[anjuta/sdb-core-trans: 77/80] language-support-cpp-java: prepared support for new SymbolManager ifaces.



commit 8f6eee3d273f662d617b2f78ca5bab52c10f4a74
Author: Massimo Corà <mcora src gnome org>
Date:   Sat Aug 14 17:07:39 2010 +0200

    language-support-cpp-java: prepared support for new SymbolManager ifaces.

 plugins/language-support-cpp-java/plugin.c |   45 +++++++++++++++++++++++----
 1 files changed, 38 insertions(+), 7 deletions(-)
---
diff --git a/plugins/language-support-cpp-java/plugin.c b/plugins/language-support-cpp-java/plugin.c
index 9bd6d37..8164950 100644
--- a/plugins/language-support-cpp-java/plugin.c
+++ b/plugins/language-support-cpp-java/plugin.c
@@ -52,6 +52,8 @@
 #define PREFS_BUILDER PACKAGE_DATA_DIR"/glade/anjuta-language-cpp-java.ui"
 #define ICON_FILE "anjuta-language-cpp-java-plugin.png"
 
+#define FIXME_DEFAULT_PACKAGE_VERSION		"1.0"
+
 /* Preferences keys */
 
 #define PREF_INDENT_AUTOMATIC "language.cpp.indent.automatic"
@@ -2027,15 +2029,44 @@ on_autocompletion_toggled (GtkToggleButton* button,
 }
 
 static void
-on_package_activated (AnjutaPkgConfigChooser *self, const gchar* package)
+on_package_activated (AnjutaPkgConfigChooser *self, const gchar* package,
+    				  gpointer data)
 {
-	g_message ("activated %s", package);
+	CppJavaPlugin* plugin;
+	IAnjutaSymbolManager *isymbol_manager;
+
+	plugin = ANJUTA_PLUGIN_CPP_JAVA (data);
+
+	DEBUG_PRINT ("activated %s", package);
+	isymbol_manager = anjuta_shell_get_interface (ANJUTA_PLUGIN (plugin)->shell,
+												IAnjutaSymbolManager,
+												NULL);
+	
+	ianjuta_symbol_manager_activate_package (isymbol_manager, 
+	    									 package, 
+    							  			 FIXME_DEFAULT_PACKAGE_VERSION,
+    							  			 NULL);
+	
 }
 
 static void
-on_package_deactivated (AnjutaPkgConfigChooser *self, const gchar* package)
+on_package_deactivated (AnjutaPkgConfigChooser *self, const gchar* package,
+    					gpointer data)
 {
-	g_message ("deactivated %s", package);
+	CppJavaPlugin* plugin;
+	IAnjutaSymbolManager *isymbol_manager;
+
+	plugin = ANJUTA_PLUGIN_CPP_JAVA (data);
+
+	DEBUG_PRINT ("deactivated %s", package);
+
+	isymbol_manager = anjuta_shell_get_interface (ANJUTA_PLUGIN (plugin)->shell,
+												IAnjutaSymbolManager,
+												NULL);
+	ianjuta_symbol_manager_deactivate_package (isymbol_manager, 
+	    									 package, 
+    							  			 FIXME_DEFAULT_PACKAGE_VERSION,
+    							  			 NULL);
 }
 
 static void
@@ -2062,14 +2093,14 @@ ipreferences_merge (IAnjutaPreferences* ipref, AnjutaPreferences* prefs,
 	                  plugin->bxml);
 	on_autocompletion_toggled (GTK_TOGGLE_BUTTON (toggle), plugin->bxml);
 
-	pkg_config = gtk_builder_get_object (plugin->bxml, PREF_WIDGET_PKG_CONFIG);
+	pkg_config = GTK_WIDGET (gtk_builder_get_object (plugin->bxml, PREF_WIDGET_PKG_CONFIG));
 	anjuta_pkg_config_chooser_show_active_column (ANJUTA_PKG_CONFIG_CHOOSER (pkg_config), 
 	    										  TRUE);
 	g_signal_connect (G_OBJECT (pkg_config), "package-activated",
-					  G_CALLBACK (on_package_activated), NULL);
+					  G_CALLBACK (on_package_activated), plugin);
 
 	g_signal_connect (G_OBJECT (pkg_config), "package-deactivated",
-					  G_CALLBACK (on_package_deactivated), NULL);
+					  G_CALLBACK (on_package_deactivated), plugin);
 	
 	gtk_widget_show_all (pkg_config);
 }



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