Move the wxDL_ macros to wxDynLibrary
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48586 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -105,6 +105,27 @@ enum wxPluginCategory
|
|||||||
#define wxDYNLIB_FUNCTION(type, name, dynlib) \
|
#define wxDYNLIB_FUNCTION(type, name, dynlib) \
|
||||||
type pfn ## name = (type)(dynlib).GetSymbol(_T(#name))
|
type pfn ## name = (type)(dynlib).GetSymbol(_T(#name))
|
||||||
|
|
||||||
|
|
||||||
|
// the following macros can be used to redirect a whole
|
||||||
|
// library to a class and check at run-time if the the
|
||||||
|
// library is present and contains all required methods.
|
||||||
|
|
||||||
|
#define wxDL_METHOD_DEFINE( rettype, name, args, shortargs, defret ) \
|
||||||
|
typedef rettype (* name ## Type) args ; \
|
||||||
|
name ## Type pfn_ ## name; \
|
||||||
|
rettype name args \
|
||||||
|
{ if (m_ok) return pfn_ ## name shortargs ; return defret; }
|
||||||
|
|
||||||
|
#define wxDL_VOIDMETHOD_DEFINE( name, args, shortargs ) \
|
||||||
|
typedef void (* name ## Type) args ; \
|
||||||
|
name ## Type pfn_ ## name; \
|
||||||
|
void name args \
|
||||||
|
{ if (m_ok) pfn_ ## name shortargs ; }
|
||||||
|
|
||||||
|
#define wxDL_METHOD_LOAD( lib, name, success ) \
|
||||||
|
pfn_ ## name = (name ## Type) lib->GetSymbol( wxT(#name), &success ); \
|
||||||
|
if (!success) return;
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxDynamicLibraryDetails: contains details about a loaded wxDynamicLibrary
|
// wxDynamicLibraryDetails: contains details about a loaded wxDynamicLibrary
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -49,16 +49,6 @@ wxFORCE_LINK_THIS_MODULE(gnome_print)
|
|||||||
// wxGnomePrintLibrary
|
// wxGnomePrintLibrary
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
#define wxDL_METHOD_DEFINE( rettype, name, args, shortargs, defret ) \
|
|
||||||
typedef rettype (* name ## Type) args ; \
|
|
||||||
name ## Type pfn_ ## name; \
|
|
||||||
rettype name args \
|
|
||||||
{ if (m_ok) return pfn_ ## name shortargs ; return defret; }
|
|
||||||
|
|
||||||
#define wxDL_METHOD_LOAD( lib, name, success ) \
|
|
||||||
pfn_ ## name = (name ## Type) lib->GetSymbol( wxT(#name), &success ); \
|
|
||||||
if (!success) return;
|
|
||||||
|
|
||||||
class wxGnomePrintLibrary
|
class wxGnomePrintLibrary
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@@ -36,16 +36,6 @@ wxFORCE_LINK_THIS_MODULE(gnome_vfs)
|
|||||||
// wxGnomeVFSLibrary
|
// wxGnomeVFSLibrary
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
#define wxDL_METHOD_DEFINE( rettype, name, args, shortargs, defret ) \
|
|
||||||
typedef rettype (* name ## Type) args ; \
|
|
||||||
name ## Type pfn_ ## name; \
|
|
||||||
rettype name args \
|
|
||||||
{ if (m_ok) return pfn_ ## name shortargs ; return defret; }
|
|
||||||
|
|
||||||
#define wxDL_METHOD_LOAD( lib, name, success ) \
|
|
||||||
pfn_ ## name = (name ## Type) lib->GetSymbol( wxT(#name), &success ); \
|
|
||||||
if (!success) return;
|
|
||||||
|
|
||||||
class wxGnomeVFSLibrary
|
class wxGnomeVFSLibrary
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@@ -1665,22 +1665,6 @@ enum
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// QT Library
|
// QT Library
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
#define wxDL_METHOD_DEFINE( rettype, name, args, shortargs, defret ) \
|
|
||||||
typedef rettype (* name ## Type) args ; \
|
|
||||||
name ## Type pfn_ ## name; \
|
|
||||||
rettype name args \
|
|
||||||
{ if (m_ok) return pfn_ ## name shortargs ; return defret; }
|
|
||||||
|
|
||||||
#define wxDL_VOIDMETHOD_DEFINE( name, args, shortargs ) \
|
|
||||||
typedef void (* name ## Type) args ; \
|
|
||||||
name ## Type pfn_ ## name; \
|
|
||||||
void name args \
|
|
||||||
{ if (m_ok) pfn_ ## name shortargs ; }
|
|
||||||
|
|
||||||
#define wxDL_METHOD_LOAD( lib, name, success ) \
|
|
||||||
pfn_ ## name = (name ## Type) lib.GetSymbol( wxT(#name), &success ); \
|
|
||||||
if (!success) return false
|
|
||||||
|
|
||||||
|
|
||||||
class WXDLLIMPEXP_MEDIA wxQuickTimeLibrary
|
class WXDLLIMPEXP_MEDIA wxQuickTimeLibrary
|
||||||
{
|
{
|
||||||
|
@@ -171,22 +171,6 @@ enum
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// QT Library
|
// QT Library
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
#define wxDL_METHOD_DEFINE( rettype, name, args, shortargs, defret ) \
|
|
||||||
typedef rettype (* name ## Type) args ; \
|
|
||||||
name ## Type pfn_ ## name; \
|
|
||||||
rettype name args \
|
|
||||||
{ if (m_ok) return pfn_ ## name shortargs ; return defret; }
|
|
||||||
|
|
||||||
#define wxDL_VOIDMETHOD_DEFINE( name, args, shortargs ) \
|
|
||||||
typedef void (* name ## Type) args ; \
|
|
||||||
name ## Type pfn_ ## name; \
|
|
||||||
void name args \
|
|
||||||
{ if (m_ok) pfn_ ## name shortargs ; }
|
|
||||||
|
|
||||||
#define wxDL_METHOD_LOAD( lib, name, success ) \
|
|
||||||
pfn_ ## name = (name ## Type) lib.GetSymbol( wxT(#name), &success ); \
|
|
||||||
if (!success) return false
|
|
||||||
|
|
||||||
|
|
||||||
class WXDLLIMPEXP_MEDIA wxQuickTimeLibrary
|
class WXDLLIMPEXP_MEDIA wxQuickTimeLibrary
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user