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