• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# These are inline-routines/defines, so we do them "by hand"
2#
3
4f = Method(Boolean, 'IsWindowVisible',
5    (WindowRef, 'theWindow', InMode),
6)
7methods.append(f)
8
9f = Method(void, 'GetWindowStructureRgn',
10        (WindowRef, 'theWindow', InMode),
11        (RgnHandle, 'r', InMode),
12)
13methods.append(f)
14
15f = Method(void, 'GetWindowContentRgn',
16        (WindowRef, 'theWindow', InMode),
17        (RgnHandle, 'r', InMode),
18)
19methods.append(f)
20
21f = Method(void, 'GetWindowUpdateRgn',
22        (WindowRef, 'theWindow', InMode),
23        (RgnHandle, 'r', InMode),
24)
25methods.append(f)
26
27f = Method(ExistingWindowPtr, 'GetNextWindow',
28        (WindowRef, 'theWindow', InMode),
29)
30methods.append(f)
31
32f = 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
51#
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)
70