2 /* ========================== Module _Ctl =========================== */
9 #include "pywintoolbox.h"
12 #include "pymactoolbox.h"
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"); \
23 #ifdef WITHOUT_FRAMEWORKS
25 #include <ControlDefinitions.h>
27 #include <Carbon/Carbon.h>
30 #ifdef USE_TOOLBOX_OBJECT_GLUE
31 extern PyObject
*_CtlObj_New(ControlHandle
);
32 extern int _CtlObj_Convert(PyObject
*, ControlHandle
*);
34 #define CtlObj_New _CtlObj_New
35 #define CtlObj_Convert _CtlObj_Convert
38 static PyObject
*CtlObj_WhichControl(ControlHandle
);
40 #define as_Control(h) ((ControlHandle)h)
41 #define as_Resource(ctl) ((Handle)ctl)
42 #define GetControlRect(ctl, rectp) GetControlBounds(ctl, rectp)
44 #define MAXTABS 32 /* maximum number of tabs that we support in a tabs control */
46 ** Parse/generate ControlFontStyleRec records
48 #if 0 /* Not needed */
50 ControlFontStyle_New(ControlFontStyleRec
*itself
)
53 return Py_BuildValue("hhhhhhO&O&", itself
->flags
, itself
->font
,
54 itself
->size
, itself
->style
, itself
->mode
, itself
->just
,
55 QdRGB_New
, &itself
->foreColor
, QdRGB_New
, &itself
->backColor
);
60 ControlFontStyle_Convert(PyObject
*v
, ControlFontStyleRec
*itself
)
62 return PyArg_Parse(v
, "(hhhhhhO&O&)", &itself
->flags
,
63 &itself
->font
, &itself
->size
, &itself
->style
, &itself
->mode
,
64 &itself
->just
, QdRGB_Convert
, &itself
->foreColor
,
65 QdRGB_Convert
, &itself
->backColor
);
69 ** Parse/generate ControlID records
72 PyControlID_New(ControlID
*itself
)
75 return Py_BuildValue("O&l", PyMac_BuildOSType
, itself
->signature
, itself
->id
);
79 PyControlID_Convert(PyObject
*v
, ControlID
*itself
)
81 return PyArg_Parse(v
, "(O&l)", PyMac_GetOSType
, &itself
->signature
, &itself
->id
);
85 ** generate DataBrowserListViewColumnDesc records
88 DataBrowserTableViewColumnDesc_Convert(PyObject
*v
, DataBrowserTableViewColumnDesc
*itself
)
90 return PyArg_Parse(v
, "(lO&l)",
92 PyMac_GetOSType
, &itself
->propertyType
,
93 &itself
->propertyFlags
);
97 ControlButtonContentInfo_Convert(PyObject
*v
, ControlButtonContentInfo
*itself
)
99 return PyArg_Parse(v
, "(hO&)",
100 &itself
->contentType
,
101 OptResObj_Convert
, &itself
->u
.iconSuite
);
105 DataBrowserListViewHeaderDesc_Convert(PyObject
*v
, DataBrowserListViewHeaderDesc
*itself
)
107 itself
->version
= kDataBrowserListViewLatestHeaderDesc
;
108 return PyArg_Parse(v
, "(HHhO&HO&O&)",
109 &itself
->minimumWidth
,
110 &itself
->maximumWidth
,
111 &itself
->titleOffset
,
112 CFStringRefObj_Convert
, &itself
->titleString
,
113 &itself
->initialOrder
,
114 ControlFontStyle_Convert
, &itself
->btnFontStyle
,
115 ControlButtonContentInfo_Convert
, &itself
->btnContentInfo
);
119 DataBrowserListViewColumnDesc_Convert(PyObject
*v
, DataBrowserListViewColumnDesc
*itself
)
121 return PyArg_Parse(v
, "(O&O&)",
122 DataBrowserTableViewColumnDesc_Convert
, &itself
->propertyDesc
,
123 DataBrowserListViewHeaderDesc_Convert
, &itself
->headerBtnDesc
);
126 /* TrackControl and HandleControlClick callback support */
127 #define kMyControlActionProcTag 'ACTN' /* not an official tag, only for internal use */
128 static PyObject
*tracker
;
129 static ControlActionUPP mytracker_upp
;
130 static ControlActionUPP myactionproc_upp
;
131 static ControlUserPaneKeyDownUPP mykeydownproc_upp
;
132 static ControlUserPaneFocusUPP myfocusproc_upp
;
133 static ControlUserPaneDrawUPP mydrawproc_upp
;
134 static ControlUserPaneIdleUPP myidleproc_upp
;
135 static ControlUserPaneHitTestUPP myhittestproc_upp
;
136 static ControlUserPaneTrackingUPP mytrackingproc_upp
;
138 static int settrackfunc(PyObject
*); /* forward */
139 static void clrtrackfunc(void); /* forward */
140 static int setcallback(PyObject
*, OSType
, PyObject
*, UniversalProcPtr
*);
142 static PyObject
*Ctl_Error
;
144 /* ---------------------- Object type Control ----------------------- */
146 PyTypeObject Control_Type
;
148 #define CtlObj_Check(x) ((x)->ob_type == &Control_Type || PyObject_TypeCheck((x), &Control_Type))
150 typedef struct ControlObject
{
152 ControlHandle ob_itself
;
153 PyObject
*ob_callbackdict
;
156 PyObject
*CtlObj_New(ControlHandle itself
)
159 if (itself
== NULL
) return PyMac_Error(resNotFound
);
160 it
= PyObject_NEW(ControlObject
, &Control_Type
);
161 if (it
== NULL
) return NULL
;
162 it
->ob_itself
= itself
;
163 SetControlReference(itself
, (long)it
);
164 it
->ob_callbackdict
= NULL
;
165 return (PyObject
*)it
;
167 int CtlObj_Convert(PyObject
*v
, ControlHandle
*p_itself
)
169 if (!CtlObj_Check(v
))
171 PyErr_SetString(PyExc_TypeError
, "Control required");
174 *p_itself
= ((ControlObject
*)v
)->ob_itself
;
178 static void CtlObj_dealloc(ControlObject
*self
)
180 Py_XDECREF(self
->ob_callbackdict
);
181 if (self
->ob_itself
)SetControlReference(self
->ob_itself
, (long)0); /* Make it forget about us */
182 self
->ob_type
->tp_free((PyObject
*)self
);
185 static PyObject
*CtlObj_HiliteControl(ControlObject
*_self
, PyObject
*_args
)
187 PyObject
*_res
= NULL
;
188 ControlPartCode hiliteState
;
189 #ifndef HiliteControl
190 PyMac_PRECHECK(HiliteControl
);
192 if (!PyArg_ParseTuple(_args
, "h",
195 HiliteControl(_self
->ob_itself
,
202 static PyObject
*CtlObj_ShowControl(ControlObject
*_self
, PyObject
*_args
)
204 PyObject
*_res
= NULL
;
206 PyMac_PRECHECK(ShowControl
);
208 if (!PyArg_ParseTuple(_args
, ""))
210 ShowControl(_self
->ob_itself
);
216 static PyObject
*CtlObj_HideControl(ControlObject
*_self
, PyObject
*_args
)
218 PyObject
*_res
= NULL
;
220 PyMac_PRECHECK(HideControl
);
222 if (!PyArg_ParseTuple(_args
, ""))
224 HideControl(_self
->ob_itself
);
230 static PyObject
*CtlObj_IsControlActive(ControlObject
*_self
, PyObject
*_args
)
232 PyObject
*_res
= NULL
;
234 #ifndef IsControlActive
235 PyMac_PRECHECK(IsControlActive
);
237 if (!PyArg_ParseTuple(_args
, ""))
239 _rv
= IsControlActive(_self
->ob_itself
);
240 _res
= Py_BuildValue("b",
245 static PyObject
*CtlObj_IsControlVisible(ControlObject
*_self
, PyObject
*_args
)
247 PyObject
*_res
= NULL
;
249 #ifndef IsControlVisible
250 PyMac_PRECHECK(IsControlVisible
);
252 if (!PyArg_ParseTuple(_args
, ""))
254 _rv
= IsControlVisible(_self
->ob_itself
);
255 _res
= Py_BuildValue("b",
260 static PyObject
*CtlObj_ActivateControl(ControlObject
*_self
, PyObject
*_args
)
262 PyObject
*_res
= NULL
;
264 #ifndef ActivateControl
265 PyMac_PRECHECK(ActivateControl
);
267 if (!PyArg_ParseTuple(_args
, ""))
269 _err
= ActivateControl(_self
->ob_itself
);
270 if (_err
!= noErr
) return PyMac_Error(_err
);
276 static PyObject
*CtlObj_DeactivateControl(ControlObject
*_self
, PyObject
*_args
)
278 PyObject
*_res
= NULL
;
280 #ifndef DeactivateControl
281 PyMac_PRECHECK(DeactivateControl
);
283 if (!PyArg_ParseTuple(_args
, ""))
285 _err
= DeactivateControl(_self
->ob_itself
);
286 if (_err
!= noErr
) return PyMac_Error(_err
);
292 static PyObject
*CtlObj_SetControlVisibility(ControlObject
*_self
, PyObject
*_args
)
294 PyObject
*_res
= NULL
;
298 #ifndef SetControlVisibility
299 PyMac_PRECHECK(SetControlVisibility
);
301 if (!PyArg_ParseTuple(_args
, "bb",
305 _err
= SetControlVisibility(_self
->ob_itself
,
308 if (_err
!= noErr
) return PyMac_Error(_err
);
314 #if TARGET_API_MAC_OSX
316 static PyObject
*CtlObj_IsControlEnabled(ControlObject
*_self
, PyObject
*_args
)
318 PyObject
*_res
= NULL
;
320 #ifndef IsControlEnabled
321 PyMac_PRECHECK(IsControlEnabled
);
323 if (!PyArg_ParseTuple(_args
, ""))
325 _rv
= IsControlEnabled(_self
->ob_itself
);
326 _res
= Py_BuildValue("b",
332 #if TARGET_API_MAC_OSX
334 static PyObject
*CtlObj_EnableControl(ControlObject
*_self
, PyObject
*_args
)
336 PyObject
*_res
= NULL
;
338 #ifndef EnableControl
339 PyMac_PRECHECK(EnableControl
);
341 if (!PyArg_ParseTuple(_args
, ""))
343 _err
= EnableControl(_self
->ob_itself
);
344 if (_err
!= noErr
) return PyMac_Error(_err
);
351 #if TARGET_API_MAC_OSX
353 static PyObject
*CtlObj_DisableControl(ControlObject
*_self
, PyObject
*_args
)
355 PyObject
*_res
= NULL
;
357 #ifndef DisableControl
358 PyMac_PRECHECK(DisableControl
);
360 if (!PyArg_ParseTuple(_args
, ""))
362 _err
= DisableControl(_self
->ob_itself
);
363 if (_err
!= noErr
) return PyMac_Error(_err
);
370 static PyObject
*CtlObj_Draw1Control(ControlObject
*_self
, PyObject
*_args
)
372 PyObject
*_res
= NULL
;
374 PyMac_PRECHECK(Draw1Control
);
376 if (!PyArg_ParseTuple(_args
, ""))
378 Draw1Control(_self
->ob_itself
);
384 static PyObject
*CtlObj_GetBestControlRect(ControlObject
*_self
, PyObject
*_args
)
386 PyObject
*_res
= NULL
;
389 SInt16 outBaseLineOffset
;
390 #ifndef GetBestControlRect
391 PyMac_PRECHECK(GetBestControlRect
);
393 if (!PyArg_ParseTuple(_args
, ""))
395 _err
= GetBestControlRect(_self
->ob_itself
,
398 if (_err
!= noErr
) return PyMac_Error(_err
);
399 _res
= Py_BuildValue("O&h",
400 PyMac_BuildRect
, &outRect
,
405 static PyObject
*CtlObj_SetControlFontStyle(ControlObject
*_self
, PyObject
*_args
)
407 PyObject
*_res
= NULL
;
409 ControlFontStyleRec inStyle
;
410 #ifndef SetControlFontStyle
411 PyMac_PRECHECK(SetControlFontStyle
);
413 if (!PyArg_ParseTuple(_args
, "O&",
414 ControlFontStyle_Convert
, &inStyle
))
416 _err
= SetControlFontStyle(_self
->ob_itself
,
418 if (_err
!= noErr
) return PyMac_Error(_err
);
424 static PyObject
*CtlObj_DrawControlInCurrentPort(ControlObject
*_self
, PyObject
*_args
)
426 PyObject
*_res
= NULL
;
427 #ifndef DrawControlInCurrentPort
428 PyMac_PRECHECK(DrawControlInCurrentPort
);
430 if (!PyArg_ParseTuple(_args
, ""))
432 DrawControlInCurrentPort(_self
->ob_itself
);
438 static PyObject
*CtlObj_SetUpControlBackground(ControlObject
*_self
, PyObject
*_args
)
440 PyObject
*_res
= NULL
;
443 Boolean inIsColorDevice
;
444 #ifndef SetUpControlBackground
445 PyMac_PRECHECK(SetUpControlBackground
);
447 if (!PyArg_ParseTuple(_args
, "hb",
451 _err
= SetUpControlBackground(_self
->ob_itself
,
454 if (_err
!= noErr
) return PyMac_Error(_err
);
460 static PyObject
*CtlObj_SetUpControlTextColor(ControlObject
*_self
, PyObject
*_args
)
462 PyObject
*_res
= NULL
;
465 Boolean inIsColorDevice
;
466 #ifndef SetUpControlTextColor
467 PyMac_PRECHECK(SetUpControlTextColor
);
469 if (!PyArg_ParseTuple(_args
, "hb",
473 _err
= SetUpControlTextColor(_self
->ob_itself
,
476 if (_err
!= noErr
) return PyMac_Error(_err
);
482 static PyObject
*CtlObj_DragControl(ControlObject
*_self
, PyObject
*_args
)
484 PyObject
*_res
= NULL
;
490 PyMac_PRECHECK(DragControl
);
492 if (!PyArg_ParseTuple(_args
, "O&O&O&H",
493 PyMac_GetPoint
, &startPoint
,
494 PyMac_GetRect
, &limitRect
,
495 PyMac_GetRect
, &slopRect
,
498 DragControl(_self
->ob_itself
,
508 static PyObject
*CtlObj_TestControl(ControlObject
*_self
, PyObject
*_args
)
510 PyObject
*_res
= NULL
;
514 PyMac_PRECHECK(TestControl
);
516 if (!PyArg_ParseTuple(_args
, "O&",
517 PyMac_GetPoint
, &testPoint
))
519 _rv
= TestControl(_self
->ob_itself
,
521 _res
= Py_BuildValue("h",
526 static PyObject
*CtlObj_HandleControlContextualMenuClick(ControlObject
*_self
, PyObject
*_args
)
528 PyObject
*_res
= NULL
;
531 Boolean menuDisplayed
;
532 #ifndef HandleControlContextualMenuClick
533 PyMac_PRECHECK(HandleControlContextualMenuClick
);
535 if (!PyArg_ParseTuple(_args
, "O&",
536 PyMac_GetPoint
, &inWhere
))
538 _err
= HandleControlContextualMenuClick(_self
->ob_itself
,
541 if (_err
!= noErr
) return PyMac_Error(_err
);
542 _res
= Py_BuildValue("b",
547 static PyObject
*CtlObj_GetControlClickActivation(ControlObject
*_self
, PyObject
*_args
)
549 PyObject
*_res
= NULL
;
552 EventModifiers inModifiers
;
553 ClickActivationResult outResult
;
554 #ifndef GetControlClickActivation
555 PyMac_PRECHECK(GetControlClickActivation
);
557 if (!PyArg_ParseTuple(_args
, "O&H",
558 PyMac_GetPoint
, &inWhere
,
561 _err
= GetControlClickActivation(_self
->ob_itself
,
565 if (_err
!= noErr
) return PyMac_Error(_err
);
566 _res
= Py_BuildValue("l",
571 static PyObject
*CtlObj_HandleControlKey(ControlObject
*_self
, PyObject
*_args
)
573 PyObject
*_res
= NULL
;
577 EventModifiers inModifiers
;
578 #ifndef HandleControlKey
579 PyMac_PRECHECK(HandleControlKey
);
581 if (!PyArg_ParseTuple(_args
, "hhH",
586 _rv
= HandleControlKey(_self
->ob_itself
,
590 _res
= Py_BuildValue("h",
595 static PyObject
*CtlObj_HandleControlSetCursor(ControlObject
*_self
, PyObject
*_args
)
597 PyObject
*_res
= NULL
;
600 EventModifiers modifiers
;
601 Boolean cursorWasSet
;
602 #ifndef HandleControlSetCursor
603 PyMac_PRECHECK(HandleControlSetCursor
);
605 if (!PyArg_ParseTuple(_args
, "O&H",
606 PyMac_GetPoint
, &localPoint
,
609 _err
= HandleControlSetCursor(_self
->ob_itself
,
613 if (_err
!= noErr
) return PyMac_Error(_err
);
614 _res
= Py_BuildValue("b",
619 static PyObject
*CtlObj_MoveControl(ControlObject
*_self
, PyObject
*_args
)
621 PyObject
*_res
= NULL
;
625 PyMac_PRECHECK(MoveControl
);
627 if (!PyArg_ParseTuple(_args
, "hh",
631 MoveControl(_self
->ob_itself
,
639 static PyObject
*CtlObj_SizeControl(ControlObject
*_self
, PyObject
*_args
)
641 PyObject
*_res
= NULL
;
645 PyMac_PRECHECK(SizeControl
);
647 if (!PyArg_ParseTuple(_args
, "hh",
651 SizeControl(_self
->ob_itself
,
659 static PyObject
*CtlObj_SetControlTitle(ControlObject
*_self
, PyObject
*_args
)
661 PyObject
*_res
= NULL
;
663 #ifndef SetControlTitle
664 PyMac_PRECHECK(SetControlTitle
);
666 if (!PyArg_ParseTuple(_args
, "O&",
667 PyMac_GetStr255
, title
))
669 SetControlTitle(_self
->ob_itself
,
676 static PyObject
*CtlObj_GetControlTitle(ControlObject
*_self
, PyObject
*_args
)
678 PyObject
*_res
= NULL
;
680 #ifndef GetControlTitle
681 PyMac_PRECHECK(GetControlTitle
);
683 if (!PyArg_ParseTuple(_args
, ""))
685 GetControlTitle(_self
->ob_itself
,
687 _res
= Py_BuildValue("O&",
688 PyMac_BuildStr255
, title
);
692 static PyObject
*CtlObj_SetControlTitleWithCFString(ControlObject
*_self
, PyObject
*_args
)
694 PyObject
*_res
= NULL
;
696 CFStringRef inString
;
697 #ifndef SetControlTitleWithCFString
698 PyMac_PRECHECK(SetControlTitleWithCFString
);
700 if (!PyArg_ParseTuple(_args
, "O&",
701 CFStringRefObj_Convert
, &inString
))
703 _err
= SetControlTitleWithCFString(_self
->ob_itself
,
705 if (_err
!= noErr
) return PyMac_Error(_err
);
711 static PyObject
*CtlObj_CopyControlTitleAsCFString(ControlObject
*_self
, PyObject
*_args
)
713 PyObject
*_res
= NULL
;
715 CFStringRef outString
;
716 #ifndef CopyControlTitleAsCFString
717 PyMac_PRECHECK(CopyControlTitleAsCFString
);
719 if (!PyArg_ParseTuple(_args
, ""))
721 _err
= CopyControlTitleAsCFString(_self
->ob_itself
,
723 if (_err
!= noErr
) return PyMac_Error(_err
);
724 _res
= Py_BuildValue("O&",
725 CFStringRefObj_New
, outString
);
729 static PyObject
*CtlObj_GetControlValue(ControlObject
*_self
, PyObject
*_args
)
731 PyObject
*_res
= NULL
;
733 #ifndef GetControlValue
734 PyMac_PRECHECK(GetControlValue
);
736 if (!PyArg_ParseTuple(_args
, ""))
738 _rv
= GetControlValue(_self
->ob_itself
);
739 _res
= Py_BuildValue("h",
744 static PyObject
*CtlObj_SetControlValue(ControlObject
*_self
, PyObject
*_args
)
746 PyObject
*_res
= NULL
;
748 #ifndef SetControlValue
749 PyMac_PRECHECK(SetControlValue
);
751 if (!PyArg_ParseTuple(_args
, "h",
754 SetControlValue(_self
->ob_itself
,
761 static PyObject
*CtlObj_GetControlMinimum(ControlObject
*_self
, PyObject
*_args
)
763 PyObject
*_res
= NULL
;
765 #ifndef GetControlMinimum
766 PyMac_PRECHECK(GetControlMinimum
);
768 if (!PyArg_ParseTuple(_args
, ""))
770 _rv
= GetControlMinimum(_self
->ob_itself
);
771 _res
= Py_BuildValue("h",
776 static PyObject
*CtlObj_SetControlMinimum(ControlObject
*_self
, PyObject
*_args
)
778 PyObject
*_res
= NULL
;
780 #ifndef SetControlMinimum
781 PyMac_PRECHECK(SetControlMinimum
);
783 if (!PyArg_ParseTuple(_args
, "h",
786 SetControlMinimum(_self
->ob_itself
,
793 static PyObject
*CtlObj_GetControlMaximum(ControlObject
*_self
, PyObject
*_args
)
795 PyObject
*_res
= NULL
;
797 #ifndef GetControlMaximum
798 PyMac_PRECHECK(GetControlMaximum
);
800 if (!PyArg_ParseTuple(_args
, ""))
802 _rv
= GetControlMaximum(_self
->ob_itself
);
803 _res
= Py_BuildValue("h",
808 static PyObject
*CtlObj_SetControlMaximum(ControlObject
*_self
, PyObject
*_args
)
810 PyObject
*_res
= NULL
;
812 #ifndef SetControlMaximum
813 PyMac_PRECHECK(SetControlMaximum
);
815 if (!PyArg_ParseTuple(_args
, "h",
818 SetControlMaximum(_self
->ob_itself
,
825 static PyObject
*CtlObj_GetControlViewSize(ControlObject
*_self
, PyObject
*_args
)
827 PyObject
*_res
= NULL
;
829 #ifndef GetControlViewSize
830 PyMac_PRECHECK(GetControlViewSize
);
832 if (!PyArg_ParseTuple(_args
, ""))
834 _rv
= GetControlViewSize(_self
->ob_itself
);
835 _res
= Py_BuildValue("l",
840 static PyObject
*CtlObj_SetControlViewSize(ControlObject
*_self
, PyObject
*_args
)
842 PyObject
*_res
= NULL
;
844 #ifndef SetControlViewSize
845 PyMac_PRECHECK(SetControlViewSize
);
847 if (!PyArg_ParseTuple(_args
, "l",
850 SetControlViewSize(_self
->ob_itself
,
857 static PyObject
*CtlObj_GetControl32BitValue(ControlObject
*_self
, PyObject
*_args
)
859 PyObject
*_res
= NULL
;
861 #ifndef GetControl32BitValue
862 PyMac_PRECHECK(GetControl32BitValue
);
864 if (!PyArg_ParseTuple(_args
, ""))
866 _rv
= GetControl32BitValue(_self
->ob_itself
);
867 _res
= Py_BuildValue("l",
872 static PyObject
*CtlObj_SetControl32BitValue(ControlObject
*_self
, PyObject
*_args
)
874 PyObject
*_res
= NULL
;
876 #ifndef SetControl32BitValue
877 PyMac_PRECHECK(SetControl32BitValue
);
879 if (!PyArg_ParseTuple(_args
, "l",
882 SetControl32BitValue(_self
->ob_itself
,
889 static PyObject
*CtlObj_GetControl32BitMaximum(ControlObject
*_self
, PyObject
*_args
)
891 PyObject
*_res
= NULL
;
893 #ifndef GetControl32BitMaximum
894 PyMac_PRECHECK(GetControl32BitMaximum
);
896 if (!PyArg_ParseTuple(_args
, ""))
898 _rv
= GetControl32BitMaximum(_self
->ob_itself
);
899 _res
= Py_BuildValue("l",
904 static PyObject
*CtlObj_SetControl32BitMaximum(ControlObject
*_self
, PyObject
*_args
)
906 PyObject
*_res
= NULL
;
908 #ifndef SetControl32BitMaximum
909 PyMac_PRECHECK(SetControl32BitMaximum
);
911 if (!PyArg_ParseTuple(_args
, "l",
914 SetControl32BitMaximum(_self
->ob_itself
,
921 static PyObject
*CtlObj_GetControl32BitMinimum(ControlObject
*_self
, PyObject
*_args
)
923 PyObject
*_res
= NULL
;
925 #ifndef GetControl32BitMinimum
926 PyMac_PRECHECK(GetControl32BitMinimum
);
928 if (!PyArg_ParseTuple(_args
, ""))
930 _rv
= GetControl32BitMinimum(_self
->ob_itself
);
931 _res
= Py_BuildValue("l",
936 static PyObject
*CtlObj_SetControl32BitMinimum(ControlObject
*_self
, PyObject
*_args
)
938 PyObject
*_res
= NULL
;
940 #ifndef SetControl32BitMinimum
941 PyMac_PRECHECK(SetControl32BitMinimum
);
943 if (!PyArg_ParseTuple(_args
, "l",
946 SetControl32BitMinimum(_self
->ob_itself
,
953 static PyObject
*CtlObj_IsValidControlHandle(ControlObject
*_self
, PyObject
*_args
)
955 PyObject
*_res
= NULL
;
957 #ifndef IsValidControlHandle
958 PyMac_PRECHECK(IsValidControlHandle
);
960 if (!PyArg_ParseTuple(_args
, ""))
962 _rv
= IsValidControlHandle(_self
->ob_itself
);
963 _res
= Py_BuildValue("b",
968 static PyObject
*CtlObj_SetControlID(ControlObject
*_self
, PyObject
*_args
)
970 PyObject
*_res
= NULL
;
974 PyMac_PRECHECK(SetControlID
);
976 if (!PyArg_ParseTuple(_args
, "O&",
977 PyControlID_Convert
, &inID
))
979 _err
= SetControlID(_self
->ob_itself
,
981 if (_err
!= noErr
) return PyMac_Error(_err
);
987 static PyObject
*CtlObj_GetControlID(ControlObject
*_self
, PyObject
*_args
)
989 PyObject
*_res
= NULL
;
993 PyMac_PRECHECK(GetControlID
);
995 if (!PyArg_ParseTuple(_args
, ""))
997 _err
= GetControlID(_self
->ob_itself
,
999 if (_err
!= noErr
) return PyMac_Error(_err
);
1000 _res
= Py_BuildValue("O&",
1001 PyControlID_New
, &outID
);
1005 static PyObject
*CtlObj_SetControlCommandID(ControlObject
*_self
, PyObject
*_args
)
1007 PyObject
*_res
= NULL
;
1010 #ifndef SetControlCommandID
1011 PyMac_PRECHECK(SetControlCommandID
);
1013 if (!PyArg_ParseTuple(_args
, "l",
1016 _err
= SetControlCommandID(_self
->ob_itself
,
1018 if (_err
!= noErr
) return PyMac_Error(_err
);
1024 static PyObject
*CtlObj_GetControlCommandID(ControlObject
*_self
, PyObject
*_args
)
1026 PyObject
*_res
= NULL
;
1028 UInt32 outCommandID
;
1029 #ifndef GetControlCommandID
1030 PyMac_PRECHECK(GetControlCommandID
);
1032 if (!PyArg_ParseTuple(_args
, ""))
1034 _err
= GetControlCommandID(_self
->ob_itself
,
1036 if (_err
!= noErr
) return PyMac_Error(_err
);
1037 _res
= Py_BuildValue("l",
1042 static PyObject
*CtlObj_RemoveControlProperty(ControlObject
*_self
, PyObject
*_args
)
1044 PyObject
*_res
= NULL
;
1046 OSType propertyCreator
;
1048 #ifndef RemoveControlProperty
1049 PyMac_PRECHECK(RemoveControlProperty
);
1051 if (!PyArg_ParseTuple(_args
, "O&O&",
1052 PyMac_GetOSType
, &propertyCreator
,
1053 PyMac_GetOSType
, &propertyTag
))
1055 _err
= RemoveControlProperty(_self
->ob_itself
,
1058 if (_err
!= noErr
) return PyMac_Error(_err
);
1064 static PyObject
*CtlObj_GetControlPropertyAttributes(ControlObject
*_self
, PyObject
*_args
)
1066 PyObject
*_res
= NULL
;
1068 OSType propertyCreator
;
1071 #ifndef GetControlPropertyAttributes
1072 PyMac_PRECHECK(GetControlPropertyAttributes
);
1074 if (!PyArg_ParseTuple(_args
, "O&O&",
1075 PyMac_GetOSType
, &propertyCreator
,
1076 PyMac_GetOSType
, &propertyTag
))
1078 _err
= GetControlPropertyAttributes(_self
->ob_itself
,
1082 if (_err
!= noErr
) return PyMac_Error(_err
);
1083 _res
= Py_BuildValue("l",
1088 static PyObject
*CtlObj_ChangeControlPropertyAttributes(ControlObject
*_self
, PyObject
*_args
)
1090 PyObject
*_res
= NULL
;
1092 OSType propertyCreator
;
1094 UInt32 attributesToSet
;
1095 UInt32 attributesToClear
;
1096 #ifndef ChangeControlPropertyAttributes
1097 PyMac_PRECHECK(ChangeControlPropertyAttributes
);
1099 if (!PyArg_ParseTuple(_args
, "O&O&ll",
1100 PyMac_GetOSType
, &propertyCreator
,
1101 PyMac_GetOSType
, &propertyTag
,
1103 &attributesToClear
))
1105 _err
= ChangeControlPropertyAttributes(_self
->ob_itself
,
1110 if (_err
!= noErr
) return PyMac_Error(_err
);
1116 static PyObject
*CtlObj_GetControlRegion(ControlObject
*_self
, PyObject
*_args
)
1118 PyObject
*_res
= NULL
;
1120 ControlPartCode inPart
;
1121 RgnHandle outRegion
;
1122 #ifndef GetControlRegion
1123 PyMac_PRECHECK(GetControlRegion
);
1125 if (!PyArg_ParseTuple(_args
, "hO&",
1127 ResObj_Convert
, &outRegion
))
1129 _err
= GetControlRegion(_self
->ob_itself
,
1132 if (_err
!= noErr
) return PyMac_Error(_err
);
1138 static PyObject
*CtlObj_GetControlVariant(ControlObject
*_self
, PyObject
*_args
)
1140 PyObject
*_res
= NULL
;
1142 #ifndef GetControlVariant
1143 PyMac_PRECHECK(GetControlVariant
);
1145 if (!PyArg_ParseTuple(_args
, ""))
1147 _rv
= GetControlVariant(_self
->ob_itself
);
1148 _res
= Py_BuildValue("h",
1153 static PyObject
*CtlObj_SetControlAction(ControlObject
*_self
, PyObject
*_args
)
1155 PyObject
*_res
= NULL
;
1156 PyObject
* actionProc
;
1157 UniversalProcPtr c_callback
;
1158 #ifndef SetControlAction
1159 PyMac_PRECHECK(SetControlAction
);
1161 if (!PyArg_ParseTuple(_args
, "O",
1164 SetControlAction(_self
->ob_itself
,
1168 setcallback((PyObject
*)_self
, kMyControlActionProcTag
, actionProc
, &c_callback
);
1172 static PyObject
*CtlObj_SetControlReference(ControlObject
*_self
, PyObject
*_args
)
1174 PyObject
*_res
= NULL
;
1176 #ifndef SetControlReference
1177 PyMac_PRECHECK(SetControlReference
);
1179 if (!PyArg_ParseTuple(_args
, "l",
1182 SetControlReference(_self
->ob_itself
,
1189 static PyObject
*CtlObj_GetControlReference(ControlObject
*_self
, PyObject
*_args
)
1191 PyObject
*_res
= NULL
;
1193 #ifndef GetControlReference
1194 PyMac_PRECHECK(GetControlReference
);
1196 if (!PyArg_ParseTuple(_args
, ""))
1198 _rv
= GetControlReference(_self
->ob_itself
);
1199 _res
= Py_BuildValue("l",
1204 static PyObject
*CtlObj_EmbedControl(ControlObject
*_self
, PyObject
*_args
)
1206 PyObject
*_res
= NULL
;
1208 ControlHandle inContainer
;
1209 #ifndef EmbedControl
1210 PyMac_PRECHECK(EmbedControl
);
1212 if (!PyArg_ParseTuple(_args
, "O&",
1213 CtlObj_Convert
, &inContainer
))
1215 _err
= EmbedControl(_self
->ob_itself
,
1217 if (_err
!= noErr
) return PyMac_Error(_err
);
1223 static PyObject
*CtlObj_AutoEmbedControl(ControlObject
*_self
, PyObject
*_args
)
1225 PyObject
*_res
= NULL
;
1228 #ifndef AutoEmbedControl
1229 PyMac_PRECHECK(AutoEmbedControl
);
1231 if (!PyArg_ParseTuple(_args
, "O&",
1232 WinObj_Convert
, &inWindow
))
1234 _err
= AutoEmbedControl(_self
->ob_itself
,
1236 if (_err
!= noErr
) return PyMac_Error(_err
);
1242 static PyObject
*CtlObj_GetSuperControl(ControlObject
*_self
, PyObject
*_args
)
1244 PyObject
*_res
= NULL
;
1246 ControlHandle outParent
;
1247 #ifndef GetSuperControl
1248 PyMac_PRECHECK(GetSuperControl
);
1250 if (!PyArg_ParseTuple(_args
, ""))
1252 _err
= GetSuperControl(_self
->ob_itself
,
1254 if (_err
!= noErr
) return PyMac_Error(_err
);
1255 _res
= Py_BuildValue("O&",
1256 CtlObj_WhichControl
, outParent
);
1260 static PyObject
*CtlObj_CountSubControls(ControlObject
*_self
, PyObject
*_args
)
1262 PyObject
*_res
= NULL
;
1264 UInt16 outNumChildren
;
1265 #ifndef CountSubControls
1266 PyMac_PRECHECK(CountSubControls
);
1268 if (!PyArg_ParseTuple(_args
, ""))
1270 _err
= CountSubControls(_self
->ob_itself
,
1272 if (_err
!= noErr
) return PyMac_Error(_err
);
1273 _res
= Py_BuildValue("H",
1278 static PyObject
*CtlObj_GetIndexedSubControl(ControlObject
*_self
, PyObject
*_args
)
1280 PyObject
*_res
= NULL
;
1283 ControlHandle outSubControl
;
1284 #ifndef GetIndexedSubControl
1285 PyMac_PRECHECK(GetIndexedSubControl
);
1287 if (!PyArg_ParseTuple(_args
, "H",
1290 _err
= GetIndexedSubControl(_self
->ob_itself
,
1293 if (_err
!= noErr
) return PyMac_Error(_err
);
1294 _res
= Py_BuildValue("O&",
1295 CtlObj_WhichControl
, outSubControl
);
1299 static PyObject
*CtlObj_SetControlSupervisor(ControlObject
*_self
, PyObject
*_args
)
1301 PyObject
*_res
= NULL
;
1303 ControlHandle inBoss
;
1304 #ifndef SetControlSupervisor
1305 PyMac_PRECHECK(SetControlSupervisor
);
1307 if (!PyArg_ParseTuple(_args
, "O&",
1308 CtlObj_Convert
, &inBoss
))
1310 _err
= SetControlSupervisor(_self
->ob_itself
,
1312 if (_err
!= noErr
) return PyMac_Error(_err
);
1318 static PyObject
*CtlObj_GetControlFeatures(ControlObject
*_self
, PyObject
*_args
)
1320 PyObject
*_res
= NULL
;
1323 #ifndef GetControlFeatures
1324 PyMac_PRECHECK(GetControlFeatures
);
1326 if (!PyArg_ParseTuple(_args
, ""))
1328 _err
= GetControlFeatures(_self
->ob_itself
,
1330 if (_err
!= noErr
) return PyMac_Error(_err
);
1331 _res
= Py_BuildValue("l",
1336 static PyObject
*CtlObj_GetControlDataSize(ControlObject
*_self
, PyObject
*_args
)
1338 PyObject
*_res
= NULL
;
1340 ControlPartCode inPart
;
1343 #ifndef GetControlDataSize
1344 PyMac_PRECHECK(GetControlDataSize
);
1346 if (!PyArg_ParseTuple(_args
, "hO&",
1348 PyMac_GetOSType
, &inTagName
))
1350 _err
= GetControlDataSize(_self
->ob_itself
,
1354 if (_err
!= noErr
) return PyMac_Error(_err
);
1355 _res
= Py_BuildValue("l",
1360 static PyObject
*CtlObj_HandleControlDragTracking(ControlObject
*_self
, PyObject
*_args
)
1362 PyObject
*_res
= NULL
;
1364 DragTrackingMessage inMessage
;
1365 DragReference inDrag
;
1366 Boolean outLikesDrag
;
1367 #ifndef HandleControlDragTracking
1368 PyMac_PRECHECK(HandleControlDragTracking
);
1370 if (!PyArg_ParseTuple(_args
, "hO&",
1372 DragObj_Convert
, &inDrag
))
1374 _err
= HandleControlDragTracking(_self
->ob_itself
,
1378 if (_err
!= noErr
) return PyMac_Error(_err
);
1379 _res
= Py_BuildValue("b",
1384 static PyObject
*CtlObj_HandleControlDragReceive(ControlObject
*_self
, PyObject
*_args
)
1386 PyObject
*_res
= NULL
;
1388 DragReference inDrag
;
1389 #ifndef HandleControlDragReceive
1390 PyMac_PRECHECK(HandleControlDragReceive
);
1392 if (!PyArg_ParseTuple(_args
, "O&",
1393 DragObj_Convert
, &inDrag
))
1395 _err
= HandleControlDragReceive(_self
->ob_itself
,
1397 if (_err
!= noErr
) return PyMac_Error(_err
);
1403 static PyObject
*CtlObj_SetControlDragTrackingEnabled(ControlObject
*_self
, PyObject
*_args
)
1405 PyObject
*_res
= NULL
;
1408 #ifndef SetControlDragTrackingEnabled
1409 PyMac_PRECHECK(SetControlDragTrackingEnabled
);
1411 if (!PyArg_ParseTuple(_args
, "b",
1414 _err
= SetControlDragTrackingEnabled(_self
->ob_itself
,
1416 if (_err
!= noErr
) return PyMac_Error(_err
);
1422 static PyObject
*CtlObj_IsControlDragTrackingEnabled(ControlObject
*_self
, PyObject
*_args
)
1424 PyObject
*_res
= NULL
;
1427 #ifndef IsControlDragTrackingEnabled
1428 PyMac_PRECHECK(IsControlDragTrackingEnabled
);
1430 if (!PyArg_ParseTuple(_args
, ""))
1432 _err
= IsControlDragTrackingEnabled(_self
->ob_itself
,
1434 if (_err
!= noErr
) return PyMac_Error(_err
);
1435 _res
= Py_BuildValue("b",
1440 static PyObject
*CtlObj_GetControlBounds(ControlObject
*_self
, PyObject
*_args
)
1442 PyObject
*_res
= NULL
;
1444 #ifndef GetControlBounds
1445 PyMac_PRECHECK(GetControlBounds
);
1447 if (!PyArg_ParseTuple(_args
, ""))
1449 GetControlBounds(_self
->ob_itself
,
1451 _res
= Py_BuildValue("O&",
1452 PyMac_BuildRect
, &bounds
);
1456 static PyObject
*CtlObj_IsControlHilited(ControlObject
*_self
, PyObject
*_args
)
1458 PyObject
*_res
= NULL
;
1460 #ifndef IsControlHilited
1461 PyMac_PRECHECK(IsControlHilited
);
1463 if (!PyArg_ParseTuple(_args
, ""))
1465 _rv
= IsControlHilited(_self
->ob_itself
);
1466 _res
= Py_BuildValue("b",
1471 static PyObject
*CtlObj_GetControlHilite(ControlObject
*_self
, PyObject
*_args
)
1473 PyObject
*_res
= NULL
;
1475 #ifndef GetControlHilite
1476 PyMac_PRECHECK(GetControlHilite
);
1478 if (!PyArg_ParseTuple(_args
, ""))
1480 _rv
= GetControlHilite(_self
->ob_itself
);
1481 _res
= Py_BuildValue("H",
1486 static PyObject
*CtlObj_GetControlOwner(ControlObject
*_self
, PyObject
*_args
)
1488 PyObject
*_res
= NULL
;
1490 #ifndef GetControlOwner
1491 PyMac_PRECHECK(GetControlOwner
);
1493 if (!PyArg_ParseTuple(_args
, ""))
1495 _rv
= GetControlOwner(_self
->ob_itself
);
1496 _res
= Py_BuildValue("O&",
1501 static PyObject
*CtlObj_GetControlDataHandle(ControlObject
*_self
, PyObject
*_args
)
1503 PyObject
*_res
= NULL
;
1505 #ifndef GetControlDataHandle
1506 PyMac_PRECHECK(GetControlDataHandle
);
1508 if (!PyArg_ParseTuple(_args
, ""))
1510 _rv
= GetControlDataHandle(_self
->ob_itself
);
1511 _res
= Py_BuildValue("O&",
1516 static PyObject
*CtlObj_GetControlPopupMenuHandle(ControlObject
*_self
, PyObject
*_args
)
1518 PyObject
*_res
= NULL
;
1520 #ifndef GetControlPopupMenuHandle
1521 PyMac_PRECHECK(GetControlPopupMenuHandle
);
1523 if (!PyArg_ParseTuple(_args
, ""))
1525 _rv
= GetControlPopupMenuHandle(_self
->ob_itself
);
1526 _res
= Py_BuildValue("O&",
1531 static PyObject
*CtlObj_GetControlPopupMenuID(ControlObject
*_self
, PyObject
*_args
)
1533 PyObject
*_res
= NULL
;
1535 #ifndef GetControlPopupMenuID
1536 PyMac_PRECHECK(GetControlPopupMenuID
);
1538 if (!PyArg_ParseTuple(_args
, ""))
1540 _rv
= GetControlPopupMenuID(_self
->ob_itself
);
1541 _res
= Py_BuildValue("h",
1546 static PyObject
*CtlObj_SetControlDataHandle(ControlObject
*_self
, PyObject
*_args
)
1548 PyObject
*_res
= NULL
;
1550 #ifndef SetControlDataHandle
1551 PyMac_PRECHECK(SetControlDataHandle
);
1553 if (!PyArg_ParseTuple(_args
, "O&",
1554 ResObj_Convert
, &dataHandle
))
1556 SetControlDataHandle(_self
->ob_itself
,
1563 static PyObject
*CtlObj_SetControlBounds(ControlObject
*_self
, PyObject
*_args
)
1565 PyObject
*_res
= NULL
;
1567 #ifndef SetControlBounds
1568 PyMac_PRECHECK(SetControlBounds
);
1570 if (!PyArg_ParseTuple(_args
, "O&",
1571 PyMac_GetRect
, &bounds
))
1573 SetControlBounds(_self
->ob_itself
,
1580 static PyObject
*CtlObj_SetControlPopupMenuHandle(ControlObject
*_self
, PyObject
*_args
)
1582 PyObject
*_res
= NULL
;
1583 MenuHandle popupMenu
;
1584 #ifndef SetControlPopupMenuHandle
1585 PyMac_PRECHECK(SetControlPopupMenuHandle
);
1587 if (!PyArg_ParseTuple(_args
, "O&",
1588 MenuObj_Convert
, &popupMenu
))
1590 SetControlPopupMenuHandle(_self
->ob_itself
,
1597 static PyObject
*CtlObj_SetControlPopupMenuID(ControlObject
*_self
, PyObject
*_args
)
1599 PyObject
*_res
= NULL
;
1601 #ifndef SetControlPopupMenuID
1602 PyMac_PRECHECK(SetControlPopupMenuID
);
1604 if (!PyArg_ParseTuple(_args
, "h",
1607 SetControlPopupMenuID(_self
->ob_itself
,
1614 static PyObject
*CtlObj_GetBevelButtonMenuValue(ControlObject
*_self
, PyObject
*_args
)
1616 PyObject
*_res
= NULL
;
1619 #ifndef GetBevelButtonMenuValue
1620 PyMac_PRECHECK(GetBevelButtonMenuValue
);
1622 if (!PyArg_ParseTuple(_args
, ""))
1624 _err
= GetBevelButtonMenuValue(_self
->ob_itself
,
1626 if (_err
!= noErr
) return PyMac_Error(_err
);
1627 _res
= Py_BuildValue("h",
1632 static PyObject
*CtlObj_SetBevelButtonMenuValue(ControlObject
*_self
, PyObject
*_args
)
1634 PyObject
*_res
= NULL
;
1637 #ifndef SetBevelButtonMenuValue
1638 PyMac_PRECHECK(SetBevelButtonMenuValue
);
1640 if (!PyArg_ParseTuple(_args
, "h",
1643 _err
= SetBevelButtonMenuValue(_self
->ob_itself
,
1645 if (_err
!= noErr
) return PyMac_Error(_err
);
1651 static PyObject
*CtlObj_GetBevelButtonMenuHandle(ControlObject
*_self
, PyObject
*_args
)
1653 PyObject
*_res
= NULL
;
1655 MenuHandle outHandle
;
1656 #ifndef GetBevelButtonMenuHandle
1657 PyMac_PRECHECK(GetBevelButtonMenuHandle
);
1659 if (!PyArg_ParseTuple(_args
, ""))
1661 _err
= GetBevelButtonMenuHandle(_self
->ob_itself
,
1663 if (_err
!= noErr
) return PyMac_Error(_err
);
1664 _res
= Py_BuildValue("O&",
1665 MenuObj_New
, outHandle
);
1669 static PyObject
*CtlObj_SetBevelButtonContentInfo(ControlObject
*_self
, PyObject
*_args
)
1671 PyObject
*_res
= NULL
;
1673 ControlButtonContentInfo inContent
;
1674 #ifndef SetBevelButtonContentInfo
1675 PyMac_PRECHECK(SetBevelButtonContentInfo
);
1677 if (!PyArg_ParseTuple(_args
, "O&",
1678 ControlButtonContentInfo_Convert
, &inContent
))
1680 _err
= SetBevelButtonContentInfo(_self
->ob_itself
,
1682 if (_err
!= noErr
) return PyMac_Error(_err
);
1688 static PyObject
*CtlObj_SetBevelButtonTransform(ControlObject
*_self
, PyObject
*_args
)
1690 PyObject
*_res
= NULL
;
1692 IconTransformType transform
;
1693 #ifndef SetBevelButtonTransform
1694 PyMac_PRECHECK(SetBevelButtonTransform
);
1696 if (!PyArg_ParseTuple(_args
, "h",
1699 _err
= SetBevelButtonTransform(_self
->ob_itself
,
1701 if (_err
!= noErr
) return PyMac_Error(_err
);
1707 static PyObject
*CtlObj_SetDisclosureTriangleLastValue(ControlObject
*_self
, PyObject
*_args
)
1709 PyObject
*_res
= NULL
;
1712 #ifndef SetDisclosureTriangleLastValue
1713 PyMac_PRECHECK(SetDisclosureTriangleLastValue
);
1715 if (!PyArg_ParseTuple(_args
, "h",
1718 _err
= SetDisclosureTriangleLastValue(_self
->ob_itself
,
1720 if (_err
!= noErr
) return PyMac_Error(_err
);
1726 static PyObject
*CtlObj_GetTabContentRect(ControlObject
*_self
, PyObject
*_args
)
1728 PyObject
*_res
= NULL
;
1730 Rect outContentRect
;
1731 #ifndef GetTabContentRect
1732 PyMac_PRECHECK(GetTabContentRect
);
1734 if (!PyArg_ParseTuple(_args
, ""))
1736 _err
= GetTabContentRect(_self
->ob_itself
,
1738 if (_err
!= noErr
) return PyMac_Error(_err
);
1739 _res
= Py_BuildValue("O&",
1740 PyMac_BuildRect
, &outContentRect
);
1744 static PyObject
*CtlObj_SetTabEnabled(ControlObject
*_self
, PyObject
*_args
)
1746 PyObject
*_res
= NULL
;
1748 SInt16 inTabToHilite
;
1750 #ifndef SetTabEnabled
1751 PyMac_PRECHECK(SetTabEnabled
);
1753 if (!PyArg_ParseTuple(_args
, "hb",
1757 _err
= SetTabEnabled(_self
->ob_itself
,
1760 if (_err
!= noErr
) return PyMac_Error(_err
);
1766 static PyObject
*CtlObj_SetImageWellContentInfo(ControlObject
*_self
, PyObject
*_args
)
1768 PyObject
*_res
= NULL
;
1770 ControlButtonContentInfo inContent
;
1771 #ifndef SetImageWellContentInfo
1772 PyMac_PRECHECK(SetImageWellContentInfo
);
1774 if (!PyArg_ParseTuple(_args
, "O&",
1775 ControlButtonContentInfo_Convert
, &inContent
))
1777 _err
= SetImageWellContentInfo(_self
->ob_itself
,
1779 if (_err
!= noErr
) return PyMac_Error(_err
);
1785 static PyObject
*CtlObj_SetImageWellTransform(ControlObject
*_self
, PyObject
*_args
)
1787 PyObject
*_res
= NULL
;
1789 IconTransformType inTransform
;
1790 #ifndef SetImageWellTransform
1791 PyMac_PRECHECK(SetImageWellTransform
);
1793 if (!PyArg_ParseTuple(_args
, "h",
1796 _err
= SetImageWellTransform(_self
->ob_itself
,
1798 if (_err
!= noErr
) return PyMac_Error(_err
);
1804 static PyObject
*CtlObj_GetDataBrowserViewStyle(ControlObject
*_self
, PyObject
*_args
)
1806 PyObject
*_res
= NULL
;
1809 #ifndef GetDataBrowserViewStyle
1810 PyMac_PRECHECK(GetDataBrowserViewStyle
);
1812 if (!PyArg_ParseTuple(_args
, ""))
1814 _err
= GetDataBrowserViewStyle(_self
->ob_itself
,
1816 if (_err
!= noErr
) return PyMac_Error(_err
);
1817 _res
= Py_BuildValue("O&",
1818 PyMac_BuildOSType
, style
);
1822 static PyObject
*CtlObj_SetDataBrowserViewStyle(ControlObject
*_self
, PyObject
*_args
)
1824 PyObject
*_res
= NULL
;
1827 #ifndef SetDataBrowserViewStyle
1828 PyMac_PRECHECK(SetDataBrowserViewStyle
);
1830 if (!PyArg_ParseTuple(_args
, "O&",
1831 PyMac_GetOSType
, &style
))
1833 _err
= SetDataBrowserViewStyle(_self
->ob_itself
,
1835 if (_err
!= noErr
) return PyMac_Error(_err
);
1841 static PyObject
*CtlObj_EnableDataBrowserEditCommand(ControlObject
*_self
, PyObject
*_args
)
1843 PyObject
*_res
= NULL
;
1846 #ifndef EnableDataBrowserEditCommand
1847 PyMac_PRECHECK(EnableDataBrowserEditCommand
);
1849 if (!PyArg_ParseTuple(_args
, "l",
1852 _rv
= EnableDataBrowserEditCommand(_self
->ob_itself
,
1854 _res
= Py_BuildValue("b",
1859 static PyObject
*CtlObj_ExecuteDataBrowserEditCommand(ControlObject
*_self
, PyObject
*_args
)
1861 PyObject
*_res
= NULL
;
1864 #ifndef ExecuteDataBrowserEditCommand
1865 PyMac_PRECHECK(ExecuteDataBrowserEditCommand
);
1867 if (!PyArg_ParseTuple(_args
, "l",
1870 _err
= ExecuteDataBrowserEditCommand(_self
->ob_itself
,
1872 if (_err
!= noErr
) return PyMac_Error(_err
);
1878 static PyObject
*CtlObj_GetDataBrowserSelectionAnchor(ControlObject
*_self
, PyObject
*_args
)
1880 PyObject
*_res
= NULL
;
1884 #ifndef GetDataBrowserSelectionAnchor
1885 PyMac_PRECHECK(GetDataBrowserSelectionAnchor
);
1887 if (!PyArg_ParseTuple(_args
, ""))
1889 _err
= GetDataBrowserSelectionAnchor(_self
->ob_itself
,
1892 if (_err
!= noErr
) return PyMac_Error(_err
);
1893 _res
= Py_BuildValue("ll",
1899 static PyObject
*CtlObj_MoveDataBrowserSelectionAnchor(ControlObject
*_self
, PyObject
*_args
)
1901 PyObject
*_res
= NULL
;
1904 Boolean extendSelection
;
1905 #ifndef MoveDataBrowserSelectionAnchor
1906 PyMac_PRECHECK(MoveDataBrowserSelectionAnchor
);
1908 if (!PyArg_ParseTuple(_args
, "lb",
1912 _err
= MoveDataBrowserSelectionAnchor(_self
->ob_itself
,
1915 if (_err
!= noErr
) return PyMac_Error(_err
);
1921 static PyObject
*CtlObj_OpenDataBrowserContainer(ControlObject
*_self
, PyObject
*_args
)
1923 PyObject
*_res
= NULL
;
1926 #ifndef OpenDataBrowserContainer
1927 PyMac_PRECHECK(OpenDataBrowserContainer
);
1929 if (!PyArg_ParseTuple(_args
, "l",
1932 _err
= OpenDataBrowserContainer(_self
->ob_itself
,
1934 if (_err
!= noErr
) return PyMac_Error(_err
);
1940 static PyObject
*CtlObj_CloseDataBrowserContainer(ControlObject
*_self
, PyObject
*_args
)
1942 PyObject
*_res
= NULL
;
1945 #ifndef CloseDataBrowserContainer
1946 PyMac_PRECHECK(CloseDataBrowserContainer
);
1948 if (!PyArg_ParseTuple(_args
, "l",
1951 _err
= CloseDataBrowserContainer(_self
->ob_itself
,
1953 if (_err
!= noErr
) return PyMac_Error(_err
);
1959 static PyObject
*CtlObj_SortDataBrowserContainer(ControlObject
*_self
, PyObject
*_args
)
1961 PyObject
*_res
= NULL
;
1964 Boolean sortChildren
;
1965 #ifndef SortDataBrowserContainer
1966 PyMac_PRECHECK(SortDataBrowserContainer
);
1968 if (!PyArg_ParseTuple(_args
, "lb",
1972 _err
= SortDataBrowserContainer(_self
->ob_itself
,
1975 if (_err
!= noErr
) return PyMac_Error(_err
);
1981 static PyObject
*CtlObj_GetDataBrowserItems(ControlObject
*_self
, PyObject
*_args
)
1983 PyObject
*_res
= NULL
;
1989 #ifndef GetDataBrowserItems
1990 PyMac_PRECHECK(GetDataBrowserItems
);
1992 if (!PyArg_ParseTuple(_args
, "lblO&",
1996 ResObj_Convert
, &items
))
1998 _err
= GetDataBrowserItems(_self
->ob_itself
,
2003 if (_err
!= noErr
) return PyMac_Error(_err
);
2009 static PyObject
*CtlObj_GetDataBrowserItemCount(ControlObject
*_self
, PyObject
*_args
)
2011 PyObject
*_res
= NULL
;
2017 #ifndef GetDataBrowserItemCount
2018 PyMac_PRECHECK(GetDataBrowserItemCount
);
2020 if (!PyArg_ParseTuple(_args
, "lbl",
2025 _err
= GetDataBrowserItemCount(_self
->ob_itself
,
2030 if (_err
!= noErr
) return PyMac_Error(_err
);
2031 _res
= Py_BuildValue("l",
2036 static PyObject
*CtlObj_IsDataBrowserItemSelected(ControlObject
*_self
, PyObject
*_args
)
2038 PyObject
*_res
= NULL
;
2041 #ifndef IsDataBrowserItemSelected
2042 PyMac_PRECHECK(IsDataBrowserItemSelected
);
2044 if (!PyArg_ParseTuple(_args
, "l",
2047 _rv
= IsDataBrowserItemSelected(_self
->ob_itself
,
2049 _res
= Py_BuildValue("b",
2054 static PyObject
*CtlObj_GetDataBrowserItemState(ControlObject
*_self
, PyObject
*_args
)
2056 PyObject
*_res
= NULL
;
2060 #ifndef GetDataBrowserItemState
2061 PyMac_PRECHECK(GetDataBrowserItemState
);
2063 if (!PyArg_ParseTuple(_args
, "l",
2066 _err
= GetDataBrowserItemState(_self
->ob_itself
,
2069 if (_err
!= noErr
) return PyMac_Error(_err
);
2070 _res
= Py_BuildValue("l",
2075 static PyObject
*CtlObj_RevealDataBrowserItem(ControlObject
*_self
, PyObject
*_args
)
2077 PyObject
*_res
= NULL
;
2082 #ifndef RevealDataBrowserItem
2083 PyMac_PRECHECK(RevealDataBrowserItem
);
2085 if (!PyArg_ParseTuple(_args
, "llb",
2090 _err
= RevealDataBrowserItem(_self
->ob_itself
,
2094 if (_err
!= noErr
) return PyMac_Error(_err
);
2100 static PyObject
*CtlObj_SetDataBrowserActiveItems(ControlObject
*_self
, PyObject
*_args
)
2102 PyObject
*_res
= NULL
;
2105 #ifndef SetDataBrowserActiveItems
2106 PyMac_PRECHECK(SetDataBrowserActiveItems
);
2108 if (!PyArg_ParseTuple(_args
, "b",
2111 _err
= SetDataBrowserActiveItems(_self
->ob_itself
,
2113 if (_err
!= noErr
) return PyMac_Error(_err
);
2119 static PyObject
*CtlObj_GetDataBrowserActiveItems(ControlObject
*_self
, PyObject
*_args
)
2121 PyObject
*_res
= NULL
;
2124 #ifndef GetDataBrowserActiveItems
2125 PyMac_PRECHECK(GetDataBrowserActiveItems
);
2127 if (!PyArg_ParseTuple(_args
, ""))
2129 _err
= GetDataBrowserActiveItems(_self
->ob_itself
,
2131 if (_err
!= noErr
) return PyMac_Error(_err
);
2132 _res
= Py_BuildValue("b",
2137 static PyObject
*CtlObj_SetDataBrowserScrollBarInset(ControlObject
*_self
, PyObject
*_args
)
2139 PyObject
*_res
= NULL
;
2142 #ifndef SetDataBrowserScrollBarInset
2143 PyMac_PRECHECK(SetDataBrowserScrollBarInset
);
2145 if (!PyArg_ParseTuple(_args
, ""))
2147 _err
= SetDataBrowserScrollBarInset(_self
->ob_itself
,
2149 if (_err
!= noErr
) return PyMac_Error(_err
);
2150 _res
= Py_BuildValue("O&",
2151 PyMac_BuildRect
, &insetRect
);
2155 static PyObject
*CtlObj_GetDataBrowserScrollBarInset(ControlObject
*_self
, PyObject
*_args
)
2157 PyObject
*_res
= NULL
;
2160 #ifndef GetDataBrowserScrollBarInset
2161 PyMac_PRECHECK(GetDataBrowserScrollBarInset
);
2163 if (!PyArg_ParseTuple(_args
, ""))
2165 _err
= GetDataBrowserScrollBarInset(_self
->ob_itself
,
2167 if (_err
!= noErr
) return PyMac_Error(_err
);
2168 _res
= Py_BuildValue("O&",
2169 PyMac_BuildRect
, &insetRect
);
2173 static PyObject
*CtlObj_SetDataBrowserTarget(ControlObject
*_self
, PyObject
*_args
)
2175 PyObject
*_res
= NULL
;
2178 #ifndef SetDataBrowserTarget
2179 PyMac_PRECHECK(SetDataBrowserTarget
);
2181 if (!PyArg_ParseTuple(_args
, "l",
2184 _err
= SetDataBrowserTarget(_self
->ob_itself
,
2186 if (_err
!= noErr
) return PyMac_Error(_err
);
2192 static PyObject
*CtlObj_GetDataBrowserTarget(ControlObject
*_self
, PyObject
*_args
)
2194 PyObject
*_res
= NULL
;
2197 #ifndef GetDataBrowserTarget
2198 PyMac_PRECHECK(GetDataBrowserTarget
);
2200 if (!PyArg_ParseTuple(_args
, ""))
2202 _err
= GetDataBrowserTarget(_self
->ob_itself
,
2204 if (_err
!= noErr
) return PyMac_Error(_err
);
2205 _res
= Py_BuildValue("l",
2210 static PyObject
*CtlObj_SetDataBrowserSortOrder(ControlObject
*_self
, PyObject
*_args
)
2212 PyObject
*_res
= NULL
;
2215 #ifndef SetDataBrowserSortOrder
2216 PyMac_PRECHECK(SetDataBrowserSortOrder
);
2218 if (!PyArg_ParseTuple(_args
, "H",
2221 _err
= SetDataBrowserSortOrder(_self
->ob_itself
,
2223 if (_err
!= noErr
) return PyMac_Error(_err
);
2229 static PyObject
*CtlObj_GetDataBrowserSortOrder(ControlObject
*_self
, PyObject
*_args
)
2231 PyObject
*_res
= NULL
;
2234 #ifndef GetDataBrowserSortOrder
2235 PyMac_PRECHECK(GetDataBrowserSortOrder
);
2237 if (!PyArg_ParseTuple(_args
, ""))
2239 _err
= GetDataBrowserSortOrder(_self
->ob_itself
,
2241 if (_err
!= noErr
) return PyMac_Error(_err
);
2242 _res
= Py_BuildValue("H",
2247 static PyObject
*CtlObj_SetDataBrowserScrollPosition(ControlObject
*_self
, PyObject
*_args
)
2249 PyObject
*_res
= NULL
;
2253 #ifndef SetDataBrowserScrollPosition
2254 PyMac_PRECHECK(SetDataBrowserScrollPosition
);
2256 if (!PyArg_ParseTuple(_args
, "ll",
2260 _err
= SetDataBrowserScrollPosition(_self
->ob_itself
,
2263 if (_err
!= noErr
) return PyMac_Error(_err
);
2269 static PyObject
*CtlObj_GetDataBrowserScrollPosition(ControlObject
*_self
, PyObject
*_args
)
2271 PyObject
*_res
= NULL
;
2275 #ifndef GetDataBrowserScrollPosition
2276 PyMac_PRECHECK(GetDataBrowserScrollPosition
);
2278 if (!PyArg_ParseTuple(_args
, ""))
2280 _err
= GetDataBrowserScrollPosition(_self
->ob_itself
,
2283 if (_err
!= noErr
) return PyMac_Error(_err
);
2284 _res
= Py_BuildValue("ll",
2290 static PyObject
*CtlObj_SetDataBrowserHasScrollBars(ControlObject
*_self
, PyObject
*_args
)
2292 PyObject
*_res
= NULL
;
2296 #ifndef SetDataBrowserHasScrollBars
2297 PyMac_PRECHECK(SetDataBrowserHasScrollBars
);
2299 if (!PyArg_ParseTuple(_args
, "bb",
2303 _err
= SetDataBrowserHasScrollBars(_self
->ob_itself
,
2306 if (_err
!= noErr
) return PyMac_Error(_err
);
2312 static PyObject
*CtlObj_GetDataBrowserHasScrollBars(ControlObject
*_self
, PyObject
*_args
)
2314 PyObject
*_res
= NULL
;
2318 #ifndef GetDataBrowserHasScrollBars
2319 PyMac_PRECHECK(GetDataBrowserHasScrollBars
);
2321 if (!PyArg_ParseTuple(_args
, ""))
2323 _err
= GetDataBrowserHasScrollBars(_self
->ob_itself
,
2326 if (_err
!= noErr
) return PyMac_Error(_err
);
2327 _res
= Py_BuildValue("bb",
2333 static PyObject
*CtlObj_SetDataBrowserSortProperty(ControlObject
*_self
, PyObject
*_args
)
2335 PyObject
*_res
= NULL
;
2338 #ifndef SetDataBrowserSortProperty
2339 PyMac_PRECHECK(SetDataBrowserSortProperty
);
2341 if (!PyArg_ParseTuple(_args
, "l",
2344 _err
= SetDataBrowserSortProperty(_self
->ob_itself
,
2346 if (_err
!= noErr
) return PyMac_Error(_err
);
2352 static PyObject
*CtlObj_GetDataBrowserSortProperty(ControlObject
*_self
, PyObject
*_args
)
2354 PyObject
*_res
= NULL
;
2357 #ifndef GetDataBrowserSortProperty
2358 PyMac_PRECHECK(GetDataBrowserSortProperty
);
2360 if (!PyArg_ParseTuple(_args
, ""))
2362 _err
= GetDataBrowserSortProperty(_self
->ob_itself
,
2364 if (_err
!= noErr
) return PyMac_Error(_err
);
2365 _res
= Py_BuildValue("l",
2370 static PyObject
*CtlObj_SetDataBrowserSelectionFlags(ControlObject
*_self
, PyObject
*_args
)
2372 PyObject
*_res
= NULL
;
2374 UInt32 selectionFlags
;
2375 #ifndef SetDataBrowserSelectionFlags
2376 PyMac_PRECHECK(SetDataBrowserSelectionFlags
);
2378 if (!PyArg_ParseTuple(_args
, "l",
2381 _err
= SetDataBrowserSelectionFlags(_self
->ob_itself
,
2383 if (_err
!= noErr
) return PyMac_Error(_err
);
2389 static PyObject
*CtlObj_GetDataBrowserSelectionFlags(ControlObject
*_self
, PyObject
*_args
)
2391 PyObject
*_res
= NULL
;
2393 UInt32 selectionFlags
;
2394 #ifndef GetDataBrowserSelectionFlags
2395 PyMac_PRECHECK(GetDataBrowserSelectionFlags
);
2397 if (!PyArg_ParseTuple(_args
, ""))
2399 _err
= GetDataBrowserSelectionFlags(_self
->ob_itself
,
2401 if (_err
!= noErr
) return PyMac_Error(_err
);
2402 _res
= Py_BuildValue("l",
2407 static PyObject
*CtlObj_SetDataBrowserPropertyFlags(ControlObject
*_self
, PyObject
*_args
)
2409 PyObject
*_res
= NULL
;
2413 #ifndef SetDataBrowserPropertyFlags
2414 PyMac_PRECHECK(SetDataBrowserPropertyFlags
);
2416 if (!PyArg_ParseTuple(_args
, "ll",
2420 _err
= SetDataBrowserPropertyFlags(_self
->ob_itself
,
2423 if (_err
!= noErr
) return PyMac_Error(_err
);
2429 static PyObject
*CtlObj_GetDataBrowserPropertyFlags(ControlObject
*_self
, PyObject
*_args
)
2431 PyObject
*_res
= NULL
;
2435 #ifndef GetDataBrowserPropertyFlags
2436 PyMac_PRECHECK(GetDataBrowserPropertyFlags
);
2438 if (!PyArg_ParseTuple(_args
, "l",
2441 _err
= GetDataBrowserPropertyFlags(_self
->ob_itself
,
2444 if (_err
!= noErr
) return PyMac_Error(_err
);
2445 _res
= Py_BuildValue("l",
2450 static PyObject
*CtlObj_SetDataBrowserEditText(ControlObject
*_self
, PyObject
*_args
)
2452 PyObject
*_res
= NULL
;
2455 #ifndef SetDataBrowserEditText
2456 PyMac_PRECHECK(SetDataBrowserEditText
);
2458 if (!PyArg_ParseTuple(_args
, "O&",
2459 CFStringRefObj_Convert
, &text
))
2461 _err
= SetDataBrowserEditText(_self
->ob_itself
,
2463 if (_err
!= noErr
) return PyMac_Error(_err
);
2469 #if TARGET_API_MAC_OSX
2471 static PyObject
*CtlObj_CopyDataBrowserEditText(ControlObject
*_self
, PyObject
*_args
)
2473 PyObject
*_res
= NULL
;
2476 #ifndef CopyDataBrowserEditText
2477 PyMac_PRECHECK(CopyDataBrowserEditText
);
2479 if (!PyArg_ParseTuple(_args
, ""))
2481 _err
= CopyDataBrowserEditText(_self
->ob_itself
,
2483 if (_err
!= noErr
) return PyMac_Error(_err
);
2484 _res
= Py_BuildValue("O&",
2485 CFStringRefObj_New
, text
);
2490 static PyObject
*CtlObj_GetDataBrowserEditText(ControlObject
*_self
, PyObject
*_args
)
2492 PyObject
*_res
= NULL
;
2494 CFMutableStringRef text
;
2495 #ifndef GetDataBrowserEditText
2496 PyMac_PRECHECK(GetDataBrowserEditText
);
2498 if (!PyArg_ParseTuple(_args
, "O&",
2499 CFMutableStringRefObj_Convert
, &text
))
2501 _err
= GetDataBrowserEditText(_self
->ob_itself
,
2503 if (_err
!= noErr
) return PyMac_Error(_err
);
2509 static PyObject
*CtlObj_SetDataBrowserEditItem(ControlObject
*_self
, PyObject
*_args
)
2511 PyObject
*_res
= NULL
;
2515 #ifndef SetDataBrowserEditItem
2516 PyMac_PRECHECK(SetDataBrowserEditItem
);
2518 if (!PyArg_ParseTuple(_args
, "ll",
2522 _err
= SetDataBrowserEditItem(_self
->ob_itself
,
2525 if (_err
!= noErr
) return PyMac_Error(_err
);
2531 static PyObject
*CtlObj_GetDataBrowserEditItem(ControlObject
*_self
, PyObject
*_args
)
2533 PyObject
*_res
= NULL
;
2537 #ifndef GetDataBrowserEditItem
2538 PyMac_PRECHECK(GetDataBrowserEditItem
);
2540 if (!PyArg_ParseTuple(_args
, ""))
2542 _err
= GetDataBrowserEditItem(_self
->ob_itself
,
2545 if (_err
!= noErr
) return PyMac_Error(_err
);
2546 _res
= Py_BuildValue("ll",
2552 static PyObject
*CtlObj_GetDataBrowserItemPartBounds(ControlObject
*_self
, PyObject
*_args
)
2554 PyObject
*_res
= NULL
;
2560 #ifndef GetDataBrowserItemPartBounds
2561 PyMac_PRECHECK(GetDataBrowserItemPartBounds
);
2563 if (!PyArg_ParseTuple(_args
, "llO&",
2566 PyMac_GetOSType
, &part
))
2568 _err
= GetDataBrowserItemPartBounds(_self
->ob_itself
,
2573 if (_err
!= noErr
) return PyMac_Error(_err
);
2574 _res
= Py_BuildValue("O&",
2575 PyMac_BuildRect
, &bounds
);
2579 static PyObject
*CtlObj_RemoveDataBrowserTableViewColumn(ControlObject
*_self
, PyObject
*_args
)
2581 PyObject
*_res
= NULL
;
2584 #ifndef RemoveDataBrowserTableViewColumn
2585 PyMac_PRECHECK(RemoveDataBrowserTableViewColumn
);
2587 if (!PyArg_ParseTuple(_args
, "l",
2590 _err
= RemoveDataBrowserTableViewColumn(_self
->ob_itself
,
2592 if (_err
!= noErr
) return PyMac_Error(_err
);
2598 static PyObject
*CtlObj_GetDataBrowserTableViewColumnCount(ControlObject
*_self
, PyObject
*_args
)
2600 PyObject
*_res
= NULL
;
2603 #ifndef GetDataBrowserTableViewColumnCount
2604 PyMac_PRECHECK(GetDataBrowserTableViewColumnCount
);
2606 if (!PyArg_ParseTuple(_args
, ""))
2608 _err
= GetDataBrowserTableViewColumnCount(_self
->ob_itself
,
2610 if (_err
!= noErr
) return PyMac_Error(_err
);
2611 _res
= Py_BuildValue("l",
2616 static PyObject
*CtlObj_SetDataBrowserTableViewHiliteStyle(ControlObject
*_self
, PyObject
*_args
)
2618 PyObject
*_res
= NULL
;
2621 #ifndef SetDataBrowserTableViewHiliteStyle
2622 PyMac_PRECHECK(SetDataBrowserTableViewHiliteStyle
);
2624 if (!PyArg_ParseTuple(_args
, "l",
2627 _err
= SetDataBrowserTableViewHiliteStyle(_self
->ob_itself
,
2629 if (_err
!= noErr
) return PyMac_Error(_err
);
2635 static PyObject
*CtlObj_GetDataBrowserTableViewHiliteStyle(ControlObject
*_self
, PyObject
*_args
)
2637 PyObject
*_res
= NULL
;
2640 #ifndef GetDataBrowserTableViewHiliteStyle
2641 PyMac_PRECHECK(GetDataBrowserTableViewHiliteStyle
);
2643 if (!PyArg_ParseTuple(_args
, ""))
2645 _err
= GetDataBrowserTableViewHiliteStyle(_self
->ob_itself
,
2647 if (_err
!= noErr
) return PyMac_Error(_err
);
2648 _res
= Py_BuildValue("l",
2653 static PyObject
*CtlObj_SetDataBrowserTableViewRowHeight(ControlObject
*_self
, PyObject
*_args
)
2655 PyObject
*_res
= NULL
;
2658 #ifndef SetDataBrowserTableViewRowHeight
2659 PyMac_PRECHECK(SetDataBrowserTableViewRowHeight
);
2661 if (!PyArg_ParseTuple(_args
, "H",
2664 _err
= SetDataBrowserTableViewRowHeight(_self
->ob_itself
,
2666 if (_err
!= noErr
) return PyMac_Error(_err
);
2672 static PyObject
*CtlObj_GetDataBrowserTableViewRowHeight(ControlObject
*_self
, PyObject
*_args
)
2674 PyObject
*_res
= NULL
;
2677 #ifndef GetDataBrowserTableViewRowHeight
2678 PyMac_PRECHECK(GetDataBrowserTableViewRowHeight
);
2680 if (!PyArg_ParseTuple(_args
, ""))
2682 _err
= GetDataBrowserTableViewRowHeight(_self
->ob_itself
,
2684 if (_err
!= noErr
) return PyMac_Error(_err
);
2685 _res
= Py_BuildValue("H",
2690 static PyObject
*CtlObj_SetDataBrowserTableViewColumnWidth(ControlObject
*_self
, PyObject
*_args
)
2692 PyObject
*_res
= NULL
;
2695 #ifndef SetDataBrowserTableViewColumnWidth
2696 PyMac_PRECHECK(SetDataBrowserTableViewColumnWidth
);
2698 if (!PyArg_ParseTuple(_args
, "H",
2701 _err
= SetDataBrowserTableViewColumnWidth(_self
->ob_itself
,
2703 if (_err
!= noErr
) return PyMac_Error(_err
);
2709 static PyObject
*CtlObj_GetDataBrowserTableViewColumnWidth(ControlObject
*_self
, PyObject
*_args
)
2711 PyObject
*_res
= NULL
;
2714 #ifndef GetDataBrowserTableViewColumnWidth
2715 PyMac_PRECHECK(GetDataBrowserTableViewColumnWidth
);
2717 if (!PyArg_ParseTuple(_args
, ""))
2719 _err
= GetDataBrowserTableViewColumnWidth(_self
->ob_itself
,
2721 if (_err
!= noErr
) return PyMac_Error(_err
);
2722 _res
= Py_BuildValue("H",
2727 static PyObject
*CtlObj_SetDataBrowserTableViewItemRowHeight(ControlObject
*_self
, PyObject
*_args
)
2729 PyObject
*_res
= NULL
;
2733 #ifndef SetDataBrowserTableViewItemRowHeight
2734 PyMac_PRECHECK(SetDataBrowserTableViewItemRowHeight
);
2736 if (!PyArg_ParseTuple(_args
, "lH",
2740 _err
= SetDataBrowserTableViewItemRowHeight(_self
->ob_itself
,
2743 if (_err
!= noErr
) return PyMac_Error(_err
);
2749 static PyObject
*CtlObj_GetDataBrowserTableViewItemRowHeight(ControlObject
*_self
, PyObject
*_args
)
2751 PyObject
*_res
= NULL
;
2755 #ifndef GetDataBrowserTableViewItemRowHeight
2756 PyMac_PRECHECK(GetDataBrowserTableViewItemRowHeight
);
2758 if (!PyArg_ParseTuple(_args
, "l",
2761 _err
= GetDataBrowserTableViewItemRowHeight(_self
->ob_itself
,
2764 if (_err
!= noErr
) return PyMac_Error(_err
);
2765 _res
= Py_BuildValue("H",
2770 static PyObject
*CtlObj_SetDataBrowserTableViewNamedColumnWidth(ControlObject
*_self
, PyObject
*_args
)
2772 PyObject
*_res
= NULL
;
2776 #ifndef SetDataBrowserTableViewNamedColumnWidth
2777 PyMac_PRECHECK(SetDataBrowserTableViewNamedColumnWidth
);
2779 if (!PyArg_ParseTuple(_args
, "lH",
2783 _err
= SetDataBrowserTableViewNamedColumnWidth(_self
->ob_itself
,
2786 if (_err
!= noErr
) return PyMac_Error(_err
);
2792 static PyObject
*CtlObj_GetDataBrowserTableViewNamedColumnWidth(ControlObject
*_self
, PyObject
*_args
)
2794 PyObject
*_res
= NULL
;
2798 #ifndef GetDataBrowserTableViewNamedColumnWidth
2799 PyMac_PRECHECK(GetDataBrowserTableViewNamedColumnWidth
);
2801 if (!PyArg_ParseTuple(_args
, "l",
2804 _err
= GetDataBrowserTableViewNamedColumnWidth(_self
->ob_itself
,
2807 if (_err
!= noErr
) return PyMac_Error(_err
);
2808 _res
= Py_BuildValue("H",
2813 static PyObject
*CtlObj_SetDataBrowserTableViewGeometry(ControlObject
*_self
, PyObject
*_args
)
2815 PyObject
*_res
= NULL
;
2817 Boolean variableWidthColumns
;
2818 Boolean variableHeightRows
;
2819 #ifndef SetDataBrowserTableViewGeometry
2820 PyMac_PRECHECK(SetDataBrowserTableViewGeometry
);
2822 if (!PyArg_ParseTuple(_args
, "bb",
2823 &variableWidthColumns
,
2824 &variableHeightRows
))
2826 _err
= SetDataBrowserTableViewGeometry(_self
->ob_itself
,
2827 variableWidthColumns
,
2828 variableHeightRows
);
2829 if (_err
!= noErr
) return PyMac_Error(_err
);
2835 static PyObject
*CtlObj_GetDataBrowserTableViewGeometry(ControlObject
*_self
, PyObject
*_args
)
2837 PyObject
*_res
= NULL
;
2839 Boolean variableWidthColumns
;
2840 Boolean variableHeightRows
;
2841 #ifndef GetDataBrowserTableViewGeometry
2842 PyMac_PRECHECK(GetDataBrowserTableViewGeometry
);
2844 if (!PyArg_ParseTuple(_args
, ""))
2846 _err
= GetDataBrowserTableViewGeometry(_self
->ob_itself
,
2847 &variableWidthColumns
,
2848 &variableHeightRows
);
2849 if (_err
!= noErr
) return PyMac_Error(_err
);
2850 _res
= Py_BuildValue("bb",
2851 variableWidthColumns
,
2852 variableHeightRows
);
2856 static PyObject
*CtlObj_GetDataBrowserTableViewItemID(ControlObject
*_self
, PyObject
*_args
)
2858 PyObject
*_res
= NULL
;
2862 #ifndef GetDataBrowserTableViewItemID
2863 PyMac_PRECHECK(GetDataBrowserTableViewItemID
);
2865 if (!PyArg_ParseTuple(_args
, "l",
2868 _err
= GetDataBrowserTableViewItemID(_self
->ob_itself
,
2871 if (_err
!= noErr
) return PyMac_Error(_err
);
2872 _res
= Py_BuildValue("l",
2877 static PyObject
*CtlObj_SetDataBrowserTableViewItemRow(ControlObject
*_self
, PyObject
*_args
)
2879 PyObject
*_res
= NULL
;
2883 #ifndef SetDataBrowserTableViewItemRow
2884 PyMac_PRECHECK(SetDataBrowserTableViewItemRow
);
2886 if (!PyArg_ParseTuple(_args
, "ll",
2890 _err
= SetDataBrowserTableViewItemRow(_self
->ob_itself
,
2893 if (_err
!= noErr
) return PyMac_Error(_err
);
2899 static PyObject
*CtlObj_GetDataBrowserTableViewItemRow(ControlObject
*_self
, PyObject
*_args
)
2901 PyObject
*_res
= NULL
;
2905 #ifndef GetDataBrowserTableViewItemRow
2906 PyMac_PRECHECK(GetDataBrowserTableViewItemRow
);
2908 if (!PyArg_ParseTuple(_args
, "l",
2911 _err
= GetDataBrowserTableViewItemRow(_self
->ob_itself
,
2914 if (_err
!= noErr
) return PyMac_Error(_err
);
2915 _res
= Py_BuildValue("l",
2920 static PyObject
*CtlObj_SetDataBrowserTableViewColumnPosition(ControlObject
*_self
, PyObject
*_args
)
2922 PyObject
*_res
= NULL
;
2926 #ifndef SetDataBrowserTableViewColumnPosition
2927 PyMac_PRECHECK(SetDataBrowserTableViewColumnPosition
);
2929 if (!PyArg_ParseTuple(_args
, "ll",
2933 _err
= SetDataBrowserTableViewColumnPosition(_self
->ob_itself
,
2936 if (_err
!= noErr
) return PyMac_Error(_err
);
2942 static PyObject
*CtlObj_GetDataBrowserTableViewColumnPosition(ControlObject
*_self
, PyObject
*_args
)
2944 PyObject
*_res
= NULL
;
2948 #ifndef GetDataBrowserTableViewColumnPosition
2949 PyMac_PRECHECK(GetDataBrowserTableViewColumnPosition
);
2951 if (!PyArg_ParseTuple(_args
, "l",
2954 _err
= GetDataBrowserTableViewColumnPosition(_self
->ob_itself
,
2957 if (_err
!= noErr
) return PyMac_Error(_err
);
2958 _res
= Py_BuildValue("l",
2963 static PyObject
*CtlObj_GetDataBrowserTableViewColumnProperty(ControlObject
*_self
, PyObject
*_args
)
2965 PyObject
*_res
= NULL
;
2969 #ifndef GetDataBrowserTableViewColumnProperty
2970 PyMac_PRECHECK(GetDataBrowserTableViewColumnProperty
);
2972 if (!PyArg_ParseTuple(_args
, "l",
2975 _err
= GetDataBrowserTableViewColumnProperty(_self
->ob_itself
,
2978 if (_err
!= noErr
) return PyMac_Error(_err
);
2979 _res
= Py_BuildValue("l",
2984 static PyObject
*CtlObj_AutoSizeDataBrowserListViewColumns(ControlObject
*_self
, PyObject
*_args
)
2986 PyObject
*_res
= NULL
;
2988 #ifndef AutoSizeDataBrowserListViewColumns
2989 PyMac_PRECHECK(AutoSizeDataBrowserListViewColumns
);
2991 if (!PyArg_ParseTuple(_args
, ""))
2993 _err
= AutoSizeDataBrowserListViewColumns(_self
->ob_itself
);
2994 if (_err
!= noErr
) return PyMac_Error(_err
);
3000 static PyObject
*CtlObj_AddDataBrowserListViewColumn(ControlObject
*_self
, PyObject
*_args
)
3002 PyObject
*_res
= NULL
;
3004 DataBrowserListViewColumnDesc columnDesc
;
3006 #ifndef AddDataBrowserListViewColumn
3007 PyMac_PRECHECK(AddDataBrowserListViewColumn
);
3009 if (!PyArg_ParseTuple(_args
, "O&l",
3010 DataBrowserListViewColumnDesc_Convert
, &columnDesc
,
3013 _err
= AddDataBrowserListViewColumn(_self
->ob_itself
,
3016 if (_err
!= noErr
) return PyMac_Error(_err
);
3022 static PyObject
*CtlObj_SetDataBrowserListViewHeaderBtnHeight(ControlObject
*_self
, PyObject
*_args
)
3024 PyObject
*_res
= NULL
;
3027 #ifndef SetDataBrowserListViewHeaderBtnHeight
3028 PyMac_PRECHECK(SetDataBrowserListViewHeaderBtnHeight
);
3030 if (!PyArg_ParseTuple(_args
, "H",
3033 _err
= SetDataBrowserListViewHeaderBtnHeight(_self
->ob_itself
,
3035 if (_err
!= noErr
) return PyMac_Error(_err
);
3041 static PyObject
*CtlObj_GetDataBrowserListViewHeaderBtnHeight(ControlObject
*_self
, PyObject
*_args
)
3043 PyObject
*_res
= NULL
;
3046 #ifndef GetDataBrowserListViewHeaderBtnHeight
3047 PyMac_PRECHECK(GetDataBrowserListViewHeaderBtnHeight
);
3049 if (!PyArg_ParseTuple(_args
, ""))
3051 _err
= GetDataBrowserListViewHeaderBtnHeight(_self
->ob_itself
,
3053 if (_err
!= noErr
) return PyMac_Error(_err
);
3054 _res
= Py_BuildValue("H",
3059 static PyObject
*CtlObj_SetDataBrowserListViewUsePlainBackground(ControlObject
*_self
, PyObject
*_args
)
3061 PyObject
*_res
= NULL
;
3063 Boolean usePlainBackground
;
3064 #ifndef SetDataBrowserListViewUsePlainBackground
3065 PyMac_PRECHECK(SetDataBrowserListViewUsePlainBackground
);
3067 if (!PyArg_ParseTuple(_args
, "b",
3068 &usePlainBackground
))
3070 _err
= SetDataBrowserListViewUsePlainBackground(_self
->ob_itself
,
3071 usePlainBackground
);
3072 if (_err
!= noErr
) return PyMac_Error(_err
);
3078 static PyObject
*CtlObj_GetDataBrowserListViewUsePlainBackground(ControlObject
*_self
, PyObject
*_args
)
3080 PyObject
*_res
= NULL
;
3082 Boolean usePlainBackground
;
3083 #ifndef GetDataBrowserListViewUsePlainBackground
3084 PyMac_PRECHECK(GetDataBrowserListViewUsePlainBackground
);
3086 if (!PyArg_ParseTuple(_args
, ""))
3088 _err
= GetDataBrowserListViewUsePlainBackground(_self
->ob_itself
,
3089 &usePlainBackground
);
3090 if (_err
!= noErr
) return PyMac_Error(_err
);
3091 _res
= Py_BuildValue("b",
3092 usePlainBackground
);
3096 static PyObject
*CtlObj_SetDataBrowserListViewDisclosureColumn(ControlObject
*_self
, PyObject
*_args
)
3098 PyObject
*_res
= NULL
;
3101 Boolean expandableRows
;
3102 #ifndef SetDataBrowserListViewDisclosureColumn
3103 PyMac_PRECHECK(SetDataBrowserListViewDisclosureColumn
);
3105 if (!PyArg_ParseTuple(_args
, "lb",
3109 _err
= SetDataBrowserListViewDisclosureColumn(_self
->ob_itself
,
3112 if (_err
!= noErr
) return PyMac_Error(_err
);
3118 static PyObject
*CtlObj_GetDataBrowserListViewDisclosureColumn(ControlObject
*_self
, PyObject
*_args
)
3120 PyObject
*_res
= NULL
;
3123 Boolean expandableRows
;
3124 #ifndef GetDataBrowserListViewDisclosureColumn
3125 PyMac_PRECHECK(GetDataBrowserListViewDisclosureColumn
);
3127 if (!PyArg_ParseTuple(_args
, ""))
3129 _err
= GetDataBrowserListViewDisclosureColumn(_self
->ob_itself
,
3132 if (_err
!= noErr
) return PyMac_Error(_err
);
3133 _res
= Py_BuildValue("lb",
3139 static PyObject
*CtlObj_GetDataBrowserColumnViewPath(ControlObject
*_self
, PyObject
*_args
)
3141 PyObject
*_res
= NULL
;
3144 #ifndef GetDataBrowserColumnViewPath
3145 PyMac_PRECHECK(GetDataBrowserColumnViewPath
);
3147 if (!PyArg_ParseTuple(_args
, "O&",
3148 ResObj_Convert
, &path
))
3150 _err
= GetDataBrowserColumnViewPath(_self
->ob_itself
,
3152 if (_err
!= noErr
) return PyMac_Error(_err
);
3158 static PyObject
*CtlObj_GetDataBrowserColumnViewPathLength(ControlObject
*_self
, PyObject
*_args
)
3160 PyObject
*_res
= NULL
;
3163 #ifndef GetDataBrowserColumnViewPathLength
3164 PyMac_PRECHECK(GetDataBrowserColumnViewPathLength
);
3166 if (!PyArg_ParseTuple(_args
, ""))
3168 _err
= GetDataBrowserColumnViewPathLength(_self
->ob_itself
,
3170 if (_err
!= noErr
) return PyMac_Error(_err
);
3171 _res
= Py_BuildValue("l",
3176 static PyObject
*CtlObj_SetDataBrowserColumnViewDisplayType(ControlObject
*_self
, PyObject
*_args
)
3178 PyObject
*_res
= NULL
;
3180 OSType propertyType
;
3181 #ifndef SetDataBrowserColumnViewDisplayType
3182 PyMac_PRECHECK(SetDataBrowserColumnViewDisplayType
);
3184 if (!PyArg_ParseTuple(_args
, "O&",
3185 PyMac_GetOSType
, &propertyType
))
3187 _err
= SetDataBrowserColumnViewDisplayType(_self
->ob_itself
,
3189 if (_err
!= noErr
) return PyMac_Error(_err
);
3195 static PyObject
*CtlObj_GetDataBrowserColumnViewDisplayType(ControlObject
*_self
, PyObject
*_args
)
3197 PyObject
*_res
= NULL
;
3199 OSType propertyType
;
3200 #ifndef GetDataBrowserColumnViewDisplayType
3201 PyMac_PRECHECK(GetDataBrowserColumnViewDisplayType
);
3203 if (!PyArg_ParseTuple(_args
, ""))
3205 _err
= GetDataBrowserColumnViewDisplayType(_self
->ob_itself
,
3207 if (_err
!= noErr
) return PyMac_Error(_err
);
3208 _res
= Py_BuildValue("O&",
3209 PyMac_BuildOSType
, propertyType
);
3213 static PyObject
*CtlObj_as_Resource(ControlObject
*_self
, PyObject
*_args
)
3215 PyObject
*_res
= NULL
;
3218 PyMac_PRECHECK(as_Resource
);
3220 if (!PyArg_ParseTuple(_args
, ""))
3222 _rv
= as_Resource(_self
->ob_itself
);
3223 _res
= Py_BuildValue("O&",
3228 static PyObject
*CtlObj_GetControlRect(ControlObject
*_self
, PyObject
*_args
)
3230 PyObject
*_res
= NULL
;
3232 #ifndef GetControlRect
3233 PyMac_PRECHECK(GetControlRect
);
3235 if (!PyArg_ParseTuple(_args
, ""))
3237 GetControlRect(_self
->ob_itself
,
3239 _res
= Py_BuildValue("O&",
3240 PyMac_BuildRect
, &rect
);
3244 static PyObject
*CtlObj_DisposeControl(ControlObject
*_self
, PyObject
*_args
)
3246 PyObject
*_res
= NULL
;
3248 if (!PyArg_ParseTuple(_args
, ""))
3250 if ( _self
->ob_itself
) {
3251 SetControlReference(_self
->ob_itself
, (long)0); /* Make it forget about us */
3252 DisposeControl(_self
->ob_itself
);
3253 _self
->ob_itself
= NULL
;
3261 static PyObject
*CtlObj_TrackControl(ControlObject
*_self
, PyObject
*_args
)
3263 PyObject
*_res
= NULL
;
3265 ControlPartCode _rv
;
3267 ControlActionUPP upp
= 0;
3268 PyObject
*callback
= 0;
3270 if (!PyArg_ParseTuple(_args
, "O&|O",
3271 PyMac_GetPoint
, &startPoint
, &callback
))
3273 if (callback
&& callback
!= Py_None
) {
3274 if (PyInt_Check(callback
) && PyInt_AS_LONG(callback
) == -1)
3275 upp
= (ControlActionUPP
)-1;
3277 settrackfunc(callback
);
3278 upp
= mytracker_upp
;
3281 _rv
= TrackControl(_self
->ob_itself
,
3285 _res
= Py_BuildValue("h",
3291 static PyObject
*CtlObj_HandleControlClick(ControlObject
*_self
, PyObject
*_args
)
3293 PyObject
*_res
= NULL
;
3295 ControlPartCode _rv
;
3298 ControlActionUPP upp
= 0;
3299 PyObject
*callback
= 0;
3301 if (!PyArg_ParseTuple(_args
, "O&h|O",
3302 PyMac_GetPoint
, &startPoint
,
3306 if (callback
&& callback
!= Py_None
) {
3307 if (PyInt_Check(callback
) && PyInt_AS_LONG(callback
) == -1)
3308 upp
= (ControlActionUPP
)-1;
3310 settrackfunc(callback
);
3311 upp
= mytracker_upp
;
3314 _rv
= HandleControlClick(_self
->ob_itself
,
3319 _res
= Py_BuildValue("h",
3325 static PyObject
*CtlObj_SetControlData(ControlObject
*_self
, PyObject
*_args
)
3327 PyObject
*_res
= NULL
;
3330 ControlPartCode inPart
;
3335 if (!PyArg_ParseTuple(_args
, "hO&s#",
3337 PyMac_GetOSType
, &inTagName
,
3338 &buffer
, &bufferSize
))
3341 _err
= SetControlData(_self
->ob_itself
,
3348 return PyMac_Error(_err
);
3354 static PyObject
*CtlObj_GetControlData(ControlObject
*_self
, PyObject
*_args
)
3356 PyObject
*_res
= NULL
;
3359 ControlPartCode inPart
;
3365 if (!PyArg_ParseTuple(_args
, "hO&",
3367 PyMac_GetOSType
, &inTagName
))
3370 /* allocate a buffer for the data */
3371 _err
= GetControlDataSize(_self
->ob_itself
,
3376 return PyMac_Error(_err
);
3377 buffer
= PyMem_NEW(char, bufferSize
);
3379 return PyErr_NoMemory();
3381 _err
= GetControlData(_self
->ob_itself
,
3388 if (_err
!= noErr
) {
3390 return PyMac_Error(_err
);
3392 _res
= Py_BuildValue("s#", buffer
, outSize
);
3398 static PyObject
*CtlObj_SetControlData_Handle(ControlObject
*_self
, PyObject
*_args
)
3400 PyObject
*_res
= NULL
;
3403 ControlPartCode inPart
;
3407 if (!PyArg_ParseTuple(_args
, "hO&O&",
3409 PyMac_GetOSType
, &inTagName
,
3410 OptResObj_Convert
, &buffer
))
3413 _err
= SetControlData(_self
->ob_itself
,
3420 return PyMac_Error(_err
);
3426 static PyObject
*CtlObj_GetControlData_Handle(ControlObject
*_self
, PyObject
*_args
)
3428 PyObject
*_res
= NULL
;
3431 ControlPartCode inPart
;
3436 if (!PyArg_ParseTuple(_args
, "hO&",
3438 PyMac_GetOSType
, &inTagName
))
3441 /* Check it is handle-sized */
3442 _err
= GetControlDataSize(_self
->ob_itself
,
3447 return PyMac_Error(_err
);
3448 if (bufferSize
!= sizeof(Handle
)) {
3449 PyErr_SetString(Ctl_Error
, "GetControlDataSize() != sizeof(Handle)");
3453 _err
= GetControlData(_self
->ob_itself
,
3460 if (_err
!= noErr
) {
3461 return PyMac_Error(_err
);
3463 _res
= Py_BuildValue("O&", OptResObj_New
, hdl
);
3468 static PyObject
*CtlObj_SetControlData_Callback(ControlObject
*_self
, PyObject
*_args
)
3470 PyObject
*_res
= NULL
;
3473 ControlPartCode inPart
;
3476 UniversalProcPtr c_callback
;
3478 if (!PyArg_ParseTuple(_args
, "hO&O",
3480 PyMac_GetOSType
, &inTagName
,
3484 if ( setcallback((PyObject
*)_self
, inTagName
, callback
, &c_callback
) < 0 )
3486 _err
= SetControlData(_self
->ob_itself
,
3493 return PyMac_Error(_err
);
3499 static PyMethodDef CtlObj_methods
[] = {
3500 {"HiliteControl", (PyCFunction
)CtlObj_HiliteControl
, 1,
3501 PyDoc_STR("(ControlPartCode hiliteState) -> None")},
3502 {"ShowControl", (PyCFunction
)CtlObj_ShowControl
, 1,
3503 PyDoc_STR("() -> None")},
3504 {"HideControl", (PyCFunction
)CtlObj_HideControl
, 1,
3505 PyDoc_STR("() -> None")},
3506 {"IsControlActive", (PyCFunction
)CtlObj_IsControlActive
, 1,
3507 PyDoc_STR("() -> (Boolean _rv)")},
3508 {"IsControlVisible", (PyCFunction
)CtlObj_IsControlVisible
, 1,
3509 PyDoc_STR("() -> (Boolean _rv)")},
3510 {"ActivateControl", (PyCFunction
)CtlObj_ActivateControl
, 1,
3511 PyDoc_STR("() -> None")},
3512 {"DeactivateControl", (PyCFunction
)CtlObj_DeactivateControl
, 1,
3513 PyDoc_STR("() -> None")},
3514 {"SetControlVisibility", (PyCFunction
)CtlObj_SetControlVisibility
, 1,
3515 PyDoc_STR("(Boolean inIsVisible, Boolean inDoDraw) -> None")},
3517 #if TARGET_API_MAC_OSX
3518 {"IsControlEnabled", (PyCFunction
)CtlObj_IsControlEnabled
, 1,
3519 PyDoc_STR("() -> (Boolean _rv)")},
3522 #if TARGET_API_MAC_OSX
3523 {"EnableControl", (PyCFunction
)CtlObj_EnableControl
, 1,
3524 PyDoc_STR("() -> None")},
3527 #if TARGET_API_MAC_OSX
3528 {"DisableControl", (PyCFunction
)CtlObj_DisableControl
, 1,
3529 PyDoc_STR("() -> None")},
3531 {"Draw1Control", (PyCFunction
)CtlObj_Draw1Control
, 1,
3532 PyDoc_STR("() -> None")},
3533 {"GetBestControlRect", (PyCFunction
)CtlObj_GetBestControlRect
, 1,
3534 PyDoc_STR("() -> (Rect outRect, SInt16 outBaseLineOffset)")},
3535 {"SetControlFontStyle", (PyCFunction
)CtlObj_SetControlFontStyle
, 1,
3536 PyDoc_STR("(ControlFontStyleRec inStyle) -> None")},
3537 {"DrawControlInCurrentPort", (PyCFunction
)CtlObj_DrawControlInCurrentPort
, 1,
3538 PyDoc_STR("() -> None")},
3539 {"SetUpControlBackground", (PyCFunction
)CtlObj_SetUpControlBackground
, 1,
3540 PyDoc_STR("(SInt16 inDepth, Boolean inIsColorDevice) -> None")},
3541 {"SetUpControlTextColor", (PyCFunction
)CtlObj_SetUpControlTextColor
, 1,
3542 PyDoc_STR("(SInt16 inDepth, Boolean inIsColorDevice) -> None")},
3543 {"DragControl", (PyCFunction
)CtlObj_DragControl
, 1,
3544 PyDoc_STR("(Point startPoint, Rect limitRect, Rect slopRect, DragConstraint axis) -> None")},
3545 {"TestControl", (PyCFunction
)CtlObj_TestControl
, 1,
3546 PyDoc_STR("(Point testPoint) -> (ControlPartCode _rv)")},
3547 {"HandleControlContextualMenuClick", (PyCFunction
)CtlObj_HandleControlContextualMenuClick
, 1,
3548 PyDoc_STR("(Point inWhere) -> (Boolean menuDisplayed)")},
3549 {"GetControlClickActivation", (PyCFunction
)CtlObj_GetControlClickActivation
, 1,
3550 PyDoc_STR("(Point inWhere, EventModifiers inModifiers) -> (ClickActivationResult outResult)")},
3551 {"HandleControlKey", (PyCFunction
)CtlObj_HandleControlKey
, 1,
3552 PyDoc_STR("(SInt16 inKeyCode, SInt16 inCharCode, EventModifiers inModifiers) -> (ControlPartCode _rv)")},
3553 {"HandleControlSetCursor", (PyCFunction
)CtlObj_HandleControlSetCursor
, 1,
3554 PyDoc_STR("(Point localPoint, EventModifiers modifiers) -> (Boolean cursorWasSet)")},
3555 {"MoveControl", (PyCFunction
)CtlObj_MoveControl
, 1,
3556 PyDoc_STR("(SInt16 h, SInt16 v) -> None")},
3557 {"SizeControl", (PyCFunction
)CtlObj_SizeControl
, 1,
3558 PyDoc_STR("(SInt16 w, SInt16 h) -> None")},
3559 {"SetControlTitle", (PyCFunction
)CtlObj_SetControlTitle
, 1,
3560 PyDoc_STR("(Str255 title) -> None")},
3561 {"GetControlTitle", (PyCFunction
)CtlObj_GetControlTitle
, 1,
3562 PyDoc_STR("() -> (Str255 title)")},
3563 {"SetControlTitleWithCFString", (PyCFunction
)CtlObj_SetControlTitleWithCFString
, 1,
3564 PyDoc_STR("(CFStringRef inString) -> None")},
3565 {"CopyControlTitleAsCFString", (PyCFunction
)CtlObj_CopyControlTitleAsCFString
, 1,
3566 PyDoc_STR("() -> (CFStringRef outString)")},
3567 {"GetControlValue", (PyCFunction
)CtlObj_GetControlValue
, 1,
3568 PyDoc_STR("() -> (SInt16 _rv)")},
3569 {"SetControlValue", (PyCFunction
)CtlObj_SetControlValue
, 1,
3570 PyDoc_STR("(SInt16 newValue) -> None")},
3571 {"GetControlMinimum", (PyCFunction
)CtlObj_GetControlMinimum
, 1,
3572 PyDoc_STR("() -> (SInt16 _rv)")},
3573 {"SetControlMinimum", (PyCFunction
)CtlObj_SetControlMinimum
, 1,
3574 PyDoc_STR("(SInt16 newMinimum) -> None")},
3575 {"GetControlMaximum", (PyCFunction
)CtlObj_GetControlMaximum
, 1,
3576 PyDoc_STR("() -> (SInt16 _rv)")},
3577 {"SetControlMaximum", (PyCFunction
)CtlObj_SetControlMaximum
, 1,
3578 PyDoc_STR("(SInt16 newMaximum) -> None")},
3579 {"GetControlViewSize", (PyCFunction
)CtlObj_GetControlViewSize
, 1,
3580 PyDoc_STR("() -> (SInt32 _rv)")},
3581 {"SetControlViewSize", (PyCFunction
)CtlObj_SetControlViewSize
, 1,
3582 PyDoc_STR("(SInt32 newViewSize) -> None")},
3583 {"GetControl32BitValue", (PyCFunction
)CtlObj_GetControl32BitValue
, 1,
3584 PyDoc_STR("() -> (SInt32 _rv)")},
3585 {"SetControl32BitValue", (PyCFunction
)CtlObj_SetControl32BitValue
, 1,
3586 PyDoc_STR("(SInt32 newValue) -> None")},
3587 {"GetControl32BitMaximum", (PyCFunction
)CtlObj_GetControl32BitMaximum
, 1,
3588 PyDoc_STR("() -> (SInt32 _rv)")},
3589 {"SetControl32BitMaximum", (PyCFunction
)CtlObj_SetControl32BitMaximum
, 1,
3590 PyDoc_STR("(SInt32 newMaximum) -> None")},
3591 {"GetControl32BitMinimum", (PyCFunction
)CtlObj_GetControl32BitMinimum
, 1,
3592 PyDoc_STR("() -> (SInt32 _rv)")},
3593 {"SetControl32BitMinimum", (PyCFunction
)CtlObj_SetControl32BitMinimum
, 1,
3594 PyDoc_STR("(SInt32 newMinimum) -> None")},
3595 {"IsValidControlHandle", (PyCFunction
)CtlObj_IsValidControlHandle
, 1,
3596 PyDoc_STR("() -> (Boolean _rv)")},
3597 {"SetControlID", (PyCFunction
)CtlObj_SetControlID
, 1,
3598 PyDoc_STR("(ControlID inID) -> None")},
3599 {"GetControlID", (PyCFunction
)CtlObj_GetControlID
, 1,
3600 PyDoc_STR("() -> (ControlID outID)")},
3601 {"SetControlCommandID", (PyCFunction
)CtlObj_SetControlCommandID
, 1,
3602 PyDoc_STR("(UInt32 inCommandID) -> None")},
3603 {"GetControlCommandID", (PyCFunction
)CtlObj_GetControlCommandID
, 1,
3604 PyDoc_STR("() -> (UInt32 outCommandID)")},
3605 {"RemoveControlProperty", (PyCFunction
)CtlObj_RemoveControlProperty
, 1,
3606 PyDoc_STR("(OSType propertyCreator, OSType propertyTag) -> None")},
3607 {"GetControlPropertyAttributes", (PyCFunction
)CtlObj_GetControlPropertyAttributes
, 1,
3608 PyDoc_STR("(OSType propertyCreator, OSType propertyTag) -> (UInt32 attributes)")},
3609 {"ChangeControlPropertyAttributes", (PyCFunction
)CtlObj_ChangeControlPropertyAttributes
, 1,
3610 PyDoc_STR("(OSType propertyCreator, OSType propertyTag, UInt32 attributesToSet, UInt32 attributesToClear) -> None")},
3611 {"GetControlRegion", (PyCFunction
)CtlObj_GetControlRegion
, 1,
3612 PyDoc_STR("(ControlPartCode inPart, RgnHandle outRegion) -> None")},
3613 {"GetControlVariant", (PyCFunction
)CtlObj_GetControlVariant
, 1,
3614 PyDoc_STR("() -> (ControlVariant _rv)")},
3615 {"SetControlAction", (PyCFunction
)CtlObj_SetControlAction
, 1,
3616 PyDoc_STR("(PyObject* actionProc) -> None")},
3617 {"SetControlReference", (PyCFunction
)CtlObj_SetControlReference
, 1,
3618 PyDoc_STR("(SInt32 data) -> None")},
3619 {"GetControlReference", (PyCFunction
)CtlObj_GetControlReference
, 1,
3620 PyDoc_STR("() -> (SInt32 _rv)")},
3621 {"EmbedControl", (PyCFunction
)CtlObj_EmbedControl
, 1,
3622 PyDoc_STR("(ControlHandle inContainer) -> None")},
3623 {"AutoEmbedControl", (PyCFunction
)CtlObj_AutoEmbedControl
, 1,
3624 PyDoc_STR("(WindowPtr inWindow) -> None")},
3625 {"GetSuperControl", (PyCFunction
)CtlObj_GetSuperControl
, 1,
3626 PyDoc_STR("() -> (ControlHandle outParent)")},
3627 {"CountSubControls", (PyCFunction
)CtlObj_CountSubControls
, 1,
3628 PyDoc_STR("() -> (UInt16 outNumChildren)")},
3629 {"GetIndexedSubControl", (PyCFunction
)CtlObj_GetIndexedSubControl
, 1,
3630 PyDoc_STR("(UInt16 inIndex) -> (ControlHandle outSubControl)")},
3631 {"SetControlSupervisor", (PyCFunction
)CtlObj_SetControlSupervisor
, 1,
3632 PyDoc_STR("(ControlHandle inBoss) -> None")},
3633 {"GetControlFeatures", (PyCFunction
)CtlObj_GetControlFeatures
, 1,
3634 PyDoc_STR("() -> (UInt32 outFeatures)")},
3635 {"GetControlDataSize", (PyCFunction
)CtlObj_GetControlDataSize
, 1,
3636 PyDoc_STR("(ControlPartCode inPart, ResType inTagName) -> (Size outMaxSize)")},
3637 {"HandleControlDragTracking", (PyCFunction
)CtlObj_HandleControlDragTracking
, 1,
3638 PyDoc_STR("(DragTrackingMessage inMessage, DragReference inDrag) -> (Boolean outLikesDrag)")},
3639 {"HandleControlDragReceive", (PyCFunction
)CtlObj_HandleControlDragReceive
, 1,
3640 PyDoc_STR("(DragReference inDrag) -> None")},
3641 {"SetControlDragTrackingEnabled", (PyCFunction
)CtlObj_SetControlDragTrackingEnabled
, 1,
3642 PyDoc_STR("(Boolean tracks) -> None")},
3643 {"IsControlDragTrackingEnabled", (PyCFunction
)CtlObj_IsControlDragTrackingEnabled
, 1,
3644 PyDoc_STR("() -> (Boolean tracks)")},
3645 {"GetControlBounds", (PyCFunction
)CtlObj_GetControlBounds
, 1,
3646 PyDoc_STR("() -> (Rect bounds)")},
3647 {"IsControlHilited", (PyCFunction
)CtlObj_IsControlHilited
, 1,
3648 PyDoc_STR("() -> (Boolean _rv)")},
3649 {"GetControlHilite", (PyCFunction
)CtlObj_GetControlHilite
, 1,
3650 PyDoc_STR("() -> (UInt16 _rv)")},
3651 {"GetControlOwner", (PyCFunction
)CtlObj_GetControlOwner
, 1,
3652 PyDoc_STR("() -> (WindowPtr _rv)")},
3653 {"GetControlDataHandle", (PyCFunction
)CtlObj_GetControlDataHandle
, 1,
3654 PyDoc_STR("() -> (Handle _rv)")},
3655 {"GetControlPopupMenuHandle", (PyCFunction
)CtlObj_GetControlPopupMenuHandle
, 1,
3656 PyDoc_STR("() -> (MenuHandle _rv)")},
3657 {"GetControlPopupMenuID", (PyCFunction
)CtlObj_GetControlPopupMenuID
, 1,
3658 PyDoc_STR("() -> (short _rv)")},
3659 {"SetControlDataHandle", (PyCFunction
)CtlObj_SetControlDataHandle
, 1,
3660 PyDoc_STR("(Handle dataHandle) -> None")},
3661 {"SetControlBounds", (PyCFunction
)CtlObj_SetControlBounds
, 1,
3662 PyDoc_STR("(Rect bounds) -> None")},
3663 {"SetControlPopupMenuHandle", (PyCFunction
)CtlObj_SetControlPopupMenuHandle
, 1,
3664 PyDoc_STR("(MenuHandle popupMenu) -> None")},
3665 {"SetControlPopupMenuID", (PyCFunction
)CtlObj_SetControlPopupMenuID
, 1,
3666 PyDoc_STR("(short menuID) -> None")},
3667 {"GetBevelButtonMenuValue", (PyCFunction
)CtlObj_GetBevelButtonMenuValue
, 1,
3668 PyDoc_STR("() -> (SInt16 outValue)")},
3669 {"SetBevelButtonMenuValue", (PyCFunction
)CtlObj_SetBevelButtonMenuValue
, 1,
3670 PyDoc_STR("(SInt16 inValue) -> None")},
3671 {"GetBevelButtonMenuHandle", (PyCFunction
)CtlObj_GetBevelButtonMenuHandle
, 1,
3672 PyDoc_STR("() -> (MenuHandle outHandle)")},
3673 {"SetBevelButtonContentInfo", (PyCFunction
)CtlObj_SetBevelButtonContentInfo
, 1,
3674 PyDoc_STR("(ControlButtonContentInfo inContent) -> None")},
3675 {"SetBevelButtonTransform", (PyCFunction
)CtlObj_SetBevelButtonTransform
, 1,
3676 PyDoc_STR("(IconTransformType transform) -> None")},
3677 {"SetDisclosureTriangleLastValue", (PyCFunction
)CtlObj_SetDisclosureTriangleLastValue
, 1,
3678 PyDoc_STR("(SInt16 inValue) -> None")},
3679 {"GetTabContentRect", (PyCFunction
)CtlObj_GetTabContentRect
, 1,
3680 PyDoc_STR("() -> (Rect outContentRect)")},
3681 {"SetTabEnabled", (PyCFunction
)CtlObj_SetTabEnabled
, 1,
3682 PyDoc_STR("(SInt16 inTabToHilite, Boolean inEnabled) -> None")},
3683 {"SetImageWellContentInfo", (PyCFunction
)CtlObj_SetImageWellContentInfo
, 1,
3684 PyDoc_STR("(ControlButtonContentInfo inContent) -> None")},
3685 {"SetImageWellTransform", (PyCFunction
)CtlObj_SetImageWellTransform
, 1,
3686 PyDoc_STR("(IconTransformType inTransform) -> None")},
3687 {"GetDataBrowserViewStyle", (PyCFunction
)CtlObj_GetDataBrowserViewStyle
, 1,
3688 PyDoc_STR("() -> (OSType style)")},
3689 {"SetDataBrowserViewStyle", (PyCFunction
)CtlObj_SetDataBrowserViewStyle
, 1,
3690 PyDoc_STR("(OSType style) -> None")},
3691 {"EnableDataBrowserEditCommand", (PyCFunction
)CtlObj_EnableDataBrowserEditCommand
, 1,
3692 PyDoc_STR("(UInt32 command) -> (Boolean _rv)")},
3693 {"ExecuteDataBrowserEditCommand", (PyCFunction
)CtlObj_ExecuteDataBrowserEditCommand
, 1,
3694 PyDoc_STR("(UInt32 command) -> None")},
3695 {"GetDataBrowserSelectionAnchor", (PyCFunction
)CtlObj_GetDataBrowserSelectionAnchor
, 1,
3696 PyDoc_STR("() -> (UInt32 first, UInt32 last)")},
3697 {"MoveDataBrowserSelectionAnchor", (PyCFunction
)CtlObj_MoveDataBrowserSelectionAnchor
, 1,
3698 PyDoc_STR("(UInt32 direction, Boolean extendSelection) -> None")},
3699 {"OpenDataBrowserContainer", (PyCFunction
)CtlObj_OpenDataBrowserContainer
, 1,
3700 PyDoc_STR("(UInt32 container) -> None")},
3701 {"CloseDataBrowserContainer", (PyCFunction
)CtlObj_CloseDataBrowserContainer
, 1,
3702 PyDoc_STR("(UInt32 container) -> None")},
3703 {"SortDataBrowserContainer", (PyCFunction
)CtlObj_SortDataBrowserContainer
, 1,
3704 PyDoc_STR("(UInt32 container, Boolean sortChildren) -> None")},
3705 {"GetDataBrowserItems", (PyCFunction
)CtlObj_GetDataBrowserItems
, 1,
3706 PyDoc_STR("(UInt32 container, Boolean recurse, UInt32 state, Handle items) -> None")},
3707 {"GetDataBrowserItemCount", (PyCFunction
)CtlObj_GetDataBrowserItemCount
, 1,
3708 PyDoc_STR("(UInt32 container, Boolean recurse, UInt32 state) -> (UInt32 numItems)")},
3709 {"IsDataBrowserItemSelected", (PyCFunction
)CtlObj_IsDataBrowserItemSelected
, 1,
3710 PyDoc_STR("(UInt32 item) -> (Boolean _rv)")},
3711 {"GetDataBrowserItemState", (PyCFunction
)CtlObj_GetDataBrowserItemState
, 1,
3712 PyDoc_STR("(UInt32 item) -> (UInt32 state)")},
3713 {"RevealDataBrowserItem", (PyCFunction
)CtlObj_RevealDataBrowserItem
, 1,
3714 PyDoc_STR("(UInt32 item, UInt32 propertyID, UInt8 options) -> None")},
3715 {"SetDataBrowserActiveItems", (PyCFunction
)CtlObj_SetDataBrowserActiveItems
, 1,
3716 PyDoc_STR("(Boolean active) -> None")},
3717 {"GetDataBrowserActiveItems", (PyCFunction
)CtlObj_GetDataBrowserActiveItems
, 1,
3718 PyDoc_STR("() -> (Boolean active)")},
3719 {"SetDataBrowserScrollBarInset", (PyCFunction
)CtlObj_SetDataBrowserScrollBarInset
, 1,
3720 PyDoc_STR("() -> (Rect insetRect)")},
3721 {"GetDataBrowserScrollBarInset", (PyCFunction
)CtlObj_GetDataBrowserScrollBarInset
, 1,
3722 PyDoc_STR("() -> (Rect insetRect)")},
3723 {"SetDataBrowserTarget", (PyCFunction
)CtlObj_SetDataBrowserTarget
, 1,
3724 PyDoc_STR("(UInt32 target) -> None")},
3725 {"GetDataBrowserTarget", (PyCFunction
)CtlObj_GetDataBrowserTarget
, 1,
3726 PyDoc_STR("() -> (UInt32 target)")},
3727 {"SetDataBrowserSortOrder", (PyCFunction
)CtlObj_SetDataBrowserSortOrder
, 1,
3728 PyDoc_STR("(UInt16 order) -> None")},
3729 {"GetDataBrowserSortOrder", (PyCFunction
)CtlObj_GetDataBrowserSortOrder
, 1,
3730 PyDoc_STR("() -> (UInt16 order)")},
3731 {"SetDataBrowserScrollPosition", (PyCFunction
)CtlObj_SetDataBrowserScrollPosition
, 1,
3732 PyDoc_STR("(UInt32 top, UInt32 left) -> None")},
3733 {"GetDataBrowserScrollPosition", (PyCFunction
)CtlObj_GetDataBrowserScrollPosition
, 1,
3734 PyDoc_STR("() -> (UInt32 top, UInt32 left)")},
3735 {"SetDataBrowserHasScrollBars", (PyCFunction
)CtlObj_SetDataBrowserHasScrollBars
, 1,
3736 PyDoc_STR("(Boolean horiz, Boolean vert) -> None")},
3737 {"GetDataBrowserHasScrollBars", (PyCFunction
)CtlObj_GetDataBrowserHasScrollBars
, 1,
3738 PyDoc_STR("() -> (Boolean horiz, Boolean vert)")},
3739 {"SetDataBrowserSortProperty", (PyCFunction
)CtlObj_SetDataBrowserSortProperty
, 1,
3740 PyDoc_STR("(UInt32 property) -> None")},
3741 {"GetDataBrowserSortProperty", (PyCFunction
)CtlObj_GetDataBrowserSortProperty
, 1,
3742 PyDoc_STR("() -> (UInt32 property)")},
3743 {"SetDataBrowserSelectionFlags", (PyCFunction
)CtlObj_SetDataBrowserSelectionFlags
, 1,
3744 PyDoc_STR("(UInt32 selectionFlags) -> None")},
3745 {"GetDataBrowserSelectionFlags", (PyCFunction
)CtlObj_GetDataBrowserSelectionFlags
, 1,
3746 PyDoc_STR("() -> (UInt32 selectionFlags)")},
3747 {"SetDataBrowserPropertyFlags", (PyCFunction
)CtlObj_SetDataBrowserPropertyFlags
, 1,
3748 PyDoc_STR("(UInt32 property, UInt32 flags) -> None")},
3749 {"GetDataBrowserPropertyFlags", (PyCFunction
)CtlObj_GetDataBrowserPropertyFlags
, 1,
3750 PyDoc_STR("(UInt32 property) -> (UInt32 flags)")},
3751 {"SetDataBrowserEditText", (PyCFunction
)CtlObj_SetDataBrowserEditText
, 1,
3752 PyDoc_STR("(CFStringRef text) -> None")},
3754 #if TARGET_API_MAC_OSX
3755 {"CopyDataBrowserEditText", (PyCFunction
)CtlObj_CopyDataBrowserEditText
, 1,
3756 PyDoc_STR("() -> (CFStringRef text)")},
3758 {"GetDataBrowserEditText", (PyCFunction
)CtlObj_GetDataBrowserEditText
, 1,
3759 PyDoc_STR("(CFMutableStringRef text) -> None")},
3760 {"SetDataBrowserEditItem", (PyCFunction
)CtlObj_SetDataBrowserEditItem
, 1,
3761 PyDoc_STR("(UInt32 item, UInt32 property) -> None")},
3762 {"GetDataBrowserEditItem", (PyCFunction
)CtlObj_GetDataBrowserEditItem
, 1,
3763 PyDoc_STR("() -> (UInt32 item, UInt32 property)")},
3764 {"GetDataBrowserItemPartBounds", (PyCFunction
)CtlObj_GetDataBrowserItemPartBounds
, 1,
3765 PyDoc_STR("(UInt32 item, UInt32 property, OSType part) -> (Rect bounds)")},
3766 {"RemoveDataBrowserTableViewColumn", (PyCFunction
)CtlObj_RemoveDataBrowserTableViewColumn
, 1,
3767 PyDoc_STR("(UInt32 column) -> None")},
3768 {"GetDataBrowserTableViewColumnCount", (PyCFunction
)CtlObj_GetDataBrowserTableViewColumnCount
, 1,
3769 PyDoc_STR("() -> (UInt32 numColumns)")},
3770 {"SetDataBrowserTableViewHiliteStyle", (PyCFunction
)CtlObj_SetDataBrowserTableViewHiliteStyle
, 1,
3771 PyDoc_STR("(UInt32 hiliteStyle) -> None")},
3772 {"GetDataBrowserTableViewHiliteStyle", (PyCFunction
)CtlObj_GetDataBrowserTableViewHiliteStyle
, 1,
3773 PyDoc_STR("() -> (UInt32 hiliteStyle)")},
3774 {"SetDataBrowserTableViewRowHeight", (PyCFunction
)CtlObj_SetDataBrowserTableViewRowHeight
, 1,
3775 PyDoc_STR("(UInt16 height) -> None")},
3776 {"GetDataBrowserTableViewRowHeight", (PyCFunction
)CtlObj_GetDataBrowserTableViewRowHeight
, 1,
3777 PyDoc_STR("() -> (UInt16 height)")},
3778 {"SetDataBrowserTableViewColumnWidth", (PyCFunction
)CtlObj_SetDataBrowserTableViewColumnWidth
, 1,
3779 PyDoc_STR("(UInt16 width) -> None")},
3780 {"GetDataBrowserTableViewColumnWidth", (PyCFunction
)CtlObj_GetDataBrowserTableViewColumnWidth
, 1,
3781 PyDoc_STR("() -> (UInt16 width)")},
3782 {"SetDataBrowserTableViewItemRowHeight", (PyCFunction
)CtlObj_SetDataBrowserTableViewItemRowHeight
, 1,
3783 PyDoc_STR("(UInt32 item, UInt16 height) -> None")},
3784 {"GetDataBrowserTableViewItemRowHeight", (PyCFunction
)CtlObj_GetDataBrowserTableViewItemRowHeight
, 1,
3785 PyDoc_STR("(UInt32 item) -> (UInt16 height)")},
3786 {"SetDataBrowserTableViewNamedColumnWidth", (PyCFunction
)CtlObj_SetDataBrowserTableViewNamedColumnWidth
, 1,
3787 PyDoc_STR("(UInt32 column, UInt16 width) -> None")},
3788 {"GetDataBrowserTableViewNamedColumnWidth", (PyCFunction
)CtlObj_GetDataBrowserTableViewNamedColumnWidth
, 1,
3789 PyDoc_STR("(UInt32 column) -> (UInt16 width)")},
3790 {"SetDataBrowserTableViewGeometry", (PyCFunction
)CtlObj_SetDataBrowserTableViewGeometry
, 1,
3791 PyDoc_STR("(Boolean variableWidthColumns, Boolean variableHeightRows) -> None")},
3792 {"GetDataBrowserTableViewGeometry", (PyCFunction
)CtlObj_GetDataBrowserTableViewGeometry
, 1,
3793 PyDoc_STR("() -> (Boolean variableWidthColumns, Boolean variableHeightRows)")},
3794 {"GetDataBrowserTableViewItemID", (PyCFunction
)CtlObj_GetDataBrowserTableViewItemID
, 1,
3795 PyDoc_STR("(UInt32 row) -> (UInt32 item)")},
3796 {"SetDataBrowserTableViewItemRow", (PyCFunction
)CtlObj_SetDataBrowserTableViewItemRow
, 1,
3797 PyDoc_STR("(UInt32 item, UInt32 row) -> None")},
3798 {"GetDataBrowserTableViewItemRow", (PyCFunction
)CtlObj_GetDataBrowserTableViewItemRow
, 1,
3799 PyDoc_STR("(UInt32 item) -> (UInt32 row)")},
3800 {"SetDataBrowserTableViewColumnPosition", (PyCFunction
)CtlObj_SetDataBrowserTableViewColumnPosition
, 1,
3801 PyDoc_STR("(UInt32 column, UInt32 position) -> None")},
3802 {"GetDataBrowserTableViewColumnPosition", (PyCFunction
)CtlObj_GetDataBrowserTableViewColumnPosition
, 1,
3803 PyDoc_STR("(UInt32 column) -> (UInt32 position)")},
3804 {"GetDataBrowserTableViewColumnProperty", (PyCFunction
)CtlObj_GetDataBrowserTableViewColumnProperty
, 1,
3805 PyDoc_STR("(UInt32 column) -> (UInt32 property)")},
3806 {"AutoSizeDataBrowserListViewColumns", (PyCFunction
)CtlObj_AutoSizeDataBrowserListViewColumns
, 1,
3807 PyDoc_STR("() -> None")},
3808 {"AddDataBrowserListViewColumn", (PyCFunction
)CtlObj_AddDataBrowserListViewColumn
, 1,
3809 PyDoc_STR("(DataBrowserListViewColumnDesc columnDesc, UInt32 position) -> None")},
3810 {"SetDataBrowserListViewHeaderBtnHeight", (PyCFunction
)CtlObj_SetDataBrowserListViewHeaderBtnHeight
, 1,
3811 PyDoc_STR("(UInt16 height) -> None")},
3812 {"GetDataBrowserListViewHeaderBtnHeight", (PyCFunction
)CtlObj_GetDataBrowserListViewHeaderBtnHeight
, 1,
3813 PyDoc_STR("() -> (UInt16 height)")},
3814 {"SetDataBrowserListViewUsePlainBackground", (PyCFunction
)CtlObj_SetDataBrowserListViewUsePlainBackground
, 1,
3815 PyDoc_STR("(Boolean usePlainBackground) -> None")},
3816 {"GetDataBrowserListViewUsePlainBackground", (PyCFunction
)CtlObj_GetDataBrowserListViewUsePlainBackground
, 1,
3817 PyDoc_STR("() -> (Boolean usePlainBackground)")},
3818 {"SetDataBrowserListViewDisclosureColumn", (PyCFunction
)CtlObj_SetDataBrowserListViewDisclosureColumn
, 1,
3819 PyDoc_STR("(UInt32 column, Boolean expandableRows) -> None")},
3820 {"GetDataBrowserListViewDisclosureColumn", (PyCFunction
)CtlObj_GetDataBrowserListViewDisclosureColumn
, 1,
3821 PyDoc_STR("() -> (UInt32 column, Boolean expandableRows)")},
3822 {"GetDataBrowserColumnViewPath", (PyCFunction
)CtlObj_GetDataBrowserColumnViewPath
, 1,
3823 PyDoc_STR("(Handle path) -> None")},
3824 {"GetDataBrowserColumnViewPathLength", (PyCFunction
)CtlObj_GetDataBrowserColumnViewPathLength
, 1,
3825 PyDoc_STR("() -> (UInt32 pathLength)")},
3826 {"SetDataBrowserColumnViewDisplayType", (PyCFunction
)CtlObj_SetDataBrowserColumnViewDisplayType
, 1,
3827 PyDoc_STR("(OSType propertyType) -> None")},
3828 {"GetDataBrowserColumnViewDisplayType", (PyCFunction
)CtlObj_GetDataBrowserColumnViewDisplayType
, 1,
3829 PyDoc_STR("() -> (OSType propertyType)")},
3830 {"as_Resource", (PyCFunction
)CtlObj_as_Resource
, 1,
3831 PyDoc_STR("() -> (Handle _rv)")},
3832 {"GetControlRect", (PyCFunction
)CtlObj_GetControlRect
, 1,
3833 PyDoc_STR("() -> (Rect rect)")},
3834 {"DisposeControl", (PyCFunction
)CtlObj_DisposeControl
, 1,
3835 PyDoc_STR("() -> None")},
3836 {"TrackControl", (PyCFunction
)CtlObj_TrackControl
, 1,
3837 PyDoc_STR("(Point startPoint [,trackercallback]) -> (ControlPartCode _rv)")},
3838 {"HandleControlClick", (PyCFunction
)CtlObj_HandleControlClick
, 1,
3839 PyDoc_STR("(Point startPoint, Integer modifiers, [,trackercallback]) -> (ControlPartCode _rv)")},
3840 {"SetControlData", (PyCFunction
)CtlObj_SetControlData
, 1,
3841 PyDoc_STR("(stuff) -> None")},
3842 {"GetControlData", (PyCFunction
)CtlObj_GetControlData
, 1,
3843 PyDoc_STR("(part, type) -> String")},
3844 {"SetControlData_Handle", (PyCFunction
)CtlObj_SetControlData_Handle
, 1,
3845 PyDoc_STR("(ResObj) -> None")},
3846 {"GetControlData_Handle", (PyCFunction
)CtlObj_GetControlData_Handle
, 1,
3847 PyDoc_STR("(part, type) -> ResObj")},
3848 {"SetControlData_Callback", (PyCFunction
)CtlObj_SetControlData_Callback
, 1,
3849 PyDoc_STR("(callbackfunc) -> None")},
3853 #define CtlObj_getsetlist NULL
3856 static int CtlObj_compare(ControlObject
*self
, ControlObject
*other
)
3860 if (!CtlObj_Check((PyObject
*)other
))
3862 v
=(unsigned long)self
;
3863 w
=(unsigned long)other
;
3867 v
=(unsigned long)self
->ob_itself
;
3868 w
=(unsigned long)other
->ob_itself
;
3870 if( v
< w
) return -1;
3871 if( v
> w
) return 1;
3875 #define CtlObj_repr NULL
3877 static long CtlObj_hash(ControlObject
*self
)
3879 return (long)self
->ob_itself
;
3881 #define CtlObj_tp_init 0
3883 #define CtlObj_tp_alloc PyType_GenericAlloc
3885 static PyObject
*CtlObj_tp_new(PyTypeObject
*type
, PyObject
*args
, PyObject
*kwds
)
3888 ControlHandle itself
;
3889 char *kw
[] = {"itself", 0};
3891 if (!PyArg_ParseTupleAndKeywords(args
, kwds
, "O&", kw
, CtlObj_Convert
, &itself
)) return NULL
;
3892 if ((self
= type
->tp_alloc(type
, 0)) == NULL
) return NULL
;
3893 ((ControlObject
*)self
)->ob_itself
= itself
;
3897 #define CtlObj_tp_free PyObject_Del
3900 PyTypeObject Control_Type
= {
3901 PyObject_HEAD_INIT(NULL
)
3903 "_Ctl.Control", /*tp_name*/
3904 sizeof(ControlObject
), /*tp_basicsize*/
3907 (destructor
) CtlObj_dealloc
, /*tp_dealloc*/
3909 (getattrfunc
)0, /*tp_getattr*/
3910 (setattrfunc
)0, /*tp_setattr*/
3911 (cmpfunc
) CtlObj_compare
, /*tp_compare*/
3912 (reprfunc
) CtlObj_repr
, /*tp_repr*/
3913 (PyNumberMethods
*)0, /* tp_as_number */
3914 (PySequenceMethods
*)0, /* tp_as_sequence */
3915 (PyMappingMethods
*)0, /* tp_as_mapping */
3916 (hashfunc
) CtlObj_hash
, /*tp_hash*/
3919 PyObject_GenericGetAttr
, /*tp_getattro*/
3920 PyObject_GenericSetAttr
, /*tp_setattro */
3922 Py_TPFLAGS_DEFAULT
|Py_TPFLAGS_BASETYPE
, /* tp_flags */
3926 0, /*tp_richcompare*/
3927 0, /*tp_weaklistoffset*/
3930 CtlObj_methods
, /* tp_methods */
3932 CtlObj_getsetlist
, /*tp_getset*/
3937 0, /*tp_dictoffset*/
3938 CtlObj_tp_init
, /* tp_init */
3939 CtlObj_tp_alloc
, /* tp_alloc */
3940 CtlObj_tp_new
, /* tp_new */
3941 CtlObj_tp_free
, /* tp_free */
3944 /* -------------------- End object type Control --------------------- */
3947 static PyObject
*Ctl_NewControl(PyObject
*_self
, PyObject
*_args
)
3949 PyObject
*_res
= NULL
;
3951 WindowPtr owningWindow
;
3953 Str255 controlTitle
;
3954 Boolean initiallyVisible
;
3955 SInt16 initialValue
;
3956 SInt16 minimumValue
;
3957 SInt16 maximumValue
;
3959 SInt32 controlReference
;
3961 PyMac_PRECHECK(NewControl
);
3963 if (!PyArg_ParseTuple(_args
, "O&O&O&bhhhhl",
3964 WinObj_Convert
, &owningWindow
,
3965 PyMac_GetRect
, &boundsRect
,
3966 PyMac_GetStr255
, controlTitle
,
3974 _rv
= NewControl(owningWindow
,
3983 _res
= Py_BuildValue("O&",
3988 static PyObject
*Ctl_GetNewControl(PyObject
*_self
, PyObject
*_args
)
3990 PyObject
*_res
= NULL
;
3993 WindowPtr owningWindow
;
3994 #ifndef GetNewControl
3995 PyMac_PRECHECK(GetNewControl
);
3997 if (!PyArg_ParseTuple(_args
, "hO&",
3999 WinObj_Convert
, &owningWindow
))
4001 _rv
= GetNewControl(resourceID
,
4003 _res
= Py_BuildValue("O&",
4008 static PyObject
*Ctl_DrawControls(PyObject
*_self
, PyObject
*_args
)
4010 PyObject
*_res
= NULL
;
4011 WindowPtr theWindow
;
4012 #ifndef DrawControls
4013 PyMac_PRECHECK(DrawControls
);
4015 if (!PyArg_ParseTuple(_args
, "O&",
4016 WinObj_Convert
, &theWindow
))
4018 DrawControls(theWindow
);
4024 static PyObject
*Ctl_UpdateControls(PyObject
*_self
, PyObject
*_args
)
4026 PyObject
*_res
= NULL
;
4027 WindowPtr theWindow
;
4028 RgnHandle updateRegion
;
4029 #ifndef UpdateControls
4030 PyMac_PRECHECK(UpdateControls
);
4032 if (!PyArg_ParseTuple(_args
, "O&O&",
4033 WinObj_Convert
, &theWindow
,
4034 ResObj_Convert
, &updateRegion
))
4036 UpdateControls(theWindow
,
4043 static PyObject
*Ctl_FindControl(PyObject
*_self
, PyObject
*_args
)
4045 PyObject
*_res
= NULL
;
4046 ControlPartCode _rv
;
4048 WindowPtr theWindow
;
4049 ControlHandle theControl
;
4051 PyMac_PRECHECK(FindControl
);
4053 if (!PyArg_ParseTuple(_args
, "O&O&",
4054 PyMac_GetPoint
, &testPoint
,
4055 WinObj_Convert
, &theWindow
))
4057 _rv
= FindControl(testPoint
,
4060 _res
= Py_BuildValue("hO&",
4062 CtlObj_WhichControl
, theControl
);
4066 static PyObject
*Ctl_IdleControls(PyObject
*_self
, PyObject
*_args
)
4068 PyObject
*_res
= NULL
;
4070 #ifndef IdleControls
4071 PyMac_PRECHECK(IdleControls
);
4073 if (!PyArg_ParseTuple(_args
, "O&",
4074 WinObj_Convert
, &inWindow
))
4076 IdleControls(inWindow
);
4082 static PyObject
*Ctl_GetControlByID(PyObject
*_self
, PyObject
*_args
)
4084 PyObject
*_res
= NULL
;
4088 ControlHandle outControl
;
4089 #ifndef GetControlByID
4090 PyMac_PRECHECK(GetControlByID
);
4092 if (!PyArg_ParseTuple(_args
, "O&O&",
4093 WinObj_Convert
, &inWindow
,
4094 PyControlID_Convert
, &inID
))
4096 _err
= GetControlByID(inWindow
,
4099 if (_err
!= noErr
) return PyMac_Error(_err
);
4100 _res
= Py_BuildValue("O&",
4101 CtlObj_WhichControl
, outControl
);
4105 static PyObject
*Ctl_DumpControlHierarchy(PyObject
*_self
, PyObject
*_args
)
4107 PyObject
*_res
= NULL
;
4111 #ifndef DumpControlHierarchy
4112 PyMac_PRECHECK(DumpControlHierarchy
);
4114 if (!PyArg_ParseTuple(_args
, "O&O&",
4115 WinObj_Convert
, &inWindow
,
4116 PyMac_GetFSSpec
, &inDumpFile
))
4118 _err
= DumpControlHierarchy(inWindow
,
4120 if (_err
!= noErr
) return PyMac_Error(_err
);
4126 static PyObject
*Ctl_CreateRootControl(PyObject
*_self
, PyObject
*_args
)
4128 PyObject
*_res
= NULL
;
4131 ControlHandle outControl
;
4132 #ifndef CreateRootControl
4133 PyMac_PRECHECK(CreateRootControl
);
4135 if (!PyArg_ParseTuple(_args
, "O&",
4136 WinObj_Convert
, &inWindow
))
4138 _err
= CreateRootControl(inWindow
,
4140 if (_err
!= noErr
) return PyMac_Error(_err
);
4141 _res
= Py_BuildValue("O&",
4142 CtlObj_New
, outControl
);
4146 static PyObject
*Ctl_GetRootControl(PyObject
*_self
, PyObject
*_args
)
4148 PyObject
*_res
= NULL
;
4151 ControlHandle outControl
;
4152 #ifndef GetRootControl
4153 PyMac_PRECHECK(GetRootControl
);
4155 if (!PyArg_ParseTuple(_args
, "O&",
4156 WinObj_Convert
, &inWindow
))
4158 _err
= GetRootControl(inWindow
,
4160 if (_err
!= noErr
) return PyMac_Error(_err
);
4161 _res
= Py_BuildValue("O&",
4162 CtlObj_WhichControl
, outControl
);
4166 static PyObject
*Ctl_GetKeyboardFocus(PyObject
*_self
, PyObject
*_args
)
4168 PyObject
*_res
= NULL
;
4171 ControlHandle outControl
;
4172 #ifndef GetKeyboardFocus
4173 PyMac_PRECHECK(GetKeyboardFocus
);
4175 if (!PyArg_ParseTuple(_args
, "O&",
4176 WinObj_Convert
, &inWindow
))
4178 _err
= GetKeyboardFocus(inWindow
,
4180 if (_err
!= noErr
) return PyMac_Error(_err
);
4181 _res
= Py_BuildValue("O&",
4182 CtlObj_WhichControl
, outControl
);
4186 static PyObject
*Ctl_SetKeyboardFocus(PyObject
*_self
, PyObject
*_args
)
4188 PyObject
*_res
= NULL
;
4191 ControlHandle inControl
;
4192 ControlFocusPart inPart
;
4193 #ifndef SetKeyboardFocus
4194 PyMac_PRECHECK(SetKeyboardFocus
);
4196 if (!PyArg_ParseTuple(_args
, "O&O&h",
4197 WinObj_Convert
, &inWindow
,
4198 CtlObj_Convert
, &inControl
,
4201 _err
= SetKeyboardFocus(inWindow
,
4204 if (_err
!= noErr
) return PyMac_Error(_err
);
4210 static PyObject
*Ctl_AdvanceKeyboardFocus(PyObject
*_self
, PyObject
*_args
)
4212 PyObject
*_res
= NULL
;
4215 #ifndef AdvanceKeyboardFocus
4216 PyMac_PRECHECK(AdvanceKeyboardFocus
);
4218 if (!PyArg_ParseTuple(_args
, "O&",
4219 WinObj_Convert
, &inWindow
))
4221 _err
= AdvanceKeyboardFocus(inWindow
);
4222 if (_err
!= noErr
) return PyMac_Error(_err
);
4228 static PyObject
*Ctl_ReverseKeyboardFocus(PyObject
*_self
, PyObject
*_args
)
4230 PyObject
*_res
= NULL
;
4233 #ifndef ReverseKeyboardFocus
4234 PyMac_PRECHECK(ReverseKeyboardFocus
);
4236 if (!PyArg_ParseTuple(_args
, "O&",
4237 WinObj_Convert
, &inWindow
))
4239 _err
= ReverseKeyboardFocus(inWindow
);
4240 if (_err
!= noErr
) return PyMac_Error(_err
);
4246 static PyObject
*Ctl_ClearKeyboardFocus(PyObject
*_self
, PyObject
*_args
)
4248 PyObject
*_res
= NULL
;
4251 #ifndef ClearKeyboardFocus
4252 PyMac_PRECHECK(ClearKeyboardFocus
);
4254 if (!PyArg_ParseTuple(_args
, "O&",
4255 WinObj_Convert
, &inWindow
))
4257 _err
= ClearKeyboardFocus(inWindow
);
4258 if (_err
!= noErr
) return PyMac_Error(_err
);
4264 static PyObject
*Ctl_SetAutomaticControlDragTrackingEnabledForWindow(PyObject
*_self
, PyObject
*_args
)
4266 PyObject
*_res
= NULL
;
4268 WindowPtr theWindow
;
4270 #ifndef SetAutomaticControlDragTrackingEnabledForWindow
4271 PyMac_PRECHECK(SetAutomaticControlDragTrackingEnabledForWindow
);
4273 if (!PyArg_ParseTuple(_args
, "O&b",
4274 WinObj_Convert
, &theWindow
,
4277 _err
= SetAutomaticControlDragTrackingEnabledForWindow(theWindow
,
4279 if (_err
!= noErr
) return PyMac_Error(_err
);
4285 static PyObject
*Ctl_IsAutomaticControlDragTrackingEnabledForWindow(PyObject
*_self
, PyObject
*_args
)
4287 PyObject
*_res
= NULL
;
4289 WindowPtr theWindow
;
4291 #ifndef IsAutomaticControlDragTrackingEnabledForWindow
4292 PyMac_PRECHECK(IsAutomaticControlDragTrackingEnabledForWindow
);
4294 if (!PyArg_ParseTuple(_args
, "O&",
4295 WinObj_Convert
, &theWindow
))
4297 _err
= IsAutomaticControlDragTrackingEnabledForWindow(theWindow
,
4299 if (_err
!= noErr
) return PyMac_Error(_err
);
4300 _res
= Py_BuildValue("b",
4305 static PyObject
*Ctl_CreateBevelButtonControl(PyObject
*_self
, PyObject
*_args
)
4307 PyObject
*_res
= NULL
;
4314 ControlButtonContentInfo info
;
4316 UInt16 menuBehavior
;
4317 UInt16 menuPlacement
;
4318 ControlHandle outControl
;
4319 #ifndef CreateBevelButtonControl
4320 PyMac_PRECHECK(CreateBevelButtonControl
);
4322 if (!PyArg_ParseTuple(_args
, "O&O&O&HHO&hHH",
4323 WinObj_Convert
, &window
,
4324 PyMac_GetRect
, &boundsRect
,
4325 CFStringRefObj_Convert
, &title
,
4328 ControlButtonContentInfo_Convert
, &info
,
4333 _err
= CreateBevelButtonControl(window
,
4343 if (_err
!= noErr
) return PyMac_Error(_err
);
4344 _res
= Py_BuildValue("O&",
4345 CtlObj_New
, outControl
);
4349 static PyObject
*Ctl_CreateSliderControl(PyObject
*_self
, PyObject
*_args
)
4351 PyObject
*_res
= NULL
;
4359 UInt16 numTickMarks
;
4360 Boolean liveTracking
;
4361 PyObject
* liveTrackingProc
;
4362 UniversalProcPtr c_callback
;
4363 ControlHandle outControl
;
4364 #ifndef CreateSliderControl
4365 PyMac_PRECHECK(CreateSliderControl
);
4367 if (!PyArg_ParseTuple(_args
, "O&O&lllHHbO",
4368 WinObj_Convert
, &window
,
4369 PyMac_GetRect
, &boundsRect
,
4378 _err
= CreateSliderControl(window
,
4388 if (_err
!= noErr
) return PyMac_Error(_err
);
4389 _res
= Py_BuildValue("O&",
4390 CtlObj_New
, outControl
);
4391 setcallback(_res
, kMyControlActionProcTag
, liveTrackingProc
, &c_callback
);
4395 static PyObject
*Ctl_CreateDisclosureTriangleControl(PyObject
*_self
, PyObject
*_args
)
4397 PyObject
*_res
= NULL
;
4403 SInt32 initialValue
;
4405 Boolean autoToggles
;
4406 ControlHandle outControl
;
4407 #ifndef CreateDisclosureTriangleControl
4408 PyMac_PRECHECK(CreateDisclosureTriangleControl
);
4410 if (!PyArg_ParseTuple(_args
, "O&O&HO&lbb",
4411 WinObj_Convert
, &window
,
4412 PyMac_GetRect
, &boundsRect
,
4414 CFStringRefObj_Convert
, &title
,
4419 _err
= CreateDisclosureTriangleControl(window
,
4427 if (_err
!= noErr
) return PyMac_Error(_err
);
4428 _res
= Py_BuildValue("O&",
4429 CtlObj_New
, outControl
);
4433 static PyObject
*Ctl_CreateProgressBarControl(PyObject
*_self
, PyObject
*_args
)
4435 PyObject
*_res
= NULL
;
4442 Boolean indeterminate
;
4443 ControlHandle outControl
;
4444 #ifndef CreateProgressBarControl
4445 PyMac_PRECHECK(CreateProgressBarControl
);
4447 if (!PyArg_ParseTuple(_args
, "O&O&lllb",
4448 WinObj_Convert
, &window
,
4449 PyMac_GetRect
, &boundsRect
,
4455 _err
= CreateProgressBarControl(window
,
4462 if (_err
!= noErr
) return PyMac_Error(_err
);
4463 _res
= Py_BuildValue("O&",
4464 CtlObj_New
, outControl
);
4468 #if TARGET_API_MAC_OSX
4470 static PyObject
*Ctl_CreateRelevanceBarControl(PyObject
*_self
, PyObject
*_args
)
4472 PyObject
*_res
= NULL
;
4479 ControlHandle outControl
;
4480 #ifndef CreateRelevanceBarControl
4481 PyMac_PRECHECK(CreateRelevanceBarControl
);
4483 if (!PyArg_ParseTuple(_args
, "O&O&lll",
4484 WinObj_Convert
, &window
,
4485 PyMac_GetRect
, &boundsRect
,
4490 _err
= CreateRelevanceBarControl(window
,
4496 if (_err
!= noErr
) return PyMac_Error(_err
);
4497 _res
= Py_BuildValue("O&",
4498 CtlObj_New
, outControl
);
4503 static PyObject
*Ctl_CreateLittleArrowsControl(PyObject
*_self
, PyObject
*_args
)
4505 PyObject
*_res
= NULL
;
4513 ControlHandle outControl
;
4514 #ifndef CreateLittleArrowsControl
4515 PyMac_PRECHECK(CreateLittleArrowsControl
);
4517 if (!PyArg_ParseTuple(_args
, "O&O&llll",
4518 WinObj_Convert
, &window
,
4519 PyMac_GetRect
, &boundsRect
,
4525 _err
= CreateLittleArrowsControl(window
,
4532 if (_err
!= noErr
) return PyMac_Error(_err
);
4533 _res
= Py_BuildValue("O&",
4534 CtlObj_New
, outControl
);
4538 static PyObject
*Ctl_CreateChasingArrowsControl(PyObject
*_self
, PyObject
*_args
)
4540 PyObject
*_res
= NULL
;
4544 ControlHandle outControl
;
4545 #ifndef CreateChasingArrowsControl
4546 PyMac_PRECHECK(CreateChasingArrowsControl
);
4548 if (!PyArg_ParseTuple(_args
, "O&O&",
4549 WinObj_Convert
, &window
,
4550 PyMac_GetRect
, &boundsRect
))
4552 _err
= CreateChasingArrowsControl(window
,
4555 if (_err
!= noErr
) return PyMac_Error(_err
);
4556 _res
= Py_BuildValue("O&",
4557 CtlObj_New
, outControl
);
4561 static PyObject
*Ctl_CreateSeparatorControl(PyObject
*_self
, PyObject
*_args
)
4563 PyObject
*_res
= NULL
;
4567 ControlHandle outControl
;
4568 #ifndef CreateSeparatorControl
4569 PyMac_PRECHECK(CreateSeparatorControl
);
4571 if (!PyArg_ParseTuple(_args
, "O&O&",
4572 WinObj_Convert
, &window
,
4573 PyMac_GetRect
, &boundsRect
))
4575 _err
= CreateSeparatorControl(window
,
4578 if (_err
!= noErr
) return PyMac_Error(_err
);
4579 _res
= Py_BuildValue("O&",
4580 CtlObj_New
, outControl
);
4584 static PyObject
*Ctl_CreateGroupBoxControl(PyObject
*_self
, PyObject
*_args
)
4586 PyObject
*_res
= NULL
;
4592 ControlHandle outControl
;
4593 #ifndef CreateGroupBoxControl
4594 PyMac_PRECHECK(CreateGroupBoxControl
);
4596 if (!PyArg_ParseTuple(_args
, "O&O&O&b",
4597 WinObj_Convert
, &window
,
4598 PyMac_GetRect
, &boundsRect
,
4599 CFStringRefObj_Convert
, &title
,
4602 _err
= CreateGroupBoxControl(window
,
4607 if (_err
!= noErr
) return PyMac_Error(_err
);
4608 _res
= Py_BuildValue("O&",
4609 CtlObj_New
, outControl
);
4613 static PyObject
*Ctl_CreateCheckGroupBoxControl(PyObject
*_self
, PyObject
*_args
)
4615 PyObject
*_res
= NULL
;
4620 SInt32 initialValue
;
4623 ControlHandle outControl
;
4624 #ifndef CreateCheckGroupBoxControl
4625 PyMac_PRECHECK(CreateCheckGroupBoxControl
);
4627 if (!PyArg_ParseTuple(_args
, "O&O&O&lbb",
4628 WinObj_Convert
, &window
,
4629 PyMac_GetRect
, &boundsRect
,
4630 CFStringRefObj_Convert
, &title
,
4635 _err
= CreateCheckGroupBoxControl(window
,
4642 if (_err
!= noErr
) return PyMac_Error(_err
);
4643 _res
= Py_BuildValue("O&",
4644 CtlObj_New
, outControl
);
4648 static PyObject
*Ctl_CreatePopupGroupBoxControl(PyObject
*_self
, PyObject
*_args
)
4650 PyObject
*_res
= NULL
;
4657 Boolean variableWidth
;
4659 SInt16 titleJustification
;
4661 ControlHandle outControl
;
4662 #ifndef CreatePopupGroupBoxControl
4663 PyMac_PRECHECK(CreatePopupGroupBoxControl
);
4665 if (!PyArg_ParseTuple(_args
, "O&O&O&bhbhhb",
4666 WinObj_Convert
, &window
,
4667 PyMac_GetRect
, &boundsRect
,
4668 CFStringRefObj_Convert
, &title
,
4673 &titleJustification
,
4676 _err
= CreatePopupGroupBoxControl(window
,
4686 if (_err
!= noErr
) return PyMac_Error(_err
);
4687 _res
= Py_BuildValue("O&",
4688 CtlObj_New
, outControl
);
4692 static PyObject
*Ctl_CreateImageWellControl(PyObject
*_self
, PyObject
*_args
)
4694 PyObject
*_res
= NULL
;
4698 ControlButtonContentInfo info
;
4699 ControlHandle outControl
;
4700 #ifndef CreateImageWellControl
4701 PyMac_PRECHECK(CreateImageWellControl
);
4703 if (!PyArg_ParseTuple(_args
, "O&O&O&",
4704 WinObj_Convert
, &window
,
4705 PyMac_GetRect
, &boundsRect
,
4706 ControlButtonContentInfo_Convert
, &info
))
4708 _err
= CreateImageWellControl(window
,
4712 if (_err
!= noErr
) return PyMac_Error(_err
);
4713 _res
= Py_BuildValue("O&",
4714 CtlObj_New
, outControl
);
4718 static PyObject
*Ctl_CreatePopupArrowControl(PyObject
*_self
, PyObject
*_args
)
4720 PyObject
*_res
= NULL
;
4726 ControlHandle outControl
;
4727 #ifndef CreatePopupArrowControl
4728 PyMac_PRECHECK(CreatePopupArrowControl
);
4730 if (!PyArg_ParseTuple(_args
, "O&O&HH",
4731 WinObj_Convert
, &window
,
4732 PyMac_GetRect
, &boundsRect
,
4736 _err
= CreatePopupArrowControl(window
,
4741 if (_err
!= noErr
) return PyMac_Error(_err
);
4742 _res
= Py_BuildValue("O&",
4743 CtlObj_New
, outControl
);
4747 static PyObject
*Ctl_CreatePlacardControl(PyObject
*_self
, PyObject
*_args
)
4749 PyObject
*_res
= NULL
;
4753 ControlHandle outControl
;
4754 #ifndef CreatePlacardControl
4755 PyMac_PRECHECK(CreatePlacardControl
);
4757 if (!PyArg_ParseTuple(_args
, "O&O&",
4758 WinObj_Convert
, &window
,
4759 PyMac_GetRect
, &boundsRect
))
4761 _err
= CreatePlacardControl(window
,
4764 if (_err
!= noErr
) return PyMac_Error(_err
);
4765 _res
= Py_BuildValue("O&",
4766 CtlObj_New
, outControl
);
4770 static PyObject
*Ctl_CreateClockControl(PyObject
*_self
, PyObject
*_args
)
4772 PyObject
*_res
= NULL
;
4778 ControlHandle outControl
;
4779 #ifndef CreateClockControl
4780 PyMac_PRECHECK(CreateClockControl
);
4782 if (!PyArg_ParseTuple(_args
, "O&O&Hl",
4783 WinObj_Convert
, &window
,
4784 PyMac_GetRect
, &boundsRect
,
4788 _err
= CreateClockControl(window
,
4793 if (_err
!= noErr
) return PyMac_Error(_err
);
4794 _res
= Py_BuildValue("O&",
4795 CtlObj_New
, outControl
);
4799 static PyObject
*Ctl_CreateUserPaneControl(PyObject
*_self
, PyObject
*_args
)
4801 PyObject
*_res
= NULL
;
4806 ControlHandle outControl
;
4807 #ifndef CreateUserPaneControl
4808 PyMac_PRECHECK(CreateUserPaneControl
);
4810 if (!PyArg_ParseTuple(_args
, "O&O&l",
4811 WinObj_Convert
, &window
,
4812 PyMac_GetRect
, &boundsRect
,
4815 _err
= CreateUserPaneControl(window
,
4819 if (_err
!= noErr
) return PyMac_Error(_err
);
4820 _res
= Py_BuildValue("O&",
4821 CtlObj_New
, outControl
);
4825 static PyObject
*Ctl_CreateEditTextControl(PyObject
*_self
, PyObject
*_args
)
4827 PyObject
*_res
= NULL
;
4833 Boolean useInlineInput
;
4834 ControlFontStyleRec style
;
4835 ControlHandle outControl
;
4836 #ifndef CreateEditTextControl
4837 PyMac_PRECHECK(CreateEditTextControl
);
4839 if (!PyArg_ParseTuple(_args
, "O&O&O&bbO&",
4840 WinObj_Convert
, &window
,
4841 PyMac_GetRect
, &boundsRect
,
4842 CFStringRefObj_Convert
, &text
,
4845 ControlFontStyle_Convert
, &style
))
4847 _err
= CreateEditTextControl(window
,
4854 if (_err
!= noErr
) return PyMac_Error(_err
);
4855 _res
= Py_BuildValue("O&",
4856 CtlObj_New
, outControl
);
4860 static PyObject
*Ctl_CreateStaticTextControl(PyObject
*_self
, PyObject
*_args
)
4862 PyObject
*_res
= NULL
;
4867 ControlFontStyleRec style
;
4868 ControlHandle outControl
;
4869 #ifndef CreateStaticTextControl
4870 PyMac_PRECHECK(CreateStaticTextControl
);
4872 if (!PyArg_ParseTuple(_args
, "O&O&O&O&",
4873 WinObj_Convert
, &window
,
4874 PyMac_GetRect
, &boundsRect
,
4875 CFStringRefObj_Convert
, &text
,
4876 ControlFontStyle_Convert
, &style
))
4878 _err
= CreateStaticTextControl(window
,
4883 if (_err
!= noErr
) return PyMac_Error(_err
);
4884 _res
= Py_BuildValue("O&",
4885 CtlObj_New
, outControl
);
4889 static PyObject
*Ctl_CreatePictureControl(PyObject
*_self
, PyObject
*_args
)
4891 PyObject
*_res
= NULL
;
4895 ControlButtonContentInfo content
;
4897 ControlHandle outControl
;
4898 #ifndef CreatePictureControl
4899 PyMac_PRECHECK(CreatePictureControl
);
4901 if (!PyArg_ParseTuple(_args
, "O&O&O&b",
4902 WinObj_Convert
, &window
,
4903 PyMac_GetRect
, &boundsRect
,
4904 ControlButtonContentInfo_Convert
, &content
,
4907 _err
= CreatePictureControl(window
,
4912 if (_err
!= noErr
) return PyMac_Error(_err
);
4913 _res
= Py_BuildValue("O&",
4914 CtlObj_New
, outControl
);
4918 static PyObject
*Ctl_CreateIconControl(PyObject
*_self
, PyObject
*_args
)
4920 PyObject
*_res
= NULL
;
4924 ControlButtonContentInfo icon
;
4926 ControlHandle outControl
;
4927 #ifndef CreateIconControl
4928 PyMac_PRECHECK(CreateIconControl
);
4930 if (!PyArg_ParseTuple(_args
, "O&O&O&b",
4931 WinObj_Convert
, &window
,
4932 PyMac_GetRect
, &boundsRect
,
4933 ControlButtonContentInfo_Convert
, &icon
,
4936 _err
= CreateIconControl(window
,
4941 if (_err
!= noErr
) return PyMac_Error(_err
);
4942 _res
= Py_BuildValue("O&",
4943 CtlObj_New
, outControl
);
4947 static PyObject
*Ctl_CreateWindowHeaderControl(PyObject
*_self
, PyObject
*_args
)
4949 PyObject
*_res
= NULL
;
4953 Boolean isListHeader
;
4954 ControlHandle outControl
;
4955 #ifndef CreateWindowHeaderControl
4956 PyMac_PRECHECK(CreateWindowHeaderControl
);
4958 if (!PyArg_ParseTuple(_args
, "O&O&b",
4959 WinObj_Convert
, &window
,
4960 PyMac_GetRect
, &boundsRect
,
4963 _err
= CreateWindowHeaderControl(window
,
4967 if (_err
!= noErr
) return PyMac_Error(_err
);
4968 _res
= Py_BuildValue("O&",
4969 CtlObj_New
, outControl
);
4973 static PyObject
*Ctl_CreatePushButtonControl(PyObject
*_self
, PyObject
*_args
)
4975 PyObject
*_res
= NULL
;
4980 ControlHandle outControl
;
4981 #ifndef CreatePushButtonControl
4982 PyMac_PRECHECK(CreatePushButtonControl
);
4984 if (!PyArg_ParseTuple(_args
, "O&O&O&",
4985 WinObj_Convert
, &window
,
4986 PyMac_GetRect
, &boundsRect
,
4987 CFStringRefObj_Convert
, &title
))
4989 _err
= CreatePushButtonControl(window
,
4993 if (_err
!= noErr
) return PyMac_Error(_err
);
4994 _res
= Py_BuildValue("O&",
4995 CtlObj_New
, outControl
);
4999 static PyObject
*Ctl_CreatePushButtonWithIconControl(PyObject
*_self
, PyObject
*_args
)
5001 PyObject
*_res
= NULL
;
5006 ControlButtonContentInfo icon
;
5007 UInt16 iconAlignment
;
5008 ControlHandle outControl
;
5009 #ifndef CreatePushButtonWithIconControl
5010 PyMac_PRECHECK(CreatePushButtonWithIconControl
);
5012 if (!PyArg_ParseTuple(_args
, "O&O&O&O&H",
5013 WinObj_Convert
, &window
,
5014 PyMac_GetRect
, &boundsRect
,
5015 CFStringRefObj_Convert
, &title
,
5016 ControlButtonContentInfo_Convert
, &icon
,
5019 _err
= CreatePushButtonWithIconControl(window
,
5025 if (_err
!= noErr
) return PyMac_Error(_err
);
5026 _res
= Py_BuildValue("O&",
5027 CtlObj_New
, outControl
);
5031 static PyObject
*Ctl_CreateRadioButtonControl(PyObject
*_self
, PyObject
*_args
)
5033 PyObject
*_res
= NULL
;
5038 SInt32 initialValue
;
5040 ControlHandle outControl
;
5041 #ifndef CreateRadioButtonControl
5042 PyMac_PRECHECK(CreateRadioButtonControl
);
5044 if (!PyArg_ParseTuple(_args
, "O&O&O&lb",
5045 WinObj_Convert
, &window
,
5046 PyMac_GetRect
, &boundsRect
,
5047 CFStringRefObj_Convert
, &title
,
5051 _err
= CreateRadioButtonControl(window
,
5057 if (_err
!= noErr
) return PyMac_Error(_err
);
5058 _res
= Py_BuildValue("O&",
5059 CtlObj_New
, outControl
);
5063 static PyObject
*Ctl_CreateCheckBoxControl(PyObject
*_self
, PyObject
*_args
)
5065 PyObject
*_res
= NULL
;
5070 SInt32 initialValue
;
5072 ControlHandle outControl
;
5073 #ifndef CreateCheckBoxControl
5074 PyMac_PRECHECK(CreateCheckBoxControl
);
5076 if (!PyArg_ParseTuple(_args
, "O&O&O&lb",
5077 WinObj_Convert
, &window
,
5078 PyMac_GetRect
, &boundsRect
,
5079 CFStringRefObj_Convert
, &title
,
5083 _err
= CreateCheckBoxControl(window
,
5089 if (_err
!= noErr
) return PyMac_Error(_err
);
5090 _res
= Py_BuildValue("O&",
5091 CtlObj_New
, outControl
);
5095 static PyObject
*Ctl_CreateScrollBarControl(PyObject
*_self
, PyObject
*_args
)
5097 PyObject
*_res
= NULL
;
5105 Boolean liveTracking
;
5106 PyObject
* liveTrackingProc
;
5107 UniversalProcPtr c_callback
;
5108 ControlHandle outControl
;
5109 #ifndef CreateScrollBarControl
5110 PyMac_PRECHECK(CreateScrollBarControl
);
5112 if (!PyArg_ParseTuple(_args
, "O&O&llllbO",
5113 WinObj_Convert
, &window
,
5114 PyMac_GetRect
, &boundsRect
,
5122 _err
= CreateScrollBarControl(window
,
5131 if (_err
!= noErr
) return PyMac_Error(_err
);
5132 _res
= Py_BuildValue("O&",
5133 CtlObj_New
, outControl
);
5134 setcallback(_res
, kMyControlActionProcTag
, liveTrackingProc
, &c_callback
);
5138 static PyObject
*Ctl_CreatePopupButtonControl(PyObject
*_self
, PyObject
*_args
)
5140 PyObject
*_res
= NULL
;
5146 Boolean variableWidth
;
5148 SInt16 titleJustification
;
5150 ControlHandle outControl
;
5151 #ifndef CreatePopupButtonControl
5152 PyMac_PRECHECK(CreatePopupButtonControl
);
5154 if (!PyArg_ParseTuple(_args
, "O&O&O&hbhhb",
5155 WinObj_Convert
, &window
,
5156 PyMac_GetRect
, &boundsRect
,
5157 CFStringRefObj_Convert
, &title
,
5161 &titleJustification
,
5164 _err
= CreatePopupButtonControl(window
,
5173 if (_err
!= noErr
) return PyMac_Error(_err
);
5174 _res
= Py_BuildValue("O&",
5175 CtlObj_New
, outControl
);
5179 static PyObject
*Ctl_CreateRadioGroupControl(PyObject
*_self
, PyObject
*_args
)
5181 PyObject
*_res
= NULL
;
5185 ControlHandle outControl
;
5186 #ifndef CreateRadioGroupControl
5187 PyMac_PRECHECK(CreateRadioGroupControl
);
5189 if (!PyArg_ParseTuple(_args
, "O&O&",
5190 WinObj_Convert
, &window
,
5191 PyMac_GetRect
, &boundsRect
))
5193 _err
= CreateRadioGroupControl(window
,
5196 if (_err
!= noErr
) return PyMac_Error(_err
);
5197 _res
= Py_BuildValue("O&",
5198 CtlObj_New
, outControl
);
5202 static PyObject
*Ctl_CreateScrollingTextBoxControl(PyObject
*_self
, PyObject
*_args
)
5204 PyObject
*_res
= NULL
;
5208 SInt16 contentResID
;
5210 UInt32 delayBeforeAutoScroll
;
5211 UInt32 delayBetweenAutoScroll
;
5212 UInt16 autoScrollAmount
;
5213 ControlHandle outControl
;
5214 #ifndef CreateScrollingTextBoxControl
5215 PyMac_PRECHECK(CreateScrollingTextBoxControl
);
5217 if (!PyArg_ParseTuple(_args
, "O&O&hbllH",
5218 WinObj_Convert
, &window
,
5219 PyMac_GetRect
, &boundsRect
,
5222 &delayBeforeAutoScroll
,
5223 &delayBetweenAutoScroll
,
5226 _err
= CreateScrollingTextBoxControl(window
,
5230 delayBeforeAutoScroll
,
5231 delayBetweenAutoScroll
,
5234 if (_err
!= noErr
) return PyMac_Error(_err
);
5235 _res
= Py_BuildValue("O&",
5236 CtlObj_New
, outControl
);
5240 #if TARGET_API_MAC_OSX
5242 static PyObject
*Ctl_CreateDisclosureButtonControl(PyObject
*_self
, PyObject
*_args
)
5244 PyObject
*_res
= NULL
;
5249 Boolean inAutoToggles
;
5250 ControlHandle outControl
;
5251 #ifndef CreateDisclosureButtonControl
5252 PyMac_PRECHECK(CreateDisclosureButtonControl
);
5254 if (!PyArg_ParseTuple(_args
, "O&O&lb",
5255 WinObj_Convert
, &inWindow
,
5256 PyMac_GetRect
, &inBoundsRect
,
5260 _err
= CreateDisclosureButtonControl(inWindow
,
5265 if (_err
!= noErr
) return PyMac_Error(_err
);
5266 _res
= Py_BuildValue("O&",
5267 CtlObj_New
, outControl
);
5272 #if TARGET_API_MAC_OSX
5274 static PyObject
*Ctl_CreateRoundButtonControl(PyObject
*_self
, PyObject
*_args
)
5276 PyObject
*_res
= NULL
;
5281 ControlButtonContentInfo inContent
;
5282 ControlHandle outControl
;
5283 #ifndef CreateRoundButtonControl
5284 PyMac_PRECHECK(CreateRoundButtonControl
);
5286 if (!PyArg_ParseTuple(_args
, "O&O&hO&",
5287 WinObj_Convert
, &inWindow
,
5288 PyMac_GetRect
, &inBoundsRect
,
5290 ControlButtonContentInfo_Convert
, &inContent
))
5292 _err
= CreateRoundButtonControl(inWindow
,
5297 if (_err
!= noErr
) return PyMac_Error(_err
);
5298 _res
= Py_BuildValue("O&",
5299 CtlObj_New
, outControl
);
5304 static PyObject
*Ctl_CreateDataBrowserControl(PyObject
*_self
, PyObject
*_args
)
5306 PyObject
*_res
= NULL
;
5311 ControlHandle outControl
;
5312 #ifndef CreateDataBrowserControl
5313 PyMac_PRECHECK(CreateDataBrowserControl
);
5315 if (!PyArg_ParseTuple(_args
, "O&O&O&",
5316 WinObj_Convert
, &window
,
5317 PyMac_GetRect
, &boundsRect
,
5318 PyMac_GetOSType
, &style
))
5320 _err
= CreateDataBrowserControl(window
,
5324 if (_err
!= noErr
) return PyMac_Error(_err
);
5325 _res
= Py_BuildValue("O&",
5326 CtlObj_New
, outControl
);
5330 #if TARGET_API_MAC_OSX
5332 static PyObject
*Ctl_CreateEditUnicodeTextControl(PyObject
*_self
, PyObject
*_args
)
5334 PyObject
*_res
= NULL
;
5340 ControlFontStyleRec style
;
5341 ControlHandle outControl
;
5342 #ifndef CreateEditUnicodeTextControl
5343 PyMac_PRECHECK(CreateEditUnicodeTextControl
);
5345 if (!PyArg_ParseTuple(_args
, "O&O&O&bO&",
5346 WinObj_Convert
, &window
,
5347 PyMac_GetRect
, &boundsRect
,
5348 CFStringRefObj_Convert
, &text
,
5350 ControlFontStyle_Convert
, &style
))
5352 _err
= CreateEditUnicodeTextControl(window
,
5358 if (_err
!= noErr
) return PyMac_Error(_err
);
5359 _res
= Py_BuildValue("O&",
5360 CtlObj_New
, outControl
);
5365 static PyObject
*Ctl_FindControlUnderMouse(PyObject
*_self
, PyObject
*_args
)
5367 PyObject
*_res
= NULL
;
5372 #ifndef FindControlUnderMouse
5373 PyMac_PRECHECK(FindControlUnderMouse
);
5375 if (!PyArg_ParseTuple(_args
, "O&O&",
5376 PyMac_GetPoint
, &inWhere
,
5377 WinObj_Convert
, &inWindow
))
5379 _rv
= FindControlUnderMouse(inWhere
,
5382 _res
= Py_BuildValue("O&h",
5383 CtlObj_WhichControl
, _rv
,
5388 static PyObject
*Ctl_as_Control(PyObject
*_self
, PyObject
*_args
)
5390 PyObject
*_res
= NULL
;
5394 PyMac_PRECHECK(as_Control
);
5396 if (!PyArg_ParseTuple(_args
, "O&",
5397 ResObj_Convert
, &h
))
5399 _rv
= as_Control(h
);
5400 _res
= Py_BuildValue("O&",
5405 static PyObject
*Ctl_CreateTabsControl(PyObject
*_self
, PyObject
*_args
)
5407 PyObject
*_res
= NULL
;
5415 ControlTabEntry tabArray
[MAXTABS
];
5416 ControlHandle outControl
;
5417 PyObject
*tabArrayObj
, *tabEntry
;
5419 #ifndef CreateTabsControl
5420 PyMac_PRECHECK(CreateTabsControl
);
5422 if (!PyArg_ParseTuple(_args
, "O&O&HHO",
5423 WinObj_Convert
, &window
,
5424 PyMac_GetRect
, &boundsRect
,
5430 i
= PySequence_Length(tabArrayObj
);
5434 PyErr_SetString(Ctl_Error
, "Too many tabs");
5438 for (i
=0; i
<numTabs
; i
++) {
5439 tabEntry
= PySequence_GetItem(tabArrayObj
, i
);
5440 if (tabEntry
== NULL
)
5442 if (!PyArg_Parse(tabEntry
, "(O&O&B)",
5443 ControlButtonContentInfo_Convert
, &tabArray
[i
].icon
,
5444 CFStringRefObj_Convert
, &tabArray
[i
].name
,
5445 &tabArray
[i
].enabled
5450 _err
= CreateTabsControl(window
,
5457 if (_err
!= noErr
) return PyMac_Error(_err
);
5458 _res
= Py_BuildValue("O&",
5459 CtlObj_New
, outControl
);
5463 static PyMethodDef Ctl_methods
[] = {
5464 {"NewControl", (PyCFunction
)Ctl_NewControl
, 1,
5465 PyDoc_STR("(WindowPtr owningWindow, Rect boundsRect, Str255 controlTitle, Boolean initiallyVisible, SInt16 initialValue, SInt16 minimumValue, SInt16 maximumValue, SInt16 procID, SInt32 controlReference) -> (ControlHandle _rv)")},
5466 {"GetNewControl", (PyCFunction
)Ctl_GetNewControl
, 1,
5467 PyDoc_STR("(SInt16 resourceID, WindowPtr owningWindow) -> (ControlHandle _rv)")},
5468 {"DrawControls", (PyCFunction
)Ctl_DrawControls
, 1,
5469 PyDoc_STR("(WindowPtr theWindow) -> None")},
5470 {"UpdateControls", (PyCFunction
)Ctl_UpdateControls
, 1,
5471 PyDoc_STR("(WindowPtr theWindow, RgnHandle updateRegion) -> None")},
5472 {"FindControl", (PyCFunction
)Ctl_FindControl
, 1,
5473 PyDoc_STR("(Point testPoint, WindowPtr theWindow) -> (ControlPartCode _rv, ControlHandle theControl)")},
5474 {"IdleControls", (PyCFunction
)Ctl_IdleControls
, 1,
5475 PyDoc_STR("(WindowPtr inWindow) -> None")},
5476 {"GetControlByID", (PyCFunction
)Ctl_GetControlByID
, 1,
5477 PyDoc_STR("(WindowPtr inWindow, ControlID inID) -> (ControlHandle outControl)")},
5478 {"DumpControlHierarchy", (PyCFunction
)Ctl_DumpControlHierarchy
, 1,
5479 PyDoc_STR("(WindowPtr inWindow, FSSpec inDumpFile) -> None")},
5480 {"CreateRootControl", (PyCFunction
)Ctl_CreateRootControl
, 1,
5481 PyDoc_STR("(WindowPtr inWindow) -> (ControlHandle outControl)")},
5482 {"GetRootControl", (PyCFunction
)Ctl_GetRootControl
, 1,
5483 PyDoc_STR("(WindowPtr inWindow) -> (ControlHandle outControl)")},
5484 {"GetKeyboardFocus", (PyCFunction
)Ctl_GetKeyboardFocus
, 1,
5485 PyDoc_STR("(WindowPtr inWindow) -> (ControlHandle outControl)")},
5486 {"SetKeyboardFocus", (PyCFunction
)Ctl_SetKeyboardFocus
, 1,
5487 PyDoc_STR("(WindowPtr inWindow, ControlHandle inControl, ControlFocusPart inPart) -> None")},
5488 {"AdvanceKeyboardFocus", (PyCFunction
)Ctl_AdvanceKeyboardFocus
, 1,
5489 PyDoc_STR("(WindowPtr inWindow) -> None")},
5490 {"ReverseKeyboardFocus", (PyCFunction
)Ctl_ReverseKeyboardFocus
, 1,
5491 PyDoc_STR("(WindowPtr inWindow) -> None")},
5492 {"ClearKeyboardFocus", (PyCFunction
)Ctl_ClearKeyboardFocus
, 1,
5493 PyDoc_STR("(WindowPtr inWindow) -> None")},
5494 {"SetAutomaticControlDragTrackingEnabledForWindow", (PyCFunction
)Ctl_SetAutomaticControlDragTrackingEnabledForWindow
, 1,
5495 PyDoc_STR("(WindowPtr theWindow, Boolean tracks) -> None")},
5496 {"IsAutomaticControlDragTrackingEnabledForWindow", (PyCFunction
)Ctl_IsAutomaticControlDragTrackingEnabledForWindow
, 1,
5497 PyDoc_STR("(WindowPtr theWindow) -> (Boolean tracks)")},
5498 {"CreateBevelButtonControl", (PyCFunction
)Ctl_CreateBevelButtonControl
, 1,
5499 PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef title, UInt16 thickness, UInt16 behavior, ControlButtonContentInfo info, SInt16 menuID, UInt16 menuBehavior, UInt16 menuPlacement) -> (ControlHandle outControl)")},
5500 {"CreateSliderControl", (PyCFunction
)Ctl_CreateSliderControl
, 1,
5501 PyDoc_STR("(WindowPtr window, Rect boundsRect, SInt32 value, SInt32 minimum, SInt32 maximum, UInt16 orientation, UInt16 numTickMarks, Boolean liveTracking, PyObject* liveTrackingProc) -> (ControlHandle outControl)")},
5502 {"CreateDisclosureTriangleControl", (PyCFunction
)Ctl_CreateDisclosureTriangleControl
, 1,
5503 PyDoc_STR("(WindowPtr window, Rect boundsRect, UInt16 orientation, CFStringRef title, SInt32 initialValue, Boolean drawTitle, Boolean autoToggles) -> (ControlHandle outControl)")},
5504 {"CreateProgressBarControl", (PyCFunction
)Ctl_CreateProgressBarControl
, 1,
5505 PyDoc_STR("(WindowPtr window, Rect boundsRect, SInt32 value, SInt32 minimum, SInt32 maximum, Boolean indeterminate) -> (ControlHandle outControl)")},
5507 #if TARGET_API_MAC_OSX
5508 {"CreateRelevanceBarControl", (PyCFunction
)Ctl_CreateRelevanceBarControl
, 1,
5509 PyDoc_STR("(WindowPtr window, Rect boundsRect, SInt32 value, SInt32 minimum, SInt32 maximum) -> (ControlHandle outControl)")},
5511 {"CreateLittleArrowsControl", (PyCFunction
)Ctl_CreateLittleArrowsControl
, 1,
5512 PyDoc_STR("(WindowPtr window, Rect boundsRect, SInt32 value, SInt32 minimum, SInt32 maximum, SInt32 increment) -> (ControlHandle outControl)")},
5513 {"CreateChasingArrowsControl", (PyCFunction
)Ctl_CreateChasingArrowsControl
, 1,
5514 PyDoc_STR("(WindowPtr window, Rect boundsRect) -> (ControlHandle outControl)")},
5515 {"CreateSeparatorControl", (PyCFunction
)Ctl_CreateSeparatorControl
, 1,
5516 PyDoc_STR("(WindowPtr window, Rect boundsRect) -> (ControlHandle outControl)")},
5517 {"CreateGroupBoxControl", (PyCFunction
)Ctl_CreateGroupBoxControl
, 1,
5518 PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef title, Boolean primary) -> (ControlHandle outControl)")},
5519 {"CreateCheckGroupBoxControl", (PyCFunction
)Ctl_CreateCheckGroupBoxControl
, 1,
5520 PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef title, SInt32 initialValue, Boolean primary, Boolean autoToggle) -> (ControlHandle outControl)")},
5521 {"CreatePopupGroupBoxControl", (PyCFunction
)Ctl_CreatePopupGroupBoxControl
, 1,
5522 PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef title, Boolean primary, SInt16 menuID, Boolean variableWidth, SInt16 titleWidth, SInt16 titleJustification, Style titleStyle) -> (ControlHandle outControl)")},
5523 {"CreateImageWellControl", (PyCFunction
)Ctl_CreateImageWellControl
, 1,
5524 PyDoc_STR("(WindowPtr window, Rect boundsRect, ControlButtonContentInfo info) -> (ControlHandle outControl)")},
5525 {"CreatePopupArrowControl", (PyCFunction
)Ctl_CreatePopupArrowControl
, 1,
5526 PyDoc_STR("(WindowPtr window, Rect boundsRect, UInt16 orientation, UInt16 size) -> (ControlHandle outControl)")},
5527 {"CreatePlacardControl", (PyCFunction
)Ctl_CreatePlacardControl
, 1,
5528 PyDoc_STR("(WindowPtr window, Rect boundsRect) -> (ControlHandle outControl)")},
5529 {"CreateClockControl", (PyCFunction
)Ctl_CreateClockControl
, 1,
5530 PyDoc_STR("(WindowPtr window, Rect boundsRect, UInt16 clockType, UInt32 clockFlags) -> (ControlHandle outControl)")},
5531 {"CreateUserPaneControl", (PyCFunction
)Ctl_CreateUserPaneControl
, 1,
5532 PyDoc_STR("(WindowPtr window, Rect boundsRect, UInt32 features) -> (ControlHandle outControl)")},
5533 {"CreateEditTextControl", (PyCFunction
)Ctl_CreateEditTextControl
, 1,
5534 PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef text, Boolean isPassword, Boolean useInlineInput, ControlFontStyleRec style) -> (ControlHandle outControl)")},
5535 {"CreateStaticTextControl", (PyCFunction
)Ctl_CreateStaticTextControl
, 1,
5536 PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef text, ControlFontStyleRec style) -> (ControlHandle outControl)")},
5537 {"CreatePictureControl", (PyCFunction
)Ctl_CreatePictureControl
, 1,
5538 PyDoc_STR("(WindowPtr window, Rect boundsRect, ControlButtonContentInfo content, Boolean dontTrack) -> (ControlHandle outControl)")},
5539 {"CreateIconControl", (PyCFunction
)Ctl_CreateIconControl
, 1,
5540 PyDoc_STR("(WindowPtr window, Rect boundsRect, ControlButtonContentInfo icon, Boolean dontTrack) -> (ControlHandle outControl)")},
5541 {"CreateWindowHeaderControl", (PyCFunction
)Ctl_CreateWindowHeaderControl
, 1,
5542 PyDoc_STR("(WindowPtr window, Rect boundsRect, Boolean isListHeader) -> (ControlHandle outControl)")},
5543 {"CreatePushButtonControl", (PyCFunction
)Ctl_CreatePushButtonControl
, 1,
5544 PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef title) -> (ControlHandle outControl)")},
5545 {"CreatePushButtonWithIconControl", (PyCFunction
)Ctl_CreatePushButtonWithIconControl
, 1,
5546 PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef title, ControlButtonContentInfo icon, UInt16 iconAlignment) -> (ControlHandle outControl)")},
5547 {"CreateRadioButtonControl", (PyCFunction
)Ctl_CreateRadioButtonControl
, 1,
5548 PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef title, SInt32 initialValue, Boolean autoToggle) -> (ControlHandle outControl)")},
5549 {"CreateCheckBoxControl", (PyCFunction
)Ctl_CreateCheckBoxControl
, 1,
5550 PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef title, SInt32 initialValue, Boolean autoToggle) -> (ControlHandle outControl)")},
5551 {"CreateScrollBarControl", (PyCFunction
)Ctl_CreateScrollBarControl
, 1,
5552 PyDoc_STR("(WindowPtr window, Rect boundsRect, SInt32 value, SInt32 minimum, SInt32 maximum, SInt32 viewSize, Boolean liveTracking, PyObject* liveTrackingProc) -> (ControlHandle outControl)")},
5553 {"CreatePopupButtonControl", (PyCFunction
)Ctl_CreatePopupButtonControl
, 1,
5554 PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef title, SInt16 menuID, Boolean variableWidth, SInt16 titleWidth, SInt16 titleJustification, Style titleStyle) -> (ControlHandle outControl)")},
5555 {"CreateRadioGroupControl", (PyCFunction
)Ctl_CreateRadioGroupControl
, 1,
5556 PyDoc_STR("(WindowPtr window, Rect boundsRect) -> (ControlHandle outControl)")},
5557 {"CreateScrollingTextBoxControl", (PyCFunction
)Ctl_CreateScrollingTextBoxControl
, 1,
5558 PyDoc_STR("(WindowPtr window, Rect boundsRect, SInt16 contentResID, Boolean autoScroll, UInt32 delayBeforeAutoScroll, UInt32 delayBetweenAutoScroll, UInt16 autoScrollAmount) -> (ControlHandle outControl)")},
5560 #if TARGET_API_MAC_OSX
5561 {"CreateDisclosureButtonControl", (PyCFunction
)Ctl_CreateDisclosureButtonControl
, 1,
5562 PyDoc_STR("(WindowPtr inWindow, Rect inBoundsRect, SInt32 inValue, Boolean inAutoToggles) -> (ControlHandle outControl)")},
5565 #if TARGET_API_MAC_OSX
5566 {"CreateRoundButtonControl", (PyCFunction
)Ctl_CreateRoundButtonControl
, 1,
5567 PyDoc_STR("(WindowPtr inWindow, Rect inBoundsRect, SInt16 inSize, ControlButtonContentInfo inContent) -> (ControlHandle outControl)")},
5569 {"CreateDataBrowserControl", (PyCFunction
)Ctl_CreateDataBrowserControl
, 1,
5570 PyDoc_STR("(WindowPtr window, Rect boundsRect, OSType style) -> (ControlHandle outControl)")},
5572 #if TARGET_API_MAC_OSX
5573 {"CreateEditUnicodeTextControl", (PyCFunction
)Ctl_CreateEditUnicodeTextControl
, 1,
5574 PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef text, Boolean isPassword, ControlFontStyleRec style) -> (ControlHandle outControl)")},
5576 {"FindControlUnderMouse", (PyCFunction
)Ctl_FindControlUnderMouse
, 1,
5577 PyDoc_STR("(Point inWhere, WindowPtr inWindow) -> (ControlHandle _rv, SInt16 outPart)")},
5578 {"as_Control", (PyCFunction
)Ctl_as_Control
, 1,
5579 PyDoc_STR("(Handle h) -> (ControlHandle _rv)")},
5580 {"CreateTabsControl", (PyCFunction
)Ctl_CreateTabsControl
, 1,
5581 PyDoc_STR("(WindowPtr window, Rect boundsRect, UInt16 size, UInt16 direction, ControlTabEntry tabArray) -> (ControlHandle outControl)")},
5588 CtlObj_NewUnmanaged(ControlHandle itself
)
5591 if (itself
== NULL
) return PyMac_Error(resNotFound
);
5592 it
= PyObject_NEW(ControlObject
, &Control_Type
);
5593 if (it
== NULL
) return NULL
;
5594 it
->ob_itself
= itself
;
5595 it
->ob_callbackdict
= NULL
;
5596 return (PyObject
*)it
;
5600 CtlObj_WhichControl(ControlHandle c
)
5607 it
= (PyObject
*) GetControlReference(c
);
5609 ** If the refcon is zero or doesn't point back to the Python object
5610 ** the control is not ours. Return a temporary object.
5612 if (it
== NULL
|| ((ControlObject
*)it
)->ob_itself
!= c
)
5613 return CtlObj_NewUnmanaged(c
);
5620 settrackfunc(PyObject
*obj
)
5623 PyErr_SetString(Ctl_Error
, "Tracker function in use");
5634 Py_XDECREF(tracker
);
5639 mytracker(ControlHandle ctl
, short part
)
5641 PyObject
*args
, *rv
=0;
5643 args
= Py_BuildValue("(O&i)", CtlObj_WhichControl
, ctl
, (int)part
);
5644 if (args
&& tracker
) {
5645 rv
= PyEval_CallObject(tracker
, args
);
5651 PySys_WriteStderr("TrackControl or HandleControlClick: exception in tracker function\n");
5657 setcallback(PyObject
*myself
, OSType which
, PyObject
*callback
, UniversalProcPtr
*uppp
)
5659 ControlObject
*self
= (ControlObject
*)myself
;
5662 if ( which
== kMyControlActionProcTag
)
5663 *uppp
= (UniversalProcPtr
)myactionproc_upp
;
5664 else if ( which
== kControlUserPaneKeyDownProcTag
)
5665 *uppp
= (UniversalProcPtr
)mykeydownproc_upp
;
5666 else if ( which
== kControlUserPaneFocusProcTag
)
5667 *uppp
= (UniversalProcPtr
)myfocusproc_upp
;
5668 else if ( which
== kControlUserPaneDrawProcTag
)
5669 *uppp
= (UniversalProcPtr
)mydrawproc_upp
;
5670 else if ( which
== kControlUserPaneIdleProcTag
)
5671 *uppp
= (UniversalProcPtr
)myidleproc_upp
;
5672 else if ( which
== kControlUserPaneHitTestProcTag
)
5673 *uppp
= (UniversalProcPtr
)myhittestproc_upp
;
5674 else if ( which
== kControlUserPaneTrackingProcTag
)
5675 *uppp
= (UniversalProcPtr
)mytrackingproc_upp
;
5678 /* Only now do we test for clearing of the callback: */
5679 if ( callback
== Py_None
)
5681 /* Create the dict if it doesn't exist yet (so we don't get such a dict for every control) */
5682 if ( self
->ob_callbackdict
== NULL
)
5683 if ( (self
->ob_callbackdict
= PyDict_New()) == NULL
)
5685 /* And store the Python callback */
5686 sprintf(keybuf
, "%x", (unsigned)which
);
5687 if (PyDict_SetItemString(self
->ob_callbackdict
, keybuf
, callback
) < 0)
5693 callcallback(ControlObject
*self
, OSType which
, PyObject
*arglist
)
5696 PyObject
*func
, *rv
;
5698 sprintf(keybuf
, "%x", (unsigned)which
);
5699 if ( self
->ob_callbackdict
== NULL
||
5700 (func
= PyDict_GetItemString(self
->ob_callbackdict
, keybuf
)) == NULL
) {
5701 PySys_WriteStderr("Control callback %x without callback object\n", (unsigned)which
);
5704 rv
= PyEval_CallObject(func
, arglist
);
5706 PySys_WriteStderr("Exception in control callback %x handler\n", (unsigned)which
);
5713 myactionproc(ControlHandle control
, SInt16 part
)
5715 ControlObject
*ctl_obj
;
5716 PyObject
*arglist
, *rv
;
5718 ctl_obj
= (ControlObject
*)CtlObj_WhichControl(control
);
5719 arglist
= Py_BuildValue("Oh", ctl_obj
, part
);
5720 rv
= callcallback(ctl_obj
, kMyControlActionProcTag
, arglist
);
5721 Py_XDECREF(arglist
);
5725 static pascal ControlPartCode
5726 mykeydownproc(ControlHandle control
, SInt16 keyCode
, SInt16 charCode
, SInt16 modifiers
)
5728 ControlObject
*ctl_obj
;
5729 PyObject
*arglist
, *rv
;
5732 ctl_obj
= (ControlObject
*)CtlObj_WhichControl(control
);
5733 arglist
= Py_BuildValue("Ohhh", ctl_obj
, keyCode
, charCode
, modifiers
);
5734 rv
= callcallback(ctl_obj
, kControlUserPaneKeyDownProcTag
, arglist
);
5735 Py_XDECREF(arglist
);
5737 if (!PyArg_Parse(rv
, "h", &c_rv
))
5740 return (ControlPartCode
)c_rv
;
5743 static pascal ControlPartCode
5744 myfocusproc(ControlHandle control
, ControlPartCode part
)
5746 ControlObject
*ctl_obj
;
5747 PyObject
*arglist
, *rv
;
5748 short c_rv
= kControlFocusNoPart
;
5750 ctl_obj
= (ControlObject
*)CtlObj_WhichControl(control
);
5751 arglist
= Py_BuildValue("Oh", ctl_obj
, part
);
5752 rv
= callcallback(ctl_obj
, kControlUserPaneFocusProcTag
, arglist
);
5753 Py_XDECREF(arglist
);
5755 if (!PyArg_Parse(rv
, "h", &c_rv
))
5758 return (ControlPartCode
)c_rv
;
5762 mydrawproc(ControlHandle control
, SInt16 part
)
5764 ControlObject
*ctl_obj
;
5765 PyObject
*arglist
, *rv
;
5767 ctl_obj
= (ControlObject
*)CtlObj_WhichControl(control
);
5768 arglist
= Py_BuildValue("Oh", ctl_obj
, part
);
5769 rv
= callcallback(ctl_obj
, kControlUserPaneDrawProcTag
, arglist
);
5770 Py_XDECREF(arglist
);
5775 myidleproc(ControlHandle control
)
5777 ControlObject
*ctl_obj
;
5778 PyObject
*arglist
, *rv
;
5780 ctl_obj
= (ControlObject
*)CtlObj_WhichControl(control
);
5781 arglist
= Py_BuildValue("O", ctl_obj
);
5782 rv
= callcallback(ctl_obj
, kControlUserPaneIdleProcTag
, arglist
);
5783 Py_XDECREF(arglist
);
5787 static pascal ControlPartCode
5788 myhittestproc(ControlHandle control
, Point where
)
5790 ControlObject
*ctl_obj
;
5791 PyObject
*arglist
, *rv
;
5794 ctl_obj
= (ControlObject
*)CtlObj_WhichControl(control
);
5795 arglist
= Py_BuildValue("OO&", ctl_obj
, PyMac_BuildPoint
, where
);
5796 rv
= callcallback(ctl_obj
, kControlUserPaneHitTestProcTag
, arglist
);
5797 Py_XDECREF(arglist
);
5798 /* Ignore errors, nothing we can do about them */
5800 if (!PyArg_Parse(rv
, "h", &c_rv
))
5803 return (ControlPartCode
)c_rv
;
5806 static pascal ControlPartCode
5807 mytrackingproc(ControlHandle control
, Point startPt
, ControlActionUPP actionProc
)
5809 ControlObject
*ctl_obj
;
5810 PyObject
*arglist
, *rv
;
5813 ctl_obj
= (ControlObject
*)CtlObj_WhichControl(control
);
5814 /* We cannot pass the actionProc without lots of work */
5815 arglist
= Py_BuildValue("OO&", ctl_obj
, PyMac_BuildPoint
, startPt
);
5816 rv
= callcallback(ctl_obj
, kControlUserPaneTrackingProcTag
, arglist
);
5817 Py_XDECREF(arglist
);
5819 if (!PyArg_Parse(rv
, "h", &c_rv
))
5822 return (ControlPartCode
)c_rv
;
5833 mytracker_upp
= NewControlActionUPP(mytracker
);
5834 myactionproc_upp
= NewControlActionUPP(myactionproc
);
5835 mykeydownproc_upp
= NewControlUserPaneKeyDownUPP(mykeydownproc
);
5836 myfocusproc_upp
= NewControlUserPaneFocusUPP(myfocusproc
);
5837 mydrawproc_upp
= NewControlUserPaneDrawUPP(mydrawproc
);
5838 myidleproc_upp
= NewControlUserPaneIdleUPP(myidleproc
);
5839 myhittestproc_upp
= NewControlUserPaneHitTestUPP(myhittestproc
);
5840 mytrackingproc_upp
= NewControlUserPaneTrackingUPP(mytrackingproc
);
5841 PyMac_INIT_TOOLBOX_OBJECT_NEW(ControlHandle
, CtlObj_New
);
5842 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ControlHandle
, CtlObj_Convert
);
5845 m
= Py_InitModule("_Ctl", Ctl_methods
);
5846 d
= PyModule_GetDict(m
);
5847 Ctl_Error
= PyMac_GetOSErrException();
5848 if (Ctl_Error
== NULL
||
5849 PyDict_SetItemString(d
, "Error", Ctl_Error
) != 0)
5851 Control_Type
.ob_type
= &PyType_Type
;
5852 if (PyType_Ready(&Control_Type
) < 0) return;
5853 Py_INCREF(&Control_Type
);
5854 PyModule_AddObject(m
, "Control", (PyObject
*)&Control_Type
);
5855 /* Backward-compatible name */
5856 Py_INCREF(&Control_Type
);
5857 PyModule_AddObject(m
, "ControlType", (PyObject
*)&Control_Type
);
5860 /* ======================== End module _Ctl ========================= */