[anjuta] language-manager: Added get_languages() to the interface



commit ec906805062d6d9ca0323be2fe07001464727bea
Author: Johannes Schmid <jhs gnome org>
Date:   Fri Dec 4 16:17:26 2009 +0100

    language-manager: Added get_languages() to the interface

 libanjuta/interfaces/libanjuta.idl |   10 ++++++++++
 plugins/language-manager/plugin.c  |    8 ++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/libanjuta/interfaces/libanjuta.idl b/libanjuta/interfaces/libanjuta.idl
index ae48fc1..780d059 100644
--- a/libanjuta/interfaces/libanjuta.idl
+++ b/libanjuta/interfaces/libanjuta.idl
@@ -5853,4 +5853,14 @@ typedef gint Id;
 	  */
 	  
 	  const gchar* get_name_from_editor (IAnjutaEditorLanguage* editor);
+	  
+	  /*
+	   * ianjuta_language_get_languages:
+	   * @obj: Self
+	   * @err: Error propagation
+	   *
+	   * Returns: a list of ids of the available languages. Use GPOINTER_TO_INT()
+	   * to receive them. The list but not the values should be free'd with g_list_free()
+	   */
+	   GList* get_languages ();
 }
diff --git a/plugins/language-manager/plugin.c b/plugins/language-manager/plugin.c
index d0d6f5f..f68d2e3 100644
--- a/plugins/language-manager/plugin.c
+++ b/plugins/language-manager/plugin.c
@@ -317,6 +317,13 @@ ilanguage_get_name_from_editor (IAnjutaLanguage* ilang, IAnjutaEditorLanguage* e
 							   ilanguage_get_from_editor (ilang, editor, e), e);
 }
 
+static GList*
+ilanguage_get_languages (IAnjutaLanguage* ilang, GError** e)
+{
+	LanguageManager* lang = LANGUAGE_MANAGER(ilang);
+	return g_hash_table_get_keys (lang->languages);
+}
+
 static void
 ilanguage_iface_init (IAnjutaLanguageIface* iface)
 {
@@ -326,6 +333,7 @@ ilanguage_iface_init (IAnjutaLanguageIface* iface)
 	iface->get_strings = ilanguage_get_strings;
 	iface->get_from_editor = ilanguage_get_from_editor;
 	iface->get_name_from_editor = ilanguage_get_name_from_editor;
+	iface->get_languages = ilanguage_get_languages;
 };	
 
 ANJUTA_PLUGIN_BEGIN (LanguageManager, language_manager);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]