Am Montag, 12. Juni 2006 18:09 schrieb Abdelrazak Younes:
> Lars Gullik Bjønnes wrote:
> > Abdelrazak Younes <[EMAIL PROTECTED]> writes:
> > 
> > | Lars Gullik Bjønnes wrote:
> > | > Abdelrazak Younes <[EMAIL PROTECTED]> writes:
> > | > | Abdelrazak Younes wrote:
> > | > | > Hello,
> > | > | > I just committed this patch the "younes" branch. I would be 
happy if
> > | > | > some kind sould help me verify complete that.
> > | > | | I managed to install Qt3 so I have fixed compilation issues 
for
> > | > qt3. I
> > | > | have a new weird issue though:
> > | > | | D:\devel\lyx\trunk\src\frontends\qt3\QCommandBuffer.C: In 
member
> > | > | function `virtual void
> > | > | 
lyx::frontend::<unnamed>::QTempListBox::mouseReleaseEvent(QMouseEvent*)':
> > | > | D:\devel\lyx\trunk\src\frontends\qt3\QCommandBuffer.C:55: error:
> > | > | `emit' was not declared in this scope
> > | > Ahh, the lovely world of Qt.
> > | 
> > | Of Qt3! I never had a single problem like this one with Qt4. I tried
> > | to #define and #undef a lot of things but I still have this error. I
> > | thought the problem was that QTempListBox was not a proper Q_OBJECT
> > | but it's more than that apparently. Here is my current patch is
> > | someone has a clever idea for me.
> > 
> > One of the tricks used earlier was to make sure that
> > <boost/signals.hpp> was included before the qt headers.
> 
> But it is! <boost/signals.hpp> is included in LyXView.h which is the 
> second include in QtView.h (after config.h), which is the second include 
> in QCommandBuffer.C (after config.h).
> 
> > I dunno...
> 
> Me neither

Why don't you simply grep for 'emit'? You would find several places where 
emit is #undefined, and a README that tells you not to do so.

Some other things I noticed:
- (at least) src/frontends/qt3/Gui.h has wrong line endings
- order the files alphabetically in Makefile.ams, please
- It is confusing that src/frontends/Gui.h defines lyx::Gui, and 
src/frontends/qt3/Gui.h defines lyx::frontend::Gui.
- The existence of lyx::WorkArea and lyx::frontend::WorkArea does seems to 
confuse compilers. I get a compile error in qt4/Application.C because the 
wrong WorkArea.h is included. It seems that MSvC and gcc disagree whether 
to use lyx::WorkArea or lyx::frontend::WorkArea if only WorkArea is given 
in the lyx::frontend namespace, so I think it would be best for now not 
to have files and classes with the same name in frontends and 
frontends/qt4 etc.
- The existence of both src/frontends/foo.h and src/frontends/bar/foo.h is 
confusing with the current includepaths. If you want to do something like 
that you should remove src/frontends from the includepath so that all 
included files in frontends need the extra "frontend" directory.
- Please try hard not to include too many files in headers (see the 
patch). More includes could be saved if you created a 
src/frontends/*/Gui.C and put some methods there.


The attached patch fixes the compile problems for all frontends. Since I 
am not sure whether this is what you had in mind please apply yourself.

Please don't complain that you need to include Clipboard.h and WorkArea.h 
in more places. If you don't like that you should rethink your decision 
to have the contens of these classes not in class Gui.


Georg
Index: src/BufferView_pimpl.C
===================================================================
--- src/BufferView_pimpl.C	(Revision 14085)
+++ src/BufferView_pimpl.C	(Arbeitskopie)
@@ -58,11 +58,13 @@
 #include "insets/insettext.h"
 
 #include "frontends/Alert.h"
+#include "frontends/Clipboard.h"
 #include "frontends/Dialogs.h"
 #include "frontends/FileDialog.h"
 #include "frontends/font_metrics.h"
 #include "frontends/LyXView.h"
 #include "frontends/Gui.h"
+#include "frontends/WorkArea.h"
 
 #include "graphics/Previews.h"
 
Index: src/frontends/gtk/GWorkArea.h
===================================================================
--- src/frontends/gtk/GWorkArea.h	(Revision 14085)
+++ src/frontends/gtk/GWorkArea.h	(Arbeitskopie)
@@ -14,6 +14,8 @@
 
 #include "GPainter.h"
 
+#include <boost/shared_ptr.hpp>
+
 #include <gtkmm.h>
 #include <gtk/gtk.h>
 
Index: src/frontends/gtk/GView.C
===================================================================
--- src/frontends/gtk/GView.C	(Revision 14085)
+++ src/frontends/gtk/GView.C	(Arbeitskopie)
@@ -57,7 +57,7 @@ void add_el(Gtk::Box::BoxList & list, Gt
 } // namespace anon
 
 
-GView::GView()
+GView::GView() : frontend_(*this)
 {
 	// The physical store for the boxes making up the layout.
 	box_store_.push_back(BoxPtr(new Gtk::VBox));
Index: src/frontends/gtk/GScreen.h
===================================================================
--- src/frontends/gtk/GScreen.h	(Revision 14085)
+++ src/frontends/gtk/GScreen.h	(Arbeitskopie)
@@ -40,7 +40,6 @@ public:
 	virtual void removeCursor();
 	///
 	virtual void showCursor(int x, int y, int h, lyx::GuiCursor::Cursor_Shape shape);
-protected:
 
 	/// Copies specified area of pixmap to screen
 	virtual void expose(int x, int y, int w, int h);
Index: src/frontends/qt3/qtTimeout.h
===================================================================
--- src/frontends/qt3/qtTimeout.h	(Revision 14085)
+++ src/frontends/qt3/qtTimeout.h	(Arbeitskopie)
@@ -12,11 +12,15 @@
 #ifndef QTTIMEOUT_H
 #define QTTIMEOUT_H
 
+#ifdef emit
+#undef emit
+#include "frontends/Timeout.h"
+#define emit
+#else
 #include "frontends/Timeout.h"
+#endif
 #include <qobject.h>
 
-// stupid Qt
-#undef emit
 
 /**
  * This class executes the callback when the timeout expires
Index: src/frontends/qt3/QContentPane.h
===================================================================
--- src/frontends/qt3/QContentPane.h	(Revision 14085)
+++ src/frontends/qt3/QContentPane.h	(Arbeitskopie)
@@ -12,12 +12,14 @@
 #ifndef QCONTENTPANE_H
 #define QCONTENTPANE_H
 
+#include "funcrequest.h"
 #ifdef emit
 #undef emit
-#endif
-
-#include "funcrequest.h"
 #include "frontends/Timeout.h"
+#define emit
+#else
+#include "frontends/Timeout.h"
+#endif
 
 #include <qwidget.h>
 #include <qpixmap.h>
Index: src/frontends/qt3/Gui.h
===================================================================
--- src/frontends/qt3/Gui.h	(Revision 14085)
+++ src/frontends/qt3/Gui.h	(Arbeitskopie)
@@ -23,8 +23,6 @@
 
 #include <boost/shared_ptr.hpp>
 
-#include <map>
-
 namespace lyx {
 namespace frontend {
 
Index: src/frontends/qt3/qtTimeout.C
===================================================================
--- src/frontends/qt3/qtTimeout.C	(Revision 14085)
+++ src/frontends/qt3/qtTimeout.C	(Arbeitskopie)
@@ -14,6 +14,9 @@
 
 #include "debug.h"
 
+// stupid Qt
+#undef emit
+
 
 Timeout::Timeout(unsigned int msec, Type t)
 	: pimpl_(new qtTimeout(*this)), type(t), timeout_ms(msec)
Index: src/frontends/qt4/Application.C
===================================================================
--- src/frontends/qt4/Application.C	(Revision 14085)
+++ src/frontends/qt4/Application.C	(Arbeitskopie)
@@ -10,10 +10,9 @@
  * Full author contact details are available in file CREDITS.
  */
 
+#include "WorkArea.h"
 #include "Application.h"
 
-#include "frontends/WorkArea.h"
-
 #include "qt_helpers.h"
 #include "BufferView.h"
 #include "debug.h"
Index: src/frontends/qt4/Makefile.am
===================================================================
--- src/frontends/qt4/Makefile.am	(Revision 14085)
+++ src/frontends/qt4/Makefile.am	(Arbeitskopie)
@@ -82,7 +82,6 @@ libqt4_la_SOURCES = \
 	Qt2BC.C	Qt2BC.h	\
 	QtLyXView.h \
 	checkedwidgets.C checkedwidgets.h \
-	LyxClipboard.C LyxClipboard.h \
 	Application.C Application.h \
 	lyx_gui.C \
 	lcolorcache.h lcolorcache.C \
Index: src/frontends/Gui.h
===================================================================
--- src/frontends/Gui.h	(Revision 14085)
+++ src/frontends/Gui.h	(Arbeitskopie)
@@ -14,12 +14,14 @@
 #ifndef BASE_GUI_H
 #define BASE_GUI_H
 
-#include "frontends/Clipboard.h"
-#include "frontends/WorkArea.h"
 #include "frontends/GuiCursor.h"
 
 namespace lyx {
 
+class Clipboard;
+class WorkArea;
+
+
 /**
  * A Gui class manages the different frontend elements.
  */
Index: src/frontends/xforms/XFormsView.C
===================================================================
--- src/frontends/xforms/XFormsView.C	(Revision 14085)
+++ src/frontends/xforms/XFormsView.C	(Arbeitskopie)
@@ -74,7 +74,7 @@ void print_metrics(std::ostream & os, st
 XFormsView::XFormsView(int width, int height)
 	: LyXView(),
 	  window_(Box(width, height)),
-	  icon_pixmap_(0), icon_mask_(0)
+	  icon_pixmap_(0), icon_mask_(0), frontend_(*this)
 {
 	int const air = 2;
 
Index: src/frontends/xforms/XFormsView.h
===================================================================
--- src/frontends/xforms/XFormsView.h	(Revision 14085)
+++ src/frontends/xforms/XFormsView.h	(Arbeitskopie)
@@ -12,6 +12,7 @@
 #ifndef LyXView_H
 #define LyXView_H
 
+#include "Gui.h"
 #include "LayoutEngine.h"
 #include "forms_fwd.h"
 
Index: src/frontends/xforms/xscreen.h
===================================================================
--- src/frontends/xforms/xscreen.h	(Revision 14085)
+++ src/frontends/xforms/xscreen.h	(Arbeitskopie)
@@ -40,7 +40,6 @@ public:
 	/// Sets the cursor color to LColor::cursor.
 	virtual	void setCursorColor();
 
-protected:
 	/// Copies specified area of pixmap to screen
 	virtual void expose(int x, int y, int w, int h);
 
Index: src/BufferView.C
===================================================================
--- src/BufferView.C	(Revision 14085)
+++ src/BufferView.C	(Arbeitskopie)
@@ -39,9 +39,11 @@
 #include "WordLangTuple.h"
 
 #include "frontends/Alert.h"
+#include "frontends/Clipboard.h"
 #include "frontends/Dialogs.h"
 #include "frontends/LyXView.h"
 #include "frontends/Gui.h"
+#include "frontends/WorkArea.h"
 
 #include "insets/insetcommand.h" // ChangeRefs
 #include "insets/insettext.h"

Reply via email to