1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0025216: WNT_Window - remove unused fields and types (WNT_WindowData)

Clean up InterfaceGraphic.hxx

OpenGl_Window - do not use removed macros WINDOW

Small correction of test case for issue CR25216
This commit is contained in:
kgv
2014-09-25 13:14:45 +04:00
committed by bugmaster
parent c1c03615f6
commit eaf5c5e010
20 changed files with 208 additions and 757 deletions

View File

@@ -2,11 +2,5 @@ InterfaceGraphic.hxx
InterfaceGraphic_Aspect.hxx InterfaceGraphic_Aspect.hxx
InterfaceGraphic_Graphic3d.hxx InterfaceGraphic_Graphic3d.hxx
InterfaceGraphic_Visual3d.hxx InterfaceGraphic_Visual3d.hxx
InterfaceGraphic_WNT.hxx
InterfaceGraphic_X11.hxx
InterfaceGraphic_Cocoa.hxx
InterfaceGraphic_XWD.hxx
InterfaceGraphic_wntio.hxx
InterfaceGraphic_cPrintf.cxx
InterfaceGraphic_telem.hxx InterfaceGraphic_telem.hxx
InterfaceGraphic_tgl_all.hxx InterfaceGraphic_tgl_all.hxx

View File

@@ -15,12 +15,31 @@
#ifndef __INTERFACE_GRAPHIC_HXX #ifndef __INTERFACE_GRAPHIC_HXX
#define __INTERFACE_GRAPHIC_HXX #define __INTERFACE_GRAPHIC_HXX
#ifdef WNT #if defined(_WIN32)
#include <InterfaceGraphic_WNT.hxx>
#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX) #include <windows.h>
#include <InterfaceGraphic_Cocoa.hxx>
#else #ifdef DrawText
#include <InterfaceGraphic_X11.hxx> #undef DrawText
#endif
#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
#include <stdio.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <GL/glx.h>
// workaround name conflicts with OCCT methods (in class TopoDS_Shape for example)
#ifdef Convex
#undef Convex
#endif
#ifdef Status
#undef Status
#endif
#endif #endif
#endif // __INTERFACE_GRAPHIC_HXX #endif // __INTERFACE_GRAPHIC_HXX

View File

@@ -1,36 +0,0 @@
// Copyright (c) 2013-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifdef __APPLE__
#ifndef InterfaceGraphic_CocoaHeader
#define InterfaceGraphic_CocoaHeader
#include <stdio.h>
#define WINDOW void*
#define DISPLAY void*
#define GLCONTEXT void*
#define GLDRAWABLE void*
#define GET_GL_CONTEXT() NULL
#define GET_GLDEV_CONTEXT() NULL
#define GL_MAKE_CURRENT(a,b,c) {}
#ifndef EXPORT
#define EXPORT
#endif
#endif // InterfaceGraphic_CocoaHeader
#endif // __APPLE__

View File

@@ -1,77 +0,0 @@
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef __INTERFACE_GRAPHIC_WNT_HXX
# define __INTERFACE_GRAPHIC_WNT_HXX
#ifdef WNT
# include <windows.h>
# ifdef DrawText
# undef DrawText
# endif /* DrawText */
//for common type naming
# define DISPLAY char
# define WINDOW HWND
# define GLCONTEXT HGLRC
# define GLDRAWABLE HDC
# define GET_GL_CONTEXT() wglGetCurrentContext ()
# define GET_GLDEV_CONTEXT() wglGetCurrentDC()
# define GL_MAKE_CURRENT(a,b,c) wglMakeCurrent(b,c)
#ifdef DrawText
# undef DrawText
#endif /* DrawText */
#define WDF_NOERASEBKGRND 0x00000001
#define WDF_FOREIGN 0x00000002
typedef struct window_data {
void* WNT_Window_Ptr; // pointer to WNT_Window
void* WNT_WDriver_Ptr; // pointer to WNT_WDriver or Visual3d_View
void* WNT_VMgr; // pointer to Visual3d_ViewManager
HPALETTE hPal; // palette handle or NULL
HBITMAP hBmp; // double buffer bitmap handle or NULL
DWORD dwFlags; // additional information
} WINDOW_DATA;
#define faUnderlined 0x00000001
#define faItalic 0x00000002
#define faStrikeOut 0x00000004
#define faBold 0x00000008
#define faHeight 0x00000010
#define faAngle 0x00000020
#define faWidth 0x00000040
#define faSlant 0x00000080
typedef struct font_data {
BOOL fdUnderlined;
BOOL fdItalic;
BOOL fdStrikeOut;
LONG fdBold;
LONG fdHeight;
LONG fdOrientation;
LONG fdWidth;
LONG fdSlant;
} FONT_DATA;
#endif //WNT
#endif /* __INTERFACE_GRAPHIC_WNT_HXX */

View File

@@ -1,64 +0,0 @@
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _WIN32
#ifndef InterfaceGraphic_X11Header
#define InterfaceGraphic_X11Header
#include <stdio.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <GL/glx.h>
#if defined (sun) || defined (SUNOS) || defined (__alpha) || defined (DECOSF1) || defined (sgi) || defined (IRIX) || defined (__hpux)|| defined (HPUX)
#ifndef icon_width
#include <X11/bitmaps/icon>
#endif
#endif // SUNOS or DECOSF1 or SOLARIS or HPUX or IRIX
#if defined(ULTRIX) && !defined(icon_width)
#define icon_width 16
#define icon_height 16
static unsigned char icon_bits[] =
{
0xff, 0xff, 0xab, 0xaa, 0x55, 0xd5, 0xab, 0xaa, 0x05, 0xd0, 0x0b, 0xa0,
0x05, 0xd0, 0x0b, 0xa0, 0x05, 0xd0, 0x0b, 0xa0, 0x05, 0xd0, 0x0b, 0xa0,
0x55, 0xd5, 0xab, 0xaa, 0x55, 0xd5, 0xff, 0xff
};
#endif // ULTRIX
// workaround name conflicts with OCCT methods (in class TopoDS_Shape for example)
#ifdef Convex
#undef Convex
#endif
#ifdef Status
#undef Status
#endif
#define WINDOW Window
#define DISPLAY Display
#define GLCONTEXT GLXContext
#define GLDRAWABLE GLXDrawable
#define GET_GL_CONTEXT() glXGetCurrentContext()
#define GET_GLDEV_CONTEXT() glXGetCurrentDrawable()
#define GL_MAKE_CURRENT(a,b,c) glXMakeCurrent(a,b,c)
#ifndef EXPORT
#define EXPORT
#endif // EXPORT
#endif // InterfaceGraphic_X11Header
#endif // _WIN32

View File

@@ -1,30 +0,0 @@
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef InterfaceGraphic_XWDHeader
#define InterfaceGraphic_XWDHeader
/*
* InterfaceGraphic_SWAPTEST = 0 sur sun, sgi, hp
* 1 sur ao1
*/
#define InterfaceGraphic_SWAPTEST (*(char*)&InterfaceGraphic_swaptest)
static unsigned long InterfaceGraphic_swaptest = 1;
#include <InterfaceGraphic_X11.hxx>
#include <X11/XWDFile.h>
#endif /* InterfaceGraphic_XWDHeader */

View File

@@ -1,147 +0,0 @@
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#if defined (__osf__ ) || defined ( DECOSF1 )
int DECOSF1_a_horreur_du_vide_a_la_compilation;
#endif
#if defined ( __hpux ) || defined ( HPUX )
int HPUX_a_horreur_du_vide_a_la_compilation;
#endif
#ifdef WNT
#define STRICT
#include <windows.h>
#include <stdio.h>
#include <string.h>
#include <InterfaceGraphic_wntio.hxx>
typedef struct _env {
DWORD len;
char* ptr;
} ENV, *PENV;
static DWORD tlsIndex;
class Init_ {
public:
Init_ () { tlsIndex = TlsAlloc (); }
}; // end Init_
static Init_ init;
int cPrintf ( char* fmt, ... ) {
static BOOL first = TRUE;
static HANDLE hConsole = NULL;
char buffer[ 256 ];
va_list argptr;
int cnt;
DWORD lpcchWritten;
if ( first ) {
hConsole = GetStdHandle ( STD_OUTPUT_HANDLE );
if ( hConsole == NULL ) {
AllocConsole ();
hConsole = GetStdHandle ( STD_OUTPUT_HANDLE );
} /* end if */
first = FALSE;
} /* end if */
va_start( argptr, fmt );
cnt = vsprintf ( buffer, fmt, argptr );
va_end ( argptr );
WriteConsole ( hConsole, buffer, (DWORD) strlen ( buffer ), &lpcchWritten, NULL );
return cnt;
} /* end cPrintf */
int fcPrintf ( int /*dummy*/, char* fmt, ... ) {
static BOOL first = TRUE;
static HANDLE hConsole = NULL;
char buffer[ 256 ];
va_list argptr;
int cnt;
DWORD lpcchWritten;
if ( first ) {
hConsole = GetStdHandle ( STD_OUTPUT_HANDLE );
if ( hConsole == NULL ) {
AllocConsole ();
hConsole = GetStdHandle ( STD_OUTPUT_HANDLE );
} /* end if */
first = FALSE;
} /* end if */
va_start( argptr, fmt );
cnt = vsprintf ( buffer, fmt, argptr );
va_end ( argptr );
WriteConsole ( hConsole, buffer, (DWORD )strlen ( buffer ), &lpcchWritten, NULL );
return cnt;
} /* end fcPrintf */
char* GetEnv ( char* name ) {
DWORD dwLen;
PENV env = ( PENV )TlsGetValue ( tlsIndex );
if ( env == NULL ) {
env = ( PENV )HeapAlloc (
GetProcessHeap (), HEAP_GENERATE_EXCEPTIONS | HEAP_ZERO_MEMORY,
( DWORD )sizeof ( ENV )
);
TlsSetValue ( tlsIndex, ( LPVOID )env );
} /* end if */
SetLastError ( ERROR_SUCCESS );
dwLen = GetEnvironmentVariable ( name, NULL, 0 );
if ( dwLen == 0 && GetLastError () != ERROR_SUCCESS ) return NULL;
++dwLen;
if ( env -> len < dwLen ) {
if ( env -> ptr != NULL )
env -> ptr = ( char* )HeapReAlloc (
GetProcessHeap (), HEAP_GENERATE_EXCEPTIONS | HEAP_ZERO_MEMORY,
env -> ptr, dwLen
);
else
env -> ptr = ( char* )HeapAlloc (
GetProcessHeap (), HEAP_GENERATE_EXCEPTIONS | HEAP_ZERO_MEMORY,
dwLen
);
env -> len = dwLen;
} /* end if */
GetEnvironmentVariable ( name, env -> ptr, dwLen );
return env -> ptr;
} /* end GetEnv */
#endif /* WNT */

View File

@@ -1,43 +0,0 @@
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef __WNTIO_H
# define __WNTIO_H
# ifdef __cplusplus
extern "C" {
# endif /* __cplusplus */
# ifndef __InterfaceGraphic_API
# ifdef __InterfaceGraphic_DLL
# define __InterfaceGraphic_API __declspec( dllexport )
# else
# define __InterfaceGraphic_API __declspec( dllimport )
# endif /* __InterfaceGraphic_DLL */
# endif /* __InterfaceGraphic_API */
__InterfaceGraphic_API int cPrintf ( char*, ... );
__InterfaceGraphic_API int fcPrintf ( int, char*, ... );
__InterfaceGraphic_API char* form ( char*, ... );
__InterfaceGraphic_API char* GetEnv ( char* );
# ifdef __cplusplus
}
# endif /* __cplusplus */
# define printf cPrintf
# define fprintf fcPrintf
# define getenv GetEnv
#endif /* __WNTIO_H */

View File

@@ -19,7 +19,7 @@
#ifdef WNT #ifdef WNT
#define THIS void #define THIS void
#include <InterfaceGraphic_WNT.hxx> #include <InterfaceGraphic.hxx>
#include <stdlib.h> #include <stdlib.h>
#include <vfw.h> #include <vfw.h>
#include <TCollection_AsciiString.hxx> #include <TCollection_AsciiString.hxx>

View File

@@ -353,8 +353,8 @@ OpenGl_Window::OpenGl_Window (const Handle(Aspect_DisplayConnection)& theDisplay
myGlContext->Init ((Aspect_Handle )aWindow, (Aspect_Handle )aWindowDC, (Aspect_RenderingContext )aGContext); myGlContext->Init ((Aspect_Handle )aWindow, (Aspect_Handle )aWindowDC, (Aspect_RenderingContext )aGContext);
#else #else
WINDOW aParent = (WINDOW )theCWindow.XWindow; Window aParent = (Window )theCWindow.XWindow;
WINDOW aWindow = 0; Window aWindow = 0;
Display* aDisp = theDisplayConnection->GetDisplay(); Display* aDisp = theDisplayConnection->GetDisplay();
GLXContext aGContext = (GLXContext )theGContext; GLXContext aGContext = (GLXContext )theGContext;

View File

@@ -118,14 +118,13 @@ void Visual3d_View::SetWindow (const Handle(Aspect_Window)& theWindow)
const Handle(WNT_Window) aWin = Handle(WNT_Window)::DownCast (theWindow); const Handle(WNT_Window) aWin = Handle(WNT_Window)::DownCast (theWindow);
MyCView.DefWindow.XWindow = (HWND )(aWin->HWindow()); MyCView.DefWindow.XWindow = (HWND )(aWin->HWindow());
MyCView.DefWindow.XParentWindow = (HWND )(aWin->HParentWindow()); MyCView.DefWindow.XParentWindow = (HWND )(aWin->HParentWindow());
WNT_WindowData* aWinData = (WNT_WindowData* )GetWindowLongPtr ((HWND )(aWin->HWindow()), GWLP_USERDATA);
aWinData->WNT_WDriver_Ptr = (void* )this;
aWinData->WNT_VMgr = myViewManager;
#elif (defined(__APPLE__) && !defined(MACOSX_USE_GLX)) #elif (defined(__APPLE__) && !defined(MACOSX_USE_GLX))
const Handle(Cocoa_Window) aWin = Handle(Cocoa_Window)::DownCast (theWindow); const Handle(Cocoa_Window) aWin = Handle(Cocoa_Window)::DownCast (theWindow);
MyCView.DefWindow.XWindow = (Aspect_Drawable )aWin->HView(); MyCView.DefWindow.XWindow = (Aspect_Drawable )aWin->HView();
MyCView.DefWindow.XParentWindow = NULL; MyCView.DefWindow.XParentWindow = NULL;
//MyCView.DefWindow.XParentWindow = aWin->HParentWindow(); //MyCView.DefWindow.XParentWindow = aWin->HParentWindow();
#elif defined(__ANDROID__)
//
#else #else
const Handle(Xw_Window) aWin = Handle(Xw_Window)::DownCast (theWindow); const Handle(Xw_Window) aWin = Handle(Xw_Window)::DownCast (theWindow);
MyCView.DefWindow.XWindow = aWin->XWindow(); MyCView.DefWindow.XWindow = aWin->XWindow();

View File

@@ -444,12 +444,14 @@ Standard_Boolean Visual3d_ViewManager::ViewExists (const Handle(Aspect_Window)&
// Parse the list of views to find // Parse the list of views to find
// a view with the specified window // a view with the specified window
#if defined(_WIN32) || defined(__WIN32__) #if defined(_WIN32)
const Handle(WNT_Window) THEWindow = Handle(WNT_Window)::DownCast (AWindow); const Handle(WNT_Window) THEWindow = Handle(WNT_Window)::DownCast (AWindow);
Aspect_Handle TheSpecifiedWindowId = THEWindow->HWindow (); Aspect_Handle TheSpecifiedWindowId = THEWindow->HWindow ();
#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX) #elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
const Handle(Cocoa_Window) THEWindow = Handle(Cocoa_Window)::DownCast (AWindow); const Handle(Cocoa_Window) THEWindow = Handle(Cocoa_Window)::DownCast (AWindow);
NSView* TheSpecifiedWindowId = THEWindow->HView(); NSView* TheSpecifiedWindowId = THEWindow->HView();
#elif defined(__ANDROID__)
int TheSpecifiedWindowId = -1;
#else #else
const Handle(Xw_Window) THEWindow = Handle(Xw_Window)::DownCast (AWindow); const Handle(Xw_Window) THEWindow = Handle(Xw_Window)::DownCast (AWindow);
int TheSpecifiedWindowId = int (THEWindow->XWindow ()); int TheSpecifiedWindowId = int (THEWindow->XWindow ());
@@ -461,12 +463,14 @@ Standard_Boolean Visual3d_ViewManager::ViewExists (const Handle(Aspect_Window)&
{ {
const Handle(Aspect_Window) AspectWindow = (MyDefinedView.Value(i))->Window(); const Handle(Aspect_Window) AspectWindow = (MyDefinedView.Value(i))->Window();
#if defined(_WIN32) || defined(__WIN32__) #if defined(_WIN32)
const Handle(WNT_Window) theWindow = Handle(WNT_Window)::DownCast (AspectWindow); const Handle(WNT_Window) theWindow = Handle(WNT_Window)::DownCast (AspectWindow);
Aspect_Handle TheWindowIdOfView = theWindow->HWindow (); Aspect_Handle TheWindowIdOfView = theWindow->HWindow ();
#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX) #elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
const Handle(Cocoa_Window) theWindow = Handle(Cocoa_Window)::DownCast (AspectWindow); const Handle(Cocoa_Window) theWindow = Handle(Cocoa_Window)::DownCast (AspectWindow);
NSView* TheWindowIdOfView = theWindow->HView(); NSView* TheWindowIdOfView = theWindow->HView();
#elif defined(__ANDROID__)
int TheWindowIdOfView = 0;
#else #else
const Handle(Xw_Window) theWindow = Handle(Xw_Window)::DownCast (AspectWindow); const Handle(Xw_Window) theWindow = Handle(Xw_Window)::DownCast (AspectWindow);
int TheWindowIdOfView = int (theWindow->XWindow ()); int TheWindowIdOfView = int (theWindow->XWindow ());

View File

@@ -4,4 +4,3 @@ WNT_CMPLRS.edl
WNT_WOKUMake.edl WNT_WOKUMake.edl
WNT_Dword.hxx WNT_Dword.hxx
WNT_Uint.hxx WNT_Uint.hxx
WNT_WindowData.hxx

View File

@@ -78,10 +78,6 @@ package WNT
imported Uint; imported Uint;
---Category: Imported types ---Category: Imported types
imported WindowData;
---Category: Imported types
--------------------------------- ---------------------------------
-- Category: Pointers -- Category: Pointers
--------------------------------- ---------------------------------

View File

@@ -16,7 +16,7 @@
#include <WNT_WClass.ixx> #include <WNT_WClass.ixx>
#include <Standard_PCharacter.hxx> #include <Standard_PCharacter.hxx>
#include <InterfaceGraphic_WNT.hxx> #include <InterfaceGraphic.hxx>
#include <string.h> #include <string.h>
@@ -43,7 +43,7 @@ WNT_WClass::WNT_WClass (
wc.style = aStyle; wc.style = aStyle;
wc.lpfnWndProc = ( aWndProc ) ? ( WNDPROC )aWndProc : DefWindowProc; wc.lpfnWndProc = ( aWndProc ) ? ( WNDPROC )aWndProc : DefWindowProc;
wc.cbClsExtra = aClassExtra; wc.cbClsExtra = aClassExtra;
wc.cbWndExtra = aWindowExtra + sizeof ( WINDOW_DATA* ); wc.cbWndExtra = aWindowExtra;
wc.hInstance = ( HINSTANCE )hInstance; wc.hInstance = ( HINSTANCE )hInstance;
wc.hIcon = ( anIcon ) ? ( HICON )anIcon : wc.hIcon = ( anIcon ) ? ( HICON )anIcon :
LoadIcon ( NULL, IDI_APPLICATION ); LoadIcon ( NULL, IDI_APPLICATION );

View File

@@ -27,8 +27,7 @@ class Window from WNT inherits Window from Aspect
Ratio from Quantity, Ratio from Quantity,
WClass from WNT, WClass from WNT,
Uint from WNT, Uint from WNT,
Dword from WNT, Dword from WNT
WindowData from WNT
raises raises
@@ -65,15 +64,6 @@ class Window from WNT inherits Window from Aspect
---Purpose: Creates a Window based on the existing window handle. ---Purpose: Creates a Window based on the existing window handle.
-- This handle equals ( aPart1 << 16 ) + aPart2. -- This handle equals ( aPart1 << 16 ) + aPart2.
Create (
aPart1 : Integer from Standard;
aPart2 : Integer from Standard;
aBackColor : NameOfColor from Quantity = Quantity_NOC_MATRAGRAY
)
returns Window from WNT;
---Level: Public
---Purpose: Creates a Window based on the existing window <aHandle>.
Destroy ( me : mutable ) Destroy ( me : mutable )
is virtual; is virtual;
---Level: Public ---Level: Public
@@ -117,6 +107,7 @@ class Window from WNT inherits Window from Aspect
DoMapping ( me ) returns Boolean from Standard DoMapping ( me ) returns Boolean from Standard
raises WindowError from Aspect is virtual; raises WindowError from Aspect is virtual;
---C++: inline
---Level: Advanced ---Level: Advanced
---Purpose: Apply the mapping change to the window <me> ---Purpose: Apply the mapping change to the window <me>
-- and returns TRUE if the window is mapped at screen. -- and returns TRUE if the window is mapped at screen.
@@ -127,21 +118,6 @@ class Window from WNT inherits Window from Aspect
---Level: Internal ---Level: Internal
---Purpose: Changes variables due to window position. ---Purpose: Changes variables due to window position.
SetFlags ( me : mutable; aFlags : Integer from Standard )
is static;
---Level: Public
---Purpose: Sets user defined flags in the extra window data area.
-- Supported flags WDF_* are listed in InterfaceGraphic_WNT.hxx
-- In particular, the window backround can be turned off using this method.
ResetFlags ( me : mutable; aFlags : Integer from Standard )
is static;
---Level: Public
---Purpose: Reset specified flags in the extra window data area.
-- Supported flags WDF_* are listed in InterfaceGraphic_WNT.hxx
-- In particular, the window backround can be turned on using this method.
---------------------------- ----------------------------
-- Category: Inquire methods -- Category: Inquire methods
---------------------------- ----------------------------
@@ -190,14 +166,6 @@ class Window from WNT inherits Window from Aspect
---Purpose: Returns the Windows NT handle parent of the created window <me>. ---Purpose: Returns the Windows NT handle parent of the created window <me>.
---C++: inline ---C++: inline
doCreate (
me : mutable;
aHandle : Handle from Aspect;
aBackColor : NameOfColor from Quantity = Quantity_NOC_MATRAGRAY
) is static private;
---Level: Private
---Purpose: private method
fields fields
aXLeft : Integer from Standard is protected; -- Window coordinates aXLeft : Integer from Standard is protected; -- Window coordinates
@@ -207,7 +175,6 @@ class Window from WNT inherits Window from Aspect
myWClass : WClass from WNT is protected; -- Window class myWClass : WClass from WNT is protected; -- Window class
myHWindow : Handle from Aspect is protected; -- Window handle myHWindow : Handle from Aspect is protected; -- Window handle
myHParentWindow : Handle from Aspect is protected; -- Parent window handle myHParentWindow : Handle from Aspect is protected; -- Parent window handle
myExtraData : WindowData from WNT is protected; -- additional data myIsForeign : Boolean from Standard is protected;
myUsrData : Address from Standard is protected;
end Window; end Window;

View File

@@ -15,8 +15,6 @@
// include windows.h first to have all definitions available // include windows.h first to have all definitions available
#include <windows.h> #include <windows.h>
// GG 07/03/00 Add MMSize() method
#include <WNT_Window.ixx> #include <WNT_Window.ixx>
#include <Image_AlienPixMap.hxx> #include <Image_AlienPixMap.hxx>
@@ -24,13 +22,10 @@
#include <stdio.h> #include <stdio.h>
//************************************************************************// // =======================================================================
//***// // function : WNT_Window
// callback function to manage window's background // purpose :
extern LRESULT CALLBACK WNT_WndProc ( // =======================================================================
HWND, UINT, WPARAM, LPARAM
);
WNT_Window::WNT_Window (const Standard_CString theTitle, WNT_Window::WNT_Window (const Standard_CString theTitle,
const Handle(WNT_WClass)& theClass, const Handle(WNT_WClass)& theClass,
const WNT_Dword& theStyle, const WNT_Dword& theStyle,
@@ -47,9 +42,9 @@ WNT_Window::WNT_Window (const Standard_CString theTitle,
aYTop (thePxTop), aYTop (thePxTop),
aXRight (thePxLeft + thePxWidth), aXRight (thePxLeft + thePxWidth),
aYBottom (thePxTop + thePxHeight), aYBottom (thePxTop + thePxHeight),
myWClass (theClass) myWClass (theClass),
myIsForeign (Standard_False)
{ {
ZeroMemory (&myExtraData, sizeof (WNT_WindowData));
DWORD dwStyle = theStyle; DWORD dwStyle = theStyle;
if (thePxWidth <= 0 || thePxHeight <= 0) if (thePxWidth <= 0 || thePxHeight <= 0)
@@ -96,121 +91,115 @@ WNT_Window::WNT_Window (const Standard_CString theTitle,
myHParentWindow = theParent; myHParentWindow = theParent;
SetBackground (theBackColor); SetBackground (theBackColor);
myUsrData = (Standard_Address )SetWindowLongPtr ((HWND )myHWindow, GWLP_USERDATA, (LONG_PTR )&myExtraData);
myExtraData.WNT_Window_Ptr = (void* )this;
SetFlags (WDF_NOERASEBKGRND);
} }
//***// // =======================================================================
//************************* Constructor **********************************// // function : WNT_Window
//***// // purpose :
WNT_Window :: WNT_Window ( // =======================================================================
const Aspect_Handle aHandle, WNT_Window::WNT_Window (const Aspect_Handle theHandle,
const Quantity_NameOfColor aBackColor const Quantity_NameOfColor theBackColor)
) : Aspect_Window() : myIsForeign (Standard_True)
{ {
doCreate (aHandle, aBackColor); myHWindow = theHandle;
myHParentWindow = GetParent ((HWND )theHandle);
/* Bug OCC20596 */ SetBackground (theBackColor);
SetFlags(WDF_NOERASEBKGRND);
} // end constructor WINDOWPLACEMENT aPlace;
//***// aPlace.length = sizeof (WINDOWPLACEMENT);
//************************* Constructor **********************************// ::GetWindowPlacement ((HWND )myHWindow, &aPlace);
//***//
WNT_Window :: WNT_Window ( aXLeft = aPlace.rcNormalPosition.left;
const Standard_Integer aPart1, aYTop = aPlace.rcNormalPosition.top;
const Standard_Integer aPart2, aXRight = aPlace.rcNormalPosition.right;
const Quantity_NameOfColor aBackColor aYBottom = aPlace.rcNormalPosition.bottom;
) : Aspect_Window() }
// =======================================================================
// function : Destroy
// purpose :
// =======================================================================
void WNT_Window::Destroy()
{ {
Aspect_Handle aHandle = ( Aspect_Handle )( ( aPart1 << 16 ) + aPart2 ); if (myHWindow == NULL
|| myIsForeign)
doCreate (aHandle, aBackColor);
/* Bug OCC20596 */
SetFlags(WDF_NOERASEBKGRND);
} // end constructor
//***//
//***************************** Destroy **********************************//
//***//
void WNT_Window :: Destroy ()
{
if (myHWindow)
{ {
if (myUsrData != Standard_Address(-1)) return;
{ }
SetWindowLongPtr ((HWND )myHWindow, GWLP_USERDATA, (LONG_PTR )myUsrData);
}
if (!( myExtraData.dwFlags & WDF_FOREIGN)) DestroyWindow ((HWND )myHWindow);
{ myIsForeign = Standard_False;
DestroyWindow ((HWND )myHWindow); }
}
} // end if
} // end WNT_Window :: Destroy
//**************************** SetCursor *********************************// // =======================================================================
//***// // function : SetCursor
void WNT_Window :: SetCursor ( const Aspect_Handle aCursor ) const { // purpose :
SetClassLongPtr ((HWND)myHWindow, GCLP_HCURSOR, (LONG_PTR)aCursor); // =======================================================================
} // end WNT_Window :: SetCursor void WNT_Window::SetCursor (const Aspect_Handle theCursor) const
{
::SetClassLongPtr ((HWND )myHWindow, GCLP_HCURSOR, (LONG_PTR )theCursor);
}
//***// // =======================================================================
//***************************** IsMapped *********************************// // function : IsMapped
//***// // purpose :
Standard_Boolean WNT_Window :: IsMapped () const { // =======================================================================
if (IsVirtual()) { Standard_Boolean WNT_Window::IsMapped() const
{
if (IsVirtual())
{
return Standard_True; return Standard_True;
} }
WINDOWPLACEMENT wp; WINDOWPLACEMENT aPlace;
aPlace.length = sizeof (WINDOWPLACEMENT);
::GetWindowPlacement ((HWND )myHWindow, &aPlace);
return !(aPlace.showCmd == SW_HIDE
|| aPlace.showCmd == SW_MINIMIZE);
}
wp.length = sizeof ( WINDOWPLACEMENT ); // =======================================================================
GetWindowPlacement ( ( HWND )myHWindow, &wp ); // function : Map
// purpose :
// =======================================================================
void WNT_Window::Map() const
{
if (!IsVirtual())
{
Map (SW_SHOW);
}
}
return !( wp.showCmd == SW_HIDE || wp.showCmd == SW_MINIMIZE ); // =======================================================================
} // WNT_Window :: IsMapped // function : Map
// purpose :
//***// // =======================================================================
//***************************** Map (1) **********************************// void WNT_Window::Map (const Standard_Integer theMapMode) const
//***// {
void WNT_Window :: Map () const { if (IsVirtual())
if (IsVirtual()) { {
return; return;
} }
Map ( SW_SHOW );
} // end WNT_Window :: Map
//***// ::ShowWindow ((HWND )myHWindow, theMapMode);
//***************************** Map (2) **********************************// ::UpdateWindow ((HWND )myHWindow);
//***// }
void WNT_Window :: Map ( const Standard_Integer aMapMode ) const {
if (IsVirtual()) {
return;
}
ShowWindow ( ( HWND )myHWindow, aMapMode );
UpdateWindow ( ( HWND )myHWindow );
} // end WNT_Window :: Map // =======================================================================
// function : Unmap
// purpose :
// =======================================================================
void WNT_Window::Unmap() const
{
Map (SW_HIDE);
}
//***// // =======================================================================
//**************************** Unmap *************************************// // function : DoResize
//***// // purpose :
void WNT_Window :: Unmap () const { // =======================================================================
Aspect_TypeOfResize WNT_Window::DoResize() const
Map ( SW_HIDE );
} // end WNT_Window :: Unmap
//***//
//**************************** DoResize **********************************//
//***//
Aspect_TypeOfResize WNT_Window :: DoResize () const
{ {
int mask = 0; int mask = 0;
Aspect_TypeOfResize mode = Aspect_TOR_UNKNOWN; Aspect_TypeOfResize mode = Aspect_TOR_UNKNOWN;
@@ -266,144 +255,70 @@ Aspect_TypeOfResize WNT_Window :: DoResize () const
} }
return mode; return mode;
} // end WNT_Window :: DoResize
//***//
//**************************** DoMapping **********************************//
//***//
Standard_Boolean WNT_Window :: DoMapping () const {
// DO nothing on WNT.
return Standard_True;
} }
//***// // =======================================================================
//******************************* Ratio **********************************// // function : Ratio
//***// // purpose :
Quantity_Ratio WNT_Window :: Ratio () const { // =======================================================================
Quantity_Ratio WNT_Window::Ratio() const
RECT r;
GetClientRect ( ( HWND )myHWindow, &r );
return ( Quantity_Ratio )( ( Quantity_Ratio )r.right / ( Quantity_Ratio )r.bottom );
} // end WNT_Window :: Ratio
//***//
//**************************** Position (2) ******************************//
//***//
void WNT_Window :: Position (
Standard_Integer& X1, Standard_Integer& Y1,
Standard_Integer& X2, Standard_Integer& Y2
) const {
POINT ptl, ptr;
RECT r;
GetClientRect ( ( HWND )myHWindow, &r );
ptl.x = ptl.y = 0;
ClientToScreen ( ( HWND )myHWindow, &ptl );
ptr.x = r.right;
ptr.y = r.bottom;
ClientToScreen ( ( HWND )myHWindow, &ptr );
if ( myHParentWindow ) {
ScreenToClient ( ( HWND )myHParentWindow, &ptl );
ScreenToClient ( ( HWND )myHParentWindow, &ptr );
} // end if
X1 = ptl.x;
X2 = ptr.x;
Y1 = ptl.y;
Y2 = ptr.y;
} // end WNT_Window :: Position
//***//
//******************************* Size (2) *******************************//
//***//
void WNT_Window :: Size (
Standard_Integer& Width, Standard_Integer& Height
) const {
RECT r;
GetClientRect ( ( HWND )myHWindow, &r );
Width = r.right;
Height = r.bottom;
} // end WNT_Window :: Size
//***//
//******************************* SetPos *********************************//
//***//
void WNT_Window :: SetPos (
const Standard_Integer X, const Standard_Integer Y,
const Standard_Integer X1, const Standard_Integer Y1
) {
aXLeft = X;
aYTop = Y;
aXRight = X1;
aYBottom = Y1;
} // end WNT_Window :: SetPos
//***//
//**************************** SetFlags **********************************//
//***//
void WNT_Window :: SetFlags ( const Standard_Integer aFlags ) {
myExtraData.dwFlags |= aFlags;
} // end WNT_Window :: SetFlags
//***//
//*************************** ResetFlags *********************************//
//***//
void WNT_Window :: ResetFlags ( const Standard_Integer aFlags ) {
myExtraData.dwFlags &= ~aFlags;
} // end WNT_Window :: ResetFlags
//***//
//*************************** doCreate **********************************//
//***//
void WNT_Window :: doCreate (
const Aspect_Handle aHandle,
const Quantity_NameOfColor aBackColor
)
{ {
ZeroMemory (&myExtraData, sizeof (WNT_WindowData)); RECT r;
GetClientRect ((HWND )myHWindow, &r);
return (Quantity_Ratio )((Quantity_Ratio )r.right / (Quantity_Ratio )r.bottom);
}
myHWindow = aHandle; // =======================================================================
myHParentWindow = GetParent ((HWND )aHandle); // function : Position
LONG_PTR uData = GetWindowLongPtr ((HWND )aHandle, GWLP_USERDATA); // purpose :
myUsrData = Standard_Address(-1); // =======================================================================
void WNT_Window::Position (Standard_Integer& theX1, Standard_Integer& theY1,
Standard_Integer& theX2, Standard_Integer& theY2) const
{
RECT aRect;
::GetClientRect ((HWND )myHWindow, &aRect);
SetBackground (aBackColor); POINT aPntLeft, aPntRight;
aPntLeft.x = aPntLeft.y = 0;
::ClientToScreen ((HWND )myHWindow, &aPntLeft);
aPntRight.x = aRect.right;
aPntRight.y = aRect.bottom;
::ClientToScreen ((HWND )myHWindow, &aPntRight);
myExtraData.WNT_Window_Ptr = (void* )this; if (myHParentWindow != NULL)
if (uData != (LONG_PTR )&myExtraData)
{ {
myUsrData = (Standard_Address )SetWindowLongPtr ((HWND )myHWindow, GWLP_USERDATA, (LONG_PTR )&myExtraData); ::ScreenToClient ((HWND )myHParentWindow, &aPntLeft);
::ScreenToClient ((HWND )myHParentWindow, &aPntRight);
} }
myExtraData.dwFlags = WDF_FOREIGN; theX1 = aPntLeft.x;
theX2 = aPntRight.x;
theY1 = aPntLeft.y;
theY2 = aPntRight.y;
}
WINDOWPLACEMENT wp; // =======================================================================
wp.length = sizeof (WINDOWPLACEMENT); // function : Size
GetWindowPlacement ((HWND )myHWindow, &wp); // purpose :
// =======================================================================
void WNT_Window::Size (Standard_Integer& theWidth,
Standard_Integer& theHeight) const
{
RECT aRect;
::GetClientRect ((HWND )myHWindow, &aRect);
theWidth = aRect.right;
theHeight = aRect.bottom;
}
aXLeft = wp.rcNormalPosition.left; // =======================================================================
aYTop = wp.rcNormalPosition.top; // function : SetPos
aXRight = wp.rcNormalPosition.right; // purpose :
aYBottom = wp.rcNormalPosition.bottom; // =======================================================================
} // end WNT_Window :: doCreate void WNT_Window::SetPos (const Standard_Integer theX, const Standard_Integer theY,
const Standard_Integer theX1, const Standard_Integer theY1)
{
aXLeft = theX;
aYTop = theY;
aXRight = theX1;
aYBottom = theY1;
}

View File

@@ -12,17 +12,18 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
// GG RIC120302 Add a NEW HParentWindow method which enable inline Standard_Boolean WNT_Window::DoMapping() const
// to retrieve the parent of the actual Hwindow handle. {
// DO nothing on WNT
return Standard_True;
}
inline Aspect_Handle WNT_Window :: HWindow () const { inline Aspect_Handle WNT_Window::HWindow() const
{
return myHWindow;
}
return myHWindow; inline Aspect_Handle WNT_Window::HParentWindow() const
{
} // end WNT_Window :: HWindow return myHParentWindow;
}
inline Aspect_Handle WNT_Window :: HParentWindow () const {
return myHParentWindow;
} // end WNT_Window :: HWindow

View File

@@ -1,46 +0,0 @@
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef __WNT_WindowData_HeaderFile
# define __WNT_WindowData_HeaderFile
// Purpose: Defines additional window data type.
# ifndef __WINDOWS_H_INCLUDED
# define __WINDOWS_H_INCLUDED
# ifndef STRICT
# define STRICT
# endif // STRICT
# include <windows.h>
# include <windowsx.h>
# ifdef DrawText
# undef DrawText
# endif // DrawText
# ifdef THIS
# undef THIS
# endif // THIS
# endif // __WINDOWS_H_INCLUDED
# ifndef __STANDARD_TYPE_HXX_INCLUDED
# define __STANDARD_TYPE_HXX_INCLUDED
# include <Standard_Type.hxx>
# endif // __STANDARD_TYPE_HXX_INCLUDED
#include <InterfaceGraphic_WNT.hxx>
typedef WINDOW_DATA WNT_WindowData;
#endif // __WNT_WindowData_HeaderFile

View File

@@ -2,8 +2,8 @@ cpulimit 2400
puts "TODO ?OCC23068 ALL: Error : result is not a topological shape" puts "TODO ?OCC23068 ALL: Error : result is not a topological shape"
puts "TODO ?OCC23068 ALL: Error : The offset cannot be built." puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO DEBUG_OCC24121 Debian60-64: Process killed by CPU limit" puts "TODO ?DEBUG_OCC24121 Debian60-64: Process killed by CPU limit"
puts "TODO DEBUG_OCC24121 Debian60-64: TEST INCOMPLETE" puts "TODO ?DEBUG_OCC24121 Debian60-64: TEST INCOMPLETE"
restore [locate_data_file offset_wire_041.brep] s restore [locate_data_file offset_wire_041.brep] s