~ubuntu-branches/ubuntu/quantal/cairo-dock-plug-ins/quantal-201208191523

« back to all changes in this revision

Viewing changes to Doncky/src/applet-struct.h

  • Committer: Bazaar Package Importer
  • Author(s): Matthieu Baerts (matttbe)
  • Date: 2010-08-10 00:05:57 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20100810000557-pfxoz5w7hbyclcqh
Tags: 2.2.0~0beta4-0ubuntu1
* New Upstream Version (LP: #614625)
* Fixed a few bugs on LP:
 - LP: #483963: Dustbin applet does not display trashes on all volumes
 - LP: #485159: Some apps have problem with Systray
 - LP: #500677: ~/.xsession-errors is too much used by CD
 - LP: #500979: Shortcuts: the order gets messed up
 - LP: #521531: Mail: crashes on Maildir
 - LP: #519915: GTG: create a new applet to control GTG
 - LP: #526138: GMenu doesn't handle desktop file exec strings properly
 - LP: #531317: CMake: Added an error if the prefix of 'cairo-dock-plugins'
                 is not the same 'cairo-dock-core'
 - LP: #531319: CMake: check the version of 'cairo-dock' when building
                 'cairo-dock-plugins'
 - LP: #537115: Click at the position where icon lavel was, the icon
                 and dock still receive the event
 - LP: #537943: Terminal applet shortkey behaviour
 - LP: #538637: Trash applet doesn't create .trashinfo files on XFCE
 - More details on the 'ChangeLog' file
* debian/rules:
 - Autotools has been replaced by CMake
 - cdbs is now used.
* debian/copyright:
 - Updated with the new applets
* debian/control:
 - Autotools has been replaced by CMake
 - Added libcurl4-gnutls-dev, libindicator-dev, libdbusmenu-glib-dev
   libido-0.1-dev, libical-dev, libdbusmenu-gtk-dev as Build-deps
 - Bump Standard-Version to 3.9.1
 - Wget is required for dnd2share applet
 - Added the exact realease for 'cairo-dock-dev' in order to prevent any
    build error if this package is not already available (thx to didrocks)
* debian/cairo-dock-plug-ins*.install:
 - All sonames are now installed into lib32 or lib64 (lib*)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
* This file is a part of the Cairo-Dock project
 
3
*
 
4
* Copyright : (C) see the 'copyright' file.
 
5
* E-mail    : see the 'copyright' file.
 
6
*
 
7
* This program is free software; you can redistribute it and/or
 
8
* modify it under the terms of the GNU General Public License
 
9
* as published by the Free Software Foundation; either version 3
 
10
* of the License, or (at your option) any later version.
 
11
*
 
12
* This program is distributed in the hope that it will be useful,
 
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
* GNU General Public License for more details.
 
16
* You should have received a copy of the GNU General Public License
 
17
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
*/
 
19
 
 
20
 
 
21
#ifndef __CD_APPLET_STRUCT__
 
22
#define  __CD_APPLET_STRUCT__
 
23
 
 
24
#include <cairo-dock.h>
 
25
 
 
26
#define CD_SYSMONITOR_PROC_FS "/proc"   // REPRIS DE SYSTEM-MONITOR
 
27
#define CD_SYSMONITOR_NB_MAX_VALUES 4   // REPRIS DE SYSTEM-MONITOR
 
28
 
 
29
 // REPRIS DE SYSTEM-MONITOR :
 
30
typedef enum _CDSysmonitorDisplayType {
 
31
        CD_SYSMONITOR_GAUGE=0,
 
32
        CD_SYSMONITOR_GRAPH,
 
33
        CD_SYSMONITOR_BAR,
 
34
        CD_SYSMONITOR_NB_TYPES
 
35
        } CDSysmonitorDisplayType;
 
36
        
 
37
 
 
38
 
 
39
typedef struct _CDDiskUsage {
 
40
        long long iPrevAvail;
 
41
        long long iAvail;
 
42
        long long iFree;
 
43
        long long iTotal;
 
44
        long long iUsed;
 
45
        int iType;
 
46
        } CDDiskUsage;
 
47
 
 
48
 
 
49
 
 
50
//\___________ structure containing the applet's configuration parameters.
 
51
struct _AppletConfig {
 
52
        
 
53
        gboolean bDisplayBackground;
 
54
        double fBackgroundColor1[4];
 
55
        double fBackgroundColor2[4];
 
56
        gint iBackgroundRadius;
 
57
        gint iBorderThickness;
 
58
        double fBorderColor[4];
 
59
        double fDefaultTextColor[4];
 
60
        gchar *cDefaultFont;
 
61
        gint iTextMargin;
 
62
        gint iSpaceBetweenLines;        
 
63
        gchar *cXmlFilePath;
 
64
        
 
65
        gint iCheckInterval;
 
66
        
 
67
        
 
68
        
 
69
        // REPRIS DE SYSTEM-MONITOR :
 
70
        gchar *defaultTitle;
 
71
        gboolean bShowCpu;
 
72
        gboolean bShowRam;
 
73
        gboolean bShowNvidia;
 
74
        gboolean bShowSwap;
 
75
        gchar *cGThemePath;
 
76
        gchar *cWatermarkImagePath;
 
77
        gdouble fAlpha; 
 
78
        CDSysmonitorDisplayType iDisplayType;
 
79
        CairoDockTypeGraph iGraphType;
 
80
        gdouble fLowColor[3];
 
81
        gdouble fHigholor[3];
 
82
        gdouble fBgColor[4];
 
83
        gboolean bMixGraph;     
 
84
        gint iNbDisplayedProcesses;
 
85
        gboolean bTopInPercent;
 
86
        CairoDockLabelDescription *pTopTextDescription; 
 
87
        gchar *cSystemMonitorCommand;
 
88
        gchar *cSystemMonitorClass;
 
89
        gboolean bStealTaskBarIcon;
 
90
        gdouble fUserHZ;        
 
91
        gchar *cSoundPath;
 
92
        } ;
 
93
 
 
94
 
 
95
 
 
96
// REPRIS DE SYSTEM-MONITOR :
 
97
typedef struct {
 
98
        gint iPid;
 
99
        gchar *cName;
 
100
        gint iCpuTime;
 
101
        gdouble fCpuPercent;
 
102
        gdouble iMemAmount;
 
103
        gdouble fLastCheckTime;
 
104
        } CDProcess;
 
105
 
 
106
 
 
107
 
 
108
 
 
109
 
 
110
//\___________ structure containing the applet's data, like surfaces, dialogs, results of calculus, etc.
 
111
struct _AppletData {
 
112
        // Nouveau Doncky
 
113
        
 
114
        
 
115
        gchar *cPrevAlignWidth;
 
116
        gchar *cPrevAlignHeight;
 
117
        gchar *cPrevFont;
 
118
        double fPrevTextColor[4];
 
119
        gint iPrevOverrideH;
 
120
        gint iPrevOverrideW;
 
121
        
 
122
        
 
123
        
 
124
        
 
125
        
 
126
        
 
127
        
 
128
        
 
129
        
 
130
        
 
131
        
 
132
        
 
133
        // Ancien Doncky
 
134
        CairoDockTask *pPeriodicRefreshTask;
 
135
        
 
136
        GList *pTextZoneList;
 
137
        
 
138
        gchar *cTempoText;
 
139
        gchar *cCurrentText;    
 
140
        double fCurrentX; // Position du curseur dans le desklet
 
141
        double fCurrentY;
 
142
        double fCurrentYalign;
 
143
        gchar *cLastAlignHeight;
 
144
        gint iLastLineHeight;
 
145
        gboolean bLastWasSameLine;
 
146
        gint iMaxGraphHistory;
 
147
        
 
148
        cairo_surface_t *pImgSurface;
 
149
        
 
150
        
 
151
        
 
152
        // REPRIS DE SYSTEM-MONITOR :
 
153
        
 
154
        // infos, constantes.
 
155
        gint iNbCPU;
 
156
        gulong iMemPageSize;
 
157
        gint iFrequency;
 
158
        gchar *cModelName;
 
159
        gchar *cGPUName;
 
160
        gint iVideoRam;
 
161
        gchar *cDriverVersion;
 
162
        
 
163
        // shared memory for the main thread.
 
164
        gboolean bInitialized;
 
165
        gboolean bAcquisitionOK;
 
166
        GTimer *pClock;
 
167
        long long int cpu_user, cpu_user_nice, cpu_system, cpu_idle;
 
168
        unsigned long long ramTotal, ramFree, ramUsed, ramBuffers, ramCached;
 
169
        unsigned long long swapTotal, swapFree, swapUsed;
 
170
        gint iGPUTemp;
 
171
        gdouble fCpuPercent;
 
172
        gdouble fPrevCpuPercent;
 
173
        gdouble fRamPercent,fSwapPercent;
 
174
        gdouble fPrevRamPercent, fPrevSwapPercent;
 
175
        gdouble fGpuTempPercent;
 
176
        gdouble fPrevGpuTempPercent;
 
177
        gboolean bNeedsUpdate;
 
178
        gint iTimerCount;
 
179
        // end of shared memory.
 
180
        gint iCount;  // pour sous-echantilloner les acquisitions de valeurs moins variables.
 
181
        
 
182
        gint iNbProcesses;
 
183
        CairoDialog *pTopDialog;
 
184
        cairo_surface_t *pTopSurface;
 
185
        CairoDockTask *pTopTask;
 
186
        // shared memory for the "top" thread.
 
187
        GHashTable *pProcessTable;
 
188
        CDProcess **pTopList;
 
189
        GTimer *pTopClock;
 
190
        gboolean bSortTopByRam;
 
191
        // end of shared memory.
 
192
        
 
193
        gint iMaxFrequency;
 
194
        } ;
 
195
 
 
196
#endif