1995-01-30 07:53:55 -04:00
|
|
|
|
|
|
|
/* =========================== Module Win =========================== */
|
|
|
|
|
|
|
|
#include "Python.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "macglue.h"
|
2000-07-14 19:16:45 -03:00
|
|
|
#include "pymactoolbox.h"
|
1995-01-30 07:53:55 -04:00
|
|
|
|
|
|
|
#include <Windows.h>
|
2000-12-12 18:10:21 -04:00
|
|
|
|
2001-05-17 18:58:34 -03:00
|
|
|
#ifdef USE_TOOLBOX_OBJECT_GLUE
|
|
|
|
extern PyObject *_WinObj_New(WindowRef);
|
|
|
|
extern PyObject *_WinObj_WhichWindow(WindowRef);
|
|
|
|
extern int _WinObj_Convert(PyObject *, WindowRef *);
|
|
|
|
|
|
|
|
#define WinObj_New _WinObj_New
|
|
|
|
#define WinObj_WhichWindow _WinObj_WhichWindow
|
|
|
|
#define WinObj_Convert _WinObj_Convert
|
|
|
|
#endif
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
|
2000-12-19 18:23:06 -04:00
|
|
|
/* Carbon calls that we emulate in classic mode */
|
2000-12-12 18:10:21 -04:00
|
|
|
#define GetWindowSpareFlag(win) (((CWindowPeek)(win))->spareFlag)
|
|
|
|
#define GetWindowFromPort(port) ((WindowRef)(port))
|
|
|
|
#define GetWindowPortBounds(win, rectp) (*(rectp) = ((CWindowPeek)(win))->port.portRect)
|
2001-04-25 19:09:29 -03:00
|
|
|
#define IsPointerValid(p) (((long)p&3) == 0)
|
2000-12-12 18:10:21 -04:00
|
|
|
#endif
|
2000-12-19 18:23:06 -04:00
|
|
|
#if ACCESSOR_CALLS_ARE_FUNCTIONS
|
|
|
|
/* Classic calls that we emulate in carbon mode */
|
|
|
|
#define GetWindowUpdateRgn(win, rgn) GetWindowRegion((win), kWindowUpdateRgn, (rgn))
|
|
|
|
#define GetWindowStructureRgn(win, rgn) GetWindowRegion((win), kWindowStructureRgn, (rgn))
|
|
|
|
#define GetWindowContentRgn(win, rgn) GetWindowRegion((win), kWindowContentRgn, (rgn))
|
|
|
|
#endif
|
2000-12-12 18:10:21 -04:00
|
|
|
|
2000-08-25 19:17:51 -03:00
|
|
|
/* Function to dispose a window, with a "normal" calling sequence */
|
|
|
|
static void
|
|
|
|
PyMac_AutoDisposeWindow(WindowPtr w)
|
|
|
|
{
|
|
|
|
DisposeWindow(w);
|
|
|
|
}
|
1995-01-30 07:53:55 -04:00
|
|
|
|
|
|
|
static PyObject *Win_Error;
|
|
|
|
|
|
|
|
/* ----------------------- Object type Window ----------------------- */
|
|
|
|
|
|
|
|
PyTypeObject Window_Type;
|
|
|
|
|
|
|
|
#define WinObj_Check(x) ((x)->ob_type == &Window_Type)
|
|
|
|
|
|
|
|
typedef struct WindowObject {
|
|
|
|
PyObject_HEAD
|
|
|
|
WindowPtr ob_itself;
|
2000-08-25 19:17:51 -03:00
|
|
|
void (*ob_freeit)(WindowPtr ptr);
|
1995-01-30 07:53:55 -04:00
|
|
|
} WindowObject;
|
|
|
|
|
|
|
|
PyObject *WinObj_New(itself)
|
1995-02-19 11:59:49 -04:00
|
|
|
WindowPtr itself;
|
1995-01-30 07:53:55 -04:00
|
|
|
{
|
|
|
|
WindowObject *it;
|
|
|
|
if (itself == NULL) return PyMac_Error(resNotFound);
|
|
|
|
it = PyObject_NEW(WindowObject, &Window_Type);
|
|
|
|
if (it == NULL) return NULL;
|
|
|
|
it->ob_itself = itself;
|
2000-12-14 18:29:00 -04:00
|
|
|
it->ob_freeit = NULL;
|
|
|
|
if (GetWRefCon(itself) == 0)
|
|
|
|
{
|
|
|
|
SetWRefCon(itself, (long)it);
|
|
|
|
it->ob_freeit = PyMac_AutoDisposeWindow;
|
|
|
|
}
|
1995-01-30 07:53:55 -04:00
|
|
|
return (PyObject *)it;
|
|
|
|
}
|
|
|
|
WinObj_Convert(v, p_itself)
|
|
|
|
PyObject *v;
|
|
|
|
WindowPtr *p_itself;
|
|
|
|
{
|
2001-05-17 18:58:34 -03:00
|
|
|
#if 1
|
|
|
|
{
|
|
|
|
DialogRef dlg;
|
|
|
|
if (DlgObj_Convert(v, &dlg) && dlg) {
|
|
|
|
*p_itself = GetDialogWindow(dlg);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
PyErr_Clear();
|
|
|
|
}
|
|
|
|
#else
|
1995-01-30 07:53:55 -04:00
|
|
|
if (DlgObj_Check(v)) {
|
2000-12-12 18:10:21 -04:00
|
|
|
*p_itself = DlgObj_ConvertToWindow(v);
|
1995-01-30 07:53:55 -04:00
|
|
|
return 1;
|
|
|
|
}
|
2001-05-17 18:58:34 -03:00
|
|
|
#endif
|
1995-01-30 07:53:55 -04:00
|
|
|
|
|
|
|
if (v == Py_None) { *p_itself = NULL; return 1; }
|
|
|
|
if (PyInt_Check(v)) { *p_itself = (WindowPtr)PyInt_AsLong(v); return 1; }
|
|
|
|
|
|
|
|
if (!WinObj_Check(v))
|
|
|
|
{
|
|
|
|
PyErr_SetString(PyExc_TypeError, "Window required");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
*p_itself = ((WindowObject *)v)->ob_itself;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void WinObj_dealloc(self)
|
|
|
|
WindowObject *self;
|
|
|
|
{
|
2000-08-25 19:17:51 -03:00
|
|
|
if (self->ob_freeit && self->ob_itself)
|
|
|
|
{
|
2000-12-14 18:29:00 -04:00
|
|
|
SetWRefCon(self->ob_itself, 0);
|
2000-08-25 19:17:51 -03:00
|
|
|
self->ob_freeit(self->ob_itself);
|
|
|
|
}
|
|
|
|
self->ob_itself = NULL;
|
2000-12-14 18:29:00 -04:00
|
|
|
self->ob_freeit = NULL;
|
1995-01-30 07:53:55 -04:00
|
|
|
PyMem_DEL(self);
|
|
|
|
}
|
|
|
|
|
1999-12-12 17:41:51 -04:00
|
|
|
static PyObject *WinObj_GetWindowOwnerCount(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
UInt32 outCount;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = GetWindowOwnerCount(_self->ob_itself,
|
|
|
|
&outCount);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("l",
|
|
|
|
outCount);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_CloneWindow(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = CloneWindow(_self->ob_itself);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
#if TARGET_API_MAC_CARBON
|
|
|
|
|
|
|
|
static PyObject *WinObj_ReshapeCustomWindow(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = ReshapeCustomWindow(_self->ob_itself);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
1999-12-12 17:41:51 -04:00
|
|
|
static PyObject *WinObj_GetWindowClass(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
WindowClass outClass;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = GetWindowClass(_self->ob_itself,
|
|
|
|
&outClass);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("l",
|
|
|
|
outClass);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_GetWindowAttributes(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
WindowAttributes outAttributes;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = GetWindowAttributes(_self->ob_itself,
|
|
|
|
&outAttributes);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("l",
|
|
|
|
outAttributes);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
#if TARGET_API_MAC_CARBON
|
|
|
|
|
|
|
|
static PyObject *WinObj_ChangeWindowAttributes(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
WindowAttributes setTheseAttributes;
|
|
|
|
WindowAttributes clearTheseAttributes;
|
|
|
|
if (!PyArg_ParseTuple(_args, "ll",
|
|
|
|
&setTheseAttributes,
|
|
|
|
&clearTheseAttributes))
|
|
|
|
return NULL;
|
|
|
|
_err = ChangeWindowAttributes(_self->ob_itself,
|
|
|
|
setTheseAttributes,
|
|
|
|
clearTheseAttributes);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
2000-06-02 18:35:07 -03:00
|
|
|
|
1998-02-20 12:02:09 -04:00
|
|
|
static PyObject *WinObj_SetWinColor(_self, _args)
|
1995-01-30 07:53:55 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
WCTabHandle newColorTable;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
ResObj_Convert, &newColorTable))
|
1995-01-30 07:53:55 -04:00
|
|
|
return NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
SetWinColor(_self->ob_itself,
|
|
|
|
newColorTable);
|
1995-01-30 07:53:55 -04:00
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
1995-01-30 07:53:55 -04:00
|
|
|
|
1999-12-12 17:41:51 -04:00
|
|
|
static PyObject *WinObj_SetWindowContentColor(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
RGBColor color;
|
2000-12-12 18:10:21 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
QdRGB_Convert, &color))
|
1999-12-12 17:41:51 -04:00
|
|
|
return NULL;
|
|
|
|
_err = SetWindowContentColor(_self->ob_itself,
|
|
|
|
&color);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
2000-12-12 18:10:21 -04:00
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
1999-12-12 17:41:51 -04:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_GetWindowContentColor(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
RGBColor color;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = GetWindowContentColor(_self->ob_itself,
|
|
|
|
&color);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
QdRGB_New, &color);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_GetWindowContentPattern(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
PixPatHandle outPixPat;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
ResObj_Convert, &outPixPat))
|
|
|
|
return NULL;
|
|
|
|
_err = GetWindowContentPattern(_self->ob_itself,
|
|
|
|
outPixPat);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_SetWindowContentPattern(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
PixPatHandle pixPat;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
ResObj_Convert, &pixPat))
|
|
|
|
return NULL;
|
|
|
|
_err = SetWindowContentPattern(_self->ob_itself,
|
|
|
|
pixPat);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
#if TARGET_API_MAC_CARBON
|
|
|
|
|
|
|
|
static PyObject *WinObj_ScrollWindowRect(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect inScrollRect;
|
|
|
|
SInt16 inHPixels;
|
|
|
|
SInt16 inVPixels;
|
|
|
|
ScrollWindowOptions inOptions;
|
|
|
|
RgnHandle outExposedRgn;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&hhlO&",
|
|
|
|
PyMac_GetRect, &inScrollRect,
|
|
|
|
&inHPixels,
|
|
|
|
&inVPixels,
|
|
|
|
&inOptions,
|
|
|
|
ResObj_Convert, &outExposedRgn))
|
|
|
|
return NULL;
|
|
|
|
_err = ScrollWindowRect(_self->ob_itself,
|
|
|
|
&inScrollRect,
|
|
|
|
inHPixels,
|
|
|
|
inVPixels,
|
|
|
|
inOptions,
|
|
|
|
outExposedRgn);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if TARGET_API_MAC_CARBON
|
|
|
|
|
|
|
|
static PyObject *WinObj_ScrollWindowRegion(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
RgnHandle inScrollRgn;
|
|
|
|
SInt16 inHPixels;
|
|
|
|
SInt16 inVPixels;
|
|
|
|
ScrollWindowOptions inOptions;
|
|
|
|
RgnHandle outExposedRgn;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&hhlO&",
|
|
|
|
ResObj_Convert, &inScrollRgn,
|
|
|
|
&inHPixels,
|
|
|
|
&inVPixels,
|
|
|
|
&inOptions,
|
|
|
|
ResObj_Convert, &outExposedRgn))
|
|
|
|
return NULL;
|
|
|
|
_err = ScrollWindowRegion(_self->ob_itself,
|
|
|
|
inScrollRgn,
|
|
|
|
inHPixels,
|
|
|
|
inVPixels,
|
|
|
|
inOptions,
|
|
|
|
outExposedRgn);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
1998-02-20 12:02:09 -04:00
|
|
|
static PyObject *WinObj_ClipAbove(_self, _args)
|
1995-01-30 07:53:55 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
ClipAbove(_self->ob_itself);
|
1995-01-30 07:53:55 -04:00
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
2000-06-02 18:35:07 -03:00
|
|
|
|
1998-02-20 12:02:09 -04:00
|
|
|
static PyObject *WinObj_SaveOld(_self, _args)
|
1995-01-30 07:53:55 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
SaveOld(_self->ob_itself);
|
1995-01-30 07:53:55 -04:00
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
1995-01-30 07:53:55 -04:00
|
|
|
|
1998-02-20 12:02:09 -04:00
|
|
|
static PyObject *WinObj_DrawNew(_self, _args)
|
1995-01-30 07:53:55 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
Boolean update;
|
1995-01-30 07:53:55 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, "b",
|
1998-02-20 12:02:09 -04:00
|
|
|
&update))
|
1995-01-30 07:53:55 -04:00
|
|
|
return NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
DrawNew(_self->ob_itself,
|
|
|
|
update);
|
1995-01-30 07:53:55 -04:00
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
1995-01-30 07:53:55 -04:00
|
|
|
|
2000-12-14 18:29:00 -04:00
|
|
|
static PyObject *WinObj_PaintOne(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
RgnHandle clobberedRgn;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
ResObj_Convert, &clobberedRgn))
|
|
|
|
return NULL;
|
|
|
|
PaintOne(_self->ob_itself,
|
|
|
|
clobberedRgn);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_PaintBehind(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
RgnHandle clobberedRgn;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
ResObj_Convert, &clobberedRgn))
|
|
|
|
return NULL;
|
|
|
|
PaintBehind(_self->ob_itself,
|
|
|
|
clobberedRgn);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *WinObj_CalcVis(_self, _args)
|
1995-01-30 07:53:55 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
1995-01-30 07:53:55 -04:00
|
|
|
return NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
CalcVis(_self->ob_itself);
|
1995-01-30 07:53:55 -04:00
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-14 18:29:00 -04:00
|
|
|
static PyObject *WinObj_CalcVisBehind(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
RgnHandle clobberedRgn;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
ResObj_Convert, &clobberedRgn))
|
|
|
|
return NULL;
|
|
|
|
CalcVisBehind(_self->ob_itself,
|
|
|
|
clobberedRgn);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *WinObj_BringToFront(_self, _args)
|
1995-01-30 07:53:55 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
1995-01-30 07:53:55 -04:00
|
|
|
return NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
BringToFront(_self->ob_itself);
|
1995-01-30 07:53:55 -04:00
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *WinObj_SendBehind(_self, _args)
|
1995-01-30 07:53:55 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
WindowPtr behindWindow;
|
1998-02-20 12:02:09 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
2000-12-12 18:10:21 -04:00
|
|
|
WinObj_Convert, &behindWindow))
|
1995-01-30 07:53:55 -04:00
|
|
|
return NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
SendBehind(_self->ob_itself,
|
|
|
|
behindWindow);
|
1995-01-30 07:53:55 -04:00
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *WinObj_SelectWindow(_self, _args)
|
1995-01-30 07:53:55 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
1995-01-30 07:53:55 -04:00
|
|
|
return NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
SelectWindow(_self->ob_itself);
|
1995-01-30 07:53:55 -04:00
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
#if TARGET_API_MAC_CARBON
|
|
|
|
|
|
|
|
static PyObject *WinObj_GetNextWindowOfClass(_self, _args)
|
1995-01-30 07:53:55 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
WindowPtr _rv;
|
|
|
|
WindowClass inWindowClass;
|
|
|
|
Boolean mustBeVisible;
|
|
|
|
if (!PyArg_ParseTuple(_args, "lb",
|
|
|
|
&inWindowClass,
|
|
|
|
&mustBeVisible))
|
|
|
|
return NULL;
|
|
|
|
_rv = GetNextWindowOfClass(_self->ob_itself,
|
|
|
|
inWindowClass,
|
|
|
|
mustBeVisible);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
WinObj_New, _rv);
|
1995-01-30 07:53:55 -04:00
|
|
|
return _res;
|
|
|
|
}
|
2000-12-12 18:10:21 -04:00
|
|
|
#endif
|
1995-01-30 07:53:55 -04:00
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
|
|
|
|
|
|
|
static PyObject *WinObj_IsValidWindowPtr(_self, _args)
|
1995-01-30 07:53:55 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
Boolean _rv;
|
1998-02-20 12:02:09 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
1995-01-30 07:53:55 -04:00
|
|
|
return NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
_rv = IsValidWindowPtr(_self->ob_itself);
|
|
|
|
_res = Py_BuildValue("b",
|
|
|
|
_rv);
|
1995-01-30 07:53:55 -04:00
|
|
|
return _res;
|
|
|
|
}
|
2000-12-12 18:10:21 -04:00
|
|
|
#endif
|
1995-01-30 07:53:55 -04:00
|
|
|
|
1998-04-21 12:23:55 -03:00
|
|
|
static PyObject *WinObj_HiliteWindow(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
Boolean fHilite;
|
|
|
|
if (!PyArg_ParseTuple(_args, "b",
|
|
|
|
&fHilite))
|
|
|
|
return NULL;
|
|
|
|
HiliteWindow(_self->ob_itself,
|
|
|
|
fHilite);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1995-01-30 07:53:55 -04:00
|
|
|
static PyObject *WinObj_SetWRefCon(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
long data;
|
|
|
|
if (!PyArg_ParseTuple(_args, "l",
|
|
|
|
&data))
|
|
|
|
return NULL;
|
|
|
|
SetWRefCon(_self->ob_itself,
|
|
|
|
data);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_GetWRefCon(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
long _rv;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_rv = GetWRefCon(_self->ob_itself);
|
|
|
|
_res = Py_BuildValue("l",
|
|
|
|
_rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1995-11-14 06:48:54 -04:00
|
|
|
static PyObject *WinObj_SetWindowPic(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
PicHandle pic;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
ResObj_Convert, &pic))
|
|
|
|
return NULL;
|
|
|
|
SetWindowPic(_self->ob_itself,
|
|
|
|
pic);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_GetWindowPic(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
PicHandle _rv;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_rv = GetWindowPic(_self->ob_itself);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
ResObj_New, _rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1998-02-20 12:02:09 -04:00
|
|
|
static PyObject *WinObj_GetWVariant(_self, _args)
|
1995-01-30 07:53:55 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
short _rv;
|
1995-01-30 07:53:55 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
_rv = GetWVariant(_self->ob_itself);
|
|
|
|
_res = Py_BuildValue("h",
|
|
|
|
_rv);
|
1995-01-30 07:53:55 -04:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1999-12-12 17:41:51 -04:00
|
|
|
static PyObject *WinObj_GetWindowFeatures(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
UInt32 outFeatures;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = GetWindowFeatures(_self->ob_itself,
|
|
|
|
&outFeatures);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("l",
|
|
|
|
outFeatures);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_GetWindowRegion(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
WindowRegionCode inRegionCode;
|
|
|
|
RgnHandle ioWinRgn;
|
2000-07-07 10:09:35 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "HO&",
|
1999-12-12 17:41:51 -04:00
|
|
|
&inRegionCode,
|
|
|
|
ResObj_Convert, &ioWinRgn))
|
|
|
|
return NULL;
|
|
|
|
_err = GetWindowRegion(_self->ob_itself,
|
|
|
|
inRegionCode,
|
|
|
|
ioWinRgn);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1998-02-20 12:02:09 -04:00
|
|
|
static PyObject *WinObj_BeginUpdate(_self, _args)
|
1995-01-30 07:53:55 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
BeginUpdate(_self->ob_itself);
|
1995-01-30 07:53:55 -04:00
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1998-02-20 12:02:09 -04:00
|
|
|
static PyObject *WinObj_EndUpdate(_self, _args)
|
1995-11-15 11:18:47 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
1995-11-15 11:18:47 -04:00
|
|
|
return NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
EndUpdate(_self->ob_itself);
|
1995-11-15 11:18:47 -04:00
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1999-12-12 17:41:51 -04:00
|
|
|
static PyObject *WinObj_InvalWindowRgn(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
RgnHandle region;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
ResObj_Convert, ®ion))
|
|
|
|
return NULL;
|
|
|
|
_err = InvalWindowRgn(_self->ob_itself,
|
|
|
|
region);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_InvalWindowRect(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect bounds;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
PyMac_GetRect, &bounds))
|
|
|
|
return NULL;
|
|
|
|
_err = InvalWindowRect(_self->ob_itself,
|
|
|
|
&bounds);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_ValidWindowRgn(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
RgnHandle region;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
ResObj_Convert, ®ion))
|
|
|
|
return NULL;
|
|
|
|
_err = ValidWindowRgn(_self->ob_itself,
|
|
|
|
region);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_ValidWindowRect(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect bounds;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
PyMac_GetRect, &bounds))
|
|
|
|
return NULL;
|
|
|
|
_err = ValidWindowRect(_self->ob_itself,
|
|
|
|
&bounds);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1998-02-20 12:02:09 -04:00
|
|
|
static PyObject *WinObj_DrawGrowIcon(_self, _args)
|
1995-11-15 11:18:47 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
1995-11-15 11:18:47 -04:00
|
|
|
return NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
DrawGrowIcon(_self->ob_itself);
|
1995-11-15 11:18:47 -04:00
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1998-02-20 12:02:09 -04:00
|
|
|
static PyObject *WinObj_SetWTitle(_self, _args)
|
1995-11-15 11:18:47 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
Str255 title;
|
1995-11-15 11:18:47 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
1998-02-20 12:02:09 -04:00
|
|
|
PyMac_GetStr255, title))
|
1995-11-15 11:18:47 -04:00
|
|
|
return NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
SetWTitle(_self->ob_itself,
|
|
|
|
title);
|
1995-11-15 11:18:47 -04:00
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1998-02-20 12:02:09 -04:00
|
|
|
static PyObject *WinObj_GetWTitle(_self, _args)
|
1995-01-30 07:53:55 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
Str255 title;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
1995-01-30 07:53:55 -04:00
|
|
|
return NULL;
|
1999-12-12 17:41:51 -04:00
|
|
|
GetWTitle(_self->ob_itself,
|
|
|
|
title);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
PyMac_BuildStr255, title);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_SetWindowProxyFSSpec(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
FSSpec inFile;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
PyMac_GetFSSpec, &inFile))
|
|
|
|
return NULL;
|
|
|
|
_err = SetWindowProxyFSSpec(_self->ob_itself,
|
|
|
|
&inFile);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_GetWindowProxyFSSpec(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
FSSpec outFile;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = GetWindowProxyFSSpec(_self->ob_itself,
|
|
|
|
&outFile);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("O&",
|
2000-06-02 18:35:07 -03:00
|
|
|
PyMac_BuildFSSpec, outFile);
|
1999-12-12 17:41:51 -04:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_SetWindowProxyAlias(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
AliasHandle alias;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
ResObj_Convert, &alias))
|
|
|
|
return NULL;
|
|
|
|
_err = SetWindowProxyAlias(_self->ob_itself,
|
|
|
|
alias);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_GetWindowProxyAlias(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
AliasHandle alias;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = GetWindowProxyAlias(_self->ob_itself,
|
|
|
|
&alias);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
ResObj_New, alias);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_SetWindowProxyCreatorAndType(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
OSType fileCreator;
|
|
|
|
OSType fileType;
|
|
|
|
SInt16 vRefNum;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&O&h",
|
|
|
|
PyMac_GetOSType, &fileCreator,
|
|
|
|
PyMac_GetOSType, &fileType,
|
|
|
|
&vRefNum))
|
|
|
|
return NULL;
|
|
|
|
_err = SetWindowProxyCreatorAndType(_self->ob_itself,
|
|
|
|
fileCreator,
|
|
|
|
fileType,
|
|
|
|
vRefNum);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_GetWindowProxyIcon(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
IconRef outIcon;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = GetWindowProxyIcon(_self->ob_itself,
|
|
|
|
&outIcon);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
ResObj_New, outIcon);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_SetWindowProxyIcon(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
IconRef icon;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
ResObj_Convert, &icon))
|
|
|
|
return NULL;
|
|
|
|
_err = SetWindowProxyIcon(_self->ob_itself,
|
|
|
|
icon);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_RemoveWindowProxy(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = RemoveWindowProxy(_self->ob_itself);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *WinObj_BeginWindowProxyDrag(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
DragReference outNewDrag;
|
|
|
|
RgnHandle outDragOutlineRgn;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
ResObj_Convert, &outDragOutlineRgn))
|
|
|
|
return NULL;
|
|
|
|
_err = BeginWindowProxyDrag(_self->ob_itself,
|
|
|
|
&outNewDrag,
|
|
|
|
outDragOutlineRgn);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
DragObj_New, outNewDrag);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_EndWindowProxyDrag(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
DragReference theDrag;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
DragObj_Convert, &theDrag))
|
|
|
|
return NULL;
|
|
|
|
_err = EndWindowProxyDrag(_self->ob_itself,
|
|
|
|
theDrag);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_TrackWindowProxyFromExistingDrag(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Point startPt;
|
|
|
|
DragReference drag;
|
|
|
|
RgnHandle inDragOutlineRgn;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&O&O&",
|
|
|
|
PyMac_GetPoint, &startPt,
|
|
|
|
DragObj_Convert, &drag,
|
|
|
|
ResObj_Convert, &inDragOutlineRgn))
|
|
|
|
return NULL;
|
|
|
|
_err = TrackWindowProxyFromExistingDrag(_self->ob_itself,
|
|
|
|
startPt,
|
|
|
|
drag,
|
|
|
|
inDragOutlineRgn);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1999-12-12 17:41:51 -04:00
|
|
|
static PyObject *WinObj_TrackWindowProxyDrag(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Point startPt;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
PyMac_GetPoint, &startPt))
|
|
|
|
return NULL;
|
|
|
|
_err = TrackWindowProxyDrag(_self->ob_itself,
|
|
|
|
startPt);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_IsWindowModified(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
Boolean _rv;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_rv = IsWindowModified(_self->ob_itself);
|
|
|
|
_res = Py_BuildValue("b",
|
|
|
|
_rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_SetWindowModified(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Boolean modified;
|
|
|
|
if (!PyArg_ParseTuple(_args, "b",
|
|
|
|
&modified))
|
|
|
|
return NULL;
|
|
|
|
_err = SetWindowModified(_self->ob_itself,
|
|
|
|
modified);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_IsWindowPathSelectClick(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
Boolean _rv;
|
|
|
|
EventRecord event;
|
2000-12-12 18:10:21 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
PyMac_GetEventRecord, &event))
|
1999-12-12 17:41:51 -04:00
|
|
|
return NULL;
|
|
|
|
_rv = IsWindowPathSelectClick(_self->ob_itself,
|
|
|
|
&event);
|
2000-12-12 18:10:21 -04:00
|
|
|
_res = Py_BuildValue("b",
|
|
|
|
_rv);
|
1999-12-12 17:41:51 -04:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-14 18:29:00 -04:00
|
|
|
static PyObject *WinObj_WindowPathSelect(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
MenuHandle menu;
|
|
|
|
SInt32 outMenuResult;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
MenuObj_Convert, &menu))
|
|
|
|
return NULL;
|
|
|
|
_err = WindowPathSelect(_self->ob_itself,
|
|
|
|
menu,
|
|
|
|
&outMenuResult);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("l",
|
|
|
|
outMenuResult);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1999-12-12 17:41:51 -04:00
|
|
|
static PyObject *WinObj_HiliteWindowFrameForDrag(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Boolean hilited;
|
|
|
|
if (!PyArg_ParseTuple(_args, "b",
|
|
|
|
&hilited))
|
|
|
|
return NULL;
|
|
|
|
_err = HiliteWindowFrameForDrag(_self->ob_itself,
|
|
|
|
hilited);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_TransitionWindow(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
WindowTransitionEffect effect;
|
|
|
|
WindowTransitionAction action;
|
|
|
|
Rect rect;
|
|
|
|
if (!PyArg_ParseTuple(_args, "llO&",
|
|
|
|
&effect,
|
|
|
|
&action,
|
|
|
|
PyMac_GetRect, &rect))
|
|
|
|
return NULL;
|
|
|
|
_err = TransitionWindow(_self->ob_itself,
|
|
|
|
effect,
|
|
|
|
action,
|
|
|
|
&rect);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_MacMoveWindow(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
short hGlobal;
|
|
|
|
short vGlobal;
|
|
|
|
Boolean front;
|
|
|
|
if (!PyArg_ParseTuple(_args, "hhb",
|
|
|
|
&hGlobal,
|
|
|
|
&vGlobal,
|
|
|
|
&front))
|
|
|
|
return NULL;
|
|
|
|
MacMoveWindow(_self->ob_itself,
|
|
|
|
hGlobal,
|
|
|
|
vGlobal,
|
|
|
|
front);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_SizeWindow(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
short w;
|
|
|
|
short h;
|
|
|
|
Boolean fUpdate;
|
|
|
|
if (!PyArg_ParseTuple(_args, "hhb",
|
|
|
|
&w,
|
|
|
|
&h,
|
|
|
|
&fUpdate))
|
|
|
|
return NULL;
|
|
|
|
SizeWindow(_self->ob_itself,
|
|
|
|
w,
|
|
|
|
h,
|
|
|
|
fUpdate);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_GrowWindow(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
long _rv;
|
|
|
|
Point startPt;
|
|
|
|
Rect bBox;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&O&",
|
|
|
|
PyMac_GetPoint, &startPt,
|
|
|
|
PyMac_GetRect, &bBox))
|
|
|
|
return NULL;
|
|
|
|
_rv = GrowWindow(_self->ob_itself,
|
|
|
|
startPt,
|
|
|
|
&bBox);
|
|
|
|
_res = Py_BuildValue("l",
|
|
|
|
_rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_DragWindow(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
Point startPt;
|
|
|
|
Rect boundsRect;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&O&",
|
|
|
|
PyMac_GetPoint, &startPt,
|
|
|
|
PyMac_GetRect, &boundsRect))
|
|
|
|
return NULL;
|
|
|
|
DragWindow(_self->ob_itself,
|
|
|
|
startPt,
|
|
|
|
&boundsRect);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_ZoomWindow(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
WindowPartCode partCode;
|
1999-12-12 17:41:51 -04:00
|
|
|
Boolean front;
|
|
|
|
if (!PyArg_ParseTuple(_args, "hb",
|
|
|
|
&partCode,
|
|
|
|
&front))
|
|
|
|
return NULL;
|
|
|
|
ZoomWindow(_self->ob_itself,
|
|
|
|
partCode,
|
|
|
|
front);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
1995-01-30 07:53:55 -04:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1998-02-20 12:02:09 -04:00
|
|
|
static PyObject *WinObj_IsWindowCollapsable(_self, _args)
|
1995-01-30 07:53:55 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
Boolean _rv;
|
1998-02-20 12:02:09 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
1995-01-30 07:53:55 -04:00
|
|
|
return NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
_rv = IsWindowCollapsable(_self->ob_itself);
|
1995-01-30 07:53:55 -04:00
|
|
|
_res = Py_BuildValue("b",
|
|
|
|
_rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1998-02-20 12:02:09 -04:00
|
|
|
static PyObject *WinObj_IsWindowCollapsed(_self, _args)
|
1997-08-15 11:38:05 -03:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
Boolean _rv;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
1997-08-15 11:38:05 -03:00
|
|
|
return NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
_rv = IsWindowCollapsed(_self->ob_itself);
|
|
|
|
_res = Py_BuildValue("b",
|
|
|
|
_rv);
|
1997-08-15 11:38:05 -03:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1998-02-20 12:02:09 -04:00
|
|
|
static PyObject *WinObj_CollapseWindow(_self, _args)
|
1995-01-30 07:53:55 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
1999-03-04 18:53:24 -04:00
|
|
|
OSStatus _err;
|
1999-12-12 17:41:51 -04:00
|
|
|
Boolean collapse;
|
1998-02-20 12:02:09 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, "b",
|
1999-12-12 17:41:51 -04:00
|
|
|
&collapse))
|
1995-01-30 07:53:55 -04:00
|
|
|
return NULL;
|
1999-03-04 18:53:24 -04:00
|
|
|
_err = CollapseWindow(_self->ob_itself,
|
1999-12-12 17:41:51 -04:00
|
|
|
collapse);
|
1999-03-04 18:53:24 -04:00
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
1995-01-30 07:53:55 -04:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *WinObj_GetWindowBounds(_self, _args)
|
1995-01-30 07:53:55 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
1999-12-12 17:41:51 -04:00
|
|
|
OSStatus _err;
|
2000-12-12 18:10:21 -04:00
|
|
|
WindowRegionCode regionCode;
|
|
|
|
Rect globalBounds;
|
|
|
|
if (!PyArg_ParseTuple(_args, "H",
|
|
|
|
®ionCode))
|
1999-12-12 17:41:51 -04:00
|
|
|
return NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
_err = GetWindowBounds(_self->ob_itself,
|
|
|
|
regionCode,
|
|
|
|
&globalBounds);
|
1999-12-12 17:41:51 -04:00
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
2000-12-12 18:10:21 -04:00
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
PyMac_BuildRect, &globalBounds);
|
1995-01-30 07:53:55 -04:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-14 18:29:00 -04:00
|
|
|
static PyObject *WinObj_ResizeWindow(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
Boolean _rv;
|
|
|
|
Point startPoint;
|
|
|
|
Rect sizeConstraints;
|
|
|
|
Rect newContentRect;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&O&",
|
|
|
|
PyMac_GetPoint, &startPoint,
|
|
|
|
PyMac_GetRect, &sizeConstraints))
|
|
|
|
return NULL;
|
|
|
|
_rv = ResizeWindow(_self->ob_itself,
|
|
|
|
startPoint,
|
|
|
|
&sizeConstraints,
|
|
|
|
&newContentRect);
|
|
|
|
_res = Py_BuildValue("bO&",
|
|
|
|
_rv,
|
|
|
|
PyMac_BuildRect, &newContentRect);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1999-12-12 17:41:51 -04:00
|
|
|
static PyObject *WinObj_SetWindowBounds(_self, _args)
|
1995-01-30 07:53:55 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
1999-12-12 17:41:51 -04:00
|
|
|
OSStatus _err;
|
|
|
|
WindowRegionCode regionCode;
|
|
|
|
Rect globalBounds;
|
2000-07-07 10:09:35 -03:00
|
|
|
if (!PyArg_ParseTuple(_args, "HO&",
|
1999-12-12 17:41:51 -04:00
|
|
|
®ionCode,
|
|
|
|
PyMac_GetRect, &globalBounds))
|
1995-01-30 07:53:55 -04:00
|
|
|
return NULL;
|
1999-12-12 17:41:51 -04:00
|
|
|
_err = SetWindowBounds(_self->ob_itself,
|
|
|
|
regionCode,
|
|
|
|
&globalBounds);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
1998-02-20 12:02:09 -04:00
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *WinObj_RepositionWindow(_self, _args)
|
1998-02-20 12:02:09 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
1999-12-12 17:41:51 -04:00
|
|
|
OSStatus _err;
|
2000-12-12 18:10:21 -04:00
|
|
|
WindowPtr parentWindow;
|
|
|
|
WindowPositionMethod method;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&l",
|
|
|
|
WinObj_Convert, &parentWindow,
|
|
|
|
&method))
|
1998-02-20 12:02:09 -04:00
|
|
|
return NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
_err = RepositionWindow(_self->ob_itself,
|
|
|
|
parentWindow,
|
|
|
|
method);
|
1999-12-12 17:41:51 -04:00
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
2000-12-12 18:10:21 -04:00
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
1999-12-12 17:41:51 -04:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_MoveWindowStructure(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
short hGlobal;
|
|
|
|
short vGlobal;
|
|
|
|
if (!PyArg_ParseTuple(_args, "hh",
|
|
|
|
&hGlobal,
|
|
|
|
&vGlobal))
|
|
|
|
return NULL;
|
|
|
|
_err = MoveWindowStructure(_self->ob_itself,
|
|
|
|
hGlobal,
|
|
|
|
vGlobal);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
1998-02-20 12:02:09 -04:00
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1999-12-12 17:41:51 -04:00
|
|
|
static PyObject *WinObj_IsWindowInStandardState(_self, _args)
|
1998-02-20 12:02:09 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
1999-12-12 17:41:51 -04:00
|
|
|
Boolean _rv;
|
|
|
|
Point idealSize;
|
|
|
|
Rect idealStandardState;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
1998-02-20 12:02:09 -04:00
|
|
|
return NULL;
|
1999-12-12 17:41:51 -04:00
|
|
|
_rv = IsWindowInStandardState(_self->ob_itself,
|
|
|
|
&idealSize,
|
|
|
|
&idealStandardState);
|
|
|
|
_res = Py_BuildValue("bO&O&",
|
|
|
|
_rv,
|
|
|
|
PyMac_BuildPoint, idealSize,
|
|
|
|
PyMac_BuildRect, &idealStandardState);
|
1995-01-30 07:53:55 -04:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1999-12-12 17:41:51 -04:00
|
|
|
static PyObject *WinObj_ZoomWindowIdeal(_self, _args)
|
1995-01-30 07:53:55 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
1999-12-12 17:41:51 -04:00
|
|
|
OSStatus _err;
|
2000-12-12 18:10:21 -04:00
|
|
|
WindowPartCode partCode;
|
1999-12-12 17:41:51 -04:00
|
|
|
Point ioIdealSize;
|
|
|
|
if (!PyArg_ParseTuple(_args, "h",
|
|
|
|
&partCode))
|
1995-01-30 07:53:55 -04:00
|
|
|
return NULL;
|
1999-12-12 17:41:51 -04:00
|
|
|
_err = ZoomWindowIdeal(_self->ob_itself,
|
|
|
|
partCode,
|
|
|
|
&ioIdealSize);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
PyMac_BuildPoint, ioIdealSize);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_GetWindowIdealUserState(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect userState;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = GetWindowIdealUserState(_self->ob_itself,
|
|
|
|
&userState);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
PyMac_BuildRect, &userState);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_SetWindowIdealUserState(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Rect userState;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = SetWindowIdealUserState(_self->ob_itself,
|
|
|
|
&userState);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
PyMac_BuildRect, &userState);
|
1995-01-30 07:53:55 -04:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1998-02-20 12:02:09 -04:00
|
|
|
static PyObject *WinObj_HideWindow(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
HideWindow(_self->ob_itself);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1998-04-21 12:23:55 -03:00
|
|
|
static PyObject *WinObj_MacShowWindow(_self, _args)
|
1998-02-20 12:02:09 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
1998-04-21 12:23:55 -03:00
|
|
|
MacShowWindow(_self->ob_itself);
|
1998-02-20 12:02:09 -04:00
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_ShowHide(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
Boolean showFlag;
|
|
|
|
if (!PyArg_ParseTuple(_args, "b",
|
|
|
|
&showFlag))
|
|
|
|
return NULL;
|
|
|
|
ShowHide(_self->ob_itself,
|
|
|
|
showFlag);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
#if TARGET_API_MAC_CARBON
|
|
|
|
|
|
|
|
static PyObject *WinObj_GetWindowPropertyAttributes(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
OSType propertyCreator;
|
|
|
|
OSType propertyTag;
|
|
|
|
UInt32 attributes;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&O&",
|
|
|
|
PyMac_GetOSType, &propertyCreator,
|
|
|
|
PyMac_GetOSType, &propertyTag))
|
|
|
|
return NULL;
|
|
|
|
_err = GetWindowPropertyAttributes(_self->ob_itself,
|
|
|
|
propertyCreator,
|
|
|
|
propertyTag,
|
|
|
|
&attributes);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("l",
|
|
|
|
attributes);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if TARGET_API_MAC_CARBON
|
|
|
|
|
|
|
|
static PyObject *WinObj_ChangeWindowPropertyAttributes(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
OSType propertyCreator;
|
|
|
|
OSType propertyTag;
|
|
|
|
UInt32 attributesToSet;
|
|
|
|
UInt32 attributesToClear;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&O&ll",
|
|
|
|
PyMac_GetOSType, &propertyCreator,
|
|
|
|
PyMac_GetOSType, &propertyTag,
|
|
|
|
&attributesToSet,
|
|
|
|
&attributesToClear))
|
|
|
|
return NULL;
|
|
|
|
_err = ChangeWindowPropertyAttributes(_self->ob_itself,
|
|
|
|
propertyCreator,
|
|
|
|
propertyTag,
|
|
|
|
attributesToSet,
|
|
|
|
attributesToClear);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
1998-02-20 12:02:09 -04:00
|
|
|
static PyObject *WinObj_TrackBox(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
Boolean _rv;
|
|
|
|
Point thePt;
|
2000-12-12 18:10:21 -04:00
|
|
|
WindowPartCode partCode;
|
1998-02-20 12:02:09 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&h",
|
|
|
|
PyMac_GetPoint, &thePt,
|
|
|
|
&partCode))
|
|
|
|
return NULL;
|
|
|
|
_rv = TrackBox(_self->ob_itself,
|
|
|
|
thePt,
|
|
|
|
partCode);
|
|
|
|
_res = Py_BuildValue("b",
|
|
|
|
_rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_TrackGoAway(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
Boolean _rv;
|
|
|
|
Point thePt;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
PyMac_GetPoint, &thePt))
|
|
|
|
return NULL;
|
|
|
|
_rv = TrackGoAway(_self->ob_itself,
|
|
|
|
thePt);
|
|
|
|
_res = Py_BuildValue("b",
|
|
|
|
_rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
2000-06-02 18:35:07 -03:00
|
|
|
|
1997-08-15 11:38:05 -03:00
|
|
|
static PyObject *WinObj_GetAuxWin(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
Boolean _rv;
|
|
|
|
AuxWinHandle awHndl;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_rv = GetAuxWin(_self->ob_itself,
|
|
|
|
&awHndl);
|
|
|
|
_res = Py_BuildValue("bO&",
|
|
|
|
_rv,
|
|
|
|
ResObj_New, awHndl);
|
|
|
|
return _res;
|
|
|
|
}
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
1997-08-15 11:38:05 -03:00
|
|
|
|
2001-02-28 19:32:42 -04:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *WinObj_GetWindowGoAwayFlag(_self, _args)
|
1995-11-15 11:18:47 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
Boolean _rv;
|
1995-11-15 11:18:47 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
_rv = GetWindowGoAwayFlag(_self->ob_itself);
|
|
|
|
_res = Py_BuildValue("b",
|
|
|
|
_rv);
|
1995-11-15 11:18:47 -04:00
|
|
|
return _res;
|
|
|
|
}
|
2001-02-28 19:32:42 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !TARGET_API_MAC_CARBON
|
1995-11-15 11:18:47 -04:00
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *WinObj_GetWindowSpareFlag(_self, _args)
|
1995-11-14 06:48:54 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
Boolean _rv;
|
1995-11-14 06:48:54 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
_rv = GetWindowSpareFlag(_self->ob_itself);
|
|
|
|
_res = Py_BuildValue("b",
|
|
|
|
_rv);
|
1995-11-14 06:48:54 -04:00
|
|
|
return _res;
|
|
|
|
}
|
2001-02-28 19:32:42 -04:00
|
|
|
#endif
|
1995-11-14 06:48:54 -04:00
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *WinObj_GetWindowPort(_self, _args)
|
1995-11-14 06:48:54 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
CGrafPtr _rv;
|
1995-11-14 06:48:54 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
_rv = GetWindowPort(_self->ob_itself);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
GrafObj_New, _rv);
|
1995-11-14 06:48:54 -04:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *WinObj_GetWindowKind(_self, _args)
|
1995-11-14 06:48:54 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
short _rv;
|
1995-11-14 06:48:54 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
_rv = GetWindowKind(_self->ob_itself);
|
|
|
|
_res = Py_BuildValue("h",
|
1995-11-14 06:48:54 -04:00
|
|
|
_rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *WinObj_MacIsWindowVisible(_self, _args)
|
1995-11-14 06:48:54 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
Boolean _rv;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
_rv = MacIsWindowVisible(_self->ob_itself);
|
1995-11-14 06:48:54 -04:00
|
|
|
_res = Py_BuildValue("b",
|
|
|
|
_rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *WinObj_IsWindowHilited(_self, _args)
|
1995-11-14 06:48:54 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
Boolean _rv;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
_rv = IsWindowHilited(_self->ob_itself);
|
1995-11-14 06:48:54 -04:00
|
|
|
_res = Py_BuildValue("b",
|
|
|
|
_rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
#if TARGET_API_MAC_CARBON
|
2000-06-02 18:35:07 -03:00
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *WinObj_IsWindowUpdatePending(_self, _args)
|
1995-11-14 06:48:54 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
Boolean _rv;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
_rv = IsWindowUpdatePending(_self->ob_itself);
|
1995-11-14 06:48:54 -04:00
|
|
|
_res = Py_BuildValue("b",
|
|
|
|
_rv);
|
|
|
|
return _res;
|
|
|
|
}
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *WinObj_MacGetNextWindow(_self, _args)
|
1995-11-15 11:18:47 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
WindowPtr _rv;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
1995-11-15 11:18:47 -04:00
|
|
|
return NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
_rv = MacGetNextWindow(_self->ob_itself);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
WinObj_New, _rv);
|
1995-11-15 11:18:47 -04:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *WinObj_GetWindowStandardState(_self, _args)
|
1995-11-15 11:18:47 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
Rect rect;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
1995-11-15 11:18:47 -04:00
|
|
|
return NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
GetWindowStandardState(_self->ob_itself,
|
|
|
|
&rect);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
PyMac_BuildRect, &rect);
|
1995-11-15 11:18:47 -04:00
|
|
|
return _res;
|
|
|
|
}
|
2000-06-02 18:35:07 -03:00
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *WinObj_GetWindowUserState(_self, _args)
|
1995-11-14 06:48:54 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
Rect rect;
|
1995-11-14 06:48:54 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
GetWindowUserState(_self->ob_itself,
|
|
|
|
&rect);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
PyMac_BuildRect, &rect);
|
1995-11-14 06:48:54 -04:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *WinObj_SetWindowKind(_self, _args)
|
1995-11-14 06:48:54 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
short kind;
|
|
|
|
if (!PyArg_ParseTuple(_args, "h",
|
|
|
|
&kind))
|
1995-11-14 06:48:54 -04:00
|
|
|
return NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
SetWindowKind(_self->ob_itself,
|
|
|
|
kind);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
1995-11-14 06:48:54 -04:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *WinObj_SetWindowStandardState(_self, _args)
|
1995-11-14 06:48:54 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
Rect rect;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
PyMac_GetRect, &rect))
|
1995-11-14 06:48:54 -04:00
|
|
|
return NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
SetWindowStandardState(_self->ob_itself,
|
|
|
|
&rect);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
1995-11-14 06:48:54 -04:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *WinObj_SetWindowUserState(_self, _args)
|
1995-11-14 06:48:54 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
Rect rect;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
PyMac_GetRect, &rect))
|
1995-11-14 06:48:54 -04:00
|
|
|
return NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
SetWindowUserState(_self->ob_itself,
|
|
|
|
&rect);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
1995-11-14 06:48:54 -04:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *WinObj_SetPortWindowPort(_self, _args)
|
1995-11-14 06:48:54 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
1995-11-14 06:48:54 -04:00
|
|
|
return NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
SetPortWindowPort(_self->ob_itself);
|
1995-11-14 06:48:54 -04:00
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *WinObj_GetWindowPortBounds(_self, _args)
|
1995-11-14 06:48:54 -04:00
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
Rect bounds;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
1995-11-14 06:48:54 -04:00
|
|
|
return NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
GetWindowPortBounds(_self->ob_itself,
|
|
|
|
&bounds);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
PyMac_BuildRect, &bounds);
|
1995-11-14 06:48:54 -04:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-19 18:23:06 -04:00
|
|
|
static PyObject *WinObj_IsWindowVisible(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
Boolean _rv;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_rv = IsWindowVisible(_self->ob_itself);
|
|
|
|
_res = Py_BuildValue("b",
|
|
|
|
_rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2001-01-09 18:09:31 -04:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
|
|
|
|
2000-12-19 18:23:06 -04:00
|
|
|
static PyObject *WinObj_GetWindowZoomFlag(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
Boolean _rv;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_rv = GetWindowZoomFlag(_self->ob_itself);
|
|
|
|
_res = Py_BuildValue("b",
|
|
|
|
_rv);
|
|
|
|
return _res;
|
|
|
|
}
|
2001-01-09 18:09:31 -04:00
|
|
|
#endif
|
2000-12-19 18:23:06 -04:00
|
|
|
|
|
|
|
static PyObject *WinObj_GetWindowStructureRgn(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
RgnHandle r;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
ResObj_Convert, &r))
|
|
|
|
return NULL;
|
|
|
|
GetWindowStructureRgn(_self->ob_itself,
|
|
|
|
r);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_GetWindowContentRgn(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
RgnHandle r;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
ResObj_Convert, &r))
|
|
|
|
return NULL;
|
|
|
|
GetWindowContentRgn(_self->ob_itself,
|
|
|
|
r);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_GetWindowUpdateRgn(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
RgnHandle r;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
ResObj_Convert, &r))
|
|
|
|
return NULL;
|
|
|
|
GetWindowUpdateRgn(_self->ob_itself,
|
|
|
|
r);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2001-01-09 18:09:31 -04:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
|
|
|
|
2000-12-19 18:23:06 -04:00
|
|
|
static PyObject *WinObj_GetWindowTitleWidth(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
short _rv;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_rv = GetWindowTitleWidth(_self->ob_itself);
|
|
|
|
_res = Py_BuildValue("h",
|
|
|
|
_rv);
|
|
|
|
return _res;
|
|
|
|
}
|
2001-01-09 18:09:31 -04:00
|
|
|
#endif
|
2000-12-19 18:23:06 -04:00
|
|
|
|
|
|
|
static PyObject *WinObj_GetNextWindow(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
WindowPtr _rv;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_rv = GetNextWindow(_self->ob_itself);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
WinObj_WhichWindow, _rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
1998-10-22 12:08:00 -03:00
|
|
|
|
1998-04-24 07:28:20 -03:00
|
|
|
static PyObject *WinObj_CloseWindow(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
CloseWindow(_self->ob_itself);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
1998-04-24 07:28:20 -03:00
|
|
|
|
|
|
|
static PyObject *WinObj_MoveWindow(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
short hGlobal;
|
|
|
|
short vGlobal;
|
|
|
|
Boolean front;
|
|
|
|
if (!PyArg_ParseTuple(_args, "hhb",
|
|
|
|
&hGlobal,
|
|
|
|
&vGlobal,
|
|
|
|
&front))
|
|
|
|
return NULL;
|
|
|
|
MoveWindow(_self->ob_itself,
|
|
|
|
hGlobal,
|
|
|
|
vGlobal,
|
|
|
|
front);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *WinObj_ShowWindow(_self, _args)
|
|
|
|
WindowObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
ShowWindow(_self->ob_itself);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1995-01-30 07:53:55 -04:00
|
|
|
static PyMethodDef WinObj_methods[] = {
|
1999-12-12 17:41:51 -04:00
|
|
|
{"GetWindowOwnerCount", (PyCFunction)WinObj_GetWindowOwnerCount, 1,
|
|
|
|
"() -> (UInt32 outCount)"},
|
|
|
|
{"CloneWindow", (PyCFunction)WinObj_CloneWindow, 1,
|
|
|
|
"() -> None"},
|
2000-12-12 18:10:21 -04:00
|
|
|
|
|
|
|
#if TARGET_API_MAC_CARBON
|
|
|
|
{"ReshapeCustomWindow", (PyCFunction)WinObj_ReshapeCustomWindow, 1,
|
|
|
|
"() -> None"},
|
|
|
|
#endif
|
1999-12-12 17:41:51 -04:00
|
|
|
{"GetWindowClass", (PyCFunction)WinObj_GetWindowClass, 1,
|
|
|
|
"() -> (WindowClass outClass)"},
|
|
|
|
{"GetWindowAttributes", (PyCFunction)WinObj_GetWindowAttributes, 1,
|
|
|
|
"() -> (WindowAttributes outAttributes)"},
|
2000-06-02 18:35:07 -03:00
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
#if TARGET_API_MAC_CARBON
|
|
|
|
{"ChangeWindowAttributes", (PyCFunction)WinObj_ChangeWindowAttributes, 1,
|
|
|
|
"(WindowAttributes setTheseAttributes, WindowAttributes clearTheseAttributes) -> None"},
|
|
|
|
#endif
|
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
1998-02-20 12:02:09 -04:00
|
|
|
{"SetWinColor", (PyCFunction)WinObj_SetWinColor, 1,
|
|
|
|
"(WCTabHandle newColorTable) -> None"},
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
1999-12-12 17:41:51 -04:00
|
|
|
{"SetWindowContentColor", (PyCFunction)WinObj_SetWindowContentColor, 1,
|
2000-12-12 18:10:21 -04:00
|
|
|
"(RGBColor color) -> None"},
|
1999-12-12 17:41:51 -04:00
|
|
|
{"GetWindowContentColor", (PyCFunction)WinObj_GetWindowContentColor, 1,
|
|
|
|
"() -> (RGBColor color)"},
|
|
|
|
{"GetWindowContentPattern", (PyCFunction)WinObj_GetWindowContentPattern, 1,
|
|
|
|
"(PixPatHandle outPixPat) -> None"},
|
|
|
|
{"SetWindowContentPattern", (PyCFunction)WinObj_SetWindowContentPattern, 1,
|
|
|
|
"(PixPatHandle pixPat) -> None"},
|
2000-12-12 18:10:21 -04:00
|
|
|
|
|
|
|
#if TARGET_API_MAC_CARBON
|
|
|
|
{"ScrollWindowRect", (PyCFunction)WinObj_ScrollWindowRect, 1,
|
|
|
|
"(Rect inScrollRect, SInt16 inHPixels, SInt16 inVPixels, ScrollWindowOptions inOptions, RgnHandle outExposedRgn) -> None"},
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if TARGET_API_MAC_CARBON
|
|
|
|
{"ScrollWindowRegion", (PyCFunction)WinObj_ScrollWindowRegion, 1,
|
|
|
|
"(RgnHandle inScrollRgn, SInt16 inHPixels, SInt16 inVPixels, ScrollWindowOptions inOptions, RgnHandle outExposedRgn) -> None"},
|
|
|
|
#endif
|
1998-02-20 12:02:09 -04:00
|
|
|
{"ClipAbove", (PyCFunction)WinObj_ClipAbove, 1,
|
1995-01-30 07:53:55 -04:00
|
|
|
"() -> None"},
|
2000-06-02 18:35:07 -03:00
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
1998-02-20 12:02:09 -04:00
|
|
|
{"SaveOld", (PyCFunction)WinObj_SaveOld, 1,
|
1995-01-30 07:53:55 -04:00
|
|
|
"() -> None"},
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
1998-02-20 12:02:09 -04:00
|
|
|
{"DrawNew", (PyCFunction)WinObj_DrawNew, 1,
|
|
|
|
"(Boolean update) -> None"},
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
2000-12-14 18:29:00 -04:00
|
|
|
{"PaintOne", (PyCFunction)WinObj_PaintOne, 1,
|
|
|
|
"(RgnHandle clobberedRgn) -> None"},
|
|
|
|
{"PaintBehind", (PyCFunction)WinObj_PaintBehind, 1,
|
|
|
|
"(RgnHandle clobberedRgn) -> None"},
|
1998-02-20 12:02:09 -04:00
|
|
|
{"CalcVis", (PyCFunction)WinObj_CalcVis, 1,
|
1995-01-30 07:53:55 -04:00
|
|
|
"() -> None"},
|
2000-12-14 18:29:00 -04:00
|
|
|
{"CalcVisBehind", (PyCFunction)WinObj_CalcVisBehind, 1,
|
|
|
|
"(RgnHandle clobberedRgn) -> None"},
|
1995-01-30 07:53:55 -04:00
|
|
|
{"BringToFront", (PyCFunction)WinObj_BringToFront, 1,
|
|
|
|
"() -> None"},
|
|
|
|
{"SendBehind", (PyCFunction)WinObj_SendBehind, 1,
|
|
|
|
"(WindowPtr behindWindow) -> None"},
|
1998-02-20 12:02:09 -04:00
|
|
|
{"SelectWindow", (PyCFunction)WinObj_SelectWindow, 1,
|
1995-01-30 07:53:55 -04:00
|
|
|
"() -> None"},
|
2000-12-12 18:10:21 -04:00
|
|
|
|
|
|
|
#if TARGET_API_MAC_CARBON
|
|
|
|
{"GetNextWindowOfClass", (PyCFunction)WinObj_GetNextWindowOfClass, 1,
|
|
|
|
"(WindowClass inWindowClass, Boolean mustBeVisible) -> (WindowPtr _rv)"},
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !TARGET_API_MAC_CARBON
|
|
|
|
{"IsValidWindowPtr", (PyCFunction)WinObj_IsValidWindowPtr, 1,
|
|
|
|
"() -> (Boolean _rv)"},
|
|
|
|
#endif
|
1998-04-21 12:23:55 -03:00
|
|
|
{"HiliteWindow", (PyCFunction)WinObj_HiliteWindow, 1,
|
|
|
|
"(Boolean fHilite) -> None"},
|
1995-01-30 07:53:55 -04:00
|
|
|
{"SetWRefCon", (PyCFunction)WinObj_SetWRefCon, 1,
|
|
|
|
"(long data) -> None"},
|
|
|
|
{"GetWRefCon", (PyCFunction)WinObj_GetWRefCon, 1,
|
|
|
|
"() -> (long _rv)"},
|
1995-11-14 06:48:54 -04:00
|
|
|
{"SetWindowPic", (PyCFunction)WinObj_SetWindowPic, 1,
|
|
|
|
"(PicHandle pic) -> None"},
|
|
|
|
{"GetWindowPic", (PyCFunction)WinObj_GetWindowPic, 1,
|
|
|
|
"() -> (PicHandle _rv)"},
|
1998-02-20 12:02:09 -04:00
|
|
|
{"GetWVariant", (PyCFunction)WinObj_GetWVariant, 1,
|
|
|
|
"() -> (short _rv)"},
|
1999-12-12 17:41:51 -04:00
|
|
|
{"GetWindowFeatures", (PyCFunction)WinObj_GetWindowFeatures, 1,
|
|
|
|
"() -> (UInt32 outFeatures)"},
|
|
|
|
{"GetWindowRegion", (PyCFunction)WinObj_GetWindowRegion, 1,
|
|
|
|
"(WindowRegionCode inRegionCode, RgnHandle ioWinRgn) -> None"},
|
1998-02-20 12:02:09 -04:00
|
|
|
{"BeginUpdate", (PyCFunction)WinObj_BeginUpdate, 1,
|
1995-01-30 07:53:55 -04:00
|
|
|
"() -> None"},
|
1998-02-20 12:02:09 -04:00
|
|
|
{"EndUpdate", (PyCFunction)WinObj_EndUpdate, 1,
|
1995-01-30 07:53:55 -04:00
|
|
|
"() -> None"},
|
1999-12-12 17:41:51 -04:00
|
|
|
{"InvalWindowRgn", (PyCFunction)WinObj_InvalWindowRgn, 1,
|
|
|
|
"(RgnHandle region) -> None"},
|
|
|
|
{"InvalWindowRect", (PyCFunction)WinObj_InvalWindowRect, 1,
|
|
|
|
"(Rect bounds) -> None"},
|
|
|
|
{"ValidWindowRgn", (PyCFunction)WinObj_ValidWindowRgn, 1,
|
|
|
|
"(RgnHandle region) -> None"},
|
|
|
|
{"ValidWindowRect", (PyCFunction)WinObj_ValidWindowRect, 1,
|
|
|
|
"(Rect bounds) -> None"},
|
1998-02-20 12:02:09 -04:00
|
|
|
{"DrawGrowIcon", (PyCFunction)WinObj_DrawGrowIcon, 1,
|
1995-01-30 07:53:55 -04:00
|
|
|
"() -> None"},
|
1998-02-20 12:02:09 -04:00
|
|
|
{"SetWTitle", (PyCFunction)WinObj_SetWTitle, 1,
|
|
|
|
"(Str255 title) -> None"},
|
|
|
|
{"GetWTitle", (PyCFunction)WinObj_GetWTitle, 1,
|
|
|
|
"() -> (Str255 title)"},
|
1999-12-12 17:41:51 -04:00
|
|
|
{"SetWindowProxyFSSpec", (PyCFunction)WinObj_SetWindowProxyFSSpec, 1,
|
|
|
|
"(FSSpec inFile) -> None"},
|
|
|
|
{"GetWindowProxyFSSpec", (PyCFunction)WinObj_GetWindowProxyFSSpec, 1,
|
|
|
|
"() -> (FSSpec outFile)"},
|
|
|
|
{"SetWindowProxyAlias", (PyCFunction)WinObj_SetWindowProxyAlias, 1,
|
|
|
|
"(AliasHandle alias) -> None"},
|
|
|
|
{"GetWindowProxyAlias", (PyCFunction)WinObj_GetWindowProxyAlias, 1,
|
|
|
|
"() -> (AliasHandle alias)"},
|
|
|
|
{"SetWindowProxyCreatorAndType", (PyCFunction)WinObj_SetWindowProxyCreatorAndType, 1,
|
|
|
|
"(OSType fileCreator, OSType fileType, SInt16 vRefNum) -> None"},
|
|
|
|
{"GetWindowProxyIcon", (PyCFunction)WinObj_GetWindowProxyIcon, 1,
|
|
|
|
"() -> (IconRef outIcon)"},
|
|
|
|
{"SetWindowProxyIcon", (PyCFunction)WinObj_SetWindowProxyIcon, 1,
|
|
|
|
"(IconRef icon) -> None"},
|
|
|
|
{"RemoveWindowProxy", (PyCFunction)WinObj_RemoveWindowProxy, 1,
|
|
|
|
"() -> None"},
|
2000-12-12 18:10:21 -04:00
|
|
|
{"BeginWindowProxyDrag", (PyCFunction)WinObj_BeginWindowProxyDrag, 1,
|
|
|
|
"(RgnHandle outDragOutlineRgn) -> (DragReference outNewDrag)"},
|
|
|
|
{"EndWindowProxyDrag", (PyCFunction)WinObj_EndWindowProxyDrag, 1,
|
|
|
|
"(DragReference theDrag) -> None"},
|
|
|
|
{"TrackWindowProxyFromExistingDrag", (PyCFunction)WinObj_TrackWindowProxyFromExistingDrag, 1,
|
|
|
|
"(Point startPt, DragReference drag, RgnHandle inDragOutlineRgn) -> None"},
|
1999-12-12 17:41:51 -04:00
|
|
|
{"TrackWindowProxyDrag", (PyCFunction)WinObj_TrackWindowProxyDrag, 1,
|
|
|
|
"(Point startPt) -> None"},
|
|
|
|
{"IsWindowModified", (PyCFunction)WinObj_IsWindowModified, 1,
|
1998-02-20 12:02:09 -04:00
|
|
|
"() -> (Boolean _rv)"},
|
1999-12-12 17:41:51 -04:00
|
|
|
{"SetWindowModified", (PyCFunction)WinObj_SetWindowModified, 1,
|
|
|
|
"(Boolean modified) -> None"},
|
|
|
|
{"IsWindowPathSelectClick", (PyCFunction)WinObj_IsWindowPathSelectClick, 1,
|
2000-12-12 18:10:21 -04:00
|
|
|
"(EventRecord event) -> (Boolean _rv)"},
|
2000-12-14 18:29:00 -04:00
|
|
|
{"WindowPathSelect", (PyCFunction)WinObj_WindowPathSelect, 1,
|
|
|
|
"(MenuHandle menu) -> (SInt32 outMenuResult)"},
|
1999-12-12 17:41:51 -04:00
|
|
|
{"HiliteWindowFrameForDrag", (PyCFunction)WinObj_HiliteWindowFrameForDrag, 1,
|
|
|
|
"(Boolean hilited) -> None"},
|
|
|
|
{"TransitionWindow", (PyCFunction)WinObj_TransitionWindow, 1,
|
|
|
|
"(WindowTransitionEffect effect, WindowTransitionAction action, Rect rect) -> None"},
|
1998-04-21 12:23:55 -03:00
|
|
|
{"MacMoveWindow", (PyCFunction)WinObj_MacMoveWindow, 1,
|
1998-02-20 12:02:09 -04:00
|
|
|
"(short hGlobal, short vGlobal, Boolean front) -> None"},
|
|
|
|
{"SizeWindow", (PyCFunction)WinObj_SizeWindow, 1,
|
|
|
|
"(short w, short h, Boolean fUpdate) -> None"},
|
1995-01-30 07:53:55 -04:00
|
|
|
{"GrowWindow", (PyCFunction)WinObj_GrowWindow, 1,
|
|
|
|
"(Point startPt, Rect bBox) -> (long _rv)"},
|
1998-02-20 12:02:09 -04:00
|
|
|
{"DragWindow", (PyCFunction)WinObj_DragWindow, 1,
|
|
|
|
"(Point startPt, Rect boundsRect) -> None"},
|
1999-12-12 17:41:51 -04:00
|
|
|
{"ZoomWindow", (PyCFunction)WinObj_ZoomWindow, 1,
|
2000-12-12 18:10:21 -04:00
|
|
|
"(WindowPartCode partCode, Boolean front) -> None"},
|
1999-12-12 17:41:51 -04:00
|
|
|
{"IsWindowCollapsable", (PyCFunction)WinObj_IsWindowCollapsable, 1,
|
|
|
|
"() -> (Boolean _rv)"},
|
|
|
|
{"IsWindowCollapsed", (PyCFunction)WinObj_IsWindowCollapsed, 1,
|
|
|
|
"() -> (Boolean _rv)"},
|
|
|
|
{"CollapseWindow", (PyCFunction)WinObj_CollapseWindow, 1,
|
|
|
|
"(Boolean collapse) -> None"},
|
|
|
|
{"GetWindowBounds", (PyCFunction)WinObj_GetWindowBounds, 1,
|
|
|
|
"(WindowRegionCode regionCode) -> (Rect globalBounds)"},
|
2000-12-14 18:29:00 -04:00
|
|
|
{"ResizeWindow", (PyCFunction)WinObj_ResizeWindow, 1,
|
|
|
|
"(Point startPoint, Rect sizeConstraints) -> (Boolean _rv, Rect newContentRect)"},
|
2000-12-12 18:10:21 -04:00
|
|
|
{"SetWindowBounds", (PyCFunction)WinObj_SetWindowBounds, 1,
|
|
|
|
"(WindowRegionCode regionCode, Rect globalBounds) -> None"},
|
|
|
|
{"RepositionWindow", (PyCFunction)WinObj_RepositionWindow, 1,
|
|
|
|
"(WindowPtr parentWindow, WindowPositionMethod method) -> None"},
|
1999-12-12 17:41:51 -04:00
|
|
|
{"MoveWindowStructure", (PyCFunction)WinObj_MoveWindowStructure, 1,
|
|
|
|
"(short hGlobal, short vGlobal) -> None"},
|
|
|
|
{"IsWindowInStandardState", (PyCFunction)WinObj_IsWindowInStandardState, 1,
|
|
|
|
"() -> (Boolean _rv, Point idealSize, Rect idealStandardState)"},
|
|
|
|
{"ZoomWindowIdeal", (PyCFunction)WinObj_ZoomWindowIdeal, 1,
|
2000-12-12 18:10:21 -04:00
|
|
|
"(WindowPartCode partCode) -> (Point ioIdealSize)"},
|
1999-12-12 17:41:51 -04:00
|
|
|
{"GetWindowIdealUserState", (PyCFunction)WinObj_GetWindowIdealUserState, 1,
|
|
|
|
"() -> (Rect userState)"},
|
|
|
|
{"SetWindowIdealUserState", (PyCFunction)WinObj_SetWindowIdealUserState, 1,
|
|
|
|
"() -> (Rect userState)"},
|
1998-02-20 12:02:09 -04:00
|
|
|
{"HideWindow", (PyCFunction)WinObj_HideWindow, 1,
|
|
|
|
"() -> None"},
|
1998-04-21 12:23:55 -03:00
|
|
|
{"MacShowWindow", (PyCFunction)WinObj_MacShowWindow, 1,
|
1998-02-20 12:02:09 -04:00
|
|
|
"() -> None"},
|
|
|
|
{"ShowHide", (PyCFunction)WinObj_ShowHide, 1,
|
|
|
|
"(Boolean showFlag) -> None"},
|
2000-12-12 18:10:21 -04:00
|
|
|
|
|
|
|
#if TARGET_API_MAC_CARBON
|
|
|
|
{"GetWindowPropertyAttributes", (PyCFunction)WinObj_GetWindowPropertyAttributes, 1,
|
|
|
|
"(OSType propertyCreator, OSType propertyTag) -> (UInt32 attributes)"},
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if TARGET_API_MAC_CARBON
|
|
|
|
{"ChangeWindowPropertyAttributes", (PyCFunction)WinObj_ChangeWindowPropertyAttributes, 1,
|
|
|
|
"(OSType propertyCreator, OSType propertyTag, UInt32 attributesToSet, UInt32 attributesToClear) -> None"},
|
|
|
|
#endif
|
1995-01-30 07:53:55 -04:00
|
|
|
{"TrackBox", (PyCFunction)WinObj_TrackBox, 1,
|
2000-12-12 18:10:21 -04:00
|
|
|
"(Point thePt, WindowPartCode partCode) -> (Boolean _rv)"},
|
1995-01-30 07:53:55 -04:00
|
|
|
{"TrackGoAway", (PyCFunction)WinObj_TrackGoAway, 1,
|
|
|
|
"(Point thePt) -> (Boolean _rv)"},
|
2000-06-02 18:35:07 -03:00
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
1997-08-15 11:38:05 -03:00
|
|
|
{"GetAuxWin", (PyCFunction)WinObj_GetAuxWin, 1,
|
|
|
|
"() -> (Boolean _rv, AuxWinHandle awHndl)"},
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
2001-02-28 19:32:42 -04:00
|
|
|
|
|
|
|
#if !TARGET_API_MAC_CARBON
|
2000-12-12 18:10:21 -04:00
|
|
|
{"GetWindowGoAwayFlag", (PyCFunction)WinObj_GetWindowGoAwayFlag, 1,
|
|
|
|
"() -> (Boolean _rv)"},
|
2001-02-28 19:32:42 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !TARGET_API_MAC_CARBON
|
2000-12-12 18:10:21 -04:00
|
|
|
{"GetWindowSpareFlag", (PyCFunction)WinObj_GetWindowSpareFlag, 1,
|
|
|
|
"() -> (Boolean _rv)"},
|
2001-02-28 19:32:42 -04:00
|
|
|
#endif
|
1995-11-15 11:18:47 -04:00
|
|
|
{"GetWindowPort", (PyCFunction)WinObj_GetWindowPort, 1,
|
|
|
|
"() -> (CGrafPtr _rv)"},
|
1995-11-14 06:48:54 -04:00
|
|
|
{"GetWindowKind", (PyCFunction)WinObj_GetWindowKind, 1,
|
|
|
|
"() -> (short _rv)"},
|
2000-12-12 18:10:21 -04:00
|
|
|
{"MacIsWindowVisible", (PyCFunction)WinObj_MacIsWindowVisible, 1,
|
1995-11-14 06:48:54 -04:00
|
|
|
"() -> (Boolean _rv)"},
|
|
|
|
{"IsWindowHilited", (PyCFunction)WinObj_IsWindowHilited, 1,
|
|
|
|
"() -> (Boolean _rv)"},
|
2000-06-02 18:35:07 -03:00
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
#if TARGET_API_MAC_CARBON
|
|
|
|
{"IsWindowUpdatePending", (PyCFunction)WinObj_IsWindowUpdatePending, 1,
|
1995-11-14 06:48:54 -04:00
|
|
|
"() -> (Boolean _rv)"},
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
2000-12-12 18:10:21 -04:00
|
|
|
{"MacGetNextWindow", (PyCFunction)WinObj_MacGetNextWindow, 1,
|
1995-11-14 06:48:54 -04:00
|
|
|
"() -> (WindowPtr _rv)"},
|
|
|
|
{"GetWindowStandardState", (PyCFunction)WinObj_GetWindowStandardState, 1,
|
2000-12-12 18:10:21 -04:00
|
|
|
"() -> (Rect rect)"},
|
1995-11-14 06:48:54 -04:00
|
|
|
{"GetWindowUserState", (PyCFunction)WinObj_GetWindowUserState, 1,
|
2000-12-12 18:10:21 -04:00
|
|
|
"() -> (Rect rect)"},
|
|
|
|
{"SetWindowKind", (PyCFunction)WinObj_SetWindowKind, 1,
|
|
|
|
"(short kind) -> None"},
|
1995-11-14 06:48:54 -04:00
|
|
|
{"SetWindowStandardState", (PyCFunction)WinObj_SetWindowStandardState, 1,
|
2000-12-12 18:10:21 -04:00
|
|
|
"(Rect rect) -> None"},
|
1995-11-14 06:48:54 -04:00
|
|
|
{"SetWindowUserState", (PyCFunction)WinObj_SetWindowUserState, 1,
|
2000-12-12 18:10:21 -04:00
|
|
|
"(Rect rect) -> None"},
|
|
|
|
{"SetPortWindowPort", (PyCFunction)WinObj_SetPortWindowPort, 1,
|
|
|
|
"() -> None"},
|
|
|
|
{"GetWindowPortBounds", (PyCFunction)WinObj_GetWindowPortBounds, 1,
|
|
|
|
"() -> (Rect bounds)"},
|
2000-12-19 18:23:06 -04:00
|
|
|
{"IsWindowVisible", (PyCFunction)WinObj_IsWindowVisible, 1,
|
|
|
|
"() -> (Boolean _rv)"},
|
2001-01-09 18:09:31 -04:00
|
|
|
|
|
|
|
#if !TARGET_API_MAC_CARBON
|
2000-12-19 18:23:06 -04:00
|
|
|
{"GetWindowZoomFlag", (PyCFunction)WinObj_GetWindowZoomFlag, 1,
|
|
|
|
"() -> (Boolean _rv)"},
|
2001-01-09 18:09:31 -04:00
|
|
|
#endif
|
2000-12-19 18:23:06 -04:00
|
|
|
{"GetWindowStructureRgn", (PyCFunction)WinObj_GetWindowStructureRgn, 1,
|
|
|
|
"(RgnHandle r) -> None"},
|
|
|
|
{"GetWindowContentRgn", (PyCFunction)WinObj_GetWindowContentRgn, 1,
|
|
|
|
"(RgnHandle r) -> None"},
|
|
|
|
{"GetWindowUpdateRgn", (PyCFunction)WinObj_GetWindowUpdateRgn, 1,
|
|
|
|
"(RgnHandle r) -> None"},
|
2001-01-09 18:09:31 -04:00
|
|
|
|
|
|
|
#if !TARGET_API_MAC_CARBON
|
2000-12-19 18:23:06 -04:00
|
|
|
{"GetWindowTitleWidth", (PyCFunction)WinObj_GetWindowTitleWidth, 1,
|
|
|
|
"() -> (short _rv)"},
|
2001-01-09 18:09:31 -04:00
|
|
|
#endif
|
2000-12-19 18:23:06 -04:00
|
|
|
{"GetNextWindow", (PyCFunction)WinObj_GetNextWindow, 1,
|
|
|
|
"() -> (WindowPtr _rv)"},
|
2000-06-02 18:35:07 -03:00
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
1998-04-24 07:28:20 -03:00
|
|
|
{"CloseWindow", (PyCFunction)WinObj_CloseWindow, 1,
|
|
|
|
"() -> None"},
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
1998-04-24 07:28:20 -03:00
|
|
|
{"MoveWindow", (PyCFunction)WinObj_MoveWindow, 1,
|
|
|
|
"(short hGlobal, short vGlobal, Boolean front) -> None"},
|
|
|
|
{"ShowWindow", (PyCFunction)WinObj_ShowWindow, 1,
|
|
|
|
"() -> None"},
|
1995-01-30 07:53:55 -04:00
|
|
|
{NULL, NULL, 0}
|
|
|
|
};
|
|
|
|
|
|
|
|
PyMethodChain WinObj_chain = { WinObj_methods, NULL };
|
|
|
|
|
|
|
|
static PyObject *WinObj_getattr(self, name)
|
|
|
|
WindowObject *self;
|
|
|
|
char *name;
|
|
|
|
{
|
|
|
|
return Py_FindMethodInChain(&WinObj_chain, (PyObject *)self, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
#define WinObj_setattr NULL
|
|
|
|
|
2000-12-19 17:34:55 -04:00
|
|
|
static int WinObj_compare(self, other)
|
|
|
|
WindowObject *self, *other;
|
|
|
|
{
|
|
|
|
if ( self->ob_itself > other->ob_itself ) return 1;
|
|
|
|
if ( self->ob_itself < other->ob_itself ) return -1;
|
|
|
|
return 0;
|
|
|
|
}
|
1999-12-12 17:41:51 -04:00
|
|
|
|
2001-02-10 21:12:53 -04:00
|
|
|
static PyObject * WinObj_repr(self)
|
|
|
|
WindowObject *self;
|
|
|
|
{
|
|
|
|
char buf[100];
|
|
|
|
sprintf(buf, "<Window object at 0x%08.8x for 0x%08.8x>", self, self->ob_itself);
|
|
|
|
return PyString_FromString(buf);
|
|
|
|
}
|
1999-12-12 17:41:51 -04:00
|
|
|
|
2000-12-19 17:34:55 -04:00
|
|
|
static int WinObj_hash(self)
|
|
|
|
WindowObject *self;
|
|
|
|
{
|
|
|
|
return (int)self->ob_itself;
|
|
|
|
}
|
1999-12-12 17:41:51 -04:00
|
|
|
|
1995-01-30 07:53:55 -04:00
|
|
|
PyTypeObject Window_Type = {
|
|
|
|
PyObject_HEAD_INIT(&PyType_Type)
|
|
|
|
0, /*ob_size*/
|
|
|
|
"Window", /*tp_name*/
|
|
|
|
sizeof(WindowObject), /*tp_basicsize*/
|
|
|
|
0, /*tp_itemsize*/
|
|
|
|
/* methods */
|
|
|
|
(destructor) WinObj_dealloc, /*tp_dealloc*/
|
|
|
|
0, /*tp_print*/
|
|
|
|
(getattrfunc) WinObj_getattr, /*tp_getattr*/
|
|
|
|
(setattrfunc) WinObj_setattr, /*tp_setattr*/
|
1999-12-12 17:41:51 -04:00
|
|
|
(cmpfunc) WinObj_compare, /*tp_compare*/
|
|
|
|
(reprfunc) WinObj_repr, /*tp_repr*/
|
|
|
|
(PyNumberMethods *)0, /* tp_as_number */
|
|
|
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
|
|
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
|
|
|
(hashfunc) WinObj_hash, /*tp_hash*/
|
1995-01-30 07:53:55 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
/* --------------------- End object type Window --------------------- */
|
|
|
|
|
|
|
|
|
1998-02-20 12:02:09 -04:00
|
|
|
static PyObject *Win_GetNewCWindow(_self, _args)
|
1995-11-15 11:18:47 -04:00
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
WindowPtr _rv;
|
|
|
|
short windowID;
|
|
|
|
WindowPtr behind;
|
|
|
|
if (!PyArg_ParseTuple(_args, "hO&",
|
|
|
|
&windowID,
|
|
|
|
WinObj_Convert, &behind))
|
1995-11-15 11:18:47 -04:00
|
|
|
return NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
_rv = GetNewCWindow(windowID,
|
|
|
|
(void *)0,
|
|
|
|
behind);
|
1995-11-15 11:18:47 -04:00
|
|
|
_res = Py_BuildValue("O&",
|
1998-02-20 12:02:09 -04:00
|
|
|
WinObj_New, _rv);
|
1995-11-15 11:18:47 -04:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1998-02-20 12:02:09 -04:00
|
|
|
static PyObject *Win_NewWindow(_self, _args)
|
1995-01-30 07:53:55 -04:00
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
WindowPtr _rv;
|
|
|
|
Rect boundsRect;
|
|
|
|
Str255 title;
|
|
|
|
Boolean visible;
|
|
|
|
short theProc;
|
|
|
|
WindowPtr behind;
|
|
|
|
Boolean goAwayFlag;
|
|
|
|
long refCon;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&O&bhO&bl",
|
|
|
|
PyMac_GetRect, &boundsRect,
|
|
|
|
PyMac_GetStr255, title,
|
|
|
|
&visible,
|
|
|
|
&theProc,
|
|
|
|
WinObj_Convert, &behind,
|
|
|
|
&goAwayFlag,
|
|
|
|
&refCon))
|
|
|
|
return NULL;
|
|
|
|
_rv = NewWindow((void *)0,
|
|
|
|
&boundsRect,
|
|
|
|
title,
|
|
|
|
visible,
|
|
|
|
theProc,
|
|
|
|
behind,
|
|
|
|
goAwayFlag,
|
|
|
|
refCon);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
WinObj_New, _rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *Win_GetNewWindow(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
WindowPtr _rv;
|
|
|
|
short windowID;
|
|
|
|
WindowPtr behind;
|
|
|
|
if (!PyArg_ParseTuple(_args, "hO&",
|
|
|
|
&windowID,
|
|
|
|
WinObj_Convert, &behind))
|
|
|
|
return NULL;
|
|
|
|
_rv = GetNewWindow(windowID,
|
|
|
|
(void *)0,
|
|
|
|
behind);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
WinObj_New, _rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1998-02-20 12:02:09 -04:00
|
|
|
static PyObject *Win_NewCWindow(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
WindowPtr _rv;
|
|
|
|
Rect boundsRect;
|
|
|
|
Str255 title;
|
|
|
|
Boolean visible;
|
|
|
|
short procID;
|
|
|
|
WindowPtr behind;
|
|
|
|
Boolean goAwayFlag;
|
|
|
|
long refCon;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&O&bhO&bl",
|
|
|
|
PyMac_GetRect, &boundsRect,
|
|
|
|
PyMac_GetStr255, title,
|
|
|
|
&visible,
|
|
|
|
&procID,
|
|
|
|
WinObj_Convert, &behind,
|
|
|
|
&goAwayFlag,
|
|
|
|
&refCon))
|
|
|
|
return NULL;
|
|
|
|
_rv = NewCWindow((void *)0,
|
|
|
|
&boundsRect,
|
|
|
|
title,
|
|
|
|
visible,
|
|
|
|
procID,
|
|
|
|
behind,
|
|
|
|
goAwayFlag,
|
|
|
|
refCon);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
WinObj_New, _rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1999-12-12 17:41:51 -04:00
|
|
|
static PyObject *Win_CreateNewWindow(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
WindowClass windowClass;
|
|
|
|
WindowAttributes attributes;
|
2000-12-12 18:10:21 -04:00
|
|
|
Rect contentBounds;
|
1999-12-12 17:41:51 -04:00
|
|
|
WindowPtr outWindow;
|
|
|
|
if (!PyArg_ParseTuple(_args, "llO&",
|
|
|
|
&windowClass,
|
|
|
|
&attributes,
|
2000-12-12 18:10:21 -04:00
|
|
|
PyMac_GetRect, &contentBounds))
|
1999-12-12 17:41:51 -04:00
|
|
|
return NULL;
|
|
|
|
_err = CreateNewWindow(windowClass,
|
|
|
|
attributes,
|
2000-12-12 18:10:21 -04:00
|
|
|
&contentBounds,
|
1999-12-12 17:41:51 -04:00
|
|
|
&outWindow);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
WinObj_WhichWindow, outWindow);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *Win_CreateWindowFromResource(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
SInt16 resID;
|
|
|
|
WindowPtr outWindow;
|
|
|
|
if (!PyArg_ParseTuple(_args, "h",
|
|
|
|
&resID))
|
|
|
|
return NULL;
|
|
|
|
_err = CreateWindowFromResource(resID,
|
|
|
|
&outWindow);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
WinObj_WhichWindow, outWindow);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *Win_ShowFloatingWindows(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = ShowFloatingWindows();
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *Win_HideFloatingWindows(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = HideFloatingWindows();
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *Win_AreFloatingWindowsVisible(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
Boolean _rv;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_rv = AreFloatingWindowsVisible();
|
|
|
|
_res = Py_BuildValue("b",
|
|
|
|
_rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
2000-06-02 18:35:07 -03:00
|
|
|
|
1998-02-20 12:02:09 -04:00
|
|
|
static PyObject *Win_SetDeskCPat(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
PixPatHandle deskPixPat;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
ResObj_Convert, &deskPixPat))
|
|
|
|
return NULL;
|
|
|
|
SetDeskCPat(deskPixPat);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
1998-02-20 12:02:09 -04:00
|
|
|
|
|
|
|
static PyObject *Win_CheckUpdate(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
Boolean _rv;
|
|
|
|
EventRecord theEvent;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_rv = CheckUpdate(&theEvent);
|
|
|
|
_res = Py_BuildValue("bO&",
|
|
|
|
_rv,
|
|
|
|
PyMac_BuildEventRecord, &theEvent);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1998-04-21 12:23:55 -03:00
|
|
|
static PyObject *Win_MacFindWindow(_self, _args)
|
1998-02-20 12:02:09 -04:00
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
2000-12-12 18:10:21 -04:00
|
|
|
WindowPartCode _rv;
|
1998-02-20 12:02:09 -04:00
|
|
|
Point thePoint;
|
1999-12-12 17:41:51 -04:00
|
|
|
WindowPtr window;
|
1998-02-20 12:02:09 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
PyMac_GetPoint, &thePoint))
|
|
|
|
return NULL;
|
1998-04-21 12:23:55 -03:00
|
|
|
_rv = MacFindWindow(thePoint,
|
1999-12-12 17:41:51 -04:00
|
|
|
&window);
|
1998-02-20 12:02:09 -04:00
|
|
|
_res = Py_BuildValue("hO&",
|
|
|
|
_rv,
|
1999-12-12 17:41:51 -04:00
|
|
|
WinObj_WhichWindow, window);
|
1998-02-20 12:02:09 -04:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1995-01-30 07:53:55 -04:00
|
|
|
static PyObject *Win_FrontWindow(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
WindowPtr _rv;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_rv = FrontWindow();
|
|
|
|
_res = Py_BuildValue("O&",
|
1995-02-28 05:49:02 -04:00
|
|
|
WinObj_WhichWindow, _rv);
|
1995-01-30 07:53:55 -04:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *Win_FrontNonFloatingWindow(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
WindowPtr _rv;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_rv = FrontNonFloatingWindow();
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
WinObj_WhichWindow, _rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if TARGET_API_MAC_CARBON
|
|
|
|
|
|
|
|
static PyObject *Win_GetFrontWindowOfClass(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
WindowPtr _rv;
|
|
|
|
WindowClass inWindowClass;
|
|
|
|
Boolean mustBeVisible;
|
|
|
|
if (!PyArg_ParseTuple(_args, "lb",
|
|
|
|
&inWindowClass,
|
|
|
|
&mustBeVisible))
|
|
|
|
return NULL;
|
|
|
|
_rv = GetFrontWindowOfClass(inWindowClass,
|
|
|
|
mustBeVisible);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
WinObj_New, _rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if TARGET_API_MAC_CARBON
|
|
|
|
|
|
|
|
static PyObject *Win_FindWindowOfClass(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
Point where;
|
|
|
|
WindowClass inWindowClass;
|
|
|
|
WindowPtr outWindow;
|
|
|
|
WindowPartCode outWindowPart;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&l",
|
|
|
|
PyMac_GetPoint, &where,
|
|
|
|
&inWindowClass))
|
|
|
|
return NULL;
|
|
|
|
_err = FindWindowOfClass(&where,
|
|
|
|
inWindowClass,
|
|
|
|
&outWindow,
|
|
|
|
&outWindowPart);
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
_res = Py_BuildValue("O&h",
|
|
|
|
WinObj_WhichWindow, outWindow,
|
|
|
|
outWindowPart);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
2000-06-02 18:35:07 -03:00
|
|
|
|
1998-02-20 12:02:09 -04:00
|
|
|
static PyObject *Win_InitWindows(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
InitWindows();
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
1998-02-20 12:02:09 -04:00
|
|
|
|
|
|
|
static PyObject *Win_GetWMgrPort(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
GrafPtr wPort;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
GetWMgrPort(&wPort);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
GrafObj_New, wPort);
|
|
|
|
return _res;
|
|
|
|
}
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
1998-02-20 12:02:09 -04:00
|
|
|
|
|
|
|
static PyObject *Win_GetCWMgrPort(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
CGrafPtr wMgrCPort;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
GetCWMgrPort(&wMgrCPort);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
GrafObj_New, wMgrCPort);
|
|
|
|
return _res;
|
|
|
|
}
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
1998-02-20 12:02:09 -04:00
|
|
|
|
1999-12-12 17:41:51 -04:00
|
|
|
static PyObject *Win_InitFloatingWindows(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
OSStatus _err;
|
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
|
|
|
_err = InitFloatingWindows();
|
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
1999-12-12 17:41:51 -04:00
|
|
|
|
1995-01-30 07:53:55 -04:00
|
|
|
static PyObject *Win_InvalRect(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
Rect badRect;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
PyMac_GetRect, &badRect))
|
|
|
|
return NULL;
|
|
|
|
InvalRect(&badRect);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
1995-01-30 07:53:55 -04:00
|
|
|
|
1995-11-15 11:18:47 -04:00
|
|
|
static PyObject *Win_InvalRgn(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
RgnHandle badRgn;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
ResObj_Convert, &badRgn))
|
|
|
|
return NULL;
|
|
|
|
InvalRgn(badRgn);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
1995-11-15 11:18:47 -04:00
|
|
|
|
1995-01-30 07:53:55 -04:00
|
|
|
static PyObject *Win_ValidRect(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
Rect goodRect;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
PyMac_GetRect, &goodRect))
|
|
|
|
return NULL;
|
|
|
|
ValidRect(&goodRect);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
1995-01-30 07:53:55 -04:00
|
|
|
|
1995-11-15 11:18:47 -04:00
|
|
|
static PyObject *Win_ValidRgn(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
RgnHandle goodRgn;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
ResObj_Convert, &goodRgn))
|
|
|
|
return NULL;
|
|
|
|
ValidRgn(goodRgn);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
|
|
|
return _res;
|
|
|
|
}
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
1995-11-15 11:18:47 -04:00
|
|
|
|
1998-02-20 12:02:09 -04:00
|
|
|
static PyObject *Win_CollapseAllWindows(_self, _args)
|
1995-01-30 07:53:55 -04:00
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
1999-03-04 18:53:24 -04:00
|
|
|
OSStatus _err;
|
1999-12-12 17:41:51 -04:00
|
|
|
Boolean collapse;
|
1998-02-20 12:02:09 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, "b",
|
1999-12-12 17:41:51 -04:00
|
|
|
&collapse))
|
1995-01-30 07:53:55 -04:00
|
|
|
return NULL;
|
1999-12-12 17:41:51 -04:00
|
|
|
_err = CollapseAllWindows(collapse);
|
1999-03-04 18:53:24 -04:00
|
|
|
if (_err != noErr) return PyMac_Error(_err);
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
_res = Py_None;
|
1995-01-30 07:53:55 -04:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *Win_PinRect(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
long _rv;
|
|
|
|
Rect theRect;
|
|
|
|
Point thePt;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&O&",
|
|
|
|
PyMac_GetRect, &theRect,
|
|
|
|
PyMac_GetPoint, &thePt))
|
|
|
|
return NULL;
|
|
|
|
_rv = PinRect(&theRect,
|
|
|
|
thePt);
|
|
|
|
_res = Py_BuildValue("l",
|
|
|
|
_rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1998-02-20 12:02:09 -04:00
|
|
|
static PyObject *Win_GetGrayRgn(_self, _args)
|
1995-11-15 11:18:47 -04:00
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
RgnHandle _rv;
|
1995-11-15 11:18:47 -04:00
|
|
|
if (!PyArg_ParseTuple(_args, ""))
|
|
|
|
return NULL;
|
1998-02-20 12:02:09 -04:00
|
|
|
_rv = GetGrayRgn();
|
1995-01-30 07:53:55 -04:00
|
|
|
_res = Py_BuildValue("O&",
|
1998-02-20 12:02:09 -04:00
|
|
|
ResObj_New, _rv);
|
1995-01-30 07:53:55 -04:00
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
2000-12-12 18:10:21 -04:00
|
|
|
static PyObject *Win_GetWindowFromPort(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
WindowPtr _rv;
|
|
|
|
CGrafPtr port;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
GrafObj_Convert, &port))
|
|
|
|
return NULL;
|
|
|
|
_rv = GetWindowFromPort(port);
|
|
|
|
_res = Py_BuildValue("O&",
|
|
|
|
WinObj_New, _rv);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1995-08-17 11:35:56 -03:00
|
|
|
static PyObject *Win_WhichWindow(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
|
|
|
|
long ptr;
|
|
|
|
|
|
|
|
if ( !PyArg_ParseTuple(_args, "i", &ptr) )
|
|
|
|
return NULL;
|
|
|
|
return WinObj_WhichWindow((WindowPtr)ptr);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
1998-04-24 07:28:20 -03:00
|
|
|
static PyObject *Win_FindWindow(_self, _args)
|
|
|
|
PyObject *_self;
|
|
|
|
PyObject *_args;
|
|
|
|
{
|
|
|
|
PyObject *_res = NULL;
|
|
|
|
short _rv;
|
|
|
|
Point thePoint;
|
|
|
|
WindowPtr theWindow;
|
|
|
|
if (!PyArg_ParseTuple(_args, "O&",
|
|
|
|
PyMac_GetPoint, &thePoint))
|
|
|
|
return NULL;
|
|
|
|
_rv = FindWindow(thePoint,
|
|
|
|
&theWindow);
|
|
|
|
_res = Py_BuildValue("hO&",
|
|
|
|
_rv,
|
|
|
|
WinObj_WhichWindow, theWindow);
|
|
|
|
return _res;
|
|
|
|
}
|
|
|
|
|
1995-01-30 07:53:55 -04:00
|
|
|
static PyMethodDef Win_methods[] = {
|
1998-02-20 12:02:09 -04:00
|
|
|
{"GetNewCWindow", (PyCFunction)Win_GetNewCWindow, 1,
|
|
|
|
"(short windowID, WindowPtr behind) -> (WindowPtr _rv)"},
|
1995-01-30 07:53:55 -04:00
|
|
|
{"NewWindow", (PyCFunction)Win_NewWindow, 1,
|
|
|
|
"(Rect boundsRect, Str255 title, Boolean visible, short theProc, WindowPtr behind, Boolean goAwayFlag, long refCon) -> (WindowPtr _rv)"},
|
|
|
|
{"GetNewWindow", (PyCFunction)Win_GetNewWindow, 1,
|
|
|
|
"(short windowID, WindowPtr behind) -> (WindowPtr _rv)"},
|
1998-02-20 12:02:09 -04:00
|
|
|
{"NewCWindow", (PyCFunction)Win_NewCWindow, 1,
|
|
|
|
"(Rect boundsRect, Str255 title, Boolean visible, short procID, WindowPtr behind, Boolean goAwayFlag, long refCon) -> (WindowPtr _rv)"},
|
1999-12-12 17:41:51 -04:00
|
|
|
{"CreateNewWindow", (PyCFunction)Win_CreateNewWindow, 1,
|
2000-12-12 18:10:21 -04:00
|
|
|
"(WindowClass windowClass, WindowAttributes attributes, Rect contentBounds) -> (WindowPtr outWindow)"},
|
1999-12-12 17:41:51 -04:00
|
|
|
{"CreateWindowFromResource", (PyCFunction)Win_CreateWindowFromResource, 1,
|
|
|
|
"(SInt16 resID) -> (WindowPtr outWindow)"},
|
|
|
|
{"ShowFloatingWindows", (PyCFunction)Win_ShowFloatingWindows, 1,
|
|
|
|
"() -> None"},
|
|
|
|
{"HideFloatingWindows", (PyCFunction)Win_HideFloatingWindows, 1,
|
|
|
|
"() -> None"},
|
|
|
|
{"AreFloatingWindowsVisible", (PyCFunction)Win_AreFloatingWindowsVisible, 1,
|
|
|
|
"() -> (Boolean _rv)"},
|
2000-06-02 18:35:07 -03:00
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
1998-02-20 12:02:09 -04:00
|
|
|
{"SetDeskCPat", (PyCFunction)Win_SetDeskCPat, 1,
|
|
|
|
"(PixPatHandle deskPixPat) -> None"},
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
1998-02-20 12:02:09 -04:00
|
|
|
{"CheckUpdate", (PyCFunction)Win_CheckUpdate, 1,
|
|
|
|
"() -> (Boolean _rv, EventRecord theEvent)"},
|
1998-04-21 12:23:55 -03:00
|
|
|
{"MacFindWindow", (PyCFunction)Win_MacFindWindow, 1,
|
2000-12-12 18:10:21 -04:00
|
|
|
"(Point thePoint) -> (WindowPartCode _rv, WindowPtr window)"},
|
1995-01-30 07:53:55 -04:00
|
|
|
{"FrontWindow", (PyCFunction)Win_FrontWindow, 1,
|
|
|
|
"() -> (WindowPtr _rv)"},
|
2000-12-12 18:10:21 -04:00
|
|
|
{"FrontNonFloatingWindow", (PyCFunction)Win_FrontNonFloatingWindow, 1,
|
|
|
|
"() -> (WindowPtr _rv)"},
|
|
|
|
|
|
|
|
#if TARGET_API_MAC_CARBON
|
|
|
|
{"GetFrontWindowOfClass", (PyCFunction)Win_GetFrontWindowOfClass, 1,
|
|
|
|
"(WindowClass inWindowClass, Boolean mustBeVisible) -> (WindowPtr _rv)"},
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if TARGET_API_MAC_CARBON
|
|
|
|
{"FindWindowOfClass", (PyCFunction)Win_FindWindowOfClass, 1,
|
|
|
|
"(Point where, WindowClass inWindowClass) -> (WindowPtr outWindow, WindowPartCode outWindowPart)"},
|
|
|
|
#endif
|
2000-06-02 18:35:07 -03:00
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
1998-02-20 12:02:09 -04:00
|
|
|
{"InitWindows", (PyCFunction)Win_InitWindows, 1,
|
|
|
|
"() -> None"},
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
1998-02-20 12:02:09 -04:00
|
|
|
{"GetWMgrPort", (PyCFunction)Win_GetWMgrPort, 1,
|
|
|
|
"() -> (GrafPtr wPort)"},
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
1998-02-20 12:02:09 -04:00
|
|
|
{"GetCWMgrPort", (PyCFunction)Win_GetCWMgrPort, 1,
|
|
|
|
"() -> (CGrafPtr wMgrCPort)"},
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
1999-12-12 17:41:51 -04:00
|
|
|
{"InitFloatingWindows", (PyCFunction)Win_InitFloatingWindows, 1,
|
|
|
|
"() -> None"},
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
1995-01-30 07:53:55 -04:00
|
|
|
{"InvalRect", (PyCFunction)Win_InvalRect, 1,
|
|
|
|
"(Rect badRect) -> None"},
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
1995-11-15 11:18:47 -04:00
|
|
|
{"InvalRgn", (PyCFunction)Win_InvalRgn, 1,
|
|
|
|
"(RgnHandle badRgn) -> None"},
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
1995-01-30 07:53:55 -04:00
|
|
|
{"ValidRect", (PyCFunction)Win_ValidRect, 1,
|
|
|
|
"(Rect goodRect) -> None"},
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
|
|
|
|
2000-07-14 19:37:27 -03:00
|
|
|
#if !TARGET_API_MAC_CARBON
|
1995-11-15 11:18:47 -04:00
|
|
|
{"ValidRgn", (PyCFunction)Win_ValidRgn, 1,
|
|
|
|
"(RgnHandle goodRgn) -> None"},
|
2000-06-02 18:35:07 -03:00
|
|
|
#endif
|
1998-02-20 12:02:09 -04:00
|
|
|
{"CollapseAllWindows", (PyCFunction)Win_CollapseAllWindows, 1,
|
1999-12-12 17:41:51 -04:00
|
|
|
"(Boolean collapse) -> None"},
|
1995-01-30 07:53:55 -04:00
|
|
|
{"PinRect", (PyCFunction)Win_PinRect, 1,
|
|
|
|
"(Rect theRect, Point thePt) -> (long _rv)"},
|
1998-02-20 12:02:09 -04:00
|
|
|
{"GetGrayRgn", (PyCFunction)Win_GetGrayRgn, 1,
|
|
|
|
"() -> (RgnHandle _rv)"},
|
2000-12-12 18:10:21 -04:00
|
|
|
{"GetWindowFromPort", (PyCFunction)Win_GetWindowFromPort, 1,
|
|
|
|
"(CGrafPtr port) -> (WindowPtr _rv)"},
|
1995-08-17 11:35:56 -03:00
|
|
|
{"WhichWindow", (PyCFunction)Win_WhichWindow, 1,
|
|
|
|
"Resolve an integer WindowPtr address to a Window object"},
|
1998-04-24 07:28:20 -03:00
|
|
|
{"FindWindow", (PyCFunction)Win_FindWindow, 1,
|
|
|
|
"(Point thePoint) -> (short _rv, WindowPtr theWindow)"},
|
1995-01-30 07:53:55 -04:00
|
|
|
{NULL, NULL, 0}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Return the object corresponding to the window, or NULL */
|
|
|
|
|
|
|
|
PyObject *
|
|
|
|
WinObj_WhichWindow(w)
|
|
|
|
WindowPtr w;
|
|
|
|
{
|
|
|
|
PyObject *it;
|
|
|
|
|
2000-08-25 19:17:51 -03:00
|
|
|
if (w == NULL) {
|
1995-01-30 07:53:55 -04:00
|
|
|
it = Py_None;
|
2000-08-25 19:17:51 -03:00
|
|
|
Py_INCREF(it);
|
|
|
|
} else {
|
|
|
|
it = (PyObject *) GetWRefCon(w);
|
2001-04-25 19:09:29 -03:00
|
|
|
if (it == NULL || !IsPointerValid((Ptr)it) || ((WindowObject *)it)->ob_itself != w || !WinObj_Check(it)) {
|
2000-08-25 19:17:51 -03:00
|
|
|
it = WinObj_New(w);
|
|
|
|
((WindowObject *)it)->ob_freeit = NULL;
|
|
|
|
} else {
|
|
|
|
Py_INCREF(it);
|
|
|
|
}
|
|
|
|
}
|
1995-01-30 07:53:55 -04:00
|
|
|
return it;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void initWin()
|
|
|
|
{
|
|
|
|
PyObject *m;
|
|
|
|
PyObject *d;
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-05-17 18:58:34 -03:00
|
|
|
PyMac_INIT_TOOLBOX_OBJECT_NEW(WinObj_New);
|
|
|
|
PyMac_INIT_TOOLBOX_OBJECT_NEW(WinObj_WhichWindow);
|
|
|
|
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(WinObj_Convert);
|
|
|
|
|
1995-01-30 07:53:55 -04:00
|
|
|
|
|
|
|
m = Py_InitModule("Win", Win_methods);
|
|
|
|
d = PyModule_GetDict(m);
|
|
|
|
Win_Error = PyMac_GetOSErrException();
|
|
|
|
if (Win_Error == NULL ||
|
|
|
|
PyDict_SetItemString(d, "Error", Win_Error) != 0)
|
2000-12-12 18:10:21 -04:00
|
|
|
return;
|
1997-09-20 14:40:22 -03:00
|
|
|
Window_Type.ob_type = &PyType_Type;
|
|
|
|
Py_INCREF(&Window_Type);
|
|
|
|
if (PyDict_SetItemString(d, "WindowType", (PyObject *)&Window_Type) != 0)
|
|
|
|
Py_FatalError("can't initialize WindowType");
|
1995-01-30 07:53:55 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ========================= End module Win ========================= */
|
|
|
|
|