summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2023-01-31 23:58:07 +0900
committerMichele Calgaro <[email protected]>2023-02-02 10:58:34 +0900
commit35ce85f8c42ceb2e8c880c8dead393c192ff2585 (patch)
treedacc2d922f911aabef20aa400b695ffc4ed24188
parentcb526fe9fffad2bc95e5230048c2b51837365c33 (diff)
downloadkoffice-35ce85f8c42ceb2e8c880c8dead393c192ff2585.tar.gz
koffice-35ce85f8c42ceb2e8c880c8dead393c192ff2585.zip
Update kivio python 3 integration.
Signed-off-by: Michele Calgaro <[email protected]>
-rw-r--r--kivio/kiviopart/kiviosdk/kivio_py_stencil.cpp56
-rw-r--r--kivio/kiviopart/kiviosdk/kivio_wrap.cpp294
2 files changed, 194 insertions, 156 deletions
diff --git a/kivio/kiviopart/kiviosdk/kivio_py_stencil.cpp b/kivio/kiviopart/kiviosdk/kivio_py_stencil.cpp
index dd228934..52c966b4 100644
--- a/kivio/kiviopart/kiviosdk/kivio_py_stencil.cpp
+++ b/kivio/kiviopart/kiviosdk/kivio_py_stencil.cpp
@@ -46,7 +46,7 @@ KivioPyStencil::KivioPyStencil()
static bool first_time = true;
if ( first_time ) {
Py_Initialize(); // initialize python only once
- //kdDebug(43000) << "init kivioc" << endl;
+ //kdDebug(43000) << "init kivioc" << endl;
initkivioc();
first_time = false;
}
@@ -190,7 +190,7 @@ TQDomElement KivioPyStencil::saveXML( TQDomDocument &doc )
PyObject* gdic = PyModule_GetDict(mainmod);
PyObject *ldic = Py_BuildValue("{s:O,s:{}}", "ldic", vars ,"res");
- char *dump_code = "import copy\n"\
+ const char *dump_code = "import copy\n"\
"import pickle\n"\
"cres = {}\n"\
"for key in ldic.keys():\n"\
@@ -203,7 +203,7 @@ TQDomElement KivioPyStencil::saveXML( TQDomDocument &doc )
if ( !PyRun_String(dump_code, Py_file_input, gdic, ldic) )
PyErr_Print();
- TQString sVars = PyString_AsString( PyDict_GetItemString( ldic, "res") );
+ TQString sVars = PyBytes_AS_STRING( PyDict_GetItemString( ldic, "res") );
XmlWriteString( dE, "vars", sVars );
XmlWriteString( dE, "resizeCode", resizeCode );
@@ -361,7 +361,7 @@ KivioStencil *KivioPyStencil::duplicate()
PyObject* gdic = PyModule_GetDict(mainmod);
PyObject *ldic = Py_BuildValue("{s:O,s:{}}", "ldic", vars ,"res");
- char *copy_code = "import copy\n"\
+ const char *copy_code = "import copy\n"\
"for key in ldic.keys():\n"\
" try:\n"\
" res[key] = copy.deepcopy(ldic[key])\n"\
@@ -535,7 +535,7 @@ int KivioPyStencil::runPython(TQString code)
}
//const char *ccode = code.local8Bit().data();
- const char *ccode = code.latin1();
+ const char *ccode = code.latin1();
//kdDebug(43000) << "code to run:" << endl << ccode << endl;
@@ -546,7 +546,13 @@ int KivioPyStencil::runPython(TQString code)
return 0;
}
- if (Py_FlushLine())
+ PyObject *f = PySys_GetObject("stdout");
+ int ret = 0;
+ if (f)
+ {
+ ret = PyFile_WriteString("\n", f);
+ }
+ if (ret)
PyErr_Clear();
Py_DECREF(v);
@@ -563,8 +569,8 @@ double KivioPyStencil::getDoubleFromDict( PyObject *dict, const char *key )
if ( PyFloat_Check(val) )
return PyFloat_AsDouble( val );
- if ( PyInt_Check(val) )
- return PyInt_AsLong( val );
+ if ( PyLong_Check(val) )
+ return PyLong_AsLong( val );
if ( PyLong_Check(val) )
return PyLong_AsDouble( val );
@@ -575,8 +581,8 @@ double KivioPyStencil::getDoubleFromDict( PyObject *dict, const char *key )
TQString KivioPyStencil::getStringFromDict( PyObject *dict, const char *key )
{
PyObject *val = PyDict_GetItemString(dict,const_cast<char*>(key));
- if ( val && PyString_Check(val) )
- return TQString( PyString_AsString(val) );
+ if ( val && PyBytes_Check(val) )
+ return TQString( PyBytes_AS_STRING(val) );
return TQString("");
}
@@ -829,8 +835,8 @@ TQColor KivioPyStencil::readColor( PyObject *color )
if ( !color )
return TQColor();
- if ( PyString_Check(color) ) {
- return TQColor( PyString_AsString(color) );
+ if ( PyBytes_Check(color) ) {
+ return TQColor( PyBytes_AsString(color) );
}
if ( PyList_Check(color) ) {
@@ -841,11 +847,11 @@ TQColor KivioPyStencil::readColor( PyObject *color )
int r=0, g=0, b=0;
if ( PyNumber_Check(ro) )
- r = PyInt_AsLong( PyNumber_Int(ro));
+ r = PyLong_AsLong( PyNumber_Long(ro));
if ( PyNumber_Check(go) )
- g = PyInt_AsLong( PyNumber_Int(go));
+ g = PyLong_AsLong( PyNumber_Long(go));
if ( PyNumber_Check(bo) )
- b = PyInt_AsLong( PyNumber_Int(bo));
+ b = PyLong_AsLong( PyNumber_Long(bo));
return TQColor(r,g,b);
@@ -858,7 +864,7 @@ TQColor KivioPyStencil::readColor( PyObject *color )
void KivioPyStencil::PyDebug( PyObject * o )
{
- kdDebug(43000) << "py_debug: " << PyString_AsString(PyObject_Str(o)) << endl;
+ kdDebug(43000) << "py_debug: " << PyBytes_AsString(PyObject_Str(o)) << endl;
}
@@ -912,7 +918,7 @@ double KivioPyStencil::lineWidth()
PyObject *lw = PyDict_GetItemString( PyDict_GetItemString(vars,"style"), "linewidth" );
if ( lw )
if ( PyNumber_Check(lw) )
- return ( PyInt_AsLong( PyNumber_Int(lw)) );
+ return ( PyLong_AsLong( PyNumber_Long(lw)) );
return 1.0;
}
@@ -967,23 +973,23 @@ TQFont KivioPyStencil::textFont()
if ( fs )
if ( PyNumber_Check(fs))
- f.setPointSize( PyInt_AsLong( PyNumber_Int(fs)));
+ f.setPointSize( PyLong_AsLong( PyNumber_Long(fs)));
if ( bd )
if ( PyNumber_Check(bd))
- f.setBold( PyInt_AsLong( PyNumber_Int(bd)));
+ f.setBold( PyLong_AsLong( PyNumber_Long(bd)));
if ( it )
if ( PyNumber_Check(it))
- f.setItalic( PyInt_AsLong( PyNumber_Int(it)));
+ f.setItalic( PyLong_AsLong( PyNumber_Long(it)));
if ( ul )
if ( PyNumber_Check(ul))
- f.setUnderline( PyInt_AsLong( PyNumber_Int(ul)));
+ f.setUnderline( PyLong_AsLong( PyNumber_Long(ul)));
if ( fn )
- if ( PyString_Check(fn))
- f.setFamily( PyString_AsString(fn));
+ if ( PyBytes_Check(fn))
+ f.setFamily( PyBytes_AsString(fn));
return f;
}
@@ -994,7 +1000,7 @@ int KivioPyStencil::hTextAlign()
if ( hta )
if ( PyNumber_Check(hta) )
- return ( PyInt_AsLong( PyNumber_Int(hta)));
+ return ( PyLong_AsLong( PyNumber_Long(hta)));
return TQt::AlignHCenter;
}
@@ -1005,7 +1011,7 @@ int KivioPyStencil::vTextAlign()
if ( vta )
if ( PyNumber_Check(vta) )
- return ( PyInt_AsLong( PyNumber_Int(vta)));
+ return ( PyLong_AsLong( PyNumber_Long(vta)));
return TQt::AlignVCenter;
}
diff --git a/kivio/kiviopart/kiviosdk/kivio_wrap.cpp b/kivio/kiviopart/kiviosdk/kivio_wrap.cpp
index a3f5c289..4fa790e2 100644
--- a/kivio/kiviopart/kiviosdk/kivio_wrap.cpp
+++ b/kivio/kiviopart/kiviosdk/kivio_wrap.cpp
@@ -124,7 +124,7 @@ typedef struct swig_varlinkobject {
static PyObject *
swig_varlink_repr(swig_varlinkobject *v) {
v = v;
- return PyString_FromString("<Global variables>");
+ return PyBytes_FromString("<Global variables>");
}
static int
@@ -166,39 +166,59 @@ swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
return 1;
}
-statichere PyTypeObject varlinktype = {
- PyObject_HEAD_INIT(0)
- 0,
- "swigvarlink", /* Type name */
- sizeof(swig_varlinkobject), /* Basic size */
- 0, /* Itemsize */
- 0, /* Deallocator */
- (printfunc) swig_varlink_print, /* Print */
- (getattrfunc) swig_varlink_getattr, /* get attr */
- (setattrfunc) swig_varlink_setattr, /* Set attr */
- 0, /* tp_compare */
- (reprfunc) swig_varlink_repr, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_mapping*/
- 0, /* tp_hash */
+static PyTypeObject varlinktype = {
+ PyVarObject_HEAD_INIT(&PyType_Type, 0)
+ (char*)"swigvarlink", /* Type name */
+ sizeof(swig_varlinkobject), /* Basic size */
+ 0, /* Itemsize */
+ 0, /* Deallocator */
+#if PY_VERSION_HEX >= 0x03080000
+ 0, /* Vector call */
+#else
+ (printfunc) swig_varlink_print, /* Print */
+#endif
+ (getattrfunc) swig_varlink_getattr, /* Get attr */
+ (setattrfunc) swig_varlink_setattr, /* Set attr */
+ 0, /* tp_as_async */
+ (reprfunc) swig_varlink_repr, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ 0, /* tp_flags */
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
+ 0, /* tp_del */
+ 0, /* tp_version_tag */
+ 0, /* tp_finalize */
+#if PY_VERSION_HEX >= 0x03100000
+ 0, /* tp_vectorcall */
+#endif
};
/* Create a variable linking object for use later */
SWIGSTATICRUNTIME(PyObject *)
SWIG_newvarlink(void) {
- swig_varlinkobject *result = 0;
- result = PyMem_NEW(swig_varlinkobject,1);
- varlinktype.ob_type = &PyType_Type; /* Patch varlinktype into a PyType */
- result->ob_type = &varlinktype;
- result->vars = 0;
- result->ob_refcnt = 0;
- Py_XINCREF((PyObject *) result);
+ swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, &varlinktype);
+ if (result)
+ {
+ result->vars = 0;
+ }
return ((PyObject*) result);
}
SWIGSTATICRUNTIME(void)
SWIG_addvarlink(PyObject *p, char *name,
- PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
+ PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
swig_varlinkobject *v;
swig_globalvar *gv;
v= (swig_varlinkobject *) p;
@@ -267,7 +287,7 @@ SWIG_TypeCheck(char *c, _swig_type_info *ty) {
/* Move s to the top of the linked list */
s->prev->next = s->next;
if (s->next) {
- s->next->prev = s->prev;
+ s->next->prev = s->prev;
}
/* Insert s as second element in the list */
s->next = ty->next;
@@ -304,13 +324,13 @@ SWIG_ConvertPtr(PyObject *obj, void **ptr, _swig_type_info *ty, int flags) {
c = (char *) PyCObject_GetDesc(obj);
goto cobject;
#else
- if (!(PyString_Check(obj))) {
+ if (!(PyByteArray_Check(obj))) {
if (!SWIG_this)
- SWIG_this = PyString_InternFromString("this");
+ SWIG_this = PyBytes_FromString("this");
obj = PyObject_GetAttr(obj,SWIG_this);
- if ((!obj) || !(PyString_Check(obj))) goto type_error;
+ if ((!obj) || !(PyByteArray_Check(obj))) goto type_error;
}
- c = PyString_AsString(obj);
+ c = PyByteArray_AS_STRING(obj);
p = 0;
/* Pointer values must start with leading underscore */
if (*c != '_') {
@@ -394,7 +414,7 @@ SWIG_NewPointerObj(void *ptr, _swig_type_info *type) {
robj = PyCObject_FromVoidPtrAndDesc((void *) ptr, type->name, NULL);
#else
SWIG_MakePtr(result,ptr,type);
- robj = PyString_FromString(result);
+ robj = PyBytes_FromString(result);
#endif
return robj;
}
@@ -407,13 +427,13 @@ SWIG_InstallConstants(PyObject *d, _swig_const_info constants[]) {
for (i = 0; constants[i].type; i++) {
switch(constants[i].type) {
case SWIG_PY_INT:
- obj = PyInt_FromLong(constants[i].lvalue);
+ obj = PyLong_FromLong(constants[i].lvalue);
break;
case SWIG_PY_FLOAT:
obj = PyFloat_FromDouble(constants[i].dvalue);
break;
case SWIG_PY_STRING:
- obj = PyString_FromString((char *) constants[i].pvalue);
+ obj = PyBytes_FromString((char *) constants[i].pvalue);
break;
case SWIG_PY_POINTER:
obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype);
@@ -1637,93 +1657,93 @@ static PyObject *_wrap_KivioLayer_takeStencil(PyObject *self, PyObject *args) {
}
static PyMethodDef kiviocMethods[] = {
- { "KivioLayer_takeStencil", _wrap_KivioLayer_takeStencil, METH_VARARGS },
- { "KivioLayer_lastStencil", _wrap_KivioLayer_lastStencil, METH_VARARGS },
- { "KivioLayer_currentStencil", _wrap_KivioLayer_currentStencil, METH_VARARGS },
- { "KivioLayer_prevStencil", _wrap_KivioLayer_prevStencil, METH_VARARGS },
- { "KivioLayer_nextStencil", _wrap_KivioLayer_nextStencil, METH_VARARGS },
- { "KivioLayer_firstStencil", _wrap_KivioLayer_firstStencil, METH_VARARGS },
- { "KivioLayer_removeStencil", _wrap_KivioLayer_removeStencil, METH_VARARGS },
- { "KivioLayer_addStencil", _wrap_KivioLayer_addStencil, METH_VARARGS },
- { "KivioLayer_setConnectable", _wrap_KivioLayer_setConnectable, METH_VARARGS },
- { "KivioLayer_connectable", _wrap_KivioLayer_connectable, METH_VARARGS },
- { "KivioLayer_setVisible", _wrap_KivioLayer_setVisible, METH_VARARGS },
- { "KivioLayer_visible", _wrap_KivioLayer_visible, METH_VARARGS },
- { "delete_KivioLayer", _wrap_delete_KivioLayer, METH_VARARGS },
- { "new_KivioLayer", _wrap_new_KivioLayer, METH_VARARGS },
- { "KivioStencil_endAHLength", _wrap_KivioStencil_endAHLength, METH_VARARGS },
- { "KivioStencil_endAHWidth", _wrap_KivioStencil_endAHWidth, METH_VARARGS },
- { "KivioStencil_endAHType", _wrap_KivioStencil_endAHType, METH_VARARGS },
- { "KivioStencil_startAHLength", _wrap_KivioStencil_startAHLength, METH_VARARGS },
- { "KivioStencil_startAHWidth", _wrap_KivioStencil_startAHWidth, METH_VARARGS },
- { "KivioStencil_startAHType", _wrap_KivioStencil_startAHType, METH_VARARGS },
- { "KivioStencil_setEndAHLength", _wrap_KivioStencil_setEndAHLength, METH_VARARGS },
- { "KivioStencil_setEndAHWidth", _wrap_KivioStencil_setEndAHWidth, METH_VARARGS },
- { "KivioStencil_setEndAHType", _wrap_KivioStencil_setEndAHType, METH_VARARGS },
- { "KivioStencil_setStartAHLength", _wrap_KivioStencil_setStartAHLength, METH_VARARGS },
- { "KivioStencil_setStartAHWidth", _wrap_KivioStencil_setStartAHWidth, METH_VARARGS },
- { "KivioStencil_setStartAHType", _wrap_KivioStencil_setStartAHType, METH_VARARGS },
- { "KivioStencil_updateGeometry", _wrap_KivioStencil_updateGeometry, METH_VARARGS },
- { "KivioStencil_addToGroup", _wrap_KivioStencil_addToGroup, METH_VARARGS },
- { "KivioStencil_subSelect", _wrap_KivioStencil_subSelect, METH_VARARGS },
- { "KivioStencil_unselect", _wrap_KivioStencil_unselect, METH_VARARGS },
- { "KivioStencil_select", _wrap_KivioStencil_select, METH_VARARGS },
- { "KivioStencil_isSelected", _wrap_KivioStencil_isSelected, METH_VARARGS },
- { "KivioStencil_setBGColor", _wrap_KivioStencil_setBGColor, METH_VARARGS },
- { "KivioStencil_bgColor", _wrap_KivioStencil_bgColor, METH_VARARGS },
- { "KivioStencil_setFGColor", _wrap_KivioStencil_setFGColor, METH_VARARGS },
- { "KivioStencil_fgColor", _wrap_KivioStencil_fgColor, METH_VARARGS },
- { "KivioStencil_setTextColor", _wrap_KivioStencil_setTextColor, METH_VARARGS },
- { "KivioStencil_textColor", _wrap_KivioStencil_textColor, METH_VARARGS },
- { "KivioStencil_text", _wrap_KivioStencil_text, METH_VARARGS },
- { "KivioStencil_setText", _wrap_KivioStencil_setText, METH_VARARGS },
- { "KivioStencil_setVTextAlign", _wrap_KivioStencil_setVTextAlign, METH_VARARGS },
- { "KivioStencil_setHTextAlign", _wrap_KivioStencil_setHTextAlign, METH_VARARGS },
- { "KivioStencil_vTextAlign", _wrap_KivioStencil_vTextAlign, METH_VARARGS },
- { "KivioStencil_hTextAlign", _wrap_KivioStencil_hTextAlign, METH_VARARGS },
- { "KivioStencil_lineWidth", _wrap_KivioStencil_lineWidth, METH_VARARGS },
- { "KivioStencil_setLineWidth", _wrap_KivioStencil_setLineWidth, METH_VARARGS },
- { "KivioStencil_fillStyle", _wrap_KivioStencil_fillStyle, METH_VARARGS },
- { "KivioStencil_setDimensions", _wrap_KivioStencil_setDimensions, METH_VARARGS },
- { "KivioStencil_setPosition", _wrap_KivioStencil_setPosition, METH_VARARGS },
- { "KivioStencil_rect", _wrap_KivioStencil_rect, METH_VARARGS },
- { "KivioStencil_setH", _wrap_KivioStencil_setH, METH_VARARGS },
- { "KivioStencil_h", _wrap_KivioStencil_h, METH_VARARGS },
- { "KivioStencil_setW", _wrap_KivioStencil_setW, METH_VARARGS },
- { "KivioStencil_w", _wrap_KivioStencil_w, METH_VARARGS },
- { "KivioStencil_setY", _wrap_KivioStencil_setY, METH_VARARGS },
- { "KivioStencil_y", _wrap_KivioStencil_y, METH_VARARGS },
- { "KivioStencil_setX", _wrap_KivioStencil_setX, METH_VARARGS },
- { "KivioStencil_x", _wrap_KivioStencil_x, METH_VARARGS },
- { "KivioStencil_duplicate", _wrap_KivioStencil_duplicate, METH_VARARGS },
- { "delete_KivioStencil", _wrap_delete_KivioStencil, METH_VARARGS },
- { "new_KivioStencil", _wrap_new_KivioStencil, METH_VARARGS },
- { "paste", _wrap_paste, METH_VARARGS },
- { "cut", _wrap_cut, METH_VARARGS },
- { "copy", _wrap_copy, METH_VARARGS },
- { "sendToBack", _wrap_sendToBack, METH_VARARGS },
- { "bringToFront", _wrap_bringToFront, METH_VARARGS },
- { "ungroupSelectedStencils", _wrap_ungroupSelectedStencils, METH_VARARGS },
- { "groupSelectedStencils", _wrap_groupSelectedStencils, METH_VARARGS },
- { "deleteSelectedStencils", _wrap_deleteSelectedStencils, METH_VARARGS },
- { "addStencil", _wrap_addStencil, METH_VARARGS },
- { "layerAt", _wrap_layerAt, METH_VARARGS },
- { "insertLayer", _wrap_insertLayer, METH_VARARGS },
- { "addLayer", _wrap_addLayer, METH_VARARGS },
- { "removeCurrentLayer", _wrap_removeCurrentLayer, METH_VARARGS },
- { "prevLayer", _wrap_prevLayer, METH_VARARGS },
- { "lastLayer", _wrap_lastLayer, METH_VARARGS },
- { "nextLayer", _wrap_nextLayer, METH_VARARGS },
- { "firstLayer", _wrap_firstLayer, METH_VARARGS },
- { "setCurLayer", _wrap_setCurLayer, METH_VARARGS },
- { "curLayer", _wrap_curLayer, METH_VARARGS },
- { "selectStencil", _wrap_selectStencil, METH_VARARGS },
- { "unselectStencil", _wrap_unselectStencil, METH_VARARGS },
- { "unselectAllStencils", _wrap_unselectAllStencils, METH_VARARGS },
- { "selectAllStencils", _wrap_selectAllStencils, METH_VARARGS },
- { "isStencilSelected", _wrap_isStencilSelected, METH_VARARGS },
- { "update", _wrap_update, METH_VARARGS },
- { NULL, NULL }
+ { "KivioLayer_takeStencil", _wrap_KivioLayer_takeStencil, METH_VARARGS, (char*)"KivioLayer_takeStencil" },
+ { "KivioLayer_lastStencil", _wrap_KivioLayer_lastStencil, METH_VARARGS, (char*)"KivioLayer_lastStencil" },
+ { "KivioLayer_currentStencil", _wrap_KivioLayer_currentStencil, METH_VARARGS, (char*)"KivioLayer_currentStencil" },
+ { "KivioLayer_prevStencil", _wrap_KivioLayer_prevStencil, METH_VARARGS, (char*)"KivioLayer_prevStencil" },
+ { "KivioLayer_nextStencil", _wrap_KivioLayer_nextStencil, METH_VARARGS, (char*)"KivioLayer_nextStencil" },
+ { "KivioLayer_firstStencil", _wrap_KivioLayer_firstStencil, METH_VARARGS, (char*)"KivioLayer_firstStencil" },
+ { "KivioLayer_removeStencil", _wrap_KivioLayer_removeStencil, METH_VARARGS, (char*)"KivioLayer_removeStencil" },
+ { "KivioLayer_addStencil", _wrap_KivioLayer_addStencil, METH_VARARGS, (char*)"KivioLayer_addStencil" },
+ { "KivioLayer_setConnectable", _wrap_KivioLayer_setConnectable, METH_VARARGS, (char*)"KivioLayer_setConnectable" },
+ { "KivioLayer_connectable", _wrap_KivioLayer_connectable, METH_VARARGS, (char*)"KivioLayer_connectable" },
+ { "KivioLayer_setVisible", _wrap_KivioLayer_setVisible, METH_VARARGS, (char*)"KivioLayer_setVisible" },
+ { "KivioLayer_visible", _wrap_KivioLayer_visible, METH_VARARGS, (char*)"KivioLayer_visible" },
+ { "delete_KivioLayer", _wrap_delete_KivioLayer, METH_VARARGS, (char*)"delete_KivioLayer" },
+ { "new_KivioLayer", _wrap_new_KivioLayer, METH_VARARGS, (char*)"new_KivioLayer" },
+ { "KivioStencil_endAHLength", _wrap_KivioStencil_endAHLength, METH_VARARGS, (char*)"KivioStencil_endAHLength" },
+ { "KivioStencil_endAHWidth", _wrap_KivioStencil_endAHWidth, METH_VARARGS, (char*)"KivioStencil_endAHWidth" },
+ { "KivioStencil_endAHType", _wrap_KivioStencil_endAHType, METH_VARARGS, (char*)"KivioStencil_endAHType" },
+ { "KivioStencil_startAHLength", _wrap_KivioStencil_startAHLength, METH_VARARGS, (char*)"KivioStencil_startAHLength" },
+ { "KivioStencil_startAHWidth", _wrap_KivioStencil_startAHWidth, METH_VARARGS, (char*)"KivioStencil_startAHWidth" },
+ { "KivioStencil_startAHType", _wrap_KivioStencil_startAHType, METH_VARARGS, (char*)"KivioStencil_startAHType" },
+ { "KivioStencil_setEndAHLength", _wrap_KivioStencil_setEndAHLength, METH_VARARGS, (char*)"KivioStencil_setEndAHLength" },
+ { "KivioStencil_setEndAHWidth", _wrap_KivioStencil_setEndAHWidth, METH_VARARGS, (char*)"KivioStencil_setEndAHWidth" },
+ { "KivioStencil_setEndAHType", _wrap_KivioStencil_setEndAHType, METH_VARARGS, (char*)"KivioStencil_setEndAHType" },
+ { "KivioStencil_setStartAHLength", _wrap_KivioStencil_setStartAHLength, METH_VARARGS, (char*)"KivioStencil_setStartAHLength" },
+ { "KivioStencil_setStartAHWidth", _wrap_KivioStencil_setStartAHWidth, METH_VARARGS, (char*)"KivioStencil_setStartAHWidth" },
+ { "KivioStencil_setStartAHType", _wrap_KivioStencil_setStartAHType, METH_VARARGS, (char*)"KivioStencil_setStartAHType" },
+ { "KivioStencil_updateGeometry", _wrap_KivioStencil_updateGeometry, METH_VARARGS, (char*)"KivioStencil_updateGeometry" },
+ { "KivioStencil_addToGroup", _wrap_KivioStencil_addToGroup, METH_VARARGS, (char*)"KivioStencil_addToGroup" },
+ { "KivioStencil_subSelect", _wrap_KivioStencil_subSelect, METH_VARARGS, (char*)"KivioStencil_subSelect" },
+ { "KivioStencil_unselect", _wrap_KivioStencil_unselect, METH_VARARGS, (char*)"KivioStencil_unselect" },
+ { "KivioStencil_select", _wrap_KivioStencil_select, METH_VARARGS, (char*)"KivioStencil_select" },
+ { "KivioStencil_isSelected", _wrap_KivioStencil_isSelected, METH_VARARGS, (char*)"KivioStencil_isSelected" },
+ { "KivioStencil_setBGColor", _wrap_KivioStencil_setBGColor, METH_VARARGS, (char*)"KivioStencil_setBGColor" },
+ { "KivioStencil_bgColor", _wrap_KivioStencil_bgColor, METH_VARARGS, (char*)"KivioStencil_bgColor" },
+ { "KivioStencil_setFGColor", _wrap_KivioStencil_setFGColor, METH_VARARGS, (char*)"KivioStencil_setFGColor" },
+ { "KivioStencil_fgColor", _wrap_KivioStencil_fgColor, METH_VARARGS, (char*)"KivioStencil_fgColor" },
+ { "KivioStencil_setTextColor", _wrap_KivioStencil_setTextColor, METH_VARARGS, (char*)"KivioStencil_setTextColor" },
+ { "KivioStencil_textColor", _wrap_KivioStencil_textColor, METH_VARARGS, (char*)"KivioStencil_textColor" },
+ { "KivioStencil_text", _wrap_KivioStencil_text, METH_VARARGS, (char*)"KivioStencil_text" },
+ { "KivioStencil_setText", _wrap_KivioStencil_setText, METH_VARARGS, (char*)"KivioStencil_setText" },
+ { "KivioStencil_setVTextAlign", _wrap_KivioStencil_setVTextAlign, METH_VARARGS, (char*)"KivioStencil_setVTextAlign" },
+ { "KivioStencil_setHTextAlign", _wrap_KivioStencil_setHTextAlign, METH_VARARGS, (char*)"KivioStencil_setHTextAlign" },
+ { "KivioStencil_vTextAlign", _wrap_KivioStencil_vTextAlign, METH_VARARGS, (char*)"KivioStencil_vTextAlign" },
+ { "KivioStencil_hTextAlign", _wrap_KivioStencil_hTextAlign, METH_VARARGS, (char*)"KivioStencil_hTextAlign" },
+ { "KivioStencil_lineWidth", _wrap_KivioStencil_lineWidth, METH_VARARGS, (char*)"KivioStencil_lineWidth" },
+ { "KivioStencil_setLineWidth", _wrap_KivioStencil_setLineWidth, METH_VARARGS, (char*)"KivioStencil_setLineWidth" },
+ { "KivioStencil_fillStyle", _wrap_KivioStencil_fillStyle, METH_VARARGS, (char*)"KivioStencil_fillStyle" },
+ { "KivioStencil_setDimensions", _wrap_KivioStencil_setDimensions, METH_VARARGS, (char*)"KivioStencil_setDimensions" },
+ { "KivioStencil_setPosition", _wrap_KivioStencil_setPosition, METH_VARARGS, (char*)"KivioStencil_setPosition" },
+ { "KivioStencil_rect", _wrap_KivioStencil_rect, METH_VARARGS, (char*)"KivioStencil_rect" },
+ { "KivioStencil_setH", _wrap_KivioStencil_setH, METH_VARARGS, (char*)"KivioStencil_setH" },
+ { "KivioStencil_h", _wrap_KivioStencil_h, METH_VARARGS, (char*)"KivioStencil_h" },
+ { "KivioStencil_setW", _wrap_KivioStencil_setW, METH_VARARGS, (char*)"KivioStencil_setW" },
+ { "KivioStencil_w", _wrap_KivioStencil_w, METH_VARARGS, (char*)"KivioStencil_w" },
+ { "KivioStencil_setY", _wrap_KivioStencil_setY, METH_VARARGS, (char*)"KivioStencil_setY" },
+ { "KivioStencil_y", _wrap_KivioStencil_y, METH_VARARGS, (char*)"KivioStencil_y" },
+ { "KivioStencil_setX", _wrap_KivioStencil_setX, METH_VARARGS, (char*)"KivioStencil_setX" },
+ { "KivioStencil_x", _wrap_KivioStencil_x, METH_VARARGS, (char*)"KivioStencil_x" },
+ { "KivioStencil_duplicate", _wrap_KivioStencil_duplicate, METH_VARARGS, (char*)"KivioStencil_duplicate" },
+ { "delete_KivioStencil", _wrap_delete_KivioStencil, METH_VARARGS, (char*)"delete_KivioStencil" },
+ { "new_KivioStencil", _wrap_new_KivioStencil, METH_VARARGS, (char*)"new_KivioStencil" },
+ { "paste", _wrap_paste, METH_VARARGS, (char*)"paste" },
+ { "cut", _wrap_cut, METH_VARARGS, (char*)"cut" },
+ { "copy", _wrap_copy, METH_VARARGS, (char*)"copy" },
+ { "sendToBack", _wrap_sendToBack, METH_VARARGS, (char*)"sendToBack" },
+ { "bringToFront", _wrap_bringToFront, METH_VARARGS, (char*)"bringToFront" },
+ { "ungroupSelectedStencils", _wrap_ungroupSelectedStencils, METH_VARARGS, (char*)"ungroupSelectedStencils" },
+ { "groupSelectedStencils", _wrap_groupSelectedStencils, METH_VARARGS, (char*)"groupSelectedStencils" },
+ { "deleteSelectedStencils", _wrap_deleteSelectedStencils, METH_VARARGS, (char*)"deleteSelectedStencils" },
+ { "addStencil", _wrap_addStencil, METH_VARARGS, (char*)"addStencil" },
+ { "layerAt", _wrap_layerAt, METH_VARARGS, (char*)"layerAt" },
+ { "insertLayer", _wrap_insertLayer, METH_VARARGS, (char*)"insertLayer" },
+ { "addLayer", _wrap_addLayer, METH_VARARGS, (char*)"addLayer" },
+ { "removeCurrentLayer", _wrap_removeCurrentLayer, METH_VARARGS, (char*)"removeCurrentLayer" },
+ { "prevLayer", _wrap_prevLayer, METH_VARARGS, (char*)"prevLayer" },
+ { "lastLayer", _wrap_lastLayer, METH_VARARGS, (char*)"lastLayer" },
+ { "nextLayer", _wrap_nextLayer, METH_VARARGS, (char*)"nextLayer" },
+ { "firstLayer", _wrap_firstLayer, METH_VARARGS, (char*)"firstLayer" },
+ { "setCurLayer", _wrap_setCurLayer, METH_VARARGS, (char*)"setCurLayer" },
+ { "curLayer", _wrap_curLayer, METH_VARARGS, (char*)"curLayer" },
+ { "selectStencil", _wrap_selectStencil, METH_VARARGS, (char*)"selectStencil" },
+ { "unselectStencil", _wrap_unselectStencil, METH_VARARGS, (char*)"unselectStencil" },
+ { "unselectAllStencils", _wrap_unselectAllStencils, METH_VARARGS, (char*)"unselectAllStencils" },
+ { "selectAllStencils", _wrap_selectAllStencils, METH_VARARGS, (char*)"selectAllStencils" },
+ { "isStencilSelected", _wrap_isStencilSelected, METH_VARARGS, (char*)"isStencilSelected" },
+ { "update", _wrap_update, METH_VARARGS, (char*)"update" },
+ { NULL, NULL }
};
#ifdef __cplusplus
}
@@ -1748,23 +1768,35 @@ _swigt__KivioLayer_p,
static _swig_const_info _swig_const_table[] = {
{0}};
+static struct PyModuleDef kivio_module = {
+ PyModuleDef_HEAD_INIT,
+ "kivioc",
+ NULL,
+ -1,
+ kiviocMethods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
static PyObject *SWIG_globals;
#ifdef __cplusplus
extern "C"
#endif
-SWIGEXPORT(void) initkivioc(void) {
- PyObject *m, *d;
- SWIG_globals = SWIG_newvarlink();
- m = Py_InitModule("kivioc", kiviocMethods);
- d = PyModule_GetDict(m);
- {
- int i;
- for (i = 0; _swig_types_initial[i]; i++) {
- _swig_types[i] = SWIG_TypeRegister(_swig_types_initial[i]);
- }
+SWIGEXPORT(void) initkivioc(void)
+{
+ PyObject *m, *d;
+ SWIG_globals = SWIG_newvarlink();
+ m = PyModule_Create(&kivio_module);
+ d = PyModule_GetDict(m);
+ {
+ int i;
+ for (i = 0; _swig_types_initial[i]; i++) {
+ _swig_types[i] = SWIG_TypeRegister(_swig_types_initial[i]);
}
- SWIG_InstallConstants(d,_swig_const_table);
-
+ }
+ SWIG_InstallConstants(d,_swig_const_table);
}
#endif // HAVE_PYTHON