|
From: <cre...@us...> - 2006-06-24 02:28:23
|
Revision: 1413 Author: creecode Date: 2006-06-23 19:28:18 -0700 (Fri, 23 Jun 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1413&view=rev Log Message: ----------- FSRef-ized code cleanup Modified Paths: -------------- Frontier/branches/FSRef_Migration/Common/headers/osincludes.h Frontier/branches/FSRef_Migration/Common/headers/player.h Frontier/branches/FSRef_Migration/Common/source/mouse.c Frontier/branches/FSRef_Migration/Common/source/player.c Frontier/branches/FSRef_Migration/Common/stubs/megastubs.c Modified: Frontier/branches/FSRef_Migration/Common/headers/osincludes.h =================================================================== --- Frontier/branches/FSRef_Migration/Common/headers/osincludes.h 2006-06-24 02:15:20 UTC (rev 1412) +++ Frontier/branches/FSRef_Migration/Common/headers/osincludes.h 2006-06-24 02:28:18 UTC (rev 1413) @@ -68,144 +68,140 @@ #define OTDEBUG 1 /* must define before including OpenTransport headers */ - #if TARGET_API_MAC_CARBON + #ifdef FRONTIER_FRAMEWORK_INCLUDES /* building for Mach-O with framework-style includes */ - #ifdef FRONTIER_FRAMEWORK_INCLUDES /* building for Mach-O with framework-style includes */ + #ifdef FRONTIER_FLAT_HEADERS /* building for Mach-O with flat header-style includes */ - #ifdef FRONTIER_FLAT_HEADERS /* building for Mach-O with flat header-style includes */ + #include <Carbon.h> + #include <ApplicationServices.h> + #include <Movies.h> - #include <Carbon.h> - #include <ApplicationServices.h> - #include <Movies.h> + #else + + #include <Carbon/Carbon.h> + #include <ApplicationServices/ApplicationServices.h> + #include <QuickTime/Movies.h> - #else - - #include <Carbon/Carbon.h> - #include <ApplicationServices/ApplicationServices.h> - #include <QuickTime/Movies.h> + #endif - #endif + #define ELASTERRNO ELAST - #define ELASTERRNO ELAST + /* cribbed from pre-OSX StandardFile.h */ + struct StandardFileReply { + Boolean sfGood; + Boolean sfReplacing; + OSType sfType; + FSSpec sfFile; + ScriptCode sfScript; + short sfFlags; + Boolean sfIsFolder; + Boolean sfIsVolume; + long sfReserved1; + short sfReserved2; + }; + typedef struct StandardFileReply StandardFileReply; - /* cribbed from pre-OSX StandardFile.h */ - struct StandardFileReply { - Boolean sfGood; - Boolean sfReplacing; - OSType sfType; - FSSpec sfFile; - ScriptCode sfScript; - short sfFlags; - Boolean sfIsFolder; - Boolean sfIsVolume; - long sfReserved1; - short sfReserved2; - }; - typedef struct StandardFileReply StandardFileReply; + #else /*CFM*/ - #else /*CFM*/ + #define ACCESSOR_CALLS_ARE_FUNCTIONS 1 + #define OPAQUE_TOOLBOX_STRUCTS 1 - #define ACCESSOR_CALLS_ARE_FUNCTIONS 1 - #define OPAQUE_TOOLBOX_STRUCTS 1 - - #define OTUNIXERRORS 1 - - #define OLDROUTINENAMES 0 - #define OLDROUTINELOCATIONS 0 - #define CGLUESUPPORTED 0 - - #define PtoCstr p2cstr - #define CtoPstr c2pstr - #define PtoCString p2cstr - #define CtoPString c2pstr - - #define TRUE true - #define FALSE false - - #include <Carbon.h> - #include <CFBundle.h> - #include <MacHelp.h> - #include <Movies.h> - - #endif - - /* cribbed from pre-OSX AppleTalk.h -- for TargetID */ - struct EntityName { - Str32Field objStr; - Str32Field typeStr; - Str32Field zoneStr; - }; - typedef struct EntityName EntityName; - - /* cribbed from pre-OSX PPCToolbox.h -- for TargetID */ - typedef SInt16 PPCLocationKind; - typedef SInt16 PPCPortKinds; - enum { - ppcByCreatorAndType = 1, /* Port type is specified as colloquial Mac creator and type */ - ppcByString = 2 /* Port type is in pascal string format */ - }; - typedef SInt16 PPCXTIAddressType; - struct PPCXTIAddress { - PPCXTIAddressType fAddressType; /* A constant specifying what kind of network address this is */ - UInt8 fAddress[96]; /* The contents of the network address (variable length, NULL terminated). */ - }; - typedef struct PPCXTIAddress PPCXTIAddress; - typedef PPCXTIAddress * PPCXTIAddressPtr; - struct PPCAddrRec { - UInt8 Reserved[3]; /* reserved - must be initialize to 0 */ - UInt8 xtiAddrLen; /* size of the xtiAddr field */ - PPCXTIAddress xtiAddr; /* the transport-independent network address */ - }; - typedef struct PPCAddrRec PPCAddrRec; - typedef PPCAddrRec * PPCAddrRecPtr; - struct LocationNameRec { - PPCLocationKind locationKindSelector; /* which variant */ - union { - EntityName nbpEntity; /* NBP name entity */ - Str32 nbpType; /* just the NBP type string, for PPCOpen */ - PPCAddrRec xtiType; /* an XTI-type network address record */ - } u; - }; - typedef struct LocationNameRec LocationNameRec; - typedef LocationNameRec * LocationNamePtr; - struct PPCPortRec { - ScriptCode nameScript; /* script of name */ - Str32Field name; /* name of port as seen in browser */ - PPCPortKinds portKindSelector; /* which variant */ - union { - Str32 portTypeStr; /* pascal type string */ - struct { - OSType portCreator; - OSType portType; - } port; - } u; - }; - typedef struct PPCPortRec PPCPortRec; - typedef PPCPortRec * PPCPortPtr; - struct PortInfoRec { - SInt8 filler1; - Boolean authRequired; - PPCPortRec name; - }; - typedef struct PortInfoRec PortInfoRec; - typedef PortInfoRec * PortInfoPtr; - - /* cribbed from pre-OSX EPPC.h -- for TargetID */ - struct TargetID { - long sessionID; - PPCPortRec name; - LocationNameRec location; - PPCPortRec recvrName; - }; - typedef struct TargetID TargetID; - typedef TargetID * TargetIDPtr; - typedef TargetIDPtr * TargetIDHandle; - typedef TargetIDHandle TargetIDHdl; - typedef TargetID SenderID; - typedef SenderID * SenderIDPtr; - - #endif /*TARGET_API_MAC_CARBON*/ - + #define OTUNIXERRORS 1 + + #define OLDROUTINENAMES 0 + #define OLDROUTINELOCATIONS 0 + #define CGLUESUPPORTED 0 + + #define PtoCstr p2cstr + #define CtoPstr c2pstr + #define PtoCString p2cstr + #define CtoPString c2pstr + + #define TRUE true + #define FALSE false + + #include <Carbon.h> + #include <CFBundle.h> + #include <MacHelp.h> + #include <Movies.h> + + #endif + + /* cribbed from pre-OSX AppleTalk.h -- for TargetID */ + struct EntityName { + Str32Field objStr; + Str32Field typeStr; + Str32Field zoneStr; + }; + typedef struct EntityName EntityName; + + /* cribbed from pre-OSX PPCToolbox.h -- for TargetID */ + typedef SInt16 PPCLocationKind; + typedef SInt16 PPCPortKinds; + enum { + ppcByCreatorAndType = 1, /* Port type is specified as colloquial Mac creator and type */ + ppcByString = 2 /* Port type is in pascal string format */ + }; + typedef SInt16 PPCXTIAddressType; + struct PPCXTIAddress { + PPCXTIAddressType fAddressType; /* A constant specifying what kind of network address this is */ + UInt8 fAddress[96]; /* The contents of the network address (variable length, NULL terminated). */ + }; + typedef struct PPCXTIAddress PPCXTIAddress; + typedef PPCXTIAddress * PPCXTIAddressPtr; + struct PPCAddrRec { + UInt8 Reserved[3]; /* reserved - must be initialize to 0 */ + UInt8 xtiAddrLen; /* size of the xtiAddr field */ + PPCXTIAddress xtiAddr; /* the transport-independent network address */ + }; + typedef struct PPCAddrRec PPCAddrRec; + typedef PPCAddrRec * PPCAddrRecPtr; + struct LocationNameRec { + PPCLocationKind locationKindSelector; /* which variant */ + union { + EntityName nbpEntity; /* NBP name entity */ + Str32 nbpType; /* just the NBP type string, for PPCOpen */ + PPCAddrRec xtiType; /* an XTI-type network address record */ + } u; + }; + typedef struct LocationNameRec LocationNameRec; + typedef LocationNameRec * LocationNamePtr; + struct PPCPortRec { + ScriptCode nameScript; /* script of name */ + Str32Field name; /* name of port as seen in browser */ + PPCPortKinds portKindSelector; /* which variant */ + union { + Str32 portTypeStr; /* pascal type string */ + struct { + OSType portCreator; + OSType portType; + } port; + } u; + }; + typedef struct PPCPortRec PPCPortRec; + typedef PPCPortRec * PPCPortPtr; + struct PortInfoRec { + SInt8 filler1; + Boolean authRequired; + PPCPortRec name; + }; + typedef struct PortInfoRec PortInfoRec; + typedef PortInfoRec * PortInfoPtr; + + /* cribbed from pre-OSX EPPC.h -- for TargetID */ + struct TargetID { + long sessionID; + PPCPortRec name; + LocationNameRec location; + PPCPortRec recvrName; + }; + typedef struct TargetID TargetID; + typedef TargetID * TargetIDPtr; + typedef TargetIDPtr * TargetIDHandle; + typedef TargetIDHandle TargetIDHdl; + typedef TargetID SenderID; + typedef SenderID * SenderIDPtr; + #if TARGET_API_MAC_OS8 #define ACCESSOR_CALLS_ARE_FUNCTIONS 0 Modified: Frontier/branches/FSRef_Migration/Common/headers/player.h =================================================================== --- Frontier/branches/FSRef_Migration/Common/headers/player.h 2006-06-24 02:15:20 UTC (rev 1412) +++ Frontier/branches/FSRef_Migration/Common/headers/player.h 2006-06-24 02:28:18 UTC (rev 1413) @@ -27,6 +27,8 @@ #ifdef MACVERSION /*Mac-only feature*/ +#include "shelltypes.h" + #define playerinclude @@ -40,7 +42,7 @@ boolean isplayerevent (void); -boolean playeropenmovieinwindow (FSSpec *f); +boolean playeropenmovieinwindow ( ptrfilespec ); boolean playerplaymovie (void); Modified: Frontier/branches/FSRef_Migration/Common/source/mouse.c =================================================================== --- Frontier/branches/FSRef_Migration/Common/source/mouse.c 2006-06-24 02:15:20 UTC (rev 1412) +++ Frontier/branches/FSRef_Migration/Common/source/mouse.c 2006-06-24 02:28:18 UTC (rev 1413) @@ -28,7 +28,7 @@ #include "frontier.h" #include "standard.h" -#ifdef MACVERSION +#ifdef MACVERSION #define GetDoubleClickTime() GetDblTime() #endif Modified: Frontier/branches/FSRef_Migration/Common/source/player.c =================================================================== --- Frontier/branches/FSRef_Migration/Common/source/player.c 2006-06-24 02:15:20 UTC (rev 1412) +++ Frontier/branches/FSRef_Migration/Common/source/player.c 2006-06-24 02:28:18 UTC (rev 1413) @@ -68,7 +68,13 @@ #include "lang.h" #include "langinternal.h" +#ifdef MACVERSION + #include "MoreFilesX.h" + +#endif + + #define moviestasktime 30 typedef struct typlayerrecord { @@ -502,39 +508,33 @@ } /*playermoviecontrollereventfilter*/ -boolean playeropenmovieinwindow (FSSpec *f) { +boolean playeropenmovieinwindow ( ptrfilespec f ) { - /* - 7.0b4 PBS: open a movie in the QuickTime Player window and display it. - If the window isn't already open, open it. - */ + // + // 2006-06-23 creedon: FSRef-zed + // + // 7.0b4 PBS: open a movie in the QuickTime Player window and display it. If the window isn't already open, open it. + // short movieresref; - OSErr err; - hdlwindowinfo hinfo; + FSSpec fs; + FSRefMakeFSSpec ( &( *f ).fsref, &fs ); + if (!findplayerwindow (&hinfo)) - playeropencommand (); /*If the Player window doesn't exist, create a new one.*/ + playeropencommand (); // If the Player window doesn't exist, create a new one. getwindowinfo (playerwindow, &playerwindowinfo); - playerdisposecurrentmovie (); /*make sure the current movie has been disposed*/ + playerdisposecurrentmovie (); // make sure the current movie has been disposed - #if TARGET_API_MAC_CARBON == 1 + SetGWorld (GetWindowPort (playerwindow), nil); - SetGWorld (GetWindowPort (playerwindow), nil); + err = OpenMovieFile ( &fs, &movieresref, fsRdPerm); - #else - - SetGWorld ((CGrafPtr) playerwindow, nil); - - #endif - - err = OpenMovieFile (f, &movieresref, fsRdPerm); - if (err != noErr) return (false); @@ -543,16 +543,8 @@ CloseMovieFile (movieresref); - #if TARGET_API_MAC_CARBON == 1 - - SetMovieGWorld (currentmovie, GetWindowPort (playerwindow), nil); + SetMovieGWorld (currentmovie, GetWindowPort (playerwindow), nil); - #else - - SetMovieGWorld (currentmovie, (CGrafPtr) playerwindow, nil); - - #endif - GetMovieBox (currentmovie, ¤tmovierect); OffsetRect (¤tmovierect, -currentmovierect.left, -currentmovierect.top); @@ -569,7 +561,7 @@ (**playerwindowinfo).contentrect = currentmovierect; - AlignWindow (playerwindow, false, nil, nil); /*position for optimal playback*/ + AlignWindow (playerwindow, false, nil, nil); // position for optimal playback //MCDoAction (currentcontroller, mcActionSetKeysEnabled, (void *) true); /*enable keyboard input*/ /*No!*/ @@ -578,7 +570,7 @@ MCIdle (currentcontroller); return (true); - } /*playeropenmovieinwindow*/ + } // playeropenmovieinwindow boolean playerplaymovie (void) { Modified: Frontier/branches/FSRef_Migration/Common/stubs/megastubs.c =================================================================== --- Frontier/branches/FSRef_Migration/Common/stubs/megastubs.c 2006-06-24 02:15:20 UTC (rev 1412) +++ Frontier/branches/FSRef_Migration/Common/stubs/megastubs.c 2006-06-24 02:28:18 UTC (rev 1413) @@ -627,10 +627,10 @@ /* -extern boolean getfiletype (const tyfilespec *, OSType *); -extern boolean fileresolvealias (tyfilespec *); -extern boolean sfdialog (tysfverb, bigstring, ptrsftypelist, tyfilespec *); -extern boolean getapplicationfilespec (bigstring, tyfilespec *); +extern boolean getfiletype (const ptrfilespec , OSType *); +extern boolean fileresolvealias (ptrfilespec ); +extern boolean sfdialog (tysfverb, bigstring, ptrsftypelist, ptrfilespec ); +extern boolean getapplicationfilespec (bigstring, ptrfilespec ); */ boolean initmacintosh () This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |