Skip to content

Commit a9e3db3

Browse files
committed
Carbon defines {Get,Set}ControlDataHandle, so unfortunately our variants on {Get,Set}ControlData have gotten an underscore: GetControlData_Handle, etc. This is an incompatible change:-(
1 parent 0d202b7 commit a9e3db3

4 files changed

Lines changed: 27 additions & 26 deletions

File tree

Mac/Lib/lib-toolbox/ControlAccessor.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
import struct
55

66
# These needn't go through this module, but are here for completeness
7-
def SetControlDataHandle(control, part, selector, data):
8-
control.SetControlDataHandle(part, selector, data)
7+
def SetControlData_Handle(control, part, selector, data):
8+
control.SetControlData_Handle(part, selector, data)
99

10-
def GetControlDataHandle(control, part, selector):
11-
return control.GetControlDataHandle(part, selector)
10+
def GetControlData_Handle(control, part, selector):
11+
return control.GetControlData_Handle(part, selector)
1212

1313
_accessdict = {
14-
kControlPopupButtonMenuHandleTag: (SetControlDataHandle, GetControlDataHandle),
14+
kControlPopupButtonMenuHandleTag: (SetControl_DataHandle, GetControlData_Handle),
1515
}
1616

1717
_codingdict = {

Mac/Modules/ctl/Ctlmodule.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,14 +1277,12 @@ static PyObject *CtlObj_GetControlBounds(_self, _args)
12771277
PyObject *_args;
12781278
{
12791279
PyObject *_res = NULL;
1280-
Rect _rv;
12811280
Rect bounds;
12821281
if (!PyArg_ParseTuple(_args, ""))
12831282
return NULL;
1284-
_rv = GetControlBounds(_self->ob_itself,
1285-
&bounds);
1286-
_res = Py_BuildValue("O&O&",
1287-
PyMac_BuildRect, &_rv,
1283+
GetControlBounds(_self->ob_itself,
1284+
&bounds);
1285+
_res = Py_BuildValue("O&",
12881286
PyMac_BuildRect, &bounds);
12891287
return _res;
12901288
}
@@ -1805,7 +1803,7 @@ static PyObject *CtlObj_GetControlData(_self, _args)
18051803

18061804
}
18071805

1808-
static PyObject *CtlObj_SetControlDataHandle(_self, _args)
1806+
static PyObject *CtlObj_SetControlData_Handle(_self, _args)
18091807
ControlObject *_self;
18101808
PyObject *_args;
18111809
{
@@ -1835,7 +1833,7 @@ static PyObject *CtlObj_SetControlDataHandle(_self, _args)
18351833

18361834
}
18371835

1838-
static PyObject *CtlObj_GetControlDataHandle(_self, _args)
1836+
static PyObject *CtlObj_GetControlData_Handle(_self, _args)
18391837
ControlObject *_self;
18401838
PyObject *_args;
18411839
{
@@ -1880,7 +1878,7 @@ static PyObject *CtlObj_GetControlDataHandle(_self, _args)
18801878

18811879
#if !TARGET_API_MAC_CARBON_NOTYET
18821880

1883-
static PyObject *CtlObj_SetControlDataCallback(_self, _args)
1881+
static PyObject *CtlObj_SetControlData_Callback(_self, _args)
18841882
ControlObject *_self;
18851883
PyObject *_args;
18861884
{
@@ -2133,7 +2131,7 @@ static PyMethodDef CtlObj_methods[] = {
21332131

21342132
#if ACCESSOR_CALLS_ARE_FUNCTIONS
21352133
{"GetControlBounds", (PyCFunction)CtlObj_GetControlBounds, 1,
2136-
"() -> (Rect _rv, Rect bounds)"},
2134+
"() -> (Rect bounds)"},
21372135
#endif
21382136

21392137
#if ACCESSOR_CALLS_ARE_FUNCTIONS
@@ -2215,13 +2213,13 @@ static PyMethodDef CtlObj_methods[] = {
22152213
"(stuff) -> None"},
22162214
{"GetControlData", (PyCFunction)CtlObj_GetControlData, 1,
22172215
"(part, type) -> String"},
2218-
{"SetControlDataHandle", (PyCFunction)CtlObj_SetControlDataHandle, 1,
2216+
{"SetControlData_Handle", (PyCFunction)CtlObj_SetControlData_Handle, 1,
22192217
"(ResObj) -> None"},
2220-
{"GetControlDataHandle", (PyCFunction)CtlObj_GetControlDataHandle, 1,
2218+
{"GetControlData_Handle", (PyCFunction)CtlObj_GetControlData_Handle, 1,
22212219
"(part, type) -> ResObj"},
22222220

22232221
#if !TARGET_API_MAC_CARBON_NOTYET
2224-
{"SetControlDataCallback", (PyCFunction)CtlObj_SetControlDataCallback, 1,
2222+
{"SetControlData_Callback", (PyCFunction)CtlObj_SetControlData_Callback, 1,
22252223
"(callbackfunc) -> None"},
22262224
#endif
22272225

Mac/Modules/ctl/ctlscan.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ def makerepairinstructions(self):
162162
[("ExistingControlHandle", "*", "*")]),
163163
([("ControlRef", "*", "OutMode")], # Ditto, for Universal Headers
164164
[("ExistingControlHandle", "*", "*")]),
165+
166+
([("Rect_ptr", "*", "ReturnMode")], # GetControlBounds
167+
[("void", "*", "ReturnMode")]),
165168
]
166169

167170
if __name__ == "__main__":

Mac/Modules/ctl/ctlsupport.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,8 @@ def outputCleanupStructMembers(self):
501501
f.docstring = lambda: "(part, type) -> String"
502502
object.add(f)
503503

504-
# Manual Generator for SetControlDataHandle
505-
setcontroldatahandle_body = """
504+
# Manual Generator for SetControlData_Handle
505+
setcontroldata_handle_body = """
506506
OSErr _err;
507507
ControlPartCode inPart;
508508
ResType inTagName;
@@ -526,12 +526,12 @@ def outputCleanupStructMembers(self):
526526
return _res;
527527
"""
528528

529-
f = ManualGenerator("SetControlDataHandle", setcontroldatahandle_body);
529+
f = ManualGenerator("SetControlData_Handle", setcontroldata_handle_body);
530530
f.docstring = lambda: "(ResObj) -> None"
531531
object.add(f)
532532

533-
# Manual Generator for GetControlDataHandle
534-
getcontroldatahandle_body = """
533+
# Manual Generator for GetControlData_Handle
534+
getcontroldata_handle_body = """
535535
OSErr _err;
536536
ControlPartCode inPart;
537537
ResType inTagName;
@@ -568,12 +568,12 @@ def outputCleanupStructMembers(self):
568568
return Py_BuildValue("O&", OptResObj_New, hdl);
569569
"""
570570

571-
f = ManualGenerator("GetControlDataHandle", getcontroldatahandle_body);
571+
f = ManualGenerator("GetControlData_Handle", getcontroldata_handle_body);
572572
f.docstring = lambda: "(part, type) -> ResObj"
573573
object.add(f)
574574

575-
# Manual Generator for SetControlDataCallback
576-
setcontroldatacallback_body = """
575+
# Manual Generator for SetControlData_Callback
576+
setcontroldata_callback_body = """
577577
OSErr _err;
578578
ControlPartCode inPart;
579579
ResType inTagName;
@@ -600,7 +600,7 @@ def outputCleanupStructMembers(self):
600600
return _res;
601601
"""
602602

603-
f = ManualGenerator("SetControlDataCallback", setcontroldatacallback_body, condition="#if !TARGET_API_MAC_CARBON_NOTYET");
603+
f = ManualGenerator("SetControlData_Callback", setcontroldata_callback_body, condition="#if !TARGET_API_MAC_CARBON_NOTYET");
604604
f.docstring = lambda: "(callbackfunc) -> None"
605605
object.add(f)
606606

0 commit comments

Comments
 (0)