Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
06b80a2a
Commit
06b80a2a
authored
Dec 16, 1999
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow keyword arguments, and the dialog is now actually shown. No way to
get at the result yet, though:-)
parent
48aee8ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
29 deletions
+53
-29
Mac/Modules/Nav.c
Mac/Modules/Nav.c
+53
-29
No files found.
Mac/Modules/Nav.c
View file @
06b80a2a
...
@@ -49,17 +49,21 @@ filldialogoptions(PyObject *d,
...
@@ -49,17 +49,21 @@ filldialogoptions(PyObject *d,
NavEventUPP
*
eventProcP
,
NavEventUPP
*
eventProcP
,
NavPreviewUPP
*
previewProcP
,
NavPreviewUPP
*
previewProcP
,
NavObjectFilterUPP
*
filterProcP
,
NavObjectFilterUPP
*
filterProcP
,
NavTypeListHandle
*
typeListP
)
NavTypeListHandle
*
typeListP
,
OSType
*
creatorP
,
OSType
*
typeP
)
{
{
int
pos
=
0
;
int
pos
=
0
;
PyObject
*
key
,
*
value
;
PyObject
*
key
,
*
value
;
char
*
keystr
;
char
*
keystr
;
memset
(
opt
,
0
,
sizeof
(
opt
)
);
NavGetDefaultDialogOptions
(
opt
);
if
(
eventProcP
)
*
eventProcP
=
NULL
;
if
(
eventProcP
)
*
eventProcP
=
NULL
;
if
(
previewProcP
)
*
previewProcP
=
NULL
;
if
(
previewProcP
)
*
previewProcP
=
NULL
;
if
(
filterProcP
)
*
filterProcP
=
NULL
;
if
(
filterProcP
)
*
filterProcP
=
NULL
;
if
(
typeListP
)
*
typeListP
=
NULL
;
if
(
typeListP
)
*
typeListP
=
NULL
;
if
(
creatorP
)
*
creatorP
=
0
;
if
(
typeP
)
*
typeP
=
0
;
while
(
PyDict_Next
(
d
,
&
pos
,
&
key
,
&
value
)
)
{
while
(
PyDict_Next
(
d
,
&
pos
,
&
key
,
&
value
)
)
{
if
(
!
key
||
!
value
||
!
PyString_Check
(
key
)
)
{
if
(
!
key
||
!
value
||
!
PyString_Check
(
key
)
)
{
...
@@ -100,18 +104,24 @@ filldialogoptions(PyObject *d,
...
@@ -100,18 +104,24 @@ filldialogoptions(PyObject *d,
}
else
if
(
strcmp
(
keystr
,
"popupExtension"
)
==
0
)
{
}
else
if
(
strcmp
(
keystr
,
"popupExtension"
)
==
0
)
{
if
(
!
PyArg_Parse
(
value
,
"O&"
,
ResObj_Convert
,
&
opt
->
popupExtension
)
)
if
(
!
PyArg_Parse
(
value
,
"O&"
,
ResObj_Convert
,
&
opt
->
popupExtension
)
)
return
0
;
return
0
;
}
else
if
(
strcmp
(
keystr
,
"eventProc"
)
==
0
)
{
}
else
if
(
eventProcP
&&
strcmp
(
keystr
,
"eventProc"
)
==
0
)
{
PyErr_SetString
(
ErrorObject
,
"No callbacks implemented yet"
);
PyErr_SetString
(
ErrorObject
,
"No callbacks implemented yet"
);
return
0
;
return
0
;
}
else
if
(
strcmp
(
keystr
,
"previewProc"
)
==
0
)
{
}
else
if
(
previewProcP
&&
strcmp
(
keystr
,
"previewProc"
)
==
0
)
{
PyErr_SetString
(
ErrorObject
,
"No callbacks implemented yet"
);
PyErr_SetString
(
ErrorObject
,
"No callbacks implemented yet"
);
return
0
;
return
0
;
}
else
if
(
strcmp
(
keystr
,
"filterProc"
)
==
0
)
{
}
else
if
(
filterProcP
&&
strcmp
(
keystr
,
"filterProc"
)
==
0
)
{
PyErr_SetString
(
ErrorObject
,
"No callbacks implemented yet"
);
PyErr_SetString
(
ErrorObject
,
"No callbacks implemented yet"
);
return
0
;
return
0
;
}
else
if
(
strcmp
(
keystr
,
"typeList"
)
==
0
)
{
}
else
if
(
typeListP
&&
strcmp
(
keystr
,
"typeList"
)
==
0
)
{
if
(
!
PyArg_Parse
(
value
,
"O&"
,
ResObj_Convert
,
typeListP
)
)
if
(
!
PyArg_Parse
(
value
,
"O&"
,
ResObj_Convert
,
typeListP
)
)
return
0
;
return
0
;
}
else
if
(
creatorP
&&
strcmp
(
keystr
,
"creator"
)
==
0
)
{
if
(
!
PyArg_Parse
(
value
,
"O&"
,
PyMac_GetOSType
,
creatorP
)
)
return
0
;
}
else
if
(
typeP
&&
strcmp
(
keystr
,
"type"
)
==
0
)
{
if
(
!
PyArg_Parse
(
value
,
"O&"
,
PyMac_GetOSType
,
typeP
)
)
return
0
;
}
else
{
}
else
{
PyErr_Format
(
ErrorObject
,
"Unknown DialogOption key: %s"
,
keystr
);
PyErr_Format
(
ErrorObject
,
"Unknown DialogOption key: %s"
,
keystr
);
return
0
;
return
0
;
...
@@ -238,9 +248,10 @@ static char nav_NavGetFile__doc__[] =
...
@@ -238,9 +248,10 @@ static char nav_NavGetFile__doc__[] =
;
;
static
PyObject
*
static
PyObject
*
nav_NavGetFile
(
self
,
args
)
nav_NavGetFile
(
self
,
args
,
kw
)
PyObject
*
self
;
/* Not used */
PyObject
*
self
;
/* Not used */
PyObject
*
args
;
PyObject
*
args
;
PyObject
*
kw
;
{
{
PyObject
*
dict
;
PyObject
*
dict
;
AEDesc
*
defaultLocation
=
NULL
;
AEDesc
*
defaultLocation
=
NULL
;
...
@@ -252,14 +263,18 @@ nav_NavGetFile(self, args)
...
@@ -252,14 +263,18 @@ nav_NavGetFile(self, args)
NavTypeListHandle
typeList
=
NULL
;
NavTypeListHandle
typeList
=
NULL
;
OSErr
err
;
OSErr
err
;
if
(
!
PyArg_ParseTuple
(
args
,
"O!"
,
&
PyDict_Type
,
&
dict
))
if
(
kw
)
{
if
(
!
PyArg_ParseTuple
(
args
,
""
))
return
NULL
;
dict
=
kw
;
}
else
if
(
!
PyArg_ParseTuple
(
args
,
"O!"
,
&
PyDict_Type
,
&
dict
))
return
NULL
;
return
NULL
;
if
(
!
filldialogoptions
(
dict
,
&
dialogOptions
,
&
eventProc
,
&
previewProc
,
&
filterProc
,
&
typeList
))
if
(
!
filldialogoptions
(
dict
,
&
dialogOptions
,
&
eventProc
,
&
previewProc
,
&
filterProc
,
&
typeList
,
NULL
,
NULL
))
return
NULL
;
return
NULL
;
err
=
NavGetFile
(
defaultLocation
,
&
reply
,
&
dialogOptions
,
err
=
NavGetFile
(
defaultLocation
,
&
reply
,
&
dialogOptions
,
eventProc
,
previewProc
,
filterProc
,
typeList
,
(
void
*
)
dict
);
eventProc
,
previewProc
,
filterProc
,
typeList
,
(
void
*
)
dict
);
if
(
err
)
{
if
(
err
)
{
Py
Mac_StrError
(
err
);
Py
Err_Mac
(
ErrorObject
,
err
);
return
NULL
;
return
NULL
;
}
}
return
(
PyObject
*
)
newnavrrobject
(
&
reply
);
return
(
PyObject
*
)
newnavrrobject
(
&
reply
);
...
@@ -270,9 +285,10 @@ static char nav_NavPutFile__doc__[] =
...
@@ -270,9 +285,10 @@ static char nav_NavPutFile__doc__[] =
;
;
static
PyObject
*
static
PyObject
*
nav_NavPutFile
(
self
,
args
)
nav_NavPutFile
(
self
,
args
,
kw
)
PyObject
*
self
;
/* Not used */
PyObject
*
self
;
/* Not used */
PyObject
*
args
;
PyObject
*
args
;
PyObject
*
kw
;
{
{
if
(
!
PyArg_ParseTuple
(
args
,
""
))
if
(
!
PyArg_ParseTuple
(
args
,
""
))
...
@@ -286,9 +302,10 @@ static char nav_NavAskSaveChanges__doc__[] =
...
@@ -286,9 +302,10 @@ static char nav_NavAskSaveChanges__doc__[] =
;
;
static
PyObject
*
static
PyObject
*
nav_NavAskSaveChanges
(
self
,
args
)
nav_NavAskSaveChanges
(
self
,
args
,
kw
)
PyObject
*
self
;
/* Not used */
PyObject
*
self
;
/* Not used */
PyObject
*
args
;
PyObject
*
args
;
PyObject
*
kw
;
{
{
if
(
!
PyArg_ParseTuple
(
args
,
""
))
if
(
!
PyArg_ParseTuple
(
args
,
""
))
...
@@ -302,9 +319,10 @@ static char nav_NavCustomAskSaveChanges__doc__[] =
...
@@ -302,9 +319,10 @@ static char nav_NavCustomAskSaveChanges__doc__[] =
;
;
static
PyObject
*
static
PyObject
*
nav_NavCustomAskSaveChanges
(
self
,
args
)
nav_NavCustomAskSaveChanges
(
self
,
args
,
kw
)
PyObject
*
self
;
/* Not used */
PyObject
*
self
;
/* Not used */
PyObject
*
args
;
PyObject
*
args
;
PyObject
*
kw
;
{
{
if
(
!
PyArg_ParseTuple
(
args
,
""
))
if
(
!
PyArg_ParseTuple
(
args
,
""
))
...
@@ -318,9 +336,10 @@ static char nav_NavAskDiscardChanges__doc__[] =
...
@@ -318,9 +336,10 @@ static char nav_NavAskDiscardChanges__doc__[] =
;
;
static
PyObject
*
static
PyObject
*
nav_NavAskDiscardChanges
(
self
,
args
)
nav_NavAskDiscardChanges
(
self
,
args
,
kw
)
PyObject
*
self
;
/* Not used */
PyObject
*
self
;
/* Not used */
PyObject
*
args
;
PyObject
*
args
;
PyObject
*
kw
;
{
{
if
(
!
PyArg_ParseTuple
(
args
,
""
))
if
(
!
PyArg_ParseTuple
(
args
,
""
))
...
@@ -334,9 +353,10 @@ static char nav_NavChooseFile__doc__[] =
...
@@ -334,9 +353,10 @@ static char nav_NavChooseFile__doc__[] =
;
;
static
PyObject
*
static
PyObject
*
nav_NavChooseFile
(
self
,
args
)
nav_NavChooseFile
(
self
,
args
,
kw
)
PyObject
*
self
;
/* Not used */
PyObject
*
self
;
/* Not used */
PyObject
*
args
;
PyObject
*
args
;
PyObject
*
kw
;
{
{
if
(
!
PyArg_ParseTuple
(
args
,
""
))
if
(
!
PyArg_ParseTuple
(
args
,
""
))
...
@@ -350,9 +370,10 @@ static char nav_NavChooseFolder__doc__[] =
...
@@ -350,9 +370,10 @@ static char nav_NavChooseFolder__doc__[] =
;
;
static
PyObject
*
static
PyObject
*
nav_NavChooseFolder
(
self
,
args
)
nav_NavChooseFolder
(
self
,
args
,
kw
)
PyObject
*
self
;
/* Not used */
PyObject
*
self
;
/* Not used */
PyObject
*
args
;
PyObject
*
args
;
PyObject
*
kw
;
{
{
if
(
!
PyArg_ParseTuple
(
args
,
""
))
if
(
!
PyArg_ParseTuple
(
args
,
""
))
...
@@ -366,9 +387,10 @@ static char nav_NavChooseVolume__doc__[] =
...
@@ -366,9 +387,10 @@ static char nav_NavChooseVolume__doc__[] =
;
;
static
PyObject
*
static
PyObject
*
nav_NavChooseVolume
(
self
,
args
)
nav_NavChooseVolume
(
self
,
args
,
kw
)
PyObject
*
self
;
/* Not used */
PyObject
*
self
;
/* Not used */
PyObject
*
args
;
PyObject
*
args
;
PyObject
*
kw
;
{
{
if
(
!
PyArg_ParseTuple
(
args
,
""
))
if
(
!
PyArg_ParseTuple
(
args
,
""
))
...
@@ -382,9 +404,10 @@ static char nav_NavChooseObject__doc__[] =
...
@@ -382,9 +404,10 @@ static char nav_NavChooseObject__doc__[] =
;
;
static
PyObject
*
static
PyObject
*
nav_NavChooseObject
(
self
,
args
)
nav_NavChooseObject
(
self
,
args
,
kw
)
PyObject
*
self
;
/* Not used */
PyObject
*
self
;
/* Not used */
PyObject
*
args
;
PyObject
*
args
;
PyObject
*
kw
;
{
{
if
(
!
PyArg_ParseTuple
(
args
,
""
))
if
(
!
PyArg_ParseTuple
(
args
,
""
))
...
@@ -398,9 +421,10 @@ static char nav_NavNewFolder__doc__[] =
...
@@ -398,9 +421,10 @@ static char nav_NavNewFolder__doc__[] =
;
;
static
PyObject
*
static
PyObject
*
nav_NavNewFolder
(
self
,
args
)
nav_NavNewFolder
(
self
,
args
,
kw
)
PyObject
*
self
;
/* Not used */
PyObject
*
self
;
/* Not used */
PyObject
*
args
;
PyObject
*
args
;
PyObject
*
kw
;
{
{
if
(
!
PyArg_ParseTuple
(
args
,
""
))
if
(
!
PyArg_ParseTuple
(
args
,
""
))
...
@@ -563,16 +587,16 @@ nav_NavGetDefaultDialogOptions(self, args)
...
@@ -563,16 +587,16 @@ nav_NavGetDefaultDialogOptions(self, args)
/* List of methods defined in the module */
/* List of methods defined in the module */
static
struct
PyMethodDef
nav_methods
[]
=
{
static
struct
PyMethodDef
nav_methods
[]
=
{
{
"NavGetFile"
,
(
PyCFunction
)
nav_NavGetFile
,
METH_VARARGS
,
nav_NavGetFile__doc__
},
{
"NavGetFile"
,
(
PyCFunction
)
nav_NavGetFile
,
METH_VARARGS
|
METH_KEYWORDS
,
nav_NavGetFile__doc__
},
{
"NavPutFile"
,
(
PyCFunction
)
nav_NavPutFile
,
METH_VARARGS
,
nav_NavPutFile__doc__
},
{
"NavPutFile"
,
(
PyCFunction
)
nav_NavPutFile
,
METH_VARARGS
|
METH_KEYWORDS
,
nav_NavPutFile__doc__
},
{
"NavAskSaveChanges"
,
(
PyCFunction
)
nav_NavAskSaveChanges
,
METH_VARARGS
,
nav_NavAskSaveChanges__doc__
},
{
"NavAskSaveChanges"
,
(
PyCFunction
)
nav_NavAskSaveChanges
,
METH_VARARGS
|
METH_KEYWORDS
,
nav_NavAskSaveChanges__doc__
},
{
"NavCustomAskSaveChanges"
,
(
PyCFunction
)
nav_NavCustomAskSaveChanges
,
METH_VARARGS
,
nav_NavCustomAskSaveChanges__doc__
},
{
"NavCustomAskSaveChanges"
,
(
PyCFunction
)
nav_NavCustomAskSaveChanges
,
METH_VARARGS
|
METH_KEYWORDS
,
nav_NavCustomAskSaveChanges__doc__
},
{
"NavAskDiscardChanges"
,
(
PyCFunction
)
nav_NavAskDiscardChanges
,
METH_VARARGS
,
nav_NavAskDiscardChanges__doc__
},
{
"NavAskDiscardChanges"
,
(
PyCFunction
)
nav_NavAskDiscardChanges
,
METH_VARARGS
|
METH_KEYWORDS
,
nav_NavAskDiscardChanges__doc__
},
{
"NavChooseFile"
,
(
PyCFunction
)
nav_NavChooseFile
,
METH_VARARGS
,
nav_NavChooseFile__doc__
},
{
"NavChooseFile"
,
(
PyCFunction
)
nav_NavChooseFile
,
METH_VARARGS
|
METH_KEYWORDS
,
nav_NavChooseFile__doc__
},
{
"NavChooseFolder"
,
(
PyCFunction
)
nav_NavChooseFolder
,
METH_VARARGS
,
nav_NavChooseFolder__doc__
},
{
"NavChooseFolder"
,
(
PyCFunction
)
nav_NavChooseFolder
,
METH_VARARGS
|
METH_KEYWORDS
,
nav_NavChooseFolder__doc__
},
{
"NavChooseVolume"
,
(
PyCFunction
)
nav_NavChooseVolume
,
METH_VARARGS
,
nav_NavChooseVolume__doc__
},
{
"NavChooseVolume"
,
(
PyCFunction
)
nav_NavChooseVolume
,
METH_VARARGS
|
METH_KEYWORDS
,
nav_NavChooseVolume__doc__
},
{
"NavChooseObject"
,
(
PyCFunction
)
nav_NavChooseObject
,
METH_VARARGS
,
nav_NavChooseObject__doc__
},
{
"NavChooseObject"
,
(
PyCFunction
)
nav_NavChooseObject
,
METH_VARARGS
|
METH_KEYWORDS
,
nav_NavChooseObject__doc__
},
{
"NavNewFolder"
,
(
PyCFunction
)
nav_NavNewFolder
,
METH_VARARGS
,
nav_NavNewFolder__doc__
},
{
"NavNewFolder"
,
(
PyCFunction
)
nav_NavNewFolder
,
METH_VARARGS
|
METH_KEYWORDS
,
nav_NavNewFolder__doc__
},
{
"NavTranslateFile"
,
(
PyCFunction
)
nav_NavTranslateFile
,
METH_VARARGS
,
nav_NavTranslateFile__doc__
},
{
"NavTranslateFile"
,
(
PyCFunction
)
nav_NavTranslateFile
,
METH_VARARGS
,
nav_NavTranslateFile__doc__
},
{
"NavCompleteSave"
,
(
PyCFunction
)
nav_NavCompleteSave
,
METH_VARARGS
,
nav_NavCompleteSave__doc__
},
{
"NavCompleteSave"
,
(
PyCFunction
)
nav_NavCompleteSave
,
METH_VARARGS
,
nav_NavCompleteSave__doc__
},
{
"NavCustomControl"
,
(
PyCFunction
)
nav_NavCustomControl
,
METH_VARARGS
,
nav_NavCustomControl__doc__
},
{
"NavCustomControl"
,
(
PyCFunction
)
nav_NavCustomControl
,
METH_VARARGS
,
nav_NavCustomControl__doc__
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment