"====================================================================== | | DBus C wrapper | | ======================================================================" "====================================================================== | | Copyright 2006 Free Software Foundation, Inc. | Written by Brad Watson | | This file is part of GNU Smalltalk. | | GNU Smalltalk is free software; you can redistribute it and/or modify it | under the terms of the GNU General Public License as published by the Free | Software Foundation; either version 2, or (at your option) any later version. | | GNU Smalltalk is distributed in the hope that it will be useful, but WITHOUT | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 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 | GNU Smalltalk; see the file COPYING. If not, write to the Free Software | Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ======================================================================" "====================================================================== | | Notes: | | ======================================================================" Object subclass: #DBus instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'DBus Wrapper'! CStruct subclass: #DBusError declaration: #( (#name (#ptr #char)) (#message (#ptr #char)) (#dummy1 #uInt) (#dummy2 #uInt) (#dummy3 #uInt) (#dummy4 #uInt) (#dummy5 #uInt) (#padding1 (#ptr #CObject))) classVariableNames: '' poolDictionaries: '' category: 'DBus Error Wrapper'! CStruct subclass: #DBusMessageIter declaration: #( (#dummy1 (#ptr #CObject)) (#dummy2 (#ptr #CObject)) (#dummy3 #uInt) (#dummy4 #int) (#dummy5 #int) (#dummy6 #int) (#dummy7 #int) (#dummy8 #int) (#dummy9 #int) (#dummy10 #int) (#dummy11 #int) (#pad1 #int) (#pad2 #int) (#pad3 (#ptr #CObject))) classVariableNames: '' poolDictionaries: '' category: 'DBus Message Iterator Wrapper'! DLD addLibrary: 'libdbus-1'! !DBus class methodsFor: 'Constants'! " DBusBusType " busSession ^0! busSystem ^1! busStarter ^2! " DBusHandlerResult " handlerResultHandled ^0! handlerResultNotYetHandled ^1! handlerResultNeedMemory ^2! " services " serviceDBus ^'org.freedesktop.DBus'! " paths " pathDBus ^'/org/freedesktop/DBus'! pathLocal ^'/org/freedesktop/DBus/Local'! " interfaces " interfaceDBus ^'org.freedesktop.DBus'! interfaceIntrospectable ^'org.freedesktop.DBus.Introspectable'! interfaceProperties ^'org.freedesktop.DBus.Properties'! interfacePeer ^'org.freedesktop.DBus.Peer'! interfaceLocal ^'org.freedesktop.DBus.Local'! " owner flags " nameFlagAllowReplacement ^16r1! nameFlagReplaceExisting ^16r2! nameFlagDoNotQueue ^16r4! " replies for a request for a name " requestNameReplyPrimaryOwner ^1! requestNameReplyInQueue ^2! requestNameReplyExists ^3! requestNameReplyAlreadyOwner ^4! " replies to releasing a name " releaseNameReplyReleased ^1! releaseNameReplyNonExistent ^2! releaseNameReplyNotOwner ^3! " replies to server starts " startReplySuccess ^1! startReplyAlreadyRunning ^2! littleEndian ^$1! bigEndian ^$b! typeInvalid ^0! typeInvalidAsString ^'\0'! typeByte ^$y asInt! typeByteAsString ^'y'! typeBoolean ^$b asInt! typeBooleanAsString ^'b'! typeInt16 ^$n asInt! typeInt16AsString ^'n'! typeUint16 ^$q asInt! typeUint16AsString ^'q'! typeInt32 ^$i asInt! typeInt32AsString ^'i'! typeUint32 ^$u asInt! typeUint32AsString ^'u'! typeInt64 ^$x asInt! typeInt64AsString ^'x'! typeDouble ^$d asInt! typeDoubleAsString ^'d'! typeString ^$s asInt! typeStringAsString ^'s'! typeObjectPath ^$o asInt! typeObjectPathAsString ^'o'! typeSignature ^$g asInt! typeSignatureAsString ^'g'! typeArray ^$a asInt! typeArrayAsString ^'a'! typeVariant ^$v asInt! typeVariantAsString ^'v'! typeStruct ^$r asInt! typeStructAsString ^'r'! typeDictEntry ^$e asInt! typeDictEntryAsString ^'e'! numberOfTypes ^16! structBeginChar ^$( asInt! structBeginCharAsString ^'('! structEndChar ^$) asInt! structEndCharAsString ^')'! dictEntryBeginChar ^${ asInt! dictEntryBeginCharAsString ^'{'! dictEntryEndChar ^$} asInt! dictEntryEndCharAsString ^'}'! maximumNameLength ^255! maximumMatchRuleLength ^1024! maximumMatchRuleArgNumber ^63! maximumArrayLength ^67108864! maximumArrayLengthBits ^26! maximumMessageLength ^self maximumArrayLength * 2! maximumMessageLengthBits ^27! maximumTypeRecursionDepth ^32! messageTypeInvalid ^0! messageTypeMethodCall ^1! messageTypeMethodReturn ^2! messageTypeError ^3! messageTypeSignal ^4! headerFlagNoReplyExpected ^16r1! headerFlagNoAutoStart ^16r2! headerFieldInvalid ^0! headerFieldPath ^1! headerFieldInterface ^2! headerFieldMember ^3! headerFieldErrorName ^4! headerFieldReplySerial ^5! headerFieldDestination ^6! headerFieldSender ^7! headerFieldSignature ^8! headerFieldLast ^self headerFieldSignature! minimumHeaderSize ^16! errorFailed ^'org.freedesktop.DBus.Error.Failed'! errorNoMemory ^'org.freedesktop.DBus.Error.NoMemory'! errorServiceUnknown ^'org.freedesktop.DBus.Error.ServiceUnknown'! errorNameHasNoOwner ^'org.freedesktop.DBus.Error.NameHasNoOwner'! errorNoReply ^'org.freedesktop.DBus.Error.NoReply'! errorIoError ^'org.freedesktop.DBus.Error.IOError'! errorBadAddress ^'org.freedesktop.DBus.Error.BadAddress'! errorNotSupported ^'org.freedesktop.DBus.Error.NotSupported'! errorLimitsExceeded ^'org.freedesktop.DBus.Error.LimitsExceeded'! errorAcessDenied ^'org.freedesktop.DBus.Error.AccessDenied'! errorAuthFailed ^'org.freedesktop.DBus.Error.AuthFailed'! errorNoServer ^'org.freedesktop.DBus.Error.NoServer'! errorTimeout ^'org.freedesktop.DBus.Error.Timeout'! errorNoNetwork ^'org.freedesktop.DBus.Error.NoNetwork'! errorAddressInUse ^'org.freedesktop.DBus.Error.AddressInUse'! errorDisconnected ^'org.freedesktop.DBus.Error.Disconnected'! errorInvalidArgs ^'org.freedesktop.DBus.Error.InvalidArgs'! errorFileNotFound ^'org.freedesktop.DBus.Error.FileNotFound'! errorUnknownMethod ^'org.freedesktop.DBus.Error.UnknownMethod'! errorTimedout ^'org.freedesktop.DBus.Error.TimedOut'! errorMatchRuleNotFound ^'org.freedesktop.DBus.Error.MatchRuleNotFound'! errorMatchRuleInvalid ^'org.freedesktop.DBus.Error.MatchRuleInvalid'! errorSpawnExecFailed ^'org.freedesktop.DBus.Error.Spawn.ExecFailed'! errorSpawnForkFailed ^'org.freedesktop.DBus.Error.Spawn.ForkFailed'! errorSpawnChildExited ^'org.freedesktop.DBus.Error.Spawn.ChildExited'! errorSpawnChildSignaled ^'org.freedesktop.DBus.Error.Spawn.ChildSignaled'! errorSpawnFailed ^'org.freedesktop.DBus.Error.Spawn.Failed'! errorUnixProcessIdUnknown ^'org.freedesktop.DBus.Error.UnixProcessIdUnknown'! errorInvalidSignature ^'org.freedesktop.DBus.Error.InvalidSignature'! errorSeLinuxSecurityContextUnkown ^'org.freedesktop.DBus.Error.SELinuxSecurityContextUnknown'! introspect10XMLNameSpace ^'http://www.freedesktop.org/standards/dbus'! introspect10XMLPublicIdentifier ^'-//freedesktop//DTD D-BUS Object Introspection 1.0//EN'! introspect10XMLSystemIdentifier ^'http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd'! introspect10XMLDocTypeDecl ^'\n'! !DBus class methodsFor: 'C call-outs'! busGet: anInt error: anObject "I provide an automatically opened connection to the well-known message buses. See the DBus dbus_bus_get API entry for a description of my C function call: DBusConnection *dbus_bus_get (DBusBusType type, DBusError *error);" ! busGetPrivate: anInt error: anObject "I answer a dedicated connection not shared with other callers of dbus_connection_open(). See the DBus dbus_bus_get_private API entry for a description of my C function call: DBusConnection *dbus_bus_get_private (DBusBusType type, DBusError *error);" ! busRegister: anObject1 error: anObject2 "I register a connection to a bus. See the DBus dbus_bus_register API entry for a description of my C function call: dbus_bool_t dbus_bus_register (DBusConnection *connection, DBusError *error);" ! busSetUniqueName: anObject name: aString "I set the unique name of the connection as assigned by the message bus. See the DBus dbus_bus_set_unique_name API entry for a description of my C function call: dbus_bool_t dbus_bus_set_unique_name (DBusConnection *connection, const char *unique_name);" ! busGetUniqueName: anObject "I answer the unique name of the connection as assigned by the message bus. See the DBus dbus_bus_get_unique_name API entry for a description of my C function call: const char* dbus_bus_get_unique_name (DBusConnection *connection);" ! busGetUnixUser: anObject1 name: aString error: anObject2 "I ask the bus to answer the UID the connection authenticated as. See the DBus dbus_bus_get_unix_user API entry for a description of my C function call: unsigned long dbus_bus_get_unix_user (DBusConnection *connection, const char *name, DBusError *error);" ! busRequestName: anObject1 name: aString flags: anInt error: anObject2 "I ask the bus to assign the given name to this connection by invoking the RequestName method on this bus. See the DBus dbus_bus_request_name API entry for a description of my C function call: int dbus_bus_request_name (DBusConnection *connection, const char *name, unsigned int flags, DBusError *error);" ! busReleaseName: anObject1 name: aString error: anObject2 "I ask the bus to unassign the given name from my connection by invoking the ReleaseName method on the bus. See the DBus dbus_bus_release_name API entry for a description of my C function call: int dbus_bus_release_name (DBusConnection *connection, const char *name, DBusError *error);" ! busNameHasOwner: anObject1 name: aString error: anObject2 "I ask the bus whether a given name has an owner. See the DBus dbus_bus_name_has_owner API entry for a description of my C function call: dbus_bool_t dbus_bus_name_has_owner (DBusConnection *connection, const char *name, DBusError *error);" ! busStartServiceByName: anObject1 name: aString flags: anInt reply: anObject2 error: cObject3 "I start a service the will request the ownership of the given name. See the DBus dbus_bus_start_service_by_name API entry for a description of my C function call: dbus_bool_t dbus_bus_start_service_by_name (DBusConnection *connection, const char *name, dbus_uint32_t flags, dbus_uint32_t *reply, DBusError *error);" ! busAddMatch: anObject1 rule: aString error: anObject2 "I add a match tule to match messages going through the message bus. See the DBus dbus_bus_add_match API entry for a description of my C function call: void dbus_bus_add_match (DBusConnection *connection, const char *rule, DBusError *error);" ! busRemoveMatch: anObject1 rule: aString error: anObject2 "I remove a previously added match rule by value. See the DBus dbus_bus_remove_match API entry for a description of my C function call: void dbus_bus_remove_match (DBusConnection *connection, const char *rule, DBusError *error);" ! connectionOpen: aString error: anObject "I get a connection to a remote address. See the DBus dbus_connection_open API entry for a description of my C function call: DBusConnection* dbus_connection_open (const char *address, DBusError *error);" ! connectionOpenPrivate: aString error: anObject "I open a dedicated connection to a remote address. See the DBus dbus_connection_open_private API entry for a description of my C function call: DBusConnection* dbus_connection_open_private (const char *address, DBusError *error);" ! connectionRef: anObject "I increment the reference count a connect. See the DBus dbus_connection_ref API entry for a description of my C function call: DBusConnection* dbus_connection_ref (DBusConnection *connection);" ! connectionUnref: anObject "I decrement the reference count of a connection. See the DBus dbus_connection_unref API entry for a description of my C function call: void dbus_connection_unref (DBusConnection *connection);" ! connectionClose: anObject "I close the private connection. See the DBus dbus_connection_unref API entry for a description of my C function call: void dbus_connection_close (DBusConnection *connection);" ! connectionDisconnect: anObject "I disconnect from a private connection. See the DBus dbus_connection_disconnect API entry for a description of my C function call: void dbus_connection_disconnect (DBusConnection *connection);" ! connectionGetIsConnected: anObject "I answer whether a connection is currently open. See the DBus dbus_connection_get_is_connected API entry for a description of my C function call: dbus_bool_t dbus_connection_get_is_connected (DBusConnection *connection);" ! connectionGetIsAuthenticated: anObject "I answer whether a connection was authenticated. See the DBus dbus_connection_get_is_authenticated API entry for a description of my C function call: dbus_bool_t dbus_connection_get_is_authenticated (DBusConnection *connection);" ! connectionSetExitOnDisconnect: anObject disconnect: aBoolean "I set whether _exit() should be invoked when a connection receives a disconnect message. See the DBus dbus_connection_set_exit_on_disconnect API entry for a description of my C function call: void dbus_connection_set_exit_on_disconnect (DBusConnection *connection, dbus_bool_t exit_on_disconnect);" ! connectionFlush: anObject "I block until the outgoing message queue is empty. See the DBus dbus_connection_flush API entry for a description of my C function call: void dbus_connection_flush (DBusConnection *connection);" ! connectionReadWriteDispatch: anObject timeOutMS: anInt "I provide an alternative to a DBusWatch-and-DBusTimeout loop. I'm usually used in conjunction with a filter method. See the DBus dbus_connection_read_write_dispatch API entry for a description of my C function call: dbus_bool_t dbus_connection_read_write_dispatch (DBusConnection *connection, int timeout_milliseconds);" ! connectionReadWrite: anObject timeOutMS: anInt "I provide an alternative to a DBusWatch-and-DBusTimeout loop. See the DBus dbus_connection_read_write API entry for a description of my C function call: dbus_bool_t dbus_connection_read_write (DBusConnection *connection, int timeout_milliseconds);" ! connectionBorrowMessage: anObject "I answer the first-received message from the incoming message queue, but leave the message in the queue. See the DBus dbus_connection_borrow_message API entry for a description of my C function call: DBusMessage* dbus_connection_borrow_message (DBusConnection *connection);" ! connectionReturnMessage: anObject1 message: cObject2 "I answer a message after peeking at it by invoking the connectionBorrowMessage method. See the DBus dbus_connection_return_message API entry for a description of my C function call: void dbus_connection_return_message (DBusConnection *connection, DBusMessage *message);" ! connectionStealBorrowedMessage: anObject1 message: cObject2 "I keep a message after peeking at it by invoking the connectionBorrowMessage method. See the DBus dbus_connection_steal_borrowed_message API entry for a description of my C function call: void dbus_connection_steal_borrowed_message (DBusConnection *connection, DBusMessage *message);" ! connectionPopMessage: anObject "I answer the first-received message from the incoming message queue and remove it from the queue. See the DBus dbus_connection_steal_borrowed_message API entry for a description of my C function call: DBusMessage* dbus_connection_pop_message (DBusConnection *connection);" ! connectionGetDispatchStatus: anObject "I answer the current state of the incoming message queue. See the DBus dbus_connection_get_dispatch_status API entry for a description of my C function call: DBusDispatchStatus dbus_connection_get_dispatch_status (DBusConnection *connection);" ! connectionDispatch: anObject "I process any incoming data. See the DBus dbus_connection_dispatch API entry for a description of my C function call: DBusDispatchStatus dbus_connection_dispatch (DBusConnection *connection);" ! hasMessageToSend: anObject "I answer if there are any messages in the outgoing message queue. See the DBus dbus_connection_has_messages_to_send API entry for a description of my C function call: dbus_bool_t dbus_connection_has_messages_to_send (DBusConnection *connection);" ! connectionSendWithReply: anObject1 message: anObject2 pendingReturn: anObject3 timeOutMS: anInt "I queue a message to send. See the DBus dbus_connection_send_with_reply API entry for a description of my C function call: dbus_bool_t dbus_connection_send_with_reply (DBusConnection *connection, DBusMessage *message, DBusPendingCall **pending_return, int timeout_milliseconds);" ! connectionSendWithReplyAndBlock: anObject1 message: anObject2 timeOutMS: anInt error: anObject3 "I send a message and block for the time period given to me while waiting for a reply. See the DBus dbus_connection_send_with_reply_and_block API entry for a description of my C function call: DBusMessage * dbus_connection_send_with_reply_and_block (DBusConnection *connection, DBusMessage *message, int timeout_milliseconds, DBusError *error);" ! connectionSetWatchFunctions: anObject1 addFunction: anObject2 removeFunction: anObject3 watchToggleFunction: anObject4 data: anObject5 freeDataFunction: anObject6 "I set the watch functions for the connection. See the DBus dbus_connection_set_watch_functions API entry for a description of my C function call: dbus_bool_t dbus_connection_set_watch_functions (DBusConnection *connection, DBusAddWatchFunction add_function, DBusRemoveWatchFunction remove_function, DBusWatchToggledFunction toggled_function, void *data, DBusFreeFunction free_data_function);" ! " skipped remaining watch functions for now ...." connectionSetTimeoutFunctions: anObject1 addTimeoutFunction: anObject2 removeTimeoutFunction: anObject3 timeoutToggledFunction: anObject4 toggledFunction: anObject5 data: anObject6 freeDataFunction: anObject7 "I set the timeout functions for the connection. See the DBus dbus_connection_set_timeout_functions API entry for a description of my C function call: dbus_bool_t dbus_connection_set_timeout_functions (DBusConnection *connection, DBusAddTimeoutFunction add_function, DBusRemoveTimeoutFunction remove_function, DBusTimeoutToggledFunction toggled_function, void *data, DBusFreeFunction free_data_function);" ! connectionSetWakeupMainFunction: anObject1 wakeUpMainFunction: anObject2 data: anObject3 freeDataFunction: anObject4 "I set the mainloop wakeup function for the connection. See the DBus dbus_connection_set_wakeup_main_function API entry for a description of my C function call: void dbus_connection_set_wakeup_main_function (DBusConnection *connection, DBusWakeupMainFunction wakeup_main_function, void *data, DBusFreeFunction free_data_function);" ! connectionSetDispatchStatusFunction: anObject1 function: anObject2 data: anObject3 freeDataFunction: anObject4 "I set a function to be invoked when the dispatch status changes. See the DBus dbus_connection_set_dispatch_status_function API entry for a description of my C function call: void dbus_connection_set_dispatch_status_function (DBusConnection *connection, DBusDispatchStatusFunction function, void *data, DBusFreeFunction free_data_function);" ! connectionGetUnixUser: anObject1 uid: anObject2 "I answer the UNIX user ID of the connection if known. See the DBus dbus_connection_get_unix_user API entry for a description of my C function call: dbus_bool_t dbus_connection_get_unix_user (DBusConnection *connection, unsigned long *uid);" ! connectionGetUnixProcessId: anObject1 pid: anObject2 "I answer the process ID of the connection if known. See the DBus dbus_connection_get_unix_process_id API entry for a description of my C function call: dbus_bool_t dbus_connection_get_unix_process_id (DBusConnection *connection, unsigned long *pid);" ! watchGetFd: anObject "I answer a file descriptor to watch. See the DBus dbus_watch_get_fd API entry for a description of my C function call: int dbus_watch_get_fd (DBusWatch *watch);" ! watchGetFlags: anObject "I answer events to watch. See the DBus dbus_watch_get_flags API entry for a description of my C function call: unsigned int dbus_watch_get_flags (DBusWatch *watch);" ! watchGetData: anObject "I answer data previously set with dbus_watch_set_data. See the DBus dbus_watch_get_data API entry for a description of my C function call: void* dbus_watch_get_data (DBusWatch *watch);" ! watchSetData: anObject1 data: anObject2 freeDataFunction: anObject3 "I set which data can be retrieved with dbus_watch_get_data. See the DBus dbus_watch_set_data API entry for a description of my C function call: void dbus_watch_set_data (DBusWatch *watch, void *data, DBusFreeFunction free_data_function);" ! watchHandle: anObject flags: anInt "I tell the DBus library when a previously added watch is ready for reading or writing. See the DBus dbus_watch_handle API entry for a description of my C function call: dbus_bool_t dbus_watch_handle (DBusWatch *watch, unsigned int flags)" ! watchGetEnabled: anObject "I answer whether a watch is enabled or not. See the DBus dbus_watch_get_enabled API entry for a description of my C function call: dbus_bool_t dbus_watch_get_enabled (DBusWatch *watch)" ! timeoutGetInterval: anObject "I answer the timeout interval. See the DBus dbus_timeout_get_interval API entry for a description of my C function call: int dbus_timeout_get_interval (DBusTimeout *timeout);" ! timeoutGetData: anObject "I answer data previously set with dbus_timeout_set_data. See the DBus dbus_timeout_get_data API entry for a description of my C function call: void* dbus_timeout_get_data (DBusTimeout *timeout);" ! timeoutSetData: anObject1 data: anObject2 freeDataFunction: anObject3 "I set data which can be retrieved with dbus_timeout_get_data. See the DBus dbus_timeout_set_data API entry for a description of my C function call: void dbus_timeout_set_data (DBusTimeout *timeout, void *data, DBusFreeFunction free_data_function);" ! timeoutHandle: anObject "I call the timeout handler for this timeout. See the DBus dbus_timeout_handle API entry for a description of my C function call: dbus_bool_t dbus_timeout_handle (DBusTimeout *timeout);" ! timeoutGetEnabled: anObject "I answer whether a timeout is enabled or not. See the DBus dbus_timeout_get_enabled API entry for a description of my C function call: dbus_bool_t dbus_timeout_get_enabled (DBusTimeout *timeout);" ! connectionAddFilter: anObject1 function: anObject2 userData: anObject3 freeDataFunction: anObject4 "I add a connection filter. See the DBus dbus_connection_add_filter API entry for a description of my C function call: dbus_bool_t dbus_connection_add_filter (DBusConnection *connection, DBusHandleMessageFunction function, void *user_data, DBusFreeFunction free_data_function);" ! connectionRemoveFilter: anObject1 function: anObject2 userData: anObject3 "I remove a connection filter. See the DBus dbus_connection_remove_filter API entry for a description of my C function call: void dbus_connection_remove_filter (DBusConnection *connection, DBusHandleMessageFunction function, void *user_data);" ! connectionAllocateDataSlot: anObject "I allocate an integer ID to be used for storing application specific data on a connection. See the DBus dbus_connection_allocate_data_slot API entry for a description of my C function call: dbus_bool_t dbus_connection_allocate_data_slot (dbus_int32_t *slot_p);" ! connectionFreeDataSlot: anObject "I deallocate a global ID for connection data slots. See the DBus dbus_connection_free_data_slot API entry for a description of my C function call: void dbus_connection_free_data_slot (dbus_int32_t *slot_p);" ! connectionSetData: anObject1 slot: anInt data: anObject2 freeDataFunction: anObject3 "I store a pointer on a connection along with the function to be used for freeing the data when the data is set again. See the DBus dbus_connection_set_data API entry for a description of my C function call: dbus_bool_t dbus_connection_set_data (DBusConnection *connection, dbus_int32_t slot, void *data, DBusFreeFunction free_data_func);" ! connectionGetData: anObject slot: anInt "I answer data previously set by invoking dbus_connection_set_data. See the DBus dbus_connection_get_data API entry for a description of my C function call: void* dbus_connection_get_data (DBusConnection *connection, dbus_int32_t slot);" ! connectionSetChangeSigpipe: aBoolean "I set a global flag for whether invkoing dbus_connection_new will set SIGPIPE behavior to SIG_IGN. See the DBus dbus_connection_set_change_sigpipe API entry for a description of my C function call: void dbus_connection_set_change_sigpipe (dbus_bool_t will_modify_sigpipe);" ! connectionSetMaxMessageSize: anObject size: aLong "I set the maximum message size this connection is allowed to receive. dbus_connection_set_max_message. See the DBus dbus_connection_set_max_message_size API entry for a description of my C function call: void dbus_connection_set_max_message_size (DBusConnection *connection, long size);" ! connectionGetMaxMessageSize: anObject "I answer the maximum message size set by invoking dbus_connection_set_max_message_size. See the DBus dbus_connection_get_max_message_size API entry for a description of my C function call: long dbus_connection_get_max_message_size (DBusConnection *connection);" ! connectionSetMaxReceivedSize: anObject size: aLong "I set the maximum total number of bytes that can be used for all messages received on this connection. See the DBus dbus_connection_set_max_received_size API entry for a description of my C function call: void dbus_connection_set_max_received_size (DBusConnection *connection, long size);" ! connectionGetMaxReceivedSize: anObject "I answer the value set by invoking dbus_connection_set_max_received_size. See the DBus dbus_connection_get_max_received_size API entry for a description of my C function call: long dbus_connection_get_max_received_size (DBusConnection *connection);" ! connectionGetOutgoingSize: anObject "I answer the approximate size in bytes of all messages in the outgoing messages queue. See the DBus dbus_connection_get_outgoing_size API entry for a description of my C function call: long dbus_connection_get_outgoing_size (DBusConnection *connection);" ! connectionPreallocateSend: anObject "I preallocate the resources needed to send a message. See the DBus dbus_connection_preallocate_send API entry for a description of my C function call: DBusPreallocatedSend* dbus_connection_preallocate_send (DBusConnection *connection);" ! connectionFreePreallocatedSend: anObject1 preallocated: anObject2 "I free preallocated message-sending resources acquired by invoking dbus_connection_preallocate_send. See the DBus dbus_connection_free_preallocated_send API entry for a description of my C function call: void dbus_connection_free_preallocated_send (DBusConnection *connection, DBusPreallocatedSend *preallocated);" ! connectionSendPreallocated: anObject1 preallocated: anObject2 message: anObject3 clientSerial: anObject4 "I send a message using preallocated resources. See the DBus dbus_connection_send_preallocated API entry for a description of my C function call: void dbus_connection_send_preallocated (DBusConnection *connection, DBusPreallocatedSend *preallocated, DBusMessage *message, dbus_uint32_t *client_serial);" ! connectionRegisterObjectPath: anObject1 path: aString vtable: anObject2 userData: anObject3 "I register a handler for a given path in the object hierarchy. See the DBus dbus_connection_register_object_path API entry for a description of my C function call: dbus_bool_t dbus_connection_register_object_path (DBusConnection *connection, const char *path, const DBusObjectPathVTable *vtable, void *user_data);" ! connectionRegisterFallback: anObject1 path: aString vtable: anObject2 userData: anObject3 "I register a fallback handler for a given subsection of the object hierarchy. See the DBus dbus_connection_register_fallback API entry for a description of my C function call: dbus_bool_t dbus_connection_register_fallback (DBusConnection *connection, const char *path, const DBusObjectPathVTable *vtable, void *user_data);" ! connectionUnregisterObjectPath: anObject path: aString "I unregister the handler registered with exactly the given path. See the DBus dbus_connection_unregister_object_path API entry for a description of my C function call: dbus_bool_t dbus_connection_unregister_object_path (DBusConnection *connection, const char *path);" ! connectionGetObjectPathData: anObject path: aString data: anObjectPtr "I answer the user data passed to dbus_connection_register_object_path. See the DBus dbus_connection_get_object_path_data API entry for a description of my C function call: dbus_bool_t dbus_connection_get_object_path_data (DBusConnection *connection, const char *path, void **data_p);" ! connectionListRegistered: anObject path: aString childEntries: anObjectPtr "I answer the registered fallback handlers an object path handlers at the given parent_path. See the DBus dbus_connection_list_registered API entry for a description of my C function call: dbus_bool_t dbus_connection_list_registered (DBusConnection *connection, const char *parent_path, char ***child_entries);" ! connectionGetUnixFd: anObject1 fd: anObject2 "I answer the UNIX file descriptor of the connection if there is one. See the DBus dbus_connection_get_unix_fd API entry for a description of my C function call: dbus_bool_t dbus_connection_get_unix_fd (DBusConnection *connection, int *fd);" ! errorInit: anObject "I initialize a DbusError structure. See the DBus dbus_error_init API entry for a description of my C function call: void dbus_error_init (DBusError *error);" ! errorFree: anObject "I free an error that has been set and then reinitialize the error. See the DBus dbus_error_free API entry for a description of my C function call: void dbus_error_free (DBusError *error);" ! setError: anObject name: aString1 message: aString2 "I assign an error name and message to a DBusError. See the DBus dbus_set_error API entry for a description of my C function call: void dbus_set_error (DBusError *error, const char *name, const char *message, ...);" ! setError: anObject1 name: aString1 message: aString2 args: anObject2 "I assign an error name and message to a DBusError. See the DBus dbus_set_error API entry for a description of my C function call: void dbus_set_error (DBusError *error, const char *name, const char *message, ...);" ! setErrorConst: anObject name: aString1 message: aString2 "I assign an error name and message to a DBusError. See the DBus dbus_set_error_const API entry for a description of my C function call: void dbus_set_error_const (DBusError *error, const char *name, const char *message);" ! moveError: anObject1 dest: anObject2 "I move an error source into a destination, free the source and overwrite the destination. See the DBus dbus_move_error API entry for a description of my C function call: void dbus_move_error (DBusError *src, DBusError *dest);" ! errorHasName: anObject name: aString "I check whether the error is set and has the given value. See the DBus dbus_error_has_name API entry for a description of my C function call: dbus_bool_t dbus_error_has_name (const DBusError *error, const char *name);" ! errorIsSet: anObject "I check whether an error occurred. See the DBus dbus_error_is_set API entry for a description of my C function call: dbus_bool_t dbus_error_is_set (const DBusError *error);" ! malloc: anInt "I allocate the given number of bytes. See the DBus dbus_malloc API entry for a description of my C function call: void* dbus_malloc (size_t bytes);" ! malloc0: anInt "I allocate the given number of bytes and initialize them to zero. See the DBus dbus_malloc0 API entry for a description of my C function call: void* dbus_malloc0 (size_t bytes);" ! realloc: anObject size: anInt "I resize a block of memory previously allocated by invoking dbus_malloc. See the DBus dbus_realloc API entry for a description of my C function call: void* dbus_realloc (void *memory, size_t bytes);" ! free: anObject "I free a block of memory previously allocated by dbus_malloc. See the DBus dbus_free API entry for a description of my C function call: void dbus_free (void *memory);" ! freeStringArray: anObjectPtr "I free a null terminated array of strings. See the DBus dbus_free_string_array API entry for a description of my C function call: void dbus_free_string_array (char **str_array);" ! shutdown "I free all memory allocated internally by libdbus. See the DBus dbus_shutdown API entry for a description of my C function call: void dbus_shutdown (void);" ! pendingCallRef: anObject "I increment the reference count on a pending call. See the DBus dbus_pending_call_ref API entry for a description of my C function call: DBusPendingCall* dbus_pending_call_ref (DBusPendingCall *pending);" ! pendingCallUnref: anObject "I decrement the reference count on a pending call and free it if the counts reaches 0. See the DBus dbus_pending_call_unref API entry for a description of my C function call: void dbus_pending_call_unref (DBusPendingCall *pending);" ! pendingCallSetNotify: anObject1 function: anObject2 userData: anObject3 freeUserData: anObject4 "I set a notification function to be called when the reply is received or the pending call times out. See the DBus dbus_pending_call_set_notify API entry for a description of my C function call: dbus_bool_t dbus_pending_call_set_notify (DBusPendingCall *pending, DBusPendingCallNotifyFunction function, void *user_data, DBusFreeFunction free_user_data);" ! pendingCallCancel: anObject "I cancel the pending call such that any reply or error received will be ignored. See the DBus dbus_pending_call_cancel API entry for a description of my C function call: void dbus_pending_call_cancel (DBusPendingCall *pending);" ! pendingCallGetCompleted: anObject "I check whether a pending call has received a reply yet or not. See the DBus dbus_pending_call_get_completed API entry for a description of my C function call: dbus_bool_t dbus_pending_call_get_completed (DBusPendingCall *pending);" ! pendingCallStealReply: anObject "I answer the reply received or answer null if none has been received yet. See the DBus dbus_pending_call_steal_reply API entry for a description of my C function call: DBusMessage* dbus_pending_call_steal_reply (DBusPendingCall *pending);" ! pendingCallBlock: anObject "I block until the pending call is completed. See the DBus dbus_pending_call_block API entry for a description of my C function call: void dbus_pending_call_block (DBusPendingCall *pending);" ! pendingCallAllocateDataSlot: anObject "I allocate an integer ID to be used for storing application specific data on any DBusPendingCall. See the DBus dbus_pending_call_allocate_data_slot API entry for a description of my C function call: dbus_bool_t dbus_pending_call_allocate_data_slot (dbus_int32_t *slot_p);" ! pendingCallFreeDataSlot: anObject "I deallocate a global ID for DBusPendingCall data slots. See the DBus dbus_pending_call_free_data_slot API entry for a description of my C function call: void dbus_pending_call_free_data_slot (dbus_int32_t *slot_p);" ! pendingCallSetData: anObject1 slot: anInt data: anObject2 freeDataFunc: anObject3 "I store a pointer on a DBusPendingCall along with an optional function to be used for freeing the data when the data is set again. See the DBus dbus_pending_call_set_data API entry for a description of my C function call: dbus_bool_t dbus_pending_call_set_data (DBusPendingCall *pending, dbus_int32_t slot, void *data, DBusFreeFunction free_data_func);" ! pendingCallGetData: anObject slot: anInt "I answer data previously set by invoking dbus_pending_call_get_data. See the DBus dbus_pending_call_get_data API entry for a description of my C function call: void* dbus_pending_call_get_data (DBusPendingCall *pending, dbus_int32_t slot);" ! serverListen: anObject1 error: anObject2 "I listen for new connections on the address given to me. See the DBus dbus_server_listen API entry for a description of my C function call: DBusServer* dbus_server_listen (const char *address, DBusError *error);" ! serverRef: anObject "I increment the reference count of a DBusServer. See the DBus dbus_server_ref API entry for a description of my C function call: DBusServer* dbus_server_ref (DBusServer *server);" ! serverUnref: anObject "I decrement the reference count of a DBusServer. See the DBus dbus_server_unref API entry for a description of my C function call: void dbus_server_unref (DBusServer *server);" ! serverDisconnect: anObject "I release the servers' address and stop listening for new clients. See the DBus dbus_server_disconnect API entry for a description of my C function call: void dbus_server_disconnect (DBusServer *server);" ! serverGetIsConnected: anObject "I answer true if the server is still listening for new connections. See the DBus dbus_server_get_is_connected API entry for a description of my C function call: dbus_bool_t dbus_server_get_is_connected (DBusServer *server);" ! serverGetAddress: anObject "I answer the address of the server as a newly allocated string which must be freed by the caller. See the DBus dbus_server_get_address API entry for a description of my C function call: char* dbus_server_get_address (DBusServer *server);" ! serverSetNewConnectionFunction: anObject1 function: anObject2 data: anObject3 freeDataFunction: anObject4 "I set a function to be used for handling new connections. See the DBus dbus_server_set_new_connection_function API entry for a description of my C function call: void dbus_server_set_new_connection_function (DBusServer *server, DBusNewConnectionFunction function, void *data, DBusFreeFunction free_data_function);" ! serverSetWatchFunctions: anObject1 addWatchFunction: anObject2 removeFunction: anObject3 toggleFunction: anObject4 data: anObject5 freeFunction: anObject6 "I set the watch functions for the server. See the DBus dbus_server_set_watch_functions API entry for a description of my C function call: dbus_bool_t dbus_server_set_watch_functions (DBusServer *server, DBusAddWatchFunction add_function, DBusRemoveWatchFunction remove_function, DBusWatchToggledFunction toggled_function, void *data, DBusFreeFunction free_data_function);" ! serverSetTimeoutFunctions: anObject1 addFunction: anObject2 removeFunction: anObject3 toggleFunction: anObject4 data: anObject5 freeDataFunction: anObject6 "I set the timeout functions for the server. See the DBus dbus_server_set_timeout_functions API entry for a description of my C function call: dbus_bool_t dbus_server_set_timeout_functions (DBusServer *server, DBusAddTimeoutFunction add_function, DBusRemoveTimeoutFunction remove_function, DBusTimeoutToggledFunction toggled_function, void *data, DBusFreeFunction free_data_function);" ! serverSetAuthMechanisms: anObject mechanisms: anObjectPtr "I set the authentication mechanisms that this server offers to clients. See the DBus dbus_server_set_auth_mechanisms API entry for a description of my C function call: dbus_bool_t dbus_server_set_auth_mechanisms (DBusServer *server, const char **mechanisms);" ! serverAllocateDataSlot: anObject "I allocate an integer ID to be used for storing application specific data on any DBusServer. See the DBus dbus_server_allocate_data_slot API entry for a description of my C function call: dbus_bool_t dbus_server_allocate_data_slot (dbus_int32_t *slot_p);" ! serverFreeDataSlot: anObject "I deallocate a global ID for server data slots. See the DBus dbus_server_free_data_slot API entry for a description of my C function call: void dbus_server_free_data_slot (dbus_int32_t *slot_p);" ! serverSetData: anObject1 slot: anInt data: anObject2 freeDataFunc: anObject3 "I store a pointer on a DbusServer along with an optional function for freeing the data when the data is set again. See the DBus dbus_server_set_data API entry for a description of my C function call: dbus_bool_t dbus_server_set_data (DBusServer *server, int slot, void *data, DBusFreeFunction free_data_func);" ! serverGetData: anObject slot: anInt "I answer the data previously set with dbus_server_set_data. See the DBus dbus_server_get_data API entry for a description of my C function call: void* dbus_server_get_data (DBusServer *server, int slot);" ! ! !DBus class methodsFor: 'Testing'! tryit | err bus | err := DBusError new. self errorInit: err. bus := self busGet: 0 error: err. (self busGetUniqueName: bus) printNl. ! !