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 = 27 * outPack = gtk 28 * outFile = TextAttributes 29 * strct = GtkTextAttributes 30 * realStrct= 31 * ctorStrct= 32 * clss = TextAttributes 33 * interf = 34 * class Code: Yes 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gtk_text_attributes_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * - event 46 * imports: 47 * - gtkc.Loader 48 * - gtkc.paths 49 * structWrap: 50 * - GtkTextAttributes* -> TextAttributes 51 * module aliases: 52 * local aliases: 53 * overrides: 54 */ 55 56 module gtk.TextAttributes; 57 58 public import gtkc.gtktypes; 59 60 private import gtkc.gtk; 61 private import glib.ConstructionException; 62 private import gobject.ObjectG; 63 64 private import gobject.Signals; 65 public import gtkc.gdktypes; 66 private import gtkc.Loader; 67 private import gtkc.paths; 68 69 70 71 /** 72 * You may wish to begin by reading the text widget 73 * conceptual overview which gives an overview of all the objects and 74 * data types related to the text widget and how they work together. 75 * 76 * Tags should be in the GtkTextTagTable for a given GtkTextBuffer 77 * before using them with that buffer. 78 * 79 * gtk_text_buffer_create_tag() is the best way to create tags. 80 * See gtk3-demo for numerous examples. 81 * 82 * For each property of GtkTextTag, there is a "set" property, e.g. 83 * "font-set" corresponds to "font". These "set" properties reflect 84 * whether a property has been set or not. 85 * They are maintained by GTK+ and you should not set them independently. 86 */ 87 public class TextAttributes 88 { 89 90 /** the main Gtk struct */ 91 protected GtkTextAttributes* gtkTextAttributes; 92 93 94 /** Get the main Gtk struct */ 95 public GtkTextAttributes* getTextAttributesStruct() 96 { 97 return gtkTextAttributes; 98 } 99 100 101 /** the main Gtk struct as a void* */ 102 protected void* getStruct() 103 { 104 return cast(void*)gtkTextAttributes; 105 } 106 107 /** 108 * Sets our main struct and passes it to the parent class 109 */ 110 public this (GtkTextAttributes* gtkTextAttributes) 111 { 112 this.gtkTextAttributes = gtkTextAttributes; 113 } 114 115 ~this () 116 { 117 if ( Linker.isLoaded(LIBRARY.GTK) && gtkTextAttributes !is null ) 118 { 119 gtk_text_attributes_unref(gtkTextAttributes); 120 } 121 } 122 123 //TODO: properties ? 124 125 /** 126 */ 127 128 /** 129 * Creates a GtkTextAttributes, which describes 130 * a set of properties on some text. 131 * Throws: ConstructionException GTK+ fails to create the object. 132 */ 133 public this () 134 { 135 // GtkTextAttributes * gtk_text_attributes_new (void); 136 auto p = gtk_text_attributes_new(); 137 if(p is null) 138 { 139 throw new ConstructionException("null returned by gtk_text_attributes_new()"); 140 } 141 this(cast(GtkTextAttributes*) p); 142 } 143 144 /** 145 * Copies src and returns a new GtkTextAttributes. 146 * Returns: a copy of src, free with gtk_text_attributes_unref() 147 */ 148 public TextAttributes copy() 149 { 150 // GtkTextAttributes * gtk_text_attributes_copy (GtkTextAttributes *src); 151 auto p = gtk_text_attributes_copy(gtkTextAttributes); 152 153 if(p is null) 154 { 155 return null; 156 } 157 158 return ObjectG.getDObject!(TextAttributes)(cast(GtkTextAttributes*) p); 159 } 160 161 /** 162 * Copies the values from src to dest so that dest has 163 * the same values as src. Frees existing values in dest. 164 * Params: 165 * dest = another GtkTextAttributes 166 */ 167 public void copyValues(TextAttributes dest) 168 { 169 // void gtk_text_attributes_copy_values (GtkTextAttributes *src, GtkTextAttributes *dest); 170 gtk_text_attributes_copy_values(gtkTextAttributes, (dest is null) ? null : dest.getTextAttributesStruct()); 171 } 172 173 /** 174 * Decrements the reference count on values, freeing the structure 175 * if the reference count reaches 0. 176 */ 177 public void unref() 178 { 179 // void gtk_text_attributes_unref (GtkTextAttributes *values); 180 gtk_text_attributes_unref(gtkTextAttributes); 181 } 182 183 /** 184 * Increments the reference count on values. 185 * Returns: the GtkTextAttributes that were passed in 186 */ 187 public TextAttributes doref() 188 { 189 // GtkTextAttributes * gtk_text_attributes_ref (GtkTextAttributes *values); 190 auto p = gtk_text_attributes_ref(gtkTextAttributes); 191 192 if(p is null) 193 { 194 return null; 195 } 196 197 return ObjectG.getDObject!(TextAttributes)(cast(GtkTextAttributes*) p); 198 } 199 }