Move setting of ioready 'wait' earlier in call chain, to
[python/dscho.git] / Mac / Modules / app / _Appmodule.c
blob069c08feb1562cc3c563d8d3ea7096a9952e9929
2 /* ========================== Module _App =========================== */
4 #include "Python.h"
8 #ifdef _WIN32
9 #include "pywintoolbox.h"
10 #else
11 #include "macglue.h"
12 #include "pymactoolbox.h"
13 #endif
15 /* Macro to test whether a weak-loaded CFM function exists */
16 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
17 PyErr_SetString(PyExc_NotImplementedError, \
18 "Not available in this shared library/OS version"); \
19 return NULL; \
20 }} while(0)
23 #ifdef WITHOUT_FRAMEWORKS
24 #include <Appearance.h>
25 #else
26 #include <Carbon/Carbon.h>
27 #endif
31 int ThemeButtonDrawInfo_Convert(PyObject *v, ThemeButtonDrawInfo *p_itself)
33 return PyArg_Parse(v, "(iHH)", &p_itself->state, &p_itself->value, &p_itself->adornment);
37 static PyObject *App_Error;
39 /* ----------------- Object type ThemeDrawingState ------------------ */
41 PyTypeObject ThemeDrawingState_Type;
43 #define ThemeDrawingStateObj_Check(x) ((x)->ob_type == &ThemeDrawingState_Type || PyObject_TypeCheck((x), &ThemeDrawingState_Type))
45 typedef struct ThemeDrawingStateObject {
46 PyObject_HEAD
47 ThemeDrawingState ob_itself;
48 } ThemeDrawingStateObject;
50 PyObject *ThemeDrawingStateObj_New(ThemeDrawingState itself)
52 ThemeDrawingStateObject *it;
53 it = PyObject_NEW(ThemeDrawingStateObject, &ThemeDrawingState_Type);
54 if (it == NULL) return NULL;
55 it->ob_itself = itself;
56 return (PyObject *)it;
58 int ThemeDrawingStateObj_Convert(PyObject *v, ThemeDrawingState *p_itself)
60 if (!ThemeDrawingStateObj_Check(v))
62 PyErr_SetString(PyExc_TypeError, "ThemeDrawingState required");
63 return 0;
65 *p_itself = ((ThemeDrawingStateObject *)v)->ob_itself;
66 return 1;
69 static void ThemeDrawingStateObj_dealloc(ThemeDrawingStateObject *self)
71 /* Cleanup of self->ob_itself goes here */
72 self->ob_type->tp_free((PyObject *)self);
75 static PyObject *ThemeDrawingStateObj_SetThemeDrawingState(ThemeDrawingStateObject *_self, PyObject *_args)
77 PyObject *_res = NULL;
78 OSStatus _rv;
79 Boolean inDisposeNow;
80 #ifndef SetThemeDrawingState
81 PyMac_PRECHECK(SetThemeDrawingState);
82 #endif
83 if (!PyArg_ParseTuple(_args, "b",
84 &inDisposeNow))
85 return NULL;
86 _rv = SetThemeDrawingState(_self->ob_itself,
87 inDisposeNow);
88 _res = Py_BuildValue("l",
89 _rv);
90 return _res;
93 static PyObject *ThemeDrawingStateObj_DisposeThemeDrawingState(ThemeDrawingStateObject *_self, PyObject *_args)
95 PyObject *_res = NULL;
96 OSStatus _rv;
97 #ifndef DisposeThemeDrawingState
98 PyMac_PRECHECK(DisposeThemeDrawingState);
99 #endif
100 if (!PyArg_ParseTuple(_args, ""))
101 return NULL;
102 _rv = DisposeThemeDrawingState(_self->ob_itself);
103 _res = Py_BuildValue("l",
104 _rv);
105 return _res;
108 static PyMethodDef ThemeDrawingStateObj_methods[] = {
109 {"SetThemeDrawingState", (PyCFunction)ThemeDrawingStateObj_SetThemeDrawingState, 1,
110 PyDoc_STR("(Boolean inDisposeNow) -> (OSStatus _rv)")},
111 {"DisposeThemeDrawingState", (PyCFunction)ThemeDrawingStateObj_DisposeThemeDrawingState, 1,
112 PyDoc_STR("() -> (OSStatus _rv)")},
113 {NULL, NULL, 0}
116 #define ThemeDrawingStateObj_getsetlist NULL
119 #define ThemeDrawingStateObj_compare NULL
121 #define ThemeDrawingStateObj_repr NULL
123 #define ThemeDrawingStateObj_hash NULL
124 #define ThemeDrawingStateObj_tp_init 0
126 #define ThemeDrawingStateObj_tp_alloc PyType_GenericAlloc
128 static PyObject *ThemeDrawingStateObj_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
130 PyObject *self;
131 ThemeDrawingState itself;
132 char *kw[] = {"itself", 0};
134 if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&", kw, ThemeDrawingStateObj_Convert, &itself)) return NULL;
135 if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;
136 ((ThemeDrawingStateObject *)self)->ob_itself = itself;
137 return self;
140 #define ThemeDrawingStateObj_tp_free PyObject_Del
143 PyTypeObject ThemeDrawingState_Type = {
144 PyObject_HEAD_INIT(NULL)
145 0, /*ob_size*/
146 "_App.ThemeDrawingState", /*tp_name*/
147 sizeof(ThemeDrawingStateObject), /*tp_basicsize*/
148 0, /*tp_itemsize*/
149 /* methods */
150 (destructor) ThemeDrawingStateObj_dealloc, /*tp_dealloc*/
151 0, /*tp_print*/
152 (getattrfunc)0, /*tp_getattr*/
153 (setattrfunc)0, /*tp_setattr*/
154 (cmpfunc) ThemeDrawingStateObj_compare, /*tp_compare*/
155 (reprfunc) ThemeDrawingStateObj_repr, /*tp_repr*/
156 (PyNumberMethods *)0, /* tp_as_number */
157 (PySequenceMethods *)0, /* tp_as_sequence */
158 (PyMappingMethods *)0, /* tp_as_mapping */
159 (hashfunc) ThemeDrawingStateObj_hash, /*tp_hash*/
160 0, /*tp_call*/
161 0, /*tp_str*/
162 PyObject_GenericGetAttr, /*tp_getattro*/
163 PyObject_GenericSetAttr, /*tp_setattro */
164 0, /*tp_as_buffer*/
165 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
166 0, /*tp_doc*/
167 0, /*tp_traverse*/
168 0, /*tp_clear*/
169 0, /*tp_richcompare*/
170 0, /*tp_weaklistoffset*/
171 0, /*tp_iter*/
172 0, /*tp_iternext*/
173 ThemeDrawingStateObj_methods, /* tp_methods */
174 0, /*tp_members*/
175 ThemeDrawingStateObj_getsetlist, /*tp_getset*/
176 0, /*tp_base*/
177 0, /*tp_dict*/
178 0, /*tp_descr_get*/
179 0, /*tp_descr_set*/
180 0, /*tp_dictoffset*/
181 ThemeDrawingStateObj_tp_init, /* tp_init */
182 ThemeDrawingStateObj_tp_alloc, /* tp_alloc */
183 ThemeDrawingStateObj_tp_new, /* tp_new */
184 ThemeDrawingStateObj_tp_free, /* tp_free */
187 /* --------------- End object type ThemeDrawingState ---------------- */
190 static PyObject *App_RegisterAppearanceClient(PyObject *_self, PyObject *_args)
192 PyObject *_res = NULL;
193 OSStatus _err;
194 #ifndef RegisterAppearanceClient
195 PyMac_PRECHECK(RegisterAppearanceClient);
196 #endif
197 if (!PyArg_ParseTuple(_args, ""))
198 return NULL;
199 _err = RegisterAppearanceClient();
200 if (_err != noErr) return PyMac_Error(_err);
201 Py_INCREF(Py_None);
202 _res = Py_None;
203 return _res;
206 static PyObject *App_UnregisterAppearanceClient(PyObject *_self, PyObject *_args)
208 PyObject *_res = NULL;
209 OSStatus _err;
210 #ifndef UnregisterAppearanceClient
211 PyMac_PRECHECK(UnregisterAppearanceClient);
212 #endif
213 if (!PyArg_ParseTuple(_args, ""))
214 return NULL;
215 _err = UnregisterAppearanceClient();
216 if (_err != noErr) return PyMac_Error(_err);
217 Py_INCREF(Py_None);
218 _res = Py_None;
219 return _res;
222 static PyObject *App_SetThemePen(PyObject *_self, PyObject *_args)
224 PyObject *_res = NULL;
225 OSStatus _err;
226 ThemeBrush inBrush;
227 SInt16 inDepth;
228 Boolean inIsColorDevice;
229 #ifndef SetThemePen
230 PyMac_PRECHECK(SetThemePen);
231 #endif
232 if (!PyArg_ParseTuple(_args, "hhb",
233 &inBrush,
234 &inDepth,
235 &inIsColorDevice))
236 return NULL;
237 _err = SetThemePen(inBrush,
238 inDepth,
239 inIsColorDevice);
240 if (_err != noErr) return PyMac_Error(_err);
241 Py_INCREF(Py_None);
242 _res = Py_None;
243 return _res;
246 static PyObject *App_SetThemeBackground(PyObject *_self, PyObject *_args)
248 PyObject *_res = NULL;
249 OSStatus _err;
250 ThemeBrush inBrush;
251 SInt16 inDepth;
252 Boolean inIsColorDevice;
253 #ifndef SetThemeBackground
254 PyMac_PRECHECK(SetThemeBackground);
255 #endif
256 if (!PyArg_ParseTuple(_args, "hhb",
257 &inBrush,
258 &inDepth,
259 &inIsColorDevice))
260 return NULL;
261 _err = SetThemeBackground(inBrush,
262 inDepth,
263 inIsColorDevice);
264 if (_err != noErr) return PyMac_Error(_err);
265 Py_INCREF(Py_None);
266 _res = Py_None;
267 return _res;
270 static PyObject *App_SetThemeTextColor(PyObject *_self, PyObject *_args)
272 PyObject *_res = NULL;
273 OSStatus _err;
274 ThemeTextColor inColor;
275 SInt16 inDepth;
276 Boolean inIsColorDevice;
277 #ifndef SetThemeTextColor
278 PyMac_PRECHECK(SetThemeTextColor);
279 #endif
280 if (!PyArg_ParseTuple(_args, "hhb",
281 &inColor,
282 &inDepth,
283 &inIsColorDevice))
284 return NULL;
285 _err = SetThemeTextColor(inColor,
286 inDepth,
287 inIsColorDevice);
288 if (_err != noErr) return PyMac_Error(_err);
289 Py_INCREF(Py_None);
290 _res = Py_None;
291 return _res;
294 static PyObject *App_SetThemeWindowBackground(PyObject *_self, PyObject *_args)
296 PyObject *_res = NULL;
297 OSStatus _err;
298 WindowPtr inWindow;
299 ThemeBrush inBrush;
300 Boolean inUpdate;
301 #ifndef SetThemeWindowBackground
302 PyMac_PRECHECK(SetThemeWindowBackground);
303 #endif
304 if (!PyArg_ParseTuple(_args, "O&hb",
305 WinObj_Convert, &inWindow,
306 &inBrush,
307 &inUpdate))
308 return NULL;
309 _err = SetThemeWindowBackground(inWindow,
310 inBrush,
311 inUpdate);
312 if (_err != noErr) return PyMac_Error(_err);
313 Py_INCREF(Py_None);
314 _res = Py_None;
315 return _res;
318 static PyObject *App_DrawThemeWindowHeader(PyObject *_self, PyObject *_args)
320 PyObject *_res = NULL;
321 OSStatus _err;
322 Rect inRect;
323 ThemeDrawState inState;
324 #ifndef DrawThemeWindowHeader
325 PyMac_PRECHECK(DrawThemeWindowHeader);
326 #endif
327 if (!PyArg_ParseTuple(_args, "O&l",
328 PyMac_GetRect, &inRect,
329 &inState))
330 return NULL;
331 _err = DrawThemeWindowHeader(&inRect,
332 inState);
333 if (_err != noErr) return PyMac_Error(_err);
334 Py_INCREF(Py_None);
335 _res = Py_None;
336 return _res;
339 static PyObject *App_DrawThemeWindowListViewHeader(PyObject *_self, PyObject *_args)
341 PyObject *_res = NULL;
342 OSStatus _err;
343 Rect inRect;
344 ThemeDrawState inState;
345 #ifndef DrawThemeWindowListViewHeader
346 PyMac_PRECHECK(DrawThemeWindowListViewHeader);
347 #endif
348 if (!PyArg_ParseTuple(_args, "O&l",
349 PyMac_GetRect, &inRect,
350 &inState))
351 return NULL;
352 _err = DrawThemeWindowListViewHeader(&inRect,
353 inState);
354 if (_err != noErr) return PyMac_Error(_err);
355 Py_INCREF(Py_None);
356 _res = Py_None;
357 return _res;
360 static PyObject *App_DrawThemePlacard(PyObject *_self, PyObject *_args)
362 PyObject *_res = NULL;
363 OSStatus _err;
364 Rect inRect;
365 ThemeDrawState inState;
366 #ifndef DrawThemePlacard
367 PyMac_PRECHECK(DrawThemePlacard);
368 #endif
369 if (!PyArg_ParseTuple(_args, "O&l",
370 PyMac_GetRect, &inRect,
371 &inState))
372 return NULL;
373 _err = DrawThemePlacard(&inRect,
374 inState);
375 if (_err != noErr) return PyMac_Error(_err);
376 Py_INCREF(Py_None);
377 _res = Py_None;
378 return _res;
381 static PyObject *App_DrawThemeEditTextFrame(PyObject *_self, PyObject *_args)
383 PyObject *_res = NULL;
384 OSStatus _err;
385 Rect inRect;
386 ThemeDrawState inState;
387 #ifndef DrawThemeEditTextFrame
388 PyMac_PRECHECK(DrawThemeEditTextFrame);
389 #endif
390 if (!PyArg_ParseTuple(_args, "O&l",
391 PyMac_GetRect, &inRect,
392 &inState))
393 return NULL;
394 _err = DrawThemeEditTextFrame(&inRect,
395 inState);
396 if (_err != noErr) return PyMac_Error(_err);
397 Py_INCREF(Py_None);
398 _res = Py_None;
399 return _res;
402 static PyObject *App_DrawThemeListBoxFrame(PyObject *_self, PyObject *_args)
404 PyObject *_res = NULL;
405 OSStatus _err;
406 Rect inRect;
407 ThemeDrawState inState;
408 #ifndef DrawThemeListBoxFrame
409 PyMac_PRECHECK(DrawThemeListBoxFrame);
410 #endif
411 if (!PyArg_ParseTuple(_args, "O&l",
412 PyMac_GetRect, &inRect,
413 &inState))
414 return NULL;
415 _err = DrawThemeListBoxFrame(&inRect,
416 inState);
417 if (_err != noErr) return PyMac_Error(_err);
418 Py_INCREF(Py_None);
419 _res = Py_None;
420 return _res;
423 static PyObject *App_DrawThemeFocusRect(PyObject *_self, PyObject *_args)
425 PyObject *_res = NULL;
426 OSStatus _err;
427 Rect inRect;
428 Boolean inHasFocus;
429 #ifndef DrawThemeFocusRect
430 PyMac_PRECHECK(DrawThemeFocusRect);
431 #endif
432 if (!PyArg_ParseTuple(_args, "O&b",
433 PyMac_GetRect, &inRect,
434 &inHasFocus))
435 return NULL;
436 _err = DrawThemeFocusRect(&inRect,
437 inHasFocus);
438 if (_err != noErr) return PyMac_Error(_err);
439 Py_INCREF(Py_None);
440 _res = Py_None;
441 return _res;
444 static PyObject *App_DrawThemePrimaryGroup(PyObject *_self, PyObject *_args)
446 PyObject *_res = NULL;
447 OSStatus _err;
448 Rect inRect;
449 ThemeDrawState inState;
450 #ifndef DrawThemePrimaryGroup
451 PyMac_PRECHECK(DrawThemePrimaryGroup);
452 #endif
453 if (!PyArg_ParseTuple(_args, "O&l",
454 PyMac_GetRect, &inRect,
455 &inState))
456 return NULL;
457 _err = DrawThemePrimaryGroup(&inRect,
458 inState);
459 if (_err != noErr) return PyMac_Error(_err);
460 Py_INCREF(Py_None);
461 _res = Py_None;
462 return _res;
465 static PyObject *App_DrawThemeSecondaryGroup(PyObject *_self, PyObject *_args)
467 PyObject *_res = NULL;
468 OSStatus _err;
469 Rect inRect;
470 ThemeDrawState inState;
471 #ifndef DrawThemeSecondaryGroup
472 PyMac_PRECHECK(DrawThemeSecondaryGroup);
473 #endif
474 if (!PyArg_ParseTuple(_args, "O&l",
475 PyMac_GetRect, &inRect,
476 &inState))
477 return NULL;
478 _err = DrawThemeSecondaryGroup(&inRect,
479 inState);
480 if (_err != noErr) return PyMac_Error(_err);
481 Py_INCREF(Py_None);
482 _res = Py_None;
483 return _res;
486 static PyObject *App_DrawThemeSeparator(PyObject *_self, PyObject *_args)
488 PyObject *_res = NULL;
489 OSStatus _err;
490 Rect inRect;
491 ThemeDrawState inState;
492 #ifndef DrawThemeSeparator
493 PyMac_PRECHECK(DrawThemeSeparator);
494 #endif
495 if (!PyArg_ParseTuple(_args, "O&l",
496 PyMac_GetRect, &inRect,
497 &inState))
498 return NULL;
499 _err = DrawThemeSeparator(&inRect,
500 inState);
501 if (_err != noErr) return PyMac_Error(_err);
502 Py_INCREF(Py_None);
503 _res = Py_None;
504 return _res;
507 static PyObject *App_DrawThemeModelessDialogFrame(PyObject *_self, PyObject *_args)
509 PyObject *_res = NULL;
510 OSStatus _err;
511 Rect inRect;
512 ThemeDrawState inState;
513 #ifndef DrawThemeModelessDialogFrame
514 PyMac_PRECHECK(DrawThemeModelessDialogFrame);
515 #endif
516 if (!PyArg_ParseTuple(_args, "O&l",
517 PyMac_GetRect, &inRect,
518 &inState))
519 return NULL;
520 _err = DrawThemeModelessDialogFrame(&inRect,
521 inState);
522 if (_err != noErr) return PyMac_Error(_err);
523 Py_INCREF(Py_None);
524 _res = Py_None;
525 return _res;
528 static PyObject *App_DrawThemeGenericWell(PyObject *_self, PyObject *_args)
530 PyObject *_res = NULL;
531 OSStatus _err;
532 Rect inRect;
533 ThemeDrawState inState;
534 Boolean inFillCenter;
535 #ifndef DrawThemeGenericWell
536 PyMac_PRECHECK(DrawThemeGenericWell);
537 #endif
538 if (!PyArg_ParseTuple(_args, "O&lb",
539 PyMac_GetRect, &inRect,
540 &inState,
541 &inFillCenter))
542 return NULL;
543 _err = DrawThemeGenericWell(&inRect,
544 inState,
545 inFillCenter);
546 if (_err != noErr) return PyMac_Error(_err);
547 Py_INCREF(Py_None);
548 _res = Py_None;
549 return _res;
552 static PyObject *App_DrawThemeFocusRegion(PyObject *_self, PyObject *_args)
554 PyObject *_res = NULL;
555 OSStatus _err;
556 Boolean inHasFocus;
557 #ifndef DrawThemeFocusRegion
558 PyMac_PRECHECK(DrawThemeFocusRegion);
559 #endif
560 if (!PyArg_ParseTuple(_args, "b",
561 &inHasFocus))
562 return NULL;
563 _err = DrawThemeFocusRegion((RgnHandle)0,
564 inHasFocus);
565 if (_err != noErr) return PyMac_Error(_err);
566 Py_INCREF(Py_None);
567 _res = Py_None;
568 return _res;
571 static PyObject *App_IsThemeInColor(PyObject *_self, PyObject *_args)
573 PyObject *_res = NULL;
574 Boolean _rv;
575 SInt16 inDepth;
576 Boolean inIsColorDevice;
577 #ifndef IsThemeInColor
578 PyMac_PRECHECK(IsThemeInColor);
579 #endif
580 if (!PyArg_ParseTuple(_args, "hb",
581 &inDepth,
582 &inIsColorDevice))
583 return NULL;
584 _rv = IsThemeInColor(inDepth,
585 inIsColorDevice);
586 _res = Py_BuildValue("b",
587 _rv);
588 return _res;
591 static PyObject *App_GetThemeAccentColors(PyObject *_self, PyObject *_args)
593 PyObject *_res = NULL;
594 OSStatus _err;
595 CTabHandle outColors;
596 #ifndef GetThemeAccentColors
597 PyMac_PRECHECK(GetThemeAccentColors);
598 #endif
599 if (!PyArg_ParseTuple(_args, ""))
600 return NULL;
601 _err = GetThemeAccentColors(&outColors);
602 if (_err != noErr) return PyMac_Error(_err);
603 _res = Py_BuildValue("O&",
604 ResObj_New, outColors);
605 return _res;
608 static PyObject *App_DrawThemeMenuBarBackground(PyObject *_self, PyObject *_args)
610 PyObject *_res = NULL;
611 OSStatus _err;
612 Rect inBounds;
613 ThemeMenuBarState inState;
614 UInt32 inAttributes;
615 #ifndef DrawThemeMenuBarBackground
616 PyMac_PRECHECK(DrawThemeMenuBarBackground);
617 #endif
618 if (!PyArg_ParseTuple(_args, "O&Hl",
619 PyMac_GetRect, &inBounds,
620 &inState,
621 &inAttributes))
622 return NULL;
623 _err = DrawThemeMenuBarBackground(&inBounds,
624 inState,
625 inAttributes);
626 if (_err != noErr) return PyMac_Error(_err);
627 Py_INCREF(Py_None);
628 _res = Py_None;
629 return _res;
632 static PyObject *App_GetThemeMenuBarHeight(PyObject *_self, PyObject *_args)
634 PyObject *_res = NULL;
635 OSStatus _err;
636 SInt16 outHeight;
637 #ifndef GetThemeMenuBarHeight
638 PyMac_PRECHECK(GetThemeMenuBarHeight);
639 #endif
640 if (!PyArg_ParseTuple(_args, ""))
641 return NULL;
642 _err = GetThemeMenuBarHeight(&outHeight);
643 if (_err != noErr) return PyMac_Error(_err);
644 _res = Py_BuildValue("h",
645 outHeight);
646 return _res;
649 static PyObject *App_DrawThemeMenuBackground(PyObject *_self, PyObject *_args)
651 PyObject *_res = NULL;
652 OSStatus _err;
653 Rect inMenuRect;
654 ThemeMenuType inMenuType;
655 #ifndef DrawThemeMenuBackground
656 PyMac_PRECHECK(DrawThemeMenuBackground);
657 #endif
658 if (!PyArg_ParseTuple(_args, "O&H",
659 PyMac_GetRect, &inMenuRect,
660 &inMenuType))
661 return NULL;
662 _err = DrawThemeMenuBackground(&inMenuRect,
663 inMenuType);
664 if (_err != noErr) return PyMac_Error(_err);
665 Py_INCREF(Py_None);
666 _res = Py_None;
667 return _res;
670 static PyObject *App_GetThemeMenuBackgroundRegion(PyObject *_self, PyObject *_args)
672 PyObject *_res = NULL;
673 OSStatus _err;
674 Rect inMenuRect;
675 ThemeMenuType menuType;
676 #ifndef GetThemeMenuBackgroundRegion
677 PyMac_PRECHECK(GetThemeMenuBackgroundRegion);
678 #endif
679 if (!PyArg_ParseTuple(_args, "O&H",
680 PyMac_GetRect, &inMenuRect,
681 &menuType))
682 return NULL;
683 _err = GetThemeMenuBackgroundRegion(&inMenuRect,
684 menuType,
685 (RgnHandle)0);
686 if (_err != noErr) return PyMac_Error(_err);
687 Py_INCREF(Py_None);
688 _res = Py_None;
689 return _res;
692 static PyObject *App_DrawThemeMenuSeparator(PyObject *_self, PyObject *_args)
694 PyObject *_res = NULL;
695 OSStatus _err;
696 Rect inItemRect;
697 #ifndef DrawThemeMenuSeparator
698 PyMac_PRECHECK(DrawThemeMenuSeparator);
699 #endif
700 if (!PyArg_ParseTuple(_args, "O&",
701 PyMac_GetRect, &inItemRect))
702 return NULL;
703 _err = DrawThemeMenuSeparator(&inItemRect);
704 if (_err != noErr) return PyMac_Error(_err);
705 Py_INCREF(Py_None);
706 _res = Py_None;
707 return _res;
710 static PyObject *App_GetThemeMenuSeparatorHeight(PyObject *_self, PyObject *_args)
712 PyObject *_res = NULL;
713 OSStatus _err;
714 SInt16 outHeight;
715 #ifndef GetThemeMenuSeparatorHeight
716 PyMac_PRECHECK(GetThemeMenuSeparatorHeight);
717 #endif
718 if (!PyArg_ParseTuple(_args, ""))
719 return NULL;
720 _err = GetThemeMenuSeparatorHeight(&outHeight);
721 if (_err != noErr) return PyMac_Error(_err);
722 _res = Py_BuildValue("h",
723 outHeight);
724 return _res;
727 static PyObject *App_GetThemeMenuItemExtra(PyObject *_self, PyObject *_args)
729 PyObject *_res = NULL;
730 OSStatus _err;
731 ThemeMenuItemType inItemType;
732 SInt16 outHeight;
733 SInt16 outWidth;
734 #ifndef GetThemeMenuItemExtra
735 PyMac_PRECHECK(GetThemeMenuItemExtra);
736 #endif
737 if (!PyArg_ParseTuple(_args, "H",
738 &inItemType))
739 return NULL;
740 _err = GetThemeMenuItemExtra(inItemType,
741 &outHeight,
742 &outWidth);
743 if (_err != noErr) return PyMac_Error(_err);
744 _res = Py_BuildValue("hh",
745 outHeight,
746 outWidth);
747 return _res;
750 static PyObject *App_GetThemeMenuTitleExtra(PyObject *_self, PyObject *_args)
752 PyObject *_res = NULL;
753 OSStatus _err;
754 SInt16 outWidth;
755 Boolean inIsSquished;
756 #ifndef GetThemeMenuTitleExtra
757 PyMac_PRECHECK(GetThemeMenuTitleExtra);
758 #endif
759 if (!PyArg_ParseTuple(_args, "b",
760 &inIsSquished))
761 return NULL;
762 _err = GetThemeMenuTitleExtra(&outWidth,
763 inIsSquished);
764 if (_err != noErr) return PyMac_Error(_err);
765 _res = Py_BuildValue("h",
766 outWidth);
767 return _res;
770 static PyObject *App_DrawThemeTabPane(PyObject *_self, PyObject *_args)
772 PyObject *_res = NULL;
773 OSStatus _err;
774 Rect inRect;
775 ThemeDrawState inState;
776 #ifndef DrawThemeTabPane
777 PyMac_PRECHECK(DrawThemeTabPane);
778 #endif
779 if (!PyArg_ParseTuple(_args, "O&l",
780 PyMac_GetRect, &inRect,
781 &inState))
782 return NULL;
783 _err = DrawThemeTabPane(&inRect,
784 inState);
785 if (_err != noErr) return PyMac_Error(_err);
786 Py_INCREF(Py_None);
787 _res = Py_None;
788 return _res;
791 static PyObject *App_GetThemeTabRegion(PyObject *_self, PyObject *_args)
793 PyObject *_res = NULL;
794 OSStatus _err;
795 Rect inRect;
796 ThemeTabStyle inStyle;
797 ThemeTabDirection inDirection;
798 #ifndef GetThemeTabRegion
799 PyMac_PRECHECK(GetThemeTabRegion);
800 #endif
801 if (!PyArg_ParseTuple(_args, "O&HH",
802 PyMac_GetRect, &inRect,
803 &inStyle,
804 &inDirection))
805 return NULL;
806 _err = GetThemeTabRegion(&inRect,
807 inStyle,
808 inDirection,
809 (RgnHandle)0);
810 if (_err != noErr) return PyMac_Error(_err);
811 Py_INCREF(Py_None);
812 _res = Py_None;
813 return _res;
816 static PyObject *App_SetThemeCursor(PyObject *_self, PyObject *_args)
818 PyObject *_res = NULL;
819 OSStatus _err;
820 ThemeCursor inCursor;
821 #ifndef SetThemeCursor
822 PyMac_PRECHECK(SetThemeCursor);
823 #endif
824 if (!PyArg_ParseTuple(_args, "l",
825 &inCursor))
826 return NULL;
827 _err = SetThemeCursor(inCursor);
828 if (_err != noErr) return PyMac_Error(_err);
829 Py_INCREF(Py_None);
830 _res = Py_None;
831 return _res;
834 static PyObject *App_SetAnimatedThemeCursor(PyObject *_self, PyObject *_args)
836 PyObject *_res = NULL;
837 OSStatus _err;
838 ThemeCursor inCursor;
839 UInt32 inAnimationStep;
840 #ifndef SetAnimatedThemeCursor
841 PyMac_PRECHECK(SetAnimatedThemeCursor);
842 #endif
843 if (!PyArg_ParseTuple(_args, "ll",
844 &inCursor,
845 &inAnimationStep))
846 return NULL;
847 _err = SetAnimatedThemeCursor(inCursor,
848 inAnimationStep);
849 if (_err != noErr) return PyMac_Error(_err);
850 Py_INCREF(Py_None);
851 _res = Py_None;
852 return _res;
855 static PyObject *App_GetThemeScrollBarThumbStyle(PyObject *_self, PyObject *_args)
857 PyObject *_res = NULL;
858 OSStatus _err;
859 ThemeScrollBarThumbStyle outStyle;
860 #ifndef GetThemeScrollBarThumbStyle
861 PyMac_PRECHECK(GetThemeScrollBarThumbStyle);
862 #endif
863 if (!PyArg_ParseTuple(_args, ""))
864 return NULL;
865 _err = GetThemeScrollBarThumbStyle(&outStyle);
866 if (_err != noErr) return PyMac_Error(_err);
867 _res = Py_BuildValue("H",
868 outStyle);
869 return _res;
872 static PyObject *App_GetThemeScrollBarArrowStyle(PyObject *_self, PyObject *_args)
874 PyObject *_res = NULL;
875 OSStatus _err;
876 ThemeScrollBarArrowStyle outStyle;
877 #ifndef GetThemeScrollBarArrowStyle
878 PyMac_PRECHECK(GetThemeScrollBarArrowStyle);
879 #endif
880 if (!PyArg_ParseTuple(_args, ""))
881 return NULL;
882 _err = GetThemeScrollBarArrowStyle(&outStyle);
883 if (_err != noErr) return PyMac_Error(_err);
884 _res = Py_BuildValue("H",
885 outStyle);
886 return _res;
889 static PyObject *App_GetThemeCheckBoxStyle(PyObject *_self, PyObject *_args)
891 PyObject *_res = NULL;
892 OSStatus _err;
893 ThemeCheckBoxStyle outStyle;
894 #ifndef GetThemeCheckBoxStyle
895 PyMac_PRECHECK(GetThemeCheckBoxStyle);
896 #endif
897 if (!PyArg_ParseTuple(_args, ""))
898 return NULL;
899 _err = GetThemeCheckBoxStyle(&outStyle);
900 if (_err != noErr) return PyMac_Error(_err);
901 _res = Py_BuildValue("H",
902 outStyle);
903 return _res;
906 static PyObject *App_UseThemeFont(PyObject *_self, PyObject *_args)
908 PyObject *_res = NULL;
909 OSStatus _err;
910 ThemeFontID inFontID;
911 ScriptCode inScript;
912 #ifndef UseThemeFont
913 PyMac_PRECHECK(UseThemeFont);
914 #endif
915 if (!PyArg_ParseTuple(_args, "Hh",
916 &inFontID,
917 &inScript))
918 return NULL;
919 _err = UseThemeFont(inFontID,
920 inScript);
921 if (_err != noErr) return PyMac_Error(_err);
922 Py_INCREF(Py_None);
923 _res = Py_None;
924 return _res;
927 static PyObject *App_DrawThemeTextBox(PyObject *_self, PyObject *_args)
929 PyObject *_res = NULL;
930 OSStatus _err;
931 CFStringRef inString;
932 ThemeFontID inFontID;
933 ThemeDrawState inState;
934 Boolean inWrapToWidth;
935 Rect inBoundingBox;
936 SInt16 inJust;
937 #ifndef DrawThemeTextBox
938 PyMac_PRECHECK(DrawThemeTextBox);
939 #endif
940 if (!PyArg_ParseTuple(_args, "O&HlbO&h",
941 CFStringRefObj_Convert, &inString,
942 &inFontID,
943 &inState,
944 &inWrapToWidth,
945 PyMac_GetRect, &inBoundingBox,
946 &inJust))
947 return NULL;
948 _err = DrawThemeTextBox(inString,
949 inFontID,
950 inState,
951 inWrapToWidth,
952 &inBoundingBox,
953 inJust,
954 NULL);
955 if (_err != noErr) return PyMac_Error(_err);
956 Py_INCREF(Py_None);
957 _res = Py_None;
958 return _res;
961 static PyObject *App_TruncateThemeText(PyObject *_self, PyObject *_args)
963 PyObject *_res = NULL;
964 OSStatus _err;
965 CFMutableStringRef inString;
966 ThemeFontID inFontID;
967 ThemeDrawState inState;
968 SInt16 inPixelWidthLimit;
969 TruncCode inTruncWhere;
970 Boolean outTruncated;
971 #ifndef TruncateThemeText
972 PyMac_PRECHECK(TruncateThemeText);
973 #endif
974 if (!PyArg_ParseTuple(_args, "O&Hlhh",
975 CFMutableStringRefObj_Convert, &inString,
976 &inFontID,
977 &inState,
978 &inPixelWidthLimit,
979 &inTruncWhere))
980 return NULL;
981 _err = TruncateThemeText(inString,
982 inFontID,
983 inState,
984 inPixelWidthLimit,
985 inTruncWhere,
986 &outTruncated);
987 if (_err != noErr) return PyMac_Error(_err);
988 _res = Py_BuildValue("b",
989 outTruncated);
990 return _res;
993 static PyObject *App_GetThemeTextDimensions(PyObject *_self, PyObject *_args)
995 PyObject *_res = NULL;
996 OSStatus _err;
997 CFStringRef inString;
998 ThemeFontID inFontID;
999 ThemeDrawState inState;
1000 Boolean inWrapToWidth;
1001 Point ioBounds;
1002 SInt16 outBaseline;
1003 #ifndef GetThemeTextDimensions
1004 PyMac_PRECHECK(GetThemeTextDimensions);
1005 #endif
1006 if (!PyArg_ParseTuple(_args, "O&HlbO&",
1007 CFStringRefObj_Convert, &inString,
1008 &inFontID,
1009 &inState,
1010 &inWrapToWidth,
1011 PyMac_GetPoint, &ioBounds))
1012 return NULL;
1013 _err = GetThemeTextDimensions(inString,
1014 inFontID,
1015 inState,
1016 inWrapToWidth,
1017 &ioBounds,
1018 &outBaseline);
1019 if (_err != noErr) return PyMac_Error(_err);
1020 _res = Py_BuildValue("O&h",
1021 PyMac_BuildPoint, ioBounds,
1022 outBaseline);
1023 return _res;
1026 static PyObject *App_GetThemeTextShadowOutset(PyObject *_self, PyObject *_args)
1028 PyObject *_res = NULL;
1029 OSStatus _err;
1030 ThemeFontID inFontID;
1031 ThemeDrawState inState;
1032 Rect outOutset;
1033 #ifndef GetThemeTextShadowOutset
1034 PyMac_PRECHECK(GetThemeTextShadowOutset);
1035 #endif
1036 if (!PyArg_ParseTuple(_args, "Hl",
1037 &inFontID,
1038 &inState))
1039 return NULL;
1040 _err = GetThemeTextShadowOutset(inFontID,
1041 inState,
1042 &outOutset);
1043 if (_err != noErr) return PyMac_Error(_err);
1044 _res = Py_BuildValue("O&",
1045 PyMac_BuildRect, &outOutset);
1046 return _res;
1049 static PyObject *App_DrawThemeScrollBarArrows(PyObject *_self, PyObject *_args)
1051 PyObject *_res = NULL;
1052 OSStatus _err;
1053 Rect bounds;
1054 ThemeTrackEnableState enableState;
1055 ThemeTrackPressState pressState;
1056 Boolean isHoriz;
1057 Rect trackBounds;
1058 #ifndef DrawThemeScrollBarArrows
1059 PyMac_PRECHECK(DrawThemeScrollBarArrows);
1060 #endif
1061 if (!PyArg_ParseTuple(_args, "O&bbb",
1062 PyMac_GetRect, &bounds,
1063 &enableState,
1064 &pressState,
1065 &isHoriz))
1066 return NULL;
1067 _err = DrawThemeScrollBarArrows(&bounds,
1068 enableState,
1069 pressState,
1070 isHoriz,
1071 &trackBounds);
1072 if (_err != noErr) return PyMac_Error(_err);
1073 _res = Py_BuildValue("O&",
1074 PyMac_BuildRect, &trackBounds);
1075 return _res;
1078 static PyObject *App_GetThemeScrollBarTrackRect(PyObject *_self, PyObject *_args)
1080 PyObject *_res = NULL;
1081 OSStatus _err;
1082 Rect bounds;
1083 ThemeTrackEnableState enableState;
1084 ThemeTrackPressState pressState;
1085 Boolean isHoriz;
1086 Rect trackBounds;
1087 #ifndef GetThemeScrollBarTrackRect
1088 PyMac_PRECHECK(GetThemeScrollBarTrackRect);
1089 #endif
1090 if (!PyArg_ParseTuple(_args, "O&bbb",
1091 PyMac_GetRect, &bounds,
1092 &enableState,
1093 &pressState,
1094 &isHoriz))
1095 return NULL;
1096 _err = GetThemeScrollBarTrackRect(&bounds,
1097 enableState,
1098 pressState,
1099 isHoriz,
1100 &trackBounds);
1101 if (_err != noErr) return PyMac_Error(_err);
1102 _res = Py_BuildValue("O&",
1103 PyMac_BuildRect, &trackBounds);
1104 return _res;
1107 static PyObject *App_HitTestThemeScrollBarArrows(PyObject *_self, PyObject *_args)
1109 PyObject *_res = NULL;
1110 Boolean _rv;
1111 Rect scrollBarBounds;
1112 ThemeTrackEnableState enableState;
1113 ThemeTrackPressState pressState;
1114 Boolean isHoriz;
1115 Point ptHit;
1116 Rect trackBounds;
1117 ControlPartCode partcode;
1118 #ifndef HitTestThemeScrollBarArrows
1119 PyMac_PRECHECK(HitTestThemeScrollBarArrows);
1120 #endif
1121 if (!PyArg_ParseTuple(_args, "O&bbbO&",
1122 PyMac_GetRect, &scrollBarBounds,
1123 &enableState,
1124 &pressState,
1125 &isHoriz,
1126 PyMac_GetPoint, &ptHit))
1127 return NULL;
1128 _rv = HitTestThemeScrollBarArrows(&scrollBarBounds,
1129 enableState,
1130 pressState,
1131 isHoriz,
1132 ptHit,
1133 &trackBounds,
1134 &partcode);
1135 _res = Py_BuildValue("bO&h",
1136 _rv,
1137 PyMac_BuildRect, &trackBounds,
1138 partcode);
1139 return _res;
1142 static PyObject *App_DrawThemeScrollBarDelimiters(PyObject *_self, PyObject *_args)
1144 PyObject *_res = NULL;
1145 OSStatus _err;
1146 ThemeWindowType flavor;
1147 Rect inContRect;
1148 ThemeDrawState state;
1149 ThemeWindowAttributes attributes;
1150 #ifndef DrawThemeScrollBarDelimiters
1151 PyMac_PRECHECK(DrawThemeScrollBarDelimiters);
1152 #endif
1153 if (!PyArg_ParseTuple(_args, "HO&ll",
1154 &flavor,
1155 PyMac_GetRect, &inContRect,
1156 &state,
1157 &attributes))
1158 return NULL;
1159 _err = DrawThemeScrollBarDelimiters(flavor,
1160 &inContRect,
1161 state,
1162 attributes);
1163 if (_err != noErr) return PyMac_Error(_err);
1164 Py_INCREF(Py_None);
1165 _res = Py_None;
1166 return _res;
1169 static PyObject *App_DrawThemeButton(PyObject *_self, PyObject *_args)
1171 PyObject *_res = NULL;
1172 OSStatus _err;
1173 Rect inBounds;
1174 UInt16 inKind;
1175 ThemeButtonDrawInfo inNewInfo;
1176 ThemeButtonDrawInfo inPrevInfo;
1177 UInt32 inUserData;
1178 #ifndef DrawThemeButton
1179 PyMac_PRECHECK(DrawThemeButton);
1180 #endif
1181 if (!PyArg_ParseTuple(_args, "O&HO&O&l",
1182 PyMac_GetRect, &inBounds,
1183 &inKind,
1184 ThemeButtonDrawInfo_Convert, &inNewInfo,
1185 ThemeButtonDrawInfo_Convert, &inPrevInfo,
1186 &inUserData))
1187 return NULL;
1188 _err = DrawThemeButton(&inBounds,
1189 inKind,
1190 &inNewInfo,
1191 &inPrevInfo,
1192 NULL,
1193 NULL,
1194 inUserData);
1195 if (_err != noErr) return PyMac_Error(_err);
1196 Py_INCREF(Py_None);
1197 _res = Py_None;
1198 return _res;
1201 static PyObject *App_GetThemeButtonRegion(PyObject *_self, PyObject *_args)
1203 PyObject *_res = NULL;
1204 OSStatus _err;
1205 Rect inBounds;
1206 UInt16 inKind;
1207 ThemeButtonDrawInfo inNewInfo;
1208 #ifndef GetThemeButtonRegion
1209 PyMac_PRECHECK(GetThemeButtonRegion);
1210 #endif
1211 if (!PyArg_ParseTuple(_args, "O&HO&",
1212 PyMac_GetRect, &inBounds,
1213 &inKind,
1214 ThemeButtonDrawInfo_Convert, &inNewInfo))
1215 return NULL;
1216 _err = GetThemeButtonRegion(&inBounds,
1217 inKind,
1218 &inNewInfo,
1219 (RgnHandle)0);
1220 if (_err != noErr) return PyMac_Error(_err);
1221 Py_INCREF(Py_None);
1222 _res = Py_None;
1223 return _res;
1226 static PyObject *App_GetThemeButtonContentBounds(PyObject *_self, PyObject *_args)
1228 PyObject *_res = NULL;
1229 OSStatus _err;
1230 Rect inBounds;
1231 UInt16 inKind;
1232 ThemeButtonDrawInfo inDrawInfo;
1233 Rect outBounds;
1234 #ifndef GetThemeButtonContentBounds
1235 PyMac_PRECHECK(GetThemeButtonContentBounds);
1236 #endif
1237 if (!PyArg_ParseTuple(_args, "O&HO&",
1238 PyMac_GetRect, &inBounds,
1239 &inKind,
1240 ThemeButtonDrawInfo_Convert, &inDrawInfo))
1241 return NULL;
1242 _err = GetThemeButtonContentBounds(&inBounds,
1243 inKind,
1244 &inDrawInfo,
1245 &outBounds);
1246 if (_err != noErr) return PyMac_Error(_err);
1247 _res = Py_BuildValue("O&",
1248 PyMac_BuildRect, &outBounds);
1249 return _res;
1252 static PyObject *App_GetThemeButtonBackgroundBounds(PyObject *_self, PyObject *_args)
1254 PyObject *_res = NULL;
1255 OSStatus _err;
1256 Rect inBounds;
1257 UInt16 inKind;
1258 ThemeButtonDrawInfo inDrawInfo;
1259 Rect outBounds;
1260 #ifndef GetThemeButtonBackgroundBounds
1261 PyMac_PRECHECK(GetThemeButtonBackgroundBounds);
1262 #endif
1263 if (!PyArg_ParseTuple(_args, "O&HO&",
1264 PyMac_GetRect, &inBounds,
1265 &inKind,
1266 ThemeButtonDrawInfo_Convert, &inDrawInfo))
1267 return NULL;
1268 _err = GetThemeButtonBackgroundBounds(&inBounds,
1269 inKind,
1270 &inDrawInfo,
1271 &outBounds);
1272 if (_err != noErr) return PyMac_Error(_err);
1273 _res = Py_BuildValue("O&",
1274 PyMac_BuildRect, &outBounds);
1275 return _res;
1278 static PyObject *App_PlayThemeSound(PyObject *_self, PyObject *_args)
1280 PyObject *_res = NULL;
1281 OSStatus _err;
1282 ThemeSoundKind kind;
1283 #ifndef PlayThemeSound
1284 PyMac_PRECHECK(PlayThemeSound);
1285 #endif
1286 if (!PyArg_ParseTuple(_args, "O&",
1287 PyMac_GetOSType, &kind))
1288 return NULL;
1289 _err = PlayThemeSound(kind);
1290 if (_err != noErr) return PyMac_Error(_err);
1291 Py_INCREF(Py_None);
1292 _res = Py_None;
1293 return _res;
1296 static PyObject *App_BeginThemeDragSound(PyObject *_self, PyObject *_args)
1298 PyObject *_res = NULL;
1299 OSStatus _err;
1300 ThemeDragSoundKind kind;
1301 #ifndef BeginThemeDragSound
1302 PyMac_PRECHECK(BeginThemeDragSound);
1303 #endif
1304 if (!PyArg_ParseTuple(_args, "O&",
1305 PyMac_GetOSType, &kind))
1306 return NULL;
1307 _err = BeginThemeDragSound(kind);
1308 if (_err != noErr) return PyMac_Error(_err);
1309 Py_INCREF(Py_None);
1310 _res = Py_None;
1311 return _res;
1314 static PyObject *App_EndThemeDragSound(PyObject *_self, PyObject *_args)
1316 PyObject *_res = NULL;
1317 OSStatus _err;
1318 #ifndef EndThemeDragSound
1319 PyMac_PRECHECK(EndThemeDragSound);
1320 #endif
1321 if (!PyArg_ParseTuple(_args, ""))
1322 return NULL;
1323 _err = EndThemeDragSound();
1324 if (_err != noErr) return PyMac_Error(_err);
1325 Py_INCREF(Py_None);
1326 _res = Py_None;
1327 return _res;
1330 static PyObject *App_DrawThemeTickMark(PyObject *_self, PyObject *_args)
1332 PyObject *_res = NULL;
1333 OSStatus _err;
1334 Rect bounds;
1335 ThemeDrawState state;
1336 #ifndef DrawThemeTickMark
1337 PyMac_PRECHECK(DrawThemeTickMark);
1338 #endif
1339 if (!PyArg_ParseTuple(_args, "O&l",
1340 PyMac_GetRect, &bounds,
1341 &state))
1342 return NULL;
1343 _err = DrawThemeTickMark(&bounds,
1344 state);
1345 if (_err != noErr) return PyMac_Error(_err);
1346 Py_INCREF(Py_None);
1347 _res = Py_None;
1348 return _res;
1351 static PyObject *App_DrawThemeChasingArrows(PyObject *_self, PyObject *_args)
1353 PyObject *_res = NULL;
1354 OSStatus _err;
1355 Rect bounds;
1356 UInt32 index;
1357 ThemeDrawState state;
1358 UInt32 eraseData;
1359 #ifndef DrawThemeChasingArrows
1360 PyMac_PRECHECK(DrawThemeChasingArrows);
1361 #endif
1362 if (!PyArg_ParseTuple(_args, "O&lll",
1363 PyMac_GetRect, &bounds,
1364 &index,
1365 &state,
1366 &eraseData))
1367 return NULL;
1368 _err = DrawThemeChasingArrows(&bounds,
1369 index,
1370 state,
1371 NULL,
1372 eraseData);
1373 if (_err != noErr) return PyMac_Error(_err);
1374 Py_INCREF(Py_None);
1375 _res = Py_None;
1376 return _res;
1379 static PyObject *App_DrawThemePopupArrow(PyObject *_self, PyObject *_args)
1381 PyObject *_res = NULL;
1382 OSStatus _err;
1383 Rect bounds;
1384 ThemeArrowOrientation orientation;
1385 ThemePopupArrowSize size;
1386 ThemeDrawState state;
1387 UInt32 eraseData;
1388 #ifndef DrawThemePopupArrow
1389 PyMac_PRECHECK(DrawThemePopupArrow);
1390 #endif
1391 if (!PyArg_ParseTuple(_args, "O&HHll",
1392 PyMac_GetRect, &bounds,
1393 &orientation,
1394 &size,
1395 &state,
1396 &eraseData))
1397 return NULL;
1398 _err = DrawThemePopupArrow(&bounds,
1399 orientation,
1400 size,
1401 state,
1402 NULL,
1403 eraseData);
1404 if (_err != noErr) return PyMac_Error(_err);
1405 Py_INCREF(Py_None);
1406 _res = Py_None;
1407 return _res;
1410 static PyObject *App_DrawThemeStandaloneGrowBox(PyObject *_self, PyObject *_args)
1412 PyObject *_res = NULL;
1413 OSStatus _err;
1414 Point origin;
1415 ThemeGrowDirection growDirection;
1416 Boolean isSmall;
1417 ThemeDrawState state;
1418 #ifndef DrawThemeStandaloneGrowBox
1419 PyMac_PRECHECK(DrawThemeStandaloneGrowBox);
1420 #endif
1421 if (!PyArg_ParseTuple(_args, "O&Hbl",
1422 PyMac_GetPoint, &origin,
1423 &growDirection,
1424 &isSmall,
1425 &state))
1426 return NULL;
1427 _err = DrawThemeStandaloneGrowBox(origin,
1428 growDirection,
1429 isSmall,
1430 state);
1431 if (_err != noErr) return PyMac_Error(_err);
1432 Py_INCREF(Py_None);
1433 _res = Py_None;
1434 return _res;
1437 static PyObject *App_DrawThemeStandaloneNoGrowBox(PyObject *_self, PyObject *_args)
1439 PyObject *_res = NULL;
1440 OSStatus _err;
1441 Point origin;
1442 ThemeGrowDirection growDirection;
1443 Boolean isSmall;
1444 ThemeDrawState state;
1445 #ifndef DrawThemeStandaloneNoGrowBox
1446 PyMac_PRECHECK(DrawThemeStandaloneNoGrowBox);
1447 #endif
1448 if (!PyArg_ParseTuple(_args, "O&Hbl",
1449 PyMac_GetPoint, &origin,
1450 &growDirection,
1451 &isSmall,
1452 &state))
1453 return NULL;
1454 _err = DrawThemeStandaloneNoGrowBox(origin,
1455 growDirection,
1456 isSmall,
1457 state);
1458 if (_err != noErr) return PyMac_Error(_err);
1459 Py_INCREF(Py_None);
1460 _res = Py_None;
1461 return _res;
1464 static PyObject *App_GetThemeStandaloneGrowBoxBounds(PyObject *_self, PyObject *_args)
1466 PyObject *_res = NULL;
1467 OSStatus _err;
1468 Point origin;
1469 ThemeGrowDirection growDirection;
1470 Boolean isSmall;
1471 Rect bounds;
1472 #ifndef GetThemeStandaloneGrowBoxBounds
1473 PyMac_PRECHECK(GetThemeStandaloneGrowBoxBounds);
1474 #endif
1475 if (!PyArg_ParseTuple(_args, "O&Hb",
1476 PyMac_GetPoint, &origin,
1477 &growDirection,
1478 &isSmall))
1479 return NULL;
1480 _err = GetThemeStandaloneGrowBoxBounds(origin,
1481 growDirection,
1482 isSmall,
1483 &bounds);
1484 if (_err != noErr) return PyMac_Error(_err);
1485 _res = Py_BuildValue("O&",
1486 PyMac_BuildRect, &bounds);
1487 return _res;
1490 static PyObject *App_NormalizeThemeDrawingState(PyObject *_self, PyObject *_args)
1492 PyObject *_res = NULL;
1493 OSStatus _err;
1494 #ifndef NormalizeThemeDrawingState
1495 PyMac_PRECHECK(NormalizeThemeDrawingState);
1496 #endif
1497 if (!PyArg_ParseTuple(_args, ""))
1498 return NULL;
1499 _err = NormalizeThemeDrawingState();
1500 if (_err != noErr) return PyMac_Error(_err);
1501 Py_INCREF(Py_None);
1502 _res = Py_None;
1503 return _res;
1506 static PyObject *App_GetThemeDrawingState(PyObject *_self, PyObject *_args)
1508 PyObject *_res = NULL;
1509 OSStatus _err;
1510 ThemeDrawingState outState;
1511 #ifndef GetThemeDrawingState
1512 PyMac_PRECHECK(GetThemeDrawingState);
1513 #endif
1514 if (!PyArg_ParseTuple(_args, ""))
1515 return NULL;
1516 _err = GetThemeDrawingState(&outState);
1517 if (_err != noErr) return PyMac_Error(_err);
1518 _res = Py_BuildValue("O&",
1519 ThemeDrawingStateObj_New, outState);
1520 return _res;
1523 static PyObject *App_ApplyThemeBackground(PyObject *_self, PyObject *_args)
1525 PyObject *_res = NULL;
1526 OSStatus _err;
1527 ThemeBackgroundKind inKind;
1528 Rect bounds;
1529 ThemeDrawState inState;
1530 SInt16 inDepth;
1531 Boolean inColorDev;
1532 #ifndef ApplyThemeBackground
1533 PyMac_PRECHECK(ApplyThemeBackground);
1534 #endif
1535 if (!PyArg_ParseTuple(_args, "lO&lhb",
1536 &inKind,
1537 PyMac_GetRect, &bounds,
1538 &inState,
1539 &inDepth,
1540 &inColorDev))
1541 return NULL;
1542 _err = ApplyThemeBackground(inKind,
1543 &bounds,
1544 inState,
1545 inDepth,
1546 inColorDev);
1547 if (_err != noErr) return PyMac_Error(_err);
1548 Py_INCREF(Py_None);
1549 _res = Py_None;
1550 return _res;
1553 static PyObject *App_SetThemeTextColorForWindow(PyObject *_self, PyObject *_args)
1555 PyObject *_res = NULL;
1556 OSStatus _err;
1557 WindowPtr window;
1558 Boolean isActive;
1559 SInt16 depth;
1560 Boolean isColorDev;
1561 #ifndef SetThemeTextColorForWindow
1562 PyMac_PRECHECK(SetThemeTextColorForWindow);
1563 #endif
1564 if (!PyArg_ParseTuple(_args, "O&bhb",
1565 WinObj_Convert, &window,
1566 &isActive,
1567 &depth,
1568 &isColorDev))
1569 return NULL;
1570 _err = SetThemeTextColorForWindow(window,
1571 isActive,
1572 depth,
1573 isColorDev);
1574 if (_err != noErr) return PyMac_Error(_err);
1575 Py_INCREF(Py_None);
1576 _res = Py_None;
1577 return _res;
1580 static PyObject *App_IsValidAppearanceFileType(PyObject *_self, PyObject *_args)
1582 PyObject *_res = NULL;
1583 Boolean _rv;
1584 OSType fileType;
1585 #ifndef IsValidAppearanceFileType
1586 PyMac_PRECHECK(IsValidAppearanceFileType);
1587 #endif
1588 if (!PyArg_ParseTuple(_args, "O&",
1589 PyMac_GetOSType, &fileType))
1590 return NULL;
1591 _rv = IsValidAppearanceFileType(fileType);
1592 _res = Py_BuildValue("b",
1593 _rv);
1594 return _res;
1597 static PyObject *App_GetThemeBrushAsColor(PyObject *_self, PyObject *_args)
1599 PyObject *_res = NULL;
1600 OSStatus _err;
1601 ThemeBrush inBrush;
1602 SInt16 inDepth;
1603 Boolean inColorDev;
1604 RGBColor outColor;
1605 #ifndef GetThemeBrushAsColor
1606 PyMac_PRECHECK(GetThemeBrushAsColor);
1607 #endif
1608 if (!PyArg_ParseTuple(_args, "hhb",
1609 &inBrush,
1610 &inDepth,
1611 &inColorDev))
1612 return NULL;
1613 _err = GetThemeBrushAsColor(inBrush,
1614 inDepth,
1615 inColorDev,
1616 &outColor);
1617 if (_err != noErr) return PyMac_Error(_err);
1618 _res = Py_BuildValue("O&",
1619 QdRGB_New, &outColor);
1620 return _res;
1623 static PyObject *App_GetThemeTextColor(PyObject *_self, PyObject *_args)
1625 PyObject *_res = NULL;
1626 OSStatus _err;
1627 ThemeTextColor inColor;
1628 SInt16 inDepth;
1629 Boolean inColorDev;
1630 RGBColor outColor;
1631 #ifndef GetThemeTextColor
1632 PyMac_PRECHECK(GetThemeTextColor);
1633 #endif
1634 if (!PyArg_ParseTuple(_args, "hhb",
1635 &inColor,
1636 &inDepth,
1637 &inColorDev))
1638 return NULL;
1639 _err = GetThemeTextColor(inColor,
1640 inDepth,
1641 inColorDev,
1642 &outColor);
1643 if (_err != noErr) return PyMac_Error(_err);
1644 _res = Py_BuildValue("O&",
1645 QdRGB_New, &outColor);
1646 return _res;
1649 static PyObject *App_GetThemeMetric(PyObject *_self, PyObject *_args)
1651 PyObject *_res = NULL;
1652 OSStatus _err;
1653 ThemeMetric inMetric;
1654 SInt32 outMetric;
1655 #ifndef GetThemeMetric
1656 PyMac_PRECHECK(GetThemeMetric);
1657 #endif
1658 if (!PyArg_ParseTuple(_args, "l",
1659 &inMetric))
1660 return NULL;
1661 _err = GetThemeMetric(inMetric,
1662 &outMetric);
1663 if (_err != noErr) return PyMac_Error(_err);
1664 _res = Py_BuildValue("l",
1665 outMetric);
1666 return _res;
1669 static PyMethodDef App_methods[] = {
1670 {"RegisterAppearanceClient", (PyCFunction)App_RegisterAppearanceClient, 1,
1671 PyDoc_STR("() -> None")},
1672 {"UnregisterAppearanceClient", (PyCFunction)App_UnregisterAppearanceClient, 1,
1673 PyDoc_STR("() -> None")},
1674 {"SetThemePen", (PyCFunction)App_SetThemePen, 1,
1675 PyDoc_STR("(ThemeBrush inBrush, SInt16 inDepth, Boolean inIsColorDevice) -> None")},
1676 {"SetThemeBackground", (PyCFunction)App_SetThemeBackground, 1,
1677 PyDoc_STR("(ThemeBrush inBrush, SInt16 inDepth, Boolean inIsColorDevice) -> None")},
1678 {"SetThemeTextColor", (PyCFunction)App_SetThemeTextColor, 1,
1679 PyDoc_STR("(ThemeTextColor inColor, SInt16 inDepth, Boolean inIsColorDevice) -> None")},
1680 {"SetThemeWindowBackground", (PyCFunction)App_SetThemeWindowBackground, 1,
1681 PyDoc_STR("(WindowPtr inWindow, ThemeBrush inBrush, Boolean inUpdate) -> None")},
1682 {"DrawThemeWindowHeader", (PyCFunction)App_DrawThemeWindowHeader, 1,
1683 PyDoc_STR("(Rect inRect, ThemeDrawState inState) -> None")},
1684 {"DrawThemeWindowListViewHeader", (PyCFunction)App_DrawThemeWindowListViewHeader, 1,
1685 PyDoc_STR("(Rect inRect, ThemeDrawState inState) -> None")},
1686 {"DrawThemePlacard", (PyCFunction)App_DrawThemePlacard, 1,
1687 PyDoc_STR("(Rect inRect, ThemeDrawState inState) -> None")},
1688 {"DrawThemeEditTextFrame", (PyCFunction)App_DrawThemeEditTextFrame, 1,
1689 PyDoc_STR("(Rect inRect, ThemeDrawState inState) -> None")},
1690 {"DrawThemeListBoxFrame", (PyCFunction)App_DrawThemeListBoxFrame, 1,
1691 PyDoc_STR("(Rect inRect, ThemeDrawState inState) -> None")},
1692 {"DrawThemeFocusRect", (PyCFunction)App_DrawThemeFocusRect, 1,
1693 PyDoc_STR("(Rect inRect, Boolean inHasFocus) -> None")},
1694 {"DrawThemePrimaryGroup", (PyCFunction)App_DrawThemePrimaryGroup, 1,
1695 PyDoc_STR("(Rect inRect, ThemeDrawState inState) -> None")},
1696 {"DrawThemeSecondaryGroup", (PyCFunction)App_DrawThemeSecondaryGroup, 1,
1697 PyDoc_STR("(Rect inRect, ThemeDrawState inState) -> None")},
1698 {"DrawThemeSeparator", (PyCFunction)App_DrawThemeSeparator, 1,
1699 PyDoc_STR("(Rect inRect, ThemeDrawState inState) -> None")},
1700 {"DrawThemeModelessDialogFrame", (PyCFunction)App_DrawThemeModelessDialogFrame, 1,
1701 PyDoc_STR("(Rect inRect, ThemeDrawState inState) -> None")},
1702 {"DrawThemeGenericWell", (PyCFunction)App_DrawThemeGenericWell, 1,
1703 PyDoc_STR("(Rect inRect, ThemeDrawState inState, Boolean inFillCenter) -> None")},
1704 {"DrawThemeFocusRegion", (PyCFunction)App_DrawThemeFocusRegion, 1,
1705 PyDoc_STR("(Boolean inHasFocus) -> None")},
1706 {"IsThemeInColor", (PyCFunction)App_IsThemeInColor, 1,
1707 PyDoc_STR("(SInt16 inDepth, Boolean inIsColorDevice) -> (Boolean _rv)")},
1708 {"GetThemeAccentColors", (PyCFunction)App_GetThemeAccentColors, 1,
1709 PyDoc_STR("() -> (CTabHandle outColors)")},
1710 {"DrawThemeMenuBarBackground", (PyCFunction)App_DrawThemeMenuBarBackground, 1,
1711 PyDoc_STR("(Rect inBounds, ThemeMenuBarState inState, UInt32 inAttributes) -> None")},
1712 {"GetThemeMenuBarHeight", (PyCFunction)App_GetThemeMenuBarHeight, 1,
1713 PyDoc_STR("() -> (SInt16 outHeight)")},
1714 {"DrawThemeMenuBackground", (PyCFunction)App_DrawThemeMenuBackground, 1,
1715 PyDoc_STR("(Rect inMenuRect, ThemeMenuType inMenuType) -> None")},
1716 {"GetThemeMenuBackgroundRegion", (PyCFunction)App_GetThemeMenuBackgroundRegion, 1,
1717 PyDoc_STR("(Rect inMenuRect, ThemeMenuType menuType) -> None")},
1718 {"DrawThemeMenuSeparator", (PyCFunction)App_DrawThemeMenuSeparator, 1,
1719 PyDoc_STR("(Rect inItemRect) -> None")},
1720 {"GetThemeMenuSeparatorHeight", (PyCFunction)App_GetThemeMenuSeparatorHeight, 1,
1721 PyDoc_STR("() -> (SInt16 outHeight)")},
1722 {"GetThemeMenuItemExtra", (PyCFunction)App_GetThemeMenuItemExtra, 1,
1723 PyDoc_STR("(ThemeMenuItemType inItemType) -> (SInt16 outHeight, SInt16 outWidth)")},
1724 {"GetThemeMenuTitleExtra", (PyCFunction)App_GetThemeMenuTitleExtra, 1,
1725 PyDoc_STR("(Boolean inIsSquished) -> (SInt16 outWidth)")},
1726 {"DrawThemeTabPane", (PyCFunction)App_DrawThemeTabPane, 1,
1727 PyDoc_STR("(Rect inRect, ThemeDrawState inState) -> None")},
1728 {"GetThemeTabRegion", (PyCFunction)App_GetThemeTabRegion, 1,
1729 PyDoc_STR("(Rect inRect, ThemeTabStyle inStyle, ThemeTabDirection inDirection) -> None")},
1730 {"SetThemeCursor", (PyCFunction)App_SetThemeCursor, 1,
1731 PyDoc_STR("(ThemeCursor inCursor) -> None")},
1732 {"SetAnimatedThemeCursor", (PyCFunction)App_SetAnimatedThemeCursor, 1,
1733 PyDoc_STR("(ThemeCursor inCursor, UInt32 inAnimationStep) -> None")},
1734 {"GetThemeScrollBarThumbStyle", (PyCFunction)App_GetThemeScrollBarThumbStyle, 1,
1735 PyDoc_STR("() -> (ThemeScrollBarThumbStyle outStyle)")},
1736 {"GetThemeScrollBarArrowStyle", (PyCFunction)App_GetThemeScrollBarArrowStyle, 1,
1737 PyDoc_STR("() -> (ThemeScrollBarArrowStyle outStyle)")},
1738 {"GetThemeCheckBoxStyle", (PyCFunction)App_GetThemeCheckBoxStyle, 1,
1739 PyDoc_STR("() -> (ThemeCheckBoxStyle outStyle)")},
1740 {"UseThemeFont", (PyCFunction)App_UseThemeFont, 1,
1741 PyDoc_STR("(ThemeFontID inFontID, ScriptCode inScript) -> None")},
1742 {"DrawThemeTextBox", (PyCFunction)App_DrawThemeTextBox, 1,
1743 PyDoc_STR("(CFStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, Boolean inWrapToWidth, Rect inBoundingBox, SInt16 inJust) -> None")},
1744 {"TruncateThemeText", (PyCFunction)App_TruncateThemeText, 1,
1745 PyDoc_STR("(CFMutableStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, SInt16 inPixelWidthLimit, TruncCode inTruncWhere) -> (Boolean outTruncated)")},
1746 {"GetThemeTextDimensions", (PyCFunction)App_GetThemeTextDimensions, 1,
1747 PyDoc_STR("(CFStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, Boolean inWrapToWidth, Point ioBounds) -> (Point ioBounds, SInt16 outBaseline)")},
1748 {"GetThemeTextShadowOutset", (PyCFunction)App_GetThemeTextShadowOutset, 1,
1749 PyDoc_STR("(ThemeFontID inFontID, ThemeDrawState inState) -> (Rect outOutset)")},
1750 {"DrawThemeScrollBarArrows", (PyCFunction)App_DrawThemeScrollBarArrows, 1,
1751 PyDoc_STR("(Rect bounds, ThemeTrackEnableState enableState, ThemeTrackPressState pressState, Boolean isHoriz) -> (Rect trackBounds)")},
1752 {"GetThemeScrollBarTrackRect", (PyCFunction)App_GetThemeScrollBarTrackRect, 1,
1753 PyDoc_STR("(Rect bounds, ThemeTrackEnableState enableState, ThemeTrackPressState pressState, Boolean isHoriz) -> (Rect trackBounds)")},
1754 {"HitTestThemeScrollBarArrows", (PyCFunction)App_HitTestThemeScrollBarArrows, 1,
1755 PyDoc_STR("(Rect scrollBarBounds, ThemeTrackEnableState enableState, ThemeTrackPressState pressState, Boolean isHoriz, Point ptHit) -> (Boolean _rv, Rect trackBounds, ControlPartCode partcode)")},
1756 {"DrawThemeScrollBarDelimiters", (PyCFunction)App_DrawThemeScrollBarDelimiters, 1,
1757 PyDoc_STR("(ThemeWindowType flavor, Rect inContRect, ThemeDrawState state, ThemeWindowAttributes attributes) -> None")},
1758 {"DrawThemeButton", (PyCFunction)App_DrawThemeButton, 1,
1759 PyDoc_STR("(Rect inBounds, UInt16 inKind, ThemeButtonDrawInfo inNewInfo, ThemeButtonDrawInfo inPrevInfo, UInt32 inUserData) -> None")},
1760 {"GetThemeButtonRegion", (PyCFunction)App_GetThemeButtonRegion, 1,
1761 PyDoc_STR("(Rect inBounds, UInt16 inKind, ThemeButtonDrawInfo inNewInfo) -> None")},
1762 {"GetThemeButtonContentBounds", (PyCFunction)App_GetThemeButtonContentBounds, 1,
1763 PyDoc_STR("(Rect inBounds, UInt16 inKind, ThemeButtonDrawInfo inDrawInfo) -> (Rect outBounds)")},
1764 {"GetThemeButtonBackgroundBounds", (PyCFunction)App_GetThemeButtonBackgroundBounds, 1,
1765 PyDoc_STR("(Rect inBounds, UInt16 inKind, ThemeButtonDrawInfo inDrawInfo) -> (Rect outBounds)")},
1766 {"PlayThemeSound", (PyCFunction)App_PlayThemeSound, 1,
1767 PyDoc_STR("(ThemeSoundKind kind) -> None")},
1768 {"BeginThemeDragSound", (PyCFunction)App_BeginThemeDragSound, 1,
1769 PyDoc_STR("(ThemeDragSoundKind kind) -> None")},
1770 {"EndThemeDragSound", (PyCFunction)App_EndThemeDragSound, 1,
1771 PyDoc_STR("() -> None")},
1772 {"DrawThemeTickMark", (PyCFunction)App_DrawThemeTickMark, 1,
1773 PyDoc_STR("(Rect bounds, ThemeDrawState state) -> None")},
1774 {"DrawThemeChasingArrows", (PyCFunction)App_DrawThemeChasingArrows, 1,
1775 PyDoc_STR("(Rect bounds, UInt32 index, ThemeDrawState state, UInt32 eraseData) -> None")},
1776 {"DrawThemePopupArrow", (PyCFunction)App_DrawThemePopupArrow, 1,
1777 PyDoc_STR("(Rect bounds, ThemeArrowOrientation orientation, ThemePopupArrowSize size, ThemeDrawState state, UInt32 eraseData) -> None")},
1778 {"DrawThemeStandaloneGrowBox", (PyCFunction)App_DrawThemeStandaloneGrowBox, 1,
1779 PyDoc_STR("(Point origin, ThemeGrowDirection growDirection, Boolean isSmall, ThemeDrawState state) -> None")},
1780 {"DrawThemeStandaloneNoGrowBox", (PyCFunction)App_DrawThemeStandaloneNoGrowBox, 1,
1781 PyDoc_STR("(Point origin, ThemeGrowDirection growDirection, Boolean isSmall, ThemeDrawState state) -> None")},
1782 {"GetThemeStandaloneGrowBoxBounds", (PyCFunction)App_GetThemeStandaloneGrowBoxBounds, 1,
1783 PyDoc_STR("(Point origin, ThemeGrowDirection growDirection, Boolean isSmall) -> (Rect bounds)")},
1784 {"NormalizeThemeDrawingState", (PyCFunction)App_NormalizeThemeDrawingState, 1,
1785 PyDoc_STR("() -> None")},
1786 {"GetThemeDrawingState", (PyCFunction)App_GetThemeDrawingState, 1,
1787 PyDoc_STR("() -> (ThemeDrawingState outState)")},
1788 {"ApplyThemeBackground", (PyCFunction)App_ApplyThemeBackground, 1,
1789 PyDoc_STR("(ThemeBackgroundKind inKind, Rect bounds, ThemeDrawState inState, SInt16 inDepth, Boolean inColorDev) -> None")},
1790 {"SetThemeTextColorForWindow", (PyCFunction)App_SetThemeTextColorForWindow, 1,
1791 PyDoc_STR("(WindowPtr window, Boolean isActive, SInt16 depth, Boolean isColorDev) -> None")},
1792 {"IsValidAppearanceFileType", (PyCFunction)App_IsValidAppearanceFileType, 1,
1793 PyDoc_STR("(OSType fileType) -> (Boolean _rv)")},
1794 {"GetThemeBrushAsColor", (PyCFunction)App_GetThemeBrushAsColor, 1,
1795 PyDoc_STR("(ThemeBrush inBrush, SInt16 inDepth, Boolean inColorDev) -> (RGBColor outColor)")},
1796 {"GetThemeTextColor", (PyCFunction)App_GetThemeTextColor, 1,
1797 PyDoc_STR("(ThemeTextColor inColor, SInt16 inDepth, Boolean inColorDev) -> (RGBColor outColor)")},
1798 {"GetThemeMetric", (PyCFunction)App_GetThemeMetric, 1,
1799 PyDoc_STR("(ThemeMetric inMetric) -> (SInt32 outMetric)")},
1800 {NULL, NULL, 0}
1806 void init_App(void)
1808 PyObject *m;
1809 PyObject *d;
1814 m = Py_InitModule("_App", App_methods);
1815 d = PyModule_GetDict(m);
1816 App_Error = PyMac_GetOSErrException();
1817 if (App_Error == NULL ||
1818 PyDict_SetItemString(d, "Error", App_Error) != 0)
1819 return;
1820 ThemeDrawingState_Type.ob_type = &PyType_Type;
1821 if (PyType_Ready(&ThemeDrawingState_Type) < 0) return;
1822 Py_INCREF(&ThemeDrawingState_Type);
1823 PyModule_AddObject(m, "ThemeDrawingState", (PyObject *)&ThemeDrawingState_Type);
1824 /* Backward-compatible name */
1825 Py_INCREF(&ThemeDrawingState_Type);
1826 PyModule_AddObject(m, "ThemeDrawingStateType", (PyObject *)&ThemeDrawingState_Type);
1829 /* ======================== End module _App ========================= */