1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19  
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 /*
25  * Conversion parameters:
26  * inFile  = GtkStyleProvider.html
27  * outPack = gtk
28  * outFile = StyleProviderT
29  * strct   = GtkStyleProvider
30  * realStrct=
31  * ctorStrct=
32  * clss    = StyleProviderT
33  * interf  = StyleProviderIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * 	- TStruct
38  * extend  = 
39  * implements:
40  * prefixes:
41  * 	- gtk_style_provider_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- gobject.ParamSpec
48  * 	- gobject.Value
49  * 	- gtk.IconFactory
50  * 	- gtk.StyleProperties
51  * 	- gtk.WidgetPath
52  * structWrap:
53  * 	- GParamSpec* -> ParamSpec
54  * 	- GValue* -> Value
55  * 	- GtkIconFactory* -> IconFactory
56  * 	- GtkStyleProperties* -> StyleProperties
57  * 	- GtkWidgetPath* -> WidgetPath
58  * module aliases:
59  * local aliases:
60  * overrides:
61  */
62 
63 module gtk.StyleProviderT;
64 
65 public  import gtkc.gtktypes;
66 
67 public import gtkc.gtk;
68 public import glib.ConstructionException;
69 public import gobject.ObjectG;
70 
71 public import gobject.ParamSpec;
72 public import gobject.Value;
73 public import gtk.IconFactory;
74 public import gtk.StyleProperties;
75 public import gtk.WidgetPath;
76 
77 
78 
79 /**
80  * GtkStyleProvider is an interface used to provide style information to a GtkStyleContext.
81  * See gtk_style_context_add_provider() and gtk_style_context_add_provider_for_screen().
82  */
83 public template StyleProviderT(TStruct)
84 {
85 	
86 	/** the main Gtk struct */
87 	protected GtkStyleProvider* gtkStyleProvider;
88 	
89 	
90 	/** Get the main Gtk struct */
91 	public GtkStyleProvider* getStyleProviderTStruct()
92 	{
93 		return cast(GtkStyleProvider*)getStruct();
94 	}
95 	
96 	
97 	/**
98 	 */
99 	
100 	/**
101 	 * Warning
102 	 * gtk_style_provider_get_icon_factory has been deprecated since version 3.8 and should not be used in newly-written code. Will always return NULL for all GTK-provided style providers.
103 	 * Returns the GtkIconFactory defined to be in use for path, or NULL if none
104 	 * is defined.
105 	 * Params:
106 	 * path = GtkWidgetPath to query
107 	 * Returns: The icon factory to use for path, or NULL. [transfer none] Since 3.0
108 	 */
109 	public IconFactory getIconFactory(WidgetPath path)
110 	{
111 		// GtkIconFactory * gtk_style_provider_get_icon_factory (GtkStyleProvider *provider,  GtkWidgetPath *path);
112 		auto p = gtk_style_provider_get_icon_factory(getStyleProviderTStruct(), (path is null) ? null : path.getWidgetPathStruct());
113 		
114 		if(p is null)
115 		{
116 			return null;
117 		}
118 		
119 		return ObjectG.getDObject!(IconFactory)(cast(GtkIconFactory*) p);
120 	}
121 	
122 	/**
123 	 * Warning
124 	 * gtk_style_provider_get_style has been deprecated since version 3.8 and should not be used in newly-written code. Will always return NULL for all GTK-provided style providers
125 	 *  as the interface cannot correctly work the way CSS is specified.
126 	 * Returns the style settings affecting a widget defined by path, or NULL if
127 	 * provider doesn't contemplate styling path.
128 	 * Params:
129 	 * path = GtkWidgetPath to query
130 	 * Returns: a GtkStyleProperties containing the style settings affecting path. [transfer full] Since 3.0
131 	 */
132 	public StyleProperties getStyle(WidgetPath path)
133 	{
134 		// GtkStyleProperties * gtk_style_provider_get_style (GtkStyleProvider *provider,  GtkWidgetPath *path);
135 		auto p = gtk_style_provider_get_style(getStyleProviderTStruct(), (path is null) ? null : path.getWidgetPathStruct());
136 		
137 		if(p is null)
138 		{
139 			return null;
140 		}
141 		
142 		return ObjectG.getDObject!(StyleProperties)(cast(GtkStyleProperties*) p);
143 	}
144 	
145 	/**
146 	 * Looks up a widget style property as defined by provider for
147 	 * the widget represented by path.
148 	 * Params:
149 	 * path = GtkWidgetPath to query
150 	 * state = state to query the style property for
151 	 * pspec = The GParamSpec to query
152 	 * value = return location for the property value. [out]
153 	 * Returns: TRUE if the property was found and has a value, FALSE otherwise Since 3.0
154 	 */
155 	public int getStyleProperty(WidgetPath path, GtkStateFlags state, ParamSpec pspec, Value value)
156 	{
157 		// gboolean gtk_style_provider_get_style_property  (GtkStyleProvider *provider,  GtkWidgetPath *path,  GtkStateFlags state,  GParamSpec *pspec,  GValue *value);
158 		return gtk_style_provider_get_style_property(getStyleProviderTStruct(), (path is null) ? null : path.getWidgetPathStruct(), state, (pspec is null) ? null : pspec.getParamSpecStruct(), (value is null) ? null : value.getValueStruct());
159 	}
160 }