summaryrefslogtreecommitdiff
path: root/library/qpeapplication.cpp
Unidiff
Diffstat (limited to 'library/qpeapplication.cpp') (more/less context) (show whitespace changes)
-rw-r--r--library/qpeapplication.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index af00f49..1c5ced3 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -15,97 +15,97 @@
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19*/ 19*/
20#define QTOPIA_INTERNAL_LANGLIST 20#define QTOPIA_INTERNAL_LANGLIST
21#include <stdlib.h> 21#include <stdlib.h>
22#include <unistd.h> 22#include <unistd.h>
23#ifndef Q_OS_MACX 23#ifndef Q_OS_MACX
24#include <linux/limits.h> // needed for some toolchains (PATH_MAX) 24#include <linux/limits.h> // needed for some toolchains (PATH_MAX)
25#endif 25#endif
26#include <qfile.h> 26#include <qfile.h>
27#include <qqueue.h> 27#include <qqueue.h>
28#ifdef Q_WS_QWS 28#ifdef Q_WS_QWS
29#ifndef QT_NO_COP 29#ifndef QT_NO_COP
30#if QT_VERSION <= 231 30#if QT_VERSION <= 231
31#define private public 31#define private public
32#define sendLocally processEvent 32#define sendLocally processEvent
33#include "qcopenvelope_qws.h" 33#include "qcopenvelope_qws.h"
34#undef private 34#undef private
35#else 35#else
36#include "qcopenvelope_qws.h" 36#include "qcopenvelope_qws.h"
37#endif 37#endif
38#endif 38#endif
39#include <qwindowsystem_qws.h> 39#include <qwindowsystem_qws.h>
40#endif 40#endif
41#include <qtextstream.h> 41#include <qtextstream.h>
42#include <qpalette.h> 42#include <qpalette.h>
43#include <qbuffer.h> 43#include <qbuffer.h>
44#include <qptrdict.h> 44#include <qptrdict.h>
45#include <qregexp.h> 45#include <qregexp.h>
46#include <qdir.h> 46#include <qdir.h>
47#include <qlabel.h> 47#include <qlabel.h>
48#include <qdialog.h> 48#include <qdialog.h>
49#include <qdragobject.h> 49#include <qdragobject.h>
50#include <qtextcodec.h> 50#include <qtextcodec.h>
51#include <qevent.h> 51#include <qevent.h>
52#include <qtooltip.h> 52#include <qtooltip.h>
53#include <qsignal.h> 53#include <qsignal.h>
54#include <qmainwindow.h> 54#include <qmainwindow.h>
55#include <qwidgetlist.h> 55#include <qwidgetlist.h>
56#include <qpixmapcache.h> 56#include <qpixmapcache.h>
57 57
58#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 58#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
59#define QTOPIA_INTERNAL_INITAPP 59#define QTOPIA_INTERNAL_INITAPP
60#include "qpeapplication.h" 60#include "qpeapplication.h"
61#include "qpestyle.h" 61#include "qpestyle.h"
62#include "styleinterface.h" 62#include "styleinterface.h"
63#if QT_VERSION >= 300 63#if QT_VERSION >= 0x030000
64#include <qstylefactory.h> 64#include <qstylefactory.h>
65#else 65#else
66#include <qplatinumstyle.h> 66#include <qplatinumstyle.h>
67#include <qwindowsstyle.h> 67#include <qwindowsstyle.h>
68#include <qmotifstyle.h> 68#include <qmotifstyle.h>
69#include <qmotifplusstyle.h> 69#include <qmotifplusstyle.h>
70#include "lightstyle.h" 70#include "lightstyle.h"
71 71
72#include <qpe/qlibrary.h> 72#include <qpe/qlibrary.h>
73#endif 73#endif
74#include "global.h" 74#include "global.h"
75#include "resource.h" 75#include "resource.h"
76#if QT_VERSION <= 230 && defined(QT_NO_CODECS) 76#if QT_VERSION <= 230 && defined(QT_NO_CODECS)
77#include "qutfcodec.h" 77#include "qutfcodec.h"
78#endif 78#endif
79#include "config.h" 79#include "config.h"
80#include "network.h" 80#include "network.h"
81#ifdef QWS 81#ifdef QWS
82#include "fontmanager.h" 82#include "fontmanager.h"
83#include "fontdatabase.h" 83#include "fontdatabase.h"
84#endif 84#endif
85 85
86#include "alarmserver.h" 86#include "alarmserver.h"
87#include "applnk.h" 87#include "applnk.h"
88#include "qpemenubar.h" 88#include "qpemenubar.h"
89#include "textcodecinterface.h" 89#include "textcodecinterface.h"
90#include "imagecodecinterface.h" 90#include "imagecodecinterface.h"
91#include <qtopia/qpeglobal.h> 91#include <qtopia/qpeglobal.h>
92 92
93#include <unistd.h> 93#include <unistd.h>
94#include <sys/file.h> 94#include <sys/file.h>
95#include <sys/ioctl.h> 95#include <sys/ioctl.h>
96#ifndef QT_NO_SOUND 96#ifndef QT_NO_SOUND
97#include <sys/soundcard.h> 97#include <sys/soundcard.h>
98#endif 98#endif
99#include "qt_override_p.h" 99#include "qt_override_p.h"
100 100
101#include <backend/rohfeedback.h> 101#include <backend/rohfeedback.h>
102 102
103 103
104static bool useBigPixmaps = 0; 104static bool useBigPixmaps = 0;
105 105
106class HackWidget : public QWidget 106class HackWidget : public QWidget
107{ 107{
108public: 108public:
109 bool needsOk() 109 bool needsOk()
110 { return (getWState() & WState_Reserved1 ); } 110 { return (getWState() & WState_Reserved1 ); }
111 111
@@ -1798,97 +1798,97 @@ void QPEApplication::showMainWidget( QWidget* mw, bool nomaximize )
1798 1798
1799 \sa showMainWidget() 1799 \sa showMainWidget()
1800*/ 1800*/
1801void QPEApplication::showMainDocumentWidget( QWidget* mw, bool nomaximize ) 1801void QPEApplication::showMainDocumentWidget( QWidget* mw, bool nomaximize )
1802{ 1802{
1803 if ( mw && argc() == 2 ) 1803 if ( mw && argc() == 2 )
1804 Global::setDocument( mw, QString::fromUtf8(argv()[1]) ); 1804 Global::setDocument( mw, QString::fromUtf8(argv()[1]) );
1805 1805
1806 1806
1807// setMainWidget(mw); see above 1807// setMainWidget(mw); see above
1808 d->show(mw, nomaximize ); 1808 d->show(mw, nomaximize );
1809} 1809}
1810 1810
1811 1811
1812/*! 1812/*!
1813 If an application is started via a \link qcop.html QCop\endlink 1813 If an application is started via a \link qcop.html QCop\endlink
1814 message, the application will process the \link qcop.html 1814 message, the application will process the \link qcop.html
1815 QCop\endlink message and then quit. If the application calls this 1815 QCop\endlink message and then quit. If the application calls this
1816 function while processing a \link qcop.html QCop\endlink message, 1816 function while processing a \link qcop.html QCop\endlink message,
1817 after processing its outstanding \link qcop.html QCop\endlink 1817 after processing its outstanding \link qcop.html QCop\endlink
1818 messages the application will start 'properly' and show itself. 1818 messages the application will start 'properly' and show itself.
1819 1819
1820 \sa keepRunning() 1820 \sa keepRunning()
1821*/ 1821*/
1822void QPEApplication::setKeepRunning() 1822void QPEApplication::setKeepRunning()
1823{ 1823{
1824 if ( qApp && qApp->inherits( "QPEApplication" ) ) { 1824 if ( qApp && qApp->inherits( "QPEApplication" ) ) {
1825 QPEApplication * qpeApp = ( QPEApplication* ) qApp; 1825 QPEApplication * qpeApp = ( QPEApplication* ) qApp;
1826 qpeApp->d->keep_running = TRUE; 1826 qpeApp->d->keep_running = TRUE;
1827 } 1827 }
1828} 1828}
1829 1829
1830/*! 1830/*!
1831 Returns TRUE if the application will quit after processing the 1831 Returns TRUE if the application will quit after processing the
1832 current list of qcop messages; otherwise returns FALSE. 1832 current list of qcop messages; otherwise returns FALSE.
1833 1833
1834 \sa setKeepRunning() 1834 \sa setKeepRunning()
1835*/ 1835*/
1836bool QPEApplication::keepRunning() const 1836bool QPEApplication::keepRunning() const
1837{ 1837{
1838 return d->keep_running; 1838 return d->keep_running;
1839} 1839}
1840 1840
1841/*! 1841/*!
1842 \internal 1842 \internal
1843*/ 1843*/
1844void QPEApplication::internalSetStyle( const QString &style ) 1844void QPEApplication::internalSetStyle( const QString &style )
1845{ 1845{
1846#if QT_VERSION >= 300 1846#if QT_VERSION >= 0x030000
1847 if ( style == "QPE" ) { 1847 if ( style == "QPE" ) {
1848 setStyle( new QPEStyle ); 1848 setStyle( new QPEStyle );
1849 } 1849 }
1850 else { 1850 else {
1851 QStyle *s = QStyleFactory::create( style ); 1851 QStyle *s = QStyleFactory::create( style );
1852 if ( s ) 1852 if ( s )
1853 setStyle( s ); 1853 setStyle( s );
1854 } 1854 }
1855#else 1855#else
1856 if ( style == "Windows" ) { 1856 if ( style == "Windows" ) {
1857 setStyle( new QWindowsStyle ); 1857 setStyle( new QWindowsStyle );
1858 } 1858 }
1859 else if ( style == "QPE" ) { 1859 else if ( style == "QPE" ) {
1860 setStyle( new QPEStyle ); 1860 setStyle( new QPEStyle );
1861 } 1861 }
1862 else if ( style == "Light" ) { 1862 else if ( style == "Light" ) {
1863 setStyle( new LightStyle ); 1863 setStyle( new LightStyle );
1864 } 1864 }
1865#ifndef QT_NO_STYLE_PLATINUM 1865#ifndef QT_NO_STYLE_PLATINUM
1866 else if ( style == "Platinum" ) { 1866 else if ( style == "Platinum" ) {
1867 setStyle( new QPlatinumStyle ); 1867 setStyle( new QPlatinumStyle );
1868 } 1868 }
1869#endif 1869#endif
1870#ifndef QT_NO_STYLE_MOTIF 1870#ifndef QT_NO_STYLE_MOTIF
1871 else if ( style == "Motif" ) { 1871 else if ( style == "Motif" ) {
1872 setStyle( new QMotifStyle ); 1872 setStyle( new QMotifStyle );
1873 } 1873 }
1874#endif 1874#endif
1875#ifndef QT_NO_STYLE_MOTIFPLUS 1875#ifndef QT_NO_STYLE_MOTIFPLUS
1876 else if ( style == "MotifPlus" ) { 1876 else if ( style == "MotifPlus" ) {
1877 setStyle( new QMotifPlusStyle ); 1877 setStyle( new QMotifPlusStyle );
1878 } 1878 }
1879#endif 1879#endif
1880 1880
1881 else { 1881 else {
1882 QStyle *sty = 0; 1882 QStyle *sty = 0;
1883 QString path = QPEApplication::qpeDir ( ) + "plugins/styles/"; 1883 QString path = QPEApplication::qpeDir ( ) + "plugins/styles/";
1884 1884
1885#ifdef Q_OS_MACX 1885#ifdef Q_OS_MACX
1886 if ( style. find ( ".dylib" ) > 0 ) 1886 if ( style. find ( ".dylib" ) > 0 )
1887 path += style; 1887 path += style;
1888 else 1888 else
1889 path = path + "lib" + style. lower ( ) + ".dylib"; // compatibility 1889 path = path + "lib" + style. lower ( ) + ".dylib"; // compatibility
1890#else 1890#else
1891 if ( style. find ( ".so" ) > 0 ) 1891 if ( style. find ( ".so" ) > 0 )
1892 path += style; 1892 path += style;
1893 else 1893 else
1894 path = path + "lib" + style. lower ( ) + ".so"; // compatibility 1894 path = path + "lib" + style. lower ( ) + ".so"; // compatibility