summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/dlg
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1995-06-06 12:55:40 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1995-06-06 12:55:40 (GMT)
commitae8a68f40cd56aa952520260970ebd5b9d3fb95c (patch)
treee1d470857f4a2fb83fe4fae48509f0babb93852c /Mac/Modules/dlg
parentc7cfb9555974e2e3789a629f1b7509eaa73ee2c6 (diff)
downloadcpython-ae8a68f40cd56aa952520260970ebd5b9d3fb95c.zip
cpython-ae8a68f40cd56aa952520260970ebd5b9d3fb95c.tar.gz
cpython-ae8a68f40cd56aa952520260970ebd5b9d3fb95c.tar.bz2
Trying again to check it in. Changes to:
- Use Universal Headers as input - Change addpack calls to not depend on Guido's disklayout - Checkge testprograms to use new names for some functions
Diffstat (limited to 'Mac/Modules/dlg')
-rw-r--r--Mac/Modules/dlg/Dlgmodule.c282
-rw-r--r--Mac/Modules/dlg/dlggen.py113
-rw-r--r--Mac/Modules/dlg/dlgscan.py8
-rw-r--r--Mac/Modules/dlg/dlgsupport.py5
4 files changed, 273 insertions, 135 deletions
diff --git a/Mac/Modules/dlg/Dlgmodule.c b/Mac/Modules/dlg/Dlgmodule.c
index b297e1c..f1010a2 100644
--- a/Mac/Modules/dlg/Dlgmodule.c
+++ b/Mac/Modules/dlg/Dlgmodule.c
@@ -172,7 +172,7 @@ static PyObject *DlgObj_UpdateDialog(_self, _args)
return _res;
}
-static PyObject *DlgObj_GetDItem(_self, _args)
+static PyObject *DlgObj_GetDialogItem(_self, _args)
DialogObject *_self;
PyObject *_args;
{
@@ -184,11 +184,11 @@ static PyObject *DlgObj_GetDItem(_self, _args)
if (!PyArg_ParseTuple(_args, "h",
&itemNo))
return NULL;
- GetDItem(_self->ob_itself,
- itemNo,
- &itemType,
- &item,
- &box);
+ GetDialogItem(_self->ob_itself,
+ itemNo,
+ &itemType,
+ &item,
+ &box);
_res = Py_BuildValue("hO&O&",
itemType,
ResObj_New, item,
@@ -196,7 +196,7 @@ static PyObject *DlgObj_GetDItem(_self, _args)
return _res;
}
-static PyObject *DlgObj_SetDItem(_self, _args)
+static PyObject *DlgObj_SetDialogItem(_self, _args)
DialogObject *_self;
PyObject *_args;
{
@@ -211,17 +211,17 @@ static PyObject *DlgObj_SetDItem(_self, _args)
ResObj_Convert, &item,
PyMac_GetRect, &box))
return NULL;
- SetDItem(_self->ob_itself,
- itemNo,
- itemType,
- item,
- &box);
+ SetDialogItem(_self->ob_itself,
+ itemNo,
+ itemType,
+ item,
+ &box);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
-static PyObject *DlgObj_HideDItem(_self, _args)
+static PyObject *DlgObj_HideDialogItem(_self, _args)
DialogObject *_self;
PyObject *_args;
{
@@ -230,14 +230,14 @@ static PyObject *DlgObj_HideDItem(_self, _args)
if (!PyArg_ParseTuple(_args, "h",
&itemNo))
return NULL;
- HideDItem(_self->ob_itself,
- itemNo);
+ HideDialogItem(_self->ob_itself,
+ itemNo);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
-static PyObject *DlgObj_ShowDItem(_self, _args)
+static PyObject *DlgObj_ShowDialogItem(_self, _args)
DialogObject *_self;
PyObject *_args;
{
@@ -246,14 +246,14 @@ static PyObject *DlgObj_ShowDItem(_self, _args)
if (!PyArg_ParseTuple(_args, "h",
&itemNo))
return NULL;
- ShowDItem(_self->ob_itself,
- itemNo);
+ ShowDialogItem(_self->ob_itself,
+ itemNo);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
-static PyObject *DlgObj_SelIText(_self, _args)
+static PyObject *DlgObj_SelectDialogItemText(_self, _args)
DialogObject *_self;
PyObject *_args;
{
@@ -266,16 +266,16 @@ static PyObject *DlgObj_SelIText(_self, _args)
&strtSel,
&endSel))
return NULL;
- SelIText(_self->ob_itself,
- itemNo,
- strtSel,
- endSel);
+ SelectDialogItemText(_self->ob_itself,
+ itemNo,
+ strtSel,
+ endSel);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
-static PyObject *DlgObj_FindDItem(_self, _args)
+static PyObject *DlgObj_FindDialogItem(_self, _args)
DialogObject *_self;
PyObject *_args;
{
@@ -285,60 +285,60 @@ static PyObject *DlgObj_FindDItem(_self, _args)
if (!PyArg_ParseTuple(_args, "O&",
PyMac_GetPoint, &thePt))
return NULL;
- _rv = FindDItem(_self->ob_itself,
- thePt);
+ _rv = FindDialogItem(_self->ob_itself,
+ thePt);
_res = Py_BuildValue("h",
_rv);
return _res;
}
-static PyObject *DlgObj_DlgCut(_self, _args)
+static PyObject *DlgObj_DialogCut(_self, _args)
DialogObject *_self;
PyObject *_args;
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
return NULL;
- DlgCut(_self->ob_itself);
+ DialogCut(_self->ob_itself);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
-static PyObject *DlgObj_DlgPaste(_self, _args)
+static PyObject *DlgObj_DialogPaste(_self, _args)
DialogObject *_self;
PyObject *_args;
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
return NULL;
- DlgPaste(_self->ob_itself);
+ DialogPaste(_self->ob_itself);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
-static PyObject *DlgObj_DlgCopy(_self, _args)
+static PyObject *DlgObj_DialogCopy(_self, _args)
DialogObject *_self;
PyObject *_args;
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
return NULL;
- DlgCopy(_self->ob_itself);
+ DialogCopy(_self->ob_itself);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
-static PyObject *DlgObj_DlgDelete(_self, _args)
+static PyObject *DlgObj_DialogDelete(_self, _args)
DialogObject *_self;
PyObject *_args;
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
return NULL;
- DlgDelete(_self->ob_itself);
+ DialogDelete(_self->ob_itself);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
@@ -393,30 +393,104 @@ static PyObject *DlgObj_ShortenDITL(_self, _args)
return _res;
}
+static PyObject *DlgObj_StdFilterProc(_self, _args)
+ DialogObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ Boolean _rv;
+ EventRecord event;
+ short itemHit;
+ if (!PyArg_ParseTuple(_args, ""))
+ return NULL;
+ _rv = StdFilterProc(_self->ob_itself,
+ &event,
+ &itemHit);
+ _res = Py_BuildValue("bO&h",
+ _rv,
+ PyMac_BuildEventRecord, &event,
+ itemHit);
+ return _res;
+}
+
+static PyObject *DlgObj_SetDialogDefaultItem(_self, _args)
+ DialogObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ OSErr _err;
+ short newItem;
+ if (!PyArg_ParseTuple(_args, "h",
+ &newItem))
+ return NULL;
+ _err = SetDialogDefaultItem(_self->ob_itself,
+ newItem);
+ if (_err != noErr) return PyMac_Error(_err);
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+}
+
+static PyObject *DlgObj_SetDialogCancelItem(_self, _args)
+ DialogObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ OSErr _err;
+ short newItem;
+ if (!PyArg_ParseTuple(_args, "h",
+ &newItem))
+ return NULL;
+ _err = SetDialogCancelItem(_self->ob_itself,
+ newItem);
+ if (_err != noErr) return PyMac_Error(_err);
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+}
+
+static PyObject *DlgObj_SetDialogTracksCursor(_self, _args)
+ DialogObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ OSErr _err;
+ Boolean tracks;
+ if (!PyArg_ParseTuple(_args, "b",
+ &tracks))
+ return NULL;
+ _err = SetDialogTracksCursor(_self->ob_itself,
+ tracks);
+ if (_err != noErr) return PyMac_Error(_err);
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+}
+
static PyMethodDef DlgObj_methods[] = {
{"DrawDialog", (PyCFunction)DlgObj_DrawDialog, 1,
"() -> None"},
{"UpdateDialog", (PyCFunction)DlgObj_UpdateDialog, 1,
"() -> None"},
- {"GetDItem", (PyCFunction)DlgObj_GetDItem, 1,
+ {"GetDialogItem", (PyCFunction)DlgObj_GetDialogItem, 1,
"(short itemNo) -> (short itemType, Handle item, Rect box)"},
- {"SetDItem", (PyCFunction)DlgObj_SetDItem, 1,
+ {"SetDialogItem", (PyCFunction)DlgObj_SetDialogItem, 1,
"(short itemNo, short itemType, Handle item, Rect box) -> None"},
- {"HideDItem", (PyCFunction)DlgObj_HideDItem, 1,
+ {"HideDialogItem", (PyCFunction)DlgObj_HideDialogItem, 1,
"(short itemNo) -> None"},
- {"ShowDItem", (PyCFunction)DlgObj_ShowDItem, 1,
+ {"ShowDialogItem", (PyCFunction)DlgObj_ShowDialogItem, 1,
"(short itemNo) -> None"},
- {"SelIText", (PyCFunction)DlgObj_SelIText, 1,
+ {"SelectDialogItemText", (PyCFunction)DlgObj_SelectDialogItemText, 1,
"(short itemNo, short strtSel, short endSel) -> None"},
- {"FindDItem", (PyCFunction)DlgObj_FindDItem, 1,
+ {"FindDialogItem", (PyCFunction)DlgObj_FindDialogItem, 1,
"(Point thePt) -> (short _rv)"},
- {"DlgCut", (PyCFunction)DlgObj_DlgCut, 1,
+ {"DialogCut", (PyCFunction)DlgObj_DialogCut, 1,
"() -> None"},
- {"DlgPaste", (PyCFunction)DlgObj_DlgPaste, 1,
+ {"DialogPaste", (PyCFunction)DlgObj_DialogPaste, 1,
"() -> None"},
- {"DlgCopy", (PyCFunction)DlgObj_DlgCopy, 1,
+ {"DialogCopy", (PyCFunction)DlgObj_DialogCopy, 1,
"() -> None"},
- {"DlgDelete", (PyCFunction)DlgObj_DlgDelete, 1,
+ {"DialogDelete", (PyCFunction)DlgObj_DialogDelete, 1,
"() -> None"},
{"AppendDITL", (PyCFunction)DlgObj_AppendDITL, 1,
"(Handle theHandle, DITLMethod method) -> None"},
@@ -424,6 +498,14 @@ static PyMethodDef DlgObj_methods[] = {
"() -> (short _rv)"},
{"ShortenDITL", (PyCFunction)DlgObj_ShortenDITL, 1,
"(short numberItems) -> None"},
+ {"StdFilterProc", (PyCFunction)DlgObj_StdFilterProc, 1,
+ "() -> (Boolean _rv, EventRecord event, short itemHit)"},
+ {"SetDialogDefaultItem", (PyCFunction)DlgObj_SetDialogDefaultItem, 1,
+ "(short newItem) -> None"},
+ {"SetDialogCancelItem", (PyCFunction)DlgObj_SetDialogCancelItem, 1,
+ "(short newItem) -> None"},
+ {"SetDialogTracksCursor", (PyCFunction)DlgObj_SetDialogTracksCursor, 1,
+ "(Boolean tracks) -> None"},
{NULL, NULL, 0}
};
@@ -541,12 +623,12 @@ static PyObject *Dlg_ModalDialog(_self, _args)
PyObject *_args;
{
PyObject *_res = NULL;
- PyObject* filterProc;
+ PyObject* modalFilter;
short itemHit;
if (!PyArg_ParseTuple(_args, "O",
- &filterProc))
+ &modalFilter))
return NULL;
- ModalDialog(NewModalFilterProc(Dlg_PassFilterProc(filterProc)),
+ ModalDialog(NewModalFilterProc(Dlg_PassFilterProc(modalFilter)),
&itemHit);
_res = Py_BuildValue("h",
itemHit);
@@ -598,13 +680,13 @@ static PyObject *Dlg_Alert(_self, _args)
PyObject *_res = NULL;
short _rv;
short alertID;
- PyObject* filterProc;
+ PyObject* modalFilter;
if (!PyArg_ParseTuple(_args, "hO",
&alertID,
- &filterProc))
+ &modalFilter))
return NULL;
_rv = Alert(alertID,
- NewModalFilterProc(Dlg_PassFilterProc(filterProc)));
+ NewModalFilterProc(Dlg_PassFilterProc(modalFilter)));
_res = Py_BuildValue("h",
_rv);
return _res;
@@ -617,13 +699,13 @@ static PyObject *Dlg_StopAlert(_self, _args)
PyObject *_res = NULL;
short _rv;
short alertID;
- PyObject* filterProc;
+ PyObject* modalFilter;
if (!PyArg_ParseTuple(_args, "hO",
&alertID,
- &filterProc))
+ &modalFilter))
return NULL;
_rv = StopAlert(alertID,
- NewModalFilterProc(Dlg_PassFilterProc(filterProc)));
+ NewModalFilterProc(Dlg_PassFilterProc(modalFilter)));
_res = Py_BuildValue("h",
_rv);
return _res;
@@ -636,13 +718,13 @@ static PyObject *Dlg_NoteAlert(_self, _args)
PyObject *_res = NULL;
short _rv;
short alertID;
- PyObject* filterProc;
+ PyObject* modalFilter;
if (!PyArg_ParseTuple(_args, "hO",
&alertID,
- &filterProc))
+ &modalFilter))
return NULL;
_rv = NoteAlert(alertID,
- NewModalFilterProc(Dlg_PassFilterProc(filterProc)));
+ NewModalFilterProc(Dlg_PassFilterProc(modalFilter)));
_res = Py_BuildValue("h",
_rv);
return _res;
@@ -655,19 +737,19 @@ static PyObject *Dlg_CautionAlert(_self, _args)
PyObject *_res = NULL;
short _rv;
short alertID;
- PyObject* filterProc;
+ PyObject* modalFilter;
if (!PyArg_ParseTuple(_args, "hO",
&alertID,
- &filterProc))
+ &modalFilter))
return NULL;
_rv = CautionAlert(alertID,
- NewModalFilterProc(Dlg_PassFilterProc(filterProc)));
+ NewModalFilterProc(Dlg_PassFilterProc(modalFilter)));
_res = Py_BuildValue("h",
_rv);
return _res;
}
-static PyObject *Dlg_GetIText(_self, _args)
+static PyObject *Dlg_GetDialogItemText(_self, _args)
PyObject *_self;
PyObject *_args;
{
@@ -677,14 +759,14 @@ static PyObject *Dlg_GetIText(_self, _args)
if (!PyArg_ParseTuple(_args, "O&",
ResObj_Convert, &item))
return NULL;
- GetIText(item,
- text);
+ GetDialogItemText(item,
+ text);
_res = Py_BuildValue("O&",
PyMac_BuildStr255, text);
return _res;
}
-static PyObject *Dlg_SetIText(_self, _args)
+static PyObject *Dlg_SetDialogItemText(_self, _args)
PyObject *_self;
PyObject *_args;
{
@@ -695,14 +777,14 @@ static PyObject *Dlg_SetIText(_self, _args)
ResObj_Convert, &item,
PyMac_GetStr255, text))
return NULL;
- SetIText(item,
- text);
+ SetDialogItemText(item,
+ text);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
-static PyObject *Dlg_NewCDialog(_self, _args)
+static PyObject *Dlg_NewColorDialog(_self, _args)
PyObject *_self;
PyObject *_args;
{
@@ -726,43 +808,57 @@ static PyObject *Dlg_NewCDialog(_self, _args)
&refCon,
ResObj_Convert, &items))
return NULL;
- _rv = NewCDialog((void *)0,
- &boundsRect,
- title,
- visible,
- procID,
- behind,
- goAwayFlag,
- refCon,
- items);
+ _rv = NewColorDialog((void *)0,
+ &boundsRect,
+ title,
+ visible,
+ procID,
+ behind,
+ goAwayFlag,
+ refCon,
+ items);
_res = Py_BuildValue("O&",
DlgObj_New, _rv);
return _res;
}
-static PyObject *Dlg_ResetAlrtStage(_self, _args)
+static PyObject *Dlg_GetAlertStage(_self, _args)
+ PyObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ short _rv;
+ if (!PyArg_ParseTuple(_args, ""))
+ return NULL;
+ _rv = GetAlertStage();
+ _res = Py_BuildValue("h",
+ _rv);
+ return _res;
+}
+
+static PyObject *Dlg_ResetAlertStage(_self, _args)
PyObject *_self;
PyObject *_args;
{
PyObject *_res = NULL;
if (!PyArg_ParseTuple(_args, ""))
return NULL;
- ResetAlrtStage();
+ ResetAlertStage();
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
-static PyObject *Dlg_SetDAFont(_self, _args)
+static PyObject *Dlg_SetDialogFont(_self, _args)
PyObject *_self;
PyObject *_args;
{
PyObject *_res = NULL;
- short fontNum;
+ short value;
if (!PyArg_ParseTuple(_args, "h",
- &fontNum))
+ &value))
return NULL;
- SetDAFont(fontNum);
+ SetDialogFont(value);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
@@ -776,29 +872,31 @@ static PyMethodDef Dlg_methods[] = {
{"ParamText", (PyCFunction)Dlg_ParamText, 1,
"(Str255 param0, Str255 param1, Str255 param2, Str255 param3) -> None"},
{"ModalDialog", (PyCFunction)Dlg_ModalDialog, 1,
- "(PyObject* filterProc) -> (short itemHit)"},
+ "(PyObject* modalFilter) -> (short itemHit)"},
{"IsDialogEvent", (PyCFunction)Dlg_IsDialogEvent, 1,
"(EventRecord theEvent) -> (Boolean _rv)"},
{"DialogSelect", (PyCFunction)Dlg_DialogSelect, 1,
"(EventRecord theEvent) -> (Boolean _rv, DialogPtr theDialog, short itemHit)"},
{"Alert", (PyCFunction)Dlg_Alert, 1,
- "(short alertID, PyObject* filterProc) -> (short _rv)"},
+ "(short alertID, PyObject* modalFilter) -> (short _rv)"},
{"StopAlert", (PyCFunction)Dlg_StopAlert, 1,
- "(short alertID, PyObject* filterProc) -> (short _rv)"},
+ "(short alertID, PyObject* modalFilter) -> (short _rv)"},
{"NoteAlert", (PyCFunction)Dlg_NoteAlert, 1,
- "(short alertID, PyObject* filterProc) -> (short _rv)"},
+ "(short alertID, PyObject* modalFilter) -> (short _rv)"},
{"CautionAlert", (PyCFunction)Dlg_CautionAlert, 1,
- "(short alertID, PyObject* filterProc) -> (short _rv)"},
- {"GetIText", (PyCFunction)Dlg_GetIText, 1,
+ "(short alertID, PyObject* modalFilter) -> (short _rv)"},
+ {"GetDialogItemText", (PyCFunction)Dlg_GetDialogItemText, 1,
"(Handle item) -> (Str255 text)"},
- {"SetIText", (PyCFunction)Dlg_SetIText, 1,
+ {"SetDialogItemText", (PyCFunction)Dlg_SetDialogItemText, 1,
"(Handle item, Str255 text) -> None"},
- {"NewCDialog", (PyCFunction)Dlg_NewCDialog, 1,
+ {"NewColorDialog", (PyCFunction)Dlg_NewColorDialog, 1,
"(Rect boundsRect, Str255 title, Boolean visible, short procID, WindowPtr behind, Boolean goAwayFlag, long refCon, Handle items) -> (DialogPtr _rv)"},
- {"ResetAlrtStage", (PyCFunction)Dlg_ResetAlrtStage, 1,
+ {"GetAlertStage", (PyCFunction)Dlg_GetAlertStage, 1,
+ "() -> (short _rv)"},
+ {"ResetAlertStage", (PyCFunction)Dlg_ResetAlertStage, 1,
"() -> None"},
- {"SetDAFont", (PyCFunction)Dlg_SetDAFont, 1,
- "(short fontNum) -> None"},
+ {"SetDialogFont", (PyCFunction)Dlg_SetDialogFont, 1,
+ "(short value) -> None"},
{NULL, NULL, 0}
};
diff --git a/Mac/Modules/dlg/dlggen.py b/Mac/Modules/dlg/dlggen.py
index bd65cd0..c6ae362 100644
--- a/Mac/Modules/dlg/dlggen.py
+++ b/Mac/Modules/dlg/dlggen.py
@@ -1,22 +1,22 @@
-# Generated from 'D:Development:THINK C:Mac #includes:Apple #includes:Dialogs.h'
+# Generated from 'Moes:CW5 GOLD \304:Metrowerks C/C++ \304:Headers \304:Universal Headers 2.0a3 \304:Dialogs.h'
-f = Function(DialogPtr, 'NewDialog',
+f = Function(DialogRef, 'NewDialog',
(NullStorage, 'wStorage', InMode),
(Rect_ptr, 'boundsRect', InMode),
(ConstStr255Param, 'title', InMode),
(Boolean, 'visible', InMode),
(short, 'procID', InMode),
- (WindowPtr, 'behind', InMode),
+ (WindowRef, 'behind', InMode),
(Boolean, 'goAwayFlag', InMode),
(long, 'refCon', InMode),
(Handle, 'itmLstHndl', InMode),
)
functions.append(f)
-f = Function(DialogPtr, 'GetNewDialog',
+f = Function(DialogRef, 'GetNewDialog',
(short, 'dialogID', InMode),
(NullStorage, 'dStorage', InMode),
- (WindowPtr, 'behind', InMode),
+ (WindowRef, 'behind', InMode),
)
functions.append(f)
@@ -29,7 +29,7 @@ f = Function(void, 'ParamText',
functions.append(f)
f = Function(void, 'ModalDialog',
- (ModalFilterProcPtr, 'filterProc', InMode),
+ (ModalFilterUPP, 'modalFilter', InMode),
(short, 'itemHit', OutMode),
)
functions.append(f)
@@ -47,42 +47,42 @@ f = Function(Boolean, 'DialogSelect',
functions.append(f)
f = Method(void, 'DrawDialog',
- (DialogPtr, 'theDialog', InMode),
+ (DialogRef, 'theDialog', InMode),
)
methods.append(f)
f = Method(void, 'UpdateDialog',
- (DialogPtr, 'theDialog', InMode),
+ (DialogRef, 'theDialog', InMode),
(RgnHandle, 'updateRgn', InMode),
)
methods.append(f)
f = Function(short, 'Alert',
(short, 'alertID', InMode),
- (ModalFilterProcPtr, 'filterProc', InMode),
+ (ModalFilterUPP, 'modalFilter', InMode),
)
functions.append(f)
f = Function(short, 'StopAlert',
(short, 'alertID', InMode),
- (ModalFilterProcPtr, 'filterProc', InMode),
+ (ModalFilterUPP, 'modalFilter', InMode),
)
functions.append(f)
f = Function(short, 'NoteAlert',
(short, 'alertID', InMode),
- (ModalFilterProcPtr, 'filterProc', InMode),
+ (ModalFilterUPP, 'modalFilter', InMode),
)
functions.append(f)
f = Function(short, 'CautionAlert',
(short, 'alertID', InMode),
- (ModalFilterProcPtr, 'filterProc', InMode),
+ (ModalFilterUPP, 'modalFilter', InMode),
)
functions.append(f)
-f = Method(void, 'GetDItem',
- (DialogPtr, 'theDialog', InMode),
+f = Method(void, 'GetDialogItem',
+ (DialogRef, 'theDialog', InMode),
(short, 'itemNo', InMode),
(short, 'itemType', OutMode),
(Handle, 'item', OutMode),
@@ -90,8 +90,8 @@ f = Method(void, 'GetDItem',
)
methods.append(f)
-f = Method(void, 'SetDItem',
- (DialogPtr, 'theDialog', InMode),
+f = Method(void, 'SetDialogItem',
+ (DialogRef, 'theDialog', InMode),
(short, 'itemNo', InMode),
(short, 'itemType', InMode),
(Handle, 'item', InMode),
@@ -99,101 +99,130 @@ f = Method(void, 'SetDItem',
)
methods.append(f)
-f = Method(void, 'HideDItem',
- (DialogPtr, 'theDialog', InMode),
+f = Method(void, 'HideDialogItem',
+ (DialogRef, 'theDialog', InMode),
(short, 'itemNo', InMode),
)
methods.append(f)
-f = Method(void, 'ShowDItem',
- (DialogPtr, 'theDialog', InMode),
+f = Method(void, 'ShowDialogItem',
+ (DialogRef, 'theDialog', InMode),
(short, 'itemNo', InMode),
)
methods.append(f)
-f = Method(void, 'SelIText',
- (DialogPtr, 'theDialog', InMode),
+f = Method(void, 'SelectDialogItemText',
+ (DialogRef, 'theDialog', InMode),
(short, 'itemNo', InMode),
(short, 'strtSel', InMode),
(short, 'endSel', InMode),
)
methods.append(f)
-f = Function(void, 'GetIText',
+f = Function(void, 'GetDialogItemText',
(Handle, 'item', InMode),
(Str255, 'text', OutMode),
)
functions.append(f)
-f = Function(void, 'SetIText',
+f = Function(void, 'SetDialogItemText',
(Handle, 'item', InMode),
(ConstStr255Param, 'text', InMode),
)
functions.append(f)
-f = Method(short, 'FindDItem',
- (DialogPtr, 'theDialog', InMode),
+f = Method(short, 'FindDialogItem',
+ (DialogRef, 'theDialog', InMode),
(Point, 'thePt', InMode),
)
methods.append(f)
-f = Function(DialogPtr, 'NewCDialog',
+f = Function(DialogRef, 'NewColorDialog',
(NullStorage, 'dStorage', InMode),
(Rect_ptr, 'boundsRect', InMode),
(ConstStr255Param, 'title', InMode),
(Boolean, 'visible', InMode),
(short, 'procID', InMode),
- (WindowPtr, 'behind', InMode),
+ (WindowRef, 'behind', InMode),
(Boolean, 'goAwayFlag', InMode),
(long, 'refCon', InMode),
(Handle, 'items', InMode),
)
functions.append(f)
-f = Function(void, 'ResetAlrtStage',
+f = Function(short, 'GetAlertStage',
)
functions.append(f)
-f = Method(void, 'DlgCut',
- (DialogPtr, 'theDialog', InMode),
+f = Function(void, 'ResetAlertStage',
+)
+functions.append(f)
+
+f = Method(void, 'DialogCut',
+ (DialogRef, 'theDialog', InMode),
)
methods.append(f)
-f = Method(void, 'DlgPaste',
- (DialogPtr, 'theDialog', InMode),
+f = Method(void, 'DialogPaste',
+ (DialogRef, 'theDialog', InMode),
)
methods.append(f)
-f = Method(void, 'DlgCopy',
- (DialogPtr, 'theDialog', InMode),
+f = Method(void, 'DialogCopy',
+ (DialogRef, 'theDialog', InMode),
)
methods.append(f)
-f = Method(void, 'DlgDelete',
- (DialogPtr, 'theDialog', InMode),
+f = Method(void, 'DialogDelete',
+ (DialogRef, 'theDialog', InMode),
)
methods.append(f)
-f = Function(void, 'SetDAFont',
- (short, 'fontNum', InMode),
+f = Function(void, 'SetDialogFont',
+ (short, 'value', InMode),
)
functions.append(f)
f = Method(void, 'AppendDITL',
- (DialogPtr, 'theDialog', InMode),
+ (DialogRef, 'theDialog', InMode),
(Handle, 'theHandle', InMode),
(DITLMethod, 'method', InMode),
)
methods.append(f)
f = Method(short, 'CountDITL',
- (DialogPtr, 'theDialog', InMode),
+ (DialogRef, 'theDialog', InMode),
)
methods.append(f)
f = Method(void, 'ShortenDITL',
- (DialogPtr, 'theDialog', InMode),
+ (DialogRef, 'theDialog', InMode),
(short, 'numberItems', InMode),
)
methods.append(f)
+f = Method(Boolean, 'StdFilterProc',
+ (DialogRef, 'theDialog', InMode),
+ (EventRecord, 'event', OutMode),
+ (short, 'itemHit', OutMode),
+)
+methods.append(f)
+
+f = Method(OSErr, 'SetDialogDefaultItem',
+ (DialogRef, 'theDialog', InMode),
+ (short, 'newItem', InMode),
+)
+methods.append(f)
+
+f = Method(OSErr, 'SetDialogCancelItem',
+ (DialogRef, 'theDialog', InMode),
+ (short, 'newItem', InMode),
+)
+methods.append(f)
+
+f = Method(OSErr, 'SetDialogTracksCursor',
+ (DialogRef, 'theDialog', InMode),
+ (Boolean, 'tracks', InMode),
+)
+methods.append(f)
+
diff --git a/Mac/Modules/dlg/dlgscan.py b/Mac/Modules/dlg/dlgscan.py
index d0cf144..6738828 100644
--- a/Mac/Modules/dlg/dlgscan.py
+++ b/Mac/Modules/dlg/dlgscan.py
@@ -1,5 +1,8 @@
# Scan an Apple header file, generating a Python file of generator calls.
+import addpack
+addpack.addpack(':Tools:bgen:bgen')
+
from scantools import Scanner
LONG = "Dialogs"
@@ -24,7 +27,7 @@ class MyScanner(Scanner):
listname = "functions"
if arglist:
t, n, m = arglist[0]
- if t == "DialogPtr" and m == "InMode":
+ if t in ("DialogPtr", "DialogRef") and m == "InMode":
classname = "Method"
listname = "methods"
return classname, listname
@@ -42,6 +45,7 @@ class MyScanner(Scanner):
'FreeAlert',
'CouldDialog',
'FreeDialog',
+ 'GetStdFilterProc',
]
def makeblacklisttypes(self):
@@ -66,6 +70,8 @@ class MyScanner(Scanner):
([("DialogPtr", "*", "OutMode")],
[("ExistingDialogPtr", "*", "*")]),
+ ([("DialogRef", "*", "OutMode")],
+ [("ExistingDialogPtr", "*", "*")]),
]
if __name__ == "__main__":
diff --git a/Mac/Modules/dlg/dlgsupport.py b/Mac/Modules/dlg/dlgsupport.py
index d3491fe..8761ea8 100644
--- a/Mac/Modules/dlg/dlgsupport.py
+++ b/Mac/Modules/dlg/dlgsupport.py
@@ -3,14 +3,19 @@
# It execs the file dlggen.py which contain the function definitions
# (dlggen.py was generated by dlgscan.py, scanning the <Dialogs.h> header file).
+import addpack
+addpack.addpack(':Tools:bgen:bgen')
+
from macsupport import *
# Create the type objects
DialogPtr = OpaqueByValueType("DialogPtr", "DlgObj")
+DialogRef = DialogPtr
ModalFilterProcPtr = InputOnlyType("PyObject*", "O")
ModalFilterProcPtr.passInput = lambda name: "NewModalFilterProc(Dlg_PassFilterProc(%s))" % name
+ModalFilterUPP = ModalFilterProcPtr
RgnHandle = FakeType("_self->ob_itself->visRgn") # XXX