From 2021da310c84d28efcf9bb359b7a8f7065743267 Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Tue, 20 Nov 2012 22:20:23 +0100 Subject: messages-service: move app handling into separate class Add ImApplicationList, a class that manages the list of applictions that are currently registered with the messaging menu. It creates dbus proxies for running applications and sends signals when the app adds messages or sources. --- src/im-application-list.h | 52 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/im-application-list.h (limited to 'src/im-application-list.h') diff --git a/src/im-application-list.h b/src/im-application-list.h new file mode 100644 index 0000000..3bf21c9 --- /dev/null +++ b/src/im-application-list.h @@ -0,0 +1,52 @@ +/* + * Copyright 2012 Canonical Ltd. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + * + * Authors: + * Lars Uebernickel + */ + +#ifndef __IM_APPLICATION_LIST_H__ +#define __IM_APPLICATION_LIST_H__ + +#include + +#define IM_TYPE_APPLICATION_LIST (im_application_list_get_type ()) +#define IM_APPLICATION_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), IM_TYPE_APPLICATION_LIST, ImApplicationList)) +#define IM_APPLICATION_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), IM_TYPE_APPLICATION_LIST, ImApplicationListClass)) +#define IM_IS_APPLICATION_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IM_TYPE_APPLICATION_LIST)) +#define IM_IS_APPLICATION_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), IM_TYPE_APPLICATION_LIST)) +#define IM_APPLICATION_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), IM_TYPE_APPLICATION_LIST, ImApplicationListClass)) + +typedef struct _ImApplicationList ImApplicationList; + +GType im_application_list_get_type (void); + +ImApplicationList * im_application_list_new (void); + +gboolean im_application_list_add (ImApplicationList *list, + const gchar *desktop_id); + +void im_application_list_remove (ImApplicationList *list, + const gchar *id); + +void im_application_list_set_remote (ImApplicationList *list, + const gchar *id, + GDBusConnection *connection, + const gchar *unique_bus_name, + const gchar *object_path); + +GActionGroup * im_application_list_get_action_group (ImApplicationList *list); + +#endif -- cgit v1.2.3 From 1d96aab069071bd6f73b3be8beb40ca25d37fa86 Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Wed, 21 Nov 2012 00:16:44 +0100 Subject: Replace app when another process is registering with the same id --- src/im-application-list.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/im-application-list.h') diff --git a/src/im-application-list.h b/src/im-application-list.h index 3bf21c9..ecba312 100644 --- a/src/im-application-list.h +++ b/src/im-application-list.h @@ -35,7 +35,7 @@ GType im_application_list_get_type (void); ImApplicationList * im_application_list_new (void); -gboolean im_application_list_add (ImApplicationList *list, +void im_application_list_add (ImApplicationList *list, const gchar *desktop_id); void im_application_list_remove (ImApplicationList *list, -- cgit v1.2.3 From 046ef6f5581ab2634d5ef097e6c449316c2404bf Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Tue, 13 Aug 2013 09:43:22 +0200 Subject: Add desktop menu Only shows application launchers right now. --- src/im-application-list.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/im-application-list.h') diff --git a/src/im-application-list.h b/src/im-application-list.h index ecba312..53dac50 100644 --- a/src/im-application-list.h +++ b/src/im-application-list.h @@ -21,6 +21,7 @@ #define __IM_APPLICATION_LIST_H__ #include +#include #define IM_TYPE_APPLICATION_LIST (im_application_list_get_type ()) #define IM_APPLICATION_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), IM_TYPE_APPLICATION_LIST, ImApplicationList)) @@ -49,4 +50,9 @@ void im_application_list_set_remote (ImApplicationLi GActionGroup * im_application_list_get_action_group (ImApplicationList *list); +GList * im_application_list_get_applications (ImApplicationList *list); + +GDesktopAppInfo * im_application_list_get_application (ImApplicationList *list, + const gchar *id); + #endif -- cgit v1.2.3 From 194c8bf9e07b10fb4857aeb5366b3aaee07dd9a2 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 15 Aug 2013 12:50:16 -0500 Subject: Really we should set status on the application list --- src/im-application-list.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/im-application-list.h') diff --git a/src/im-application-list.h b/src/im-application-list.h index 53dac50..f1de220 100644 --- a/src/im-application-list.h +++ b/src/im-application-list.h @@ -55,4 +55,8 @@ GList * im_application_list_get_applications (ImApplicationLi GDesktopAppInfo * im_application_list_get_application (ImApplicationList *list, const gchar *id); +void im_application_list_set_status (ImApplicationList *list, + const gchar *id, + const gchar *status); + #endif -- cgit v1.2.3