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  = GtkSourceView.html
27  * outPack = gsv
28  * outFile = SourceView
29  * strct   = GtkSourceView
30  * realStrct=
31  * ctorStrct=
32  * clss    = SourceView
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_source_view_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.Str
47  * 	- gdk.Event
48  * 	- gsv.SourceBuffer
49  * 	- gsv.SourceCompletion
50  * 	- gsv.SourceGutter
51  * 	- gsv.SourceMarkAttributes
52  * 	- gtk.TextIter
53  * 	- gtkc.gtk
54  * structWrap:
55  * 	- GdkEvent* -> Event
56  * 	- GtkSourceBuffer* -> SourceBuffer
57  * 	- GtkSourceCompletion* -> SourceCompletion
58  * 	- GtkSourceGutter* -> SourceGutter
59  * 	- GtkSourceMarkAttributes* -> SourceMarkAttributes
60  * 	- GtkTextIter* -> TextIter
61  * module aliases:
62  * local aliases:
63  * overrides:
64  */
65 
66 module gsv.SourceView;
67 
68 public  import gsvc.gsvtypes;
69 
70 private import gsvc.gsv;
71 private import glib.ConstructionException;
72 private import gobject.ObjectG;
73 
74 private import gobject.Signals;
75 public  import gtkc.gdktypes;
76 
77 private import glib.Str;
78 private import gdk.Event;
79 private import gsv.SourceBuffer;
80 private import gsv.SourceCompletion;
81 private import gsv.SourceGutter;
82 private import gsv.SourceMarkAttributes;
83 private import gtk.TextIter;
84 private import gtkc.gtk;
85 
86 
87 
88 private import gtk.TextView;
89 
90 /**
91  * GtkSourceView is the main object of the GtkSourceView library. It provides
92  * a text view with syntax highlighting, undo/redo and text marks. Use a
93  * GtkSourceBuffer to display text with a GtkSourceView.
94  */
95 public class SourceView : TextView
96 {
97 	
98 	/** the main Gtk struct */
99 	protected GtkSourceView* gtkSourceView;
100 	
101 	
102 	public GtkSourceView* getSourceViewStruct()
103 	{
104 		return gtkSourceView;
105 	}
106 	
107 	
108 	/** the main Gtk struct as a void* */
109 	protected override void* getStruct()
110 	{
111 		return cast(void*)gtkSourceView;
112 	}
113 	
114 	/**
115 	 * Sets our main struct and passes it to the parent class
116 	 */
117 	public this (GtkSourceView* gtkSourceView)
118 	{
119 		super(cast(GtkTextView*)gtkSourceView);
120 		this.gtkSourceView = gtkSourceView;
121 	}
122 	
123 	protected override void setStruct(GObject* obj)
124 	{
125 		super.setStruct(obj);
126 		gtkSourceView = cast(GtkSourceView*)obj;
127 	}
128 	
129 	/**
130 	 * Returns the GtkSourceBuffer being displayed by this source view.
131 	 * The reference count on the buffer is not incremented; the caller
132 	 * of this function won't own a new reference.
133 	 * Returns:
134 	 *  a GtkSourceBuffer
135 	 */
136 	public override SourceBuffer getBuffer()
137 	{
138 		// GtkSourceBuffer* gtk_text_view_get_buffer (GtkTextView *text_view);
139 		auto p = gtk_text_view_get_buffer(cast(GtkTextView*)gtkSourceView);
140 		
141 		if(p is null)
142 		{
143 			throw new ConstructionException("null returned by gtk_text_view_get_buffer");
144 		}
145 		
146 		return ObjectG.getDObject!(SourceBuffer)(cast(GtkSourceBuffer*) p);
147 	}
148 	
149 	/**
150 	 */
151 	int[string] connectedSignals;
152 	
153 	void delegate(TextIter, Event, SourceView)[] onLineMarkActivatedListeners;
154 	/**
155 	 * Emitted when a line mark has been activated (for instance when there
156 	 * was a button press in the line marks gutter). You can use iter to
157 	 * determine on which line the activation took place.
158 	 */
159 	void addOnLineMarkActivated(void delegate(TextIter, Event, SourceView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
160 	{
161 		if ( !("line-mark-activated" in connectedSignals) )
162 		{
163 			Signals.connectData(
164 			getStruct(),
165 			"line-mark-activated",
166 			cast(GCallback)&callBackLineMarkActivated,
167 			cast(void*)this,
168 			null,
169 			connectFlags);
170 			connectedSignals["line-mark-activated"] = 1;
171 		}
172 		onLineMarkActivatedListeners ~= dlg;
173 	}
174 	extern(C) static void callBackLineMarkActivated(GtkSourceView* viewStruct, GtkTextIter* iter, GdkEvent* event, SourceView _sourceView)
175 	{
176 		foreach ( void delegate(TextIter, Event, SourceView) dlg ; _sourceView.onLineMarkActivatedListeners )
177 		{
178 			dlg(ObjectG.getDObject!(TextIter)(iter), ObjectG.getDObject!(Event)(event), _sourceView);
179 		}
180 	}
181 	
182 	void delegate(gboolean, gint, SourceView)[] onMoveLinesListeners;
183 	/**
184 	 * The ::move-lines signal is a keybinding which gets emitted
185 	 * when the user initiates moving a line. The default binding key
186 	 * is Alt+Up/Down arrow. And moves the currently selected lines,
187 	 * or the current line by count. For the moment, only
188 	 * count of -1 or 1 is valid.
189 	 * TRUE if the line should be copied,
190 	 * FALSE if it should be moved
191 	 * Since 2.10
192 	 */
193 	void addOnMoveLines(void delegate(gboolean, gint, SourceView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
194 	{
195 		if ( !("move-lines" in connectedSignals) )
196 		{
197 			Signals.connectData(
198 			getStruct(),
199 			"move-lines",
200 			cast(GCallback)&callBackMoveLines,
201 			cast(void*)this,
202 			null,
203 			connectFlags);
204 			connectedSignals["move-lines"] = 1;
205 		}
206 		onMoveLinesListeners ~= dlg;
207 	}
208 	extern(C) static void callBackMoveLines(GtkSourceView* viewStruct, gboolean copy, gint count, SourceView _sourceView)
209 	{
210 		foreach ( void delegate(gboolean, gint, SourceView) dlg ; _sourceView.onMoveLinesListeners )
211 		{
212 			dlg(copy, count, _sourceView);
213 		}
214 	}
215 	
216 	void delegate(gint, SourceView)[] onMoveWordsListeners;
217 	/**
218 	 * The ::move-words signal is a keybinding which gets emitted
219 	 * when the user initiates moving a word. The default binding key
220 	 * is Alt+Left/Right Arrow and moves the current selection, or the current
221 	 * word by one word.
222 	 * Since 3.0
223 	 */
224 	void addOnMoveWords(void delegate(gint, SourceView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
225 	{
226 		if ( !("move-words" in connectedSignals) )
227 		{
228 			Signals.connectData(
229 			getStruct(),
230 			"move-words",
231 			cast(GCallback)&callBackMoveWords,
232 			cast(void*)this,
233 			null,
234 			connectFlags);
235 			connectedSignals["move-words"] = 1;
236 		}
237 		onMoveWordsListeners ~= dlg;
238 	}
239 	extern(C) static void callBackMoveWords(GtkSourceView* viewStruct, gint count, SourceView _sourceView)
240 	{
241 		foreach ( void delegate(gint, SourceView) dlg ; _sourceView.onMoveWordsListeners )
242 		{
243 			dlg(count, _sourceView);
244 		}
245 	}
246 	
247 	void delegate(SourceView)[] onRedoListeners;
248 	/**
249 	 */
250 	void addOnRedo(void delegate(SourceView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
251 	{
252 		if ( !("redo" in connectedSignals) )
253 		{
254 			Signals.connectData(
255 			getStruct(),
256 			"redo",
257 			cast(GCallback)&callBackRedo,
258 			cast(void*)this,
259 			null,
260 			connectFlags);
261 			connectedSignals["redo"] = 1;
262 		}
263 		onRedoListeners ~= dlg;
264 	}
265 	extern(C) static void callBackRedo(GtkSourceView* sourceviewStruct, SourceView _sourceView)
266 	{
267 		foreach ( void delegate(SourceView) dlg ; _sourceView.onRedoListeners )
268 		{
269 			dlg(_sourceView);
270 		}
271 	}
272 	
273 	void delegate(SourceView)[] onShowCompletionListeners;
274 	/**
275 	 * The ::show-completion signal is a key binding signal which gets
276 	 * emitted when the user requests a completion, by pressing
277 	 * Control+space.
278 	 * This will create a GtkSourceCompletionContext with the activation
279 	 * type as GTK_SOURCE_COMPLETION_ACTIVATION_USER_REQUESTED.
280 	 * Applications should not connect to it, but may emit it with
281 	 * g_signal_emit_by_name() if they need to activate the completion by
282 	 * another means, for example with another key binding or a menu entry.
283 	 */
284 	void addOnShowCompletion(void delegate(SourceView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
285 	{
286 		if ( !("show-completion" in connectedSignals) )
287 		{
288 			Signals.connectData(
289 			getStruct(),
290 			"show-completion",
291 			cast(GCallback)&callBackShowCompletion,
292 			cast(void*)this,
293 			null,
294 			connectFlags);
295 			connectedSignals["show-completion"] = 1;
296 		}
297 		onShowCompletionListeners ~= dlg;
298 	}
299 	extern(C) static void callBackShowCompletion(GtkSourceView* viewStruct, SourceView _sourceView)
300 	{
301 		foreach ( void delegate(SourceView) dlg ; _sourceView.onShowCompletionListeners )
302 		{
303 			dlg(_sourceView);
304 		}
305 	}
306 	
307 	void delegate(TextIter, gint, SourceView)[] onSmartHomeEndListeners;
308 	/**
309 	 * Emitted when a the cursor was moved according to the smart home
310 	 * end setting. The signal is emitted after the cursor is moved, but
311 	 * during the GtkTextView::move-cursor action. This can be used to find
312 	 * out whether the cursor was moved by a normal home/end or by a smart
313 	 * home/end.
314 	 * Since 3.0
315 	 */
316 	void addOnSmartHomeEnd(void delegate(TextIter, gint, SourceView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
317 	{
318 		if ( !("smart-home-end" in connectedSignals) )
319 		{
320 			Signals.connectData(
321 			getStruct(),
322 			"smart-home-end",
323 			cast(GCallback)&callBackSmartHomeEnd,
324 			cast(void*)this,
325 			null,
326 			connectFlags);
327 			connectedSignals["smart-home-end"] = 1;
328 		}
329 		onSmartHomeEndListeners ~= dlg;
330 	}
331 	extern(C) static void callBackSmartHomeEnd(GtkSourceView* viewStruct, GtkTextIter* iter, gint count, SourceView _sourceView)
332 	{
333 		foreach ( void delegate(TextIter, gint, SourceView) dlg ; _sourceView.onSmartHomeEndListeners )
334 		{
335 			dlg(ObjectG.getDObject!(TextIter)(iter), count, _sourceView);
336 		}
337 	}
338 	
339 	void delegate(SourceView)[] onUndoListeners;
340 	/**
341 	 * See Also
342 	 * GtkTextView,GtkSourceBuffer
343 	 */
344 	void addOnUndo(void delegate(SourceView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
345 	{
346 		if ( !("undo" in connectedSignals) )
347 		{
348 			Signals.connectData(
349 			getStruct(),
350 			"undo",
351 			cast(GCallback)&callBackUndo,
352 			cast(void*)this,
353 			null,
354 			connectFlags);
355 			connectedSignals["undo"] = 1;
356 		}
357 		onUndoListeners ~= dlg;
358 	}
359 	extern(C) static void callBackUndo(GtkSourceView* sourceviewStruct, SourceView _sourceView)
360 	{
361 		foreach ( void delegate(SourceView) dlg ; _sourceView.onUndoListeners )
362 		{
363 			dlg(_sourceView);
364 		}
365 	}
366 	
367 	
368 	/**
369 	 * Creates a new GtkSourceView. An empty default buffer will be
370 	 * created for you. If you want to specify your own buffer, consider
371 	 * gtk_source_view_new_with_buffer().
372 	 * Throws: ConstructionException GTK+ fails to create the object.
373 	 */
374 	public this ()
375 	{
376 		// GtkWidget * gtk_source_view_new (void);
377 		auto p = gtk_source_view_new();
378 		if(p is null)
379 		{
380 			throw new ConstructionException("null returned by gtk_source_view_new()");
381 		}
382 		this(cast(GtkSourceView*) p);
383 	}
384 	
385 	/**
386 	 * Creates a new GtkSourceView widget displaying the buffer
387 	 * buffer. One buffer can be shared among many widgets.
388 	 * Params:
389 	 * buffer = a GtkSourceBuffer.
390 	 * Throws: ConstructionException GTK+ fails to create the object.
391 	 */
392 	public this (SourceBuffer buffer)
393 	{
394 		// GtkWidget * gtk_source_view_new_with_buffer (GtkSourceBuffer *buffer);
395 		auto p = gtk_source_view_new_with_buffer((buffer is null) ? null : buffer.getSourceBufferStruct());
396 		if(p is null)
397 		{
398 			throw new ConstructionException("null returned by gtk_source_view_new_with_buffer((buffer is null) ? null : buffer.getSourceBufferStruct())");
399 		}
400 		this(cast(GtkSourceView*) p);
401 	}
402 	
403 	/**
404 	 * If TRUE auto indentation of text is enabled.
405 	 * Params:
406 	 * enable = whether to enable auto indentation.
407 	 */
408 	public void setAutoIndent(int enable)
409 	{
410 		// void gtk_source_view_set_auto_indent (GtkSourceView *view,  gboolean enable);
411 		gtk_source_view_set_auto_indent(gtkSourceView, enable);
412 	}
413 	
414 	/**
415 	 * Returns whether auto indentation of text is enabled.
416 	 * Returns: TRUE if auto indentation is enabled.
417 	 */
418 	public int getAutoIndent()
419 	{
420 		// gboolean gtk_source_view_get_auto_indent (GtkSourceView *view);
421 		return gtk_source_view_get_auto_indent(gtkSourceView);
422 	}
423 	
424 	/**
425 	 * If TRUE, when the tab key is pressed and there is a selection, the
426 	 * selected text is indented of one level instead of being replaced with
427 	 * the \t characters. Shift+Tab unindents the selection.
428 	 * Since 1.8
429 	 * Params:
430 	 * enable = whether to indent a block when tab is pressed.
431 	 */
432 	public void setIndentOnTab(int enable)
433 	{
434 		// void gtk_source_view_set_indent_on_tab (GtkSourceView *view,  gboolean enable);
435 		gtk_source_view_set_indent_on_tab(gtkSourceView, enable);
436 	}
437 	
438 	/**
439 	 * Returns whether when the tab key is pressed the current selection
440 	 * should get indented instead of replaced with the \t character.
441 	 * Since 1.8
442 	 * Returns: TRUE if the selection is indented when tab is pressed.
443 	 */
444 	public int getIndentOnTab()
445 	{
446 		// gboolean gtk_source_view_get_indent_on_tab (GtkSourceView *view);
447 		return gtk_source_view_get_indent_on_tab(gtkSourceView);
448 	}
449 	
450 	/**
451 	 * Sets the number of spaces to use for each step of indent.
452 	 * If width is -1, the value of the GtkSourceView::tab-width property
453 	 * will be used.
454 	 * Params:
455 	 * width = indent width in characters.
456 	 */
457 	public void setIndentWidth(int width)
458 	{
459 		// void gtk_source_view_set_indent_width (GtkSourceView *view,  gint width);
460 		gtk_source_view_set_indent_width(gtkSourceView, width);
461 	}
462 	
463 	/**
464 	 * Returns the number of spaces to use for each step of indent.
465 	 * See gtk_source_view_set_indent_width() for details.
466 	 * Returns: indent width.
467 	 */
468 	public int getIndentWidth()
469 	{
470 		// gint gtk_source_view_get_indent_width (GtkSourceView *view);
471 		return gtk_source_view_get_indent_width(gtkSourceView);
472 	}
473 	
474 	/**
475 	 * If TRUE any tabulator character inserted is replaced by a group
476 	 * of space characters.
477 	 * Params:
478 	 * enable = whether to insert spaces instead of tabs.
479 	 */
480 	public void setInsertSpacesInsteadOfTabs(int enable)
481 	{
482 		// void gtk_source_view_set_insert_spaces_instead_of_tabs  (GtkSourceView *view,  gboolean enable);
483 		gtk_source_view_set_insert_spaces_instead_of_tabs(gtkSourceView, enable);
484 	}
485 	
486 	/**
487 	 * Returns whether when inserting a tabulator character it should
488 	 * be replaced by a group of space characters.
489 	 * Returns: TRUE if spaces are inserted instead of tabs.
490 	 */
491 	public int getInsertSpacesInsteadOfTabs()
492 	{
493 		// gboolean gtk_source_view_get_insert_spaces_instead_of_tabs  (GtkSourceView *view);
494 		return gtk_source_view_get_insert_spaces_instead_of_tabs(gtkSourceView);
495 	}
496 	
497 	/**
498 	 * Set the desired movement of the cursor when HOME and END keys
499 	 * are pressed.
500 	 * Params:
501 	 * smartHe = the desired behavior among GtkSourceSmartHomeEndType.
502 	 */
503 	public void setSmartHomeEnd(GtkSourceSmartHomeEndType smartHe)
504 	{
505 		// void gtk_source_view_set_smart_home_end (GtkSourceView *view,  GtkSourceSmartHomeEndType smart_he);
506 		gtk_source_view_set_smart_home_end(gtkSourceView, smartHe);
507 	}
508 	
509 	/**
510 	 * Returns a GtkSourceSmartHomeEndType end value specifying
511 	 * how the cursor will move when HOME and END keys are pressed.
512 	 * Returns: a GtkSourceSmartHomeEndType value.
513 	 */
514 	public GtkSourceSmartHomeEndType getSmartHomeEnd()
515 	{
516 		// GtkSourceSmartHomeEndType gtk_source_view_get_smart_home_end  (GtkSourceView *view);
517 		return gtk_source_view_get_smart_home_end(gtkSourceView);
518 	}
519 	
520 	/**
521 	 * Sets attributes and priority for the category.
522 	 * Params:
523 	 * category = the category.
524 	 * attributes = mark attributes.
525 	 * priority = priority of the category.
526 	 */
527 	public void setMarkAttributes(string category, SourceMarkAttributes attributes, int priority)
528 	{
529 		// void gtk_source_view_set_mark_attributes (GtkSourceView *view,  const gchar *category,  GtkSourceMarkAttributes *attributes,  gint priority);
530 		gtk_source_view_set_mark_attributes(gtkSourceView, Str.toStringz(category), (attributes is null) ? null : attributes.getSourceMarkAttributesStruct(), priority);
531 	}
532 	
533 	/**
534 	 * Gets attributes and priority for the category.
535 	 * Params:
536 	 * category = the category.
537 	 * priority = place where priority of the category will be stored.
538 	 * Returns: GtkSourceMarkAttributes for the category. The object belongs to view, so it must not be unreffed. [transfer none]
539 	 */
540 	public SourceMarkAttributes getMarkAttributes(string category, int* priority)
541 	{
542 		// GtkSourceMarkAttributes * gtk_source_view_get_mark_attributes  (GtkSourceView *view,  const gchar *category,  gint *priority);
543 		auto p = gtk_source_view_get_mark_attributes(gtkSourceView, Str.toStringz(category), priority);
544 		
545 		if(p is null)
546 		{
547 			return null;
548 		}
549 		
550 		return ObjectG.getDObject!(SourceMarkAttributes)(cast(GtkSourceMarkAttributes*) p);
551 	}
552 	
553 	/**
554 	 * If hl is TRUE the current line is highlighted.
555 	 * Params:
556 	 * hl = whether to highlight the current line.
557 	 */
558 	public void setHighlightCurrentLine(int hl)
559 	{
560 		// void gtk_source_view_set_highlight_current_line  (GtkSourceView *view,  gboolean hl);
561 		gtk_source_view_set_highlight_current_line(gtkSourceView, hl);
562 	}
563 	
564 	/**
565 	 * Returns whether the current line is highlighted.
566 	 * Returns: TRUE if the current line is highlighted.
567 	 */
568 	public int getHighlightCurrentLine()
569 	{
570 		// gboolean gtk_source_view_get_highlight_current_line  (GtkSourceView *view);
571 		return gtk_source_view_get_highlight_current_line(gtkSourceView);
572 	}
573 	
574 	/**
575 	 * If TRUE line marks will be displayed beside the text.
576 	 * Since 2.2
577 	 * Params:
578 	 * show = whether line marks should be displayed.
579 	 */
580 	public void setShowLineMarks(int show)
581 	{
582 		// void gtk_source_view_set_show_line_marks (GtkSourceView *view,  gboolean show);
583 		gtk_source_view_set_show_line_marks(gtkSourceView, show);
584 	}
585 	
586 	/**
587 	 * Returns whether line marks are displayed beside the text.
588 	 * Since 2.2
589 	 * Returns: TRUE if the line marks are displayed.
590 	 */
591 	public int getShowLineMarks()
592 	{
593 		// gboolean gtk_source_view_get_show_line_marks (GtkSourceView *view);
594 		return gtk_source_view_get_show_line_marks(gtkSourceView);
595 	}
596 	
597 	/**
598 	 * If TRUE line numbers will be displayed beside the text.
599 	 * Params:
600 	 * show = whether line numbers should be displayed.
601 	 */
602 	public void setShowLineNumbers(int show)
603 	{
604 		// void gtk_source_view_set_show_line_numbers  (GtkSourceView *view,  gboolean show);
605 		gtk_source_view_set_show_line_numbers(gtkSourceView, show);
606 	}
607 	
608 	/**
609 	 * Returns whether line numbers are displayed beside the text.
610 	 * Returns: TRUE if the line numbers are displayed.
611 	 */
612 	public int getShowLineNumbers()
613 	{
614 		// gboolean gtk_source_view_get_show_line_numbers  (GtkSourceView *view);
615 		return gtk_source_view_get_show_line_numbers(gtkSourceView);
616 	}
617 	
618 	/**
619 	 * If TRUE a right margin is displayed.
620 	 * Params:
621 	 * show = whether to show a right margin.
622 	 */
623 	public void setShowRightMargin(int show)
624 	{
625 		// void gtk_source_view_set_show_right_margin  (GtkSourceView *view,  gboolean show);
626 		gtk_source_view_set_show_right_margin(gtkSourceView, show);
627 	}
628 	
629 	/**
630 	 * Returns whether a right margin is displayed.
631 	 * Returns: TRUE if the right margin is shown.
632 	 */
633 	public int getShowRightMargin()
634 	{
635 		// gboolean gtk_source_view_get_show_right_margin  (GtkSourceView *view);
636 		return gtk_source_view_get_show_right_margin(gtkSourceView);
637 	}
638 	
639 	/**
640 	 * Sets the position of the right margin in the given view.
641 	 * Params:
642 	 * pos = the width in characters where to position the right margin.
643 	 */
644 	public void setRightMarginPosition(uint pos)
645 	{
646 		// void gtk_source_view_set_right_margin_position  (GtkSourceView *view,  guint pos);
647 		gtk_source_view_set_right_margin_position(gtkSourceView, pos);
648 	}
649 	
650 	/**
651 	 * Gets the position of the right margin in the given view.
652 	 * Returns: the position of the right margin.
653 	 */
654 	public uint getRightMarginPosition()
655 	{
656 		// guint gtk_source_view_get_right_margin_position  (GtkSourceView *view);
657 		return gtk_source_view_get_right_margin_position(gtkSourceView);
658 	}
659 	
660 	/**
661 	 * Sets the width of tabulation in characters.
662 	 * Params:
663 	 * width = width of tab in characters.
664 	 */
665 	public void setTabWidth(uint width)
666 	{
667 		// void gtk_source_view_set_tab_width (GtkSourceView *view,  guint width);
668 		gtk_source_view_set_tab_width(gtkSourceView, width);
669 	}
670 	
671 	/**
672 	 * Returns the width of tabulation in characters.
673 	 * Returns: width of tab.
674 	 */
675 	public uint getTabWidth()
676 	{
677 		// guint gtk_source_view_get_tab_width (GtkSourceView *view);
678 		return gtk_source_view_get_tab_width(gtkSourceView);
679 	}
680 	
681 	/**
682 	 * Set if and how the spaces should be visualized. Specifying flags as 0 will
683 	 * disable display of spaces.
684 	 * Params:
685 	 * flags = GtkSourceDrawSpacesFlags specifing how white spaces should
686 	 * be displayed
687 	 */
688 	public void setDrawSpaces(GtkSourceDrawSpacesFlags flags)
689 	{
690 		// void gtk_source_view_set_draw_spaces (GtkSourceView *view,  GtkSourceDrawSpacesFlags flags);
691 		gtk_source_view_set_draw_spaces(gtkSourceView, flags);
692 	}
693 	
694 	/**
695 	 * Returns the GtkSourceDrawSpacesFlags specifying if and how spaces
696 	 * should be displayed for this view.
697 	 * Returns: the GtkSourceDrawSpacesFlags, 0 if no spaces should be drawn.
698 	 */
699 	public GtkSourceDrawSpacesFlags getDrawSpaces()
700 	{
701 		// GtkSourceDrawSpacesFlags gtk_source_view_get_draw_spaces  (GtkSourceView *view);
702 		return gtk_source_view_get_draw_spaces(gtkSourceView);
703 	}
704 	
705 	/**
706 	 * Gets the GtkSourceCompletion associated with view.
707 	 * Returns: the GtkSourceCompletion associated with view. [type GtkSource.Completion][transfer none]
708 	 */
709 	public SourceCompletion getCompletion()
710 	{
711 		// GtkSourceCompletion * gtk_source_view_get_completion (GtkSourceView *view);
712 		auto p = gtk_source_view_get_completion(gtkSourceView);
713 		
714 		if(p is null)
715 		{
716 			return null;
717 		}
718 		
719 		return ObjectG.getDObject!(SourceCompletion)(cast(GtkSourceCompletion*) p);
720 	}
721 	
722 	/**
723 	 * Returns the GtkSourceGutter object associated with window_type for view.
724 	 * Only GTK_TEXT_WINDOW_LEFT and GTK_TEXT_WINDOW_RIGHT are supported,
725 	 * respectively corresponding to the left and right gutter. The line numbers
726 	 * and mark category icons are rendered in the gutter corresponding to
727 	 * GTK_TEXT_WINDOW_LEFT.
728 	 * Since 2.8
729 	 * Params:
730 	 * windowType = the gutter window type.
731 	 * Returns: the GtkSourceGutter. [transfer none]
732 	 */
733 	public SourceGutter getGutter(GtkTextWindowType windowType)
734 	{
735 		// GtkSourceGutter * gtk_source_view_get_gutter (GtkSourceView *view,  GtkTextWindowType window_type);
736 		auto p = gtk_source_view_get_gutter(gtkSourceView, windowType);
737 		
738 		if(p is null)
739 		{
740 			return null;
741 		}
742 		
743 		return ObjectG.getDObject!(SourceGutter)(cast(GtkSourceGutter*) p);
744 	}
745 	
746 	/**
747 	 * Determines the visual column at iter taking into
748 	 * consideration the indent width of view.
749 	 * Params:
750 	 * iter = a position in view.
751 	 * Returns: the visual column at iter.
752 	 */
753 	public uint getVisualColumn(TextIter iter)
754 	{
755 		// guint gtk_source_view_get_visual_column (GtkSourceView *view,  const GtkTextIter *iter);
756 		return gtk_source_view_get_visual_column(gtkSourceView, (iter is null) ? null : iter.getTextIterStruct());
757 	}
758 }