[gnome-shell] shellDBus: Split extensions API out into a separate DBus interface



commit 7da0f398a560420b31a5bd68d9340b83c84d2ac4
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Jun 27 11:47:51 2012 -0400

    shellDBus: Split extensions API out into a separate DBus interface
    
    The generic "Shell" interface was getting a bit too crowded.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=679099

 browser-plugin/browser-plugin.c |    2 +-
 js/ui/shellDBus.js              |  102 +++++++++++++++++++++++----------------
 2 files changed, 61 insertions(+), 43 deletions(-)
---
diff --git a/browser-plugin/browser-plugin.c b/browser-plugin/browser-plugin.c
index 1703724..d16f805 100644
--- a/browser-plugin/browser-plugin.c
+++ b/browser-plugin/browser-plugin.c
@@ -225,7 +225,7 @@ NPP_New(NPMIMEType    mimetype,
                                                NULL, /* interface info */
                                                "org.gnome.Shell",
                                                "/org/gnome/Shell",
-                                               "org.gnome.Shell",
+                                               "org.gnome.Shell.Extensions",
                                                NULL, /* GCancellable */
                                                &error);
   if (!data->proxy)
diff --git a/js/ui/shellDBus.js b/js/ui/shellDBus.js
index 55de257..910d5cf 100644
--- a/js/ui/shellDBus.js
+++ b/js/ui/shellDBus.js
@@ -18,17 +18,6 @@ const GnomeShellIface = <interface name="org.gnome.Shell">
     <arg type="b" direction="out" name="success" />
     <arg type="s" direction="out" name="result" />
 </method>
-<method name="ListExtensions">
-    <arg type="a{sa{sv}}" direction="out" name="extensions" />
-</method>
-<method name="GetExtensionInfo">
-    <arg type="s" direction="in" name="extension" />
-    <arg type="a{sv}" direction="out" name="info" />
-</method>
-<method name="GetExtensionErrors">
-    <arg type="s" direction="in" name="extension" />
-    <arg type="as" direction="out" name="errors" />
-</method>
 <method name="ScreenshotArea">
     <arg type="i" direction="in" name="x"/>
     <arg type="i" direction="in" name="y"/>
@@ -57,26 +46,8 @@ const GnomeShellIface = <interface name="org.gnome.Shell">
     <arg type="i" direction="in" name="width"/>
     <arg type="i" direction="in" name="height"/>
 </method>
-<method name="InstallRemoteExtension">
-    <arg type="s" direction="in" name="uuid"/>
-</method>
-<method name="UninstallExtension">
-    <arg type="s" direction="in" name="uuid"/>
-    <arg type="b" direction="out" name="success"/>
-</method>
-<method name="LaunchExtensionPrefs">
-    <arg type="s" direction="in" name="uuid"/>
-</method>
-<method name="ReloadExtension">
-    <arg type="s" direction="in" name="uuid"/>
-</method>
 <property name="OverviewActive" type="b" access="readwrite" />
 <property name="ShellVersion" type="s" access="read" />
-<signal name="ExtensionStatusChanged">
-    <arg type="s" name="uuid"/>
-    <arg type="i" name="state"/>
-    <arg type="s" name="error"/>
-</signal>
 </interface>;
 
 const GnomeShell = new Lang.Class({
@@ -85,8 +56,8 @@ const GnomeShell = new Lang.Class({
     _init: function() {
         this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(GnomeShellIface, this);
         this._dbusImpl.export(Gio.DBus.session, '/org/gnome/Shell');
-        ExtensionSystem.connect('extension-state-changed',
-                                Lang.bind(this, this._extensionStateChanged));
+
+        this._extensionsSerivce = new GnomeShellExtensions();
     },
 
     /**
@@ -198,6 +169,64 @@ const GnomeShell = new Lang.Class({
         flashspot.fire();
     },
 
+    get OverviewActive() {
+        return Main.overview.visible;
+    },
+
+    set OverviewActive(visible) {
+        if (visible)
+            Main.overview.show();
+        else
+            Main.overview.hide();
+    },
+
+    ShellVersion: Config.PACKAGE_VERSION
+});
+
+const GnomeShellExtensionsIface = <interface name="org.gnome.Shell.Extensions">
+<method name="ListExtensions">
+    <arg type="a{sa{sv}}" direction="out" name="extensions" />
+</method>
+<method name="GetExtensionInfo">
+    <arg type="s" direction="in" name="extension" />
+    <arg type="a{sv}" direction="out" name="info" />
+</method>
+<method name="GetExtensionErrors">
+    <arg type="s" direction="in" name="extension" />
+    <arg type="as" direction="out" name="errors" />
+</method>
+<signal name="ExtensionStatusChanged">
+    <arg type="s" name="uuid"/>
+    <arg type="i" name="state"/>
+    <arg type="s" name="error"/>
+</signal>
+<method name="InstallRemoteExtension">
+    <arg type="s" direction="in" name="uuid"/>
+</method>
+<method name="UninstallExtension">
+    <arg type="s" direction="in" name="uuid"/>
+    <arg type="b" direction="out" name="success"/>
+</method>
+<method name="LaunchExtensionPrefs">
+    <arg type="s" direction="in" name="uuid"/>
+</method>
+<method name="ReloadExtension">
+    <arg type="s" direction="in" name="uuid"/>
+</method>
+<property name="ShellVersion" type="s" access="read" />
+</interface>;
+
+const GnomeShellExtensions = new Lang.Class({
+    Name: 'GnomeShellExtensionsDBus',
+
+    _init: function() {
+        this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(GnomeShellExtensionsIface, this);
+        this._dbusImpl.export(Gio.DBus.session, '/org/gnome/Shell');
+        ExtensionSystem.connect('extension-state-changed',
+                                Lang.bind(this, this._extensionStateChanged));
+    },
+
+
     ListExtensions: function() {
         let out = {};
         for (let uuid in ExtensionUtils.extensions) {
@@ -276,17 +305,6 @@ const GnomeShell = new Lang.Class({
         ExtensionSystem.loadExtension(uuid);
     },
 
-    get OverviewActive() {
-        return Main.overview.visible;
-    },
-
-    set OverviewActive(visible) {
-        if (visible)
-            Main.overview.show();
-        else
-            Main.overview.hide();
-    },
-
     ShellVersion: Config.PACKAGE_VERSION,
 
     _extensionStateChanged: function(_, newState) {



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