| 1 | n/a | |
|---|
| 2 | n/a | /* ========================== Module _Win =========================== */ |
|---|
| 3 | n/a | |
|---|
| 4 | n/a | #include "Python.h" |
|---|
| 5 | n/a | |
|---|
| 6 | n/a | #ifndef __LP64__ |
|---|
| 7 | n/a | |
|---|
| 8 | n/a | #include "pymactoolbox.h" |
|---|
| 9 | n/a | |
|---|
| 10 | n/a | /* Macro to test whether a weak-loaded CFM function exists */ |
|---|
| 11 | n/a | #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ |
|---|
| 12 | n/a | PyErr_SetString(PyExc_NotImplementedError, \ |
|---|
| 13 | n/a | "Not available in this shared library/OS version"); \ |
|---|
| 14 | n/a | return NULL; \ |
|---|
| 15 | n/a | }} while(0) |
|---|
| 16 | n/a | |
|---|
| 17 | n/a | |
|---|
| 18 | n/a | #include <Carbon/Carbon.h> |
|---|
| 19 | n/a | |
|---|
| 20 | n/a | #ifdef USE_TOOLBOX_OBJECT_GLUE |
|---|
| 21 | n/a | extern PyObject *_WinObj_New(WindowRef); |
|---|
| 22 | n/a | extern PyObject *_WinObj_WhichWindow(WindowRef); |
|---|
| 23 | n/a | extern int _WinObj_Convert(PyObject *, WindowRef *); |
|---|
| 24 | n/a | |
|---|
| 25 | n/a | #define WinObj_New _WinObj_New |
|---|
| 26 | n/a | #define WinObj_WhichWindow _WinObj_WhichWindow |
|---|
| 27 | n/a | #define WinObj_Convert _WinObj_Convert |
|---|
| 28 | n/a | #endif |
|---|
| 29 | n/a | |
|---|
| 30 | n/a | /* Classic calls that we emulate in carbon mode */ |
|---|
| 31 | n/a | #define GetWindowUpdateRgn(win, rgn) GetWindowRegion((win), kWindowUpdateRgn, (rgn)) |
|---|
| 32 | n/a | #define GetWindowStructureRgn(win, rgn) GetWindowRegion((win), kWindowStructureRgn, (rgn)) |
|---|
| 33 | n/a | #define GetWindowContentRgn(win, rgn) GetWindowRegion((win), kWindowContentRgn, (rgn)) |
|---|
| 34 | n/a | |
|---|
| 35 | n/a | /* Function to dispose a window, with a "normal" calling sequence */ |
|---|
| 36 | n/a | static void |
|---|
| 37 | n/a | PyMac_AutoDisposeWindow(WindowPtr w) |
|---|
| 38 | n/a | { |
|---|
| 39 | n/a | DisposeWindow(w); |
|---|
| 40 | n/a | } |
|---|
| 41 | n/a | |
|---|
| 42 | n/a | static PyObject *Win_Error; |
|---|
| 43 | n/a | |
|---|
| 44 | n/a | /* ----------------------- Object type Window ----------------------- */ |
|---|
| 45 | n/a | |
|---|
| 46 | n/a | PyTypeObject Window_Type; |
|---|
| 47 | n/a | |
|---|
| 48 | n/a | #define WinObj_Check(x) ((x)->ob_type == &Window_Type || PyObject_TypeCheck((x), &Window_Type)) |
|---|
| 49 | n/a | |
|---|
| 50 | n/a | typedef struct WindowObject { |
|---|
| 51 | n/a | PyObject_HEAD |
|---|
| 52 | n/a | WindowPtr ob_itself; |
|---|
| 53 | n/a | void (*ob_freeit)(WindowPtr ptr); |
|---|
| 54 | n/a | } WindowObject; |
|---|
| 55 | n/a | |
|---|
| 56 | n/a | PyObject *WinObj_New(WindowPtr itself) |
|---|
| 57 | n/a | { |
|---|
| 58 | n/a | WindowObject *it; |
|---|
| 59 | n/a | if (itself == NULL) return PyMac_Error(resNotFound); |
|---|
| 60 | n/a | /* XXXX Or should we use WhichWindow code here? */ |
|---|
| 61 | n/a | it = PyObject_NEW(WindowObject, &Window_Type); |
|---|
| 62 | n/a | if (it == NULL) return NULL; |
|---|
| 63 | n/a | it->ob_itself = itself; |
|---|
| 64 | n/a | it->ob_freeit = NULL; |
|---|
| 65 | n/a | if (GetWRefCon(itself) == 0) |
|---|
| 66 | n/a | { |
|---|
| 67 | n/a | SetWRefCon(itself, (long)it); |
|---|
| 68 | n/a | it->ob_freeit = PyMac_AutoDisposeWindow; |
|---|
| 69 | n/a | } |
|---|
| 70 | n/a | return (PyObject *)it; |
|---|
| 71 | n/a | } |
|---|
| 72 | n/a | |
|---|
| 73 | n/a | int WinObj_Convert(PyObject *v, WindowPtr *p_itself) |
|---|
| 74 | n/a | { |
|---|
| 75 | n/a | |
|---|
| 76 | n/a | if (v == Py_None) { *p_itself = NULL; return 1; } |
|---|
| 77 | n/a | if (PyInt_Check(v)) { *p_itself = (WindowPtr)PyInt_AsLong(v); return 1; } |
|---|
| 78 | n/a | |
|---|
| 79 | n/a | { |
|---|
| 80 | n/a | DialogRef dlg; |
|---|
| 81 | n/a | if (DlgObj_Convert(v, &dlg) && dlg) { |
|---|
| 82 | n/a | *p_itself = GetDialogWindow(dlg); |
|---|
| 83 | n/a | return 1; |
|---|
| 84 | n/a | } |
|---|
| 85 | n/a | PyErr_Clear(); |
|---|
| 86 | n/a | } |
|---|
| 87 | n/a | if (!WinObj_Check(v)) |
|---|
| 88 | n/a | { |
|---|
| 89 | n/a | PyErr_SetString(PyExc_TypeError, "Window required"); |
|---|
| 90 | n/a | return 0; |
|---|
| 91 | n/a | } |
|---|
| 92 | n/a | *p_itself = ((WindowObject *)v)->ob_itself; |
|---|
| 93 | n/a | return 1; |
|---|
| 94 | n/a | } |
|---|
| 95 | n/a | |
|---|
| 96 | n/a | static void WinObj_dealloc(WindowObject *self) |
|---|
| 97 | n/a | { |
|---|
| 98 | n/a | if (self->ob_freeit && self->ob_itself) |
|---|
| 99 | n/a | { |
|---|
| 100 | n/a | SetWRefCon(self->ob_itself, 0); |
|---|
| 101 | n/a | self->ob_freeit(self->ob_itself); |
|---|
| 102 | n/a | } |
|---|
| 103 | n/a | self->ob_itself = NULL; |
|---|
| 104 | n/a | self->ob_freeit = NULL; |
|---|
| 105 | n/a | self->ob_type->tp_free((PyObject *)self); |
|---|
| 106 | n/a | } |
|---|
| 107 | n/a | |
|---|
| 108 | n/a | static PyObject *WinObj_GetWindowOwnerCount(WindowObject *_self, PyObject *_args) |
|---|
| 109 | n/a | { |
|---|
| 110 | n/a | PyObject *_res = NULL; |
|---|
| 111 | n/a | OSStatus _err; |
|---|
| 112 | n/a | UInt32 outCount; |
|---|
| 113 | n/a | #ifndef GetWindowOwnerCount |
|---|
| 114 | n/a | PyMac_PRECHECK(GetWindowOwnerCount); |
|---|
| 115 | n/a | #endif |
|---|
| 116 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 117 | n/a | return NULL; |
|---|
| 118 | n/a | _err = GetWindowOwnerCount(_self->ob_itself, |
|---|
| 119 | n/a | &outCount); |
|---|
| 120 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 121 | n/a | _res = Py_BuildValue("l", |
|---|
| 122 | n/a | outCount); |
|---|
| 123 | n/a | return _res; |
|---|
| 124 | n/a | } |
|---|
| 125 | n/a | |
|---|
| 126 | n/a | static PyObject *WinObj_CloneWindow(WindowObject *_self, PyObject *_args) |
|---|
| 127 | n/a | { |
|---|
| 128 | n/a | PyObject *_res = NULL; |
|---|
| 129 | n/a | OSStatus _err; |
|---|
| 130 | n/a | #ifndef CloneWindow |
|---|
| 131 | n/a | PyMac_PRECHECK(CloneWindow); |
|---|
| 132 | n/a | #endif |
|---|
| 133 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 134 | n/a | return NULL; |
|---|
| 135 | n/a | _err = CloneWindow(_self->ob_itself); |
|---|
| 136 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 137 | n/a | Py_INCREF(Py_None); |
|---|
| 138 | n/a | _res = Py_None; |
|---|
| 139 | n/a | return _res; |
|---|
| 140 | n/a | } |
|---|
| 141 | n/a | |
|---|
| 142 | n/a | static PyObject *WinObj_GetWindowRetainCount(WindowObject *_self, PyObject *_args) |
|---|
| 143 | n/a | { |
|---|
| 144 | n/a | PyObject *_res = NULL; |
|---|
| 145 | n/a | ItemCount _rv; |
|---|
| 146 | n/a | #ifndef GetWindowRetainCount |
|---|
| 147 | n/a | PyMac_PRECHECK(GetWindowRetainCount); |
|---|
| 148 | n/a | #endif |
|---|
| 149 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 150 | n/a | return NULL; |
|---|
| 151 | n/a | _rv = GetWindowRetainCount(_self->ob_itself); |
|---|
| 152 | n/a | _res = Py_BuildValue("l", |
|---|
| 153 | n/a | _rv); |
|---|
| 154 | n/a | return _res; |
|---|
| 155 | n/a | } |
|---|
| 156 | n/a | |
|---|
| 157 | n/a | static PyObject *WinObj_RetainWindow(WindowObject *_self, PyObject *_args) |
|---|
| 158 | n/a | { |
|---|
| 159 | n/a | PyObject *_res = NULL; |
|---|
| 160 | n/a | OSStatus _err; |
|---|
| 161 | n/a | #ifndef RetainWindow |
|---|
| 162 | n/a | PyMac_PRECHECK(RetainWindow); |
|---|
| 163 | n/a | #endif |
|---|
| 164 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 165 | n/a | return NULL; |
|---|
| 166 | n/a | _err = RetainWindow(_self->ob_itself); |
|---|
| 167 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 168 | n/a | Py_INCREF(Py_None); |
|---|
| 169 | n/a | _res = Py_None; |
|---|
| 170 | n/a | return _res; |
|---|
| 171 | n/a | } |
|---|
| 172 | n/a | |
|---|
| 173 | n/a | static PyObject *WinObj_ReleaseWindow(WindowObject *_self, PyObject *_args) |
|---|
| 174 | n/a | { |
|---|
| 175 | n/a | PyObject *_res = NULL; |
|---|
| 176 | n/a | OSStatus _err; |
|---|
| 177 | n/a | #ifndef ReleaseWindow |
|---|
| 178 | n/a | PyMac_PRECHECK(ReleaseWindow); |
|---|
| 179 | n/a | #endif |
|---|
| 180 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 181 | n/a | return NULL; |
|---|
| 182 | n/a | _err = ReleaseWindow(_self->ob_itself); |
|---|
| 183 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 184 | n/a | Py_INCREF(Py_None); |
|---|
| 185 | n/a | _res = Py_None; |
|---|
| 186 | n/a | return _res; |
|---|
| 187 | n/a | } |
|---|
| 188 | n/a | |
|---|
| 189 | n/a | static PyObject *WinObj_ReshapeCustomWindow(WindowObject *_self, PyObject *_args) |
|---|
| 190 | n/a | { |
|---|
| 191 | n/a | PyObject *_res = NULL; |
|---|
| 192 | n/a | OSStatus _err; |
|---|
| 193 | n/a | #ifndef ReshapeCustomWindow |
|---|
| 194 | n/a | PyMac_PRECHECK(ReshapeCustomWindow); |
|---|
| 195 | n/a | #endif |
|---|
| 196 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 197 | n/a | return NULL; |
|---|
| 198 | n/a | _err = ReshapeCustomWindow(_self->ob_itself); |
|---|
| 199 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 200 | n/a | Py_INCREF(Py_None); |
|---|
| 201 | n/a | _res = Py_None; |
|---|
| 202 | n/a | return _res; |
|---|
| 203 | n/a | } |
|---|
| 204 | n/a | |
|---|
| 205 | n/a | static PyObject *WinObj_GetWindowWidgetHilite(WindowObject *_self, PyObject *_args) |
|---|
| 206 | n/a | { |
|---|
| 207 | n/a | PyObject *_res = NULL; |
|---|
| 208 | n/a | OSStatus _err; |
|---|
| 209 | n/a | WindowDefPartCode outHilite; |
|---|
| 210 | n/a | #ifndef GetWindowWidgetHilite |
|---|
| 211 | n/a | PyMac_PRECHECK(GetWindowWidgetHilite); |
|---|
| 212 | n/a | #endif |
|---|
| 213 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 214 | n/a | return NULL; |
|---|
| 215 | n/a | _err = GetWindowWidgetHilite(_self->ob_itself, |
|---|
| 216 | n/a | &outHilite); |
|---|
| 217 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 218 | n/a | _res = Py_BuildValue("h", |
|---|
| 219 | n/a | outHilite); |
|---|
| 220 | n/a | return _res; |
|---|
| 221 | n/a | } |
|---|
| 222 | n/a | |
|---|
| 223 | n/a | static PyObject *WinObj_GetWindowClass(WindowObject *_self, PyObject *_args) |
|---|
| 224 | n/a | { |
|---|
| 225 | n/a | PyObject *_res = NULL; |
|---|
| 226 | n/a | OSStatus _err; |
|---|
| 227 | n/a | WindowClass outClass; |
|---|
| 228 | n/a | #ifndef GetWindowClass |
|---|
| 229 | n/a | PyMac_PRECHECK(GetWindowClass); |
|---|
| 230 | n/a | #endif |
|---|
| 231 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 232 | n/a | return NULL; |
|---|
| 233 | n/a | _err = GetWindowClass(_self->ob_itself, |
|---|
| 234 | n/a | &outClass); |
|---|
| 235 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 236 | n/a | _res = Py_BuildValue("l", |
|---|
| 237 | n/a | outClass); |
|---|
| 238 | n/a | return _res; |
|---|
| 239 | n/a | } |
|---|
| 240 | n/a | |
|---|
| 241 | n/a | static PyObject *WinObj_GetWindowAttributes(WindowObject *_self, PyObject *_args) |
|---|
| 242 | n/a | { |
|---|
| 243 | n/a | PyObject *_res = NULL; |
|---|
| 244 | n/a | OSStatus _err; |
|---|
| 245 | n/a | WindowAttributes outAttributes; |
|---|
| 246 | n/a | #ifndef GetWindowAttributes |
|---|
| 247 | n/a | PyMac_PRECHECK(GetWindowAttributes); |
|---|
| 248 | n/a | #endif |
|---|
| 249 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 250 | n/a | return NULL; |
|---|
| 251 | n/a | _err = GetWindowAttributes(_self->ob_itself, |
|---|
| 252 | n/a | &outAttributes); |
|---|
| 253 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 254 | n/a | _res = Py_BuildValue("l", |
|---|
| 255 | n/a | outAttributes); |
|---|
| 256 | n/a | return _res; |
|---|
| 257 | n/a | } |
|---|
| 258 | n/a | |
|---|
| 259 | n/a | static PyObject *WinObj_ChangeWindowAttributes(WindowObject *_self, PyObject *_args) |
|---|
| 260 | n/a | { |
|---|
| 261 | n/a | PyObject *_res = NULL; |
|---|
| 262 | n/a | OSStatus _err; |
|---|
| 263 | n/a | WindowAttributes setTheseAttributes; |
|---|
| 264 | n/a | WindowAttributes clearTheseAttributes; |
|---|
| 265 | n/a | #ifndef ChangeWindowAttributes |
|---|
| 266 | n/a | PyMac_PRECHECK(ChangeWindowAttributes); |
|---|
| 267 | n/a | #endif |
|---|
| 268 | n/a | if (!PyArg_ParseTuple(_args, "ll", |
|---|
| 269 | n/a | &setTheseAttributes, |
|---|
| 270 | n/a | &clearTheseAttributes)) |
|---|
| 271 | n/a | return NULL; |
|---|
| 272 | n/a | _err = ChangeWindowAttributes(_self->ob_itself, |
|---|
| 273 | n/a | setTheseAttributes, |
|---|
| 274 | n/a | clearTheseAttributes); |
|---|
| 275 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 276 | n/a | Py_INCREF(Py_None); |
|---|
| 277 | n/a | _res = Py_None; |
|---|
| 278 | n/a | return _res; |
|---|
| 279 | n/a | } |
|---|
| 280 | n/a | |
|---|
| 281 | n/a | static PyObject *WinObj_SetWindowClass(WindowObject *_self, PyObject *_args) |
|---|
| 282 | n/a | { |
|---|
| 283 | n/a | PyObject *_res = NULL; |
|---|
| 284 | n/a | OSStatus _err; |
|---|
| 285 | n/a | WindowClass inWindowClass; |
|---|
| 286 | n/a | #ifndef SetWindowClass |
|---|
| 287 | n/a | PyMac_PRECHECK(SetWindowClass); |
|---|
| 288 | n/a | #endif |
|---|
| 289 | n/a | if (!PyArg_ParseTuple(_args, "l", |
|---|
| 290 | n/a | &inWindowClass)) |
|---|
| 291 | n/a | return NULL; |
|---|
| 292 | n/a | _err = SetWindowClass(_self->ob_itself, |
|---|
| 293 | n/a | inWindowClass); |
|---|
| 294 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 295 | n/a | Py_INCREF(Py_None); |
|---|
| 296 | n/a | _res = Py_None; |
|---|
| 297 | n/a | return _res; |
|---|
| 298 | n/a | } |
|---|
| 299 | n/a | |
|---|
| 300 | n/a | static PyObject *WinObj_SetWindowModality(WindowObject *_self, PyObject *_args) |
|---|
| 301 | n/a | { |
|---|
| 302 | n/a | PyObject *_res = NULL; |
|---|
| 303 | n/a | OSStatus _err; |
|---|
| 304 | n/a | WindowModality inModalKind; |
|---|
| 305 | n/a | WindowPtr inUnavailableWindow; |
|---|
| 306 | n/a | #ifndef SetWindowModality |
|---|
| 307 | n/a | PyMac_PRECHECK(SetWindowModality); |
|---|
| 308 | n/a | #endif |
|---|
| 309 | n/a | if (!PyArg_ParseTuple(_args, "lO&", |
|---|
| 310 | n/a | &inModalKind, |
|---|
| 311 | n/a | WinObj_Convert, &inUnavailableWindow)) |
|---|
| 312 | n/a | return NULL; |
|---|
| 313 | n/a | _err = SetWindowModality(_self->ob_itself, |
|---|
| 314 | n/a | inModalKind, |
|---|
| 315 | n/a | inUnavailableWindow); |
|---|
| 316 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 317 | n/a | Py_INCREF(Py_None); |
|---|
| 318 | n/a | _res = Py_None; |
|---|
| 319 | n/a | return _res; |
|---|
| 320 | n/a | } |
|---|
| 321 | n/a | |
|---|
| 322 | n/a | static PyObject *WinObj_GetWindowModality(WindowObject *_self, PyObject *_args) |
|---|
| 323 | n/a | { |
|---|
| 324 | n/a | PyObject *_res = NULL; |
|---|
| 325 | n/a | OSStatus _err; |
|---|
| 326 | n/a | WindowModality outModalKind; |
|---|
| 327 | n/a | WindowPtr outUnavailableWindow; |
|---|
| 328 | n/a | #ifndef GetWindowModality |
|---|
| 329 | n/a | PyMac_PRECHECK(GetWindowModality); |
|---|
| 330 | n/a | #endif |
|---|
| 331 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 332 | n/a | return NULL; |
|---|
| 333 | n/a | _err = GetWindowModality(_self->ob_itself, |
|---|
| 334 | n/a | &outModalKind, |
|---|
| 335 | n/a | &outUnavailableWindow); |
|---|
| 336 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 337 | n/a | _res = Py_BuildValue("lO&", |
|---|
| 338 | n/a | outModalKind, |
|---|
| 339 | n/a | WinObj_WhichWindow, outUnavailableWindow); |
|---|
| 340 | n/a | return _res; |
|---|
| 341 | n/a | } |
|---|
| 342 | n/a | |
|---|
| 343 | n/a | static PyObject *WinObj_SetWindowContentColor(WindowObject *_self, PyObject *_args) |
|---|
| 344 | n/a | { |
|---|
| 345 | n/a | PyObject *_res = NULL; |
|---|
| 346 | n/a | OSStatus _err; |
|---|
| 347 | n/a | RGBColor color; |
|---|
| 348 | n/a | #ifndef SetWindowContentColor |
|---|
| 349 | n/a | PyMac_PRECHECK(SetWindowContentColor); |
|---|
| 350 | n/a | #endif |
|---|
| 351 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 352 | n/a | QdRGB_Convert, &color)) |
|---|
| 353 | n/a | return NULL; |
|---|
| 354 | n/a | _err = SetWindowContentColor(_self->ob_itself, |
|---|
| 355 | n/a | &color); |
|---|
| 356 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 357 | n/a | Py_INCREF(Py_None); |
|---|
| 358 | n/a | _res = Py_None; |
|---|
| 359 | n/a | return _res; |
|---|
| 360 | n/a | } |
|---|
| 361 | n/a | |
|---|
| 362 | n/a | static PyObject *WinObj_GetWindowContentColor(WindowObject *_self, PyObject *_args) |
|---|
| 363 | n/a | { |
|---|
| 364 | n/a | PyObject *_res = NULL; |
|---|
| 365 | n/a | OSStatus _err; |
|---|
| 366 | n/a | RGBColor color; |
|---|
| 367 | n/a | #ifndef GetWindowContentColor |
|---|
| 368 | n/a | PyMac_PRECHECK(GetWindowContentColor); |
|---|
| 369 | n/a | #endif |
|---|
| 370 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 371 | n/a | return NULL; |
|---|
| 372 | n/a | _err = GetWindowContentColor(_self->ob_itself, |
|---|
| 373 | n/a | &color); |
|---|
| 374 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 375 | n/a | _res = Py_BuildValue("O&", |
|---|
| 376 | n/a | QdRGB_New, &color); |
|---|
| 377 | n/a | return _res; |
|---|
| 378 | n/a | } |
|---|
| 379 | n/a | |
|---|
| 380 | n/a | static PyObject *WinObj_GetWindowContentPattern(WindowObject *_self, PyObject *_args) |
|---|
| 381 | n/a | { |
|---|
| 382 | n/a | PyObject *_res = NULL; |
|---|
| 383 | n/a | OSStatus _err; |
|---|
| 384 | n/a | PixPatHandle outPixPat; |
|---|
| 385 | n/a | #ifndef GetWindowContentPattern |
|---|
| 386 | n/a | PyMac_PRECHECK(GetWindowContentPattern); |
|---|
| 387 | n/a | #endif |
|---|
| 388 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 389 | n/a | ResObj_Convert, &outPixPat)) |
|---|
| 390 | n/a | return NULL; |
|---|
| 391 | n/a | _err = GetWindowContentPattern(_self->ob_itself, |
|---|
| 392 | n/a | outPixPat); |
|---|
| 393 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 394 | n/a | Py_INCREF(Py_None); |
|---|
| 395 | n/a | _res = Py_None; |
|---|
| 396 | n/a | return _res; |
|---|
| 397 | n/a | } |
|---|
| 398 | n/a | |
|---|
| 399 | n/a | static PyObject *WinObj_SetWindowContentPattern(WindowObject *_self, PyObject *_args) |
|---|
| 400 | n/a | { |
|---|
| 401 | n/a | PyObject *_res = NULL; |
|---|
| 402 | n/a | OSStatus _err; |
|---|
| 403 | n/a | PixPatHandle pixPat; |
|---|
| 404 | n/a | #ifndef SetWindowContentPattern |
|---|
| 405 | n/a | PyMac_PRECHECK(SetWindowContentPattern); |
|---|
| 406 | n/a | #endif |
|---|
| 407 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 408 | n/a | ResObj_Convert, &pixPat)) |
|---|
| 409 | n/a | return NULL; |
|---|
| 410 | n/a | _err = SetWindowContentPattern(_self->ob_itself, |
|---|
| 411 | n/a | pixPat); |
|---|
| 412 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 413 | n/a | Py_INCREF(Py_None); |
|---|
| 414 | n/a | _res = Py_None; |
|---|
| 415 | n/a | return _res; |
|---|
| 416 | n/a | } |
|---|
| 417 | n/a | |
|---|
| 418 | n/a | static PyObject *WinObj_ScrollWindowRect(WindowObject *_self, PyObject *_args) |
|---|
| 419 | n/a | { |
|---|
| 420 | n/a | PyObject *_res = NULL; |
|---|
| 421 | n/a | OSStatus _err; |
|---|
| 422 | n/a | Rect inScrollRect; |
|---|
| 423 | n/a | SInt16 inHPixels; |
|---|
| 424 | n/a | SInt16 inVPixels; |
|---|
| 425 | n/a | ScrollWindowOptions inOptions; |
|---|
| 426 | n/a | RgnHandle outExposedRgn; |
|---|
| 427 | n/a | #ifndef ScrollWindowRect |
|---|
| 428 | n/a | PyMac_PRECHECK(ScrollWindowRect); |
|---|
| 429 | n/a | #endif |
|---|
| 430 | n/a | if (!PyArg_ParseTuple(_args, "O&hhlO&", |
|---|
| 431 | n/a | PyMac_GetRect, &inScrollRect, |
|---|
| 432 | n/a | &inHPixels, |
|---|
| 433 | n/a | &inVPixels, |
|---|
| 434 | n/a | &inOptions, |
|---|
| 435 | n/a | ResObj_Convert, &outExposedRgn)) |
|---|
| 436 | n/a | return NULL; |
|---|
| 437 | n/a | _err = ScrollWindowRect(_self->ob_itself, |
|---|
| 438 | n/a | &inScrollRect, |
|---|
| 439 | n/a | inHPixels, |
|---|
| 440 | n/a | inVPixels, |
|---|
| 441 | n/a | inOptions, |
|---|
| 442 | n/a | outExposedRgn); |
|---|
| 443 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 444 | n/a | Py_INCREF(Py_None); |
|---|
| 445 | n/a | _res = Py_None; |
|---|
| 446 | n/a | return _res; |
|---|
| 447 | n/a | } |
|---|
| 448 | n/a | |
|---|
| 449 | n/a | static PyObject *WinObj_ScrollWindowRegion(WindowObject *_self, PyObject *_args) |
|---|
| 450 | n/a | { |
|---|
| 451 | n/a | PyObject *_res = NULL; |
|---|
| 452 | n/a | OSStatus _err; |
|---|
| 453 | n/a | RgnHandle inScrollRgn; |
|---|
| 454 | n/a | SInt16 inHPixels; |
|---|
| 455 | n/a | SInt16 inVPixels; |
|---|
| 456 | n/a | ScrollWindowOptions inOptions; |
|---|
| 457 | n/a | RgnHandle outExposedRgn; |
|---|
| 458 | n/a | #ifndef ScrollWindowRegion |
|---|
| 459 | n/a | PyMac_PRECHECK(ScrollWindowRegion); |
|---|
| 460 | n/a | #endif |
|---|
| 461 | n/a | if (!PyArg_ParseTuple(_args, "O&hhlO&", |
|---|
| 462 | n/a | ResObj_Convert, &inScrollRgn, |
|---|
| 463 | n/a | &inHPixels, |
|---|
| 464 | n/a | &inVPixels, |
|---|
| 465 | n/a | &inOptions, |
|---|
| 466 | n/a | ResObj_Convert, &outExposedRgn)) |
|---|
| 467 | n/a | return NULL; |
|---|
| 468 | n/a | _err = ScrollWindowRegion(_self->ob_itself, |
|---|
| 469 | n/a | inScrollRgn, |
|---|
| 470 | n/a | inHPixels, |
|---|
| 471 | n/a | inVPixels, |
|---|
| 472 | n/a | inOptions, |
|---|
| 473 | n/a | outExposedRgn); |
|---|
| 474 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 475 | n/a | Py_INCREF(Py_None); |
|---|
| 476 | n/a | _res = Py_None; |
|---|
| 477 | n/a | return _res; |
|---|
| 478 | n/a | } |
|---|
| 479 | n/a | |
|---|
| 480 | n/a | static PyObject *WinObj_ClipAbove(WindowObject *_self, PyObject *_args) |
|---|
| 481 | n/a | { |
|---|
| 482 | n/a | PyObject *_res = NULL; |
|---|
| 483 | n/a | #ifndef ClipAbove |
|---|
| 484 | n/a | PyMac_PRECHECK(ClipAbove); |
|---|
| 485 | n/a | #endif |
|---|
| 486 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 487 | n/a | return NULL; |
|---|
| 488 | n/a | ClipAbove(_self->ob_itself); |
|---|
| 489 | n/a | Py_INCREF(Py_None); |
|---|
| 490 | n/a | _res = Py_None; |
|---|
| 491 | n/a | return _res; |
|---|
| 492 | n/a | } |
|---|
| 493 | n/a | |
|---|
| 494 | n/a | static PyObject *WinObj_PaintOne(WindowObject *_self, PyObject *_args) |
|---|
| 495 | n/a | { |
|---|
| 496 | n/a | PyObject *_res = NULL; |
|---|
| 497 | n/a | RgnHandle clobberedRgn; |
|---|
| 498 | n/a | #ifndef PaintOne |
|---|
| 499 | n/a | PyMac_PRECHECK(PaintOne); |
|---|
| 500 | n/a | #endif |
|---|
| 501 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 502 | n/a | ResObj_Convert, &clobberedRgn)) |
|---|
| 503 | n/a | return NULL; |
|---|
| 504 | n/a | PaintOne(_self->ob_itself, |
|---|
| 505 | n/a | clobberedRgn); |
|---|
| 506 | n/a | Py_INCREF(Py_None); |
|---|
| 507 | n/a | _res = Py_None; |
|---|
| 508 | n/a | return _res; |
|---|
| 509 | n/a | } |
|---|
| 510 | n/a | |
|---|
| 511 | n/a | static PyObject *WinObj_PaintBehind(WindowObject *_self, PyObject *_args) |
|---|
| 512 | n/a | { |
|---|
| 513 | n/a | PyObject *_res = NULL; |
|---|
| 514 | n/a | RgnHandle clobberedRgn; |
|---|
| 515 | n/a | #ifndef PaintBehind |
|---|
| 516 | n/a | PyMac_PRECHECK(PaintBehind); |
|---|
| 517 | n/a | #endif |
|---|
| 518 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 519 | n/a | ResObj_Convert, &clobberedRgn)) |
|---|
| 520 | n/a | return NULL; |
|---|
| 521 | n/a | PaintBehind(_self->ob_itself, |
|---|
| 522 | n/a | clobberedRgn); |
|---|
| 523 | n/a | Py_INCREF(Py_None); |
|---|
| 524 | n/a | _res = Py_None; |
|---|
| 525 | n/a | return _res; |
|---|
| 526 | n/a | } |
|---|
| 527 | n/a | |
|---|
| 528 | n/a | static PyObject *WinObj_CalcVis(WindowObject *_self, PyObject *_args) |
|---|
| 529 | n/a | { |
|---|
| 530 | n/a | PyObject *_res = NULL; |
|---|
| 531 | n/a | #ifndef CalcVis |
|---|
| 532 | n/a | PyMac_PRECHECK(CalcVis); |
|---|
| 533 | n/a | #endif |
|---|
| 534 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 535 | n/a | return NULL; |
|---|
| 536 | n/a | CalcVis(_self->ob_itself); |
|---|
| 537 | n/a | Py_INCREF(Py_None); |
|---|
| 538 | n/a | _res = Py_None; |
|---|
| 539 | n/a | return _res; |
|---|
| 540 | n/a | } |
|---|
| 541 | n/a | |
|---|
| 542 | n/a | static PyObject *WinObj_CalcVisBehind(WindowObject *_self, PyObject *_args) |
|---|
| 543 | n/a | { |
|---|
| 544 | n/a | PyObject *_res = NULL; |
|---|
| 545 | n/a | RgnHandle clobberedRgn; |
|---|
| 546 | n/a | #ifndef CalcVisBehind |
|---|
| 547 | n/a | PyMac_PRECHECK(CalcVisBehind); |
|---|
| 548 | n/a | #endif |
|---|
| 549 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 550 | n/a | ResObj_Convert, &clobberedRgn)) |
|---|
| 551 | n/a | return NULL; |
|---|
| 552 | n/a | CalcVisBehind(_self->ob_itself, |
|---|
| 553 | n/a | clobberedRgn); |
|---|
| 554 | n/a | Py_INCREF(Py_None); |
|---|
| 555 | n/a | _res = Py_None; |
|---|
| 556 | n/a | return _res; |
|---|
| 557 | n/a | } |
|---|
| 558 | n/a | |
|---|
| 559 | n/a | static PyObject *WinObj_BringToFront(WindowObject *_self, PyObject *_args) |
|---|
| 560 | n/a | { |
|---|
| 561 | n/a | PyObject *_res = NULL; |
|---|
| 562 | n/a | #ifndef BringToFront |
|---|
| 563 | n/a | PyMac_PRECHECK(BringToFront); |
|---|
| 564 | n/a | #endif |
|---|
| 565 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 566 | n/a | return NULL; |
|---|
| 567 | n/a | BringToFront(_self->ob_itself); |
|---|
| 568 | n/a | Py_INCREF(Py_None); |
|---|
| 569 | n/a | _res = Py_None; |
|---|
| 570 | n/a | return _res; |
|---|
| 571 | n/a | } |
|---|
| 572 | n/a | |
|---|
| 573 | n/a | static PyObject *WinObj_SendBehind(WindowObject *_self, PyObject *_args) |
|---|
| 574 | n/a | { |
|---|
| 575 | n/a | PyObject *_res = NULL; |
|---|
| 576 | n/a | WindowPtr behindWindow; |
|---|
| 577 | n/a | #ifndef SendBehind |
|---|
| 578 | n/a | PyMac_PRECHECK(SendBehind); |
|---|
| 579 | n/a | #endif |
|---|
| 580 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 581 | n/a | WinObj_Convert, &behindWindow)) |
|---|
| 582 | n/a | return NULL; |
|---|
| 583 | n/a | SendBehind(_self->ob_itself, |
|---|
| 584 | n/a | behindWindow); |
|---|
| 585 | n/a | Py_INCREF(Py_None); |
|---|
| 586 | n/a | _res = Py_None; |
|---|
| 587 | n/a | return _res; |
|---|
| 588 | n/a | } |
|---|
| 589 | n/a | |
|---|
| 590 | n/a | static PyObject *WinObj_SelectWindow(WindowObject *_self, PyObject *_args) |
|---|
| 591 | n/a | { |
|---|
| 592 | n/a | PyObject *_res = NULL; |
|---|
| 593 | n/a | #ifndef SelectWindow |
|---|
| 594 | n/a | PyMac_PRECHECK(SelectWindow); |
|---|
| 595 | n/a | #endif |
|---|
| 596 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 597 | n/a | return NULL; |
|---|
| 598 | n/a | SelectWindow(_self->ob_itself); |
|---|
| 599 | n/a | Py_INCREF(Py_None); |
|---|
| 600 | n/a | _res = Py_None; |
|---|
| 601 | n/a | return _res; |
|---|
| 602 | n/a | } |
|---|
| 603 | n/a | |
|---|
| 604 | n/a | static PyObject *WinObj_GetNextWindowOfClass(WindowObject *_self, PyObject *_args) |
|---|
| 605 | n/a | { |
|---|
| 606 | n/a | PyObject *_res = NULL; |
|---|
| 607 | n/a | WindowPtr _rv; |
|---|
| 608 | n/a | WindowClass inWindowClass; |
|---|
| 609 | n/a | Boolean mustBeVisible; |
|---|
| 610 | n/a | #ifndef GetNextWindowOfClass |
|---|
| 611 | n/a | PyMac_PRECHECK(GetNextWindowOfClass); |
|---|
| 612 | n/a | #endif |
|---|
| 613 | n/a | if (!PyArg_ParseTuple(_args, "lb", |
|---|
| 614 | n/a | &inWindowClass, |
|---|
| 615 | n/a | &mustBeVisible)) |
|---|
| 616 | n/a | return NULL; |
|---|
| 617 | n/a | _rv = GetNextWindowOfClass(_self->ob_itself, |
|---|
| 618 | n/a | inWindowClass, |
|---|
| 619 | n/a | mustBeVisible); |
|---|
| 620 | n/a | _res = Py_BuildValue("O&", |
|---|
| 621 | n/a | WinObj_New, _rv); |
|---|
| 622 | n/a | return _res; |
|---|
| 623 | n/a | } |
|---|
| 624 | n/a | |
|---|
| 625 | n/a | static PyObject *WinObj_SetWindowAlternateTitle(WindowObject *_self, PyObject *_args) |
|---|
| 626 | n/a | { |
|---|
| 627 | n/a | PyObject *_res = NULL; |
|---|
| 628 | n/a | OSStatus _err; |
|---|
| 629 | n/a | CFStringRef inTitle; |
|---|
| 630 | n/a | #ifndef SetWindowAlternateTitle |
|---|
| 631 | n/a | PyMac_PRECHECK(SetWindowAlternateTitle); |
|---|
| 632 | n/a | #endif |
|---|
| 633 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 634 | n/a | CFStringRefObj_Convert, &inTitle)) |
|---|
| 635 | n/a | return NULL; |
|---|
| 636 | n/a | _err = SetWindowAlternateTitle(_self->ob_itself, |
|---|
| 637 | n/a | inTitle); |
|---|
| 638 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 639 | n/a | Py_INCREF(Py_None); |
|---|
| 640 | n/a | _res = Py_None; |
|---|
| 641 | n/a | return _res; |
|---|
| 642 | n/a | } |
|---|
| 643 | n/a | |
|---|
| 644 | n/a | static PyObject *WinObj_CopyWindowAlternateTitle(WindowObject *_self, PyObject *_args) |
|---|
| 645 | n/a | { |
|---|
| 646 | n/a | PyObject *_res = NULL; |
|---|
| 647 | n/a | OSStatus _err; |
|---|
| 648 | n/a | CFStringRef outTitle; |
|---|
| 649 | n/a | #ifndef CopyWindowAlternateTitle |
|---|
| 650 | n/a | PyMac_PRECHECK(CopyWindowAlternateTitle); |
|---|
| 651 | n/a | #endif |
|---|
| 652 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 653 | n/a | return NULL; |
|---|
| 654 | n/a | _err = CopyWindowAlternateTitle(_self->ob_itself, |
|---|
| 655 | n/a | &outTitle); |
|---|
| 656 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 657 | n/a | _res = Py_BuildValue("O&", |
|---|
| 658 | n/a | CFStringRefObj_New, outTitle); |
|---|
| 659 | n/a | return _res; |
|---|
| 660 | n/a | } |
|---|
| 661 | n/a | |
|---|
| 662 | n/a | static PyObject *WinObj_HiliteWindow(WindowObject *_self, PyObject *_args) |
|---|
| 663 | n/a | { |
|---|
| 664 | n/a | PyObject *_res = NULL; |
|---|
| 665 | n/a | Boolean fHilite; |
|---|
| 666 | n/a | #ifndef HiliteWindow |
|---|
| 667 | n/a | PyMac_PRECHECK(HiliteWindow); |
|---|
| 668 | n/a | #endif |
|---|
| 669 | n/a | if (!PyArg_ParseTuple(_args, "b", |
|---|
| 670 | n/a | &fHilite)) |
|---|
| 671 | n/a | return NULL; |
|---|
| 672 | n/a | HiliteWindow(_self->ob_itself, |
|---|
| 673 | n/a | fHilite); |
|---|
| 674 | n/a | Py_INCREF(Py_None); |
|---|
| 675 | n/a | _res = Py_None; |
|---|
| 676 | n/a | return _res; |
|---|
| 677 | n/a | } |
|---|
| 678 | n/a | |
|---|
| 679 | n/a | static PyObject *WinObj_SetWRefCon(WindowObject *_self, PyObject *_args) |
|---|
| 680 | n/a | { |
|---|
| 681 | n/a | PyObject *_res = NULL; |
|---|
| 682 | n/a | long data; |
|---|
| 683 | n/a | #ifndef SetWRefCon |
|---|
| 684 | n/a | PyMac_PRECHECK(SetWRefCon); |
|---|
| 685 | n/a | #endif |
|---|
| 686 | n/a | if (!PyArg_ParseTuple(_args, "l", |
|---|
| 687 | n/a | &data)) |
|---|
| 688 | n/a | return NULL; |
|---|
| 689 | n/a | SetWRefCon(_self->ob_itself, |
|---|
| 690 | n/a | data); |
|---|
| 691 | n/a | Py_INCREF(Py_None); |
|---|
| 692 | n/a | _res = Py_None; |
|---|
| 693 | n/a | return _res; |
|---|
| 694 | n/a | } |
|---|
| 695 | n/a | |
|---|
| 696 | n/a | static PyObject *WinObj_GetWRefCon(WindowObject *_self, PyObject *_args) |
|---|
| 697 | n/a | { |
|---|
| 698 | n/a | PyObject *_res = NULL; |
|---|
| 699 | n/a | long _rv; |
|---|
| 700 | n/a | #ifndef GetWRefCon |
|---|
| 701 | n/a | PyMac_PRECHECK(GetWRefCon); |
|---|
| 702 | n/a | #endif |
|---|
| 703 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 704 | n/a | return NULL; |
|---|
| 705 | n/a | _rv = GetWRefCon(_self->ob_itself); |
|---|
| 706 | n/a | _res = Py_BuildValue("l", |
|---|
| 707 | n/a | _rv); |
|---|
| 708 | n/a | return _res; |
|---|
| 709 | n/a | } |
|---|
| 710 | n/a | |
|---|
| 711 | n/a | static PyObject *WinObj_SetWindowPic(WindowObject *_self, PyObject *_args) |
|---|
| 712 | n/a | { |
|---|
| 713 | n/a | PyObject *_res = NULL; |
|---|
| 714 | n/a | PicHandle pic; |
|---|
| 715 | n/a | #ifndef SetWindowPic |
|---|
| 716 | n/a | PyMac_PRECHECK(SetWindowPic); |
|---|
| 717 | n/a | #endif |
|---|
| 718 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 719 | n/a | ResObj_Convert, &pic)) |
|---|
| 720 | n/a | return NULL; |
|---|
| 721 | n/a | SetWindowPic(_self->ob_itself, |
|---|
| 722 | n/a | pic); |
|---|
| 723 | n/a | Py_INCREF(Py_None); |
|---|
| 724 | n/a | _res = Py_None; |
|---|
| 725 | n/a | return _res; |
|---|
| 726 | n/a | } |
|---|
| 727 | n/a | |
|---|
| 728 | n/a | static PyObject *WinObj_GetWindowPic(WindowObject *_self, PyObject *_args) |
|---|
| 729 | n/a | { |
|---|
| 730 | n/a | PyObject *_res = NULL; |
|---|
| 731 | n/a | PicHandle _rv; |
|---|
| 732 | n/a | #ifndef GetWindowPic |
|---|
| 733 | n/a | PyMac_PRECHECK(GetWindowPic); |
|---|
| 734 | n/a | #endif |
|---|
| 735 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 736 | n/a | return NULL; |
|---|
| 737 | n/a | _rv = GetWindowPic(_self->ob_itself); |
|---|
| 738 | n/a | _res = Py_BuildValue("O&", |
|---|
| 739 | n/a | ResObj_New, _rv); |
|---|
| 740 | n/a | return _res; |
|---|
| 741 | n/a | } |
|---|
| 742 | n/a | |
|---|
| 743 | n/a | static PyObject *WinObj_GetWVariant(WindowObject *_self, PyObject *_args) |
|---|
| 744 | n/a | { |
|---|
| 745 | n/a | PyObject *_res = NULL; |
|---|
| 746 | n/a | short _rv; |
|---|
| 747 | n/a | #ifndef GetWVariant |
|---|
| 748 | n/a | PyMac_PRECHECK(GetWVariant); |
|---|
| 749 | n/a | #endif |
|---|
| 750 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 751 | n/a | return NULL; |
|---|
| 752 | n/a | _rv = GetWVariant(_self->ob_itself); |
|---|
| 753 | n/a | _res = Py_BuildValue("h", |
|---|
| 754 | n/a | _rv); |
|---|
| 755 | n/a | return _res; |
|---|
| 756 | n/a | } |
|---|
| 757 | n/a | |
|---|
| 758 | n/a | static PyObject *WinObj_GetWindowFeatures(WindowObject *_self, PyObject *_args) |
|---|
| 759 | n/a | { |
|---|
| 760 | n/a | PyObject *_res = NULL; |
|---|
| 761 | n/a | OSStatus _err; |
|---|
| 762 | n/a | UInt32 outFeatures; |
|---|
| 763 | n/a | #ifndef GetWindowFeatures |
|---|
| 764 | n/a | PyMac_PRECHECK(GetWindowFeatures); |
|---|
| 765 | n/a | #endif |
|---|
| 766 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 767 | n/a | return NULL; |
|---|
| 768 | n/a | _err = GetWindowFeatures(_self->ob_itself, |
|---|
| 769 | n/a | &outFeatures); |
|---|
| 770 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 771 | n/a | _res = Py_BuildValue("l", |
|---|
| 772 | n/a | outFeatures); |
|---|
| 773 | n/a | return _res; |
|---|
| 774 | n/a | } |
|---|
| 775 | n/a | |
|---|
| 776 | n/a | static PyObject *WinObj_GetWindowRegion(WindowObject *_self, PyObject *_args) |
|---|
| 777 | n/a | { |
|---|
| 778 | n/a | PyObject *_res = NULL; |
|---|
| 779 | n/a | OSStatus _err; |
|---|
| 780 | n/a | WindowRegionCode inRegionCode; |
|---|
| 781 | n/a | RgnHandle ioWinRgn; |
|---|
| 782 | n/a | #ifndef GetWindowRegion |
|---|
| 783 | n/a | PyMac_PRECHECK(GetWindowRegion); |
|---|
| 784 | n/a | #endif |
|---|
| 785 | n/a | if (!PyArg_ParseTuple(_args, "HO&", |
|---|
| 786 | n/a | &inRegionCode, |
|---|
| 787 | n/a | ResObj_Convert, &ioWinRgn)) |
|---|
| 788 | n/a | return NULL; |
|---|
| 789 | n/a | _err = GetWindowRegion(_self->ob_itself, |
|---|
| 790 | n/a | inRegionCode, |
|---|
| 791 | n/a | ioWinRgn); |
|---|
| 792 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 793 | n/a | Py_INCREF(Py_None); |
|---|
| 794 | n/a | _res = Py_None; |
|---|
| 795 | n/a | return _res; |
|---|
| 796 | n/a | } |
|---|
| 797 | n/a | |
|---|
| 798 | n/a | static PyObject *WinObj_GetWindowStructureWidths(WindowObject *_self, PyObject *_args) |
|---|
| 799 | n/a | { |
|---|
| 800 | n/a | PyObject *_res = NULL; |
|---|
| 801 | n/a | OSStatus _err; |
|---|
| 802 | n/a | Rect outRect; |
|---|
| 803 | n/a | #ifndef GetWindowStructureWidths |
|---|
| 804 | n/a | PyMac_PRECHECK(GetWindowStructureWidths); |
|---|
| 805 | n/a | #endif |
|---|
| 806 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 807 | n/a | return NULL; |
|---|
| 808 | n/a | _err = GetWindowStructureWidths(_self->ob_itself, |
|---|
| 809 | n/a | &outRect); |
|---|
| 810 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 811 | n/a | _res = Py_BuildValue("O&", |
|---|
| 812 | n/a | PyMac_BuildRect, &outRect); |
|---|
| 813 | n/a | return _res; |
|---|
| 814 | n/a | } |
|---|
| 815 | n/a | |
|---|
| 816 | n/a | static PyObject *WinObj_BeginUpdate(WindowObject *_self, PyObject *_args) |
|---|
| 817 | n/a | { |
|---|
| 818 | n/a | PyObject *_res = NULL; |
|---|
| 819 | n/a | #ifndef BeginUpdate |
|---|
| 820 | n/a | PyMac_PRECHECK(BeginUpdate); |
|---|
| 821 | n/a | #endif |
|---|
| 822 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 823 | n/a | return NULL; |
|---|
| 824 | n/a | BeginUpdate(_self->ob_itself); |
|---|
| 825 | n/a | Py_INCREF(Py_None); |
|---|
| 826 | n/a | _res = Py_None; |
|---|
| 827 | n/a | return _res; |
|---|
| 828 | n/a | } |
|---|
| 829 | n/a | |
|---|
| 830 | n/a | static PyObject *WinObj_EndUpdate(WindowObject *_self, PyObject *_args) |
|---|
| 831 | n/a | { |
|---|
| 832 | n/a | PyObject *_res = NULL; |
|---|
| 833 | n/a | #ifndef EndUpdate |
|---|
| 834 | n/a | PyMac_PRECHECK(EndUpdate); |
|---|
| 835 | n/a | #endif |
|---|
| 836 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 837 | n/a | return NULL; |
|---|
| 838 | n/a | EndUpdate(_self->ob_itself); |
|---|
| 839 | n/a | Py_INCREF(Py_None); |
|---|
| 840 | n/a | _res = Py_None; |
|---|
| 841 | n/a | return _res; |
|---|
| 842 | n/a | } |
|---|
| 843 | n/a | |
|---|
| 844 | n/a | static PyObject *WinObj_InvalWindowRgn(WindowObject *_self, PyObject *_args) |
|---|
| 845 | n/a | { |
|---|
| 846 | n/a | PyObject *_res = NULL; |
|---|
| 847 | n/a | OSStatus _err; |
|---|
| 848 | n/a | RgnHandle region; |
|---|
| 849 | n/a | #ifndef InvalWindowRgn |
|---|
| 850 | n/a | PyMac_PRECHECK(InvalWindowRgn); |
|---|
| 851 | n/a | #endif |
|---|
| 852 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 853 | n/a | ResObj_Convert, ®ion)) |
|---|
| 854 | n/a | return NULL; |
|---|
| 855 | n/a | _err = InvalWindowRgn(_self->ob_itself, |
|---|
| 856 | n/a | region); |
|---|
| 857 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 858 | n/a | Py_INCREF(Py_None); |
|---|
| 859 | n/a | _res = Py_None; |
|---|
| 860 | n/a | return _res; |
|---|
| 861 | n/a | } |
|---|
| 862 | n/a | |
|---|
| 863 | n/a | static PyObject *WinObj_InvalWindowRect(WindowObject *_self, PyObject *_args) |
|---|
| 864 | n/a | { |
|---|
| 865 | n/a | PyObject *_res = NULL; |
|---|
| 866 | n/a | OSStatus _err; |
|---|
| 867 | n/a | Rect bounds; |
|---|
| 868 | n/a | #ifndef InvalWindowRect |
|---|
| 869 | n/a | PyMac_PRECHECK(InvalWindowRect); |
|---|
| 870 | n/a | #endif |
|---|
| 871 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 872 | n/a | PyMac_GetRect, &bounds)) |
|---|
| 873 | n/a | return NULL; |
|---|
| 874 | n/a | _err = InvalWindowRect(_self->ob_itself, |
|---|
| 875 | n/a | &bounds); |
|---|
| 876 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 877 | n/a | Py_INCREF(Py_None); |
|---|
| 878 | n/a | _res = Py_None; |
|---|
| 879 | n/a | return _res; |
|---|
| 880 | n/a | } |
|---|
| 881 | n/a | |
|---|
| 882 | n/a | static PyObject *WinObj_ValidWindowRgn(WindowObject *_self, PyObject *_args) |
|---|
| 883 | n/a | { |
|---|
| 884 | n/a | PyObject *_res = NULL; |
|---|
| 885 | n/a | OSStatus _err; |
|---|
| 886 | n/a | RgnHandle region; |
|---|
| 887 | n/a | #ifndef ValidWindowRgn |
|---|
| 888 | n/a | PyMac_PRECHECK(ValidWindowRgn); |
|---|
| 889 | n/a | #endif |
|---|
| 890 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 891 | n/a | ResObj_Convert, ®ion)) |
|---|
| 892 | n/a | return NULL; |
|---|
| 893 | n/a | _err = ValidWindowRgn(_self->ob_itself, |
|---|
| 894 | n/a | region); |
|---|
| 895 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 896 | n/a | Py_INCREF(Py_None); |
|---|
| 897 | n/a | _res = Py_None; |
|---|
| 898 | n/a | return _res; |
|---|
| 899 | n/a | } |
|---|
| 900 | n/a | |
|---|
| 901 | n/a | static PyObject *WinObj_ValidWindowRect(WindowObject *_self, PyObject *_args) |
|---|
| 902 | n/a | { |
|---|
| 903 | n/a | PyObject *_res = NULL; |
|---|
| 904 | n/a | OSStatus _err; |
|---|
| 905 | n/a | Rect bounds; |
|---|
| 906 | n/a | #ifndef ValidWindowRect |
|---|
| 907 | n/a | PyMac_PRECHECK(ValidWindowRect); |
|---|
| 908 | n/a | #endif |
|---|
| 909 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 910 | n/a | PyMac_GetRect, &bounds)) |
|---|
| 911 | n/a | return NULL; |
|---|
| 912 | n/a | _err = ValidWindowRect(_self->ob_itself, |
|---|
| 913 | n/a | &bounds); |
|---|
| 914 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 915 | n/a | Py_INCREF(Py_None); |
|---|
| 916 | n/a | _res = Py_None; |
|---|
| 917 | n/a | return _res; |
|---|
| 918 | n/a | } |
|---|
| 919 | n/a | |
|---|
| 920 | n/a | static PyObject *WinObj_DrawGrowIcon(WindowObject *_self, PyObject *_args) |
|---|
| 921 | n/a | { |
|---|
| 922 | n/a | PyObject *_res = NULL; |
|---|
| 923 | n/a | #ifndef DrawGrowIcon |
|---|
| 924 | n/a | PyMac_PRECHECK(DrawGrowIcon); |
|---|
| 925 | n/a | #endif |
|---|
| 926 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 927 | n/a | return NULL; |
|---|
| 928 | n/a | DrawGrowIcon(_self->ob_itself); |
|---|
| 929 | n/a | Py_INCREF(Py_None); |
|---|
| 930 | n/a | _res = Py_None; |
|---|
| 931 | n/a | return _res; |
|---|
| 932 | n/a | } |
|---|
| 933 | n/a | |
|---|
| 934 | n/a | static PyObject *WinObj_SetWTitle(WindowObject *_self, PyObject *_args) |
|---|
| 935 | n/a | { |
|---|
| 936 | n/a | PyObject *_res = NULL; |
|---|
| 937 | n/a | Str255 title; |
|---|
| 938 | n/a | #ifndef SetWTitle |
|---|
| 939 | n/a | PyMac_PRECHECK(SetWTitle); |
|---|
| 940 | n/a | #endif |
|---|
| 941 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 942 | n/a | PyMac_GetStr255, title)) |
|---|
| 943 | n/a | return NULL; |
|---|
| 944 | n/a | SetWTitle(_self->ob_itself, |
|---|
| 945 | n/a | title); |
|---|
| 946 | n/a | Py_INCREF(Py_None); |
|---|
| 947 | n/a | _res = Py_None; |
|---|
| 948 | n/a | return _res; |
|---|
| 949 | n/a | } |
|---|
| 950 | n/a | |
|---|
| 951 | n/a | static PyObject *WinObj_GetWTitle(WindowObject *_self, PyObject *_args) |
|---|
| 952 | n/a | { |
|---|
| 953 | n/a | PyObject *_res = NULL; |
|---|
| 954 | n/a | Str255 title; |
|---|
| 955 | n/a | #ifndef GetWTitle |
|---|
| 956 | n/a | PyMac_PRECHECK(GetWTitle); |
|---|
| 957 | n/a | #endif |
|---|
| 958 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 959 | n/a | return NULL; |
|---|
| 960 | n/a | GetWTitle(_self->ob_itself, |
|---|
| 961 | n/a | title); |
|---|
| 962 | n/a | _res = Py_BuildValue("O&", |
|---|
| 963 | n/a | PyMac_BuildStr255, title); |
|---|
| 964 | n/a | return _res; |
|---|
| 965 | n/a | } |
|---|
| 966 | n/a | |
|---|
| 967 | n/a | static PyObject *WinObj_SetWindowTitleWithCFString(WindowObject *_self, PyObject *_args) |
|---|
| 968 | n/a | { |
|---|
| 969 | n/a | PyObject *_res = NULL; |
|---|
| 970 | n/a | OSStatus _err; |
|---|
| 971 | n/a | CFStringRef inString; |
|---|
| 972 | n/a | #ifndef SetWindowTitleWithCFString |
|---|
| 973 | n/a | PyMac_PRECHECK(SetWindowTitleWithCFString); |
|---|
| 974 | n/a | #endif |
|---|
| 975 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 976 | n/a | CFStringRefObj_Convert, &inString)) |
|---|
| 977 | n/a | return NULL; |
|---|
| 978 | n/a | _err = SetWindowTitleWithCFString(_self->ob_itself, |
|---|
| 979 | n/a | inString); |
|---|
| 980 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 981 | n/a | Py_INCREF(Py_None); |
|---|
| 982 | n/a | _res = Py_None; |
|---|
| 983 | n/a | return _res; |
|---|
| 984 | n/a | } |
|---|
| 985 | n/a | |
|---|
| 986 | n/a | static PyObject *WinObj_CopyWindowTitleAsCFString(WindowObject *_self, PyObject *_args) |
|---|
| 987 | n/a | { |
|---|
| 988 | n/a | PyObject *_res = NULL; |
|---|
| 989 | n/a | OSStatus _err; |
|---|
| 990 | n/a | CFStringRef outString; |
|---|
| 991 | n/a | #ifndef CopyWindowTitleAsCFString |
|---|
| 992 | n/a | PyMac_PRECHECK(CopyWindowTitleAsCFString); |
|---|
| 993 | n/a | #endif |
|---|
| 994 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 995 | n/a | return NULL; |
|---|
| 996 | n/a | _err = CopyWindowTitleAsCFString(_self->ob_itself, |
|---|
| 997 | n/a | &outString); |
|---|
| 998 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 999 | n/a | _res = Py_BuildValue("O&", |
|---|
| 1000 | n/a | CFStringRefObj_New, outString); |
|---|
| 1001 | n/a | return _res; |
|---|
| 1002 | n/a | } |
|---|
| 1003 | n/a | |
|---|
| 1004 | n/a | static PyObject *WinObj_SetWindowProxyFSSpec(WindowObject *_self, PyObject *_args) |
|---|
| 1005 | n/a | { |
|---|
| 1006 | n/a | PyObject *_res = NULL; |
|---|
| 1007 | n/a | OSStatus _err; |
|---|
| 1008 | n/a | FSSpec inFile; |
|---|
| 1009 | n/a | #ifndef SetWindowProxyFSSpec |
|---|
| 1010 | n/a | PyMac_PRECHECK(SetWindowProxyFSSpec); |
|---|
| 1011 | n/a | #endif |
|---|
| 1012 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 1013 | n/a | PyMac_GetFSSpec, &inFile)) |
|---|
| 1014 | n/a | return NULL; |
|---|
| 1015 | n/a | _err = SetWindowProxyFSSpec(_self->ob_itself, |
|---|
| 1016 | n/a | &inFile); |
|---|
| 1017 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1018 | n/a | Py_INCREF(Py_None); |
|---|
| 1019 | n/a | _res = Py_None; |
|---|
| 1020 | n/a | return _res; |
|---|
| 1021 | n/a | } |
|---|
| 1022 | n/a | |
|---|
| 1023 | n/a | static PyObject *WinObj_GetWindowProxyFSSpec(WindowObject *_self, PyObject *_args) |
|---|
| 1024 | n/a | { |
|---|
| 1025 | n/a | PyObject *_res = NULL; |
|---|
| 1026 | n/a | OSStatus _err; |
|---|
| 1027 | n/a | FSSpec outFile; |
|---|
| 1028 | n/a | #ifndef GetWindowProxyFSSpec |
|---|
| 1029 | n/a | PyMac_PRECHECK(GetWindowProxyFSSpec); |
|---|
| 1030 | n/a | #endif |
|---|
| 1031 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1032 | n/a | return NULL; |
|---|
| 1033 | n/a | _err = GetWindowProxyFSSpec(_self->ob_itself, |
|---|
| 1034 | n/a | &outFile); |
|---|
| 1035 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1036 | n/a | _res = Py_BuildValue("O&", |
|---|
| 1037 | n/a | PyMac_BuildFSSpec, &outFile); |
|---|
| 1038 | n/a | return _res; |
|---|
| 1039 | n/a | } |
|---|
| 1040 | n/a | |
|---|
| 1041 | n/a | static PyObject *WinObj_SetWindowProxyAlias(WindowObject *_self, PyObject *_args) |
|---|
| 1042 | n/a | { |
|---|
| 1043 | n/a | PyObject *_res = NULL; |
|---|
| 1044 | n/a | OSStatus _err; |
|---|
| 1045 | n/a | AliasHandle inAlias; |
|---|
| 1046 | n/a | #ifndef SetWindowProxyAlias |
|---|
| 1047 | n/a | PyMac_PRECHECK(SetWindowProxyAlias); |
|---|
| 1048 | n/a | #endif |
|---|
| 1049 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 1050 | n/a | ResObj_Convert, &inAlias)) |
|---|
| 1051 | n/a | return NULL; |
|---|
| 1052 | n/a | _err = SetWindowProxyAlias(_self->ob_itself, |
|---|
| 1053 | n/a | inAlias); |
|---|
| 1054 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1055 | n/a | Py_INCREF(Py_None); |
|---|
| 1056 | n/a | _res = Py_None; |
|---|
| 1057 | n/a | return _res; |
|---|
| 1058 | n/a | } |
|---|
| 1059 | n/a | |
|---|
| 1060 | n/a | static PyObject *WinObj_GetWindowProxyAlias(WindowObject *_self, PyObject *_args) |
|---|
| 1061 | n/a | { |
|---|
| 1062 | n/a | PyObject *_res = NULL; |
|---|
| 1063 | n/a | OSStatus _err; |
|---|
| 1064 | n/a | AliasHandle alias; |
|---|
| 1065 | n/a | #ifndef GetWindowProxyAlias |
|---|
| 1066 | n/a | PyMac_PRECHECK(GetWindowProxyAlias); |
|---|
| 1067 | n/a | #endif |
|---|
| 1068 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1069 | n/a | return NULL; |
|---|
| 1070 | n/a | _err = GetWindowProxyAlias(_self->ob_itself, |
|---|
| 1071 | n/a | &alias); |
|---|
| 1072 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1073 | n/a | _res = Py_BuildValue("O&", |
|---|
| 1074 | n/a | ResObj_New, alias); |
|---|
| 1075 | n/a | return _res; |
|---|
| 1076 | n/a | } |
|---|
| 1077 | n/a | |
|---|
| 1078 | n/a | static PyObject *WinObj_SetWindowProxyCreatorAndType(WindowObject *_self, PyObject *_args) |
|---|
| 1079 | n/a | { |
|---|
| 1080 | n/a | PyObject *_res = NULL; |
|---|
| 1081 | n/a | OSStatus _err; |
|---|
| 1082 | n/a | OSType fileCreator; |
|---|
| 1083 | n/a | OSType fileType; |
|---|
| 1084 | n/a | SInt16 vRefNum; |
|---|
| 1085 | n/a | #ifndef SetWindowProxyCreatorAndType |
|---|
| 1086 | n/a | PyMac_PRECHECK(SetWindowProxyCreatorAndType); |
|---|
| 1087 | n/a | #endif |
|---|
| 1088 | n/a | if (!PyArg_ParseTuple(_args, "O&O&h", |
|---|
| 1089 | n/a | PyMac_GetOSType, &fileCreator, |
|---|
| 1090 | n/a | PyMac_GetOSType, &fileType, |
|---|
| 1091 | n/a | &vRefNum)) |
|---|
| 1092 | n/a | return NULL; |
|---|
| 1093 | n/a | _err = SetWindowProxyCreatorAndType(_self->ob_itself, |
|---|
| 1094 | n/a | fileCreator, |
|---|
| 1095 | n/a | fileType, |
|---|
| 1096 | n/a | vRefNum); |
|---|
| 1097 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1098 | n/a | Py_INCREF(Py_None); |
|---|
| 1099 | n/a | _res = Py_None; |
|---|
| 1100 | n/a | return _res; |
|---|
| 1101 | n/a | } |
|---|
| 1102 | n/a | |
|---|
| 1103 | n/a | static PyObject *WinObj_GetWindowProxyIcon(WindowObject *_self, PyObject *_args) |
|---|
| 1104 | n/a | { |
|---|
| 1105 | n/a | PyObject *_res = NULL; |
|---|
| 1106 | n/a | OSStatus _err; |
|---|
| 1107 | n/a | IconRef outIcon; |
|---|
| 1108 | n/a | #ifndef GetWindowProxyIcon |
|---|
| 1109 | n/a | PyMac_PRECHECK(GetWindowProxyIcon); |
|---|
| 1110 | n/a | #endif |
|---|
| 1111 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1112 | n/a | return NULL; |
|---|
| 1113 | n/a | _err = GetWindowProxyIcon(_self->ob_itself, |
|---|
| 1114 | n/a | &outIcon); |
|---|
| 1115 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1116 | n/a | _res = Py_BuildValue("O&", |
|---|
| 1117 | n/a | ResObj_New, outIcon); |
|---|
| 1118 | n/a | return _res; |
|---|
| 1119 | n/a | } |
|---|
| 1120 | n/a | |
|---|
| 1121 | n/a | static PyObject *WinObj_SetWindowProxyIcon(WindowObject *_self, PyObject *_args) |
|---|
| 1122 | n/a | { |
|---|
| 1123 | n/a | PyObject *_res = NULL; |
|---|
| 1124 | n/a | OSStatus _err; |
|---|
| 1125 | n/a | IconRef icon; |
|---|
| 1126 | n/a | #ifndef SetWindowProxyIcon |
|---|
| 1127 | n/a | PyMac_PRECHECK(SetWindowProxyIcon); |
|---|
| 1128 | n/a | #endif |
|---|
| 1129 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 1130 | n/a | ResObj_Convert, &icon)) |
|---|
| 1131 | n/a | return NULL; |
|---|
| 1132 | n/a | _err = SetWindowProxyIcon(_self->ob_itself, |
|---|
| 1133 | n/a | icon); |
|---|
| 1134 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1135 | n/a | Py_INCREF(Py_None); |
|---|
| 1136 | n/a | _res = Py_None; |
|---|
| 1137 | n/a | return _res; |
|---|
| 1138 | n/a | } |
|---|
| 1139 | n/a | |
|---|
| 1140 | n/a | static PyObject *WinObj_RemoveWindowProxy(WindowObject *_self, PyObject *_args) |
|---|
| 1141 | n/a | { |
|---|
| 1142 | n/a | PyObject *_res = NULL; |
|---|
| 1143 | n/a | OSStatus _err; |
|---|
| 1144 | n/a | #ifndef RemoveWindowProxy |
|---|
| 1145 | n/a | PyMac_PRECHECK(RemoveWindowProxy); |
|---|
| 1146 | n/a | #endif |
|---|
| 1147 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1148 | n/a | return NULL; |
|---|
| 1149 | n/a | _err = RemoveWindowProxy(_self->ob_itself); |
|---|
| 1150 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1151 | n/a | Py_INCREF(Py_None); |
|---|
| 1152 | n/a | _res = Py_None; |
|---|
| 1153 | n/a | return _res; |
|---|
| 1154 | n/a | } |
|---|
| 1155 | n/a | |
|---|
| 1156 | n/a | static PyObject *WinObj_BeginWindowProxyDrag(WindowObject *_self, PyObject *_args) |
|---|
| 1157 | n/a | { |
|---|
| 1158 | n/a | PyObject *_res = NULL; |
|---|
| 1159 | n/a | OSStatus _err; |
|---|
| 1160 | n/a | DragReference outNewDrag; |
|---|
| 1161 | n/a | RgnHandle outDragOutlineRgn; |
|---|
| 1162 | n/a | #ifndef BeginWindowProxyDrag |
|---|
| 1163 | n/a | PyMac_PRECHECK(BeginWindowProxyDrag); |
|---|
| 1164 | n/a | #endif |
|---|
| 1165 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 1166 | n/a | ResObj_Convert, &outDragOutlineRgn)) |
|---|
| 1167 | n/a | return NULL; |
|---|
| 1168 | n/a | _err = BeginWindowProxyDrag(_self->ob_itself, |
|---|
| 1169 | n/a | &outNewDrag, |
|---|
| 1170 | n/a | outDragOutlineRgn); |
|---|
| 1171 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1172 | n/a | _res = Py_BuildValue("O&", |
|---|
| 1173 | n/a | DragObj_New, outNewDrag); |
|---|
| 1174 | n/a | return _res; |
|---|
| 1175 | n/a | } |
|---|
| 1176 | n/a | |
|---|
| 1177 | n/a | static PyObject *WinObj_EndWindowProxyDrag(WindowObject *_self, PyObject *_args) |
|---|
| 1178 | n/a | { |
|---|
| 1179 | n/a | PyObject *_res = NULL; |
|---|
| 1180 | n/a | OSStatus _err; |
|---|
| 1181 | n/a | DragReference theDrag; |
|---|
| 1182 | n/a | #ifndef EndWindowProxyDrag |
|---|
| 1183 | n/a | PyMac_PRECHECK(EndWindowProxyDrag); |
|---|
| 1184 | n/a | #endif |
|---|
| 1185 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 1186 | n/a | DragObj_Convert, &theDrag)) |
|---|
| 1187 | n/a | return NULL; |
|---|
| 1188 | n/a | _err = EndWindowProxyDrag(_self->ob_itself, |
|---|
| 1189 | n/a | theDrag); |
|---|
| 1190 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1191 | n/a | Py_INCREF(Py_None); |
|---|
| 1192 | n/a | _res = Py_None; |
|---|
| 1193 | n/a | return _res; |
|---|
| 1194 | n/a | } |
|---|
| 1195 | n/a | |
|---|
| 1196 | n/a | static PyObject *WinObj_TrackWindowProxyFromExistingDrag(WindowObject *_self, PyObject *_args) |
|---|
| 1197 | n/a | { |
|---|
| 1198 | n/a | PyObject *_res = NULL; |
|---|
| 1199 | n/a | OSStatus _err; |
|---|
| 1200 | n/a | Point startPt; |
|---|
| 1201 | n/a | DragReference drag; |
|---|
| 1202 | n/a | RgnHandle inDragOutlineRgn; |
|---|
| 1203 | n/a | #ifndef TrackWindowProxyFromExistingDrag |
|---|
| 1204 | n/a | PyMac_PRECHECK(TrackWindowProxyFromExistingDrag); |
|---|
| 1205 | n/a | #endif |
|---|
| 1206 | n/a | if (!PyArg_ParseTuple(_args, "O&O&O&", |
|---|
| 1207 | n/a | PyMac_GetPoint, &startPt, |
|---|
| 1208 | n/a | DragObj_Convert, &drag, |
|---|
| 1209 | n/a | ResObj_Convert, &inDragOutlineRgn)) |
|---|
| 1210 | n/a | return NULL; |
|---|
| 1211 | n/a | _err = TrackWindowProxyFromExistingDrag(_self->ob_itself, |
|---|
| 1212 | n/a | startPt, |
|---|
| 1213 | n/a | drag, |
|---|
| 1214 | n/a | inDragOutlineRgn); |
|---|
| 1215 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1216 | n/a | Py_INCREF(Py_None); |
|---|
| 1217 | n/a | _res = Py_None; |
|---|
| 1218 | n/a | return _res; |
|---|
| 1219 | n/a | } |
|---|
| 1220 | n/a | |
|---|
| 1221 | n/a | static PyObject *WinObj_TrackWindowProxyDrag(WindowObject *_self, PyObject *_args) |
|---|
| 1222 | n/a | { |
|---|
| 1223 | n/a | PyObject *_res = NULL; |
|---|
| 1224 | n/a | OSStatus _err; |
|---|
| 1225 | n/a | Point startPt; |
|---|
| 1226 | n/a | #ifndef TrackWindowProxyDrag |
|---|
| 1227 | n/a | PyMac_PRECHECK(TrackWindowProxyDrag); |
|---|
| 1228 | n/a | #endif |
|---|
| 1229 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 1230 | n/a | PyMac_GetPoint, &startPt)) |
|---|
| 1231 | n/a | return NULL; |
|---|
| 1232 | n/a | _err = TrackWindowProxyDrag(_self->ob_itself, |
|---|
| 1233 | n/a | startPt); |
|---|
| 1234 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1235 | n/a | Py_INCREF(Py_None); |
|---|
| 1236 | n/a | _res = Py_None; |
|---|
| 1237 | n/a | return _res; |
|---|
| 1238 | n/a | } |
|---|
| 1239 | n/a | |
|---|
| 1240 | n/a | static PyObject *WinObj_IsWindowModified(WindowObject *_self, PyObject *_args) |
|---|
| 1241 | n/a | { |
|---|
| 1242 | n/a | PyObject *_res = NULL; |
|---|
| 1243 | n/a | Boolean _rv; |
|---|
| 1244 | n/a | #ifndef IsWindowModified |
|---|
| 1245 | n/a | PyMac_PRECHECK(IsWindowModified); |
|---|
| 1246 | n/a | #endif |
|---|
| 1247 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1248 | n/a | return NULL; |
|---|
| 1249 | n/a | _rv = IsWindowModified(_self->ob_itself); |
|---|
| 1250 | n/a | _res = Py_BuildValue("b", |
|---|
| 1251 | n/a | _rv); |
|---|
| 1252 | n/a | return _res; |
|---|
| 1253 | n/a | } |
|---|
| 1254 | n/a | |
|---|
| 1255 | n/a | static PyObject *WinObj_SetWindowModified(WindowObject *_self, PyObject *_args) |
|---|
| 1256 | n/a | { |
|---|
| 1257 | n/a | PyObject *_res = NULL; |
|---|
| 1258 | n/a | OSStatus _err; |
|---|
| 1259 | n/a | Boolean modified; |
|---|
| 1260 | n/a | #ifndef SetWindowModified |
|---|
| 1261 | n/a | PyMac_PRECHECK(SetWindowModified); |
|---|
| 1262 | n/a | #endif |
|---|
| 1263 | n/a | if (!PyArg_ParseTuple(_args, "b", |
|---|
| 1264 | n/a | &modified)) |
|---|
| 1265 | n/a | return NULL; |
|---|
| 1266 | n/a | _err = SetWindowModified(_self->ob_itself, |
|---|
| 1267 | n/a | modified); |
|---|
| 1268 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1269 | n/a | Py_INCREF(Py_None); |
|---|
| 1270 | n/a | _res = Py_None; |
|---|
| 1271 | n/a | return _res; |
|---|
| 1272 | n/a | } |
|---|
| 1273 | n/a | |
|---|
| 1274 | n/a | static PyObject *WinObj_IsWindowPathSelectClick(WindowObject *_self, PyObject *_args) |
|---|
| 1275 | n/a | { |
|---|
| 1276 | n/a | PyObject *_res = NULL; |
|---|
| 1277 | n/a | Boolean _rv; |
|---|
| 1278 | n/a | EventRecord event; |
|---|
| 1279 | n/a | #ifndef IsWindowPathSelectClick |
|---|
| 1280 | n/a | PyMac_PRECHECK(IsWindowPathSelectClick); |
|---|
| 1281 | n/a | #endif |
|---|
| 1282 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 1283 | n/a | PyMac_GetEventRecord, &event)) |
|---|
| 1284 | n/a | return NULL; |
|---|
| 1285 | n/a | _rv = IsWindowPathSelectClick(_self->ob_itself, |
|---|
| 1286 | n/a | &event); |
|---|
| 1287 | n/a | _res = Py_BuildValue("b", |
|---|
| 1288 | n/a | _rv); |
|---|
| 1289 | n/a | return _res; |
|---|
| 1290 | n/a | } |
|---|
| 1291 | n/a | |
|---|
| 1292 | n/a | static PyObject *WinObj_WindowPathSelect(WindowObject *_self, PyObject *_args) |
|---|
| 1293 | n/a | { |
|---|
| 1294 | n/a | PyObject *_res = NULL; |
|---|
| 1295 | n/a | OSStatus _err; |
|---|
| 1296 | n/a | MenuHandle menu; |
|---|
| 1297 | n/a | SInt32 outMenuResult; |
|---|
| 1298 | n/a | #ifndef WindowPathSelect |
|---|
| 1299 | n/a | PyMac_PRECHECK(WindowPathSelect); |
|---|
| 1300 | n/a | #endif |
|---|
| 1301 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 1302 | n/a | MenuObj_Convert, &menu)) |
|---|
| 1303 | n/a | return NULL; |
|---|
| 1304 | n/a | _err = WindowPathSelect(_self->ob_itself, |
|---|
| 1305 | n/a | menu, |
|---|
| 1306 | n/a | &outMenuResult); |
|---|
| 1307 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1308 | n/a | _res = Py_BuildValue("l", |
|---|
| 1309 | n/a | outMenuResult); |
|---|
| 1310 | n/a | return _res; |
|---|
| 1311 | n/a | } |
|---|
| 1312 | n/a | |
|---|
| 1313 | n/a | static PyObject *WinObj_HiliteWindowFrameForDrag(WindowObject *_self, PyObject *_args) |
|---|
| 1314 | n/a | { |
|---|
| 1315 | n/a | PyObject *_res = NULL; |
|---|
| 1316 | n/a | OSStatus _err; |
|---|
| 1317 | n/a | Boolean hilited; |
|---|
| 1318 | n/a | #ifndef HiliteWindowFrameForDrag |
|---|
| 1319 | n/a | PyMac_PRECHECK(HiliteWindowFrameForDrag); |
|---|
| 1320 | n/a | #endif |
|---|
| 1321 | n/a | if (!PyArg_ParseTuple(_args, "b", |
|---|
| 1322 | n/a | &hilited)) |
|---|
| 1323 | n/a | return NULL; |
|---|
| 1324 | n/a | _err = HiliteWindowFrameForDrag(_self->ob_itself, |
|---|
| 1325 | n/a | hilited); |
|---|
| 1326 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1327 | n/a | Py_INCREF(Py_None); |
|---|
| 1328 | n/a | _res = Py_None; |
|---|
| 1329 | n/a | return _res; |
|---|
| 1330 | n/a | } |
|---|
| 1331 | n/a | |
|---|
| 1332 | n/a | static PyObject *WinObj_TransitionWindow(WindowObject *_self, PyObject *_args) |
|---|
| 1333 | n/a | { |
|---|
| 1334 | n/a | PyObject *_res = NULL; |
|---|
| 1335 | n/a | OSStatus _err; |
|---|
| 1336 | n/a | WindowTransitionEffect inEffect; |
|---|
| 1337 | n/a | WindowTransitionAction inAction; |
|---|
| 1338 | n/a | Rect inRect; |
|---|
| 1339 | n/a | #ifndef TransitionWindow |
|---|
| 1340 | n/a | PyMac_PRECHECK(TransitionWindow); |
|---|
| 1341 | n/a | #endif |
|---|
| 1342 | n/a | if (!PyArg_ParseTuple(_args, "llO&", |
|---|
| 1343 | n/a | &inEffect, |
|---|
| 1344 | n/a | &inAction, |
|---|
| 1345 | n/a | PyMac_GetRect, &inRect)) |
|---|
| 1346 | n/a | return NULL; |
|---|
| 1347 | n/a | _err = TransitionWindow(_self->ob_itself, |
|---|
| 1348 | n/a | inEffect, |
|---|
| 1349 | n/a | inAction, |
|---|
| 1350 | n/a | &inRect); |
|---|
| 1351 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1352 | n/a | Py_INCREF(Py_None); |
|---|
| 1353 | n/a | _res = Py_None; |
|---|
| 1354 | n/a | return _res; |
|---|
| 1355 | n/a | } |
|---|
| 1356 | n/a | |
|---|
| 1357 | n/a | static PyObject *WinObj_TransitionWindowAndParent(WindowObject *_self, PyObject *_args) |
|---|
| 1358 | n/a | { |
|---|
| 1359 | n/a | PyObject *_res = NULL; |
|---|
| 1360 | n/a | OSStatus _err; |
|---|
| 1361 | n/a | WindowPtr inParentWindow; |
|---|
| 1362 | n/a | WindowTransitionEffect inEffect; |
|---|
| 1363 | n/a | WindowTransitionAction inAction; |
|---|
| 1364 | n/a | Rect inRect; |
|---|
| 1365 | n/a | #ifndef TransitionWindowAndParent |
|---|
| 1366 | n/a | PyMac_PRECHECK(TransitionWindowAndParent); |
|---|
| 1367 | n/a | #endif |
|---|
| 1368 | n/a | if (!PyArg_ParseTuple(_args, "O&llO&", |
|---|
| 1369 | n/a | WinObj_Convert, &inParentWindow, |
|---|
| 1370 | n/a | &inEffect, |
|---|
| 1371 | n/a | &inAction, |
|---|
| 1372 | n/a | PyMac_GetRect, &inRect)) |
|---|
| 1373 | n/a | return NULL; |
|---|
| 1374 | n/a | _err = TransitionWindowAndParent(_self->ob_itself, |
|---|
| 1375 | n/a | inParentWindow, |
|---|
| 1376 | n/a | inEffect, |
|---|
| 1377 | n/a | inAction, |
|---|
| 1378 | n/a | &inRect); |
|---|
| 1379 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1380 | n/a | Py_INCREF(Py_None); |
|---|
| 1381 | n/a | _res = Py_None; |
|---|
| 1382 | n/a | return _res; |
|---|
| 1383 | n/a | } |
|---|
| 1384 | n/a | |
|---|
| 1385 | n/a | static PyObject *WinObj_MacMoveWindow(WindowObject *_self, PyObject *_args) |
|---|
| 1386 | n/a | { |
|---|
| 1387 | n/a | PyObject *_res = NULL; |
|---|
| 1388 | n/a | short hGlobal; |
|---|
| 1389 | n/a | short vGlobal; |
|---|
| 1390 | n/a | Boolean front; |
|---|
| 1391 | n/a | #ifndef MacMoveWindow |
|---|
| 1392 | n/a | PyMac_PRECHECK(MacMoveWindow); |
|---|
| 1393 | n/a | #endif |
|---|
| 1394 | n/a | if (!PyArg_ParseTuple(_args, "hhb", |
|---|
| 1395 | n/a | &hGlobal, |
|---|
| 1396 | n/a | &vGlobal, |
|---|
| 1397 | n/a | &front)) |
|---|
| 1398 | n/a | return NULL; |
|---|
| 1399 | n/a | MacMoveWindow(_self->ob_itself, |
|---|
| 1400 | n/a | hGlobal, |
|---|
| 1401 | n/a | vGlobal, |
|---|
| 1402 | n/a | front); |
|---|
| 1403 | n/a | Py_INCREF(Py_None); |
|---|
| 1404 | n/a | _res = Py_None; |
|---|
| 1405 | n/a | return _res; |
|---|
| 1406 | n/a | } |
|---|
| 1407 | n/a | |
|---|
| 1408 | n/a | static PyObject *WinObj_SizeWindow(WindowObject *_self, PyObject *_args) |
|---|
| 1409 | n/a | { |
|---|
| 1410 | n/a | PyObject *_res = NULL; |
|---|
| 1411 | n/a | short w; |
|---|
| 1412 | n/a | short h; |
|---|
| 1413 | n/a | Boolean fUpdate; |
|---|
| 1414 | n/a | #ifndef SizeWindow |
|---|
| 1415 | n/a | PyMac_PRECHECK(SizeWindow); |
|---|
| 1416 | n/a | #endif |
|---|
| 1417 | n/a | if (!PyArg_ParseTuple(_args, "hhb", |
|---|
| 1418 | n/a | &w, |
|---|
| 1419 | n/a | &h, |
|---|
| 1420 | n/a | &fUpdate)) |
|---|
| 1421 | n/a | return NULL; |
|---|
| 1422 | n/a | SizeWindow(_self->ob_itself, |
|---|
| 1423 | n/a | w, |
|---|
| 1424 | n/a | h, |
|---|
| 1425 | n/a | fUpdate); |
|---|
| 1426 | n/a | Py_INCREF(Py_None); |
|---|
| 1427 | n/a | _res = Py_None; |
|---|
| 1428 | n/a | return _res; |
|---|
| 1429 | n/a | } |
|---|
| 1430 | n/a | |
|---|
| 1431 | n/a | static PyObject *WinObj_GrowWindow(WindowObject *_self, PyObject *_args) |
|---|
| 1432 | n/a | { |
|---|
| 1433 | n/a | PyObject *_res = NULL; |
|---|
| 1434 | n/a | long _rv; |
|---|
| 1435 | n/a | Point startPt; |
|---|
| 1436 | n/a | Rect bBox; |
|---|
| 1437 | n/a | #ifndef GrowWindow |
|---|
| 1438 | n/a | PyMac_PRECHECK(GrowWindow); |
|---|
| 1439 | n/a | #endif |
|---|
| 1440 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 1441 | n/a | PyMac_GetPoint, &startPt, |
|---|
| 1442 | n/a | PyMac_GetRect, &bBox)) |
|---|
| 1443 | n/a | return NULL; |
|---|
| 1444 | n/a | _rv = GrowWindow(_self->ob_itself, |
|---|
| 1445 | n/a | startPt, |
|---|
| 1446 | n/a | &bBox); |
|---|
| 1447 | n/a | _res = Py_BuildValue("l", |
|---|
| 1448 | n/a | _rv); |
|---|
| 1449 | n/a | return _res; |
|---|
| 1450 | n/a | } |
|---|
| 1451 | n/a | |
|---|
| 1452 | n/a | static PyObject *WinObj_DragWindow(WindowObject *_self, PyObject *_args) |
|---|
| 1453 | n/a | { |
|---|
| 1454 | n/a | PyObject *_res = NULL; |
|---|
| 1455 | n/a | Point startPt; |
|---|
| 1456 | n/a | Rect boundsRect; |
|---|
| 1457 | n/a | #ifndef DragWindow |
|---|
| 1458 | n/a | PyMac_PRECHECK(DragWindow); |
|---|
| 1459 | n/a | #endif |
|---|
| 1460 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 1461 | n/a | PyMac_GetPoint, &startPt, |
|---|
| 1462 | n/a | PyMac_GetRect, &boundsRect)) |
|---|
| 1463 | n/a | return NULL; |
|---|
| 1464 | n/a | DragWindow(_self->ob_itself, |
|---|
| 1465 | n/a | startPt, |
|---|
| 1466 | n/a | &boundsRect); |
|---|
| 1467 | n/a | Py_INCREF(Py_None); |
|---|
| 1468 | n/a | _res = Py_None; |
|---|
| 1469 | n/a | return _res; |
|---|
| 1470 | n/a | } |
|---|
| 1471 | n/a | |
|---|
| 1472 | n/a | static PyObject *WinObj_ZoomWindow(WindowObject *_self, PyObject *_args) |
|---|
| 1473 | n/a | { |
|---|
| 1474 | n/a | PyObject *_res = NULL; |
|---|
| 1475 | n/a | WindowPartCode partCode; |
|---|
| 1476 | n/a | Boolean front; |
|---|
| 1477 | n/a | #ifndef ZoomWindow |
|---|
| 1478 | n/a | PyMac_PRECHECK(ZoomWindow); |
|---|
| 1479 | n/a | #endif |
|---|
| 1480 | n/a | if (!PyArg_ParseTuple(_args, "hb", |
|---|
| 1481 | n/a | &partCode, |
|---|
| 1482 | n/a | &front)) |
|---|
| 1483 | n/a | return NULL; |
|---|
| 1484 | n/a | ZoomWindow(_self->ob_itself, |
|---|
| 1485 | n/a | partCode, |
|---|
| 1486 | n/a | front); |
|---|
| 1487 | n/a | Py_INCREF(Py_None); |
|---|
| 1488 | n/a | _res = Py_None; |
|---|
| 1489 | n/a | return _res; |
|---|
| 1490 | n/a | } |
|---|
| 1491 | n/a | |
|---|
| 1492 | n/a | static PyObject *WinObj_IsWindowCollapsable(WindowObject *_self, PyObject *_args) |
|---|
| 1493 | n/a | { |
|---|
| 1494 | n/a | PyObject *_res = NULL; |
|---|
| 1495 | n/a | Boolean _rv; |
|---|
| 1496 | n/a | #ifndef IsWindowCollapsable |
|---|
| 1497 | n/a | PyMac_PRECHECK(IsWindowCollapsable); |
|---|
| 1498 | n/a | #endif |
|---|
| 1499 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1500 | n/a | return NULL; |
|---|
| 1501 | n/a | _rv = IsWindowCollapsable(_self->ob_itself); |
|---|
| 1502 | n/a | _res = Py_BuildValue("b", |
|---|
| 1503 | n/a | _rv); |
|---|
| 1504 | n/a | return _res; |
|---|
| 1505 | n/a | } |
|---|
| 1506 | n/a | |
|---|
| 1507 | n/a | static PyObject *WinObj_IsWindowCollapsed(WindowObject *_self, PyObject *_args) |
|---|
| 1508 | n/a | { |
|---|
| 1509 | n/a | PyObject *_res = NULL; |
|---|
| 1510 | n/a | Boolean _rv; |
|---|
| 1511 | n/a | #ifndef IsWindowCollapsed |
|---|
| 1512 | n/a | PyMac_PRECHECK(IsWindowCollapsed); |
|---|
| 1513 | n/a | #endif |
|---|
| 1514 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1515 | n/a | return NULL; |
|---|
| 1516 | n/a | _rv = IsWindowCollapsed(_self->ob_itself); |
|---|
| 1517 | n/a | _res = Py_BuildValue("b", |
|---|
| 1518 | n/a | _rv); |
|---|
| 1519 | n/a | return _res; |
|---|
| 1520 | n/a | } |
|---|
| 1521 | n/a | |
|---|
| 1522 | n/a | static PyObject *WinObj_CollapseWindow(WindowObject *_self, PyObject *_args) |
|---|
| 1523 | n/a | { |
|---|
| 1524 | n/a | PyObject *_res = NULL; |
|---|
| 1525 | n/a | OSStatus _err; |
|---|
| 1526 | n/a | Boolean collapse; |
|---|
| 1527 | n/a | #ifndef CollapseWindow |
|---|
| 1528 | n/a | PyMac_PRECHECK(CollapseWindow); |
|---|
| 1529 | n/a | #endif |
|---|
| 1530 | n/a | if (!PyArg_ParseTuple(_args, "b", |
|---|
| 1531 | n/a | &collapse)) |
|---|
| 1532 | n/a | return NULL; |
|---|
| 1533 | n/a | _err = CollapseWindow(_self->ob_itself, |
|---|
| 1534 | n/a | collapse); |
|---|
| 1535 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1536 | n/a | Py_INCREF(Py_None); |
|---|
| 1537 | n/a | _res = Py_None; |
|---|
| 1538 | n/a | return _res; |
|---|
| 1539 | n/a | } |
|---|
| 1540 | n/a | |
|---|
| 1541 | n/a | static PyObject *WinObj_GetWindowBounds(WindowObject *_self, PyObject *_args) |
|---|
| 1542 | n/a | { |
|---|
| 1543 | n/a | PyObject *_res = NULL; |
|---|
| 1544 | n/a | OSStatus _err; |
|---|
| 1545 | n/a | WindowRegionCode regionCode; |
|---|
| 1546 | n/a | Rect globalBounds; |
|---|
| 1547 | n/a | #ifndef GetWindowBounds |
|---|
| 1548 | n/a | PyMac_PRECHECK(GetWindowBounds); |
|---|
| 1549 | n/a | #endif |
|---|
| 1550 | n/a | if (!PyArg_ParseTuple(_args, "H", |
|---|
| 1551 | n/a | ®ionCode)) |
|---|
| 1552 | n/a | return NULL; |
|---|
| 1553 | n/a | _err = GetWindowBounds(_self->ob_itself, |
|---|
| 1554 | n/a | regionCode, |
|---|
| 1555 | n/a | &globalBounds); |
|---|
| 1556 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1557 | n/a | _res = Py_BuildValue("O&", |
|---|
| 1558 | n/a | PyMac_BuildRect, &globalBounds); |
|---|
| 1559 | n/a | return _res; |
|---|
| 1560 | n/a | } |
|---|
| 1561 | n/a | |
|---|
| 1562 | n/a | static PyObject *WinObj_ResizeWindow(WindowObject *_self, PyObject *_args) |
|---|
| 1563 | n/a | { |
|---|
| 1564 | n/a | PyObject *_res = NULL; |
|---|
| 1565 | n/a | Boolean _rv; |
|---|
| 1566 | n/a | Point inStartPoint; |
|---|
| 1567 | n/a | Rect inSizeConstraints; |
|---|
| 1568 | n/a | Rect outNewContentRect; |
|---|
| 1569 | n/a | #ifndef ResizeWindow |
|---|
| 1570 | n/a | PyMac_PRECHECK(ResizeWindow); |
|---|
| 1571 | n/a | #endif |
|---|
| 1572 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 1573 | n/a | PyMac_GetPoint, &inStartPoint, |
|---|
| 1574 | n/a | PyMac_GetRect, &inSizeConstraints)) |
|---|
| 1575 | n/a | return NULL; |
|---|
| 1576 | n/a | _rv = ResizeWindow(_self->ob_itself, |
|---|
| 1577 | n/a | inStartPoint, |
|---|
| 1578 | n/a | &inSizeConstraints, |
|---|
| 1579 | n/a | &outNewContentRect); |
|---|
| 1580 | n/a | _res = Py_BuildValue("bO&", |
|---|
| 1581 | n/a | _rv, |
|---|
| 1582 | n/a | PyMac_BuildRect, &outNewContentRect); |
|---|
| 1583 | n/a | return _res; |
|---|
| 1584 | n/a | } |
|---|
| 1585 | n/a | |
|---|
| 1586 | n/a | static PyObject *WinObj_SetWindowBounds(WindowObject *_self, PyObject *_args) |
|---|
| 1587 | n/a | { |
|---|
| 1588 | n/a | PyObject *_res = NULL; |
|---|
| 1589 | n/a | OSStatus _err; |
|---|
| 1590 | n/a | WindowRegionCode regionCode; |
|---|
| 1591 | n/a | Rect globalBounds; |
|---|
| 1592 | n/a | #ifndef SetWindowBounds |
|---|
| 1593 | n/a | PyMac_PRECHECK(SetWindowBounds); |
|---|
| 1594 | n/a | #endif |
|---|
| 1595 | n/a | if (!PyArg_ParseTuple(_args, "HO&", |
|---|
| 1596 | n/a | ®ionCode, |
|---|
| 1597 | n/a | PyMac_GetRect, &globalBounds)) |
|---|
| 1598 | n/a | return NULL; |
|---|
| 1599 | n/a | _err = SetWindowBounds(_self->ob_itself, |
|---|
| 1600 | n/a | regionCode, |
|---|
| 1601 | n/a | &globalBounds); |
|---|
| 1602 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1603 | n/a | Py_INCREF(Py_None); |
|---|
| 1604 | n/a | _res = Py_None; |
|---|
| 1605 | n/a | return _res; |
|---|
| 1606 | n/a | } |
|---|
| 1607 | n/a | |
|---|
| 1608 | n/a | static PyObject *WinObj_RepositionWindow(WindowObject *_self, PyObject *_args) |
|---|
| 1609 | n/a | { |
|---|
| 1610 | n/a | PyObject *_res = NULL; |
|---|
| 1611 | n/a | OSStatus _err; |
|---|
| 1612 | n/a | WindowPtr parentWindow; |
|---|
| 1613 | n/a | WindowPositionMethod method; |
|---|
| 1614 | n/a | #ifndef RepositionWindow |
|---|
| 1615 | n/a | PyMac_PRECHECK(RepositionWindow); |
|---|
| 1616 | n/a | #endif |
|---|
| 1617 | n/a | if (!PyArg_ParseTuple(_args, "O&l", |
|---|
| 1618 | n/a | WinObj_Convert, &parentWindow, |
|---|
| 1619 | n/a | &method)) |
|---|
| 1620 | n/a | return NULL; |
|---|
| 1621 | n/a | _err = RepositionWindow(_self->ob_itself, |
|---|
| 1622 | n/a | parentWindow, |
|---|
| 1623 | n/a | method); |
|---|
| 1624 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1625 | n/a | Py_INCREF(Py_None); |
|---|
| 1626 | n/a | _res = Py_None; |
|---|
| 1627 | n/a | return _res; |
|---|
| 1628 | n/a | } |
|---|
| 1629 | n/a | |
|---|
| 1630 | n/a | static PyObject *WinObj_MoveWindowStructure(WindowObject *_self, PyObject *_args) |
|---|
| 1631 | n/a | { |
|---|
| 1632 | n/a | PyObject *_res = NULL; |
|---|
| 1633 | n/a | OSStatus _err; |
|---|
| 1634 | n/a | short hGlobal; |
|---|
| 1635 | n/a | short vGlobal; |
|---|
| 1636 | n/a | #ifndef MoveWindowStructure |
|---|
| 1637 | n/a | PyMac_PRECHECK(MoveWindowStructure); |
|---|
| 1638 | n/a | #endif |
|---|
| 1639 | n/a | if (!PyArg_ParseTuple(_args, "hh", |
|---|
| 1640 | n/a | &hGlobal, |
|---|
| 1641 | n/a | &vGlobal)) |
|---|
| 1642 | n/a | return NULL; |
|---|
| 1643 | n/a | _err = MoveWindowStructure(_self->ob_itself, |
|---|
| 1644 | n/a | hGlobal, |
|---|
| 1645 | n/a | vGlobal); |
|---|
| 1646 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1647 | n/a | Py_INCREF(Py_None); |
|---|
| 1648 | n/a | _res = Py_None; |
|---|
| 1649 | n/a | return _res; |
|---|
| 1650 | n/a | } |
|---|
| 1651 | n/a | |
|---|
| 1652 | n/a | static PyObject *WinObj_IsWindowInStandardState(WindowObject *_self, PyObject *_args) |
|---|
| 1653 | n/a | { |
|---|
| 1654 | n/a | PyObject *_res = NULL; |
|---|
| 1655 | n/a | Boolean _rv; |
|---|
| 1656 | n/a | Point inIdealSize; |
|---|
| 1657 | n/a | Rect outIdealStandardState; |
|---|
| 1658 | n/a | #ifndef IsWindowInStandardState |
|---|
| 1659 | n/a | PyMac_PRECHECK(IsWindowInStandardState); |
|---|
| 1660 | n/a | #endif |
|---|
| 1661 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 1662 | n/a | PyMac_GetPoint, &inIdealSize)) |
|---|
| 1663 | n/a | return NULL; |
|---|
| 1664 | n/a | _rv = IsWindowInStandardState(_self->ob_itself, |
|---|
| 1665 | n/a | &inIdealSize, |
|---|
| 1666 | n/a | &outIdealStandardState); |
|---|
| 1667 | n/a | _res = Py_BuildValue("bO&", |
|---|
| 1668 | n/a | _rv, |
|---|
| 1669 | n/a | PyMac_BuildRect, &outIdealStandardState); |
|---|
| 1670 | n/a | return _res; |
|---|
| 1671 | n/a | } |
|---|
| 1672 | n/a | |
|---|
| 1673 | n/a | static PyObject *WinObj_ZoomWindowIdeal(WindowObject *_self, PyObject *_args) |
|---|
| 1674 | n/a | { |
|---|
| 1675 | n/a | PyObject *_res = NULL; |
|---|
| 1676 | n/a | OSStatus _err; |
|---|
| 1677 | n/a | WindowPartCode inPartCode; |
|---|
| 1678 | n/a | Point ioIdealSize; |
|---|
| 1679 | n/a | #ifndef ZoomWindowIdeal |
|---|
| 1680 | n/a | PyMac_PRECHECK(ZoomWindowIdeal); |
|---|
| 1681 | n/a | #endif |
|---|
| 1682 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 1683 | n/a | &inPartCode)) |
|---|
| 1684 | n/a | return NULL; |
|---|
| 1685 | n/a | _err = ZoomWindowIdeal(_self->ob_itself, |
|---|
| 1686 | n/a | inPartCode, |
|---|
| 1687 | n/a | &ioIdealSize); |
|---|
| 1688 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1689 | n/a | _res = Py_BuildValue("O&", |
|---|
| 1690 | n/a | PyMac_BuildPoint, ioIdealSize); |
|---|
| 1691 | n/a | return _res; |
|---|
| 1692 | n/a | } |
|---|
| 1693 | n/a | |
|---|
| 1694 | n/a | static PyObject *WinObj_GetWindowIdealUserState(WindowObject *_self, PyObject *_args) |
|---|
| 1695 | n/a | { |
|---|
| 1696 | n/a | PyObject *_res = NULL; |
|---|
| 1697 | n/a | OSStatus _err; |
|---|
| 1698 | n/a | Rect outUserState; |
|---|
| 1699 | n/a | #ifndef GetWindowIdealUserState |
|---|
| 1700 | n/a | PyMac_PRECHECK(GetWindowIdealUserState); |
|---|
| 1701 | n/a | #endif |
|---|
| 1702 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1703 | n/a | return NULL; |
|---|
| 1704 | n/a | _err = GetWindowIdealUserState(_self->ob_itself, |
|---|
| 1705 | n/a | &outUserState); |
|---|
| 1706 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1707 | n/a | _res = Py_BuildValue("O&", |
|---|
| 1708 | n/a | PyMac_BuildRect, &outUserState); |
|---|
| 1709 | n/a | return _res; |
|---|
| 1710 | n/a | } |
|---|
| 1711 | n/a | |
|---|
| 1712 | n/a | static PyObject *WinObj_SetWindowIdealUserState(WindowObject *_self, PyObject *_args) |
|---|
| 1713 | n/a | { |
|---|
| 1714 | n/a | PyObject *_res = NULL; |
|---|
| 1715 | n/a | OSStatus _err; |
|---|
| 1716 | n/a | Rect inUserState; |
|---|
| 1717 | n/a | #ifndef SetWindowIdealUserState |
|---|
| 1718 | n/a | PyMac_PRECHECK(SetWindowIdealUserState); |
|---|
| 1719 | n/a | #endif |
|---|
| 1720 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 1721 | n/a | PyMac_GetRect, &inUserState)) |
|---|
| 1722 | n/a | return NULL; |
|---|
| 1723 | n/a | _err = SetWindowIdealUserState(_self->ob_itself, |
|---|
| 1724 | n/a | &inUserState); |
|---|
| 1725 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1726 | n/a | Py_INCREF(Py_None); |
|---|
| 1727 | n/a | _res = Py_None; |
|---|
| 1728 | n/a | return _res; |
|---|
| 1729 | n/a | } |
|---|
| 1730 | n/a | |
|---|
| 1731 | n/a | static PyObject *WinObj_GetWindowGreatestAreaDevice(WindowObject *_self, PyObject *_args) |
|---|
| 1732 | n/a | { |
|---|
| 1733 | n/a | PyObject *_res = NULL; |
|---|
| 1734 | n/a | OSStatus _err; |
|---|
| 1735 | n/a | WindowRegionCode inRegion; |
|---|
| 1736 | n/a | GDHandle outGreatestDevice; |
|---|
| 1737 | n/a | Rect outGreatestDeviceRect; |
|---|
| 1738 | n/a | #ifndef GetWindowGreatestAreaDevice |
|---|
| 1739 | n/a | PyMac_PRECHECK(GetWindowGreatestAreaDevice); |
|---|
| 1740 | n/a | #endif |
|---|
| 1741 | n/a | if (!PyArg_ParseTuple(_args, "H", |
|---|
| 1742 | n/a | &inRegion)) |
|---|
| 1743 | n/a | return NULL; |
|---|
| 1744 | n/a | _err = GetWindowGreatestAreaDevice(_self->ob_itself, |
|---|
| 1745 | n/a | inRegion, |
|---|
| 1746 | n/a | &outGreatestDevice, |
|---|
| 1747 | n/a | &outGreatestDeviceRect); |
|---|
| 1748 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1749 | n/a | _res = Py_BuildValue("O&O&", |
|---|
| 1750 | n/a | ResObj_New, outGreatestDevice, |
|---|
| 1751 | n/a | PyMac_BuildRect, &outGreatestDeviceRect); |
|---|
| 1752 | n/a | return _res; |
|---|
| 1753 | n/a | } |
|---|
| 1754 | n/a | |
|---|
| 1755 | n/a | static PyObject *WinObj_ConstrainWindowToScreen(WindowObject *_self, PyObject *_args) |
|---|
| 1756 | n/a | { |
|---|
| 1757 | n/a | PyObject *_res = NULL; |
|---|
| 1758 | n/a | OSStatus _err; |
|---|
| 1759 | n/a | WindowRegionCode inRegionCode; |
|---|
| 1760 | n/a | WindowConstrainOptions inOptions; |
|---|
| 1761 | n/a | Rect inScreenRect; |
|---|
| 1762 | n/a | Rect outStructure; |
|---|
| 1763 | n/a | #ifndef ConstrainWindowToScreen |
|---|
| 1764 | n/a | PyMac_PRECHECK(ConstrainWindowToScreen); |
|---|
| 1765 | n/a | #endif |
|---|
| 1766 | n/a | if (!PyArg_ParseTuple(_args, "HlO&", |
|---|
| 1767 | n/a | &inRegionCode, |
|---|
| 1768 | n/a | &inOptions, |
|---|
| 1769 | n/a | PyMac_GetRect, &inScreenRect)) |
|---|
| 1770 | n/a | return NULL; |
|---|
| 1771 | n/a | _err = ConstrainWindowToScreen(_self->ob_itself, |
|---|
| 1772 | n/a | inRegionCode, |
|---|
| 1773 | n/a | inOptions, |
|---|
| 1774 | n/a | &inScreenRect, |
|---|
| 1775 | n/a | &outStructure); |
|---|
| 1776 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1777 | n/a | _res = Py_BuildValue("O&", |
|---|
| 1778 | n/a | PyMac_BuildRect, &outStructure); |
|---|
| 1779 | n/a | return _res; |
|---|
| 1780 | n/a | } |
|---|
| 1781 | n/a | |
|---|
| 1782 | n/a | static PyObject *WinObj_HideWindow(WindowObject *_self, PyObject *_args) |
|---|
| 1783 | n/a | { |
|---|
| 1784 | n/a | PyObject *_res = NULL; |
|---|
| 1785 | n/a | #ifndef HideWindow |
|---|
| 1786 | n/a | PyMac_PRECHECK(HideWindow); |
|---|
| 1787 | n/a | #endif |
|---|
| 1788 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1789 | n/a | return NULL; |
|---|
| 1790 | n/a | HideWindow(_self->ob_itself); |
|---|
| 1791 | n/a | Py_INCREF(Py_None); |
|---|
| 1792 | n/a | _res = Py_None; |
|---|
| 1793 | n/a | return _res; |
|---|
| 1794 | n/a | } |
|---|
| 1795 | n/a | |
|---|
| 1796 | n/a | static PyObject *WinObj_MacShowWindow(WindowObject *_self, PyObject *_args) |
|---|
| 1797 | n/a | { |
|---|
| 1798 | n/a | PyObject *_res = NULL; |
|---|
| 1799 | n/a | #ifndef MacShowWindow |
|---|
| 1800 | n/a | PyMac_PRECHECK(MacShowWindow); |
|---|
| 1801 | n/a | #endif |
|---|
| 1802 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1803 | n/a | return NULL; |
|---|
| 1804 | n/a | MacShowWindow(_self->ob_itself); |
|---|
| 1805 | n/a | Py_INCREF(Py_None); |
|---|
| 1806 | n/a | _res = Py_None; |
|---|
| 1807 | n/a | return _res; |
|---|
| 1808 | n/a | } |
|---|
| 1809 | n/a | |
|---|
| 1810 | n/a | static PyObject *WinObj_ShowHide(WindowObject *_self, PyObject *_args) |
|---|
| 1811 | n/a | { |
|---|
| 1812 | n/a | PyObject *_res = NULL; |
|---|
| 1813 | n/a | Boolean showFlag; |
|---|
| 1814 | n/a | #ifndef ShowHide |
|---|
| 1815 | n/a | PyMac_PRECHECK(ShowHide); |
|---|
| 1816 | n/a | #endif |
|---|
| 1817 | n/a | if (!PyArg_ParseTuple(_args, "b", |
|---|
| 1818 | n/a | &showFlag)) |
|---|
| 1819 | n/a | return NULL; |
|---|
| 1820 | n/a | ShowHide(_self->ob_itself, |
|---|
| 1821 | n/a | showFlag); |
|---|
| 1822 | n/a | Py_INCREF(Py_None); |
|---|
| 1823 | n/a | _res = Py_None; |
|---|
| 1824 | n/a | return _res; |
|---|
| 1825 | n/a | } |
|---|
| 1826 | n/a | |
|---|
| 1827 | n/a | static PyObject *WinObj_MacIsWindowVisible(WindowObject *_self, PyObject *_args) |
|---|
| 1828 | n/a | { |
|---|
| 1829 | n/a | PyObject *_res = NULL; |
|---|
| 1830 | n/a | Boolean _rv; |
|---|
| 1831 | n/a | #ifndef MacIsWindowVisible |
|---|
| 1832 | n/a | PyMac_PRECHECK(MacIsWindowVisible); |
|---|
| 1833 | n/a | #endif |
|---|
| 1834 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1835 | n/a | return NULL; |
|---|
| 1836 | n/a | _rv = MacIsWindowVisible(_self->ob_itself); |
|---|
| 1837 | n/a | _res = Py_BuildValue("b", |
|---|
| 1838 | n/a | _rv); |
|---|
| 1839 | n/a | return _res; |
|---|
| 1840 | n/a | } |
|---|
| 1841 | n/a | |
|---|
| 1842 | n/a | static PyObject *WinObj_ShowSheetWindow(WindowObject *_self, PyObject *_args) |
|---|
| 1843 | n/a | { |
|---|
| 1844 | n/a | PyObject *_res = NULL; |
|---|
| 1845 | n/a | OSStatus _err; |
|---|
| 1846 | n/a | WindowPtr inParentWindow; |
|---|
| 1847 | n/a | #ifndef ShowSheetWindow |
|---|
| 1848 | n/a | PyMac_PRECHECK(ShowSheetWindow); |
|---|
| 1849 | n/a | #endif |
|---|
| 1850 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 1851 | n/a | WinObj_Convert, &inParentWindow)) |
|---|
| 1852 | n/a | return NULL; |
|---|
| 1853 | n/a | _err = ShowSheetWindow(_self->ob_itself, |
|---|
| 1854 | n/a | inParentWindow); |
|---|
| 1855 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1856 | n/a | Py_INCREF(Py_None); |
|---|
| 1857 | n/a | _res = Py_None; |
|---|
| 1858 | n/a | return _res; |
|---|
| 1859 | n/a | } |
|---|
| 1860 | n/a | |
|---|
| 1861 | n/a | static PyObject *WinObj_HideSheetWindow(WindowObject *_self, PyObject *_args) |
|---|
| 1862 | n/a | { |
|---|
| 1863 | n/a | PyObject *_res = NULL; |
|---|
| 1864 | n/a | OSStatus _err; |
|---|
| 1865 | n/a | #ifndef HideSheetWindow |
|---|
| 1866 | n/a | PyMac_PRECHECK(HideSheetWindow); |
|---|
| 1867 | n/a | #endif |
|---|
| 1868 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1869 | n/a | return NULL; |
|---|
| 1870 | n/a | _err = HideSheetWindow(_self->ob_itself); |
|---|
| 1871 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1872 | n/a | Py_INCREF(Py_None); |
|---|
| 1873 | n/a | _res = Py_None; |
|---|
| 1874 | n/a | return _res; |
|---|
| 1875 | n/a | } |
|---|
| 1876 | n/a | |
|---|
| 1877 | n/a | static PyObject *WinObj_GetSheetWindowParent(WindowObject *_self, PyObject *_args) |
|---|
| 1878 | n/a | { |
|---|
| 1879 | n/a | PyObject *_res = NULL; |
|---|
| 1880 | n/a | OSStatus _err; |
|---|
| 1881 | n/a | WindowPtr outParentWindow; |
|---|
| 1882 | n/a | #ifndef GetSheetWindowParent |
|---|
| 1883 | n/a | PyMac_PRECHECK(GetSheetWindowParent); |
|---|
| 1884 | n/a | #endif |
|---|
| 1885 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1886 | n/a | return NULL; |
|---|
| 1887 | n/a | _err = GetSheetWindowParent(_self->ob_itself, |
|---|
| 1888 | n/a | &outParentWindow); |
|---|
| 1889 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1890 | n/a | _res = Py_BuildValue("O&", |
|---|
| 1891 | n/a | WinObj_WhichWindow, outParentWindow); |
|---|
| 1892 | n/a | return _res; |
|---|
| 1893 | n/a | } |
|---|
| 1894 | n/a | |
|---|
| 1895 | n/a | static PyObject *WinObj_GetWindowPropertyAttributes(WindowObject *_self, PyObject *_args) |
|---|
| 1896 | n/a | { |
|---|
| 1897 | n/a | PyObject *_res = NULL; |
|---|
| 1898 | n/a | OSStatus _err; |
|---|
| 1899 | n/a | OSType propertyCreator; |
|---|
| 1900 | n/a | OSType propertyTag; |
|---|
| 1901 | n/a | UInt32 attributes; |
|---|
| 1902 | n/a | #ifndef GetWindowPropertyAttributes |
|---|
| 1903 | n/a | PyMac_PRECHECK(GetWindowPropertyAttributes); |
|---|
| 1904 | n/a | #endif |
|---|
| 1905 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 1906 | n/a | PyMac_GetOSType, &propertyCreator, |
|---|
| 1907 | n/a | PyMac_GetOSType, &propertyTag)) |
|---|
| 1908 | n/a | return NULL; |
|---|
| 1909 | n/a | _err = GetWindowPropertyAttributes(_self->ob_itself, |
|---|
| 1910 | n/a | propertyCreator, |
|---|
| 1911 | n/a | propertyTag, |
|---|
| 1912 | n/a | &attributes); |
|---|
| 1913 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1914 | n/a | _res = Py_BuildValue("l", |
|---|
| 1915 | n/a | attributes); |
|---|
| 1916 | n/a | return _res; |
|---|
| 1917 | n/a | } |
|---|
| 1918 | n/a | |
|---|
| 1919 | n/a | static PyObject *WinObj_ChangeWindowPropertyAttributes(WindowObject *_self, PyObject *_args) |
|---|
| 1920 | n/a | { |
|---|
| 1921 | n/a | PyObject *_res = NULL; |
|---|
| 1922 | n/a | OSStatus _err; |
|---|
| 1923 | n/a | OSType propertyCreator; |
|---|
| 1924 | n/a | OSType propertyTag; |
|---|
| 1925 | n/a | UInt32 attributesToSet; |
|---|
| 1926 | n/a | UInt32 attributesToClear; |
|---|
| 1927 | n/a | #ifndef ChangeWindowPropertyAttributes |
|---|
| 1928 | n/a | PyMac_PRECHECK(ChangeWindowPropertyAttributes); |
|---|
| 1929 | n/a | #endif |
|---|
| 1930 | n/a | if (!PyArg_ParseTuple(_args, "O&O&ll", |
|---|
| 1931 | n/a | PyMac_GetOSType, &propertyCreator, |
|---|
| 1932 | n/a | PyMac_GetOSType, &propertyTag, |
|---|
| 1933 | n/a | &attributesToSet, |
|---|
| 1934 | n/a | &attributesToClear)) |
|---|
| 1935 | n/a | return NULL; |
|---|
| 1936 | n/a | _err = ChangeWindowPropertyAttributes(_self->ob_itself, |
|---|
| 1937 | n/a | propertyCreator, |
|---|
| 1938 | n/a | propertyTag, |
|---|
| 1939 | n/a | attributesToSet, |
|---|
| 1940 | n/a | attributesToClear); |
|---|
| 1941 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1942 | n/a | Py_INCREF(Py_None); |
|---|
| 1943 | n/a | _res = Py_None; |
|---|
| 1944 | n/a | return _res; |
|---|
| 1945 | n/a | } |
|---|
| 1946 | n/a | |
|---|
| 1947 | n/a | static PyObject *WinObj_TrackBox(WindowObject *_self, PyObject *_args) |
|---|
| 1948 | n/a | { |
|---|
| 1949 | n/a | PyObject *_res = NULL; |
|---|
| 1950 | n/a | Boolean _rv; |
|---|
| 1951 | n/a | Point thePt; |
|---|
| 1952 | n/a | WindowPartCode partCode; |
|---|
| 1953 | n/a | #ifndef TrackBox |
|---|
| 1954 | n/a | PyMac_PRECHECK(TrackBox); |
|---|
| 1955 | n/a | #endif |
|---|
| 1956 | n/a | if (!PyArg_ParseTuple(_args, "O&h", |
|---|
| 1957 | n/a | PyMac_GetPoint, &thePt, |
|---|
| 1958 | n/a | &partCode)) |
|---|
| 1959 | n/a | return NULL; |
|---|
| 1960 | n/a | _rv = TrackBox(_self->ob_itself, |
|---|
| 1961 | n/a | thePt, |
|---|
| 1962 | n/a | partCode); |
|---|
| 1963 | n/a | _res = Py_BuildValue("b", |
|---|
| 1964 | n/a | _rv); |
|---|
| 1965 | n/a | return _res; |
|---|
| 1966 | n/a | } |
|---|
| 1967 | n/a | |
|---|
| 1968 | n/a | static PyObject *WinObj_TrackGoAway(WindowObject *_self, PyObject *_args) |
|---|
| 1969 | n/a | { |
|---|
| 1970 | n/a | PyObject *_res = NULL; |
|---|
| 1971 | n/a | Boolean _rv; |
|---|
| 1972 | n/a | Point thePt; |
|---|
| 1973 | n/a | #ifndef TrackGoAway |
|---|
| 1974 | n/a | PyMac_PRECHECK(TrackGoAway); |
|---|
| 1975 | n/a | #endif |
|---|
| 1976 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 1977 | n/a | PyMac_GetPoint, &thePt)) |
|---|
| 1978 | n/a | return NULL; |
|---|
| 1979 | n/a | _rv = TrackGoAway(_self->ob_itself, |
|---|
| 1980 | n/a | thePt); |
|---|
| 1981 | n/a | _res = Py_BuildValue("b", |
|---|
| 1982 | n/a | _rv); |
|---|
| 1983 | n/a | return _res; |
|---|
| 1984 | n/a | } |
|---|
| 1985 | n/a | |
|---|
| 1986 | n/a | static PyObject *WinObj_GetWindowPort(WindowObject *_self, PyObject *_args) |
|---|
| 1987 | n/a | { |
|---|
| 1988 | n/a | PyObject *_res = NULL; |
|---|
| 1989 | n/a | CGrafPtr _rv; |
|---|
| 1990 | n/a | #ifndef GetWindowPort |
|---|
| 1991 | n/a | PyMac_PRECHECK(GetWindowPort); |
|---|
| 1992 | n/a | #endif |
|---|
| 1993 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1994 | n/a | return NULL; |
|---|
| 1995 | n/a | _rv = GetWindowPort(_self->ob_itself); |
|---|
| 1996 | n/a | _res = Py_BuildValue("O&", |
|---|
| 1997 | n/a | GrafObj_New, _rv); |
|---|
| 1998 | n/a | return _res; |
|---|
| 1999 | n/a | } |
|---|
| 2000 | n/a | |
|---|
| 2001 | n/a | static PyObject *WinObj_GetWindowStructurePort(WindowObject *_self, PyObject *_args) |
|---|
| 2002 | n/a | { |
|---|
| 2003 | n/a | PyObject *_res = NULL; |
|---|
| 2004 | n/a | CGrafPtr _rv; |
|---|
| 2005 | n/a | #ifndef GetWindowStructurePort |
|---|
| 2006 | n/a | PyMac_PRECHECK(GetWindowStructurePort); |
|---|
| 2007 | n/a | #endif |
|---|
| 2008 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 2009 | n/a | return NULL; |
|---|
| 2010 | n/a | _rv = GetWindowStructurePort(_self->ob_itself); |
|---|
| 2011 | n/a | _res = Py_BuildValue("O&", |
|---|
| 2012 | n/a | GrafObj_New, _rv); |
|---|
| 2013 | n/a | return _res; |
|---|
| 2014 | n/a | } |
|---|
| 2015 | n/a | |
|---|
| 2016 | n/a | static PyObject *WinObj_GetWindowKind(WindowObject *_self, PyObject *_args) |
|---|
| 2017 | n/a | { |
|---|
| 2018 | n/a | PyObject *_res = NULL; |
|---|
| 2019 | n/a | short _rv; |
|---|
| 2020 | n/a | #ifndef GetWindowKind |
|---|
| 2021 | n/a | PyMac_PRECHECK(GetWindowKind); |
|---|
| 2022 | n/a | #endif |
|---|
| 2023 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 2024 | n/a | return NULL; |
|---|
| 2025 | n/a | _rv = GetWindowKind(_self->ob_itself); |
|---|
| 2026 | n/a | _res = Py_BuildValue("h", |
|---|
| 2027 | n/a | _rv); |
|---|
| 2028 | n/a | return _res; |
|---|
| 2029 | n/a | } |
|---|
| 2030 | n/a | |
|---|
| 2031 | n/a | static PyObject *WinObj_IsWindowHilited(WindowObject *_self, PyObject *_args) |
|---|
| 2032 | n/a | { |
|---|
| 2033 | n/a | PyObject *_res = NULL; |
|---|
| 2034 | n/a | Boolean _rv; |
|---|
| 2035 | n/a | #ifndef IsWindowHilited |
|---|
| 2036 | n/a | PyMac_PRECHECK(IsWindowHilited); |
|---|
| 2037 | n/a | #endif |
|---|
| 2038 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 2039 | n/a | return NULL; |
|---|
| 2040 | n/a | _rv = IsWindowHilited(_self->ob_itself); |
|---|
| 2041 | n/a | _res = Py_BuildValue("b", |
|---|
| 2042 | n/a | _rv); |
|---|
| 2043 | n/a | return _res; |
|---|
| 2044 | n/a | } |
|---|
| 2045 | n/a | |
|---|
| 2046 | n/a | static PyObject *WinObj_IsWindowUpdatePending(WindowObject *_self, PyObject *_args) |
|---|
| 2047 | n/a | { |
|---|
| 2048 | n/a | PyObject *_res = NULL; |
|---|
| 2049 | n/a | Boolean _rv; |
|---|
| 2050 | n/a | #ifndef IsWindowUpdatePending |
|---|
| 2051 | n/a | PyMac_PRECHECK(IsWindowUpdatePending); |
|---|
| 2052 | n/a | #endif |
|---|
| 2053 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 2054 | n/a | return NULL; |
|---|
| 2055 | n/a | _rv = IsWindowUpdatePending(_self->ob_itself); |
|---|
| 2056 | n/a | _res = Py_BuildValue("b", |
|---|
| 2057 | n/a | _rv); |
|---|
| 2058 | n/a | return _res; |
|---|
| 2059 | n/a | } |
|---|
| 2060 | n/a | |
|---|
| 2061 | n/a | static PyObject *WinObj_MacGetNextWindow(WindowObject *_self, PyObject *_args) |
|---|
| 2062 | n/a | { |
|---|
| 2063 | n/a | PyObject *_res = NULL; |
|---|
| 2064 | n/a | WindowPtr _rv; |
|---|
| 2065 | n/a | #ifndef MacGetNextWindow |
|---|
| 2066 | n/a | PyMac_PRECHECK(MacGetNextWindow); |
|---|
| 2067 | n/a | #endif |
|---|
| 2068 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 2069 | n/a | return NULL; |
|---|
| 2070 | n/a | _rv = MacGetNextWindow(_self->ob_itself); |
|---|
| 2071 | n/a | _res = Py_BuildValue("O&", |
|---|
| 2072 | n/a | WinObj_New, _rv); |
|---|
| 2073 | n/a | return _res; |
|---|
| 2074 | n/a | } |
|---|
| 2075 | n/a | |
|---|
| 2076 | n/a | static PyObject *WinObj_GetWindowStandardState(WindowObject *_self, PyObject *_args) |
|---|
| 2077 | n/a | { |
|---|
| 2078 | n/a | PyObject *_res = NULL; |
|---|
| 2079 | n/a | Rect rect; |
|---|
| 2080 | n/a | #ifndef GetWindowStandardState |
|---|
| 2081 | n/a | PyMac_PRECHECK(GetWindowStandardState); |
|---|
| 2082 | n/a | #endif |
|---|
| 2083 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 2084 | n/a | return NULL; |
|---|
| 2085 | n/a | GetWindowStandardState(_self->ob_itself, |
|---|
| 2086 | n/a | &rect); |
|---|
| 2087 | n/a | _res = Py_BuildValue("O&", |
|---|
| 2088 | n/a | PyMac_BuildRect, &rect); |
|---|
| 2089 | n/a | return _res; |
|---|
| 2090 | n/a | } |
|---|
| 2091 | n/a | |
|---|
| 2092 | n/a | static PyObject *WinObj_GetWindowUserState(WindowObject *_self, PyObject *_args) |
|---|
| 2093 | n/a | { |
|---|
| 2094 | n/a | PyObject *_res = NULL; |
|---|
| 2095 | n/a | Rect rect; |
|---|
| 2096 | n/a | #ifndef GetWindowUserState |
|---|
| 2097 | n/a | PyMac_PRECHECK(GetWindowUserState); |
|---|
| 2098 | n/a | #endif |
|---|
| 2099 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 2100 | n/a | return NULL; |
|---|
| 2101 | n/a | GetWindowUserState(_self->ob_itself, |
|---|
| 2102 | n/a | &rect); |
|---|
| 2103 | n/a | _res = Py_BuildValue("O&", |
|---|
| 2104 | n/a | PyMac_BuildRect, &rect); |
|---|
| 2105 | n/a | return _res; |
|---|
| 2106 | n/a | } |
|---|
| 2107 | n/a | |
|---|
| 2108 | n/a | static PyObject *WinObj_SetWindowKind(WindowObject *_self, PyObject *_args) |
|---|
| 2109 | n/a | { |
|---|
| 2110 | n/a | PyObject *_res = NULL; |
|---|
| 2111 | n/a | short kind; |
|---|
| 2112 | n/a | #ifndef SetWindowKind |
|---|
| 2113 | n/a | PyMac_PRECHECK(SetWindowKind); |
|---|
| 2114 | n/a | #endif |
|---|
| 2115 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 2116 | n/a | &kind)) |
|---|
| 2117 | n/a | return NULL; |
|---|
| 2118 | n/a | SetWindowKind(_self->ob_itself, |
|---|
| 2119 | n/a | kind); |
|---|
| 2120 | n/a | Py_INCREF(Py_None); |
|---|
| 2121 | n/a | _res = Py_None; |
|---|
| 2122 | n/a | return _res; |
|---|
| 2123 | n/a | } |
|---|
| 2124 | n/a | |
|---|
| 2125 | n/a | static PyObject *WinObj_SetWindowStandardState(WindowObject *_self, PyObject *_args) |
|---|
| 2126 | n/a | { |
|---|
| 2127 | n/a | PyObject *_res = NULL; |
|---|
| 2128 | n/a | Rect rect; |
|---|
| 2129 | n/a | #ifndef SetWindowStandardState |
|---|
| 2130 | n/a | PyMac_PRECHECK(SetWindowStandardState); |
|---|
| 2131 | n/a | #endif |
|---|
| 2132 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 2133 | n/a | PyMac_GetRect, &rect)) |
|---|
| 2134 | n/a | return NULL; |
|---|
| 2135 | n/a | SetWindowStandardState(_self->ob_itself, |
|---|
| 2136 | n/a | &rect); |
|---|
| 2137 | n/a | Py_INCREF(Py_None); |
|---|
| 2138 | n/a | _res = Py_None; |
|---|
| 2139 | n/a | return _res; |
|---|
| 2140 | n/a | } |
|---|
| 2141 | n/a | |
|---|
| 2142 | n/a | static PyObject *WinObj_SetWindowUserState(WindowObject *_self, PyObject *_args) |
|---|
| 2143 | n/a | { |
|---|
| 2144 | n/a | PyObject *_res = NULL; |
|---|
| 2145 | n/a | Rect rect; |
|---|
| 2146 | n/a | #ifndef SetWindowUserState |
|---|
| 2147 | n/a | PyMac_PRECHECK(SetWindowUserState); |
|---|
| 2148 | n/a | #endif |
|---|
| 2149 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 2150 | n/a | PyMac_GetRect, &rect)) |
|---|
| 2151 | n/a | return NULL; |
|---|
| 2152 | n/a | SetWindowUserState(_self->ob_itself, |
|---|
| 2153 | n/a | &rect); |
|---|
| 2154 | n/a | Py_INCREF(Py_None); |
|---|
| 2155 | n/a | _res = Py_None; |
|---|
| 2156 | n/a | return _res; |
|---|
| 2157 | n/a | } |
|---|
| 2158 | n/a | |
|---|
| 2159 | n/a | static PyObject *WinObj_SetPortWindowPort(WindowObject *_self, PyObject *_args) |
|---|
| 2160 | n/a | { |
|---|
| 2161 | n/a | PyObject *_res = NULL; |
|---|
| 2162 | n/a | #ifndef SetPortWindowPort |
|---|
| 2163 | n/a | PyMac_PRECHECK(SetPortWindowPort); |
|---|
| 2164 | n/a | #endif |
|---|
| 2165 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 2166 | n/a | return NULL; |
|---|
| 2167 | n/a | SetPortWindowPort(_self->ob_itself); |
|---|
| 2168 | n/a | Py_INCREF(Py_None); |
|---|
| 2169 | n/a | _res = Py_None; |
|---|
| 2170 | n/a | return _res; |
|---|
| 2171 | n/a | } |
|---|
| 2172 | n/a | |
|---|
| 2173 | n/a | static PyObject *WinObj_GetWindowPortBounds(WindowObject *_self, PyObject *_args) |
|---|
| 2174 | n/a | { |
|---|
| 2175 | n/a | PyObject *_res = NULL; |
|---|
| 2176 | n/a | Rect bounds; |
|---|
| 2177 | n/a | #ifndef GetWindowPortBounds |
|---|
| 2178 | n/a | PyMac_PRECHECK(GetWindowPortBounds); |
|---|
| 2179 | n/a | #endif |
|---|
| 2180 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 2181 | n/a | return NULL; |
|---|
| 2182 | n/a | GetWindowPortBounds(_self->ob_itself, |
|---|
| 2183 | n/a | &bounds); |
|---|
| 2184 | n/a | _res = Py_BuildValue("O&", |
|---|
| 2185 | n/a | PyMac_BuildRect, &bounds); |
|---|
| 2186 | n/a | return _res; |
|---|
| 2187 | n/a | } |
|---|
| 2188 | n/a | |
|---|
| 2189 | n/a | static PyObject *WinObj_IsWindowVisible(WindowObject *_self, PyObject *_args) |
|---|
| 2190 | n/a | { |
|---|
| 2191 | n/a | PyObject *_res = NULL; |
|---|
| 2192 | n/a | Boolean _rv; |
|---|
| 2193 | n/a | #ifndef IsWindowVisible |
|---|
| 2194 | n/a | PyMac_PRECHECK(IsWindowVisible); |
|---|
| 2195 | n/a | #endif |
|---|
| 2196 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 2197 | n/a | return NULL; |
|---|
| 2198 | n/a | _rv = IsWindowVisible(_self->ob_itself); |
|---|
| 2199 | n/a | _res = Py_BuildValue("b", |
|---|
| 2200 | n/a | _rv); |
|---|
| 2201 | n/a | return _res; |
|---|
| 2202 | n/a | } |
|---|
| 2203 | n/a | |
|---|
| 2204 | n/a | static PyObject *WinObj_GetWindowStructureRgn(WindowObject *_self, PyObject *_args) |
|---|
| 2205 | n/a | { |
|---|
| 2206 | n/a | PyObject *_res = NULL; |
|---|
| 2207 | n/a | RgnHandle r; |
|---|
| 2208 | n/a | #ifndef GetWindowStructureRgn |
|---|
| 2209 | n/a | PyMac_PRECHECK(GetWindowStructureRgn); |
|---|
| 2210 | n/a | #endif |
|---|
| 2211 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 2212 | n/a | ResObj_Convert, &r)) |
|---|
| 2213 | n/a | return NULL; |
|---|
| 2214 | n/a | GetWindowStructureRgn(_self->ob_itself, |
|---|
| 2215 | n/a | r); |
|---|
| 2216 | n/a | Py_INCREF(Py_None); |
|---|
| 2217 | n/a | _res = Py_None; |
|---|
| 2218 | n/a | return _res; |
|---|
| 2219 | n/a | } |
|---|
| 2220 | n/a | |
|---|
| 2221 | n/a | static PyObject *WinObj_GetWindowContentRgn(WindowObject *_self, PyObject *_args) |
|---|
| 2222 | n/a | { |
|---|
| 2223 | n/a | PyObject *_res = NULL; |
|---|
| 2224 | n/a | RgnHandle r; |
|---|
| 2225 | n/a | #ifndef GetWindowContentRgn |
|---|
| 2226 | n/a | PyMac_PRECHECK(GetWindowContentRgn); |
|---|
| 2227 | n/a | #endif |
|---|
| 2228 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 2229 | n/a | ResObj_Convert, &r)) |
|---|
| 2230 | n/a | return NULL; |
|---|
| 2231 | n/a | GetWindowContentRgn(_self->ob_itself, |
|---|
| 2232 | n/a | r); |
|---|
| 2233 | n/a | Py_INCREF(Py_None); |
|---|
| 2234 | n/a | _res = Py_None; |
|---|
| 2235 | n/a | return _res; |
|---|
| 2236 | n/a | } |
|---|
| 2237 | n/a | |
|---|
| 2238 | n/a | static PyObject *WinObj_GetWindowUpdateRgn(WindowObject *_self, PyObject *_args) |
|---|
| 2239 | n/a | { |
|---|
| 2240 | n/a | PyObject *_res = NULL; |
|---|
| 2241 | n/a | RgnHandle r; |
|---|
| 2242 | n/a | #ifndef GetWindowUpdateRgn |
|---|
| 2243 | n/a | PyMac_PRECHECK(GetWindowUpdateRgn); |
|---|
| 2244 | n/a | #endif |
|---|
| 2245 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 2246 | n/a | ResObj_Convert, &r)) |
|---|
| 2247 | n/a | return NULL; |
|---|
| 2248 | n/a | GetWindowUpdateRgn(_self->ob_itself, |
|---|
| 2249 | n/a | r); |
|---|
| 2250 | n/a | Py_INCREF(Py_None); |
|---|
| 2251 | n/a | _res = Py_None; |
|---|
| 2252 | n/a | return _res; |
|---|
| 2253 | n/a | } |
|---|
| 2254 | n/a | |
|---|
| 2255 | n/a | static PyObject *WinObj_GetNextWindow(WindowObject *_self, PyObject *_args) |
|---|
| 2256 | n/a | { |
|---|
| 2257 | n/a | PyObject *_res = NULL; |
|---|
| 2258 | n/a | WindowPtr _rv; |
|---|
| 2259 | n/a | #ifndef GetNextWindow |
|---|
| 2260 | n/a | PyMac_PRECHECK(GetNextWindow); |
|---|
| 2261 | n/a | #endif |
|---|
| 2262 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 2263 | n/a | return NULL; |
|---|
| 2264 | n/a | _rv = GetNextWindow(_self->ob_itself); |
|---|
| 2265 | n/a | _res = Py_BuildValue("O&", |
|---|
| 2266 | n/a | WinObj_WhichWindow, _rv); |
|---|
| 2267 | n/a | return _res; |
|---|
| 2268 | n/a | } |
|---|
| 2269 | n/a | |
|---|
| 2270 | n/a | static PyObject *WinObj_MoveWindow(WindowObject *_self, PyObject *_args) |
|---|
| 2271 | n/a | { |
|---|
| 2272 | n/a | PyObject *_res = NULL; |
|---|
| 2273 | n/a | short hGlobal; |
|---|
| 2274 | n/a | short vGlobal; |
|---|
| 2275 | n/a | Boolean front; |
|---|
| 2276 | n/a | #ifndef MoveWindow |
|---|
| 2277 | n/a | PyMac_PRECHECK(MoveWindow); |
|---|
| 2278 | n/a | #endif |
|---|
| 2279 | n/a | if (!PyArg_ParseTuple(_args, "hhb", |
|---|
| 2280 | n/a | &hGlobal, |
|---|
| 2281 | n/a | &vGlobal, |
|---|
| 2282 | n/a | &front)) |
|---|
| 2283 | n/a | return NULL; |
|---|
| 2284 | n/a | MoveWindow(_self->ob_itself, |
|---|
| 2285 | n/a | hGlobal, |
|---|
| 2286 | n/a | vGlobal, |
|---|
| 2287 | n/a | front); |
|---|
| 2288 | n/a | Py_INCREF(Py_None); |
|---|
| 2289 | n/a | _res = Py_None; |
|---|
| 2290 | n/a | return _res; |
|---|
| 2291 | n/a | } |
|---|
| 2292 | n/a | |
|---|
| 2293 | n/a | static PyObject *WinObj_ShowWindow(WindowObject *_self, PyObject *_args) |
|---|
| 2294 | n/a | { |
|---|
| 2295 | n/a | PyObject *_res = NULL; |
|---|
| 2296 | n/a | #ifndef ShowWindow |
|---|
| 2297 | n/a | PyMac_PRECHECK(ShowWindow); |
|---|
| 2298 | n/a | #endif |
|---|
| 2299 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 2300 | n/a | return NULL; |
|---|
| 2301 | n/a | ShowWindow(_self->ob_itself); |
|---|
| 2302 | n/a | Py_INCREF(Py_None); |
|---|
| 2303 | n/a | _res = Py_None; |
|---|
| 2304 | n/a | return _res; |
|---|
| 2305 | n/a | } |
|---|
| 2306 | n/a | |
|---|
| 2307 | n/a | static PyObject *WinObj_AutoDispose(WindowObject *_self, PyObject *_args) |
|---|
| 2308 | n/a | { |
|---|
| 2309 | n/a | PyObject *_res = NULL; |
|---|
| 2310 | n/a | |
|---|
| 2311 | n/a | int onoff, old = 0; |
|---|
| 2312 | n/a | if (!PyArg_ParseTuple(_args, "i", &onoff)) |
|---|
| 2313 | n/a | return NULL; |
|---|
| 2314 | n/a | if ( _self->ob_freeit ) |
|---|
| 2315 | n/a | old = 1; |
|---|
| 2316 | n/a | if ( onoff ) |
|---|
| 2317 | n/a | _self->ob_freeit = PyMac_AutoDisposeWindow; |
|---|
| 2318 | n/a | else |
|---|
| 2319 | n/a | _self->ob_freeit = NULL; |
|---|
| 2320 | n/a | _res = Py_BuildValue("i", old); |
|---|
| 2321 | n/a | return _res; |
|---|
| 2322 | n/a | |
|---|
| 2323 | n/a | } |
|---|
| 2324 | n/a | |
|---|
| 2325 | n/a | static PyMethodDef WinObj_methods[] = { |
|---|
| 2326 | n/a | {"GetWindowOwnerCount", (PyCFunction)WinObj_GetWindowOwnerCount, 1, |
|---|
| 2327 | n/a | PyDoc_STR("() -> (UInt32 outCount)")}, |
|---|
| 2328 | n/a | {"CloneWindow", (PyCFunction)WinObj_CloneWindow, 1, |
|---|
| 2329 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 2330 | n/a | {"GetWindowRetainCount", (PyCFunction)WinObj_GetWindowRetainCount, 1, |
|---|
| 2331 | n/a | PyDoc_STR("() -> (ItemCount _rv)")}, |
|---|
| 2332 | n/a | {"RetainWindow", (PyCFunction)WinObj_RetainWindow, 1, |
|---|
| 2333 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 2334 | n/a | {"ReleaseWindow", (PyCFunction)WinObj_ReleaseWindow, 1, |
|---|
| 2335 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 2336 | n/a | {"ReshapeCustomWindow", (PyCFunction)WinObj_ReshapeCustomWindow, 1, |
|---|
| 2337 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 2338 | n/a | {"GetWindowWidgetHilite", (PyCFunction)WinObj_GetWindowWidgetHilite, 1, |
|---|
| 2339 | n/a | PyDoc_STR("() -> (WindowDefPartCode outHilite)")}, |
|---|
| 2340 | n/a | {"GetWindowClass", (PyCFunction)WinObj_GetWindowClass, 1, |
|---|
| 2341 | n/a | PyDoc_STR("() -> (WindowClass outClass)")}, |
|---|
| 2342 | n/a | {"GetWindowAttributes", (PyCFunction)WinObj_GetWindowAttributes, 1, |
|---|
| 2343 | n/a | PyDoc_STR("() -> (WindowAttributes outAttributes)")}, |
|---|
| 2344 | n/a | {"ChangeWindowAttributes", (PyCFunction)WinObj_ChangeWindowAttributes, 1, |
|---|
| 2345 | n/a | PyDoc_STR("(WindowAttributes setTheseAttributes, WindowAttributes clearTheseAttributes) -> None")}, |
|---|
| 2346 | n/a | {"SetWindowClass", (PyCFunction)WinObj_SetWindowClass, 1, |
|---|
| 2347 | n/a | PyDoc_STR("(WindowClass inWindowClass) -> None")}, |
|---|
| 2348 | n/a | {"SetWindowModality", (PyCFunction)WinObj_SetWindowModality, 1, |
|---|
| 2349 | n/a | PyDoc_STR("(WindowModality inModalKind, WindowPtr inUnavailableWindow) -> None")}, |
|---|
| 2350 | n/a | {"GetWindowModality", (PyCFunction)WinObj_GetWindowModality, 1, |
|---|
| 2351 | n/a | PyDoc_STR("() -> (WindowModality outModalKind, WindowPtr outUnavailableWindow)")}, |
|---|
| 2352 | n/a | {"SetWindowContentColor", (PyCFunction)WinObj_SetWindowContentColor, 1, |
|---|
| 2353 | n/a | PyDoc_STR("(RGBColor color) -> None")}, |
|---|
| 2354 | n/a | {"GetWindowContentColor", (PyCFunction)WinObj_GetWindowContentColor, 1, |
|---|
| 2355 | n/a | PyDoc_STR("() -> (RGBColor color)")}, |
|---|
| 2356 | n/a | {"GetWindowContentPattern", (PyCFunction)WinObj_GetWindowContentPattern, 1, |
|---|
| 2357 | n/a | PyDoc_STR("(PixPatHandle outPixPat) -> None")}, |
|---|
| 2358 | n/a | {"SetWindowContentPattern", (PyCFunction)WinObj_SetWindowContentPattern, 1, |
|---|
| 2359 | n/a | PyDoc_STR("(PixPatHandle pixPat) -> None")}, |
|---|
| 2360 | n/a | {"ScrollWindowRect", (PyCFunction)WinObj_ScrollWindowRect, 1, |
|---|
| 2361 | n/a | PyDoc_STR("(Rect inScrollRect, SInt16 inHPixels, SInt16 inVPixels, ScrollWindowOptions inOptions, RgnHandle outExposedRgn) -> None")}, |
|---|
| 2362 | n/a | {"ScrollWindowRegion", (PyCFunction)WinObj_ScrollWindowRegion, 1, |
|---|
| 2363 | n/a | PyDoc_STR("(RgnHandle inScrollRgn, SInt16 inHPixels, SInt16 inVPixels, ScrollWindowOptions inOptions, RgnHandle outExposedRgn) -> None")}, |
|---|
| 2364 | n/a | {"ClipAbove", (PyCFunction)WinObj_ClipAbove, 1, |
|---|
| 2365 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 2366 | n/a | {"PaintOne", (PyCFunction)WinObj_PaintOne, 1, |
|---|
| 2367 | n/a | PyDoc_STR("(RgnHandle clobberedRgn) -> None")}, |
|---|
| 2368 | n/a | {"PaintBehind", (PyCFunction)WinObj_PaintBehind, 1, |
|---|
| 2369 | n/a | PyDoc_STR("(RgnHandle clobberedRgn) -> None")}, |
|---|
| 2370 | n/a | {"CalcVis", (PyCFunction)WinObj_CalcVis, 1, |
|---|
| 2371 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 2372 | n/a | {"CalcVisBehind", (PyCFunction)WinObj_CalcVisBehind, 1, |
|---|
| 2373 | n/a | PyDoc_STR("(RgnHandle clobberedRgn) -> None")}, |
|---|
| 2374 | n/a | {"BringToFront", (PyCFunction)WinObj_BringToFront, 1, |
|---|
| 2375 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 2376 | n/a | {"SendBehind", (PyCFunction)WinObj_SendBehind, 1, |
|---|
| 2377 | n/a | PyDoc_STR("(WindowPtr behindWindow) -> None")}, |
|---|
| 2378 | n/a | {"SelectWindow", (PyCFunction)WinObj_SelectWindow, 1, |
|---|
| 2379 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 2380 | n/a | {"GetNextWindowOfClass", (PyCFunction)WinObj_GetNextWindowOfClass, 1, |
|---|
| 2381 | n/a | PyDoc_STR("(WindowClass inWindowClass, Boolean mustBeVisible) -> (WindowPtr _rv)")}, |
|---|
| 2382 | n/a | {"SetWindowAlternateTitle", (PyCFunction)WinObj_SetWindowAlternateTitle, 1, |
|---|
| 2383 | n/a | PyDoc_STR("(CFStringRef inTitle) -> None")}, |
|---|
| 2384 | n/a | {"CopyWindowAlternateTitle", (PyCFunction)WinObj_CopyWindowAlternateTitle, 1, |
|---|
| 2385 | n/a | PyDoc_STR("() -> (CFStringRef outTitle)")}, |
|---|
| 2386 | n/a | {"HiliteWindow", (PyCFunction)WinObj_HiliteWindow, 1, |
|---|
| 2387 | n/a | PyDoc_STR("(Boolean fHilite) -> None")}, |
|---|
| 2388 | n/a | {"SetWRefCon", (PyCFunction)WinObj_SetWRefCon, 1, |
|---|
| 2389 | n/a | PyDoc_STR("(long data) -> None")}, |
|---|
| 2390 | n/a | {"GetWRefCon", (PyCFunction)WinObj_GetWRefCon, 1, |
|---|
| 2391 | n/a | PyDoc_STR("() -> (long _rv)")}, |
|---|
| 2392 | n/a | {"SetWindowPic", (PyCFunction)WinObj_SetWindowPic, 1, |
|---|
| 2393 | n/a | PyDoc_STR("(PicHandle pic) -> None")}, |
|---|
| 2394 | n/a | {"GetWindowPic", (PyCFunction)WinObj_GetWindowPic, 1, |
|---|
| 2395 | n/a | PyDoc_STR("() -> (PicHandle _rv)")}, |
|---|
| 2396 | n/a | {"GetWVariant", (PyCFunction)WinObj_GetWVariant, 1, |
|---|
| 2397 | n/a | PyDoc_STR("() -> (short _rv)")}, |
|---|
| 2398 | n/a | {"GetWindowFeatures", (PyCFunction)WinObj_GetWindowFeatures, 1, |
|---|
| 2399 | n/a | PyDoc_STR("() -> (UInt32 outFeatures)")}, |
|---|
| 2400 | n/a | {"GetWindowRegion", (PyCFunction)WinObj_GetWindowRegion, 1, |
|---|
| 2401 | n/a | PyDoc_STR("(WindowRegionCode inRegionCode, RgnHandle ioWinRgn) -> None")}, |
|---|
| 2402 | n/a | {"GetWindowStructureWidths", (PyCFunction)WinObj_GetWindowStructureWidths, 1, |
|---|
| 2403 | n/a | PyDoc_STR("() -> (Rect outRect)")}, |
|---|
| 2404 | n/a | {"BeginUpdate", (PyCFunction)WinObj_BeginUpdate, 1, |
|---|
| 2405 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 2406 | n/a | {"EndUpdate", (PyCFunction)WinObj_EndUpdate, 1, |
|---|
| 2407 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 2408 | n/a | {"InvalWindowRgn", (PyCFunction)WinObj_InvalWindowRgn, 1, |
|---|
| 2409 | n/a | PyDoc_STR("(RgnHandle region) -> None")}, |
|---|
| 2410 | n/a | {"InvalWindowRect", (PyCFunction)WinObj_InvalWindowRect, 1, |
|---|
| 2411 | n/a | PyDoc_STR("(Rect bounds) -> None")}, |
|---|
| 2412 | n/a | {"ValidWindowRgn", (PyCFunction)WinObj_ValidWindowRgn, 1, |
|---|
| 2413 | n/a | PyDoc_STR("(RgnHandle region) -> None")}, |
|---|
| 2414 | n/a | {"ValidWindowRect", (PyCFunction)WinObj_ValidWindowRect, 1, |
|---|
| 2415 | n/a | PyDoc_STR("(Rect bounds) -> None")}, |
|---|
| 2416 | n/a | {"DrawGrowIcon", (PyCFunction)WinObj_DrawGrowIcon, 1, |
|---|
| 2417 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 2418 | n/a | {"SetWTitle", (PyCFunction)WinObj_SetWTitle, 1, |
|---|
| 2419 | n/a | PyDoc_STR("(Str255 title) -> None")}, |
|---|
| 2420 | n/a | {"GetWTitle", (PyCFunction)WinObj_GetWTitle, 1, |
|---|
| 2421 | n/a | PyDoc_STR("() -> (Str255 title)")}, |
|---|
| 2422 | n/a | {"SetWindowTitleWithCFString", (PyCFunction)WinObj_SetWindowTitleWithCFString, 1, |
|---|
| 2423 | n/a | PyDoc_STR("(CFStringRef inString) -> None")}, |
|---|
| 2424 | n/a | {"CopyWindowTitleAsCFString", (PyCFunction)WinObj_CopyWindowTitleAsCFString, 1, |
|---|
| 2425 | n/a | PyDoc_STR("() -> (CFStringRef outString)")}, |
|---|
| 2426 | n/a | {"SetWindowProxyFSSpec", (PyCFunction)WinObj_SetWindowProxyFSSpec, 1, |
|---|
| 2427 | n/a | PyDoc_STR("(FSSpec inFile) -> None")}, |
|---|
| 2428 | n/a | {"GetWindowProxyFSSpec", (PyCFunction)WinObj_GetWindowProxyFSSpec, 1, |
|---|
| 2429 | n/a | PyDoc_STR("() -> (FSSpec outFile)")}, |
|---|
| 2430 | n/a | {"SetWindowProxyAlias", (PyCFunction)WinObj_SetWindowProxyAlias, 1, |
|---|
| 2431 | n/a | PyDoc_STR("(AliasHandle inAlias) -> None")}, |
|---|
| 2432 | n/a | {"GetWindowProxyAlias", (PyCFunction)WinObj_GetWindowProxyAlias, 1, |
|---|
| 2433 | n/a | PyDoc_STR("() -> (AliasHandle alias)")}, |
|---|
| 2434 | n/a | {"SetWindowProxyCreatorAndType", (PyCFunction)WinObj_SetWindowProxyCreatorAndType, 1, |
|---|
| 2435 | n/a | PyDoc_STR("(OSType fileCreator, OSType fileType, SInt16 vRefNum) -> None")}, |
|---|
| 2436 | n/a | {"GetWindowProxyIcon", (PyCFunction)WinObj_GetWindowProxyIcon, 1, |
|---|
| 2437 | n/a | PyDoc_STR("() -> (IconRef outIcon)")}, |
|---|
| 2438 | n/a | {"SetWindowProxyIcon", (PyCFunction)WinObj_SetWindowProxyIcon, 1, |
|---|
| 2439 | n/a | PyDoc_STR("(IconRef icon) -> None")}, |
|---|
| 2440 | n/a | {"RemoveWindowProxy", (PyCFunction)WinObj_RemoveWindowProxy, 1, |
|---|
| 2441 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 2442 | n/a | {"BeginWindowProxyDrag", (PyCFunction)WinObj_BeginWindowProxyDrag, 1, |
|---|
| 2443 | n/a | PyDoc_STR("(RgnHandle outDragOutlineRgn) -> (DragReference outNewDrag)")}, |
|---|
| 2444 | n/a | {"EndWindowProxyDrag", (PyCFunction)WinObj_EndWindowProxyDrag, 1, |
|---|
| 2445 | n/a | PyDoc_STR("(DragReference theDrag) -> None")}, |
|---|
| 2446 | n/a | {"TrackWindowProxyFromExistingDrag", (PyCFunction)WinObj_TrackWindowProxyFromExistingDrag, 1, |
|---|
| 2447 | n/a | PyDoc_STR("(Point startPt, DragReference drag, RgnHandle inDragOutlineRgn) -> None")}, |
|---|
| 2448 | n/a | {"TrackWindowProxyDrag", (PyCFunction)WinObj_TrackWindowProxyDrag, 1, |
|---|
| 2449 | n/a | PyDoc_STR("(Point startPt) -> None")}, |
|---|
| 2450 | n/a | {"IsWindowModified", (PyCFunction)WinObj_IsWindowModified, 1, |
|---|
| 2451 | n/a | PyDoc_STR("() -> (Boolean _rv)")}, |
|---|
| 2452 | n/a | {"SetWindowModified", (PyCFunction)WinObj_SetWindowModified, 1, |
|---|
| 2453 | n/a | PyDoc_STR("(Boolean modified) -> None")}, |
|---|
| 2454 | n/a | {"IsWindowPathSelectClick", (PyCFunction)WinObj_IsWindowPathSelectClick, 1, |
|---|
| 2455 | n/a | PyDoc_STR("(EventRecord event) -> (Boolean _rv)")}, |
|---|
| 2456 | n/a | {"WindowPathSelect", (PyCFunction)WinObj_WindowPathSelect, 1, |
|---|
| 2457 | n/a | PyDoc_STR("(MenuHandle menu) -> (SInt32 outMenuResult)")}, |
|---|
| 2458 | n/a | {"HiliteWindowFrameForDrag", (PyCFunction)WinObj_HiliteWindowFrameForDrag, 1, |
|---|
| 2459 | n/a | PyDoc_STR("(Boolean hilited) -> None")}, |
|---|
| 2460 | n/a | {"TransitionWindow", (PyCFunction)WinObj_TransitionWindow, 1, |
|---|
| 2461 | n/a | PyDoc_STR("(WindowTransitionEffect inEffect, WindowTransitionAction inAction, Rect inRect) -> None")}, |
|---|
| 2462 | n/a | {"TransitionWindowAndParent", (PyCFunction)WinObj_TransitionWindowAndParent, 1, |
|---|
| 2463 | n/a | PyDoc_STR("(WindowPtr inParentWindow, WindowTransitionEffect inEffect, WindowTransitionAction inAction, Rect inRect) -> None")}, |
|---|
| 2464 | n/a | {"MacMoveWindow", (PyCFunction)WinObj_MacMoveWindow, 1, |
|---|
| 2465 | n/a | PyDoc_STR("(short hGlobal, short vGlobal, Boolean front) -> None")}, |
|---|
| 2466 | n/a | {"SizeWindow", (PyCFunction)WinObj_SizeWindow, 1, |
|---|
| 2467 | n/a | PyDoc_STR("(short w, short h, Boolean fUpdate) -> None")}, |
|---|
| 2468 | n/a | {"GrowWindow", (PyCFunction)WinObj_GrowWindow, 1, |
|---|
| 2469 | n/a | PyDoc_STR("(Point startPt, Rect bBox) -> (long _rv)")}, |
|---|
| 2470 | n/a | {"DragWindow", (PyCFunction)WinObj_DragWindow, 1, |
|---|
| 2471 | n/a | PyDoc_STR("(Point startPt, Rect boundsRect) -> None")}, |
|---|
| 2472 | n/a | {"ZoomWindow", (PyCFunction)WinObj_ZoomWindow, 1, |
|---|
| 2473 | n/a | PyDoc_STR("(WindowPartCode partCode, Boolean front) -> None")}, |
|---|
| 2474 | n/a | {"IsWindowCollapsable", (PyCFunction)WinObj_IsWindowCollapsable, 1, |
|---|
| 2475 | n/a | PyDoc_STR("() -> (Boolean _rv)")}, |
|---|
| 2476 | n/a | {"IsWindowCollapsed", (PyCFunction)WinObj_IsWindowCollapsed, 1, |
|---|
| 2477 | n/a | PyDoc_STR("() -> (Boolean _rv)")}, |
|---|
| 2478 | n/a | {"CollapseWindow", (PyCFunction)WinObj_CollapseWindow, 1, |
|---|
| 2479 | n/a | PyDoc_STR("(Boolean collapse) -> None")}, |
|---|
| 2480 | n/a | {"GetWindowBounds", (PyCFunction)WinObj_GetWindowBounds, 1, |
|---|
| 2481 | n/a | PyDoc_STR("(WindowRegionCode regionCode) -> (Rect globalBounds)")}, |
|---|
| 2482 | n/a | {"ResizeWindow", (PyCFunction)WinObj_ResizeWindow, 1, |
|---|
| 2483 | n/a | PyDoc_STR("(Point inStartPoint, Rect inSizeConstraints) -> (Boolean _rv, Rect outNewContentRect)")}, |
|---|
| 2484 | n/a | {"SetWindowBounds", (PyCFunction)WinObj_SetWindowBounds, 1, |
|---|
| 2485 | n/a | PyDoc_STR("(WindowRegionCode regionCode, Rect globalBounds) -> None")}, |
|---|
| 2486 | n/a | {"RepositionWindow", (PyCFunction)WinObj_RepositionWindow, 1, |
|---|
| 2487 | n/a | PyDoc_STR("(WindowPtr parentWindow, WindowPositionMethod method) -> None")}, |
|---|
| 2488 | n/a | {"MoveWindowStructure", (PyCFunction)WinObj_MoveWindowStructure, 1, |
|---|
| 2489 | n/a | PyDoc_STR("(short hGlobal, short vGlobal) -> None")}, |
|---|
| 2490 | n/a | {"IsWindowInStandardState", (PyCFunction)WinObj_IsWindowInStandardState, 1, |
|---|
| 2491 | n/a | PyDoc_STR("(Point inIdealSize) -> (Boolean _rv, Rect outIdealStandardState)")}, |
|---|
| 2492 | n/a | {"ZoomWindowIdeal", (PyCFunction)WinObj_ZoomWindowIdeal, 1, |
|---|
| 2493 | n/a | PyDoc_STR("(WindowPartCode inPartCode) -> (Point ioIdealSize)")}, |
|---|
| 2494 | n/a | {"GetWindowIdealUserState", (PyCFunction)WinObj_GetWindowIdealUserState, 1, |
|---|
| 2495 | n/a | PyDoc_STR("() -> (Rect outUserState)")}, |
|---|
| 2496 | n/a | {"SetWindowIdealUserState", (PyCFunction)WinObj_SetWindowIdealUserState, 1, |
|---|
| 2497 | n/a | PyDoc_STR("(Rect inUserState) -> None")}, |
|---|
| 2498 | n/a | {"GetWindowGreatestAreaDevice", (PyCFunction)WinObj_GetWindowGreatestAreaDevice, 1, |
|---|
| 2499 | n/a | PyDoc_STR("(WindowRegionCode inRegion) -> (GDHandle outGreatestDevice, Rect outGreatestDeviceRect)")}, |
|---|
| 2500 | n/a | {"ConstrainWindowToScreen", (PyCFunction)WinObj_ConstrainWindowToScreen, 1, |
|---|
| 2501 | n/a | PyDoc_STR("(WindowRegionCode inRegionCode, WindowConstrainOptions inOptions, Rect inScreenRect) -> (Rect outStructure)")}, |
|---|
| 2502 | n/a | {"HideWindow", (PyCFunction)WinObj_HideWindow, 1, |
|---|
| 2503 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 2504 | n/a | {"MacShowWindow", (PyCFunction)WinObj_MacShowWindow, 1, |
|---|
| 2505 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 2506 | n/a | {"ShowHide", (PyCFunction)WinObj_ShowHide, 1, |
|---|
| 2507 | n/a | PyDoc_STR("(Boolean showFlag) -> None")}, |
|---|
| 2508 | n/a | {"MacIsWindowVisible", (PyCFunction)WinObj_MacIsWindowVisible, 1, |
|---|
| 2509 | n/a | PyDoc_STR("() -> (Boolean _rv)")}, |
|---|
| 2510 | n/a | {"ShowSheetWindow", (PyCFunction)WinObj_ShowSheetWindow, 1, |
|---|
| 2511 | n/a | PyDoc_STR("(WindowPtr inParentWindow) -> None")}, |
|---|
| 2512 | n/a | {"HideSheetWindow", (PyCFunction)WinObj_HideSheetWindow, 1, |
|---|
| 2513 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 2514 | n/a | {"GetSheetWindowParent", (PyCFunction)WinObj_GetSheetWindowParent, 1, |
|---|
| 2515 | n/a | PyDoc_STR("() -> (WindowPtr outParentWindow)")}, |
|---|
| 2516 | n/a | {"GetWindowPropertyAttributes", (PyCFunction)WinObj_GetWindowPropertyAttributes, 1, |
|---|
| 2517 | n/a | PyDoc_STR("(OSType propertyCreator, OSType propertyTag) -> (UInt32 attributes)")}, |
|---|
| 2518 | n/a | {"ChangeWindowPropertyAttributes", (PyCFunction)WinObj_ChangeWindowPropertyAttributes, 1, |
|---|
| 2519 | n/a | PyDoc_STR("(OSType propertyCreator, OSType propertyTag, UInt32 attributesToSet, UInt32 attributesToClear) -> None")}, |
|---|
| 2520 | n/a | {"TrackBox", (PyCFunction)WinObj_TrackBox, 1, |
|---|
| 2521 | n/a | PyDoc_STR("(Point thePt, WindowPartCode partCode) -> (Boolean _rv)")}, |
|---|
| 2522 | n/a | {"TrackGoAway", (PyCFunction)WinObj_TrackGoAway, 1, |
|---|
| 2523 | n/a | PyDoc_STR("(Point thePt) -> (Boolean _rv)")}, |
|---|
| 2524 | n/a | {"GetWindowPort", (PyCFunction)WinObj_GetWindowPort, 1, |
|---|
| 2525 | n/a | PyDoc_STR("() -> (CGrafPtr _rv)")}, |
|---|
| 2526 | n/a | {"GetWindowStructurePort", (PyCFunction)WinObj_GetWindowStructurePort, 1, |
|---|
| 2527 | n/a | PyDoc_STR("() -> (CGrafPtr _rv)")}, |
|---|
| 2528 | n/a | {"GetWindowKind", (PyCFunction)WinObj_GetWindowKind, 1, |
|---|
| 2529 | n/a | PyDoc_STR("() -> (short _rv)")}, |
|---|
| 2530 | n/a | {"IsWindowHilited", (PyCFunction)WinObj_IsWindowHilited, 1, |
|---|
| 2531 | n/a | PyDoc_STR("() -> (Boolean _rv)")}, |
|---|
| 2532 | n/a | {"IsWindowUpdatePending", (PyCFunction)WinObj_IsWindowUpdatePending, 1, |
|---|
| 2533 | n/a | PyDoc_STR("() -> (Boolean _rv)")}, |
|---|
| 2534 | n/a | {"MacGetNextWindow", (PyCFunction)WinObj_MacGetNextWindow, 1, |
|---|
| 2535 | n/a | PyDoc_STR("() -> (WindowPtr _rv)")}, |
|---|
| 2536 | n/a | {"GetWindowStandardState", (PyCFunction)WinObj_GetWindowStandardState, 1, |
|---|
| 2537 | n/a | PyDoc_STR("() -> (Rect rect)")}, |
|---|
| 2538 | n/a | {"GetWindowUserState", (PyCFunction)WinObj_GetWindowUserState, 1, |
|---|
| 2539 | n/a | PyDoc_STR("() -> (Rect rect)")}, |
|---|
| 2540 | n/a | {"SetWindowKind", (PyCFunction)WinObj_SetWindowKind, 1, |
|---|
| 2541 | n/a | PyDoc_STR("(short kind) -> None")}, |
|---|
| 2542 | n/a | {"SetWindowStandardState", (PyCFunction)WinObj_SetWindowStandardState, 1, |
|---|
| 2543 | n/a | PyDoc_STR("(Rect rect) -> None")}, |
|---|
| 2544 | n/a | {"SetWindowUserState", (PyCFunction)WinObj_SetWindowUserState, 1, |
|---|
| 2545 | n/a | PyDoc_STR("(Rect rect) -> None")}, |
|---|
| 2546 | n/a | {"SetPortWindowPort", (PyCFunction)WinObj_SetPortWindowPort, 1, |
|---|
| 2547 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 2548 | n/a | {"GetWindowPortBounds", (PyCFunction)WinObj_GetWindowPortBounds, 1, |
|---|
| 2549 | n/a | PyDoc_STR("() -> (Rect bounds)")}, |
|---|
| 2550 | n/a | {"IsWindowVisible", (PyCFunction)WinObj_IsWindowVisible, 1, |
|---|
| 2551 | n/a | PyDoc_STR("() -> (Boolean _rv)")}, |
|---|
| 2552 | n/a | {"GetWindowStructureRgn", (PyCFunction)WinObj_GetWindowStructureRgn, 1, |
|---|
| 2553 | n/a | PyDoc_STR("(RgnHandle r) -> None")}, |
|---|
| 2554 | n/a | {"GetWindowContentRgn", (PyCFunction)WinObj_GetWindowContentRgn, 1, |
|---|
| 2555 | n/a | PyDoc_STR("(RgnHandle r) -> None")}, |
|---|
| 2556 | n/a | {"GetWindowUpdateRgn", (PyCFunction)WinObj_GetWindowUpdateRgn, 1, |
|---|
| 2557 | n/a | PyDoc_STR("(RgnHandle r) -> None")}, |
|---|
| 2558 | n/a | {"GetNextWindow", (PyCFunction)WinObj_GetNextWindow, 1, |
|---|
| 2559 | n/a | PyDoc_STR("() -> (WindowPtr _rv)")}, |
|---|
| 2560 | n/a | {"MoveWindow", (PyCFunction)WinObj_MoveWindow, 1, |
|---|
| 2561 | n/a | PyDoc_STR("(short hGlobal, short vGlobal, Boolean front) -> None")}, |
|---|
| 2562 | n/a | {"ShowWindow", (PyCFunction)WinObj_ShowWindow, 1, |
|---|
| 2563 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 2564 | n/a | {"AutoDispose", (PyCFunction)WinObj_AutoDispose, 1, |
|---|
| 2565 | n/a | PyDoc_STR("(int)->int. Automatically DisposeHandle the object on Python object cleanup")}, |
|---|
| 2566 | n/a | {NULL, NULL, 0} |
|---|
| 2567 | n/a | }; |
|---|
| 2568 | n/a | |
|---|
| 2569 | n/a | #define WinObj_getsetlist NULL |
|---|
| 2570 | n/a | |
|---|
| 2571 | n/a | |
|---|
| 2572 | n/a | static int WinObj_compare(WindowObject *self, WindowObject *other) |
|---|
| 2573 | n/a | { |
|---|
| 2574 | n/a | if ( self->ob_itself > other->ob_itself ) return 1; |
|---|
| 2575 | n/a | if ( self->ob_itself < other->ob_itself ) return -1; |
|---|
| 2576 | n/a | return 0; |
|---|
| 2577 | n/a | } |
|---|
| 2578 | n/a | |
|---|
| 2579 | n/a | static PyObject * WinObj_repr(WindowObject *self) |
|---|
| 2580 | n/a | { |
|---|
| 2581 | n/a | char buf[100]; |
|---|
| 2582 | n/a | sprintf(buf, "<Window object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself); |
|---|
| 2583 | n/a | return PyString_FromString(buf); |
|---|
| 2584 | n/a | } |
|---|
| 2585 | n/a | |
|---|
| 2586 | n/a | static int WinObj_hash(WindowObject *self) |
|---|
| 2587 | n/a | { |
|---|
| 2588 | n/a | return (int)self->ob_itself; |
|---|
| 2589 | n/a | } |
|---|
| 2590 | n/a | #define WinObj_tp_init 0 |
|---|
| 2591 | n/a | |
|---|
| 2592 | n/a | #define WinObj_tp_alloc PyType_GenericAlloc |
|---|
| 2593 | n/a | |
|---|
| 2594 | n/a | static PyObject *WinObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds) |
|---|
| 2595 | n/a | { |
|---|
| 2596 | n/a | PyObject *_self; |
|---|
| 2597 | n/a | WindowPtr itself; |
|---|
| 2598 | n/a | char *kw[] = {"itself", 0}; |
|---|
| 2599 | n/a | |
|---|
| 2600 | n/a | if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, WinObj_Convert, &itself)) return NULL; |
|---|
| 2601 | n/a | if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL; |
|---|
| 2602 | n/a | ((WindowObject *)_self)->ob_itself = itself; |
|---|
| 2603 | n/a | return _self; |
|---|
| 2604 | n/a | } |
|---|
| 2605 | n/a | |
|---|
| 2606 | n/a | #define WinObj_tp_free PyObject_Del |
|---|
| 2607 | n/a | |
|---|
| 2608 | n/a | |
|---|
| 2609 | n/a | PyTypeObject Window_Type = { |
|---|
| 2610 | n/a | PyObject_HEAD_INIT(NULL) |
|---|
| 2611 | n/a | 0, /*ob_size*/ |
|---|
| 2612 | n/a | "_Win.Window", /*tp_name*/ |
|---|
| 2613 | n/a | sizeof(WindowObject), /*tp_basicsize*/ |
|---|
| 2614 | n/a | 0, /*tp_itemsize*/ |
|---|
| 2615 | n/a | /* methods */ |
|---|
| 2616 | n/a | (destructor) WinObj_dealloc, /*tp_dealloc*/ |
|---|
| 2617 | n/a | 0, /*tp_print*/ |
|---|
| 2618 | n/a | (getattrfunc)0, /*tp_getattr*/ |
|---|
| 2619 | n/a | (setattrfunc)0, /*tp_setattr*/ |
|---|
| 2620 | n/a | (cmpfunc) WinObj_compare, /*tp_compare*/ |
|---|
| 2621 | n/a | (reprfunc) WinObj_repr, /*tp_repr*/ |
|---|
| 2622 | n/a | (PyNumberMethods *)0, /* tp_as_number */ |
|---|
| 2623 | n/a | (PySequenceMethods *)0, /* tp_as_sequence */ |
|---|
| 2624 | n/a | (PyMappingMethods *)0, /* tp_as_mapping */ |
|---|
| 2625 | n/a | (hashfunc) WinObj_hash, /*tp_hash*/ |
|---|
| 2626 | n/a | 0, /*tp_call*/ |
|---|
| 2627 | n/a | 0, /*tp_str*/ |
|---|
| 2628 | n/a | PyObject_GenericGetAttr, /*tp_getattro*/ |
|---|
| 2629 | n/a | PyObject_GenericSetAttr, /*tp_setattro */ |
|---|
| 2630 | n/a | 0, /*tp_as_buffer*/ |
|---|
| 2631 | n/a | Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ |
|---|
| 2632 | n/a | 0, /*tp_doc*/ |
|---|
| 2633 | n/a | 0, /*tp_traverse*/ |
|---|
| 2634 | n/a | 0, /*tp_clear*/ |
|---|
| 2635 | n/a | 0, /*tp_richcompare*/ |
|---|
| 2636 | n/a | 0, /*tp_weaklistoffset*/ |
|---|
| 2637 | n/a | 0, /*tp_iter*/ |
|---|
| 2638 | n/a | 0, /*tp_iternext*/ |
|---|
| 2639 | n/a | WinObj_methods, /* tp_methods */ |
|---|
| 2640 | n/a | 0, /*tp_members*/ |
|---|
| 2641 | n/a | WinObj_getsetlist, /*tp_getset*/ |
|---|
| 2642 | n/a | 0, /*tp_base*/ |
|---|
| 2643 | n/a | 0, /*tp_dict*/ |
|---|
| 2644 | n/a | 0, /*tp_descr_get*/ |
|---|
| 2645 | n/a | 0, /*tp_descr_set*/ |
|---|
| 2646 | n/a | 0, /*tp_dictoffset*/ |
|---|
| 2647 | n/a | WinObj_tp_init, /* tp_init */ |
|---|
| 2648 | n/a | WinObj_tp_alloc, /* tp_alloc */ |
|---|
| 2649 | n/a | WinObj_tp_new, /* tp_new */ |
|---|
| 2650 | n/a | WinObj_tp_free, /* tp_free */ |
|---|
| 2651 | n/a | }; |
|---|
| 2652 | n/a | |
|---|
| 2653 | n/a | /* --------------------- End object type Window --------------------- */ |
|---|
| 2654 | n/a | |
|---|
| 2655 | n/a | |
|---|
| 2656 | n/a | static PyObject *Win_GetNewCWindow(PyObject *_self, PyObject *_args) |
|---|
| 2657 | n/a | { |
|---|
| 2658 | n/a | PyObject *_res = NULL; |
|---|
| 2659 | n/a | WindowPtr _rv; |
|---|
| 2660 | n/a | short windowID; |
|---|
| 2661 | n/a | WindowPtr behind; |
|---|
| 2662 | n/a | #ifndef GetNewCWindow |
|---|
| 2663 | n/a | PyMac_PRECHECK(GetNewCWindow); |
|---|
| 2664 | n/a | #endif |
|---|
| 2665 | n/a | if (!PyArg_ParseTuple(_args, "hO&", |
|---|
| 2666 | n/a | &windowID, |
|---|
| 2667 | n/a | WinObj_Convert, &behind)) |
|---|
| 2668 | n/a | return NULL; |
|---|
| 2669 | n/a | _rv = GetNewCWindow(windowID, |
|---|
| 2670 | n/a | (void *)0, |
|---|
| 2671 | n/a | behind); |
|---|
| 2672 | n/a | _res = Py_BuildValue("O&", |
|---|
| 2673 | n/a | WinObj_New, _rv); |
|---|
| 2674 | n/a | return _res; |
|---|
| 2675 | n/a | } |
|---|
| 2676 | n/a | |
|---|
| 2677 | n/a | static PyObject *Win_NewWindow(PyObject *_self, PyObject *_args) |
|---|
| 2678 | n/a | { |
|---|
| 2679 | n/a | PyObject *_res = NULL; |
|---|
| 2680 | n/a | WindowPtr _rv; |
|---|
| 2681 | n/a | Rect boundsRect; |
|---|
| 2682 | n/a | Str255 title; |
|---|
| 2683 | n/a | Boolean visible; |
|---|
| 2684 | n/a | short theProc; |
|---|
| 2685 | n/a | WindowPtr behind; |
|---|
| 2686 | n/a | Boolean goAwayFlag; |
|---|
| 2687 | n/a | long refCon; |
|---|
| 2688 | n/a | #ifndef NewWindow |
|---|
| 2689 | n/a | PyMac_PRECHECK(NewWindow); |
|---|
| 2690 | n/a | #endif |
|---|
| 2691 | n/a | if (!PyArg_ParseTuple(_args, "O&O&bhO&bl", |
|---|
| 2692 | n/a | PyMac_GetRect, &boundsRect, |
|---|
| 2693 | n/a | PyMac_GetStr255, title, |
|---|
| 2694 | n/a | &visible, |
|---|
| 2695 | n/a | &theProc, |
|---|
| 2696 | n/a | WinObj_Convert, &behind, |
|---|
| 2697 | n/a | &goAwayFlag, |
|---|
| 2698 | n/a | &refCon)) |
|---|
| 2699 | n/a | return NULL; |
|---|
| 2700 | n/a | _rv = NewWindow((void *)0, |
|---|
| 2701 | n/a | &boundsRect, |
|---|
| 2702 | n/a | title, |
|---|
| 2703 | n/a | visible, |
|---|
| 2704 | n/a | theProc, |
|---|
| 2705 | n/a | behind, |
|---|
| 2706 | n/a | goAwayFlag, |
|---|
| 2707 | n/a | refCon); |
|---|
| 2708 | n/a | _res = Py_BuildValue("O&", |
|---|
| 2709 | n/a | WinObj_New, _rv); |
|---|
| 2710 | n/a | return _res; |
|---|
| 2711 | n/a | } |
|---|
| 2712 | n/a | |
|---|
| 2713 | n/a | static PyObject *Win_GetNewWindow(PyObject *_self, PyObject *_args) |
|---|
| 2714 | n/a | { |
|---|
| 2715 | n/a | PyObject *_res = NULL; |
|---|
| 2716 | n/a | WindowPtr _rv; |
|---|
| 2717 | n/a | short windowID; |
|---|
| 2718 | n/a | WindowPtr behind; |
|---|
| 2719 | n/a | #ifndef GetNewWindow |
|---|
| 2720 | n/a | PyMac_PRECHECK(GetNewWindow); |
|---|
| 2721 | n/a | #endif |
|---|
| 2722 | n/a | if (!PyArg_ParseTuple(_args, "hO&", |
|---|
| 2723 | n/a | &windowID, |
|---|
| 2724 | n/a | WinObj_Convert, &behind)) |
|---|
| 2725 | n/a | return NULL; |
|---|
| 2726 | n/a | _rv = GetNewWindow(windowID, |
|---|
| 2727 | n/a | (void *)0, |
|---|
| 2728 | n/a | behind); |
|---|
| 2729 | n/a | _res = Py_BuildValue("O&", |
|---|
| 2730 | n/a | WinObj_New, _rv); |
|---|
| 2731 | n/a | return _res; |
|---|
| 2732 | n/a | } |
|---|
| 2733 | n/a | |
|---|
| 2734 | n/a | static PyObject *Win_NewCWindow(PyObject *_self, PyObject *_args) |
|---|
| 2735 | n/a | { |
|---|
| 2736 | n/a | PyObject *_res = NULL; |
|---|
| 2737 | n/a | WindowPtr _rv; |
|---|
| 2738 | n/a | Rect boundsRect; |
|---|
| 2739 | n/a | Str255 title; |
|---|
| 2740 | n/a | Boolean visible; |
|---|
| 2741 | n/a | short procID; |
|---|
| 2742 | n/a | WindowPtr behind; |
|---|
| 2743 | n/a | Boolean goAwayFlag; |
|---|
| 2744 | n/a | long refCon; |
|---|
| 2745 | n/a | #ifndef NewCWindow |
|---|
| 2746 | n/a | PyMac_PRECHECK(NewCWindow); |
|---|
| 2747 | n/a | #endif |
|---|
| 2748 | n/a | if (!PyArg_ParseTuple(_args, "O&O&bhO&bl", |
|---|
| 2749 | n/a | PyMac_GetRect, &boundsRect, |
|---|
| 2750 | n/a | PyMac_GetStr255, title, |
|---|
| 2751 | n/a | &visible, |
|---|
| 2752 | n/a | &procID, |
|---|
| 2753 | n/a | WinObj_Convert, &behind, |
|---|
| 2754 | n/a | &goAwayFlag, |
|---|
| 2755 | n/a | &refCon)) |
|---|
| 2756 | n/a | return NULL; |
|---|
| 2757 | n/a | _rv = NewCWindow((void *)0, |
|---|
| 2758 | n/a | &boundsRect, |
|---|
| 2759 | n/a | title, |
|---|
| 2760 | n/a | visible, |
|---|
| 2761 | n/a | procID, |
|---|
| 2762 | n/a | behind, |
|---|
| 2763 | n/a | goAwayFlag, |
|---|
| 2764 | n/a | refCon); |
|---|
| 2765 | n/a | _res = Py_BuildValue("O&", |
|---|
| 2766 | n/a | WinObj_New, _rv); |
|---|
| 2767 | n/a | return _res; |
|---|
| 2768 | n/a | } |
|---|
| 2769 | n/a | |
|---|
| 2770 | n/a | static PyObject *Win_CreateNewWindow(PyObject *_self, PyObject *_args) |
|---|
| 2771 | n/a | { |
|---|
| 2772 | n/a | PyObject *_res = NULL; |
|---|
| 2773 | n/a | OSStatus _err; |
|---|
| 2774 | n/a | WindowClass windowClass; |
|---|
| 2775 | n/a | WindowAttributes attributes; |
|---|
| 2776 | n/a | Rect contentBounds; |
|---|
| 2777 | n/a | WindowPtr outWindow; |
|---|
| 2778 | n/a | #ifndef CreateNewWindow |
|---|
| 2779 | n/a | PyMac_PRECHECK(CreateNewWindow); |
|---|
| 2780 | n/a | #endif |
|---|
| 2781 | n/a | if (!PyArg_ParseTuple(_args, "llO&", |
|---|
| 2782 | n/a | &windowClass, |
|---|
| 2783 | n/a | &attributes, |
|---|
| 2784 | n/a | PyMac_GetRect, &contentBounds)) |
|---|
| 2785 | n/a | return NULL; |
|---|
| 2786 | n/a | _err = CreateNewWindow(windowClass, |
|---|
| 2787 | n/a | attributes, |
|---|
| 2788 | n/a | &contentBounds, |
|---|
| 2789 | n/a | &outWindow); |
|---|
| 2790 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 2791 | n/a | _res = Py_BuildValue("O&", |
|---|
| 2792 | n/a | WinObj_New, outWindow); |
|---|
| 2793 | n/a | return _res; |
|---|
| 2794 | n/a | } |
|---|
| 2795 | n/a | |
|---|
| 2796 | n/a | static PyObject *Win_CreateWindowFromResource(PyObject *_self, PyObject *_args) |
|---|
| 2797 | n/a | { |
|---|
| 2798 | n/a | PyObject *_res = NULL; |
|---|
| 2799 | n/a | OSStatus _err; |
|---|
| 2800 | n/a | SInt16 resID; |
|---|
| 2801 | n/a | WindowPtr outWindow; |
|---|
| 2802 | n/a | #ifndef CreateWindowFromResource |
|---|
| 2803 | n/a | PyMac_PRECHECK(CreateWindowFromResource); |
|---|
| 2804 | n/a | #endif |
|---|
| 2805 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 2806 | n/a | &resID)) |
|---|
| 2807 | n/a | return NULL; |
|---|
| 2808 | n/a | _err = CreateWindowFromResource(resID, |
|---|
| 2809 | n/a | &outWindow); |
|---|
| 2810 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 2811 | n/a | _res = Py_BuildValue("O&", |
|---|
| 2812 | n/a | WinObj_New, outWindow); |
|---|
| 2813 | n/a | return _res; |
|---|
| 2814 | n/a | } |
|---|
| 2815 | n/a | |
|---|
| 2816 | n/a | static PyObject *Win_ShowFloatingWindows(PyObject *_self, PyObject *_args) |
|---|
| 2817 | n/a | { |
|---|
| 2818 | n/a | PyObject *_res = NULL; |
|---|
| 2819 | n/a | OSStatus _err; |
|---|
| 2820 | n/a | #ifndef ShowFloatingWindows |
|---|
| 2821 | n/a | PyMac_PRECHECK(ShowFloatingWindows); |
|---|
| 2822 | n/a | #endif |
|---|
| 2823 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 2824 | n/a | return NULL; |
|---|
| 2825 | n/a | _err = ShowFloatingWindows(); |
|---|
| 2826 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 2827 | n/a | Py_INCREF(Py_None); |
|---|
| 2828 | n/a | _res = Py_None; |
|---|
| 2829 | n/a | return _res; |
|---|
| 2830 | n/a | } |
|---|
| 2831 | n/a | |
|---|
| 2832 | n/a | static PyObject *Win_HideFloatingWindows(PyObject *_self, PyObject *_args) |
|---|
| 2833 | n/a | { |
|---|
| 2834 | n/a | PyObject *_res = NULL; |
|---|
| 2835 | n/a | OSStatus _err; |
|---|
| 2836 | n/a | #ifndef HideFloatingWindows |
|---|
| 2837 | n/a | PyMac_PRECHECK(HideFloatingWindows); |
|---|
| 2838 | n/a | #endif |
|---|
| 2839 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 2840 | n/a | return NULL; |
|---|
| 2841 | n/a | _err = HideFloatingWindows(); |
|---|
| 2842 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 2843 | n/a | Py_INCREF(Py_None); |
|---|
| 2844 | n/a | _res = Py_None; |
|---|
| 2845 | n/a | return _res; |
|---|
| 2846 | n/a | } |
|---|
| 2847 | n/a | |
|---|
| 2848 | n/a | static PyObject *Win_AreFloatingWindowsVisible(PyObject *_self, PyObject *_args) |
|---|
| 2849 | n/a | { |
|---|
| 2850 | n/a | PyObject *_res = NULL; |
|---|
| 2851 | n/a | Boolean _rv; |
|---|
| 2852 | n/a | #ifndef AreFloatingWindowsVisible |
|---|
| 2853 | n/a | PyMac_PRECHECK(AreFloatingWindowsVisible); |
|---|
| 2854 | n/a | #endif |
|---|
| 2855 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 2856 | n/a | return NULL; |
|---|
| 2857 | n/a | _rv = AreFloatingWindowsVisible(); |
|---|
| 2858 | n/a | _res = Py_BuildValue("b", |
|---|
| 2859 | n/a | _rv); |
|---|
| 2860 | n/a | return _res; |
|---|
| 2861 | n/a | } |
|---|
| 2862 | n/a | |
|---|
| 2863 | n/a | static PyObject *Win_CheckUpdate(PyObject *_self, PyObject *_args) |
|---|
| 2864 | n/a | { |
|---|
| 2865 | n/a | PyObject *_res = NULL; |
|---|
| 2866 | n/a | Boolean _rv; |
|---|
| 2867 | n/a | EventRecord theEvent; |
|---|
| 2868 | n/a | #ifndef CheckUpdate |
|---|
| 2869 | n/a | PyMac_PRECHECK(CheckUpdate); |
|---|
| 2870 | n/a | #endif |
|---|
| 2871 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 2872 | n/a | return NULL; |
|---|
| 2873 | n/a | _rv = CheckUpdate(&theEvent); |
|---|
| 2874 | n/a | _res = Py_BuildValue("bO&", |
|---|
| 2875 | n/a | _rv, |
|---|
| 2876 | n/a | PyMac_BuildEventRecord, &theEvent); |
|---|
| 2877 | n/a | return _res; |
|---|
| 2878 | n/a | } |
|---|
| 2879 | n/a | |
|---|
| 2880 | n/a | static PyObject *Win_MacFindWindow(PyObject *_self, PyObject *_args) |
|---|
| 2881 | n/a | { |
|---|
| 2882 | n/a | PyObject *_res = NULL; |
|---|
| 2883 | n/a | WindowPartCode _rv; |
|---|
| 2884 | n/a | Point thePoint; |
|---|
| 2885 | n/a | WindowPtr window; |
|---|
| 2886 | n/a | #ifndef MacFindWindow |
|---|
| 2887 | n/a | PyMac_PRECHECK(MacFindWindow); |
|---|
| 2888 | n/a | #endif |
|---|
| 2889 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 2890 | n/a | PyMac_GetPoint, &thePoint)) |
|---|
| 2891 | n/a | return NULL; |
|---|
| 2892 | n/a | _rv = MacFindWindow(thePoint, |
|---|
| 2893 | n/a | &window); |
|---|
| 2894 | n/a | _res = Py_BuildValue("hO&", |
|---|
| 2895 | n/a | _rv, |
|---|
| 2896 | n/a | WinObj_WhichWindow, window); |
|---|
| 2897 | n/a | return _res; |
|---|
| 2898 | n/a | } |
|---|
| 2899 | n/a | |
|---|
| 2900 | n/a | static PyObject *Win_FrontWindow(PyObject *_self, PyObject *_args) |
|---|
| 2901 | n/a | { |
|---|
| 2902 | n/a | PyObject *_res = NULL; |
|---|
| 2903 | n/a | WindowPtr _rv; |
|---|
| 2904 | n/a | #ifndef FrontWindow |
|---|
| 2905 | n/a | PyMac_PRECHECK(FrontWindow); |
|---|
| 2906 | n/a | #endif |
|---|
| 2907 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 2908 | n/a | return NULL; |
|---|
| 2909 | n/a | _rv = FrontWindow(); |
|---|
| 2910 | n/a | _res = Py_BuildValue("O&", |
|---|
| 2911 | n/a | WinObj_WhichWindow, _rv); |
|---|
| 2912 | n/a | return _res; |
|---|
| 2913 | n/a | } |
|---|
| 2914 | n/a | |
|---|
| 2915 | n/a | static PyObject *Win_FrontNonFloatingWindow(PyObject *_self, PyObject *_args) |
|---|
| 2916 | n/a | { |
|---|
| 2917 | n/a | PyObject *_res = NULL; |
|---|
| 2918 | n/a | WindowPtr _rv; |
|---|
| 2919 | n/a | #ifndef FrontNonFloatingWindow |
|---|
| 2920 | n/a | PyMac_PRECHECK(FrontNonFloatingWindow); |
|---|
| 2921 | n/a | #endif |
|---|
| 2922 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 2923 | n/a | return NULL; |
|---|
| 2924 | n/a | _rv = FrontNonFloatingWindow(); |
|---|
| 2925 | n/a | _res = Py_BuildValue("O&", |
|---|
| 2926 | n/a | WinObj_WhichWindow, _rv); |
|---|
| 2927 | n/a | return _res; |
|---|
| 2928 | n/a | } |
|---|
| 2929 | n/a | |
|---|
| 2930 | n/a | static PyObject *Win_GetFrontWindowOfClass(PyObject *_self, PyObject *_args) |
|---|
| 2931 | n/a | { |
|---|
| 2932 | n/a | PyObject *_res = NULL; |
|---|
| 2933 | n/a | WindowPtr _rv; |
|---|
| 2934 | n/a | WindowClass inWindowClass; |
|---|
| 2935 | n/a | Boolean mustBeVisible; |
|---|
| 2936 | n/a | #ifndef GetFrontWindowOfClass |
|---|
| 2937 | n/a | PyMac_PRECHECK(GetFrontWindowOfClass); |
|---|
| 2938 | n/a | #endif |
|---|
| 2939 | n/a | if (!PyArg_ParseTuple(_args, "lb", |
|---|
| 2940 | n/a | &inWindowClass, |
|---|
| 2941 | n/a | &mustBeVisible)) |
|---|
| 2942 | n/a | return NULL; |
|---|
| 2943 | n/a | _rv = GetFrontWindowOfClass(inWindowClass, |
|---|
| 2944 | n/a | mustBeVisible); |
|---|
| 2945 | n/a | _res = Py_BuildValue("O&", |
|---|
| 2946 | n/a | WinObj_New, _rv); |
|---|
| 2947 | n/a | return _res; |
|---|
| 2948 | n/a | } |
|---|
| 2949 | n/a | |
|---|
| 2950 | n/a | static PyObject *Win_FindWindowOfClass(PyObject *_self, PyObject *_args) |
|---|
| 2951 | n/a | { |
|---|
| 2952 | n/a | PyObject *_res = NULL; |
|---|
| 2953 | n/a | OSStatus _err; |
|---|
| 2954 | n/a | Point where; |
|---|
| 2955 | n/a | WindowClass inWindowClass; |
|---|
| 2956 | n/a | WindowPtr outWindow; |
|---|
| 2957 | n/a | WindowPartCode outWindowPart; |
|---|
| 2958 | n/a | #ifndef FindWindowOfClass |
|---|
| 2959 | n/a | PyMac_PRECHECK(FindWindowOfClass); |
|---|
| 2960 | n/a | #endif |
|---|
| 2961 | n/a | if (!PyArg_ParseTuple(_args, "O&l", |
|---|
| 2962 | n/a | PyMac_GetPoint, &where, |
|---|
| 2963 | n/a | &inWindowClass)) |
|---|
| 2964 | n/a | return NULL; |
|---|
| 2965 | n/a | _err = FindWindowOfClass(&where, |
|---|
| 2966 | n/a | inWindowClass, |
|---|
| 2967 | n/a | &outWindow, |
|---|
| 2968 | n/a | &outWindowPart); |
|---|
| 2969 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 2970 | n/a | _res = Py_BuildValue("O&h", |
|---|
| 2971 | n/a | WinObj_WhichWindow, outWindow, |
|---|
| 2972 | n/a | outWindowPart); |
|---|
| 2973 | n/a | return _res; |
|---|
| 2974 | n/a | } |
|---|
| 2975 | n/a | |
|---|
| 2976 | n/a | static PyObject *Win_CreateStandardWindowMenu(PyObject *_self, PyObject *_args) |
|---|
| 2977 | n/a | { |
|---|
| 2978 | n/a | PyObject *_res = NULL; |
|---|
| 2979 | n/a | OSStatus _err; |
|---|
| 2980 | n/a | OptionBits inOptions; |
|---|
| 2981 | n/a | MenuHandle outMenu; |
|---|
| 2982 | n/a | #ifndef CreateStandardWindowMenu |
|---|
| 2983 | n/a | PyMac_PRECHECK(CreateStandardWindowMenu); |
|---|
| 2984 | n/a | #endif |
|---|
| 2985 | n/a | if (!PyArg_ParseTuple(_args, "l", |
|---|
| 2986 | n/a | &inOptions)) |
|---|
| 2987 | n/a | return NULL; |
|---|
| 2988 | n/a | _err = CreateStandardWindowMenu(inOptions, |
|---|
| 2989 | n/a | &outMenu); |
|---|
| 2990 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 2991 | n/a | _res = Py_BuildValue("O&", |
|---|
| 2992 | n/a | MenuObj_New, outMenu); |
|---|
| 2993 | n/a | return _res; |
|---|
| 2994 | n/a | } |
|---|
| 2995 | n/a | |
|---|
| 2996 | n/a | static PyObject *Win_CollapseAllWindows(PyObject *_self, PyObject *_args) |
|---|
| 2997 | n/a | { |
|---|
| 2998 | n/a | PyObject *_res = NULL; |
|---|
| 2999 | n/a | OSStatus _err; |
|---|
| 3000 | n/a | Boolean collapse; |
|---|
| 3001 | n/a | #ifndef CollapseAllWindows |
|---|
| 3002 | n/a | PyMac_PRECHECK(CollapseAllWindows); |
|---|
| 3003 | n/a | #endif |
|---|
| 3004 | n/a | if (!PyArg_ParseTuple(_args, "b", |
|---|
| 3005 | n/a | &collapse)) |
|---|
| 3006 | n/a | return NULL; |
|---|
| 3007 | n/a | _err = CollapseAllWindows(collapse); |
|---|
| 3008 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 3009 | n/a | Py_INCREF(Py_None); |
|---|
| 3010 | n/a | _res = Py_None; |
|---|
| 3011 | n/a | return _res; |
|---|
| 3012 | n/a | } |
|---|
| 3013 | n/a | |
|---|
| 3014 | n/a | static PyObject *Win_GetAvailableWindowPositioningBounds(PyObject *_self, PyObject *_args) |
|---|
| 3015 | n/a | { |
|---|
| 3016 | n/a | PyObject *_res = NULL; |
|---|
| 3017 | n/a | OSStatus _err; |
|---|
| 3018 | n/a | GDHandle inDevice; |
|---|
| 3019 | n/a | Rect outAvailableRect; |
|---|
| 3020 | n/a | #ifndef GetAvailableWindowPositioningBounds |
|---|
| 3021 | n/a | PyMac_PRECHECK(GetAvailableWindowPositioningBounds); |
|---|
| 3022 | n/a | #endif |
|---|
| 3023 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 3024 | n/a | ResObj_Convert, &inDevice)) |
|---|
| 3025 | n/a | return NULL; |
|---|
| 3026 | n/a | _err = GetAvailableWindowPositioningBounds(inDevice, |
|---|
| 3027 | n/a | &outAvailableRect); |
|---|
| 3028 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 3029 | n/a | _res = Py_BuildValue("O&", |
|---|
| 3030 | n/a | PyMac_BuildRect, &outAvailableRect); |
|---|
| 3031 | n/a | return _res; |
|---|
| 3032 | n/a | } |
|---|
| 3033 | n/a | |
|---|
| 3034 | n/a | static PyObject *Win_DisableScreenUpdates(PyObject *_self, PyObject *_args) |
|---|
| 3035 | n/a | { |
|---|
| 3036 | n/a | PyObject *_res = NULL; |
|---|
| 3037 | n/a | OSStatus _err; |
|---|
| 3038 | n/a | #ifndef DisableScreenUpdates |
|---|
| 3039 | n/a | PyMac_PRECHECK(DisableScreenUpdates); |
|---|
| 3040 | n/a | #endif |
|---|
| 3041 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 3042 | n/a | return NULL; |
|---|
| 3043 | n/a | _err = DisableScreenUpdates(); |
|---|
| 3044 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 3045 | n/a | Py_INCREF(Py_None); |
|---|
| 3046 | n/a | _res = Py_None; |
|---|
| 3047 | n/a | return _res; |
|---|
| 3048 | n/a | } |
|---|
| 3049 | n/a | |
|---|
| 3050 | n/a | static PyObject *Win_EnableScreenUpdates(PyObject *_self, PyObject *_args) |
|---|
| 3051 | n/a | { |
|---|
| 3052 | n/a | PyObject *_res = NULL; |
|---|
| 3053 | n/a | OSStatus _err; |
|---|
| 3054 | n/a | #ifndef EnableScreenUpdates |
|---|
| 3055 | n/a | PyMac_PRECHECK(EnableScreenUpdates); |
|---|
| 3056 | n/a | #endif |
|---|
| 3057 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 3058 | n/a | return NULL; |
|---|
| 3059 | n/a | _err = EnableScreenUpdates(); |
|---|
| 3060 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 3061 | n/a | Py_INCREF(Py_None); |
|---|
| 3062 | n/a | _res = Py_None; |
|---|
| 3063 | n/a | return _res; |
|---|
| 3064 | n/a | } |
|---|
| 3065 | n/a | |
|---|
| 3066 | n/a | static PyObject *Win_PinRect(PyObject *_self, PyObject *_args) |
|---|
| 3067 | n/a | { |
|---|
| 3068 | n/a | PyObject *_res = NULL; |
|---|
| 3069 | n/a | long _rv; |
|---|
| 3070 | n/a | Rect theRect; |
|---|
| 3071 | n/a | Point thePt; |
|---|
| 3072 | n/a | #ifndef PinRect |
|---|
| 3073 | n/a | PyMac_PRECHECK(PinRect); |
|---|
| 3074 | n/a | #endif |
|---|
| 3075 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 3076 | n/a | PyMac_GetRect, &theRect, |
|---|
| 3077 | n/a | PyMac_GetPoint, &thePt)) |
|---|
| 3078 | n/a | return NULL; |
|---|
| 3079 | n/a | _rv = PinRect(&theRect, |
|---|
| 3080 | n/a | thePt); |
|---|
| 3081 | n/a | _res = Py_BuildValue("l", |
|---|
| 3082 | n/a | _rv); |
|---|
| 3083 | n/a | return _res; |
|---|
| 3084 | n/a | } |
|---|
| 3085 | n/a | |
|---|
| 3086 | n/a | static PyObject *Win_GetGrayRgn(PyObject *_self, PyObject *_args) |
|---|
| 3087 | n/a | { |
|---|
| 3088 | n/a | PyObject *_res = NULL; |
|---|
| 3089 | n/a | RgnHandle _rv; |
|---|
| 3090 | n/a | #ifndef GetGrayRgn |
|---|
| 3091 | n/a | PyMac_PRECHECK(GetGrayRgn); |
|---|
| 3092 | n/a | #endif |
|---|
| 3093 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 3094 | n/a | return NULL; |
|---|
| 3095 | n/a | _rv = GetGrayRgn(); |
|---|
| 3096 | n/a | _res = Py_BuildValue("O&", |
|---|
| 3097 | n/a | ResObj_New, _rv); |
|---|
| 3098 | n/a | return _res; |
|---|
| 3099 | n/a | } |
|---|
| 3100 | n/a | |
|---|
| 3101 | n/a | static PyObject *Win_GetWindowFromPort(PyObject *_self, PyObject *_args) |
|---|
| 3102 | n/a | { |
|---|
| 3103 | n/a | PyObject *_res = NULL; |
|---|
| 3104 | n/a | WindowPtr _rv; |
|---|
| 3105 | n/a | CGrafPtr port; |
|---|
| 3106 | n/a | #ifndef GetWindowFromPort |
|---|
| 3107 | n/a | PyMac_PRECHECK(GetWindowFromPort); |
|---|
| 3108 | n/a | #endif |
|---|
| 3109 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 3110 | n/a | GrafObj_Convert, &port)) |
|---|
| 3111 | n/a | return NULL; |
|---|
| 3112 | n/a | _rv = GetWindowFromPort(port); |
|---|
| 3113 | n/a | _res = Py_BuildValue("O&", |
|---|
| 3114 | n/a | WinObj_New, _rv); |
|---|
| 3115 | n/a | return _res; |
|---|
| 3116 | n/a | } |
|---|
| 3117 | n/a | |
|---|
| 3118 | n/a | static PyObject *Win_WhichWindow(PyObject *_self, PyObject *_args) |
|---|
| 3119 | n/a | { |
|---|
| 3120 | n/a | PyObject *_res = NULL; |
|---|
| 3121 | n/a | |
|---|
| 3122 | n/a | long ptr; |
|---|
| 3123 | n/a | |
|---|
| 3124 | n/a | if ( !PyArg_ParseTuple(_args, "i", &ptr) ) |
|---|
| 3125 | n/a | return NULL; |
|---|
| 3126 | n/a | _res = WinObj_WhichWindow((WindowPtr)ptr); |
|---|
| 3127 | n/a | return _res; |
|---|
| 3128 | n/a | |
|---|
| 3129 | n/a | } |
|---|
| 3130 | n/a | |
|---|
| 3131 | n/a | static PyObject *Win_FindWindow(PyObject *_self, PyObject *_args) |
|---|
| 3132 | n/a | { |
|---|
| 3133 | n/a | PyObject *_res = NULL; |
|---|
| 3134 | n/a | short _rv; |
|---|
| 3135 | n/a | Point thePoint; |
|---|
| 3136 | n/a | WindowPtr theWindow; |
|---|
| 3137 | n/a | #ifndef FindWindow |
|---|
| 3138 | n/a | PyMac_PRECHECK(FindWindow); |
|---|
| 3139 | n/a | #endif |
|---|
| 3140 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 3141 | n/a | PyMac_GetPoint, &thePoint)) |
|---|
| 3142 | n/a | return NULL; |
|---|
| 3143 | n/a | _rv = FindWindow(thePoint, |
|---|
| 3144 | n/a | &theWindow); |
|---|
| 3145 | n/a | _res = Py_BuildValue("hO&", |
|---|
| 3146 | n/a | _rv, |
|---|
| 3147 | n/a | WinObj_WhichWindow, theWindow); |
|---|
| 3148 | n/a | return _res; |
|---|
| 3149 | n/a | } |
|---|
| 3150 | n/a | #endif /* __LP64__ */ |
|---|
| 3151 | n/a | |
|---|
| 3152 | n/a | static PyMethodDef Win_methods[] = { |
|---|
| 3153 | n/a | #ifndef __LP64__ |
|---|
| 3154 | n/a | {"GetNewCWindow", (PyCFunction)Win_GetNewCWindow, 1, |
|---|
| 3155 | n/a | PyDoc_STR("(short windowID, WindowPtr behind) -> (WindowPtr _rv)")}, |
|---|
| 3156 | n/a | {"NewWindow", (PyCFunction)Win_NewWindow, 1, |
|---|
| 3157 | n/a | PyDoc_STR("(Rect boundsRect, Str255 title, Boolean visible, short theProc, WindowPtr behind, Boolean goAwayFlag, long refCon) -> (WindowPtr _rv)")}, |
|---|
| 3158 | n/a | {"GetNewWindow", (PyCFunction)Win_GetNewWindow, 1, |
|---|
| 3159 | n/a | PyDoc_STR("(short windowID, WindowPtr behind) -> (WindowPtr _rv)")}, |
|---|
| 3160 | n/a | {"NewCWindow", (PyCFunction)Win_NewCWindow, 1, |
|---|
| 3161 | n/a | PyDoc_STR("(Rect boundsRect, Str255 title, Boolean visible, short procID, WindowPtr behind, Boolean goAwayFlag, long refCon) -> (WindowPtr _rv)")}, |
|---|
| 3162 | n/a | {"CreateNewWindow", (PyCFunction)Win_CreateNewWindow, 1, |
|---|
| 3163 | n/a | PyDoc_STR("(WindowClass windowClass, WindowAttributes attributes, Rect contentBounds) -> (WindowPtr outWindow)")}, |
|---|
| 3164 | n/a | {"CreateWindowFromResource", (PyCFunction)Win_CreateWindowFromResource, 1, |
|---|
| 3165 | n/a | PyDoc_STR("(SInt16 resID) -> (WindowPtr outWindow)")}, |
|---|
| 3166 | n/a | {"ShowFloatingWindows", (PyCFunction)Win_ShowFloatingWindows, 1, |
|---|
| 3167 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 3168 | n/a | {"HideFloatingWindows", (PyCFunction)Win_HideFloatingWindows, 1, |
|---|
| 3169 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 3170 | n/a | {"AreFloatingWindowsVisible", (PyCFunction)Win_AreFloatingWindowsVisible, 1, |
|---|
| 3171 | n/a | PyDoc_STR("() -> (Boolean _rv)")}, |
|---|
| 3172 | n/a | {"CheckUpdate", (PyCFunction)Win_CheckUpdate, 1, |
|---|
| 3173 | n/a | PyDoc_STR("() -> (Boolean _rv, EventRecord theEvent)")}, |
|---|
| 3174 | n/a | {"MacFindWindow", (PyCFunction)Win_MacFindWindow, 1, |
|---|
| 3175 | n/a | PyDoc_STR("(Point thePoint) -> (WindowPartCode _rv, WindowPtr window)")}, |
|---|
| 3176 | n/a | {"FrontWindow", (PyCFunction)Win_FrontWindow, 1, |
|---|
| 3177 | n/a | PyDoc_STR("() -> (WindowPtr _rv)")}, |
|---|
| 3178 | n/a | {"FrontNonFloatingWindow", (PyCFunction)Win_FrontNonFloatingWindow, 1, |
|---|
| 3179 | n/a | PyDoc_STR("() -> (WindowPtr _rv)")}, |
|---|
| 3180 | n/a | {"GetFrontWindowOfClass", (PyCFunction)Win_GetFrontWindowOfClass, 1, |
|---|
| 3181 | n/a | PyDoc_STR("(WindowClass inWindowClass, Boolean mustBeVisible) -> (WindowPtr _rv)")}, |
|---|
| 3182 | n/a | {"FindWindowOfClass", (PyCFunction)Win_FindWindowOfClass, 1, |
|---|
| 3183 | n/a | PyDoc_STR("(Point where, WindowClass inWindowClass) -> (WindowPtr outWindow, WindowPartCode outWindowPart)")}, |
|---|
| 3184 | n/a | {"CreateStandardWindowMenu", (PyCFunction)Win_CreateStandardWindowMenu, 1, |
|---|
| 3185 | n/a | PyDoc_STR("(OptionBits inOptions) -> (MenuHandle outMenu)")}, |
|---|
| 3186 | n/a | {"CollapseAllWindows", (PyCFunction)Win_CollapseAllWindows, 1, |
|---|
| 3187 | n/a | PyDoc_STR("(Boolean collapse) -> None")}, |
|---|
| 3188 | n/a | {"GetAvailableWindowPositioningBounds", (PyCFunction)Win_GetAvailableWindowPositioningBounds, 1, |
|---|
| 3189 | n/a | PyDoc_STR("(GDHandle inDevice) -> (Rect outAvailableRect)")}, |
|---|
| 3190 | n/a | {"DisableScreenUpdates", (PyCFunction)Win_DisableScreenUpdates, 1, |
|---|
| 3191 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 3192 | n/a | {"EnableScreenUpdates", (PyCFunction)Win_EnableScreenUpdates, 1, |
|---|
| 3193 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 3194 | n/a | {"PinRect", (PyCFunction)Win_PinRect, 1, |
|---|
| 3195 | n/a | PyDoc_STR("(Rect theRect, Point thePt) -> (long _rv)")}, |
|---|
| 3196 | n/a | {"GetGrayRgn", (PyCFunction)Win_GetGrayRgn, 1, |
|---|
| 3197 | n/a | PyDoc_STR("() -> (RgnHandle _rv)")}, |
|---|
| 3198 | n/a | {"GetWindowFromPort", (PyCFunction)Win_GetWindowFromPort, 1, |
|---|
| 3199 | n/a | PyDoc_STR("(CGrafPtr port) -> (WindowPtr _rv)")}, |
|---|
| 3200 | n/a | {"WhichWindow", (PyCFunction)Win_WhichWindow, 1, |
|---|
| 3201 | n/a | PyDoc_STR("Resolve an integer WindowPtr address to a Window object")}, |
|---|
| 3202 | n/a | {"FindWindow", (PyCFunction)Win_FindWindow, 1, |
|---|
| 3203 | n/a | PyDoc_STR("(Point thePoint) -> (short _rv, WindowPtr theWindow)")}, |
|---|
| 3204 | n/a | {NULL, NULL, 0} |
|---|
| 3205 | n/a | #endif /* __LP64__ */ |
|---|
| 3206 | n/a | }; |
|---|
| 3207 | n/a | |
|---|
| 3208 | n/a | |
|---|
| 3209 | n/a | |
|---|
| 3210 | n/a | #ifndef __LP64__ |
|---|
| 3211 | n/a | /* Return the object corresponding to the window, or NULL */ |
|---|
| 3212 | n/a | |
|---|
| 3213 | n/a | PyObject * |
|---|
| 3214 | n/a | WinObj_WhichWindow(WindowPtr w) |
|---|
| 3215 | n/a | { |
|---|
| 3216 | n/a | PyObject *it; |
|---|
| 3217 | n/a | |
|---|
| 3218 | n/a | if (w == NULL) { |
|---|
| 3219 | n/a | it = Py_None; |
|---|
| 3220 | n/a | Py_INCREF(it); |
|---|
| 3221 | n/a | } else { |
|---|
| 3222 | n/a | it = (PyObject *) GetWRefCon(w); |
|---|
| 3223 | n/a | if (it == NULL || !IsPointerValid((Ptr)it) || ((WindowObject *)it)->ob_itself != w || !WinObj_Check(it)) { |
|---|
| 3224 | n/a | it = WinObj_New(w); |
|---|
| 3225 | n/a | ((WindowObject *)it)->ob_freeit = NULL; |
|---|
| 3226 | n/a | } else { |
|---|
| 3227 | n/a | Py_INCREF(it); |
|---|
| 3228 | n/a | } |
|---|
| 3229 | n/a | } |
|---|
| 3230 | n/a | return it; |
|---|
| 3231 | n/a | } |
|---|
| 3232 | n/a | |
|---|
| 3233 | n/a | #endif /* __LP64__ */ |
|---|
| 3234 | n/a | |
|---|
| 3235 | n/a | void init_Win(void) |
|---|
| 3236 | n/a | { |
|---|
| 3237 | n/a | PyObject *m; |
|---|
| 3238 | n/a | #ifndef __LP64__ |
|---|
| 3239 | n/a | PyObject *d; |
|---|
| 3240 | n/a | |
|---|
| 3241 | n/a | PyMac_INIT_TOOLBOX_OBJECT_NEW(WindowPtr, WinObj_New); |
|---|
| 3242 | n/a | PyMac_INIT_TOOLBOX_OBJECT_NEW(WindowPtr, WinObj_WhichWindow); |
|---|
| 3243 | n/a | PyMac_INIT_TOOLBOX_OBJECT_CONVERT(WindowPtr, WinObj_Convert); |
|---|
| 3244 | n/a | |
|---|
| 3245 | n/a | #endif /* __LP64__ */ |
|---|
| 3246 | n/a | |
|---|
| 3247 | n/a | m = Py_InitModule("_Win", Win_methods); |
|---|
| 3248 | n/a | #ifndef __LP64__ |
|---|
| 3249 | n/a | d = PyModule_GetDict(m); |
|---|
| 3250 | n/a | Win_Error = PyMac_GetOSErrException(); |
|---|
| 3251 | n/a | if (Win_Error == NULL || |
|---|
| 3252 | n/a | PyDict_SetItemString(d, "Error", Win_Error) != 0) |
|---|
| 3253 | n/a | return; |
|---|
| 3254 | n/a | Window_Type.ob_type = &PyType_Type; |
|---|
| 3255 | n/a | if (PyType_Ready(&Window_Type) < 0) return; |
|---|
| 3256 | n/a | Py_INCREF(&Window_Type); |
|---|
| 3257 | n/a | PyModule_AddObject(m, "Window", (PyObject *)&Window_Type); |
|---|
| 3258 | n/a | /* Backward-compatible name */ |
|---|
| 3259 | n/a | Py_INCREF(&Window_Type); |
|---|
| 3260 | n/a | PyModule_AddObject(m, "WindowType", (PyObject *)&Window_Type); |
|---|
| 3261 | n/a | #endif /* __LP64__ */ |
|---|
| 3262 | n/a | } |
|---|
| 3263 | n/a | |
|---|
| 3264 | n/a | /* ======================== End module _Win ========================= */ |
|---|
| 3265 | n/a | |
|---|