~cairo-dock-team/cairo-dock-plug-ins/plug-ins

« back to all changes in this revision

Viewing changes to Network-Monitor/src/applet-struct.h

  • Committer: Matthieu Baerts
  • Date: 2014-10-19 00:26:10 UTC
  • Revision ID: matttbe@gmail.com-20141019002610-ulf26s9b4c4rw10r
We just switched from BZR to Git.
Follow us on Github: https://github.com/Cairo-Dock

Note: we will only use Github to manage our source code and all pull requests.
Please continue to report your bugs/ideas/messages on our forum or Launchpad! 

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_NETSPEED_NB_MAX_VALUES 2
27
 
 
28
 
 
29
 
typedef enum {
30
 
        WIFI_QUALITY_NO_SIGNAL = 0,
31
 
        WIFI_QUALITY_VERY_LOW,
32
 
        WIFI_QUALITY_LOW,
33
 
        WIFI_QUALITY_MIDDLE,
34
 
        WIFI_QUALITY_GOOD,
35
 
        WIFI_QUALITY_EXCELLENT,
36
 
        WIRED_NO_CONNECTION,
37
 
        WIRED_CONNECTION,
38
 
        CONNECTION_NB_QUALITY
39
 
} CDConnectionQuality;
40
 
 
41
 
typedef enum {
42
 
        WIFI_EFFECT_NONE = 0,
43
 
        WIFI_EFFECT_ZOOM,
44
 
        WIFI_EFFECT_TRANSPARENCY,
45
 
        WIFI_EFFECT_BAR,
46
 
} CDIconEffect;
47
 
 
48
 
 
49
 
typedef enum {
50
 
        CD_EFFECT_GAUGE=0,
51
 
        CD_EFFECT_GRAPH,
52
 
        CD_EFFECT_ICON,
53
 
        CD_WIFI_NB_TYPES
54
 
        } CDRenderType;
55
 
 
56
 
typedef struct _CDRenderer {
57
 
        CDRenderType iRenderType;
58
 
        // jauge.
59
 
        gchar *cGThemePath;
60
 
        // graphe
61
 
        CairoDockTypeGraph iGraphType;
62
 
        gdouble fLowColor[3];
63
 
        gdouble fHigholor[3];
64
 
        gdouble fBgColor[4];
65
 
        // icone
66
 
        CDIconEffect iEffect;
67
 
        gchar *cUserImage[CONNECTION_NB_QUALITY];
68
 
        } CDRenderer;
69
 
 
70
 
struct _AppletConfig {
71
 
        gchar *defaultTitle;
72
 
        gchar *cWifiConfigCommand;
73
 
        
74
 
        // parametres
75
 
        gboolean bModeWifi;  // TRUE pour l'affichage Wifi, FALSE pour l'affichage Netspeed.
76
 
        gchar *cInterface;  // interface (eth0, etc) a surveiller
77
 
        gint iStringLen;
78
 
        gchar *cSysMonitorCommand;  // command pour ouvrir un moniteur systeme.
79
 
        gchar *cAnimation;  // animation de connexion.
80
 
        
81
 
        gdouble fSmoothFactor;
82
 
        // wifi
83
 
        gint iWifiCheckInterval;
84
 
        CDRenderer wifiRenderer;
85
 
        
86
 
        // netspeed
87
 
        gint iNetspeedCheckInterval;
88
 
        CDRenderer netSpeedRenderer;
89
 
};
90
 
 
91
 
 
92
 
typedef struct _CDNetSpeed {
93
 
        GldiTask *pTask;
94
 
        // shared memory
95
 
        gboolean _bInitialized;
96
 
        gboolean _bAcquisitionOK;
97
 
        long long int _iReceivedBytes, _iTransmittedBytes;
98
 
        gint _iDownloadSpeed, _iUploadSpeed;
99
 
        gint _iMaxUpRate, _iMaxDownRate;
100
 
        // end of shared memory
101
 
        gboolean bAcquisitionOK;
102
 
        long long int iReceivedBytes, iTransmittedBytes;
103
 
        CairoDataRenderer *pDataRenderer;
104
 
        } CDNetSpeed;
105
 
 
106
 
typedef struct _CDWifi {
107
 
        GldiTask *pTask;
108
 
        // shared memory
109
 
        CDConnectionQuality _iQuality, _iPreviousQuality;
110
 
        gint _iPercent, _iPrevPercent;
111
 
        gint _iSignalLevel, _iPrevSignalLevel;
112
 
        gint _iPrevNoiseLevel, _iNoiseLevel;
113
 
        gchar *_cESSID;
114
 
        gchar *_cInterface;
115
 
        gchar *_cAccessPoint;
116
 
        // end of shared memory
117
 
        gboolean bWirelessExt;
118
 
        CDConnectionQuality iQuality;
119
 
        gchar *cInterface;
120
 
        gchar *cAccessPoint;
121
 
        gchar *cESSID;
122
 
        CairoDataRenderer *pDataRenderer;
123
 
        } CDWifi;
124
 
 
125
 
typedef struct _CDNetworkManager {
126
 
        gint iPercent, iPrevPercent;
127
 
        gchar *cActiveAccessPoint;
128
 
        gchar *cAccessPointHwAdress;
129
 
        gchar *cESSID;
130
 
        gint iSpeed;  // max bit rate
131
 
        
132
 
        DBusGProxy *dbus_proxy_ActiveConnection;
133
 
        DBusGProxy *dbus_proxy_Device;
134
 
        DBusGProxy *dbus_proxy_ActiveAccessPoint;
135
 
        DBusGProxy *dbus_proxy_NM;
136
 
        DBusGProxy *dbus_proxy_WirelessDevice;
137
 
        DBusGProxy *dbus_proxy_WiredDevice;
138
 
        
139
 
        
140
 
        CairoDataRenderer *pDataRenderer;
141
 
        } CDNetworkManager;
142
 
 
143
 
typedef struct _CDMenuItemData {
144
 
        gchar *cConnection;
145
 
        gchar *cDevice;
146
 
        gchar *cAccessPoint;
147
 
        gint iPercent;
148
 
        gchar *cSsid;
149
 
        } CDMenuItemData;  // le service name est fixe une fois pour toutes dans myData.
150
 
 
151
 
 
152
 
struct _AppletData {
153
 
        CDConnectionQuality iQuality, iPreviousQuality;
154
 
        gint iPercent, iPrevPercent;
155
 
        gint iSignalLevel, iPrevSignalLevel;
156
 
        gint iPrevNoiseLevel, iNoiseLevel;
157
 
        gchar *cESSID;
158
 
        gchar *cInterface;
159
 
        gint iSpeed;  // max bit rate
160
 
        
161
 
        gboolean bDbusConnection;  // TRUE si on a trouve NM sur le bus.
162
 
        
163
 
        gboolean bWirelessExt;
164
 
        gboolean bWiredExt;
165
 
        
166
 
        cairo_surface_t *pSurfaces[CONNECTION_NB_QUALITY];
167
 
        
168
 
        DBusGProxy *dbus_proxy_NM;
169
 
        DBusGProxy *dbus_proxy_NM_prop;
170
 
        DBusGProxy *dbus_proxy_ActiveConnection;
171
 
        DBusGProxy *dbus_proxy_ActiveConnection_prop;
172
 
        DBusGProxy *dbus_proxy_Device;
173
 
        DBusGProxy *dbus_proxy_Device_prop;
174
 
        DBusGProxy *dbus_proxy_ActiveAccessPoint;
175
 
        DBusGProxy *dbus_proxy_ActiveAccessPoint_prop;
176
 
        DBusGProxy *dbus_proxy_WirelessDevice;
177
 
        DBusGProxy *dbus_proxy_WirelessDevice_prop;
178
 
        DBusGProxy *dbus_proxy_WiredDevice;
179
 
        DBusGProxy *dbus_proxy_WiredDevice_prop;
180
 
        DBusGProxy *dbus_proxy_Settings;
181
 
        
182
 
        gchar *cActiveConnection;
183
 
        gchar *cDevice;
184
 
        gchar *cServiceName;
185
 
        gchar *cConnection;
186
 
        gchar *cAccessPoint;
187
 
        gchar *cAccessPointHwAdress;
188
 
        GPtrArray *pMenuAccessPoints;
189
 
        GPtrArray *pMenuSettings;
190
 
        
191
 
        CDNetSpeed netSpeed;
192
 
        CDWifi wifi;
193
 
        CDNetworkManager nm;
194
 
};
195
 
 
196
 
 
197
 
#endif