aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-application.c
diff options
context:
space:
mode:
authorKen VanDine <ken.vandine@canonical.com>2011-02-03 16:22:27 -0500
committerKen VanDine <ken.vandine@canonical.com>2011-02-03 16:22:27 -0500
commit24664ec27541fe615592cf8f03bbb647d01baeda (patch)
tree46dac838da34494c54cc0ed5efa4b10f2f50d3a3 /src/indicator-application.c
parentc3f02be7909dc9b8a6080b0f3c7c9272f9866534 (diff)
parent56bc4ef42f82379257b856124da93f782d5cdee1 (diff)
downloadayatana-indicator-application-24664ec27541fe615592cf8f03bbb647d01baeda.tar.gz
ayatana-indicator-application-24664ec27541fe615592cf8f03bbb647d01baeda.tar.bz2
ayatana-indicator-application-24664ec27541fe615592cf8f03bbb647d01baeda.zip
releasing version 0.2.93-0ubuntu1
Diffstat (limited to 'src/indicator-application.c')
-rw-r--r--src/indicator-application.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/indicator-application.c b/src/indicator-application.c
index 5754ac4..cd83bdf 100644
--- a/src/indicator-application.c
+++ b/src/indicator-application.c
@@ -108,6 +108,7 @@ static void indicator_application_dispose (GObject *object);
static void indicator_application_finalize (GObject *object);
static GList * get_entries (IndicatorObject * io);
static guint get_location (IndicatorObject * io, IndicatorObjectEntry * entry);
+static void scroll_entry (IndicatorObject * io, IndicatorObjectEntry * entry, gint delta, IndicatorScrollDirection direction);
void connection_changed (IndicatorServiceManager * sm, gboolean connected, IndicatorApplication * application);
static void connected (IndicatorApplication * application);
static void disconnected (IndicatorApplication * application);
@@ -142,6 +143,7 @@ indicator_application_class_init (IndicatorApplicationClass *klass)
io_class->get_entries = get_entries;
io_class->get_location = get_location;
+ io_class->scroll_entry = scroll_entry;
return;
}
@@ -381,6 +383,29 @@ get_location (IndicatorObject * io, IndicatorObjectEntry * entry)
return g_list_index(priv->applications, entry);
}
+/* Redirect the scroll event to the Application Item */
+static void scroll_entry (IndicatorObject * io, IndicatorObjectEntry * entry, gint delta, IndicatorScrollDirection direction) {
+
+ g_return_if_fail(IS_INDICATOR_APPLICATION(io));
+
+ IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(io);
+ g_return_if_fail(priv->service_proxy);
+
+ GList *l = g_list_find(priv->applications, entry);
+ if (l == NULL)
+ return;
+
+ ApplicationEntry *app = l->data;
+
+ if (app && app->dbusaddress && app->dbusobject && priv->service_proxy) {
+ g_dbus_proxy_call(priv->service_proxy, "ApplicationScrollEvent",
+ g_variant_new("(ssiu)", app->dbusaddress,
+ app->dbusobject,
+ delta, direction),
+ G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, NULL);
+ }
+}
+
/* Does a quick meausre of how big the string is in
pixels with a Pango layout */
static gint