Jack Jansen | 330f576 | 1995-11-14 10:48:54 +0000 | [diff] [blame] | 1 | # These are inline-routines/defines, so we do them "by hand" |
| 2 | # |
| 3 | |
Jack Jansen | 3224865 | 2000-12-19 22:23:06 +0000 | [diff] [blame] | 4 | f = Method(Boolean, 'IsWindowVisible', |
| 5 | (WindowRef, 'theWindow', InMode), |
| 6 | ) |
| 7 | methods.append(f) |
Jack Jansen | b7abb18 | 1995-11-15 15:18:47 +0000 | [diff] [blame] | 8 | |
Jack Jansen | 3224865 | 2000-12-19 22:23:06 +0000 | [diff] [blame] | 9 | f = Method(void, 'GetWindowStructureRgn', |
| 10 | (WindowRef, 'theWindow', InMode), |
| 11 | (RgnHandle, 'r', InMode), |
| 12 | ) |
| 13 | methods.append(f) |
Jack Jansen | 330f576 | 1995-11-14 10:48:54 +0000 | [diff] [blame] | 14 | |
Jack Jansen | 3224865 | 2000-12-19 22:23:06 +0000 | [diff] [blame] | 15 | f = Method(void, 'GetWindowContentRgn', |
| 16 | (WindowRef, 'theWindow', InMode), |
| 17 | (RgnHandle, 'r', InMode), |
| 18 | ) |
| 19 | methods.append(f) |
Jack Jansen | 330f576 | 1995-11-14 10:48:54 +0000 | [diff] [blame] | 20 | |
Jack Jansen | 3224865 | 2000-12-19 22:23:06 +0000 | [diff] [blame] | 21 | f = Method(void, 'GetWindowUpdateRgn', |
| 22 | (WindowRef, 'theWindow', InMode), |
| 23 | (RgnHandle, 'r', InMode), |
| 24 | ) |
| 25 | methods.append(f) |
Jack Jansen | 330f576 | 1995-11-14 10:48:54 +0000 | [diff] [blame] | 26 | |
Jack Jansen | 3224865 | 2000-12-19 22:23:06 +0000 | [diff] [blame] | 27 | f = Method(ExistingWindowPtr, 'GetNextWindow', |
| 28 | (WindowRef, 'theWindow', InMode), |
| 29 | ) |
| 30 | methods.append(f) |
Jack Jansen | 330f576 | 1995-11-14 10:48:54 +0000 | [diff] [blame] | 31 | |
Jack Jansen | e180d99 | 1998-04-24 10:28:20 +0000 | [diff] [blame] | 32 | f = Function(short, 'FindWindow', |
| 33 | (Point, 'thePoint', InMode), |
| 34 | (ExistingWindowPtr, 'theWindow', OutMode), |
| 35 | ) |
| 36 | functions.append(f) |
| 37 | |
| 38 | f = Method(void, 'MoveWindow', |
| 39 | (WindowPtr, 'theWindow', InMode), |
| 40 | (short, 'hGlobal', InMode), |
| 41 | (short, 'vGlobal', InMode), |
| 42 | (Boolean, 'front', InMode), |
| 43 | ) |
| 44 | methods.append(f) |
| 45 | |
| 46 | f = Method(void, 'ShowWindow', |
| 47 | (WindowPtr, 'theWindow', InMode), |
| 48 | ) |
| 49 | methods.append(f) |
| 50 | |
Jack Jansen | 8c46ce9 | 2003-04-22 13:55:23 +0000 | [diff] [blame^] | 51 | # |
| 52 | # A method to set the auto-dispose flag |
| 53 | # |
| 54 | AutoDispose_body = """ |
| 55 | int onoff, old = 0; |
| 56 | if (!PyArg_ParseTuple(_args, "i", &onoff)) |
| 57 | return NULL; |
| 58 | if ( _self->ob_freeit ) |
| 59 | old = 1; |
| 60 | if ( onoff ) |
| 61 | _self->ob_freeit = PyMac_AutoDisposeWindow; |
| 62 | else |
| 63 | _self->ob_freeit = NULL; |
| 64 | _res = Py_BuildValue("i", old); |
| 65 | return _res; |
| 66 | """ |
| 67 | f = ManualGenerator("AutoDispose", AutoDispose_body) |
| 68 | f.docstring = lambda: "(int)->int. Automatically DisposeHandle the object on Python object cleanup" |
| 69 | methods.append(f) |
Jack Jansen | e180d99 | 1998-04-24 10:28:20 +0000 | [diff] [blame] | 70 | |
| 71 | |