~ubuntu-branches/ubuntu/oneiric/cairo-dock-plug-ins/oneiric-updates

« back to all changes in this revision

Viewing changes to powermanager/src/powermanager-struct.h

  • Committer: Kees Cook
  • Date: 2011-08-11 23:17:39 UTC
  • mfrom: (20.1.1 cairo-dock-plug-ins)
  • Revision ID: kees@outflux.net-20110811231739-cteedan51tmdg77v
Tags: 2.4.0~0beta2-0ubuntu1
releasing version 2.4.0~0beta2-0ubuntu1

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#define  __POWERMANAGER_STRUCT__
22
22
 
23
23
#include <cairo-dock.h>
24
 
 
 
24
#ifdef CD_UPOWER_AVAILABLE
 
25
#include <upower.h>
 
26
#endif
25
27
 
26
28
typedef enum _CDPowermanagerDisplayType {
27
29
        CD_POWERMANAGER_GAUGE=0,
68
70
        gboolean highBatteryWitness;
69
71
        gboolean lowBatteryWitness;
70
72
        gboolean criticalBatteryWitness;
71
 
        gboolean bUseApprox;
72
73
        gint lowBatteryValue;
73
74
        const gchar *cGThemePath;
74
75
        gchar *cSoundPath[POWER_MANAGER_NB_CHARGE_LEVEL];
75
 
        gboolean bUseDBusFallback;
76
76
        
77
77
        gdouble fLastDischargeMeanRate;
78
78
        gdouble fLastChargeMeanRate;
83
83
        MyAppletEffect iEffect;
84
84
  } ;
85
85
 
 
86
 
 
87
/**typedef struct {
 
88
        gint iTime;
 
89
        gint iPercentage;
 
90
        gboolean bOnBattery;
 
91
        gboolean bBatteryPresent;
 
92
        } CDBateryState;*/
 
93
 
 
94
typedef struct {
 
95
        #ifdef CD_UPOWER_AVAILABLE
 
96
        UpClient *pUPowerClient;
 
97
        UpDevice *pBatteryDevice;
 
98
        #else
 
99
        gpointer pUPowerClient;  // will stay NULL.
 
100
        gpointer pBatteryDevice;  // will stay NULL.
 
101
        #endif
 
102
        } CDSharedMemory;
 
103
 
86
104
#define PM_NB_VALUES 100
87
105
struct _AppletData {
 
106
        CairoDockTask *pTask;
 
107
        #ifdef CD_UPOWER_AVAILABLE
 
108
        UpClient *pUPowerClient;
 
109
        #else
 
110
        gpointer pUPowerClient;  // will stay NULL.
 
111
        #endif
 
112
        gchar *cBatteryStateFilePath;
 
113
        gboolean bProcAcpiFound;
 
114
        gboolean bSysClassFound;
 
115
        
 
116
        gchar *cTechnology;
 
117
        gchar *cVendor;
 
118
        gchar *cModel;
 
119
        gdouble fMaxAvailableCapacity;
 
120
        
 
121
        gint iTime;
 
122
        gint iPercentage;
 
123
        gboolean bOnBattery;
 
124
        gboolean bBatteryPresent;
 
125
        gint iPrevTime;
 
126
        gint iPrevPercentage;
 
127
        gboolean bPrevOnBattery;
 
128
        
88
129
        cairo_surface_t *pSurfaceBattery;
89
130
        cairo_surface_t *pSurfaceCharge;
90
 
        gboolean dbus_enable;
91
 
        gboolean battery_present, prev_battery_present;
92
131
        gint iCapacity;
93
 
        gboolean on_battery, previously_on_battery;
94
 
        gdouble battery_time, previous_battery_time;
95
 
        gdouble battery_charge, previous_battery_charge;
96
 
        gboolean alerted;
 
132
        gboolean bAlerted;
97
133
        gboolean bCritical;
98
134
        gint checkLoop;
99
 
        Gauge *pGauge;
100
 
        gchar *cBatteryStateFilePath;
101
135
        
102
 
        gdouble fRateHistory[PM_NB_VALUES];
 
136
        /**gdouble fRateHistory[PM_NB_VALUES];
103
137
        gint iCurrentIndex;
104
 
        gint iIndexMax;
105
 
        gboolean bUseDBus;
 
138
        gint iIndexMax;*/
106
139
        
107
140
        gdouble fChargeMeanRate;
108
141
        gint iNbChargeMeasures;
109
142
        gdouble fDischargeMeanRate;
110
143
        gint iNbDischargeMeasures;
111
144
        
 
145
        gint iStatPercentage;
 
146
        gint iStatPercentageBegin;
 
147
        gint iStatTime;
 
148
        gint iStatTimeCount;
 
149
        
112
150
        CairoEmblem *pEmblem;
 
151
 
 
152
        gint iSignalID;
113
153
        } ;
114
154
 
115
155