Salome HOME
updated copyright message
[modules/gui.git] / src / GLViewer / GLViewer_ViewPort.cxx
index 699d245a6bd717e4ccacbc02ad2cf2a740e1d499..544917c70b3ca2a16b02a1ce0fb7628db7caa72e 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_ViewPort.cxx
 // Created:   November, 2004
@@ -41,7 +42,7 @@
 
 #include <stdlib.h>
 
-#if !defined WIN32
+#if !defined WIN32 && !defined __APPLE__
 #include <QX11Info>
 #include <GL/glx.h>
 #include <X11/Xlib.h>
@@ -50,7 +51,6 @@
 #include <X11/Xmu/StdCmap.h>
 #undef QT_CLEAN_NAMESPACE
 #include <Xw_Window.hxx>
-#include <Graphic3d_GraphicDevice.hxx>
 
 /*!
   \struct CMapEntry
@@ -121,15 +121,13 @@ static Colormap choose_cmap( Display *dpy, XVisualInfo *vi )
 #ifdef DEBUG
     cout << "Choosing cmap for vID = " << vi->visualid << endl;
 #endif
-
-    if ( vi->visualid == XVisualIDFromVisual( (Visual*)QX11Info::appVisual() ) )
+    if ( vi->visualid == XVisualIDFromVisual( XDefaultVisual( QX11Info::display(), -1 ) ) )
     {
 #ifdef DEBUG
-        cout << "Using x11AppColormap" << endl;
+        cout << "Using XDefaultColormap" << endl;
 #endif
-        return QX11Info::appColormap();
+        return XDefaultColormap( QX11Info::display(), -1 );
     }
-
     if ( mesa_gl )
     {
         Atom hp_cmaps = XInternAtom( dpy, "_HP_RGB_SMOOTH_MAP_LIST", true );
@@ -344,7 +342,7 @@ void GLViewer_ViewPort::cleanup()
 */
 void GLViewer_ViewPort::selectVisualId( ViewType type )
 {
-#if !defined WIN32
+#if !defined WIN32 && !defined __APPLE__
     XVisualInfo* pVisualInfo;
     if ( QX11Info::display() )
     {