15 |
#include "input.h" |
#include "input.h" |
16 |
#include "audio.h" |
#include "audio.h" |
17 |
#include "character_base.h" |
#include "character_base.h" |
|
#include "item_storage.h" |
|
|
#include "inventory.h" |
|
|
#include "manager.h" |
|
18 |
#include "quest.h" |
#include "quest.h" |
19 |
#include "drawing_area.h" |
#include "drawing_area.h" |
20 |
#include "drawable.h" |
#include "drawable.h" |
36 |
#include "win_image.h" |
#include "win_image.h" |
37 |
#include "win_write.h" |
#include "win_write.h" |
38 |
#include "win_mapview.h" |
#include "win_mapview.h" |
39 |
#include "win_font.h" |
#include "win_ttf.h" |
40 |
#include "win_theme.h" |
#include "win_theme.h" |
41 |
#include "win_base.h" |
#include "win_base.h" |
42 |
#include "text_bubble.h" |
#include "text_bubble.h" |
55 |
#define SDLK_UNDO 322 |
#define SDLK_UNDO 322 |
56 |
#endif |
#endif |
57 |
|
|
58 |
|
// Workaround for bug in pyptrtypes.swg |
59 |
|
#define SWIG_append_msg SWIG_append_errmsg |
60 |
|
|
61 |
// This enum allows clearer ownership operation: |
// This enum allows clearer ownership operation: |
62 |
// obj.thisown = Python (Python will destroy the object) |
// obj.thisown = Python (Python will destroy the object) |
63 |
// obj.thisown = C (C have to destroy the object) |
// obj.thisown = C (C has to destroy the object) |
64 |
enum {Python = 1, C = 0}; |
enum {Python = 1, C = 0}; |
65 |
|
|
66 |
%} |
// pass an instance to python |
67 |
|
PyObject *pass_instance (void *instance, const char* class_name) |
|
// Same enum available for Python |
|
|
enum {Python = 1, C = 0}; |
|
|
|
|
|
%typemap(python,in) string |
|
68 |
{ |
{ |
69 |
if (PyString_Check ($input)) |
swig_type_info * ti = SWIG_TypeQuery (class_name); |
70 |
{ |
if (ti) return SWIG_NewPointerObj (instance, ti, C); |
71 |
$1 = string (PyString_AsString($input)); |
else printf ("*** pass_instance: Type '%s' not known to SWIG!\n", class_name); |
72 |
} |
return NULL; |
|
else |
|
|
{ |
|
|
PyErr_SetString (PyExc_TypeError, "not a String"); |
|
|
return NULL; |
|
|
} |
|
73 |
} |
} |
|
%typemap(python,in) const string = string; |
|
74 |
|
|
75 |
%typemap(python,in) string & |
%} |
|
{ |
|
|
if (PyString_Check ($input)) |
|
|
{ |
|
|
$1 = new string (PyString_AsString($input)); |
|
|
} |
|
|
else |
|
|
{ |
|
|
PyErr_SetString (PyExc_TypeError, "not a String"); |
|
|
return NULL; |
|
|
} |
|
|
} |
|
|
%typemap(python,in) const string & = string &; |
|
|
%typemap(python,in) const std::string & = string &; |
|
|
|
|
|
%typemap(python,out) string |
|
|
{ |
|
|
$result = PyString_FromString((const char *)$1.c_str()); |
|
|
} |
|
|
%typemap(python,out) const string = string; |
|
76 |
|
|
77 |
%typemap(python,out) string & |
// Same enum available for Python |
78 |
{ |
enum {Python = 1, C = 0}; |
|
$result = PyString_FromString((const char *)$1->c_str()); |
|
|
// delete $1; |
|
|
} |
|
|
%typemap(python,out) const string & = string &; |
|
79 |
|
|
80 |
%typemap (python, freearg) string & |
%include "std_string.i" |
|
{ |
|
|
if ($1 != NULL) |
|
|
{ |
|
|
delete $1; |
|
|
} |
|
|
} |
|
|
%typemap (python, freearg) const string & = string &; |
|
|
%typemap (python, freearg) const std::string & = string &; |
|
81 |
|
|
82 |
%typemap (python,in) PyObject *pyfunc |
%typemap (in) PyObject *pyfunc |
83 |
{ |
{ |
84 |
if (!PyCallable_Check($input)) |
if (!PyCallable_Check($input)) |
85 |
{ |
{ |
89 |
$1 = $input; |
$1 = $input; |
90 |
} |
} |
91 |
|
|
92 |
%typemap (python,in) PyObject* |
%typemap (in) PyObject* |
93 |
{ |
{ |
94 |
$1 = $input; |
$1 = $input; |
95 |
} |
} |
96 |
|
|
|
%include "typemaps.i" |
|
|
%apply unsigned int *INOUT { unsigned int *count }; |
|
|
|
|
|
|
|
97 |
%include "types.h" |
%include "types.h" |
98 |
%include "fileops.h" |
%include "fileops.h" |
99 |
%include "event.h" |
%include "event.h" |
108 |
%include "input.h" |
%include "input.h" |
109 |
%include "audio.h" |
%include "audio.h" |
110 |
%include "character_base.h" |
%include "character_base.h" |
|
%include "slot.h" |
|
111 |
%include "py_object.h" |
%include "py_object.h" |
|
%include "item_base.h" |
|
|
%include "item_storage.h" |
|
|
%include "inventory.h" |
|
|
%include "manager.h" |
|
112 |
%include "drawing_area.h" |
%include "drawing_area.h" |
113 |
%include "quest.h" |
%include "quest.h" |
114 |
%include "drawable.h" |
%include "drawable.h" |