]> git.lyx.org Git - features.git/commitdiff
Abdelrazak Younes: Compile fixes for the Mac (ChangeLog follows)
authorJürgen Spitzmüller <spitz@lyx.org>
Sun, 12 Mar 2006 17:44:38 +0000 (17:44 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Sun, 12 Mar 2006 17:44:38 +0000 (17:44 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13349 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/QLMenubar.C
src/frontends/qt4/QLMenubar.h
src/frontends/qt4/QLPainter.C
src/frontends/qt4/QLPopupMenu.C
src/frontends/qt4/lyx_gui.C

index f8c16c425b3956c2c1a7e4813004fda0103349ee..d853fc5276fc85a02d0dd13f2aec69d11dac0759 100644 (file)
@@ -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.
  *
 #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<kb_keymap> toplevel_keymap;
-#endif
-
 #include <QMenuBar>
 #include <QCursor>
 
@@ -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
 }
 
index 7c846a8d4e865fe76537d56aa715c62075adfa4b..3fe0676740441fe9860c4e1b1a65131d0e55aa36 100644 (file)
 #include "frontends/Menubar.h"
 
 #include <map>
+#include <boost/scoped_ptr.hpp>
 
 #include <QObject>
+#include <QMenuBar>
+
+#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<std::string, QMenu *> NameMap;
+       typedef std::map<std::string, QLPopupMenu *> NameMap;
 
        /// name to menu for openByName
        NameMap name_map_;
 
-#ifdef Q_WS_MACX
-       boost::scoped_ptr<QMenuBar> menubar_;
-#endif
+       /// MACOS X special menubar.
+       boost::scoped_ptr<QMenuBar> mac_menubar_;
 };
 
 } // namespace frontend
index ed57983ff07acf224debf9b4a5c4c591cb29042f..877f07fde989a09183a9f2962ab075719edb0256 100644 (file)
@@ -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
index a12ea9e25b85c3f7fc672246420dd7204a291301..ecc7d0315a1475816b4e72882119976176965a71 100644 (file)
@@ -11,6 +11,8 @@
 
 #include <config.h>
 
+#include <boost/current_function.hpp>
+
 // 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<kb_keymap> 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
index 4bd4d4e386a0d134ad08417d22cc7ea38de61792..da1f7c0e34c797566146f630df841b817139e425 100644 (file)
@@ -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);