mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
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
This commit is contained in:
parent
4035592aee
commit
98b1da0248
@ -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<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
|
||||
}
|
||||
|
||||
|
@ -16,11 +16,13 @@
|
||||
#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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user