summaryrefslogtreecommitdiff
path: root/library
Side-by-side diff
Diffstat (limited to 'library') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qlibrary_unix.cpp2
-rw-r--r--library/qpeapplication.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/library/qlibrary_unix.cpp b/library/qlibrary_unix.cpp
index 2181153..fee73c2 100644
--- a/library/qlibrary_unix.cpp
+++ b/library/qlibrary_unix.cpp
@@ -60,184 +60,184 @@ bool QLibraryPrivate::freeLibrary()
}
return FALSE;
}
void* QLibraryPrivate::resolveSymbol( const char* symbol )
{
if ( !pHnd )
return 0;
void* address = 0;
if ( shl_findsym( (shl_t*)&pHnd, symbol, TYPE_UNDEFINED, address ) < 0 ) {
#if defined(QT_DEBUG) || defined(QT_DEBUG_COMPONENT)
qDebug( "Couldn't resolve symbol \"%s\"", symbol );
#endif
return 0;
}
return address;
}
#elif defined(_NULL_LIB_)
bool QLibraryPrivate::loadLibrary()
{
//qDebug("QLibraryPrivate::loadLibrary\n");
return FALSE;
}
bool QLibraryPrivate::freeLibrary()
{
//qDebug("QLibraryPrivate::freeLibrary\n");
return FALSE;
}
void* QLibraryPrivate::resolveSymbol( const char* symbol )
{
//qDebug("QLibraryPrivate::resolveSymbol\n");
return FALSE;
}
#elif defined(Q_OS_MACX)
#define ENUM_DYLD_BOOL
enum DYLD_BOOL {
DYLD_FALSE,
DYLD_TRUE
};
#include <mach-o/dyld.h>
typedef struct {
NSObjectFileImage img;
NSModule mod;
} DyldLibDesc;
bool QLibraryPrivate::loadLibrary()
{
// qDebug("QLibraryPrivate::loadLibrary\n");
// return FALSE;
if ( pHnd )
return TRUE;
QString filename = library->library();
NSObjectFileImage img = 0;
NSModule mod = 0;
NSObjectFileImageReturnCode ret = NSCreateObjectFileImageFromFile( filename.latin1() , &img );
if ( ret != NSObjectFileImageSuccess ) {
qWarning( "Error in NSCreateObjectFileImageFromFile(): %d; Filename: %s", ret, filename.latin1() );
if (ret == NSObjectFileImageAccess) {
qWarning ("(NSObjectFileImageAccess)" );
}
} else {
mod = NSLinkModule(img, filename.latin1(), NSLINKMODULE_OPTION_BINDNOW |
NSLINKMODULE_OPTION_PRIVATE |
NSLINKMODULE_OPTION_RETURN_ON_ERROR);
if (mod == 0) {
qWarning( "Error in NSLinkModule()" );
NSDestroyObjectFileImage(img);
}
}
DyldLibDesc* desc = 0;
if (img != 0 && mod != 0) {
desc = new DyldLibDesc;
desc->img = img;
desc->mod = mod;
}
pHnd = desc;
return pHnd != 0;
}
bool QLibraryPrivate::freeLibrary()
{
//qDebug("QLibraryPrivate::freeLibrary\n");
//return FALSE;
if ( !pHnd )
return TRUE;
DyldLibDesc* desc = (DyldLibDesc*) pHnd;
NSModule mod = desc->mod;
NSObjectFileImage img = desc->img;
- DYLD_BOOL success = NSUnLinkModule(mod, NSUNLINKMODULE_OPTION_NONE);
+ bool success = NSUnLinkModule(mod, NSUNLINKMODULE_OPTION_NONE);
if ( success ) {
NSDestroyObjectFileImage(img);
delete desc;
pHnd = 0;
}
#if defined(QT_DEBUG) || defined(QT_DEBUG_COMPONENT)
else {
qWarning( "Error in NSUnLinkModule()" );
}
#endif
return pHnd == 0;
}
void* QLibraryPrivate::resolveSymbol( const char* symbol )
{
//qDebug("QLibraryPrivate::resolveSymbol\n");
//return FALSE;
if ( !pHnd )
return 0;
DyldLibDesc* desc = (DyldLibDesc*) pHnd;
NSSymbol sym = NSLookupSymbolInModule(desc->mod, symbol);
void* address = 0;
if (sym != 0) {
address = NSAddressOfSymbol(sym);
}
#if defined(QT_DEBUG) || defined(QT_DEBUG_COMPONENT)
if ( address == 0 )
qWarning( "Cannot find symbol: %s", symbol );
#endif
return address;
}
#else
// Something else, assuming POSIX
#include <dlfcn.h>
bool QLibraryPrivate::loadLibrary()
{
if ( pHnd )
return TRUE;
QString filename = library->library();
pHnd = dlopen( filename.latin1() , RTLD_LAZY );
// #if defined(QT_DEBUG) || defined(QT_DEBUG_COMPONENT)
if ( !pHnd )
qWarning( "%s", dlerror() );
// #endif
return pHnd != 0;
}
bool QLibraryPrivate::freeLibrary()
{
if ( !pHnd )
return TRUE;
int ec = dlclose( pHnd );
if ( !ec )
pHnd = 0;
#if defined(QT_DEBUG) || defined(QT_DEBUG_COMPONENT)
else {
const char* error = dlerror();
if ( error )
qWarning( "%s", error );
}
#endif
return pHnd == 0;
}
void* QLibraryPrivate::resolveSymbol( const char* f )
{
if ( !pHnd )
return 0;
void* address = dlsym( pHnd, f );
#if defined(QT_DEBUG) || defined(QT_DEBUG_COMPONENT)
const char* error = dlerror();
if ( error )
qWarning( "%s", error );
#endif
return address;
}
#endif // POSIX
#endif // QT_NO_COMPONENT
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index 19e99f2..dcc1001 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -2114,177 +2114,177 @@ void QPEApplication::ungrabKeyboard()
{
((QPEApplication *) qApp )-> d-> kbgrabbed = false;
}
/*!
Grabs the physical keyboard keys, e.g. the application's launching
keys. Instead of launching applications when these keys are pressed
the signals emitted are sent to this application instead. Some games
programs take over the launch keys in this way to make interaction
easier.
\sa ungrabKeyboard()
*/
void QPEApplication::grabKeyboard()
{
((QPEApplication *) qApp )-> d-> kbgrabbed = true;
}
/*!
\reimp
*/
int QPEApplication::exec()
{
d->qcopQok = true;
#ifndef QT_NO_COP
d->sendQCopQ();
if ( !d->keep_running )
processEvents(); // we may have received QCop messages in the meantime.
#endif
if ( d->keep_running )
//|| d->qpe_main_widget && d->qpe_main_widget->isVisible() )
return QApplication::exec();
#ifndef QT_NO_COP
{
QCopEnvelope e( "QPE/System", "closing(QString)" );
e << d->appName;
}
#endif
processEvents();
return 0;
}
/*!
\internal
External request for application to quit. Quits if possible without
loosing state.
*/
void QPEApplication::tryQuit()
{
if ( activeModalWidget() )
return ; // Inside modal loop or konsole. Too hard to save state.
#ifndef QT_NO_COP
{
QCopEnvelope e( "QPE/System", "closing(QString)" );
e << d->appName;
}
#endif
if ( d->keep_running )
d->store_widget_rect(d->qpe_main_widget, d->appName);
processEvents();
quit();
}
/*!
\internal
User initiated quit. Makes the window 'Go Away'. If preloaded this means
hiding the window. If not it means quitting the application.
As this is user initiated we don't need to check state.
*/
void QPEApplication::hideOrQuit()
{
if ( d->keep_running )
d->store_widget_rect(d->qpe_main_widget, d->appName);
processEvents();
// If we are a preloaded application we don't actually quit, so emit
// a System message indicating we're quasi-closing.
if ( d->preloaded && d->qpe_main_widget )
#ifndef QT_NO_COP
{
QCopEnvelope e("QPE/System", "fastAppHiding(QString)" );
e << d->appName;
d->qpe_main_widget->hide();
}
#endif
else
quit();
}
-#if (__GNUC__ > 2 )
+#if (__GNUC__ > 2 ) && !defined(_OS_MACX_)
extern "C" void __cxa_pure_virtual();
void __cxa_pure_virtual()
{
fprintf( stderr, "Pure virtual called\n");
abort();
}
#endif
#if defined(OPIE_NEW_MALLOC)
// The libraries with the skiff package (and possibly others) have
// completely useless implementations of builtin new and delete that
// use about 50% of your CPU. Here we revert to the simple libc
// functions.
void* operator new[]( size_t size )
{
return malloc( size );
}
void* operator new( size_t size )
{
return malloc( size );
}
void operator delete[]( void* p )
{
if ( p )
free( p );
}
void operator delete[]( void* p, size_t /*size*/ )
{
if ( p )
free( p );
}
void operator delete( void* p )
{
if ( p )
free( p );
}
void operator delete( void* p, size_t /*size*/ )
{
if ( p )
free( p );
}
#endif
#if ( QT_VERSION <= 230 ) && !defined(SINGLE_APP)
#include <qwidgetlist.h>
#ifdef QWS
#include <qgfx_qws.h>
extern QRect qt_maxWindowRect;
void qt_setMaxWindowRect(const QRect& r )
{
qt_maxWindowRect = qt_screen->mapFromDevice( r,
qt_screen->mapToDevice( QSize( qt_screen->width(), qt_screen->height() ) ) );
// Re-resize any maximized windows
QWidgetList* l = QApplication::topLevelWidgets();
if ( l ) {
QWidget * w = l->first();
while ( w ) {
if ( w->isVisible() && w->isMaximized() ) {
w->showMaximized();
}
w = l->next();
}
delete l;
}
}
#endif
#endif