Am Freitag, 22. September 2006 11:49 schrieb Abdelrazak Younes:
> Abdelrazak Younes wrote:
> >> 2) I just commit and continue my cleanup work. This includes:
> > 
> > If there's no objection then I will proceed to 2) at the end of the 
day.
> 
> Done.

... and gtk. It compiles, I have no idea whether it works.


Georg
Index: src/frontends/gtk/lyx_gui.C
===================================================================
--- src/frontends/gtk/lyx_gui.C	(Revision 15125)
+++ src/frontends/gtk/lyx_gui.C	(Arbeitskopie)
@@ -37,17 +37,16 @@
 #include "io_callback.h"
 
 // FIXME: move this stuff out again
-#include "bufferlist.h"
 #include "lyxfunc.h"
 #include "lyxserver.h"
 #include "lyxsocket.h"
 #include "BufferView.h"
 
+#include "GuiApplication.h"
 #include "GuiImplementation.h"
 #include "GView.h"
 #include "GtkmmX.h"
 
-#include "xftFontLoader.h"
 #include "GWorkArea.h"
 
 #include "support/lyxlib.h"
@@ -57,8 +56,6 @@
 
 #include <gtkmm.h>
 
-#include "LyXGdkImage.h"
-
 #include <boost/bind.hpp>
 #include <boost/function.hpp>
 #include <boost/shared_ptr.hpp>
@@ -77,16 +74,11 @@ using lyx::support::package;
 
 using lyx::frontend::colorCache;
 using lyx::frontend::Gui;
+using lyx::frontend::GuiApplication;
 using lyx::frontend::GuiImplementation;
 using lyx::frontend::GView;
 
 
-extern BufferList bufferlist;
-
-// FIXME: wrong place !
-LyXServer * lyxserver;
-LyXServerSocket * lyxsocket;
-
 bool lyx_gui::use_gui = true;
 
 namespace {
@@ -102,34 +94,13 @@ int getDPI()
 
 } // namespace anon
 
-class Application: public Gtk::Main
-{
-public:
-	///
-	Application(int & argc, char * argv[]): Gtk::Main(argc, argv)
-	{}
-	///
-	Gui & gui() { return gui_; }
-
-private:
-	///
-	GuiImplementation gui_;
-};
-
-Application * theApp;
+lyx::frontend::Application * theApp;
+GuiApplication * guiApp;
 
 int lyx_gui::exec(int & argc, char * argv[])
 {
-	theApp = new Application(argc, argv);
-
-	using namespace lyx::graphics;
-	Image::newImage = boost::bind(&LyXGdkImage::newImage);
-	Image::loadableFormats = boost::bind(&LyXGdkImage::loadableFormats);
-
-	locale_init();
-
-	// must do this /before/ lyxrc gets read
-	lyxrc.dpi = getDPI();
+	guiApp = new GuiApplication(argc, argv);
+	theApp = guiApp;
 
 	return LyX::ref().exec2(argc, argv);
 }
@@ -141,47 +112,21 @@ void lyx_gui::parse_lyxrc()
 
 
 LyXView * lyx_gui::create_view(unsigned int width, unsigned int height,
-		   int /*posx*/, int /*posy*/, bool)
+		int posx, int posy, bool maximize)
 {
-	int view_id = theApp->gui().newView(width, height);
-	GView & view = static_cast<GView &> (theApp->gui().view(view_id));
-	theApp->gui().newWorkArea(width, height, 0);
-
-	LyX::ref().addLyXView(&view);
-
-	view.show();
-	view.init();
-
-	return &view;
+	return &guiApp->createView(width, height, posx, posy, maximize);
 }
 
 
-int lyx_gui::start(LyXView * view, string const & batch)
+int lyx_gui::start(LyXView *, string const & batch)
 {
-	// FIXME: server code below needs moving
-
-	lyxserver = new LyXServer(&view->getLyXFunc(), lyxrc.lyxpipes);
-	lyxsocket = new LyXServerSocket(&view->getLyXFunc(),
-			  os::internal_path(package().temp_dir() + "/lyxsocket"));
-
-	// handle the batch commands the user asked for
-	if (!batch.empty()) {
-		view->getLyXFunc().dispatch(lyxaction.lookupFunc(batch));
-	}
-
-	theApp->run();
-
-	// FIXME: breaks emergencyCleanup
-	delete lyxsocket;
-	delete lyxserver;
-	return EXIT_SUCCESS;
+	return guiApp->start(batch);
 }
 
 
-void lyx_gui::exit(int /*status*/)
+void lyx_gui::exit(int status)
 {
-	// FIXME: Don't ignore status
-	theApp->quit();
+	guiApp->exit(status);
 }
 
 
Index: src/frontends/gtk/GWorkArea.h
===================================================================
--- src/frontends/gtk/GWorkArea.h	(Revision 15125)
+++ src/frontends/gtk/GWorkArea.h	(Arbeitskopie)
@@ -82,8 +82,6 @@ public:
 	ColorHandler & getColorHandler();
 
 	virtual void setScrollbarParams(int height, int pos, int line_height);
-	/// a selection exists
-	virtual void haveSelection(bool);
 	void inputCommit(gchar * str);
 
 	LyXView & view()
@@ -100,8 +98,6 @@ private:
 	bool onButtonRelease(GdkEventButton * event);
 	bool onMotionNotify(GdkEventMotion * event);
 	bool onKeyPress(GdkEventKey * event);
-	void onClipboardGet(Gtk::SelectionData & selection_data, guint info);
-	void onClipboardClear();
 	LyXView & view_;
 	Gtk::HBox hbox_;
 	Gtk::DrawingArea workArea_;
Index: src/frontends/gtk/GView.C
===================================================================
--- src/frontends/gtk/GView.C	(Revision 15125)
+++ src/frontends/gtk/GView.C	(Arbeitskopie)
@@ -59,7 +59,7 @@ void add_el(Gtk::Box::BoxList & list, Gt
 } // namespace anon
 
 
-GView::GView(Gui & owner) : LyXView(owner)
+GView::GView() : LyXView()
 {
 	// The physical store for the boxes making up the layout.
 	box_store_.push_back(BoxPtr(new Gtk::VBox));
Index: src/frontends/gtk/GuiImplementation.C
===================================================================
--- src/frontends/gtk/GuiImplementation.C	(Revision 15125)
+++ src/frontends/gtk/GuiImplementation.C	(Arbeitskopie)
@@ -32,7 +32,7 @@ namespace frontend {
 
 int GuiImplementation::newView(unsigned int /*w*/, unsigned int /*h*/)
 {
-	view_.reset(new GView(*this));
+	view_.reset(new GView);
 	return 0;
 }
 
@@ -42,7 +42,6 @@ int GuiImplementation::newWorkArea(unsig
 	old_work_area_.reset(new GWorkArea(*view_.get(), w, h));
 	old_screen_.reset(new GScreen(*old_work_area_.get()));
 	work_area_.reset(new GuiWorkArea(old_screen_.get(), old_work_area_.get()));
-	selection_.reset(new GuiSelection(old_work_area_.get()));
 
 	// FIXME BufferView creation should be independant of WorkArea creation
 	buffer_views_[0].reset(new BufferView(view_.get()));
@@ -54,7 +53,6 @@ int GuiImplementation::newWorkArea(unsig
 
 void GuiImplementation::destroyWorkArea(int /*id*/)
 {
-	selection_.reset();
 	work_area_.reset();
 	old_work_area_.reset();
 	old_screen_.reset();
Index: src/frontends/gtk/GView.h
===================================================================
--- src/frontends/gtk/GView.h	(Revision 15125)
+++ src/frontends/gtk/GView.h	(Arbeitskopie)
@@ -35,7 +35,7 @@ public:
 		Center
 	};
 
-	GView(Gui & owner);
+	GView();
 	~GView();
 
 	Gtk::Box & getBox(Position pos);
Index: src/frontends/gtk/GuiSelection.C
===================================================================
--- src/frontends/gtk/GuiSelection.C	(Revision 15125)
+++ src/frontends/gtk/GuiSelection.C	(Arbeitskopie)
@@ -21,8 +21,14 @@
 #endif
 
 #include "GuiSelection.h"
+
+#include "BufferView.h"
 #include "debug.h"
 
+#include "frontends/Application.h"
+#include "frontends/Gui.h"
+#include "frontends/LyXView.h"
+
 #include <gtkmm.h>
 
 using std::endl;
@@ -50,5 +56,38 @@ void GuiSelection::put(docstring const &
 	clipboard->set_text(utf8);
 }
 
+
+void GuiSelection::onClipboardGet(Gtk::SelectionData & /*selection_data*/,
+		guint /*info*/)
+{
+	// FIXME: This assumes only one LyXView
+	lyx::docstring const sel = theApp->gui().view(0).view()->requestSelection();
+	if (!sel.empty())
+		put(sel);
+}
+
+
+void GuiSelection::onClipboardClear()
+{
+	// FIXME: This assumes only one LyXView
+	theApp->gui().view(0).view()->clearSelection();
+}
+
+
+void GuiSelection::haveSelection(bool toHave)
+{
+	if (toHave) {
+		Glib::RefPtr<Gtk::Clipboard> clipboard =
+			Gtk::Clipboard::get(GDK_SELECTION_PRIMARY);
+		std::vector<Gtk::TargetEntry> listTargets;
+		listTargets.push_back(Gtk::TargetEntry("UTF8_STRING"));
+		clipboard->set(listTargets,
+				sigc::mem_fun(const_cast<GuiSelection&>(*this),
+					&GuiSelection::onClipboardGet),
+				sigc::mem_fun(const_cast<GuiSelection&>(*this),
+					&GuiSelection::onClipboardClear));
+	}
+}
+
 } // namespace frontend
 } // namespace lyx
Index: src/frontends/gtk/GuiImplementation.h
===================================================================
--- src/frontends/gtk/GuiImplementation.h	(Revision 15125)
+++ src/frontends/gtk/GuiImplementation.h	(Arbeitskopie)
@@ -18,8 +18,6 @@
 #include "GScreen.h"
 #include "GWorkArea.h"
 
-#include "GuiClipboard.h"
-#include "GuiSelection.h"
 #include "GuiWorkArea.h"
 
 #include <boost/shared_ptr.hpp>
@@ -41,16 +39,6 @@ public:
 	{
 	}
 
-	lyx::frontend::Clipboard & clipboard()
-	{
-		return clipboard_;
-	}
-
-	lyx::frontend::Selection & selection()
-	{
-		return *selection_;
-	}
-
 	int newView(unsigned int w, unsigned int h);
 
 	LyXView & view(int /*id*/)
@@ -74,10 +62,6 @@ public:
 
 private:
 	///
-	GuiClipboard clipboard_;
-	///
-	boost::shared_ptr<GuiSelection> selection_;
-	///
 	boost::shared_ptr<GuiWorkArea> work_area_;
 	///
 	boost::shared_ptr<LyXView> view_;
Index: src/frontends/gtk/Makefile.am
===================================================================
--- src/frontends/gtk/Makefile.am	(Revision 15125)
+++ src/frontends/gtk/Makefile.am	(Arbeitskopie)
@@ -138,6 +138,8 @@ libgtk_la_SOURCES = \
 	LyXKeySymFactory.C \
 	ghelpers.C \
 	ghelpers.h \
+	GuiApplication.C \
+	GuiApplication.h \
 	GuiImplementation.h \
 	GuiImplementation.C \
 	io_callback.C \
@@ -146,3 +148,6 @@ libgtk_la_SOURCES = \
 	xftFontLoader.C \
 	xftFontLoader.h \
 	xftFontMetrics.C
+
+desktopdir = $(datadir)/applications
+dist_desktop_DATA = lyx-gtk.desktop
Index: src/frontends/gtk/GuiSelection.h
===================================================================
--- src/frontends/gtk/GuiSelection.h	(Revision 15125)
+++ src/frontends/gtk/GuiSelection.h	(Arbeitskopie)
@@ -14,7 +14,8 @@
 
 #include "frontends/Selection.h"
 
-#include "GWorkArea.h"
+#include <gtkmm.h>
+#include <gtk/gtk.h>
 
 namespace lyx {
 namespace frontend {
@@ -25,28 +26,22 @@ namespace frontend {
 class GuiSelection: public lyx::frontend::Selection
 {
 public:
-	GuiSelection(GWorkArea * work_area)
-		: old_work_area_(work_area)
-	{
-	}
+	GuiSelection() {}
 
 	virtual ~GuiSelection() {}
 
 	/** Selection overloaded methods
 	 */
 	//@{
-	void haveSelection(bool own)
-	{
-		old_work_area_->haveSelection(own);
-	}
+	void haveSelection(bool own);
 
 	docstring const get() const;
 
 	void put(docstring const & str);
 	//@}
-
 private:
-	GWorkArea * old_work_area_;
+	void onClipboardGet(Gtk::SelectionData & selection_data, guint info);
+	void onClipboardClear();
 };
 
 } // namespace frontend
Index: src/frontends/gtk/GuiApplication.C
===================================================================
--- src/frontends/gtk/GuiApplication.C	(Revision 15125)
+++ src/frontends/gtk/GuiApplication.C	(Arbeitskopie)
@@ -14,10 +14,9 @@
 
 #include "GuiApplication.h"
 
-#include "GuiView.h"
+#include "GView.h"
 #include "GuiWorkArea.h"
-#include "qt_helpers.h"
-#include "QLImage.h"
+#include "GtkmmX.h"
 
 #include "BufferView.h"
 
@@ -31,39 +30,26 @@
 #include "lyxrc.h"
 #include "debug.h"
 
-#include <QApplication>
-#include <QClipboard>
-#include <QEventLoop>
-#include <QLocale>
-#include <QLibraryInfo>
-#include <QTextCodec>
-#include <QTranslator>
-
-#ifdef Q_WS_X11
-#include <X11/Xlib.h>
-#endif
+#include <gtkmm.h>
+
+#include "LyXGdkImage.h"
 
-#include <boost/bind.hpp>
 
 using lyx::support::subst;
 
 using std::string;
 using std::endl;
 
-// in QLyXKeySym.C
-extern void initEncodings();
-
-///////////////////////////////////////////////////////////////
-// You can find other X11 and MACX specific stuff
-// at the end of this file...
-///////////////////////////////////////////////////////////////
 
 namespace {
 
+/// estimate DPI from X server
 int getDPI()
 {
-	QWidget w;
-	return int(0.5 * (w.logicalDpiX() + w.logicalDpiY()));
+	//TODO use GDK instead
+	Screen * scr = ScreenOfDisplay(getDisplay(), getScreen());
+	return int(((HeightOfScreen(scr) * 25.4 / HeightMMOfScreen(scr)) +
+		(WidthOfScreen(scr) * 25.4 / WidthMMOfScreen(scr))) / 2);
 }
 
 } // namespace anon
@@ -73,62 +59,11 @@ namespace lyx {
 namespace frontend {
 
 GuiApplication::GuiApplication(int & argc, char ** argv)
-	: QApplication(argc, argv), Application(argc, argv)
+	: Gtk::Main(argc, argv), Application(argc, argv)
 {
-#ifdef Q_WS_X11
-	// doubleClickInterval() is 400 ms on X11 witch is just too long.
-	// On Windows and Mac OS X, the operating system's value is used.
-	// On Microsoft Windows, calling this function sets the double
-	// click interval for all applications. So we don't!
-	QApplication::setDoubleClickInterval(300);
-#endif
-
-#ifdef Q_WS_MACX
-	AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments,
-			      NewAEEventHandlerUPP(handleOpenDocuments),
-			      0, false);
-#endif
-
-	// install translation file for Qt built-in dialogs
-	// These are only installed since Qt 3.2.x
-	QTranslator qt_trans;
-	QString language_name = QString("qt_") + QLocale::system().name();
-	language_name.truncate(5);
-	if (qt_trans.load(language_name,
-		QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
-	{
-		qApp->installTranslator(&qt_trans);
-		// even if the language calls for RtL, don't do that
-		qApp->setLayoutDirection(Qt::LeftToRight);
-		lyxerr[Debug::GUI]
-			<< "Successfully installed Qt translations for locale "
-			<< fromqstr(language_name) << std::endl;
-	} else
-		lyxerr[Debug::GUI]
-			<< "Could not find  Qt translations for locale "
-			<< fromqstr(language_name) << std::endl;
-
-/*#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
-	QTranslator aqua_trans(0);
-	aqua_trans.insert(QTranslatorMessage("QMenuBar", "Setting", 0,
-					     "do_not_merge_me"));
-	aqua_trans.insert(QTranslatorMessage("QMenuBar", "Config", 0,
-					     "do_not_merge_me"));
-	aqua_trans.insert(QTranslatorMessage("QMenuBar", "Options", 0,
-					     "do_not_merge_me"));
-	aqua_trans.insert(QTranslatorMessage("QMenuBar", "Setup", 0,
-					     "do_not_merge_me"));
-
-	qApp->installTranslator(&aqua_trans);
-#endif
-*/
 	using namespace lyx::graphics;
-
-	Image::newImage = boost::bind(&QLImage::newImage);
-	Image::loadableFormats = boost::bind(&QLImage::loadableFormats);
+	Image::newImage = boost::bind(&LyXGdkImage::newImage);
+	Image::loadableFormats = boost::bind(&LyXGdkImage::loadableFormats);
 
 	// needs to be done before reading lyxrc
 	lyxrc.dpi = getDPI();
@@ -151,13 +86,15 @@ Selection& GuiApplication::selection()
 
 int const GuiApplication::exec()
 {
-	return QApplication::exec();
+	run();
+	return EXIT_SUCCESS;
 }
 
 
-void GuiApplication::exit(int status)
+void GuiApplication::exit(int /*status*/)
 {
-	QApplication::exit(status);
+	// FIXME: Don't ignore status
+	guiApp->quit();
 }
 
 
@@ -167,159 +104,22 @@ LyXView & GuiApplication::createView(uns
 									  int posx, int posy,
 									  bool maximize)
 {
-	// this can't be done before because it needs the Languages object
-	initEncodings();
-
-	int view_id = gui().newView(width, height);
-	GuiView & view = static_cast<GuiView &> (gui().view(view_id));
-
-	lyxfunc_.reset(new LyXFunc(&view));
-
 	// FIXME: for now we assume that there is only one LyXView with id = 0.
 	/*int workArea_id_ =*/ gui().newWorkArea(width, height, 0);
 	//WorkArea * workArea_ = & theApp->gui().workArea(workArea_id_);
 
-	LyX::ref().addLyXView(&view);
-
-	view.init();
+	int view_id = gui().newView(width, height);
+	GView & view = static_cast<GView &>(gui().view(view_id));
 
-	// FIXME: put this initialisation code in GuiView accessible via
-	// a pure virtual method in LyXView.
+	lyxfunc_.reset(new LyXFunc(&view));
 
-	// only true when the -geometry option was NOT used
-	if (width != 0 && height != 0) {
-		if (posx != -1 && posy != -1) {
-#ifdef Q_OS_WIN32
-			// FIXME: use only setGeoemtry when Trolltech has
-			// fixed the qt4/X11 bug
-			view.setGeometry(posx, posy,width, height);
-#else
-			view.resize(width, height);
-			view.move(posx, posy);
-#endif
-		} else {
-			view.resize(width, height);
-		}
-
-		if (maximize)
-			view.setWindowState(Qt::WindowMaximized);
-	}
+	LyX::ref().addLyXView(&view);
 
 	view.show();
+	view.init();
 
 	return view;
 }
 
-
-////////////////////////////////////////////////////////////////////////
-// X11 specific stuff goes here...
-#ifdef Q_WS_X11
-bool GuiApplication::x11EventFilter(XEvent * xev)
-{
-	switch (xev->type) {
-	case SelectionRequest:
-		lyxerr[Debug::GUI] << "X requested selection." << endl;
-		if (buffer_view_) {
-			lyx::docstring const sel = buffer_view_->requestSelection();
-			if (!sel.empty())
-				selection_.put(sel);
-		}
-		break;
-	case SelectionClear:
-		lyxerr[Debug::GUI] << "Lost selection." << endl;
-		if (buffer_view_)
-			buffer_view_->clearSelection();
-		break;
-	}
-	return false;
-}
-#endif
-
-
-////////////////////////////////////////////////////////////////////////
-// Mac OSX specific stuff goes here...
-
-#ifdef Q_WS_MACX
-namespace{
-
-OSErr checkAppleEventForMissingParams(const AppleEvent& theAppleEvent)
- {
-	DescType returnedType;
-	Size actualSize;
-	OSErr err = AEGetAttributePtr(&theAppleEvent, keyMissedKeywordAttr,
-				      typeWildCard, &returnedType, nil, 0,
-				      &actualSize);
-	switch (err) {
-	case errAEDescNotFound:
-		return noErr;
-	case noErr:
-		return errAEEventNotHandled;
-	default:
-		return err;
-	}
- }
-
-} // namespace
-
-OSErr GuiApplication::handleOpenDocuments(const AppleEvent* inEvent,
-				       AppleEvent* /*reply*/, long /*refCon*/)
-{
-	QString s_arg;
-	AEDescList documentList;
-	OSErr err = AEGetParamDesc(inEvent, keyDirectObject, typeAEList,
-				   &documentList);
-	if (err != noErr)
-		return err;
-
-	err = checkAppleEventForMissingParams(*inEvent);
-	if (err == noErr) {
-		long documentCount;
-		err = AECountItems(&documentList, &documentCount);
-		for (long documentIndex = 1;
-		     err == noErr && documentIndex <= documentCount;
-		     documentIndex++) {
-			DescType returnedType;
-			Size actualSize;
-			AEKeyword keyword;
-			FSRef ref;
-			char qstr_buf[1024];
-			err = AESizeOfNthItem(&documentList, documentIndex,
-					      &returnedType, &actualSize);
-			if (err == noErr) {
-				err = AEGetNthPtr(&documentList, documentIndex,
-						  typeFSRef, &keyword,
-						  &returnedType, (Ptr)&ref,
-						  sizeof(FSRef), &actualSize);
-				if (err == noErr) {
-					FSRefMakePath(&ref, (UInt8*)qstr_buf,
-						      1024);
-					s_arg=QString::fromUtf8(qstr_buf);
-//					buffer_view_->workAreaDispatch(
-//						FuncRequest(LFUN_FILE_OPEN,
-//							    fromqstr(s_arg)));
-					break;
-				}
-			}
-		} // for ...
-	}
-	AEDisposeDesc(&documentList);
-
-	return err;
-}
-
-bool GuiApplication::macEventFilter(EventRef event)
-{
-	if (GetEventClass(event) == kEventClassAppleEvent) {
-		EventRecord eventrec;
-		ConvertEventRefToEventRecord(event, &eventrec);
-		AEProcessAppleEvent(&eventrec);
-
-		return false;
-	}
-	return false;
-}
-
-#endif  // Q_WS_MACX
-
 } // namespace frontend
 } // namespace lyx
Index: src/frontends/gtk/GuiApplication.h
===================================================================
--- src/frontends/gtk/GuiApplication.h	(Revision 15125)
+++ src/frontends/gtk/GuiApplication.h	(Arbeitskopie)
@@ -1,5 +1,5 @@
 /**
- * \file qt4/GuiApplication.h
+ * \file gtk/GuiApplication.h
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
@@ -10,25 +10,19 @@
  * Full author contact details are available in file CREDITS.
  */
 
-#ifndef QT4_APPLICATION_H
-#define QT4_APPLICATION_H
+#ifndef GTK_APPLICATION_H
+#define GTK_APPLICATION_H
 
-#include "FontLoader.h"
 #include "GuiClipboard.h"
 #include "GuiImplementation.h"
 #include "GuiSelection.h"
+#include "xftFontLoader.h"
 
 #include "frontends/Application.h"
 
-#include <QApplication>
+#include <gtkmm.h>
 
 ///////////////////////////////////////////////////////////////
-// Specific stuff
-
-#ifdef Q_WS_MACX
-#include <Carbon/Carbon.h>
-#endif
-///////////////////////////////////////////////////////////////
 
 class BufferView;
 
@@ -37,15 +31,15 @@ namespace frontend {
 
 class GuiWorkArea;
 
-/// The Qt main application class
+/// The Gtk main application class
 /**
-There should be only one instance of this class. No Qt object
+There should be only one instance of this class. No Gtk 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 GuiApplication : public QApplication, public Application
+class GuiApplication : public Gtk::Main, public Application
 {
 public:
 	GuiApplication(int & argc, char ** argv);
@@ -60,7 +54,7 @@ public:
 	//@}
 
 	///
-	FontLoader & fontLoader() { return font_loader_; }
+	xftFontLoader & fontLoader() { return font_loader_; }
 
 	///
 	LyXView & createView(unsigned int width, unsigned int height,
@@ -74,21 +68,7 @@ private:
 	///
 	GuiSelection selection_;
 	///
-	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
+	xftFontLoader font_loader_;
 }; // GuiApplication
 
 } // namespace frontend
@@ -97,4 +77,4 @@ private:
 extern lyx::frontend::GuiApplication * guiApp;
 
 
-#endif // QT4_APPLICATION_H
+#endif // GTK_APPLICATION_H
Index: src/frontends/gtk/GWorkArea.C
===================================================================
--- src/frontends/gtk/GWorkArea.C	(Revision 15125)
+++ src/frontends/gtk/GWorkArea.C	(Arbeitskopie)
@@ -493,36 +493,5 @@ bool GWorkArea::onKeyPress(GdkEventKey *
 	return true;
 }
 
-
-void GWorkArea::onClipboardGet(Gtk::SelectionData & /*selection_data*/,
-			       guint /*info*/)
-{
-	lyx::docstring const sel = view_.view()->requestSelection();
-	if (!sel.empty())
-		view_.gui().selection().put(sel);
-}
-
-
-void GWorkArea::onClipboardClear()
-{
-//	clearSelection();
-}
-
-
-void GWorkArea::haveSelection(bool toHave)
-{
-	if (toHave) {
-		Glib::RefPtr<Gtk::Clipboard> clipboard =
-			Gtk::Clipboard::get(GDK_SELECTION_PRIMARY);
-		std::vector<Gtk::TargetEntry> listTargets;
-		listTargets.push_back(Gtk::TargetEntry("UTF8_STRING"));
-		clipboard->set(listTargets,
-			       sigc::mem_fun(const_cast<GWorkArea&>(*this),
-					  &GWorkArea::onClipboardGet),
-			       sigc::mem_fun(const_cast<GWorkArea&>(*this),
-					  &GWorkArea::onClipboardClear));
-	}
-}
-
 } // namespace frontend
 } // namespace lyx

Reply via email to