~ps-jenkins/indicator-power/latestsnapshot-12.10.6+13.10.20131008-0ubuntu1

« back to all changes in this revision

Viewing changes to src/dbus-listener.h

  • Committer: Tarmac
  • Author(s): Charles Kerr
  • Date: 2013-06-19 21:13:09 UTC
  • mfrom: (167.1.32 gmenuify)
  • Revision ID: tarmac-20130619211309-nj444ogmrhsi7r9f
Convert the power indicator into a service that exports GMenus and GActions in accordance with our indicator-ng design.

Approved by PS Jenkins bot, Ted Gould.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 
3
 
Listens for Power changes from org.gnome.SettingsDaemon.Power on Dbus
4
 
 
5
 
Copyright 2012 Canonical Ltd.
6
 
 
7
 
Authors:
8
 
    Javier Jardon <javier.jardon@codethink.co.uk>
9
 
    Charles Kerr <charles.kerr@canonical.com>
10
 
 
11
 
This library is free software; you can redistribute it and/or
12
 
modify it under the terms of the GNU General Public License
13
 
version 3.0 as published by the Free Software Foundation.
14
 
 
15
 
This library is distributed in the hope that it will be useful,
16
 
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 
GNU General Public License version 3.0 for more details.
19
 
 
20
 
You should have received a copy of the GNU General Public
21
 
License along with this library. If not, see
22
 
<http://www.gnu.org/licenses/>.
23
 
*/
24
 
 
25
 
#ifndef __INDICATOR_POWER_DBUS_LISTENER_H__
26
 
#define __INDICATOR_POWER_DBUS_LISTENER_H__
27
 
 
28
 
#include <glib-object.h>
29
 
#include <libupower-glib/upower.h>
30
 
 
31
 
G_BEGIN_DECLS
32
 
 
33
 
#define INDICATOR_POWER_DBUS_LISTENER_TYPE            (indicator_power_dbus_listener_get_type ())
34
 
#define INDICATOR_POWER_DBUS_LISTENER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), INDICATOR_POWER_DBUS_LISTENER_TYPE, IndicatorPowerDbusListener))
35
 
#define INDICATOR_POWER_DBUS_LISTENER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  INDICATOR_POWER_DBUS_LISTENER_TYPE, IndicatorPowerDbusListenerClass))
36
 
#define INDICATOR_IS_POWER_DBUS_LISTENER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), INDICATOR_POWER_DBUS_LISTENER_TYPE))
37
 
#define INDICATOR_IS_POWER_DBUS_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  INDICATOR_POWER_DBUS_LISTENER_TYPE))
38
 
#define INDICATOR_POWER_DBUS_LISTENER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  INDICATOR_POWER_DBUS_LISTENER_TYPE, IndicatorPowerDbusListenerClass))
39
 
 
40
 
typedef struct _IndicatorPowerDbusListener IndicatorPowerDbusListener;
41
 
typedef struct _IndicatorPowerDbusListenerClass IndicatorPowerDbusListenerClass;
42
 
typedef struct _IndicatorPowerDbusListenerPrivate IndicatorPowerDbusListenerPrivate;
43
 
 
44
 
#define GSD_SERVICE               "org.gnome.SettingsDaemon"
45
 
#define GSD_PATH                  "/org/gnome/SettingsDaemon"
46
 
#define GSD_POWER_DBUS_INTERFACE  GSD_SERVICE ".Power"
47
 
#define GSD_POWER_DBUS_PATH       GSD_PATH "/Power"
48
 
 
49
 
/* signals */
50
 
#define INDICATOR_POWER_DBUS_LISTENER_DEVICES_ENUMERATED  "devices-enumerated"
51
 
 
52
 
/**
53
 
 * IndicatorPowerDbusListenerClass:
54
 
 * @parent_class: #GObjectClass
55
 
 */
56
 
struct _IndicatorPowerDbusListenerClass
57
 
{
58
 
  GObjectClass parent_class;
59
 
 
60
 
  void (* devices_enumerated) (IndicatorPowerDbusListener*, GSList * devices);
61
 
};
62
 
 
63
 
/**
64
 
 * IndicatorPowerDbusListener:
65
 
 * @parent: #GObject
66
 
 * @priv: A cached reference to the private data for the instance.
67
 
*/
68
 
struct _IndicatorPowerDbusListener
69
 
{
70
 
  GObject parent;
71
 
  IndicatorPowerDbusListenerPrivate * priv;
72
 
};
73
 
 
74
 
/***
75
 
****
76
 
***/
77
 
 
78
 
GType indicator_power_dbus_listener_get_type (void);
79
 
 
80
 
G_END_DECLS
81
 
 
82
 
#endif