compile fix

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15311 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2006-10-12 16:50:47 +00:00
parent eedd7bd25f
commit bd8fc3aed3
3 changed files with 8 additions and 156 deletions

View File

@ -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<int, shared_ptr<socket_callback> > socket_callbacks;
std::map<int, boost::shared_ptr<socket_callback> > 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<void()> func)
{
socket_callbacks[fd] = shared_ptr<socket_callback>(new socket_callback(fd, func));
socket_callbacks[fd] = boost::shared_ptr<socket_callback>(new socket_callback(fd, func));
}

View File

@ -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();

View File

@ -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 <config.h>
#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 <boost/signal.hpp> // FIXME: Is this needed? (Lgb)
#include <boost/bind.hpp>
#include <boost/shared_ptr.hpp>
#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 <Carbon/Carbon.h>
#endif
#include <qapplication.h>
#if QT_VERSION >= 0x030100
#include <qeventloop.h>
#endif
#include <qpaintdevicemetrics.h>
#include <qtranslator.h>
#include <qtextcodec.h>
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<int, shared_ptr<socket_callback> > 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<void()> func)
{
socket_callbacks[fd] = shared_ptr<socket_callback>(new socket_callback(fd, func));
}
void unregister_socket_callback(int fd)
{
socket_callbacks.erase(fd);
}
}; // namespace lyx_gui