diff options
author | Rüdiger Timm <rt@openoffice.org> | 2005-01-31 08:22:57 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2005-01-31 08:22:57 +0000 |
commit | 57fb2666c1cc95531a11d8dd0907e1d90116f15d (patch) | |
tree | 8ba778bfbf8a2bb93aea533c68dd54153bfc0592 | |
parent | d281568b957d7f4119ca273e11115470fa856aab (diff) |
INTEGRATION: CWS vcl34 (1.4.26); FILE MERGED
2005/01/12 15:29:58 dv 1.4.26.1: #107733# Use osl_loadModule instead of LoadLibrary
-rw-r--r-- | vcl/win/source/gdi/salnativewidgets-luna.cxx | 48 |
1 files changed, 36 insertions, 12 deletions
diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx index 8ae2297854bc..81cfc510b417 100644 --- a/vcl/win/source/gdi/salnativewidgets-luna.cxx +++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx @@ -2,9 +2,9 @@ * * $RCSfile: salnativewidgets-luna.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: obo $ $Date: 2004-11-16 15:18:06 $ + * last change: $Author: rt $ $Date: 2005-01-31 09:22:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -72,6 +72,11 @@ #include <saldata.hxx> #endif +#ifndef _RTL_USTRING_H_ +#include <rtl/ustring.h> +#endif +#include <osl/module.h> + #include "uxtheme.h" #include "tmschema.h" @@ -107,7 +112,7 @@ private: DrawThemeText_Proc_T lpfnDrawThemeText; GetThemePartSize_Proc_T lpfnGetThemePartSize; - HMODULE mhModule; + oslModule mhModule; public: VisualStylesAPI(); @@ -126,19 +131,38 @@ static VisualStylesAPI vsAPI; VisualStylesAPI::VisualStylesAPI() { - mhModule = LoadLibraryA("uxtheme.dll"); - - lpfnOpenThemeData = (OpenThemeData_Proc_T) GetProcAddress( mhModule, "OpenThemeData" ); - lpfnCloseThemeData = (CloseThemeData_Proc_T) GetProcAddress( mhModule, "CloseThemeData" ); - lpfnGetThemeBackgroundContentRect = (GetThemeBackgroundContentRect_Proc_T) GetProcAddress( mhModule, "GetThemeBackgroundContentRect" ); - lpfnDrawThemeBackground = (DrawThemeBackground_Proc_T) GetProcAddress( mhModule, "DrawThemeBackground" ); - lpfnDrawThemeText = (DrawThemeText_Proc_T) GetProcAddress( mhModule, "DrawThemeText" ); - lpfnGetThemePartSize = (GetThemePartSize_Proc_T) GetProcAddress( mhModule, "GetThemePartSize" ); + OUString aLibraryName( RTL_CONSTASCII_USTRINGPARAM( "uxtheme.dll" ) ); + mhModule = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT ); + + if ( mhModule ) + { + OUString queryFuncName( RTL_CONSTASCII_USTRINGPARAM( "OpenThemeData" ) ); + lpfnOpenThemeData = (OpenThemeData_Proc_T) osl_getSymbol( mhModule, queryFuncName.pData ); + queryFuncName = OUString( RTL_CONSTASCII_USTRINGPARAM( "CloseThemeData" ) ); + lpfnCloseThemeData = (CloseThemeData_Proc_T) osl_getSymbol( mhModule, queryFuncName.pData ); + queryFuncName = OUString( RTL_CONSTASCII_USTRINGPARAM( "GetThemeBackgroundContentRect" ) ); + lpfnGetThemeBackgroundContentRect = (GetThemeBackgroundContentRect_Proc_T) osl_getSymbol( mhModule, queryFuncName.pData ); + queryFuncName = OUString( RTL_CONSTASCII_USTRINGPARAM( "DrawThemeBackground" ) ); + lpfnDrawThemeBackground = (DrawThemeBackground_Proc_T) osl_getSymbol( mhModule, queryFuncName.pData ); + queryFuncName = OUString( RTL_CONSTASCII_USTRINGPARAM( "DrawThemeText" ) ); + lpfnDrawThemeText = (DrawThemeText_Proc_T) osl_getSymbol( mhModule, queryFuncName.pData ); + queryFuncName = OUString( RTL_CONSTASCII_USTRINGPARAM( "GetThemePartSize" ) ); + lpfnGetThemePartSize = (GetThemePartSize_Proc_T) osl_getSymbol( mhModule, queryFuncName.pData ); + } + else + { + lpfnOpenThemeData = NULL; + lpfnCloseThemeData = NULL; + lpfnGetThemeBackgroundContentRect = NULL; + lpfnDrawThemeBackground = NULL; + lpfnDrawThemeText = NULL; + lpfnGetThemePartSize = NULL; + } } VisualStylesAPI::~VisualStylesAPI() { if( mhModule ) - FreeLibrary( mhModule ); + osl_unloadModule( mhModule ); } HTHEME VisualStylesAPI::OpenThemeData( HWND hwnd, LPCWSTR pszClassList ) { |