1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19  
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 /*
25  * Conversion parameters:
26  * inFile  = GtkTextView.html
27  * outPack = gtk
28  * outFile = TextView
29  * strct   = GtkTextView
30  * realStrct=
31  * ctorStrct=
32  * clss    = TextView
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_text_view_
41  * 	- gtk_
42  * omit structs:
43  * omit prefixes:
44  * 	- gtk_text_child_anchor_
45  * omit code:
46  * omit signals:
47  * imports:
48  * 	- glib.Str
49  * 	- gtk.Adjustment
50  * 	- gtk.TextBuffer
51  * 	- gtk.TextMark
52  * 	- gtk.TextIter
53  * 	- gdk.Rectangle
54  * 	- gtk.Widget
55  * 	- pango.PgTabArray
56  * 	- gtk.TextAttributes
57  * 	- gdk.Window
58  * 	- gtk.TextChildAnchor
59  * 	- glib.ListG
60  * structWrap:
61  * 	- GList* -> ListG
62  * 	- GdkRectangle* -> Rectangle
63  * 	- GdkWindow* -> Window
64  * 	- GtkAdjustment* -> Adjustment
65  * 	- GtkTextAttributes* -> TextAttributes
66  * 	- GtkTextBuffer* -> TextBuffer
67  * 	- GtkTextChildAnchor* -> TextChildAnchor
68  * 	- GtkTextIter* -> TextIter
69  * 	- GtkTextMark* -> TextMark
70  * 	- GtkWidget* -> Widget
71  * 	- PangoTabArray* -> PgTabArray
72  * module aliases:
73  * local aliases:
74  * overrides:
75  */
76 
77 module gtk.TextView;
78 
79 public  import gtkc.gtktypes;
80 
81 private import gtkc.gtk;
82 private import glib.ConstructionException;
83 private import gobject.ObjectG;
84 
85 private import gobject.Signals;
86 public  import gtkc.gdktypes;
87 
88 private import glib.Str;
89 private import gtk.Adjustment;
90 private import gtk.TextBuffer;
91 private import gtk.TextMark;
92 private import gtk.TextIter;
93 private import gdk.Rectangle;
94 private import gtk.Widget;
95 private import pango.PgTabArray;
96 private import gtk.TextAttributes;
97 private import gdk.Window;
98 private import gtk.TextChildAnchor;
99 private import glib.ListG;
100 
101 
102 
103 private import gtk.Container;
104 
105 /**
106  * Description
107  * You may wish to begin by reading the text widget
108  * conceptual overview which gives an overview of all the objects and data
109  * types related to the text widget and how they work together.
110  */
111 public class TextView : Container
112 {
113 	
114 	/** the main Gtk struct */
115 	protected GtkTextView* gtkTextView;
116 	
117 	
118 	public GtkTextView* getTextViewStruct()
119 	{
120 		return gtkTextView;
121 	}
122 	
123 	
124 	/** the main Gtk struct as a void* */
125 	protected override void* getStruct()
126 	{
127 		return cast(void*)gtkTextView;
128 	}
129 	
130 	/**
131 	 * Sets our main struct and passes it to the parent class
132 	 */
133 	public this (GtkTextView* gtkTextView)
134 	{
135 		super(cast(GtkContainer*)gtkTextView);
136 		this.gtkTextView = gtkTextView;
137 	}
138 	
139 	protected override void setStruct(GObject* obj)
140 	{
141 		super.setStruct(obj);
142 		gtkTextView = cast(GtkTextView*)obj;
143 	}
144 	
145 	/**
146 	 * Get the text line at the pixel y
147 	 */
148 	string getLineTextAt(gint y)
149 	{
150 		
151 		TextIter iter = new TextIter();
152 		int windowX;
153 		int windowY;
154 		bufferToWindowCoords(TextWindowType.TEXT, 0, y, windowX, windowY);
155 		
156 		gtk_text_view_get_line_at_y(gtkTextView, iter.getTextIterStruct(), y+y-windowY, null);
157 		
158 		TextIter iterEnd = new TextIter();
159 		TextBuffer buffer = getBuffer();
160 		buffer.getIterAtOffset(iterEnd, iter.getOffset()+iter.getCharsInLine());
161 		return buffer.getText(iter, iterEnd, false);
162 	}
163 	
164 	/**
165 	 * Simply appends some on the cursor position
166 	 * Params:
167 	 *  text = the text to append
168 	 */
169 	void insertText(string text)
170 	{
171 		TextBuffer buf = getBuffer();
172 		buf.insertAtCursor(text);
173 	}
174 	
175 	/**
176 	 * Simply appends some text to this view
177 	 * Params:
178 	 *  text = the text to append
179 	 */
180 	void appendText(string text, bool ensureVisible=true)
181 	body
182 	{
183 		TextBuffer buf = getBuffer();
184 		TextIter iter = new TextIter();
185 		buf.getEndIter(iter);
186 		buf.insert(iter, text);
187 		if ( ensureVisible )
188 		{
189 			gdouble within_margin = 0.0;
190 			bool use_align = false;
191 			gdouble xalign = 0.0;
192 			gdouble yalign = 0.0;
193 			scrollToMark(buf.createMark("",iter,true), within_margin, use_align, xalign, yalign);
194 		}
195 	}
196 	
197 	
198 	/**
199 	 */
200 	int[string] connectedSignals;
201 	
202 	void delegate(TextView)[] onBackspaceListeners;
203 	/**
204 	 * The ::backspace signal is a
205 	 * keybinding signal
206 	 * which gets emitted when the user asks for it.
207 	 * The default bindings for this signal are
208 	 * Backspace and Shift-Backspace.
209 	 */
210 	void addOnBackspace(void delegate(TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
211 	{
212 		if ( !("backspace" in connectedSignals) )
213 		{
214 			Signals.connectData(
215 			getStruct(),
216 			"backspace",
217 			cast(GCallback)&callBackBackspace,
218 			cast(void*)this,
219 			null,
220 			connectFlags);
221 			connectedSignals["backspace"] = 1;
222 		}
223 		onBackspaceListeners ~= dlg;
224 	}
225 	extern(C) static void callBackBackspace(GtkTextView* textViewStruct, TextView _textView)
226 	{
227 		foreach ( void delegate(TextView) dlg ; _textView.onBackspaceListeners )
228 		{
229 			dlg(_textView);
230 		}
231 	}
232 	
233 	void delegate(TextView)[] onCopyClipboardListeners;
234 	/**
235 	 * The ::copy-clipboard signal is a
236 	 * keybinding signal
237 	 * which gets emitted to copy the selection to the clipboard.
238 	 * The default bindings for this signal are
239 	 * Ctrl-c and Ctrl-Insert.
240 	 */
241 	void addOnCopyClipboard(void delegate(TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
242 	{
243 		if ( !("copy-clipboard" in connectedSignals) )
244 		{
245 			Signals.connectData(
246 			getStruct(),
247 			"copy-clipboard",
248 			cast(GCallback)&callBackCopyClipboard,
249 			cast(void*)this,
250 			null,
251 			connectFlags);
252 			connectedSignals["copy-clipboard"] = 1;
253 		}
254 		onCopyClipboardListeners ~= dlg;
255 	}
256 	extern(C) static void callBackCopyClipboard(GtkTextView* textViewStruct, TextView _textView)
257 	{
258 		foreach ( void delegate(TextView) dlg ; _textView.onCopyClipboardListeners )
259 		{
260 			dlg(_textView);
261 		}
262 	}
263 	
264 	void delegate(TextView)[] onCutClipboardListeners;
265 	/**
266 	 * The ::cut-clipboard signal is a
267 	 * keybinding signal
268 	 * which gets emitted to cut the selection to the clipboard.
269 	 * The default bindings for this signal are
270 	 * Ctrl-x and Shift-Delete.
271 	 */
272 	void addOnCutClipboard(void delegate(TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
273 	{
274 		if ( !("cut-clipboard" in connectedSignals) )
275 		{
276 			Signals.connectData(
277 			getStruct(),
278 			"cut-clipboard",
279 			cast(GCallback)&callBackCutClipboard,
280 			cast(void*)this,
281 			null,
282 			connectFlags);
283 			connectedSignals["cut-clipboard"] = 1;
284 		}
285 		onCutClipboardListeners ~= dlg;
286 	}
287 	extern(C) static void callBackCutClipboard(GtkTextView* textViewStruct, TextView _textView)
288 	{
289 		foreach ( void delegate(TextView) dlg ; _textView.onCutClipboardListeners )
290 		{
291 			dlg(_textView);
292 		}
293 	}
294 	
295 	void delegate(GtkDeleteType, gint, TextView)[] onDeleteFromCursorListeners;
296 	/**
297 	 * The ::delete-from-cursor signal is a
298 	 * keybinding signal
299 	 * which gets emitted when the user initiates a text deletion.
300 	 * If the type is GTK_DELETE_CHARS, GTK+ deletes the selection
301 	 * if there is one, otherwise it deletes the requested number
302 	 * of characters.
303 	 * The default bindings for this signal are
304 	 * Delete for deleting a character, Ctrl-Delete for
305 	 * deleting a word and Ctrl-Backspace for deleting a word
306 	 * backwords.
307 	 */
308 	void addOnDeleteFromCursor(void delegate(GtkDeleteType, gint, TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
309 	{
310 		if ( !("delete-from-cursor" in connectedSignals) )
311 		{
312 			Signals.connectData(
313 			getStruct(),
314 			"delete-from-cursor",
315 			cast(GCallback)&callBackDeleteFromCursor,
316 			cast(void*)this,
317 			null,
318 			connectFlags);
319 			connectedSignals["delete-from-cursor"] = 1;
320 		}
321 		onDeleteFromCursorListeners ~= dlg;
322 	}
323 	extern(C) static void callBackDeleteFromCursor(GtkTextView* textViewStruct, GtkDeleteType type, gint count, TextView _textView)
324 	{
325 		foreach ( void delegate(GtkDeleteType, gint, TextView) dlg ; _textView.onDeleteFromCursorListeners )
326 		{
327 			dlg(type, count, _textView);
328 		}
329 	}
330 	
331 	void delegate(string, TextView)[] onInsertAtCursorListeners;
332 	/**
333 	 * The ::insert-at-cursor signal is a
334 	 * keybinding signal
335 	 * which gets emitted when the user initiates the insertion of a
336 	 * fixed string at the cursor.
337 	 * This signal has no default bindings.
338 	 */
339 	void addOnInsertAtCursor(void delegate(string, TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
340 	{
341 		if ( !("insert-at-cursor" in connectedSignals) )
342 		{
343 			Signals.connectData(
344 			getStruct(),
345 			"insert-at-cursor",
346 			cast(GCallback)&callBackInsertAtCursor,
347 			cast(void*)this,
348 			null,
349 			connectFlags);
350 			connectedSignals["insert-at-cursor"] = 1;
351 		}
352 		onInsertAtCursorListeners ~= dlg;
353 	}
354 	extern(C) static void callBackInsertAtCursor(GtkTextView* textViewStruct, gchar* str, TextView _textView)
355 	{
356 		foreach ( void delegate(string, TextView) dlg ; _textView.onInsertAtCursorListeners )
357 		{
358 			dlg(Str.toString(str), _textView);
359 		}
360 	}
361 	
362 	void delegate(GtkMovementStep, gint, gboolean, TextView)[] onMoveCursorListeners;
363 	/**
364 	 * The ::move-cursor signal is a
365 	 * keybinding signal
366 	 * which gets emitted when the user initiates a cursor movement.
367 	 * If the cursor is not visible in text_view, this signal causes
368 	 * the viewport to be moved instead.
369 	 * Applications should not connect to it, but may emit it with
370 	 * g_signal_emit_by_name() if they need to control the cursor
371 	 * programmatically.
372 	 * The default bindings for this signal come in two variants,
373 	 * the variant with the Shift modifier extends the selection,
374 	 * the variant without the Shift modifer does not.
375 	 * There are too many key combinations to list them all here.
376 	 * Arrow keys move by individual characters/lines
377 	 * Ctrl-arrow key combinations move by words/paragraphs
378 	 * Home/End keys move to the ends of the buffer
379 	 * PageUp/PageDown keys move vertically by pages
380 	 * Ctrl-PageUp/PageDown keys move horizontally by pages
381 	 * TRUE if the move should extend the selection
382 	 */
383 	void addOnMoveCursor(void delegate(GtkMovementStep, gint, gboolean, TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
384 	{
385 		if ( !("move-cursor" in connectedSignals) )
386 		{
387 			Signals.connectData(
388 			getStruct(),
389 			"move-cursor",
390 			cast(GCallback)&callBackMoveCursor,
391 			cast(void*)this,
392 			null,
393 			connectFlags);
394 			connectedSignals["move-cursor"] = 1;
395 		}
396 		onMoveCursorListeners ~= dlg;
397 	}
398 	extern(C) static void callBackMoveCursor(GtkTextView* textViewStruct, GtkMovementStep step, gint count, gboolean extendSelection, TextView _textView)
399 	{
400 		foreach ( void delegate(GtkMovementStep, gint, gboolean, TextView) dlg ; _textView.onMoveCursorListeners )
401 		{
402 			dlg(step, count, extendSelection, _textView);
403 		}
404 	}
405 	
406 	void delegate(GtkScrollStep, gint, TextView)[] onMoveViewportListeners;
407 	/**
408 	 * The ::move-viewport signal is a
409 	 * keybinding signal
410 	 * which can be bound to key combinations to allow the user
411 	 * to move the viewport, i.e. change what part of the text view
412 	 * is visible in a containing scrolled window.
413 	 * There are no default bindings for this signal.
414 	 */
415 	void addOnMoveViewport(void delegate(GtkScrollStep, gint, TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
416 	{
417 		if ( !("move-viewport" in connectedSignals) )
418 		{
419 			Signals.connectData(
420 			getStruct(),
421 			"move-viewport",
422 			cast(GCallback)&callBackMoveViewport,
423 			cast(void*)this,
424 			null,
425 			connectFlags);
426 			connectedSignals["move-viewport"] = 1;
427 		}
428 		onMoveViewportListeners ~= dlg;
429 	}
430 	extern(C) static void callBackMoveViewport(GtkTextView* textViewStruct, GtkScrollStep step, gint count, TextView _textView)
431 	{
432 		foreach ( void delegate(GtkScrollStep, gint, TextView) dlg ; _textView.onMoveViewportListeners )
433 		{
434 			dlg(step, count, _textView);
435 		}
436 	}
437 	
438 	void delegate(gint, gboolean, TextView)[] onPageHorizontallyListeners;
439 	/**
440 	 * The ::page-horizontally signal is a
441 	 * keybinding signal
442 	 * which can be bound to key combinations to allow the user
443 	 * to initiate horizontal cursor movement by pages.
444 	 * This signal should not be used anymore, instead use the
445 	 * "move-cursor" signal with the GTK_MOVEMENT_HORIZONTAL_PAGES
446 	 * granularity.
447 	 * TRUE if the move should extend the selection
448 	 */
449 	void addOnPageHorizontally(void delegate(gint, gboolean, TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
450 	{
451 		if ( !("page-horizontally" in connectedSignals) )
452 		{
453 			Signals.connectData(
454 			getStruct(),
455 			"page-horizontally",
456 			cast(GCallback)&callBackPageHorizontally,
457 			cast(void*)this,
458 			null,
459 			connectFlags);
460 			connectedSignals["page-horizontally"] = 1;
461 		}
462 		onPageHorizontallyListeners ~= dlg;
463 	}
464 	extern(C) static void callBackPageHorizontally(GtkTextView* textViewStruct, gint count, gboolean extendSelection, TextView _textView)
465 	{
466 		foreach ( void delegate(gint, gboolean, TextView) dlg ; _textView.onPageHorizontallyListeners )
467 		{
468 			dlg(count, extendSelection, _textView);
469 		}
470 	}
471 	
472 	void delegate(TextView)[] onPasteClipboardListeners;
473 	/**
474 	 * The ::paste-clipboard signal is a
475 	 * keybinding signal
476 	 * which gets emitted to paste the contents of the clipboard
477 	 * into the text view.
478 	 * The default bindings for this signal are
479 	 * Ctrl-v and Shift-Insert.
480 	 */
481 	void addOnPasteClipboard(void delegate(TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
482 	{
483 		if ( !("paste-clipboard" in connectedSignals) )
484 		{
485 			Signals.connectData(
486 			getStruct(),
487 			"paste-clipboard",
488 			cast(GCallback)&callBackPasteClipboard,
489 			cast(void*)this,
490 			null,
491 			connectFlags);
492 			connectedSignals["paste-clipboard"] = 1;
493 		}
494 		onPasteClipboardListeners ~= dlg;
495 	}
496 	extern(C) static void callBackPasteClipboard(GtkTextView* textViewStruct, TextView _textView)
497 	{
498 		foreach ( void delegate(TextView) dlg ; _textView.onPasteClipboardListeners )
499 		{
500 			dlg(_textView);
501 		}
502 	}
503 	
504 	void delegate(GtkMenu*, TextView)[] onPopulatePopupListeners;
505 	/**
506 	 * The ::populate-popup signal gets emitted before showing the
507 	 * context menu of the text view.
508 	 * If you need to add items to the context menu, connect
509 	 * to this signal and append your menuitems to the menu.
510 	 */
511 	void addOnPopulatePopup(void delegate(GtkMenu*, TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
512 	{
513 		if ( !("populate-popup" in connectedSignals) )
514 		{
515 			Signals.connectData(
516 			getStruct(),
517 			"populate-popup",
518 			cast(GCallback)&callBackPopulatePopup,
519 			cast(void*)this,
520 			null,
521 			connectFlags);
522 			connectedSignals["populate-popup"] = 1;
523 		}
524 		onPopulatePopupListeners ~= dlg;
525 	}
526 	extern(C) static void callBackPopulatePopup(GtkTextView* entryStruct, GtkMenu* menu, TextView _textView)
527 	{
528 		foreach ( void delegate(GtkMenu*, TextView) dlg ; _textView.onPopulatePopupListeners )
529 		{
530 			dlg(menu, _textView);
531 		}
532 	}
533 	
534 	void delegate(string, TextView)[] onPreeditChangedListeners;
535 	/**
536 	 * If an input method is used, the typed text will not immediately
537 	 * be committed to the buffer. So if you are interested in the text,
538 	 * connect to this signal.
539 	 * This signal is only emitted if the text at the given position
540 	 * is actually editable.
541 	 * Since 2.20
542 	 */
543 	void addOnPreeditChanged(void delegate(string, TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
544 	{
545 		if ( !("preedit-changed" in connectedSignals) )
546 		{
547 			Signals.connectData(
548 			getStruct(),
549 			"preedit-changed",
550 			cast(GCallback)&callBackPreeditChanged,
551 			cast(void*)this,
552 			null,
553 			connectFlags);
554 			connectedSignals["preedit-changed"] = 1;
555 		}
556 		onPreeditChangedListeners ~= dlg;
557 	}
558 	extern(C) static void callBackPreeditChanged(GtkTextView* textViewStruct, gchar* preedit, TextView _textView)
559 	{
560 		foreach ( void delegate(string, TextView) dlg ; _textView.onPreeditChangedListeners )
561 		{
562 			dlg(Str.toString(preedit), _textView);
563 		}
564 	}
565 	
566 	void delegate(gboolean, TextView)[] onSelectAllListeners;
567 	/**
568 	 * The ::select-all signal is a
569 	 * keybinding signal
570 	 * which gets emitted to select or unselect the complete
571 	 * contents of the text view.
572 	 * The default bindings for this signal are Ctrl-a and Ctrl-/
573 	 * for selecting and Shift-Ctrl-a and Ctrl-\ for unselecting.
574 	 * TRUE to select, FALSE to unselect
575 	 */
576 	void addOnSelectAll(void delegate(gboolean, TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
577 	{
578 		if ( !("select-all" in connectedSignals) )
579 		{
580 			Signals.connectData(
581 			getStruct(),
582 			"select-all",
583 			cast(GCallback)&callBackSelectAll,
584 			cast(void*)this,
585 			null,
586 			connectFlags);
587 			connectedSignals["select-all"] = 1;
588 		}
589 		onSelectAllListeners ~= dlg;
590 	}
591 	extern(C) static void callBackSelectAll(GtkTextView* textViewStruct, gboolean select, TextView _textView)
592 	{
593 		foreach ( void delegate(gboolean, TextView) dlg ; _textView.onSelectAllListeners )
594 		{
595 			dlg(select, _textView);
596 		}
597 	}
598 	
599 	void delegate(TextView)[] onSetAnchorListeners;
600 	/**
601 	 * The ::set-anchor signal is a
602 	 * keybinding signal
603 	 * which gets emitted when the user initiates setting the "anchor"
604 	 * mark. The "anchor" mark gets placed at the same position as the
605 	 * "insert" mark.
606 	 * This signal has no default bindings.
607 	 */
608 	void addOnSetAnchor(void delegate(TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
609 	{
610 		if ( !("set-anchor" in connectedSignals) )
611 		{
612 			Signals.connectData(
613 			getStruct(),
614 			"set-anchor",
615 			cast(GCallback)&callBackSetAnchor,
616 			cast(void*)this,
617 			null,
618 			connectFlags);
619 			connectedSignals["set-anchor"] = 1;
620 		}
621 		onSetAnchorListeners ~= dlg;
622 	}
623 	extern(C) static void callBackSetAnchor(GtkTextView* textViewStruct, TextView _textView)
624 	{
625 		foreach ( void delegate(TextView) dlg ; _textView.onSetAnchorListeners )
626 		{
627 			dlg(_textView);
628 		}
629 	}
630 	
631 	void delegate(Adjustment, Adjustment, TextView)[] onSetScrollAdjustmentsListeners;
632 	/**
633 	 * Set the scroll adjustments for the text view. Usually scrolled containers
634 	 * like GtkScrolledWindow will emit this signal to connect two instances
635 	 * of GtkScrollbar to the scroll directions of the GtkTextView.
636 	 */
637 	void addOnSetScrollAdjustments(void delegate(Adjustment, Adjustment, TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
638 	{
639 		if ( !("set-scroll-adjustments" in connectedSignals) )
640 		{
641 			Signals.connectData(
642 			getStruct(),
643 			"set-scroll-adjustments",
644 			cast(GCallback)&callBackSetScrollAdjustments,
645 			cast(void*)this,
646 			null,
647 			connectFlags);
648 			connectedSignals["set-scroll-adjustments"] = 1;
649 		}
650 		onSetScrollAdjustmentsListeners ~= dlg;
651 	}
652 	extern(C) static void callBackSetScrollAdjustments(GtkTextView* horizontalStruct, GtkAdjustment* vertical, GtkAdjustment* arg2, TextView _textView)
653 	{
654 		foreach ( void delegate(Adjustment, Adjustment, TextView) dlg ; _textView.onSetScrollAdjustmentsListeners )
655 		{
656 			dlg(ObjectG.getDObject!(Adjustment)(vertical), ObjectG.getDObject!(Adjustment)(arg2), _textView);
657 		}
658 	}
659 	
660 	void delegate(TextView)[] onToggleCursorVisibleListeners;
661 	/**
662 	 * The ::toggle-cursor-visible signal is a
663 	 * keybinding signal
664 	 * which gets emitted to toggle the visibility of the cursor.
665 	 * The default binding for this signal is F7.
666 	 */
667 	void addOnToggleCursorVisible(void delegate(TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
668 	{
669 		if ( !("toggle-cursor-visible" in connectedSignals) )
670 		{
671 			Signals.connectData(
672 			getStruct(),
673 			"toggle-cursor-visible",
674 			cast(GCallback)&callBackToggleCursorVisible,
675 			cast(void*)this,
676 			null,
677 			connectFlags);
678 			connectedSignals["toggle-cursor-visible"] = 1;
679 		}
680 		onToggleCursorVisibleListeners ~= dlg;
681 	}
682 	extern(C) static void callBackToggleCursorVisible(GtkTextView* textViewStruct, TextView _textView)
683 	{
684 		foreach ( void delegate(TextView) dlg ; _textView.onToggleCursorVisibleListeners )
685 		{
686 			dlg(_textView);
687 		}
688 	}
689 	
690 	void delegate(TextView)[] onToggleOverwriteListeners;
691 	/**
692 	 * The ::toggle-overwrite signal is a
693 	 * keybinding signal
694 	 * which gets emitted to toggle the overwrite mode of the text view.
695 	 * The default bindings for this signal is Insert.
696 	 * See Also
697 	 * GtkTextBuffer, GtkTextIter
698 	 */
699 	void addOnToggleOverwrite(void delegate(TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
700 	{
701 		if ( !("toggle-overwrite" in connectedSignals) )
702 		{
703 			Signals.connectData(
704 			getStruct(),
705 			"toggle-overwrite",
706 			cast(GCallback)&callBackToggleOverwrite,
707 			cast(void*)this,
708 			null,
709 			connectFlags);
710 			connectedSignals["toggle-overwrite"] = 1;
711 		}
712 		onToggleOverwriteListeners ~= dlg;
713 	}
714 	extern(C) static void callBackToggleOverwrite(GtkTextView* textViewStruct, TextView _textView)
715 	{
716 		foreach ( void delegate(TextView) dlg ; _textView.onToggleOverwriteListeners )
717 		{
718 			dlg(_textView);
719 		}
720 	}
721 	
722 	
723 	/**
724 	 * Creates a new GtkTextView. If you don't call gtk_text_view_set_buffer()
725 	 * before using the text view, an empty default buffer will be created
726 	 * for you. Get the buffer with gtk_text_view_get_buffer(). If you want
727 	 * to specify your own buffer, consider gtk_text_view_new_with_buffer().
728 	 * Throws: ConstructionException GTK+ fails to create the object.
729 	 */
730 	public this ()
731 	{
732 		// GtkWidget * gtk_text_view_new (void);
733 		auto p = gtk_text_view_new();
734 		if(p is null)
735 		{
736 			throw new ConstructionException("null returned by gtk_text_view_new()");
737 		}
738 		this(cast(GtkTextView*) p);
739 	}
740 	
741 	/**
742 	 * Creates a new GtkTextView widget displaying the buffer
743 	 * buffer. One buffer can be shared among many widgets.
744 	 * buffer may be NULL to create a default buffer, in which case
745 	 * this function is equivalent to gtk_text_view_new(). The
746 	 * text view adds its own reference count to the buffer; it does not
747 	 * take over an existing reference.
748 	 * Params:
749 	 * buffer = a GtkTextBuffer
750 	 * Throws: ConstructionException GTK+ fails to create the object.
751 	 */
752 	public this (TextBuffer buffer)
753 	{
754 		// GtkWidget * gtk_text_view_new_with_buffer (GtkTextBuffer *buffer);
755 		auto p = gtk_text_view_new_with_buffer((buffer is null) ? null : buffer.getTextBufferStruct());
756 		if(p is null)
757 		{
758 			throw new ConstructionException("null returned by gtk_text_view_new_with_buffer((buffer is null) ? null : buffer.getTextBufferStruct())");
759 		}
760 		this(cast(GtkTextView*) p);
761 	}
762 	
763 	/**
764 	 * Sets buffer as the buffer being displayed by text_view. The previous
765 	 * buffer displayed by the text view is unreferenced, and a reference is
766 	 * added to buffer. If you owned a reference to buffer before passing it
767 	 * to this function, you must remove that reference yourself; GtkTextView
768 	 * will not "adopt" it.
769 	 * Params:
770 	 * buffer = a GtkTextBuffer. [allow-none]
771 	 */
772 	public void setBuffer(TextBuffer buffer)
773 	{
774 		// void gtk_text_view_set_buffer (GtkTextView *text_view,  GtkTextBuffer *buffer);
775 		gtk_text_view_set_buffer(gtkTextView, (buffer is null) ? null : buffer.getTextBufferStruct());
776 	}
777 	
778 	/**
779 	 * Returns the GtkTextBuffer being displayed by this text view.
780 	 * The reference count on the buffer is not incremented; the caller
781 	 * of this function won't own a new reference.
782 	 * Returns: a GtkTextBuffer. [transfer none]
783 	 */
784 	public TextBuffer getBuffer()
785 	{
786 		// GtkTextBuffer * gtk_text_view_get_buffer (GtkTextView *text_view);
787 		auto p = gtk_text_view_get_buffer(gtkTextView);
788 		
789 		if(p is null)
790 		{
791 			return null;
792 		}
793 		
794 		return ObjectG.getDObject!(TextBuffer)(cast(GtkTextBuffer*) p);
795 	}
796 	
797 	/**
798 	 * Scrolls text_view so that mark is on the screen in the position
799 	 * indicated by xalign and yalign. An alignment of 0.0 indicates
800 	 * left or top, 1.0 indicates right or bottom, 0.5 means center.
801 	 * If use_align is FALSE, the text scrolls the minimal distance to
802 	 * get the mark onscreen, possibly not scrolling at all. The effective
803 	 * screen for purposes of this function is reduced by a margin of size
804 	 * within_margin.
805 	 * Params:
806 	 * mark = a GtkTextMark
807 	 * withinMargin = margin as a [0.0,0.5) fraction of screen size
808 	 * useAlign = whether to use alignment arguments (if FALSE, just
809 	 * get the mark onscreen)
810 	 * xalign = horizontal alignment of mark within visible area
811 	 * yalign = vertical alignment of mark within visible area
812 	 */
813 	public void scrollToMark(TextMark mark, double withinMargin, int useAlign, double xalign, double yalign)
814 	{
815 		// void gtk_text_view_scroll_to_mark (GtkTextView *text_view,  GtkTextMark *mark,  gdouble within_margin,  gboolean use_align,  gdouble xalign,  gdouble yalign);
816 		gtk_text_view_scroll_to_mark(gtkTextView, (mark is null) ? null : mark.getTextMarkStruct(), withinMargin, useAlign, xalign, yalign);
817 	}
818 	
819 	/**
820 	 * Scrolls text_view so that iter is on the screen in the position
821 	 * indicated by xalign and yalign. An alignment of 0.0 indicates
822 	 * left or top, 1.0 indicates right or bottom, 0.5 means center.
823 	 * If use_align is FALSE, the text scrolls the minimal distance to
824 	 * get the mark onscreen, possibly not scrolling at all. The effective
825 	 * screen for purposes of this function is reduced by a margin of size
826 	 * within_margin.
827 	 * Note that this function uses the currently-computed height of the
828 	 * lines in the text buffer. Line heights are computed in an idle
829 	 * handler; so this function may not have the desired effect if it's
830 	 * called before the height computations. To avoid oddness, consider
831 	 * using gtk_text_view_scroll_to_mark() which saves a point to be
832 	 * scrolled to after line validation.
833 	 * Params:
834 	 * iter = a GtkTextIter
835 	 * withinMargin = margin as a [0.0,0.5) fraction of screen size
836 	 * useAlign = whether to use alignment arguments (if FALSE,
837 	 * just get the mark onscreen)
838 	 * xalign = horizontal alignment of mark within visible area
839 	 * yalign = vertical alignment of mark within visible area
840 	 * Returns: TRUE if scrolling occurred
841 	 */
842 	public int scrollToIter(TextIter iter, double withinMargin, int useAlign, double xalign, double yalign)
843 	{
844 		// gboolean gtk_text_view_scroll_to_iter (GtkTextView *text_view,  GtkTextIter *iter,  gdouble within_margin,  gboolean use_align,  gdouble xalign,  gdouble yalign);
845 		return gtk_text_view_scroll_to_iter(gtkTextView, (iter is null) ? null : iter.getTextIterStruct(), withinMargin, useAlign, xalign, yalign);
846 	}
847 	
848 	/**
849 	 * Scrolls text_view the minimum distance such that mark is contained
850 	 * within the visible area of the widget.
851 	 * Params:
852 	 * mark = a mark in the buffer for text_view
853 	 */
854 	public void scrollMarkOnscreen(TextMark mark)
855 	{
856 		// void gtk_text_view_scroll_mark_onscreen (GtkTextView *text_view,  GtkTextMark *mark);
857 		gtk_text_view_scroll_mark_onscreen(gtkTextView, (mark is null) ? null : mark.getTextMarkStruct());
858 	}
859 	
860 	/**
861 	 * Moves a mark within the buffer so that it's
862 	 * located within the currently-visible text area.
863 	 * Params:
864 	 * mark = a GtkTextMark
865 	 * Returns: TRUE if the mark moved (wasn't already onscreen)
866 	 */
867 	public int moveMarkOnscreen(TextMark mark)
868 	{
869 		// gboolean gtk_text_view_move_mark_onscreen (GtkTextView *text_view,  GtkTextMark *mark);
870 		return gtk_text_view_move_mark_onscreen(gtkTextView, (mark is null) ? null : mark.getTextMarkStruct());
871 	}
872 	
873 	/**
874 	 * Moves the cursor to the currently visible region of the
875 	 * buffer, it it isn't there already.
876 	 * Returns: TRUE if the cursor had to be moved.
877 	 */
878 	public int placeCursorOnscreen()
879 	{
880 		// gboolean gtk_text_view_place_cursor_onscreen (GtkTextView *text_view);
881 		return gtk_text_view_place_cursor_onscreen(gtkTextView);
882 	}
883 	
884 	/**
885 	 * Fills visible_rect with the currently-visible
886 	 * region of the buffer, in buffer coordinates. Convert to window coordinates
887 	 * with gtk_text_view_buffer_to_window_coords().
888 	 * Params:
889 	 * visibleRect = rectangle to fill. [out]
890 	 */
891 	public void getVisibleRect(Rectangle visibleRect)
892 	{
893 		// void gtk_text_view_get_visible_rect (GtkTextView *text_view,  GdkRectangle *visible_rect);
894 		gtk_text_view_get_visible_rect(gtkTextView, (visibleRect is null) ? null : visibleRect.getRectangleStruct());
895 	}
896 	
897 	/**
898 	 * Gets a rectangle which roughly contains the character at iter.
899 	 * The rectangle position is in buffer coordinates; use
900 	 * gtk_text_view_buffer_to_window_coords() to convert these
901 	 * coordinates to coordinates for one of the windows in the text view.
902 	 * Params:
903 	 * iter = a GtkTextIter
904 	 * location = bounds of the character at iter. [out]
905 	 */
906 	public void getIterLocation(TextIter iter, Rectangle location)
907 	{
908 		// void gtk_text_view_get_iter_location (GtkTextView *text_view,  const GtkTextIter *iter,  GdkRectangle *location);
909 		gtk_text_view_get_iter_location(gtkTextView, (iter is null) ? null : iter.getTextIterStruct(), (location is null) ? null : location.getRectangleStruct());
910 	}
911 	
912 	/**
913 	 * Gets the GtkTextIter at the start of the line containing
914 	 * the coordinate y. y is in buffer coordinates, convert from
915 	 * window coordinates with gtk_text_view_window_to_buffer_coords().
916 	 * If non-NULL, line_top will be filled with the coordinate of the top
917 	 * edge of the line.
918 	 * Params:
919 	 * targetIter = a GtkTextIter. [out]
920 	 * y = a y coordinate
921 	 * lineTop = return location for top coordinate of the line. [out]
922 	 */
923 	public void getLineAtY(TextIter targetIter, int y, out int lineTop)
924 	{
925 		// void gtk_text_view_get_line_at_y (GtkTextView *text_view,  GtkTextIter *target_iter,  gint y,  gint *line_top);
926 		gtk_text_view_get_line_at_y(gtkTextView, (targetIter is null) ? null : targetIter.getTextIterStruct(), y, &lineTop);
927 	}
928 	
929 	/**
930 	 * Gets the y coordinate of the top of the line containing iter,
931 	 * and the height of the line. The coordinate is a buffer coordinate;
932 	 * convert to window coordinates with gtk_text_view_buffer_to_window_coords().
933 	 * Params:
934 	 * iter = a GtkTextIter
935 	 * y = return location for a y coordinate. [out]
936 	 * height = return location for a height. [out]
937 	 */
938 	public void getLineYrange(TextIter iter, out int y, out int height)
939 	{
940 		// void gtk_text_view_get_line_yrange (GtkTextView *text_view,  const GtkTextIter *iter,  gint *y,  gint *height);
941 		gtk_text_view_get_line_yrange(gtkTextView, (iter is null) ? null : iter.getTextIterStruct(), &y, &height);
942 	}
943 	
944 	/**
945 	 * Retrieves the iterator at buffer coordinates x and y. Buffer
946 	 * coordinates are coordinates for the entire buffer, not just the
947 	 * currently-displayed portion. If you have coordinates from an
948 	 * event, you have to convert those to buffer coordinates with
949 	 * gtk_text_view_window_to_buffer_coords().
950 	 * Params:
951 	 * iter = a GtkTextIter. [out]
952 	 * x = x position, in buffer coordinates
953 	 * y = y position, in buffer coordinates
954 	 */
955 	public void getIterAtLocation(TextIter iter, int x, int y)
956 	{
957 		// void gtk_text_view_get_iter_at_location (GtkTextView *text_view,  GtkTextIter *iter,  gint x,  gint y);
958 		gtk_text_view_get_iter_at_location(gtkTextView, (iter is null) ? null : iter.getTextIterStruct(), x, y);
959 	}
960 	
961 	/**
962 	 * Retrieves the iterator pointing to the character at buffer
963 	 * coordinates x and y. Buffer coordinates are coordinates for
964 	 * the entire buffer, not just the currently-displayed portion.
965 	 * If you have coordinates from an event, you have to convert
966 	 * those to buffer coordinates with
967 	 * gtk_text_view_window_to_buffer_coords().
968 	 * Note that this is different from gtk_text_view_get_iter_at_location(),
969 	 * which returns cursor locations, i.e. positions between
970 	 * characters.
971 	 * Since 2.6
972 	 * Params:
973 	 * iter = a GtkTextIter. [out]
974 	 * trailing = if non-NULL, location to store an integer indicating where
975 	 * in the grapheme the user clicked. It will either be
976 	 * zero, or the number of characters in the grapheme.
977 	 * 0 represents the trailing edge of the grapheme. [out][allow-none]
978 	 * x = x position, in buffer coordinates
979 	 * y = y position, in buffer coordinates
980 	 */
981 	public void getIterAtPosition(TextIter iter, out int trailing, int x, int y)
982 	{
983 		// void gtk_text_view_get_iter_at_position (GtkTextView *text_view,  GtkTextIter *iter,  gint *trailing,  gint x,  gint y);
984 		gtk_text_view_get_iter_at_position(gtkTextView, (iter is null) ? null : iter.getTextIterStruct(), &trailing, x, y);
985 	}
986 	
987 	/**
988 	 * Converts coordinate (buffer_x, buffer_y) to coordinates for the window
989 	 * win, and stores the result in (window_x, window_y).
990 	 * Note that you can't convert coordinates for a nonexisting window (see
991 	 * gtk_text_view_set_border_window_size()).
992 	 * Params:
993 	 * win = a GtkTextWindowType except GTK_TEXT_WINDOW_PRIVATE
994 	 * bufferX = buffer x coordinate
995 	 * bufferY = buffer y coordinate
996 	 * windowX = window x coordinate return location or NULL. [out][allow-none]
997 	 * windowY = window y coordinate return location or NULL. [out][allow-none]
998 	 */
999 	public void bufferToWindowCoords(GtkTextWindowType win, int bufferX, int bufferY, out int windowX, out int windowY)
1000 	{
1001 		// void gtk_text_view_buffer_to_window_coords  (GtkTextView *text_view,  GtkTextWindowType win,  gint buffer_x,  gint buffer_y,  gint *window_x,  gint *window_y);
1002 		gtk_text_view_buffer_to_window_coords(gtkTextView, win, bufferX, bufferY, &windowX, &windowY);
1003 	}
1004 	
1005 	/**
1006 	 * Converts coordinates on the window identified by win to buffer
1007 	 * coordinates, storing the result in (buffer_x,buffer_y).
1008 	 * Note that you can't convert coordinates for a nonexisting window (see
1009 	 * gtk_text_view_set_border_window_size()).
1010 	 * Params:
1011 	 * win = a GtkTextWindowType except GTK_TEXT_WINDOW_PRIVATE
1012 	 * windowX = window x coordinate
1013 	 * windowY = window y coordinate
1014 	 * bufferX = buffer x coordinate return location or NULL. [out][allow-none]
1015 	 * bufferY = buffer y coordinate return location or NULL. [out][allow-none]
1016 	 */
1017 	public void windowToBufferCoords(GtkTextWindowType win, int windowX, int windowY, out int bufferX, out int bufferY)
1018 	{
1019 		// void gtk_text_view_window_to_buffer_coords  (GtkTextView *text_view,  GtkTextWindowType win,  gint window_x,  gint window_y,  gint *buffer_x,  gint *buffer_y);
1020 		gtk_text_view_window_to_buffer_coords(gtkTextView, win, windowX, windowY, &bufferX, &bufferY);
1021 	}
1022 	
1023 	/**
1024 	 * Retrieves the GdkWindow corresponding to an area of the text view;
1025 	 * possible windows include the overall widget window, child windows
1026 	 * on the left, right, top, bottom, and the window that displays the
1027 	 * text buffer. Windows are NULL and nonexistent if their width or
1028 	 * height is 0, and are nonexistent before the widget has been
1029 	 * realized.
1030 	 * Params:
1031 	 * win = window to get
1032 	 * Returns: a GdkWindow, or NULL. [transfer none]
1033 	 */
1034 	public Window getWindow(GtkTextWindowType win)
1035 	{
1036 		// GdkWindow * gtk_text_view_get_window (GtkTextView *text_view,  GtkTextWindowType win);
1037 		auto p = gtk_text_view_get_window(gtkTextView, win);
1038 		
1039 		if(p is null)
1040 		{
1041 			return null;
1042 		}
1043 		
1044 		return ObjectG.getDObject!(Window)(cast(GdkWindow*) p);
1045 	}
1046 	
1047 	/**
1048 	 * Usually used to find out which window an event corresponds to.
1049 	 * If you connect to an event signal on text_view, this function
1050 	 * should be called on event->window to
1051 	 * see which window it was.
1052 	 * Params:
1053 	 * window = a window type
1054 	 * Returns: the window type.
1055 	 */
1056 	public GtkTextWindowType getWindowType(Window window)
1057 	{
1058 		// GtkTextWindowType gtk_text_view_get_window_type (GtkTextView *text_view,  GdkWindow *window);
1059 		return gtk_text_view_get_window_type(gtkTextView, (window is null) ? null : window.getWindowStruct());
1060 	}
1061 	
1062 	/**
1063 	 * Sets the width of GTK_TEXT_WINDOW_LEFT or GTK_TEXT_WINDOW_RIGHT,
1064 	 * or the height of GTK_TEXT_WINDOW_TOP or GTK_TEXT_WINDOW_BOTTOM.
1065 	 * Automatically destroys the corresponding window if the size is set
1066 	 * to 0, and creates the window if the size is set to non-zero. This
1067 	 * function can only be used for the "border windows," it doesn't work
1068 	 * with GTK_TEXT_WINDOW_WIDGET, GTK_TEXT_WINDOW_TEXT, or
1069 	 * GTK_TEXT_WINDOW_PRIVATE.
1070 	 * Params:
1071 	 * type = window to affect
1072 	 * size = width or height of the window
1073 	 */
1074 	public void setBorderWindowSize(GtkTextWindowType type, int size)
1075 	{
1076 		// void gtk_text_view_set_border_window_size  (GtkTextView *text_view,  GtkTextWindowType type,  gint size);
1077 		gtk_text_view_set_border_window_size(gtkTextView, type, size);
1078 	}
1079 	
1080 	/**
1081 	 * Gets the width of the specified border window. See
1082 	 * gtk_text_view_set_border_window_size().
1083 	 * Params:
1084 	 * type = window to return size from
1085 	 * Returns: width of window
1086 	 */
1087 	public int getBorderWindowSize(GtkTextWindowType type)
1088 	{
1089 		// gint gtk_text_view_get_border_window_size  (GtkTextView *text_view,  GtkTextWindowType type);
1090 		return gtk_text_view_get_border_window_size(gtkTextView, type);
1091 	}
1092 	
1093 	/**
1094 	 * Moves the given iter forward by one display (wrapped) line.
1095 	 * A display line is different from a paragraph. Paragraphs are
1096 	 * separated by newlines or other paragraph separator characters.
1097 	 * Display lines are created by line-wrapping a paragraph. If
1098 	 * wrapping is turned off, display lines and paragraphs will be the
1099 	 * same. Display lines are divided differently for each view, since
1100 	 * they depend on the view's width; paragraphs are the same in all
1101 	 * views, since they depend on the contents of the GtkTextBuffer.
1102 	 * Params:
1103 	 * iter = a GtkTextIter
1104 	 * Returns: TRUE if iter was moved and is not on the end iterator
1105 	 */
1106 	public int forwardDisplayLine(TextIter iter)
1107 	{
1108 		// gboolean gtk_text_view_forward_display_line (GtkTextView *text_view,  GtkTextIter *iter);
1109 		return gtk_text_view_forward_display_line(gtkTextView, (iter is null) ? null : iter.getTextIterStruct());
1110 	}
1111 	
1112 	/**
1113 	 * Moves the given iter backward by one display (wrapped) line.
1114 	 * A display line is different from a paragraph. Paragraphs are
1115 	 * separated by newlines or other paragraph separator characters.
1116 	 * Display lines are created by line-wrapping a paragraph. If
1117 	 * wrapping is turned off, display lines and paragraphs will be the
1118 	 * same. Display lines are divided differently for each view, since
1119 	 * they depend on the view's width; paragraphs are the same in all
1120 	 * views, since they depend on the contents of the GtkTextBuffer.
1121 	 * Params:
1122 	 * iter = a GtkTextIter
1123 	 * Returns: TRUE if iter was moved and is not on the end iterator
1124 	 */
1125 	public int backwardDisplayLine(TextIter iter)
1126 	{
1127 		// gboolean gtk_text_view_backward_display_line (GtkTextView *text_view,  GtkTextIter *iter);
1128 		return gtk_text_view_backward_display_line(gtkTextView, (iter is null) ? null : iter.getTextIterStruct());
1129 	}
1130 	
1131 	/**
1132 	 * Moves the given iter forward to the next display line end.
1133 	 * A display line is different from a paragraph. Paragraphs are
1134 	 * separated by newlines or other paragraph separator characters.
1135 	 * Display lines are created by line-wrapping a paragraph. If
1136 	 * wrapping is turned off, display lines and paragraphs will be the
1137 	 * same. Display lines are divided differently for each view, since
1138 	 * they depend on the view's width; paragraphs are the same in all
1139 	 * views, since they depend on the contents of the GtkTextBuffer.
1140 	 * Params:
1141 	 * iter = a GtkTextIter
1142 	 * Returns: TRUE if iter was moved and is not on the end iterator
1143 	 */
1144 	public int forwardDisplayLineEnd(TextIter iter)
1145 	{
1146 		// gboolean gtk_text_view_forward_display_line_end  (GtkTextView *text_view,  GtkTextIter *iter);
1147 		return gtk_text_view_forward_display_line_end(gtkTextView, (iter is null) ? null : iter.getTextIterStruct());
1148 	}
1149 	
1150 	/**
1151 	 * Moves the given iter backward to the next display line start.
1152 	 * A display line is different from a paragraph. Paragraphs are
1153 	 * separated by newlines or other paragraph separator characters.
1154 	 * Display lines are created by line-wrapping a paragraph. If
1155 	 * wrapping is turned off, display lines and paragraphs will be the
1156 	 * same. Display lines are divided differently for each view, since
1157 	 * they depend on the view's width; paragraphs are the same in all
1158 	 * views, since they depend on the contents of the GtkTextBuffer.
1159 	 * Params:
1160 	 * iter = a GtkTextIter
1161 	 * Returns: TRUE if iter was moved and is not on the end iterator
1162 	 */
1163 	public int backwardDisplayLineStart(TextIter iter)
1164 	{
1165 		// gboolean gtk_text_view_backward_display_line_start  (GtkTextView *text_view,  GtkTextIter *iter);
1166 		return gtk_text_view_backward_display_line_start(gtkTextView, (iter is null) ? null : iter.getTextIterStruct());
1167 	}
1168 	
1169 	/**
1170 	 * Determines whether iter is at the start of a display line.
1171 	 * See gtk_text_view_forward_display_line() for an explanation of
1172 	 * display lines vs. paragraphs.
1173 	 * Params:
1174 	 * iter = a GtkTextIter
1175 	 * Returns: TRUE if iter begins a wrapped line
1176 	 */
1177 	public int startsDisplayLine(TextIter iter)
1178 	{
1179 		// gboolean gtk_text_view_starts_display_line (GtkTextView *text_view,  const GtkTextIter *iter);
1180 		return gtk_text_view_starts_display_line(gtkTextView, (iter is null) ? null : iter.getTextIterStruct());
1181 	}
1182 	
1183 	/**
1184 	 * Move the iterator a given number of characters visually, treating
1185 	 * it as the strong cursor position. If count is positive, then the
1186 	 * new strong cursor position will be count positions to the right of
1187 	 * the old cursor position. If count is negative then the new strong
1188 	 * cursor position will be count positions to the left of the old
1189 	 * cursor position.
1190 	 * In the presence of bi-directional text, the correspondence
1191 	 * between logical and visual order will depend on the direction
1192 	 * of the current run, and there may be jumps when the cursor
1193 	 * is moved off of the end of a run.
1194 	 * Params:
1195 	 * iter = a GtkTextIter
1196 	 * count = number of characters to move (negative moves left,
1197 	 * positive moves right)
1198 	 * Returns: TRUE if iter moved and is not on the end iterator
1199 	 */
1200 	public int moveVisually(TextIter iter, int count)
1201 	{
1202 		// gboolean gtk_text_view_move_visually (GtkTextView *text_view,  GtkTextIter *iter,  gint count);
1203 		return gtk_text_view_move_visually(gtkTextView, (iter is null) ? null : iter.getTextIterStruct(), count);
1204 	}
1205 	
1206 	/**
1207 	 * Adds a child widget in the text buffer, at the given anchor.
1208 	 * Params:
1209 	 * child = a GtkWidget
1210 	 * anchor = a GtkTextChildAnchor in the GtkTextBuffer for text_view
1211 	 */
1212 	public void addChildAtAnchor(Widget child, TextChildAnchor anchor)
1213 	{
1214 		// void gtk_text_view_add_child_at_anchor (GtkTextView *text_view,  GtkWidget *child,  GtkTextChildAnchor *anchor);
1215 		gtk_text_view_add_child_at_anchor(gtkTextView, (child is null) ? null : child.getWidgetStruct(), (anchor is null) ? null : anchor.getTextChildAnchorStruct());
1216 	}
1217 	
1218 	/**
1219 	 * Adds a child at fixed coordinates in one of the text widget's
1220 	 * windows. The window must have nonzero size (see
1221 	 * gtk_text_view_set_border_window_size()). Note that the child
1222 	 * coordinates are given relative to the GdkWindow in question, and
1223 	 * that these coordinates have no sane relationship to scrolling. When
1224 	 * placing a child in GTK_TEXT_WINDOW_WIDGET, scrolling is
1225 	 * irrelevant, the child floats above all scrollable areas. But when
1226 	 * placing a child in one of the scrollable windows (border windows or
1227 	 * text window), you'll need to compute the child's correct position
1228 	 * in buffer coordinates any time scrolling occurs or buffer changes
1229 	 * occur, and then call gtk_text_view_move_child() to update the
1230 	 * child's position. Unfortunately there's no good way to detect that
1231 	 * scrolling has occurred, using the current API; a possible hack
1232 	 * would be to update all child positions when the scroll adjustments
1233 	 * change or the text buffer changes. See bug 64518 on
1234 	 * bugzilla.gnome.org for status of fixing this issue.
1235 	 * Params:
1236 	 * child = a GtkWidget
1237 	 * whichWindow = which window the child should appear in
1238 	 * xpos = X position of child in window coordinates
1239 	 * ypos = Y position of child in window coordinates
1240 	 */
1241 	public void addChildInWindow(Widget child, GtkTextWindowType whichWindow, int xpos, int ypos)
1242 	{
1243 		// void gtk_text_view_add_child_in_window (GtkTextView *text_view,  GtkWidget *child,  GtkTextWindowType which_window,  gint xpos,  gint ypos);
1244 		gtk_text_view_add_child_in_window(gtkTextView, (child is null) ? null : child.getWidgetStruct(), whichWindow, xpos, ypos);
1245 	}
1246 	
1247 	/**
1248 	 * Updates the position of a child, as for gtk_text_view_add_child_in_window().
1249 	 * Params:
1250 	 * child = child widget already added to the text view
1251 	 * xpos = new X position in window coordinates
1252 	 * ypos = new Y position in window coordinates
1253 	 */
1254 	public void moveChild(Widget child, int xpos, int ypos)
1255 	{
1256 		// void gtk_text_view_move_child (GtkTextView *text_view,  GtkWidget *child,  gint xpos,  gint ypos);
1257 		gtk_text_view_move_child(gtkTextView, (child is null) ? null : child.getWidgetStruct(), xpos, ypos);
1258 	}
1259 	
1260 	/**
1261 	 * Sets the line wrapping for the view.
1262 	 * Params:
1263 	 * wrapMode = a GtkWrapMode
1264 	 */
1265 	public void setWrapMode(GtkWrapMode wrapMode)
1266 	{
1267 		// void gtk_text_view_set_wrap_mode (GtkTextView *text_view,  GtkWrapMode wrap_mode);
1268 		gtk_text_view_set_wrap_mode(gtkTextView, wrapMode);
1269 	}
1270 	
1271 	/**
1272 	 * Gets the line wrapping for the view.
1273 	 * Returns: the line wrap setting
1274 	 */
1275 	public GtkWrapMode getWrapMode()
1276 	{
1277 		// GtkWrapMode gtk_text_view_get_wrap_mode (GtkTextView *text_view);
1278 		return gtk_text_view_get_wrap_mode(gtkTextView);
1279 	}
1280 	
1281 	/**
1282 	 * Sets the default editability of the GtkTextView. You can override
1283 	 * this default setting with tags in the buffer, using the "editable"
1284 	 * attribute of tags.
1285 	 * Params:
1286 	 * setting = whether it's editable
1287 	 */
1288 	public void setEditable(int setting)
1289 	{
1290 		// void gtk_text_view_set_editable (GtkTextView *text_view,  gboolean setting);
1291 		gtk_text_view_set_editable(gtkTextView, setting);
1292 	}
1293 	
1294 	/**
1295 	 * Returns the default editability of the GtkTextView. Tags in the
1296 	 * buffer may override this setting for some ranges of text.
1297 	 * Returns: whether text is editable by default
1298 	 */
1299 	public int getEditable()
1300 	{
1301 		// gboolean gtk_text_view_get_editable (GtkTextView *text_view);
1302 		return gtk_text_view_get_editable(gtkTextView);
1303 	}
1304 	
1305 	/**
1306 	 * Toggles whether the insertion point is displayed. A buffer with no editable
1307 	 * text probably shouldn't have a visible cursor, so you may want to turn
1308 	 * the cursor off.
1309 	 * Params:
1310 	 * setting = whether to show the insertion cursor
1311 	 */
1312 	public void setCursorVisible(int setting)
1313 	{
1314 		// void gtk_text_view_set_cursor_visible (GtkTextView *text_view,  gboolean setting);
1315 		gtk_text_view_set_cursor_visible(gtkTextView, setting);
1316 	}
1317 	
1318 	/**
1319 	 * Find out whether the cursor is being displayed.
1320 	 * Returns: whether the insertion mark is visible
1321 	 */
1322 	public int getCursorVisible()
1323 	{
1324 		// gboolean gtk_text_view_get_cursor_visible (GtkTextView *text_view);
1325 		return gtk_text_view_get_cursor_visible(gtkTextView);
1326 	}
1327 	
1328 	/**
1329 	 * Changes the GtkTextView overwrite mode.
1330 	 * Since 2.4
1331 	 * Params:
1332 	 * overwrite = TRUE to turn on overwrite mode, FALSE to turn it off
1333 	 */
1334 	public void setOverwrite(int overwrite)
1335 	{
1336 		// void gtk_text_view_set_overwrite (GtkTextView *text_view,  gboolean overwrite);
1337 		gtk_text_view_set_overwrite(gtkTextView, overwrite);
1338 	}
1339 	
1340 	/**
1341 	 * Returns whether the GtkTextView is in overwrite mode or not.
1342 	 * Since 2.4
1343 	 * Returns: whether text_view is in overwrite mode or not.
1344 	 */
1345 	public int getOverwrite()
1346 	{
1347 		// gboolean gtk_text_view_get_overwrite (GtkTextView *text_view);
1348 		return gtk_text_view_get_overwrite(gtkTextView);
1349 	}
1350 	
1351 	/**
1352 	 * Sets the default number of blank pixels above paragraphs in text_view.
1353 	 * Tags in the buffer for text_view may override the defaults.
1354 	 * Params:
1355 	 * pixelsAboveLines = pixels above paragraphs
1356 	 */
1357 	public void setPixelsAboveLines(int pixelsAboveLines)
1358 	{
1359 		// void gtk_text_view_set_pixels_above_lines  (GtkTextView *text_view,  gint pixels_above_lines);
1360 		gtk_text_view_set_pixels_above_lines(gtkTextView, pixelsAboveLines);
1361 	}
1362 	
1363 	/**
1364 	 * Gets the default number of pixels to put above paragraphs.
1365 	 * Returns: default number of pixels above paragraphs
1366 	 */
1367 	public int getPixelsAboveLines()
1368 	{
1369 		// gint gtk_text_view_get_pixels_above_lines  (GtkTextView *text_view);
1370 		return gtk_text_view_get_pixels_above_lines(gtkTextView);
1371 	}
1372 	
1373 	/**
1374 	 * Sets the default number of pixels of blank space
1375 	 * to put below paragraphs in text_view. May be overridden
1376 	 * by tags applied to text_view's buffer.
1377 	 * Params:
1378 	 * pixelsBelowLines = pixels below paragraphs
1379 	 */
1380 	public void setPixelsBelowLines(int pixelsBelowLines)
1381 	{
1382 		// void gtk_text_view_set_pixels_below_lines  (GtkTextView *text_view,  gint pixels_below_lines);
1383 		gtk_text_view_set_pixels_below_lines(gtkTextView, pixelsBelowLines);
1384 	}
1385 	
1386 	/**
1387 	 * Gets the value set by gtk_text_view_set_pixels_below_lines().
1388 	 * Returns: default number of blank pixels below paragraphs
1389 	 */
1390 	public int getPixelsBelowLines()
1391 	{
1392 		// gint gtk_text_view_get_pixels_below_lines  (GtkTextView *text_view);
1393 		return gtk_text_view_get_pixels_below_lines(gtkTextView);
1394 	}
1395 	
1396 	/**
1397 	 * Sets the default number of pixels of blank space to leave between
1398 	 * display/wrapped lines within a paragraph. May be overridden by
1399 	 * tags in text_view's buffer.
1400 	 * Params:
1401 	 * pixelsInsideWrap = default number of pixels between wrapped lines
1402 	 */
1403 	public void setPixelsInsideWrap(int pixelsInsideWrap)
1404 	{
1405 		// void gtk_text_view_set_pixels_inside_wrap  (GtkTextView *text_view,  gint pixels_inside_wrap);
1406 		gtk_text_view_set_pixels_inside_wrap(gtkTextView, pixelsInsideWrap);
1407 	}
1408 	
1409 	/**
1410 	 * Gets the value set by gtk_text_view_set_pixels_inside_wrap().
1411 	 * Returns: default number of pixels of blank space between wrapped lines
1412 	 */
1413 	public int getPixelsInsideWrap()
1414 	{
1415 		// gint gtk_text_view_get_pixels_inside_wrap  (GtkTextView *text_view);
1416 		return gtk_text_view_get_pixels_inside_wrap(gtkTextView);
1417 	}
1418 	
1419 	/**
1420 	 * Sets the default justification of text in text_view.
1421 	 * Tags in the view's buffer may override the default.
1422 	 * Params:
1423 	 * justification = justification
1424 	 */
1425 	public void setJustification(GtkJustification justification)
1426 	{
1427 		// void gtk_text_view_set_justification (GtkTextView *text_view,  GtkJustification justification);
1428 		gtk_text_view_set_justification(gtkTextView, justification);
1429 	}
1430 	
1431 	/**
1432 	 * Gets the default justification of paragraphs in text_view.
1433 	 * Tags in the buffer may override the default.
1434 	 * Returns: default justification
1435 	 */
1436 	public GtkJustification getJustification()
1437 	{
1438 		// GtkJustification gtk_text_view_get_justification (GtkTextView *text_view);
1439 		return gtk_text_view_get_justification(gtkTextView);
1440 	}
1441 	
1442 	/**
1443 	 * Sets the default left margin for text in text_view.
1444 	 * Tags in the buffer may override the default.
1445 	 * Params:
1446 	 * leftMargin = left margin in pixels
1447 	 */
1448 	public void setLeftMargin(int leftMargin)
1449 	{
1450 		// void gtk_text_view_set_left_margin (GtkTextView *text_view,  gint left_margin);
1451 		gtk_text_view_set_left_margin(gtkTextView, leftMargin);
1452 	}
1453 	
1454 	/**
1455 	 * Gets the default left margin size of paragraphs in the text_view.
1456 	 * Tags in the buffer may override the default.
1457 	 * Returns: left margin in pixels
1458 	 */
1459 	public int getLeftMargin()
1460 	{
1461 		// gint gtk_text_view_get_left_margin (GtkTextView *text_view);
1462 		return gtk_text_view_get_left_margin(gtkTextView);
1463 	}
1464 	
1465 	/**
1466 	 * Sets the default right margin for text in the text view.
1467 	 * Tags in the buffer may override the default.
1468 	 * Params:
1469 	 * rightMargin = right margin in pixels
1470 	 */
1471 	public void setRightMargin(int rightMargin)
1472 	{
1473 		// void gtk_text_view_set_right_margin (GtkTextView *text_view,  gint right_margin);
1474 		gtk_text_view_set_right_margin(gtkTextView, rightMargin);
1475 	}
1476 	
1477 	/**
1478 	 * Gets the default right margin for text in text_view. Tags
1479 	 * in the buffer may override the default.
1480 	 * Returns: right margin in pixels
1481 	 */
1482 	public int getRightMargin()
1483 	{
1484 		// gint gtk_text_view_get_right_margin (GtkTextView *text_view);
1485 		return gtk_text_view_get_right_margin(gtkTextView);
1486 	}
1487 	
1488 	/**
1489 	 * Sets the default indentation for paragraphs in text_view.
1490 	 * Tags in the buffer may override the default.
1491 	 * Params:
1492 	 * indent = indentation in pixels
1493 	 */
1494 	public void setIndent(int indent)
1495 	{
1496 		// void gtk_text_view_set_indent (GtkTextView *text_view,  gint indent);
1497 		gtk_text_view_set_indent(gtkTextView, indent);
1498 	}
1499 	
1500 	/**
1501 	 * Gets the default indentation of paragraphs in text_view.
1502 	 * Tags in the view's buffer may override the default.
1503 	 * The indentation may be negative.
1504 	 * Returns: number of pixels of indentation
1505 	 */
1506 	public int getIndent()
1507 	{
1508 		// gint gtk_text_view_get_indent (GtkTextView *text_view);
1509 		return gtk_text_view_get_indent(gtkTextView);
1510 	}
1511 	
1512 	/**
1513 	 * Sets the default tab stops for paragraphs in text_view.
1514 	 * Tags in the buffer may override the default.
1515 	 * Params:
1516 	 * tabs = tabs as a PangoTabArray
1517 	 */
1518 	public void setTabs(PgTabArray tabs)
1519 	{
1520 		// void gtk_text_view_set_tabs (GtkTextView *text_view,  PangoTabArray *tabs);
1521 		gtk_text_view_set_tabs(gtkTextView, (tabs is null) ? null : tabs.getPgTabArrayStruct());
1522 	}
1523 	
1524 	/**
1525 	 * Gets the default tabs for text_view. Tags in the buffer may
1526 	 * override the defaults. The returned array will be NULL if
1527 	 * "standard" (8-space) tabs are used. Free the return value
1528 	 * with pango_tab_array_free().
1529 	 * Returns: copy of default tab array, or NULL if "standard" tabs are used; must be freed with pango_tab_array_free().
1530 	 */
1531 	public PgTabArray getTabs()
1532 	{
1533 		// PangoTabArray * gtk_text_view_get_tabs (GtkTextView *text_view);
1534 		auto p = gtk_text_view_get_tabs(gtkTextView);
1535 		
1536 		if(p is null)
1537 		{
1538 			return null;
1539 		}
1540 		
1541 		return ObjectG.getDObject!(PgTabArray)(cast(PangoTabArray*) p);
1542 	}
1543 	
1544 	/**
1545 	 * Sets the behavior of the text widget when the Tab key is pressed.
1546 	 * If accepts_tab is TRUE, a tab character is inserted. If accepts_tab
1547 	 * is FALSE the keyboard focus is moved to the next widget in the focus
1548 	 * chain.
1549 	 * Since 2.4
1550 	 * Params:
1551 	 * acceptsTab = TRUE if pressing the Tab key should insert a tab
1552 	 * character, FALSE, if pressing the Tab key should move the
1553 	 * keyboard focus.
1554 	 */
1555 	public void setAcceptsTab(int acceptsTab)
1556 	{
1557 		// void gtk_text_view_set_accepts_tab (GtkTextView *text_view,  gboolean accepts_tab);
1558 		gtk_text_view_set_accepts_tab(gtkTextView, acceptsTab);
1559 	}
1560 	
1561 	/**
1562 	 * Returns whether pressing the Tab key inserts a tab characters.
1563 	 * gtk_text_view_set_accepts_tab().
1564 	 * Since 2.4
1565 	 * Returns: TRUE if pressing the Tab key inserts a tab character, FALSE if pressing the Tab key moves the keyboard focus.
1566 	 */
1567 	public int getAcceptsTab()
1568 	{
1569 		// gboolean gtk_text_view_get_accepts_tab (GtkTextView *text_view);
1570 		return gtk_text_view_get_accepts_tab(gtkTextView);
1571 	}
1572 	
1573 	/**
1574 	 * Obtains a copy of the default text attributes. These are the
1575 	 * attributes used for text unless a tag overrides them.
1576 	 * You'd typically pass the default attributes in to
1577 	 * gtk_text_iter_get_attributes() in order to get the
1578 	 * attributes in effect at a given text position.
1579 	 * The return value is a copy owned by the caller of this function,
1580 	 * and should be freed.
1581 	 * Returns: a new GtkTextAttributes
1582 	 */
1583 	public TextAttributes getDefaultAttributes()
1584 	{
1585 		// GtkTextAttributes * gtk_text_view_get_default_attributes  (GtkTextView *text_view);
1586 		auto p = gtk_text_view_get_default_attributes(gtkTextView);
1587 		
1588 		if(p is null)
1589 		{
1590 			return null;
1591 		}
1592 		
1593 		return ObjectG.getDObject!(TextAttributes)(cast(GtkTextAttributes*) p);
1594 	}
1595 	
1596 	/**
1597 	 * Allow the GtkTextView input method to internally handle key press
1598 	 * and release events. If this function returns TRUE, then no further
1599 	 * processing should be done for this key event. See
1600 	 * gtk_im_context_filter_keypress().
1601 	 * Note that you are expected to call this function from your handler
1602 	 * when overriding key event handling. This is needed in the case when
1603 	 * you need to insert your own key handling between the input method
1604 	 * and the default key event handling of the GtkTextView.
1605 	 * $(DDOC_COMMENT example)
1606 	 * Since 2.22
1607 	 * Params:
1608 	 * event = the key event
1609 	 * Returns: TRUE if the input method handled the key event.
1610 	 */
1611 	public int imContextFilterKeypress(GdkEventKey* event)
1612 	{
1613 		// gboolean gtk_text_view_im_context_filter_keypress  (GtkTextView *text_view,  GdkEventKey *event);
1614 		return gtk_text_view_im_context_filter_keypress(gtkTextView, event);
1615 	}
1616 	
1617 	/**
1618 	 * Reset the input method context of the text view if needed.
1619 	 * This can be necessary in the case where modifying the buffer
1620 	 * would confuse on-going input method behavior.
1621 	 * Since 2.22
1622 	 */
1623 	public void resetImContext()
1624 	{
1625 		// void gtk_text_view_reset_im_context (GtkTextView *text_view);
1626 		gtk_text_view_reset_im_context(gtkTextView);
1627 	}
1628 	
1629 	/**
1630 	 * Gets the horizontal-scrolling GtkAdjustment.
1631 	 * Since 2.22
1632 	 * Returns: pointer to the horizontal GtkAdjustment. [transfer none]
1633 	 */
1634 	public Adjustment getHadjustment()
1635 	{
1636 		// GtkAdjustment * gtk_text_view_get_hadjustment (GtkTextView *text_view);
1637 		auto p = gtk_text_view_get_hadjustment(gtkTextView);
1638 		
1639 		if(p is null)
1640 		{
1641 			return null;
1642 		}
1643 		
1644 		return ObjectG.getDObject!(Adjustment)(cast(GtkAdjustment*) p);
1645 	}
1646 	
1647 	/**
1648 	 * Gets the vertical-scrolling GtkAdjustment.
1649 	 * Since 2.22
1650 	 * Returns: pointer to the vertical GtkAdjustment. [transfer none]
1651 	 */
1652 	public Adjustment getVadjustment()
1653 	{
1654 		// GtkAdjustment * gtk_text_view_get_vadjustment (GtkTextView *text_view);
1655 		auto p = gtk_text_view_get_vadjustment(gtkTextView);
1656 		
1657 		if(p is null)
1658 		{
1659 			return null;
1660 		}
1661 		
1662 		return ObjectG.getDObject!(Adjustment)(cast(GtkAdjustment*) p);
1663 	}
1664 }