1 /*
2  * Interface wrapper code.
3  *
4  * Generated by SIP 4.19.16
5  *
6  *     Copyright: (c) 2018 by Total Control Software
7  *     License:   wxWindows License
8  */
9 
10 #include "sipAPI_core.h"
11 
12         #include <wx/dcclient.h>
13 
14         #include <wx/window.h>
15     #include <wx/setup.h>
16     #include <wxPython/wxpy_api.h>
17         #include <wx/gdicmn.h>
18         #include <wx/bitmap.h>
19         #include <wx/gdicmn.h>
20         #include <wx/palette.h>
21         #include <wx/colour.h>
22         #include <wx/gdicmn.h>
23         #include <wx/dc.h>
24         #include <wx/affinematrix2d.h>
25         #include <wx/pen.h>
26         #include "arrayholder.h"
27         #include <wx/brush.h>
28         #include <wx/font.h>
29         #include <wx/dc.h>
30         #include <wx/region.h>
31 
32         #include <wx/icon.h>
33         #include <wx/object.h>
34         #include <wx/object.h>
35         #include <wx/object.h>
36 
37 
38 class sipwxClientDC : public  ::wxClientDC
39 {
40 public:
41     sipwxClientDC( ::wxWindow*);
42     ~sipwxClientDC();
43 
44 public:
45     sipSimpleWrapper *sipPySelf;
46 
47 private:
48     sipwxClientDC(const sipwxClientDC &);
49     sipwxClientDC &operator = (const sipwxClientDC &);
50 };
51 
sipwxClientDC(::wxWindow * window)52 sipwxClientDC::sipwxClientDC( ::wxWindow*window):  ::wxClientDC(window), sipPySelf(SIP_NULLPTR)
53 {
54 }
55 
~sipwxClientDC()56 sipwxClientDC::~sipwxClientDC()
57 {
58     sipInstanceDestroyedEx(&sipPySelf);
59 }
60 
61 
62 /* Cast a pointer to a type somewhere in its inheritance hierarchy. */
63 extern "C" {static void *cast_wxClientDC(void *, const sipTypeDef *);}
cast_wxClientDC(void * sipCppV,const sipTypeDef * targetType)64 static void *cast_wxClientDC(void *sipCppV, const sipTypeDef *targetType)
65 {
66      ::wxClientDC *sipCpp = reinterpret_cast< ::wxClientDC *>(sipCppV);
67 
68     if (targetType == sipType_wxWindowDC)
69         return static_cast< ::wxWindowDC *>(sipCpp);
70 
71     if (targetType == sipType_wxDC)
72         return static_cast< ::wxDC *>(sipCpp);
73 
74     if (targetType == sipType_wxObject)
75         return static_cast< ::wxObject *>(sipCpp);
76 
77     return sipCppV;
78 }
79 
80 
81 /* Call the instance's destructor. */
82 extern "C" {static void release_wxClientDC(void *, int);}
release_wxClientDC(void * sipCppV,int sipState)83 static void release_wxClientDC(void *sipCppV, int sipState)
84 {
85     Py_BEGIN_ALLOW_THREADS
86 
87     if (sipState & SIP_DERIVED_CLASS)
88         delete reinterpret_cast<sipwxClientDC *>(sipCppV);
89     else
90         delete reinterpret_cast< ::wxClientDC *>(sipCppV);
91 
92     Py_END_ALLOW_THREADS
93 }
94 
95 
96 extern "C" {static void dealloc_wxClientDC(sipSimpleWrapper *);}
dealloc_wxClientDC(sipSimpleWrapper * sipSelf)97 static void dealloc_wxClientDC(sipSimpleWrapper *sipSelf)
98 {
99     if (sipIsDerivedClass(sipSelf))
100         reinterpret_cast<sipwxClientDC *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;
101 
102     if (sipIsOwnedByPython(sipSelf))
103     {
104         release_wxClientDC(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
105     }
106 }
107 
108 
109 extern "C" {static void *init_type_wxClientDC(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
init_type_wxClientDC(sipSimpleWrapper * sipSelf,PyObject * sipArgs,PyObject * sipKwds,PyObject ** sipUnused,PyObject **,PyObject ** sipParseErr)110 static void *init_type_wxClientDC(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
111 {
112     sipwxClientDC *sipCpp = SIP_NULLPTR;
113 
114     {
115          ::wxWindow* window;
116 
117         static const char *sipKwdList[] = {
118             sipName_window,
119         };
120 
121         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J8", sipType_wxWindow, &window))
122         {
123 
124         if (!wxPyCheckForApp()) return NULL;
125 
126             PyErr_Clear();
127 
128             Py_BEGIN_ALLOW_THREADS
129             sipCpp = new sipwxClientDC(window);
130             Py_END_ALLOW_THREADS
131 
132             if (PyErr_Occurred())
133             {
134                 delete sipCpp;
135                 return SIP_NULLPTR;
136             }
137 
138             sipCpp->sipPySelf = sipSelf;
139 
140             return sipCpp;
141         }
142     }
143 
144     return SIP_NULLPTR;
145 }
146 
147 
148 /* Define this type's super-types. */
149 static sipEncodedTypeDef supers_wxClientDC[] = {{574, 255, 1}};
150 
151 PyDoc_STRVAR(doc_wxClientDC, "ClientDC(window)\n"
152 "\n"
153 "A wxClientDC must be constructed if an application wishes to paint on\n"
154 "the client area of a window from outside an EVT_PAINT() handler.");
155 
156 
157 sipClassTypeDef sipTypeDef__core_wxClientDC = {
158     {
159         -1,
160         SIP_NULLPTR,
161         SIP_NULLPTR,
162         SIP_TYPE_SCC|SIP_TYPE_CLASS,
163         sipNameNr_wxClientDC,
164         {SIP_NULLPTR},
165         SIP_NULLPTR
166     },
167     {
168         sipNameNr_ClientDC,
169         {0, 0, 1},
170         0, SIP_NULLPTR,
171         0, SIP_NULLPTR,
172         0, SIP_NULLPTR,
173         {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
174     },
175     doc_wxClientDC,
176     -1,
177     -1,
178     supers_wxClientDC,
179     SIP_NULLPTR,
180     init_type_wxClientDC,
181     SIP_NULLPTR,
182     SIP_NULLPTR,
183 #if PY_MAJOR_VERSION >= 3
184     SIP_NULLPTR,
185     SIP_NULLPTR,
186 #else
187     SIP_NULLPTR,
188     SIP_NULLPTR,
189     SIP_NULLPTR,
190     SIP_NULLPTR,
191 #endif
192     dealloc_wxClientDC,
193     SIP_NULLPTR,
194     SIP_NULLPTR,
195     SIP_NULLPTR,
196     release_wxClientDC,
197     cast_wxClientDC,
198     SIP_NULLPTR,
199     SIP_NULLPTR,
200     SIP_NULLPTR,
201     SIP_NULLPTR,
202     SIP_NULLPTR,
203     SIP_NULLPTR
204 };
205