Panda3D
 All Classes Functions Variables Enumerations
dtool_super_base.cxx
1 // Filename: dtool_super_base.cxx
2 // Created by: drose (04Jul05)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "py_panda.h"
16 
17 #ifdef HAVE_PYTHON
18 
19 class EmptyClass {
20 };
21 Define_Module_Class_Private(dtoolconfig, DTOOL_SUPER_BASE, EmptyClass, DTOOL_SUPER_BASE111);
22 
23 static PyObject *GetSuperBase(PyObject *self) {
24  Py_INCREF(&(Dtool_DTOOL_SUPER_BASE.As_PyTypeObject())); // order is important .. this is used for static functions
25  return (PyObject *) &Dtool_DTOOL_SUPER_BASE;
26 };
27 
28 PyMethodDef Dtool_Methods_DTOOL_SUPER_BASE[] = {
29  { "DtoolGetSuperBase", (PyCFunction) &GetSuperBase, METH_NOARGS, "Will Return SUPERbase Class"},
30  { NULL, NULL }
31 };
32 
33 EXPCL_DTOOLCONFIG void Dtool_PyModuleClassInit_DTOOL_SUPER_BASE(PyObject *module) {
34  static bool initdone = false;
35  if (!initdone) {
36 
37  initdone = true;
38  Dtool_DTOOL_SUPER_BASE.As_PyTypeObject().tp_dict = PyDict_New();
39  PyDict_SetItemString(Dtool_DTOOL_SUPER_BASE.As_PyTypeObject().tp_dict, "DtoolClassDict", Dtool_DTOOL_SUPER_BASE.As_PyTypeObject().tp_dict);
40 
41  if (PyType_Ready(&Dtool_DTOOL_SUPER_BASE.As_PyTypeObject()) < 0) {
42  PyErr_SetString(PyExc_TypeError, "PyType_Ready(Dtool_DTOOL_SUPER_BASE)");
43  return;
44  }
45  Py_INCREF(&Dtool_DTOOL_SUPER_BASE.As_PyTypeObject());
46 
47  PyDict_SetItemString(Dtool_DTOOL_SUPER_BASE.As_PyTypeObject().tp_dict, "DtoolGetSuperBase", PyCFunction_New(&Dtool_Methods_DTOOL_SUPER_BASE[0], &Dtool_DTOOL_SUPER_BASE.As_PyObject()));
48  }
49 
50  if (module != NULL) {
51  Py_INCREF(&Dtool_DTOOL_SUPER_BASE.As_PyTypeObject());
52  PyModule_AddObject(module, "DTOOL_SUPER_BASE", (PyObject *)&Dtool_DTOOL_SUPER_BASE.As_PyTypeObject());
53  }
54 }
55 
56 inline void *Dtool_DowncastInterface_DTOOL_SUPER_BASE(void *from_this, Dtool_PyTypedObject *from_type) {
57  return (void *) NULL;
58 }
59 
60 inline void *Dtool_UpcastInterface_DTOOL_SUPER_BASE(PyObject *self, Dtool_PyTypedObject *requested_type) {
61  return NULL;
62 }
63 
64 int Dtool_Init_DTOOL_SUPER_BASE(PyObject *self, PyObject *args, PyObject *kwds) {
65  PyErr_SetString(PyExc_TypeError, "cannot init super base");
66  return -1;
67 }
68 
69 EXPORT_THIS Dtool_PyTypedObject Dtool_DTOOL_SUPER_BASE = {
70  {
71  PyVarObject_HEAD_INIT(NULL, 0)
72  "dtoolconfig.DTOOL_SUPER_BASE",
73  sizeof(Dtool_PyInstDef),
74  0,
75  &Dtool_FreeInstance_DTOOL_SUPER_BASE,
76  0,
77  0,
78  0,
79 #if PY_MAJOR_VERSION >= 3
80  0,
81 #else
82  &DTOOL_PyObject_ComparePointers,
83 #endif
84  0,
85  0,
86  0,
87  0,
88  &DTOOL_PyObject_HashPointer,
89  0,
90  0,
91  PyObject_GenericGetAttr,
92  PyObject_GenericSetAttr,
93  0,
94  (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_CHECKTYPES),
95  0,
96  0,
97  0,
98 #if PY_MAJOR_VERSION >= 3
99  &DTOOL_PyObject_RichCompare,
100 #else
101  0,
102 #endif
103  0,
104  0,
105  0,
106  Dtool_Methods_DTOOL_SUPER_BASE,
107  standard_type_members,
108  0,
109  0,
110  0,
111  0,
112  0,
113  0,
114  Dtool_Init_DTOOL_SUPER_BASE,
115  PyType_GenericAlloc,
116  Dtool_new_DTOOL_SUPER_BASE,
117  PyObject_Del,
118  0,
119  0,
120  0,
121  0,
122  0,
123  0,
124  0,
125  },
126  Dtool_UpcastInterface_DTOOL_SUPER_BASE,
127  Dtool_DowncastInterface_DTOOL_SUPER_BASE,
129 };
130 
131 #endif // HAVE_PYTHON
static TypeHandle none()
Returns a special zero-valued TypeHandle that is used to indicate no type.
Definition: typeHandle.I:274