This patch makes it compile (and probably breaks qt), but xforms fails
brutally upon start up.

IMHO there are too many different changes in the younes branch now.

Index: src/frontends/WorkArea.h
===================================================================
--- src/frontends/WorkArea.h	(revision 14200)
+++ src/frontends/WorkArea.h	(working copy)
@@ -66,7 +66,7 @@
 	void greyOut();
 
 	/// paint the cursor and store the background
-	virtual void showCursor(int x, int y, int h, Cursor_Shape shape) = 0;
+	virtual void showCursor(int x, int y, int h, CursorShape shape) = 0;
 
 	/// hide the cursor
 	virtual void removeCursor() = 0;
Index: src/frontends/qt3/QtView.C
===================================================================
Index: src/frontends/GuiCursor.h
===================================================================
--- src/frontends/GuiCursor.h	(revision 14200)
+++ src/frontends/GuiCursor.h	(working copy)
@@ -11,6 +11,22 @@
  * Full author contact details are available in file CREDITS.
  */
 
+// X11 use a define called CursorShape, and we really want to use
+// that name our selves. Therefore we do something similar to what is done
+// in kde/fixx11h.h:
+namespace X {
+#ifdef CursorShape
+#ifndef FIXX11H_CursorShape
+#define FIXX11H_CursorShape
+int const XCursorShape = CursorShape;
+#undef CursorShape
+int const CursorShape = CursorShape;
+#endif
+#undef CursorShape
+#endif
+
+} // namespace X
+
 #ifndef GUI_CURSOR_H
 #define GUI_CURSOR_H
 
@@ -26,7 +42,7 @@
 class WorkArea;
 
 /// types of cursor in work area
-enum Cursor_Shape {
+enum CursorShape {
 	/// normal I-beam
 	BAR_SHAPE,
 	/// L-shape for locked insets of a different language
Index: src/frontends/Gui.h
===================================================================
--- src/frontends/Gui.h	(revision 14200)
+++ src/frontends/Gui.h	(working copy)
@@ -18,6 +18,8 @@
 
 #include <boost/shared_ptr.hpp>
 
+#include <map>
+
 class LyXView;
 
 namespace lyx {
Index: src/frontends/xforms/XFormsView.C
===================================================================
--- src/frontends/xforms/XFormsView.C	(revision 14200)
+++ src/frontends/xforms/XFormsView.C	(working copy)
@@ -74,7 +74,7 @@
 XFormsView::XFormsView(Gui & owner, int width, int height)
 	: LyXView(owner),
 	  window_(Box(width, height)),
-	  icon_pixmap_(0), icon_mask_(0), frontend_(*this)
+	  icon_pixmap_(0), icon_mask_(0)
 {
 	int const air = 2;
 
@@ -108,7 +108,6 @@
 
 	menubar_.reset(new XFormsMenubar(this, menubackend));
 	getToolbars().init();
-	bufferview_.reset(new BufferView(this, width, height));
 	minibuffer_.reset(new XMiniBuffer(*this, *controlcommand_));
 
 	//  Assign an icon to the main form.
Index: src/frontends/xforms/xscreen.C
===================================================================
--- src/frontends/xforms/xscreen.C	(revision 14200)
+++ src/frontends/xforms/xscreen.C	(working copy)
@@ -73,7 +73,7 @@
 }
 
 
-void XScreen::showCursor(int x, int y, int h, Cursor_Shape shape)
+void XScreen::showCursor(int x, int y, int h, CursorShape shape)
 {
 	// Update the cursor color. (a little slow doing it like this ??)
 	setCursorColor();
Index: src/frontends/xforms/XFormsView.h
===================================================================
--- src/frontends/xforms/XFormsView.h	(revision 14200)
+++ src/frontends/xforms/XFormsView.h	(working copy)
@@ -12,7 +12,6 @@
 #ifndef LyXView_H
 #define LyXView_H
 
-#include "GuiImplementation.h"
 #include "LayoutEngine.h"
 #include "forms_fwd.h"
 
Index: src/frontends/xforms/GuiImplementation.C
===================================================================
--- src/frontends/xforms/GuiImplementation.C	(revision 0)
+++ src/frontends/xforms/GuiImplementation.C	(revision 0)
@@ -0,0 +1,50 @@
+// -*- C++ -*-
+/**
+ * \file xforms/GuiImplementation.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Abdelrazak Younes
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include "GuiImplementation.h"
+
+namespace lyx {
+namespace frontend {
+
+int GuiImplementation::newView(unsigned int w, unsigned int h)
+{
+	view_.reset(new XFormsView(*this, w, h));
+	return 0;
+}
+
+
+	int GuiImplementation::newWorkArea(unsigned int w, unsigned int h, int /*view_id*/)
+{
+	old_work_area_.reset(new XWorkArea(*view_.get(), w, h));
+	old_screen_.reset(new XScreen(*boost::static_pointer_cast<XWorkArea>(old_work_area_)));
+	work_area_.reset(new GuiWorkArea(boost::static_pointer_cast<XScreen>(old_screen_).get(),
+					 boost::static_pointer_cast<XWorkArea>(old_work_area_).get()));
+	clipboard_.reset(new GuiClipboard(boost::static_pointer_cast<XWorkArea>(old_work_area_).get()));
+	guiCursor().connect(work_area_.get());
+	
+	// FIXME BufferView creation should be independant of WorkArea creation
+	buffer_views_[0].reset(new BufferView(view_.get(), work_area_.get()));
+	work_area_->setBufferView(buffer_views_[0].get());
+	view_->setBufferView(buffer_views_[0].get());
+	return 0;
+}
+
+
+void GuiImplementation::destroyWorkArea(int /*id*/)
+{
+	clipboard_.reset();
+	work_area_.reset();
+	old_work_area_.reset();
+	old_screen_.reset();
+}
+
+} // namespace frontend
+} // namespace lyx

Property changes on: src/frontends/xforms/GuiImplementation.C
___________________________________________________________________
Name: svn:eol-style
   + native

Index: src/frontends/xforms/xscreen.h
===================================================================
--- src/frontends/xforms/xscreen.h	(revision 14200)
+++ src/frontends/xforms/xscreen.h	(working copy)
@@ -13,10 +13,10 @@
 #ifndef XSCREEN_H
 #define XSCREEN_H
 
-#include "frontends/GuiCursor.h"
-
 #include <X11/Xlib.h> // for Pixmap, GC
 
+#include "frontends/GuiCursor.h"
+
 class WorkArea;
 
 namespace lyx {
@@ -44,7 +44,7 @@
 	virtual void expose(int x, int y, int w, int h);
 
 	/// paint the cursor and store the background
-	virtual void showCursor(int x, int y, int h, Cursor_Shape shape);
+	virtual void showCursor(int x, int y, int h, CursorShape shape);
 
 	/// hide the cursor
 	virtual void removeCursor();
Index: src/frontends/xforms/GuiImplementation.h
===================================================================
--- src/frontends/xforms/GuiImplementation.h	(revision 14200)
+++ src/frontends/xforms/GuiImplementation.h	(working copy)
@@ -17,10 +17,13 @@
 
 #include "xscreen.h"
 #include "XWorkArea.h"
+#include "XFormsView.h"
 
 #include "GuiClipboard.h"
 #include "GuiWorkArea.h"
 
+#include "BufferView.h"
+
 #include <boost/shared_ptr.hpp>
 
 #include <map>
@@ -28,10 +32,6 @@
 namespace lyx {
 namespace frontend {
 
-typedef XFormsView FView;
-typedef XScreen FScreen;
-typedef XWorkArea FWorkArea;
-
 /**
  * The Gui class is the interface to all XForms components.
  */
@@ -51,51 +51,28 @@
 		return *clipboard_;
 	}
 
-	int newView(unsigned int w, unsigned int h)
-	{
-		view_.reset(new FView(*this, w, h));
-		return 0;
-	}
+	int newView(unsigned int w, unsigned int h);
 
 
-	LyXView& view(int id)
+	LyXView & view(int /*id*/)
 	{
 		return *view_;
 	}
 
 
-	void destroyView(int id)
+	void destroyView(int /*id*/)
 	{
 		view_.reset();
 	}
 
-	int newWorkArea(unsigned int w, unsigned int h, int view_id)
-	{		
-		old_work_area_.reset(new FWorkArea(*view_.get(), w, h));
-		old_screen_.reset(new FScreen(*old_work_area_.get()));
-		work_area_.reset(new GuiWorkArea(old_screen_.get(), old_work_area_.get()));
-		clipboard_.reset(new GuiClipboard(old_work_area_.get()));
-		guiCursor().connect(work_area_.get());
-
-		// FIXME BufferView creation should be independant of WorkArea creation
-		buffer_views_[0].reset(new BufferView(view_.get(), work_area_.get()));
-		work_area_->setBufferView(buffer_views_[0].get());
-		view_->setBufferView(buffer_views_[0].get());
-		return 0;
-	}
+	int newWorkArea(unsigned int w, unsigned int h, int view_id);
 
-	lyx::frontend::WorkArea& workArea(int id)
+	lyx::frontend::WorkArea & workArea(int /*id*/)
 	{
 		return *work_area_;
 	}
 
-	void destroyWorkArea(int id)
-	{
-		clipboard_.reset();
-		work_area_.reset();
-		old_work_area_.reset();
-		old_screen_.reset();
-	}
+	void destroyWorkArea(int id);
 
 private:
 	///
@@ -103,11 +80,11 @@
 	///
 	boost::shared_ptr<GuiWorkArea> work_area_;
 	///
-	boost::shared_ptr<FView> view_;
+	boost::shared_ptr<LyXView> view_;
 	///
-	boost::shared_ptr<FWorkArea> old_work_area_;
+	boost::shared_ptr<XWorkArea> old_work_area_;
 	///
-	boost::shared_ptr<FScreen> old_screen_;
+	boost::shared_ptr<XScreen> old_screen_;
 };
 
 } // namespace frontend
Index: src/frontends/xforms/XWorkArea.h
===================================================================
--- src/frontends/xforms/XWorkArea.h	(revision 14200)
+++ src/frontends/xforms/XWorkArea.h	(working copy)
@@ -31,7 +31,7 @@
 	///
 	XWorkArea(LyXView & owner, int width, int height);
 	///
-	~XWorkArea();
+	virtual ~XWorkArea();
 	///
 	virtual Painter & getPainter() { return painter_; }
 	///
Index: src/frontends/xforms/Makefile.am
===================================================================
--- src/frontends/xforms/Makefile.am	(revision 14200)
+++ src/frontends/xforms/Makefile.am	(working copy)
@@ -158,6 +158,7 @@
 	FormWrap.h \
 	GuiClipboard.h \
 	GuiImplementation.h \
+	GuiImplementation.C \
 	GuiWorkArea.h \
 	LayoutEngine.C \
 	LayoutEngine.h \
Index: src/frontends/xforms/GuiClipboard.h
===================================================================
--- src/frontends/xforms/GuiClipboard.h	(revision 14200)
+++ src/frontends/xforms/GuiClipboard.h	(working copy)
@@ -19,15 +19,13 @@
 namespace lyx {
 namespace frontend {
 
-typedef XWorkArea FWorkArea;
-
 /**
  * The XForms version of the Clipboard.
  */
 class GuiClipboard: public lyx::frontend::Clipboard
 {
 public:
-	GuiClipboard(FWorkArea * work_area)
+	GuiClipboard(XWorkArea * work_area)
 		: old_work_area_(work_area)
 	{
 	}
@@ -54,7 +52,7 @@
 	//@}
 
 private:
-	FWorkArea * old_work_area_;
+	XWorkArea * old_work_area_;
 };
 
 } // namespace frontend
Index: src/frontends/xforms/GuiWorkArea.h
===================================================================
--- src/frontends/xforms/GuiWorkArea.h	(revision 14200)
+++ src/frontends/xforms/GuiWorkArea.h	(working copy)
@@ -20,16 +20,13 @@
 namespace lyx {
 namespace frontend {
 
-typedef XScreen FScreen;
-typedef XWorkArea FWorkArea;
-
 /**
  * Temporary wrapper around XWorkArea and XScreen.
  * Please refer to the Qt4 implementation for a proper cleanup of the API.
  */
 class GuiWorkArea: public lyx::frontend::WorkArea {
 public:
-	GuiWorkArea(FScreen * screen, FWorkArea * work_area)
+	GuiWorkArea(XScreen * screen, XWorkArea * work_area)
 		: old_screen_(screen), old_work_area_(work_area)
 	{
 	}
@@ -67,7 +64,7 @@
 
 
 	/// paint the cursor and store the background
-	virtual void showCursor(int x, int y, int h, Cursor_Shape shape)
+	virtual void showCursor(int x, int y, int h, CursorShape shape)
 	{
 		old_screen_->showCursor(x, y, h, shape);
 	}
@@ -86,8 +83,8 @@
 	}
 
 private:
-	FScreen * old_screen_;
-	FWorkArea * old_work_area_;
+	XScreen * old_screen_;
+	XWorkArea * old_work_area_;
 };
 
 } // namespace frontend
Index: src/frontends/GuiCursor.C
===================================================================
--- src/frontends/GuiCursor.C	(revision 14200)
+++ src/frontends/GuiCursor.C	(working copy)
@@ -42,10 +42,6 @@
 
 #include "support/filetools.h" // LibFileSearch
 
-#include <boost/utility.hpp>
-#include <boost/bind.hpp>
-#include <boost/signals/trackable.hpp>
-
 using lyx::support::libFileSearch;
 
 using std::endl;
@@ -57,7 +53,7 @@
 namespace frontend {
 
 GuiCursor::GuiCursor()
-	: cursor_visible_(false), work_area_(NULL)
+	: cursor_visible_(false), work_area_(0)
 {
 }
 
@@ -80,7 +76,7 @@
 	if (!bv.available())
 		return;
 
-	Cursor_Shape shape = BAR_SHAPE;
+	CursorShape shape = BAR_SHAPE;
 
 	LyXText const & text = *bv.getLyXText();
 	LyXFont const & realfont = text.real_current_font;
Index: src/BufferView.h
===================================================================
Index: src/lyx_main.h
===================================================================
-- 
        Lgb

Reply via email to