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/intl.h>
13
14 #include <wx/intl.h>
_wxLocale___nonzero__(wxLocale * self)15 int _wxLocale___nonzero__(wxLocale* self)
16 {
17 return self->IsOk();
18 }
_wxLocale___bool__(wxLocale * self)19 int _wxLocale___bool__(wxLocale* self)
20 {
21 return self->IsOk();
22 }
23
24
25 class sipwxLocale : public ::wxLocale
26 {
27 public:
28 sipwxLocale();
29 sipwxLocale(int,int);
30 sipwxLocale(const ::wxString&,const ::wxString&,const ::wxString&,bool);
31 ~sipwxLocale();
32
33 public:
34 sipSimpleWrapper *sipPySelf;
35
36 private:
37 sipwxLocale(const sipwxLocale &);
38 sipwxLocale &operator = (const sipwxLocale &);
39 };
40
sipwxLocale()41 sipwxLocale::sipwxLocale(): ::wxLocale(), sipPySelf(SIP_NULLPTR)
42 {
43 }
44
sipwxLocale(int language,int flags)45 sipwxLocale::sipwxLocale(int language,int flags): ::wxLocale(language,flags), sipPySelf(SIP_NULLPTR)
46 {
47 }
48
sipwxLocale(const::wxString & name,const::wxString & shortName,const::wxString & locale,bool bLoadDefault)49 sipwxLocale::sipwxLocale(const ::wxString& name,const ::wxString& shortName,const ::wxString& locale,bool bLoadDefault): ::wxLocale(name,shortName,locale,bLoadDefault), sipPySelf(SIP_NULLPTR)
50 {
51 }
52
~sipwxLocale()53 sipwxLocale::~sipwxLocale()
54 {
55 sipInstanceDestroyedEx(&sipPySelf);
56 }
57
58
59 PyDoc_STRVAR(doc_wxLocale_AddCatalog, "AddCatalog(domain) -> bool\n"
60 "AddCatalog(domain, msgIdLanguage) -> bool\n"
61 "AddCatalog(domain, msgIdLanguage, msgIdCharset) -> bool\n"
62 "\n"
63 "Calls wxTranslations::AddCatalog(const wxString&).\n"
64 "\n"
65 "");
66
67 extern "C" {static PyObject *meth_wxLocale_AddCatalog(PyObject *, PyObject *, PyObject *);}
meth_wxLocale_AddCatalog(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)68 static PyObject *meth_wxLocale_AddCatalog(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
69 {
70 PyObject *sipParseErr = SIP_NULLPTR;
71
72 {
73 const ::wxString* domain;
74 int domainState = 0;
75 ::wxLocale *sipCpp;
76
77 static const char *sipKwdList[] = {
78 sipName_domain,
79 };
80
81 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxLocale, &sipCpp, sipType_wxString,&domain, &domainState))
82 {
83 bool sipRes;
84
85 PyErr_Clear();
86
87 Py_BEGIN_ALLOW_THREADS
88 sipRes = sipCpp->AddCatalog(*domain);
89 Py_END_ALLOW_THREADS
90 sipReleaseType(const_cast< ::wxString *>(domain),sipType_wxString,domainState);
91
92 if (PyErr_Occurred())
93 return 0;
94
95 return PyBool_FromLong(sipRes);
96 }
97 }
98
99 {
100 const ::wxString* domain;
101 int domainState = 0;
102 ::wxLanguage msgIdLanguage;
103 ::wxLocale *sipCpp;
104
105 static const char *sipKwdList[] = {
106 sipName_domain,
107 sipName_msgIdLanguage,
108 };
109
110 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1E", &sipSelf, sipType_wxLocale, &sipCpp, sipType_wxString,&domain, &domainState, sipType_wxLanguage, &msgIdLanguage))
111 {
112 bool sipRes;
113
114 PyErr_Clear();
115
116 Py_BEGIN_ALLOW_THREADS
117 sipRes = sipCpp->AddCatalog(*domain,msgIdLanguage);
118 Py_END_ALLOW_THREADS
119 sipReleaseType(const_cast< ::wxString *>(domain),sipType_wxString,domainState);
120
121 if (PyErr_Occurred())
122 return 0;
123
124 return PyBool_FromLong(sipRes);
125 }
126 }
127
128 {
129 const ::wxString* domain;
130 int domainState = 0;
131 ::wxLanguage msgIdLanguage;
132 const ::wxString* msgIdCharset;
133 int msgIdCharsetState = 0;
134 ::wxLocale *sipCpp;
135
136 static const char *sipKwdList[] = {
137 sipName_domain,
138 sipName_msgIdLanguage,
139 sipName_msgIdCharset,
140 };
141
142 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1EJ1", &sipSelf, sipType_wxLocale, &sipCpp, sipType_wxString,&domain, &domainState, sipType_wxLanguage, &msgIdLanguage, sipType_wxString,&msgIdCharset, &msgIdCharsetState))
143 {
144 bool sipRes;
145
146 PyErr_Clear();
147
148 Py_BEGIN_ALLOW_THREADS
149 sipRes = sipCpp->AddCatalog(*domain,msgIdLanguage,*msgIdCharset);
150 Py_END_ALLOW_THREADS
151 sipReleaseType(const_cast< ::wxString *>(domain),sipType_wxString,domainState);
152 sipReleaseType(const_cast< ::wxString *>(msgIdCharset),sipType_wxString,msgIdCharsetState);
153
154 if (PyErr_Occurred())
155 return 0;
156
157 return PyBool_FromLong(sipRes);
158 }
159 }
160
161 /* Raise an exception if the arguments couldn't be parsed. */
162 sipNoMethod(sipParseErr, sipName_Locale, sipName_AddCatalog, SIP_NULLPTR);
163
164 return SIP_NULLPTR;
165 }
166
167
168 PyDoc_STRVAR(doc_wxLocale_GetCanonicalName, "GetCanonicalName() -> String\n"
169 "\n"
170 "Returns the canonical form of current locale name.");
171
172 extern "C" {static PyObject *meth_wxLocale_GetCanonicalName(PyObject *, PyObject *);}
meth_wxLocale_GetCanonicalName(PyObject * sipSelf,PyObject * sipArgs)173 static PyObject *meth_wxLocale_GetCanonicalName(PyObject *sipSelf, PyObject *sipArgs)
174 {
175 PyObject *sipParseErr = SIP_NULLPTR;
176
177 {
178 const ::wxLocale *sipCpp;
179
180 if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxLocale, &sipCpp))
181 {
182 ::wxString*sipRes;
183
184 PyErr_Clear();
185
186 Py_BEGIN_ALLOW_THREADS
187 sipRes = new ::wxString(sipCpp->GetCanonicalName());
188 Py_END_ALLOW_THREADS
189
190 if (PyErr_Occurred())
191 return 0;
192
193 return sipConvertFromNewType(sipRes,sipType_wxString,SIP_NULLPTR);
194 }
195 }
196
197 /* Raise an exception if the arguments couldn't be parsed. */
198 sipNoMethod(sipParseErr, sipName_Locale, sipName_GetCanonicalName, SIP_NULLPTR);
199
200 return SIP_NULLPTR;
201 }
202
203
204 PyDoc_STRVAR(doc_wxLocale_GetHeaderValue, "GetHeaderValue(header, domain=EmptyString) -> String\n"
205 "\n"
206 "Calls wxTranslations::GetHeaderValue().");
207
208 extern "C" {static PyObject *meth_wxLocale_GetHeaderValue(PyObject *, PyObject *, PyObject *);}
meth_wxLocale_GetHeaderValue(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)209 static PyObject *meth_wxLocale_GetHeaderValue(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
210 {
211 PyObject *sipParseErr = SIP_NULLPTR;
212
213 {
214 const ::wxString* header;
215 int headerState = 0;
216 const ::wxString& domaindef = wxEmptyString;
217 const ::wxString* domain = &domaindef;
218 int domainState = 0;
219 const ::wxLocale *sipCpp;
220
221 static const char *sipKwdList[] = {
222 sipName_header,
223 sipName_domain,
224 };
225
226 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1|J1", &sipSelf, sipType_wxLocale, &sipCpp, sipType_wxString,&header, &headerState, sipType_wxString,&domain, &domainState))
227 {
228 ::wxString*sipRes;
229
230 PyErr_Clear();
231
232 Py_BEGIN_ALLOW_THREADS
233 sipRes = new ::wxString(sipCpp->GetHeaderValue(*header,*domain));
234 Py_END_ALLOW_THREADS
235 sipReleaseType(const_cast< ::wxString *>(header),sipType_wxString,headerState);
236 sipReleaseType(const_cast< ::wxString *>(domain),sipType_wxString,domainState);
237
238 if (PyErr_Occurred())
239 return 0;
240
241 return sipConvertFromNewType(sipRes,sipType_wxString,SIP_NULLPTR);
242 }
243 }
244
245 /* Raise an exception if the arguments couldn't be parsed. */
246 sipNoMethod(sipParseErr, sipName_Locale, sipName_GetHeaderValue, SIP_NULLPTR);
247
248 return SIP_NULLPTR;
249 }
250
251
252 PyDoc_STRVAR(doc_wxLocale_GetLanguage, "GetLanguage() -> int\n"
253 "\n"
254 "Returns the wxLanguage constant of current language.");
255
256 extern "C" {static PyObject *meth_wxLocale_GetLanguage(PyObject *, PyObject *);}
meth_wxLocale_GetLanguage(PyObject * sipSelf,PyObject * sipArgs)257 static PyObject *meth_wxLocale_GetLanguage(PyObject *sipSelf, PyObject *sipArgs)
258 {
259 PyObject *sipParseErr = SIP_NULLPTR;
260
261 {
262 const ::wxLocale *sipCpp;
263
264 if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxLocale, &sipCpp))
265 {
266 int sipRes;
267
268 PyErr_Clear();
269
270 Py_BEGIN_ALLOW_THREADS
271 sipRes = sipCpp->GetLanguage();
272 Py_END_ALLOW_THREADS
273
274 if (PyErr_Occurred())
275 return 0;
276
277 return SIPLong_FromLong(sipRes);
278 }
279 }
280
281 /* Raise an exception if the arguments couldn't be parsed. */
282 sipNoMethod(sipParseErr, sipName_Locale, sipName_GetLanguage, SIP_NULLPTR);
283
284 return SIP_NULLPTR;
285 }
286
287
288 PyDoc_STRVAR(doc_wxLocale_GetLocale, "GetLocale() -> String\n"
289 "\n"
290 "Returns the locale name as passed to the constructor or Init().");
291
292 extern "C" {static PyObject *meth_wxLocale_GetLocale(PyObject *, PyObject *);}
meth_wxLocale_GetLocale(PyObject * sipSelf,PyObject * sipArgs)293 static PyObject *meth_wxLocale_GetLocale(PyObject *sipSelf, PyObject *sipArgs)
294 {
295 PyObject *sipParseErr = SIP_NULLPTR;
296
297 {
298 const ::wxLocale *sipCpp;
299
300 if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxLocale, &sipCpp))
301 {
302 ::wxString*sipRes;
303
304 PyErr_Clear();
305
306 Py_BEGIN_ALLOW_THREADS
307 sipRes = new ::wxString(sipCpp->GetLocale());
308 Py_END_ALLOW_THREADS
309
310 if (PyErr_Occurred())
311 return 0;
312
313 return sipConvertFromNewType(sipRes,sipType_wxString,SIP_NULLPTR);
314 }
315 }
316
317 /* Raise an exception if the arguments couldn't be parsed. */
318 sipNoMethod(sipParseErr, sipName_Locale, sipName_GetLocale, SIP_NULLPTR);
319
320 return SIP_NULLPTR;
321 }
322
323
324 PyDoc_STRVAR(doc_wxLocale_GetName, "GetName() -> String\n"
325 "\n"
326 "Returns the current short name for the locale (as given to the\n"
327 "constructor or the Init() function).");
328
329 extern "C" {static PyObject *meth_wxLocale_GetName(PyObject *, PyObject *);}
meth_wxLocale_GetName(PyObject * sipSelf,PyObject * sipArgs)330 static PyObject *meth_wxLocale_GetName(PyObject *sipSelf, PyObject *sipArgs)
331 {
332 PyObject *sipParseErr = SIP_NULLPTR;
333
334 {
335 const ::wxLocale *sipCpp;
336
337 if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxLocale, &sipCpp))
338 {
339 ::wxString*sipRes;
340
341 PyErr_Clear();
342
343 Py_BEGIN_ALLOW_THREADS
344 sipRes = new ::wxString(sipCpp->GetName());
345 Py_END_ALLOW_THREADS
346
347 if (PyErr_Occurred())
348 return 0;
349
350 return sipConvertFromNewType(sipRes,sipType_wxString,SIP_NULLPTR);
351 }
352 }
353
354 /* Raise an exception if the arguments couldn't be parsed. */
355 sipNoMethod(sipParseErr, sipName_Locale, sipName_GetName, SIP_NULLPTR);
356
357 return SIP_NULLPTR;
358 }
359
360
361 PyDoc_STRVAR(doc_wxLocale_GetString, "GetString(origString, domain=EmptyString) -> String\n"
362 "GetString(origString, origString2, n, domain=EmptyString) -> String\n"
363 "\n"
364 "Calls wxGetTranslation(const wxString&, const wxString&).\n"
365 "");
366
367 extern "C" {static PyObject *meth_wxLocale_GetString(PyObject *, PyObject *, PyObject *);}
meth_wxLocale_GetString(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)368 static PyObject *meth_wxLocale_GetString(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
369 {
370 PyObject *sipParseErr = SIP_NULLPTR;
371
372 {
373 const ::wxString* origString;
374 int origStringState = 0;
375 const ::wxString& domaindef = wxEmptyString;
376 const ::wxString* domain = &domaindef;
377 int domainState = 0;
378 const ::wxLocale *sipCpp;
379
380 static const char *sipKwdList[] = {
381 sipName_origString,
382 sipName_domain,
383 };
384
385 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1|J1", &sipSelf, sipType_wxLocale, &sipCpp, sipType_wxString,&origString, &origStringState, sipType_wxString,&domain, &domainState))
386 {
387 ::wxString*sipRes;
388
389 PyErr_Clear();
390
391 Py_BEGIN_ALLOW_THREADS
392 sipRes = new ::wxString(sipCpp->GetString(*origString,*domain));
393 Py_END_ALLOW_THREADS
394 sipReleaseType(const_cast< ::wxString *>(origString),sipType_wxString,origStringState);
395 sipReleaseType(const_cast< ::wxString *>(domain),sipType_wxString,domainState);
396
397 if (PyErr_Occurred())
398 return 0;
399
400 return sipConvertFromNewType(sipRes,sipType_wxString,SIP_NULLPTR);
401 }
402 }
403
404 {
405 const ::wxString* origString;
406 int origStringState = 0;
407 const ::wxString* origString2;
408 int origString2State = 0;
409 uint n;
410 const ::wxString& domaindef = wxEmptyString;
411 const ::wxString* domain = &domaindef;
412 int domainState = 0;
413 const ::wxLocale *sipCpp;
414
415 static const char *sipKwdList[] = {
416 sipName_origString,
417 sipName_origString2,
418 sipName_n,
419 sipName_domain,
420 };
421
422 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1J1u|J1", &sipSelf, sipType_wxLocale, &sipCpp, sipType_wxString,&origString, &origStringState, sipType_wxString,&origString2, &origString2State, &n, sipType_wxString,&domain, &domainState))
423 {
424 ::wxString*sipRes;
425
426 PyErr_Clear();
427
428 Py_BEGIN_ALLOW_THREADS
429 sipRes = new ::wxString(sipCpp->GetString(*origString,*origString2,n,*domain));
430 Py_END_ALLOW_THREADS
431 sipReleaseType(const_cast< ::wxString *>(origString),sipType_wxString,origStringState);
432 sipReleaseType(const_cast< ::wxString *>(origString2),sipType_wxString,origString2State);
433 sipReleaseType(const_cast< ::wxString *>(domain),sipType_wxString,domainState);
434
435 if (PyErr_Occurred())
436 return 0;
437
438 return sipConvertFromNewType(sipRes,sipType_wxString,SIP_NULLPTR);
439 }
440 }
441
442 /* Raise an exception if the arguments couldn't be parsed. */
443 sipNoMethod(sipParseErr, sipName_Locale, sipName_GetString, SIP_NULLPTR);
444
445 return SIP_NULLPTR;
446 }
447
448
449 PyDoc_STRVAR(doc_wxLocale_GetSysName, "GetSysName() -> String\n"
450 "\n"
451 "Returns current platform-specific locale name as passed to\n"
452 "setlocale().");
453
454 extern "C" {static PyObject *meth_wxLocale_GetSysName(PyObject *, PyObject *);}
meth_wxLocale_GetSysName(PyObject * sipSelf,PyObject * sipArgs)455 static PyObject *meth_wxLocale_GetSysName(PyObject *sipSelf, PyObject *sipArgs)
456 {
457 PyObject *sipParseErr = SIP_NULLPTR;
458
459 {
460 const ::wxLocale *sipCpp;
461
462 if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxLocale, &sipCpp))
463 {
464 ::wxString*sipRes;
465
466 PyErr_Clear();
467
468 Py_BEGIN_ALLOW_THREADS
469 sipRes = new ::wxString(sipCpp->GetSysName());
470 Py_END_ALLOW_THREADS
471
472 if (PyErr_Occurred())
473 return 0;
474
475 return sipConvertFromNewType(sipRes,sipType_wxString,SIP_NULLPTR);
476 }
477 }
478
479 /* Raise an exception if the arguments couldn't be parsed. */
480 sipNoMethod(sipParseErr, sipName_Locale, sipName_GetSysName, SIP_NULLPTR);
481
482 return SIP_NULLPTR;
483 }
484
485
486 PyDoc_STRVAR(doc_wxLocale_Init, "Init(language=LANGUAGE_DEFAULT, flags=LOCALE_LOAD_DEFAULT) -> bool\n"
487 "Init(name, shortName=EmptyString, locale=EmptyString, bLoadDefault=True) -> bool\n"
488 "\n"
489 "Initializes the wxLocale instance.\n"
490 "");
491
492 extern "C" {static PyObject *meth_wxLocale_Init(PyObject *, PyObject *, PyObject *);}
meth_wxLocale_Init(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)493 static PyObject *meth_wxLocale_Init(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
494 {
495 PyObject *sipParseErr = SIP_NULLPTR;
496
497 {
498 int language = wxLANGUAGE_DEFAULT;
499 int flags = wxLOCALE_LOAD_DEFAULT;
500 ::wxLocale *sipCpp;
501
502 static const char *sipKwdList[] = {
503 sipName_language,
504 sipName_flags,
505 };
506
507 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|ii", &sipSelf, sipType_wxLocale, &sipCpp, &language, &flags))
508 {
509 bool sipRes;
510
511 PyErr_Clear();
512
513 Py_BEGIN_ALLOW_THREADS
514 sipRes = sipCpp->Init(language,flags);
515 Py_END_ALLOW_THREADS
516
517 if (PyErr_Occurred())
518 return 0;
519
520 return PyBool_FromLong(sipRes);
521 }
522 }
523
524 {
525 const ::wxString* name;
526 int nameState = 0;
527 const ::wxString& shortNamedef = wxEmptyString;
528 const ::wxString* shortName = &shortNamedef;
529 int shortNameState = 0;
530 const ::wxString& localedef = wxEmptyString;
531 const ::wxString* locale = &localedef;
532 int localeState = 0;
533 bool bLoadDefault = 1;
534 ::wxLocale *sipCpp;
535
536 static const char *sipKwdList[] = {
537 sipName_name,
538 sipName_shortName,
539 sipName_locale,
540 sipName_bLoadDefault,
541 };
542
543 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1|J1J1b", &sipSelf, sipType_wxLocale, &sipCpp, sipType_wxString,&name, &nameState, sipType_wxString,&shortName, &shortNameState, sipType_wxString,&locale, &localeState, &bLoadDefault))
544 {
545 bool sipRes;
546
547 if (sipDeprecated(sipName_Locale,sipName_Init) < 0)
548 return SIP_NULLPTR;
549
550 PyErr_Clear();
551
552 Py_BEGIN_ALLOW_THREADS
553 sipRes = sipCpp->Init(*name,*shortName,*locale,bLoadDefault);
554 Py_END_ALLOW_THREADS
555 sipReleaseType(const_cast< ::wxString *>(name),sipType_wxString,nameState);
556 sipReleaseType(const_cast< ::wxString *>(shortName),sipType_wxString,shortNameState);
557 sipReleaseType(const_cast< ::wxString *>(locale),sipType_wxString,localeState);
558
559 if (PyErr_Occurred())
560 return 0;
561
562 return PyBool_FromLong(sipRes);
563 }
564 }
565
566 /* Raise an exception if the arguments couldn't be parsed. */
567 sipNoMethod(sipParseErr, sipName_Locale, sipName_Init, SIP_NULLPTR);
568
569 return SIP_NULLPTR;
570 }
571
572
573 PyDoc_STRVAR(doc_wxLocale_IsLoaded, "IsLoaded(domain) -> bool\n"
574 "\n"
575 "Calls wxTranslations::IsLoaded().");
576
577 extern "C" {static PyObject *meth_wxLocale_IsLoaded(PyObject *, PyObject *, PyObject *);}
meth_wxLocale_IsLoaded(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)578 static PyObject *meth_wxLocale_IsLoaded(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
579 {
580 PyObject *sipParseErr = SIP_NULLPTR;
581
582 {
583 const ::wxString* domain;
584 int domainState = 0;
585 const ::wxLocale *sipCpp;
586
587 static const char *sipKwdList[] = {
588 sipName_domain,
589 };
590
591 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxLocale, &sipCpp, sipType_wxString,&domain, &domainState))
592 {
593 bool sipRes;
594
595 PyErr_Clear();
596
597 Py_BEGIN_ALLOW_THREADS
598 sipRes = sipCpp->IsLoaded(*domain);
599 Py_END_ALLOW_THREADS
600 sipReleaseType(const_cast< ::wxString *>(domain),sipType_wxString,domainState);
601
602 if (PyErr_Occurred())
603 return 0;
604
605 return PyBool_FromLong(sipRes);
606 }
607 }
608
609 /* Raise an exception if the arguments couldn't be parsed. */
610 sipNoMethod(sipParseErr, sipName_Locale, sipName_IsLoaded, SIP_NULLPTR);
611
612 return SIP_NULLPTR;
613 }
614
615
616 PyDoc_STRVAR(doc_wxLocale_IsOk, "IsOk() -> bool\n"
617 "\n"
618 "Returns true if the locale could be set successfully.");
619
620 extern "C" {static PyObject *meth_wxLocale_IsOk(PyObject *, PyObject *);}
meth_wxLocale_IsOk(PyObject * sipSelf,PyObject * sipArgs)621 static PyObject *meth_wxLocale_IsOk(PyObject *sipSelf, PyObject *sipArgs)
622 {
623 PyObject *sipParseErr = SIP_NULLPTR;
624
625 {
626 const ::wxLocale *sipCpp;
627
628 if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxLocale, &sipCpp))
629 {
630 bool sipRes;
631
632 PyErr_Clear();
633
634 Py_BEGIN_ALLOW_THREADS
635 sipRes = sipCpp->IsOk();
636 Py_END_ALLOW_THREADS
637
638 if (PyErr_Occurred())
639 return 0;
640
641 return PyBool_FromLong(sipRes);
642 }
643 }
644
645 /* Raise an exception if the arguments couldn't be parsed. */
646 sipNoMethod(sipParseErr, sipName_Locale, sipName_IsOk, SIP_NULLPTR);
647
648 return SIP_NULLPTR;
649 }
650
651
652 PyDoc_STRVAR(doc_wxLocale_AddCatalogLookupPathPrefix, "AddCatalogLookupPathPrefix(prefix)\n"
653 "\n"
654 "Calls wxFileTranslationsLoader::AddCatalogLookupPathPrefix().");
655
656 extern "C" {static PyObject *meth_wxLocale_AddCatalogLookupPathPrefix(PyObject *, PyObject *, PyObject *);}
meth_wxLocale_AddCatalogLookupPathPrefix(PyObject *,PyObject * sipArgs,PyObject * sipKwds)657 static PyObject *meth_wxLocale_AddCatalogLookupPathPrefix(PyObject *, PyObject *sipArgs, PyObject *sipKwds)
658 {
659 PyObject *sipParseErr = SIP_NULLPTR;
660
661 {
662 const ::wxString* prefix;
663 int prefixState = 0;
664
665 static const char *sipKwdList[] = {
666 sipName_prefix,
667 };
668
669 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "J1", sipType_wxString,&prefix, &prefixState))
670 {
671 PyErr_Clear();
672
673 Py_BEGIN_ALLOW_THREADS
674 ::wxLocale::AddCatalogLookupPathPrefix(*prefix);
675 Py_END_ALLOW_THREADS
676 sipReleaseType(const_cast< ::wxString *>(prefix),sipType_wxString,prefixState);
677
678 if (PyErr_Occurred())
679 return 0;
680
681 Py_INCREF(Py_None);
682 return Py_None;
683 }
684 }
685
686 /* Raise an exception if the arguments couldn't be parsed. */
687 sipNoMethod(sipParseErr, sipName_Locale, sipName_AddCatalogLookupPathPrefix, SIP_NULLPTR);
688
689 return SIP_NULLPTR;
690 }
691
692
693 PyDoc_STRVAR(doc_wxLocale_AddLanguage, "AddLanguage(info)\n"
694 "\n"
695 "Adds custom, user-defined language to the database of known languages.");
696
697 extern "C" {static PyObject *meth_wxLocale_AddLanguage(PyObject *, PyObject *, PyObject *);}
meth_wxLocale_AddLanguage(PyObject *,PyObject * sipArgs,PyObject * sipKwds)698 static PyObject *meth_wxLocale_AddLanguage(PyObject *, PyObject *sipArgs, PyObject *sipKwds)
699 {
700 PyObject *sipParseErr = SIP_NULLPTR;
701
702 {
703 const ::wxLanguageInfo* info;
704
705 static const char *sipKwdList[] = {
706 sipName_info,
707 };
708
709 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "J9", sipType_wxLanguageInfo, &info))
710 {
711 PyErr_Clear();
712
713 Py_BEGIN_ALLOW_THREADS
714 ::wxLocale::AddLanguage(*info);
715 Py_END_ALLOW_THREADS
716
717 if (PyErr_Occurred())
718 return 0;
719
720 Py_INCREF(Py_None);
721 return Py_None;
722 }
723 }
724
725 /* Raise an exception if the arguments couldn't be parsed. */
726 sipNoMethod(sipParseErr, sipName_Locale, sipName_AddLanguage, SIP_NULLPTR);
727
728 return SIP_NULLPTR;
729 }
730
731
732 PyDoc_STRVAR(doc_wxLocale_FindLanguageInfo, "FindLanguageInfo(locale) -> LanguageInfo\n"
733 "\n"
734 "This function may be used to find the language description structure\n"
735 "for the given locale, specified either as a two letter ISO language\n"
736 "code (for example, \"pt\"), a language code followed by the country code\n"
737 "(\"pt_BR\") or a full, human readable, language description\n"
738 "(\"Portuguese-Brazil\").");
739
740 extern "C" {static PyObject *meth_wxLocale_FindLanguageInfo(PyObject *, PyObject *, PyObject *);}
meth_wxLocale_FindLanguageInfo(PyObject *,PyObject * sipArgs,PyObject * sipKwds)741 static PyObject *meth_wxLocale_FindLanguageInfo(PyObject *, PyObject *sipArgs, PyObject *sipKwds)
742 {
743 PyObject *sipParseErr = SIP_NULLPTR;
744
745 {
746 const ::wxString* locale;
747 int localeState = 0;
748
749 static const char *sipKwdList[] = {
750 sipName_locale,
751 };
752
753 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "J1", sipType_wxString,&locale, &localeState))
754 {
755 const ::wxLanguageInfo*sipRes;
756
757 PyErr_Clear();
758
759 Py_BEGIN_ALLOW_THREADS
760 sipRes = ::wxLocale::FindLanguageInfo(*locale);
761 Py_END_ALLOW_THREADS
762 sipReleaseType(const_cast< ::wxString *>(locale),sipType_wxString,localeState);
763
764 if (PyErr_Occurred())
765 return 0;
766
767 return sipConvertFromType(const_cast< ::wxLanguageInfo *>(sipRes),sipType_wxLanguageInfo,SIP_NULLPTR);
768 }
769 }
770
771 /* Raise an exception if the arguments couldn't be parsed. */
772 sipNoMethod(sipParseErr, sipName_Locale, sipName_FindLanguageInfo, SIP_NULLPTR);
773
774 return SIP_NULLPTR;
775 }
776
777
778 PyDoc_STRVAR(doc_wxLocale_GetLanguageInfo, "GetLanguageInfo(lang) -> LanguageInfo\n"
779 "\n"
780 "Returns a pointer to wxLanguageInfo structure containing information\n"
781 "about the given language or NULL if this language is unknown.");
782
783 extern "C" {static PyObject *meth_wxLocale_GetLanguageInfo(PyObject *, PyObject *, PyObject *);}
meth_wxLocale_GetLanguageInfo(PyObject *,PyObject * sipArgs,PyObject * sipKwds)784 static PyObject *meth_wxLocale_GetLanguageInfo(PyObject *, PyObject *sipArgs, PyObject *sipKwds)
785 {
786 PyObject *sipParseErr = SIP_NULLPTR;
787
788 {
789 int lang;
790
791 static const char *sipKwdList[] = {
792 sipName_lang,
793 };
794
795 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "i", &lang))
796 {
797 const ::wxLanguageInfo*sipRes;
798
799 PyErr_Clear();
800
801 Py_BEGIN_ALLOW_THREADS
802 sipRes = ::wxLocale::GetLanguageInfo(lang);
803 Py_END_ALLOW_THREADS
804
805 if (PyErr_Occurred())
806 return 0;
807
808 return sipConvertFromType(const_cast< ::wxLanguageInfo *>(sipRes),sipType_wxLanguageInfo,SIP_NULLPTR);
809 }
810 }
811
812 /* Raise an exception if the arguments couldn't be parsed. */
813 sipNoMethod(sipParseErr, sipName_Locale, sipName_GetLanguageInfo, SIP_NULLPTR);
814
815 return SIP_NULLPTR;
816 }
817
818
819 PyDoc_STRVAR(doc_wxLocale_GetLanguageName, "GetLanguageName(lang) -> String\n"
820 "\n"
821 "Returns English name of the given language or empty string if this\n"
822 "language is unknown.");
823
824 extern "C" {static PyObject *meth_wxLocale_GetLanguageName(PyObject *, PyObject *, PyObject *);}
meth_wxLocale_GetLanguageName(PyObject *,PyObject * sipArgs,PyObject * sipKwds)825 static PyObject *meth_wxLocale_GetLanguageName(PyObject *, PyObject *sipArgs, PyObject *sipKwds)
826 {
827 PyObject *sipParseErr = SIP_NULLPTR;
828
829 {
830 int lang;
831
832 static const char *sipKwdList[] = {
833 sipName_lang,
834 };
835
836 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "i", &lang))
837 {
838 ::wxString*sipRes;
839
840 PyErr_Clear();
841
842 Py_BEGIN_ALLOW_THREADS
843 sipRes = new ::wxString( ::wxLocale::GetLanguageName(lang));
844 Py_END_ALLOW_THREADS
845
846 if (PyErr_Occurred())
847 return 0;
848
849 return sipConvertFromNewType(sipRes,sipType_wxString,SIP_NULLPTR);
850 }
851 }
852
853 /* Raise an exception if the arguments couldn't be parsed. */
854 sipNoMethod(sipParseErr, sipName_Locale, sipName_GetLanguageName, SIP_NULLPTR);
855
856 return SIP_NULLPTR;
857 }
858
859
860 PyDoc_STRVAR(doc_wxLocale_GetLanguageCanonicalName, "GetLanguageCanonicalName(lang) -> String\n"
861 "\n"
862 "Returns canonical name (see GetCanonicalName()) of the given language\n"
863 "or empty string if this language is unknown.");
864
865 extern "C" {static PyObject *meth_wxLocale_GetLanguageCanonicalName(PyObject *, PyObject *, PyObject *);}
meth_wxLocale_GetLanguageCanonicalName(PyObject *,PyObject * sipArgs,PyObject * sipKwds)866 static PyObject *meth_wxLocale_GetLanguageCanonicalName(PyObject *, PyObject *sipArgs, PyObject *sipKwds)
867 {
868 PyObject *sipParseErr = SIP_NULLPTR;
869
870 {
871 int lang;
872
873 static const char *sipKwdList[] = {
874 sipName_lang,
875 };
876
877 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "i", &lang))
878 {
879 ::wxString*sipRes;
880
881 PyErr_Clear();
882
883 Py_BEGIN_ALLOW_THREADS
884 sipRes = new ::wxString( ::wxLocale::GetLanguageCanonicalName(lang));
885 Py_END_ALLOW_THREADS
886
887 if (PyErr_Occurred())
888 return 0;
889
890 return sipConvertFromNewType(sipRes,sipType_wxString,SIP_NULLPTR);
891 }
892 }
893
894 /* Raise an exception if the arguments couldn't be parsed. */
895 sipNoMethod(sipParseErr, sipName_Locale, sipName_GetLanguageCanonicalName, SIP_NULLPTR);
896
897 return SIP_NULLPTR;
898 }
899
900
901 PyDoc_STRVAR(doc_wxLocale_GetSystemEncoding, "GetSystemEncoding() -> FontEncoding\n"
902 "\n"
903 "Tries to detect the user's default font encoding.");
904
905 extern "C" {static PyObject *meth_wxLocale_GetSystemEncoding(PyObject *, PyObject *);}
meth_wxLocale_GetSystemEncoding(PyObject *,PyObject * sipArgs)906 static PyObject *meth_wxLocale_GetSystemEncoding(PyObject *, PyObject *sipArgs)
907 {
908 PyObject *sipParseErr = SIP_NULLPTR;
909
910 {
911 if (sipParseArgs(&sipParseErr, sipArgs, ""))
912 {
913 ::wxFontEncoding sipRes;
914
915 PyErr_Clear();
916
917 Py_BEGIN_ALLOW_THREADS
918 sipRes = ::wxLocale::GetSystemEncoding();
919 Py_END_ALLOW_THREADS
920
921 if (PyErr_Occurred())
922 return 0;
923
924 return sipConvertFromEnum(static_cast<int>(sipRes), sipType_wxFontEncoding);
925 }
926 }
927
928 /* Raise an exception if the arguments couldn't be parsed. */
929 sipNoMethod(sipParseErr, sipName_Locale, sipName_GetSystemEncoding, SIP_NULLPTR);
930
931 return SIP_NULLPTR;
932 }
933
934
935 PyDoc_STRVAR(doc_wxLocale_GetSystemEncodingName, "GetSystemEncodingName() -> String\n"
936 "\n"
937 "Tries to detect the name of the user's default font encoding.");
938
939 extern "C" {static PyObject *meth_wxLocale_GetSystemEncodingName(PyObject *, PyObject *);}
meth_wxLocale_GetSystemEncodingName(PyObject *,PyObject * sipArgs)940 static PyObject *meth_wxLocale_GetSystemEncodingName(PyObject *, PyObject *sipArgs)
941 {
942 PyObject *sipParseErr = SIP_NULLPTR;
943
944 {
945 if (sipParseArgs(&sipParseErr, sipArgs, ""))
946 {
947 ::wxString*sipRes;
948
949 PyErr_Clear();
950
951 Py_BEGIN_ALLOW_THREADS
952 sipRes = new ::wxString( ::wxLocale::GetSystemEncodingName());
953 Py_END_ALLOW_THREADS
954
955 if (PyErr_Occurred())
956 return 0;
957
958 return sipConvertFromNewType(sipRes,sipType_wxString,SIP_NULLPTR);
959 }
960 }
961
962 /* Raise an exception if the arguments couldn't be parsed. */
963 sipNoMethod(sipParseErr, sipName_Locale, sipName_GetSystemEncodingName, SIP_NULLPTR);
964
965 return SIP_NULLPTR;
966 }
967
968
969 PyDoc_STRVAR(doc_wxLocale_GetSystemLanguage, "GetSystemLanguage() -> int\n"
970 "\n"
971 "Tries to detect the user's default locale setting.");
972
973 extern "C" {static PyObject *meth_wxLocale_GetSystemLanguage(PyObject *, PyObject *);}
meth_wxLocale_GetSystemLanguage(PyObject *,PyObject * sipArgs)974 static PyObject *meth_wxLocale_GetSystemLanguage(PyObject *, PyObject *sipArgs)
975 {
976 PyObject *sipParseErr = SIP_NULLPTR;
977
978 {
979 if (sipParseArgs(&sipParseErr, sipArgs, ""))
980 {
981 int sipRes;
982
983 PyErr_Clear();
984
985 Py_BEGIN_ALLOW_THREADS
986 sipRes = ::wxLocale::GetSystemLanguage();
987 Py_END_ALLOW_THREADS
988
989 if (PyErr_Occurred())
990 return 0;
991
992 return SIPLong_FromLong(sipRes);
993 }
994 }
995
996 /* Raise an exception if the arguments couldn't be parsed. */
997 sipNoMethod(sipParseErr, sipName_Locale, sipName_GetSystemLanguage, SIP_NULLPTR);
998
999 return SIP_NULLPTR;
1000 }
1001
1002
1003 PyDoc_STRVAR(doc_wxLocale_GetInfo, "GetInfo(index, cat=LOCALE_CAT_DEFAULT) -> String\n"
1004 "\n"
1005 "Get the values of the given locale-dependent datum.");
1006
1007 extern "C" {static PyObject *meth_wxLocale_GetInfo(PyObject *, PyObject *, PyObject *);}
meth_wxLocale_GetInfo(PyObject *,PyObject * sipArgs,PyObject * sipKwds)1008 static PyObject *meth_wxLocale_GetInfo(PyObject *, PyObject *sipArgs, PyObject *sipKwds)
1009 {
1010 PyObject *sipParseErr = SIP_NULLPTR;
1011
1012 {
1013 ::wxLocaleInfo index;
1014 ::wxLocaleCategory cat = wxLOCALE_CAT_DEFAULT;
1015
1016 static const char *sipKwdList[] = {
1017 sipName_index,
1018 sipName_cat,
1019 };
1020
1021 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "E|E", sipType_wxLocaleInfo, &index, sipType_wxLocaleCategory, &cat))
1022 {
1023 ::wxString*sipRes;
1024
1025 PyErr_Clear();
1026
1027 Py_BEGIN_ALLOW_THREADS
1028 sipRes = new ::wxString( ::wxLocale::GetInfo(index,cat));
1029 Py_END_ALLOW_THREADS
1030
1031 if (PyErr_Occurred())
1032 return 0;
1033
1034 return sipConvertFromNewType(sipRes,sipType_wxString,SIP_NULLPTR);
1035 }
1036 }
1037
1038 /* Raise an exception if the arguments couldn't be parsed. */
1039 sipNoMethod(sipParseErr, sipName_Locale, sipName_GetInfo, SIP_NULLPTR);
1040
1041 return SIP_NULLPTR;
1042 }
1043
1044
1045 PyDoc_STRVAR(doc_wxLocale_IsAvailable, "IsAvailable(lang) -> bool\n"
1046 "\n"
1047 "Check whether the operating system and/or C run time environment\n"
1048 "supports this locale.");
1049
1050 extern "C" {static PyObject *meth_wxLocale_IsAvailable(PyObject *, PyObject *, PyObject *);}
meth_wxLocale_IsAvailable(PyObject *,PyObject * sipArgs,PyObject * sipKwds)1051 static PyObject *meth_wxLocale_IsAvailable(PyObject *, PyObject *sipArgs, PyObject *sipKwds)
1052 {
1053 PyObject *sipParseErr = SIP_NULLPTR;
1054
1055 {
1056 int lang;
1057
1058 static const char *sipKwdList[] = {
1059 sipName_lang,
1060 };
1061
1062 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "i", &lang))
1063 {
1064 bool sipRes;
1065
1066 PyErr_Clear();
1067
1068 Py_BEGIN_ALLOW_THREADS
1069 sipRes = ::wxLocale::IsAvailable(lang);
1070 Py_END_ALLOW_THREADS
1071
1072 if (PyErr_Occurred())
1073 return 0;
1074
1075 return PyBool_FromLong(sipRes);
1076 }
1077 }
1078
1079 /* Raise an exception if the arguments couldn't be parsed. */
1080 sipNoMethod(sipParseErr, sipName_Locale, sipName_IsAvailable, SIP_NULLPTR);
1081
1082 return SIP_NULLPTR;
1083 }
1084
1085
1086 extern "C" {static int slot_wxLocale___bool__(PyObject *);}
slot_wxLocale___bool__(PyObject * sipSelf)1087 static int slot_wxLocale___bool__(PyObject *sipSelf)
1088 {
1089 ::wxLocale *sipCpp = reinterpret_cast< ::wxLocale *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_wxLocale));
1090
1091 if (!sipCpp)
1092 return -1;
1093
1094
1095 {
1096 {
1097 int sipRes = 0;
1098 int sipIsErr = 0;
1099
1100 PyErr_Clear();
1101 Py_BEGIN_ALLOW_THREADS
1102 sipRes = _wxLocale___bool__(sipCpp);
1103 Py_END_ALLOW_THREADS
1104 if (PyErr_Occurred()) sipIsErr = 1;
1105
1106 if (sipIsErr)
1107 return -1;
1108
1109 return sipRes;
1110 }
1111 }
1112
1113 return 0;
1114 }
1115
1116
1117 extern "C" {static int slot_wxLocale___nonzero__(PyObject *);}
slot_wxLocale___nonzero__(PyObject * sipSelf)1118 static int slot_wxLocale___nonzero__(PyObject *sipSelf)
1119 {
1120 ::wxLocale *sipCpp = reinterpret_cast< ::wxLocale *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_wxLocale));
1121
1122 if (!sipCpp)
1123 return -1;
1124
1125
1126 {
1127 {
1128 int sipRes = 0;
1129 int sipIsErr = 0;
1130
1131 PyErr_Clear();
1132 Py_BEGIN_ALLOW_THREADS
1133 sipRes = _wxLocale___nonzero__(sipCpp);
1134 Py_END_ALLOW_THREADS
1135 if (PyErr_Occurred()) sipIsErr = 1;
1136
1137 if (sipIsErr)
1138 return -1;
1139
1140 return sipRes;
1141 }
1142 }
1143
1144 return 0;
1145 }
1146
1147
1148 /* Call the instance's destructor. */
1149 extern "C" {static void release_wxLocale(void *, int);}
release_wxLocale(void * sipCppV,int sipState)1150 static void release_wxLocale(void *sipCppV, int sipState)
1151 {
1152 Py_BEGIN_ALLOW_THREADS
1153
1154 if (sipState & SIP_DERIVED_CLASS)
1155 delete reinterpret_cast<sipwxLocale *>(sipCppV);
1156 else
1157 delete reinterpret_cast< ::wxLocale *>(sipCppV);
1158
1159 Py_END_ALLOW_THREADS
1160 }
1161
1162
1163 extern "C" {static void dealloc_wxLocale(sipSimpleWrapper *);}
dealloc_wxLocale(sipSimpleWrapper * sipSelf)1164 static void dealloc_wxLocale(sipSimpleWrapper *sipSelf)
1165 {
1166 if (sipIsDerivedClass(sipSelf))
1167 reinterpret_cast<sipwxLocale *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;
1168
1169 if (sipIsOwnedByPython(sipSelf))
1170 {
1171 release_wxLocale(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
1172 }
1173 }
1174
1175
1176 extern "C" {static void *init_type_wxLocale(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
init_type_wxLocale(sipSimpleWrapper * sipSelf,PyObject * sipArgs,PyObject * sipKwds,PyObject ** sipUnused,PyObject **,PyObject ** sipParseErr)1177 static void *init_type_wxLocale(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
1178 {
1179 sipwxLocale *sipCpp = SIP_NULLPTR;
1180
1181 {
1182 if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
1183 {
1184 PyErr_Clear();
1185
1186 Py_BEGIN_ALLOW_THREADS
1187 sipCpp = new sipwxLocale();
1188 Py_END_ALLOW_THREADS
1189
1190 if (PyErr_Occurred())
1191 {
1192 delete sipCpp;
1193 return SIP_NULLPTR;
1194 }
1195
1196 sipCpp->sipPySelf = sipSelf;
1197
1198 return sipCpp;
1199 }
1200 }
1201
1202 {
1203 int language;
1204 int flags = wxLOCALE_LOAD_DEFAULT;
1205
1206 static const char *sipKwdList[] = {
1207 sipName_language,
1208 sipName_flags,
1209 };
1210
1211 if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "i|i", &language, &flags))
1212 {
1213 PyErr_Clear();
1214
1215 Py_BEGIN_ALLOW_THREADS
1216 sipCpp = new sipwxLocale(language,flags);
1217 Py_END_ALLOW_THREADS
1218
1219 if (PyErr_Occurred())
1220 {
1221 delete sipCpp;
1222 return SIP_NULLPTR;
1223 }
1224
1225 sipCpp->sipPySelf = sipSelf;
1226
1227 return sipCpp;
1228 }
1229 }
1230
1231 {
1232 const ::wxString* name;
1233 int nameState = 0;
1234 const ::wxString& shortNamedef = wxEmptyString;
1235 const ::wxString* shortName = &shortNamedef;
1236 int shortNameState = 0;
1237 const ::wxString& localedef = wxEmptyString;
1238 const ::wxString* locale = &localedef;
1239 int localeState = 0;
1240 bool bLoadDefault = 1;
1241
1242 static const char *sipKwdList[] = {
1243 sipName_name,
1244 sipName_shortName,
1245 sipName_locale,
1246 sipName_bLoadDefault,
1247 };
1248
1249 if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J1|J1J1b", sipType_wxString,&name, &nameState, sipType_wxString,&shortName, &shortNameState, sipType_wxString,&locale, &localeState, &bLoadDefault))
1250 {
1251 PyErr_Clear();
1252
1253 Py_BEGIN_ALLOW_THREADS
1254 sipCpp = new sipwxLocale(*name,*shortName,*locale,bLoadDefault);
1255 Py_END_ALLOW_THREADS
1256 sipReleaseType(const_cast< ::wxString *>(name),sipType_wxString,nameState);
1257 sipReleaseType(const_cast< ::wxString *>(shortName),sipType_wxString,shortNameState);
1258 sipReleaseType(const_cast< ::wxString *>(locale),sipType_wxString,localeState);
1259
1260 if (PyErr_Occurred())
1261 {
1262 delete sipCpp;
1263 return SIP_NULLPTR;
1264 }
1265
1266 sipCpp->sipPySelf = sipSelf;
1267
1268 return sipCpp;
1269 }
1270 }
1271
1272 return SIP_NULLPTR;
1273 }
1274
1275
1276 /* Define this type's Python slots. */
1277 static sipPySlotDef slots_wxLocale[] = {
1278 {(void *)slot_wxLocale___bool__, bool_slot},
1279 {(void *)slot_wxLocale___nonzero__, bool_slot},
1280 {0, (sipPySlotType)0}
1281 };
1282
1283
1284 static PyMethodDef methods_wxLocale[] = {
1285 {SIP_MLNAME_CAST(sipName_AddCatalog), SIP_MLMETH_CAST(meth_wxLocale_AddCatalog), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxLocale_AddCatalog)},
1286 {SIP_MLNAME_CAST(sipName_AddCatalogLookupPathPrefix), SIP_MLMETH_CAST(meth_wxLocale_AddCatalogLookupPathPrefix), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxLocale_AddCatalogLookupPathPrefix)},
1287 {SIP_MLNAME_CAST(sipName_AddLanguage), SIP_MLMETH_CAST(meth_wxLocale_AddLanguage), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxLocale_AddLanguage)},
1288 {SIP_MLNAME_CAST(sipName_FindLanguageInfo), SIP_MLMETH_CAST(meth_wxLocale_FindLanguageInfo), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxLocale_FindLanguageInfo)},
1289 {SIP_MLNAME_CAST(sipName_GetCanonicalName), meth_wxLocale_GetCanonicalName, METH_VARARGS, SIP_MLDOC_CAST(doc_wxLocale_GetCanonicalName)},
1290 {SIP_MLNAME_CAST(sipName_GetHeaderValue), SIP_MLMETH_CAST(meth_wxLocale_GetHeaderValue), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxLocale_GetHeaderValue)},
1291 {SIP_MLNAME_CAST(sipName_GetInfo), SIP_MLMETH_CAST(meth_wxLocale_GetInfo), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxLocale_GetInfo)},
1292 {SIP_MLNAME_CAST(sipName_GetLanguage), meth_wxLocale_GetLanguage, METH_VARARGS, SIP_MLDOC_CAST(doc_wxLocale_GetLanguage)},
1293 {SIP_MLNAME_CAST(sipName_GetLanguageCanonicalName), SIP_MLMETH_CAST(meth_wxLocale_GetLanguageCanonicalName), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxLocale_GetLanguageCanonicalName)},
1294 {SIP_MLNAME_CAST(sipName_GetLanguageInfo), SIP_MLMETH_CAST(meth_wxLocale_GetLanguageInfo), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxLocale_GetLanguageInfo)},
1295 {SIP_MLNAME_CAST(sipName_GetLanguageName), SIP_MLMETH_CAST(meth_wxLocale_GetLanguageName), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxLocale_GetLanguageName)},
1296 {SIP_MLNAME_CAST(sipName_GetLocale), meth_wxLocale_GetLocale, METH_VARARGS, SIP_MLDOC_CAST(doc_wxLocale_GetLocale)},
1297 {SIP_MLNAME_CAST(sipName_GetName), meth_wxLocale_GetName, METH_VARARGS, SIP_MLDOC_CAST(doc_wxLocale_GetName)},
1298 {SIP_MLNAME_CAST(sipName_GetString), SIP_MLMETH_CAST(meth_wxLocale_GetString), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxLocale_GetString)},
1299 {SIP_MLNAME_CAST(sipName_GetSysName), meth_wxLocale_GetSysName, METH_VARARGS, SIP_MLDOC_CAST(doc_wxLocale_GetSysName)},
1300 {SIP_MLNAME_CAST(sipName_GetSystemEncoding), meth_wxLocale_GetSystemEncoding, METH_VARARGS, SIP_MLDOC_CAST(doc_wxLocale_GetSystemEncoding)},
1301 {SIP_MLNAME_CAST(sipName_GetSystemEncodingName), meth_wxLocale_GetSystemEncodingName, METH_VARARGS, SIP_MLDOC_CAST(doc_wxLocale_GetSystemEncodingName)},
1302 {SIP_MLNAME_CAST(sipName_GetSystemLanguage), meth_wxLocale_GetSystemLanguage, METH_VARARGS, SIP_MLDOC_CAST(doc_wxLocale_GetSystemLanguage)},
1303 {SIP_MLNAME_CAST(sipName_Init), SIP_MLMETH_CAST(meth_wxLocale_Init), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxLocale_Init)},
1304 {SIP_MLNAME_CAST(sipName_IsAvailable), SIP_MLMETH_CAST(meth_wxLocale_IsAvailable), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxLocale_IsAvailable)},
1305 {SIP_MLNAME_CAST(sipName_IsLoaded), SIP_MLMETH_CAST(meth_wxLocale_IsLoaded), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxLocale_IsLoaded)},
1306 {SIP_MLNAME_CAST(sipName_IsOk), meth_wxLocale_IsOk, METH_VARARGS, SIP_MLDOC_CAST(doc_wxLocale_IsOk)}
1307 };
1308
1309 sipVariableDef variables_wxLocale[] = {
1310 {PropertyVariable, sipName_SysName, &methods_wxLocale[14], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
1311 {PropertyVariable, sipName_Name, &methods_wxLocale[12], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
1312 {PropertyVariable, sipName_Locale, &methods_wxLocale[11], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
1313 {PropertyVariable, sipName_Language, &methods_wxLocale[7], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
1314 {PropertyVariable, sipName_CanonicalName, &methods_wxLocale[4], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
1315 };
1316
1317 PyDoc_STRVAR(doc_wxLocale, "Locale()\n"
1318 "Locale(language, flags=LOCALE_LOAD_DEFAULT)\n"
1319 "Locale(name, shortName=EmptyString, locale=EmptyString, bLoadDefault=True)\n"
1320 "\n"
1321 "wxLocale class encapsulates all language-dependent settings and is a\n"
1322 "generalization of the C locale concept.");
1323
1324
1325 sipClassTypeDef sipTypeDef__core_wxLocale = {
1326 {
1327 -1,
1328 SIP_NULLPTR,
1329 SIP_NULLPTR,
1330 SIP_TYPE_CLASS,
1331 sipNameNr_wxLocale,
1332 {SIP_NULLPTR},
1333 SIP_NULLPTR
1334 },
1335 {
1336 sipNameNr_Locale,
1337 {0, 0, 1},
1338 22, methods_wxLocale,
1339 0, SIP_NULLPTR,
1340 5, variables_wxLocale,
1341 {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
1342 },
1343 doc_wxLocale,
1344 -1,
1345 -1,
1346 SIP_NULLPTR,
1347 slots_wxLocale,
1348 init_type_wxLocale,
1349 SIP_NULLPTR,
1350 SIP_NULLPTR,
1351 #if PY_MAJOR_VERSION >= 3
1352 SIP_NULLPTR,
1353 SIP_NULLPTR,
1354 #else
1355 SIP_NULLPTR,
1356 SIP_NULLPTR,
1357 SIP_NULLPTR,
1358 SIP_NULLPTR,
1359 #endif
1360 dealloc_wxLocale,
1361 SIP_NULLPTR,
1362 SIP_NULLPTR,
1363 SIP_NULLPTR,
1364 release_wxLocale,
1365 SIP_NULLPTR,
1366 SIP_NULLPTR,
1367 SIP_NULLPTR,
1368 SIP_NULLPTR,
1369 SIP_NULLPTR,
1370 SIP_NULLPTR,
1371 SIP_NULLPTR
1372 };
1373