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