diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2013-06-19 21:13:09 +0000 |
---|---|---|
committer | Tarmac <Unknown> | 2013-06-19 21:13:09 +0000 |
commit | 0ce78de0eae6f44a0afe6e5b4bdc6da83f6dbdf8 (patch) | |
tree | ce626b15bcfb92beec4487a6b7fe50ef4be91dac /src/service.h | |
parent | 0b0585581a8da994362ef4cfe3a2168917a47ff4 (diff) | |
parent | 258f3ad689ae4ba49e2813a5051b4968d568f999 (diff) | |
download | ayatana-indicator-power-0ce78de0eae6f44a0afe6e5b4bdc6da83f6dbdf8.tar.gz ayatana-indicator-power-0ce78de0eae6f44a0afe6e5b4bdc6da83f6dbdf8.tar.bz2 ayatana-indicator-power-0ce78de0eae6f44a0afe6e5b4bdc6da83f6dbdf8.zip |
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.
Diffstat (limited to 'src/service.h')
-rw-r--r-- | src/service.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/src/service.h b/src/service.h new file mode 100644 index 0000000..76ed10f --- /dev/null +++ b/src/service.h @@ -0,0 +1,78 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * Authors: + * Charles Kerr <charles.kerr@canonical.com> + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, 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 this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __INDICATOR_POWER_SERVICE_H__ +#define __INDICATOR_POWER_SERVICE_H__ + +#include <glib.h> +#include <glib-object.h> + +#include "device-provider.h" + +G_BEGIN_DECLS + +/* standard GObject macros */ +#define INDICATOR_POWER_SERVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), INDICATOR_TYPE_POWER_SERVICE, IndicatorPowerService)) +#define INDICATOR_TYPE_POWER_SERVICE (indicator_power_service_get_type()) +#define INDICATOR_IS_POWER_SERVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), INDICATOR_TYPE_POWER_SERVICE)) + +typedef struct _IndicatorPowerService IndicatorPowerService; +typedef struct _IndicatorPowerServiceClass IndicatorPowerServiceClass; +typedef struct _IndicatorPowerServicePrivate IndicatorPowerServicePrivate; + +/* signal keys */ +#define INDICATOR_POWER_SERVICE_SIGNAL_NAME_LOST "name-lost" + +/** + * The Indicator Power Service. + */ +struct _IndicatorPowerService +{ + /*< private >*/ + GObject parent; + IndicatorPowerServicePrivate * priv; +}; + +struct _IndicatorPowerServiceClass +{ + GObjectClass parent_class; + + /* signals */ + + void (* name_lost)(IndicatorPowerService * self); +}; + +/*** +**** +***/ + +GType indicator_power_service_get_type (void); + +IndicatorPowerService * indicator_power_service_new (IndicatorPowerDeviceProvider * provider); + +void indicator_power_service_set_device_provider (IndicatorPowerService * self, + IndicatorPowerDeviceProvider * provider); + +IndicatorPowerDevice * indicator_power_service_choose_primary_device (GList * devices); + + + +G_END_DECLS + +#endif /* __INDICATOR_POWER_SERVICE_H__ */ |