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 = GtkSourceStyleSchemeManager.html 27 * outPack = gsv 28 * outFile = SourceStyleSchemeManager 29 * strct = GtkSourceStyleSchemeManager 30 * realStrct= 31 * ctorStrct= 32 * clss = SourceStyleSchemeManager 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gtk_source_style_scheme_manager_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - glib.Str 47 * - gsv.SourceStyleScheme 48 * structWrap: 49 * - GtkSourceStyleScheme* -> SourceStyleScheme 50 * - GtkSourceStyleSchemeManager* -> SourceStyleSchemeManager 51 * module aliases: 52 * local aliases: 53 * overrides: 54 */ 55 56 module gsv.SourceStyleSchemeManager; 57 58 public import gsvc.gsvtypes; 59 60 private import gsvc.gsv; 61 private import glib.ConstructionException; 62 private import gobject.ObjectG; 63 64 private import glib.Str; 65 private import gsv.SourceStyleScheme; 66 67 68 private import gobject.ObjectG; 69 70 /** 71 * Object which provides access to GtkSourceStyleSchemes. 72 */ 73 public class SourceStyleSchemeManager : ObjectG 74 { 75 76 /** the main Gtk struct */ 77 protected GtkSourceStyleSchemeManager* gtkSourceStyleSchemeManager; 78 79 80 /** Get the main Gtk struct */ 81 public GtkSourceStyleSchemeManager* getSourceStyleSchemeManagerStruct() 82 { 83 return gtkSourceStyleSchemeManager; 84 } 85 86 87 /** the main Gtk struct as a void* */ 88 protected override void* getStruct() 89 { 90 return cast(void*)gtkSourceStyleSchemeManager; 91 } 92 93 /** 94 * Sets our main struct and passes it to the parent class 95 */ 96 public this (GtkSourceStyleSchemeManager* gtkSourceStyleSchemeManager) 97 { 98 super(cast(GObject*)gtkSourceStyleSchemeManager); 99 this.gtkSourceStyleSchemeManager = gtkSourceStyleSchemeManager; 100 } 101 102 protected override void setStruct(GObject* obj) 103 { 104 super.setStruct(obj); 105 gtkSourceStyleSchemeManager = cast(GtkSourceStyleSchemeManager*)obj; 106 } 107 108 /** 109 */ 110 111 /** 112 * Creates a new style manager. If you do not need more than one style 113 * manager then use gtk_source_style_scheme_manager_get_default() instead. 114 * Throws: ConstructionException GTK+ fails to create the object. 115 */ 116 public this () 117 { 118 // GtkSourceStyleSchemeManager * gtk_source_style_scheme_manager_new (void); 119 auto p = gtk_source_style_scheme_manager_new(); 120 if(p is null) 121 { 122 throw new ConstructionException("null returned by gtk_source_style_scheme_manager_new()"); 123 } 124 this(cast(GtkSourceStyleSchemeManager*) p); 125 } 126 127 /** 128 * Returns the default GtkSourceStyleSchemeManager instance. 129 * Returns: a GtkSourceStyleSchemeManager. Return value is owned by GtkSourceView library and must not be unref'ed. [transfer none] 130 */ 131 public static SourceStyleSchemeManager getDefault() 132 { 133 // GtkSourceStyleSchemeManager * gtk_source_style_scheme_manager_get_default (void); 134 auto p = gtk_source_style_scheme_manager_get_default(); 135 136 if(p is null) 137 { 138 return null; 139 } 140 141 return ObjectG.getDObject!(SourceStyleSchemeManager)(cast(GtkSourceStyleSchemeManager*) p); 142 } 143 144 /** 145 * Sets the list of directories where the manager looks for 146 * style scheme files. 147 * If path is NULL, the search path is reset to default. 148 * Params: 149 * path = a NULL-terminated array of strings or NULL. [array zero-terminated=1][allow-none] 150 */ 151 public void setSearchPath(string[] path) 152 { 153 // void gtk_source_style_scheme_manager_set_search_path (GtkSourceStyleSchemeManager *manager, gchar **path); 154 gtk_source_style_scheme_manager_set_search_path(gtkSourceStyleSchemeManager, Str.toStringzArray(path)); 155 } 156 157 /** 158 * Appends path to the list of directories where the manager looks for 159 * style scheme files. 160 * See gtk_source_style_scheme_manager_set_search_path() for details. 161 * Params: 162 * path = a directory or a filename. 163 */ 164 public void appendSearchPath(string path) 165 { 166 // void gtk_source_style_scheme_manager_append_search_path (GtkSourceStyleSchemeManager *manager, const gchar *path); 167 gtk_source_style_scheme_manager_append_search_path(gtkSourceStyleSchemeManager, Str.toStringz(path)); 168 } 169 170 /** 171 * Prepends path to the list of directories where the manager looks 172 * for style scheme files. 173 * See gtk_source_style_scheme_manager_set_search_path() for details. 174 * Params: 175 * path = a directory or a filename. 176 */ 177 public void prependSearchPath(string path) 178 { 179 // void gtk_source_style_scheme_manager_prepend_search_path (GtkSourceStyleSchemeManager *manager, const gchar *path); 180 gtk_source_style_scheme_manager_prepend_search_path(gtkSourceStyleSchemeManager, Str.toStringz(path)); 181 } 182 183 /** 184 * Returns the current search path for the manager. 185 * See gtk_source_style_scheme_manager_set_search_path() for details. 186 * Returns: a NULL-terminated array of string containing the search path. The array is owned by the manager and must not be modified. [array zero-terminated=1][transfer none] 187 */ 188 public string[] getSearchPath() 189 { 190 // const gchar * const * gtk_source_style_scheme_manager_get_search_path (GtkSourceStyleSchemeManager *manager); 191 return Str.toStringArray(gtk_source_style_scheme_manager_get_search_path(gtkSourceStyleSchemeManager)); 192 } 193 194 /** 195 * Returns the ids of the available style schemes. 196 * Returns: a NULL-terminated array of string containing the ids of the available style schemes or NULL if no style scheme is available. The array is sorted alphabetically according to the scheme name. The array is owned by the manager and must not be modified. [array zero-terminated=1][transfer none] 197 */ 198 public string[] getSchemeIds() 199 { 200 // const gchar * const * gtk_source_style_scheme_manager_get_scheme_ids (GtkSourceStyleSchemeManager *manager); 201 return Str.toStringArray(gtk_source_style_scheme_manager_get_scheme_ids(gtkSourceStyleSchemeManager)); 202 } 203 204 /** 205 * Looks up style scheme by id. 206 * Params: 207 * schemeId = style scheme id to find. 208 * Returns: a GtkSourceStyleScheme object. Returned value is owned by manager and must not be unref'ed. [transfer none] 209 */ 210 public SourceStyleScheme getScheme(string schemeId) 211 { 212 // GtkSourceStyleScheme * gtk_source_style_scheme_manager_get_scheme (GtkSourceStyleSchemeManager *manager, const gchar *scheme_id); 213 auto p = gtk_source_style_scheme_manager_get_scheme(gtkSourceStyleSchemeManager, Str.toStringz(schemeId)); 214 215 if(p is null) 216 { 217 return null; 218 } 219 220 return ObjectG.getDObject!(SourceStyleScheme)(cast(GtkSourceStyleScheme*) p); 221 } 222 223 /** 224 * Mark any currently cached information about the available style scehems 225 * as invalid. All the available style schemes will be reloaded next time 226 * the manager is accessed. 227 */ 228 public void forceRescan() 229 { 230 // void gtk_source_style_scheme_manager_force_rescan (GtkSourceStyleSchemeManager *manager); 231 gtk_source_style_scheme_manager_force_rescan(gtkSourceStyleSchemeManager); 232 } 233 }