]> git.saurik.com Git - wxWidgets.git/blob - wxPython/contrib/ogl/_ogldefs.i
added safety check to wxWindow::ReleaseMouse
[wxWidgets.git] / wxPython / contrib / ogl / _ogldefs.i
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;
34 class wxControlPoint;
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;
53 class wxPyControlPoint;
54
55
56 //---------------------------------------------------------------------------
57 // Typemaps just for OGL
58
59
60 // OOR Support
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
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); }
68 %typemap(python, out) wxPseudoMetaFile* { $target = wxPyMake_wxObject($source); }
69 %typemap(python, out) wxArrowHead* { $target = wxPyMake_wxObject($source); }
70
71
72
73
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
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
132 //---------------------------------------------------------------------------
133 //---------------------------------------------------------------------------
134
135
136
137
138