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