2001-08-23 11:02:09 -03:00
|
|
|
|
|
|
|
/* ========================== Module _App =========================== */
|
|
|
|
|
|
|
|
#include "Python.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "pymactoolbox.h"
|
|
|
|
|
|
|
|
/* Macro to test whether a weak-loaded CFM function exists */
|
|
|
|
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
|
2003-11-19 12:13:35 -04:00
|
|
|
PyErr_SetString(PyExc_NotImplementedError, \
|
|
|
|
"Not available in this shared library/OS version"); \
|
|
|
|
return NULL; \
|
2001-08-23 11:02:09 -03:00
|
|
|
}} while(0)
|
|
|
|
|
|
|
|
|
|
|
|
#include <Carbon/Carbon.h>
|
|
|
|
|
2002-01-06 19:03:39 -04:00
|
|
|
|
|
|
|
int ThemeButtonDrawInfo_Convert(PyObject *v, ThemeButtonDrawInfo *p_itself)
|
|
|
|
{
|
2005-07-03 17:59:44 -03:00
|
|
|
return PyArg_Parse(v, "(iHH)", &p_itself->state, &p_itself->value, &p_itself->adornment);
|
2002-01-06 19:03:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-08-23 11:02:09 -03:00
|
|
|
static PyObject *App_Error;
|
|
|
|
|
2002-01-05 19:37:19 -04:00
|
|
|
/* ----------------- Object type ThemeDrawingState ------------------ */
|
|
|
|
|
|
|
|
PyTypeObject ThemeDrawingState_Type;
|
|
|
|
|
2002-12-19 17:24:35 -04:00
|
|
|
#define ThemeDrawingStateObj_Check(x) ((x)->ob_type == &ThemeDrawingState_Type || PyObject_TypeCheck((x), &ThemeDrawingState_Type))
|
2002-01-05 19:37:19 -04:00
|
|
|
|
|
|
|
typedef struct ThemeDrawingStateObject {
|
|
|
|
PyObject_HEAD
|
|
|
|
ThemeDrawingState ob_itself;
|
|
|
|
} ThemeDrawingStateObject;
|
|
|
|
|
2002-01-05 19:44:33 -04:00
|
|
|
PyObject *ThemeDrawingStateObj_New(ThemeDrawingState itself)
|
2002-01-05 19:37:19 -04:00
|
|
|
{
|
|
|
|
ThemeDrawingStateObject *it;
|
|
|
|
it = PyObject_NEW(ThemeDrawingStateObject, &ThemeDrawingState_Type);
|
|
|
|
if (it == NULL) return NULL;
|
|
|
|
it->ob_itself = itself;
|
|
|
|
return (PyObject *)it;
|
|
|
|
}
|
2005-07-03 17:59:44 -03:00
|
|
|
|
2002-01-05 19:44:33 -04:00
|
|
|
int ThemeDrawingStateObj_Convert(PyObject *v, ThemeDrawingState *p_itself)
|
2002-01-05 19:37:19 -04:00
|
|
|
{
|
2002-01-05 19:44:33 -04:00
|
|
|
if (!ThemeDrawingStateObj_Check(v))
|
2002-01-05 19:37:19 -04:00
|
|
|
{
|
|
|
|
PyErr_SetString(PyExc_TypeError, "ThemeDrawingState required");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
*p_itself = ((ThemeDrawingStateObject *)v)->ob_itself;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2002-01-05 19:44:33 -04:00
|
|
|
static void ThemeDrawingStateObj_dealloc(ThemeDrawingStateObject *self)
|
2002-01-05 19:37:19 -04:00
|
|
|
{
|
|
|
|
/* Cleanup of self->ob_itself goes here */
|
2002-12-23 19:16:25 -04:00
|
|
|
self->ob_type->tp_free((PyObject *)self);
|
2002-01-05 19:37:19 -04:00
|
|
|
}
|
|
|
|
|
2002-01-05 19:44:33 -04:00
|
|
|
static PyObject *ThemeDrawingStateObj_SetThemeDrawingState(ThemeDrawingStateObject *_self, PyObject *_args)
|
2002-01-05 19:37:19 -04:00
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _rv;
|
|
|
|
Boolean inDisposeNow;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef SetThemeDrawingState
|
|
|
|
PyMac_PRECHECK(SetThemeDrawingState);
|
|
|
|
#endif
|
2002-01-05 19:37:19 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, "b",
|
|
|
|
&inDisposeNow))
|
|
|
|
return NULL;
|
|
|
|
_rv = SetThemeDrawingState(_self->ob_itself,
|
|
|
|
inDisposeNow);
|
|
|
|
_res = Py_BuildValue("l",
|
|
|
|
_rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2002-01-05 19:44:33 -04:00
|
|
|
static PyObject *ThemeDrawingStateObj_DisposeThemeDrawingState(ThemeDrawingStateObject *_self, PyObject *_args)
|
2002-01-05 19:37:19 -04:00
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _rv;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DisposeThemeDrawingState
|
|
|
|
PyMac_PRECHECK(DisposeThemeDrawingState);
|
|
|
|
#endif
|
2002-01-05 19:37:19 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_rv = DisposeThemeDrawingState(_self->ob_itself);
|
|
|
|
_res = Py_BuildValue("l",
|
|
|
|
_rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2002-01-05 19:44:33 -04:00
|
|
|
static PyMethodDef ThemeDrawingStateObj_methods[] = {
|
|
|
|
{"SetThemeDrawingState", (PyCFunction)ThemeDrawingStateObj_SetThemeDrawingState, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Boolean inDisposeNow) -> (OSStatus _rv)")},
|
2002-01-05 19:44:33 -04:00
|
|
|
{"DisposeThemeDrawingState", (PyCFunction)ThemeDrawingStateObj_DisposeThemeDrawingState, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("() -> (OSStatus _rv)")},
|
2002-01-05 19:37:19 -04:00
|
|
|
{NULL, NULL, 0}
|
|
|
|
};
|
|
|
|
|
2002-11-29 19:40:48 -04:00
|
|
|
#define ThemeDrawingStateObj_getsetlist NULL
|
2002-01-05 19:37:19 -04:00
|
|
|
|
2002-12-03 19:40:22 -04:00
|
|
|
|
2002-01-05 19:44:33 -04:00
|
|
|
#define ThemeDrawingStateObj_compare NULL
|
2002-01-05 19:37:19 -04:00
|
|
|
|
2002-01-05 19:44:33 -04:00
|
|
|
#define ThemeDrawingStateObj_repr NULL
|
2002-01-05 19:37:19 -04:00
|
|
|
|
2002-01-05 19:44:33 -04:00
|
|
|
#define ThemeDrawingStateObj_hash NULL
|
2002-12-03 19:40:22 -04:00
|
|
|
#define ThemeDrawingStateObj_tp_init 0
|
|
|
|
|
|
|
|
#define ThemeDrawingStateObj_tp_alloc PyType_GenericAlloc
|
|
|
|
|
2005-07-03 17:59:44 -03:00
|
|
|
static PyObject *ThemeDrawingStateObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
|
2002-12-03 19:40:22 -04:00
|
|
|
{
|
2005-07-03 17:59:44 -03:00
|
|
|
PyObject *_self;
|
2002-12-03 19:40:22 -04:00
|
|
|
ThemeDrawingState itself;
|
|
|
|
char *kw[] = {"itself", 0};
|
|
|
|
|
2005-07-03 17:59:44 -03:00
|
|
|
if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, ThemeDrawingStateObj_Convert, &itself)) return NULL;
|
|
|
|
if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;
|
|
|
|
((ThemeDrawingStateObject *)_self)->ob_itself = itself;
|
|
|
|
return _self;
|
2002-12-03 19:40:22 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
#define ThemeDrawingStateObj_tp_free PyObject_Del
|
|
|
|
|
2002-01-05 19:37:19 -04:00
|
|
|
|
|
|
|
PyTypeObject ThemeDrawingState_Type = {
|
|
|
|
PyObject_HEAD_INIT(NULL)
|
|
|
|
0, /*ob_size*/
|
|
|
|
"_App.ThemeDrawingState", /*tp_name*/
|
|
|
|
sizeof(ThemeDrawingStateObject), /*tp_basicsize*/
|
|
|
|
0, /*tp_itemsize*/
|
|
|
|
/* methods */
|
2002-01-05 19:44:33 -04:00
|
|
|
(destructor) ThemeDrawingStateObj_dealloc, /*tp_dealloc*/
|
2002-01-05 19:37:19 -04:00
|
|
|
0, /*tp_print*/
|
2002-11-29 19:40:48 -04:00
|
|
|
(getattrfunc)0, /*tp_getattr*/
|
|
|
|
(setattrfunc)0, /*tp_setattr*/
|
2002-01-05 19:44:33 -04:00
|
|
|
(cmpfunc) ThemeDrawingStateObj_compare, /*tp_compare*/
|
|
|
|
(reprfunc) ThemeDrawingStateObj_repr, /*tp_repr*/
|
2002-01-05 19:37:19 -04:00
|
|
|
(PyNumberMethods *)0, /* tp_as_number */
|
|
|
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
|
|
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
2002-01-05 19:44:33 -04:00
|
|
|
(hashfunc) ThemeDrawingStateObj_hash, /*tp_hash*/
|
2002-11-29 19:40:48 -04:00
|
|
|
0, /*tp_call*/
|
|
|
|
0, /*tp_str*/
|
|
|
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
|
|
|
PyObject_GenericSetAttr, /*tp_setattro */
|
2002-12-03 19:40:22 -04:00
|
|
|
0, /*tp_as_buffer*/
|
|
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
|
|
|
|
0, /*tp_doc*/
|
|
|
|
0, /*tp_traverse*/
|
|
|
|
0, /*tp_clear*/
|
|
|
|
0, /*tp_richcompare*/
|
|
|
|
0, /*tp_weaklistoffset*/
|
|
|
|
0, /*tp_iter*/
|
|
|
|
0, /*tp_iternext*/
|
2002-11-29 19:40:48 -04:00
|
|
|
ThemeDrawingStateObj_methods, /* tp_methods */
|
2002-12-03 19:40:22 -04:00
|
|
|
0, /*tp_members*/
|
2002-11-29 19:40:48 -04:00
|
|
|
ThemeDrawingStateObj_getsetlist, /*tp_getset*/
|
2002-12-03 19:40:22 -04:00
|
|
|
0, /*tp_base*/
|
|
|
|
0, /*tp_dict*/
|
|
|
|
0, /*tp_descr_get*/
|
|
|
|
0, /*tp_descr_set*/
|
|
|
|
0, /*tp_dictoffset*/
|
|
|
|
ThemeDrawingStateObj_tp_init, /* tp_init */
|
|
|
|
ThemeDrawingStateObj_tp_alloc, /* tp_alloc */
|
|
|
|
ThemeDrawingStateObj_tp_new, /* tp_new */
|
|
|
|
ThemeDrawingStateObj_tp_free, /* tp_free */
|
2002-01-05 19:37:19 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
/* --------------- End object type ThemeDrawingState ---------------- */
|
|
|
|
|
|
|
|
|
2001-08-23 11:02:09 -03:00
|
|
|
static PyObject *App_RegisterAppearanceClient(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef RegisterAppearanceClient
|
|
|
|
PyMac_PRECHECK(RegisterAppearanceClient);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = RegisterAppearanceClient();
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_UnregisterAppearanceClient(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef UnregisterAppearanceClient
|
|
|
|
PyMac_PRECHECK(UnregisterAppearanceClient);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = UnregisterAppearanceClient();
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_SetThemePen(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
ThemeBrush inBrush;
|
|
|
|
SInt16 inDepth;
|
|
|
|
Boolean inIsColorDevice;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef SetThemePen
|
|
|
|
PyMac_PRECHECK(SetThemePen);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "hhb",
|
|
|
|
&inBrush,
|
|
|
|
&inDepth,
|
|
|
|
&inIsColorDevice))
|
|
|
|
return NULL;
|
|
|
|
_err = SetThemePen(inBrush,
|
|
|
|
inDepth,
|
|
|
|
inIsColorDevice);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_SetThemeBackground(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
ThemeBrush inBrush;
|
|
|
|
SInt16 inDepth;
|
|
|
|
Boolean inIsColorDevice;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef SetThemeBackground
|
|
|
|
PyMac_PRECHECK(SetThemeBackground);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "hhb",
|
|
|
|
&inBrush,
|
|
|
|
&inDepth,
|
|
|
|
&inIsColorDevice))
|
|
|
|
return NULL;
|
|
|
|
_err = SetThemeBackground(inBrush,
|
|
|
|
inDepth,
|
|
|
|
inIsColorDevice);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_SetThemeTextColor(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
ThemeTextColor inColor;
|
|
|
|
SInt16 inDepth;
|
|
|
|
Boolean inIsColorDevice;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef SetThemeTextColor
|
|
|
|
PyMac_PRECHECK(SetThemeTextColor);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "hhb",
|
|
|
|
&inColor,
|
|
|
|
&inDepth,
|
|
|
|
&inIsColorDevice))
|
|
|
|
return NULL;
|
|
|
|
_err = SetThemeTextColor(inColor,
|
|
|
|
inDepth,
|
|
|
|
inIsColorDevice);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_SetThemeWindowBackground(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
WindowPtr inWindow;
|
|
|
|
ThemeBrush inBrush;
|
|
|
|
Boolean inUpdate;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef SetThemeWindowBackground
|
|
|
|
PyMac_PRECHECK(SetThemeWindowBackground);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&hb",
|
|
|
|
WinObj_Convert, &inWindow,
|
|
|
|
&inBrush,
|
|
|
|
&inUpdate))
|
|
|
|
return NULL;
|
|
|
|
_err = SetThemeWindowBackground(inWindow,
|
|
|
|
inBrush,
|
|
|
|
inUpdate);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_DrawThemeWindowHeader(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect inRect;
|
|
|
|
ThemeDrawState inState;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemeWindowHeader
|
|
|
|
PyMac_PRECHECK(DrawThemeWindowHeader);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&l",
|
|
|
|
PyMac_GetRect, &inRect,
|
|
|
|
&inState))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemeWindowHeader(&inRect,
|
|
|
|
inState);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_DrawThemeWindowListViewHeader(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect inRect;
|
|
|
|
ThemeDrawState inState;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemeWindowListViewHeader
|
|
|
|
PyMac_PRECHECK(DrawThemeWindowListViewHeader);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&l",
|
|
|
|
PyMac_GetRect, &inRect,
|
|
|
|
&inState))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemeWindowListViewHeader(&inRect,
|
|
|
|
inState);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_DrawThemePlacard(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect inRect;
|
|
|
|
ThemeDrawState inState;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemePlacard
|
|
|
|
PyMac_PRECHECK(DrawThemePlacard);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&l",
|
|
|
|
PyMac_GetRect, &inRect,
|
|
|
|
&inState))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemePlacard(&inRect,
|
|
|
|
inState);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_DrawThemeEditTextFrame(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect inRect;
|
|
|
|
ThemeDrawState inState;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemeEditTextFrame
|
|
|
|
PyMac_PRECHECK(DrawThemeEditTextFrame);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&l",
|
|
|
|
PyMac_GetRect, &inRect,
|
|
|
|
&inState))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemeEditTextFrame(&inRect,
|
|
|
|
inState);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_DrawThemeListBoxFrame(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect inRect;
|
|
|
|
ThemeDrawState inState;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemeListBoxFrame
|
|
|
|
PyMac_PRECHECK(DrawThemeListBoxFrame);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&l",
|
|
|
|
PyMac_GetRect, &inRect,
|
|
|
|
&inState))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemeListBoxFrame(&inRect,
|
|
|
|
inState);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_DrawThemeFocusRect(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect inRect;
|
|
|
|
Boolean inHasFocus;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemeFocusRect
|
|
|
|
PyMac_PRECHECK(DrawThemeFocusRect);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&b",
|
|
|
|
PyMac_GetRect, &inRect,
|
|
|
|
&inHasFocus))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemeFocusRect(&inRect,
|
|
|
|
inHasFocus);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_DrawThemePrimaryGroup(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect inRect;
|
|
|
|
ThemeDrawState inState;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemePrimaryGroup
|
|
|
|
PyMac_PRECHECK(DrawThemePrimaryGroup);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&l",
|
|
|
|
PyMac_GetRect, &inRect,
|
|
|
|
&inState))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemePrimaryGroup(&inRect,
|
|
|
|
inState);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_DrawThemeSecondaryGroup(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect inRect;
|
|
|
|
ThemeDrawState inState;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemeSecondaryGroup
|
|
|
|
PyMac_PRECHECK(DrawThemeSecondaryGroup);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&l",
|
|
|
|
PyMac_GetRect, &inRect,
|
|
|
|
&inState))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemeSecondaryGroup(&inRect,
|
|
|
|
inState);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_DrawThemeSeparator(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect inRect;
|
|
|
|
ThemeDrawState inState;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemeSeparator
|
|
|
|
PyMac_PRECHECK(DrawThemeSeparator);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&l",
|
|
|
|
PyMac_GetRect, &inRect,
|
|
|
|
&inState))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemeSeparator(&inRect,
|
|
|
|
inState);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_DrawThemeModelessDialogFrame(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect inRect;
|
|
|
|
ThemeDrawState inState;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemeModelessDialogFrame
|
|
|
|
PyMac_PRECHECK(DrawThemeModelessDialogFrame);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&l",
|
|
|
|
PyMac_GetRect, &inRect,
|
|
|
|
&inState))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemeModelessDialogFrame(&inRect,
|
|
|
|
inState);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_DrawThemeGenericWell(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect inRect;
|
|
|
|
ThemeDrawState inState;
|
|
|
|
Boolean inFillCenter;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemeGenericWell
|
|
|
|
PyMac_PRECHECK(DrawThemeGenericWell);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&lb",
|
|
|
|
PyMac_GetRect, &inRect,
|
|
|
|
&inState,
|
|
|
|
&inFillCenter))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemeGenericWell(&inRect,
|
|
|
|
inState,
|
|
|
|
inFillCenter);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_DrawThemeFocusRegion(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Boolean inHasFocus;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemeFocusRegion
|
|
|
|
PyMac_PRECHECK(DrawThemeFocusRegion);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "b",
|
|
|
|
&inHasFocus))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemeFocusRegion((RgnHandle)0,
|
|
|
|
inHasFocus);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_IsThemeInColor(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
Boolean _rv;
|
|
|
|
SInt16 inDepth;
|
|
|
|
Boolean inIsColorDevice;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef IsThemeInColor
|
|
|
|
PyMac_PRECHECK(IsThemeInColor);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "hb",
|
|
|
|
&inDepth,
|
|
|
|
&inIsColorDevice))
|
|
|
|
return NULL;
|
|
|
|
_rv = IsThemeInColor(inDepth,
|
|
|
|
inIsColorDevice);
|
|
|
|
_res = Py_BuildValue("b",
|
|
|
|
_rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_GetThemeAccentColors(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
CTabHandle outColors;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef GetThemeAccentColors
|
|
|
|
PyMac_PRECHECK(GetThemeAccentColors);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = GetThemeAccentColors(&outColors);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
ResObj_New, outColors);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_DrawThemeMenuBarBackground(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect inBounds;
|
|
|
|
ThemeMenuBarState inState;
|
|
|
|
UInt32 inAttributes;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemeMenuBarBackground
|
|
|
|
PyMac_PRECHECK(DrawThemeMenuBarBackground);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&Hl",
|
|
|
|
PyMac_GetRect, &inBounds,
|
|
|
|
&inState,
|
|
|
|
&inAttributes))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemeMenuBarBackground(&inBounds,
|
|
|
|
inState,
|
|
|
|
inAttributes);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_GetThemeMenuBarHeight(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
SInt16 outHeight;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef GetThemeMenuBarHeight
|
|
|
|
PyMac_PRECHECK(GetThemeMenuBarHeight);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = GetThemeMenuBarHeight(&outHeight);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("h",
|
|
|
|
outHeight);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_DrawThemeMenuBackground(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect inMenuRect;
|
|
|
|
ThemeMenuType inMenuType;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemeMenuBackground
|
|
|
|
PyMac_PRECHECK(DrawThemeMenuBackground);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&H",
|
|
|
|
PyMac_GetRect, &inMenuRect,
|
|
|
|
&inMenuType))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemeMenuBackground(&inMenuRect,
|
|
|
|
inMenuType);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_GetThemeMenuBackgroundRegion(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect inMenuRect;
|
|
|
|
ThemeMenuType menuType;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef GetThemeMenuBackgroundRegion
|
|
|
|
PyMac_PRECHECK(GetThemeMenuBackgroundRegion);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&H",
|
|
|
|
PyMac_GetRect, &inMenuRect,
|
|
|
|
&menuType))
|
|
|
|
return NULL;
|
|
|
|
_err = GetThemeMenuBackgroundRegion(&inMenuRect,
|
|
|
|
menuType,
|
|
|
|
(RgnHandle)0);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_DrawThemeMenuSeparator(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect inItemRect;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemeMenuSeparator
|
|
|
|
PyMac_PRECHECK(DrawThemeMenuSeparator);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
PyMac_GetRect, &inItemRect))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemeMenuSeparator(&inItemRect);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_GetThemeMenuSeparatorHeight(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
SInt16 outHeight;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef GetThemeMenuSeparatorHeight
|
|
|
|
PyMac_PRECHECK(GetThemeMenuSeparatorHeight);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = GetThemeMenuSeparatorHeight(&outHeight);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("h",
|
|
|
|
outHeight);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_GetThemeMenuItemExtra(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
ThemeMenuItemType inItemType;
|
|
|
|
SInt16 outHeight;
|
|
|
|
SInt16 outWidth;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef GetThemeMenuItemExtra
|
|
|
|
PyMac_PRECHECK(GetThemeMenuItemExtra);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "H",
|
|
|
|
&inItemType))
|
|
|
|
return NULL;
|
|
|
|
_err = GetThemeMenuItemExtra(inItemType,
|
|
|
|
&outHeight,
|
|
|
|
&outWidth);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("hh",
|
|
|
|
outHeight,
|
|
|
|
outWidth);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_GetThemeMenuTitleExtra(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
SInt16 outWidth;
|
|
|
|
Boolean inIsSquished;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef GetThemeMenuTitleExtra
|
|
|
|
PyMac_PRECHECK(GetThemeMenuTitleExtra);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "b",
|
|
|
|
&inIsSquished))
|
|
|
|
return NULL;
|
|
|
|
_err = GetThemeMenuTitleExtra(&outWidth,
|
|
|
|
inIsSquished);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("h",
|
|
|
|
outWidth);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_DrawThemeTabPane(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect inRect;
|
|
|
|
ThemeDrawState inState;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemeTabPane
|
|
|
|
PyMac_PRECHECK(DrawThemeTabPane);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&l",
|
|
|
|
PyMac_GetRect, &inRect,
|
|
|
|
&inState))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemeTabPane(&inRect,
|
|
|
|
inState);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_GetThemeTabRegion(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect inRect;
|
|
|
|
ThemeTabStyle inStyle;
|
|
|
|
ThemeTabDirection inDirection;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef GetThemeTabRegion
|
|
|
|
PyMac_PRECHECK(GetThemeTabRegion);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&HH",
|
|
|
|
PyMac_GetRect, &inRect,
|
|
|
|
&inStyle,
|
|
|
|
&inDirection))
|
|
|
|
return NULL;
|
|
|
|
_err = GetThemeTabRegion(&inRect,
|
|
|
|
inStyle,
|
|
|
|
inDirection,
|
|
|
|
(RgnHandle)0);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_SetThemeCursor(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
ThemeCursor inCursor;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef SetThemeCursor
|
|
|
|
PyMac_PRECHECK(SetThemeCursor);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "l",
|
|
|
|
&inCursor))
|
|
|
|
return NULL;
|
|
|
|
_err = SetThemeCursor(inCursor);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_SetAnimatedThemeCursor(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
ThemeCursor inCursor;
|
|
|
|
UInt32 inAnimationStep;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef SetAnimatedThemeCursor
|
|
|
|
PyMac_PRECHECK(SetAnimatedThemeCursor);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "ll",
|
|
|
|
&inCursor,
|
|
|
|
&inAnimationStep))
|
|
|
|
return NULL;
|
|
|
|
_err = SetAnimatedThemeCursor(inCursor,
|
|
|
|
inAnimationStep);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_GetThemeScrollBarThumbStyle(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
ThemeScrollBarThumbStyle outStyle;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef GetThemeScrollBarThumbStyle
|
|
|
|
PyMac_PRECHECK(GetThemeScrollBarThumbStyle);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = GetThemeScrollBarThumbStyle(&outStyle);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("H",
|
|
|
|
outStyle);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_GetThemeScrollBarArrowStyle(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
ThemeScrollBarArrowStyle outStyle;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef GetThemeScrollBarArrowStyle
|
|
|
|
PyMac_PRECHECK(GetThemeScrollBarArrowStyle);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = GetThemeScrollBarArrowStyle(&outStyle);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("H",
|
|
|
|
outStyle);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_GetThemeCheckBoxStyle(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
ThemeCheckBoxStyle outStyle;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef GetThemeCheckBoxStyle
|
|
|
|
PyMac_PRECHECK(GetThemeCheckBoxStyle);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = GetThemeCheckBoxStyle(&outStyle);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("H",
|
|
|
|
outStyle);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_UseThemeFont(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
ThemeFontID inFontID;
|
|
|
|
ScriptCode inScript;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef UseThemeFont
|
|
|
|
PyMac_PRECHECK(UseThemeFont);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "Hh",
|
|
|
|
&inFontID,
|
|
|
|
&inScript))
|
|
|
|
return NULL;
|
|
|
|
_err = UseThemeFont(inFontID,
|
|
|
|
inScript);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2002-01-02 11:11:44 -04:00
|
|
|
static PyObject *App_DrawThemeTextBox(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
CFStringRef inString;
|
|
|
|
ThemeFontID inFontID;
|
|
|
|
ThemeDrawState inState;
|
|
|
|
Boolean inWrapToWidth;
|
|
|
|
Rect inBoundingBox;
|
|
|
|
SInt16 inJust;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemeTextBox
|
|
|
|
PyMac_PRECHECK(DrawThemeTextBox);
|
|
|
|
#endif
|
2002-01-02 11:11:44 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&HlbO&h",
|
|
|
|
CFStringRefObj_Convert, &inString,
|
|
|
|
&inFontID,
|
|
|
|
&inState,
|
|
|
|
&inWrapToWidth,
|
|
|
|
PyMac_GetRect, &inBoundingBox,
|
|
|
|
&inJust))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemeTextBox(inString,
|
|
|
|
inFontID,
|
|
|
|
inState,
|
|
|
|
inWrapToWidth,
|
|
|
|
&inBoundingBox,
|
|
|
|
inJust,
|
|
|
|
NULL);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2001-12-16 16:18:40 -04:00
|
|
|
static PyObject *App_TruncateThemeText(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
CFMutableStringRef inString;
|
|
|
|
ThemeFontID inFontID;
|
|
|
|
ThemeDrawState inState;
|
|
|
|
SInt16 inPixelWidthLimit;
|
|
|
|
TruncCode inTruncWhere;
|
|
|
|
Boolean outTruncated;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef TruncateThemeText
|
|
|
|
PyMac_PRECHECK(TruncateThemeText);
|
|
|
|
#endif
|
2001-12-16 16:18:40 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&Hlhh",
|
|
|
|
CFMutableStringRefObj_Convert, &inString,
|
|
|
|
&inFontID,
|
|
|
|
&inState,
|
|
|
|
&inPixelWidthLimit,
|
|
|
|
&inTruncWhere))
|
|
|
|
return NULL;
|
|
|
|
_err = TruncateThemeText(inString,
|
|
|
|
inFontID,
|
|
|
|
inState,
|
|
|
|
inPixelWidthLimit,
|
|
|
|
inTruncWhere,
|
|
|
|
&outTruncated);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("b",
|
|
|
|
outTruncated);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_GetThemeTextDimensions(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
CFStringRef inString;
|
|
|
|
ThemeFontID inFontID;
|
|
|
|
ThemeDrawState inState;
|
|
|
|
Boolean inWrapToWidth;
|
|
|
|
Point ioBounds;
|
|
|
|
SInt16 outBaseline;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef GetThemeTextDimensions
|
|
|
|
PyMac_PRECHECK(GetThemeTextDimensions);
|
|
|
|
#endif
|
2002-01-02 11:11:44 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&HlbO&",
|
2001-12-16 16:18:40 -04:00
|
|
|
CFStringRefObj_Convert, &inString,
|
|
|
|
&inFontID,
|
|
|
|
&inState,
|
2002-01-02 11:11:44 -04:00
|
|
|
&inWrapToWidth,
|
|
|
|
PyMac_GetPoint, &ioBounds))
|
2001-12-16 16:18:40 -04:00
|
|
|
return NULL;
|
|
|
|
_err = GetThemeTextDimensions(inString,
|
|
|
|
inFontID,
|
|
|
|
inState,
|
|
|
|
inWrapToWidth,
|
|
|
|
&ioBounds,
|
|
|
|
&outBaseline);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("O&h",
|
|
|
|
PyMac_BuildPoint, ioBounds,
|
|
|
|
outBaseline);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_GetThemeTextShadowOutset(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
ThemeFontID inFontID;
|
|
|
|
ThemeDrawState inState;
|
|
|
|
Rect outOutset;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef GetThemeTextShadowOutset
|
|
|
|
PyMac_PRECHECK(GetThemeTextShadowOutset);
|
|
|
|
#endif
|
2001-12-16 16:18:40 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, "Hl",
|
|
|
|
&inFontID,
|
|
|
|
&inState))
|
|
|
|
return NULL;
|
|
|
|
_err = GetThemeTextShadowOutset(inFontID,
|
|
|
|
inState,
|
|
|
|
&outOutset);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
PyMac_BuildRect, &outOutset);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2001-08-23 11:02:09 -03:00
|
|
|
static PyObject *App_DrawThemeScrollBarArrows(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect bounds;
|
|
|
|
ThemeTrackEnableState enableState;
|
|
|
|
ThemeTrackPressState pressState;
|
|
|
|
Boolean isHoriz;
|
|
|
|
Rect trackBounds;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemeScrollBarArrows
|
|
|
|
PyMac_PRECHECK(DrawThemeScrollBarArrows);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&bbb",
|
|
|
|
PyMac_GetRect, &bounds,
|
|
|
|
&enableState,
|
|
|
|
&pressState,
|
|
|
|
&isHoriz))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemeScrollBarArrows(&bounds,
|
|
|
|
enableState,
|
|
|
|
pressState,
|
|
|
|
isHoriz,
|
|
|
|
&trackBounds);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
PyMac_BuildRect, &trackBounds);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_GetThemeScrollBarTrackRect(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect bounds;
|
|
|
|
ThemeTrackEnableState enableState;
|
|
|
|
ThemeTrackPressState pressState;
|
|
|
|
Boolean isHoriz;
|
|
|
|
Rect trackBounds;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef GetThemeScrollBarTrackRect
|
|
|
|
PyMac_PRECHECK(GetThemeScrollBarTrackRect);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&bbb",
|
|
|
|
PyMac_GetRect, &bounds,
|
|
|
|
&enableState,
|
|
|
|
&pressState,
|
|
|
|
&isHoriz))
|
|
|
|
return NULL;
|
|
|
|
_err = GetThemeScrollBarTrackRect(&bounds,
|
|
|
|
enableState,
|
|
|
|
pressState,
|
|
|
|
isHoriz,
|
|
|
|
&trackBounds);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
PyMac_BuildRect, &trackBounds);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_HitTestThemeScrollBarArrows(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
Boolean _rv;
|
|
|
|
Rect scrollBarBounds;
|
|
|
|
ThemeTrackEnableState enableState;
|
|
|
|
ThemeTrackPressState pressState;
|
|
|
|
Boolean isHoriz;
|
|
|
|
Point ptHit;
|
|
|
|
Rect trackBounds;
|
|
|
|
ControlPartCode partcode;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef HitTestThemeScrollBarArrows
|
|
|
|
PyMac_PRECHECK(HitTestThemeScrollBarArrows);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&bbbO&",
|
|
|
|
PyMac_GetRect, &scrollBarBounds,
|
|
|
|
&enableState,
|
|
|
|
&pressState,
|
|
|
|
&isHoriz,
|
|
|
|
PyMac_GetPoint, &ptHit))
|
|
|
|
return NULL;
|
|
|
|
_rv = HitTestThemeScrollBarArrows(&scrollBarBounds,
|
|
|
|
enableState,
|
|
|
|
pressState,
|
|
|
|
isHoriz,
|
|
|
|
ptHit,
|
|
|
|
&trackBounds,
|
|
|
|
&partcode);
|
|
|
|
_res = Py_BuildValue("bO&h",
|
|
|
|
_rv,
|
|
|
|
PyMac_BuildRect, &trackBounds,
|
|
|
|
partcode);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_DrawThemeScrollBarDelimiters(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
ThemeWindowType flavor;
|
|
|
|
Rect inContRect;
|
|
|
|
ThemeDrawState state;
|
|
|
|
ThemeWindowAttributes attributes;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemeScrollBarDelimiters
|
|
|
|
PyMac_PRECHECK(DrawThemeScrollBarDelimiters);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "HO&ll",
|
|
|
|
&flavor,
|
|
|
|
PyMac_GetRect, &inContRect,
|
|
|
|
&state,
|
|
|
|
&attributes))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemeScrollBarDelimiters(flavor,
|
|
|
|
&inContRect,
|
|
|
|
state,
|
|
|
|
attributes);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2002-01-06 19:03:39 -04:00
|
|
|
static PyObject *App_DrawThemeButton(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect inBounds;
|
|
|
|
UInt16 inKind;
|
|
|
|
ThemeButtonDrawInfo inNewInfo;
|
|
|
|
ThemeButtonDrawInfo inPrevInfo;
|
|
|
|
UInt32 inUserData;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemeButton
|
|
|
|
PyMac_PRECHECK(DrawThemeButton);
|
|
|
|
#endif
|
2002-01-06 19:03:39 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&HO&O&l",
|
|
|
|
PyMac_GetRect, &inBounds,
|
|
|
|
&inKind,
|
|
|
|
ThemeButtonDrawInfo_Convert, &inNewInfo,
|
|
|
|
ThemeButtonDrawInfo_Convert, &inPrevInfo,
|
|
|
|
&inUserData))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemeButton(&inBounds,
|
|
|
|
inKind,
|
|
|
|
&inNewInfo,
|
|
|
|
&inPrevInfo,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
inUserData);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_GetThemeButtonRegion(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect inBounds;
|
|
|
|
UInt16 inKind;
|
|
|
|
ThemeButtonDrawInfo inNewInfo;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef GetThemeButtonRegion
|
|
|
|
PyMac_PRECHECK(GetThemeButtonRegion);
|
|
|
|
#endif
|
2002-01-06 19:03:39 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&HO&",
|
|
|
|
PyMac_GetRect, &inBounds,
|
|
|
|
&inKind,
|
|
|
|
ThemeButtonDrawInfo_Convert, &inNewInfo))
|
|
|
|
return NULL;
|
|
|
|
_err = GetThemeButtonRegion(&inBounds,
|
|
|
|
inKind,
|
|
|
|
&inNewInfo,
|
|
|
|
(RgnHandle)0);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_GetThemeButtonContentBounds(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect inBounds;
|
|
|
|
UInt16 inKind;
|
|
|
|
ThemeButtonDrawInfo inDrawInfo;
|
|
|
|
Rect outBounds;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef GetThemeButtonContentBounds
|
|
|
|
PyMac_PRECHECK(GetThemeButtonContentBounds);
|
|
|
|
#endif
|
2002-01-06 19:03:39 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&HO&",
|
|
|
|
PyMac_GetRect, &inBounds,
|
|
|
|
&inKind,
|
|
|
|
ThemeButtonDrawInfo_Convert, &inDrawInfo))
|
|
|
|
return NULL;
|
|
|
|
_err = GetThemeButtonContentBounds(&inBounds,
|
|
|
|
inKind,
|
|
|
|
&inDrawInfo,
|
|
|
|
&outBounds);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
PyMac_BuildRect, &outBounds);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_GetThemeButtonBackgroundBounds(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect inBounds;
|
|
|
|
UInt16 inKind;
|
|
|
|
ThemeButtonDrawInfo inDrawInfo;
|
|
|
|
Rect outBounds;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef GetThemeButtonBackgroundBounds
|
|
|
|
PyMac_PRECHECK(GetThemeButtonBackgroundBounds);
|
|
|
|
#endif
|
2002-01-06 19:03:39 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&HO&",
|
|
|
|
PyMac_GetRect, &inBounds,
|
|
|
|
&inKind,
|
|
|
|
ThemeButtonDrawInfo_Convert, &inDrawInfo))
|
|
|
|
return NULL;
|
|
|
|
_err = GetThemeButtonBackgroundBounds(&inBounds,
|
|
|
|
inKind,
|
|
|
|
&inDrawInfo,
|
|
|
|
&outBounds);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
PyMac_BuildRect, &outBounds);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2001-08-23 11:02:09 -03:00
|
|
|
static PyObject *App_PlayThemeSound(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
ThemeSoundKind kind;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef PlayThemeSound
|
|
|
|
PyMac_PRECHECK(PlayThemeSound);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
PyMac_GetOSType, &kind))
|
|
|
|
return NULL;
|
|
|
|
_err = PlayThemeSound(kind);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_BeginThemeDragSound(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
ThemeDragSoundKind kind;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef BeginThemeDragSound
|
|
|
|
PyMac_PRECHECK(BeginThemeDragSound);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
PyMac_GetOSType, &kind))
|
|
|
|
return NULL;
|
|
|
|
_err = BeginThemeDragSound(kind);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_EndThemeDragSound(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef EndThemeDragSound
|
|
|
|
PyMac_PRECHECK(EndThemeDragSound);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = EndThemeDragSound();
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_DrawThemeTickMark(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect bounds;
|
|
|
|
ThemeDrawState state;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemeTickMark
|
|
|
|
PyMac_PRECHECK(DrawThemeTickMark);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&l",
|
|
|
|
PyMac_GetRect, &bounds,
|
|
|
|
&state))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemeTickMark(&bounds,
|
|
|
|
state);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2002-01-06 19:03:39 -04:00
|
|
|
static PyObject *App_DrawThemeChasingArrows(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect bounds;
|
|
|
|
UInt32 index;
|
|
|
|
ThemeDrawState state;
|
|
|
|
UInt32 eraseData;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemeChasingArrows
|
|
|
|
PyMac_PRECHECK(DrawThemeChasingArrows);
|
|
|
|
#endif
|
2002-01-06 19:03:39 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&lll",
|
|
|
|
PyMac_GetRect, &bounds,
|
|
|
|
&index,
|
|
|
|
&state,
|
|
|
|
&eraseData))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemeChasingArrows(&bounds,
|
|
|
|
index,
|
|
|
|
state,
|
|
|
|
NULL,
|
|
|
|
eraseData);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_DrawThemePopupArrow(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect bounds;
|
|
|
|
ThemeArrowOrientation orientation;
|
|
|
|
ThemePopupArrowSize size;
|
|
|
|
ThemeDrawState state;
|
|
|
|
UInt32 eraseData;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemePopupArrow
|
|
|
|
PyMac_PRECHECK(DrawThemePopupArrow);
|
|
|
|
#endif
|
2002-01-06 19:03:39 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&HHll",
|
|
|
|
PyMac_GetRect, &bounds,
|
|
|
|
&orientation,
|
|
|
|
&size,
|
|
|
|
&state,
|
|
|
|
&eraseData))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemePopupArrow(&bounds,
|
|
|
|
orientation,
|
|
|
|
size,
|
|
|
|
state,
|
|
|
|
NULL,
|
|
|
|
eraseData);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2001-08-23 11:02:09 -03:00
|
|
|
static PyObject *App_DrawThemeStandaloneGrowBox(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Point origin;
|
|
|
|
ThemeGrowDirection growDirection;
|
|
|
|
Boolean isSmall;
|
|
|
|
ThemeDrawState state;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemeStandaloneGrowBox
|
|
|
|
PyMac_PRECHECK(DrawThemeStandaloneGrowBox);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&Hbl",
|
|
|
|
PyMac_GetPoint, &origin,
|
|
|
|
&growDirection,
|
|
|
|
&isSmall,
|
|
|
|
&state))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemeStandaloneGrowBox(origin,
|
|
|
|
growDirection,
|
|
|
|
isSmall,
|
|
|
|
state);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_DrawThemeStandaloneNoGrowBox(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Point origin;
|
|
|
|
ThemeGrowDirection growDirection;
|
|
|
|
Boolean isSmall;
|
|
|
|
ThemeDrawState state;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef DrawThemeStandaloneNoGrowBox
|
|
|
|
PyMac_PRECHECK(DrawThemeStandaloneNoGrowBox);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&Hbl",
|
|
|
|
PyMac_GetPoint, &origin,
|
|
|
|
&growDirection,
|
|
|
|
&isSmall,
|
|
|
|
&state))
|
|
|
|
return NULL;
|
|
|
|
_err = DrawThemeStandaloneNoGrowBox(origin,
|
|
|
|
growDirection,
|
|
|
|
isSmall,
|
|
|
|
state);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_GetThemeStandaloneGrowBoxBounds(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Point origin;
|
|
|
|
ThemeGrowDirection growDirection;
|
|
|
|
Boolean isSmall;
|
|
|
|
Rect bounds;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef GetThemeStandaloneGrowBoxBounds
|
|
|
|
PyMac_PRECHECK(GetThemeStandaloneGrowBoxBounds);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&Hb",
|
|
|
|
PyMac_GetPoint, &origin,
|
|
|
|
&growDirection,
|
|
|
|
&isSmall))
|
|
|
|
return NULL;
|
|
|
|
_err = GetThemeStandaloneGrowBoxBounds(origin,
|
|
|
|
growDirection,
|
|
|
|
isSmall,
|
|
|
|
&bounds);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
PyMac_BuildRect, &bounds);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_NormalizeThemeDrawingState(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef NormalizeThemeDrawingState
|
|
|
|
PyMac_PRECHECK(NormalizeThemeDrawingState);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = NormalizeThemeDrawingState();
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2002-01-05 19:37:19 -04:00
|
|
|
static PyObject *App_GetThemeDrawingState(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
ThemeDrawingState outState;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef GetThemeDrawingState
|
|
|
|
PyMac_PRECHECK(GetThemeDrawingState);
|
|
|
|
#endif
|
2002-01-05 19:37:19 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = GetThemeDrawingState(&outState);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("O&",
|
2002-01-05 19:44:33 -04:00
|
|
|
ThemeDrawingStateObj_New, outState);
|
2002-01-05 19:37:19 -04:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2001-08-23 11:02:09 -03:00
|
|
|
static PyObject *App_ApplyThemeBackground(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
ThemeBackgroundKind inKind;
|
|
|
|
Rect bounds;
|
|
|
|
ThemeDrawState inState;
|
|
|
|
SInt16 inDepth;
|
|
|
|
Boolean inColorDev;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef ApplyThemeBackground
|
|
|
|
PyMac_PRECHECK(ApplyThemeBackground);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "lO&lhb",
|
|
|
|
&inKind,
|
|
|
|
PyMac_GetRect, &bounds,
|
|
|
|
&inState,
|
|
|
|
&inDepth,
|
|
|
|
&inColorDev))
|
|
|
|
return NULL;
|
|
|
|
_err = ApplyThemeBackground(inKind,
|
|
|
|
&bounds,
|
|
|
|
inState,
|
|
|
|
inDepth,
|
|
|
|
inColorDev);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_SetThemeTextColorForWindow(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
WindowPtr window;
|
|
|
|
Boolean isActive;
|
|
|
|
SInt16 depth;
|
|
|
|
Boolean isColorDev;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef SetThemeTextColorForWindow
|
|
|
|
PyMac_PRECHECK(SetThemeTextColorForWindow);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&bhb",
|
|
|
|
WinObj_Convert, &window,
|
|
|
|
&isActive,
|
|
|
|
&depth,
|
|
|
|
&isColorDev))
|
|
|
|
return NULL;
|
|
|
|
_err = SetThemeTextColorForWindow(window,
|
|
|
|
isActive,
|
|
|
|
depth,
|
|
|
|
isColorDev);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_IsValidAppearanceFileType(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
Boolean _rv;
|
|
|
|
OSType fileType;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef IsValidAppearanceFileType
|
|
|
|
PyMac_PRECHECK(IsValidAppearanceFileType);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
PyMac_GetOSType, &fileType))
|
|
|
|
return NULL;
|
|
|
|
_rv = IsValidAppearanceFileType(fileType);
|
|
|
|
_res = Py_BuildValue("b",
|
|
|
|
_rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_GetThemeBrushAsColor(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
ThemeBrush inBrush;
|
|
|
|
SInt16 inDepth;
|
|
|
|
Boolean inColorDev;
|
|
|
|
RGBColor outColor;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef GetThemeBrushAsColor
|
|
|
|
PyMac_PRECHECK(GetThemeBrushAsColor);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "hhb",
|
|
|
|
&inBrush,
|
|
|
|
&inDepth,
|
|
|
|
&inColorDev))
|
|
|
|
return NULL;
|
|
|
|
_err = GetThemeBrushAsColor(inBrush,
|
|
|
|
inDepth,
|
|
|
|
inColorDev,
|
|
|
|
&outColor);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
QdRGB_New, &outColor);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_GetThemeTextColor(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
ThemeTextColor inColor;
|
|
|
|
SInt16 inDepth;
|
|
|
|
Boolean inColorDev;
|
|
|
|
RGBColor outColor;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef GetThemeTextColor
|
|
|
|
PyMac_PRECHECK(GetThemeTextColor);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "hhb",
|
|
|
|
&inColor,
|
|
|
|
&inDepth,
|
|
|
|
&inColorDev))
|
|
|
|
return NULL;
|
|
|
|
_err = GetThemeTextColor(inColor,
|
|
|
|
inDepth,
|
|
|
|
inColorDev,
|
|
|
|
&outColor);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
QdRGB_New, &outColor);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *App_GetThemeMetric(PyObject *_self, PyObject *_args)
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
ThemeMetric inMetric;
|
|
|
|
SInt32 outMetric;
|
2002-03-24 19:04:18 -04:00
|
|
|
#ifndef GetThemeMetric
|
|
|
|
PyMac_PRECHECK(GetThemeMetric);
|
|
|
|
#endif
|
2001-08-23 11:02:09 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "l",
|
|
|
|
&inMetric))
|
|
|
|
return NULL;
|
|
|
|
_err = GetThemeMetric(inMetric,
|
|
|
|
&outMetric);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("l",
|
|
|
|
outMetric);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyMethodDef App_methods[] = {
|
|
|
|
{"RegisterAppearanceClient", (PyCFunction)App_RegisterAppearanceClient, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("() -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"UnregisterAppearanceClient", (PyCFunction)App_UnregisterAppearanceClient, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("() -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"SetThemePen", (PyCFunction)App_SetThemePen, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(ThemeBrush inBrush, SInt16 inDepth, Boolean inIsColorDevice) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"SetThemeBackground", (PyCFunction)App_SetThemeBackground, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(ThemeBrush inBrush, SInt16 inDepth, Boolean inIsColorDevice) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"SetThemeTextColor", (PyCFunction)App_SetThemeTextColor, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(ThemeTextColor inColor, SInt16 inDepth, Boolean inIsColorDevice) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"SetThemeWindowBackground", (PyCFunction)App_SetThemeWindowBackground, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(WindowPtr inWindow, ThemeBrush inBrush, Boolean inUpdate) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"DrawThemeWindowHeader", (PyCFunction)App_DrawThemeWindowHeader, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect inRect, ThemeDrawState inState) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"DrawThemeWindowListViewHeader", (PyCFunction)App_DrawThemeWindowListViewHeader, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect inRect, ThemeDrawState inState) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"DrawThemePlacard", (PyCFunction)App_DrawThemePlacard, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect inRect, ThemeDrawState inState) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"DrawThemeEditTextFrame", (PyCFunction)App_DrawThemeEditTextFrame, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect inRect, ThemeDrawState inState) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"DrawThemeListBoxFrame", (PyCFunction)App_DrawThemeListBoxFrame, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect inRect, ThemeDrawState inState) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"DrawThemeFocusRect", (PyCFunction)App_DrawThemeFocusRect, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect inRect, Boolean inHasFocus) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"DrawThemePrimaryGroup", (PyCFunction)App_DrawThemePrimaryGroup, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect inRect, ThemeDrawState inState) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"DrawThemeSecondaryGroup", (PyCFunction)App_DrawThemeSecondaryGroup, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect inRect, ThemeDrawState inState) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"DrawThemeSeparator", (PyCFunction)App_DrawThemeSeparator, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect inRect, ThemeDrawState inState) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"DrawThemeModelessDialogFrame", (PyCFunction)App_DrawThemeModelessDialogFrame, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect inRect, ThemeDrawState inState) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"DrawThemeGenericWell", (PyCFunction)App_DrawThemeGenericWell, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect inRect, ThemeDrawState inState, Boolean inFillCenter) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"DrawThemeFocusRegion", (PyCFunction)App_DrawThemeFocusRegion, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Boolean inHasFocus) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"IsThemeInColor", (PyCFunction)App_IsThemeInColor, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(SInt16 inDepth, Boolean inIsColorDevice) -> (Boolean _rv)")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"GetThemeAccentColors", (PyCFunction)App_GetThemeAccentColors, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("() -> (CTabHandle outColors)")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"DrawThemeMenuBarBackground", (PyCFunction)App_DrawThemeMenuBarBackground, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect inBounds, ThemeMenuBarState inState, UInt32 inAttributes) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"GetThemeMenuBarHeight", (PyCFunction)App_GetThemeMenuBarHeight, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("() -> (SInt16 outHeight)")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"DrawThemeMenuBackground", (PyCFunction)App_DrawThemeMenuBackground, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect inMenuRect, ThemeMenuType inMenuType) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"GetThemeMenuBackgroundRegion", (PyCFunction)App_GetThemeMenuBackgroundRegion, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect inMenuRect, ThemeMenuType menuType) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"DrawThemeMenuSeparator", (PyCFunction)App_DrawThemeMenuSeparator, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect inItemRect) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"GetThemeMenuSeparatorHeight", (PyCFunction)App_GetThemeMenuSeparatorHeight, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("() -> (SInt16 outHeight)")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"GetThemeMenuItemExtra", (PyCFunction)App_GetThemeMenuItemExtra, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(ThemeMenuItemType inItemType) -> (SInt16 outHeight, SInt16 outWidth)")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"GetThemeMenuTitleExtra", (PyCFunction)App_GetThemeMenuTitleExtra, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Boolean inIsSquished) -> (SInt16 outWidth)")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"DrawThemeTabPane", (PyCFunction)App_DrawThemeTabPane, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect inRect, ThemeDrawState inState) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"GetThemeTabRegion", (PyCFunction)App_GetThemeTabRegion, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect inRect, ThemeTabStyle inStyle, ThemeTabDirection inDirection) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"SetThemeCursor", (PyCFunction)App_SetThemeCursor, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(ThemeCursor inCursor) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"SetAnimatedThemeCursor", (PyCFunction)App_SetAnimatedThemeCursor, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(ThemeCursor inCursor, UInt32 inAnimationStep) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"GetThemeScrollBarThumbStyle", (PyCFunction)App_GetThemeScrollBarThumbStyle, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("() -> (ThemeScrollBarThumbStyle outStyle)")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"GetThemeScrollBarArrowStyle", (PyCFunction)App_GetThemeScrollBarArrowStyle, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("() -> (ThemeScrollBarArrowStyle outStyle)")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"GetThemeCheckBoxStyle", (PyCFunction)App_GetThemeCheckBoxStyle, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("() -> (ThemeCheckBoxStyle outStyle)")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"UseThemeFont", (PyCFunction)App_UseThemeFont, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(ThemeFontID inFontID, ScriptCode inScript) -> None")},
|
2002-01-02 11:11:44 -04:00
|
|
|
{"DrawThemeTextBox", (PyCFunction)App_DrawThemeTextBox, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(CFStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, Boolean inWrapToWidth, Rect inBoundingBox, SInt16 inJust) -> None")},
|
2001-12-16 16:18:40 -04:00
|
|
|
{"TruncateThemeText", (PyCFunction)App_TruncateThemeText, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(CFMutableStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, SInt16 inPixelWidthLimit, TruncCode inTruncWhere) -> (Boolean outTruncated)")},
|
2001-12-16 16:18:40 -04:00
|
|
|
{"GetThemeTextDimensions", (PyCFunction)App_GetThemeTextDimensions, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(CFStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, Boolean inWrapToWidth, Point ioBounds) -> (Point ioBounds, SInt16 outBaseline)")},
|
2001-12-16 16:18:40 -04:00
|
|
|
{"GetThemeTextShadowOutset", (PyCFunction)App_GetThemeTextShadowOutset, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(ThemeFontID inFontID, ThemeDrawState inState) -> (Rect outOutset)")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"DrawThemeScrollBarArrows", (PyCFunction)App_DrawThemeScrollBarArrows, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect bounds, ThemeTrackEnableState enableState, ThemeTrackPressState pressState, Boolean isHoriz) -> (Rect trackBounds)")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"GetThemeScrollBarTrackRect", (PyCFunction)App_GetThemeScrollBarTrackRect, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect bounds, ThemeTrackEnableState enableState, ThemeTrackPressState pressState, Boolean isHoriz) -> (Rect trackBounds)")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"HitTestThemeScrollBarArrows", (PyCFunction)App_HitTestThemeScrollBarArrows, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect scrollBarBounds, ThemeTrackEnableState enableState, ThemeTrackPressState pressState, Boolean isHoriz, Point ptHit) -> (Boolean _rv, Rect trackBounds, ControlPartCode partcode)")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"DrawThemeScrollBarDelimiters", (PyCFunction)App_DrawThemeScrollBarDelimiters, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(ThemeWindowType flavor, Rect inContRect, ThemeDrawState state, ThemeWindowAttributes attributes) -> None")},
|
2002-01-06 19:03:39 -04:00
|
|
|
{"DrawThemeButton", (PyCFunction)App_DrawThemeButton, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect inBounds, UInt16 inKind, ThemeButtonDrawInfo inNewInfo, ThemeButtonDrawInfo inPrevInfo, UInt32 inUserData) -> None")},
|
2002-01-06 19:03:39 -04:00
|
|
|
{"GetThemeButtonRegion", (PyCFunction)App_GetThemeButtonRegion, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect inBounds, UInt16 inKind, ThemeButtonDrawInfo inNewInfo) -> None")},
|
2002-01-06 19:03:39 -04:00
|
|
|
{"GetThemeButtonContentBounds", (PyCFunction)App_GetThemeButtonContentBounds, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect inBounds, UInt16 inKind, ThemeButtonDrawInfo inDrawInfo) -> (Rect outBounds)")},
|
2002-01-06 19:03:39 -04:00
|
|
|
{"GetThemeButtonBackgroundBounds", (PyCFunction)App_GetThemeButtonBackgroundBounds, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect inBounds, UInt16 inKind, ThemeButtonDrawInfo inDrawInfo) -> (Rect outBounds)")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"PlayThemeSound", (PyCFunction)App_PlayThemeSound, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(ThemeSoundKind kind) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"BeginThemeDragSound", (PyCFunction)App_BeginThemeDragSound, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(ThemeDragSoundKind kind) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"EndThemeDragSound", (PyCFunction)App_EndThemeDragSound, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("() -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"DrawThemeTickMark", (PyCFunction)App_DrawThemeTickMark, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect bounds, ThemeDrawState state) -> None")},
|
2002-01-06 19:03:39 -04:00
|
|
|
{"DrawThemeChasingArrows", (PyCFunction)App_DrawThemeChasingArrows, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect bounds, UInt32 index, ThemeDrawState state, UInt32 eraseData) -> None")},
|
2002-01-06 19:03:39 -04:00
|
|
|
{"DrawThemePopupArrow", (PyCFunction)App_DrawThemePopupArrow, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Rect bounds, ThemeArrowOrientation orientation, ThemePopupArrowSize size, ThemeDrawState state, UInt32 eraseData) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"DrawThemeStandaloneGrowBox", (PyCFunction)App_DrawThemeStandaloneGrowBox, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Point origin, ThemeGrowDirection growDirection, Boolean isSmall, ThemeDrawState state) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"DrawThemeStandaloneNoGrowBox", (PyCFunction)App_DrawThemeStandaloneNoGrowBox, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Point origin, ThemeGrowDirection growDirection, Boolean isSmall, ThemeDrawState state) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"GetThemeStandaloneGrowBoxBounds", (PyCFunction)App_GetThemeStandaloneGrowBoxBounds, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(Point origin, ThemeGrowDirection growDirection, Boolean isSmall) -> (Rect bounds)")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"NormalizeThemeDrawingState", (PyCFunction)App_NormalizeThemeDrawingState, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("() -> None")},
|
2002-01-05 19:37:19 -04:00
|
|
|
{"GetThemeDrawingState", (PyCFunction)App_GetThemeDrawingState, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("() -> (ThemeDrawingState outState)")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"ApplyThemeBackground", (PyCFunction)App_ApplyThemeBackground, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(ThemeBackgroundKind inKind, Rect bounds, ThemeDrawState inState, SInt16 inDepth, Boolean inColorDev) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"SetThemeTextColorForWindow", (PyCFunction)App_SetThemeTextColorForWindow, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(WindowPtr window, Boolean isActive, SInt16 depth, Boolean isColorDev) -> None")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"IsValidAppearanceFileType", (PyCFunction)App_IsValidAppearanceFileType, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(OSType fileType) -> (Boolean _rv)")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"GetThemeBrushAsColor", (PyCFunction)App_GetThemeBrushAsColor, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(ThemeBrush inBrush, SInt16 inDepth, Boolean inColorDev) -> (RGBColor outColor)")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"GetThemeTextColor", (PyCFunction)App_GetThemeTextColor, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(ThemeTextColor inColor, SInt16 inDepth, Boolean inColorDev) -> (RGBColor outColor)")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{"GetThemeMetric", (PyCFunction)App_GetThemeMetric, 1,
|
2002-08-16 06:09:31 -03:00
|
|
|
PyDoc_STR("(ThemeMetric inMetric) -> (SInt32 outMetric)")},
|
2001-08-23 11:02:09 -03:00
|
|
|
{NULL, NULL, 0}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void init_App(void)
|
|
|
|
{
|
|
|
|
PyObject *m;
|
|
|
|
PyObject *d;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m = Py_InitModule("_App", App_methods);
|
|
|
|
d = PyModule_GetDict(m);
|
|
|
|
App_Error = PyMac_GetOSErrException();
|
|
|
|
if (App_Error == NULL ||
|
|
|
|
PyDict_SetItemString(d, "Error", App_Error) != 0)
|
|
|
|
return;
|
2002-01-05 19:37:19 -04:00
|
|
|
ThemeDrawingState_Type.ob_type = &PyType_Type;
|
2002-12-23 19:16:25 -04:00
|
|
|
if (PyType_Ready(&ThemeDrawingState_Type) < 0) return;
|
2002-01-05 19:37:19 -04:00
|
|
|
Py_INCREF(&ThemeDrawingState_Type);
|
2002-12-03 19:40:22 -04:00
|
|
|
PyModule_AddObject(m, "ThemeDrawingState", (PyObject *)&ThemeDrawingState_Type);
|
|
|
|
/* Backward-compatible name */
|
|
|
|
Py_INCREF(&ThemeDrawingState_Type);
|
|
|
|
PyModule_AddObject(m, "ThemeDrawingStateType", (PyObject *)&ThemeDrawingState_Type);
|
2001-08-23 11:02:09 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ======================== End module _App ========================= */
|
|
|
|
|