alternative to assert
[gtkD.git] / src / gtk / TextAttributes.d
blob6c8beb6f5d350897b45a4b9f7dac2ccadb09538f
1 /*
2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile =
26 * outPack = gtk
27 * outFile = TextAttributes
28 * strct = GtkTextAttributes
29 * realStrct=
30 * ctorStrct=
31 * clss = TextAttributes
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_text_attributes_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - gtk.TextAttributes
45 * structWrap:
46 * - GtkTextAttributes* -> TextAttributes
47 * local aliases:
50 module gtk.TextAttributes;
52 private import gtk.gtktypes;
54 private import lib.gtk;
56 private import gtk.TextAttributes;
58 /**
59 * Description
60 * You may wish to begin by reading the text widget
61 * conceptual overview which gives an overview of all the objects and data
62 * types related to the text widget and how they work together.
63 * Tags should be in the GtkTextTagTable for a given GtkTextBuffer
64 * before using them with that buffer.
65 * gtk_text_buffer_create_tag() is the best way to create tags.
66 * See gtk-demo for numerous examples.
67 * The "invisible" property was not implemented for GTK+ 2.0; it's
68 * planned to be implemented in future releases.
70 public class TextAttributes
73 /** the main Gtk struct */
74 protected GtkTextAttributes* gtkTextAttributes;
77 public GtkTextAttributes* getTextAttributesStruct()
79 return gtkTextAttributes;
83 /** the main Gtk struct as a void* */
84 protected void* getStruct()
86 return cast(void*)gtkTextAttributes;
89 /**
90 * Sets our main struct and passes it to the parent class
92 public this (GtkTextAttributes* gtkTextAttributes)
94 this.gtkTextAttributes = gtkTextAttributes;
97 /**
100 // imports for the signal processing
101 private import gobject.Signals;
102 private import gdk.gdktypes;
103 int[char[]] connectedSignals;
105 gboolean delegate(GObject*, GdkEvent*, GtkTextIter*, TextAttributes)[] onListeners;
106 void addOn(gboolean delegate(GObject*, GdkEvent*, GtkTextIter*, TextAttributes) dlg)
108 if ( !("event" in connectedSignals) )
110 Signals.connectData(
111 getStruct(),
112 "event",
113 cast(GCallback)&callBack,
114 this,
115 null,
116 cast(ConnectFlags)0);
117 connectedSignals["event"] = 1;
119 onListeners ~= dlg;
121 extern(C) static void callBack(GtkTextTag* texttagStruct, GObject* arg1, GdkEvent* event, GtkTextIter* arg2, TextAttributes textAttributes)
123 bit consumed = false;
125 foreach ( gboolean delegate(GObject*, GdkEvent*, GtkTextIter*, TextAttributes) dlg ; textAttributes.onListeners )
127 dlg(arg1, event, arg2, textAttributes);
130 return consumed;
143 * Creates a GtkTextAttributes, which describes
144 * a set of properties on some text.
145 * Returns:
146 * a new GtkTextAttributes
148 public this ()
150 // GtkTextAttributes* gtk_text_attributes_new (void);
151 this(cast(GtkTextAttributes*)gtk_text_attributes_new() );
155 * Copies src and returns a new GtkTextAttributes.
156 * src:
157 * a GtkTextAttributes to be copied
158 * Returns:
159 * a copy of src
161 public TextAttributes copy()
163 // GtkTextAttributes* gtk_text_attributes_copy (GtkTextAttributes *src);
164 return new TextAttributes( gtk_text_attributes_copy(gtkTextAttributes) );
168 * Copies the values from src to dest so that dest has the same values
169 * as src. Frees existing values in dest.
170 * src:
171 * a GtkTextAttributes
172 * dest:
173 * another GtkTextAttributes
175 public void copyValues(TextAttributes dest)
177 // void gtk_text_attributes_copy_values (GtkTextAttributes *src, GtkTextAttributes *dest);
178 gtk_text_attributes_copy_values(gtkTextAttributes, (dest is null) ? null : dest.getTextAttributesStruct());
182 * Decrements the reference count on values, freeing the structure
183 * if the reference count reaches 0.
184 * values:
185 * a GtkTextAttributes
187 public void unref()
189 // void gtk_text_attributes_unref (GtkTextAttributes *values);
190 gtk_text_attributes_unref(gtkTextAttributes);
194 * Increments the reference count on values.
195 * values:
196 * a GtkTextAttributes
197 * Returns:
198 * the GtkTextAttributes that were passed in
199 * Property Details
200 * The "background" property
201 * "background" gchararray : Write
202 * Background color as a string.
203 * Default value: NULL
205 public TextAttributes ref()
207 // GtkTextAttributes* gtk_text_attributes_ref (GtkTextAttributes *values);
208 return new TextAttributes( gtk_text_attributes_ref(gtkTextAttributes) );