mirror of https://github.com/python/cpython.git
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:-(
This commit is contained in:
parent
0d202b7403
commit
a9e3db354d
|
@ -4,14 +4,14 @@
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
# These needn't go through this module, but are here for completeness
|
# These needn't go through this module, but are here for completeness
|
||||||
def SetControlDataHandle(control, part, selector, data):
|
def SetControlData_Handle(control, part, selector, data):
|
||||||
control.SetControlDataHandle(part, selector, data)
|
control.SetControlData_Handle(part, selector, data)
|
||||||
|
|
||||||
def GetControlDataHandle(control, part, selector):
|
def GetControlData_Handle(control, part, selector):
|
||||||
return control.GetControlDataHandle(part, selector)
|
return control.GetControlData_Handle(part, selector)
|
||||||
|
|
||||||
_accessdict = {
|
_accessdict = {
|
||||||
kControlPopupButtonMenuHandleTag: (SetControlDataHandle, GetControlDataHandle),
|
kControlPopupButtonMenuHandleTag: (SetControl_DataHandle, GetControlData_Handle),
|
||||||
}
|
}
|
||||||
|
|
||||||
_codingdict = {
|
_codingdict = {
|
||||||
|
|
|
@ -1277,14 +1277,12 @@ static PyObject *CtlObj_GetControlBounds(_self, _args)
|
||||||
PyObject *_args;
|
PyObject *_args;
|
||||||
{
|
{
|
||||||
PyObject *_res = NULL;
|
PyObject *_res = NULL;
|
||||||
Rect _rv;
|
|
||||||
Rect bounds;
|
Rect bounds;
|
||||||
if (!PyArg_ParseTuple(_args, ""))
|
if (!PyArg_ParseTuple(_args, ""))
|
||||||
return NULL;
|
return NULL;
|
||||||
_rv = GetControlBounds(_self->ob_itself,
|
GetControlBounds(_self->ob_itself,
|
||||||
&bounds);
|
&bounds);
|
||||||
_res = Py_BuildValue("O&O&",
|
_res = Py_BuildValue("O&",
|
||||||
PyMac_BuildRect, &_rv,
|
|
||||||
PyMac_BuildRect, &bounds);
|
PyMac_BuildRect, &bounds);
|
||||||
return _res;
|
return _res;
|
||||||
}
|
}
|
||||||
|
@ -1805,7 +1803,7 @@ static PyObject *CtlObj_GetControlData(_self, _args)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *CtlObj_SetControlDataHandle(_self, _args)
|
static PyObject *CtlObj_SetControlData_Handle(_self, _args)
|
||||||
ControlObject *_self;
|
ControlObject *_self;
|
||||||
PyObject *_args;
|
PyObject *_args;
|
||||||
{
|
{
|
||||||
|
@ -1835,7 +1833,7 @@ static PyObject *CtlObj_SetControlDataHandle(_self, _args)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *CtlObj_GetControlDataHandle(_self, _args)
|
static PyObject *CtlObj_GetControlData_Handle(_self, _args)
|
||||||
ControlObject *_self;
|
ControlObject *_self;
|
||||||
PyObject *_args;
|
PyObject *_args;
|
||||||
{
|
{
|
||||||
|
@ -1880,7 +1878,7 @@ static PyObject *CtlObj_GetControlDataHandle(_self, _args)
|
||||||
|
|
||||||
#if !TARGET_API_MAC_CARBON_NOTYET
|
#if !TARGET_API_MAC_CARBON_NOTYET
|
||||||
|
|
||||||
static PyObject *CtlObj_SetControlDataCallback(_self, _args)
|
static PyObject *CtlObj_SetControlData_Callback(_self, _args)
|
||||||
ControlObject *_self;
|
ControlObject *_self;
|
||||||
PyObject *_args;
|
PyObject *_args;
|
||||||
{
|
{
|
||||||
|
@ -2133,7 +2131,7 @@ static PyMethodDef CtlObj_methods[] = {
|
||||||
|
|
||||||
#if ACCESSOR_CALLS_ARE_FUNCTIONS
|
#if ACCESSOR_CALLS_ARE_FUNCTIONS
|
||||||
{"GetControlBounds", (PyCFunction)CtlObj_GetControlBounds, 1,
|
{"GetControlBounds", (PyCFunction)CtlObj_GetControlBounds, 1,
|
||||||
"() -> (Rect _rv, Rect bounds)"},
|
"() -> (Rect bounds)"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ACCESSOR_CALLS_ARE_FUNCTIONS
|
#if ACCESSOR_CALLS_ARE_FUNCTIONS
|
||||||
|
@ -2215,13 +2213,13 @@ static PyMethodDef CtlObj_methods[] = {
|
||||||
"(stuff) -> None"},
|
"(stuff) -> None"},
|
||||||
{"GetControlData", (PyCFunction)CtlObj_GetControlData, 1,
|
{"GetControlData", (PyCFunction)CtlObj_GetControlData, 1,
|
||||||
"(part, type) -> String"},
|
"(part, type) -> String"},
|
||||||
{"SetControlDataHandle", (PyCFunction)CtlObj_SetControlDataHandle, 1,
|
{"SetControlData_Handle", (PyCFunction)CtlObj_SetControlData_Handle, 1,
|
||||||
"(ResObj) -> None"},
|
"(ResObj) -> None"},
|
||||||
{"GetControlDataHandle", (PyCFunction)CtlObj_GetControlDataHandle, 1,
|
{"GetControlData_Handle", (PyCFunction)CtlObj_GetControlData_Handle, 1,
|
||||||
"(part, type) -> ResObj"},
|
"(part, type) -> ResObj"},
|
||||||
|
|
||||||
#if !TARGET_API_MAC_CARBON_NOTYET
|
#if !TARGET_API_MAC_CARBON_NOTYET
|
||||||
{"SetControlDataCallback", (PyCFunction)CtlObj_SetControlDataCallback, 1,
|
{"SetControlData_Callback", (PyCFunction)CtlObj_SetControlData_Callback, 1,
|
||||||
"(callbackfunc) -> None"},
|
"(callbackfunc) -> None"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -162,6 +162,9 @@ def makerepairinstructions(self):
|
||||||
[("ExistingControlHandle", "*", "*")]),
|
[("ExistingControlHandle", "*", "*")]),
|
||||||
([("ControlRef", "*", "OutMode")], # Ditto, for Universal Headers
|
([("ControlRef", "*", "OutMode")], # Ditto, for Universal Headers
|
||||||
[("ExistingControlHandle", "*", "*")]),
|
[("ExistingControlHandle", "*", "*")]),
|
||||||
|
|
||||||
|
([("Rect_ptr", "*", "ReturnMode")], # GetControlBounds
|
||||||
|
[("void", "*", "ReturnMode")]),
|
||||||
]
|
]
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
@ -501,8 +501,8 @@ def outputCleanupStructMembers(self):
|
||||||
f.docstring = lambda: "(part, type) -> String"
|
f.docstring = lambda: "(part, type) -> String"
|
||||||
object.add(f)
|
object.add(f)
|
||||||
|
|
||||||
# Manual Generator for SetControlDataHandle
|
# Manual Generator for SetControlData_Handle
|
||||||
setcontroldatahandle_body = """
|
setcontroldata_handle_body = """
|
||||||
OSErr _err;
|
OSErr _err;
|
||||||
ControlPartCode inPart;
|
ControlPartCode inPart;
|
||||||
ResType inTagName;
|
ResType inTagName;
|
||||||
|
@ -526,12 +526,12 @@ def outputCleanupStructMembers(self):
|
||||||
return _res;
|
return _res;
|
||||||
"""
|
"""
|
||||||
|
|
||||||
f = ManualGenerator("SetControlDataHandle", setcontroldatahandle_body);
|
f = ManualGenerator("SetControlData_Handle", setcontroldata_handle_body);
|
||||||
f.docstring = lambda: "(ResObj) -> None"
|
f.docstring = lambda: "(ResObj) -> None"
|
||||||
object.add(f)
|
object.add(f)
|
||||||
|
|
||||||
# Manual Generator for GetControlDataHandle
|
# Manual Generator for GetControlData_Handle
|
||||||
getcontroldatahandle_body = """
|
getcontroldata_handle_body = """
|
||||||
OSErr _err;
|
OSErr _err;
|
||||||
ControlPartCode inPart;
|
ControlPartCode inPart;
|
||||||
ResType inTagName;
|
ResType inTagName;
|
||||||
|
@ -568,12 +568,12 @@ def outputCleanupStructMembers(self):
|
||||||
return Py_BuildValue("O&", OptResObj_New, hdl);
|
return Py_BuildValue("O&", OptResObj_New, hdl);
|
||||||
"""
|
"""
|
||||||
|
|
||||||
f = ManualGenerator("GetControlDataHandle", getcontroldatahandle_body);
|
f = ManualGenerator("GetControlData_Handle", getcontroldata_handle_body);
|
||||||
f.docstring = lambda: "(part, type) -> ResObj"
|
f.docstring = lambda: "(part, type) -> ResObj"
|
||||||
object.add(f)
|
object.add(f)
|
||||||
|
|
||||||
# Manual Generator for SetControlDataCallback
|
# Manual Generator for SetControlData_Callback
|
||||||
setcontroldatacallback_body = """
|
setcontroldata_callback_body = """
|
||||||
OSErr _err;
|
OSErr _err;
|
||||||
ControlPartCode inPart;
|
ControlPartCode inPart;
|
||||||
ResType inTagName;
|
ResType inTagName;
|
||||||
|
@ -600,7 +600,7 @@ def outputCleanupStructMembers(self):
|
||||||
return _res;
|
return _res;
|
||||||
"""
|
"""
|
||||||
|
|
||||||
f = ManualGenerator("SetControlDataCallback", setcontroldatacallback_body, condition="#if !TARGET_API_MAC_CARBON_NOTYET");
|
f = ManualGenerator("SetControlData_Callback", setcontroldata_callback_body, condition="#if !TARGET_API_MAC_CARBON_NOTYET");
|
||||||
f.docstring = lambda: "(callbackfunc) -> None"
|
f.docstring = lambda: "(callbackfunc) -> None"
|
||||||
object.add(f)
|
object.add(f)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue