← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~sense/indicator-application/fix-608219 into lp:indicator-application

 

Sense Hofstede has proposed merging lp:~sense/indicator-application/fix-608219 into lp:indicator-application.

Requested reviews:
  Indicator Applet Developers (indicator-applet-developers)
Related bugs:
  #608219 Submenus not added when done so with Glade
  https://bugs.launchpad.net/bugs/608219


 * Adding the new API additions to the Mono bindings;
  - The assembly version is changed to 0.2.0.0 (on advice of Joe Shields) to reflect the change in API. The policy file was left intact, so applications looking for an earlier version of the assembly should still be able to find it;
 * Adding the new API additions to the Python bindings.

Joe Shields' lp:~directhex/indicator-application/gapi_is_a_pile_of_shit branch was merged into this branch.
-- 
https://code.launchpad.net/~sense/indicator-application/fix-608219/+merge/36048
Your team ayatana-commits is subscribed to branch lp:indicator-application.
=== modified file 'bindings/mono/ApplicationIndicator.custom'
--- bindings/mono/ApplicationIndicator.custom	2010-01-12 04:59:17 +0000
+++ bindings/mono/ApplicationIndicator.custom	2010-09-20 18:32:47 +0000
@@ -1,10 +1,10 @@
-[DllImport ("libappindicator.so.0")]
+[DllImport ("appindicator.dll")]
 static extern int app_indicator_get_status (IntPtr i);
 
-[DllImport ("libappindicator.so.0")]
+[DllImport ("appindicator.dll")]
 static extern int app_indicator_get_category (IntPtr i);
 
-[DllImport ("libappindicator.so.0")]
+[DllImport ("appindicator.dll")]
 static extern void app_indicator_set_status (IntPtr i, int s);
 
         [GLib.Property ("status")]
@@ -23,4 +23,4 @@
                get {
                    return (Category) app_indicator_get_category (Handle);
                }
-        }
\ No newline at end of file
+        }

=== modified file 'bindings/mono/AssemblyInfo.cs'
--- bindings/mono/AssemblyInfo.cs	2010-04-14 16:07:23 +0000
+++ bindings/mono/AssemblyInfo.cs	2010-09-20 18:32:47 +0000
@@ -27,4 +27,4 @@
 [assembly: AssemblyCopyright ("© 2010 Canonical, Ltd.")]
 [assembly: AssemblyTrademark ("")]
 [assembly: AssemblyCulture ("")]
-[assembly: AssemblyVersion ("0.1")]
+[assembly: AssemblyVersion ("0.2")]

=== modified file 'bindings/mono/Makefile.am'
--- bindings/mono/Makefile.am	2010-07-07 19:23:37 +0000
+++ bindings/mono/Makefile.am	2010-09-20 18:32:47 +0000
@@ -10,11 +10,13 @@
 RAW_API = libappindicator-api.raw
 METADATA = libappindicator-api.metadata
 ASSEMBLY_NAME = appindicator-sharp
-ASSEMBLY_VERSION = 0.1.0.0
+ASSEMBLY_VERSION = 0.2.0.0
 ASSEMBLY = $(ASSEMBLY_NAME).dll
 POLICY = policy.$(POLICY_VERSION).$(ASSEMBLY_NAME)
 POLICY_VERSION = 0.0
 DLLPOLICY = $(POLICY).dll
+WRAPPER_FREE_BINDING_SRC = ../../src/app-indicator.c
+WRAPPER_FREE_BINDING = app-indicator.c
 
 TARGET = \
 	$(ASSEMBLY) \
@@ -35,6 +37,7 @@
 	$(RAW_API) \
 	$(TEST) \
 	$(DLLPOLICY) \
+	$(WRAPPER_FREE_BINDING) \
 	$(POLICY).config
 
 DISTCLEANFILES = $(ASSEMBLY).config
@@ -57,9 +60,12 @@
 references = $(GTK_SHARP_LIBS)
 test_references = $(GTK_SHARP_LIBS) $(NUNIT_LIBS) -r:$(ASSEMBLY)
 
-$(RAW_API): app-indicator.sources.xml
+$(RAW_API): app-indicator.sources.xml $(WRAPPER_FREE_BINDING)
 	$(GAPI_PARSER) app-indicator.sources.xml
 
+$(WRAPPER_FREE_BINDING): $(WRAPPER_FREE_BINDING_SRC)
+	sed '/signals\[X_NEW_LABEL\] /,+6d' $(WRAPPER_FREE_BINDING_SRC) > $(WRAPPER_FREE_BINDING)
+
 $(MIDDLE_API): $(METADATA) $(RAW_API)
 	cp $(srcdir)/$(RAW_API) $(MIDDLE_API)
 	chmod u+w $(MIDDLE_API)
@@ -77,6 +83,9 @@
 		-e "s|PROP_ICON_THEME_PATH_S|icon-theme-path|" \
 		-e "s|PROP_MENU_S|menu|" \
 		-e "s|PROP_CONNECTED_S|connected|" \
+		-e "s|PROP_LABEL_S|label|" \
+		-e "s|PROP_LABEL_GUIDE_S|label-guide|" \
+		-e "s|PROP_ORDERING_INDEX_S|ordering-index|" \
 		$< > $@
 
 api_includes = $(GTK_SHARP_CFLAGS)

=== modified file 'bindings/mono/app-indicator.sources.xml'
--- bindings/mono/app-indicator.sources.xml	2010-06-17 17:43:06 +0000
+++ bindings/mono/app-indicator.sources.xml	2010-09-20 18:32:47 +0000
@@ -1,8 +1,8 @@
 <gapi-parser-input>
 	<api filename="libappindicator-api.raw">
-		<library name="libappindicator.so.0">
+		<library name="appindicator.dll">
 			<namespace name="AppIndicator">
-				<file>../../src/app-indicator.c</file>
+				<file>app-indicator.c</file>
 				<file>../../src/app-indicator-enum-types.c</file>
 				<file>../../src/app-indicator-enum-types.h</file>
 				<file>../../src/app-indicator.h</file>

=== modified file 'bindings/mono/appindicator-sharp.dll.config.in'
--- bindings/mono/appindicator-sharp.dll.config.in	2009-12-16 21:15:30 +0000
+++ bindings/mono/appindicator-sharp.dll.config.in	2010-09-20 18:32:47 +0000
@@ -1,5 +1,5 @@
 <configuration>
-  <dllmap dll="appindicator-sharp.dll" target="libappindicator@LIB_PREFIX@.0@LIB_SUFFIX@"/>
+  <dllmap dll="appindicator.dll" target="libappindicator@LIB_PREFIX@.1@LIB_SUFFIX@"/>
   <dllmap dll="libgtk-2.0-0.dll" target="libgtk-2.0@LIB_PREFIX@.0@LIB_SUFFIX@"/>
   <dllmap dll="libglib-2.0-0.dll" target="libglib-2.0@LIB_PREFIX@.0@LIB_SUFFIX@"/>
   <dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0@LIB_PREFIX@.0@LIB_SUFFIX@"/>

=== modified file 'bindings/mono/libappindicator-api.metadata'
--- bindings/mono/libappindicator-api.metadata	2010-07-22 14:51:10 +0000
+++ bindings/mono/libappindicator-api.metadata	2010-09-20 18:32:47 +0000
@@ -5,11 +5,13 @@
 	<attr path="/api/namespace/object[@cname='AppIndicator']/signal[@field_name='new_attention_icon']" name="cname">new-attention-icon</attr>
 	<attr path="/api/namespace/object[@cname='AppIndicator']/signal[@field_name='new_status']" name="name">NewStatus</attr>
 	<attr path="/api/namespace/object[@cname='AppIndicator']/signal[@field_name='new_status']" name="cname">new-status</attr>
+	<attr path="/api/namespace/object[@cname='AppIndicator']/signal[@field_name='new_label']" name="name">NewLabel</attr>
+	<attr path="/api/namespace/object[@cname='AppIndicator']/signal[@field_name='new_label']" name="cname">new-label</attr>
 	<attr path="/api/namespace/object[@cname='AppIndicator']/signal[@field_name='connection_changed']" name="name">ConnectionChanged</attr>
 	<attr path="/api/namespace/object[@cname='AppIndicator']/signal[@field_name='connection_changed']" name="cname">connection-changed</attr>
 	<attr path="/api/namespace/object[@cname='AppIndicator']/signal[@field_name='new_icon']" name="name">NewIcon</attr>
 	<attr path="/api/namespace/object[@cname='AppIndicator']/signal[@field_name='new_icon']" name="cname">new-icon</attr>
-		<attr path="/api/namespace/object[@cname='AppIndicator']/signal[@field_name='new_icon_theme_path']" name="name">NewIconThemePath</attr>
+	<attr path="/api/namespace/object[@cname='AppIndicator']/signal[@field_name='new_icon_theme_path']" name="name">NewIconThemePath</attr>
 	<attr path="/api/namespace/object[@cname='AppIndicator']/signal[@field_name='new_icon_theme_path']" name="cname">new-icon-theme-path</attr>
     <attr path="/api/namespace/object[@cname='AppIndicator']/property[@cname='PROP_ID_S']" name="name">ID</attr>
     <attr path="/api/namespace/object[@cname='AppIndicator']/property[@cname='PROP_CATEGORY_S']" name="hidden">true</attr>
@@ -20,6 +22,9 @@
     <attr path="/api/namespace/object[@cname='AppIndicator']/property[@cname='PROP_MENU_S']" name="name">Menu</attr>
     <attr path="/api/namespace/object[@cname='AppIndicator']/property[@cname='PROP_MENU_S']" name="type">GtkMenu*</attr>
     <attr path="/api/namespace/object[@cname='AppIndicator']/property[@cname='PROP_CONNECTED_S']" name="name">Connected</attr>
+    <attr path="/api/namespace/object[@cname='AppIndicator']/property[@cname='PROP_LABEL_S']" name="name">Label</attr>
+    <attr path="/api/namespace/object[@cname='AppIndicator']/property[@cname='PROP_LABEL_GUIDE_S']" name="name">LabelGuide</attr>
+    <attr path="/api/namespace/object[@cname='AppIndicator']/property[@cname='PROP_ORDERING_INDEX_S']" name="name">OrderingIndex</attr>
     <attr path="/api/namespace/object[@cname='AppIndicator']/method[@name='SetMenu']" name="name">SetMenu</attr>
 
     <attr path="/api/namespace/object[@cname='AppIndicator']/constructor[@cname='app_indicator_new']/*/*[@name='id']" name="property_name">id</attr>
@@ -30,16 +35,22 @@
     <attr path="/api/namespace/object[@cname='AppIndicator']/constructor[@cname='app_indicator_new_with_path']/*/*[@name='category']" name="property_name">category</attr>
     <attr path="/api/namespace/object[@cname='AppIndicator']/constructor[@cname='app_indicator_new_with_path']/*/*[@name='icon_theme_path']" name="property_name">icon-theme-path</attr>
 
+    <remove-node path="/api/namespace/object[@cname='AppIndicator']/property[@cname='PROP_X_LABEL_S']" />
+    <remove-node path="/api/namespace/object[@cname='AppIndicator']/property[@cname='PROP_X_LABEL_GUIDE_S']" />
+    <remove-node path="/api/namespace/object[@cname='AppIndicator']/property[@cname='PROP_X_ORDERING_INDEX_S']" />
+
     <remove-node path="/api/namespace/object/method[@cname='app_indicator_get_id']" />
     <remove-node path="/api/namespace/object/method[@cname='app_indicator_get_status']" />
     <remove-node path="/api/namespace/object/method[@cname='app_indicator_get_icon']" />
     <remove-node path="/api/namespace/object/method[@cname='app_indicator_get_icon_theme_path']" />
     <remove-node path="/api/namespace/object/method[@cname='app_indicator_get_category']" />
     <remove-node path="/api/namespace/object/method[@cname='app_indicator_get_attention_icon']" />
+    <remove-node path="/api/namespace/object/method[@cname='app_indicator_get_label']" />
+    <remove-node path="/api/namespace/object/method[@cname='app_indicator_get_label_guide']" />
 
-	<remove-node path="/api/namespace/object/method[@cname='app_indicator_set_id']" />
     <remove-node path="/api/namespace/object/method[@cname='app_indicator_set_status']" />
     <remove-node path="/api/namespace/object/method[@cname='app_indicator_set_icon']" />
     <remove-node path="/api/namespace/object/method[@cname='app_indicator_set_icon_theme_path']" />
     <remove-node path="/api/namespace/object/method[@cname='app_indicator_set_attention_icon']" />
+    <remove-node path="/api/namespace/object/method[@cname='app_indicator_set_label']" />
 </metadata>

=== modified file 'bindings/python/appindicator.defs'
--- bindings/python/appindicator.defs	2010-07-22 14:51:10 +0000
+++ bindings/python/appindicator.defs	2010-09-20 18:32:47 +0000
@@ -62,6 +62,24 @@
   )
 )
 
+(define-method set_label
+  (of-object "AppIndicator")
+  (c-name "app_indicator_set_label")
+  (return-type "none")
+  (parameters
+    '("const-gchar*" "label" (null-ok))
+    '("const-gchar*" "guide" (null-ok) (default "NULL"))
+  )
+)
+
+(define-method set_ordering_index
+  (of-object "AppIndicator")
+  (c-name "app_indicator_set_ordering_index")
+  (parameters
+    '("guint32" "ordering_index")
+  )
+)
+
 (define-method set_attention_icon
   (of-object "AppIndicator")
   (c-name "app_indicator_set_attention_icon")
@@ -116,6 +134,24 @@
   (return-type "AppIndicatorStatus")
 )
 
+(define-method get_label
+  (of-object "AppIndicator")
+  (c-name "app_indicator_get_label")
+  (return-type "const-gchar*")
+)
+
+(define-method get_label_guide
+  (of-object "AppIndicator")
+  (c-name "app_indicator_get_label_guide")
+  (return-type "const-gchar*")
+)
+
+(define-method get_ordering_index
+  (of-object "AppIndicator")
+  (c-name "app_indicator_get_ordering_index")
+  (return-type "guint32")
+)
+
 (define-method get_icon
   (of-object "AppIndicator")
   (c-name "app_indicator_get_icon")

=== modified file 'src/app-indicator.c'
--- src/app-indicator.c	2010-08-11 20:55:25 +0000
+++ src/app-indicator.c	2010-09-20 18:32:47 +0000
@@ -174,6 +174,7 @@
 static void watcher_proxy_destroyed (GObject * object, gpointer data);
 static void client_menu_changed (GtkWidget *widget, GtkWidget *child, AppIndicator *indicator);
 static void submenu_changed (GtkWidget *widget, GtkWidget *child, gpointer data);
+static void submenu_added (GtkWidget *widget, GtkWidget *submenu, gpointer data);
 
 static void theme_changed_cb (GtkIconTheme * theme, gpointer user_data);
 
@@ -1749,6 +1750,14 @@
                                    child,
                                    0);
         }
+      g_signal_connect (GTK_MENU_ITEM(widget),
+                       "submenu-added",
+                       G_CALLBACK (submenu_added),
+                       child);
+      g_signal_connect (GTK_MENU_ITEM(widget),
+                       "submenu-removed",
+                       G_CALLBACK (submenu_changed),
+                       child);
     }
 
   dbusmenu_menuitem_property_set_bool (child,
@@ -1813,6 +1822,28 @@
 }
 
 static void
+submenu_added (GtkWidget *widget,
+               GtkWidget *submenu,
+               gpointer   data)
+{
+    DbusmenuMenuitem *root = (DbusmenuMenuitem *)data;
+    
+    gtk_container_foreach (GTK_CONTAINER (submenu),
+                        container_iterate,
+                        root);
+    g_signal_connect_object (GTK_MENU(submenu),
+                           "child-added",
+                           G_CALLBACK (submenu_changed),
+                           root,
+                           0);
+    g_signal_connect_object (GTK_MENU(submenu),
+                           "child-removed",
+                           G_CALLBACK (submenu_changed),
+                           root,
+                           0);
+}
+
+static void
 setup_dbusmenu (AppIndicator *self)
 {
   AppIndicatorPrivate *priv;


Follow ups