~ubuntu-branches/ubuntu/lucid/fpc/lucid-proposed

« back to all changes in this revision

Viewing changes to fpcsrc/packages/dbus/src/dbus-connection.inc

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-10-09 23:29:00 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20081009232900-553f61m37jkp6upv
Tags: 2.2.2-4
[ Torsten Werner ]
* Update ABI version in fpc-depends automatically.
* Remove empty directories from binary package fpc-source.

[ Mazen Neifer ]
* Removed leading path when calling update-alternatives to remove a Linitian
  error.
* Fixed clean target.
* Improved description of packages. (Closes: #498882)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{ -*- mode: C; c-file-style: "gnu" -*- }
 
2
{ dbus-connection.h DBusConnection object
 
3
 *
 
4
 * Copyright (C) 2002, 2003  Red Hat Inc.
 
5
 *
 
6
 * Licensed under the Academic Free License version 2.1
 
7
 * 
 
8
 * This program is free software; you can redistribute it and/or modify
 
9
 * it under the terms of the GNU General Public License as published by
 
10
 * the Free Software Foundation; either version 2 of the License, or
 
11
 * (at your option) any later version.
 
12
 *
 
13
 * This program is distributed in the hope that it will be useful,
 
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
 * GNU General Public License for more details.
 
17
 * 
 
18
 * You should have received a copy of the GNU General Public License
 
19
 * along with this program; if not, write to the Free Software
 
20
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
21
 *
 
22
 }
 
23
 
 
24
{#include <dbus/dbus-errors.h>}
 
25
{.$include dbus-memory.inc}
 
26
{#include <dbus/dbus-message.h>}
 
27
{.$include dbus-shared.inc}
 
28
 
 
29
type
 
30
  DBusWatch = record end;
 
31
  PDBusWatch = ^DBusWatch;
 
32
 
 
33
  DBusTimeout = record end;
 
34
  PDBusTimeout = ^DBusTimeout;
 
35
 
 
36
  DBusPreallocatedSend = record end;
 
37
  PDBusPreallocatedSend = ^DBusPreallocatedSend;
 
38
 
 
39
  DBusPendingCall = record end;
 
40
  PDBusPendingCall = ^DBusPendingCall;
 
41
  PPDBusPendingCall = ^PDBusPendingCall;
 
42
 
 
43
  DBusConnection = record end;
 
44
  PDBusConnection = ^DBusConnection;
 
45
 
 
46
  DBusWatchFlags =
 
47
  (
 
48
    DBUS_WATCH_READABLE = 1 shl 0, {< As in POLLIN }
 
49
    DBUS_WATCH_WRITABLE = 1 shl 1, {< As in POLLOUT }
 
50
    DBUS_WATCH_ERROR    = 1 shl 2, {< As in POLLERR (can't watch for this, but
 
51
                                 *   the flag can be passed to dbus_watch_handle()).}
 
52
    DBUS_WATCH_HANGUP   = 1 shl 3  {< As in POLLHUP (can't watch for it, but
 
53
                                 *   can be present in current state). }
 
54
  );
 
55
 
 
56
  DBusDispatchStatus =
 
57
  (
 
58
    DBUS_DISPATCH_DATA_REMAINS,  {< There is more data to potentially convert to messages. }
 
59
    DBUS_DISPATCH_COMPLETE,      {< All currently available data has been processed. }
 
60
    DBUS_DISPATCH_NEED_MEMORY    {< More memory is needed to continue. }
 
61
  );
 
62
 
 
63
  DBusAddWatchFunction = function (watch: PDBusWatch; data: Pointer): dbus_bool_t;
 
64
  DBusWatchToggledFunction = procedure(watch: PDBusWatch; data: Pointer);
 
65
  DBusRemoveWatchFunction = procedure(watch: PDBusWatch; data: Pointer);
 
66
  DBusAddTimeoutFunction = function(timeout: PDBusTimeout; data: Pointer): dbus_bool_t;
 
67
  DBusTimeoutToggledFunction = procedure(timeout: PDBusTimeout; data: Pointer);
 
68
  DBusRemoveTimeoutFunction = procedure(timeout: PDBusTimeout; data: Pointer);
 
69
  DBusDispatchStatusFunction = procedure(connection: PDBusConnection;
 
70
   new_status: DBusDispatchStatus; data: Pointer);
 
71
  DBusWakeupMainFunction = procedure(data: Pointer);
 
72
  DBusAllowUnixUserFunction = function(connection: PDBusConnection;
 
73
   uid: cuint; data: Pointer): dbus_bool_t;
 
74
 
 
75
  DBusPendingCallNotifyFunction = procedure(pending: PDBusPendingCall;
 
76
   user_data: Pointer);
 
77
 
 
78
  DBusHandleMessageFunction = function(connection: PDBusConnection;
 
79
   message_: PDBusMessage; user_data: Pointer): DBusHandlerResult;
 
80
 
 
81
function dbus_connection_open(const address: PChar; error: PDBusError): PDBusConnection; cdecl; external LibDBus;
 
82
function dbus_connection_open_private(const address: PChar; error: PDBusError): PDBusConnection; cdecl; external LibDBus;
 
83
function dbus_connection_ref(connection: PDBusConnection): PDBusConnection; cdecl; external LibDBus;
 
84
procedure dbus_connection_unref(connection: PDBusConnection); cdecl; external LibDBus;
 
85
procedure dbus_connection_close(connection: PDBusConnection); cdecl; external LibDBus;
 
86
function dbus_connection_get_is_connected(connection: PDBusConnection): dbus_bool_t; cdecl; external LibDBus;
 
87
function dbus_connection_get_is_authenticated(connection: PDBusConnection): dbus_bool_t; cdecl; external LibDBus;
 
88
procedure dbus_connection_set_exit_on_disconnect(connection: PDBusConnection;
 
89
 exit_on_disconnect: dbus_bool_t); cdecl; external LibDBus;
 
90
procedure dbus_connection_flush(connection: PDBusConnection); cdecl; external LibDBus;
 
91
function dbus_connection_read_write_dispatch(connection: PDBusConnection;
 
92
 timeout_milliseconds: Integer): dbus_bool_t; cdecl; external LibDBus;
 
93
function dbus_connection_read_write(connection: PDBusConnection;
 
94
 timeout_milliseconds: Integer): dbus_bool_t; cdecl; external LibDBus;
 
95
function dbus_connection_borrow_message(connection: PDBusConnection): PDBusMessage; cdecl; external LibDBus;
 
96
procedure dbus_connection_return_message(connection: PDBusConnection; message_: PDBusMessage); cdecl; external LibDBus;
 
97
procedure dbus_connection_steal_borrowed_message(connection: PDBusConnection; message_: PDBusMessage); cdecl; external LibDBus;
 
98
function dbus_connection_pop_message(connection: PDBusConnection): PDBusMessage; cdecl; external LibDBus;
 
99
function dbus_connection_get_dispatch_status(connection: PDBusConnection): DBusDispatchStatus; cdecl; external LibDBus;
 
100
function dbus_connection_dispatch(connection: PDBusConnection): DBusDispatchStatus; cdecl; external LibDBus;
 
101
function dbus_connection_has_messages_to_send(connection: PDBusConnection): dbus_bool_t; cdecl; external LibDBus;
 
102
function dbus_connection_send(connection: PDBusConnection; message_: PDBusMessage;
 
103
 client_serial: Pdbus_uint32_t): dbus_bool_t; cdecl; external LibDBus;
 
104
function dbus_connection_send_with_reply(connection: PDBusConnection;
 
105
 message_: PDBusMessage;
 
106
 pending_return: PPDBusPendingCall;
 
107
 timeout_milliseconds: cint): dbus_bool_t; cdecl; external LibDBus;
 
108
function dbus_connection_send_with_reply_and_block(connection: PDBusConnection;
 
109
 message_: PDBusMessage;
 
110
 timeout_milliseconds: cint;
 
111
 error: PDBusError): PDBusMessage; cdecl; external LibDBus;
 
112
function dbus_connection_set_watch_functions(connection: PDBusConnection;
 
113
 add_function: DBusAddWatchFunction;
 
114
 remove_function: DBusRemoveWatchFunction;
 
115
 toggled_function: DBusWatchToggledFunction;
 
116
 data: Pointer;
 
117
 free_data_function: DBusFreeFunction): dbus_bool_t; cdecl; external LibDBus;
 
118
function dbus_connection_set_timeout_functions(connection: PDBusConnection;
 
119
 add_function: DBusAddTimeoutFunction;
 
120
 remove_function: DBusRemoveTimeoutFunction;
 
121
 toggled_function: DBusTimeoutToggledFunction;
 
122
 data: Pointer;
 
123
 free_data_function: DBusFreeFunction): dbus_bool_t; cdecl; external LibDBus;
 
124
procedure dbus_connection_set_wakeup_main_function(connection: PDBusConnection;
 
125
 wakeup_main_function: DBusWakeupMainFunction;
 
126
 data: Pointer;
 
127
 free_data_function: DBusFreeFunction); cdecl; external LibDBus;
 
128
procedure dbus_connection_set_dispatch_status_function (connection: PDBusConnection;
 
129
 function_: DBusDispatchStatusFunction;
 
130
 data: Pointer;
 
131
 free_data_function: DBusFreeFunction); cdecl; external LibDBus;
 
132
function dbus_connection_get_unix_user(connection: PDBusConnection;
 
133
 uid: Pculong): dbus_bool_t; cdecl; external LibDBus;
 
134
function dbus_connection_get_unix_process_id(connection: PDBusConnection;
 
135
 pid: Pculong): dbus_bool_t; cdecl; external LibDBus;
 
136
procedure dbus_connection_set_unix_user_function(connection: PDBusConnection;
 
137
 function_: DBusAllowUnixUserFunction;
 
138
 data: Pointer;
 
139
 free_data_function: DBusFreeFunction); cdecl; external LibDBus;
 
140
 
 
141
 
 
142
function dbus_watch_get_fd(watch: PDBusWatch): cint; cdecl; external LibDBus;
 
143
function dbus_watch_get_flags(watch: PDBusWatch): cuint; cdecl; external LibDBus;
 
144
function dbus_watch_get_data(watch: PDBusWatch): Pointer; cdecl; external LibDBus;
 
145
procedure dbus_watch_set_data(watch: PDBusWatch;
 
146
 data: Pointer; free_data_function: DBusFreeFunction); cdecl; external LibDBus;
 
147
function dbus_watch_handle(watch: PDBusWatch; flags: cuint): dbus_bool_t; cdecl; external LibDBus;
 
148
function  dbus_watch_get_enabled(watch: PDBusWatch): dbus_bool_t; cdecl; external LibDBus;
 
149
 
 
150
function dbus_timeout_get_interval(timeout: PDBusTimeout): cint; cdecl; external LibDBus;
 
151
function dbus_timeout_get_data(timeout: PDBusTimeout): Pointer; cdecl; external LibDBus;
 
152
procedure dbus_timeout_set_data(timeout: PDBusTimeout;
 
153
 data: Pointer; free_data_function: DBusFreeFunction); cdecl; external LibDBus;
 
154
function dbus_timeout_handle(timeout: PDBusTimeout): dbus_bool_t; cdecl; external LibDBus;
 
155
function dbus_timeout_get_enabled(timeout: PDBusTimeout): dbus_bool_t; cdecl; external LibDBus;
 
156
 
 
157
{ Filters }
 
158
 
 
159
function dbus_connection_add_filter(connection: PDBusConnection;
 
160
 function_: DBusHandleMessageFunction;
 
161
 user_data: Pointer; free_data_function: DBusFreeFunction): dbus_bool_t; cdecl; external LibDBus;
 
162
procedure dbus_connection_remove_filter (connection: PDBusConnection;
 
163
 function_: DBusHandleMessageFunction; user_data: Pointer); cdecl; external LibDBus;
 
164
 
 
165
 
 
166
{ Other }
 
167
function dbus_connection_allocate_data_slot (slot_p: Pdbus_int32_t): dbus_bool_t; cdecl; external LibDBus;
 
168
procedure dbus_connection_free_data_slot     (slot_p: Pdbus_int32_t); cdecl; external LibDBus;
 
169
function dbus_connection_set_data(connection: PDBusConnection;
 
170
 slot: dbus_int32_t; data: Pointer; free_data_func: DBusFreeFunction): dbus_bool_t; cdecl; external LibDBus;
 
171
function dbus_connection_get_data(connection: PDBusConnection; slot: dbus_int32_t): Pointer; cdecl; external LibDBus;
 
172
 
 
173
procedure dbus_connection_set_change_sigpipe (will_modify_sigpipe: dbus_bool_t); cdecl; external LibDBus;
 
174
 
 
175
procedure dbus_connection_set_max_message_size  (connection: PDBusConnection; size: clong); cdecl; external LibDBus;
 
176
function dbus_connection_get_max_message_size  (connection: PDBusConnection): clong; cdecl; external LibDBus;
 
177
procedure dbus_connection_set_max_received_size (connection: PDBusConnection; size: clong); cdecl; external LibDBus;
 
178
function dbus_connection_get_max_received_size (connection: PDBusConnection): clong; cdecl; external LibDBus;
 
179
function dbus_connection_get_outgoing_size     (connection: PDBusConnection): clong; cdecl; external LibDBus;
 
180
 
 
181
function dbus_connection_preallocate_send       (connection: PDBusConnection): PDBusPreallocatedSend; cdecl; external LibDBus;
 
182
procedure dbus_connection_free_preallocated_send (connection: PDBusConnection; preallocated: PDBusPreallocatedSend); cdecl; external LibDBus;
 
183
procedure dbus_connection_send_preallocated      (connection: PDBusConnection;
 
184
 preallocated: PDBusPreallocatedSend;
 
185
 message_: PDBusMessage; client_serial: Pdbus_uint32_t); cdecl; external LibDBus;
 
186
 
 
187
 
 
188
{ Object tree functionality }
 
189
 
 
190
type
 
191
  DBusObjectPathUnregisterFunction = procedure(connection: PDBusConnection;
 
192
   user_data: Pointer);
 
193
  DBusObjectPathMessageFunction = function(connection: PDBusConnection;
 
194
   message_: PDBusMessage; user_data: Pointer): DBusHandlerResult;
 
195
 
 
196
{
 
197
 * Virtual table that must be implemented to handle a portion of the
 
198
 * object path hierarchy.
 
199
 }
 
200
  dbus_internal_func = procedure(param1: Pointer);
 
201
 
 
202
  PDBusObjectPathVTable = ^DBusObjectPathVTable;
 
203
 
 
204
  DBusObjectPathVTable = record
 
205
 
 
206
    unregister_function: DBusObjectPathUnregisterFunction; {< Function to unregister this handler }
 
207
    message_function: DBusObjectPathMessageFunction; {< Function to handle messages }
 
208
  
 
209
    dbus_internal_pad1: dbus_internal_func; {< Reserved for future expansion }
 
210
    dbus_internal_pad2: dbus_internal_func; {< Reserved for future expansion }
 
211
    dbus_internal_pad3: dbus_internal_func; {< Reserved for future expansion }
 
212
    dbus_internal_pad4: dbus_internal_func; {< Reserved for future expansion }
 
213
  end;
 
214
 
 
215
function dbus_connection_register_object_path(connection: PDBusConnection;
 
216
 const path: PChar;
 
217
 const vtable: PDBusObjectPathVTable;
 
218
 user_data: Pointer): dbus_bool_t; cdecl; external LibDBus;
 
219
function dbus_connection_register_fallback(connection: PDBusConnection;
 
220
 const path: PChar;
 
221
 const vtable: PDBusObjectPathVTable;
 
222
 user_data: Pointer): dbus_bool_t; cdecl; external LibDBus;
 
223
function dbus_connection_unregister_object_path(connection: PDBusConnection;
 
224
 const path: PChar): dbus_bool_t; cdecl; external LibDBus;
 
225
 
 
226
function dbus_connection_get_object_path_data(connection: PDBusConnection;
 
227
 const path: PChar;
 
228
 data_p: PPointer): dbus_bool_t; cdecl; external LibDBus;
 
229
 
 
230
function dbus_connection_list_registered(connection: PDBusConnection;
 
231
 const parent_path: PChar;
 
232
 child_entries: PPPChar): dbus_bool_t; cdecl; external LibDBus;
 
233
 
 
234
function dbus_connection_get_unix_fd(connection: PDBusConnection;
 
235
 fd: Pcint): dbus_bool_t; cdecl; external LibDBus;
 
236