Kaydet (Commit) 24a45e3c authored tarafından Guido van Rossum's avatar Guido van Rossum

ported to MPW, moved main() here

üst 850f44b4
...@@ -48,6 +48,9 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -48,6 +48,9 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef HAVE_UNIVERSAL_HEADERS #ifndef HAVE_UNIVERSAL_HEADERS
#define GetResourceSizeOnDisk(x) SizeResource(x) #define GetResourceSizeOnDisk(x) SizeResource(x)
typedef DlgHookYDProcPtr DlgHookYDUPP;
#define NewDlgHookYDProc(userRoutine) ((DlgHookYDUPP) (userRoutine))
typedef FileFilterYDProcPtr FileFilterYDUPP;
#endif #endif
#include <signal.h> #include <signal.h>
...@@ -588,14 +591,12 @@ error: ...@@ -588,14 +591,12 @@ error:
return NULL; return NULL;
} }
} }
/* /*
** Helper routine for GetDirectory ** Helper routine for GetDirectory
*/ */
static int static pascal short
myhook_proc(item, theDialog, dataptr) myhook_proc(short item, DialogPtr theDialog, void *dataptr)
short item;
DialogPtr theDialog;
void *dataptr;
{ {
if ( item == SELECTCUR_ITEM ) { if ( item == SELECTCUR_ITEM ) {
item = sfItemCancelButton; item = sfItemCancelButton;
...@@ -623,7 +624,7 @@ PyMac_GetDirectory(dirfss) ...@@ -623,7 +624,7 @@ PyMac_GetDirectory(dirfss)
myhook_upp = NewDlgHookYDProc(myhook_proc); myhook_upp = NewDlgHookYDProc(myhook_proc);
upp_inited = 1; upp_inited = 1;
} }
CustomGetFile((FileFilterUPP)0, 1, list, &reply, GETDIR_ID, where, myhook_upp, CustomGetFile((FileFilterYDUPP)0, 1, list, &reply, GETDIR_ID, where, myhook_upp,
NULL, NULL, NULL, (void *)&select_clicked); NULL, NULL, NULL, (void *)&select_clicked);
reply.sfFile.name[0] = 0; reply.sfFile.name[0] = 0;
...@@ -786,7 +787,26 @@ PyMac_BuildEventRecord(EventRecord *e) ...@@ -786,7 +787,26 @@ PyMac_BuildEventRecord(EventRecord *e)
} }
/* ---------- */ #ifndef USE_MAC_SHARED_LIBRARY
/* For normal application */
void
main()
{
int argc;
char **argv;
#ifdef __MWERKS__
SIOUXSettings.asktosaveonclose = 0;
SIOUXSettings.showstatusline = 0;
SIOUXSettings.tabspaces = 4;
#endif
argc = PyMac_GetArgv(&argv);
Py_Main(argc, argv);
}
#else /* USE_MAC_SHARED_LIBRARY */
/* Applet support */ /* Applet support */
/* Run a compiled Python Python script from 'PYC ' resource __main__ */ /* Run a compiled Python Python script from 'PYC ' resource __main__ */
...@@ -828,16 +848,10 @@ PyMac_InitApplet() ...@@ -828,16 +848,10 @@ PyMac_InitApplet()
{ {
int argc; int argc;
char **argv; char **argv;
int err;
#ifdef __MWERKS__ #ifdef USE_MAC_SHARED_LIBRARY
/*
** Guido: you should fix this. You should arrange to have the
** __sinit routine from macshlglue.c called so you can stuff
** resources into the lib file.
*/
PyMac_AddLibResources(); PyMac_AddLibResources();
#else
KABOO! KABOO!
#endif #endif
#ifdef __MWERKS__ #ifdef __MWERKS__
SIOUXSettings.asktosaveonclose = 0; SIOUXSettings.asktosaveonclose = 0;
...@@ -858,3 +872,5 @@ PyMac_InitApplet() ...@@ -858,3 +872,5 @@ PyMac_InitApplet()
#endif #endif
/* XXX Should we bother to Py_Exit(sts)? */ /* XXX Should we bother to Py_Exit(sts)? */
} }
#endif /* USE_MAC_SHARED_LIBRARY */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment