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

sourcetag.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 
00021 
00022 #ifndef INTI_GTK_SOURCE_TAG_H
00023 #define INTI_GTK_SOURCE_TAG_H
00024 
00025 #ifndef INTI_GTK_TEXT_TAG_H
00026 #include <inti/gtk/texttag.h>
00027 #endif
00028 
00029 #ifndef __GTK_SOURCE_TAG_H__
00030 #include <gtksourceview/gtksourcetag.h>
00031 #endif
00032 
00033 #ifndef __GTK_SOURCE_TAG_TABLE_H__
00034 #include <gtksourceview/gtksourcetagtable.h>
00035 #endif
00036 
00037 namespace Inti {
00038 
00039 namespace Gtk {
00040 
00041 class SourceTagStyle;
00042 class SourceTagTableClass;
00043 
00046 
00047 class SourceTag : public TextTag
00048 {
00049         friend class G::Object;
00050 
00051         SourceTag(const SourceTag&);
00052         SourceTag& operator=(const SourceTag&);
00053 
00054 protected:
00057 
00058         explicit SourceTag(GtkSourceTag *tag, bool reference = false);
00065 
00067 //  Properties
00068 
00069         typedef G::Property<String> IdPropertyType;
00070         typedef G::PropertyProxy<G::Object, IdPropertyType> IdPropertyProxy;
00071         static const IdPropertyType id_property;
00072 
00073         typedef G::Property<Pointer<SourceTagStyle> > TagStylePropertyType;
00074         typedef G::PropertyProxy<G::Object, TagStylePropertyType> TagStylePropertyProxy;
00075         static const TagStylePropertyType tag_style_property;
00076 
00077 public:
00080 
00081         virtual ~SourceTag();
00083 
00087 
00088         GtkSourceTag* gtk_source_tag() const { return (GtkSourceTag*)instance; }
00090 
00091         operator GtkSourceTag* () const;
00093 
00094         bool is_gtk_source_tag() const;
00096 
00097         String get_id() const;
00099 
00100         SourceTagStyle* get_style() const;
00102 
00106 
00107         void set_style(const SourceTagStyle& style);
00110 
00114 
00115         const IdPropertyProxy prop_id()
00116         {
00117                 return IdPropertyProxy(this, &id_property);
00118         }
00120 
00121         const TagStylePropertyProxy prop_tag_style()
00122         {
00123                 return TagStylePropertyProxy(this, &tag_style_property);
00124         }
00126 
00128 };
00129 
00132 
00133 class SyntaxTag : public SourceTag
00134 {
00135         friend class G::Object;
00136 
00137         SyntaxTag(const SyntaxTag&);
00138         SyntaxTag& operator=(const SyntaxTag&);
00139 
00140 protected:
00143 
00144         explicit SyntaxTag(GtkSyntaxTag *tag, bool reference = false);
00151 
00153 
00154 public:
00157 
00158         SyntaxTag(const String& id, const String& name, const char *pattern_start, const char *pattern_end);
00164 
00165         virtual ~SyntaxTag();
00167 
00171 
00172         GtkSyntaxTag* gtk_syntax_tag() const { return (GtkSyntaxTag*)instance; }
00174 
00175         operator GtkSyntaxTag* () const;
00177 
00178         bool is_gtk_syntax_tag() const;
00180 
00182 };
00183 
00186 
00187 class LineCommentTag : public SyntaxTag
00188 {
00189 public:
00192 
00193         LineCommentTag(const String& id, const String& name, const char *pattern_start);
00198 
00200 };
00201 
00204 
00205 class StringTag : public SyntaxTag
00206 {
00207 public:
00210 
00211         StringTag(const String& id, const String& name, const char *pattern_start, const char *pattern_end, bool end_at_line_end);
00218 
00220 };
00221 
00224 
00225 class PatternTag : public SourceTag
00226 {
00227         friend class G::Object;
00228 
00229         PatternTag(const PatternTag&);
00230         PatternTag& operator=(const PatternTag&);
00231 
00232 protected:
00235 
00236         explicit PatternTag(GtkPatternTag *tag, bool reference = false);
00243 
00245 
00246 public:
00249 
00250         PatternTag(const String& id, const String& name, const char *pattern);
00255 
00256         virtual ~PatternTag();
00258 
00262 
00263         GtkPatternTag* gtk_pattern_tag() const { return (GtkPatternTag*)instance; }
00265 
00266         operator GtkPatternTag* () const;
00268 
00269         bool is_gtk_pattern_tag() const;
00271 
00273 };
00274 
00277 
00278 class KeywordListTag : public PatternTag
00279 {
00280 public:
00283 
00284         KeywordListTag(const String& id, const String& name, std::vector<String>& keywords, bool case_sensitive,
00285                        bool match_empty_string_at_beginning, bool match_empty_string_at_end,
00286                        const char *beginning_regex, const char *end_regex);
00296 
00298 };
00299 
00302 
00303 class SourceTagTable : public TextTagTable
00304 {
00305         friend class G::Object;
00306         friend class SourceTagTableClass;
00307 
00308         SourceTagTable(const SourceTagTable&);
00309         SourceTagTable& operator=(const SourceTagTable&);
00310 
00311 protected:
00314 
00315         explicit SourceTagTable(GtkSourceTagTable *table, bool reference = false);
00322 
00326 
00327         virtual void on_changed();
00329 
00331 //  Signals
00332 
00333         typedef G::Signal0<void> ChangedSignalType;
00334         typedef G::SignalProxy<TypeInstance, ChangedSignalType> ChangedSignalProxy;
00335         static const ChangedSignalType changed_signal;
00336 
00337 public:
00340 
00341         SourceTagTable();
00343 
00344         virtual ~SourceTagTable();
00346 
00350 
00351         GtkSourceTagTable* gtk_source_tag_table() const { return (GtkSourceTagTable*)instance; }
00353 
00354         GtkSourceTagTableClass* gtk_source_tag_table_class() const;
00356 
00357         operator GtkSourceTagTable* () const;
00359 
00360         bool is_gtk_source_tag_table() const;
00362 
00366 
00367         void add_tags(const std::vector<TextTag*>& tags);
00374 
00375         void remove_source_tags();
00379 
00383 
00384         const ChangedSignalProxy sig_changed()
00385         {
00386                 return ChangedSignalProxy(this, &changed_signal);
00387         }
00389 
00391 };
00392 
00393 } // namespace Gtk
00394 
00395 } // namespace Inti
00396 
00397 #endif // INTI_GTK_SOURCE_TAG_H
00398 
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