vdk 2.4.0
gtksourceview.h
1 /* gtksourceview.h
2  *
3  * Copyright (C) 2001
4  * Mikael Hermansson<tyan@linux.se>
5  * Chris Phelps <chicane@reninet.com>
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Library General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License* along with this program; if not, write to the Free
18  * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19  * 02111-1307, USA.
20  */
21 
22 #ifndef __GTK_SOURCE_VIEW_H__
23 #define __GTK_SOURCE_VIEW_H__
24 
25 #include <gtk/gtk.h>
26 #include <gtk/gtktextview.h>
27 #include <vdk/gtksourcebuffer.h>
28 
29 G_BEGIN_DECLS
30 
31 #define GTK_TYPE_SOURCE_VIEW (gtk_source_view_get_type ())
32 #define GTK_SOURCE_VIEW(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_SOURCE_VIEW, GtkSourceView))
33 #define GTK_SOURCE_VIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_SOURCE_VIEW, GtkSourceViewClass))
34 #define GTK_IS_SOURCE_VIEW(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_SOURCE_VIEW))
35 #define GTK_IS_SOURCE_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SOURCE_VIEW))
36 
37 typedef struct _GtkSourceView GtkSourceView;
38 typedef struct _GtkSourceViewClass GtkSourceViewClass;
39 
40 struct _GtkSourceView
41 {
42  GtkTextView parent;
43 
44  guint tab_stop;
45  gint show_line_numbers :1;
46  gint line_number_space;
47  guint show_line_pixmaps :1;
48  GHashTable *pixmap_cache;
49 
50  gchar *delete_range;
51 };
52 
53 struct _GtkSourceViewClass
54 {
55  GtkTextViewClass parent_class;
56 
57  void (*undo) ();
58  void (*redo) ();
59 };
60 
61 GType gtk_source_view_get_type(void);
62 
63 GtkWidget *gtk_source_view_new(void);
64 GtkWidget *gtk_source_view_new_with_buffer(GtkSourceBuffer *buffer);
65 
66 void gtk_source_view_set_show_line_numbers(GtkSourceView *view, gboolean show);
67 gboolean gtk_source_view_get_show_line_numbers(GtkSourceView *view);
68 void gtk_source_view_set_show_line_pixmaps(GtkSourceView *view, gboolean show);
69 gboolean gtk_source_view_get_show_line_pixmaps(GtkSourceView *view);
70 
71 void gtk_source_view_set_tab_stop(GtkSourceView *view, gint tab_stop);
72 gint gtk_source_view_get_tab_stop(GtkSourceView *view);
73 /* Get the width in pixels */
74 gint gtk_source_view_get_tab_stop_width(GtkSourceView *view);
75 
76 gboolean gtk_source_view_add_pixbuf(GtkSourceView *view, const gchar *key, GdkPixbuf *pixbuf, gboolean overwrite);
77 GdkPixbuf *gtk_source_view_get_pixbuf(GtkSourceView *view, const gchar *key);
78 
79 G_END_DECLS
80 
81 #endif /* end of SOURCE_VIEW_H__ */