32 #include <tdeapplication.h>
34 #include <twinmodule.h>
39 #include <tqfileinfo.h>
40 #include <tdeaction.h>
43 #include <tqpainter.h>
49 #include <tqobjectlist.h>
51 #include <tqstringlist.h>
52 #include <ksharedpixmap.h>
53 #include <tqvaluestack.h>
54 #include <dcopclient.h>
55 #include <tdepopupmenu.h>
58 #include <kiconloader.h>
59 #include <tdefiledialog.h>
63 #include <tqdatetime.h>
65 #include <tdeconfig.h>
66 #include <tdeprocess.h>
67 #include <tqdragobject.h>
69 #include "karambarootpixmap.h"
72 #include "textlabel.h"
73 #include "imagelabel.h"
77 #include "clickarea.h"
79 #include "sensorparams.h"
80 #include "memsensor.h"
81 #include "datesensor.h"
82 #include "uptimesensor.h"
83 #include "memsensor.h"
84 #include "cpusensor.h"
85 #include "gpusensor.h"
86 #include "networksensor.h"
87 #include "xmmssensor.h"
88 #include "noatunsensor.h"
89 #include "programsensor.h"
90 #include "disksensor.h"
91 #include "sensorsensor.h"
92 #include "textfilesensor.h"
95 #include "rsssensor.h"
97 #include "taskmanager.h"
98 #include "showdesktop.h"
99 #include "systemtray.h"
100 #include "themefile.h"
113 class karamba :
public TQWidget
119 karamba(TQString fn, TQString name,
bool reloading =
false,
120 int instance = -1,
bool sub_theme =
false);
121 TQObjectList *menuList;
124 const ThemeFile& theme()
const {
return m_theme; };
126 TQObjectList *meterList;
127 TQObjectList *imageList;
128 TQObjectList *clickList;
129 void setSensor(
const LineParser& lineParser, Meter* meter);
130 TQString getSensor(Meter* meter);
131 TQString findSensorFromMap(Sensor* sensor);
132 void deleteMeterFromSensors(Meter* meter);
133 Sensor* findSensorFromList(Meter* meter);
134 TDEPopupMenu* keditpop;
136 TQBitmap* widgetMask;
140 TDEProcess* currProcess;
141 bool useSmoothTransforms();
143 void changeInterval(
int interval);
144 void setWidgetUpdate(
bool wu) { widgetUpdate = wu; };
145 bool getWidgetUpdate() {
return widgetUpdate; };
146 bool hasMeter(Meter* meter) {
return meterList->containsRef(meter) > 0; };
147 char getTempUnit() {
return tempUnit; };
148 void addMenuConfigOption(TQString key, TQString name);
149 bool setMenuConfigOption(TQString key,
bool value);
150 bool readMenuConfigOption(TQString key);
151 void writeConfigData();
152 TextField* getDefaultTextProps() {
return defaultTextField; };
153 int instance()
const {
return m_instance; };
154 void setInstance(
int instance) { m_instance = instance; };
155 void closeTheme(
bool reloading =
false);
156 void keyPressed(
const TQString& s,
const Meter* meter);
158 int numberOfConfMenuItems;
162 bool isSubTheme() {
return m_sub_theme; }
164 void toggleWidgetUpdate(
bool );
166 KWinModule* kWinModule;
168 TQString incomingData;
169 TQString getIncomingData() {
return incomingData; }
170 void _setIncomingData(TQString data) { incomingData = data; }
171 void setIncomingData(TQString theme, TQString data);
173 void themeNotify(TQString theme, TQString txt);
174 void callTheme(TQString theme, TQString txt);
176 double getUpdateTime() {
return update_time; }
177 void setUpdateTime(
double time) { update_time = time; }
182 void showMenuExtension();
183 void hideMenuExtension();
186 void mousePressEvent( TQMouseEvent *);
187 void wheelEvent( TQWheelEvent *);
188 void mouseReleaseEvent( TQMouseEvent *);
189 void mouseDoubleClickEvent( TQMouseEvent *);
190 void mouseMoveEvent( TQMouseEvent *);
191 void keyPressEvent ( TQKeyEvent * e );
192 void closeEvent ( TQCloseEvent *);
193 void paintEvent ( TQPaintEvent *);
194 void saveProperties(TDEConfig *);
195 void readProperties(TDEConfig *);
196 void dragEnterEvent(TQDragEnterEvent* event);
197 void dropEvent(TQDropEvent* event);
201 bool repaintInProgress;
203 bool want_right_button;
204 bool want_meter_wheel_event;
217 void passClick( TQMouseEvent* );
218 void passWheelClick( TQWheelEvent* );
219 void meterClicked(TQMouseEvent*, Meter*);
221 TQMap<TQString, Sensor*> sensorMap;
222 TQObjectList *sensorList;
223 TQObjectList *timeList;
229 TDEPopupMenu* themeConfMenu;
230 TDEPopupMenu* toDesktopMenu;
231 TDEPopupMenu* kglobal;
241 TDEActionCollection* accColl;
242 TDEActionCollection* menuAccColl;
243 TDEToggleAction *toggleLocked;
245 TDEToggleAction *toggleFastTransforms;
248 KarambaPython* pythonIface;
254 int trayMenuSeperatorId;
256 int trayMenuToggleId;
264 void updateSensors();
265 void currentDesktopChanged(
int);
266 void currentWallpaperChanged(
int);
267 void slotToggleConfigOption(TQString key,
bool);
268 void updateBackground(TDESharedPixmap*);
269 void passMenuOptionChanged(TQString key,
bool);
270 void passMenuItemClicked(
int);
271 void processExited (TDEProcess *proc);
272 void receivedStdout (TDEProcess *proc,
char *buffer,
int buflen);
273 void toDesktop(
int desktopid,
int menuid);
274 const char *getPrettyName() {
return prettyName.ascii(); }
277 void systrayUpdated();
283 void taskAdded(
Task*);
284 void taskRemoved(
Task*);
285 void activeTaskChanged(
Task*);
288 void setAlwaysOnTop(
bool stay);
294 void setWantRightButton(
bool yesno) { want_right_button = yesno; }
296 void setWantMeterWheelEvent(
bool yesno) { want_meter_wheel_event = yesno; }
301 void management_popup(
void );
310 void initPythonInterface();
314 void slotToggleLocked();
315 void slotToggleFastTransforms();
316 void popupNotify(
int);
317 void slotFileChanged(
const TQString & );
319 void slotToggleSystemTray();
321 void slotShowTheme();
328 class DesktopChangeSlot :
public TQObject
334 DesktopChangeSlot(TQObject *parent,
int desktop_id);
337 void setMenuId(
int id);
355 SignalBridge(TQObject* parent, TQString, TDEActionCollection*);
358 void enabled(TQString,
bool);
364 TDEActionCollection* collection;
367 #endif // _KARAMBA_H_