00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifdef _XOPEN_SOURCE
00024 #undef _XOPEN_SOURCE
00025 #endif
00026
00027 #include <Python.h>
00028 #include <qobject.h>
00029 #include "../karamba.h"
00030 #include "meters/meter.h"
00031 #include "python/meter.h"
00032 #include "meters/graph.h"
00033 #include "python/graph.h"
00034
00035 PyObject* py_createGraph(PyObject *, PyObject *args)
00036 {
00037 long widget, x, y, w, h, points;
00038
00039 if (!PyArg_ParseTuple(args, (char*)"llllll", &widget, &x, &y, &w, &h, &points))
00040 return NULL;
00041 if (!checkKaramba(widget))
00042 return NULL;
00043
00044 Graph *tmp =
00045 new Graph((Karamba*)widget, (int)x, (int)y, (int)w, (int)h, (int)points);
00046 ((Karamba*)widget)->addToGroup(tmp);
00047 return (Py_BuildValue((char*)"l", (long)tmp));
00048 }
00049
00050 PyObject* py_deleteGraph(PyObject *, PyObject *args)
00051 {
00052 long widget, meter;
00053 if (!PyArg_ParseTuple(args, (char*)"ll", &widget, &meter))
00054 return NULL;
00055 if (!checkKarambaAndMeter(widget, meter, "Graph"))
00056 return NULL;
00057
00058 ((Karamba*)widget)->deleteMeterFromSensors((Meter*)meter);
00059 return Py_BuildValue((char*)"l",
00060 ((Karamba*)widget)->removeMeter((Meter*)meter));
00061 }
00062
00063 PyObject* py_getThemeGraph(PyObject *self, PyObject *args)
00064 {
00065 return py_getThemeMeter(self, args, "Graph");
00066 }
00067
00068 PyObject* py_getGraphSize(PyObject *self, PyObject *args)
00069 {
00070 return py_getSize(self, args, "Graph");
00071 }
00072
00073 PyObject* py_resizeGraph(PyObject *self, PyObject *args)
00074 {
00075 return py_resize(self, args, "Graph");
00076 }
00077
00078 PyObject* py_getGraphPos(PyObject *self, PyObject *args)
00079 {
00080 return py_getPos(self, args, "Graph");
00081 }
00082
00083 PyObject* py_moveGraph(PyObject *self, PyObject *args)
00084 {
00085 return py_move(self, args, "Graph");
00086 }
00087
00088 PyObject* py_hideGraph(PyObject *self, PyObject *args)
00089 {
00090 return py_hide(self, args, "Graph");
00091 }
00092
00093 PyObject* py_showGraph(PyObject *self, PyObject *args)
00094 {
00095 return py_show(self, args, "Graph");
00096 }
00097
00098 PyObject* py_getGraphMinMax(PyObject *self, PyObject *args)
00099 {
00100 return py_getMinMax(self, args, "Graph");
00101 }
00102
00103 PyObject* py_setGraphMinMax(PyObject *self, PyObject *args)
00104 {
00105 return py_setMinMax(self, args, "Graph");
00106 }
00107
00108 PyObject* py_getGraphValue(PyObject *self, PyObject *args)
00109 {
00110 return py_getValue(self, args, "Graph");
00111 }
00112
00113 PyObject* py_setGraphValue(PyObject *self, PyObject *args)
00114 {
00115 return py_setValue(self, args, "Graph");
00116 }
00117
00118 PyObject* py_getGraphSensor(PyObject *self, PyObject *args)
00119 {
00120 return py_getSensor(self, args, "Graph");
00121 }
00122
00123 PyObject* py_setGraphSensor(PyObject *self, PyObject *args)
00124 {
00125 return py_setSensor(self, args, "Graph");
00126 }
00127
00128 PyObject* py_getGraphColor(PyObject *self, PyObject *args)
00129 {
00130 return py_getColor(self, args, "Graph");
00131 }
00132
00133 PyObject* py_setGraphColor(PyObject *self, PyObject *args)
00134 {
00135 return py_setColor(self, args, "Graph");
00136 }
00137
00138