2011-11-07 13:46:58 -06:00
|
|
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
|
|
|
|
*
|
2016-01-25 08:13:49 -06:00
|
|
|
* xedittextregion.h - GtkTextMark based region utility functions
|
2011-11-07 13:46:58 -06:00
|
|
|
*
|
|
|
|
* This file is part of the GtkSourceView widget
|
|
|
|
*
|
2014-02-22 10:36:10 -06:00
|
|
|
* Copyright (C) 2002 Gustavo Giráldez <gustavo.giraldez@gmx.net>
|
2011-11-07 13:46:58 -06:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-11-18 19:54:49 -06:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2011-11-07 13:46:58 -06:00
|
|
|
*/
|
|
|
|
|
2016-01-25 08:13:49 -06:00
|
|
|
#ifndef __XEDIT_TEXT_REGION_H__
|
|
|
|
#define __XEDIT_TEXT_REGION_H__
|
2011-11-07 13:46:58 -06:00
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2016-01-25 08:13:49 -06:00
|
|
|
typedef struct _XeditTextRegion XeditTextRegion;
|
|
|
|
typedef struct _XeditTextRegionIterator XeditTextRegionIterator;
|
2011-11-07 13:46:58 -06:00
|
|
|
|
2016-01-25 08:13:49 -06:00
|
|
|
struct _XeditTextRegionIterator {
|
|
|
|
/* XeditTextRegionIterator is an opaque datatype; ignore all these fields.
|
|
|
|
* Initialize the iter with xedit_text_region_get_iterator
|
2011-11-07 13:46:58 -06:00
|
|
|
* function
|
|
|
|
*/
|
|
|
|
/*< private >*/
|
|
|
|
gpointer dummy1;
|
|
|
|
guint32 dummy2;
|
|
|
|
gpointer dummy3;
|
|
|
|
};
|
|
|
|
|
2016-01-25 08:13:49 -06:00
|
|
|
XeditTextRegion *xedit_text_region_new (GtkTextBuffer *buffer);
|
|
|
|
void xedit_text_region_destroy (XeditTextRegion *region,
|
2011-11-07 13:46:58 -06:00
|
|
|
gboolean delete_marks);
|
|
|
|
|
2016-01-25 08:13:49 -06:00
|
|
|
GtkTextBuffer *xedit_text_region_get_buffer (XeditTextRegion *region);
|
2011-11-07 13:46:58 -06:00
|
|
|
|
2016-01-25 08:13:49 -06:00
|
|
|
void xedit_text_region_add (XeditTextRegion *region,
|
2011-11-07 13:46:58 -06:00
|
|
|
const GtkTextIter *_start,
|
|
|
|
const GtkTextIter *_end);
|
|
|
|
|
2016-01-25 08:13:49 -06:00
|
|
|
void xedit_text_region_subtract (XeditTextRegion *region,
|
2011-11-07 13:46:58 -06:00
|
|
|
const GtkTextIter *_start,
|
|
|
|
const GtkTextIter *_end);
|
|
|
|
|
2016-01-25 08:13:49 -06:00
|
|
|
gint xedit_text_region_subregions (XeditTextRegion *region);
|
2011-11-07 13:46:58 -06:00
|
|
|
|
2016-01-25 08:13:49 -06:00
|
|
|
gboolean xedit_text_region_nth_subregion (XeditTextRegion *region,
|
2011-11-07 13:46:58 -06:00
|
|
|
guint subregion,
|
|
|
|
GtkTextIter *start,
|
|
|
|
GtkTextIter *end);
|
|
|
|
|
2016-01-25 08:13:49 -06:00
|
|
|
XeditTextRegion *xedit_text_region_intersect (XeditTextRegion *region,
|
2011-11-07 13:46:58 -06:00
|
|
|
const GtkTextIter *_start,
|
|
|
|
const GtkTextIter *_end);
|
|
|
|
|
2016-01-25 08:13:49 -06:00
|
|
|
void xedit_text_region_get_iterator (XeditTextRegion *region,
|
|
|
|
XeditTextRegionIterator *iter,
|
2011-11-07 13:46:58 -06:00
|
|
|
guint start);
|
|
|
|
|
2016-01-25 08:13:49 -06:00
|
|
|
gboolean xedit_text_region_iterator_is_end (XeditTextRegionIterator *iter);
|
2011-11-07 13:46:58 -06:00
|
|
|
|
|
|
|
/* Returns FALSE if iterator is the end iterator */
|
2016-01-25 08:13:49 -06:00
|
|
|
gboolean xedit_text_region_iterator_next (XeditTextRegionIterator *iter);
|
2011-11-07 13:46:58 -06:00
|
|
|
|
2016-01-25 08:13:49 -06:00
|
|
|
void xedit_text_region_iterator_get_subregion (XeditTextRegionIterator *iter,
|
2011-11-07 13:46:58 -06:00
|
|
|
GtkTextIter *start,
|
|
|
|
GtkTextIter *end);
|
|
|
|
|
2016-01-25 08:13:49 -06:00
|
|
|
void xedit_text_region_debug_print (XeditTextRegion *region);
|
2011-11-07 13:46:58 -06:00
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
2016-01-25 08:13:49 -06:00
|
|
|
#endif /* __XEDIT_TEXT_REGION_H__ */
|