2
* This file is a part of the Cairo-Dock project
4
* Copyright : (C) see the 'copyright' file.
5
* E-mail : see the 'copyright' file.
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.
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/>.
21
#ifndef __CD_APPLET_STRUCT__
22
#define __CD_APPLET_STRUCT__
24
#include <cairo-dock.h>
26
#define CD_NETSPEED_NB_MAX_VALUES 2
30
WIFI_QUALITY_NO_SIGNAL = 0,
31
WIFI_QUALITY_VERY_LOW,
35
WIFI_QUALITY_EXCELLENT,
39
} CDConnectionQuality;
44
WIFI_EFFECT_TRANSPARENCY,
56
typedef struct _CDRenderer {
57
CDRenderType iRenderType;
61
CairoDockTypeGraph iGraphType;
67
gchar *cUserImage[CONNECTION_NB_QUALITY];
70
struct _AppletConfig {
72
gchar *cWifiConfigCommand;
75
gboolean bModeWifi; // TRUE pour l'affichage Wifi, FALSE pour l'affichage Netspeed.
76
gchar *cInterface; // interface (eth0, etc) a surveiller
78
gchar *cSysMonitorCommand; // command pour ouvrir un moniteur systeme.
79
gchar *cAnimation; // animation de connexion.
81
gdouble fSmoothFactor;
83
gint iWifiCheckInterval;
84
CDRenderer wifiRenderer;
87
gint iNetspeedCheckInterval;
88
CDRenderer netSpeedRenderer;
92
typedef struct _CDNetSpeed {
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;
106
typedef struct _CDWifi {
109
CDConnectionQuality _iQuality, _iPreviousQuality;
110
gint _iPercent, _iPrevPercent;
111
gint _iSignalLevel, _iPrevSignalLevel;
112
gint _iPrevNoiseLevel, _iNoiseLevel;
115
gchar *_cAccessPoint;
116
// end of shared memory
117
gboolean bWirelessExt;
118
CDConnectionQuality iQuality;
122
CairoDataRenderer *pDataRenderer;
125
typedef struct _CDNetworkManager {
126
gint iPercent, iPrevPercent;
127
gchar *cActiveAccessPoint;
128
gchar *cAccessPointHwAdress;
130
gint iSpeed; // max bit rate
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;
140
CairoDataRenderer *pDataRenderer;
143
typedef struct _CDMenuItemData {
149
} CDMenuItemData; // le service name est fixe une fois pour toutes dans myData.
153
CDConnectionQuality iQuality, iPreviousQuality;
154
gint iPercent, iPrevPercent;
155
gint iSignalLevel, iPrevSignalLevel;
156
gint iPrevNoiseLevel, iNoiseLevel;
159
gint iSpeed; // max bit rate
161
gboolean bDbusConnection; // TRUE si on a trouve NM sur le bus.
163
gboolean bWirelessExt;
166
cairo_surface_t *pSurfaces[CONNECTION_NB_QUALITY];
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;
182
gchar *cActiveConnection;
187
gchar *cAccessPointHwAdress;
188
GPtrArray *pMenuAccessPoints;
189
GPtrArray *pMenuSettings;