From 98b1da0248476c5e86ace335f4fe098b2b3dfdb7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Sun, 12 Mar 2006 17:44:38 +0000 Subject: [PATCH] Abdelrazak Younes: Compile fixes for the Mac (ChangeLog follows) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13349 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/QLMenubar.C | 19 ++++++------------- src/frontends/qt4/QLMenubar.h | 13 +++++++------ src/frontends/qt4/QLPainter.C | 2 +- src/frontends/qt4/QLPopupMenu.C | 8 +++++--- src/frontends/qt4/lyx_gui.C | 6 ++---- 5 files changed, 21 insertions(+), 27 deletions(-) diff --git a/src/frontends/qt4/QLMenubar.C b/src/frontends/qt4/QLMenubar.C index f8c16c425b..d853fc5276 100644 --- a/src/frontends/qt4/QLMenubar.C +++ b/src/frontends/qt4/QLMenubar.C @@ -1,5 +1,5 @@ /** - * \file qt2/QLMenubar.C + * \file qt4/QLMenubar.C * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * @@ -21,16 +21,9 @@ #include "support/lstrings.h" #include "MenuBackend.h" -#include "support/lstrings.h" #include "debug.h" -#ifdef Q_WS_MACX -#include "kbmap.h" -#include "QLyXKeySym.h" -extern boost::scoped_ptr toplevel_keymap; -#endif - #include #include @@ -156,8 +149,8 @@ MenuBackend const & QLMenubar::backend() */ QMenuBar * QLMenubar::menuBar() const { -#ifdef Q_WS_MAC - return menubar_.get(); +#ifdef Q_OS_MACX + return mac_menubar_.get(); #else return owner_->menuBar(); #endif @@ -165,14 +158,14 @@ QMenuBar * QLMenubar::menuBar() const void QLMenubar::macxMenuBarInit() { -#ifdef Q_WS_MACX - menubar_ = new QMenuBar; +#ifdef Q_OS_MACX + mac_menubar_.reset(new QMenuBar); // this is the name of the menu that contains our special entries menubackend_.specialMenu("LyX"); // make sure that the special entries are added to the first // menu even before this menu has been opened. - name_map_[menubackend_.getMenubar().begin()->submenuname()]->showing(); + name_map_[menubackend_.getMenubar().begin()->submenuname()]->update(); #endif } diff --git a/src/frontends/qt4/QLMenubar.h b/src/frontends/qt4/QLMenubar.h index 7c846a8d4e..3fe0676740 100644 --- a/src/frontends/qt4/QLMenubar.h +++ b/src/frontends/qt4/QLMenubar.h @@ -16,11 +16,13 @@ #include "frontends/Menubar.h" #include +#include #include +#include + +#include "QLPopupMenu.h" -class QMenuBar; -class QMenu; class LyXView; class MenuBackend; class Menu; @@ -67,14 +69,13 @@ private: /// menu controller MenuBackend & menubackend_; - typedef std::map NameMap; + typedef std::map NameMap; /// name to menu for openByName NameMap name_map_; -#ifdef Q_WS_MACX - boost::scoped_ptr menubar_; -#endif + /// MACOS X special menubar. + boost::scoped_ptr mac_menubar_; }; } // namespace frontend diff --git a/src/frontends/qt4/QLPainter.C b/src/frontends/qt4/QLPainter.C index ed57983ff0..877f07fde9 100644 --- a/src/frontends/qt4/QLPainter.C +++ b/src/frontends/qt4/QLPainter.C @@ -265,7 +265,7 @@ void QLPainter::text(int x, int y, char const * s, size_t ls, QString str; str.setLength(ls); - for (size_t i = 0; i < ls; ++i) + for (int i = 0; i < ls; ++i) // Brain-dead MSVC wants at(i) rather than operator[] str[i] = QChar(encoding->ucs(s[i])); // HACK: QT3 refuses to show single compose characters diff --git a/src/frontends/qt4/QLPopupMenu.C b/src/frontends/qt4/QLPopupMenu.C index a12ea9e25b..ecc7d0315a 100644 --- a/src/frontends/qt4/QLPopupMenu.C +++ b/src/frontends/qt4/QLPopupMenu.C @@ -11,6 +11,8 @@ #include +#include + // Qt defines a macro 'signals' that clashes with a boost namespace. // All is well if the namespace is visible first. #include "QtView.h" @@ -26,7 +28,7 @@ #include "debug.h" -#ifdef Q_WS_MACX +#ifdef Q_OS_MACX #include "kbmap.h" #include "QLyXKeySym.h" extern boost::scoped_ptr toplevel_keymap; @@ -145,7 +147,7 @@ string const QLPopupMenu::getLabel(MenuItem const & mi) /// \todo Mac specific binding handling. void QLPopupMenu::addBinding(string & label, MenuItem const & mi) { -#ifndef Q_WS_MACX +#ifndef Q_OS_MACX string const binding(mi.binding()); if (!binding.empty()) { @@ -175,7 +177,7 @@ void QLPopupMenu::addBinding(string & label, MenuItem const & mi) /// \todo Fix Mac specific menu hack void QLPopupMenu::specialMacXmenuHack() { -#ifdef Q_WS_MACX +#ifdef Q_OS_MACX /* The qt/mac menu code has a very silly hack that moves some menu entries that it recognizes by name (e.g. "Preferences...") to the "LyX" menu. This diff --git a/src/frontends/qt4/lyx_gui.C b/src/frontends/qt4/lyx_gui.C index 4bd4d4e386..da1f7c0e34 100644 --- a/src/frontends/qt4/lyx_gui.C +++ b/src/frontends/qt4/lyx_gui.C @@ -160,7 +160,6 @@ void parse_init(int & argc, char * argv[]) static LQApplication app(argc, argv); -#if QT_VERSION >= 0x030200 // install translation file for Qt built-in dialogs // These are only installed since Qt 3.2.x static QTranslator qt_trans(0); @@ -176,9 +175,8 @@ void parse_init(int & argc, char * argv[]) lyxerr[Debug::GUI] << "Could not find Qt translations for locale " << QTextCodec::locale() << std::endl; -#endif -#ifdef Q_WS_MACX +/*#ifdef Q_WS_MACX // These translations are meant to break Qt/Mac menu merging // algorithm on some entries. It lists the menu names that // should not be moved to the LyX menu @@ -194,7 +192,7 @@ void parse_init(int & argc, char * argv[]) app.installTranslator(&aqua_trans); #endif - +*/ using namespace lyx::graphics; Image::newImage = boost::bind(&QLImage::newImage); -- 2.39.5