Lars Gullik Bjønnes wrote:
Abdelrazak Younes <[EMAIL PROTECTED]> writes:
| > Then QtGui.... (Oh!)
|
| I really don't like it but that's the only thing that would please you Ok.
I am not sure that I like it either.... but I am also unsure if we are
discussing the same thing; ref other mail.
OK just for making clear where I am going with this cleanup please find
attached the header for my Application and TheGui class. This is in my
working copy and I have sent the patch already. I plan to commit that
after the merge.
| We kind of agreed to stay with the flat namespace:
| everything in lyx::frontend
Right...
So we avoid using that and use "namespace fe = lyx::frontend" instead.
But we need to refer to object in the "lyx" namespace also (everything
that is in src) and sometimes we need "lyx::support" object, etc...
Abdel.
// -*- C++ -*-
/**
* \file TheGui.h
* 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.
*/
#ifndef GUI_H
#define GUI_H
#include "frontends/Gui.h"
#include "GuiClipboard.h"
#include <boost/shared_ptr.hpp>
#include <map>
class LyXView;
namespace lyx {
namespace frontend {
class GuiWorkArea;
class GuiView;
/**
* The TheGui class is the interface to all Qt4 components.
*/
class TheGui: public Gui
{
public:
TheGui();
virtual ~TheGui() {}
Clipboard& clipboard();
int newView(unsigned int width, unsigned int height);
LyXView& view(int id);
void destroyView(int id);
int newWorkArea(unsigned int width, unsigned int height, int view_id);
int newWorkArea(int w, int h);
WorkArea& workArea(int id);
void destroyWorkArea(int id);
private:
///
GuiClipboard clipboard_;
///
std::map<int, boost::shared_ptr<GuiView> > views_;
///
std::map<int, boost::shared_ptr<GuiWorkArea> > work_areas_;
///
size_t max_view_id_;
///
size_t max_wa_id_;
};
} // namespace frontend
} // namespace lyx
#endif // GUI_H
/**
* \file qt4/Application.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author unknown
* \author John Levon
* \author Abdelrazak Younes
*
* Full author contact details are available in file CREDITS.
*/
#ifndef LYX_APPLICATION_H
#define LYX_APPLICATION_H
#include "TheGui.h"
#include "FontLoader.h"
#include <QApplication>
///////////////////////////////////////////////////////////////
// Specific stuff
#ifdef Q_WS_MACX
#include <Carbon/Carbon.h>
#endif
///////////////////////////////////////////////////////////////
namespace lyx {
namespace frontend {
class GuiWorkArea;
/// The Qt main application class
/**
There should be only one instance of this class. No Qt object
initialisation should be done before the instanciation of this class.
\todo The work areas handling could be moved to a base virtual class
comon to all frontends.
*/
class Application : public QApplication
{
public:
Application(int & argc, char ** argv);
//
Gui & gui() { return gui_; }
///
FontLoader & fontLoader() { return font_loader_; }
void connect(GuiWorkArea * work_area);
private:
///
GuiWorkArea * work_area_;
///
TheGui gui_;
///
FontLoader font_loader_;
#ifdef Q_WS_X11
public:
bool x11EventFilter (XEvent * ev);
#endif
#ifdef Q_WS_MACX
public:
bool macEventFilter(EventRef event);
private:
// static OSStatus handleOpenDocuments(
static pascal OSErr handleOpenDocuments(
const AppleEvent* inEvent, AppleEvent*, long);
#endif
}; // Application
} // namespace frontend
} // namespace lyx
extern lyx::frontend::Application * theApp;
#endif // LYX_APPLICATION_H