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/printdlg.h>
13 
14         #include <wx/window.h>
15         #include <wx/cmndata.h>
16         #include <wx/object.h>
17         #include <wx/object.h>
18         #include <wx/object.h>
19 
20 
21 class sipwxPageSetupDialog : public  ::wxPageSetupDialog
22 {
23 public:
24     sipwxPageSetupDialog( ::wxWindow*, ::wxPageSetupDialogData*);
25     ~sipwxPageSetupDialog();
26 
27 public:
28     sipSimpleWrapper *sipPySelf;
29 
30 private:
31     sipwxPageSetupDialog(const sipwxPageSetupDialog &);
32     sipwxPageSetupDialog &operator = (const sipwxPageSetupDialog &);
33 };
34 
sipwxPageSetupDialog(::wxWindow * parent,::wxPageSetupDialogData * data)35 sipwxPageSetupDialog::sipwxPageSetupDialog( ::wxWindow*parent, ::wxPageSetupDialogData*data):  ::wxPageSetupDialog(parent,data), sipPySelf(SIP_NULLPTR)
36 {
37 }
38 
~sipwxPageSetupDialog()39 sipwxPageSetupDialog::~sipwxPageSetupDialog()
40 {
41     sipInstanceDestroyedEx(&sipPySelf);
42 }
43 
44 
45 PyDoc_STRVAR(doc_wxPageSetupDialog_GetPageSetupData, "GetPageSetupData() -> PageSetupDialogData\n"
46 "\n"
47 "Returns the wxPageSetupDialogData object associated with the dialog.");
48 
49 extern "C" {static PyObject *meth_wxPageSetupDialog_GetPageSetupData(PyObject *, PyObject *);}
meth_wxPageSetupDialog_GetPageSetupData(PyObject * sipSelf,PyObject * sipArgs)50 static PyObject *meth_wxPageSetupDialog_GetPageSetupData(PyObject *sipSelf, PyObject *sipArgs)
51 {
52     PyObject *sipParseErr = SIP_NULLPTR;
53 
54     {
55          ::wxPageSetupDialog *sipCpp;
56 
57         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxPageSetupDialog, &sipCpp))
58         {
59              ::wxPageSetupDialogData*sipRes;
60 
61             PyErr_Clear();
62 
63             Py_BEGIN_ALLOW_THREADS
64             sipRes = &sipCpp->GetPageSetupData();
65             Py_END_ALLOW_THREADS
66 
67             if (PyErr_Occurred())
68                 return 0;
69 
70             return sipConvertFromType(sipRes,sipType_wxPageSetupDialogData,SIP_NULLPTR);
71         }
72     }
73 
74     /* Raise an exception if the arguments couldn't be parsed. */
75     sipNoMethod(sipParseErr, sipName_PageSetupDialog, sipName_GetPageSetupData, SIP_NULLPTR);
76 
77     return SIP_NULLPTR;
78 }
79 
80 
81 PyDoc_STRVAR(doc_wxPageSetupDialog_ShowModal, "ShowModal() -> int\n"
82 "\n"
83 "Shows the dialog, returning wxID_OK if the user pressed OK, and\n"
84 "wxID_CANCEL otherwise.");
85 
86 extern "C" {static PyObject *meth_wxPageSetupDialog_ShowModal(PyObject *, PyObject *);}
meth_wxPageSetupDialog_ShowModal(PyObject * sipSelf,PyObject * sipArgs)87 static PyObject *meth_wxPageSetupDialog_ShowModal(PyObject *sipSelf, PyObject *sipArgs)
88 {
89     PyObject *sipParseErr = SIP_NULLPTR;
90 
91     {
92          ::wxPageSetupDialog *sipCpp;
93 
94         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxPageSetupDialog, &sipCpp))
95         {
96             int sipRes;
97 
98             PyErr_Clear();
99 
100             Py_BEGIN_ALLOW_THREADS
101             sipRes = sipCpp->ShowModal();
102             Py_END_ALLOW_THREADS
103 
104             if (PyErr_Occurred())
105                 return 0;
106 
107             return SIPLong_FromLong(sipRes);
108         }
109     }
110 
111     /* Raise an exception if the arguments couldn't be parsed. */
112     sipNoMethod(sipParseErr, sipName_PageSetupDialog, sipName_ShowModal, SIP_NULLPTR);
113 
114     return SIP_NULLPTR;
115 }
116 
117 
118 /* Cast a pointer to a type somewhere in its inheritance hierarchy. */
119 extern "C" {static void *cast_wxPageSetupDialog(void *, const sipTypeDef *);}
cast_wxPageSetupDialog(void * sipCppV,const sipTypeDef * targetType)120 static void *cast_wxPageSetupDialog(void *sipCppV, const sipTypeDef *targetType)
121 {
122      ::wxPageSetupDialog *sipCpp = reinterpret_cast< ::wxPageSetupDialog *>(sipCppV);
123 
124     if (targetType == sipType_wxObject)
125         return static_cast< ::wxObject *>(sipCpp);
126 
127     return sipCppV;
128 }
129 
130 
131 /* Call the instance's destructor. */
132 extern "C" {static void release_wxPageSetupDialog(void *, int);}
release_wxPageSetupDialog(void * sipCppV,int sipState)133 static void release_wxPageSetupDialog(void *sipCppV, int sipState)
134 {
135     Py_BEGIN_ALLOW_THREADS
136 
137     if (sipState & SIP_DERIVED_CLASS)
138         delete reinterpret_cast<sipwxPageSetupDialog *>(sipCppV);
139     else
140         delete reinterpret_cast< ::wxPageSetupDialog *>(sipCppV);
141 
142     Py_END_ALLOW_THREADS
143 }
144 
145 
146 extern "C" {static void dealloc_wxPageSetupDialog(sipSimpleWrapper *);}
dealloc_wxPageSetupDialog(sipSimpleWrapper * sipSelf)147 static void dealloc_wxPageSetupDialog(sipSimpleWrapper *sipSelf)
148 {
149     if (sipIsDerivedClass(sipSelf))
150         reinterpret_cast<sipwxPageSetupDialog *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;
151 
152     if (sipIsOwnedByPython(sipSelf))
153     {
154         release_wxPageSetupDialog(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
155     }
156 }
157 
158 
159 extern "C" {static void *init_type_wxPageSetupDialog(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
init_type_wxPageSetupDialog(sipSimpleWrapper * sipSelf,PyObject * sipArgs,PyObject * sipKwds,PyObject ** sipUnused,PyObject **,PyObject ** sipParseErr)160 static void *init_type_wxPageSetupDialog(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
161 {
162     sipwxPageSetupDialog *sipCpp = SIP_NULLPTR;
163 
164     {
165          ::wxWindow* parent;
166          ::wxPageSetupDialogData* data = 0;
167 
168         static const char *sipKwdList[] = {
169             sipName_parent,
170             sipName_data,
171         };
172 
173         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J8|J8", sipType_wxWindow, &parent, sipType_wxPageSetupDialogData, &data))
174         {
175             PyErr_Clear();
176 
177             Py_BEGIN_ALLOW_THREADS
178             sipCpp = new sipwxPageSetupDialog(parent,data);
179             Py_END_ALLOW_THREADS
180 
181             if (PyErr_Occurred())
182             {
183                 delete sipCpp;
184                 return SIP_NULLPTR;
185             }
186 
187             sipCpp->sipPySelf = sipSelf;
188 
189             return sipCpp;
190         }
191     }
192 
193     return SIP_NULLPTR;
194 }
195 
196 
197 /* Define this type's super-types. */
198 static sipEncodedTypeDef supers_wxPageSetupDialog[] = {{358, 255, 1}};
199 
200 
201 static PyMethodDef methods_wxPageSetupDialog[] = {
202     {SIP_MLNAME_CAST(sipName_GetPageSetupData), meth_wxPageSetupDialog_GetPageSetupData, METH_VARARGS, SIP_MLDOC_CAST(doc_wxPageSetupDialog_GetPageSetupData)},
203     {SIP_MLNAME_CAST(sipName_ShowModal), meth_wxPageSetupDialog_ShowModal, METH_VARARGS, SIP_MLDOC_CAST(doc_wxPageSetupDialog_ShowModal)}
204 };
205 
206 sipVariableDef variables_wxPageSetupDialog[] = {
207     {PropertyVariable, sipName_PageSetupData, &methods_wxPageSetupDialog[0], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
208 };
209 
210 PyDoc_STRVAR(doc_wxPageSetupDialog, "PageSetupDialog(parent, data=None)\n"
211 "\n"
212 "This class represents the page setup common dialog.");
213 
214 
215 sipClassTypeDef sipTypeDef__core_wxPageSetupDialog = {
216     {
217         -1,
218         SIP_NULLPTR,
219         SIP_NULLPTR,
220         SIP_TYPE_SCC|SIP_TYPE_CLASS,
221         sipNameNr_wxPageSetupDialog,
222         {SIP_NULLPTR},
223         SIP_NULLPTR
224     },
225     {
226         sipNameNr_PageSetupDialog,
227         {0, 0, 1},
228         2, methods_wxPageSetupDialog,
229         0, SIP_NULLPTR,
230         1, variables_wxPageSetupDialog,
231         {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
232     },
233     doc_wxPageSetupDialog,
234     -1,
235     -1,
236     supers_wxPageSetupDialog,
237     SIP_NULLPTR,
238     init_type_wxPageSetupDialog,
239     SIP_NULLPTR,
240     SIP_NULLPTR,
241 #if PY_MAJOR_VERSION >= 3
242     SIP_NULLPTR,
243     SIP_NULLPTR,
244 #else
245     SIP_NULLPTR,
246     SIP_NULLPTR,
247     SIP_NULLPTR,
248     SIP_NULLPTR,
249 #endif
250     dealloc_wxPageSetupDialog,
251     SIP_NULLPTR,
252     SIP_NULLPTR,
253     SIP_NULLPTR,
254     release_wxPageSetupDialog,
255     cast_wxPageSetupDialog,
256     SIP_NULLPTR,
257     SIP_NULLPTR,
258     SIP_NULLPTR,
259     SIP_NULLPTR,
260     SIP_NULLPTR,
261     SIP_NULLPTR
262 };
263