diff --git a/src/AlienImage/AlienImage_X11XWDAlienData.cxx b/src/AlienImage/AlienImage_X11XWDAlienData.cxx index 3aea541595..b2f57bdf03 100755 --- a/src/AlienImage/AlienImage_X11XWDAlienData.cxx +++ b/src/AlienImage/AlienImage_X11XWDAlienData.cxx @@ -29,7 +29,7 @@ #define TEST //GG_140699 // Check file extension, must be ".xwd". -#ifndef WNT +#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) # include #endif // WNT #include diff --git a/src/AlienImage/AlienImage_X11XWDFileHeader.cxx b/src/AlienImage/AlienImage_X11XWDFileHeader.cxx index 2b03bb2e45..49b5183f2f 100755 --- a/src/AlienImage/AlienImage_X11XWDFileHeader.cxx +++ b/src/AlienImage/AlienImage_X11XWDFileHeader.cxx @@ -16,7 +16,7 @@ // purpose or non-infringement. Please see the License for the specific terms // and conditions governing the rights and limitations under the License. -#ifndef WNT +#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) # include #endif // WNT #include diff --git a/src/Aspect/Aspect_XWD.hxx b/src/Aspect/Aspect_XWD.hxx index fb36ecc3e1..b91e84834b 100755 --- a/src/Aspect/Aspect_XWD.hxx +++ b/src/Aspect/Aspect_XWD.hxx @@ -18,7 +18,7 @@ #ifndef __Aspect_WNTXWD_HXX # define __Aspect_WNTXWD_HXX -# ifndef WNT +#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) # include # else diff --git a/src/Draw/Draw_Window.cxx b/src/Draw/Draw_Window.cxx index cd553921a7..539bab44e9 100755 --- a/src/Draw/Draw_Window.cxx +++ b/src/Draw/Draw_Window.cxx @@ -134,10 +134,6 @@ defaultPrompt: # include #endif - -#include -#include - #include #include @@ -174,10 +170,7 @@ static Standard_Boolean tty; /* Non-zero means standard input is a static unsigned long thePixels[MAXCOLOR]; - -Display* Draw_WindowDisplay = NULL; Standard_Integer Draw_WindowScreen = 0; -Colormap Draw_WindowColorMap; Standard_Boolean Draw_BlackBackGround = Standard_True; @@ -187,10 +180,21 @@ Draw_Window* Draw_Window::firstWindow = NULL; // X11 specific part #if !defined(__APPLE__) || defined(MACOSX_USE_GLX) +#include #include +Display* Draw_WindowDisplay = NULL; +Colormap Draw_WindowColorMap; static Handle(Aspect_DisplayConnection) Draw_DisplayConnection; +// Base_Window struct definition +//=================================== +struct Base_Window +{ + GC gc; + XSetWindowAttributes xswa; +}; + //======================================================================= //function : Draw_Window //purpose : @@ -597,6 +601,7 @@ void Draw_Window::Hide() //======================================================================= void Draw_Window::Destroy() { + XFreeGC (Draw_WindowDisplay, base.gc); XDestroyWindow(Draw_WindowDisplay, win); win = 0; if (myBuffer != 0) diff --git a/src/Draw/Draw_WindowBase.hxx b/src/Draw/Draw_WindowBase.hxx deleted file mode 100755 index 12c81ee199..0000000000 --- a/src/Draw/Draw_WindowBase.hxx +++ /dev/null @@ -1,41 +0,0 @@ -// Created on: 1995-03-17 -// Created by: Remi LEQUETTE -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2012 OPEN CASCADE SAS -// -// The content of this file is subject to the Open CASCADE Technology Public -// License Version 6.5 (the "License"). You may not use the content of this file -// except in compliance with the License. Please obtain a copy of the License -// at http://www.opencascade.org and read it completely before using this file. -// -// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its -// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. -// -// The Original Code and all software distributed under the License is -// distributed on an "AS IS" basis, without warranty of any kind, and the -// Initial Developer hereby disclaims all such warranties, including without -// limitation, any warranties of merchantability, fitness for a particular -// purpose or non-infringement. Please see the License for the specific terms -// and conditions governing the rights and limitations under the License. - - - -#ifndef _Draw_WindowBase_HeaderFile -#define _Draw_WindowBase_HeaderFile - -#ifndef WNT -#include -#include -#include -#endif - -// Definition de la class Base_Window -//=================================== -struct Base_Window -{ - GC gc; - XSetWindowAttributes xswa; -}; - - -#endif diff --git a/src/Draw/FILES b/src/Draw/FILES index 2e588e86d9..9f0dd1a22d 100755 --- a/src/Draw/FILES +++ b/src/Draw/FILES @@ -13,7 +13,6 @@ Draw_Viewer.hxx Draw_Viewer.hxx Draw_Window.cxx Draw_Window.hxx -Draw_WindowBase.hxx Draw_PInterp.hxx Draw_CommandFunction.hxx DrawRessource.h diff --git a/src/QADraw/QADraw.cxx b/src/QADraw/QADraw.cxx index 5cdfb951b6..1b886191ca 100755 --- a/src/QADraw/QADraw.cxx +++ b/src/QADraw/QADraw.cxx @@ -17,11 +17,6 @@ // purpose or non-infringement. Please see the License for the specific terms // and conditions governing the rights and limitations under the License. - - -#if defined(WNT) -#include -#endif #include #include #include @@ -41,18 +36,13 @@ #include #include #include +#include -#if ! defined(WNT) -#include -//#include -#include -#include -#include -#include +#if defined(_WIN32) || defined(__WIN32__) +# include +# include #else -#include -#include -#include +# include #endif #include @@ -448,88 +438,11 @@ static Standard_Integer QAAISGetMousePoint (Draw_Interpretor& di, Standard_Integ return 0; } -static Standard_Integer QAAISGetColorCoord (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) -{ -#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) - if ( argc > 1 ) { - di << "Usage : " << argv[0] << "\n"; - return 1; - } - Handle(Xw_Window) QAAISWindow; - - Handle (V3d_View) QAAIS_MainView = ViewerTest::CurrentView (); - if ( QAAIS_MainView.IsNull () ) { - di << "You must initialize AISViewer before this command." << "\n"; - return 1; - } - QAAISWindow = Handle(Xw_Window)::DownCast (QAAIS_MainView->V3d_View::Window()); - - Standard_Integer QAAIS_WindowSize_X = 0; - Standard_Integer QAAIS_WindowSize_Y = 0; - QAAISWindow->Size(QAAIS_WindowSize_X, QAAIS_WindowSize_Y); - Handle(Aspect_DisplayConnection) aDisplayConnection = new Aspect_DisplayConnection(); - Handle(Graphic3d_GraphicDriver) aGraphicDriver = Graphic3d::InitGraphicDriver (aDisplayConnection); - - Draw_Window QAAIS_CoordWindow ("coordinate", 421, 205, 200, 60); - QAAIS_CoordWindow.DisplayWindow (); - QAAIS_CoordWindow.SetColor (12); - - Handle (Xw_Window) QAAIS_ColorWindow = new Xw_Window (aDisplayConnection, "color", 0.4074, 0.678, 0.1962, 0.06, Quantity_NOC_BLACK); - Handle (V3d_Viewer) QAAIS_ColorViewer = new V3d_Viewer (aGraphicDriver, Standard_ExtString ("COLOR")); - Handle (V3d_View) QAAIS_ColorView = QAAIS_ColorViewer -> CreateView (); - QAAIS_ColorWindow -> Map (); - QAAIS_ColorView -> SetWindow (QAAIS_ColorWindow); - QAAIS_ColorView -> SetBackgroundColor (Quantity_NOC_BLACK); - QAAIS_ColorView -> Redraw (); - - Standard_Integer QAAIS_MousePoint_X = 0; - Standard_Integer QAAIS_MousePoint_Y = 0; - Standard_Character QAAIS_MousePointX[32]; - Sprintf (QAAIS_MousePointX, "X : %d", QAAIS_MousePoint_X); - Standard_Character QAAIS_MousePointY[32]; - Sprintf (QAAIS_MousePointY, "Y : %d", QAAIS_MousePoint_Y); - Standard_ShortReal QAAIS_ColorRED = 0; - Standard_ShortReal QAAIS_ColorGRN = 0; - Standard_ShortReal QAAIS_ColorBLU = 0; - Quantity_Color QAAIS_ShowingColor; - QAAIS_ShowingColor.SetValues (QAAIS_ColorRED, QAAIS_ColorGRN, QAAIS_ColorBLU, Quantity_TOC_RGB); - Standard_Integer argccc = 5; - const char *bufff[] = { "A", "B", "C", "D", "E" }; - const char **argvvv = (const char **) bufff; - while (ViewerMainLoop (argccc, argvvv)) { - Handle(TColStd_HSequenceOfReal) aSeq; - Image_PixMap anImage; - - ViewerTest::GetMousePosition (QAAIS_MousePoint_X, QAAIS_MousePoint_Y); - Handle (V3d_View) QAAIS_MainView = ViewerTest::CurrentView(); - QAAIS_MainView->ToPixMap (anImage, QAAIS_WindowSize_X, QAAIS_WindowSize_Y); - - aSeq = GetColorOfPixel (anImage, QAAIS_MousePoint_X, QAAIS_MousePoint_Y, 0); - - QAAIS_ColorRED = aSeq->Value(1); - QAAIS_ColorGRN = aSeq->Value(2); - QAAIS_ColorBLU = aSeq->Value(3); - QAAIS_ShowingColor.SetValues (QAAIS_ColorRED, QAAIS_ColorGRN, QAAIS_ColorBLU, Quantity_TOC_RGB); - QAAIS_ColorView -> SetBackgroundColor (QAAIS_ShowingColor); - QAAIS_ColorView -> Redraw (); - QAAIS_CoordWindow.Clear(); - Sprintf (QAAIS_MousePointX, "X : %d", QAAIS_MousePoint_X); - Sprintf (QAAIS_MousePointY, "Y : %d", QAAIS_MousePoint_Y); - QAAIS_CoordWindow.DrawString (30, 35, QAAIS_MousePointX); - QAAIS_CoordWindow.DrawString (125, 35, QAAIS_MousePointY); - } - QAAIS_CoordWindow.Destroy (); -#endif //WNT - return 0; -} - //============================================================================== // VIEWER GLOBALs //============================================================================== #ifndef WNT extern Draw_Viewer dout; -extern Display* Draw_WindowDisplay; -extern Colormap Draw_WindowColorMap; #else Standard_IMPORT Draw_Viewer dout; #endif @@ -692,7 +605,6 @@ void QADraw::CommonCommands(Draw_Interpretor& theCommands) theCommands.Add("QARebuild","QARebuild command_name",__FILE__,QARebuild,group); theCommands.Add("QAGetPixelColor", "QAGetPixelColor coordinate_X coordinate_Y [color_R color_G color_B]", __FILE__,QAAISGetPixelColor, group); theCommands.Add("QAGetMousePoint", "QAGetMousePoint", __FILE__,QAAISGetMousePoint, group); - theCommands.Add("QAGetColorCoord", "QAGetColorCoord", __FILE__,QAAISGetColorCoord, group); theCommands.Add("vtri_orig", "vtri_orig : vtri_orig trihedron_name - draws axis origin lines", __FILE__,VTrihedronOrigins,group);