Reference Manual
Inti Logo
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

sourceview.h

Go to the documentation of this file.
00001 /*  Inti-SourceView: Integrated Foundation Classes
00002  *  Copyright (C) 2003 The Inti Development Team.
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU Library General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU Library General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  */
00018  
00024 
00025 #ifndef INTI_GTK_SOURCE_VIEW_H
00026 #define INTI_GTK_SOURCE_VIEW_H
00027 
00028 #ifndef INTI_GTK_TEXT_VIEW_H
00029 #include <inti/gtk/textview.h>
00030 #endif
00031 
00032 #ifndef INTI_GTK_SOURCE_BUFFER_H
00033 #include <inti/gtk-sourceview/sourcebuffer.h>
00034 #endif
00035 
00036 #ifndef __GTK_SOURCE_VIEW_H__
00037 #include <gtksourceview/gtksourceview.h>
00038 #endif
00039 
00040 namespace Inti {
00041 
00042 namespace Gdk {
00043 class Pixbuf;
00044 }
00045 
00046 namespace Gtk {
00047 
00048 class SourceViewClass;
00049 
00055 
00056 class SourceView : public TextView
00057 {
00058         friend class G::Object;
00059         friend class SourceViewClass;
00060 
00061         SourceView(const SourceView&);
00062         SourceView& operator=(const SourceView&);
00063 
00064 protected:
00067 
00068         explicit SourceView(GtkSourceView *view, bool reference = false);
00075         
00077 //  Properties
00078 
00079         typedef G::Property<bool> ShowLineNumbersPropertyType;
00080         typedef G::PropertyProxy<G::Object, ShowLineNumbersPropertyType> ShowLineNumbersPropertyProxy;
00081         static const ShowLineNumbersPropertyType show_line_numbers_property;
00082 
00083         typedef G::Property<bool> ShowLineMarkersPropertyType;
00084         typedef G::PropertyProxy<G::Object, ShowLineMarkersPropertyType> ShowLineMarkersPropertyProxy;
00085         static const ShowLineMarkersPropertyType show_line_markers_property;
00086 
00087         typedef G::Property<unsigned int> TabsWidthPropertyType;
00088         typedef G::PropertyProxy<G::Object, TabsWidthPropertyType> TabsWidthPropertyProxy;
00089         static const TabsWidthPropertyType tabs_width_property;
00090 
00091         typedef G::Property<bool> AutoIndentPropertyType;
00092         typedef G::PropertyProxy<G::Object, AutoIndentPropertyType> AutoIndentPropertyProxy;
00093         static const AutoIndentPropertyType auto_indent_property;
00094 
00095         typedef G::Property<bool> InsertSpacesPropertyType;
00096         typedef G::PropertyProxy<G::Object, InsertSpacesPropertyType> InsertSpacesPropertyProxy;
00097         static const InsertSpacesPropertyType insert_spaces_property;
00098 
00099         typedef G::Property<bool> ShowMarginPropertyType;
00100         typedef G::PropertyProxy<G::Object, ShowMarginPropertyType> ShowMarginPropertyProxy;
00101         static const ShowMarginPropertyType show_margin_property;
00102 
00103         typedef G::Property<unsigned int> MarginPropertyType;
00104         typedef G::PropertyProxy<G::Object, MarginPropertyType> MarginPropertyProxy;
00105         static const MarginPropertyType margin_property;
00106 
00107         typedef G::Property<bool> SmartHomeEndPropertyType;
00108         typedef G::PropertyProxy<G::Object, SmartHomeEndPropertyType> SmartHomeEndPropertyProxy;
00109         static const SmartHomeEndPropertyType smart_home_end_property;
00110 
00111 public:
00114 
00115         SourceView();
00117 
00118         explicit SourceView(SourceBuffer& buffer);
00124 
00125         virtual ~SourceView();
00127 
00131 
00132         GtkSourceView* gtk_source_view() const { return (GtkSourceView*)instance; }
00134 
00135         GtkSourceViewClass* gtk_source_view_class() const;
00137 
00138         operator GtkSourceView* () const;
00140 
00141         bool is_gtk_source_view() const;
00143 
00144         SourceBuffer* get_source_buffer() const;
00146 
00147         bool get_show_line_numbers() const;
00149 
00150         bool get_show_line_markers() const;
00152 
00153         unsigned int get_tabs_width() const;
00155 
00156         bool get_auto_indent() const;
00158 
00159         bool get_insert_spaces_instead_of_tabs() const;
00161 
00162         bool get_show_margin() const;
00164 
00165         unsigned int get_margin() const;
00167 
00168         Pointer<Gdk::Pixbuf> get_marker_pixbuf(const String& marker_type) const;
00172 
00173         bool get_smart_home_end() const;
00176 
00180 
00181         void set_show_line_numbers(bool show);
00184 
00185         void set_show_line_markers(bool show);
00188 
00189         void set_tabs_width(unsigned int width);
00192 
00193         void set_auto_indent(bool enable);
00196 
00197         void set_insert_spaces_instead_of_tabs(bool enable);
00200 
00201         void set_show_margin(bool show);
00204 
00205         void set_margin(unsigned int margin);
00208 
00209         void set_marker_pixbuf(const String& marker_type, Gdk::Pixbuf *pixbuf);
00213 
00214         void set_smart_home_end(bool enable);
00218 
00222 
00223         const ShowLineNumbersPropertyProxy prop_show_line_numbers()
00224         {
00225                 return ShowLineNumbersPropertyProxy(this, &show_line_numbers_property);
00226         }
00228 
00229         const ShowLineMarkersPropertyProxy prop_show_line_markers()
00230         {
00231                 return ShowLineMarkersPropertyProxy(this, &show_line_markers_property);
00232         }
00234 
00235         const TabsWidthPropertyProxy prop_tabs_width()
00236         {
00237                 return TabsWidthPropertyProxy(this, &tabs_width_property);
00238         }
00240 
00241         const AutoIndentPropertyProxy prop_auto_indent()
00242         {
00243                 return AutoIndentPropertyProxy(this, &auto_indent_property);
00244         }
00246 
00247         const InsertSpacesPropertyProxy prop_insert_spaces()
00248         {
00249                 return InsertSpacesPropertyProxy(this, &insert_spaces_property);
00250         }
00252 
00253         const ShowMarginPropertyProxy prop_show_margin()
00254         {
00255                 return ShowMarginPropertyProxy(this, &show_margin_property);
00256         }
00258 
00259         const MarginPropertyProxy prop_margin()
00260         {
00261                 return MarginPropertyProxy(this, &margin_property);
00262         }
00264 
00265         const SmartHomeEndPropertyProxy prop_smart_home_end()
00266         {
00267                 return SmartHomeEndPropertyProxy(this, &smart_home_end_property);
00268         }
00271 };
00272 
00273 } // namespace Gtk
00274 
00275 } // namespace Inti
00276 
00277 #endif // INTI_GTK_SOURCE_VIEW_H
00278 
Main Page - Footer


Generated on Wed Aug 27 21:17:27 2003 for Inti-SourceView by doxygen 1.3.2 written by Dimitri van Heesch, © 1997-2002