00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00024
00025 #ifndef INTI_GTK_SOURCE_LANGUAGE_H
00026 #define INTI_GTK_SOURCE_LANGUAGE_H
00027
00028 #ifndef INTI_G_OBJECT_H
00029 #include <inti/glib/object.h>
00030 #endif
00031
00032 #ifndef INTI_GTK_SOURCE_TAG_H
00033 #include <inti/gtk-sourceview/sourcetagstyle.h>
00034 #endif
00035
00036 #ifndef __GTK_SOURCE_LANGUAGE_H__
00037 #include <gtksourceview/gtksourcelanguage.h>
00038 #endif
00039
00040 #ifndef __GTK_SOURCE_LANGUAGES_MANAGER_H__
00041 #include <gtksourceview/gtksourcelanguagesmanager.h>
00042 #endif
00043
00044 #ifndef _CPP_VECTOR
00045 #include <vector>
00046 #endif
00047
00048 namespace Inti {
00049
00050 namespace Gtk {
00051
00052 class SourceLanguageClass;
00053 class SourceLanguagesManagerClass;
00054 class SourceStyleScheme;
00055 class TextTag;
00056
00061
00062 class SourceLanguage : public G::Object
00063 {
00064 friend class G::Object;
00065 friend class SourceLanguageClass;
00066
00067 SourceLanguage(const SourceLanguage&);
00068 SourceLanguage& operator=(const SourceLanguage&);
00069
00070 protected:
00073
00074 explicit SourceLanguage(GtkSourceLanguage *language, bool reference = false);
00081
00085
00086 virtual void on_tag_style_changed(const String& name);
00089
00091
00092
00093 typedef G::Signal1<void, const char*> TagStyleChangedSignalType;
00094 typedef G::SignalProxy<TypeInstance, TagStyleChangedSignalType> TagStyleChangedSignalProxy;
00095 static const TagStyleChangedSignalType tag_style_changed_signal;
00096
00097 public:
00100
00101 virtual ~SourceLanguage();
00103
00107
00108 GtkSourceLanguage* gtk_source_language() const { return (GtkSourceLanguage*)instance; }
00110
00111 GtkSourceLanguageClass* gtk_source_language_class() const;
00113
00114 operator GtkSourceLanguage* () const;
00116
00117 bool is_gtk_source_language() const;
00119
00123
00124 String get_id() const;
00126
00127 String get_name() const;
00130
00131 String get_section() const;
00134
00135 bool get_tags(std::vector<Pointer<TextTag> >& tags) const;
00139
00140 G::Unichar get_escape_char() const;
00142
00143 bool get_mime_types(std::vector<String>& mime_types) const;
00147
00148 SourceStyleScheme* get_style_scheme() const;
00150
00151 SourceTagStyle* get_tag_style(const String& tag_id) const;
00155
00156 SourceTagStyle* get_tag_default_style(const String& tag_id) const;
00160
00164
00165 void set_mime_types(const std::vector<String>& mime_types);
00168
00169 void set_style_scheme(SourceStyleScheme& scheme);
00172
00173 void set_tag_style(const String& tag_id, const SourceTagStyle& style);
00177
00181
00182 const TagStyleChangedSignalProxy sig_tag_style_changed()
00183 {
00184 return TagStyleChangedSignalProxy(this, &tag_style_changed_signal);
00185 }
00187
00189 };
00190
00195
00196 class SourceLanguagesManager : public G::Object
00197 {
00198 friend class G::Object;
00199 friend class SourceLanguagesManagerClass;
00200
00201 SourceLanguagesManager(const SourceLanguagesManager&);
00202 SourceLanguagesManager& operator=(const SourceLanguagesManager&);
00203
00204 protected:
00207
00208 explicit SourceLanguagesManager(GtkSourceLanguagesManager *lm, bool reference = false);
00215
00217
00218
00219 typedef G::Property<GSList*> LangSpecsDirsPropertyType;
00220 typedef G::PropertyProxy<G::Object, LangSpecsDirsPropertyType> LangSpecsDirsPropertyProxy;
00221 static const LangSpecsDirsPropertyType lang_specs_dirs_property;
00222
00223 public:
00226
00227 SourceLanguagesManager();
00229
00230 virtual ~SourceLanguagesManager();
00232
00236
00237 GtkSourceLanguagesManager* gtk_source_languages_manager() const { return (GtkSourceLanguagesManager*)instance; }
00239
00240 GtkSourceLanguagesManagerClass* gtk_source_languages_manager_class() const;
00242
00243 operator GtkSourceLanguagesManager* () const;
00245
00246 bool is_gtk_source_languages_manager() const;
00248
00252
00253 bool get_available_languages(std::vector<SourceLanguage*>& languages) const;
00257
00258 SourceLanguage* get_language_from_mime_type(const String& mime_type) const;
00262
00263 Gtk::SourceLanguage* get_language_from_name(const String& language) const;
00270
00271 bool get_lang_files_dirs(std::vector<String>& dirs) const;
00275
00279
00280 const LangSpecsDirsPropertyProxy prop_lang_specs_dirs()
00281 {
00282 return LangSpecsDirsPropertyProxy(this, &lang_specs_dirs_property);
00283 }
00286
00288 };
00289
00290 }
00291
00292 }
00293
00294 #endif // INTI_GTK_SOURCE_LANGUAGE_H
00295