static void on_editor_language_changed (IAnjutaEditor *editor, const gchar *new_language, CppJavaPlugin *plugin) { uninstall_support (plugin); install_support (plugin); }
static void on_value_added_current_editor (AnjutaPlugin *plugin, const gchar *name, const GValue *value, gpointer data) { JSLang *js_support_plugin; IAnjutaDocument* doc = IANJUTA_DOCUMENT(g_value_get_object (value)); DEBUG_PRINT ("%s", "JSLang: Add editor"); js_support_plugin = (JSLang*) plugin; if (IANJUTA_IS_EDITOR(doc)) js_support_plugin->current_editor = G_OBJECT(doc); else { js_support_plugin->current_editor = NULL; return; } install_support (js_support_plugin); }
static void on_value_added_current_editor (AnjutaPlugin *plugin, const gchar *name, const GValue *value, gpointer data) { CppJavaPlugin *lang_plugin; IAnjutaDocument* doc = IANJUTA_DOCUMENT(g_value_get_object (value)); lang_plugin = ANJUTA_PLUGIN_CPP_JAVA (plugin); if (IANJUTA_IS_EDITOR(doc)) lang_plugin->current_editor = G_OBJECT(doc); else { lang_plugin->current_editor = NULL; return; } if (IANJUTA_IS_EDITOR(lang_plugin->current_editor)) install_support (lang_plugin); g_signal_connect (lang_plugin->current_editor, "language-changed", G_CALLBACK (on_editor_language_changed), plugin); }
static void on_editor_added (AnjutaPlugin *plugin, const gchar *name, const GValue *value, gpointer data) { PythonPlugin *lang_plugin; IAnjutaDocument* doc = IANJUTA_DOCUMENT(g_value_get_object (value)); lang_plugin = ANJUTA_PLUGIN_PYTHON(plugin); if (IANJUTA_IS_EDITOR(doc)) { lang_plugin->current_editor = G_OBJECT(doc); } else { lang_plugin->current_editor = NULL; return; } if (lang_plugin->current_editor) { IAnjutaEditor* editor = IANJUTA_EDITOR (lang_plugin->current_editor); GFile* current_editor_file = ianjuta_file_get_file (IANJUTA_FILE (editor), NULL); if (current_editor_file) { lang_plugin->current_editor_filename = g_file_get_path (current_editor_file); g_object_unref (current_editor_file); } install_support (lang_plugin); g_signal_connect (lang_plugin->current_editor, "language-changed", G_CALLBACK (on_editor_language_changed), plugin); } }