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
|
/****************************************************************************
* graph_python.cpp - Functions for graph python api
*
* Copyright (c) 2004 Petri Damst�n <[email protected]>
*
* 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 GRAPH_PYTHON_H
#define GRAPH_PYTHON_H
/** Graph/createGraph
*
* SYNOPSIS
* long createGraph(widget, x, y, w, h, points)
* DESCRIPTION
* This creates a graph 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
* * long points -- Number of points in graph
* RETURN VALUE
* Pointer to new graph meter
*/
PyObject* py_createGraph(PyObject *self, PyObject *args);
/** Graph/deleteGraph
*
* SYNOPSIS
* long deleteGraph(widget, graph)
* DESCRIPTION
* This deletes graph.
* ARGUMENTS
* * long widget -- karamba
* * long widget -- graph
* RETURN VALUE
* 1 if successful
*/
PyObject* py_deleteGraph(PyObject *self, PyObject *args);
/** Graph/getThemeGraph
*
* SYNOPSIS
* long getThemeGraph(widget, name)
* DESCRIPTION
* You can reference graph in your python code that was created in the
* theme file. Basically, you just add a NAME= value to the GRAPH line in
* the .theme file. Then if you want to use that object, instead of calling
* createGraph, 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 graph to get
* RETURN VALUE
* Pointer to graph
*/
PyObject* py_getThemeGraph(PyObject *self, PyObject *args);
/** Graph/getGraphSize
*
* SYNOPSIS
* tuple getGraphSize(widget, graph)
* DESCRIPTION
* Given a reference to a graph object, this will return a tuple
* containing the height and width of a graph object.
* ARGUMENTS
* * long widget -- karamba
* * long graph -- pointer to graph
* RETURN VALUE
* size
*/
PyObject* py_getGraphSize(PyObject *self, PyObject *args);
/** Graph/resizeGraph
*
* SYNOPSIS
* long resizeGraph(widget, graph, w, h)
* DESCRIPTION
* This will resize graph to new height and width.
* ARGUMENTS
* * long widget -- karamba
* * long graph -- pointer to graph
* * long w -- new width
* * long h -- new height
* RETURN VALUE
* 1 if successful
*/
PyObject* py_resizeGraph(PyObject *self, PyObject *args);
/** Graph/getGraphPos
*
* SYNOPSIS
* tuple getGraphPos(widget, graph)
* DESCRIPTION
* Given a reference to a graph object, this will return a tuple
* containing the x and y coordinate of a graph object.
* ARGUMENTS
* * long widget -- karamba
* * long graph -- pointer to graph
* RETURN VALUE
* pos
*/
PyObject* py_getGraphPos(PyObject *self, PyObject *args);
/** Graph/moveGraph
*
* SYNOPSIS
* long moveGraph(widget, graph, x, y)
* DESCRIPTION
* This will move graph to new x and y coordinates.
* ARGUMENTS
* * long widget -- karamba
* * long graph -- pointer to graph
* * long x -- x coordinate
* * long y -- y coordinate
* RETURN VALUE
* 1 if successful
*/
PyObject* py_moveGraph(PyObject *self, PyObject *args);
/** Graph/hideGraph
*
* SYNOPSIS
* long hideGraph(widget, graph)
* DESCRIPTION
* This hides an graph. In other words, during subsequent calls to
* widgetUpdate(), this graph will not be drawn.
* ARGUMENTS
* * long widget -- karamba
* * long graph -- pointer to graph
* RETURN VALUE
* 1 if successful
*/
PyObject* py_hideGraph(PyObject *self, PyObject *args);
/** Graph/showGraph
*
* SYNOPSIS
* long showGraph(widget, graph)
* DESCRIPTION
* This shows an graph. In other words, during subsequent calls to
* widgetUpdate(), this graph will be drawn.
* ARGUMENTS
* * long widget -- karamba
* * long graph -- pointer to graph
* RETURN VALUE
* 1 if successful
*/
PyObject* py_showGraph(PyObject *self, PyObject *args);
/** Graph/getGraphValue
*
* SYNOPSIS
* long getGraphValue(widget, graph)
* DESCRIPTION
* Returns current graph value.
* ARGUMENTS
* * long widget -- karamba
* * long graph -- pointer to graph
* RETURN VALUE
* value
*/
PyObject* py_getGraphValue(PyObject *self, PyObject *args);
/** Graph/setGraphValue
*
* SYNOPSIS
* long setGraphValue(widget, graph, value)
* DESCRIPTION
* Sets current graph value.
* ARGUMENTS
* * long widget -- karamba
* * long graph -- pointer to graph
* * long value -- new value
* RETURN VALUE
* 1 if successful
*/
PyObject* py_setGraphValue(PyObject *self, PyObject *args);
/** Graph/getGraphMinMax
*
* SYNOPSIS
* tuple getGraphMinMax(widget, graph)
* DESCRIPTION
* Returns current graph value.
* ARGUMENTS
* * long widget -- karamba
* * long graph -- pointer to graph
* RETURN VALUE
* min & max
*/
PyObject* py_getGraphMinMax(PyObject *self, PyObject *args);
/** Graph/setGraphMinMax
*
* SYNOPSIS
* long setGraphMinMax(widget, graph, min, max)
* DESCRIPTION
* Returns current graph value.
* ARGUMENTS
* * long widget -- karamba
* * long graph -- pointer to graph
* * long min -- min value
* * long max -- max value
* RETURN VALUE
* 1 if successful
*/
PyObject* py_setGraphMinMax(PyObject *self, PyObject *args);
/** Graph/getGraphSensor
*
* SYNOPSIS
* string getGraphSensor(widget, graph)
* DESCRIPTION
* Get current sensor string
* ARGUMENTS
* * long widget -- karamba
* * long graph -- pointer to graph
* RETURN VALUE
* sensor string
*/
PyObject* py_getGraphSensor(PyObject *self, PyObject *args);
/** Graph/setGraphSensor
*
* SYNOPSIS
* long setGraphSensor(widget, graph, sensor)
* DESCRIPTION
* Get current sensor string
* ARGUMENTS
* * long widget -- karamba
* * long graph -- pointer to graph
* * string sensor -- new sensor as in theme files
* RETURN VALUE
* 1 if successful
*/
PyObject* py_setGraphSensor(PyObject *self, PyObject *args);
/** Graph/getGraphColor
*
* SYNOPSIS
* tuple getGraphColor(widget, graph)
* DESCRIPTION
* Get current graph color
* ARGUMENTS
* * long widget -- karamba
* * long graph -- pointer to graph
* RETURN VALUE
* (red, green, blue)
*/
PyObject* py_getGraphColor(PyObject *self, PyObject *args);
/** Graph/setGraphColor
*
* SYNOPSIS
* tuple setGraphColor(widget, graph, red, green, blue)
* DESCRIPTION
* Set current graph color
* ARGUMENTS
* * long widget -- karamba
* * long graph -- pointer to graph
* * long red -- red component of color
* * long green -- green component of color
* * long blue -- blue component of color
* RETURN VALUE
* 1 if successful
*/
PyObject* py_setGraphColor(PyObject *self, PyObject *args);
#endif // GRAPH_PYTHON_H
|