Implement activation of applications via desktop files.
[mmediamanager.git] / test / server / src / server-app.c
blobb1a0bee38e1d74dc578b4534526fd00ff97cb1e2
1 /* MManager - a Desktop wide manager for multimedia applications.
3 * Copyright (C) 2008 Cosimo Cecchi <cosimoc@gnome.org>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 #include <glib-object.h>
22 #include <glib.h>
23 #include <gio/gdesktopappinfo.h>
24 #include <libmmanager/mm.h>
26 #include "server-app.h"
28 static GObjectClass *server_app_parent_class;
29 static GType server_app_type = 0;
31 MMApplication *
32 server_app_get_application (MMApplicationProvider *provider)
34 MMApplication *app;
36 app = mm_application_new ("foo.desktop", MM_APPLICATION_PHOTO);
38 return app;
41 static void
42 server_app_application_provider_iface_init (MMApplicationProviderIface *iface)
44 /* implement interface methods */
45 iface->get_application = server_app_get_application;
48 static void
49 server_app_instance_init (ServerApp *app)
51 /* do nothing */
54 static void
55 server_app_class_init (ServerAppClass *klass)
57 server_app_parent_class = g_type_class_peek_parent (klass);
60 GType
61 server_app_get_type (void)
63 return server_app_type;
66 void
67 server_app_register_type (GTypeModule *module)
69 static const GTypeInfo info = {
70 sizeof (ServerAppClass),
71 (GBaseInitFunc) NULL,
72 (GBaseFinalizeFunc) NULL,
73 (GClassInitFunc) server_app_class_init,
74 NULL,
75 NULL,
76 sizeof (ServerApp),
78 (GInstanceInitFunc) server_app_instance_init,
81 static const GInterfaceInfo application_provider_iface_info = {
82 (GInterfaceInitFunc) server_app_application_provider_iface_init,
83 NULL,
84 NULL
87 server_app_type = g_type_module_register_type (module,
88 G_TYPE_OBJECT,
89 "ServerApp",
90 &info, 0);
92 g_type_module_add_interface (module,
93 server_app_type,
94 MM_TYPE_APPLICATION_PROVIDER,
95 &application_provider_iface_info);