From bd8fc3aed3d79334d22232ea371ef6f05445ae7b Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Thu, 12 Oct 2006 16:50:47 +0000 Subject: [PATCH] compile fix git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15311 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt3/GuiApplication.C | 12 ++- src/frontends/qt3/GuiApplication.h | 1 + src/frontends/qt3/lyx_gui.C | 151 ----------------------------- 3 files changed, 8 insertions(+), 156 deletions(-) delete mode 100644 src/frontends/qt3/lyx_gui.C diff --git a/src/frontends/qt3/GuiApplication.C b/src/frontends/qt3/GuiApplication.C index d167f9fdb8..0c96371d7f 100644 --- a/src/frontends/qt3/GuiApplication.C +++ b/src/frontends/qt3/GuiApplication.C @@ -17,6 +17,7 @@ #include "GuiApplication.h" +#include "lcolorcache.h" #include "qt_helpers.h" #include "QLImage.h" #include "socket_callback.h" @@ -28,6 +29,7 @@ #include "support/package.h" #include "BufferView.h" +#include "Color.h" #include "lyx_main.h" #include "lyxrc.h" #include "debug.h" @@ -61,7 +63,7 @@ extern void initEncodings(); namespace { -map > socket_callbacks; +std::map > socket_callbacks; int getDPI() { @@ -75,9 +77,9 @@ int getDPI() namespace lyx { -lyx::frontend::Application * createApplication(int & argc, char * argv[]) +frontend::Application * createApplication(int & argc, char * argv[]) { - GuiApplication app(argc, argv); + frontend::GuiApplication app(argc, argv); return &app; } @@ -233,7 +235,7 @@ bool GuiApplication::getRgbColor(LColor_color col, string const GuiApplication::hexName(LColor_color col) { - return ltrim(fromqstr(lcolorcache.get(col).name()), "#"); + return lyx::support::ltrim(fromqstr(lcolorcache.get(col).name()), "#"); } @@ -246,7 +248,7 @@ void GuiApplication::updateColor(LColor_color) void GuiApplication::registerSocketCallback(int fd, boost::function func) { - socket_callbacks[fd] = shared_ptr(new socket_callback(fd, func)); + socket_callbacks[fd] = boost::shared_ptr(new socket_callback(fd, func)); } diff --git a/src/frontends/qt3/GuiApplication.h b/src/frontends/qt3/GuiApplication.h index 9684b95853..9b3b845720 100644 --- a/src/frontends/qt3/GuiApplication.h +++ b/src/frontends/qt3/GuiApplication.h @@ -60,6 +60,7 @@ public: virtual int const exec(); virtual Gui & gui() { return gui_; } virtual void exit(int status); + void syncEvents(); virtual std::string const romanFontName(); virtual std::string const sansFontName(); virtual std::string const typewriterFontName(); diff --git a/src/frontends/qt3/lyx_gui.C b/src/frontends/qt3/lyx_gui.C deleted file mode 100644 index c6465d43d7..0000000000 --- a/src/frontends/qt3/lyx_gui.C +++ /dev/null @@ -1,151 +0,0 @@ -/** - * \file qt3/lyx_gui.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author unknown - * \author John Levon - * - * Full author contact details are available in file CREDITS. - */ - -#include - -#include "lyx_gui.h" - -// FIXME: move this stuff out again -#include "BufferView.h" -#include "Color.h" -#include "funcrequest.h" -#include "LColor.h" -#include "lyx_main.h" -#include "LyXAction.h" -#include "lyxfunc.h" -#include "lyxrc.h" -#include "lyxserver.h" -#include "lyxsocket.h" - -#include "support/lstrings.h" -#include "support/os.h" -#include "support/package.h" -#include "debug.h" - -// Dear Lord, deliver us from Evil, aka the Qt headers -// Qt defines a macro 'signals' that clashes with a boost namespace. -// All is well if the namespace is visible first. -#include // FIXME: Is this needed? (Lgb) -#include -#include -#include "frontends/LyXView.h" -#include "frontends/WorkArea.h" - -#include "GuiApplication.h" -#include "QtView.h" -#include "lcolorcache.h" -#include "qfont_loader.h" -#include "QLImage.h" -#include "qt_helpers.h" -#include "socket_callback.h" - -#ifdef Q_WS_MACX -#include -#endif - -#include -#if QT_VERSION >= 0x030100 -#include -#endif -#include -#include -#include - -using lyx::support::ltrim; -using lyx::support::package; - -using lyx::frontend::GuiApplication; -using lyx::frontend::QtView; - -namespace os = lyx::support::os; - -using boost::shared_ptr; - -using std::map; -using std::vector; -using std::string; - - -namespace { - -map > socket_callbacks; - -} // namespace anon - - -GuiApplication * guiApp; - -namespace lyx_gui { - -int exec(int & argc, char * argv[]) -{ - GuiApplication app(argc, argv); - - guiApp = &app; - theApp = guiApp; - - return LyX::ref().exec2(argc, argv); -} - - -void sync_events() -{ - // This is the ONLY place where processEvents may be called. - // During screen update/ redraw, this method is disabled to - // prevent keyboard events being handed to the LyX core, where - // they could cause re-entrant calls to screen update. -#if QT_VERSION >= 0x030100 - qApp->eventLoop()->processEvents(QEventLoop::ExcludeUserInput); -#endif -} - - -bool getRGBColor(LColor_color col, lyx::RGBColor & rgbcol) -{ - QColor const & qcol = lcolorcache.get(col); - if (!qcol.isValid()) { - rgbcol.r = 0; - rgbcol.g = 0; - rgbcol.b = 0; - return false; - } - rgbcol.r = qcol.red(); - rgbcol.g = qcol.green(); - rgbcol.b = qcol.blue(); - return true; -} - - -string const hexname(LColor_color col) -{ - return ltrim(fromqstr(lcolorcache.get(col).name()), "#"); -} - - -void update_color(LColor_color) -{ - // FIXME: Bleh, can't we just clear them all at once ? - lcolorcache.clear(); -} - - -void register_socket_callback(int fd, boost::function func) -{ - socket_callbacks[fd] = shared_ptr(new socket_callback(fd, func)); -} - - -void unregister_socket_callback(int fd) -{ - socket_callbacks.erase(fd); -} - -}; // namespace lyx_gui