diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2000-12-12 22:10:21 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2000-12-12 22:10:21 (GMT) |
commit | 723ad8ae738e02a5b6f6f1d172cf297db1c11b26 (patch) | |
tree | 91ee498f2630c951058201fd7ede2bdb42409637 /Mac/Modules/ctl | |
parent | 8ed81303f68fe3be5b4afa77d1ffd03a066ba3dc (diff) | |
download | cpython-723ad8ae738e02a5b6f6f1d172cf297db1c11b26.zip cpython-723ad8ae738e02a5b6f6f1d172cf297db1c11b26.tar.gz cpython-723ad8ae738e02a5b6f6f1d172cf297db1c11b26.tar.bz2 |
More toolbox modules adapted to Universal Headers 3.3.2.
Diffstat (limited to 'Mac/Modules/ctl')
-rw-r--r-- | Mac/Modules/ctl/Ctlmodule.c | 57 | ||||
-rw-r--r-- | Mac/Modules/ctl/ctlscan.py | 5 | ||||
-rw-r--r-- | Mac/Modules/ctl/ctlsupport.py | 3 |
3 files changed, 63 insertions, 2 deletions
diff --git a/Mac/Modules/ctl/Ctlmodule.c b/Mac/Modules/ctl/Ctlmodule.c index cd45260..c20e9b8 100644 --- a/Mac/Modules/ctl/Ctlmodule.c +++ b/Mac/Modules/ctl/Ctlmodule.c @@ -1184,6 +1184,53 @@ static PyObject *CtlObj_GetControlDataSize(_self, _args) #if TARGET_API_MAC_CARBON +static PyObject *CtlObj_HandleControlDragTracking(_self, _args) + ControlObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + OSStatus _err; + DragTrackingMessage inMessage; + DragReference inDrag; + Boolean outLikesDrag; + if (!PyArg_ParseTuple(_args, "hO&", + &inMessage, + DragObj_Convert, &inDrag)) + return NULL; + _err = HandleControlDragTracking(_self->ob_itself, + inMessage, + inDrag, + &outLikesDrag); + if (_err != noErr) return PyMac_Error(_err); + _res = Py_BuildValue("b", + outLikesDrag); + return _res; +} +#endif + +#if TARGET_API_MAC_CARBON + +static PyObject *CtlObj_HandleControlDragReceive(_self, _args) + ControlObject *_self; + PyObject *_args; +{ + PyObject *_res = NULL; + OSStatus _err; + DragReference inDrag; + if (!PyArg_ParseTuple(_args, "O&", + DragObj_Convert, &inDrag)) + return NULL; + _err = HandleControlDragReceive(_self->ob_itself, + inDrag); + if (_err != noErr) return PyMac_Error(_err); + Py_INCREF(Py_None); + _res = Py_None; + return _res; +} +#endif + +#if TARGET_API_MAC_CARBON + static PyObject *CtlObj_SetControlDragTrackingEnabled(_self, _args) ControlObject *_self; PyObject *_args; @@ -2065,6 +2112,16 @@ static PyMethodDef CtlObj_methods[] = { "(ControlPartCode inPart, ResType inTagName) -> (Size outMaxSize)"}, #if TARGET_API_MAC_CARBON + {"HandleControlDragTracking", (PyCFunction)CtlObj_HandleControlDragTracking, 1, + "(DragTrackingMessage inMessage, DragReference inDrag) -> (Boolean outLikesDrag)"}, +#endif + +#if TARGET_API_MAC_CARBON + {"HandleControlDragReceive", (PyCFunction)CtlObj_HandleControlDragReceive, 1, + "(DragReference inDrag) -> None"}, +#endif + +#if TARGET_API_MAC_CARBON {"SetControlDragTrackingEnabled", (PyCFunction)CtlObj_SetControlDragTrackingEnabled, 1, "(Boolean tracks) -> None"}, #endif diff --git a/Mac/Modules/ctl/ctlscan.py b/Mac/Modules/ctl/ctlscan.py index 709fa10..3af28ca 100644 --- a/Mac/Modules/ctl/ctlscan.py +++ b/Mac/Modules/ctl/ctlscan.py @@ -35,6 +35,7 @@ class MyScanner(Scanner): self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n") self.defsfile.write("from TextEdit import *\n") self.defsfile.write("from QuickDraw import *\n") + self.defsfile.write("from Dragconst import *\n") self.defsfile.write("\n") def makeblacklistnames(self): @@ -98,6 +99,8 @@ class MyScanner(Scanner): ('#if TARGET_API_MAC_CARBON', [ 'IsAutomaticControlDragTrackingEnabledForWindow', 'SetAutomaticControlDragTrackingEnabledForWindow', + 'HandleControlDragReceive', + 'HandleControlDragTracking', 'GetControlByID', 'IsControlDragTrackingEnabled', 'SetControlDragTrackingEnabled', @@ -134,8 +137,6 @@ class MyScanner(Scanner): 'ControlDefSpec', # Don't know how to do this yet 'ControlDefSpec_ptr', # ditto 'Collection', # Ditto - 'DragTrackingMessage', # Needs Drag module, must implement later - 'DragReference', # ditto ] def makerepairinstructions(self): diff --git a/Mac/Modules/ctl/ctlsupport.py b/Mac/Modules/ctl/ctlsupport.py index ab2a999..a49007c 100644 --- a/Mac/Modules/ctl/ctlsupport.py +++ b/Mac/Modules/ctl/ctlsupport.py @@ -45,6 +45,9 @@ ControlFontStyleRec_ptr = ControlFontStyleRec ControlID = OpaqueType('ControlID', 'PyControlID') ControlID_ptr = ControlID +DragTrackingMessage = Type("DragTrackingMessage", "h") +DragReference = OpaqueByValueType("DragReference", "DragObj") + includestuff = includestuff + """ #include <%s>""" % MACHEADERFILE + """ #ifndef kControlCheckBoxUncheckedValue |