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  = GtkSourceBuffer.html
27  * outPack = gsv
28  * outFile = SourceBuffer
29  * strct   = GtkSourceBuffer
30  * realStrct=
31  * ctorStrct=
32  * clss    = SourceBuffer
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_source_buffer_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.Str
47  * 	- gtk.TextTagTable
48  * 	- gsv.SourceLanguage
49  * 	- gsv.SourceStyleScheme
50  * 	- gsv.SourceMark
51  * 	- glib.ListSG
52  * 	- gtk.TextIter
53  * structWrap:
54  * 	- GSList* -> ListSG
55  * 	- GtkSourceLanguage* -> SourceLanguage
56  * 	- GtkSourceMark* -> SourceMark
57  * 	- GtkSourceStyleScheme* -> SourceStyleScheme
58  * 	- GtkTextIter* -> TextIter
59  * 	- GtkTextTagTable* -> TextTagTable
60  * module aliases:
61  * local aliases:
62  * overrides:
63  */
64 
65 module gsv.SourceBuffer;
66 
67 public  import gsvc.gsvtypes;
68 
69 private import gsvc.gsv;
70 private import glib.ConstructionException;
71 private import gobject.ObjectG;
72 
73 private import gobject.Signals;
74 public  import gtkc.gdktypes;
75 
76 private import glib.Str;
77 private import gtk.TextTagTable;
78 private import gsv.SourceLanguage;
79 private import gsv.SourceStyleScheme;
80 private import gsv.SourceMark;
81 private import glib.ListSG;
82 private import gtk.TextIter;
83 
84 
85 
86 private import gtk.TextBuffer;
87 
88 /**
89  * Description
90  * The GtkSourceBuffer object is the model for GtkSourceView widgets.
91  * It extends the GtkTextBuffer object by adding features useful to display
92  * and edit source code as syntax highlighting and bracket matching. It
93  * also implements support for undo/redo operations.
94  * To create a GtkSourceBuffer use gtk_source_buffer_new() or
95  * gtk_source_buffer_new_with_language(). The second form is just a convenience
96  * function which allows you to initially set a GtkSourceLanguage.
97  * By default highlighting is enabled, but you can disable it with
98  * gtk_source_buffer_set_highlight_syntax().
99  */
100 public class SourceBuffer : TextBuffer
101 {
102 	
103 	/** the main Gtk struct */
104 	protected GtkSourceBuffer* gtkSourceBuffer;
105 	
106 	
107 	public GtkSourceBuffer* getSourceBufferStruct()
108 	{
109 		return gtkSourceBuffer;
110 	}
111 	
112 	
113 	/** the main Gtk struct as a void* */
114 	protected override void* getStruct()
115 	{
116 		return cast(void*)gtkSourceBuffer;
117 	}
118 	
119 	/**
120 	 * Sets our main struct and passes it to the parent class
121 	 */
122 	public this (GtkSourceBuffer* gtkSourceBuffer)
123 	{
124 		super(cast(GtkTextBuffer*)gtkSourceBuffer);
125 		this.gtkSourceBuffer = gtkSourceBuffer;
126 	}
127 	
128 	protected override void setStruct(GObject* obj)
129 	{
130 		super.setStruct(obj);
131 		gtkSourceBuffer = cast(GtkSourceBuffer*)obj;
132 	}
133 	
134 	/**
135 	 */
136 	int[string] connectedSignals;
137 	
138 	void delegate(TextIter, TextIter, SourceBuffer)[] onHighlightUpdatedListeners;
139 	/**
140 	 */
141 	void addOnHighlightUpdated(void delegate(TextIter, TextIter, SourceBuffer) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
142 	{
143 		if ( !("highlight-updated" in connectedSignals) )
144 		{
145 			Signals.connectData(
146 			getStruct(),
147 			"highlight-updated",
148 			cast(GCallback)&callBackHighlightUpdated,
149 			cast(void*)this,
150 			null,
151 			connectFlags);
152 			connectedSignals["highlight-updated"] = 1;
153 		}
154 		onHighlightUpdatedListeners ~= dlg;
155 	}
156 	extern(C) static void callBackHighlightUpdated(GtkSourceBuffer* sourcebufferStruct, GtkTextIter* arg1, GtkTextIter* arg2, SourceBuffer _sourceBuffer)
157 	{
158 		foreach ( void delegate(TextIter, TextIter, SourceBuffer) dlg ; _sourceBuffer.onHighlightUpdatedListeners )
159 		{
160 			dlg(ObjectG.getDObject!(TextIter)(arg1), ObjectG.getDObject!(TextIter)(arg2), _sourceBuffer);
161 		}
162 	}
163 	
164 	void delegate(SourceBuffer)[] onRedoListeners;
165 	/**
166 	 */
167 	void addOnRedo(void delegate(SourceBuffer) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
168 	{
169 		if ( !("redo" in connectedSignals) )
170 		{
171 			Signals.connectData(
172 			getStruct(),
173 			"redo",
174 			cast(GCallback)&callBackRedo,
175 			cast(void*)this,
176 			null,
177 			connectFlags);
178 			connectedSignals["redo"] = 1;
179 		}
180 		onRedoListeners ~= dlg;
181 	}
182 	extern(C) static void callBackRedo(GtkSourceBuffer* sourcebufferStruct, SourceBuffer _sourceBuffer)
183 	{
184 		foreach ( void delegate(SourceBuffer) dlg ; _sourceBuffer.onRedoListeners )
185 		{
186 			dlg(_sourceBuffer);
187 		}
188 	}
189 	
190 	void delegate(GtkTextMark*, SourceBuffer)[] onSourceMarkUpdatedListeners;
191 	/**
192 	 * The ::source_mark_updated signal is emitted each time
193 	 * a mark is added to, moved or removed from the buffer.
194 	 */
195 	void addOnSourceMarkUpdated(void delegate(GtkTextMark*, SourceBuffer) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
196 	{
197 		if ( !("source-mark-updated" in connectedSignals) )
198 		{
199 			Signals.connectData(
200 			getStruct(),
201 			"source-mark-updated",
202 			cast(GCallback)&callBackSourceMarkUpdated,
203 			cast(void*)this,
204 			null,
205 			connectFlags);
206 			connectedSignals["source-mark-updated"] = 1;
207 		}
208 		onSourceMarkUpdatedListeners ~= dlg;
209 	}
210 	extern(C) static void callBackSourceMarkUpdated(GtkSourceBuffer* bufferStruct, GtkTextMark* arg1, SourceBuffer _sourceBuffer)
211 	{
212 		foreach ( void delegate(GtkTextMark*, SourceBuffer) dlg ; _sourceBuffer.onSourceMarkUpdatedListeners )
213 		{
214 			dlg(arg1, _sourceBuffer);
215 		}
216 	}
217 	
218 	void delegate(SourceBuffer)[] onUndoListeners;
219 	/**
220 	 * See Also
221 	 * GtkTextBuffer,GtkSourceView
222 	 */
223 	void addOnUndo(void delegate(SourceBuffer) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
224 	{
225 		if ( !("undo" in connectedSignals) )
226 		{
227 			Signals.connectData(
228 			getStruct(),
229 			"undo",
230 			cast(GCallback)&callBackUndo,
231 			cast(void*)this,
232 			null,
233 			connectFlags);
234 			connectedSignals["undo"] = 1;
235 		}
236 		onUndoListeners ~= dlg;
237 	}
238 	extern(C) static void callBackUndo(GtkSourceBuffer* sourcebufferStruct, SourceBuffer _sourceBuffer)
239 	{
240 		foreach ( void delegate(SourceBuffer) dlg ; _sourceBuffer.onUndoListeners )
241 		{
242 			dlg(_sourceBuffer);
243 		}
244 	}
245 	
246 	
247 	/**
248 	 * Creates a new source buffer.
249 	 * Params:
250 	 * table = a GtkTextTagTable, or NULL to create a new one.
251 	 * Throws: ConstructionException GTK+ fails to create the object.
252 	 */
253 	public this (TextTagTable table)
254 	{
255 		// GtkSourceBuffer * gtk_source_buffer_new (GtkTextTagTable *table);
256 		auto p = gtk_source_buffer_new((table is null) ? null : table.getTextTagTableStruct());
257 		if(p is null)
258 		{
259 			throw new ConstructionException("null returned by gtk_source_buffer_new((table is null) ? null : table.getTextTagTableStruct())");
260 		}
261 		this(cast(GtkSourceBuffer*) p);
262 	}
263 	
264 	/**
265 	 * Creates a new source buffer using the highlighting patterns in
266 	 * language. This is equivalent to creating a new source buffer with
267 	 * a new tag table and then calling gtk_source_buffer_set_language().
268 	 * Params:
269 	 * language = a GtkSourceLanguage.
270 	 * Throws: ConstructionException GTK+ fails to create the object.
271 	 */
272 	public this (SourceLanguage language)
273 	{
274 		// GtkSourceBuffer * gtk_source_buffer_new_with_language (GtkSourceLanguage *language);
275 		auto p = gtk_source_buffer_new_with_language((language is null) ? null : language.getSourceLanguageStruct());
276 		if(p is null)
277 		{
278 			throw new ConstructionException("null returned by gtk_source_buffer_new_with_language((language is null) ? null : language.getSourceLanguageStruct())");
279 		}
280 		this(cast(GtkSourceBuffer*) p);
281 	}
282 	
283 	/**
284 	 * Controls whether syntax is highlighted in the buffer. If highlight
285 	 * is TRUE, the text will be highlighted according to the syntax
286 	 * patterns specified in the language set with
287 	 * gtk_source_buffer_set_language(). If highlight is FALSE, syntax highlighting
288 	 * is disabled and all the GtkTextTag objects that have been added by the
289 	 * syntax highlighting engine are removed from the buffer.
290 	 * Params:
291 	 * highlight = TRUE to enable syntax highlighting, FALSE to disable it.
292 	 */
293 	public void setHighlightSyntax(int highlight)
294 	{
295 		// void gtk_source_buffer_set_highlight_syntax  (GtkSourceBuffer *buffer,  gboolean highlight);
296 		gtk_source_buffer_set_highlight_syntax(gtkSourceBuffer, highlight);
297 	}
298 	
299 	/**
300 	 * Determines whether syntax highlighting is activated in the source
301 	 * buffer.
302 	 * Returns: TRUE if syntax highlighting is enabled, FALSE otherwise.
303 	 */
304 	public int getHighlightSyntax()
305 	{
306 		// gboolean gtk_source_buffer_get_highlight_syntax  (GtkSourceBuffer *buffer);
307 		return gtk_source_buffer_get_highlight_syntax(gtkSourceBuffer);
308 	}
309 	
310 	/**
311 	 * Associate a GtkSourceLanguage with the source buffer. If language is
312 	 * not-NULL and syntax highlighting is enabled (see gtk_source_buffer_set_highlight_syntax()),
313 	 * the syntax patterns defined in language will be used to highlight the text
314 	 * contained in the buffer. If language is NULL, the text contained in the
315 	 * buffer is not highlighted.
316 	 * The buffer holds a reference to language.
317 	 * Params:
318 	 * language = a GtkSourceLanguage to set, or NULL.
319 	 */
320 	public void setLanguage(SourceLanguage language)
321 	{
322 		// void gtk_source_buffer_set_language (GtkSourceBuffer *buffer,  GtkSourceLanguage *language);
323 		gtk_source_buffer_set_language(gtkSourceBuffer, (language is null) ? null : language.getSourceLanguageStruct());
324 	}
325 	
326 	/**
327 	 * Returns the GtkSourceLanguage associated with the buffer,
328 	 * see gtk_source_buffer_set_language(). The returned object should not be
329 	 * unreferenced by the user.
330 	 * Returns: GtkSourceLanguage associated with the buffer, or NULL.
331 	 */
332 	public SourceLanguage getLanguage()
333 	{
334 		// GtkSourceLanguage * gtk_source_buffer_get_language (GtkSourceBuffer *buffer);
335 		auto p = gtk_source_buffer_get_language(gtkSourceBuffer);
336 		
337 		if(p is null)
338 		{
339 			return null;
340 		}
341 		
342 		return ObjectG.getDObject!(SourceLanguage)(cast(GtkSourceLanguage*) p);
343 	}
344 	
345 	/**
346 	 * Controls the bracket match highlighting function in the buffer. If
347 	 * activated, when you position your cursor over a bracket character
348 	 * (a parenthesis, a square bracket, etc.) the matching opening or
349 	 * closing bracket character will be highlighted. You can specify the
350 	 * style with the gtk_source_buffer_set_bracket_match_style()
351 	 * function.
352 	 * Params:
353 	 * highlight = TRUE if you want matching brackets highlighted.
354 	 */
355 	public void setHighlightMatchingBrackets(int highlight)
356 	{
357 		// void gtk_source_buffer_set_highlight_matching_brackets  (GtkSourceBuffer *buffer,  gboolean highlight);
358 		gtk_source_buffer_set_highlight_matching_brackets(gtkSourceBuffer, highlight);
359 	}
360 	
361 	/**
362 	 * Determines whether bracket match highlighting is activated for the
363 	 * source buffer.
364 	 * Returns: TRUE if the source buffer will highlight matching brackets.
365 	 */
366 	public int getHighlightMatchingBrackets()
367 	{
368 		// gboolean gtk_source_buffer_get_highlight_matching_brackets  (GtkSourceBuffer *buffer);
369 		return gtk_source_buffer_get_highlight_matching_brackets(gtkSourceBuffer);
370 	}
371 	
372 	/**
373 	 * Sets style scheme used by the buffer. If scheme is NULL no
374 	 * style scheme is used.
375 	 * Params:
376 	 * scheme = style scheme.
377 	 */
378 	public void setStyleScheme(SourceStyleScheme scheme)
379 	{
380 		// void gtk_source_buffer_set_style_scheme (GtkSourceBuffer *buffer,  GtkSourceStyleScheme *scheme);
381 		gtk_source_buffer_set_style_scheme(gtkSourceBuffer, (scheme is null) ? null : scheme.getSourceStyleSchemeStruct());
382 	}
383 	
384 	/**
385 	 * Returns the GtkSourceStyleScheme currently used in buffer.
386 	 * Returns: the GtkSourceStyleScheme set by gtk_source_buffer_set_style_scheme(), or NULL.
387 	 */
388 	public SourceStyleScheme getStyleScheme()
389 	{
390 		// GtkSourceStyleScheme * gtk_source_buffer_get_style_scheme  (GtkSourceBuffer *buffer);
391 		auto p = gtk_source_buffer_get_style_scheme(gtkSourceBuffer);
392 		
393 		if(p is null)
394 		{
395 			return null;
396 		}
397 		
398 		return ObjectG.getDObject!(SourceStyleScheme)(cast(GtkSourceStyleScheme*) p);
399 	}
400 	
401 	/**
402 	 * Determines the number of undo levels the buffer will track for
403 	 * buffer edits.
404 	 * Returns: the maximum number of possible undo levels or -1 if no limit is set.
405 	 */
406 	public int getMaxUndoLevels()
407 	{
408 		// gint gtk_source_buffer_get_max_undo_levels  (GtkSourceBuffer *buffer);
409 		return gtk_source_buffer_get_max_undo_levels(gtkSourceBuffer);
410 	}
411 	
412 	/**
413 	 * Sets the number of undo levels for user actions the buffer will
414 	 * track. If the number of user actions exceeds the limit set by this
415 	 * function, older actions will be discarded.
416 	 * If max_undo_levels is -1, no limit is set.
417 	 * A new action is started whenever the function
418 	 * gtk_text_buffer_begin_user_action() is called. In general, this
419 	 * happens whenever the user presses any key which modifies the
420 	 * buffer, but the undo manager will try to merge similar consecutive
421 	 * actions, such as multiple character insertions into one action.
422 	 * But, inserting a newline does start a new action.
423 	 * Params:
424 	 * maxUndoLevels = the desired maximum number of undo levels.
425 	 */
426 	public void setMaxUndoLevels(int maxUndoLevels)
427 	{
428 		// void gtk_source_buffer_set_max_undo_levels  (GtkSourceBuffer *buffer,  gint max_undo_levels);
429 		gtk_source_buffer_set_max_undo_levels(gtkSourceBuffer, maxUndoLevels);
430 	}
431 	
432 	/**
433 	 * Redoes the last undo operation. Use gtk_source_buffer_can_redo()
434 	 * to check whether a call to this function will have any effect.
435 	 */
436 	public void redo()
437 	{
438 		// void gtk_source_buffer_redo (GtkSourceBuffer *buffer);
439 		gtk_source_buffer_redo(gtkSourceBuffer);
440 	}
441 	
442 	/**
443 	 * Undoes the last user action which modified the buffer. Use
444 	 * gtk_source_buffer_can_undo() to check whether a call to this
445 	 * function will have any effect.
446 	 * Actions are defined as groups of operations between a call to
447 	 * gtk_text_buffer_begin_user_action() and
448 	 * gtk_text_buffer_end_user_action(), or sequences of similar edits
449 	 * (inserts or deletes) on the same line.
450 	 */
451 	public void undo()
452 	{
453 		// void gtk_source_buffer_undo (GtkSourceBuffer *buffer);
454 		gtk_source_buffer_undo(gtkSourceBuffer);
455 	}
456 	
457 	/**
458 	 * Determines whether a source buffer can redo the last action
459 	 * (i.e. if the last operation was an undo).
460 	 * Returns: TRUE if a redo is possible.
461 	 */
462 	public int canRedo()
463 	{
464 		// gboolean gtk_source_buffer_can_redo (GtkSourceBuffer *buffer);
465 		return gtk_source_buffer_can_redo(gtkSourceBuffer);
466 	}
467 	
468 	/**
469 	 * Determines whether a source buffer can undo the last action.
470 	 * Returns: TRUE if it's possible to undo the last action.
471 	 */
472 	public int canUndo()
473 	{
474 		// gboolean gtk_source_buffer_can_undo (GtkSourceBuffer *buffer);
475 		return gtk_source_buffer_can_undo(gtkSourceBuffer);
476 	}
477 	
478 	/**
479 	 * Marks the beginning of a not undoable action on the buffer,
480 	 * disabling the undo manager. Typically you would call this function
481 	 * before initially setting the contents of the buffer (e.g. when
482 	 * loading a file in a text editor).
483 	 * You may nest gtk_source_buffer_begin_not_undoable_action() /
484 	 * gtk_source_buffer_end_not_undoable_action() blocks.
485 	 */
486 	public void beginNotUndoableAction()
487 	{
488 		// void gtk_source_buffer_begin_not_undoable_action  (GtkSourceBuffer *buffer);
489 		gtk_source_buffer_begin_not_undoable_action(gtkSourceBuffer);
490 	}
491 	
492 	/**
493 	 * Marks the end of a not undoable action on the buffer. When the
494 	 * last not undoable block is closed through the call to this
495 	 * function, the list of undo actions is cleared and the undo manager
496 	 * is re-enabled.
497 	 */
498 	public void endNotUndoableAction()
499 	{
500 		// void gtk_source_buffer_end_not_undoable_action  (GtkSourceBuffer *buffer);
501 		gtk_source_buffer_end_not_undoable_action(gtkSourceBuffer);
502 	}
503 	
504 	/**
505 	 * Creates a source mark in the buffer of category category. A source mark is
506 	 * a GtkTextMark but organised into categories. Depending on the category
507 	 * a pixbuf can be specified that will be displayed along the line of the mark.
508 	 * Like a GtkTextMark, a GtkSourceMark can be anonymous if the
509 	 * passed name is NULL. Also, the buffer owns the marks so you
510 	 * shouldn't unreference it.
511 	 * Marks always have left gravity and are moved to the beginning of
512 	 * the line when the user deletes the line they were in.
513 	 * Typical uses for a source mark are bookmarks, breakpoints, current
514 	 * executing instruction indication in a source file, etc..
515 	 * Since 2.2
516 	 * Params:
517 	 * name = the name of the mark, or NULL.
518 	 * category = a string defining the mark category.
519 	 * where = location to place the mark.
520 	 * Returns: a new GtkSourceMark, owned by the buffer.
521 	 */
522 	public SourceMark createSourceMark(string name, string category, TextIter where)
523 	{
524 		// GtkSourceMark * gtk_source_buffer_create_source_mark  (GtkSourceBuffer *buffer,  const gchar *name,  const gchar *category,  const GtkTextIter *where);
525 		auto p = gtk_source_buffer_create_source_mark(gtkSourceBuffer, Str.toStringz(name), Str.toStringz(category), (where is null) ? null : where.getTextIterStruct());
526 		
527 		if(p is null)
528 		{
529 			return null;
530 		}
531 		
532 		return ObjectG.getDObject!(SourceMark)(cast(GtkSourceMark*) p);
533 	}
534 	
535 	/**
536 	 * Returns the list of marks of the given category at line.
537 	 * If category is NULL, all marks at line are returned.
538 	 * Since 2.2
539 	 * Params:
540 	 * line = a line number.
541 	 * category = category to search for or NULL
542 	 * Returns: a newly allocated GSList.
543 	 */
544 	public ListSG getSourceMarksAtLine(int line, string category)
545 	{
546 		// GSList * gtk_source_buffer_get_source_marks_at_line  (GtkSourceBuffer *buffer,  gint line,  const gchar *category);
547 		auto p = gtk_source_buffer_get_source_marks_at_line(gtkSourceBuffer, line, Str.toStringz(category));
548 		
549 		if(p is null)
550 		{
551 			return null;
552 		}
553 		
554 		return ObjectG.getDObject!(ListSG)(cast(GSList*) p);
555 	}
556 	
557 	/**
558 	 * Returns the list of marks of the given category at iter. If category
559 	 * is NULL it returns all marks at iter.
560 	 * Since 2.2
561 	 * Params:
562 	 * iter = an iterator.
563 	 * category = category to search for or NULL
564 	 * Returns: a newly allocated GSList.
565 	 */
566 	public ListSG getSourceMarksAtIter(TextIter iter, string category)
567 	{
568 		// GSList * gtk_source_buffer_get_source_marks_at_iter  (GtkSourceBuffer *buffer,  GtkTextIter *iter,  const gchar *category);
569 		auto p = gtk_source_buffer_get_source_marks_at_iter(gtkSourceBuffer, (iter is null) ? null : iter.getTextIterStruct(), Str.toStringz(category));
570 		
571 		if(p is null)
572 		{
573 			return null;
574 		}
575 		
576 		return ObjectG.getDObject!(ListSG)(cast(GSList*) p);
577 	}
578 	
579 	/**
580 	 * Remove all marks of category between start and end from the buffer.
581 	 * If category is NULL, all marks in the range will be removed.
582 	 * Since 2.2
583 	 * Params:
584 	 * start = a GtkTextIter
585 	 * end = a GtkTextIter
586 	 * category = category to search for or NULL
587 	 */
588 	public void removeSourceMarks(TextIter start, TextIter end, string category)
589 	{
590 		// void gtk_source_buffer_remove_source_marks  (GtkSourceBuffer *buffer,  const GtkTextIter *start,  const GtkTextIter *end,  const gchar *category);
591 		gtk_source_buffer_remove_source_marks(gtkSourceBuffer, (start is null) ? null : start.getTextIterStruct(), (end is null) ? null : end.getTextIterStruct(), Str.toStringz(category));
592 	}
593 	
594 	/**
595 	 * Moves iter to the position of the next GtkSourceMark of the given
596 	 * category. Returns TRUE if iter was moved. If category is NULL, the
597 	 * next source mark can be of any category.
598 	 * Since 2.2
599 	 * Params:
600 	 * iter = an iterator.
601 	 * category = category to search for or NULL
602 	 * Returns: whether iter moved.
603 	 */
604 	public int forwardIterToSourceMark(TextIter iter, string category)
605 	{
606 		// gboolean gtk_source_buffer_forward_iter_to_source_mark  (GtkSourceBuffer *buffer,  GtkTextIter *iter,  const gchar *category);
607 		return gtk_source_buffer_forward_iter_to_source_mark(gtkSourceBuffer, (iter is null) ? null : iter.getTextIterStruct(), Str.toStringz(category));
608 	}
609 	
610 	/**
611 	 * Moves iter to the position of the previous GtkSourceMark of the given
612 	 * category. Returns TRUE if iter was moved. If category is NULL, the
613 	 * previous source mark can be of any category.
614 	 * Since 2.2
615 	 * Params:
616 	 * iter = an iterator.
617 	 * category = category to search for or NULL
618 	 * Returns: whether iter moved.
619 	 */
620 	public int backwardIterToSourceMark(TextIter iter, string category)
621 	{
622 		// gboolean gtk_source_buffer_backward_iter_to_source_mark  (GtkSourceBuffer *buffer,  GtkTextIter *iter,  const gchar *category);
623 		return gtk_source_buffer_backward_iter_to_source_mark(gtkSourceBuffer, (iter is null) ? null : iter.getTextIterStruct(), Str.toStringz(category));
624 	}
625 	
626 	/**
627 	 * Forces buffer to analyze and highlight the given area synchronously.
628 	 * Note
629 	 *  This is a potentially slow operation and should be used only
630 	 *  when you need to make sure that some text not currently
631 	 *  visible is highlighted, for instance before printing.
632 	 * Params:
633 	 * start = start of the area to highlight.
634 	 * end = end of the area to highlight.
635 	 */
636 	public void ensureHighlight(TextIter start, TextIter end)
637 	{
638 		// void gtk_source_buffer_ensure_highlight (GtkSourceBuffer *buffer,  const GtkTextIter *start,  const GtkTextIter *end);
639 		gtk_source_buffer_ensure_highlight(gtkSourceBuffer, (start is null) ? null : start.getTextIterStruct(), (end is null) ? null : end.getTextIterStruct());
640 	}
641 }