]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVTKRenderWindowInteractor.cxx
#3128 creaMaracasVisu Feature New Normal - branch changeWx28to30 compilation with...
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxVTKRenderWindowInteractor.cxx
index 36a4cfa1183a6caa958ae32bcbe007b4a05dabca..e7aa85e32a8fcf79c6917e8c3e7a08f8a4e6d830 100644 (file)
@@ -1,10 +1,35 @@
+/*# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+#                        pour la Sant�)
+# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+# Previous Authors : Laurent Guigues, Jean-Pierre Roux
+# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+#
+#  This software is governed by the CeCILL-B license under French law and
+#  abiding by the rules of distribution of free software. You can  use,
+#  modify and/ or redistribute the software under the terms of the CeCILL-B
+#  license as circulated by CEA, CNRS and INRIA at the following URL
+#  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+#  or in the file LICENSE.txt.
+#
+#  As a counterpart to the access to the source code and  rights to copy,
+#  modify and redistribute granted by the license, users are provided only
+#  with a limited warranty  and the software's author,  the holder of the
+#  economic rights,  and the successive licensors  have only  limited
+#  liability.
+#
+#  The fact that you are presently reading this means that you have had
+#  knowledge of the CeCILL-B license and that you accept its terms.
+# ------------------------------------------------------------------------ */
+
 /*=========================================================================
 
   Program:   Visualization Toolkit
   Module:    $RCSfile: wxVTKRenderWindowInteractor.cxx,v $
   Language:  C++
-  Date:      $Date: 2011/02/17 11:02:20 $
-  Version:   $Revision: 1.6 $
+  Date:      $Date: 2012/11/15 14:14:35 $
+  Version:   $Revision: 1.7 $
 
   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
   All rights reserved.
@@ -57,23 +82,37 @@ wxWindow* wxGetTopLevelParent(wxWindow *win)
 #endif //VTK_USE_COCOA
 #endif //__WXCOCOA__
 
-#ifdef __WXGTK__
-#    include <gdk/gdkx.h> // GDK_WINDOW_XWINDOW is found here in wxWidgets 2.8.0
-#    include "gdk/gdkprivate.h"
-#if wxCHECK_VERSION(2, 8, 0)
-#ifdef __WXGTK20__
-#include <wx/gtk/win_gtk.h>
-#else
-#include <wx/gtk1/win_gtk.h>
-#endif
+
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+       #ifdef __WXGTK__
+               #    include <gdk/gdkx.h> // GDK_WINDOW_XWINDOW is found here in wxWidgets 2.8.0
+               #    include "gdk/gdkprivate.h"
+               #if wxCHECK_VERSION(2, 8, 0)
+                       #ifdef __WXGTK20__
+                               #include <wx/gtk/win_gtk.h>
+                       #else
+                               #include <wx/gtk1/win_gtk.h>
+                       #endif
+               #else
+                       #include <wx/gtk/win_gtk.h>
+               #endif
+               #define GetXWindow(wxwin) (wxwin)->m_wxwindow ? \
+                                         GDK_WINDOW_XWINDOW(GTK_PIZZA((wxwin)->m_wxwindow)->bin_window) : \
+                                         GDK_WINDOW_XWINDOW((wxwin)->m_widget->window)
+       #endif
 #else
-#include <wx/gtk/win_gtk.h>
-#endif
-#define GetXWindow(wxwin) (wxwin)->m_wxwindow ? \
-                          GDK_WINDOW_XWINDOW(GTK_PIZZA((wxwin)->m_wxwindow)->bin_window) : \
-                          GDK_WINDOW_XWINDOW((wxwin)->m_widget->window)
+       #ifdef __WXGTK__
+           #include <gdk/gdkx.h>
+           #include <gtk/gtk.h>
+       #endif
 #endif
 
+
+
+
+
 #ifdef __WXX11__
 #include "wx/x11/privx.h"
 #define GetXWindow(wxwin)   ((Window)(wxwin)->GetHandle())
@@ -127,7 +166,7 @@ BEGIN_EVENT_TABLE(wxVTKRenderWindowInteractor, wxWindow)
   EVT_SIZE        (wxVTKRenderWindowInteractor::OnSize)
 END_EVENT_TABLE()
 
-vtkCxxRevisionMacro(wxVTKRenderWindowInteractor, "$Revision: 1.6 $")
+vtkCxxRevisionMacro(wxVTKRenderWindowInteractor, "$Revision: 1.7 $")
 vtkInstantiatorNewMacro(wxVTKRenderWindowInteractor)
 
 //---------------------------------------------------------------------------
@@ -341,7 +380,15 @@ long wxVTKRenderWindowInteractor::GetHandleHack()
 
     // Find and return the actual X-Window.
 #if defined(__WXGTK__) || defined(__WXX11__)
-    return (long)GetXWindow(this);
+
+       //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+       #if wxMAJOR_VERSION <= 2
+               return (long)GetXWindow(this);
+       #else
+               GdkWindow* Win = gtk_widget_get_window( (GtkWidget *) GetHandle() );
+               return (long int)GDK_WINDOW_XDISPLAY(Win);
+       #endif
+
 #endif
 
 //#ifdef __WXMOTIF__