1 // Generated by admPyClass.pl do not edit !
zzpy__pyDFInteger_get(tp_vm * vm)2 tp_obj zzpy__pyDFInteger_get(tp_vm *vm)
3 {
4 tp_obj self = tp_getraw(vm);
5 IScriptEngine *engine = (IScriptEngine*)tp_get(vm, vm->builtins, tp_string("userdata")).data.val;
6 IEditor *editor = engine->editor();
7 TinyParams pm(vm);
8 ADM_scriptDFIntegerHelper *me=(ADM_scriptDFIntegerHelper *)pm.asThis(&self, ADM_PYID_DF_INTEGER);
9 char const *key = pm.asString();
10 if (!strcmp(key, "value"))
11 {
12 if(!me) pm.raise("pyDFInteger:No this!");
13 return tp_number(me->value());
14 }
15 return tp_get(vm, self, tp_string(key));
16 }
zzpy__pyDFInteger_set(tp_vm * vm)17 tp_obj zzpy__pyDFInteger_set(tp_vm *vm)
18 {
19 tp_obj self = tp_getraw(vm);
20 IScriptEngine *engine = (IScriptEngine*)tp_get(vm, vm->builtins, tp_string("userdata")).data.val;
21 IEditor *editor = engine->editor();
22 TinyParams pm(vm);
23 ADM_scriptDFIntegerHelper *me = (ADM_scriptDFIntegerHelper *)pm.asThis(&self, ADM_PYID_DF_INTEGER);
24 char const *key = pm.asString();
25 if (!strcmp(key, "value"))
26 {
27 if(!me) pm.raise("pyDFInteger:No this!");
28 int val = pm.asInt();
29 me->setValue(val);
30 return tp_None;
31 }
32 return tp_None;
33 }
34 // Dctor
myDtorpyDFInteger(tp_vm * vm,tp_obj self)35 static void myDtorpyDFInteger(tp_vm *vm,tp_obj self)
36 {
37 ADM_scriptDFIntegerHelper *cookie = (ADM_scriptDFIntegerHelper *)self.data.val;
38 if (cookie) delete cookie;
39 self.data.val = NULL;
40 }
41 // Ctor (str int int)
myCtorpyDFInteger(tp_vm * vm)42 static tp_obj myCtorpyDFInteger(tp_vm *vm)
43 {
44 tp_obj self = tp_getraw(vm);
45 TinyParams pm(vm);
46 const char *p0 = pm.asString();
47 int p1 = pm.asInt();
48 int p2 = pm.asInt();
49 ADM_scriptDFIntegerHelper *me = new ADM_scriptDFIntegerHelper(p0,p1,p2);
50 tp_obj cdata = tp_data(vm, ADM_PYID_DF_INTEGER, me);
51 cdata.data.info->xfree = myDtorpyDFInteger;
52 tp_set(vm, self, tp_string("cdata"), cdata);
53 return tp_None;
54 }
zzpy__pyDFInteger_help(TP)55 static tp_obj zzpy__pyDFInteger_help(TP)
56 {
57 PythonEngine *engine = (PythonEngine*)tp_get(tp, tp->builtins, tp_string("userdata")).data.val;
58
59
60 return tp_None;
61 };
initClasspyDFInteger(tp_vm * vm)62 tp_obj initClasspyDFInteger(tp_vm *vm)
63 {
64 tp_obj myClass = tp_class(vm);
65 tp_set(vm,myClass, tp_string("__init__"), tp_fnc(vm,myCtorpyDFInteger));
66 tp_set(vm,myClass, tp_string("__set__"), tp_fnc(vm,zzpy__pyDFInteger_set));
67 tp_set(vm,myClass, tp_string("__get__"), tp_fnc(vm,zzpy__pyDFInteger_get));
68 tp_set(vm,myClass, tp_string("help"), tp_fnc(vm,zzpy__pyDFInteger_help));
69 return myClass;
70 }
71