summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-07-15 09:29:16 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-07-15 09:35:21 (GMT)
commitcd4c5a65b9d91fd84408205c3d20554122037730 (patch)
tree3495b44cf34e129c3156224fb2353949221203ee /src/gui/widgets
parentfde7966c1b6122ed904d30e1f6e83eb8cd3a80b2 (diff)
downloadQt-cd4c5a65b9d91fd84408205c3d20554122037730.zip
Qt-cd4c5a65b9d91fd84408205c3d20554122037730.tar.gz
Qt-cd4c5a65b9d91fd84408205c3d20554122037730.tar.bz2
Make S60 integration optional.
This is more a cleanup of the usage of Q_WS_S60 vs. Q_OS_SYMBIAN than anything else. One of the side effects of this work was that it was relatively little work to get QtGui compiling when Q_WS_S60 is not defined. Based on this we introduce two new configure options that control S60 integration. Currently the -no-s60 option will not work entirely because the 's60main' module has not yet been refactored and still has a dependancy on the S60 libraries. Reviewed-by: axis <qt-info@nokia.com>
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qmenu.cpp2
-rw-r--r--src/gui/widgets/qmenu.h4
-rw-r--r--src/gui/widgets/qmenu_p.h10
-rw-r--r--src/gui/widgets/qmenu_symbian.cpp12
-rw-r--r--src/gui/widgets/qmenubar.cpp16
-rw-r--r--src/gui/widgets/qmenubar_p.h8
6 files changed, 28 insertions, 24 deletions
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
index 079a3b5..43dc33a 100644
--- a/src/gui/widgets/qmenu.cpp
+++ b/src/gui/widgets/qmenu.cpp
@@ -2855,7 +2855,7 @@ void QMenu::actionEvent(QActionEvent *e)
d->wce_menu->syncAction(e->action());
#endif
-#ifdef Q_OS_SYMBIAN
+#ifdef Q_WS_S60
if (!d->symbian_menu)
d->symbian_menu = new QMenuPrivate::QSymbianMenuPrivate;
if (e->type() == QEvent::ActionAdded)
diff --git a/src/gui/widgets/qmenu.h b/src/gui/widgets/qmenu.h
index 117e272..41890c4 100644
--- a/src/gui/widgets/qmenu.h
+++ b/src/gui/widgets/qmenu.h
@@ -52,7 +52,7 @@
#endif
QT_BEGIN_HEADER
-#ifdef Q_OS_SYMBIAN
+#ifdef Q_WS_S60
class CEikMenuPane;
#endif
@@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Gui)
-#ifdef Q_OS_SYMBIAN
+#ifdef Q_WS_S60
IMPORT_C void qt_symbian_show_toplevel(CEikMenuPane* menuPane);
IMPORT_C void qt_symbian_show_submenu(CEikMenuPane* menuPane, int id);
#endif
diff --git a/src/gui/widgets/qmenu_p.h b/src/gui/widgets/qmenu_p.h
index b9bb544..d9ad422 100644
--- a/src/gui/widgets/qmenu_p.h
+++ b/src/gui/widgets/qmenu_p.h
@@ -61,7 +61,7 @@
#include "QtCore/qbasictimer.h"
#include "private/qwidget_p.h"
-#ifdef Q_OS_SYMBIAN
+#ifdef Q_WS_S60
class CEikMenuPane;
#endif
QT_BEGIN_NAMESPACE
@@ -123,7 +123,7 @@ struct QWceMenuAction {
QWceMenuAction() : menuHandle(0), command(0) {}
};
#endif
-#ifdef Q_OS_SYMBIAN
+#ifdef Q_WS_S60
struct QSymbianMenuAction {
uint command;
int parent;
@@ -147,7 +147,7 @@ public:
#if defined(Q_WS_WINCE) && !defined(QT_NO_MENUBAR)
,wce_menu(0)
#endif
-#ifdef Q_OS_SYMBIAN
+#ifdef Q_WS_S60
,symbian_menu(0)
#endif
#ifdef QT3_SUPPORT
@@ -163,7 +163,7 @@ public:
#if defined(Q_WS_WINCE) && !defined(QT_NO_MENUBAR)
delete wce_menu;
#endif
-#ifdef Q_OS_SYMBIAN
+#ifdef Q_WS_S60
delete symbian_menu;
#endif
@@ -336,7 +336,7 @@ public:
HMENU wceMenu(bool create = false);
QAction* wceCommands(uint command);
#endif
-#if defined(Q_OS_SYMBIAN)
+#if defined(Q_WS_S60)
struct QSymbianMenuPrivate {
QList<QSymbianMenuAction*> actionItems;
QSymbianMenuPrivate();
diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp
index 69ce981..76057e7 100644
--- a/src/gui/widgets/qmenu_symbian.cpp
+++ b/src/gui/widgets/qmenu_symbian.cpp
@@ -44,17 +44,21 @@
#include "qstyle.h"
#include "qdebug.h"
#include "qwidgetaction.h"
-#include <eikmenub.h>
-#include <eikmenup.h>
#include <private/qapplication_p.h>
#include <private/qmenu_p.h>
#include <private/qmenubar_p.h>
#include <qt_s60_p.h>
+#include <QtCore/qlibrary.h>
+
+#ifdef Q_WS_S60
+#include <eikmenub.h>
+#include <eikmenup.h>
#include <eikaufty.h>
#include <eikbtgpc.h>
-#include <QtCore/qlibrary.h>
#include <avkon.rsg>
-#ifndef QT_NO_MENUBAR
+#endif
+
+#if !defined(QT_NO_MENUBAR) && defined(Q_WS_S60)
QT_BEGIN_NAMESPACE
diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp
index 638e4a6..4607fc3 100644
--- a/src/gui/widgets/qmenubar.cpp
+++ b/src/gui/widgets/qmenubar.cpp
@@ -741,7 +741,7 @@ void QMenuBarPrivate::init()
q->hide();
}
#endif
-#ifdef Q_OS_SYMBIAN
+#ifdef Q_WS_S60
symbianCreateMenuBar(q->parentWidget());
if(symbian_menubar)
q->hide();
@@ -817,7 +817,7 @@ QMenuBar::~QMenuBar()
if (qt_wince_is_mobile())
d->wceDestroyMenuBar();
#endif
-#ifdef Q_OS_SYMBIAN
+#ifdef Q_WS_S60
Q_D(QMenuBar);
d->symbianDestroyMenuBar();
#endif
@@ -1069,7 +1069,7 @@ void QMenuBar::setVisible(bool visible)
if (isNativeMenuBar())
return;
#endif
-#ifdef Q_OS_SYMBIAN
+#ifdef Q_WS_S60
Q_D(QMenuBar);
if(d->symbian_menubar)
return;
@@ -1286,7 +1286,7 @@ void QMenuBar::actionEvent(QActionEvent *e)
nativeMenuBar->syncAction(e->action());
}
#endif
-#ifdef Q_OS_SYMBIAN
+#ifdef Q_WS_S60
if(d->symbian_menubar) {
if(e->type() == QEvent::ActionAdded)
d->symbian_menubar->addAction(e->action(), d->symbian_menubar->findAction(e->before()));
@@ -1383,7 +1383,7 @@ void QMenuBarPrivate::handleReparent()
if (qt_wince_is_mobile() && wce_menubar)
wce_menubar->rebuild();
#endif
-#ifdef Q_OS_SYMBIAN
+#ifdef Q_WS_S60
if (symbian_menubar)
symbian_menubar->rebuild();
#endif
@@ -1622,7 +1622,7 @@ QRect QMenuBar::actionGeometry(QAction *act) const
QSize QMenuBar::minimumSizeHint() const
{
Q_D(const QMenuBar);
-#if defined(Q_WS_MAC) || defined(Q_WS_WINCE) || defined(Q_OS_SYMBIAN)
+#if defined(Q_WS_MAC) || defined(Q_WS_WINCE) || defined(Q_WS_S60)
const bool as_gui_menubar = !isNativeMenuBar();
#else
const bool as_gui_menubar = true;
@@ -1677,7 +1677,7 @@ QSize QMenuBar::minimumSizeHint() const
QSize QMenuBar::sizeHint() const
{
Q_D(const QMenuBar);
-#if defined(Q_WS_MAC) || defined(Q_WS_WINCE) || defined(Q_OS_SYMBIAN)
+#if defined(Q_WS_MAC) || defined(Q_WS_WINCE) || defined(Q_WS_S60)
const bool as_gui_menubar = !isNativeMenuBar();
#else
const bool as_gui_menubar = true;
@@ -1735,7 +1735,7 @@ QSize QMenuBar::sizeHint() const
int QMenuBar::heightForWidth(int) const
{
Q_D(const QMenuBar);
-#if defined(Q_WS_MAC) || defined(Q_WS_WINCE) || defined(Q_OS_SYMBIAN)
+#if defined(Q_WS_MAC) || defined(Q_WS_WINCE) || defined(Q_WS_S60)
const bool as_gui_menubar = !isNativeMenuBar();
#else
const bool as_gui_menubar = true;
diff --git a/src/gui/widgets/qmenubar_p.h b/src/gui/widgets/qmenubar_p.h
index a51a6cc..004562f 100644
--- a/src/gui/widgets/qmenubar_p.h
+++ b/src/gui/widgets/qmenubar_p.h
@@ -62,7 +62,7 @@
#endif
#ifndef QT_NO_MENUBAR
-#ifdef Q_OS_SYMBIAN
+#ifdef Q_WS_S60
class CCoeControl;
class CEikMenuBar;
#endif
@@ -89,7 +89,7 @@ public:
#ifdef Q_WS_WINCE
, wce_menubar(0), wceClassicMenu(false)
#endif
-#ifdef Q_OS_SYMBIAN
+#ifdef Q_WS_S60
, symbian_menubar(0)
#endif
@@ -102,7 +102,7 @@ public:
#ifdef Q_WS_WINCE
delete wce_menubar;
#endif
-#ifdef Q_OS_SYMBIAN
+#ifdef Q_WS_S60
delete symbian_menubar;
#endif
}
@@ -239,7 +239,7 @@ public:
void wceRefresh();
bool wceEmitSignals(QList<QWceMenuAction*> actions, uint command);
#endif
-#ifdef Q_OS_SYMBIAN
+#ifdef Q_WS_S60
void symbianCreateMenuBar(QWidget *);
void symbianDestroyMenuBar();
struct QSymbianMenuBarPrivate {