Galago - desktop presence framework

galago-dbus.h File Reference

D-BUS Support API. More...

#include <dbus/dbus.h>
#include <libgalago/galago-list.h>
#include <libgalago/galago-object.h>

Go to the source code of this file.


Defines

#define DBUS_API_SUBJECT_TO_CHANGE
#define GALAGO_DBUS_SERVICE   "org.freedesktop.Galago"
#define GALAGO_DBUS_ERROR_INVALID_PROPERTY   "org.freedesktop.Galago.Error.InvalidProperty"
#define GALAGO_DBUS_ERROR_OBJECT_NOT_FOUND   "org.freedesktop.Galago.Error.ObjectNotFound"

Functions

void galago_dbus_message_iter_append_string_or_nil (DBusMessageIter *iter, const char *str)
 Appends a string to a message, or an empty string if the passed string is NULL.
char * galago_dbus_message_iter_get_string_or_nil (DBusMessageIter *iter)
 Returns a string that the iterator points to.
void galago_dbus_message_iter_append_object (DBusMessageIter *iter, const void *object)
 Appends an object to a D-BUS message.
void galago_dbus_message_iter_append_object_list (DBusMessageIter *iter, const GalagoList *list)
 Appends a list of objects to a D-BUS message.
void * galago_dbus_message_iter_get_object (DBusMessageIter *iter, const GalagoObjectClass *klass)
 Returns an object of the specified type from a D-BUS message.
GalagoListgalago_dbus_message_iter_get_object_list (DBusMessageIter *iter, const GalagoObjectClass *klass)
 Returns a list of objects of the specified type from a D-BUS message.
DBusMessage * galago_dbus_message_new_method_call (const void *object, const char *name, galago_bool reply, DBusMessageIter *ret_iter)
 Creates a D-BUS message to the specified object.
DBusMessage * galago_dbus_message_new_method_call_vargs (const void *object, const char *name, galago_bool reply, va_list args)
 Creates a D-BUS message to the specified object with a va_list of parameters.
DBusMessage * galago_dbus_message_new_method_call_args (const void *object, const char *name, galago_bool reply,...)
 Creates a D-BUS message to the specified object with a list of parameters.
void galago_dbus_send_message (const void *object, const char *name,...)
 Sends a new D-BUS message with an object, name, and parameters.
GalagoListgalago_dbus_send_message_with_reply_list (const void *object, const char *name, GalagoList *return_types,...)
 Sends a new D-BUS message with an object, name, and parameters, and waits for a reply with a variable list of return types.
void * galago_dbus_send_message_with_reply (const void *object, const char *name, GalagoValue *return_type,...)
 Sends a new D-BUS message with an object, name, and parameters, and waits for a reply.
void galago_dbus_object_push_full (void *object)
 Pushes an object and all its internal data to the server.
const char * galago_dbus_normalize_name (const char *name)
 Normalizes the passed name for purposes of using it in D-BUS paths and commands.

Detailed Description

D-BUS Support API.

Copyright:
(C) 2004-2005 Christian Hammond.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library 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 Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Definition in file galago-dbus.h.


Function Documentation

void galago_dbus_message_iter_append_object DBusMessageIter *  iter,
const void *  object
 

Appends an object to a D-BUS message.

Parameters:
iter The D-BUS message iterator.
object The object to append.

void galago_dbus_message_iter_append_object_list DBusMessageIter *  iter,
const GalagoList list
 

Appends a list of objects to a D-BUS message.

Parameters:
iter The D-BUS message iterator.
list The list of objects to append.

void galago_dbus_message_iter_append_string_or_nil DBusMessageIter *  iter,
const char *  str
 

Appends a string to a message, or an empty string if the passed string is NULL.

Parameters:
iter The message iterator.
str The string, or NULL.

void* galago_dbus_message_iter_get_object DBusMessageIter *  iter,
const GalagoObjectClass klass
 

Returns an object of the specified type from a D-BUS message.

Parameters:
iter The D-BUS message iterator.
klass The object class.
Returns:
The object.

GalagoList* galago_dbus_message_iter_get_object_list DBusMessageIter *  iter,
const GalagoObjectClass klass
 

Returns a list of objects of the specified type from a D-BUS message.

The returned list must be destroyed.

Parameters:
iter The D-BUS message iterator.
klass The object class.
Returns:
The list.

char* galago_dbus_message_iter_get_string_or_nil DBusMessageIter *  iter  ) 
 

Returns a string that the iterator points to.

If the returned string is an empty string (""), this returns NULL.

Parameters:
iter The iterator.
Returns:
The string or NULL.

DBusMessage* galago_dbus_message_new_method_call const void *  object,
const char *  name,
galago_bool  reply,
DBusMessageIter *  ret_iter
 

Creates a D-BUS message to the specified object.

Parameters:
object The object.
name The message name.
reply TRUE if a reply is expected.
ret_iter The returned message iterator, if not NULL.
Returns:
The D-BUS message.

DBusMessage* galago_dbus_message_new_method_call_args const void *  object,
const char *  name,
galago_bool  reply,
  ...
 

Creates a D-BUS message to the specified object with a list of parameters.

The parameters passed are in GalagoValue, pointer-to-data form.

Parameters:
object The object.
name The message name.
reply TRUE if a reply is expected.
... The list of parameters.
Returns:
The D-BUS message.

DBusMessage* galago_dbus_message_new_method_call_vargs const void *  object,
const char *  name,
galago_bool  reply,
va_list  args
 

Creates a D-BUS message to the specified object with a va_list of parameters.

Parameters:
object The object.
name The message name.
reply TRUE if a reply is expected.
va_list The va_list of parameters.
Returns:
The D-BUS message.

const char* galago_dbus_normalize_name const char *  name  ) 
 

Normalizes the passed name for purposes of using it in D-BUS paths and commands.

Parameters:
name The name to normalize.
Returns:
A pointer to a static buffer containing the normalized name.

void galago_dbus_object_push_full void *  object  ) 
 

Pushes an object and all its internal data to the server.

This should only be used internally.

Parameters:
object The object to push.

void galago_dbus_send_message const void *  object,
const char *  name,
  ...
 

Sends a new D-BUS message with an object, name, and parameters.

The parameters passed are in GalagoValue, pointer-to-data form.

Parameters:
object The object.
name The message name.
... The list of parameters.

void* galago_dbus_send_message_with_reply const void *  object,
const char *  name,
GalagoValue *  return_type,
  ...
 

Sends a new D-BUS message with an object, name, and parameters, and waits for a reply.

The parameters passed are in GalagoValue, pointer-to-data form.

Parameters:
object The object.
name The message name.
return_type The expected return type.
... The list of parameters.
Returns:
The returned data. This may need to be freed.

GalagoList* galago_dbus_send_message_with_reply_list const void *  object,
const char *  name,
GalagoList return_types,
  ...
 

Sends a new D-BUS message with an object, name, and parameters, and waits for a reply with a variable list of return types.

The parameters passed are in GalagoValue, pointer-to-data form.

Parameters:
object The object.
name The message name.
return_types A list of expected return types, in order.
... The list of parameters.
Returns:
The returned data in a list. The list will need to be freed, as may some of its data.