vdk 2.4.0
gtksourceview.h
00001 /*  gtksourceview.h
00002  *
00003  *  Copyright (C) 2001
00004  *  Mikael Hermansson<tyan@linux.se>
00005  *  Chris Phelps <chicane@reninet.com>
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU Library General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU Library General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU Library General Public
00017  *  License* along with this program; if not, write to the Free
00018  *  Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00019  *  02111-1307, USA.
00020  */
00021 
00022 #ifndef __GTK_SOURCE_VIEW_H__
00023 #define __GTK_SOURCE_VIEW_H__
00024 
00025 #include <gtk/gtk.h>
00026 #include <gtk/gtktextview.h>
00027 #include <vdk/gtksourcebuffer.h>
00028 
00029 G_BEGIN_DECLS
00030 
00031 #define GTK_TYPE_SOURCE_VIEW                  (gtk_source_view_get_type ())
00032 #define GTK_SOURCE_VIEW(obj)                  (GTK_CHECK_CAST ((obj), GTK_TYPE_SOURCE_VIEW, GtkSourceView))
00033 #define GTK_SOURCE_VIEW_CLASS(klass)          (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_SOURCE_VIEW, GtkSourceViewClass))
00034 #define GTK_IS_SOURCE_VIEW(obj)               (GTK_CHECK_TYPE ((obj), GTK_TYPE_SOURCE_VIEW))
00035 #define GTK_IS_SOURCE_VIEW_CLASS(klass)       (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SOURCE_VIEW))
00036 
00037 typedef struct _GtkSourceView GtkSourceView;
00038 typedef struct _GtkSourceViewClass GtkSourceViewClass;
00039 
00040 struct _GtkSourceView
00041 {
00042   GtkTextView parent;
00043   
00044   guint tab_stop;
00045   gint show_line_numbers :1;
00046   gint line_number_space;
00047   guint show_line_pixmaps :1;
00048   GHashTable *pixmap_cache;
00049 
00050   gchar *delete_range;
00051 };
00052 
00053 struct _GtkSourceViewClass
00054 {
00055   GtkTextViewClass parent_class;
00056   
00057   void (*undo) ();
00058   void (*redo) ();
00059 };
00060 
00061 GType gtk_source_view_get_type(void);
00062 
00063 GtkWidget *gtk_source_view_new(void);
00064 GtkWidget *gtk_source_view_new_with_buffer(GtkSourceBuffer *buffer);
00065 
00066 void gtk_source_view_set_show_line_numbers(GtkSourceView *view, gboolean show);
00067 gboolean gtk_source_view_get_show_line_numbers(GtkSourceView *view);
00068 void gtk_source_view_set_show_line_pixmaps(GtkSourceView *view, gboolean show);
00069 gboolean gtk_source_view_get_show_line_pixmaps(GtkSourceView *view);
00070 
00071 void gtk_source_view_set_tab_stop(GtkSourceView *view, gint tab_stop);
00072 gint gtk_source_view_get_tab_stop(GtkSourceView *view);
00073 /* Get the width in pixels */
00074 gint gtk_source_view_get_tab_stop_width(GtkSourceView *view);
00075 
00076 gboolean gtk_source_view_add_pixbuf(GtkSourceView *view, const gchar *key, GdkPixbuf *pixbuf, gboolean overwrite);
00077 GdkPixbuf *gtk_source_view_get_pixbuf(GtkSourceView *view, const gchar *key);
00078 
00079 G_END_DECLS
00080 
00081 #endif /* end of SOURCE_VIEW_H__ */