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 = GtkTextTagTable.html
27 * outFile = TextTagTable
28 * strct = GtkTextTagTable
49 * - GtkTextTag* -> TextTag
50 * - GtkTextTagTable* -> TextTagTable
54 module gtk
.TextTagTable
;
56 private import gtk
.gtktypes
;
58 private import lib
.gtk
;
60 private import glib
.Str
;
61 private import gtk
.TextTagTable
;
62 private import gtk
.TextTag
;
66 * You may wish to begin by reading the text widget
67 * conceptual overview which gives an overview of all the objects and data
68 * types related to the text widget and how they work together.
70 private import gobject
.ObjectG
;
71 public class TextTagTable
: ObjectG
74 /** the main Gtk struct */
75 protected GtkTextTagTable
* gtkTextTagTable
;
78 public GtkTextTagTable
* getTextTagTableStruct()
80 return gtkTextTagTable
;
84 /** the main Gtk struct as a void* */
85 protected void* getStruct()
87 return cast(void*)gtkTextTagTable
;
91 * Sets our main struct and passes it to the parent class
93 public this (GtkTextTagTable
* gtkTextTagTable
)
95 super(cast(GObject
*)gtkTextTagTable
);
96 this.gtkTextTagTable
= gtkTextTagTable
;
102 // imports for the signal processing
103 private import gobject
.Signals
;
104 private import gdk
.gdktypes
;
105 int[char[]] connectedSignals
;
107 void delegate(TextTag
, TextTagTable
)[] onTagAddedListeners
;
108 void addOnTagAdded(void delegate(TextTag
, TextTagTable
) dlg
)
110 if ( !("tag-added" in connectedSignals
) )
115 cast(GCallback
)&callBackTagAdded
,
118 cast(ConnectFlags
)0);
119 connectedSignals
["tag-added"] = 1;
121 onTagAddedListeners
~= dlg
;
123 extern(C
) static void callBackTagAdded(GtkTextTagTable
* texttagtableStruct
, GtkTextTag
* arg1
, TextTagTable textTagTable
)
125 bit consumed
= false;
127 foreach ( void delegate(TextTag
, TextTagTable
) dlg
; textTagTable
.onTagAddedListeners
)
129 dlg(new TextTag(arg1
), textTagTable
);
135 void delegate(TextTag
, gboolean
, TextTagTable
)[] onTagChangedListeners
;
136 void addOnTagChanged(void delegate(TextTag
, gboolean
, TextTagTable
) dlg
)
138 if ( !("tag-changed" in connectedSignals
) )
143 cast(GCallback
)&callBackTagChanged
,
146 cast(ConnectFlags
)0);
147 connectedSignals
["tag-changed"] = 1;
149 onTagChangedListeners
~= dlg
;
151 extern(C
) static void callBackTagChanged(GtkTextTagTable
* texttagtableStruct
, GtkTextTag
* arg1
, gboolean arg2
, TextTagTable textTagTable
)
153 bit consumed
= false;
155 foreach ( void delegate(TextTag
, gboolean
, TextTagTable
) dlg
; textTagTable
.onTagChangedListeners
)
157 dlg(new TextTag(arg1
), arg2
, textTagTable
);
163 void delegate(TextTag
, TextTagTable
)[] onTagRemovedListeners
;
164 void addOnTagRemoved(void delegate(TextTag
, TextTagTable
) dlg
)
166 if ( !("tag-removed" in connectedSignals
) )
171 cast(GCallback
)&callBackTagRemoved
,
174 cast(ConnectFlags
)0);
175 connectedSignals
["tag-removed"] = 1;
177 onTagRemovedListeners
~= dlg
;
179 extern(C
) static void callBackTagRemoved(GtkTextTagTable
* texttagtableStruct
, GtkTextTag
* arg1
, TextTagTable textTagTable
)
181 bit consumed
= false;
183 foreach ( void delegate(TextTag
, TextTagTable
) dlg
; textTagTable
.onTagRemovedListeners
)
185 dlg(new TextTag(arg1
), textTagTable
);
195 * Creates a new GtkTextTagTable. The table contains no tags by
198 * a new GtkTextTagTable
200 public static TextTagTable
tableNew()
202 // GtkTextTagTable* gtk_text_tag_table_new (void);
203 return new TextTagTable( gtk_text_tag_table_new() );
207 * Add a tag to the table. The tag is assigned the highest priority
209 * tag must not be in a tag table already, and may not have
210 * the same name as an already-added tag.
216 public void tableAdd(TextTag tag
)
218 // void gtk_text_tag_table_add (GtkTextTagTable *table, GtkTextTag *tag);
219 gtk_text_tag_table_add(gtkTextTagTable
, (tag
is null) ?
null : tag
.getTextTagStruct());
223 * Remove a tag from the table. This will remove the table's
224 * reference to the tag, so be careful - the tag will end
225 * up destroyed if you don't have a reference to it.
231 public void tableRemove(TextTag tag
)
233 // void gtk_text_tag_table_remove (GtkTextTagTable *table, GtkTextTag *tag);
234 gtk_text_tag_table_remove(gtkTextTagTable
, (tag
is null) ?
null : tag
.getTextTagStruct());
238 * Look up a named tag.
244 * The tag, or NULL if none by that name is in the table.
246 public TextTag
tableLookup(char[] name
)
248 // GtkTextTag* gtk_text_tag_table_lookup (GtkTextTagTable *table, const gchar *name);
249 return new TextTag( gtk_text_tag_table_lookup(gtkTextTagTable
, Str
.toStringz(name
)) );
253 * Calls func on each tag in table, with user data data.
254 * Note that the table may not be modified while iterating
255 * over it (you can't add/remove tags).
259 * a function to call on each tag
263 public void tableForeach(GtkTextTagTableForeach func
, void* data
)
265 // void gtk_text_tag_table_foreach (GtkTextTagTable *table, GtkTextTagTableForeach func, gpointer data);
266 gtk_text_tag_table_foreach(gtkTextTagTable
, func
, data
);
270 * Returns the size of the table (number of tags)
274 * number of tags in table
276 * The "tag-added" signal
277 * void user_function (GtkTextTagTable *texttagtable,
279 * gpointer user_data) : Run last
281 * the object which received the signal.
284 * user data set when the signal handler was connected.
286 public int tableGetSize()
288 // gint gtk_text_tag_table_get_size (GtkTextTagTable *table);
289 return gtk_text_tag_table_get_size(gtkTextTagTable
);