• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeutils API Reference
  • KDE Home
  • Contact Us
 

superkaramba

  • sources
  • kde-4.12
  • kdeutils
  • superkaramba
  • src
  • python
systray.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 * systray_python.h - Functions for systray python api
3 *
4 * Copyright (C) 2003 Hans Karlsson <karlsson.h@home.se>
5 * Copyright (C) 2003-2004 Adam Geitgey <adam@rootnode.org>
6 * Copyright (c) 2004 Petri Damstén <damu@iki.fi>
7 *
8 * This file is part of SuperKaramba.
9 *
10 * SuperKaramba is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * SuperKaramba is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with SuperKaramba; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 ****************************************************************************/
24 
25 #if defined(_XOPEN_SOURCE) && !defined(__SUNPRO_CC)
26 #undef _XOPEN_SOURCE
27 #endif
28 
29 #include "python/systray.h"
30 
31 #include <Python.h>
32 #include <QObject>
33 #include "../karamba.h"
34 #include "../meters/meter.h"
35 #include "python/meter.h"
36 
37 #include <KDebug>
38 
39 #if 0
40 long moveSystray(long widget, long x, long y, long w, long h)
41 {
42  Karamba* currTheme = (Karamba*)widget;
43 
44  if (currTheme->systemTray() != 0) {
45  currTheme->systemTray()->move((int)x, (int)y);
46  currTheme->systemTray()->setMinimumSize((int)w, (int)h);
47  currTheme->systemTray()->layoutsystemTray();
48  currTheme->systemTray()->show();
49  }
50  return 1;
51 }
52 #endif
53 
54 PyObject* py_move_systray(PyObject *, PyObject *args)
55 {
56  Q_UNUSED(args);
57 
58  static bool firstMessage = false;
59 
60  if (!firstMessage) {
61  kWarning() << "Call to \"moveSystray\" not available in this version of SuperKaramba" ;
62  firstMessage = true;
63  }
64 
65  return 0;
66 
67 #if 0
68  long widget, x, y, w, h;
69  if (!PyArg_ParseTuple(args, (char*)"lllll:moveSystray", &widget, &x, &y, &w, &h))
70  return NULL;
71  if (!checkKaramba(widget))
72  return NULL;
73  return Py_BuildValue((char*)"l", moveSystray(widget, x, y, w, h));
74 #endif
75 }
76 
77 /* now a method we need to expose to Python */
78 #if 0
79 long showSystray(long widget)
80 {
81  Karamba* currTheme = (Karamba*)widget;
82 
83  if (currTheme->systemTray() != 0) {
84  currTheme->systemTray()->show();
85  }
86  return 1;
87 }
88 #endif
89 
90 PyObject* py_show_systray(PyObject *, PyObject *args)
91 {
92  Q_UNUSED(args);
93 
94  static bool firstMessage = false;
95 
96  if (!firstMessage) {
97  kWarning() << "Call to \"moveSystray\" not available in this version of SuperKaramba" ;
98  firstMessage = true;
99  }
100 
101  return 0;
102 
103 #if 0
104  long widget;
105  if (!PyArg_ParseTuple(args, (char*)"l:showSystray", &widget))
106  return NULL;
107  if (!checkKaramba(widget))
108  return NULL;
109  return Py_BuildValue((char*)"l", showSystray(widget));
110 #endif
111 }
112 
113 /* now a method we need to expose to Python */
114 #if 0
115 long hideSystray(long widget)
116 {
117  Karamba* currTheme = (Karamba*)widget;
118 
119  if (currTheme->systemTray() != 0) {
120  currTheme->systemTray()->hide();
121  }
122  return 1;
123 }
124 #endif
125 
126 PyObject* py_hide_systray(PyObject *, PyObject *args)
127 {
128  Q_UNUSED(args);
129 
130  static bool firstMessage = false;
131 
132  if (!firstMessage) {
133  kWarning() << "Call to \"moveSystray\" not available in this version of SuperKaramba" ;
134  firstMessage = true;
135  }
136 
137  return 0;
138 
139 #if 0
140  long widget;
141  if (!PyArg_ParseTuple(args, (char*)"l:hideSystray", &widget))
142  return NULL;
143  if (!checkKaramba(widget))
144  return NULL;
145  return Py_BuildValue((char*)"l", hideSystray(widget));
146 #endif
147 }
148 
149 /* now a method we need to expose to Python */
150 #if 0
151 long createSystray(long widget, long x, long y, long w, long h)
152 {
153  Karamba* currTheme = (Karamba*)widget;
154 
155  //Don't create more than one systray
156  if (currTheme->systemTray() == 0) {
157  currTheme->systemTray() = new Systemtray(currTheme);
158  currTheme->systemTray()->move((int)x, (int)y);
159  currTheme->systemTray()->setMinimumSize((int)w, (int)h);
160  currTheme->systemTray()->initsystemTray();
161  QObject::connect(currTheme->systemTray(), SIGNAL(updated()),
162  currTheme, SLOT(systrayUpdated()));
163  currTheme->systemTray()->show();
164  }
165 
166  return 1;
167 }
168 #endif
169 
170 PyObject* py_create_systray(PyObject *, PyObject *args)
171 {
172  Q_UNUSED(args);
173 
174  static bool firstMessage = false;
175 
176  if (!firstMessage) {
177  kWarning() << "Call to \"moveSystray\" not available in this version of SuperKaramba" ;
178  firstMessage = true;
179  }
180 
181  return 0;
182 
183 #if 0
184  long widget, x, y, w, h;
185  if (!PyArg_ParseTuple(args, (char*)"lllll:createSystray", &widget, &x, &y, &w, &h))
186  return NULL;
187  if (!checkKaramba(widget))
188  return NULL;
189  return Py_BuildValue((char*)"l", createSystray(widget, x, y, w, h));
190 #endif
191 }
192 
193 /* now a method we need to expose to Python */
194 #if 0
195 long getCurrentWindowCount(long widget)
196 {
197  Karamba* currTheme = (Karamba*)widget;
198  int num;
199 
200  num = 0;
201 
202  if (currTheme->systemTray() != 0) {
203  num = currTheme->systemTray()->getCurrentWindowCount();
204  }
205  return num;
206 }
207 #endif
208 
209 PyObject* py_get_current_window_count(PyObject *, PyObject *args)
210 {
211  Q_UNUSED(args);
212 
213  static bool firstMessage = false;
214 
215  if (!firstMessage) {
216  kWarning() << "Call to \"moveSystray\" not available in this version of SuperKaramba" ;
217  firstMessage = true;
218  }
219 
220  return 0;
221 
222 #if 0
223  long widget;
224  if (!PyArg_ParseTuple(args, (char*)"l:getCurrentWindowCount", &widget))
225  return NULL;
226  if (!checkKaramba(widget))
227  return NULL;
228  return Py_BuildValue((char*)"l", getCurrentWindowCount(widget));
229 #endif
230 }
231 
232 /* now a method we need to expose to Python */
233 #if 0
234 long updateSystrayLayout(long widget)
235 {
236  Karamba* currTheme = (Karamba*)widget;
237 
238  if (currTheme->systemTray() != 0) {
239  currTheme->systemTray()->layoutsystemTray();
240  }
241  return 1;
242 }
243 #endif
244 
245 PyObject* py_update_systray_layout(PyObject *, PyObject *args)
246 {
247  Q_UNUSED(args);
248 
249  static bool firstMessage = false;
250 
251  if (!firstMessage) {
252  kWarning() << "Call to \"moveSystray\" not available in this version of SuperKaramba" ;
253  firstMessage = true;
254  }
255 
256  return 0;
257 
258 #if 0
259  long widget;
260  if (!PyArg_ParseTuple(args, (char*)"l:updateSystrayLayout", &widget))
261  return NULL;
262  if (!checkKaramba(widget))
263  return NULL;
264  return Py_BuildValue((char*)"l", updateSystrayLayout(widget));
265 #endif
266 }
267 
268 /* get the systray size from python */
269 #if 0
270 int getSystraySize(long widget)
271 {
272  Karamba* currTheme = (Karamba*)widget;
273  if (currTheme->systemTray() == 0) {
274  return 0;
275  } else {
276  return currTheme->systemTray()->getTraySize();
277  }
278 }
279 #endif
280 
281 // Returns the size of the systray
282 PyObject* py_get_systray_size(PyObject*, PyObject* args)
283 {
284  Q_UNUSED(args);
285 
286  static bool firstMessage = false;
287 
288  if (!firstMessage) {
289  kWarning() << "Call to \"moveSystray\" not available in this version of SuperKaramba" ;
290  firstMessage = true;
291  }
292 
293  return 0;
294 
295 #if 0
296  long widget;
297 
298  if (!PyArg_ParseTuple(args, "l:getSystraySize", &widget))
299  return NULL;
300 
301  return Py_BuildValue("l", getSystraySize(widget));
302 #endif
303 }
304 
PyObject
struct _object PyObject
Definition: python/karamba.h:35
meter.h
systray.h
py_create_systray
PyObject * py_create_systray(PyObject *, PyObject *args)
Systray/createSystray.
Definition: systray.cpp:170
py_get_current_window_count
PyObject * py_get_current_window_count(PyObject *, PyObject *args)
Systray/getCurrentWindowCount.
Definition: systray.cpp:209
Karamba
Definition: karamba.h:52
Systemtray::getTraySize
int getTraySize()
Definition: systemtray.cpp:50
checkKaramba
bool checkKaramba(long widget)
Definition: python/meter.cpp:26
Systemtray
Definition: systemtray.h:35
py_hide_systray
PyObject * py_hide_systray(PyObject *, PyObject *args)
Systray/hideSystray.
Definition: systray.cpp:126
Systemtray::getCurrentWindowCount
int getCurrentWindowCount()
Definition: systemtray.cpp:222
py_get_systray_size
PyObject * py_get_systray_size(PyObject *, PyObject *args)
Definition: systray.cpp:282
Karamba::systemTray
Systemtray * systemTray()
Definition: karamba.cpp:2245
py_move_systray
PyObject * py_move_systray(PyObject *, PyObject *args)
Systray/moveSystray.
Definition: systray.cpp:54
py_update_systray_layout
PyObject * py_update_systray_layout(PyObject *, PyObject *args)
Systray/updateSystrayLayout.
Definition: systray.cpp:245
py_show_systray
PyObject * py_show_systray(PyObject *, PyObject *args)
Systray/showSystray.
Definition: systray.cpp:90
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:07:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

superkaramba

Skip menu "superkaramba"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeutils API Reference

Skip menu "kdeutils API Reference"
  • ark
  • filelight
  • kcalc
  • kcharselect
  • kdf
  • kfloppy
  • kgpg
  • kremotecontrol
  • ktimer
  • kwallet
  • superkaramba
  • sweeper

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal