summaryrefslogtreecommitdiffstats
path: root/superkaramba/src/bar_python.h
blob: 0d5d428b6ffa70ec84c6f90624fdbae8ac7e32a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
/****************************************************************************
*  bar_python.cpp  -  Functions for bar python api
*
*  Copyright (c) 2004 Petri Damstén <damu@iki.fi>
*
*  This file is part of SuperKaramba.
*
*  SuperKaramba is free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  SuperKaramba is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with SuperKaramba; if not, write to the Free Software
*  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
****************************************************************************/

#ifndef BAR_PYTHON_H
#define BAR_PYTHON_H

/** Bar/createBar
*
* SYNOPSIS
*   long createBar(widget, x, y, w, h, image)
* DESCRIPTION
*   This creates a bar at x,y with width and height w,h.
* ARGUMENTS
*   * long widget -- karamba
*   * long x -- x coordinate
*   * long y -- y coordinate
*   * long w -- width
*   * long h -- height
*   * string image -- Path to image
* RETURN VALUE
*   Pointer to new bar meter
*/
PyObject* py_createBar(PyObject *self, PyObject *args);

/** Bar/deleteBar
*
* SYNOPSIS
*   long deleteBar(widget, bar)
* DESCRIPTION
*   This deletes bar.
* ARGUMENTS
*   * long widget -- karamba
*   * long widget -- bar
* RETURN VALUE
*   1 if successful
*/
PyObject* py_deleteBar(PyObject *self, PyObject *args);

/** Bar/getThemeBar
*
* SYNOPSIS
*   long getThemeBar(widget, name)
* DESCRIPTION
*   You can reference bar in your python code that was created in the
*   theme file. Basically, you just add a NAME= value to the BAR line in
*   the .theme file. Then if you want to use that object, instead of calling
*   createBar, you can call this function.
*
*   The name you pass to the function is the same one that you gave it for
*   the NAME= parameter in the .theme file.
* ARGUMENTS
*   * long widget -- karamba
*   * string name -- name of the bar to get
* RETURN VALUE
*   Pointer to bar
*/
PyObject* py_getThemeBar(PyObject *self, PyObject *args);

/** Bar/getBarSize
*
* SYNOPSIS
*   tuple getBarSize(widget, bar)
* DESCRIPTION
*   Given a reference to a bar object, this will return a tuple
*   containing the height and width of a bar object.
* ARGUMENTS
*   * long widget -- karamba
*   * long bar -- pointer to bar
* RETURN VALUE
*   size
*/
PyObject* py_getBarSize(PyObject *self, PyObject *args);

/** Bar/resizeBar
*
* SYNOPSIS
*   long resizeBar(widget, bar, w, h)
* DESCRIPTION
*   This will resize bar to new height and width.
* ARGUMENTS
*   * long widget -- karamba
*   * long bar -- pointer to bar
*   * long w -- new width
*   * long h -- new height
* RETURN VALUE
*   1 if successful
*/
PyObject* py_resizeBar(PyObject *self, PyObject *args);

/** Bar/getBarPos
*
* SYNOPSIS
*   tuple getBarPos(widget, bar)
* DESCRIPTION
*   Given a reference to a bar object, this will return a tuple
*   containing the x and y coordinate of a bar object.
* ARGUMENTS
*   * long widget -- karamba
*   * long bar -- pointer to bar
* RETURN VALUE
*   pos
*/
PyObject* py_getBarPos(PyObject *self, PyObject *args);

/** Bar/moveBar
*
* SYNOPSIS
*   long moveBar(widget, bar, x, y)
* DESCRIPTION
*   This will move bar to new x and y coordinates.
* ARGUMENTS
*   * long widget -- karamba
*   * long bar -- pointer to bar
*   * long x -- x coordinate
*   * long y -- y coordinate
* RETURN VALUE
*   1 if successful
*/
PyObject* py_moveBar(PyObject *self, PyObject *args);

/** Bar/hideBar
*
* SYNOPSIS
*   long hideBar(widget, bar)
* DESCRIPTION
*   This hides an bar. In other words, during subsequent calls to
*   widgetUpdate(), this bar will not be drawn.
* ARGUMENTS
*   * long widget -- karamba
*   * long bar -- pointer to bar
* RETURN VALUE
*   1 if successful
*/
PyObject* py_hideBar(PyObject *self, PyObject *args);

/** Bar/showBar
*
* SYNOPSIS
*   long showBar(widget, bar)
* DESCRIPTION
*   This shows an bar. In other words, during subsequent calls to
*   widgetUpdate(), this bar will be drawn.
* ARGUMENTS
*   * long widget -- karamba
*   * long bar -- pointer to bar
* RETURN VALUE
*   1 if successful
*/
PyObject* py_showBar(PyObject *self, PyObject *args);

/** Bar/getBarValue
*
* SYNOPSIS
*   long getBarValue(widget, bar)
* DESCRIPTION
*   Returns current bar value.
* ARGUMENTS
*   * long widget -- karamba
*   * long bar -- pointer to bar
* RETURN VALUE
*   value
*/
PyObject* py_getBarValue(PyObject *self, PyObject *args);

/** Bar/setBarValue
*
* SYNOPSIS
*   long setBarValue(widget, bar, value)
* DESCRIPTION
*   Sets current bar value.
* ARGUMENTS
*   * long widget -- karamba
*   * long bar -- pointer to bar
*   * long value -- new value
* RETURN VALUE
*   1 if successful
*/
PyObject* py_setBarValue(PyObject *self, PyObject *args);

/** Bar/getBarMinMax
*
* SYNOPSIS
*   tuple getBarMinMax(widget, bar)
* DESCRIPTION
*   Returns current bar value.
* ARGUMENTS
*   * long widget -- karamba
*   * long bar -- pointer to bar
* RETURN VALUE
*   min & max
*/
PyObject* py_getBarMinMax(PyObject *self, PyObject *args);

/** Bar/setBarMinMax
*
* SYNOPSIS
*   long setBarMinMax(widget, bar, min, max)
* DESCRIPTION
*   Returns current bar value.
* ARGUMENTS
*   * long widget -- karamba
*   * long bar -- pointer to bar
*   * long min -- min value
*   * long max -- max value
* RETURN VALUE
*   1 if successful
*/
PyObject* py_setBarMinMax(PyObject *self, PyObject *args);

/** Bar/getBarSensor
*
* SYNOPSIS
*   string getBarSensor(widget, bar)
* DESCRIPTION
*   Get current sensor string
* ARGUMENTS
*   * long widget -- karamba
*   * long bar -- pointer to bar
* RETURN VALUE
*   sensor string
*/
PyObject* py_getBarSensor(PyObject *self, PyObject *args);

/** Bar/setBarSensor
*
* SYNOPSIS
*   long setBarSensor(widget, bar, sensor)
* DESCRIPTION
*   Get current sensor string
* ARGUMENTS
*   * long widget -- karamba
*   * long bar -- pointer to bar
*   * string sensor -- new sensor as in theme files
* RETURN VALUE
*   1 if successful
*/
PyObject* py_setBarSensor(PyObject *self, PyObject *args);

/** Bar/getBarImage
*
* SYNOPSIS
*   string getBarImage(widget, bar)
* DESCRIPTION
*   Get bar image
* ARGUMENTS
*   * long widget -- karamba
*   * long bar -- pointer to bar
* RETURN VALUE
*   path to bar image
*/
PyObject* py_getBarImage(PyObject *self, PyObject *args);

/** Bar/setBarImage
*
* SYNOPSIS
*   long setBarImage(widget, bar, image)
* DESCRIPTION
*   Get bar image
* ARGUMENTS
*   * long widget -- karamba
*   * long bar -- pointer to bar
*   * string image -- new image
* RETURN VALUE
*   1 if successful
*/
PyObject* py_setBarImage(PyObject *self, PyObject *args);

/** Bar/getBarVertical
*
* SYNOPSIS
*   string getBarVertical(widget, bar)
* DESCRIPTION
*   Check if bar is vertical bar
* ARGUMENTS
*   * long widget -- karamba
*   * long bar -- pointer to bar
* RETURN VALUE
*   1 if vertical
*/
PyObject* py_getBarVertical(PyObject *self, PyObject *args);

/** Bar/setBarVertical
*
* SYNOPSIS
*   long setBarVertical(widget, bar)
* DESCRIPTION
*   Set bar vertical
* ARGUMENTS
*   * long widget -- karamba
*   * long bar -- pointer to bar
*   * long vertical -- 1 if vertical
* RETURN VALUE
*   1 if successful
*/
PyObject* py_setBarVertical(PyObject *self, PyObject *args);

#endif // BAR_PYTHON_H