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