]> granicus.if.org Git - python/commitdiff
Carbon defines {Get,Set}ControlDataHandle, so unfortunately our variants on {Get...
authorJack Jansen <jack.jansen@cwi.nl>
Tue, 9 Jan 2001 22:10:16 +0000 (22:10 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Tue, 9 Jan 2001 22:10:16 +0000 (22:10 +0000)
Mac/Lib/lib-toolbox/ControlAccessor.py
Mac/Modules/ctl/Ctlmodule.c
Mac/Modules/ctl/ctlscan.py
Mac/Modules/ctl/ctlsupport.py

index 94cc70e9665a87e45417005da3f5ef2168e22e88..2c064b63e872d321d74d8ce2e9e518e5a3670f9f 100644 (file)
@@ -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 = {
index c20e9b86277a9949f858ffd7bacfb4f4e9aed483..743a1f5d9abc25f0714d2caa390310e83ad81903 100644 (file)
@@ -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
 
index 3af28ca6f4bbace0f13f02597a7d45dc2562e48d..1a502d6ea34eab33972b64405cf91cd442acedf6 100644 (file)
@@ -162,6 +162,9 @@ class MyScanner(Scanner):
                         [("ExistingControlHandle", "*", "*")]),
                        ([("ControlRef", "*", "OutMode")],      # Ditto, for Universal Headers
                         [("ExistingControlHandle", "*", "*")]),
+                        
+                       ([("Rect_ptr", "*", "ReturnMode")], # GetControlBounds
+                        [("void", "*", "ReturnMode")]),
                        ]
 
 if __name__ == "__main__":
index a49007c8335285a04067b657b4d9e6a746fed55f..83286972fcd991028d15f6b787fe828b2318011c 100644 (file)
@@ -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)