xed/pluma/plumatextregion.h

89 lines
3.3 KiB
C
Raw Normal View History

2011-11-07 13:46:58 -06:00
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
2011-11-07 16:52:18 -06:00
* plumatextregion.h - GtkTextMark based region utility functions
2011-11-07 13:46:58 -06:00
*
* This file is part of the GtkSourceView widget
*
* 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
*/
2011-11-07 16:52:18 -06:00
#ifndef __PLUMA_TEXT_REGION_H__
#define __PLUMA_TEXT_REGION_H__
2011-11-07 13:46:58 -06:00
#include <gtk/gtk.h>
G_BEGIN_DECLS
2011-11-07 16:52:18 -06:00
typedef struct _PlumaTextRegion PlumaTextRegion;
typedef struct _PlumaTextRegionIterator PlumaTextRegionIterator;
2011-11-07 13:46:58 -06:00
2011-11-07 16:52:18 -06:00
struct _PlumaTextRegionIterator {
/* PlumaTextRegionIterator is an opaque datatype; ignore all these fields.
* Initialize the iter with pluma_text_region_get_iterator
2011-11-07 13:46:58 -06:00
* function
*/
/*< private >*/
gpointer dummy1;
guint32 dummy2;
gpointer dummy3;
};
2011-11-07 16:52:18 -06:00
PlumaTextRegion *pluma_text_region_new (GtkTextBuffer *buffer);
void pluma_text_region_destroy (PlumaTextRegion *region,
2011-11-07 13:46:58 -06:00
gboolean delete_marks);
2011-11-07 16:52:18 -06:00
GtkTextBuffer *pluma_text_region_get_buffer (PlumaTextRegion *region);
2011-11-07 13:46:58 -06:00
2011-11-07 16:52:18 -06:00
void pluma_text_region_add (PlumaTextRegion *region,
2011-11-07 13:46:58 -06:00
const GtkTextIter *_start,
const GtkTextIter *_end);
2011-11-07 16:52:18 -06:00
void pluma_text_region_subtract (PlumaTextRegion *region,
2011-11-07 13:46:58 -06:00
const GtkTextIter *_start,
const GtkTextIter *_end);
2011-11-07 16:52:18 -06:00
gint pluma_text_region_subregions (PlumaTextRegion *region);
2011-11-07 13:46:58 -06:00
2011-11-07 16:52:18 -06:00
gboolean pluma_text_region_nth_subregion (PlumaTextRegion *region,
2011-11-07 13:46:58 -06:00
guint subregion,
GtkTextIter *start,
GtkTextIter *end);
2011-11-07 16:52:18 -06:00
PlumaTextRegion *pluma_text_region_intersect (PlumaTextRegion *region,
2011-11-07 13:46:58 -06:00
const GtkTextIter *_start,
const GtkTextIter *_end);
2011-11-07 16:52:18 -06:00
void pluma_text_region_get_iterator (PlumaTextRegion *region,
PlumaTextRegionIterator *iter,
2011-11-07 13:46:58 -06:00
guint start);
2011-11-07 16:52:18 -06:00
gboolean pluma_text_region_iterator_is_end (PlumaTextRegionIterator *iter);
2011-11-07 13:46:58 -06:00
/* Returns FALSE if iterator is the end iterator */
2011-11-07 16:52:18 -06:00
gboolean pluma_text_region_iterator_next (PlumaTextRegionIterator *iter);
2011-11-07 13:46:58 -06:00
2011-11-07 16:52:18 -06:00
void pluma_text_region_iterator_get_subregion (PlumaTextRegionIterator *iter,
2011-11-07 13:46:58 -06:00
GtkTextIter *start,
GtkTextIter *end);
2011-11-07 16:52:18 -06:00
void pluma_text_region_debug_print (PlumaTextRegion *region);
2011-11-07 13:46:58 -06:00
G_END_DECLS
2011-11-07 16:52:18 -06:00
#endif /* __PLUMA_TEXT_REGION_H__ */