summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-01-09 22:10:16 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-01-09 22:10:16 (GMT)
commita9e3db354def12649afc4923fef431744ffbbab6 (patch)
tree2a7981e679d16184480a864fe9f6a0544cfd239b
parent0d202b740399241d332c21960611943a0789190a (diff)
downloadcpython-a9e3db354def12649afc4923fef431744ffbbab6.zip
cpython-a9e3db354def12649afc4923fef431744ffbbab6.tar.gz
cpython-a9e3db354def12649afc4923fef431744ffbbab6.tar.bz2
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:-(
-rw-r--r--Mac/Lib/lib-toolbox/ControlAccessor.py10
-rw-r--r--Mac/Modules/ctl/Ctlmodule.c22
-rw-r--r--Mac/Modules/ctl/ctlscan.py3
-rw-r--r--Mac/Modules/ctl/ctlsupport.py18
4 files changed, 27 insertions, 26 deletions
diff --git a/Mac/Lib/lib-toolbox/ControlAccessor.py b/Mac/Lib/lib-toolbox/ControlAccessor.py
index 94cc70e..2c064b6 100644
--- a/Mac/Lib/lib-toolbox/ControlAccessor.py
+++ b/Mac/Lib/lib-toolbox/ControlAccessor.py
@@ -4,14 +4,14 @@ from Controls import *
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 = {
diff --git a/Mac/Modules/ctl/Ctlmodule.c b/Mac/Modules/ctl/Ctlmodule.c
index c20e9b8..743a1f5 100644
--- a/Mac/Modules/ctl/Ctlmodule.c
+++ b/Mac/Modules/ctl/Ctlmodule.c
@@ -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,
- &bounds);
- _res = Py_BuildValue("O&O&",
- PyMac_BuildRect, &_rv,
+ GetControlBounds(_self->ob_itself,
+ &bounds);
+ _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
diff --git a/Mac/Modules/ctl/ctlscan.py b/Mac/Modules/ctl/ctlscan.py
index 3af28ca..1a502d6 100644
--- a/Mac/Modules/ctl/ctlscan.py
+++ b/Mac/Modules/ctl/ctlscan.py
@@ -162,6 +162,9 @@ class MyScanner(Scanner):
[("ExistingControlHandle", "*", "*")]),
([("ControlRef", "*", "OutMode")], # Ditto, for Universal Headers
[("ExistingControlHandle", "*", "*")]),
+
+ ([("Rect_ptr", "*", "ReturnMode")], # GetControlBounds
+ [("void", "*", "ReturnMode")]),
]
if __name__ == "__main__":
diff --git a/Mac/Modules/ctl/ctlsupport.py b/Mac/Modules/ctl/ctlsupport.py
index a49007c..8328697 100644
--- a/Mac/Modules/ctl/ctlsupport.py
+++ b/Mac/Modules/ctl/ctlsupport.py
@@ -501,8 +501,8 @@ f = ManualGenerator("GetControlData", getcontroldata_body);
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 @@ _res = Py_None;
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 @@ if (_err != noErr) {
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 @@ _res = Py_None;
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)