blob: b73949eee465b47b29b7561cdf6a6ae9a22b30b3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
Index: vcl/unx/gtk/app/gtkinst.cxx
===================================================================
RCS file: /cvs/gsl/vcl/unx/gtk/app/gtkinst.cxx,v
retrieving revision 1.14.88.1
diff -u -r1.14.88.1 gtkinst.cxx
--- vcl/unx/gtk/app/gtkinst.cxx 10 Aug 2006 14:53:08 -0000 1.14.88.1
+++ vcl/unx/gtk/app/gtkinst.cxx 21 Aug 2006 05:38:21 -0000
@@ -43,6 +43,7 @@
#include <plugins/gtk/atkbridge.hxx>
#include <rtl/strbuf.hxx>
+#include <rtl/ustrbuf.hxx>
#if OSL_DEBUG_LEVEL > 1
#include <stdio.h>
@@ -111,13 +112,28 @@
GtkHookedYieldMutex *pYieldMutex = GET_YIELD_MUTEX();
pYieldMutex->ThreadsLeave();
}
- static bool hookLocks( oslModule pModule )
+ static bool hookLocks( void )
{
typedef void (*GdkLockFn) (GCallback enter_fn, GCallback leave_fn);
rtl::OUString aSymbolName( RTL_CONSTASCII_USTRINGPARAM( "gdk_threads_set_lock_functions") );
+ /* XXX GDK library path should be set by configure. */
+ OUStringBuffer aModName( 128 );
+ aModName.appendAscii( SAL_DLLPREFIX"gdk-x11-2.0" );
+ aModName.appendAscii( SAL_DLLEXTENSION );
+ OUString aModule = aModName.makeStringAndClear();
+ oslModule aMod = osl_loadModule( aModule.pData, SAL_LOADMODULE_DEFAULT );
+
+ if ( !aMod )
+ {
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "Failed to load "SAL_DLLPREFIX"gdk-x11-2.0"SAL_DLLEXTENSION"\n" );
+#endif
+ return false;
+ }
+
GdkLockFn gdk_threads_set_lock_functions =
- (GdkLockFn) osl_getFunctionSymbol( pModule, aSymbolName.pData );
+ (GdkLockFn) osl_getFunctionSymbol( aMod, aSymbolName.pData );
if ( !gdk_threads_set_lock_functions )
{
#if OSL_DEBUG_LEVEL > 1
@@ -150,7 +166,7 @@
if ( !g_thread_supported() )
g_thread_init( NULL );
- if ( hookLocks( pModule ) )
+ if ( hookLocks() )
pYieldMutex = new GtkHookedYieldMutex();
else
pYieldMutex = new GtkYieldMutex();
|