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

rpc-systemui.c File Reference

#include <dbus/dbus.h>
#include <glib/gthread.h>
#include <glib/gslist.h>
#include <glib/gstrfuncs.h>
#include <systemui/dbus-names.h>
#include <systemui/alarm_dialog-dbus-names.h>
#include <systemui/actingdead-dbus-names.h>
#include <string.h>
#include "debug.h"
#include "include/alarm_dbus.h"
#include "rpc-dbus.h"
#include "rpc-systemui.h"
#include "rpc-mce.h"

Include dependency graph for rpc-systemui.c:

Go to the source code of this file.

Defines

#define ALARMD_ACTION_DBUS_METHOD   "action_dbus_return"
 This file is part of alarmd.

Typedefs

typedef _SystemuiAlarmdDialog SystemuiAlarmdDialog

Enumerations

enum  response { RESPONSE_ACCEPT = -3 }
enum  flag {
  FLAG_CAN_SNOOZE = 1 << 0,
  FLAG_POWERUP = 1 << 1
}

Functions

static void _dialog_free (SystemuiAlarmdDialog *dialog)
static gboolean _resend_message (gpointer user_data)
static DBusConnection * _dbus_connect (void)
static void _dbus_disconnect (DBusConnection *conn)
static void _queue_changed (void)
static void _close_dialog (void)
static gint _queue_compare (gconstpointer v1, gconstpointer v2)
static gboolean _dialog_do_cb (gpointer data)
static DBusHandlerResult _dialog_ackd (DBusConnection *connection, DBusMessage *message, void *user_data)
static void _systemui_dialog_queue_append (time_t alarm_time, const gchar *title, const gchar *message, const gchar *sound, const gchar *icon, enum flag flags, SystemuiAlarmdDialogCallback cb, gpointer user_data)
void systemui_powerup_dialog_queue_append (SystemuiAlarmdDialogCallback cb, gpointer user_data)
 systemui_powerup_dialog_queue_append: : Callback called when the dialog is acknowledged.
void systemui_alarm_dialog_queue_append (time_t alarm_time, const gchar *title, const gchar *message, const gchar *sound, const gchar *icon, gboolean can_snooze, SystemuiAlarmdDialogCallback cb, gpointer user_data)
 systemui_alarm_dialog_queue_append: : Title of the dialog to be appended to the queue.
void systemui_powerup_dialog_queue_remove (SystemuiAlarmdDialogCallback cb, gpointer user_data)
 systemui_powerup_dialog_queue_remove: : As passed to systemui_powerup_dialog_queue_append.
void systemui_alarm_dialog_queue_remove (time_t alarm_time, const gchar *title, const gchar *message, const gchar *sound, const gchar *icon, SystemuiAlarmdDialogCallback cb, gpointer user_data)
 systemui_alarm_dialog_queue_remove: : As passed to systemui_alarm_dialog_queue_append.
void update_mce_alarm_visibility (void)
 update_mce_alarm_visibility:
void systemui_ack_all_dialogs (void)
 systemui_ack_all_dialogs:
gboolean systemui_is_acting_dead (void)
 systemui_is_acting_dead:

Variables

static GStaticMutex queue_mutex = G_STATIC_MUTEX_INIT
static GSList * dialog_queue = NULL
static DBusConnection * system_bus = NULL
static gboolean mce_dialog_visible = FALSE


Define Documentation

#define ALARMD_ACTION_DBUS_METHOD   "action_dbus_return"
 

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 37 of file rpc-systemui.c.

Referenced by _dialog_ackd(), _queue_changed(), and _resend_message().


Typedef Documentation

typedef struct _SystemuiAlarmdDialog SystemuiAlarmdDialog
 

Definition at line 49 of file rpc-systemui.c.


Enumeration Type Documentation

enum flag
 

Enumeration values:
FLAG_CAN_SNOOZE 
FLAG_POWERUP 

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

enum response
 

Enumeration values:
RESPONSE_ACCEPT 

Definition at line 40 of file rpc-systemui.c.


Function Documentation

static void _close_dialog void   )  [static]
 

Definition at line 274 of file rpc-systemui.c.

References _dbus_disconnect(), dbus_do_call(), ENTER_FUNC, LEAVE_FUNC, queue_mutex, and system_bus.

Referenced by systemui_ack_all_dialogs(), and systemui_alarm_dialog_queue_remove().

static DBusConnection * _dbus_connect void   )  [static]
 

Definition at line 294 of file rpc-systemui.c.

References _dialog_ackd(), ALARMD_SERVICE, ENTER_FUNC, get_dbus_connection(), and LEAVE_FUNC.

Referenced by _queue_changed().

static void _dbus_disconnect DBusConnection *  conn  )  [static]
 

Definition at line 314 of file rpc-systemui.c.

References _dialog_ackd(), ENTER_FUNC, and LEAVE_FUNC.

Referenced by _close_dialog(), _dialog_ackd(), and _queue_changed().

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

Definition at line 334 of file rpc-systemui.c.

References _dbus_disconnect(), _dialog_do_cb(), _dialog_free(), _queue_changed(), ALARMD_ACTION_DBUS_METHOD, ALARMD_INTERFACE, DEBUG, dialog_queue, ENTER_FUNC, LEAVE_FUNC, queue_mutex, _SystemuiAlarmdDialog::status, system_bus, and _SystemuiAlarmdDialog::timer_id.

Referenced by _dbus_connect(), and _dbus_disconnect().

static gboolean _dialog_do_cb gpointer  data  )  [static]
 

Definition at line 324 of file rpc-systemui.c.

References _SystemuiAlarmdDialog::cb, _SystemuiAlarmdDialog::status, and _SystemuiAlarmdDialog::user_data.

Referenced by _dialog_ackd().

static void _dialog_free SystemuiAlarmdDialog dialog  )  [static]
 

Definition at line 173 of file rpc-systemui.c.

References ENTER_FUNC, and LEAVE_FUNC.

Referenced by _dialog_ackd(), and systemui_alarm_dialog_queue_remove().

static void _queue_changed void   )  [static]
 

Definition at line 197 of file rpc-systemui.c.

References _dbus_connect(), _dbus_disconnect(), _resend_message(), _SystemuiAlarmdDialog::alarm_time, ALARMD_ACTION_DBUS_METHOD, ALARMD_INTERFACE, ALARMD_PATH, ALARMD_SERVICE, dbus_do_call(), DEBUG, dialog_queue, ENTER_FUNC, FLAG_CAN_SNOOZE, FLAG_POWERUP, _SystemuiAlarmdDialog::flags, _SystemuiAlarmdDialog::icon, LEAVE_FUNC, _SystemuiAlarmdDialog::message, queue_mutex, RESPONSE_ACCEPT, _SystemuiAlarmdDialog::sound, system_bus, _SystemuiAlarmdDialog::timer_id, and _SystemuiAlarmdDialog::title.

static gint _queue_compare gconstpointer  v1,
gconstpointer  v2
[static]
 

Definition at line 137 of file rpc-systemui.c.

References _SystemuiAlarmdDialog::alarm_time, _SystemuiAlarmdDialog::cb, ENTER_FUNC, _SystemuiAlarmdDialog::icon, LEAVE_FUNC, _SystemuiAlarmdDialog::message, _SystemuiAlarmdDialog::sound, _SystemuiAlarmdDialog::title, and _SystemuiAlarmdDialog::user_data.

Referenced by systemui_alarm_dialog_queue_remove().

static gboolean _resend_message gpointer  user_data  )  [static]
 

Definition at line 446 of file rpc-systemui.c.

References _SystemuiAlarmdDialog::alarm_time, ALARMD_ACTION_DBUS_METHOD, ALARMD_INTERFACE, ALARMD_PATH, ALARMD_SERVICE, _SystemuiAlarmdDialog::count, dbus_do_call(), DEBUG, ENTER_FUNC, FLAG_CAN_SNOOZE, _SystemuiAlarmdDialog::flags, _SystemuiAlarmdDialog::icon, LEAVE_FUNC, _SystemuiAlarmdDialog::message, queue_mutex, _SystemuiAlarmdDialog::sound, system_bus, _SystemuiAlarmdDialog::timer_id, and _SystemuiAlarmdDialog::title.

Referenced by _queue_changed().

static void _systemui_dialog_queue_append time_t  alarm_time,
const gchar *  title,
const gchar *  message,
const gchar *  sound,
const gchar *  icon,
enum flag  flags,
SystemuiAlarmdDialogCallback  cb,
gpointer  user_data
[static]
 

Definition at line 383 of file rpc-systemui.c.

References _queue_changed(), _SystemuiAlarmdDialog::alarm_time, _SystemuiAlarmdDialog::cb, dialog_queue, ENTER_FUNC, _SystemuiAlarmdDialog::flags, _SystemuiAlarmdDialog::icon, LEAVE_FUNC, _SystemuiAlarmdDialog::message, queue_mutex, _SystemuiAlarmdDialog::sound, _SystemuiAlarmdDialog::title, and _SystemuiAlarmdDialog::user_data.

Referenced by systemui_alarm_dialog_queue_append(), and systemui_powerup_dialog_queue_append().

void systemui_ack_all_dialogs void   ) 
 

systemui_ack_all_dialogs:

Clears the queue acknowledging all alarms and tells systemui to close the currently showing one.

Definition at line 419 of file rpc-systemui.c.

References _close_dialog(), _SystemuiAlarmdDialog::cb, dialog_queue, ENTER_FUNC, LEAVE_FUNC, queue_mutex, _SystemuiAlarmdDialog::timer_id, and _SystemuiAlarmdDialog::user_data.

Referenced by _osso_hw_cb().

void systemui_alarm_dialog_queue_append time_t  alarm_time,
const gchar *  title,
const gchar *  message,
const gchar *  sound,
const gchar *  icon,
gboolean  can_snooze,
SystemuiAlarmdDialogCallback  cb,
gpointer  user_data
 

systemui_alarm_dialog_queue_append: : Title of the dialog to be appended to the queue.

: Message of the dialog to be appended to the queue. : Sound for the dialog to be appended to the queue. : Icon for the dialog to be appended to the queue. : TRUE if the dialog should have snooze button enabled. : Callback called when the dialog is acknowledged. : user date to pass to the callback.

Adds a request for a dialog to the queue. After the dialog has been acknowledged, the request is removed from the queue, no need to remove it manually.

Definition at line 87 of file rpc-systemui.c.

References _systemui_dialog_queue_append(), and FLAG_CAN_SNOOZE.

Referenced by _alarmd_action_dialog_connected(), and _alarmd_action_dialog_run().

void systemui_alarm_dialog_queue_remove time_t  alarm_time,
const gchar *  title,
const gchar *  message,
const gchar *  sound,
const gchar *  icon,
SystemuiAlarmdDialogCallback  cb,
gpointer  user_data
 

systemui_alarm_dialog_queue_remove: : As passed to systemui_alarm_dialog_queue_append.

: As passed to systemui_alarm_dialog_queue_append. : As passed to systemui_alarm_dialog_queue_append. : As passed to systemui_alarm_dialog_queue_append. : As passed to systemui_alarm_dialog_queue_append. : As passed to systemui_alarm_dialog_queue_append.

Removes an alarm dialog request from the dialog queue.

Definition at line 97 of file rpc-systemui.c.

References _close_dialog(), _dialog_free(), _queue_changed(), _queue_compare(), _SystemuiAlarmdDialog::alarm_time, dialog_queue, ENTER_FUNC, LEAVE_FUNC, queue_mutex, system_bus, and _SystemuiAlarmdDialog::timer_id.

Referenced by systemui_powerup_dialog_queue_remove().

gboolean systemui_is_acting_dead void   ) 
 

systemui_is_acting_dead:

Queries system UI whether the acting dead mode is enabled or not. Returns: TRUE if device is in acting dead, false otherwise.

Definition at line 495 of file rpc-systemui.c.

References dbus_do_call(), ENTER_FUNC, get_dbus_connection(), LEAVE_FUNC, and system_bus.

Referenced by _alarmd_action_dialog_real_run().

void systemui_powerup_dialog_queue_append SystemuiAlarmdDialogCallback  cb,
gpointer  user_data
 

systemui_powerup_dialog_queue_append: : Callback called when the dialog is acknowledged.

: user date to pass to the callback.

Appends a powerup dialog request to the dialog queue. After the dialog has been acknowledged, the request is removed from the queue, no need to remove it manually.

Definition at line 82 of file rpc-systemui.c.

References _systemui_dialog_queue_append(), and FLAG_POWERUP.

Referenced by _alarmd_action_dialog_real_run().

void systemui_powerup_dialog_queue_remove SystemuiAlarmdDialogCallback  cb,
gpointer  user_data
 

systemui_powerup_dialog_queue_remove: : As passed to systemui_powerup_dialog_queue_append.

: As passed to systemui_powerup_dialog_queue_append.

Removes a powerup dialog request from the dialog queue.

Definition at line 92 of file rpc-systemui.c.

References systemui_alarm_dialog_queue_remove().

void update_mce_alarm_visibility void   ) 
 

update_mce_alarm_visibility:

Sends message to mce telling the alarm dialog visibility status.

Definition at line 402 of file rpc-systemui.c.

References conn, dialog_queue, get_dbus_connection(), mce_dialog_visible, mce_set_alarm_visibility(), and queue_mutex.

Referenced by _alarmd_action_dialog_connected(), _alarmd_action_dialog_powerup(), _alarmd_action_dialog_run(), _alarmd_action_dialog_snooze_powerup(), and _alarmd_action_real_acknowledge().


Variable Documentation

GSList* dialog_queue = NULL [static]
 

Definition at line 65 of file rpc-systemui.c.

Referenced by _dialog_ackd(), _queue_changed(), _systemui_dialog_queue_append(), systemui_ack_all_dialogs(), systemui_alarm_dialog_queue_remove(), and update_mce_alarm_visibility().

gboolean mce_dialog_visible = FALSE [static]
 

Definition at line 67 of file rpc-systemui.c.

Referenced by update_mce_alarm_visibility().

GStaticMutex queue_mutex = G_STATIC_MUTEX_INIT [static]
 

Definition at line 64 of file rpc-systemui.c.

Referenced by _close_dialog(), _dialog_ackd(), _queue_changed(), _resend_message(), _systemui_dialog_queue_append(), systemui_ack_all_dialogs(), systemui_alarm_dialog_queue_remove(), and update_mce_alarm_visibility().

DBusConnection* system_bus = NULL [static]
 

Definition at line 66 of file rpc-systemui.c.


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