Main Page | Data Structures | File List | Data Fields | Globals

rpc-dbus.c File Reference

#include <glib/gslist.h>
#include <glib/gthread.h>
#include <glib/gmessages.h>
#include <glib/gstrfuncs.h>
#include <string.h>
#include <libosso.h>
#include <osso-log.h>
#include "rpc-dbus.h"

Include dependency graph for rpc-dbus.c:

Go to the source code of this file.

Defines

#define SERVICE_STARTED_SIGNAL   "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='%s'"
 This file is part of alarmd.

Typedefs

typedef _DBusNameNotify DBusNameNotify

Functions

static DBusHandlerResult _service_started (DBusConnection *connection, DBusMessage *message, void *user_data)
void dbus_do_call (DBusConnection *bus, DBusMessage **reply, gboolean activation, const gchar *service, const gchar *path, const gchar *interface, const gchar *name, int first_arg_type,...)
void dbus_watch_name (const gchar *name, DBusNameNotifyCb cb, gpointer user_data)
void dbus_unwatch_name (const gchar *name, DBusNameNotifyCb cb, gpointer user_data)
void dbus_set_osso (osso_context_t *osso)
 dbus_set_osso: : osso context to get connections from.
DBusConnection * get_dbus_connection (DBusBusType type)
 get_dbus_connection: DBUS_BUS_SESSION for session bus or DBUS_TYPE_SYSTEM for system bus.

Variables

static osso_context_t * _osso = NULL
static GSList * service_notifies = NULL
static DBusConnection * system_bus = NULL
static GStaticMutex notify_mutex = G_STATIC_MUTEX_INIT


Define Documentation

#define SERVICE_STARTED_SIGNAL   "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='%s'"
 

This file is part of alarmd.

Contact Person: David Weinehall <david.weinehall@nokia.com>

Copyright (C) 2006 Nokia Corporation alarmd and libalarm are free software; you can redistribute them and/or modify them under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation.

alarmd and libalarm are distributed in the hope that they 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 software; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Definition at line 31 of file rpc-dbus.c.

Referenced by dbus_watch_name().


Typedef Documentation

typedef struct _DBusNameNotify DBusNameNotify
 


Function Documentation

static DBusHandlerResult _service_started DBusConnection *  connection,
DBusMessage *  message,
void *  user_data
[static]
 

Definition at line 160 of file rpc-dbus.c.

References _DBusNameNotify::cb, _DBusNameNotify::match, _DBusNameNotify::name, notify_mutex, service_notifies, system_bus, and _DBusNameNotify::user_data.

Referenced by dbus_unwatch_name(), and dbus_watch_name().

void dbus_do_call DBusConnection *  bus,
DBusMessage **  reply,
gboolean  activation,
const gchar *  service,
const gchar *  path,
const gchar *  interface,
const gchar *  name,
int  first_arg_type,
  ...
 

Definition at line 47 of file rpc-dbus.c.

Referenced by _alarmd_action_dbus_do_action(), _close_dialog(), _display_icon(), _ic_get_connected_bus(), _queue_changed(), _resend_message(), mce_request_powerup(), mce_request_shutdown(), mce_set_alarm_visibility(), statusbar_hide_icon(), statusbar_show_icon(), and systemui_is_acting_dead().

void dbus_set_osso osso_context_t *  osso  ) 
 

dbus_set_osso: : osso context to get connections from.

Sets a singleton osso context that is used to get dbus connections wherever they are needed, See get_dbus_connection.

Definition at line 206 of file rpc-dbus.c.

References _osso.

Referenced by main().

void dbus_unwatch_name const gchar *  name,
DBusNameNotifyCb  cb,
gpointer  user_data
 

Definition at line 133 of file rpc-dbus.c.

References _service_started(), _DBusNameNotify::cb, _DBusNameNotify::match, _DBusNameNotify::name, notify_mutex, service_notifies, system_bus, and _DBusNameNotify::user_data.

Referenced by _alarmd_action_dialog_finalize().

void dbus_watch_name const gchar *  name,
DBusNameNotifyCb  cb,
gpointer  user_data
 

Definition at line 99 of file rpc-dbus.c.

References _service_started(), _DBusNameNotify::cb, get_dbus_connection(), _DBusNameNotify::match, _DBusNameNotify::name, notify_mutex, service_notifies, SERVICE_STARTED_SIGNAL, system_bus, and _DBusNameNotify::user_data.

Referenced by _alarmd_action_dialog_real_run().

DBusConnection* get_dbus_connection DBusBusType  type  ) 
 

get_dbus_connection: DBUS_BUS_SESSION for session bus or DBUS_TYPE_SYSTEM for system bus.

Gets system or session bus from the osso context registered with dbus_set_osso. dbus_set_osso _must_ be called before this can be called. Returns: A dbus connection to the bus specified by . Callers owns a reference, unref with dbus_connection_unref.

Definition at line 210 of file rpc-dbus.c.

References _osso, and conn.

Referenced by _alarmd_action_dbus_do_action(), _alarmd_action_dialog_powerup(), _alarmd_action_dialog_real_run(), _alarmd_action_dialog_snooze_powerup(), _dbus_connect(), dbus_watch_name(), ic_get_connected(), ic_wait_connection(), statusbar_show_icon(), systemui_is_acting_dead(), and update_mce_alarm_visibility().


Variable Documentation

osso_context_t* _osso = NULL [static]
 

Definition at line 34 of file rpc-dbus.c.

Referenced by dbus_set_osso(), and get_dbus_connection().

GStaticMutex notify_mutex = G_STATIC_MUTEX_INIT [static]
 

Definition at line 45 of file rpc-dbus.c.

Referenced by _ic_connected(), _service_started(), dbus_unwatch_name(), dbus_watch_name(), ic_unwait_connection(), and ic_wait_connection().

GSList* service_notifies = NULL [static]
 

Definition at line 43 of file rpc-dbus.c.

Referenced by _service_started(), dbus_unwatch_name(), and dbus_watch_name().

DBusConnection* system_bus = NULL [static]
 

Definition at line 44 of file rpc-dbus.c.

Referenced by _alarmd_action_dialog_powerup(), _alarmd_action_dialog_real_run(), _alarmd_action_dialog_snooze_powerup(), _close_dialog(), _dialog_ackd(), _ic_connected(), _queue_changed(), _resend_message(), _service_started(), dbus_unwatch_name(), dbus_watch_name(), ic_unwait_connection(), ic_wait_connection(), systemui_alarm_dialog_queue_remove(), and systemui_is_acting_dead().


Generated on Thu Dec 21 18:23:31 2006 for Alarmd by  doxygen 1.4.2