From 4a60cd5e9ad0384e5bed98a2d70e9c02832a4286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Tue, 14 Feb 2012 13:05:41 +0000 Subject: Code style fixes --- src/indicator-power.c | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/indicator-power.c b/src/indicator-power.c index f7de038..84bd4c1 100644 --- a/src/indicator-power.c +++ b/src/indicator-power.c @@ -44,6 +44,12 @@ with this program. If not, see . #define POWER_DBUS_PATH DBUS_PATH "/Power" #define POWER_DBUS_INTERFACE "org.gnome.SettingsDaemon.Power" +enum { + POWER_INDICATOR_ICON_POLICY_PRESENT, + POWER_INDICATOR_ICON_POLICY_CHARGE, + POWER_INDICATOR_ICON_POLICY_NEVER +}; + #define INDICATOR_POWER_TYPE (indicator_power_get_type ()) #define INDICATOR_POWER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), INDICATOR_POWER_TYPE, IndicatorPower)) #define INDICATOR_POWER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), INDICATOR_POWER_TYPE, IndicatorPowerClass)) @@ -51,23 +57,16 @@ with this program. If not, see . #define IS_INDICATOR_POWER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), INDICATOR_POWER_TYPE)) #define INDICATOR_POWER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), INDICATOR_POWER_TYPE, IndicatorPowerClass)) -enum { - POWER_INDICATOR_ICON_POLICY_PRESENT, - POWER_INDICATOR_ICON_POLICY_CHARGE, - POWER_INDICATOR_ICON_POLICY_NEVER -}; - -GType indicator_power_get_type (void); +typedef struct _IndicatorPowerClass IndicatorPowerClass; +typedef struct _IndicatorPower IndicatorPower; -INDICATOR_SET_VERSION -INDICATOR_SET_TYPE (INDICATOR_POWER_TYPE) - -typedef struct { +struct _IndicatorPowerClass +{ IndicatorObjectClass parent_class; -} -IndicatorPowerClass; +}; -typedef struct { +struct _IndicatorPower +{ IndicatorObject parent_instance; GtkMenu *menu; @@ -84,8 +83,12 @@ typedef struct { GVariant *device; GSettings *settings; -} -IndicatorPower; +}; + +GType indicator_power_get_type (void); + +INDICATOR_SET_VERSION +INDICATOR_SET_TYPE (INDICATOR_POWER_TYPE) /* Prototypes */ static void indicator_power_dispose (GObject *object); -- cgit v1.2.3 From 207267adc55aad9810afb4eb2e04ca86c4289f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Tue, 14 Feb 2012 13:06:16 +0000 Subject: Use G_GNUC_CONST for indicator_power_get_type() to improve performance --- src/indicator-power.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/indicator-power.c b/src/indicator-power.c index 84bd4c1..3980988 100644 --- a/src/indicator-power.c +++ b/src/indicator-power.c @@ -85,7 +85,7 @@ struct _IndicatorPower GSettings *settings; }; -GType indicator_power_get_type (void); +GType indicator_power_get_type (void) G_GNUC_CONST; INDICATOR_SET_VERSION INDICATOR_SET_TYPE (INDICATOR_POWER_TYPE) -- cgit v1.2.3