]>
Commit | Line | Data |
---|---|---|
e91a9dfc RD |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: _ogldefs.i | |
3 | // Purpose: SWIG definitions for the wxWindows Object Graphics Library | |
4 | // | |
5 | // Author: Robin Dunn | |
6 | // | |
7 | // Created: 27-Aug-1999 | |
8 | // RCS-ID: $Id$ | |
9 | // Copyright: (c) 1998 by Total Control Software | |
10 | // Licence: wxWindows license | |
11 | ///////////////////////////////////////////////////////////////////////////// | |
12 | ||
13 | ||
14 | //--------------------------------------------------------------------------- | |
15 | ||
16 | ||
17 | class wxOGLConstraint; | |
18 | class wxBitmapShape; | |
19 | class wxDiagram; | |
20 | class wxDrawnShape; | |
21 | class wxCircleShape; | |
22 | class wxCompositeShape; | |
23 | class wxDividedShape; | |
24 | class wxDivisionShape; | |
25 | class wxEllipseShape; | |
26 | class wxLineShape; | |
27 | class wxPolygonShape; | |
28 | class wxRectangleShape; | |
29 | class wxPseudoMetaFile; | |
30 | class wxShape; | |
31 | class wxShapeCanvas; | |
32 | class wxShapeEvtHandler; | |
33 | class wxTextShape; | |
2348eaee | 34 | class wxControlPoint; |
e91a9dfc RD |
35 | |
36 | class wxPyOGLConstraint; | |
37 | class wxPyBitmapShape; | |
38 | class wxPyDiagram; | |
39 | class wxPyDrawnShape; | |
40 | class wxPyCircleShape; | |
41 | class wxPyCompositeShape; | |
42 | class wxPyDividedShape; | |
43 | class wxPyDivisionShape; | |
44 | class wxPyEllipseShape; | |
45 | class wxPyLineShape; | |
46 | class wxPyPolygonShape; | |
47 | class wxPyRectangleShape; | |
48 | class wxPyPseudoMetaFile; | |
49 | class wxPyShape; | |
50 | class wxPyShapeCanvas; | |
51 | class wxPyShapeEvtHandler; | |
52 | class wxPyTextShape; | |
2348eaee | 53 | class wxPyControlPoint; |
e91a9dfc RD |
54 | |
55 | ||
56 | //--------------------------------------------------------------------------- | |
d74525f7 RD |
57 | // Typemaps just for OGL |
58 | ||
59 | ||
9416aa89 | 60 | // OOR Support |
2f4e9287 RD |
61 | %typemap(python, out) wxPyShape* { $target = wxPyMake_wxShapeEvtHandler($source); } |
62 | %typemap(python, out) wxPyShapeEvtHandler* { $target = wxPyMake_wxShapeEvtHandler($source); } | |
63 | %typemap(python, out) wxPyDivisionShape* { $target = wxPyMake_wxShapeEvtHandler($source); } | |
64 | ||
9416aa89 RD |
65 | %typemap(python, out) wxPyShapeCanvas* { $target = wxPyMake_wxObject($source); } |
66 | %typemap(python, out) wxDiagram* { $target = wxPyMake_wxObject($source); } | |
67 | %typemap(python, out) wxOGLConstraint* { $target = wxPyMake_wxObject($source); } | |
9416aa89 RD |
68 | %typemap(python, out) wxPseudoMetaFile* { $target = wxPyMake_wxObject($source); } |
69 | %typemap(python, out) wxArrowHead* { $target = wxPyMake_wxObject($source); } | |
70 | ||
71 | ||
72 | ||
73 | ||
d74525f7 RD |
74 | // wxOGL doesn't use a ref-counted copy of pens and brushes, so we'll |
75 | // use the pen and brush lists to simulate that... | |
76 | ||
d74525f7 RD |
77 | %typemap(python, in) wxPen* { |
78 | wxPen* temp; | |
79 | if ($source) { | |
80 | if ($source == Py_None) { temp = NULL; } | |
81 | else if (SWIG_GetPtrObj($source, (void **) &temp,"_wxPen_p")) { | |
82 | PyErr_SetString(PyExc_TypeError,"Type error, expected _wxPen_p."); | |
83 | return NULL; | |
84 | } | |
85 | } | |
86 | if (temp) | |
87 | $target = wxThePenList->FindOrCreatePen(temp->GetColour(), | |
88 | temp->GetWidth(), | |
89 | temp->GetStyle()); | |
90 | else | |
91 | $target = NULL; | |
92 | } | |
93 | ||
94 | %typemap(python, in) wxBrush* { | |
95 | wxBrush* temp; | |
96 | if ($source) { | |
97 | if ($source == Py_None) { temp = NULL; } | |
98 | else if (SWIG_GetPtrObj($source, (void **) &temp,"_wxBrush_p")) { | |
99 | PyErr_SetString(PyExc_TypeError,"Type error, expected _wxBrush_p."); | |
100 | return NULL; | |
101 | } | |
102 | } | |
103 | if (temp) | |
104 | $target = wxTheBrushList->FindOrCreateBrush(temp->GetColour(), temp->GetStyle()); | |
105 | else | |
106 | $target = NULL; | |
107 | } | |
108 | ||
109 | ||
110 | %typemap(python, in) wxFont* { | |
111 | wxFont* temp; | |
112 | if ($source) { | |
113 | if ($source == Py_None) { temp = NULL; } | |
114 | else if (SWIG_GetPtrObj($source, (void **) &temp,"_wxFont_p")) { | |
115 | PyErr_SetString(PyExc_TypeError,"Type error, expected _wxFont_p."); | |
116 | return NULL; | |
117 | } | |
118 | } | |
119 | if (temp) | |
120 | $target = wxTheFontList->FindOrCreateFont(temp->GetPointSize(), | |
121 | temp->GetFamily(), | |
122 | temp->GetStyle(), | |
123 | temp->GetWeight(), | |
124 | temp->GetUnderlined(), | |
125 | temp->GetFaceName(), | |
126 | temp->GetEncoding()); | |
127 | else | |
128 | $target = NULL; | |
129 | } | |
130 | ||
131 | ||
e91a9dfc RD |
132 | //--------------------------------------------------------------------------- |
133 | //--------------------------------------------------------------------------- | |
134 | ||
135 | ||
136 | ||
137 | ||
138 |