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