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 = GtkTextTag.html
43 * - gtk_text_attributes_
51 * - GObject* -> ObjectG
52 * - GdkEvent* -> Event
53 * - GtkTextIter* -> TextIter
64 import tango
.io
.Stdout
; // use the tango loging?
68 private import gtkc
.gtktypes
;
70 private import gtkc
.gtk
;
73 private import glib
.Str
;
74 private import gobject
.ObjectG
;
75 private import gdk
.Event
;
76 private import gtk
.TextIter
;
83 * You may wish to begin by reading the text widget
84 * conceptual overview which gives an overview of all the objects and data
85 * types related to the text widget and how they work together.
86 * Tags should be in the GtkTextTagTable for a given GtkTextBuffer
87 * before using them with that buffer.
88 * gtk_text_buffer_create_tag() is the best way to create tags.
89 * See gtk-demo for numerous examples.
90 * The "invisible" property was not implemented for GTK+ 2.0; it's
91 * planned to be implemented in future releases.
93 private import gobject
.ObjectG
;
94 public class TextTag
: ObjectG
97 /** the main Gtk struct */
98 protected GtkTextTag
* gtkTextTag
;
101 public GtkTextTag
* getTextTagStruct()
107 /** the main Gtk struct as a void* */
108 protected void* getStruct()
110 return cast(void*)gtkTextTag
;
114 * Sets our main struct and passes it to the parent class
116 public this (GtkTextTag
* gtkTextTag
)
120 if ( gtkTextTag
is null )
125 Stdout("struct gtkTextTag is null on constructor").newline
;
129 printf("struct gtkTextTag is null on constructor");
136 assert(gtkTextTag
!is null, "struct gtkTextTag is null on constructor");
138 super(cast(GObject
*)gtkTextTag
);
139 this.gtkTextTag
= gtkTextTag
;
145 // imports for the signal processing
146 private import gobject
.Signals
;
147 private import gtkc
.gdktypes
;
148 int[char[]] connectedSignals
;
150 gboolean
delegate(ObjectG
, Event
, TextIter
, TextTag
)[] onListeners
;
151 void addOn(gboolean
delegate(ObjectG
, Event
, TextIter
, TextTag
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
153 if ( !("event" in connectedSignals
) )
158 cast(GCallback
)&callBack
,
162 connectedSignals
["event"] = 1;
166 extern(C
) static void callBack(GtkTextTag
* texttagStruct
, GObject
* arg1
, GdkEvent
* event
, GtkTextIter
* arg2
, TextTag textTag
)
168 bool consumed
= false;
170 foreach ( gboolean
delegate(ObjectG
, Event
, TextIter
, TextTag
) dlg
; textTag
.onListeners
)
172 dlg(new ObjectG(arg1
), new Event(event
), new TextIter(arg2
), textTag
);
183 * Creates a GtkTextTag. Configure the tag using object arguments,
184 * i.e. using g_object_set().
190 public this (char[] name
)
192 // GtkTextTag* gtk_text_tag_new (const gchar *name);
193 this(cast(GtkTextTag
*)gtk_text_tag_new(Str
.toStringz(name
)) );
197 * Get the tag priority.
201 * The tag's priority.
203 public int getPriority()
205 // gint gtk_text_tag_get_priority (GtkTextTag *tag);
206 return gtk_text_tag_get_priority(gtkTextTag
);
210 * Sets the priority of a GtkTextTag. Valid priorities are
211 * start at 0 and go to one less than gtk_text_tag_table_get_size().
212 * Each tag in a table has a unique priority; setting the priority
213 * of one tag shifts the priorities of all the other tags in the
214 * table to maintain a unique priority for each tag. Higher priority
215 * tags "win" if two tags both set the same text attribute. When adding
216 * a tag to a tag table, it will be assigned the highest priority in
217 * the table by default; so normally the precedence of a set of tags
218 * is the order in which they were added to the table, or created with
219 * gtk_text_buffer_create_tag(), which adds the tag to the buffer's table
226 public void setPriority(int priority
)
228 // void gtk_text_tag_set_priority (GtkTextTag *tag, gint priority);
229 gtk_text_tag_set_priority(gtkTextTag
, priority
);
233 * Emits the "event" signal on the GtkTextTag.
237 * object that received the event, such as a widget
241 * location where the event was received
243 * result of signal emission (whether the event was handled)
245 public int event(ObjectG eventObject
, Event event
, TextIter iter
)
247 // gboolean gtk_text_tag_event (GtkTextTag *tag, GObject *event_object, GdkEvent *event, const GtkTextIter *iter);
248 return gtk_text_tag_event(gtkTextTag
, (eventObject
is null) ?
null : eventObject
.getObjectGStruct(), (event
is null) ?
null : event
.getEventStruct(), (iter
is null) ?
null : iter
.getTextIterStruct());