annotate Mac/Modules/Nav.c @ 65035:87f4b32905df 2.7

Cosmetic fix to use print function.
author Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
date Fri, 01 Oct 2010 10:48:47 +0000
parents fd25030223b0
children 15e3ad0ca364
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1 /***********************************************************
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2 Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3 The Netherlands.
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
5 All Rights Reserved
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
6
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
7 Permission to use, copy, modify, and distribute this software and its
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
8 documentation for any purpose and without fee is hereby granted,
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
9 provided that the above copyright notice appear in all copies and that
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
10 both that copyright notice and this permission notice appear in
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
11 supporting documentation, and that the names of Stichting Mathematisch
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
12 Centrum or CWI or Corporation for National Research Initiatives or
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
13 CNRI not be used in advertising or publicity pertaining to
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
14 distribution of the software without specific, written prior
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
15 permission.
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
16
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
17 While CWI is the initial source for this software, a modified version
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
18 is made available by the Corporation for National Research Initiatives
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
19 (CNRI) at the Internet address ftp://ftp.python.org.
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
20
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
21 STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
22 REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
23 MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
24 CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
25 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
26 PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
27 TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
28 PERFORMANCE OF THIS SOFTWARE.
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
29
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
30 ******************************************************************/
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
31
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
32 #include "Python.h"
13606
c9a4a1316170 pymactoolbox.h contains protoypes for all externally visible toolbox module
Jack Jansen <jack.jansen@cwi.nl>
parents: 12836
diff changeset
33 #include "pymactoolbox.h"
17923
a895d7d739ad Fixed changed UPP routines names. The module now compiles and loads.
Jack Jansen <jack.jansen@cwi.nl>
parents: 16057
diff changeset
34 #include <Carbon/Carbon.h>
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
35
56182
06ce27a82e99 Merged revisions 75017 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 47527
diff changeset
36 #ifndef __LP64__
06ce27a82e99 Merged revisions 75017 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 47527
diff changeset
37
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
38 static PyObject *ErrorObject;
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
39
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
40 static NavEventUPP my_eventProcUPP;
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
41 static NavPreviewUPP my_previewProcUPP;
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
42 static NavObjectFilterUPP my_filterProcUPP;
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
43
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
44 /* Callback functions */
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
45 static pascal void
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
46 my_eventProc(NavEventCallbackMessage callBackSelector,
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
47 NavCBRecPtr callBackParms,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
48 NavCallBackUserData callbackUD)
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
49 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
50 PyObject *dict = (PyObject *)callbackUD;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
51 PyObject *pyfunc;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
52 PyObject *rv;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
53
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
54 if (!dict) return;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
55 if ( (pyfunc = PyDict_GetItemString(dict, "eventProc")) == NULL ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
56 PyErr_Print();
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
57 return;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
58 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
59 if ( pyfunc == Py_None ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
60 return;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
61 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
62 rv = PyObject_CallFunction(pyfunc, "ls#", (long)callBackSelector,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
63 (void *)callBackParms, sizeof(NavCBRec));
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
64 if ( rv )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
65 Py_DECREF(rv);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
66 else {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
67 PySys_WriteStderr("Nav: exception in eventProc callback\n");
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
68 PyErr_Print();
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
69 }
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
70 }
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
71
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
72 static pascal Boolean
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
73 my_previewProc(NavCBRecPtr callBackParms,
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
74 NavCallBackUserData callbackUD)
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
75 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
76 PyObject *dict = (PyObject *)callbackUD;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
77 PyObject *pyfunc;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
78 PyObject *rv;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
79 Boolean c_rv = false;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
80
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
81 if (!dict) return false;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
82 if ( (pyfunc = PyDict_GetItemString(dict, "previewProc")) == NULL ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
83 PyErr_Print();
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
84 return false;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
85 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
86 rv = PyObject_CallFunction(pyfunc, "s#", (void *)callBackParms, sizeof(NavCBRec));
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
87 if ( rv ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
88 c_rv = PyObject_IsTrue(rv);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
89 Py_DECREF(rv);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
90 } else {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
91 PySys_WriteStderr("Nav: exception in previewProc callback\n");
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
92 PyErr_Print();
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
93 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
94 return c_rv;
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
95 }
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
96
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
97 static pascal Boolean
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
98 my_filterProc(AEDesc *theItem, void *info,
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
99 NavCallBackUserData callbackUD,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
100 NavFilterModes filterMode)
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
101 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
102 PyObject *dict = (PyObject *)callbackUD;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
103 PyObject *pyfunc;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
104 PyObject *rv;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
105 Boolean c_rv = false;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
106
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
107 if (!dict) return false;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
108 if ( (pyfunc = PyDict_GetItemString(dict, "filterProc")) == NULL ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
109 PyErr_Print();
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
110 return false;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
111 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
112 rv = PyObject_CallFunction(pyfunc, "O&s#h",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
113 AEDesc_NewBorrowed, theItem, info, sizeof(NavFileOrFolderInfo), (short)filterMode);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
114 if ( rv ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
115 c_rv = PyObject_IsTrue(rv);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
116 Py_DECREF(rv);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
117 } else {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
118 PySys_WriteStderr("Nav: exception in filterProc callback\n");
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
119 PyErr_Print();
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
120 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
121 return c_rv;
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
122 }
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
123
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
124 /* ----------------------------------------------------- */
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
125 static int
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
126 filldialogoptions(PyObject *d,
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
127 AEDesc **defaultLocationP,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
128 NavDialogOptions *opt,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
129 NavEventUPP *eventProcP,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
130 NavPreviewUPP *previewProcP,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
131 NavObjectFilterUPP *filterProcP,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
132 NavTypeListHandle *typeListP,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
133 OSType *fileTypeP,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
134 OSType *fileCreatorP)
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
135 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
136 Py_ssize_t pos = 0;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
137 PyObject *key, *value;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
138 char *keystr;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
139 AEDesc *defaultLocation_storage;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
140
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
141 NavGetDefaultDialogOptions(opt);
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
142
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
143 while ( PyDict_Next(d, &pos, &key, &value) ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
144 if ( !key || !value || !PyString_Check(key) ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
145 PyErr_SetString(ErrorObject, "DialogOption has non-string key");
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
146 return 0;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
147 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
148 keystr = PyString_AsString(key);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
149 if( strcmp(keystr, "defaultLocation") == 0 ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
150 if ( (defaultLocation_storage = PyMem_NEW(AEDesc, 1)) == NULL ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
151 PyErr_NoMemory();
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
152 return 0;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
153 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
154 if ( !PyArg_Parse(value, "O&", AEDesc_Convert, defaultLocation_storage) ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
155 PyMem_DEL(defaultLocation_storage);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
156 return 0;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
157 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
158 *defaultLocationP = defaultLocation_storage;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
159 } else if( strcmp(keystr, "version") == 0 ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
160 if ( !PyArg_Parse(value, "H", &opt->version) )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
161 return 0;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
162 } else if( strcmp(keystr, "dialogOptionFlags") == 0 ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
163 if ( !PyArg_Parse(value, "k", &opt->dialogOptionFlags) )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
164 return 0;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
165 } else if( strcmp(keystr, "location") == 0 ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
166 if ( !PyArg_Parse(value, "O&", PyMac_GetPoint, &opt->location) )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
167 return 0;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
168 } else if( strcmp(keystr, "clientName") == 0 ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
169 if ( !PyArg_Parse(value, "O&", PyMac_GetStr255, &opt->clientName) )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
170 return 0;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
171 } else if( strcmp(keystr, "windowTitle") == 0 ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
172 if ( !PyArg_Parse(value, "O&", PyMac_GetStr255, &opt->windowTitle) )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
173 return 0;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
174 } else if( strcmp(keystr, "actionButtonLabel") == 0 ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
175 if ( !PyArg_Parse(value, "O&", PyMac_GetStr255, &opt->actionButtonLabel) )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
176 return 0;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
177 } else if( strcmp(keystr, "cancelButtonLabel") == 0 ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
178 if ( !PyArg_Parse(value, "O&", PyMac_GetStr255, &opt->cancelButtonLabel) )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
179 return 0;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
180 } else if( strcmp(keystr, "savedFileName") == 0 ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
181 if ( !PyArg_Parse(value, "O&", PyMac_GetStr255, &opt->savedFileName) )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
182 return 0;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
183 } else if( strcmp(keystr, "message") == 0 ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
184 if ( !PyArg_Parse(value, "O&", PyMac_GetStr255, &opt->message) )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
185 return 0;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
186 } else if( strcmp(keystr, "preferenceKey") == 0 ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
187 if ( !PyArg_Parse(value, "O&", PyMac_GetOSType, &opt->preferenceKey) )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
188 return 0;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
189 } else if( strcmp(keystr, "popupExtension") == 0 ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
190 if ( !PyArg_Parse(value, "O&", ResObj_Convert, &opt->popupExtension) )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
191 return 0;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
192 } else if( eventProcP && strcmp(keystr, "eventProc") == 0 ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
193 *eventProcP = my_eventProcUPP;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
194 } else if( previewProcP && strcmp(keystr, "previewProc") == 0 ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
195 *previewProcP = my_previewProcUPP;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
196 } else if( filterProcP && strcmp(keystr, "filterProc") == 0 ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
197 *filterProcP = my_filterProcUPP;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
198 } else if( typeListP && strcmp(keystr, "typeList") == 0 ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
199 if ( !PyArg_Parse(value, "O&", ResObj_Convert, typeListP) )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
200 return 0;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
201 } else if( fileTypeP && strcmp(keystr, "fileType") == 0 ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
202 if ( !PyArg_Parse(value, "O&", PyMac_GetOSType, fileTypeP) )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
203 return 0;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
204 } else if( fileCreatorP && strcmp(keystr, "fileCreator") == 0 ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
205 if ( !PyArg_Parse(value, "O&", PyMac_GetOSType, fileCreatorP) )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
206 return 0;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
207 } else {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
208 PyErr_Format(ErrorObject, "Unknown DialogOption key: %s", keystr);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
209 return 0;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
210 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
211 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
212 return 1;
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
213 }
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
214
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
215 /* ----------------------------------------------------- */
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
216
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
217 /* Declarations for objects of type NavReplyRecord */
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
218
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
219 typedef struct {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
220 PyObject_HEAD
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
221 NavReplyRecord itself;
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
222 } navrrobject;
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
223
24280
1598a1e473e2 staticforward bites the dust.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23510
diff changeset
224 static PyTypeObject Navrrtype;
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
225
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
226
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
227
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
228 /* ---------------------------------------------------------------- */
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
229
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
230 static char nav_NavTranslateFile__doc__[] =
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
231 "(NavTranslationOptions)->None"
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
232 ;
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
233
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
234 static PyObject *
19709
0b0c84078f91 Added prototypes to silence gcc strict-prototype warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19648
diff changeset
235 nav_NavTranslateFile(navrrobject *self, PyObject *args)
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
236 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
237 NavTranslationOptions howToTranslate;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
238 OSErr err;
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
239
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
240 if (!PyArg_ParseTuple(args, "k", &howToTranslate))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
241 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
242 err = NavTranslateFile(&self->itself, howToTranslate);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
243 if ( err ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
244 PyErr_Mac(ErrorObject, err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
245 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
246 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
247 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
248 return Py_None;
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
249 }
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
250
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
251 static char nav_NavCompleteSave__doc__[] =
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
252 "(NavTranslationOptions)->None"
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
253 ;
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
254
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
255 static PyObject *
19709
0b0c84078f91 Added prototypes to silence gcc strict-prototype warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19648
diff changeset
256 nav_NavCompleteSave(navrrobject *self, PyObject *args)
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
257 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
258 NavTranslationOptions howToTranslate;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
259 OSErr err;
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
260
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
261 if (!PyArg_ParseTuple(args, "k", &howToTranslate))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
262 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
263 err = NavCompleteSave(&self->itself, howToTranslate);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
264 if ( err ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
265 PyErr_Mac(ErrorObject, err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
266 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
267 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
268 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
269 return Py_None;
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
270 }
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
271
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
272
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
273 static struct PyMethodDef navrr_methods[] = {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
274 {"NavTranslateFile", (PyCFunction)nav_NavTranslateFile, METH_VARARGS, nav_NavTranslateFile__doc__},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
275 {"NavCompleteSave", (PyCFunction)nav_NavCompleteSave, METH_VARARGS, nav_NavCompleteSave__doc__},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
276
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
277 {NULL, NULL} /* sentinel */
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
278 };
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
279
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
280 /* ---------- */
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
281
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
282
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
283 static navrrobject *
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
284 newnavrrobject(NavReplyRecord *itself)
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
285 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
286 navrrobject *self;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
287
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
288 self = PyObject_NEW(navrrobject, &Navrrtype);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
289 if (self == NULL)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
290 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
291 self->itself = *itself;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
292 return self;
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
293 }
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
294
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
295
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
296 static void
19709
0b0c84078f91 Added prototypes to silence gcc strict-prototype warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19648
diff changeset
297 navrr_dealloc(navrrobject *self)
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
298 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
299 NavDisposeReply(&self->itself);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
300 PyObject_DEL(self);
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
301 }
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
302
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
303 static PyObject *
19709
0b0c84078f91 Added prototypes to silence gcc strict-prototype warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19648
diff changeset
304 navrr_getattr(navrrobject *self, char *name)
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
305 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
306 FSRef fsr;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
307 FSSpec fss;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
308
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
309 if( strcmp(name, "__members__") == 0 )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
310 return Py_BuildValue(
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
311 "ssssssssss",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
312 "version", "validRecord", "replacing",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
313 "isStationery", "translationNeeded",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
314 "selection",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
315 "selection_fsr",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
316 "fileTranslation", "keyScript", "saveFileName");
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
317
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
318 if( strcmp(name, "version") == 0 )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
319 return Py_BuildValue("h", self->itself.version);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
320 if( strcmp(name, "validRecord") == 0 )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
321 return Py_BuildValue("l", (long)self->itself.validRecord);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
322 if( strcmp(name, "replacing") == 0 )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
323 return Py_BuildValue("l", (long)self->itself.replacing);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
324 if( strcmp(name, "isStationery") == 0 )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
325 return Py_BuildValue("l", (long)self->itself.isStationery);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
326 if( strcmp(name, "translationNeeded") == 0 )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
327 return Py_BuildValue("l", (long)self->itself.translationNeeded);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
328 if( strcmp(name, "selection") == 0 ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
329 SInt32 i;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
330 long count;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
331 OSErr err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
332 PyObject *rv, *rvitem;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
333 AEDesc desc;
47473
c34e34057714 MacOS X: Enable 4-way universal builds
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 47294
diff changeset
334
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
335 if ((err=AECountItems(&self->itself.selection, &count))) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
336 PyErr_Mac(ErrorObject, err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
337 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
338 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
339 if ( (rv=PyList_New(count)) == NULL )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
340 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
341 for(i=0; i<count; i++) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
342 desc.dataHandle = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
343 if ((err=AEGetNthDesc(&self->itself.selection, i+1, typeFSS, NULL, &desc))) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
344 Py_DECREF(rv);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
345 PyErr_Mac(ErrorObject, err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
346 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
347 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
348 if ((err=AEGetDescData(&desc, &fss, sizeof(FSSpec)))) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
349 Py_DECREF(rv);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
350 PyErr_Mac(ErrorObject, err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
351 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
352 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
353 rvitem = PyMac_BuildFSSpec(&fss);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
354 PyList_SetItem(rv, i, rvitem);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
355 AEDisposeDesc(&desc);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
356 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
357 return rv;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
358 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
359 if( strcmp(name, "selection_fsr") == 0 ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
360 SInt32 i;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
361 long count;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
362 OSErr err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
363 PyObject *rv, *rvitem;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
364 AEDesc desc;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
365
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
366 if ((err=AECountItems(&self->itself.selection, &count))) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
367 PyErr_Mac(ErrorObject, err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
368 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
369 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
370 if ( (rv=PyList_New(count)) == NULL )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
371 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
372 for(i=0; i<count; i++) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
373 desc.dataHandle = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
374 if ((err=AEGetNthDesc(&self->itself.selection, i+1, typeFSRef, NULL, &desc))) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
375 Py_DECREF(rv);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
376 PyErr_Mac(ErrorObject, err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
377 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
378 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
379 if ((err=AEGetDescData(&desc, &fsr, sizeof(FSRef)))) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
380 Py_DECREF(rv);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
381 PyErr_Mac(ErrorObject, err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
382 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
383 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
384 rvitem = PyMac_BuildFSRef(&fsr);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
385 PyList_SetItem(rv, i, rvitem);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
386 AEDisposeDesc(&desc);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
387 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
388 return rv;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
389 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
390 if( strcmp(name, "fileTranslation") == 0 )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
391 return ResObj_New((Handle)self->itself.fileTranslation);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
392 if( strcmp(name, "keyScript") == 0 )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
393 return Py_BuildValue("h", (short)self->itself.keyScript);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
394 if( strcmp(name, "saveFileName") == 0 )
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
395 return Py_BuildValue("O&", CFStringRefObj_New, self->itself.saveFileName);
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
396
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
397
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
398 return Py_FindMethod(navrr_methods, (PyObject *)self, name);
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
399 }
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
400
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
401 static int
19709
0b0c84078f91 Added prototypes to silence gcc strict-prototype warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19648
diff changeset
402 navrr_setattr(navrrobject *self, char *name, PyObject *v)
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
403 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
404 /* Set attribute 'name' to value 'v'. v==NULL means delete */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
405
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
406 /* XXXX Add your own setattr code here */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
407 return -1;
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
408 }
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
409
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
410 static char Navrrtype__doc__[] =
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
411 "Record containing result of a Nav file selection call. Use dir() for member names."
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
412 ;
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
413
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
414 static PyTypeObject Navrrtype = {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
415 PyObject_HEAD_INIT(&PyType_Type)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
416 0, /*ob_size*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
417 "Nav.NavReplyRecord", /*tp_name*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
418 sizeof(navrrobject), /*tp_basicsize*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
419 0, /*tp_itemsize*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
420 /* methods */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
421 (destructor)navrr_dealloc, /*tp_dealloc*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
422 (printfunc)0, /*tp_print*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
423 (getattrfunc)navrr_getattr, /*tp_getattr*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
424 (setattrfunc)navrr_setattr, /*tp_setattr*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
425 (cmpfunc)0, /*tp_compare*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
426 (reprfunc)0, /*tp_repr*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
427 0, /*tp_as_number*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
428 0, /*tp_as_sequence*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
429 0, /*tp_as_mapping*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
430 (hashfunc)0, /*tp_hash*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
431 (ternaryfunc)0, /*tp_call*/
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
432 (reprfunc)0, /*tp_str*/
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
433
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
434 /* Space for future expansion */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
435 0L,0L,0L,0L,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
436 Navrrtype__doc__ /* Documentation string */
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
437 };
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
438
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
439 /* End of code for NavReplyRecord objects */
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
440
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
441 /* ----------------------------------------------------- */
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
442
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
443 static char nav_NavGetFile__doc__[] =
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
444 "(DialogOptions dict or kwargs+defaultLocation,eventProc,previewProc,filterProc,typeList) -> NavReplyRecord"
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
445 ;
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
446
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
447 static PyObject *
19709
0b0c84078f91 Added prototypes to silence gcc strict-prototype warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19648
diff changeset
448 nav_NavGetFile(PyObject *self, PyObject *args, PyObject *kw)
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
449 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
450 PyObject *dict;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
451 AEDesc *defaultLocation = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
452 NavReplyRecord reply;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
453 NavDialogOptions dialogOptions;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
454 NavEventUPP eventProc = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
455 NavPreviewUPP previewProc = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
456 NavObjectFilterUPP filterProc = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
457 NavTypeListHandle typeList = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
458 OSErr err;
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
459
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
460 if ( kw && PyObject_IsTrue(kw) ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
461 if (!PyArg_ParseTuple(args, ";either keyword arguments or dictionary expected"))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
462 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
463 dict = kw;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
464 } else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
465 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
466 if (!filldialogoptions(dict, &defaultLocation, &dialogOptions, &eventProc, &previewProc, &filterProc, &typeList, NULL, NULL))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
467 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
468 err = NavGetFile(defaultLocation, &reply, &dialogOptions,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
469 eventProc, previewProc, filterProc, typeList, (void *)dict);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
470 PyMem_DEL(defaultLocation);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
471 if ( err ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
472 PyErr_Mac(ErrorObject, err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
473 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
474 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
475 return (PyObject *)newnavrrobject(&reply);
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
476 }
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
477
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
478 static char nav_NavPutFile__doc__[] =
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
479 "(DialogOptions dict or kwargs+defaultLocation,eventProc,fileCreator,fileType) -> NavReplyRecord"
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
480 ;
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
481
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
482 static PyObject *
19709
0b0c84078f91 Added prototypes to silence gcc strict-prototype warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19648
diff changeset
483 nav_NavPutFile(PyObject *self, PyObject *args, PyObject *kw)
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
484 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
485 PyObject *dict;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
486 AEDesc *defaultLocation = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
487 NavReplyRecord reply;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
488 NavDialogOptions dialogOptions;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
489 NavEventUPP eventProc = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
490 OSType fileType;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
491 OSType fileCreator;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
492 OSErr err;
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
493
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
494 if ( kw && PyObject_IsTrue(kw) ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
495 if (!PyArg_ParseTuple(args, ";either keyword arguments or dictionary expected"))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
496 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
497 dict = kw;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
498 } else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
499 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
500 if (!filldialogoptions(dict, &defaultLocation, &dialogOptions, &eventProc, NULL, NULL, NULL, &fileType, &fileCreator))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
501 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
502 err = NavPutFile(defaultLocation, &reply, &dialogOptions,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
503 eventProc, fileType, fileCreator, (void *)dict);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
504 PyMem_DEL(defaultLocation);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
505 if ( err ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
506 PyErr_Mac(ErrorObject, err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
507 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
508 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
509 return (PyObject *)newnavrrobject(&reply);
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
510 }
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
511
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
512 static char nav_NavAskSaveChanges__doc__[] =
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
513 "(NavAskSaveChangesAction, DialogOptions dict or kwargs+eventProc) -> NavAskSaveChangesResult"
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
514
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
515 ;
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
516
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
517 static PyObject *
19709
0b0c84078f91 Added prototypes to silence gcc strict-prototype warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19648
diff changeset
518 nav_NavAskSaveChanges(PyObject *self, PyObject *args, PyObject *kw)
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
519 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
520 PyObject *dict;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
521 NavDialogOptions dialogOptions;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
522 NavAskSaveChangesAction action;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
523 NavAskSaveChangesResult reply;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
524 NavEventUPP eventProc = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
525 OSErr err;
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
526
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
527 if ( kw && PyObject_IsTrue(kw) ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
528 if (!PyArg_ParseTuple(args, "k", &action))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
529 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
530 dict = kw;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
531 } else if (!PyArg_ParseTuple(args, "lO!", &action, &PyDict_Type, &dict))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
532 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
533 if (!filldialogoptions(dict, NULL, &dialogOptions, &eventProc, NULL, NULL, NULL, NULL, NULL))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
534 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
535 err = NavAskSaveChanges(&dialogOptions, action, &reply, eventProc, (void *)dict);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
536 if ( err ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
537 PyErr_Mac(ErrorObject, err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
538 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
539 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
540 return Py_BuildValue("l", (long)reply);
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
541 }
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
542
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
543 static char nav_NavCustomAskSaveChanges__doc__[] =
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
544 "(DialogOptions dict or kwargs+eventProc) -> NavAskSaveChangesResult"
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
545 ;
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
546
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
547 static PyObject *
19709
0b0c84078f91 Added prototypes to silence gcc strict-prototype warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19648
diff changeset
548 nav_NavCustomAskSaveChanges(PyObject *self, PyObject *args, PyObject *kw)
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
549 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
550 PyObject *dict;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
551 NavDialogOptions dialogOptions;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
552 NavAskSaveChangesResult reply;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
553 NavEventUPP eventProc = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
554 OSErr err;
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
555
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
556 if ( kw && PyObject_IsTrue(kw) ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
557 if (!PyArg_ParseTuple(args, ";either keyword arguments or dictionary expected"))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
558 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
559 dict = kw;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
560 } else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
561 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
562 if (!filldialogoptions(dict, NULL, &dialogOptions, &eventProc, NULL, NULL, NULL, NULL, NULL))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
563 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
564 err = NavCustomAskSaveChanges(&dialogOptions, &reply, eventProc, (void *)dict);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
565 if ( err ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
566 PyErr_Mac(ErrorObject, err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
567 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
568 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
569 return Py_BuildValue("l", (long)reply);
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
570 }
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
571
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
572 static char nav_NavAskDiscardChanges__doc__[] =
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
573 "(DialogOptions dict or kwargs+eventProc) -> NavAskSaveChangesResult"
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
574 ;
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
575
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
576 static PyObject *
19709
0b0c84078f91 Added prototypes to silence gcc strict-prototype warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19648
diff changeset
577 nav_NavAskDiscardChanges(PyObject *self, PyObject *args, PyObject *kw)
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
578 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
579 PyObject *dict;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
580 NavDialogOptions dialogOptions;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
581 NavAskSaveChangesResult reply;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
582 NavEventUPP eventProc = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
583 OSErr err;
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
584
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
585 if ( kw && PyObject_IsTrue(kw) ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
586 if (!PyArg_ParseTuple(args, ";either keyword arguments or dictionary expected"))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
587 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
588 dict = kw;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
589 } else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
590 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
591 if (!filldialogoptions(dict, NULL, &dialogOptions, &eventProc, NULL, NULL, NULL, NULL, NULL))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
592 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
593 err = NavAskDiscardChanges(&dialogOptions, &reply, eventProc, (void *)dict);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
594 if ( err ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
595 PyErr_Mac(ErrorObject, err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
596 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
597 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
598 return Py_BuildValue("l", (long)reply);
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
599 }
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
600
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
601 static char nav_NavChooseFile__doc__[] =
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
602 "(DialogOptions dict or kwargs+defaultLocation,eventProc,previewProc,filterProc,typeList) -> NavReplyRecord"
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
603 ;
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
604
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
605 static PyObject *
19709
0b0c84078f91 Added prototypes to silence gcc strict-prototype warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19648
diff changeset
606 nav_NavChooseFile(PyObject *self, PyObject *args, PyObject *kw)
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
607 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
608 PyObject *dict;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
609 AEDesc *defaultLocation = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
610 NavReplyRecord reply;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
611 NavDialogOptions dialogOptions;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
612 NavEventUPP eventProc = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
613 NavPreviewUPP previewProc = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
614 NavObjectFilterUPP filterProc = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
615 NavTypeListHandle typeList = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
616 OSErr err;
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
617
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
618 if ( kw && PyObject_IsTrue(kw) ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
619 if (!PyArg_ParseTuple(args, ";either keyword arguments or dictionary expected"))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
620 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
621 dict = kw;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
622 } else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
623 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
624 if (!filldialogoptions(dict, &defaultLocation, &dialogOptions, &eventProc, &previewProc, &filterProc, &typeList, NULL, NULL))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
625 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
626 err = NavChooseFile(defaultLocation, &reply, &dialogOptions,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
627 eventProc, previewProc, filterProc, typeList, (void *)dict);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
628 PyMem_DEL(defaultLocation);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
629 if ( err ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
630 PyErr_Mac(ErrorObject, err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
631 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
632 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
633 return (PyObject *)newnavrrobject(&reply);
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
634 }
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
635
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
636 static char nav_NavChooseFolder__doc__[] =
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
637 "(DialogOptions dict or kwargs+defaultLocation,eventProc,filterProc) -> NavReplyRecord"
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
638 ;
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
639
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
640 static PyObject *
19709
0b0c84078f91 Added prototypes to silence gcc strict-prototype warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19648
diff changeset
641 nav_NavChooseFolder(PyObject *self, PyObject *args, PyObject *kw)
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
642 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
643 PyObject *dict;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
644 AEDesc *defaultLocation = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
645 NavReplyRecord reply;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
646 NavDialogOptions dialogOptions;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
647 NavEventUPP eventProc = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
648 NavObjectFilterUPP filterProc = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
649 OSErr err;
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
650
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
651 if ( kw && PyObject_IsTrue(kw) ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
652 if (!PyArg_ParseTuple(args, ";either keyword arguments or dictionary expected"))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
653 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
654 dict = kw;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
655 } else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
656 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
657 if (!filldialogoptions(dict, &defaultLocation, &dialogOptions, &eventProc, NULL, &filterProc, NULL, NULL, NULL))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
658 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
659 err = NavChooseFolder(defaultLocation, &reply, &dialogOptions,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
660 eventProc, filterProc, (void *)dict);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
661 PyMem_DEL(defaultLocation);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
662 if ( err ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
663 PyErr_Mac(ErrorObject, err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
664 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
665 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
666 return (PyObject *)newnavrrobject(&reply);
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
667 }
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
668
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
669 static char nav_NavChooseVolume__doc__[] =
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
670 "(DialogOptions dict or kwargs+defaultLocation,eventProc,filterProc) -> NavReplyRecord"
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
671 ;
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
672
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
673 static PyObject *
19709
0b0c84078f91 Added prototypes to silence gcc strict-prototype warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19648
diff changeset
674 nav_NavChooseVolume(PyObject *self, PyObject *args, PyObject *kw)
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
675 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
676 PyObject *dict;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
677 AEDesc *defaultLocation = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
678 NavReplyRecord reply;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
679 NavDialogOptions dialogOptions;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
680 NavEventUPP eventProc = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
681 NavObjectFilterUPP filterProc = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
682 OSErr err;
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
683
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
684 if ( kw && PyObject_IsTrue(kw) ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
685 if (!PyArg_ParseTuple(args, ";either keyword arguments or dictionary expected"))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
686 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
687 dict = kw;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
688 } else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
689 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
690 if (!filldialogoptions(dict, &defaultLocation, &dialogOptions, &eventProc, NULL, &filterProc, NULL, NULL, NULL))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
691 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
692 err = NavChooseVolume(defaultLocation, &reply, &dialogOptions,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
693 eventProc, filterProc, (void *)dict);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
694 PyMem_DEL(defaultLocation);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
695 if ( err ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
696 PyErr_Mac(ErrorObject, err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
697 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
698 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
699 return (PyObject *)newnavrrobject(&reply);
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
700 }
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
701
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
702 static char nav_NavChooseObject__doc__[] =
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
703 "(DialogOptions dict or kwargs+defaultLocation,eventProc,filterProc) -> NavReplyRecord"
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
704 ;
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
705
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
706 static PyObject *
19709
0b0c84078f91 Added prototypes to silence gcc strict-prototype warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19648
diff changeset
707 nav_NavChooseObject(PyObject *self, PyObject *args, PyObject *kw)
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
708 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
709 PyObject *dict;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
710 AEDesc *defaultLocation = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
711 NavReplyRecord reply;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
712 NavDialogOptions dialogOptions;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
713 NavEventUPP eventProc = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
714 NavObjectFilterUPP filterProc = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
715 OSErr err;
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
716
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
717 if ( kw && PyObject_IsTrue(kw) ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
718 if (!PyArg_ParseTuple(args, ";either keyword arguments or dictionary expected"))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
719 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
720 dict = kw;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
721 } else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
722 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
723 if (!filldialogoptions(dict, &defaultLocation, &dialogOptions, &eventProc, NULL, &filterProc, NULL, NULL, NULL))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
724 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
725 err = NavChooseObject(defaultLocation, &reply, &dialogOptions,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
726 eventProc, filterProc, (void *)dict);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
727 PyMem_DEL(defaultLocation);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
728 if ( err ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
729 PyErr_Mac(ErrorObject, err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
730 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
731 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
732 return (PyObject *)newnavrrobject(&reply);
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
733 }
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
734
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
735 static char nav_NavNewFolder__doc__[] =
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
736 "(DialogOptions dict or kwargs+defaultLocation,eventProc) -> NavReplyRecord"
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
737 ;
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
738
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
739 static PyObject *
19709
0b0c84078f91 Added prototypes to silence gcc strict-prototype warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19648
diff changeset
740 nav_NavNewFolder(PyObject *self, PyObject *args, PyObject *kw)
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
741 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
742 PyObject *dict;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
743 AEDesc *defaultLocation = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
744 NavReplyRecord reply;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
745 NavDialogOptions dialogOptions;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
746 NavEventUPP eventProc = NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
747 OSErr err;
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
748
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
749 if ( kw && PyObject_IsTrue(kw) ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
750 if (!PyArg_ParseTuple(args, ";either keyword arguments or dictionary expected"))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
751 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
752 dict = kw;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
753 } else if (!PyArg_ParseTuple(args, "O!", &PyDict_Type, &dict))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
754 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
755 if (!filldialogoptions(dict, &defaultLocation, &dialogOptions, &eventProc, NULL, NULL, NULL, NULL, NULL))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
756 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
757 err = NavNewFolder(defaultLocation, &reply, &dialogOptions, eventProc, (void *)dict);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
758 PyMem_DEL(defaultLocation);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
759 if ( err ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
760 PyErr_Mac(ErrorObject, err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
761 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
762 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
763 return (PyObject *)newnavrrobject(&reply);
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
764 }
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
765
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
766 #if 0
16057
e3259e4bec60 Treat an empty kwdict argument the same as a missing one.
Jack Jansen <jack.jansen@cwi.nl>
parents: 14563
diff changeset
767 /* XXXX I don't know what to do with the void * argument */
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
768 static char nav_NavCustomControl__doc__[] =
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
769 ""
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
770 ;
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
771
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
772
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
773 static PyObject *
19709
0b0c84078f91 Added prototypes to silence gcc strict-prototype warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19648
diff changeset
774 nav_NavCustomControl(PyObject *self, PyObject *args)
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
775 {
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
776
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
777 if (!PyArg_ParseTuple(args, ""))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
778 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
779 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
780 return Py_None;
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
781 }
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
782 #endif
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
783
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
784 static char nav_NavServicesCanRun__doc__[] =
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
785 "()->int"
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
786 ;
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
787
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
788 static PyObject *
19709
0b0c84078f91 Added prototypes to silence gcc strict-prototype warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19648
diff changeset
789 nav_NavServicesCanRun(PyObject *self, PyObject *args)
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
790 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
791 Boolean rv;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
792 if (!PyArg_ParseTuple(args, ""))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
793 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
794 rv = NavServicesCanRun();
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
795 return Py_BuildValue("l", (long)rv);
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
796 }
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
797
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
798 static char nav_NavServicesAvailable__doc__[] =
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
799 "()->int"
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
800 ;
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
801
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
802 static PyObject *
19709
0b0c84078f91 Added prototypes to silence gcc strict-prototype warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19648
diff changeset
803 nav_NavServicesAvailable(PyObject *self, PyObject *args)
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
804 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
805 Boolean rv;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
806
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
807 if (!PyArg_ParseTuple(args, ""))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
808 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
809 rv = NavServicesAvailable();
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
810 return Py_BuildValue("l", (long)rv);
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
811 }
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
812 /* XX */
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
813 static char nav_NavLoad__doc__[] =
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
814 "()->None"
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
815 ;
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
816
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
817 static PyObject *
19709
0b0c84078f91 Added prototypes to silence gcc strict-prototype warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19648
diff changeset
818 nav_NavLoad(PyObject *self, PyObject *args)
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
819 {
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
820
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
821 if (!PyArg_ParseTuple(args, ""))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
822 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
823 NavLoad();
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
824 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
825 return Py_None;
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
826 }
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
827
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
828 static char nav_NavUnload__doc__[] =
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
829 "()->None"
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
830 ;
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
831
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
832 static PyObject *
19709
0b0c84078f91 Added prototypes to silence gcc strict-prototype warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19648
diff changeset
833 nav_NavUnload(PyObject *self, PyObject *args)
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
834 {
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
835
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
836 if (!PyArg_ParseTuple(args, ""))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
837 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
838 NavUnload();
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
839 Py_INCREF(Py_None);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
840 return Py_None;
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
841 }
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
842
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
843 static char nav_NavLibraryVersion__doc__[] =
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
844 "()->int"
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
845 ;
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
846
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
847 static PyObject *
19709
0b0c84078f91 Added prototypes to silence gcc strict-prototype warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19648
diff changeset
848 nav_NavLibraryVersion(PyObject *self, PyObject *args)
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
849 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
850 UInt32 rv;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
851
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
852 if (!PyArg_ParseTuple(args, ""))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
853 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
854 rv = NavLibraryVersion();
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
855 return Py_BuildValue("l", (long)rv);
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
856 }
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
857
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
858 static char nav_NavGetDefaultDialogOptions__doc__[] =
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
859 "()->dict\nPass dict or keyword args with same names to other calls."
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
860 ;
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
861
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
862 static PyObject *
19709
0b0c84078f91 Added prototypes to silence gcc strict-prototype warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19648
diff changeset
863 nav_NavGetDefaultDialogOptions(PyObject *self, PyObject *args)
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
864 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
865 NavDialogOptions dialogOptions;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
866 OSErr err;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
867
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
868 err = NavGetDefaultDialogOptions(&dialogOptions);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
869 if ( err ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
870 PyErr_Mac(ErrorObject, err);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
871 return NULL;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
872 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
873 return Py_BuildValue(
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
874 "{s:h,s:l,s:O&,s:O&,s:O&,s:O&,s:O&,s:O&,s:O&,s:O&,s:O&}",
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
875 "version", dialogOptions.version,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
876 "dialogOptionFlags", dialogOptions.dialogOptionFlags,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
877 "location", PyMac_BuildPoint, dialogOptions.location,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
878 "clientName", PyMac_BuildStr255, &dialogOptions.clientName,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
879 "windowTitle", PyMac_BuildStr255, &dialogOptions.windowTitle,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
880 "actionButtonLabel", PyMac_BuildStr255, &dialogOptions.actionButtonLabel,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
881 "cancelButtonLabel", PyMac_BuildStr255, &dialogOptions.cancelButtonLabel,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
882 "savedFileName", PyMac_BuildStr255, &dialogOptions.savedFileName,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
883 "message", PyMac_BuildStr255, &dialogOptions.message,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
884 "preferenceKey", PyMac_BuildOSType, dialogOptions.preferenceKey
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
885 ,"popupExtension", OptResObj_New, dialogOptions.popupExtension
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
886 );
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
887 }
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
888
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
889 /* List of methods defined in the module */
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
890
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
891 static struct PyMethodDef nav_methods[] = {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
892 {"NavGetFile", (PyCFunction)nav_NavGetFile, METH_VARARGS|METH_KEYWORDS, nav_NavGetFile__doc__},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
893 {"NavPutFile", (PyCFunction)nav_NavPutFile, METH_VARARGS|METH_KEYWORDS, nav_NavPutFile__doc__},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
894 {"NavAskSaveChanges", (PyCFunction)nav_NavAskSaveChanges, METH_VARARGS|METH_KEYWORDS, nav_NavAskSaveChanges__doc__},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
895 {"NavCustomAskSaveChanges", (PyCFunction)nav_NavCustomAskSaveChanges, METH_VARARGS|METH_KEYWORDS, nav_NavCustomAskSaveChanges__doc__},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
896 {"NavAskDiscardChanges", (PyCFunction)nav_NavAskDiscardChanges, METH_VARARGS|METH_KEYWORDS, nav_NavAskDiscardChanges__doc__},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
897 {"NavChooseFile", (PyCFunction)nav_NavChooseFile, METH_VARARGS|METH_KEYWORDS, nav_NavChooseFile__doc__},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
898 {"NavChooseFolder", (PyCFunction)nav_NavChooseFolder, METH_VARARGS|METH_KEYWORDS, nav_NavChooseFolder__doc__},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
899 {"NavChooseVolume", (PyCFunction)nav_NavChooseVolume, METH_VARARGS|METH_KEYWORDS, nav_NavChooseVolume__doc__},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
900 {"NavChooseObject", (PyCFunction)nav_NavChooseObject, METH_VARARGS|METH_KEYWORDS, nav_NavChooseObject__doc__},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
901 {"NavNewFolder", (PyCFunction)nav_NavNewFolder, METH_VARARGS|METH_KEYWORDS, nav_NavNewFolder__doc__},
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
902 #if 0
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
903 {"NavCustomControl", (PyCFunction)nav_NavCustomControl, METH_VARARGS, nav_NavCustomControl__doc__},
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
904 #endif
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
905 {"NavServicesCanRun", (PyCFunction)nav_NavServicesCanRun, METH_VARARGS, nav_NavServicesCanRun__doc__},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
906 {"NavServicesAvailable", (PyCFunction)nav_NavServicesAvailable, METH_VARARGS, nav_NavServicesAvailable__doc__},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
907 {"NavLoad", (PyCFunction)nav_NavLoad, METH_VARARGS, nav_NavLoad__doc__},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
908 {"NavUnload", (PyCFunction)nav_NavUnload, METH_VARARGS, nav_NavUnload__doc__},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
909 {"NavLibraryVersion", (PyCFunction)nav_NavLibraryVersion, METH_VARARGS, nav_NavLibraryVersion__doc__},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
910 {"NavGetDefaultDialogOptions", (PyCFunction)nav_NavGetDefaultDialogOptions, METH_VARARGS, nav_NavGetDefaultDialogOptions__doc__},
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
911 {NULL, (PyCFunction)NULL, 0, NULL} /* sentinel */
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
912 };
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
913
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
914
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
915 /* Initialization function for the module (*must* be called initNav) */
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
916
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
917 static char Nav_module_documentation[] =
11590
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
918 "Interface to Navigation Services\n"
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
919 "Most calls accept a NavDialogOptions dictionary or keywords with the same names, pass {}\n"
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
920 "if you want the default options.\n"
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
921 "Use NavGetDefaultDialogOptions() to find out common option names.\n"
648d97bd3ac6 Finished (I think), but only very lightly tested. Should now have full interface: all
Jack Jansen <jack.jansen@cwi.nl>
parents: 11587
diff changeset
922 "See individual docstrings for additional keyword args/dictentries supported by each call.\n"
11593
cab3ff551f4b Added a line about passing None as eventProc to the docstring to get movable
Jack Jansen <jack.jansen@cwi.nl>
parents: 11590
diff changeset
923 "Pass None as eventProc to get movable-modal dialogs that process updates through the standard Python mechanism."
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
924 ;
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
925
56182
06ce27a82e99 Merged revisions 75017 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 47527
diff changeset
926
06ce27a82e99 Merged revisions 75017 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 47527
diff changeset
927 #endif /* !__LP64__ */
06ce27a82e99 Merged revisions 75017 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 47527
diff changeset
928
06ce27a82e99 Merged revisions 75017 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 47527
diff changeset
929
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
930 void
19709
0b0c84078f91 Added prototypes to silence gcc strict-prototype warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents: 19648
diff changeset
931 initNav(void)
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
932 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
933 PyObject *m, *d;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
934
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
935 if (PyErr_WarnPy3k("In 3.x, the Nav module is removed.", 1))
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
936 return;
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
937
56182
06ce27a82e99 Merged revisions 75017 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 47527
diff changeset
938 #ifdef __LP64__
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
939 PyErr_SetString(PyExc_ImportError, "Navigation Services not available in 64-bit mode");
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
940 return;
56182
06ce27a82e99 Merged revisions 75017 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 47527
diff changeset
941
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
942 #else /* !__LP64__ */
56182
06ce27a82e99 Merged revisions 75017 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 47527
diff changeset
943
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
944 /* Test that we have NavServices */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
945 if ( !NavServicesAvailable() ) {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
946 PyErr_SetString(PyExc_ImportError, "Navigation Services not available");
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
947 return;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
948 }
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
949 /* Create the module and add the functions */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
950 m = Py_InitModule4("Nav", nav_methods,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
951 Nav_module_documentation,
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
952 (PyObject*)NULL,PYTHON_API_VERSION);
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
953
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
954 /* Add some symbolic constants to the module */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
955 d = PyModule_GetDict(m);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
956 ErrorObject = PyString_FromString("Nav.error");
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
957 PyDict_SetItemString(d, "error", ErrorObject);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
958
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
959 /* XXXX Add constants here */
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
960
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
961 /* Set UPPs */
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
962 my_eventProcUPP = NewNavEventUPP(my_eventProc);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
963 my_previewProcUPP = NewNavPreviewUPP(my_previewProc);
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
964 my_filterProcUPP = NewNavObjectFilterUPP(my_filterProc);
56182
06ce27a82e99 Merged revisions 75017 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 47527
diff changeset
965 #endif /* !__LP64__ */
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 60271
diff changeset
966
11581
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
967 }
273a5e9aa633 Navigation Services module. Started from scratch, as Joe's module exported too little for my needs.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
968