modified configure to allow configuration of wxMotif under Darwin/Mac OS X
wxWindows can be configured as wxMac or wxMotif under Mac OS X replaced __WXMAC_X__ define by __DARWIN__ (general Darwin related issues) moved dlopen/dlerror code to dynlib.cpp to make it available for wxMotif git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11061 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
34
configure.in
34
configure.in
@@ -40,7 +40,7 @@ AC_DEFUN(WX_PATH_FIND_LIBRARIES,
|
||||
ac_find_libraries=
|
||||
for ac_dir in $1;
|
||||
do
|
||||
for ac_extension in a so sl; do
|
||||
for ac_extension in a so sl dylib; do
|
||||
if test -f "$ac_dir/lib$2.$ac_extension"; then
|
||||
ac_find_libraries=$ac_dir
|
||||
break 2
|
||||
@@ -393,6 +393,7 @@ USE_SUNOS=
|
||||
USE_ALPHA=
|
||||
USE_OSF=
|
||||
USE_BSD=
|
||||
USE_DARWIN=
|
||||
USE_FREEBSD=
|
||||
USE_OPENBSD=
|
||||
USE_NETBSD=
|
||||
@@ -556,9 +557,9 @@ case "${host}" in
|
||||
|
||||
*-*-darwin* )
|
||||
USE_BSD=1
|
||||
USE_MAC=1
|
||||
AC_DEFINE(__MAC__)
|
||||
USE_DARWIN=1
|
||||
AC_DEFINE(__BSD__)
|
||||
AC_DEFINE(__DARWIN__)
|
||||
AC_DEFINE(__UNIX__)
|
||||
DEFAULT_DEFAULT_wxUSE_MAC=1
|
||||
;;
|
||||
@@ -2245,6 +2246,9 @@ if test "$wxUSE_SHARED" = "yes"; then
|
||||
fi
|
||||
;;
|
||||
*-*-darwin* )
|
||||
TOOLKIT_DEF="${TOOLKIT_DEF} -D__UNIX__ -D__DARWIN__ -D__POWERPC__"
|
||||
CFLAGS="${CFLAGS} -fno-common"
|
||||
CPPFLAGS="${CPPFLAGS} -fno-common"
|
||||
SHARED_LD="${CXX} -dynamiclib -o"
|
||||
PIC_FLAG="-dynamic -fPIC"
|
||||
if test "$wxUSE_OPENGL" = "yes"; then
|
||||
@@ -2254,8 +2258,10 @@ if test "$wxUSE_SHARED" = "yes"; then
|
||||
WX_ALL_INSTALLED="CREATE_INSTALLED_LINKS"
|
||||
WX_ALL="CREATE_LINKS"
|
||||
fi
|
||||
dnl add the resources target
|
||||
WX_ALL="${WX_ALL} ./lib/lib${WX_LIBRARY}-${WX_RELEASE}.r"
|
||||
dnl add the resources target for wxMac
|
||||
if test "$wxUSE_MAC" = 1 ; then
|
||||
WX_ALL="${WX_ALL} ./lib/lib${WX_LIBRARY}-${WX_RELEASE}.r"
|
||||
fi
|
||||
dnl the name of the shared library
|
||||
WX_LIBRARY_NAME_SHARED="lib${WX_LIBRARY}-${WX_RELEASE}.dylib.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}"
|
||||
WX_LIBRARY_NAME_SHARED_GL="lib${WX_LIBRARY}_gl-${WX_RELEASE}.dylib.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}"
|
||||
@@ -2775,7 +2781,7 @@ if test "$USE_BEOS" = 1; then
|
||||
HAVE_SOME_SLEEP_FUNC=1
|
||||
fi
|
||||
|
||||
if test "$USE_MAC" = 1; then
|
||||
if test "$USE_DARWIN" = 1; then
|
||||
dnl Mac OS X has both nanosleep and usleep
|
||||
dnl but only usleep is defined in unistd.h
|
||||
AC_DEFINE(HAVE_USLEEP)
|
||||
@@ -3055,8 +3061,8 @@ fi
|
||||
if test "$wxUSE_THREADS" = "yes"; then
|
||||
AC_DEFINE(wxUSE_THREADS)
|
||||
|
||||
dnl must define _REENTRANT for multithreaded code except for Mac OS X
|
||||
if test "$wxUSE_MAC" = "0"; then
|
||||
dnl must define _REENTRANT for multithreaded code except for Darwin/Mac OS X
|
||||
if test "$wxUSE_DARWIN" = "0"; then
|
||||
CFLAGS="${CFLAGS} -D_REENTRANT"
|
||||
CXXFLAGS="${CXXFLAGS} -D_REENTRANT"
|
||||
fi
|
||||
@@ -3095,9 +3101,9 @@ if test "$WXWINE" = 1 ; then
|
||||
fi
|
||||
|
||||
if test "$wxUSE_MAC" = 1 ; then
|
||||
TOOLKIT_DEF="${TOOLKIT_DEF} -D__UNIX__ -D__POWERPC__ -DTARGET_CARBON"
|
||||
CFLAGS="${CFLAGS} -fno-common -fpascal-strings"
|
||||
CPPFLAGS="${CPPFLAGS} -cpp-precomp -fno-common -fpascal-strings"
|
||||
TOOLKIT_DEF="${TOOLKIT_DEF} -DTARGET_CARBON"
|
||||
CFLAGS="${CFLAGS} -fpascal-strings"
|
||||
CPPFLAGS="${CPPFLAGS} -cpp-precomp -fpascal-strings"
|
||||
AC_CHECK_PROG(REZ, Rez, Rez, /Developer/Tools/Rez)
|
||||
AC_CHECK_PROG(DEREZ, Derez, Derez, /Developer/Tools/Derez)
|
||||
RESCOMP=${REZ}
|
||||
@@ -3765,8 +3771,8 @@ if test "$TOOLKIT" != "MSW"; then
|
||||
HAVE_DL_FUNCS=0
|
||||
HAVE_SHL_FUNCS=0
|
||||
if test "$wxUSE_DYNLIB_CLASS" = "yes"; then
|
||||
if test "$USE_MAC" = 1; then
|
||||
dnl Mac OS X needs dl_macosx.c to be compiled in to fake dlopen/dlerror
|
||||
if test "$USE_DARWIN" = 1; then
|
||||
dnl dlopen/dlerror is implemented in dynlib.cpp for Darwin/Mac OS X
|
||||
HAVE_DL_FUNCS=1
|
||||
else
|
||||
dnl the test is a bit complicated because we check for dlopen() both with
|
||||
@@ -4430,7 +4436,7 @@ dnl
|
||||
dnl note that we always link with -lm except for Mac OS X
|
||||
dnl extended.c uses floor() and is always linked in
|
||||
EXTRA_LIBS="$LIBS $POSIX4_LINK $INET_LINK $WCHAR_LINK $THREADS_LINK $DMALLOC_LINK $DL_LINK $ZLIB_LINK -lm"
|
||||
if test "$USE_MAC" = 1 ; then
|
||||
if test "$wxUSE_MAC" = 1 ; then
|
||||
EXTRA_LIBS="$EXTRA_LIBS -framework Carbon -framework System"
|
||||
fi
|
||||
if test "$wxUSE_GUI" = "yes"; then
|
||||
|
@@ -65,6 +65,9 @@ public:
|
||||
|
||||
// the virtual functions which may/must be overridden in the derived class
|
||||
// -----------------------------------------------------------------------
|
||||
#ifdef __DARWIN__
|
||||
virtual ~wxAppBase() { }
|
||||
#endif
|
||||
|
||||
// called during the program initialization, returning FALSE from here
|
||||
// prevents the program from continuing - it's a good place to create
|
||||
@@ -315,11 +318,6 @@ protected:
|
||||
// does any of our windows has focus?
|
||||
bool m_isActive;
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
#ifdef __WXMAC_X__
|
||||
public:
|
||||
virtual ~wxAppBase() {} // Added min for Mac X
|
||||
#endif
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -38,7 +38,7 @@ class WXDLLEXPORT wxChoiceBase : public wxControlWithItems
|
||||
{
|
||||
public:
|
||||
// all generic methods are in wxControlWithItems
|
||||
#ifdef __WXMAC_X__
|
||||
#ifdef __DARWIN__
|
||||
virtual ~wxChoiceBase() {}
|
||||
#endif
|
||||
|
||||
|
@@ -48,8 +48,8 @@ public:
|
||||
// get the control alignment (left/right/centre, top/bottom/centre)
|
||||
int GetAlignment() const { return m_windowStyle & wxALIGN_MASK; }
|
||||
|
||||
#ifdef __WXMAC_X__
|
||||
virtual ~wxControlBase() { } // Added min for Mac X
|
||||
#ifdef __DARWIN__
|
||||
virtual ~wxControlBase() { }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
@@ -86,8 +86,8 @@ public:
|
||||
int Number() const { return GetCount(); }
|
||||
#endif // WXWIN_COMPATIBILITY_2_2
|
||||
|
||||
#ifdef __WXMAC_X__
|
||||
virtual ~wxItemContainer() {} // Added min for Mac X
|
||||
#ifdef __DARWIN__
|
||||
virtual ~wxItemContainer() { }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
@@ -112,41 +112,26 @@
|
||||
#define __HPUX__
|
||||
#endif // HP-UX
|
||||
|
||||
#if defined(__APPLE__)
|
||||
// MacOS X
|
||||
#ifndef __WXMAC__
|
||||
#define __WXMAC__
|
||||
#endif
|
||||
#ifndef __WXMAC_X__
|
||||
// This define really should not be necessary since __WXMAC__
|
||||
// combined with __UNIX__ is sufficient to differentiate
|
||||
// Classic Mac OS from Mac OS X. However, some code has been
|
||||
// added to workaround defects(?) in the bundled gcc compiler
|
||||
// and these corrections are identified by __WXMAC_X__
|
||||
#define __WXMAC_X__
|
||||
#endif
|
||||
#if defined(__WXMAC__) && defined(__DARWIN__)
|
||||
// Mac OS X
|
||||
|
||||
// Some code has been added to workaround defects(?) in the
|
||||
// bundled gcc compiler. These corrections are identified by:
|
||||
// __DARWIN__ for corrections necessary for Darwin (wxMac, wxMotif)
|
||||
|
||||
#include <Carbon/Carbon.h>
|
||||
#endif // __APPLE__
|
||||
#endif // __WXMAC__ && __DARWIN__
|
||||
#elif defined(applec) || \
|
||||
defined(THINK_C) || \
|
||||
(defined(__MWERKS__) && !defined(__INTEL__))
|
||||
// MacOS
|
||||
#elif defined(__WXMAC__) && defined(__APPLE__)
|
||||
// MacOS X
|
||||
#elif defined(__WXMAC__) && defined(__DARWIN__)
|
||||
// Mac OS X
|
||||
#define __UNIX_LIKE__
|
||||
|
||||
#ifndef __WXMAC__
|
||||
#define __WXMAC__
|
||||
#endif
|
||||
#ifndef __WXMAC_X__
|
||||
// This define really should not be necessary since __WXMAC__
|
||||
// combined with __UNIX__ is sufficient to differentiate
|
||||
// Classic Mac OS from Mac OS X. However, some code has been
|
||||
// added to workaround defects(?) in the bundled gcc compiler
|
||||
// and these corrections are identified by __WXMAC_X__
|
||||
#define __WXMAC_X__
|
||||
#endif
|
||||
// Some code has been added to workaround defects(?) in the
|
||||
// bundled gcc compiler. These corrections are identified by:
|
||||
// __DARWIN__ for corrections necessary for Darwin (wxMac, wxMotif)
|
||||
|
||||
#include <Carbon/Carbon.h>
|
||||
#elif defined(__OS2__)
|
||||
|
@@ -22,8 +22,8 @@
|
||||
class WXDLLEXPORT wxDialogBase : public wxPanel
|
||||
{
|
||||
public:
|
||||
#ifdef __WXMAC_X__
|
||||
~wxDialogBase() {} // Added min for Mac X
|
||||
#ifdef __DARWIN__
|
||||
~wxDialogBase() { }
|
||||
#endif
|
||||
// the modal dialogs have a return code - usually the id of the last
|
||||
// pressed button
|
||||
|
@@ -48,7 +48,7 @@
|
||||
#elif defined(__WINDOWS__)
|
||||
# include <windows.h> // needed to get HMODULE
|
||||
typedef HMODULE wxDllType;
|
||||
#elif defined(__APPLE__) && defined(__UNIX__)
|
||||
#elif defined(__DARWIN__)
|
||||
typedef void *wxDllType;
|
||||
#elif defined(__WXMAC__)
|
||||
typedef CFragConnectionID wxDllType;
|
||||
|
@@ -23,7 +23,7 @@ enum
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/filedlg.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#ifdef __WXMAC_X__
|
||||
#ifdef __DARWIN__
|
||||
#include "wx/generic/filedlgg.h"
|
||||
#else
|
||||
#include "wx/mac/filedlg.h"
|
||||
|
@@ -78,8 +78,8 @@ class WXDLLEXPORT wxFontBase : public wxGDIObject
|
||||
{
|
||||
public:
|
||||
// creator function
|
||||
#ifdef __WXMAC_X__
|
||||
virtual ~wxFontBase() {} // Added min for Mac X
|
||||
#ifdef __DARWIN__
|
||||
virtual ~wxFontBase() { }
|
||||
#endif
|
||||
|
||||
// from the font components
|
||||
|
@@ -58,8 +58,8 @@ class WXDLLEXPORT wxFrameBase : public wxWindow
|
||||
public:
|
||||
// construction
|
||||
wxFrameBase();
|
||||
#ifdef __WXMAC_X__
|
||||
virtual ~wxFrameBase() {} // Added min for Mac X
|
||||
#ifdef __DARWIN__
|
||||
virtual ~wxFrameBase() { }
|
||||
#endif
|
||||
|
||||
wxFrame *New(wxWindow *parent,
|
||||
|
@@ -31,7 +31,7 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxGaugeNameStr;
|
||||
class WXDLLEXPORT wxGaugeBase : public wxControl
|
||||
{
|
||||
public:
|
||||
#ifdef __WXMAC_X__
|
||||
#ifdef __DARWIN__
|
||||
virtual ~wxGaugeBase() { }
|
||||
#endif
|
||||
bool Create(wxWindow *parent,
|
||||
|
@@ -31,10 +31,8 @@
|
||||
#ifdef __WXMSW__
|
||||
#define wxMulDivInt32( a , b , c ) ::MulDiv( a , b , c )
|
||||
#elif defined( __WXMAC__ )
|
||||
#ifdef __WXMAC_X__
|
||||
#include <CoreServices/CoreServices.h>
|
||||
#else
|
||||
#include "Math64.h"
|
||||
#ifndef __DARWIN__
|
||||
#include "Math64.h"
|
||||
#endif
|
||||
#define wxMulDivInt32( a , b , c ) S32Set( S64Div( S64Multiply( S64Set(a) , S64Set(b) ) , S64Set(c) ) )
|
||||
#else
|
||||
|
@@ -485,8 +485,8 @@ class WXDLLEXPORT wxList : public wxObjectList
|
||||
{
|
||||
public:
|
||||
wxList(int key_type = wxKEY_NONE) : wxObjectList((wxKeyType)key_type) { }
|
||||
#ifdef __WXMAC_X__
|
||||
~wxList() {} // Added min for Mac X
|
||||
#ifdef __DARWIN__
|
||||
~wxList() { }
|
||||
#endif
|
||||
|
||||
wxList& operator=(const wxList& list)
|
||||
|
@@ -45,8 +45,8 @@ class WXDLLEXPORT wxListBoxBase : public wxControlWithItems
|
||||
public:
|
||||
// all generic methods are in wxControlWithItems, except for the following
|
||||
// ones which are not yet implemented by wxChoice/wxCombobox
|
||||
#ifdef __WXMAC_X__
|
||||
virtual ~wxListBoxBase() {} // Added min for Mac X
|
||||
#ifdef __DARWIN__
|
||||
virtual ~wxListBoxBase() { }
|
||||
#endif
|
||||
|
||||
void Insert(const wxString& item, int pos)
|
||||
|
@@ -101,8 +101,8 @@ class WXDLLEXPORT wxBitmapHandler: public wxBitmapHandlerBase
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
|
||||
public:
|
||||
wxBitmapHandler() { m_name = ""; m_extension = ""; m_type = 0; };
|
||||
#ifdef __WXMAC_X__
|
||||
virtual ~wxBitmapHandler() {} // Added min for Mac X
|
||||
#ifdef __DARWIN__
|
||||
virtual ~wxBitmapHandler() { }
|
||||
#endif
|
||||
|
||||
virtual bool Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth = 1);
|
||||
|
@@ -17,13 +17,11 @@
|
||||
#pragma interface "checklst.h"
|
||||
#endif
|
||||
|
||||
#include "wx/listbox.h"
|
||||
|
||||
#if !defined(__MWERKS__) && !defined(__UNIX__)
|
||||
typedef unsigned int size_t;
|
||||
#endif
|
||||
|
||||
class wxCheckListBox : public wxListBox
|
||||
class wxCheckListBox : public wxCheckListBoxBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxCheckListBox)
|
||||
public:
|
||||
|
@@ -24,8 +24,8 @@ class wxDataObject : public wxDataObjectBase
|
||||
{
|
||||
public:
|
||||
wxDataObject();
|
||||
#ifdef __WXMAC_X__
|
||||
~wxDataObject() {} // Added min for Mac X
|
||||
#ifdef __DARWIN__
|
||||
~wxDataObject() { }
|
||||
#endif
|
||||
|
||||
virtual bool IsSupportedFormat( const wxDataFormat& format, Direction dir = Get ) const;
|
||||
|
@@ -24,7 +24,7 @@ class wxMimeTypesManagerImpl
|
||||
{
|
||||
public :
|
||||
wxMimeTypesManagerImpl() { }
|
||||
#ifdef __WXMAC_X__
|
||||
#ifdef __DARWIN__
|
||||
~wxMimeTypesManagerImpl() { }
|
||||
#endif
|
||||
|
||||
|
@@ -18,9 +18,7 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
#include "wx/dynarray.h"
|
||||
#include "wx/event.h"
|
||||
#include "wx/control.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// types
|
||||
|
@@ -20,6 +20,10 @@
|
||||
|
||||
class wxDataObject : public wxDataObjectBase
|
||||
{
|
||||
public:
|
||||
#ifdef __DARWIN__
|
||||
~wxDataObject() { }
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif //_WX_MOTIF_DATAOBJ_H_
|
||||
|
@@ -86,7 +86,7 @@ public:
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(__UNIX__) && !defined(__APPLE__)
|
||||
#if defined(__UNIX__) && !defined(__WXMAC__)
|
||||
#include <sys/socket.h>
|
||||
#ifndef __VMS__
|
||||
# include <sys/un.h>
|
||||
|
@@ -12,12 +12,6 @@
|
||||
#ifndef _WX_SPINBUTT_H_BASE_
|
||||
#define _WX_SPINBUTT_H_BASE_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#if !defined(__WXMOTIF__) && !defined(__WXMAC__) // because there is no matching .cpp
|
||||
#pragma interface "spinbutt.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -30,7 +30,7 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxStaticBitmapNameStr;
|
||||
class WXDLLEXPORT wxStaticBitmapBase : public wxControl
|
||||
{
|
||||
public:
|
||||
#ifdef __WXMAC_X__
|
||||
#ifdef __DARWIN__
|
||||
~wxStaticBitmapBase() { }
|
||||
#endif
|
||||
|
||||
|
@@ -49,8 +49,8 @@ public:
|
||||
void SetOwner(wxEvtHandler *owner, int id = -1)
|
||||
{ m_owner = owner; m_idTimer = id; }
|
||||
|
||||
#ifdef __WXMAC_X__
|
||||
virtual ~wxTimerBase() {} // Added min for Mac X
|
||||
#ifdef __DARWIN__
|
||||
virtual ~wxTimerBase() { }
|
||||
#endif
|
||||
|
||||
// working with the timer
|
||||
|
@@ -76,7 +76,13 @@
|
||||
else
|
||||
return (void *)0;
|
||||
}
|
||||
#elif defined(__APPLE__) && defined(__UNIX__)
|
||||
#elif defined(__DARWIN__)
|
||||
/* Porting notes:
|
||||
* The dlopen port is a port from dl_next.xs by Anno Siegel.
|
||||
* dl_next.xs is itself a port from dl_dlopen.xs by Paul Marquess.
|
||||
* The method used here is just to supply the sun style dlopen etc.
|
||||
* functions in terms of Darwin NS*.
|
||||
*/
|
||||
void *dlopen(const char *path, int mode /* mode is ignored */);
|
||||
void *dlsym(void *handle, const char *symbol);
|
||||
int dlclose(void *handle);
|
||||
@@ -431,4 +437,100 @@ wxObject *wxLibraries::CreateObject(const wxString& path)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef __DARWIN__
|
||||
// ---------------------------------------------------------------------------
|
||||
// For Darwin/Mac OS X
|
||||
// supply the sun style dlopen functions in terms of Darwin NS*
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
extern "C" {
|
||||
#import <mach-o/dyld.h>
|
||||
};
|
||||
|
||||
enum dyldErrorSource
|
||||
{
|
||||
OFImage,
|
||||
};
|
||||
|
||||
static char dl_last_error[1024];
|
||||
|
||||
static
|
||||
void TranslateError(const char *path, enum dyldErrorSource type, int number)
|
||||
{
|
||||
unsigned int index;
|
||||
static char *OFIErrorStrings[] =
|
||||
{
|
||||
"%s(%d): Object Image Load Failure\n",
|
||||
"%s(%d): Object Image Load Success\n",
|
||||
"%s(%d): Not an recognisable object file\n",
|
||||
"%s(%d): No valid architecture\n",
|
||||
"%s(%d): Object image has an invalid format\n",
|
||||
"%s(%d): Invalid access (permissions?)\n",
|
||||
"%s(%d): Unknown error code from NSCreateObjectFileImageFromFile\n",
|
||||
};
|
||||
#define NUM_OFI_ERRORS (sizeof(OFIErrorStrings) / sizeof(OFIErrorStrings[0]))
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case OFImage:
|
||||
index = number;
|
||||
if (index > NUM_OFI_ERRORS - 1) {
|
||||
index = NUM_OFI_ERRORS - 1;
|
||||
}
|
||||
sprintf(dl_last_error, OFIErrorStrings[index], path, number);
|
||||
break;
|
||||
|
||||
default:
|
||||
sprintf(dl_last_error, "%s(%d): Totally unknown error type %d\n",
|
||||
path, number, type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const char *dlerror()
|
||||
{
|
||||
return dl_last_error;
|
||||
}
|
||||
|
||||
void *dlopen(const char *path, int mode /* mode is ignored */)
|
||||
{
|
||||
int dyld_result;
|
||||
NSObjectFileImage ofile;
|
||||
NSModule handle = NULL;
|
||||
|
||||
dyld_result = NSCreateObjectFileImageFromFile(path, &ofile);
|
||||
if (dyld_result != NSObjectFileImageSuccess)
|
||||
{
|
||||
TranslateError(path, OFImage, dyld_result);
|
||||
}
|
||||
else
|
||||
{
|
||||
// NSLinkModule will cause the run to abort on any link error's
|
||||
// not very friendly but the error recovery functionality is limited.
|
||||
handle = NSLinkModule(ofile, path, TRUE);
|
||||
}
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
int dlclose(void *handle) /* stub only */
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void *dlsym(void *handle, const char *symbol)
|
||||
{
|
||||
void *addr;
|
||||
|
||||
if (NSIsSymbolNameDefined(symbol)) {
|
||||
addr = NSAddressOfSymbol(NSLookupAndBindSymbol(symbol));
|
||||
}
|
||||
else {
|
||||
addr = NULL;
|
||||
}
|
||||
return addr;
|
||||
}
|
||||
|
||||
#endif // __DARWIN__
|
||||
|
||||
#endif // wxUSE_DYNLIB_CLASS
|
||||
|
@@ -30,6 +30,7 @@
|
||||
|
||||
#if wxUSE_HTML && wxUSE_PRINTING_ARCHITECTURE && wxUSE_STREAMS
|
||||
|
||||
#include "wx/dc.h"
|
||||
#include "wx/print.h"
|
||||
#include "wx/printdlg.h"
|
||||
#include "wx/html/htmprint.h"
|
||||
|
@@ -44,7 +44,7 @@ END_EVENT_TABLE()
|
||||
// ----------------
|
||||
|
||||
// def ctor: use Create() to really create the control
|
||||
wxCheckListBox::wxCheckListBox() : wxListBox()
|
||||
wxCheckListBox::wxCheckListBox() : wxCheckListBoxBase()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
|
||||
int nStrings, const wxString choices[],
|
||||
long style, const wxValidator& val,
|
||||
const wxString& name)
|
||||
: wxListBox()
|
||||
: wxCheckListBoxBase()
|
||||
{
|
||||
// TODO: you'll probably need a separate Create instead of using
|
||||
// the wxListBox one as here.
|
||||
|
@@ -20,7 +20,7 @@
|
||||
#include "wx/filedlg.h"
|
||||
#include "wx/intl.h"
|
||||
|
||||
#if !defined(__UNIX__)
|
||||
#ifndef __DARWIN__
|
||||
#include "PLStringFuncs.h"
|
||||
#endif
|
||||
|
||||
@@ -30,13 +30,11 @@ IMPLEMENT_CLASS(wxFileDialog, wxDialog)
|
||||
|
||||
// begin wxmac
|
||||
|
||||
#if defined(__UNIX__)
|
||||
#include <Carbon/Carbon.h>
|
||||
#else
|
||||
#ifndef __DARWIN__
|
||||
#include <Navigation.h>
|
||||
#endif
|
||||
|
||||
#ifndef __UNIX__
|
||||
#ifndef __DARWIN__
|
||||
#include "morefile.h"
|
||||
#include "moreextr.h"
|
||||
#include "fullpath.h"
|
||||
@@ -546,7 +544,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
|
||||
}
|
||||
|
||||
|
||||
Boolean CrossPlatformFilterCallback (
|
||||
pascal Boolean CrossPlatformFilterCallback (
|
||||
AEDesc *theItem,
|
||||
void *info,
|
||||
void *callBackUD,
|
||||
@@ -751,7 +749,7 @@ int wxFileDialog::ShowModal()
|
||||
}
|
||||
}
|
||||
|
||||
mNavFilterUPP = NewNavObjectFilterProc( CrossPlatformFilterCallback ) ;
|
||||
mNavFilterUPP = NewNavObjectFilterUPP( CrossPlatformFilterCallback ) ;
|
||||
if ( m_dialogStyle & wxMULTIPLE )
|
||||
mNavOptions.dialogOptionFlags |= kNavAllowMultipleFiles ;
|
||||
else
|
||||
|
@@ -705,9 +705,9 @@ GENERICOBJS = \
|
||||
proplist.o \
|
||||
sashwin.o \
|
||||
scrlwing.o \
|
||||
spinctlg.o \
|
||||
splash.o \
|
||||
splitter.o \
|
||||
spinctlg.o \
|
||||
statusbr.o \
|
||||
tabg.o \
|
||||
tbarsmpl.o \
|
||||
@@ -766,8 +766,8 @@ GENERICDEPS = \
|
||||
# Not included for Mac OS X
|
||||
# dirmac.o
|
||||
# filedlg.o
|
||||
# statline.o
|
||||
# spinctrl.o
|
||||
# statline.o
|
||||
# treectrl.o
|
||||
GUIOBJS = \
|
||||
accel.o \
|
||||
@@ -934,8 +934,7 @@ GUIDEPS = \
|
||||
# dialup.o
|
||||
UNIXOBJS = \
|
||||
dir.o \
|
||||
utilsunx.o \
|
||||
dl_macosx.o
|
||||
utilsunx.o
|
||||
|
||||
UNIXDEPS = \
|
||||
dialup.d \
|
||||
@@ -945,8 +944,7 @@ UNIXDEPS = \
|
||||
gsocket.d \
|
||||
mimetype.d \
|
||||
threadpsx.d \
|
||||
utilsunx.d \
|
||||
dl_macosx.d
|
||||
utilsunx.d
|
||||
|
||||
HTMLOBJS = \
|
||||
helpctrl.o \
|
||||
|
@@ -44,7 +44,7 @@ END_EVENT_TABLE()
|
||||
// ----------------
|
||||
|
||||
// def ctor: use Create() to really create the control
|
||||
wxCheckListBox::wxCheckListBox() : wxListBox()
|
||||
wxCheckListBox::wxCheckListBox() : wxCheckListBoxBase()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
|
||||
int nStrings, const wxString choices[],
|
||||
long style, const wxValidator& val,
|
||||
const wxString& name)
|
||||
: wxListBox()
|
||||
: wxCheckListBoxBase()
|
||||
{
|
||||
// TODO: you'll probably need a separate Create instead of using
|
||||
// the wxListBox one as here.
|
||||
|
@@ -20,7 +20,7 @@
|
||||
#include "wx/filedlg.h"
|
||||
#include "wx/intl.h"
|
||||
|
||||
#if !defined(__UNIX__)
|
||||
#ifndef __DARWIN__
|
||||
#include "PLStringFuncs.h"
|
||||
#endif
|
||||
|
||||
@@ -30,13 +30,11 @@ IMPLEMENT_CLASS(wxFileDialog, wxDialog)
|
||||
|
||||
// begin wxmac
|
||||
|
||||
#if defined(__UNIX__)
|
||||
#include <Carbon/Carbon.h>
|
||||
#else
|
||||
#ifndef __DARWIN__
|
||||
#include <Navigation.h>
|
||||
#endif
|
||||
|
||||
#ifndef __UNIX__
|
||||
#ifndef __DARWIN__
|
||||
#include "morefile.h"
|
||||
#include "moreextr.h"
|
||||
#include "fullpath.h"
|
||||
@@ -546,7 +544,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
|
||||
}
|
||||
|
||||
|
||||
Boolean CrossPlatformFilterCallback (
|
||||
pascal Boolean CrossPlatformFilterCallback (
|
||||
AEDesc *theItem,
|
||||
void *info,
|
||||
void *callBackUD,
|
||||
@@ -751,7 +749,7 @@ int wxFileDialog::ShowModal()
|
||||
}
|
||||
}
|
||||
|
||||
mNavFilterUPP = NewNavObjectFilterProc( CrossPlatformFilterCallback ) ;
|
||||
mNavFilterUPP = NewNavObjectFilterUPP( CrossPlatformFilterCallback ) ;
|
||||
if ( m_dialogStyle & wxMULTIPLE )
|
||||
mNavOptions.dialogOptionFlags |= kNavAllowMultipleFiles ;
|
||||
else
|
||||
|
@@ -705,9 +705,9 @@ GENERICOBJS = \
|
||||
proplist.o \
|
||||
sashwin.o \
|
||||
scrlwing.o \
|
||||
spinctlg.o \
|
||||
splash.o \
|
||||
splitter.o \
|
||||
spinctlg.o \
|
||||
statusbr.o \
|
||||
tabg.o \
|
||||
tbarsmpl.o \
|
||||
@@ -766,8 +766,8 @@ GENERICDEPS = \
|
||||
# Not included for Mac OS X
|
||||
# dirmac.o
|
||||
# filedlg.o
|
||||
# statline.o
|
||||
# spinctrl.o
|
||||
# statline.o
|
||||
# treectrl.o
|
||||
GUIOBJS = \
|
||||
accel.o \
|
||||
@@ -934,8 +934,7 @@ GUIDEPS = \
|
||||
# dialup.o
|
||||
UNIXOBJS = \
|
||||
dir.o \
|
||||
utilsunx.o \
|
||||
dl_macosx.o
|
||||
utilsunx.o
|
||||
|
||||
UNIXDEPS = \
|
||||
dialup.d \
|
||||
@@ -945,8 +944,7 @@ UNIXDEPS = \
|
||||
gsocket.d \
|
||||
mimetype.d \
|
||||
threadpsx.d \
|
||||
utilsunx.d \
|
||||
dl_macosx.d
|
||||
utilsunx.d
|
||||
|
||||
HTMLOBJS = \
|
||||
helpctrl.o \
|
||||
|
BIN
src/makemac.mcp
BIN
src/makemac.mcp
Binary file not shown.
@@ -10,8 +10,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "spinbutt.h"
|
||||
#pragma implementation "spinctlg.h"
|
||||
#pragma implementation "spinbutt.h"
|
||||
#endif
|
||||
|
||||
#include "wx/spinbutt.h"
|
||||
|
@@ -1,104 +0,0 @@
|
||||
/* dl_macosx.c
|
||||
*
|
||||
* Platform: Mac OS X
|
||||
* Author: Gilles Depeyrot (Gilles.Depeyrot@wanadoo.fr)
|
||||
* Based on: dl_next.xs by Anno Siegel (siegel@zrz.TU-Berlin.DE)
|
||||
* Based on: dl_dlopen.xs by Paul Marquess
|
||||
* Created: Aug 15th, 1994
|
||||
*
|
||||
*/
|
||||
|
||||
/* Porting notes:
|
||||
* dl_macosx.c is itself a port from dl_next.xs by Anno Siegel.
|
||||
* dl_next.xs is itself a port from dl_dlopen.xs by Paul Marquess.
|
||||
* The method used here is just to supply the sun style dlopen etc.
|
||||
* functions in terms of NeXTs rld_*.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
static char dl_last_error[1024];
|
||||
|
||||
char *dlerror()
|
||||
{
|
||||
return dl_last_error;
|
||||
}
|
||||
|
||||
int dlclose(void *handle) /* stub only */
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
#import <mach-o/dyld.h>
|
||||
};
|
||||
|
||||
enum dyldErrorSource
|
||||
{
|
||||
OFImage,
|
||||
};
|
||||
|
||||
static
|
||||
void TranslateError(const char *path, enum dyldErrorSource type, int number)
|
||||
{
|
||||
unsigned int index;
|
||||
static char *OFIErrorStrings[] =
|
||||
{
|
||||
"%s(%d): Object Image Load Failure\n",
|
||||
"%s(%d): Object Image Load Success\n",
|
||||
"%s(%d): Not an recognisable object file\n",
|
||||
"%s(%d): No valid architecture\n",
|
||||
"%s(%d): Object image has an invalid format\n",
|
||||
"%s(%d): Invalid access (permissions?)\n",
|
||||
"%s(%d): Unknown error code from NSCreateObjectFileImageFromFile\n",
|
||||
};
|
||||
#define NUM_OFI_ERRORS (sizeof(OFIErrorStrings) / sizeof(OFIErrorStrings[0]))
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case OFImage:
|
||||
index = number;
|
||||
if (index > NUM_OFI_ERRORS - 1)
|
||||
index = NUM_OFI_ERRORS - 1;
|
||||
sprintf(dl_last_error, OFIErrorStrings[index], path, number);
|
||||
break;
|
||||
|
||||
default:
|
||||
sprintf(dl_last_error, "%s(%d): Totally unknown error type %d\n",
|
||||
path, number, type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void *dlopen(const char *path, int mode /* mode is ignored */)
|
||||
{
|
||||
int dyld_result;
|
||||
NSObjectFileImage ofile;
|
||||
NSModule handle = NULL;
|
||||
|
||||
dyld_result = NSCreateObjectFileImageFromFile(path, &ofile);
|
||||
if (dyld_result != NSObjectFileImageSuccess)
|
||||
{
|
||||
TranslateError(path, OFImage, dyld_result);
|
||||
}
|
||||
else
|
||||
{
|
||||
// NSLinkModule will cause the run to abort on any link error's
|
||||
// not very friendly but the error recovery functionality is limited.
|
||||
handle = NSLinkModule(ofile, path, TRUE);
|
||||
}
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
void *dlsym(void *handle, const char *symbol)
|
||||
{
|
||||
void *addr;
|
||||
|
||||
if (NSIsSymbolNameDefined(symbol))
|
||||
addr = NSAddressOfSymbol(NSLookupAndBindSymbol(symbol));
|
||||
else
|
||||
addr = NULL;
|
||||
|
||||
return addr;
|
||||
}
|
Reference in New Issue
Block a user