superkaramba
karamba_python.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef KARAMBA_PYTHON_H
00026 #define KARAMBA_PYTHON_H
00027
00028 class TQString;
00029 class TDEPopupMenu;
00030 class Task;
00031 class Startup;
00032 class karamba;
00033 class Meter;
00034 struct _object;
00035 typedef struct _object PyObject;
00036 struct _ts;
00037 typedef struct _ts PyThreadState;
00038 class ThemeFile;
00039
00040 class KarambaPython
00041 {
00042 protected:
00043 bool pythonThemeExtensionLoaded;
00044 PyObject *pName, *pModule;
00045 PyObject *pDict;
00046 static PyThreadState* mainThreadState;
00047
00048 void getLock(PyThreadState** myThreadState);
00049 PyObject* getFunc(const char* function);
00050 void releaseLock(PyThreadState* myThreadState);
00051 bool callObject(const char* func, PyObject* pArgs, bool lock=true);
00052
00053 public:
00054 KarambaPython(const ThemeFile& theme, bool reloading);
00055 ~KarambaPython();
00056
00057 static void initPython();
00058 static void shutdownPython();
00059
00060 bool isExtensionLoaded() { return pythonThemeExtensionLoaded; };
00061 bool initWidget(karamba* k);
00062 bool widgetUpdated(karamba* k);
00063 bool widgetClosed(karamba* k);
00064 bool menuOptionChanged(karamba* k, TQString key, bool value);
00065 bool meterClicked(karamba* k, Meter* meter, int button);
00066 bool meterClicked(karamba* k, TQString anchor, int button);
00067 bool widgetClicked(karamba* k, int x, int y, int button);
00068 bool keyPressed(karamba* k, const Meter* meter, const TQString& text);
00069 bool widgetMouseMoved(karamba* k, int x, int y, int button);
00070 bool menuItemClicked(karamba* k, TDEPopupMenu* menu, long id);
00071 bool activeTaskChanged(karamba* k, Task* t);
00072 bool taskAdded(karamba* k, Task* t);
00073 bool taskRemoved(karamba* k, Task* t);
00074 bool startupAdded(karamba* k, Startup* t);
00075 bool startupRemoved(karamba* k, Startup* t);
00076 bool commandOutput(karamba* k, int pid, char *buffer);
00077 bool commandFinished(karamba* k, int pid);
00078 bool itemDropped(karamba* k, TQString text, int x, int y);
00079 bool themeNotify(karamba* k, const char *from, const char *txt);
00080 bool systrayUpdated(karamba* k);
00081 bool desktopChanged(karamba* k, int desktop);
00082 bool wallpaperChanged(karamba* k, int desktop);
00083 };
00084
00085 #endif // KARAMBA_PYTHON_H