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 72 public import gobject.ParamSpec; 73 public import gobject.Value; 74 public import gtk.IconFactory; 75 public import gtk.StyleProperties; 76 public import gtk.WidgetPath; 77 78 79 80 81 /** 82 * GtkStyleProvider is an interface used to provide style information to a GtkStyleContext. 83 * See gtk_style_context_add_provider() and gtk_style_context_add_provider_for_screen(). 84 */ 85 public template StyleProviderT(TStruct) 86 { 87 88 /** the main Gtk struct */ 89 protected GtkStyleProvider* gtkStyleProvider; 90 91 92 public GtkStyleProvider* getStyleProviderTStruct() 93 { 94 return cast(GtkStyleProvider*)getStruct(); 95 } 96 97 98 /** 99 */ 100 101 /** 102 * Warning 103 * 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. 104 * Returns the GtkIconFactory defined to be in use for path, or NULL if none 105 * is defined. 106 * Params: 107 * path = GtkWidgetPath to query 108 * Returns: The icon factory to use for path, or NULL. [transfer none] Since 3.0 109 */ 110 public IconFactory getIconFactory(WidgetPath path) 111 { 112 // GtkIconFactory * gtk_style_provider_get_icon_factory (GtkStyleProvider *provider, GtkWidgetPath *path); 113 auto p = gtk_style_provider_get_icon_factory(getStyleProviderTStruct(), (path is null) ? null : path.getWidgetPathStruct()); 114 115 if(p is null) 116 { 117 return null; 118 } 119 120 return ObjectG.getDObject!(IconFactory)(cast(GtkIconFactory*) p); 121 } 122 123 /** 124 * Warning 125 * 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 126 * as the interface cannot correctly work the way CSS is specified. 127 * Returns the style settings affecting a widget defined by path, or NULL if 128 * provider doesn't contemplate styling path. 129 * Params: 130 * path = GtkWidgetPath to query 131 * Returns: a GtkStyleProperties containing the style settings affecting path. [transfer full] Since 3.0 132 */ 133 public StyleProperties getStyle(WidgetPath path) 134 { 135 // GtkStyleProperties * gtk_style_provider_get_style (GtkStyleProvider *provider, GtkWidgetPath *path); 136 auto p = gtk_style_provider_get_style(getStyleProviderTStruct(), (path is null) ? null : path.getWidgetPathStruct()); 137 138 if(p is null) 139 { 140 return null; 141 } 142 143 return ObjectG.getDObject!(StyleProperties)(cast(GtkStyleProperties*) p); 144 } 145 146 /** 147 * Looks up a widget style property as defined by provider for 148 * the widget represented by path. 149 * Params: 150 * path = GtkWidgetPath to query 151 * state = state to query the style property for 152 * pspec = The GParamSpec to query 153 * value = return location for the property value. [out] 154 * Returns: TRUE if the property was found and has a value, FALSE otherwise Since 3.0 155 */ 156 public int getStyleProperty(WidgetPath path, GtkStateFlags state, ParamSpec pspec, Value value) 157 { 158 // gboolean gtk_style_provider_get_style_property (GtkStyleProvider *provider, GtkWidgetPath *path, GtkStateFlags state, GParamSpec *pspec, GValue *value); 159 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()); 160 } 161 }