00001
00002
00003 #ifndef _GTKSOURCEVIEWMM_SOURCEVIEW_H
00004 #define _GTKSOURCEVIEWMM_SOURCEVIEW_H
00005
00006
00007 #include <glibmm.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00032
00033 #include <gtkmm/textview.h>
00034 #include <gtksourceviewmm/sourcebuffer.h>
00035
00036
00037 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00038 typedef struct _GtkSourceView GtkSourceView;
00039 typedef struct _GtkSourceViewClass GtkSourceViewClass;
00040 #endif
00041
00042
00043 namespace gtksourceview
00044 { class SourceView_Class; }
00045 namespace gtksourceview
00046 {
00047
00053 enum SourceSmartHomeEndType
00054 {
00055 SOURCE_SMART_HOME_END_DISABLED,
00056 SOURCE_SMART_HOME_END_BEFORE,
00057 SOURCE_SMART_HOME_END_AFTER,
00058 SOURCE_SMART_HOME_END_ALWAYS
00059 };
00060
00061 }
00062
00063
00064 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00065 namespace Glib
00066 {
00067
00068 template <>
00069 class Value<gtksourceview::SourceSmartHomeEndType> : public Glib::Value_Enum<gtksourceview::SourceSmartHomeEndType>
00070 {
00071 public:
00072 static GType value_type() G_GNUC_CONST;
00073 };
00074
00075 }
00076 #endif
00077
00078
00079 namespace gtksourceview
00080 {
00081
00082
00086
00087 class SourceView : public Gtk::TextView
00088 {
00089 public:
00090 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00091 typedef SourceView CppObjectType;
00092 typedef SourceView_Class CppClassType;
00093 typedef GtkSourceView BaseObjectType;
00094 typedef GtkSourceViewClass BaseClassType;
00095 #endif
00096
00097 virtual ~SourceView();
00098
00099 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00100
00101 private:
00102 friend class SourceView_Class;
00103 static CppClassType sourceview_class_;
00104
00105
00106 SourceView(const SourceView&);
00107 SourceView& operator=(const SourceView&);
00108
00109 protected:
00110 explicit SourceView(const Glib::ConstructParams& construct_params);
00111 explicit SourceView(GtkSourceView* castitem);
00112
00113 #endif
00114
00115 public:
00116 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00117 static GType get_type() G_GNUC_CONST;
00118 static GType get_base_type() G_GNUC_CONST;
00119 #endif
00120
00122 GtkSourceView* gobj() { return reinterpret_cast<GtkSourceView*>(gobject_); }
00123
00125 const GtkSourceView* gobj() const { return reinterpret_cast<GtkSourceView*>(gobject_); }
00126
00127
00128 public:
00129
00130 #ifdef GLIBMM_VFUNCS_ENABLED
00131 #endif //GLIBMM_VFUNCS_ENABLED
00132
00133 protected:
00134
00135 #ifdef GLIBMM_VFUNCS_ENABLED
00136 #endif //GLIBMM_VFUNCS_ENABLED
00137
00138
00139 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00140 virtual void on_redo();
00141 virtual void on_undo();
00142 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00143
00144
00145 private:
00146
00147
00148 public:
00149
00150
00151
00153 explicit SourceView () ;
00154
00159 explicit SourceView (const Glib::RefPtr<SourceBuffer> &buffer) ;
00160
00161
00162 static Glib::RefPtr<SourceView> create();
00163
00164
00165 static Glib::RefPtr<SourceView> create(const Glib::RefPtr<SourceBuffer> & buffer);
00166
00167
00171 Glib::RefPtr<const SourceBuffer> get_source_buffer () const ;
00172
00176 Glib::RefPtr<SourceBuffer> get_source_buffer () ;
00177
00181 void set_source_buffer (const Glib::RefPtr<SourceBuffer> &source_buffer) ;
00182
00186
00190 void set_show_line_numbers(bool show=true);
00191
00195
00199 bool get_show_line_numbers() const;
00200
00204
00208 void set_tab_width(guint width);
00209
00213
00217 guint get_tab_width() const;
00218
00222
00226 void set_auto_indent(bool enable=true);
00227
00231
00235 bool get_auto_indent() const;
00236
00240
00245 void set_insert_spaces_instead_of_tabs(bool enable=true);
00246
00250
00254 bool get_insert_spaces_instead_of_tabs() const;
00255
00259
00263 void set_show_right_margin(bool show = true);
00264
00268
00272 bool get_show_right_margin() const;
00273
00277
00281 void set_highlight_current_line(bool highlight=true);
00282
00286
00290 bool get_highlight_current_line() const;
00291
00295
00300 void set_right_margin_position(guint margin);
00301
00305
00309 guint get_right_margin_position() const;
00310
00314
00319 void set_smart_home_end(SourceSmartHomeEndType smart_he);
00320
00324
00328 SourceSmartHomeEndType get_smart_home_end() const;
00329
00333
00339 void set_show_line_marks(bool show = true);
00340
00344
00350 bool get_show_line_marks() const;
00351
00356
00364 void set_indent_on_tab(bool show = true);
00365
00370
00376 bool get_indent_on_tab() const;
00377
00384
00390 void set_indent_width(gint width);
00391
00397
00401 gint get_indent_width() const;
00402
00410
00419 void set_mark_category_priority(const Glib::ustring& category, gint priority);
00420
00426
00434 gint get_mark_category_priority(const Glib::ustring& category) const;
00435
00441
00449 void set_mark_category_pixbuf(const Glib::ustring& category, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf);
00454
00461 Glib::RefPtr<Gdk::Pixbuf> get_mark_category_pixbuf(const Glib::ustring& category);
00462
00467
00474 Glib::RefPtr<const Gdk::Pixbuf> get_mark_category_pixbuf(const Glib::ustring& category) const;
00475
00476
00482 Glib::SignalProxy0< void > signal_redo();
00483
00484
00490 Glib::SignalProxy0< void > signal_undo();
00491
00492
00496 #ifdef GLIBMM_PROPERTIES_ENABLED
00497
00503 Glib::PropertyProxy<bool> property_show_line_numbers() ;
00504 #endif //#GLIBMM_PROPERTIES_ENABLED
00505
00506 #ifdef GLIBMM_PROPERTIES_ENABLED
00507
00513 Glib::PropertyProxy_ReadOnly<bool> property_show_line_numbers() const;
00514 #endif //#GLIBMM_PROPERTIES_ENABLED
00515
00516
00520 #ifdef GLIBMM_PROPERTIES_ENABLED
00521
00527 Glib::PropertyProxy<bool> property_show_line_marks() ;
00528 #endif //#GLIBMM_PROPERTIES_ENABLED
00529
00530 #ifdef GLIBMM_PROPERTIES_ENABLED
00531
00537 Glib::PropertyProxy_ReadOnly<bool> property_show_line_marks() const;
00538 #endif //#GLIBMM_PROPERTIES_ENABLED
00539
00540
00545 #ifdef GLIBMM_PROPERTIES_ENABLED
00546
00552 Glib::PropertyProxy<guint> property_tab_width() ;
00553 #endif //#GLIBMM_PROPERTIES_ENABLED
00554
00555 #ifdef GLIBMM_PROPERTIES_ENABLED
00556
00562 Glib::PropertyProxy_ReadOnly<guint> property_tab_width() const;
00563 #endif //#GLIBMM_PROPERTIES_ENABLED
00564
00565
00570 #ifdef GLIBMM_PROPERTIES_ENABLED
00571
00577 Glib::PropertyProxy<int> property_indent_width() ;
00578 #endif //#GLIBMM_PROPERTIES_ENABLED
00579
00580 #ifdef GLIBMM_PROPERTIES_ENABLED
00581
00587 Glib::PropertyProxy_ReadOnly<int> property_indent_width() const;
00588 #endif //#GLIBMM_PROPERTIES_ENABLED
00589
00590
00594 #ifdef GLIBMM_PROPERTIES_ENABLED
00595
00601 Glib::PropertyProxy<bool> property_auto_indent() ;
00602 #endif //#GLIBMM_PROPERTIES_ENABLED
00603
00604 #ifdef GLIBMM_PROPERTIES_ENABLED
00605
00611 Glib::PropertyProxy_ReadOnly<bool> property_auto_indent() const;
00612 #endif //#GLIBMM_PROPERTIES_ENABLED
00613
00614
00618 #ifdef GLIBMM_PROPERTIES_ENABLED
00619
00625 Glib::PropertyProxy<bool> property_insert_spaces_instead_of_tabs() ;
00626 #endif //#GLIBMM_PROPERTIES_ENABLED
00627
00628 #ifdef GLIBMM_PROPERTIES_ENABLED
00629
00635 Glib::PropertyProxy_ReadOnly<bool> property_insert_spaces_instead_of_tabs() const;
00636 #endif //#GLIBMM_PROPERTIES_ENABLED
00637
00638
00642 #ifdef GLIBMM_PROPERTIES_ENABLED
00643
00649 Glib::PropertyProxy<bool> property_show_right_margin() ;
00650 #endif //#GLIBMM_PROPERTIES_ENABLED
00651
00652 #ifdef GLIBMM_PROPERTIES_ENABLED
00653
00659 Glib::PropertyProxy_ReadOnly<bool> property_show_right_margin() const;
00660 #endif //#GLIBMM_PROPERTIES_ENABLED
00661
00662
00667 #ifdef GLIBMM_PROPERTIES_ENABLED
00668
00674 Glib::PropertyProxy<guint> property_right_margin_position() ;
00675 #endif //#GLIBMM_PROPERTIES_ENABLED
00676
00677 #ifdef GLIBMM_PROPERTIES_ENABLED
00678
00684 Glib::PropertyProxy_ReadOnly<guint> property_right_margin_position() const;
00685 #endif //#GLIBMM_PROPERTIES_ENABLED
00686
00687
00691 #ifdef GLIBMM_PROPERTIES_ENABLED
00692
00698 Glib::PropertyProxy<SourceSmartHomeEndType> property_smart_home_end() ;
00699 #endif //#GLIBMM_PROPERTIES_ENABLED
00700
00701 #ifdef GLIBMM_PROPERTIES_ENABLED
00702
00708 Glib::PropertyProxy_ReadOnly<SourceSmartHomeEndType> property_smart_home_end() const;
00709 #endif //#GLIBMM_PROPERTIES_ENABLED
00710
00711
00715 #ifdef GLIBMM_PROPERTIES_ENABLED
00716
00722 Glib::PropertyProxy<bool> property_highlight_current_line() ;
00723 #endif //#GLIBMM_PROPERTIES_ENABLED
00724
00725 #ifdef GLIBMM_PROPERTIES_ENABLED
00726
00732 Glib::PropertyProxy_ReadOnly<bool> property_highlight_current_line() const;
00733 #endif //#GLIBMM_PROPERTIES_ENABLED
00734
00735
00740 #ifdef GLIBMM_PROPERTIES_ENABLED
00741
00747 Glib::PropertyProxy<bool> property_indent_on_tab() ;
00748 #endif //#GLIBMM_PROPERTIES_ENABLED
00749
00750 #ifdef GLIBMM_PROPERTIES_ENABLED
00751
00757 Glib::PropertyProxy_ReadOnly<bool> property_indent_on_tab() const;
00758 #endif //#GLIBMM_PROPERTIES_ENABLED
00759
00760
00761 };
00762
00763 }
00764
00765
00766 namespace Glib
00767 {
00776 gtksourceview::SourceView* wrap(GtkSourceView* object, bool take_copy = false);
00777 }
00778
00779
00780 #endif
00781