ยปCore Development>Code coverage>Mac/Modules/ctl/ctledit.py

Python code coverage for Mac/Modules/ctl/ctledit.py

#countcontent
1n/a# FindControlUnderMouse() returns an existing control, not a new one,
2n/a# so create this one by hand.
3n/af = Function(ExistingControlHandle, 'FindControlUnderMouse',
4n/a (Point, 'inWhere', InMode),
5n/a (WindowRef, 'inWindow', InMode),
6n/a (SInt16, 'outPart', OutMode),
7n/a)
8n/afunctions.append(f)
9n/a
10n/af = Function(ControlHandle, 'as_Control',
11n/a (Handle, 'h', InMode))
12n/afunctions.append(f)
13n/a
14n/af = Method(Handle, 'as_Resource', (ControlHandle, 'ctl', InMode))
15n/amethods.append(f)
16n/a
17n/af = Method(void, 'GetControlRect', (ControlHandle, 'ctl', InMode), (Rect, 'rect', OutMode))
18n/amethods.append(f)
19n/a
20n/aDisposeControl_body = """
21n/a if (!PyArg_ParseTuple(_args, ""))
22n/a return NULL;
23n/a if ( _self->ob_itself ) {
24n/a SetControlReference(_self->ob_itself, (long)0); /* Make it forget about us */
25n/a DisposeControl(_self->ob_itself);
26n/a _self->ob_itself = NULL;
27n/a }
28n/a Py_INCREF(Py_None);
29n/a _res = Py_None;
30n/a return _res;
31n/a"""
32n/a
33n/af = ManualGenerator("DisposeControl", DisposeControl_body)
34n/af.docstring = lambda : "() -> None"
35n/a
36n/amethods.append(f)
37n/a
38n/a# All CreateXxxXxxControl() functions return a new object in an output
39n/a# parameter; these should however be managed by us (we're creating them
40n/a# after all), so set the type to ControlRef.
41n/afor f in functions:
42n/a if f.name.startswith("Create"):
43n/a v = f.argumentList[-1]
44n/a if v.type == ExistingControlHandle:
45n/a v.type = ControlRef