I've no idea here...
[gtkD.git] / src / gtk / TextMark.d
blob8c0feadc4689ccd303a4ea84cf596e22ed56a970
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 = GtkTextMark.html
26 * outPack = gtk
27 * outFile = TextMark
28 * strct = GtkTextMark
29 * realStrct=
30 * ctorStrct=
31 * clss = TextMark
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_text_mark_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * - glib.Str
46 * - gtk.TextBuffer
47 * structWrap:
48 * - GtkTextBuffer* -> TextBuffer
49 * local aliases:
52 module gtk.TextMark;
54 private import gtk.gtktypes;
56 private import lib.gtk;
58 private import glib.Str;
59 private import gtk.TextBuffer;
61 /**
62 * Description
63 * You may wish to begin by reading the text widget
64 * conceptual overview which gives an overview of all the objects and data
65 * types related to the text widget and how they work together.
66 * A GtkTextMark is like a bookmark in a text buffer; it preserves a position in
67 * the text. You can convert the mark to an iterator using
68 * gtk_text_buffer_get_iter_at_mark(). Unlike iterators, marks remain valid across
69 * buffer mutations, because their behavior is defined when text is inserted or
70 * deleted. When text containing a mark is deleted, the mark remains in the
71 * position originally occupied by the deleted text. When text is inserted at a
72 * mark, a mark with left gravity will be moved to the
73 * beginning of the newly-inserted text, and a mark with right
74 * gravity will be moved to the end.
75 * [3]
76 * Marks are reference counted, but the reference count only controls the validity
77 * of the memory; marks can be deleted from the buffer at any time with
78 * gtk_text_buffer_delete_mark(). Once deleted from the buffer, a mark is
79 * essentially useless.
80 * Marks optionally have names; these can be convenient to avoid passing the
81 * GtkTextMark object around.
82 * Marks are typically created using the gtk_text_buffer_create_mark() function.
84 private import gobject.ObjectG;
85 public class TextMark : ObjectG
88 /** the main Gtk struct */
89 protected GtkTextMark* gtkTextMark;
92 public GtkTextMark* getTextMarkStruct()
94 return gtkTextMark;
98 /** the main Gtk struct as a void* */
99 protected void* getStruct()
101 return cast(void*)gtkTextMark;
105 * Sets our main struct and passes it to the parent class
107 public this (GtkTextMark* gtkTextMark)
109 super(cast(GObject*)gtkTextMark);
110 this.gtkTextMark = gtkTextMark;
118 * Sets the visibility of mark; the insertion point is normally
119 * visible, i.e. you can see it as a vertical bar. Also, the text
120 * widget uses a visible mark to indicate where a drop will occur when
121 * dragging-and-dropping text. Most other marks are not visible.
122 * Marks are not visible by default.
123 * mark:
124 * a GtkTextMark
125 * setting:
126 * visibility of mark
128 public void setVisible(int setting)
130 // void gtk_text_mark_set_visible (GtkTextMark *mark, gboolean setting);
131 gtk_text_mark_set_visible(gtkTextMark, setting);
135 * Returns TRUE if the mark is visible (i.e. a cursor is displayed
136 * for it)
137 * mark:
138 * a GtkTextMark
139 * Returns:
140 * TRUE if visible
142 public int getVisible()
144 // gboolean gtk_text_mark_get_visible (GtkTextMark *mark);
145 return gtk_text_mark_get_visible(gtkTextMark);
149 * Returns TRUE if the mark has been removed from its buffer
150 * with gtk_text_buffer_delete_mark(). Marks can't be used
151 * once deleted.
152 * mark:
153 * a GtkTextMark
154 * Returns:
155 * whether the mark is deleted
157 public int getDeleted()
159 // gboolean gtk_text_mark_get_deleted (GtkTextMark *mark);
160 return gtk_text_mark_get_deleted(gtkTextMark);
164 * Returns the mark name; returns NULL for anonymous marks.
165 * mark:
166 * a GtkTextMark
167 * Returns:
168 * mark name
170 public char[] getName()
172 // const gchar* gtk_text_mark_get_name (GtkTextMark *mark);
173 return Str.toString(gtk_text_mark_get_name(gtkTextMark) );
177 * Gets the buffer this mark is located inside,
178 * or NULL if the mark is deleted.
179 * mark:
180 * a GtkTextMark
181 * Returns:
182 * the mark's GtkTextBuffer
184 public TextBuffer getBuffer()
186 // GtkTextBuffer* gtk_text_mark_get_buffer (GtkTextMark *mark);
187 return new TextBuffer( gtk_text_mark_get_buffer(gtkTextMark) );
191 * Determines whether the mark has left gravity.
192 * mark:
193 * a GtkTextMark
194 * Returns:
195 * TRUE if the mark has left gravity, FALSE otherwise
196 * [3]
197 * "left" and "right" here refer to logical direction (left is the toward the start
198 * of the buffer); in some languages such as Hebrew the logically-leftmost text is
199 * not actually on the left when displayed.
201 public int getLeftGravity()
203 // gboolean gtk_text_mark_get_left_gravity (GtkTextMark *mark);
204 return gtk_text_mark_get_left_gravity(gtkTextMark);