diff options
Diffstat (limited to 'extensions/source/plugin/unx/npwrap.cxx')
-rw-r--r-- | extensions/source/plugin/unx/npwrap.cxx | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/extensions/source/plugin/unx/npwrap.cxx b/extensions/source/plugin/unx/npwrap.cxx index 7124972d8578..04f4bbbacf5a 100644 --- a/extensions/source/plugin/unx/npwrap.cxx +++ b/extensions/source/plugin/unx/npwrap.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -47,9 +47,9 @@ PluginConnector* pConnector = NULL; -int nAppArguments = 0; -char** pAppArguments = NULL; -Display* pAppDisplay = NULL; +int nAppArguments = 0; +char** pAppArguments = NULL; +Display* pAppDisplay = NULL; Display* pXtAppDisplay = NULL; extern oslModule pPluginLib; @@ -65,7 +65,7 @@ static bool bPluginAppQuit = false; static long GlobalConnectionLostHdl( void* /*pInst*/, void* /*pArg*/ ) { medDebug( 1, "pluginapp exiting due to connection lost\n" ); - + write( wakeup_fd[1], "xxxx", 4 ); return 0; } @@ -76,14 +76,14 @@ extern "C" { return 0; } - + #ifndef ENABLE_GTK static void ThreadEventHandler( XtPointer /*client_data*/, int* /*source*/, XtInputId* id ) { char buf[256]; // clear pipe int len, nLast = -1; - + while( (len = read( wakeup_fd[0], buf, sizeof( buf ) ) ) > 0 ) nLast = len-1; if( ! bPluginAppQuit ) @@ -114,7 +114,7 @@ IMPL_LINK( PluginConnector, NewMessageHdl, Mediator*, /*pMediator*/ ) medDebug( 1, "new message handler\n" ); write( wakeup_fd[1], "cccc", 4 ); return 0; - + } Widget createSubWidget( char* /*pPluginText*/, Widget shell, XLIB_Window aParentWindow ) @@ -145,7 +145,7 @@ Widget createSubWidget( char* /*pPluginText*/, Widget shell, XLIB_Window aParent 0, 0 ); XtMapWidget( shell ); XtMapWidget( newWidget ); - XRaiseWindow( pXtAppDisplay, XtWindow( shell ) ); + XRaiseWindow( pXtAppDisplay, XtWindow( shell ) ); XSync( pXtAppDisplay, False ); return newWidget; @@ -192,7 +192,7 @@ static oslModule LoadModule( const char* pPath ) static void CheckPlugin( const char* pPath ) { oslModule pLib = LoadModule( pPath ); - + char*(*pNP_GetMIMEDescription)() = (char*(*)()) osl_getAsciiFunctionSymbol( pLib, "NP_GetMIMEDescription" ); if( pNP_GetMIMEDescription ) @@ -279,7 +279,7 @@ static gboolean pollXtTimerCallback(gpointer) static gboolean prepareWakeupEvent( GSource*, gint* ) { struct pollfd aPoll = { wakeup_fd[0], POLLIN, 0 }; - poll( &aPoll, 1, 0 ); + poll( &aPoll, 1, 0 ); return (aPoll.revents & POLLIN ) != 0; } @@ -294,7 +294,7 @@ static gboolean dispatchWakeupEvent( GSource*, GSourceFunc, gpointer ) char buf[256]; // clear pipe int len, nLast = -1; - + while( (len = read( wakeup_fd[0], buf, sizeof( buf ) ) ) > 0 ) nLast = len-1; if( ( nLast == -1 || buf[nLast] != 'x' ) && pConnector ) @@ -307,7 +307,7 @@ static gboolean dispatchWakeupEvent( GSource*, GSourceFunc, gpointer ) delete pConnector; pConnector = NULL; } - + return TRUE; } @@ -359,7 +359,7 @@ int main( int argc, char **argv) } // initialize 'wakeup' pipe. int flags; - + // set close-on-exec descriptor flag. if ((flags = fcntl (wakeup_fd[0], F_GETFD)) != -1) { @@ -371,7 +371,7 @@ int main( int argc, char **argv) flags |= FD_CLOEXEC; fcntl (wakeup_fd[1], F_SETFD, flags); } - + // set non-blocking I/O flag. if ((flags = fcntl (wakeup_fd[0], F_GETFL)) != -1) { @@ -390,7 +390,7 @@ int main( int argc, char **argv) exit(255); } int nSocket = atol( argv[1] ); - + #ifdef ENABLE_GTK g_thread_init(NULL); gtk_init(&argc, &argv); @@ -416,7 +416,7 @@ int main( int argc, char **argv) medDebug( 1, "could not get Xt GSource" ); return 1; } - + g_source_set_priority( pXTSource, GDK_PRIORITY_EVENTS ); g_source_set_can_recurse( pXTSource, TRUE ); g_source_attach( pXTSource, NULL ); @@ -424,7 +424,7 @@ int main( int argc, char **argv) aXtPollDesc.events = G_IO_IN; aXtPollDesc.revents = 0; g_source_add_poll( pXTSource, &aXtPollDesc ); - + gint xt_polling_timer_id = g_timeout_add( 25, pollXtTimerCallback, NULL); // Initialize wakeup events listener GSource *pWakeupSource = g_source_new( &aWakeupEventFuncs, sizeof(GSource) ); @@ -491,7 +491,7 @@ int main( int argc, char **argv) #ifdef ENABLE_GTK g_source_remove(xt_polling_timer_id); #endif - + pNP_Shutdown(); medDebug( 1, "NP_Shutdown done\n" ); osl_unloadModule( pPluginLib ); |