blob: 01cfe86f3868f8fbc8e3af922954df5336a2f5ed [file] [log] [blame]
Jack Jansen330f5761995-11-14 10:48:54 +00001# These are inline-routines/defines, so we do them "by hand"
2#
3
Jack Jansen32248652000-12-19 22:23:06 +00004f = Method(Boolean, 'IsWindowVisible',
5 (WindowRef, 'theWindow', InMode),
6)
7methods.append(f)
Jack Jansenb7abb181995-11-15 15:18:47 +00008
Jack Jansen32248652000-12-19 22:23:06 +00009f = Method(void, 'GetWindowStructureRgn',
Tim Peters182b5ac2004-07-18 06:16:08 +000010 (WindowRef, 'theWindow', InMode),
11 (RgnHandle, 'r', InMode),
Jack Jansen32248652000-12-19 22:23:06 +000012)
13methods.append(f)
Jack Jansen330f5761995-11-14 10:48:54 +000014
Jack Jansen32248652000-12-19 22:23:06 +000015f = Method(void, 'GetWindowContentRgn',
Tim Peters182b5ac2004-07-18 06:16:08 +000016 (WindowRef, 'theWindow', InMode),
17 (RgnHandle, 'r', InMode),
Jack Jansen32248652000-12-19 22:23:06 +000018)
19methods.append(f)
Jack Jansen330f5761995-11-14 10:48:54 +000020
Jack Jansen32248652000-12-19 22:23:06 +000021f = Method(void, 'GetWindowUpdateRgn',
Tim Peters182b5ac2004-07-18 06:16:08 +000022 (WindowRef, 'theWindow', InMode),
23 (RgnHandle, 'r', InMode),
Jack Jansen32248652000-12-19 22:23:06 +000024)
25methods.append(f)
Jack Jansen330f5761995-11-14 10:48:54 +000026
Jack Jansen32248652000-12-19 22:23:06 +000027f = Method(ExistingWindowPtr, 'GetNextWindow',
Tim Peters182b5ac2004-07-18 06:16:08 +000028 (WindowRef, 'theWindow', InMode),
Jack Jansen32248652000-12-19 22:23:06 +000029)
30methods.append(f)
Jack Jansen330f5761995-11-14 10:48:54 +000031
Jack Jansene180d991998-04-24 10:28:20 +000032f = Function(short, 'FindWindow',
33 (Point, 'thePoint', InMode),
34 (ExistingWindowPtr, 'theWindow', OutMode),
35)
36functions.append(f)
37
38f = Method(void, 'MoveWindow',
39 (WindowPtr, 'theWindow', InMode),
40 (short, 'hGlobal', InMode),
41 (short, 'vGlobal', InMode),
42 (Boolean, 'front', InMode),
43)
44methods.append(f)
45
46f = Method(void, 'ShowWindow',
47 (WindowPtr, 'theWindow', InMode),
48)
49methods.append(f)
50
Jack Jansen8c46ce92003-04-22 13:55:23 +000051#
52# A method to set the auto-dispose flag
53#
54AutoDispose_body = """
55int onoff, old = 0;
56if (!PyArg_ParseTuple(_args, "i", &onoff))
Tim Peters182b5ac2004-07-18 06:16:08 +000057 return NULL;
Jack Jansen8c46ce92003-04-22 13:55:23 +000058if ( _self->ob_freeit )
Tim Peters182b5ac2004-07-18 06:16:08 +000059 old = 1;
Jack Jansen8c46ce92003-04-22 13:55:23 +000060if ( onoff )
Tim Peters182b5ac2004-07-18 06:16:08 +000061 _self->ob_freeit = PyMac_AutoDisposeWindow;
Jack Jansen8c46ce92003-04-22 13:55:23 +000062else
Tim Peters182b5ac2004-07-18 06:16:08 +000063 _self->ob_freeit = NULL;
Jack Jansen8c46ce92003-04-22 13:55:23 +000064_res = Py_BuildValue("i", old);
65return _res;
66"""
67f = ManualGenerator("AutoDispose", AutoDispose_body)
68f.docstring = lambda: "(int)->int. Automatically DisposeHandle the object on Python object cleanup"
69methods.append(f)