summaryrefslogtreecommitdiff
path: root/library/qpeapplication.cpp
Side-by-side diff
Diffstat (limited to 'library/qpeapplication.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index df313ce..3efba20 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -43,96 +43,97 @@
#include <qbuffer.h>
#include <qptrdict.h>
#include <qregexp.h>
#include <qdir.h>
#include <qlabel.h>
#include <qdialog.h>
#include <qdragobject.h>
#include <qtextcodec.h>
#include <qevent.h>
#include <qtooltip.h>
#include <qsignal.h>
#include <qmainwindow.h>
#include <qwidgetlist.h>
#include <qpixmapcache.h>
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
#define QTOPIA_INTERNAL_INITAPP
#include "qpeapplication.h"
#include "qpestyle.h"
#include "styleinterface.h"
#if QT_VERSION >= 300
#include <qstylefactory.h>
#else
#include <qplatinumstyle.h>
#include <qwindowsstyle.h>
#include <qmotifstyle.h>
#include <qmotifplusstyle.h>
#include "lightstyle.h"
#include <qpe/qlibrary.h>
#endif
#include "global.h"
#include "resource.h"
#if QT_VERSION <= 230 && defined(QT_NO_CODECS)
#include "qutfcodec.h"
#endif
#include "config.h"
#include "network.h"
#ifdef QWS
#include "fontmanager.h"
#include "fontdatabase.h"
#endif
#include "alarmserver.h"
#include "applnk.h"
#include "qpemenubar.h"
#include "textcodecinterface.h"
#include "imagecodecinterface.h"
+#include <qtopia/qpeglobal.h>
#include <unistd.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#ifndef QT_NO_SOUND
#include <sys/soundcard.h>
#endif
#include "qt_override_p.h"
#include <backend/rohfeedback.h>
static bool useBigPixmaps = 0;
class HackWidget : public QWidget
{
public:
bool needsOk()
{ return (getWState() & WState_Reserved1 ); }
QRect normalGeometry()
{ return topData()->normalGeometry; };
};
class QPEApplicationData
{
public:
QPEApplicationData ( ) :
presstimer( 0 ), presswidget( 0 ), rightpressed( false ), kbgrabbed( false ),
notbusysent( false ), preloaded( false ), forceshow( false ), nomaximize( false ),
keep_running( true ), qcopQok( false ),
fontFamily( "Vera" ), fontSize( 10 ), smallIconSize( 14 ),
bigIconSize( 32 ), qpe_main_widget( 0 )
{
Config cfg( "qpe" );
cfg.setGroup( "Appearance" );
useBigPixmaps = cfg.readBoolEntry( "useBigPixmaps", false );
fontFamily = cfg.readEntry( "FontFamily", "Vera" );
fontSize = cfg.readNumEntry( "FontSize", 10 );
smallIconSize = cfg.readNumEntry( "SmallIconSize", 14 );
bigIconSize = cfg.readNumEntry( "BigIconSize", 32 );
#ifdef OPIE_WITHROHFEEDBACK
RoH = 0;
#endif
}
int presstimer;
QWidget* presswidget;
@@ -1249,102 +1250,97 @@ void QPEApplication::setDefaultRotation( int r )
e << r;
}
#endif
}
}
#include <qgfx_qws.h>
#include <qwindowsystem_qws.h>
#if QT_VERSION > 236
extern void qws_clearLoadedFonts();
#endif
void QPEApplication::setCurrentMode( int x, int y, int depth )
{
// Reset the caches
#if QT_VERSION > 236
qws_clearLoadedFonts();
#endif
QPixmapCache::clear();
// Change the screen mode
qt_screen->setMode(x, y, depth);
if ( qApp->type() == GuiServer ) {
#if QT_VERSION > 236
// Reconfigure the GuiServer
qwsServer->beginDisplayReconfigure();
qwsServer->endDisplayReconfigure();
#endif
// Get all the running apps to reset
QCopEnvelope env( "QPE/System", "reset()" );
}
}
void QPEApplication::reset() {
// Reconnect to the screen
qt_screen->disconnect();
qt_screen->connect( QString::null );
// Redraw everything
applyStyle();
}
#if (QT_VERSION < 238) && defined Q_OS_MACX
bool qt_left_hand_scrollbars = false;
#else
-#ifdef Q_OS_MACX
-#define WEAK_SYMBOL __attribute__((weak_import))
-#else
-#define WEAK_SYMBOL __attribute__((weak))
-#endif
-extern bool qt_left_hand_scrollbars WEAK_SYMBOL;
+extern bool qt_left_hand_scrollbars QPE_WEAK_SYMBOL;
#endif
/*!
\internal
*/
void QPEApplication::applyStyle()
{
Config config( "qpe" );
config.setGroup( "Appearance" );
#if QT_VERSION > 233
#if !defined(OPIE_NO_OVERRIDE_QT)
// don't block ourselves ...
Opie::force_appearance = 0;
static QString appname = Opie::binaryName ( );
QStringList ex = config. readListEntry ( "NoStyle", ';' );
int nostyle = 0;
for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) {
if ( QRegExp (( *it ). mid ( 1 ), false, true ). find ( appname, 0 ) >= 0 ) {
nostyle = ( *it ). left ( 1 ). toInt ( 0, 32 );
break;
}
}
#else
int nostyle = 0;
#endif
// Widget style
QString style = config.readEntry( "Style", "FlatStyle" );
// don't set a custom style
if ( nostyle & Opie::Force_Style )
style = "FlatStyle";
internalSetStyle ( style );
// Colors - from /etc/colors/Liquid.scheme
QColor bgcolor( config.readEntry( "Background", "#E0E0E0" ) );
QColor btncolor( config.readEntry( "Button", "#96c8fa" ) );
QPalette pal( btncolor, bgcolor );
QString color = config.readEntry( "Highlight", "#73adef" );
pal.setColor( QColorGroup::Highlight, QColor( color ) );
color = config.readEntry( "HighlightedText", "#FFFFFF" );
pal.setColor( QColorGroup::HighlightedText, QColor( color ) );
color = config.readEntry( "Text", "#000000" );
pal.setColor( QColorGroup::Text, QColor( color ) );