33#include "meter_python.h"
34#include "systray_python.h"
36long moveSystray(
long widget,
long x,
long y,
long w,
long h)
38 karamba* currTheme = (karamba*)widget;
40 if (currTheme->systray != 0) {
41 currTheme->systray->move((
int)x,(int)y);
42 currTheme->systray->setMinimumSize((
int)w,(int)h);
43 currTheme->systray->layoutSystray();
44 currTheme->systray->show();
49PyObject* py_move_systray(PyObject *, PyObject *args)
51 long widget, x, y, w, h;
52 if (!PyArg_ParseTuple(args, (
char*)
"lllll:moveSystray", &widget, &x, &y, &w, &h))
54 if (!checkKaramba(widget))
56 return Py_BuildValue((
char*)
"l", moveSystray(widget, x, y, w, h));
60long showSystray(
long widget)
62 karamba* currTheme = (karamba*)widget;
64 if (currTheme->systray != 0)
66 currTheme->systray->show();
71PyObject* py_show_systray(PyObject *, PyObject *args)
74 if (!PyArg_ParseTuple(args, (
char*)
"l:showSystray", &widget))
76 if (!checkKaramba(widget))
78 return Py_BuildValue((
char*)
"l", showSystray(widget));
82long hideSystray(
long widget)
84 karamba* currTheme = (karamba*)widget;
86 if (currTheme->systray != 0)
88 currTheme->systray->hide();
93PyObject* py_hide_systray(PyObject *, PyObject *args)
96 if (!PyArg_ParseTuple(args, (
char*)
"l:hideSystray", &widget))
98 if (!checkKaramba(widget))
100 return Py_BuildValue((
char*)
"l", hideSystray(widget));
104long createSystray(
long widget,
long x,
long y,
long w,
long h)
106 karamba* currTheme = (karamba*)widget;
109 if (currTheme->systray == 0) {
110 currTheme->systray =
new Systemtray(currTheme);
111 currTheme->systray->move((
int)x,(
int)y);
112 currTheme->systray->setMinimumSize((
int)w,(
int)h);
113 currTheme->systray->initSystray();
114 TQObject::connect(currTheme->systray,TQ_SIGNAL(updated()),
115 currTheme,TQ_SLOT(systrayUpdated()));
116 currTheme->systray->show();
122PyObject* py_create_systray(PyObject *, PyObject *args)
124 long widget, x, y, w, h;
125 if (!PyArg_ParseTuple(args, (
char*)
"lllll:createSystray", &widget, &x, &y, &w, &h))
127 if (!checkKaramba(widget))
129 return Py_BuildValue((
char*)
"l", createSystray(widget, x, y, w, h));
133long getCurrentWindowCount(
long widget)
135 karamba* currTheme = (karamba*)widget;
140 if (currTheme->systray != 0)
142 num = currTheme->systray->getCurrentWindowCount();
147PyObject* py_get_current_window_count(PyObject *, PyObject *args)
150 if (!PyArg_ParseTuple(args, (
char*)
"l:getCurrentWindowCount", &widget ))
152 if (!checkKaramba(widget))
154 return Py_BuildValue((
char*)
"l", getCurrentWindowCount(widget));
158long updateSystrayLayout(
long widget)
160 karamba* currTheme = (karamba*)widget;
162 if (currTheme->systray != 0)
164 currTheme->systray->layoutSystray();
169PyObject* py_update_systray_layout(PyObject *, PyObject *args)
172 if (!PyArg_ParseTuple(args, (
char*)
"l:updateSystrayLayout", &widget ))
174 if (!checkKaramba(widget))
176 return Py_BuildValue((
char*)
"l", updateSystrayLayout(widget));
180int getSystraySize(
long widget) {
181 karamba* currTheme = (karamba*)widget;
182 if(currTheme->systray == 0) {
185 return currTheme->systray->getTraySize();
190PyObject* py_get_systray_size(PyObject*, PyObject* args)
194 if (!PyArg_ParseTuple(args,
"l:getSystraySize", &widget))
197 return Py_BuildValue(
"l", getSystraySize(widget));