blob: 6ba024b8d2c8006ccafb8549862d2740e3a176ca [file] [log] [blame]
Just van Rossum7ec1c852001-12-13 21:24:37 +00001# FindControlUnderMouse() returns an existing control, not a new one,
2# so create this one by hand.
3f = Function(ExistingControlHandle, 'FindControlUnderMouse',
4 (Point, 'inWhere', InMode),
5 (WindowRef, 'inWindow', InMode),
6 (SInt16, 'outPart', OutMode),
7)
8functions.append(f)
9
Jack Jansene0581891999-02-07 14:02:03 +000010f = Function(ControlHandle, 'as_Control',
11 (Handle, 'h', InMode))
12functions.append(f)
13
Jack Jansena1a0fef1999-12-23 14:32:06 +000014f = Method(Handle, 'as_Resource', (ControlHandle, 'ctl', InMode))
Jack Jansen5d56f4b1995-06-18 20:16:33 +000015methods.append(f)
Jack Jansencfb60ee1996-10-01 10:46:46 +000016
Jack Jansen1a7d5b12000-03-21 16:25:23 +000017f = Method(void, 'GetControlRect', (ControlHandle, 'ctl', InMode), (Rect, 'rect', OutMode))
18methods.append(f)
19
Jack Jansencfb60ee1996-10-01 10:46:46 +000020DisposeControl_body = """
21 if (!PyArg_ParseTuple(_args, ""))
22 return NULL;
23 if ( _self->ob_itself ) {
Jack Jansena755e681997-09-20 17:40:22 +000024 SetControlReference(_self->ob_itself, (long)0); /* Make it forget about us */
Jack Jansencfb60ee1996-10-01 10:46:46 +000025 DisposeControl(_self->ob_itself);
26 _self->ob_itself = NULL;
27 }
28 Py_INCREF(Py_None);
29 _res = Py_None;
30 return _res;
31"""
32
33f = ManualGenerator("DisposeControl", DisposeControl_body)
34f.docstring = lambda : "() -> None"
35
36methods.append(f)
Just van Rossum7ec1c852001-12-13 21:24:37 +000037
38# All CreateXxxXxxControl() functions return a new object in an output
39# parameter; these should however be managed by us (we're creating them
40# after all), so set the type to ControlRef.
41for f in functions:
42 if f.name.startswith("Create"):
43 v = f.argumentList[-1]
44 if v.type == ExistingControlHandle:
45 v.type = ControlRef