2006-05-05 14:17:47 -07:00
|
|
|
/*
|
2005-09-09 02:40:10 -07:00
|
|
|
* mootextbuffer.h
|
|
|
|
*
|
2007-06-24 10:56:20 -07:00
|
|
|
* Copyright (C) 2004-2007 by Yevgen Muntyan <muntyan@math.tamu.edu>
|
2005-09-09 02:40:10 -07:00
|
|
|
*
|
2007-06-24 10:56:20 -07: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-09-09 02:40:10 -07:00
|
|
|
*
|
|
|
|
* See COPYING file that comes with this distribution.
|
|
|
|
*/
|
|
|
|
|
2007-06-10 02:06:03 -07:00
|
|
|
#ifndef MOO_TEXT_BUFFER_H
|
|
|
|
#define MOO_TEXT_BUFFER_H
|
2005-09-09 02:40:10 -07:00
|
|
|
|
2005-10-13 07:08:18 -07:00
|
|
|
#include <gtk/gtktextbuffer.h>
|
|
|
|
#include <mooedit/moolang.h>
|
2005-12-10 20:23:32 -08:00
|
|
|
#include <mooedit/moolinemark.h>
|
2005-09-09 02:40:10 -07:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
|
|
|
|
#define MOO_TYPE_TEXT_BUFFER (moo_text_buffer_get_type ())
|
|
|
|
#define MOO_TEXT_BUFFER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), MOO_TYPE_TEXT_BUFFER, MooTextBuffer))
|
|
|
|
#define MOO_TEXT_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MOO_TYPE_TEXT_BUFFER, MooTextBufferClass))
|
|
|
|
#define MOO_IS_TEXT_BUFFER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), MOO_TYPE_TEXT_BUFFER))
|
|
|
|
#define MOO_IS_TEXT_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MOO_TYPE_TEXT_BUFFER))
|
|
|
|
#define MOO_TEXT_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MOO_TYPE_TEXT_BUFFER, MooTextBufferClass))
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _MooTextBufferPrivate MooTextBufferPrivate;
|
|
|
|
typedef struct _MooTextBufferClass MooTextBufferClass;
|
|
|
|
|
|
|
|
struct _MooTextBuffer
|
|
|
|
{
|
2005-10-13 07:08:18 -07:00
|
|
|
GtkTextBuffer parent;
|
2005-09-09 02:40:10 -07:00
|
|
|
|
|
|
|
MooTextBufferPrivate *priv;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _MooTextBufferClass
|
|
|
|
{
|
2005-10-13 07:08:18 -07:00
|
|
|
GtkTextBufferClass parent_class;
|
2005-09-09 02:54:58 -07:00
|
|
|
|
2005-11-20 23:54:52 -08:00
|
|
|
void (*cursor_moved) (MooTextBuffer *buffer,
|
|
|
|
const GtkTextIter *iter);
|
|
|
|
void (*selection_changed) (MooTextBuffer *buffer);
|
2005-12-10 20:23:32 -08:00
|
|
|
|
|
|
|
void (*line_mark_added) (MooTextBuffer *buffer,
|
|
|
|
MooLineMark *mark);
|
2005-12-10 20:26:39 -08:00
|
|
|
void (*line_mark_deleted) (MooTextBuffer *buffer,
|
|
|
|
MooLineMark *mark);
|
|
|
|
void (*line_mark_moved) (MooTextBuffer *buffer,
|
|
|
|
MooLineMark *mark);
|
2005-12-12 02:58:25 -08:00
|
|
|
|
|
|
|
void (*fold_added) (MooTextBuffer *buffer,
|
|
|
|
MooFold *fold);
|
|
|
|
void (*fold_deleted) (MooTextBuffer *buffer,
|
|
|
|
MooFold *fold);
|
|
|
|
void (*fold_toggled) (MooTextBuffer *buffer,
|
|
|
|
MooFold *fold);
|
2005-09-09 02:40:10 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-10-13 07:08:18 -07:00
|
|
|
GType moo_text_buffer_get_type (void) G_GNUC_CONST;
|
2005-09-09 02:40:10 -07:00
|
|
|
|
2005-10-13 07:08:18 -07:00
|
|
|
GtkTextBuffer *moo_text_buffer_new (GtkTextTagTable *table);
|
2005-09-09 02:40:10 -07:00
|
|
|
|
2005-10-13 07:08:18 -07:00
|
|
|
void moo_text_buffer_set_lang (MooTextBuffer *buffer,
|
|
|
|
MooLang *lang);
|
|
|
|
MooLang *moo_text_buffer_get_lang (MooTextBuffer *buffer);
|
2005-09-09 02:40:10 -07:00
|
|
|
|
2005-10-13 07:08:18 -07:00
|
|
|
void moo_text_buffer_set_highlight (MooTextBuffer *buffer,
|
|
|
|
gboolean highlight);
|
|
|
|
gboolean moo_text_buffer_get_highlight (MooTextBuffer *buffer);
|
|
|
|
|
|
|
|
void moo_text_buffer_set_brackets (MooTextBuffer *buffer,
|
|
|
|
const char *brackets);
|
|
|
|
|
2005-11-13 19:08:24 -08:00
|
|
|
void moo_text_buffer_freeze (MooTextBuffer *buffer);
|
|
|
|
void moo_text_buffer_thaw (MooTextBuffer *buffer);
|
2005-11-14 21:56:39 -08:00
|
|
|
void moo_text_buffer_begin_non_interactive_action(MooTextBuffer *buffer);
|
|
|
|
void moo_text_buffer_end_non_interactive_action (MooTextBuffer *buffer);
|
2005-11-13 19:08:24 -08:00
|
|
|
|
2005-10-13 07:08:18 -07:00
|
|
|
gboolean moo_text_buffer_has_text (MooTextBuffer *buffer);
|
|
|
|
gboolean moo_text_buffer_has_selection (MooTextBuffer *buffer);
|
|
|
|
|
2005-12-10 20:23:32 -08:00
|
|
|
void moo_text_buffer_add_line_mark (MooTextBuffer *buffer,
|
2005-12-10 20:30:02 -08:00
|
|
|
MooLineMark *mark,
|
|
|
|
int line);
|
2005-12-12 02:58:25 -08:00
|
|
|
void moo_text_buffer_delete_line_mark (MooTextBuffer *buffer,
|
2005-12-10 20:23:32 -08:00
|
|
|
MooLineMark *mark);
|
|
|
|
void moo_text_buffer_move_line_mark (MooTextBuffer *buffer,
|
|
|
|
MooLineMark *mark,
|
|
|
|
int line);
|
|
|
|
GSList *moo_text_buffer_get_line_marks_in_range (MooTextBuffer *buffer,
|
|
|
|
int first_line,
|
|
|
|
int last_line);
|
2005-12-10 20:24:32 -08:00
|
|
|
GSList *moo_text_buffer_get_line_marks_at_line (MooTextBuffer *buffer,
|
|
|
|
int line);
|
2005-12-10 20:23:32 -08:00
|
|
|
|
2005-12-12 02:58:25 -08:00
|
|
|
MooFold *moo_text_buffer_add_fold (MooTextBuffer *buffer,
|
|
|
|
int first_line,
|
|
|
|
int end_line);
|
|
|
|
void moo_text_buffer_delete_fold (MooTextBuffer *buffer,
|
|
|
|
MooFold *fold);
|
|
|
|
MooFold *moo_text_buffer_get_fold_at_line (MooTextBuffer *buffer,
|
|
|
|
int line);
|
|
|
|
void moo_text_buffer_toggle_fold (MooTextBuffer *buffer,
|
|
|
|
MooFold *fold);
|
|
|
|
|
2005-09-09 02:40:10 -07:00
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
2007-06-10 02:06:03 -07:00
|
|
|
#endif /* MOO_TEXT_BUFFER_H */
|