[anjuta] indentation-c-style: enable the plugin for IDL files
- From: Carl-Anton Ingmarsson <carlantoni src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] indentation-c-style: enable the plugin for IDL files
- Date: Thu, 31 Jan 2013 13:58:52 +0000 (UTC)
commit 821f3952b06c7106d0ea0688ef942d1014a768c0
Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
Date: Thu Jan 31 14:58:03 2013 +0100
indentation-c-style: enable the plugin for IDL files
.../anjuta-indentation-c-style.plugin.in | 4 +-
plugins/indentation-c-style/plugin.c | 26 ++++++++++---------
plugins/language-manager/languages.xml | 1 +
3 files changed, 17 insertions(+), 14 deletions(-)
---
diff --git a/plugins/indentation-c-style/anjuta-indentation-c-style.plugin.in b/plugins/indentation-c-style/anjuta-indentation-c-style.plugin.in
index fce79ae..f74719e 100644
--- a/plugins/indentation-c-style/anjuta-indentation-c-style.plugin.in
+++ b/plugins/indentation-c-style/anjuta-indentation-c-style.plugin.in
@@ -7,5 +7,5 @@ Interfaces=IAnjutaLanguageSupport,IAnjutaIndenter
UserActivatable=no
[Language Support]
-Languages=C,C++,Java,Vala,JavaScript
-MimeTypes=text/x-c,text/x-java-source,text/x-vala,application/javascript
+Languages=C,C++,Java,Vala,JavaScript,IDL
+MimeTypes=text/x-c,text/x-java-source,text/x-vala,application/javascript,text/x-idl
diff --git a/plugins/indentation-c-style/plugin.c b/plugins/indentation-c-style/plugin.c
index 2aad90c..17ad70e 100644
--- a/plugins/indentation-c-style/plugin.c
+++ b/plugins/indentation-c-style/plugin.c
@@ -329,6 +329,18 @@ initialize_indentation_params (IndentCPlugin *plugin)
}
}
+static gboolean
+language_is_supported (const gchar* language)
+{
+ return (language &&
+ (g_str_equal (language, "C") ||
+ g_str_equal (language, "C++") ||
+ g_str_equal (language, "Vala") ||
+ g_str_equal (language, "Java") ||
+ g_str_equal (language, "JavaScript") ||
+ g_str_equal (language, "IDL")));
+}
+
/* Enable/Disable language-support */
static void
install_support (IndentCPlugin *lang_plugin)
@@ -350,12 +362,7 @@ install_support (IndentCPlugin *lang_plugin)
DEBUG_PRINT("Indentation support installed for: %s",
lang_plugin->current_language);
- if (lang_plugin->current_language &&
- (g_str_equal (lang_plugin->current_language, "C")
- || g_str_equal (lang_plugin->current_language, "C++")
- || g_str_equal (lang_plugin->current_language, "Vala")
- || g_str_equal (lang_plugin->current_language, "Java")
- || g_str_equal (lang_plugin->current_language, "JavaScript")))
+ if (language_is_supported (lang_plugin->current_language))
{
g_signal_connect (lang_plugin->current_editor,
"char-added",
@@ -381,12 +388,7 @@ uninstall_support (IndentCPlugin *lang_plugin)
if (!lang_plugin->support_installed)
return;
- if (lang_plugin->current_language &&
- (g_str_equal (lang_plugin->current_language, "C")
- || g_str_equal (lang_plugin->current_language, "C++")
- || g_str_equal (lang_plugin->current_language, "Vala")
- || g_str_equal (lang_plugin->current_language, "Java")
- || g_str_equal (lang_plugin->current_language, "JavaScript")))
+ if (language_is_supported (lang_plugin->current_language))
{
g_signal_handlers_disconnect_by_func (lang_plugin->current_editor,
G_CALLBACK (cpp_java_indentation_char_added),
diff --git a/plugins/language-manager/languages.xml b/plugins/language-manager/languages.xml
index 6b19d00..a1adb68 100644
--- a/plugins/language-manager/languages.xml
+++ b/plugins/language-manager/languages.xml
@@ -12,4 +12,5 @@
<language id="8" name="Perl" strings="perl" mime-types="application/x-perl"/>
<language id="9" name="Makefile" strings="makefile" mime-types="text/x-makefile" />
<language id="10" name="ShellScript" strings="sh,shell" mime-types="application/x-sh" />
+ <language id="11" name="IDL" strings="idl" mime-types="text/x-idl" />
</languages>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]