[Libreoffice-commits] .: vcl/source

Tor Lillqvist tml at kemper.freedesktop.org
Wed Jul 13 10:47:56 PDT 2011


 vcl/source/app/svmainhook.cxx |   78 ------------------------------------------
 1 file changed, 1 insertion(+), 77 deletions(-)

New commits:
commit 0939143dcf5b0859e11890310858981cc0ddcc52
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Jul 13 20:42:27 2011 +0300

    Bin dead MacOSX X11 code

diff --git a/vcl/source/app/svmainhook.cxx b/vcl/source/app/svmainhook.cxx
index 5d3c3ad..c740600 100644
--- a/vcl/source/app/svmainhook.cxx
+++ b/vcl/source/app/svmainhook.cxx
@@ -31,89 +31,13 @@
 #include <tools/tools.h>
 
 #ifndef MACOSX
+// MacOSX implementation of ImplSVMainHook is in aqua/source/app/salinst.cxx
 
 sal_Bool ImplSVMainHook( int * )
 {
     return sal_False;   // indicate that ImplSVMainHook is not implemented
 }
 
-#else
-// MACOSX cocoa implementation of ImplSVMainHook is in aqua/source/app/salinst.cxx
-#ifndef QUARTZ  // MACOSX (X11) needs the CFRunLoop()
-#include <osl/thread.h>
-#include <premac.h>
-#include <CoreFoundation/CoreFoundation.h>
-#include <postmac.h>
-#include <unistd.h>
-
-extern sal_Bool ImplSVMain();
-
-// ============================================================================
-
-
-static void SourceContextCallBack( void *pInfo )
-{
-}
-
-struct ThreadContext
-{
-    int* pRet;
-    CFRunLoopRef* pRunLoopRef;
-};
-
-static void RunSVMain(void *pData)
-{
-    ThreadContext* tcx = reinterpret_cast<ThreadContext*>(pData);
-
-    // busy waiting (ok in this case) until the run loop is
-    // running
-    while (!CFRunLoopIsWaiting(*tcx->pRunLoopRef))
-        usleep(100);
-        
-    *tcx->pRet = ImplSVMain();
-
-    // Force exit since some JVMs won't shutdown when only exit() is invoked
-    _exit( 0 );
-}
-
-sal_Bool ImplSVMainHook( int *pnInit )
-{
-    // Mac OS X requires that any Cocoa code have a CFRunLoop started in the
-    // primordial thread. Since all of the AWT classes in Java 1.4 and higher
-    // are written in Cocoa, we need to start the CFRunLoop here and run
-    // ImplSVMain() in a secondary thread.
-    // See http://developer.apple.com/samplecode/simpleJavaLauncher/listing3.html
-    // for further details and an example
-
-    CFRunLoopRef runLoopRef = CFRunLoopGetCurrent();
-    ThreadContext tcx;
-    tcx.pRet = pnInit;  // the return value
-    tcx.pRunLoopRef = &runLoopRef;
-    oslThread hThreadID = osl_createThread(RunSVMain, &tcx);
-
-    // Start the CFRunLoop
-    CFRunLoopSourceContext aSourceContext;
-    aSourceContext.version = 0;
-    aSourceContext.info = NULL;
-    aSourceContext.retain = NULL;
-    aSourceContext.release = NULL;
-    aSourceContext.copyDescription = NULL;
-    aSourceContext.equal = NULL;
-    aSourceContext.hash = NULL;
-    aSourceContext.schedule = NULL;
-    aSourceContext.cancel = NULL;
-    aSourceContext.perform = &SourceContextCallBack;
-    CFRunLoopSourceRef aSourceRef = CFRunLoopSourceCreate(NULL, 0, &aSourceContext);
-    CFRunLoopAddSource(runLoopRef, aSourceRef, kCFRunLoopCommonModes);
-    CFRunLoopRun();
-
-    osl_joinWithThread( hThreadID );
-    osl_destroyThread( hThreadID );
-
-    return sal_True;    // indicate that ImplSVMainHook is implemented
-}
-
-#endif // MACOSX
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list