More toolbox modules adapted to Universal Headers 3.3.2.

This commit is contained in:
Jack Jansen 2000-12-12 22:10:21 +00:00
parent 8ed81303f6
commit 723ad8ae73
20 changed files with 2241 additions and 492 deletions

View file

@ -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;
@ -2064,6 +2111,16 @@ static PyMethodDef CtlObj_methods[] = {
{"GetControlDataSize", (PyCFunction)CtlObj_GetControlDataSize, 1,
"(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"},

View file

@ -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):

View file

@ -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