summaryrefslogtreecommitdiff
path: root/library/qpeapplication.cpp
authorkergoth <kergoth>2003-03-19 05:38:25 (UTC)
committer kergoth <kergoth>2003-03-19 05:38:25 (UTC)
commit234f974bea8f93213fa43bb8b501dee5db43cbdc (patch) (unidiff)
treefc9c441bbbb1d12d1fc929cecfd323c03fafb48c /library/qpeapplication.cpp
parentf35989ef21fb5a27ebe6f6924ee2cc601318c1b8 (diff)
downloadopie-234f974bea8f93213fa43bb8b501dee5db43cbdc.zip
opie-234f974bea8f93213fa43bb8b501dee5db43cbdc.tar.gz
opie-234f974bea8f93213fa43bb8b501dee5db43cbdc.tar.bz2
Goodbye QT_QWS_EBX and QT_QWS_SHARP.. hello QT_QWS_SL5XXX!
Diffstat (limited to 'library/qpeapplication.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index 95c4a1b..7463074 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -1616,191 +1616,191 @@ bool QPEApplication::eventFilter( QObject *o, QEvent *e )
1616 1616
1617/*! 1617/*!
1618 \reimp 1618 \reimp
1619*/ 1619*/
1620void QPEApplication::timerEvent( QTimerEvent *e ) 1620void QPEApplication::timerEvent( QTimerEvent *e )
1621{ 1621{
1622 if ( e->timerId() == d->presstimer && d->presswidget ) { 1622 if ( e->timerId() == d->presstimer && d->presswidget ) {
1623 // Right pressed 1623 // Right pressed
1624 postEvent( d->presswidget, 1624 postEvent( d->presswidget,
1625 new QMouseEvent( QEvent::MouseButtonPress, d->presspos, 1625 new QMouseEvent( QEvent::MouseButtonPress, d->presspos,
1626 RightButton, LeftButton ) ); 1626 RightButton, LeftButton ) );
1627 killTimer( d->presstimer ); 1627 killTimer( d->presstimer );
1628 d->presstimer = 0; 1628 d->presstimer = 0;
1629 d->rightpressed = TRUE; 1629 d->rightpressed = TRUE;
1630 } 1630 }
1631} 1631}
1632 1632
1633void QPEApplication::removeSenderFromStylusDict() 1633void QPEApplication::removeSenderFromStylusDict()
1634{ 1634{
1635 stylusDict->remove 1635 stylusDict->remove
1636 ( ( void* ) sender() ); 1636 ( ( void* ) sender() );
1637 if ( d->presswidget == sender() ) 1637 if ( d->presswidget == sender() )
1638 d->presswidget = 0; 1638 d->presswidget = 0;
1639} 1639}
1640 1640
1641/*! 1641/*!
1642 \internal 1642 \internal
1643*/ 1643*/
1644bool QPEApplication::keyboardGrabbed() const 1644bool QPEApplication::keyboardGrabbed() const
1645{ 1645{
1646 return d->kbgrabbed; 1646 return d->kbgrabbed;
1647} 1647}
1648 1648
1649 1649
1650/*! 1650/*!
1651 Reverses the effect of grabKeyboard(). This is called automatically 1651 Reverses the effect of grabKeyboard(). This is called automatically
1652 on program exit. 1652 on program exit.
1653*/ 1653*/
1654void QPEApplication::ungrabKeyboard() 1654void QPEApplication::ungrabKeyboard()
1655{ 1655{
1656 ((QPEApplication *) qApp )-> d-> kbgrabbed = false; 1656 ((QPEApplication *) qApp )-> d-> kbgrabbed = false;
1657} 1657}
1658 1658
1659/*! 1659/*!
1660 Grabs the physical keyboard keys, e.g. the application's launching 1660 Grabs the physical keyboard keys, e.g. the application's launching
1661 keys. Instead of launching applications when these keys are pressed 1661 keys. Instead of launching applications when these keys are pressed
1662 the signals emitted are sent to this application instead. Some games 1662 the signals emitted are sent to this application instead. Some games
1663 programs take over the launch keys in this way to make interaction 1663 programs take over the launch keys in this way to make interaction
1664 easier. 1664 easier.
1665 1665
1666 \sa ungrabKeyboard() 1666 \sa ungrabKeyboard()
1667*/ 1667*/
1668void QPEApplication::grabKeyboard() 1668void QPEApplication::grabKeyboard()
1669{ 1669{
1670 ((QPEApplication *) qApp )-> d-> kbgrabbed = true; 1670 ((QPEApplication *) qApp )-> d-> kbgrabbed = true;
1671} 1671}
1672 1672
1673/*! 1673/*!
1674 \reimp 1674 \reimp
1675*/ 1675*/
1676int QPEApplication::exec() 1676int QPEApplication::exec()
1677{ 1677{
1678#ifndef QT_NO_COP 1678#ifndef QT_NO_COP
1679 d->sendQCopQ(); 1679 d->sendQCopQ();
1680#endif 1680#endif
1681 1681
1682 if ( d->keep_running ) 1682 if ( d->keep_running )
1683 //|| d->qpe_main_widget && d->qpe_main_widget->isVisible() ) 1683 //|| d->qpe_main_widget && d->qpe_main_widget->isVisible() )
1684 return QApplication::exec(); 1684 return QApplication::exec();
1685 1685
1686#ifndef QT_NO_COP 1686#ifndef QT_NO_COP
1687 1687
1688 { 1688 {
1689 QCopEnvelope e( "QPE/System", "closing(QString)" ); 1689 QCopEnvelope e( "QPE/System", "closing(QString)" );
1690 e << d->appName; 1690 e << d->appName;
1691 } 1691 }
1692#endif 1692#endif
1693 processEvents(); 1693 processEvents();
1694 return 0; 1694 return 0;
1695} 1695}
1696 1696
1697/*! 1697/*!
1698 \internal 1698 \internal
1699 External request for application to quit. Quits if possible without 1699 External request for application to quit. Quits if possible without
1700 loosing state. 1700 loosing state.
1701*/ 1701*/
1702void QPEApplication::tryQuit() 1702void QPEApplication::tryQuit()
1703{ 1703{
1704 if ( activeModalWidget() || strcmp( argv() [ 0 ], "embeddedkonsole" ) == 0 ) 1704 if ( activeModalWidget() || strcmp( argv() [ 0 ], "embeddedkonsole" ) == 0 )
1705 return ; // Inside modal loop or konsole. Too hard to save state. 1705 return ; // Inside modal loop or konsole. Too hard to save state.
1706#ifndef QT_NO_COP 1706#ifndef QT_NO_COP
1707 1707
1708 { 1708 {
1709 QCopEnvelope e( "QPE/System", "closing(QString)" ); 1709 QCopEnvelope e( "QPE/System", "closing(QString)" );
1710 e << d->appName; 1710 e << d->appName;
1711 } 1711 }
1712#endif 1712#endif
1713 processEvents(); 1713 processEvents();
1714 1714
1715 quit(); 1715 quit();
1716} 1716}
1717 1717
1718/*! 1718/*!
1719 \internal 1719 \internal
1720 User initiated quit. Makes the window 'Go Away'. If preloaded this means 1720 User initiated quit. Makes the window 'Go Away'. If preloaded this means
1721 hiding the window. If not it means quitting the application. 1721 hiding the window. If not it means quitting the application.
1722 As this is user initiated we don't need to check state. 1722 As this is user initiated we don't need to check state.
1723*/ 1723*/
1724void QPEApplication::hideOrQuit() 1724void QPEApplication::hideOrQuit()
1725{ 1725{
1726 processEvents(); 1726 processEvents();
1727 1727
1728 // If we are a preloaded application we don't actually quit, so emit 1728 // If we are a preloaded application we don't actually quit, so emit
1729 // a System message indicating we're quasi-closing. 1729 // a System message indicating we're quasi-closing.
1730 if ( d->preloaded && d->qpe_main_widget ) 1730 if ( d->preloaded && d->qpe_main_widget )
1731#ifndef QT_NO_COP 1731#ifndef QT_NO_COP
1732 1732
1733 { 1733 {
1734 QCopEnvelope e("QPE/System", "fastAppHiding(QString)" ); 1734 QCopEnvelope e("QPE/System", "fastAppHiding(QString)" );
1735 e << d->appName; 1735 e << d->appName;
1736 d->qpe_main_widget->hide(); 1736 d->qpe_main_widget->hide();
1737 } 1737 }
1738#endif 1738#endif
1739 else 1739 else
1740 quit(); 1740 quit();
1741} 1741}
1742 1742
1743 1743
1744#if defined(QT_QWS_IPAQ) || defined(QT_QWS_SHARP) 1744#if defined(QT_QWS_IPAQ) || defined(QT_QWS_SL5XXX)
1745 1745
1746// The libraries with the skiff package (and possibly others) have 1746// The libraries with the skiff package (and possibly others) have
1747// completely useless implementations of builtin new and delete that 1747// completely useless implementations of builtin new and delete that
1748// use about 50% of your CPU. Here we revert to the simple libc 1748// use about 50% of your CPU. Here we revert to the simple libc
1749// functions. 1749// functions.
1750 1750
1751void* operator new[]( size_t size ) 1751void* operator new[]( size_t size )
1752{ 1752{
1753 return malloc( size ); 1753 return malloc( size );
1754} 1754}
1755 1755
1756void* operator new( size_t size ) 1756void* operator new( size_t size )
1757{ 1757{
1758 return malloc( size ); 1758 return malloc( size );
1759} 1759}
1760 1760
1761void operator delete[]( void* p ) 1761void operator delete[]( void* p )
1762{ 1762{
1763 free( p ); 1763 free( p );
1764} 1764}
1765 1765
1766void operator delete[]( void* p, size_t /*size*/ ) 1766void operator delete[]( void* p, size_t /*size*/ )
1767{ 1767{
1768 free( p ); 1768 free( p );
1769} 1769}
1770 1770
1771void operator delete( void* p ) 1771void operator delete( void* p )
1772{ 1772{
1773 free( p ); 1773 free( p );
1774} 1774}
1775 1775
1776void operator delete( void* p, size_t /*size*/ ) 1776void operator delete( void* p, size_t /*size*/ )
1777{ 1777{
1778 free( p ); 1778 free( p );
1779} 1779}
1780 1780
1781#endif 1781#endif
1782 1782
1783#if ( QT_VERSION <= 230 ) && !defined(SINGLE_APP) 1783#if ( QT_VERSION <= 230 ) && !defined(SINGLE_APP)
1784#include <qwidgetlist.h> 1784#include <qwidgetlist.h>
1785#ifdef QWS 1785#ifdef QWS
1786#include <qgfx_qws.h> 1786#include <qgfx_qws.h>
1787extern QRect qt_maxWindowRect; 1787extern QRect qt_maxWindowRect;
1788void qt_setMaxWindowRect(const QRect& r ) 1788void qt_setMaxWindowRect(const QRect& r )
1789{ 1789{
1790 qt_maxWindowRect = qt_screen->mapFromDevice( r, 1790 qt_maxWindowRect = qt_screen->mapFromDevice( r,
1791 qt_screen->mapToDevice( QSize( qt_screen->width(), qt_screen->height() ) ) ); 1791 qt_screen->mapToDevice( QSize( qt_screen->width(), qt_screen->height() ) ) );
1792 // Re-resize any maximized windows 1792 // Re-resize any maximized windows
1793 QWidgetList* l = QApplication::topLevelWidgets(); 1793 QWidgetList* l = QApplication::topLevelWidgets();
1794 if ( l ) { 1794 if ( l ) {
1795 QWidget * w = l->first(); 1795 QWidget * w = l->first();
1796 while ( w ) { 1796 while ( w ) {
1797 if ( w->isVisible() && w->isMaximized() ) { 1797 if ( w->isVisible() && w->isMaximized() ) {
1798 w->showMaximized(); 1798 w->showMaximized();
1799 } 1799 }
1800 w = l->next(); 1800 w = l->next();
1801 } 1801 }
1802 delete l; 1802 delete l;
1803 } 1803 }
1804} 1804}
1805#endif 1805#endif
1806#endif 1806#endif