medit/moo/mooedit/mootextiter.h

52 lines
1.8 KiB
C
Raw Normal View History

2006-04-16 12:26:36 -05:00
/*
2005-09-06 16:21:05 +00:00
* mootextiter.h
2005-06-22 18:20:32 +00:00
*
2007-06-24 12:56:20 -05:00
* Copyright (C) 2004-2007 by Yevgen Muntyan <muntyan@math.tamu.edu>
2005-06-22 18:20:32 +00:00
*
2007-06-24 12:56:20 -05:00
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
2005-06-22 18:20:32 +00:00
*
* See COPYING file that comes with this distribution.
2005-07-24 04:58:57 +00:00
*/
2005-06-22 18:20:32 +00:00
#ifndef MOO_TEXT_ITER_H
#define MOO_TEXT_ITER_H
2005-06-22 18:20:32 +00:00
#include <gtk/gtktextbuffer.h>
2005-06-22 18:20:32 +00:00
G_BEGIN_DECLS
typedef enum _MooBracketMatchType {
MOO_BRACKET_MATCH_NOT_AT_BRACKET = -1,
MOO_BRACKET_MATCH_NONE = 0,
MOO_BRACKET_MATCH_CORRECT = 1,
MOO_BRACKET_MATCH_INCORRECT = 2
} MooBracketMatchType;
2005-06-22 18:20:32 +00:00
/* it assumes that iter points to a bracket */
MooBracketMatchType moo_text_iter_find_matching_bracket (GtkTextIter *iter,
int limit);
2005-06-22 18:20:32 +00:00
/* tries to find bracket near the iter, i.e. like |( or (|,
2006-04-16 12:26:36 -05:00
* and chooses the better one in the case )|( */
gboolean moo_text_iter_at_bracket (GtkTextIter *iter);
2005-06-22 18:20:32 +00:00
/* like gtk_text_iter_get_chars_in_line, but tabs are translated to 8,
and line end is not included */
int moo_text_iter_get_visual_line_length (const GtkTextIter *iter,
int tab_width);
int moo_text_iter_get_visual_line_offset (const GtkTextIter *iter,
int tab_width);
void moo_text_iter_set_visual_line_offset (GtkTextIter *iter,
int offset,
int tab_width);
2005-06-22 18:20:32 +00:00
G_END_DECLS
#endif /* MOO_TEXT_ITER_H */