frameworkd-glib-dbus: don't call deprecated g_type_init for glib-2.35* and newer
[libframeworkd-glib.git] / src / opimd / frameworkd-glib-opimd-dbus.c
blobe6b572ad357b3e8557ac5a0a9a141679c6b9a779
1 /*
2 * Copyright (C) 2009
3 * Authors (alphabetical) :
4 * mrmoku (Klaus Kurzmann, mok@fluxnetz.de)
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Public License as published by
8 * the Free Software Foundation; version 2 of the license.
10 * This program 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
13 * GNU Lesser Public License for more details.
17 #include <stdlib.h>
18 #include <unistd.h>
19 #include <dbus/dbus-glib.h>
20 #include <dbus/dbus-glib-bindings.h>
21 #include "frameworkd-glib-opimd-dbus.h"
22 #include "frameworkd-glib-opimd-contacts.h"
23 #include "frameworkd-glib-opimd-messages.h"
24 #include "frameworkd-glib-opimd-sources.h"
25 #include "frameworkd-glib-opimd-calls.h"
26 #include "frameworkd-glib-opimd-fields.h"
27 #include "frameworkd-glib-opimd-types.h"
28 #include "frameworkd-glib-opimd-tasks.h"
30 void
31 dbus_connect_to_opimd_types(void)
33 if (opimdTypesBus == NULL) {
34 opimdTypesBus =
35 dbus_connect_to_interface(OPIMD_BUS, TYPES_BUS_PATH,
36 TYPES_INTERFACE,
37 "PIM.Types");
41 DBusGProxy *
42 dbus_connect_to_opimd_fields(const char *domain)
44 return (dbus_connect_to_interface(OPIMD_BUS, domain,
45 FIELDS_INTERFACE,
46 "PIM.Fields"));
49 void
50 dbus_connect_to_opimd_contacts(void)
52 if (opimdContactsBus == NULL)
53 opimdContactsBus =
54 dbus_connect_to_interface(OPIMD_BUS, CONTACTS_BUS_PATH,
55 CONTACTS_INTERFACE,
56 "PIM.Contacts");
59 DBusGProxy *
60 dbus_connect_to_opimd_contact(const char *contact_path)
62 return (dbus_connect_to_interface
63 (OPIMD_BUS, contact_path, CONTACT_INTERFACE, "PIM.Contact"));
66 DBusGProxy *
67 dbus_connect_to_opimd_contact_query(const char *query_path)
69 return (dbus_connect_to_interface
70 (OPIMD_BUS, query_path, CONTACT_QUERY_INTERFACE,
71 "PIM.ContactQuery"));
75 void
76 dbus_connect_to_opimd_messages(void)
78 if (opimdMessagesBus == NULL)
79 opimdMessagesBus =
80 dbus_connect_to_interface(OPIMD_BUS, MESSAGES_BUS_PATH,
81 MESSAGES_INTERFACE,
82 "PIM.Messages");
85 DBusGProxy *
86 dbus_connect_to_opimd_message(const char *message_path)
88 return (dbus_connect_to_interface
89 (OPIMD_BUS, message_path, MESSAGE_INTERFACE, "PIM.Message"));
92 DBusGProxy *
93 dbus_connect_to_opimd_message_query(const char *query_path)
95 return (dbus_connect_to_interface
96 (OPIMD_BUS, query_path, MESSAGE_QUERY_INTERFACE,
97 "PIM.MessageQuery"));
100 DBusGProxy *
101 dbus_connect_to_opimd_message_folder(const char *folder_path)
103 return (dbus_connect_to_interface
104 (OPIMD_BUS, folder_path, MESSAGE_FOLDER_INTERFACE,
105 "PIM.MessageFolder"));
110 void
111 dbus_connect_to_opimd_sources(void)
113 if (opimdSourcesBus == NULL)
114 opimdSourcesBus =
115 dbus_connect_to_interface(OPIMD_BUS, SOURCES_BUS_PATH,
116 SOURCES_INTERFACE,
117 "PIM.Sources");
121 DBusGProxy *
122 dbus_connect_to_opimd_source(const char *source_path)
124 return (dbus_connect_to_interface
125 (OPIMD_BUS, source_path, SOURCE_INTERFACE, "PIM.Source"));
128 void dbus_connect_to_opimd_calls(void)
130 if (opimdCallsBus == NULL)
131 opimdCallsBus =
132 dbus_connect_to_interface(OPIMD_BUS, CALLS_BUS_PATH,
133 CALLS_INTERFACE,
134 "PIM.Calls");
137 DBusGProxy *
138 dbus_connect_to_opimd_call(const char *call_path)
140 return (dbus_connect_to_interface
141 (OPIMD_BUS, call_path, PIM_CALL_INTERFACE, "PIM.Call"));
144 DBusGProxy *
145 dbus_connect_to_opimd_call_query(const char *query_path)
147 return (dbus_connect_to_interface
148 (OPIMD_BUS, query_path, CALL_QUERY_INTERFACE, "PIM.CallQuery"));
152 void
153 dbus_connect_to_opimd_tasks()
155 if (opimdTasksBus == NULL) {
156 opimdTasksBus = dbus_connect_to_interface(OPIMD_BUS,
157 TASKS_BUS_PATH,
158 TASKS_INTERFACE,
159 "PIM.Tasks");