From d2de2511e09167ebed9120ab08476edf919776e3 Mon Sep 17 00:00:00 2001 From: Johannes Schmid Date: Sun, 12 Feb 2012 13:15:58 +0100 Subject: [PATCH] language-manager: Added ianjuta_language_get_mime_types() --- libanjuta/interfaces/libanjuta.idl | 11 ++++++++++- plugins/language-manager/plugin.c | 16 +++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/libanjuta/interfaces/libanjuta.idl b/libanjuta/interfaces/libanjuta.idl index dfc61ac1b..2c8fd61d9 100644 --- a/libanjuta/interfaces/libanjuta.idl +++ b/libanjuta/interfaces/libanjuta.idl @@ -6530,10 +6530,19 @@ typedef gint Id; * @obj: Self * @id: A valid language id * - * Returns: (element-type utf8): A list of strings that represent this language that language + * Returns: (element-type utf8): A list of strings that represent this language */ List get_strings(Id id); + /** + * ianjuta_language_get_mime_types: + * @obj: Self + * @id: A valid language id + * + * Returns: (element-type utf8): A list of mime-types that represent this language + */ + List get_mime_types(Id id); + /** * ianjuta_language_get_from_editor: * @obj: Self diff --git a/plugins/language-manager/plugin.c b/plugins/language-manager/plugin.c index 4a0ca73e2..5294d85bb 100644 --- a/plugins/language-manager/plugin.c +++ b/plugins/language-manager/plugin.c @@ -304,7 +304,7 @@ ilanguage_get_make_target (IAnjutaLanguage* ilang, IAnjutaLanguageId id, GError* { LanguageManager* lang = LANGUAGE_MANAGER(ilang); Language* language = g_hash_table_lookup (lang->languages, - GINT_TO_POINTER(id)); + GINT_TO_POINTER(id)); if (language) return language->make_target; else @@ -338,6 +338,19 @@ ilanguage_get_languages (IAnjutaLanguage* ilang, GError** e) return g_hash_table_get_keys (lang->languages); } +static GList* +ilanguage_get_mime_types(IAnjutaLanguage* ilang, IAnjutaLanguageId id, GError** e) +{ + LanguageManager* lang = LANGUAGE_MANAGER(ilang); + Language* language = g_hash_table_lookup (lang->languages, + GINT_TO_POINTER(id)); + if (language) + { + return language->mime_types; + } + return NULL; +} + static void ilanguage_iface_init (IAnjutaLanguageIface* iface) { @@ -345,6 +358,7 @@ ilanguage_iface_init (IAnjutaLanguageIface* iface) iface->get_from_string = ilanguage_get_from_string; iface->get_name = ilanguage_get_name; iface->get_strings = ilanguage_get_strings; + iface->get_mime_types = ilanguage_get_mime_types; iface->get_make_target = ilanguage_get_make_target; iface->get_from_editor = ilanguage_get_from_editor; iface->get_name_from_editor = ilanguage_get_name_from_editor; -- 2.11.4.GIT