2 * This file is part of gtkD.
4 * gtkD 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 * gtkD 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 gtkD; 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
55 module gtk
.TextTagTable
;
61 import tango
.io
.Stdout
; // use the tango loging?
65 private import gtkc
.gtktypes
;
67 private import gtkc
.gtk
;
70 private import glib
.Str
;
71 private import gtk
.TextTagTable
;
72 private import gtk
.TextTag
;
79 * You may wish to begin by reading the text widget
80 * conceptual overview which gives an overview of all the objects and data
81 * types related to the text widget and how they work together.
83 private import gobject
.ObjectG
;
84 public class TextTagTable
: ObjectG
87 /** the main Gtk struct */
88 protected GtkTextTagTable
* gtkTextTagTable
;
91 public GtkTextTagTable
* getTextTagTableStruct()
93 return gtkTextTagTable
;
97 /** the main Gtk struct as a void* */
98 protected void* getStruct()
100 return cast(void*)gtkTextTagTable
;
104 * Sets our main struct and passes it to the parent class
106 public this (GtkTextTagTable
* gtkTextTagTable
)
110 if ( gtkTextTagTable
is null )
115 Stdout("struct gtkTextTagTable is null on constructor").newline
;
119 printf("struct gtkTextTagTable is null on constructor");
126 assert(gtkTextTagTable
!is null, "struct gtkTextTagTable is null on constructor");
128 super(cast(GObject
*)gtkTextTagTable
);
129 this.gtkTextTagTable
= gtkTextTagTable
;
135 // imports for the signal processing
136 private import gobject
.Signals
;
137 private import gtkc
.gdktypes
;
138 int[char[]] connectedSignals
;
140 void delegate(TextTag
, TextTagTable
)[] onTagAddedListeners
;
141 void addOnTagAdded(void delegate(TextTag
, TextTagTable
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
143 if ( !("tag-added" in connectedSignals
) )
148 cast(GCallback
)&callBackTagAdded
,
152 connectedSignals
["tag-added"] = 1;
154 onTagAddedListeners
~= dlg
;
156 extern(C
) static void callBackTagAdded(GtkTextTagTable
* texttagtableStruct
, GtkTextTag
* arg1
, TextTagTable textTagTable
)
158 bool consumed
= false;
160 foreach ( void delegate(TextTag
, TextTagTable
) dlg
; textTagTable
.onTagAddedListeners
)
162 dlg(new TextTag(arg1
), textTagTable
);
168 void delegate(TextTag
, gboolean
, TextTagTable
)[] onTagChangedListeners
;
169 void addOnTagChanged(void delegate(TextTag
, gboolean
, TextTagTable
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
171 if ( !("tag-changed" in connectedSignals
) )
176 cast(GCallback
)&callBackTagChanged
,
180 connectedSignals
["tag-changed"] = 1;
182 onTagChangedListeners
~= dlg
;
184 extern(C
) static void callBackTagChanged(GtkTextTagTable
* texttagtableStruct
, GtkTextTag
* arg1
, gboolean arg2
, TextTagTable textTagTable
)
186 bool consumed
= false;
188 foreach ( void delegate(TextTag
, gboolean
, TextTagTable
) dlg
; textTagTable
.onTagChangedListeners
)
190 dlg(new TextTag(arg1
), arg2
, textTagTable
);
196 void delegate(TextTag
, TextTagTable
)[] onTagRemovedListeners
;
197 void addOnTagRemoved(void delegate(TextTag
, TextTagTable
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
199 if ( !("tag-removed" in connectedSignals
) )
204 cast(GCallback
)&callBackTagRemoved
,
208 connectedSignals
["tag-removed"] = 1;
210 onTagRemovedListeners
~= dlg
;
212 extern(C
) static void callBackTagRemoved(GtkTextTagTable
* texttagtableStruct
, GtkTextTag
* arg1
, TextTagTable textTagTable
)
214 bool consumed
= false;
216 foreach ( void delegate(TextTag
, TextTagTable
) dlg
; textTagTable
.onTagRemovedListeners
)
218 dlg(new TextTag(arg1
), textTagTable
);
228 * Creates a new GtkTextTagTable. The table contains no tags by
231 * a new GtkTextTagTable
233 public static TextTagTable
tableNew()
235 // GtkTextTagTable* gtk_text_tag_table_new (void);
236 return new TextTagTable( gtk_text_tag_table_new() );
240 * Add a tag to the table. The tag is assigned the highest priority
242 * tag must not be in a tag table already, and may not have
243 * the same name as an already-added tag.
249 public void tableAdd(TextTag tag
)
251 // void gtk_text_tag_table_add (GtkTextTagTable *table, GtkTextTag *tag);
252 gtk_text_tag_table_add(gtkTextTagTable
, (tag
is null) ?
null : tag
.getTextTagStruct());
256 * Remove a tag from the table. This will remove the table's
257 * reference to the tag, so be careful - the tag will end
258 * up destroyed if you don't have a reference to it.
264 public void tableRemove(TextTag tag
)
266 // void gtk_text_tag_table_remove (GtkTextTagTable *table, GtkTextTag *tag);
267 gtk_text_tag_table_remove(gtkTextTagTable
, (tag
is null) ?
null : tag
.getTextTagStruct());
271 * Look up a named tag.
277 * The tag, or NULL if none by that name is in the table.
279 public TextTag
tableLookup(char[] name
)
281 // GtkTextTag* gtk_text_tag_table_lookup (GtkTextTagTable *table, const gchar *name);
282 return new TextTag( gtk_text_tag_table_lookup(gtkTextTagTable
, Str
.toStringz(name
)) );
286 * Calls func on each tag in table, with user data data.
287 * Note that the table may not be modified while iterating
288 * over it (you can't add/remove tags).
292 * a function to call on each tag
296 public void tableForeach(GtkTextTagTableForeach func
, void* data
)
298 // void gtk_text_tag_table_foreach (GtkTextTagTable *table, GtkTextTagTableForeach func, gpointer data);
299 gtk_text_tag_table_foreach(gtkTextTagTable
, func
, data
);
303 * Returns the size of the table (number of tags)
307 * number of tags in table
309 * The "tag-added" signal
310 * void user_function (GtkTextTagTable *texttagtable,
312 * gpointer user_data) : Run Last
314 * the object which received the signal.
317 * user data set when the signal handler was connected.
319 public int tableGetSize()
321 // gint gtk_text_tag_table_get_size (GtkTextTagTable *table);
322 return gtk_text_tag_table_get_size(gtkTextTagTable
);