blob: d79356fc634de8bd4d88a8fd1d89973eda1fb70a [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',
10 (WindowRef, 'theWindow', InMode),
11 (RgnHandle, 'r', InMode),
12)
13methods.append(f)
Jack Jansen330f5761995-11-14 10:48:54 +000014
Jack Jansen32248652000-12-19 22:23:06 +000015f = Method(void, 'GetWindowContentRgn',
16 (WindowRef, 'theWindow', InMode),
17 (RgnHandle, 'r', InMode),
18)
19methods.append(f)
Jack Jansen330f5761995-11-14 10:48:54 +000020
Jack Jansen32248652000-12-19 22:23:06 +000021f = Method(void, 'GetWindowUpdateRgn',
22 (WindowRef, 'theWindow', InMode),
23 (RgnHandle, 'r', InMode),
24)
25methods.append(f)
Jack Jansen330f5761995-11-14 10:48:54 +000026
Jack Jansen32248652000-12-19 22:23:06 +000027f = Method(ExistingWindowPtr, 'GetNextWindow',
28 (WindowRef, 'theWindow', InMode),
29)
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))
57 return NULL;
58if ( _self->ob_freeit )
59 old = 1;
60if ( onoff )
61 _self->ob_freeit = PyMac_AutoDisposeWindow;
62else
63 _self->ob_freeit = NULL;
64_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)
Jack Jansene180d991998-04-24 10:28:20 +000070
71