[rkward-cvs] SF.net SVN: rkward:[2862] trunk/rkward/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue May 11 18:55:21 UTC 2010


Revision: 2862
          http://rkward.svn.sourceforge.net/rkward/?rev=2862&view=rev
Author:   tfry
Date:     2010-05-11 18:55:20 +0000 (Tue, 11 May 2010)

Log Message:
-----------
Tune the precompiler directives a bit. This should allow compilation against mac native (but the plot windows will *not* be caputred, then).

Modified Paths:
--------------
    trunk/rkward/rkward/rkwardapplication.cpp
    trunk/rkward/rkward/rkwardapplication.h
    trunk/rkward/rkward/windows/rkwindowcatcher.cpp
    trunk/rkward/rkward/windows/rkwindowcatcher.h

Modified: trunk/rkward/rkward/rkwardapplication.cpp
===================================================================
--- trunk/rkward/rkward/rkwardapplication.cpp	2010-05-11 15:16:38 UTC (rev 2861)
+++ trunk/rkward/rkward/rkwardapplication.cpp	2010-05-11 18:55:20 UTC (rev 2862)
@@ -2,7 +2,7 @@
                           rkwardapplication  -  description
                              -------------------
     begin                : Sun Nov 26 2006
-    copyright            : (C) 2006, 2007 by Thomas Friedrichsmeier
+    copyright            : (C) 2006, 2007, 2010 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 
@@ -21,6 +21,8 @@
 
 #ifdef Q_WS_WIN
 #	include <windows.h>
+#elif defined Q_WS_MAC
+#	warning "Graph window capturing is not supported on Mac OS native, yet. Consider using X11."
 #else
 #	include <X11/X.h>
 #	include <X11/Xlib.h>
@@ -65,9 +67,9 @@
 	rkapp = this;
 	detect_x11_creations = false;
 
-#ifndef Q_WS_WIN
+#ifdef Q_WS_X11
 	wm_name_property = XInternAtom (QX11Info::display (), "WM_NAME", true);
-#endif	//nQ_WS_WIN
+#endif	//Q_WS_X11
 }
 
 RKWardApplication::~RKWardApplication () {
@@ -89,10 +91,10 @@
 
 #ifdef Q_WS_WIN
 	RKWardApplicationPrivate::updateToplevelWindowList ();
-#else	//Q_WS_WIN
+#elif defined Q_WS_X11
 	XSelectInput (QX11Info::display (), QX11Info::appRootWindow (), SubstructureNotifyMask);
 	syncX ();	// this is to make sure we don't miss out on the window creation (if it happens very early). Testing shows, we really need this.
-#endif	//Q_WS_WIN
+#endif
 }
 
 WId RKWardApplication::endWindowCreationDetection () {
@@ -129,7 +131,7 @@
 		return candidate_windows[0];
 	}
 	return 0;
-#else	//Q_WS_WIN
+#elif defined Q_WS_X11
 	if (!created_window) {
 		// we did not see the window, yet? Maybe the event simply hasn't been processed, yet.
 		syncX ();
@@ -139,10 +141,12 @@
 	detect_x11_creations = false;
 	XSelectInput (QX11Info::display (), QX11Info::appRootWindow (), NoEventMask);
 	return created_window;
-#endif	//Q_WS_WIN
+#else
+	return 0;
+#endif
 }
 
-#ifndef Q_WS_WIN
+#ifdef Q_WS_X11
 void RKWardApplication::registerNameWatcher (WId watched, RKMDIWindow *watcher) {
 	RK_TRACE (APP);
 	RK_ASSERT (!name_watchers_list.contains (watched));
@@ -188,4 +192,4 @@
 
 	return KApplication::x11EventFilter (e);
 }
-#endif	//nQ_WS_WIN
+#endif	// Q_WS_X11

Modified: trunk/rkward/rkward/rkwardapplication.h
===================================================================
--- trunk/rkward/rkward/rkwardapplication.h	2010-05-11 15:16:38 UTC (rev 2861)
+++ trunk/rkward/rkward/rkwardapplication.h	2010-05-11 18:55:20 UTC (rev 2862)
@@ -40,7 +40,7 @@
 	@returns the window id of the last top-level window created after the last call to startWindowCreation, hoping it was only one. 0 if no window was created/detected. */
 	WId endWindowCreationDetection ();
 
-#ifndef Q_WS_WIN
+#ifdef Q_WS_X11
 	/** watch the given window for changes in its WM_NAME property (i.e. changes in caption). When a change is detected, the caption will be set on watcher. WARNING: Do not use to watch windows managed by Qt! Will override the event mask for this window (within qt_xdisplay ()). WARNING: Remember to call unregisterNameWatcher, when watcher is deleted! */
 	void registerNameWatcher (WId watched, RKMDIWindow *watcher);
 	/** remove a watch created with registerNameWatcher */

Modified: trunk/rkward/rkward/windows/rkwindowcatcher.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkwindowcatcher.cpp	2010-05-11 15:16:38 UTC (rev 2861)
+++ trunk/rkward/rkward/windows/rkwindowcatcher.cpp	2010-05-11 18:55:20 UTC (rev 2862)
@@ -70,7 +70,7 @@
 #ifdef Q_WS_WIN
 #	include "../qwinhost/qwinhost.h"
 #	include <windows.h>
-#else
+#elif defined Q_WS_X11
 #	include <QX11EmbedContainer>
 #endif
 #include <QTimer>
@@ -122,7 +122,7 @@
 	// set a fixed size until the window is shown
 	xembed_container->setFixedSize (wininfo.rcClient.right - wininfo.rcClient.left, wininfo.rcClient.bottom - wininfo.rcClient.top);
 	move (wininfo.rcClient.left, wininfo.rcClient.top);
-#else
+#elif defined Q_WS_X11
 	KWindowInfo wininfo = KWindowSystem::windowInfo (embedded, NET::WMName | NET::WMGeometry);
 	RK_ASSERT (wininfo.valid ());
 
@@ -151,7 +151,7 @@
 	connect (capture, SIGNAL (clientTitleChanged(const QString&)), this, SLOT (setCaption(const QString&)), Qt::QueuedConnection);
 
 	setCaption (capture->getClientTitle ());
-#else
+#elif defined Q_WS_X11
 	capture = new QX11EmbedContainer (xembed_container);
 	capture->embedClient (embedded);
 	connect (capture, SIGNAL (clientClosed ()), this, SLOT (deleteLater ()));
@@ -167,7 +167,7 @@
 	RK_TRACE (MISC);
 
 	capture->close ();
-#ifndef Q_WS_WIN
+#ifdef Q_WS_X11
 	RKWardApplication::getApp ()->unregisterNameWatcher (embedded);
 #endif
 	error_dialog->autoDeleteWhenDone ();

Modified: trunk/rkward/rkward/windows/rkwindowcatcher.h
===================================================================
--- trunk/rkward/rkward/windows/rkwindowcatcher.h	2010-05-11 15:16:38 UTC (rev 2861)
+++ trunk/rkward/rkward/windows/rkwindowcatcher.h	2010-05-11 18:55:20 UTC (rev 2862)
@@ -133,8 +133,11 @@
 	RKProgressControl *error_dialog;
 #ifdef Q_WS_WIN
 	QWinHost *capture;
+#elif defined Q_WS_X11
+	QX11EmbedContainer *capture;
 #else
-	QX11EmbedContainer *capture;
+	// a dummy to make things compile for now
+	QWidget *capture;
 #endif
 
 	bool dynamic_size;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list