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/dc.h>
13 
14         #include <wx/dc.h>
15         #include <wx/colour.h>
16 
17 
18 PyDoc_STRVAR(doc_wxDCTextColourChanger_Set, "Set(col)\n"
19 "\n"
20 "Set the colour to use.");
21 
22 extern "C" {static PyObject *meth_wxDCTextColourChanger_Set(PyObject *, PyObject *, PyObject *);}
meth_wxDCTextColourChanger_Set(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)23 static PyObject *meth_wxDCTextColourChanger_Set(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
24 {
25     PyObject *sipParseErr = SIP_NULLPTR;
26 
27     {
28         const  ::wxColour* col;
29         int colState = 0;
30          ::wxDCTextColourChanger *sipCpp;
31 
32         static const char *sipKwdList[] = {
33             sipName_col,
34         };
35 
36         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxDCTextColourChanger, &sipCpp, sipType_wxColour, &col, &colState))
37         {
38             PyErr_Clear();
39 
40             Py_BEGIN_ALLOW_THREADS
41             sipCpp->Set(*col);
42             Py_END_ALLOW_THREADS
43             sipReleaseType(const_cast< ::wxColour *>(col),sipType_wxColour,colState);
44 
45             if (PyErr_Occurred())
46                 return 0;
47 
48             Py_INCREF(Py_None);
49             return Py_None;
50         }
51     }
52 
53     /* Raise an exception if the arguments couldn't be parsed. */
54     sipNoMethod(sipParseErr, sipName_DCTextColourChanger, sipName_Set, SIP_NULLPTR);
55 
56     return SIP_NULLPTR;
57 }
58 
59 
60 /* Call the instance's destructor. */
61 extern "C" {static void release_wxDCTextColourChanger(void *, int);}
release_wxDCTextColourChanger(void * sipCppV,int)62 static void release_wxDCTextColourChanger(void *sipCppV, int)
63 {
64     Py_BEGIN_ALLOW_THREADS
65 
66     delete reinterpret_cast< ::wxDCTextColourChanger *>(sipCppV);
67 
68     Py_END_ALLOW_THREADS
69 }
70 
71 
72 extern "C" {static void dealloc_wxDCTextColourChanger(sipSimpleWrapper *);}
dealloc_wxDCTextColourChanger(sipSimpleWrapper * sipSelf)73 static void dealloc_wxDCTextColourChanger(sipSimpleWrapper *sipSelf)
74 {
75     if (sipIsOwnedByPython(sipSelf))
76     {
77         release_wxDCTextColourChanger(sipGetAddress(sipSelf), 0);
78     }
79 }
80 
81 
82 extern "C" {static void *init_type_wxDCTextColourChanger(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
init_type_wxDCTextColourChanger(sipSimpleWrapper *,PyObject * sipArgs,PyObject * sipKwds,PyObject ** sipUnused,PyObject **,PyObject ** sipParseErr)83 static void *init_type_wxDCTextColourChanger(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
84 {
85      ::wxDCTextColourChanger *sipCpp = SIP_NULLPTR;
86 
87     {
88          ::wxDC* dc;
89 
90         static const char *sipKwdList[] = {
91             sipName_dc,
92         };
93 
94         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9", sipType_wxDC, &dc))
95         {
96             PyErr_Clear();
97 
98             Py_BEGIN_ALLOW_THREADS
99             sipCpp = new  ::wxDCTextColourChanger(*dc);
100             Py_END_ALLOW_THREADS
101 
102             if (PyErr_Occurred())
103             {
104                 delete sipCpp;
105                 return SIP_NULLPTR;
106             }
107 
108             return sipCpp;
109         }
110     }
111 
112     {
113          ::wxDC* dc;
114         const  ::wxColour* col;
115         int colState = 0;
116 
117         static const char *sipKwdList[] = {
118             sipName_dc,
119             sipName_col,
120         };
121 
122         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9J1", sipType_wxDC, &dc, sipType_wxColour, &col, &colState))
123         {
124             PyErr_Clear();
125 
126             Py_BEGIN_ALLOW_THREADS
127             sipCpp = new  ::wxDCTextColourChanger(*dc,*col);
128             Py_END_ALLOW_THREADS
129             sipReleaseType(const_cast< ::wxColour *>(col),sipType_wxColour,colState);
130 
131             if (PyErr_Occurred())
132             {
133                 delete sipCpp;
134                 return SIP_NULLPTR;
135             }
136 
137             return sipCpp;
138         }
139     }
140 
141     return SIP_NULLPTR;
142 }
143 
144 
145 static PyMethodDef methods_wxDCTextColourChanger[] = {
146     {SIP_MLNAME_CAST(sipName_Set), SIP_MLMETH_CAST(meth_wxDCTextColourChanger_Set), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxDCTextColourChanger_Set)}
147 };
148 
149 PyDoc_STRVAR(doc_wxDCTextColourChanger, "DCTextColourChanger(dc)\n"
150 "DCTextColourChanger(dc, col)\n"
151 "\n"
152 "wxDCTextColourChanger is a small helper class for setting a foreground\n"
153 "text colour on a wxDC and unsetting it automatically in the\n"
154 "destructor, restoring the previous one.");
155 
156 
157 sipClassTypeDef sipTypeDef__core_wxDCTextColourChanger = {
158     {
159         -1,
160         SIP_NULLPTR,
161         SIP_NULLPTR,
162         SIP_TYPE_CLASS,
163         sipNameNr_wxDCTextColourChanger,
164         {SIP_NULLPTR},
165         SIP_NULLPTR
166     },
167     {
168         sipNameNr_DCTextColourChanger,
169         {0, 0, 1},
170         1, methods_wxDCTextColourChanger,
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_wxDCTextColourChanger,
176     -1,
177     -1,
178     SIP_NULLPTR,
179     SIP_NULLPTR,
180     init_type_wxDCTextColourChanger,
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_wxDCTextColourChanger,
193     SIP_NULLPTR,
194     SIP_NULLPTR,
195     SIP_NULLPTR,
196     release_wxDCTextColourChanger,
197     SIP_NULLPTR,
198     SIP_NULLPTR,
199     SIP_NULLPTR,
200     SIP_NULLPTR,
201     SIP_NULLPTR,
202     SIP_NULLPTR,
203     SIP_NULLPTR
204 };
205