alternative to assert
[gtkD.git] / src / gtk / TextChildAnchor.d
blobb5b1138ff469fd1dc6c2e12f360071f89b17f9e6
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 = TextChildAnchor
28 * strct = GtkTextChildAnchor
29 * realStrct=
30 * ctorStrct=
31 * clss = TextChildAnchor
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_text_child_anchor_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - glib.Str
45 * structWrap:
46 * local aliases:
49 module gtk.TextChildAnchor;
51 private import gtk.gtktypes;
53 private import lib.gtk;
55 private import glib.Str;
57 /**
58 * Description
59 * You may wish to begin by reading the text widget
60 * conceptual overview which gives an overview of all the objects and data
61 * types related to the text widget and how they work together.
63 public class TextChildAnchor
66 /** the main Gtk struct */
67 protected GtkTextChildAnchor* gtkTextChildAnchor;
70 public GtkTextChildAnchor* getTextChildAnchorStruct()
72 return gtkTextChildAnchor;
76 /** the main Gtk struct as a void* */
77 protected void* getStruct()
79 return cast(void*)gtkTextChildAnchor;
82 /**
83 * Sets our main struct and passes it to the parent class
85 public this (GtkTextChildAnchor* gtkTextChildAnchor)
87 this.gtkTextChildAnchor = gtkTextChildAnchor;
90 /**
93 // imports for the signal processing
94 private import gobject.Signals;
95 private import gdk.gdktypes;
96 int[char[]] connectedSignals;
98 void delegate(TextChildAnchor)[] onBackspaceListeners;
99 void addOnBackspace(void delegate(TextChildAnchor) dlg)
101 if ( !("backspace" in connectedSignals) )
103 Signals.connectData(
104 getStruct(),
105 "backspace",
106 cast(GCallback)&callBackBackspace,
107 this,
108 null,
109 cast(ConnectFlags)0);
110 connectedSignals["backspace"] = 1;
112 onBackspaceListeners ~= dlg;
114 extern(C) static void callBackBackspace(GtkTextView* textviewStruct, TextChildAnchor textChildAnchor)
116 bit consumed = false;
118 foreach ( void delegate(TextChildAnchor) dlg ; textChildAnchor.onBackspaceListeners )
120 dlg(textChildAnchor);
123 return consumed;
126 void delegate(TextChildAnchor)[] onCopyClipboardListeners;
127 void addOnCopyClipboard(void delegate(TextChildAnchor) dlg)
129 if ( !("copy-clipboard" in connectedSignals) )
131 Signals.connectData(
132 getStruct(),
133 "copy-clipboard",
134 cast(GCallback)&callBackCopyClipboard,
135 this,
136 null,
137 cast(ConnectFlags)0);
138 connectedSignals["copy-clipboard"] = 1;
140 onCopyClipboardListeners ~= dlg;
142 extern(C) static void callBackCopyClipboard(GtkTextView* textviewStruct, TextChildAnchor textChildAnchor)
144 bit consumed = false;
146 foreach ( void delegate(TextChildAnchor) dlg ; textChildAnchor.onCopyClipboardListeners )
148 dlg(textChildAnchor);
151 return consumed;
154 void delegate(TextChildAnchor)[] onCutClipboardListeners;
155 void addOnCutClipboard(void delegate(TextChildAnchor) dlg)
157 if ( !("cut-clipboard" in connectedSignals) )
159 Signals.connectData(
160 getStruct(),
161 "cut-clipboard",
162 cast(GCallback)&callBackCutClipboard,
163 this,
164 null,
165 cast(ConnectFlags)0);
166 connectedSignals["cut-clipboard"] = 1;
168 onCutClipboardListeners ~= dlg;
170 extern(C) static void callBackCutClipboard(GtkTextView* textviewStruct, TextChildAnchor textChildAnchor)
172 bit consumed = false;
174 foreach ( void delegate(TextChildAnchor) dlg ; textChildAnchor.onCutClipboardListeners )
176 dlg(textChildAnchor);
179 return consumed;
182 void delegate(GtkDeleteType, gint, TextChildAnchor)[] onDeleteFromCursorListeners;
183 void addOnDeleteFromCursor(void delegate(GtkDeleteType, gint, TextChildAnchor) dlg)
185 if ( !("delete-from-cursor" in connectedSignals) )
187 Signals.connectData(
188 getStruct(),
189 "delete-from-cursor",
190 cast(GCallback)&callBackDeleteFromCursor,
191 this,
192 null,
193 cast(ConnectFlags)0);
194 connectedSignals["delete-from-cursor"] = 1;
196 onDeleteFromCursorListeners ~= dlg;
198 extern(C) static void callBackDeleteFromCursor(GtkTextView* textviewStruct, GtkDeleteType arg1, gint arg2, TextChildAnchor textChildAnchor)
200 bit consumed = false;
202 foreach ( void delegate(GtkDeleteType, gint, TextChildAnchor) dlg ; textChildAnchor.onDeleteFromCursorListeners )
204 dlg(arg1, arg2, textChildAnchor);
207 return consumed;
210 void delegate(char[], TextChildAnchor)[] onInsertAtCursorListeners;
211 void addOnInsertAtCursor(void delegate(char[], TextChildAnchor) dlg)
213 if ( !("insert-at-cursor" in connectedSignals) )
215 Signals.connectData(
216 getStruct(),
217 "insert-at-cursor",
218 cast(GCallback)&callBackInsertAtCursor,
219 this,
220 null,
221 cast(ConnectFlags)0);
222 connectedSignals["insert-at-cursor"] = 1;
224 onInsertAtCursorListeners ~= dlg;
226 extern(C) static void callBackInsertAtCursor(GtkTextView* textviewStruct, gchar* arg1, TextChildAnchor textChildAnchor)
228 bit consumed = false;
230 foreach ( void delegate(char[], TextChildAnchor) dlg ; textChildAnchor.onInsertAtCursorListeners )
232 dlg(Str.toString(arg1), textChildAnchor);
235 return consumed;
238 void delegate(GtkMovementStep, gint, gboolean, TextChildAnchor)[] onMoveCursorListeners;
239 void addOnMoveCursor(void delegate(GtkMovementStep, gint, gboolean, TextChildAnchor) dlg)
241 if ( !("move-cursor" in connectedSignals) )
243 Signals.connectData(
244 getStruct(),
245 "move-cursor",
246 cast(GCallback)&callBackMoveCursor,
247 this,
248 null,
249 cast(ConnectFlags)0);
250 connectedSignals["move-cursor"] = 1;
252 onMoveCursorListeners ~= dlg;
254 extern(C) static void callBackMoveCursor(GtkTextView* widgetStruct, GtkMovementStep step, gint count, gboolean extendSelection, TextChildAnchor textChildAnchor)
256 bit consumed = false;
258 foreach ( void delegate(GtkMovementStep, gint, gboolean, TextChildAnchor) dlg ; textChildAnchor.onMoveCursorListeners )
260 dlg(step, count, extendSelection, textChildAnchor);
263 return consumed;
266 void delegate(GtkDirectionType, TextChildAnchor)[] onMoveFocusListeners;
267 void addOnMoveFocus(void delegate(GtkDirectionType, TextChildAnchor) dlg)
269 if ( !("move-focus" in connectedSignals) )
271 Signals.connectData(
272 getStruct(),
273 "move-focus",
274 cast(GCallback)&callBackMoveFocus,
275 this,
276 null,
277 cast(ConnectFlags)0);
278 connectedSignals["move-focus"] = 1;
280 onMoveFocusListeners ~= dlg;
282 extern(C) static void callBackMoveFocus(GtkTextView* textviewStruct, GtkDirectionType arg1, TextChildAnchor textChildAnchor)
284 bit consumed = false;
286 foreach ( void delegate(GtkDirectionType, TextChildAnchor) dlg ; textChildAnchor.onMoveFocusListeners )
288 dlg(arg1, textChildAnchor);
291 return consumed;
294 void delegate(GtkScrollStep, gint, TextChildAnchor)[] onMoveViewportListeners;
295 void addOnMoveViewport(void delegate(GtkScrollStep, gint, TextChildAnchor) dlg)
297 if ( !("move-viewport" in connectedSignals) )
299 Signals.connectData(
300 getStruct(),
301 "move-viewport",
302 cast(GCallback)&callBackMoveViewport,
303 this,
304 null,
305 cast(ConnectFlags)0);
306 connectedSignals["move-viewport"] = 1;
308 onMoveViewportListeners ~= dlg;
310 extern(C) static void callBackMoveViewport(GtkTextView* textviewStruct, GtkScrollStep arg1, gint arg2, TextChildAnchor textChildAnchor)
312 bit consumed = false;
314 foreach ( void delegate(GtkScrollStep, gint, TextChildAnchor) dlg ; textChildAnchor.onMoveViewportListeners )
316 dlg(arg1, arg2, textChildAnchor);
319 return consumed;
322 void delegate(gint, gboolean, TextChildAnchor)[] onPageHorizontallyListeners;
323 void addOnPageHorizontally(void delegate(gint, gboolean, TextChildAnchor) dlg)
325 if ( !("page-horizontally" in connectedSignals) )
327 Signals.connectData(
328 getStruct(),
329 "page-horizontally",
330 cast(GCallback)&callBackPageHorizontally,
331 this,
332 null,
333 cast(ConnectFlags)0);
334 connectedSignals["page-horizontally"] = 1;
336 onPageHorizontallyListeners ~= dlg;
338 extern(C) static void callBackPageHorizontally(GtkTextView* textviewStruct, gint arg1, gboolean arg2, TextChildAnchor textChildAnchor)
340 bit consumed = false;
342 foreach ( void delegate(gint, gboolean, TextChildAnchor) dlg ; textChildAnchor.onPageHorizontallyListeners )
344 dlg(arg1, arg2, textChildAnchor);
347 return consumed;
350 void delegate(TextChildAnchor)[] onPasteClipboardListeners;
351 void addOnPasteClipboard(void delegate(TextChildAnchor) dlg)
353 if ( !("paste-clipboard" in connectedSignals) )
355 Signals.connectData(
356 getStruct(),
357 "paste-clipboard",
358 cast(GCallback)&callBackPasteClipboard,
359 this,
360 null,
361 cast(ConnectFlags)0);
362 connectedSignals["paste-clipboard"] = 1;
364 onPasteClipboardListeners ~= dlg;
366 extern(C) static void callBackPasteClipboard(GtkTextView* textviewStruct, TextChildAnchor textChildAnchor)
368 bit consumed = false;
370 foreach ( void delegate(TextChildAnchor) dlg ; textChildAnchor.onPasteClipboardListeners )
372 dlg(textChildAnchor);
375 return consumed;
378 void delegate(GtkMenu*, TextChildAnchor)[] onPopulatePopupListeners;
379 void addOnPopulatePopup(void delegate(GtkMenu*, TextChildAnchor) dlg)
381 if ( !("populate-popup" in connectedSignals) )
383 Signals.connectData(
384 getStruct(),
385 "populate-popup",
386 cast(GCallback)&callBackPopulatePopup,
387 this,
388 null,
389 cast(ConnectFlags)0);
390 connectedSignals["populate-popup"] = 1;
392 onPopulatePopupListeners ~= dlg;
394 extern(C) static void callBackPopulatePopup(GtkTextView* textviewStruct, GtkMenu* arg1, TextChildAnchor textChildAnchor)
396 bit consumed = false;
398 foreach ( void delegate(GtkMenu*, TextChildAnchor) dlg ; textChildAnchor.onPopulatePopupListeners )
400 dlg(arg1, textChildAnchor);
403 return consumed;
406 void delegate(gboolean, TextChildAnchor)[] onSelectAllListeners;
407 void addOnSelectAll(void delegate(gboolean, TextChildAnchor) dlg)
409 if ( !("select-all" in connectedSignals) )
411 Signals.connectData(
412 getStruct(),
413 "select-all",
414 cast(GCallback)&callBackSelectAll,
415 this,
416 null,
417 cast(ConnectFlags)0);
418 connectedSignals["select-all"] = 1;
420 onSelectAllListeners ~= dlg;
422 extern(C) static void callBackSelectAll(GtkTextView* textviewStruct, gboolean arg1, TextChildAnchor textChildAnchor)
424 bit consumed = false;
426 foreach ( void delegate(gboolean, TextChildAnchor) dlg ; textChildAnchor.onSelectAllListeners )
428 dlg(arg1, textChildAnchor);
431 return consumed;
434 void delegate(TextChildAnchor)[] onSetAnchorListeners;
435 void addOnSetAnchor(void delegate(TextChildAnchor) dlg)
437 if ( !("set-anchor" in connectedSignals) )
439 Signals.connectData(
440 getStruct(),
441 "set-anchor",
442 cast(GCallback)&callBackSetAnchor,
443 this,
444 null,
445 cast(ConnectFlags)0);
446 connectedSignals["set-anchor"] = 1;
448 onSetAnchorListeners ~= dlg;
450 extern(C) static void callBackSetAnchor(GtkTextView* textviewStruct, TextChildAnchor textChildAnchor)
452 bit consumed = false;
454 foreach ( void delegate(TextChildAnchor) dlg ; textChildAnchor.onSetAnchorListeners )
456 dlg(textChildAnchor);
459 return consumed;
462 void delegate(GtkAdjustment*, GtkAdjustment*, TextChildAnchor)[] onSetScrollAdjustmentsListeners;
463 void addOnSetScrollAdjustments(void delegate(GtkAdjustment*, GtkAdjustment*, TextChildAnchor) dlg)
465 if ( !("set-scroll-adjustments" in connectedSignals) )
467 Signals.connectData(
468 getStruct(),
469 "set-scroll-adjustments",
470 cast(GCallback)&callBackSetScrollAdjustments,
471 this,
472 null,
473 cast(ConnectFlags)0);
474 connectedSignals["set-scroll-adjustments"] = 1;
476 onSetScrollAdjustmentsListeners ~= dlg;
478 extern(C) static void callBackSetScrollAdjustments(GtkTextView* textviewStruct, GtkAdjustment* arg1, GtkAdjustment* arg2, TextChildAnchor textChildAnchor)
480 bit consumed = false;
482 foreach ( void delegate(GtkAdjustment*, GtkAdjustment*, TextChildAnchor) dlg ; textChildAnchor.onSetScrollAdjustmentsListeners )
484 dlg(arg1, arg2, textChildAnchor);
487 return consumed;
490 void delegate(TextChildAnchor)[] onToggleOverwriteListeners;
491 void addOnToggleOverwrite(void delegate(TextChildAnchor) dlg)
493 if ( !("toggle-overwrite" in connectedSignals) )
495 Signals.connectData(
496 getStruct(),
497 "toggle-overwrite",
498 cast(GCallback)&callBackToggleOverwrite,
499 this,
500 null,
501 cast(ConnectFlags)0);
502 connectedSignals["toggle-overwrite"] = 1;
504 onToggleOverwriteListeners ~= dlg;
506 extern(C) static void callBackToggleOverwrite(GtkTextView* textviewStruct, TextChildAnchor textChildAnchor)
508 bit consumed = false;
510 foreach ( void delegate(TextChildAnchor) dlg ; textChildAnchor.onToggleOverwriteListeners )
512 dlg(textChildAnchor);
515 return consumed;
551 * Creates a new GtkTextChildAnchor. Usually you would then insert
552 * it into a GtkTextBuffer with gtk_text_buffer_insert_child_anchor().
553 * To perform the creation and insertion in one step, use the
554 * convenience function gtk_text_buffer_create_child_anchor().
555 * Returns:
556 * a new GtkTextChildAnchor
558 public this ()
560 // GtkTextChildAnchor* gtk_text_child_anchor_new (void);
561 this(cast(GtkTextChildAnchor*)gtk_text_child_anchor_new() );
565 * Gets a list of all widgets anchored at this child anchor.
566 * The returned list should be freed with g_list_free().
567 * anchor:
568 * a GtkTextChildAnchor
569 * Returns:
570 * list of widgets anchored at anchor
572 public GList* getWidgets()
574 // GList* gtk_text_child_anchor_get_widgets (GtkTextChildAnchor *anchor);
575 return gtk_text_child_anchor_get_widgets(gtkTextChildAnchor);
579 * Determines whether a child anchor has been deleted from
580 * the buffer. Keep in mind that the child anchor will be
581 * unreferenced when removed from the buffer, so you need to
582 * hold your own reference (with g_object_ref()) if you plan
583 * to use this function otherwise all deleted child anchors
584 * will also be finalized.
585 * anchor:
586 * a GtkTextChildAnchor
587 * Returns:
588 * TRUE if the child anchor has been deleted from its buffer
590 public int getDeleted()
592 // gboolean gtk_text_child_anchor_get_deleted (GtkTextChildAnchor *anchor);
593 return gtk_text_child_anchor_get_deleted(gtkTextChildAnchor);