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