aboutsummaryrefslogtreecommitdiff
path: root/src/sound-service-dbus.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-01-19 15:25:18 -0600
committerConor Curran <conor.curran@canonical.com>2011-01-19 15:25:18 -0600
commita4637ac0f922a3df3e31c19a0a86eebb6a8b4994 (patch)
treecabf6d00a45e7e6bf1e46e4ac97f5e0cef318d1d /src/sound-service-dbus.c
parent6db28ce9134db40a0808a3c67df5f9dd223303b5 (diff)
downloadayatana-indicator-sound-a4637ac0f922a3df3e31c19a0a86eebb6a8b4994.tar.gz
ayatana-indicator-sound-a4637ac0f922a3df3e31c19a0a86eebb6a8b4994.tar.bz2
ayatana-indicator-sound-a4637ac0f922a3df3e31c19a0a86eebb6a8b4994.zip
further consolidation on the service side
Diffstat (limited to 'src/sound-service-dbus.c')
-rw-r--r--src/sound-service-dbus.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c
index 6057a29..f14e7c6 100644
--- a/src/sound-service-dbus.c
+++ b/src/sound-service-dbus.c
@@ -24,11 +24,18 @@
#include <gio/gio.h>
#include <libindicator/indicator-service.h>
+#include <libdbusmenu-glib/server.h>
+#include <libdbusmenu-glib/client.h>
+
+#include "sound-service-dbus.h"
+
#include "gen-sound-service.xml.h"
#include "dbus-shared-names.h"
-#include "sound-service-dbus.h"
#include "common-defs.h"
#include "pulse-manager.h"
+#include "slider-menu-item.h"
+#include "mute-menu-item.h"
+
// DBUS methods
static void bus_method_call (GDBusConnection * connection,
@@ -50,9 +57,12 @@ static GDBusInterfaceVTable interface_table = {
typedef struct _SoundServiceDbusPrivate SoundServiceDbusPrivate;
struct _SoundServiceDbusPrivate {
- GDBusConnection *connection;
- gboolean mute;
- gboolean sink_availability;
+ GDBusConnection* connection;
+ gboolean mute;
+ gboolean sink_availability;
+ DbusmenuMenuitem* root_menuitem;
+ SliderMenuItem* volume_slider_menuitem;
+ MuteMenuItem* mute_menuitem;
};
static GDBusNodeInfo * node_info = NULL;
@@ -65,7 +75,6 @@ static void sound_service_dbus_init (SoundServiceDbus *self);
static void sound_service_dbus_dispose (GObject *object);
static void sound_service_dbus_finalize (GObject *object);
-/* GObject Boilerplate */
G_DEFINE_TYPE (SoundServiceDbus, sound_service_dbus, G_TYPE_OBJECT);
static void
@@ -108,6 +117,7 @@ sound_service_dbus_init (SoundServiceDbus *self)
SoundServiceDbusPrivate * priv = SOUND_SERVICE_DBUS_GET_PRIVATE(self);
priv->connection = NULL;
+
priv->mute = FALSE;
priv->sink_availability = FALSE;
@@ -134,6 +144,17 @@ sound_service_dbus_init (SoundServiceDbus *self)
}
}
+DbusmenuMenuitem* sound_service_dbus_construct_menu (SoundServiceDbus* self)
+{
+ SoundServiceDbusPrivate * priv = SOUND_SERVICE_DBUS_GET_PRIVATE(self);
+ priv->root_menuitem = dbusmenu_menuitem_new();
+ g_debug("Root ID: %d", dbusmenu_menuitem_get_id(priv->root_menuitem));
+ DbusmenuServer *server = dbusmenu_server_new(INDICATOR_SOUND_MENU_DBUS_OBJECT_PATH);
+ dbusmenu_server_set_root(server, priv->root_menuitem);
+ establish_pulse_activities(self);
+ return priv->root_menuitem;
+}
+
static void
sound_service_dbus_dispose (GObject *object)
{