]> git.saurik.com Git - wxWidgets.git/commitdiff
resource fork not used anymore
authorStefan Csomor <csomor@advancedconcepts.ch>
Mon, 23 Aug 2004 17:48:18 +0000 (17:48 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Mon, 23 Aug 2004 17:48:18 +0000 (17:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28871 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/app.cpp
src/mac/carbon/cursor.cpp
src/mac/carbon/menu.cpp

index f610756a2a282f456a2a3ef295a83e1fcb725941..5e2dd1cae98637f049abf8018835465070b976fa 100644 (file)
@@ -726,153 +726,6 @@ void wxApp::CleanUp()
 // misc initialization stuff
 //----------------------------------------------------------------------
 
-// extern variable for shared library resource id
-// need to be able to find it with NSLookupAndBindSymbol
-short gSharedLibraryResource = kResFileNotOpened ;
-
-#if defined(WXMAKINGDLL_CORE) && defined(__DARWIN__)
-CFBundleRef gSharedLibraryBundle = NULL;
-#endif /* WXMAKINGDLL_CORE && __DARWIN__ */
-
-wxStAppResource::wxStAppResource()
-{
-    m_currentRefNum = CurResFile() ;
-    if ( gSharedLibraryResource != kResFileNotOpened )
-    {
-        UseResFile( gSharedLibraryResource ) ;
-    }
-}
-
-wxStAppResource::~wxStAppResource()
-{
-    if ( m_currentRefNum != kResFileNotOpened )
-    {
-        UseResFile( m_currentRefNum ) ;
-    }
-}
-
-void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
-{
-    gSharedLibraryResource = kResFileNotOpened;
-
-#ifdef WXMAKINGDLL_CORE
-    if ( initBlock != NULL ) {
-        const CFragInitBlock *theInitBlock = (const CFragInitBlock *)initBlock;
-        FSSpec *fileSpec = NULL;
-
-        if (theInitBlock->fragLocator.where == kDataForkCFragLocator) {
-            fileSpec = theInitBlock->fragLocator.u.onDisk.fileSpec;
-        }
-        else if (theInitBlock->fragLocator.where == kResourceCFragLocator) {
-            fileSpec = theInitBlock->fragLocator.u.inSegs.fileSpec;
-        }
-
-        if (fileSpec != NULL) {
-            gSharedLibraryResource =  FSpOpenResFile(fileSpec, fsRdPerm);
-        }
-    }
-    else {
-#ifdef __DARWIN__
-        // Open the shared library resource file if it is not yet open
-        NSSymbol    theSymbol;
-        NSModule    theModule;
-        const char *theLibPath;
-
-        gSharedLibraryBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.wxwindows.wxWidgets"));
-        if (gSharedLibraryBundle != NULL) {
-            // wxWidgets has been bundled into a framework
-            //   load the framework resources
-
-            gSharedLibraryResource = CFBundleOpenBundleResourceMap(gSharedLibraryBundle);
-        }
-        else {
-            // wxWidgets is a simple dynamic shared library
-            //   load the resources from the data fork of a separate resource file
-            wxString theResPath;
-            wxString theName;
-            FSRef  theResRef;
-            OSErr  theErr = noErr;
-
-            // get the library path
-            theSymbol = NSLookupAndBindSymbol("_gSharedLibraryResource");
-            theModule = NSModuleForSymbol(theSymbol);
-            theLibPath = NSLibraryNameForModule(theModule);
-
-            // if we call wxLogDebug from here then, as wxTheApp hasn't been
-            // created yet when we're called from wxApp::Initialize(), wxLog
-            // is going to create a default stderr-based log target instead of
-            // the expected normal GUI one -- don't do it, if we really want
-            // to see this message just use fprintf() here
-#if 0
-            wxLogDebug( wxT("wxMac library installation name is '%s'"),
-                        theLibPath );
-#endif
-
-            // allocate copy to replace .dylib.* extension with .rsrc
-            if (theLibPath != NULL) {
-#if wxUSE_UNICODE
-                theResPath = wxString(theLibPath, wxConvLocal);
-#else
-                theResPath = wxString(theLibPath);
-#endif
-                // replace '_core' with '' in case of multi-lib build
-                theResPath.Replace(wxT("_core"), wxEmptyString);
-                // replace ".dylib" shared library extension with ".rsrc"
-                theResPath.Replace(wxT(".dylib"), wxT(".rsrc"));
-                // Find the begining of the filename
-                theName = theResPath.AfterLast('/');
-
-#if 0
-                wxLogDebug( wxT("wxMac resources file name is '%s'"),
-                            theResPath.mb_str() );
-#endif
-
-                theErr = FSPathMakeRef((UInt8 *) theResPath.mb_str(), &theResRef, false);
-                if (theErr != noErr) {
-                    // try in current directory (using name only)
-                    theErr = FSPathMakeRef((UInt8 *) theName.mb_str(), &theResRef, false);
-                }
-
-                // open the resource file
-                if (theErr == noErr) {
-                    theErr = FSOpenResourceFile( &theResRef, 0, NULL, fsRdPerm,
-                                                 &gSharedLibraryResource);
-                }
-                if (theErr != noErr) {
-#ifdef __WXDEBUG__
-                    wxLogDebug( wxT("unable to open wxMac resource file '%s'\n"),
-                                theResPath.mb_str() );
-#endif // __WXDEBUG__
-                }
-
-            }
-        }
-#endif /* __DARWIN__ */
-    }
-#endif /* WXMAKINGDLL_CORE */
-}
-
-void wxStAppResource::CloseSharedLibraryResource()
-{
-#ifdef WXMAKINGDLL_CORE
-    // Close the shared library resource file
-    if (gSharedLibraryResource != kResFileNotOpened) {
-#ifdef __DARWIN__
-        if (gSharedLibraryBundle != NULL) {
-            CFBundleCloseBundleResourceMap(gSharedLibraryBundle,
-                                           gSharedLibraryResource);
-            gSharedLibraryBundle = NULL;
-        }
-        else
-#endif /* __DARWIN__ */
-        {
-            CloseResFile(gSharedLibraryResource);
-        }
-        gSharedLibraryResource = kResFileNotOpened;
-    }
-#endif /* WXMAKINGDLL_CORE */
-}
-
 #if defined(WXMAKINGDLL_CORE) && !defined(__DARWIN__)
 
 // for shared libraries we have to manually get the correct resource
@@ -887,13 +740,11 @@ extern "C" {
 
 pascal OSErr __wxinitialize(const CFragInitBlock *theInitBlock)
 {
-    wxStAppResource::OpenSharedLibraryResource( theInitBlock ) ;
     return __initialize( theInitBlock ) ;
 }
 
 pascal void __wxterminate(void)
 {
-    wxStAppResource::CloseSharedLibraryResource() ;
     __terminate() ;
 }
 
index 741025af8bc69ce54b1841ae4a70f7ff97747816..2a6eb5f4eab04684a0c4652e03fd6bb85967b1dc 100644 (file)
@@ -376,7 +376,6 @@ wxCursor::wxCursor(const wxString& cursor_file, long flags, int hotSpotX, int ho
         Str255 theName ;
                wxMacStringToPascal( cursor_file , theName ) ;
         
-        wxStAppResource resload ;
         Handle resHandle = ::GetNamedResource( 'crsr' , theName ) ;
         if ( resHandle )
         {
index adb3fb2e958ef01448a0cbb19c1de4d63dc7e33b..1aab98b958183f8bf0d71f34fef6205d3d5db296 100644 (file)
@@ -536,8 +536,6 @@ void wxMenuBar::MacInstallMenuBar()
     if ( s_macInstalledMenuBar == this )
         return ;
 
-    wxStAppResource resload ;
-
     MenuBarHandle menubar = NULL ;
 #if TARGET_API_MAC_OSX
     menubar = NewHandleClear( 6 /* sizeof( MenuBarHeader ) */ ) ;