alternative to assert
[gtkD.git] / gtkD / src / gtk / TextView.d
bloba76d72f196a60d982f08eaa3d02f911f22bf4398
1 /*
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 = GtkTextView.html
26 * outPack = gtk
27 * outFile = TextView
28 * strct = GtkTextView
29 * realStrct=
30 * ctorStrct=
31 * clss = TextView
32 * interf =
33 * class Code: Yes
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_text_view_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * - gtk_text_child_anchor_
44 * omit code:
45 * imports:
46 * - glib.Str
47 * - gtk.TextBuffer
48 * - gtk.TextMark
49 * - gtk.TextIter
50 * - gdk.Rectangle
51 * - gtk.Widget
52 * - pango.PgTabArray
53 * - gtk.TextAttributes
54 * - gdk.Window
55 * - gtk.TextChildAnchor
56 * - glib.ListG
57 * structWrap:
58 * - GList* -> ListG
59 * - GdkRectangle* -> Rectangle
60 * - GdkWindow* -> Window
61 * - GtkTextAttributes* -> TextAttributes
62 * - GtkTextBuffer* -> TextBuffer
63 * - GtkTextChildAnchor* -> TextChildAnchor
64 * - GtkTextIter* -> TextIter
65 * - GtkTextMark* -> TextMark
66 * - GtkWidget* -> Widget
67 * - PangoTabArray* -> PgTabArray
68 * module aliases:
69 * local aliases:
72 module gtk.TextView;
74 version(noAssert)
76 version(Tango)
78 import tango.io.Stdout; // use the tango loging?
82 private import gtkc.gtktypes;
84 private import gtkc.gtk;
87 private import glib.Str;
88 private import gtk.TextBuffer;
89 private import gtk.TextMark;
90 private import gtk.TextIter;
91 private import gdk.Rectangle;
92 private import gtk.Widget;
93 private import pango.PgTabArray;
94 private import gtk.TextAttributes;
95 private import gdk.Window;
96 private import gtk.TextChildAnchor;
97 private import glib.ListG;
103 * Description
104 * You may wish to begin by reading the text widget
105 * conceptual overview which gives an overview of all the objects and data
106 * types related to the text widget and how they work together.
108 private import gtk.Container;
109 public class TextView : Container
112 /** the main Gtk struct */
113 protected GtkTextView* gtkTextView;
116 public GtkTextView* getTextViewStruct()
118 return gtkTextView;
122 /** the main Gtk struct as a void* */
123 protected void* getStruct()
125 return cast(void*)gtkTextView;
129 * Sets our main struct and passes it to the parent class
131 public this (GtkTextView* gtkTextView)
133 version(noAssert)
135 if ( gtkTextView is null )
137 int zero = 0;
138 version(Tango)
140 Stdout("struct gtkTextView is null on constructor").newline;
142 else
144 printf("struct gtkTextView is null on constructor");
146 zero = zero / zero;
149 else
151 assert(gtkTextView !is null, "struct gtkTextView is null on constructor");
153 super(cast(GtkContainer*)gtkTextView);
154 this.gtkTextView = gtkTextView;
158 * Get the text line at the pixel y
160 char[] getLineTextAt(gint y)
163 TextIter iter = new TextIter();
164 int windowX;
165 int windowY;
166 bufferToWindowCoords(TextWindowType.TEXT, 0, y, &windowX, &windowY);
168 gtk_text_view_get_line_at_y(gtkTextView, iter.getTextIterStruct(), y+y-windowY, null);
170 TextIter iterEnd = new TextIter();
171 TextBuffer buffer = getBuffer();
172 buffer.getIterAtOffset(iterEnd, iter.getOffset()+iter.getCharsInLine());
173 return buffer.getText(iter, iterEnd, false);
177 * Simply appends some on the cursor position
178 * @param text the text to append
180 void insertText(char[] text)
182 TextBuffer buf = getBuffer();
183 buf.insertAtCursor(text);
187 * Simply appends some text to this view
188 * @param text the text to append
190 void appendText(char[] text, bool ensureVisible=true)
191 body
193 TextBuffer buf = getBuffer();
194 TextIter iter = new TextIter();
195 buf.getEndIter(iter);
196 buf.insert(iter, text);
197 if ( ensureVisible )
199 gdouble within_margin = 0.0;
200 bool use_align = false;
201 gdouble xalign = 0.0;
202 gdouble yalign = 0.0;
203 scrollToMark(buf.createMark("",iter,true), within_margin, use_align, xalign, yalign);
211 // imports for the signal processing
212 private import gobject.Signals;
213 private import gtkc.gdktypes;
214 int[char[]] connectedSignals;
216 void delegate(TextView)[] onBackspaceListeners;
217 void addOnBackspace(void delegate(TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
219 if ( !("backspace" in connectedSignals) )
221 Signals.connectData(
222 getStruct(),
223 "backspace",
224 cast(GCallback)&callBackBackspace,
225 cast(void*)this,
226 null,
227 connectFlags);
228 connectedSignals["backspace"] = 1;
230 onBackspaceListeners ~= dlg;
232 extern(C) static void callBackBackspace(GtkTextView* textviewStruct, TextView textView)
234 bool consumed = false;
236 foreach ( void delegate(TextView) dlg ; textView.onBackspaceListeners )
238 dlg(textView);
241 return consumed;
244 void delegate(TextView)[] onCopyClipboardListeners;
245 void addOnCopyClipboard(void delegate(TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
247 if ( !("copy-clipboard" in connectedSignals) )
249 Signals.connectData(
250 getStruct(),
251 "copy-clipboard",
252 cast(GCallback)&callBackCopyClipboard,
253 cast(void*)this,
254 null,
255 connectFlags);
256 connectedSignals["copy-clipboard"] = 1;
258 onCopyClipboardListeners ~= dlg;
260 extern(C) static void callBackCopyClipboard(GtkTextView* textviewStruct, TextView textView)
262 bool consumed = false;
264 foreach ( void delegate(TextView) dlg ; textView.onCopyClipboardListeners )
266 dlg(textView);
269 return consumed;
272 void delegate(TextView)[] onCutClipboardListeners;
273 void addOnCutClipboard(void delegate(TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
275 if ( !("cut-clipboard" in connectedSignals) )
277 Signals.connectData(
278 getStruct(),
279 "cut-clipboard",
280 cast(GCallback)&callBackCutClipboard,
281 cast(void*)this,
282 null,
283 connectFlags);
284 connectedSignals["cut-clipboard"] = 1;
286 onCutClipboardListeners ~= dlg;
288 extern(C) static void callBackCutClipboard(GtkTextView* textviewStruct, TextView textView)
290 bool consumed = false;
292 foreach ( void delegate(TextView) dlg ; textView.onCutClipboardListeners )
294 dlg(textView);
297 return consumed;
300 void delegate(GtkDeleteType, gint, TextView)[] onDeleteFromCursorListeners;
301 void addOnDeleteFromCursor(void delegate(GtkDeleteType, gint, TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
303 if ( !("delete-from-cursor" in connectedSignals) )
305 Signals.connectData(
306 getStruct(),
307 "delete-from-cursor",
308 cast(GCallback)&callBackDeleteFromCursor,
309 cast(void*)this,
310 null,
311 connectFlags);
312 connectedSignals["delete-from-cursor"] = 1;
314 onDeleteFromCursorListeners ~= dlg;
316 extern(C) static void callBackDeleteFromCursor(GtkTextView* textviewStruct, GtkDeleteType arg1, gint arg2, TextView textView)
318 bool consumed = false;
320 foreach ( void delegate(GtkDeleteType, gint, TextView) dlg ; textView.onDeleteFromCursorListeners )
322 dlg(arg1, arg2, textView);
325 return consumed;
328 void delegate(char[], TextView)[] onInsertAtCursorListeners;
329 void addOnInsertAtCursor(void delegate(char[], TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
331 if ( !("insert-at-cursor" in connectedSignals) )
333 Signals.connectData(
334 getStruct(),
335 "insert-at-cursor",
336 cast(GCallback)&callBackInsertAtCursor,
337 cast(void*)this,
338 null,
339 connectFlags);
340 connectedSignals["insert-at-cursor"] = 1;
342 onInsertAtCursorListeners ~= dlg;
344 extern(C) static void callBackInsertAtCursor(GtkTextView* textviewStruct, gchar* arg1, TextView textView)
346 bool consumed = false;
348 foreach ( void delegate(char[], TextView) dlg ; textView.onInsertAtCursorListeners )
350 dlg(Str.toString(arg1), textView);
353 return consumed;
356 void delegate(GtkMovementStep, gint, gboolean, TextView)[] onMoveCursorListeners;
357 void addOnMoveCursor(void delegate(GtkMovementStep, gint, gboolean, TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
359 if ( !("move-cursor" in connectedSignals) )
361 Signals.connectData(
362 getStruct(),
363 "move-cursor",
364 cast(GCallback)&callBackMoveCursor,
365 cast(void*)this,
366 null,
367 connectFlags);
368 connectedSignals["move-cursor"] = 1;
370 onMoveCursorListeners ~= dlg;
372 extern(C) static void callBackMoveCursor(GtkTextView* widgetStruct, GtkMovementStep step, gint count, gboolean extendSelection, TextView textView)
374 bool consumed = false;
376 foreach ( void delegate(GtkMovementStep, gint, gboolean, TextView) dlg ; textView.onMoveCursorListeners )
378 dlg(step, count, extendSelection, textView);
381 return consumed;
384 void delegate(GtkDirectionType, TextView)[] onMoveFocusListeners;
385 void addOnMoveFocus(void delegate(GtkDirectionType, TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
387 if ( !("move-focus" in connectedSignals) )
389 Signals.connectData(
390 getStruct(),
391 "move-focus",
392 cast(GCallback)&callBackMoveFocus,
393 cast(void*)this,
394 null,
395 connectFlags);
396 connectedSignals["move-focus"] = 1;
398 onMoveFocusListeners ~= dlg;
400 extern(C) static void callBackMoveFocus(GtkTextView* textviewStruct, GtkDirectionType arg1, TextView textView)
402 bool consumed = false;
404 foreach ( void delegate(GtkDirectionType, TextView) dlg ; textView.onMoveFocusListeners )
406 dlg(arg1, textView);
409 return consumed;
412 void delegate(GtkScrollStep, gint, TextView)[] onMoveViewportListeners;
413 void addOnMoveViewport(void delegate(GtkScrollStep, gint, TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
415 if ( !("move-viewport" in connectedSignals) )
417 Signals.connectData(
418 getStruct(),
419 "move-viewport",
420 cast(GCallback)&callBackMoveViewport,
421 cast(void*)this,
422 null,
423 connectFlags);
424 connectedSignals["move-viewport"] = 1;
426 onMoveViewportListeners ~= dlg;
428 extern(C) static void callBackMoveViewport(GtkTextView* textviewStruct, GtkScrollStep arg1, gint arg2, TextView textView)
430 bool consumed = false;
432 foreach ( void delegate(GtkScrollStep, gint, TextView) dlg ; textView.onMoveViewportListeners )
434 dlg(arg1, arg2, textView);
437 return consumed;
440 void delegate(gint, gboolean, TextView)[] onPageHorizontallyListeners;
441 void addOnPageHorizontally(void delegate(gint, gboolean, TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
443 if ( !("page-horizontally" in connectedSignals) )
445 Signals.connectData(
446 getStruct(),
447 "page-horizontally",
448 cast(GCallback)&callBackPageHorizontally,
449 cast(void*)this,
450 null,
451 connectFlags);
452 connectedSignals["page-horizontally"] = 1;
454 onPageHorizontallyListeners ~= dlg;
456 extern(C) static void callBackPageHorizontally(GtkTextView* textviewStruct, gint arg1, gboolean arg2, TextView textView)
458 bool consumed = false;
460 foreach ( void delegate(gint, gboolean, TextView) dlg ; textView.onPageHorizontallyListeners )
462 dlg(arg1, arg2, textView);
465 return consumed;
468 void delegate(TextView)[] onPasteClipboardListeners;
469 void addOnPasteClipboard(void delegate(TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
471 if ( !("paste-clipboard" in connectedSignals) )
473 Signals.connectData(
474 getStruct(),
475 "paste-clipboard",
476 cast(GCallback)&callBackPasteClipboard,
477 cast(void*)this,
478 null,
479 connectFlags);
480 connectedSignals["paste-clipboard"] = 1;
482 onPasteClipboardListeners ~= dlg;
484 extern(C) static void callBackPasteClipboard(GtkTextView* textviewStruct, TextView textView)
486 bool consumed = false;
488 foreach ( void delegate(TextView) dlg ; textView.onPasteClipboardListeners )
490 dlg(textView);
493 return consumed;
496 void delegate(GtkMenu*, TextView)[] onPopulatePopupListeners;
497 void addOnPopulatePopup(void delegate(GtkMenu*, TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
499 if ( !("populate-popup" in connectedSignals) )
501 Signals.connectData(
502 getStruct(),
503 "populate-popup",
504 cast(GCallback)&callBackPopulatePopup,
505 cast(void*)this,
506 null,
507 connectFlags);
508 connectedSignals["populate-popup"] = 1;
510 onPopulatePopupListeners ~= dlg;
512 extern(C) static void callBackPopulatePopup(GtkTextView* textviewStruct, GtkMenu* arg1, TextView textView)
514 bool consumed = false;
516 foreach ( void delegate(GtkMenu*, TextView) dlg ; textView.onPopulatePopupListeners )
518 dlg(arg1, textView);
521 return consumed;
524 void delegate(gboolean, TextView)[] onSelectAllListeners;
525 void addOnSelectAll(void delegate(gboolean, TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
527 if ( !("select-all" in connectedSignals) )
529 Signals.connectData(
530 getStruct(),
531 "select-all",
532 cast(GCallback)&callBackSelectAll,
533 cast(void*)this,
534 null,
535 connectFlags);
536 connectedSignals["select-all"] = 1;
538 onSelectAllListeners ~= dlg;
540 extern(C) static void callBackSelectAll(GtkTextView* textviewStruct, gboolean arg1, TextView textView)
542 bool consumed = false;
544 foreach ( void delegate(gboolean, TextView) dlg ; textView.onSelectAllListeners )
546 dlg(arg1, textView);
549 return consumed;
552 void delegate(TextView)[] onSetAnchorListeners;
553 void addOnSetAnchor(void delegate(TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
555 if ( !("set-anchor" in connectedSignals) )
557 Signals.connectData(
558 getStruct(),
559 "set-anchor",
560 cast(GCallback)&callBackSetAnchor,
561 cast(void*)this,
562 null,
563 connectFlags);
564 connectedSignals["set-anchor"] = 1;
566 onSetAnchorListeners ~= dlg;
568 extern(C) static void callBackSetAnchor(GtkTextView* textviewStruct, TextView textView)
570 bool consumed = false;
572 foreach ( void delegate(TextView) dlg ; textView.onSetAnchorListeners )
574 dlg(textView);
577 return consumed;
580 void delegate(GtkAdjustment*, GtkAdjustment*, TextView)[] onSetScrollAdjustmentsListeners;
581 void addOnSetScrollAdjustments(void delegate(GtkAdjustment*, GtkAdjustment*, TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
583 if ( !("set-scroll-adjustments" in connectedSignals) )
585 Signals.connectData(
586 getStruct(),
587 "set-scroll-adjustments",
588 cast(GCallback)&callBackSetScrollAdjustments,
589 cast(void*)this,
590 null,
591 connectFlags);
592 connectedSignals["set-scroll-adjustments"] = 1;
594 onSetScrollAdjustmentsListeners ~= dlg;
596 extern(C) static void callBackSetScrollAdjustments(GtkTextView* textviewStruct, GtkAdjustment* arg1, GtkAdjustment* arg2, TextView textView)
598 bool consumed = false;
600 foreach ( void delegate(GtkAdjustment*, GtkAdjustment*, TextView) dlg ; textView.onSetScrollAdjustmentsListeners )
602 dlg(arg1, arg2, textView);
605 return consumed;
608 void delegate(TextView)[] onToggleOverwriteListeners;
609 void addOnToggleOverwrite(void delegate(TextView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
611 if ( !("toggle-overwrite" in connectedSignals) )
613 Signals.connectData(
614 getStruct(),
615 "toggle-overwrite",
616 cast(GCallback)&callBackToggleOverwrite,
617 cast(void*)this,
618 null,
619 connectFlags);
620 connectedSignals["toggle-overwrite"] = 1;
622 onToggleOverwriteListeners ~= dlg;
624 extern(C) static void callBackToggleOverwrite(GtkTextView* textviewStruct, TextView textView)
626 bool consumed = false;
628 foreach ( void delegate(TextView) dlg ; textView.onToggleOverwriteListeners )
630 dlg(textView);
633 return consumed;
640 * Creates a new GtkTextView. If you don't call gtk_text_view_set_buffer()
641 * before using the text view, an empty default buffer will be created
642 * for you. Get the buffer with gtk_text_view_get_buffer(). If you want
643 * to specify your own buffer, consider gtk_text_view_new_with_buffer().
644 * Returns:
645 * a new GtkTextView
647 public this ()
649 // GtkWidget* gtk_text_view_new (void);
650 this(cast(GtkTextView*)gtk_text_view_new() );
654 * Creates a new GtkTextView widget displaying the buffer
655 * buffer. One buffer can be shared among many widgets.
656 * buffer may be NULL to create a default buffer, in which case
657 * this function is equivalent to gtk_text_view_new(). The
658 * text view adds its own reference count to the buffer; it does not
659 * take over an existing reference.
660 * buffer:
661 * a GtkTextBuffer
662 * Returns:
663 * a new GtkTextView.
665 public this (TextBuffer buffer)
667 // GtkWidget* gtk_text_view_new_with_buffer (GtkTextBuffer *buffer);
668 this(cast(GtkTextView*)gtk_text_view_new_with_buffer((buffer is null) ? null : buffer.getTextBufferStruct()) );
672 * Sets buffer as the buffer being displayed by text_view. The previous
673 * buffer displayed by the text view is unreferenced, and a reference is
674 * added to buffer. If you owned a reference to buffer before passing it
675 * to this function, you must remove that reference yourself; GtkTextView
676 * will not "adopt" it.
677 * text_view:
678 * a GtkTextView
679 * buffer:
680 * a GtkTextBuffer
682 public void setBuffer(TextBuffer buffer)
684 // void gtk_text_view_set_buffer (GtkTextView *text_view, GtkTextBuffer *buffer);
685 gtk_text_view_set_buffer(gtkTextView, (buffer is null) ? null : buffer.getTextBufferStruct());
689 * Returns the GtkTextBuffer being displayed by this text view.
690 * The reference count on the buffer is not incremented; the caller
691 * of this function won't own a new reference.
692 * text_view:
693 * a GtkTextView
694 * Returns:
695 * a GtkTextBuffer
697 public TextBuffer getBuffer()
699 // GtkTextBuffer* gtk_text_view_get_buffer (GtkTextView *text_view);
700 return new TextBuffer( gtk_text_view_get_buffer(gtkTextView) );
704 * Scrolls text_view so that mark is on the screen in the position
705 * indicated by xalign and yalign. An alignment of 0.0 indicates
706 * left or top, 1.0 indicates right or bottom, 0.5 means center. If use_align
707 * is FALSE, the text scrolls the minimal distance to get the mark onscreen,
708 * possibly not scrolling at all. The effective screen for purposes
709 * of this function is reduced by a margin of size within_margin.
710 * text_view:
711 * a GtkTextView
712 * mark:
713 * a GtkTextMark
714 * within_margin:
715 * margin as a [0.0,0.5) fraction of screen size
716 * use_align:
717 * whether to use alignment arguments (if FALSE, just get the mark onscreen)
718 * xalign:
719 * horizontal alignment of mark within visible area.
720 * yalign:
721 * vertical alignment of mark within visible area
723 public void scrollToMark(TextMark mark, double withinMargin, int useAlign, double xalign, double yalign)
725 // void gtk_text_view_scroll_to_mark (GtkTextView *text_view, GtkTextMark *mark, gdouble within_margin, gboolean use_align, gdouble xalign, gdouble yalign);
726 gtk_text_view_scroll_to_mark(gtkTextView, (mark is null) ? null : mark.getTextMarkStruct(), withinMargin, useAlign, xalign, yalign);
730 * Scrolls text_view so that iter is on the screen in the position
731 * indicated by xalign and yalign. An alignment of 0.0 indicates
732 * left or top, 1.0 indicates right or bottom, 0.5 means center. If use_align
733 * is FALSE, the text scrolls the minimal distance to get the mark onscreen,
734 * possibly not scrolling at all. The effective screen for purposes
735 * of this function is reduced by a margin of size within_margin.
736 * NOTE: This function uses the currently-computed height of the
737 * lines in the text buffer. Note that line heights are computed
738 * in an idle handler; so this function may not have the desired effect
739 * if it's called before the height computations. To avoid oddness,
740 * consider using gtk_text_view_scroll_to_mark() which saves a point
741 * to be scrolled to after line validation.
742 * text_view:
743 * a GtkTextView
744 * iter:
745 * a GtkTextIter
746 * within_margin:
747 * margin as a [0.0,0.5) fraction of screen size
748 * use_align:
749 * whether to use alignment arguments (if FALSE, just get the mark onscreen)
750 * xalign:
751 * horizontal alignment of mark within visible area.
752 * yalign:
753 * vertical alignment of mark within visible area
754 * Returns:
755 * TRUE if scrolling occurred
757 public int scrollToIter(TextIter iter, double withinMargin, int useAlign, double xalign, double yalign)
759 // gboolean gtk_text_view_scroll_to_iter (GtkTextView *text_view, GtkTextIter *iter, gdouble within_margin, gboolean use_align, gdouble xalign, gdouble yalign);
760 return gtk_text_view_scroll_to_iter(gtkTextView, (iter is null) ? null : iter.getTextIterStruct(), withinMargin, useAlign, xalign, yalign);
764 * Scrolls text_view the minimum distance such that mark is contained
765 * within the visible area of the widget.
766 * text_view:
767 * a GtkTextView
768 * mark:
769 * a mark in the buffer for text_view
771 public void scrollMarkOnscreen(TextMark mark)
773 // void gtk_text_view_scroll_mark_onscreen (GtkTextView *text_view, GtkTextMark *mark);
774 gtk_text_view_scroll_mark_onscreen(gtkTextView, (mark is null) ? null : mark.getTextMarkStruct());
778 * Moves a mark within the buffer so that it's
779 * located within the currently-visible text area.
780 * text_view:
781 * a GtkTextView
782 * mark:
783 * a GtkTextMark
784 * Returns:
785 * TRUE if the mark moved (wasn't already onscreen)
787 public int moveMarkOnscreen(TextMark mark)
789 // gboolean gtk_text_view_move_mark_onscreen (GtkTextView *text_view, GtkTextMark *mark);
790 return gtk_text_view_move_mark_onscreen(gtkTextView, (mark is null) ? null : mark.getTextMarkStruct());
794 * Moves the cursor to the currently visible region of the
795 * buffer, it it isn't there already.
796 * text_view:
797 * a GtkTextView
798 * Returns:
799 * TRUE if the cursor had to be moved.
801 public int placeCursorOnscreen()
803 // gboolean gtk_text_view_place_cursor_onscreen (GtkTextView *text_view);
804 return gtk_text_view_place_cursor_onscreen(gtkTextView);
808 * Fills visible_rect with the currently-visible
809 * region of the buffer, in buffer coordinates. Convert to window coordinates
810 * with gtk_text_view_buffer_to_window_coords().
811 * text_view:
812 * a GtkTextView
813 * visible_rect:
814 * rectangle to fill
816 public void getVisibleRect(Rectangle visibleRect)
818 // void gtk_text_view_get_visible_rect (GtkTextView *text_view, GdkRectangle *visible_rect);
819 gtk_text_view_get_visible_rect(gtkTextView, (visibleRect is null) ? null : visibleRect.getRectangleStruct());
823 * Gets a rectangle which roughly contains the character at iter.
824 * The rectangle position is in buffer coordinates; use
825 * gtk_text_view_buffer_to_window_coords() to convert these
826 * coordinates to coordinates for one of the windows in the text view.
827 * text_view:
828 * a GtkTextView
829 * iter:
830 * a GtkTextIter
831 * location:
832 * bounds of the character at iter
834 public void getIterLocation(TextIter iter, Rectangle location)
836 // void gtk_text_view_get_iter_location (GtkTextView *text_view, const GtkTextIter *iter, GdkRectangle *location);
837 gtk_text_view_get_iter_location(gtkTextView, (iter is null) ? null : iter.getTextIterStruct(), (location is null) ? null : location.getRectangleStruct());
841 * Gets the GtkTextIter at the start of the line containing
842 * the coordinate y. y is in buffer coordinates, convert from
843 * window coordinates with gtk_text_view_window_to_buffer_coords().
844 * If non-NULL, line_top will be filled with the coordinate of the top
845 * edge of the line.
846 * text_view:
847 * a GtkTextView
848 * target_iter:
849 * a GtkTextIter
850 * y:
851 * a y coordinate
852 * line_top:
853 * return location for top coordinate of the line
855 public void getLineAtY(TextIter targetIter, int y, int* lineTop)
857 // void gtk_text_view_get_line_at_y (GtkTextView *text_view, GtkTextIter *target_iter, gint y, gint *line_top);
858 gtk_text_view_get_line_at_y(gtkTextView, (targetIter is null) ? null : targetIter.getTextIterStruct(), y, lineTop);
862 * Gets the y coordinate of the top of the line containing iter,
863 * and the height of the line. The coordinate is a buffer coordinate;
864 * convert to window coordinates with gtk_text_view_buffer_to_window_coords().
865 * text_view:
866 * a GtkTextView
867 * iter:
868 * a GtkTextIter
869 * y:
870 * return location for a y coordinate
871 * height:
872 * return location for a height
874 public void getLineYrange(TextIter iter, int* y, int* height)
876 // void gtk_text_view_get_line_yrange (GtkTextView *text_view, const GtkTextIter *iter, gint *y, gint *height);
877 gtk_text_view_get_line_yrange(gtkTextView, (iter is null) ? null : iter.getTextIterStruct(), y, height);
881 * Retrieves the iterator at buffer coordinates x and y. Buffer
882 * coordinates are coordinates for the entire buffer, not just the
883 * currently-displayed portion. If you have coordinates from an
884 * event, you have to convert those to buffer coordinates with
885 * gtk_text_view_window_to_buffer_coords().
886 * text_view:
887 * a GtkTextView
888 * iter:
889 * a GtkTextIter
890 * x:
891 * x position, in buffer coordinates
892 * y:
893 * y position, in buffer coordinates
895 public void getIterAtLocation(TextIter iter, int x, int y)
897 // void gtk_text_view_get_iter_at_location (GtkTextView *text_view, GtkTextIter *iter, gint x, gint y);
898 gtk_text_view_get_iter_at_location(gtkTextView, (iter is null) ? null : iter.getTextIterStruct(), x, y);
902 * Retrieves the iterator pointing to the character at buffer
903 * coordinates x and y. Buffer coordinates are coordinates for
904 * the entire buffer, not just the currently-displayed portion.
905 * If you have coordinates from an event, you have to convert
906 * those to buffer coordinates with
907 * gtk_text_view_window_to_buffer_coords().
908 * Note that this is different from gtk_text_view_get_iter_at_location(),
909 * which returns cursor locations, i.e. positions between
910 * characters.
911 * text_view:
912 * a GtkTextView
913 * iter:
914 * a GtkTextIter
915 * trailing:
916 * location to store an integer indicating where
917 * in the grapheme the user clicked. It will either be
918 * zero, or the number of characters in the grapheme.
919 * 0 represents the trailing edge of the grapheme.
920 * x:
921 * x position, in buffer coordinates
922 * y:
923 * y position, in buffer coordinates
924 * Since 2.6
926 public void getIterAtPosition(TextIter iter, int* trailing, int x, int y)
928 // void gtk_text_view_get_iter_at_position (GtkTextView *text_view, GtkTextIter *iter, gint *trailing, gint x, gint y);
929 gtk_text_view_get_iter_at_position(gtkTextView, (iter is null) ? null : iter.getTextIterStruct(), trailing, x, y);
933 * Converts coordinate (buffer_x, buffer_y) to coordinates for the window
934 * win, and stores the result in (window_x, window_y).
935 * Note that you can't convert coordinates for a nonexisting window (see
936 * gtk_text_view_set_border_window_size()).
937 * text_view:
938 * a GtkTextView
939 * win:
940 * a GtkTextWindowType except GTK_TEXT_WINDOW_PRIVATE
941 * buffer_x:
942 * buffer x coordinate
943 * buffer_y:
944 * buffer y coordinate
945 * window_x:
946 * window x coordinate return location
947 * window_y:
948 * window y coordinate return location
950 public void bufferToWindowCoords(GtkTextWindowType win, int bufferX, int bufferY, int* windowX, int* windowY)
952 // 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);
953 gtk_text_view_buffer_to_window_coords(gtkTextView, win, bufferX, bufferY, windowX, windowY);
957 * Converts coordinates on the window identified by win to buffer
958 * coordinates, storing the result in (buffer_x,buffer_y).
959 * Note that you can't convert coordinates for a nonexisting window (see
960 * gtk_text_view_set_border_window_size()).
961 * text_view:
962 * a GtkTextView
963 * win:
964 * a GtkTextWindowType except GTK_TEXT_WINDOW_PRIVATE
965 * window_x:
966 * window x coordinate
967 * window_y:
968 * window y coordinate
969 * buffer_x:
970 * buffer x coordinate return location
971 * buffer_y:
972 * buffer y coordinate return location
974 public void windowToBufferCoords(GtkTextWindowType win, int windowX, int windowY, int* bufferX, int* bufferY)
976 // 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);
977 gtk_text_view_window_to_buffer_coords(gtkTextView, win, windowX, windowY, bufferX, bufferY);
981 * Retrieves the GdkWindow corresponding to an area of the text view;
982 * possible windows include the overall widget window, child windows
983 * on the left, right, top, bottom, and the window that displays the
984 * text buffer. Windows are NULL and nonexistent if their width or
985 * height is 0, and are nonexistent before the widget has been
986 * realized.
987 * text_view:
988 * a GtkTextView
989 * win:
990 * window to get
991 * Returns:
992 * a GdkWindow, or NULL
994 public Window getWindow(GtkTextWindowType win)
996 // GdkWindow* gtk_text_view_get_window (GtkTextView *text_view, GtkTextWindowType win);
997 return new Window( gtk_text_view_get_window(gtkTextView, win) );
1001 * Usually used to find out which window an event corresponds to.
1002 * If you connect to an event signal on text_view, this function
1003 * should be called on event->window to
1004 * see which window it was.
1005 * text_view:
1006 * a GtkTextView
1007 * window:
1008 * a window type
1009 * Returns:
1010 * the window type.
1012 public GtkTextWindowType getWindowType(Window window)
1014 // GtkTextWindowType gtk_text_view_get_window_type (GtkTextView *text_view, GdkWindow *window);
1015 return gtk_text_view_get_window_type(gtkTextView, (window is null) ? null : window.getWindowStruct());
1019 * Sets the width of GTK_TEXT_WINDOW_LEFT or GTK_TEXT_WINDOW_RIGHT,
1020 * or the height of GTK_TEXT_WINDOW_TOP or GTK_TEXT_WINDOW_BOTTOM.
1021 * Automatically destroys the corresponding window if the size is set
1022 * to 0, and creates the window if the size is set to non-zero. This
1023 * function can only be used for the "border windows," it doesn't work
1024 * with GTK_TEXT_WINDOW_WIDGET, GTK_TEXT_WINDOW_TEXT, or
1025 * GTK_TEXT_WINDOW_PRIVATE.
1026 * text_view:
1027 * a GtkTextView
1028 * type:
1029 * window to affect
1030 * size:
1031 * width or height of the window
1033 public void setBorderWindowSize(GtkTextWindowType type, int size)
1035 // void gtk_text_view_set_border_window_size (GtkTextView *text_view, GtkTextWindowType type, gint size);
1036 gtk_text_view_set_border_window_size(gtkTextView, type, size);
1040 * Gets the width of the specified border window. See
1041 * gtk_text_view_set_border_window_size().
1042 * text_view:
1043 * a GtkTextView
1044 * type:
1045 * window to return size from
1046 * Returns:
1047 * width of window
1049 public int getBorderWindowSize(GtkTextWindowType type)
1051 // gint gtk_text_view_get_border_window_size (GtkTextView *text_view, GtkTextWindowType type);
1052 return gtk_text_view_get_border_window_size(gtkTextView, type);
1056 * Moves the given iter forward by one display (wrapped) line. A
1057 * display line is different from a paragraph. Paragraphs are
1058 * separated by newlines or other paragraph separator characters.
1059 * Display lines are created by line-wrapping a paragraph. If
1060 * wrapping is turned off, display lines and paragraphs will be the
1061 * same. Display lines are divided differently for each view, since
1062 * they depend on the view's width; paragraphs are the same in all
1063 * views, since they depend on the contents of the GtkTextBuffer.
1064 * text_view:
1065 * a GtkTextView
1066 * iter:
1067 * a GtkTextIter
1068 * Returns:
1069 * TRUE if iter was moved and is not on the end iterator
1071 public int forwardDisplayLine(TextIter iter)
1073 // gboolean gtk_text_view_forward_display_line (GtkTextView *text_view, GtkTextIter *iter);
1074 return gtk_text_view_forward_display_line(gtkTextView, (iter is null) ? null : iter.getTextIterStruct());
1078 * Moves the given iter backward by one display (wrapped) line. A
1079 * display line is different from a paragraph. Paragraphs are
1080 * separated by newlines or other paragraph separator characters.
1081 * Display lines are created by line-wrapping a paragraph. If
1082 * wrapping is turned off, display lines and paragraphs will be the
1083 * same. Display lines are divided differently for each view, since
1084 * they depend on the view's width; paragraphs are the same in all
1085 * views, since they depend on the contents of the GtkTextBuffer.
1086 * text_view:
1087 * a GtkTextView
1088 * iter:
1089 * a GtkTextIter
1090 * Returns:
1091 * TRUE if iter was moved and is not on the end iterator
1093 public int backwardDisplayLine(TextIter iter)
1095 // gboolean gtk_text_view_backward_display_line (GtkTextView *text_view, GtkTextIter *iter);
1096 return gtk_text_view_backward_display_line(gtkTextView, (iter is null) ? null : iter.getTextIterStruct());
1100 * Moves the given iter forward to the next display line end. A
1101 * display line is different from a paragraph. Paragraphs are
1102 * separated by newlines or other paragraph separator characters.
1103 * Display lines are created by line-wrapping a paragraph. If
1104 * wrapping is turned off, display lines and paragraphs will be the
1105 * same. Display lines are divided differently for each view, since
1106 * they depend on the view's width; paragraphs are the same in all
1107 * views, since they depend on the contents of the GtkTextBuffer.
1108 * text_view:
1109 * a GtkTextView
1110 * iter:
1111 * a GtkTextIter
1112 * Returns:
1113 * TRUE if iter was moved and is not on the end iterator
1115 public int forwardDisplayLineEnd(TextIter iter)
1117 // gboolean gtk_text_view_forward_display_line_end (GtkTextView *text_view, GtkTextIter *iter);
1118 return gtk_text_view_forward_display_line_end(gtkTextView, (iter is null) ? null : iter.getTextIterStruct());
1122 * Moves the given iter backward to the next display line start. A
1123 * display line is different from a paragraph. Paragraphs are
1124 * separated by newlines or other paragraph separator characters.
1125 * Display lines are created by line-wrapping a paragraph. If
1126 * wrapping is turned off, display lines and paragraphs will be the
1127 * same. Display lines are divided differently for each view, since
1128 * they depend on the view's width; paragraphs are the same in all
1129 * views, since they depend on the contents of the GtkTextBuffer.
1130 * text_view:
1131 * a GtkTextView
1132 * iter:
1133 * a GtkTextIter
1134 * Returns:
1135 * TRUE if iter was moved and is not on the end iterator
1137 public int backwardDisplayLineStart(TextIter iter)
1139 // gboolean gtk_text_view_backward_display_line_start (GtkTextView *text_view, GtkTextIter *iter);
1140 return gtk_text_view_backward_display_line_start(gtkTextView, (iter is null) ? null : iter.getTextIterStruct());
1144 * Determines whether iter is at the start of a display line.
1145 * See gtk_text_view_forward_display_line() for an explanation of
1146 * display lines vs. paragraphs.
1147 * text_view:
1148 * a GtkTextView
1149 * iter:
1150 * a GtkTextIter
1151 * Returns:
1152 * TRUE if iter begins a wrapped line
1154 public int startsDisplayLine(TextIter iter)
1156 // gboolean gtk_text_view_starts_display_line (GtkTextView *text_view, const GtkTextIter *iter);
1157 return gtk_text_view_starts_display_line(gtkTextView, (iter is null) ? null : iter.getTextIterStruct());
1161 * Move the iterator a given number of characters visually, treating
1162 * it as the strong cursor position. If count is positive, then the
1163 * new strong cursor position will be count positions to the right of
1164 * the old cursor position. If count is negative then the new strong
1165 * cursor position will be count positions to the left of the old
1166 * cursor position.
1167 * In the presence of bidirection text, the correspondence
1168 * between logical and visual order will depend on the direction
1169 * of the current run, and there may be jumps when the cursor
1170 * is moved off of the end of a run.
1171 * text_view:
1172 * a GtkTextView
1173 * iter:
1174 * a GtkTextIter
1175 * count:
1176 * number of characters to move (negative moves left, positive moves right)
1177 * Returns:
1178 * TRUE if iter moved and is not on the end iterator
1180 public int moveVisually(TextIter iter, int count)
1182 // gboolean gtk_text_view_move_visually (GtkTextView *text_view, GtkTextIter *iter, gint count);
1183 return gtk_text_view_move_visually(gtkTextView, (iter is null) ? null : iter.getTextIterStruct(), count);
1187 * Adds a child widget in the text buffer, at the given anchor.
1188 * text_view:
1189 * a GtkTextView
1190 * child:
1191 * a GtkWidget
1192 * anchor:
1193 * a GtkTextChildAnchor in the GtkTextBuffer for text_view
1195 public void addChildAtAnchor(Widget child, TextChildAnchor anchor)
1197 // void gtk_text_view_add_child_at_anchor (GtkTextView *text_view, GtkWidget *child, GtkTextChildAnchor *anchor);
1198 gtk_text_view_add_child_at_anchor(gtkTextView, (child is null) ? null : child.getWidgetStruct(), (anchor is null) ? null : anchor.getTextChildAnchorStruct());
1206 * Adds a child at fixed coordinates in one of the text widget's
1207 * windows. The window must have nonzero size (see
1208 * gtk_text_view_set_border_window_size()). Note that the child
1209 * coordinates are given relative to the GdkWindow in question, and
1210 * that these coordinates have no sane relationship to scrolling. When
1211 * placing a child in GTK_TEXT_WINDOW_WIDGET, scrolling is
1212 * irrelevant, the child floats above all scrollable areas. But when
1213 * placing a child in one of the scrollable windows (border windows or
1214 * text window), you'll need to compute the child's correct position
1215 * in buffer coordinates any time scrolling occurs or buffer changes
1216 * occur, and then call gtk_text_view_move_child() to update the
1217 * child's position. Unfortunately there's no good way to detect that
1218 * scrolling has occurred, using the current API; a possible hack
1219 * would be to update all child positions when the scroll adjustments
1220 * change or the text buffer changes. See bug 64518 on
1221 * bugzilla.gnome.org for status of fixing this issue.
1222 * text_view:
1223 * a GtkTextView
1224 * child:
1225 * a GtkWidget
1226 * which_window:
1227 * which window the child should appear in
1228 * xpos:
1229 * X position of child in window coordinates
1230 * ypos:
1231 * Y position of child in window coordinates
1233 public void addChildInWindow(Widget child, GtkTextWindowType whichWindow, int xpos, int ypos)
1235 // void gtk_text_view_add_child_in_window (GtkTextView *text_view, GtkWidget *child, GtkTextWindowType which_window, gint xpos, gint ypos);
1236 gtk_text_view_add_child_in_window(gtkTextView, (child is null) ? null : child.getWidgetStruct(), whichWindow, xpos, ypos);
1240 * Updates the position of a child, as for gtk_text_view_add_child_in_window().
1241 * text_view:
1242 * a GtkTextView
1243 * child:
1244 * child widget already added to the text view
1245 * xpos:
1246 * new X position in window coordinates
1247 * ypos:
1248 * new Y position in window coordinates
1250 public void moveChild(Widget child, int xpos, int ypos)
1252 // void gtk_text_view_move_child (GtkTextView *text_view, GtkWidget *child, gint xpos, gint ypos);
1253 gtk_text_view_move_child(gtkTextView, (child is null) ? null : child.getWidgetStruct(), xpos, ypos);
1257 * Sets the line wrapping for the view.
1258 * text_view:
1259 * a GtkTextView
1260 * wrap_mode:
1261 * a GtkWrapMode
1263 public void setWrapMode(GtkWrapMode wrapMode)
1265 // void gtk_text_view_set_wrap_mode (GtkTextView *text_view, GtkWrapMode wrap_mode);
1266 gtk_text_view_set_wrap_mode(gtkTextView, wrapMode);
1270 * Gets the line wrapping for the view.
1271 * text_view:
1272 * a GtkTextView
1273 * Returns:
1274 * the line wrap setting
1276 public GtkWrapMode getWrapMode()
1278 // GtkWrapMode gtk_text_view_get_wrap_mode (GtkTextView *text_view);
1279 return gtk_text_view_get_wrap_mode(gtkTextView);
1283 * Sets the default editability of the GtkTextView. You can override
1284 * this default setting with tags in the buffer, using the "editable"
1285 * attribute of tags.
1286 * text_view:
1287 * a GtkTextView
1288 * setting:
1289 * whether it's editable
1291 public void setEditable(int setting)
1293 // void gtk_text_view_set_editable (GtkTextView *text_view, gboolean setting);
1294 gtk_text_view_set_editable(gtkTextView, setting);
1298 * Returns the default editability of the GtkTextView. Tags in the
1299 * buffer may override this setting for some ranges of text.
1300 * text_view:
1301 * a GtkTextView
1302 * Returns:
1303 * whether text is editable by default
1305 public int getEditable()
1307 // gboolean gtk_text_view_get_editable (GtkTextView *text_view);
1308 return gtk_text_view_get_editable(gtkTextView);
1312 * Toggles whether the insertion point is displayed. A buffer with no editable
1313 * text probably shouldn't have a visible cursor, so you may want to turn
1314 * the cursor off.
1315 * text_view:
1316 * a GtkTextView
1317 * setting:
1318 * whether to show the insertion cursor
1320 public void setCursorVisible(int setting)
1322 // void gtk_text_view_set_cursor_visible (GtkTextView *text_view, gboolean setting);
1323 gtk_text_view_set_cursor_visible(gtkTextView, setting);
1327 * Find out whether the cursor is being displayed.
1328 * text_view:
1329 * a GtkTextView
1330 * Returns:
1331 * whether the insertion mark is visible
1333 public int getCursorVisible()
1335 // gboolean gtk_text_view_get_cursor_visible (GtkTextView *text_view);
1336 return gtk_text_view_get_cursor_visible(gtkTextView);
1340 * Changes the GtkTextView overwrite mode.
1341 * text_view:
1342 * a GtkTextView
1343 * overwrite:
1344 * TRUE to turn on overwrite mode, FALSE to turn it off
1345 * Since 2.4
1347 public void setOverwrite(int overwrite)
1349 // void gtk_text_view_set_overwrite (GtkTextView *text_view, gboolean overwrite);
1350 gtk_text_view_set_overwrite(gtkTextView, overwrite);
1354 * Returns whether the GtkTextView is in overwrite mode or not.
1355 * text_view:
1356 * a GtkTextView
1357 * Returns:
1358 * whether text_view is in overwrite mode or not.
1359 * Since 2.4
1361 public int getOverwrite()
1363 // gboolean gtk_text_view_get_overwrite (GtkTextView *text_view);
1364 return gtk_text_view_get_overwrite(gtkTextView);
1368 * Sets the default number of blank pixels above paragraphs in text_view.
1369 * Tags in the buffer for text_view may override the defaults.
1370 * text_view:
1371 * a GtkTextView
1372 * pixels_above_lines:
1373 * pixels above paragraphs
1375 public void setPixelsAboveLines(int pixelsAboveLines)
1377 // void gtk_text_view_set_pixels_above_lines (GtkTextView *text_view, gint pixels_above_lines);
1378 gtk_text_view_set_pixels_above_lines(gtkTextView, pixelsAboveLines);
1382 * Gets the default number of pixels to put above paragraphs.
1383 * text_view:
1384 * a GtkTextView
1385 * Returns:
1386 * default number of pixels above paragraphs
1388 public int getPixelsAboveLines()
1390 // gint gtk_text_view_get_pixels_above_lines (GtkTextView *text_view);
1391 return gtk_text_view_get_pixels_above_lines(gtkTextView);
1395 * Sets the default number of pixels of blank space
1396 * to put below paragraphs in text_view. May be overridden
1397 * by tags applied to text_view's buffer.
1398 * text_view:
1399 * a GtkTextView
1400 * pixels_below_lines:
1401 * pixels below paragraphs
1403 public void setPixelsBelowLines(int pixelsBelowLines)
1405 // void gtk_text_view_set_pixels_below_lines (GtkTextView *text_view, gint pixels_below_lines);
1406 gtk_text_view_set_pixels_below_lines(gtkTextView, pixelsBelowLines);
1410 * Gets the value set by gtk_text_view_set_pixels_below_lines().
1411 * text_view:
1412 * a GtkTextView
1413 * Returns:
1414 * default number of blank pixels below paragraphs
1416 public int getPixelsBelowLines()
1418 // gint gtk_text_view_get_pixels_below_lines (GtkTextView *text_view);
1419 return gtk_text_view_get_pixels_below_lines(gtkTextView);
1423 * Sets the default number of pixels of blank space to leave between
1424 * display/wrapped lines within a paragraph. May be overridden by
1425 * tags in text_view's buffer.
1426 * text_view:
1427 * a GtkTextView
1428 * pixels_inside_wrap:
1429 * default number of pixels between wrapped lines
1431 public void setPixelsInsideWrap(int pixelsInsideWrap)
1433 // void gtk_text_view_set_pixels_inside_wrap (GtkTextView *text_view, gint pixels_inside_wrap);
1434 gtk_text_view_set_pixels_inside_wrap(gtkTextView, pixelsInsideWrap);
1438 * Gets the value set by gtk_text_view_set_pixels_inside_wrap().
1439 * text_view:
1440 * a GtkTextView
1441 * Returns:
1442 * default number of pixels of blank space between wrapped lines
1444 public int getPixelsInsideWrap()
1446 // gint gtk_text_view_get_pixels_inside_wrap (GtkTextView *text_view);
1447 return gtk_text_view_get_pixels_inside_wrap(gtkTextView);
1451 * Sets the default justification of text in text_view.
1452 * Tags in the view's buffer may override the default.
1453 * text_view:
1454 * a GtkTextView
1455 * justification:
1456 * justification
1458 public void setJustification(GtkJustification justification)
1460 // void gtk_text_view_set_justification (GtkTextView *text_view, GtkJustification justification);
1461 gtk_text_view_set_justification(gtkTextView, justification);
1465 * Gets the default justification of paragraphs in text_view.
1466 * Tags in the buffer may override the default.
1467 * text_view:
1468 * a GtkTextView
1469 * Returns:
1470 * default justification
1472 public GtkJustification getJustification()
1474 // GtkJustification gtk_text_view_get_justification (GtkTextView *text_view);
1475 return gtk_text_view_get_justification(gtkTextView);
1479 * Sets the default left margin for text in text_view.
1480 * Tags in the buffer may override the default.
1481 * text_view:
1482 * a GtkTextView
1483 * left_margin:
1484 * left margin in pixels
1486 public void setLeftMargin(int leftMargin)
1488 // void gtk_text_view_set_left_margin (GtkTextView *text_view, gint left_margin);
1489 gtk_text_view_set_left_margin(gtkTextView, leftMargin);
1493 * Gets the default left margin size of paragraphs in the text_view.
1494 * Tags in the buffer may override the default.
1495 * text_view:
1496 * a GtkTextView
1497 * Returns:
1498 * left margin in pixels
1500 public int getLeftMargin()
1502 // gint gtk_text_view_get_left_margin (GtkTextView *text_view);
1503 return gtk_text_view_get_left_margin(gtkTextView);
1507 * Sets the default right margin for text in the text view.
1508 * Tags in the buffer may override the default.
1509 * text_view:
1510 * a GtkTextView
1511 * right_margin:
1512 * right margin in pixels
1514 public void setRightMargin(int rightMargin)
1516 // void gtk_text_view_set_right_margin (GtkTextView *text_view, gint right_margin);
1517 gtk_text_view_set_right_margin(gtkTextView, rightMargin);
1521 * Gets the default right margin for text in text_view. Tags
1522 * in the buffer may override the default.
1523 * text_view:
1524 * a GtkTextView
1525 * Returns:
1526 * right margin in pixels
1528 public int getRightMargin()
1530 // gint gtk_text_view_get_right_margin (GtkTextView *text_view);
1531 return gtk_text_view_get_right_margin(gtkTextView);
1535 * Sets the default indentation for paragraphs in text_view.
1536 * Tags in the buffer may override the default.
1537 * text_view:
1538 * a GtkTextView
1539 * indent:
1540 * indentation in pixels
1542 public void setIndent(int indent)
1544 // void gtk_text_view_set_indent (GtkTextView *text_view, gint indent);
1545 gtk_text_view_set_indent(gtkTextView, indent);
1549 * Gets the default indentation of paragraphs in text_view.
1550 * Tags in the view's buffer may override the default.
1551 * The indentation may be negative.
1552 * text_view:
1553 * a GtkTextView
1554 * Returns:
1555 * number of pixels of indentation
1557 public int getIndent()
1559 // gint gtk_text_view_get_indent (GtkTextView *text_view);
1560 return gtk_text_view_get_indent(gtkTextView);
1564 * Sets the default tab stops for paragraphs in text_view.
1565 * Tags in the buffer may override the default.
1566 * text_view:
1567 * a GtkTextView
1568 * tabs:
1569 * tabs as a PangoTabArray
1571 public void setTabs(PgTabArray tabs)
1573 // void gtk_text_view_set_tabs (GtkTextView *text_view, PangoTabArray *tabs);
1574 gtk_text_view_set_tabs(gtkTextView, (tabs is null) ? null : tabs.getPgTabArrayStruct());
1578 * Gets the default tabs for text_view. Tags in the buffer may
1579 * override the defaults. The returned array will be NULL if
1580 * "standard" (8-space) tabs are used. Free the return value
1581 * with pango_tab_array_free().
1582 * text_view:
1583 * a GtkTextView
1584 * Returns:
1585 * copy of default tab array, or NULL if "standard" tabs are used; must be freed with pango_tab_array_free().
1587 public PgTabArray getTabs()
1589 // PangoTabArray* gtk_text_view_get_tabs (GtkTextView *text_view);
1590 return new PgTabArray( gtk_text_view_get_tabs(gtkTextView) );
1594 * Sets the behavior of the text widget when the Tab key is pressed. If accepts_tab
1595 * is TRUE a tab character is inserted. If accepts_tab is FALSE the keyboard focus
1596 * is moved to the next widget in the focus chain.
1597 * text_view:
1598 * A GtkTextView
1599 * accepts_tab:
1600 * TRUE if pressing the Tab key should insert a tab character, FALSE, if pressing the Tab key should move the keyboard focus.
1601 * Since 2.4
1603 public void setAcceptsTab(int acceptsTab)
1605 // void gtk_text_view_set_accepts_tab (GtkTextView *text_view, gboolean accepts_tab);
1606 gtk_text_view_set_accepts_tab(gtkTextView, acceptsTab);
1610 * Returns whether pressing the Tab key inserts a tab characters.
1611 * gtk_text_view_set_accepts_tab().
1612 * text_view:
1613 * A GtkTextView
1614 * Returns:
1615 * TRUE if pressing the Tab key inserts a tab character, FALSE if pressing the Tab key moves the keyboard focus.
1616 * Since 2.4
1618 public int getAcceptsTab()
1620 // gboolean gtk_text_view_get_accepts_tab (GtkTextView *text_view);
1621 return gtk_text_view_get_accepts_tab(gtkTextView);
1625 * Obtains a copy of the default text attributes. These are the
1626 * attributes used for text unless a tag overrides them.
1627 * You'd typically pass the default attributes in to
1628 * gtk_text_iter_get_attributes() in order to get the
1629 * attributes in effect at a given text position.
1630 * The return value is a copy owned by the caller of this function,
1631 * and should be freed.
1632 * text_view:
1633 * a GtkTextView
1634 * Returns:
1635 * a new GtkTextAttributes
1637 public TextAttributes getDefaultAttributes()
1639 // GtkTextAttributes* gtk_text_view_get_default_attributes (GtkTextView *text_view);
1640 return new TextAttributes( gtk_text_view_get_default_attributes(gtkTextView) );