]> git.saurik.com Git - wxWidgets.git/blob - wxPython/wxSWIG/swig_lib/objc.i
Since I have made several changes to SWIG over the years to accomodate
[wxWidgets.git] / wxPython / wxSWIG / swig_lib / objc.i
1 // SWIG Objective-C configuration file
2 // Dave Beazley
3 // Copyright (C) 1997
4
5 // This file provides support to Objective-C parsing and
6 // should be included with just about any Objective-C module
7
8 // Base Object class
9
10 @interface Object { }
11
12 -(char *) name; // Get object name
13
14 @end
15
16 typedef Object *id; // Make 'id' behave like any other "Object"
17
18 // Typemaps to make *id work like kind of like a void pointer
19
20 %typemap(python,in) id {
21 char *temp;
22 if (!PyString_Check($source)) {
23 PyErr_SetString(PyExc_TypeError,"Expecting an 'id' in argument $argnum of $name");
24 return NULL;
25 }
26 temp = PyString_AsString($source);
27 if (SWIG_GetPtr(temp, (void **) &$target, 0)) {
28 PyErr_SetString(PyExc_TypeError,"Expecting an 'id' in argument $argnum of $name");
29 return NULL;
30 }
31 }
32
33 %typemap(tcl,in) id {
34 if (SWIG_GetPtr($source,(void **) &$target, 0)) {
35 Tcl_SetResult(interp,"Expecting an 'id' in argument $argnum of $name",TCL_STATIC);
36 return TCL_ERROR;
37 }
38 }
39
40 %typemap(tcl8,in) id {
41 if (SWIG_GetPointerObj(interp, $source, (void **) &$target, 0)) {
42 Tcl_SetStringObj(result_obj, "Expecting an 'id' in argument $argnum of $name");
43 }
44 }
45
46 %typemap(perl5,in) id {
47 if (SWIG_GetPtr($source, (void **) &$target, 0)) {
48 croak("Expecting an 'id' in argument $argnum of $name");
49 }
50 }
51
52
53
54
55
56