]> git.saurik.com Git - wxWidgets.git/blob - wxPython/include/wx/wxPython/pyclasses.h
compilation fix after removing wxImage(wxImage *) ctor
[wxWidgets.git] / wxPython / include / wx / wxPython / pyclasses.h
1 ////////////////////////////////////////////////////////////////////////////
2 // Name: pyclasses.h
3 // Purpose: wxPython python-aware classes for redirecting virtual method
4 // calls for classes located in the core but that need to be
5 // visible to multiple modules
6 //
7 // Author: Robin Dunn
8 //
9 // Created: 11-Oct-2003
10 // RCS-ID: $Id$
11 // Copyright: (c) 2003 by Total Control Software
12 // Licence: wxWindows license
13 /////////////////////////////////////////////////////////////////////////////
14
15 #ifndef __pyclasses_h__
16 #define __pyclasses_h__
17
18
19
20 //---------------------------------------------------------------------------
21
22 class wxPySizer : public wxSizer {
23 DECLARE_DYNAMIC_CLASS(wxPySizer)
24 public:
25 wxPySizer() : wxSizer() {};
26
27 DEC_PYCALLBACK___pure(RecalcSizes);
28 DEC_PYCALLBACK_wxSize__pure(CalcMin);
29 PYPRIVATE;
30 };
31
32
33 //---------------------------------------------------------------------------
34
35 class wxPyValidator : public wxValidator {
36 DECLARE_DYNAMIC_CLASS(wxPyValidator)
37 public:
38 wxPyValidator() {
39 }
40
41 ~wxPyValidator() {
42 }
43
44 wxObject* Clone() const {
45 wxPyValidator* ptr = NULL;
46 wxPyValidator* self = (wxPyValidator*)this;
47
48 wxPyBlock_t blocked = wxPyBeginBlockThreads();
49 if (wxPyCBH_findCallback(self->m_myInst, "Clone")) {
50 PyObject* ro;
51 ro = wxPyCBH_callCallbackObj(self->m_myInst, Py_BuildValue("()"));
52 if (ro) {
53 wxPyConvertSwigPtr(ro, (void **)&ptr, wxT("wxPyValidator"));
54 Py_DECREF(ro);
55 }
56 }
57 wxPyEndBlockThreads(blocked);
58
59 // This is very dangerous!!! But is the only way I could find
60 // to squash a memory leak. Currently it is okay, but if the
61 // validator architecture in wxWindows ever changes, problems
62 // could arise.
63 delete self;
64 return ptr;
65 }
66
67
68 DEC_PYCALLBACK_BOOL_WXWIN(Validate);
69 DEC_PYCALLBACK_BOOL_(TransferToWindow);
70 DEC_PYCALLBACK_BOOL_(TransferFromWindow);
71
72 PYPRIVATE;
73 };
74
75
76 //---------------------------------------------------------------------------
77
78
79 class wxPyTimer : public wxTimer
80 {
81 public:
82 wxPyTimer(wxEvtHandler *owner=NULL, int id = -1);
83
84 DEC_PYCALLBACK__(Notify);
85 PYPRIVATE;
86 DECLARE_ABSTRACT_CLASS(wxPyTimer)
87 };
88
89
90 //---------------------------------------------------------------------------
91
92
93 class wxPyProcess : public wxProcess {
94 public:
95 wxPyProcess(wxEvtHandler *parent = NULL, int id = -1)
96 : wxProcess(parent, id)
97 {}
98
99 DEC_PYCALLBACK_VOID_INTINT(OnTerminate);
100
101 PYPRIVATE;
102 };
103
104
105 //---------------------------------------------------------------------------
106
107 #ifndef __WXX11__
108 class wxPyDropSource : public wxDropSource {
109 public:
110 #ifndef __WXGTK__
111 wxPyDropSource(wxWindow *win = NULL,
112 const wxCursor &copy = wxNullCursor,
113 const wxCursor &move = wxNullCursor,
114 const wxCursor &none = wxNullCursor)
115 : wxDropSource(win, copy, move, none) {}
116 #else
117 wxPyDropSource(wxWindow *win = NULL,
118 const wxIcon& copy = wxNullIcon,
119 const wxIcon& move = wxNullIcon,
120 const wxIcon& none = wxNullIcon)
121 : wxDropSource(win, copy, move, none) {}
122 #endif
123 ~wxPyDropSource() { }
124
125 DEC_PYCALLBACK_BOOL_DR(GiveFeedback);
126 PYPRIVATE;
127 };
128
129
130 class wxPyDropTarget : public wxDropTarget {
131 public:
132 wxPyDropTarget(wxDataObject *dataObject = NULL)
133 : wxDropTarget(dataObject) {}
134
135 // called when mouse leaves the window: might be used to remove the
136 // feedback which was given in OnEnter()
137 DEC_PYCALLBACK__(OnLeave);
138
139 // called when the mouse enters the window (only once until OnLeave())
140 DEC_PYCALLBACK_DR_2WXCDR(OnEnter);
141
142 // called when the mouse moves in the window - shouldn't take long to
143 // execute or otherwise mouse movement would be too slow
144 DEC_PYCALLBACK_DR_2WXCDR(OnDragOver);
145
146 // called after OnDrop() returns True: you will usually just call
147 // GetData() from here and, probably, also refresh something to update the
148 // new data and, finally, return the code indicating how did the operation
149 // complete (returning default value in case of success and wxDragError on
150 // failure is usually ok)
151 DEC_PYCALLBACK_DR_2WXCDR_pure(OnData);
152
153 // this function is called when data is dropped at position (x, y) - if it
154 // returns True, OnData() will be called immediately afterwards which will
155 // allow to retrieve the data dropped.
156 DEC_PYCALLBACK_BOOL_INTINT(OnDrop);
157
158 PYPRIVATE;
159 };
160
161 #endif
162
163
164 //---------------------------------------------------------------------------
165
166 class wxPyVScrolledWindow;
167 class wxPyVListBox;
168 class wxPyHtmlListBox;
169 class wxPyPanel;
170 class wxPyScrolledWindow;
171 class wxPyPopupTransientWindow;
172 class wxPyPreviewFrame;
173 class wxPyWindow;
174 class wxPyPreviewControlBar;
175 class wxPyPrintPreview;
176 class wxPyListCtrl;
177 class wxPyControl;
178 class wxPyPrintout;
179 class wxGenericDragImage;
180 class wxPyTaskBarIcon;
181
182
183 #ifdef __WXMAC__
184 class wxPopupWindow;
185 class wxTaskBarIconEvent;
186 class wxTaskBarIcon;
187 class wxToggleButton;
188 #endif
189
190 //---------------------------------------------------------------------------
191
192 //---------------------------------------------------------------------------
193 //---------------------------------------------------------------------------
194 #endif