Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

gtksourcebuffer.h

00001 /*  Higlight code       
00002 *  Copyright (C) 1999 by:
00003 *Mikael Hermansson <mikeh@bahnhof.se>
00004 *
00005 *  This program is free software; you can redistribute it and/or modify
00006 *  it under the terms of the GNU General Public License as published by
00007 *  the Free Software Foundation; either version 2 of the License, or
00008 *  (at your option) any later version.
00009 *
00010 *  This program is distributed in the hope that it will be useful,
00011 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 *  GNU General Public License for more details.
00014 *
00015 *  You should have received a copy of the GNU General Public License
00016 *  along with this program; if not, write to the Free Software
00017 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018 */
00019 
00020 #ifndef HIGLIGHT_H__
00021 #define HIGLIGHT_H__
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025 #include "vdk/gtksourcetag.h"
00026 
00027 #define GTK_TYPE_SOURCE_BUFFER                  (gtk_source_buffer_get_type ())
00028 #define GTK_SOURCE_BUFFER(obj)                  (GTK_CHECK_CAST ((obj), GTK_TYPE_SOURCE_BUFFER, GtkSourceBuffer))
00029 #define GTK_SOURCE_BUFFER_CLASS(klass)          (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_SOURCE_BUFFER, GtkSourceBufferClass))
00030 #define GTK_IS_SOURCE_BUFFER(obj)               (GTK_CHECK_TYPE ((obj), GTK_TYPE_SOURCE_BUFFER))
00031 #define GTK_IS_SOURCE_BUFFER_CLASS(klass)       (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SOURCE_BUFFER))
00032 
00033 #define UNDO_TYPE_INSERT_TEXT 1
00034 #define UNDO_TYPE_INSERT_PIXBUF 2
00035 #define UNDO_TYPE_REMOVE_RANGE 3
00036 
00037 typedef struct _UndoObject
00038 {
00039   gint type;
00040   gint offset;
00041   gint len;
00042   gpointer data;
00043 }  UndoObject ;
00044 
00045 typedef struct _GtkSourceBuffer
00046 {
00047   GtkTextBuffer TextBuffer;
00048   gint highlight :1;
00049   gint check_brackets :1;
00050 
00051   gint refresh_start;
00052   gint refresh_length;
00053   Regex reg_syntax_all;
00054   GtkTextTag *exselect_tag;
00055   GtkTextMark *mark;
00056   
00057   gint redo_count; /* TODO: implement multiple redo??? */
00058   gint undo_count;
00059   gint undo_max;
00060 
00061   GPtrArray *undo_processing_array;
00062   GPtrArray *redo_array;
00063 
00064   GList *undo_list;
00065   GList *undo_current;
00066 } GtkSourceBuffer;
00067 
00068 typedef struct _GtkSourceBufferClass
00069 {
00070   GtkTextBufferClass parent_class;
00071 
00072 } GtkSourceBufferClass;
00073 
00074 GtkTextBuffer* gtk_source_buffer_new(GtkTextTagTable *table);
00075 
00076 /* pass created tables to widget */
00077 
00078 gint gtk_source_buffer_regex_search(const char *text,gint pos,Regex *regex,gboolean forward,GtkSourceBufferMatch *m);
00079 gint gtk_source_buffer_regex_match(const char *text,gint pos,gint end,Regex *regex);
00080 
00081 void gtk_source_buffer_set_check_brackets(GtkSourceBuffer *text,gboolean check);
00082 void gtk_source_buffer_set_highlight(GtkSourceBuffer *text,gboolean set);
00083 
00084 GtkSyntaxTag* gtk_source_buffer_iter_has_syntax_tag (GtkTextIter *text);
00085 gint gtk_source_buffer_get_tag_start (GtkTextIter *iter);
00086 gint gtk_source_buffer_get_tag_end (GtkTextIter *iter);
00087 
00088 GList * gtk_source_buffer_get_tags(GtkSourceBuffer *buf);
00089 GList* gtk_source_buffer_get_first_pattern_tag (GtkSourceBuffer *buf);
00090 GList* gtk_source_buffer_get_next_pattern_tag (GList *list);
00091 GList* gtk_source_buffer_get_first_syntax_tag (GtkSourceBuffer *buf);
00092 GList* gtk_source_buffer_get_next_syntax_tag (GList *list);
00093 gint gtk_source_buffer_get_n_syntax_tag(GtkSourceBuffer *buf);
00094 
00095 gchar *gtk_source_buffer_convert_to_html(GtkSourceBuffer *buf, const gchar*htmltitle);
00096 gboolean gtk_source_buffer_find_bracket_match(GtkTextIter *orig);
00097 
00098 void gtk_source_buffer_clear_undo_stack(GtkSourceBuffer *buf);
00099 void gtk_source_buffer_set_max_undo_stack(GtkSourceBuffer *buf, gint max);
00100 void gtk_source_buffer_undo(GtkSourceBuffer *buf);
00101 void gtk_source_buffer_redo(GtkSourceBuffer *buf);
00102 gint gtk_source_buffer_get_undo_count(GtkSourceBuffer *buf);
00103 gint gtk_source_buffer_get_redo_count(GtkSourceBuffer *buf);
00104 
00105 
00106 GtkType gtk_source_buffer_get_type(void);
00107 
00108 #ifdef __cplusplus
00109 }
00110 #endif
00111 #endif 

Generated on Sat May 4 21:58:25 2002 for vdk 2.0.1 by doxygen1.2.15