Debian Codegraph @

launch_helper/cual/cual_c.go

raw
1 /*
2 Copyright 2013-2014 Canonical Ltd.
3
4 This program is free software: you can redistribute it and/or modify it
5 under the terms of the GNU General Public License version 3, as published
6 by the Free Software Foundation.
7
8 This program is distributed in the hope that it will be useful, but
9 WITHOUT ANY WARRANTY; without even the implied warranties of
10 MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 PURPOSE. See the GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License along
14 with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17 package cual
18
19 // this is a .go to work around limitations in dh-golang
20
21 /*
22 #include <lomiri-app-launch.h>
23 #include <glib.h>
24
25 #define HELPER_ERROR g_quark_from_static_string ("cgo-ual-helper-error-quark")
26
27 void helperDone(gpointer gp, const gchar * ciid);
28
29 static void observer_of_stop (const gchar * app_id, const gchar * instance_id, const gchar * helper_type, gpointer user_data) {
30 helperDone (user_data, instance_id);
31 }
32
33 char* launch(gchar* app_id, gchar* f1, gchar* f2, gpointer p) {
34 const gchar* uris[] = {f1, f2, NULL};
35 gchar* iid = lomiri_app_launch_start_multiple_helper ("push-helper", app_id, uris);
36 g_free (app_id);
37 g_free (f1);
38 g_free (f2);
39 return iid;
40 }
41
42 gboolean add_observer(gpointer p) {
43 return lomiri_app_launch_observer_add_helper_stop(observer_of_stop, "push-helper", p);
44 }
45
46 gboolean remove_observer(gpointer p) {
47 return lomiri_app_launch_observer_delete_helper_stop(observer_of_stop, "push-helper", p);
48 }
49
50 gboolean stop(gchar* app_id, gchar* iid) {
51 gboolean res;
52 res = lomiri_app_launch_stop_multiple_helper ("push-helper", app_id, iid);
53 g_free (app_id);
54 g_free (iid);
55 return res;
56 }
57 */
58 import "C"