annotate engine/swigwrappers/python/fife.i.templ @ 653:01acc9fc35ea

* Moved getCurrentScreenMode() to the renderbackend as renderbackend is what initializes the screen. * Updated the Color masks to follow the integer standards * Added some new SDL modes (HW Surface and double buffer) to check for in DeviceCaps. * RenderBackend now saves the actual flags used to initialize the screen.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Fri, 15 Oct 2010 18:54:34 +0000
parents b9c132cb6ea4
children 4f36c890b1dd
rev   line source
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
1 %module(directors="1") fife
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
2 %include "std_string.i"
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
3 %include "std_vector.i"
112
98541d3b9220 * add some std types to swig wrapper (fife.i.templ)
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
4 %include "std_pair.i"
98541d3b9220 * add some std types to swig wrapper (fife.i.templ)
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
5 %include "std_list.i"
98541d3b9220 * add some std types to swig wrapper (fife.i.templ)
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
6 %include "std_map.i"
98541d3b9220 * add some std types to swig wrapper (fife.i.templ)
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
7 %include "std_set.i"
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
8 %include "typemaps.i"
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
9 %include "exception.i"
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
10
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
11 /**
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
12 * Some materials to understand exception handling:
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
13 *
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
14 * Basics about python exceptions:
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
15 * http://docs.python.org/tut/node10.html
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
16 * Python exception handling in C APIs
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
17 * http://docs.python.org/api/exceptions.html
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
18 * http://docs.python.org/api/exceptionHandling.html
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
19 * SWIG exception handling
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
20 * http://www.swig.org/Doc1.3/Customization.html#exception
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
21 * http://www.swig.org/Doc1.3/SWIGPlus.html#SWIGPlus_exception_specifications
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
22 * http://www.swig.org/Doc1.3/Python.html#Python_nn36
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
23 */
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
24
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
25 %feature("autodoc", "1"); // 0 == no param types, 1 == show param types
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
26
649
b9c132cb6ea4 * Fixed the non standard integer definitions in DeviceCaps
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 638
diff changeset
27 %{
b9c132cb6ea4 * Fixed the non standard integer definitions in DeviceCaps
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 638
diff changeset
28 #include "util/base/fife_stdint.h"
b9c132cb6ea4 * Fixed the non standard integer definitions in DeviceCaps
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 638
diff changeset
29 %}
b9c132cb6ea4 * Fixed the non standard integer definitions in DeviceCaps
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 638
diff changeset
30
632
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
31 /**
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
32 * Integer definitions (See swigs stdint.i implementation)
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
33 *
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
34 */
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
35
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
36 /* Signed. */
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
37 typedef signed char int8_t;
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
38 typedef short int int16_t;
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
39 typedef int int32_t;
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
40 #if defined(SWIGWORDSIZE64)
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
41 typedef long int int64_t;
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
42 #else
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
43 typedef long long int int64_t;
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
44 #endif
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
45
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
46 /* Unsigned. */
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
47 typedef unsigned char uint8_t;
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
48 typedef unsigned short int uint16_t;
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
49 typedef unsigned int uint32_t;
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
50 #if defined(SWIGWORDSIZE64)
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
51 typedef unsigned long int uint64_t;
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
52 #else
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
53 typedef unsigned long long int uint64_t;
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
54 #endif
a7909cdcdc85 * A little data type cleanup in the FIFE::EngineSettings class
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 167
diff changeset
55
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
56 namespace std {
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
57 %template(StringVector) vector<std::string>;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
58 %template(UintVector) vector<unsigned int>;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
59 %template(IntVector) vector<int>;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
60 %template(FloatVector) vector<float>;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
61 %template(DoubleVector) vector<double>;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
62 %template(BoolVector) vector<bool>;
112
98541d3b9220 * add some std types to swig wrapper (fife.i.templ)
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
63
638
980c02db2f56 * Fixed a swig template that got missed in a previous commit
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 632
diff changeset
64 %template(Uint16Uint16Pair) pair<uint16_t, uint16_t>;
980c02db2f56 * Fixed a swig template that got missed in a previous commit
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 632
diff changeset
65 %template(Uint16Uint16PairVector) vector<std::pair<uint16_t, uint16_t> >;
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
66 };
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
67
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
68 %{
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
69 #include "util/base/exception.h"
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
70 static void handleDirectorException() {
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
71 PyObject* exception = NULL;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
72 PyObject* value = NULL;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
73 PyObject* traceback = NULL;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
74 PyErr_Fetch(&exception, &value, &traceback);
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
75 PyErr_NormalizeException(&exception, &value, &traceback);
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
76 if (exception) {
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
77 PySys_SetObject("last_type", exception);
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
78 PySys_SetObject("last_value", value);
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
79 PySys_SetObject("last_traceback", traceback);
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
80
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
81 PyObject* d = PyModule_GetDict (PyImport_AddModule ("__main__"));
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
82 PyDict_SetItemString(d, "exc_type", exception);
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
83 PyDict_SetItemString(d, "exc_value", value);
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
84 PyDict_SetItemString(d, "exc_traceback", traceback ? traceback : Py_None);
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
85
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
86 char buf[1024];
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
87 sprintf (buf, "\n\
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
88 import traceback\n\
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
89 s = \"\"\n\
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
90 for filename, line, function, text in traceback.extract_tb(exc_traceback):\n\
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
91 s = s + ' File \"%%s\", line %%d, in %%s\\n %%s' %% (filename, line, function, text)\n\
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
92 if s[-1] != '\\n': s = s + '\\n'\n\
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
93 for l in traceback.format_exception_only(exc_type, exc_value):\n\
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
94 s = s + ' ' + l\n\
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
95 if s[-1] != '\\n': s = s + '\\n'\n\
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
96 print s\n\
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
97 ");
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
98 PyObject* e = PyRun_String(buf, Py_file_input, d, d);
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
99 if (!e) {
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
100 PyErr_Print();
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
101 }
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
102 Py_XDECREF(e);
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
103 Py_XDECREF(d);
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
104 Py_XDECREF(exception);
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
105 Py_XDECREF(value);
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
106 Py_XDECREF(traceback);
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
107 }
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
108 }
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
109
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
110 #define _FIFE_EXC_HANDLER(_fife_exc_type, _converted_type) \
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
111 catch (FIFE::_fife_exc_type& _e) { \
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
112 PyErr_Clear(); \
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
113 SWIG_exception(_converted_type, _e.getMessage().c_str()); \
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
114 }
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
115
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
116 #define _FIFE_DIRECTOR_EXC_HANDLER() \
167
10a5f9e6c03f * Fixed a few thousand warnings made by swigwrapper in MSVC.
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 112
diff changeset
117 catch (Swig::DirectorException &) { \
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
118 PyErr_Clear(); \
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
119 SWIG_exception(SWIG_RuntimeError, "Catched director exception"); \
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
120 }
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
121 %}
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
122
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
123 %feature("director:except") {
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
124 if ($$error != NULL) {
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
125 handleDirectorException();
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
126 throw Swig::DirectorMethodException();
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
127 }
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
128 }
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
129
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
130 %exception {
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
131 try {
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
132 $$action
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
133 }
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
134 _FIFE_DIRECTOR_EXC_HANDLER()
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
135 _FIFE_EXC_HANDLER(Exception, SWIG_RuntimeError)
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
136 }
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
137
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
138 $inclusions
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
139
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
140 %include engine/swigwrappers/python/extensions.i.templ