0027067: Avoid use of virtual methods for implementation of destructors in legacy...
[occt.git] / src / WNT / WNT_Window.hxx
CommitLineData
42cf5bc1 1// Created on: 1996-01-26
2// Created by: PLOTNIKOV Eugeny
3// Copyright (c) 1996-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _WNT_Window_HeaderFile
18#define _WNT_Window_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <Standard_Integer.hxx>
24#include <Aspect_Handle.hxx>
25#include <Standard_Boolean.hxx>
26#include <Aspect_Window.hxx>
27#include <Standard_CString.hxx>
28#include <WNT_Dword.hxx>
29#include <Quantity_NameOfColor.hxx>
30#include <Standard_Address.hxx>
31#include <Aspect_TypeOfResize.hxx>
32#include <Quantity_Ratio.hxx>
33#include <Aspect_Drawable.hxx>
34class WNT_WClass;
35class Aspect_WindowDefinitionError;
36class Aspect_WindowError;
37
38
39class WNT_Window;
40DEFINE_STANDARD_HANDLE(WNT_Window, Aspect_Window)
41
42//! This class defines Windows NT window
43class WNT_Window : public Aspect_Window
44{
45
46public:
47
48
49 //! Creates a Window defined by his position and size
50 //! in pixles from the Parent Window.
51 //! Trigger: Raises WindowDefinitionError if the Position out of the
52 //! Screen Space or the window creation failed.
53 Standard_EXPORT WNT_Window(const Standard_CString theTitle, const Handle(WNT_WClass)& theClass, const WNT_Dword& theStyle, const Standard_Integer thePxLeft, const Standard_Integer thePxTop, const Standard_Integer thePxWidth, const Standard_Integer thePxHeight, const Quantity_NameOfColor theBackColor = Quantity_NOC_MATRAGRAY, const Aspect_Handle theParent = 0, const Aspect_Handle theMenu = 0, const Standard_Address theClientStruct = 0);
54
55 //! Creates a Window based on the existing window handle.
56 //! This handle equals ( aPart1 << 16 ) + aPart2.
57 Standard_EXPORT WNT_Window(const Aspect_Handle aHandle, const Quantity_NameOfColor aBackColor = Quantity_NOC_MATRAGRAY);
58
e6f550da 59 //! Destroys the Window and all resourses attached to it.
60 Standard_EXPORT ~WNT_Window();
42cf5bc1 61
62 //! Sets cursor <aCursor> for ENTIRE WINDOW CLASS to which
63 //! the Window belongs.
64 Standard_EXPORT void SetCursor (const Aspect_Handle aCursor) const;
65
66 //! Opens the window <me>.
b6bf4ec1 67 Standard_EXPORT virtual void Map() const Standard_OVERRIDE;
42cf5bc1 68
69 //! Opens a window <me> according to <aMapMode>.
70 //! This method is specific to Windows NT.
71 //! <aMapMode> can be one of SW_xxx constants defined
72 //! in <windows.h>. See documentation.
73 Standard_EXPORT void Map (const Standard_Integer aMapMode) const;
74
75 //! Closes the window <me>.
b6bf4ec1 76 Standard_EXPORT virtual void Unmap() const Standard_OVERRIDE;
42cf5bc1 77
78 //! Applies the resizing to the window <me>.
b6bf4ec1 79 Standard_EXPORT virtual Aspect_TypeOfResize DoResize() const Standard_OVERRIDE;
42cf5bc1 80
81 //! Apply the mapping change to the window <me>
82 //! and returns TRUE if the window is mapped at screen.
b6bf4ec1 83 virtual Standard_Boolean DoMapping() const Standard_OVERRIDE;
42cf5bc1 84
85 //! Changes variables due to window position.
86 Standard_EXPORT void SetPos (const Standard_Integer X, const Standard_Integer Y, const Standard_Integer X1, const Standard_Integer Y1);
87
88 //! Returns True if the window <me> is opened
89 //! and False if the window is closed.
b6bf4ec1 90 Standard_EXPORT virtual Standard_Boolean IsMapped() const Standard_OVERRIDE;
42cf5bc1 91
92 //! Returns The Window RATIO equal to the physical
93 //! WIDTH/HEIGHT dimensions.
b6bf4ec1 94 Standard_EXPORT virtual Quantity_Ratio Ratio() const Standard_OVERRIDE;
42cf5bc1 95
96 //! Returns The Window POSITION in PIXEL
b6bf4ec1 97 Standard_EXPORT virtual void Position (Standard_Integer& X1, Standard_Integer& Y1, Standard_Integer& X2, Standard_Integer& Y2) const Standard_OVERRIDE;
42cf5bc1 98
99 //! Returns The Window SIZE in PIXEL
b6bf4ec1 100 Standard_EXPORT virtual void Size (Standard_Integer& Width, Standard_Integer& Height) const Standard_OVERRIDE;
42cf5bc1 101
102 //! Returns the Windows NT handle of the created window <me>.
b6bf4ec1 103 Aspect_Handle HWindow() const;
42cf5bc1 104
105 //! Returns the Windows NT handle parent of the created window <me>.
b6bf4ec1 106 Aspect_Handle HParentWindow() const;
42cf5bc1 107
108 //! Returns native Window handle (HWND)
b6bf4ec1 109 virtual Aspect_Drawable NativeHandle() const Standard_OVERRIDE;
42cf5bc1 110
111 //! Returns parent of native Window handle (HWND on Windows, Window with Xlib, and so on)
b6bf4ec1 112 virtual Aspect_Drawable NativeParentHandle() const Standard_OVERRIDE;
42cf5bc1 113
b6bf4ec1 114 //! Returns nothing on Windows
115 virtual Aspect_FBConfig NativeFBConfig() const Standard_OVERRIDE { return NULL; }
42cf5bc1 116
92efcf78 117 DEFINE_STANDARD_RTTIEXT(WNT_Window,Aspect_Window)
42cf5bc1 118
119protected:
120
121
122 Standard_Integer aXLeft;
123 Standard_Integer aYTop;
124 Standard_Integer aXRight;
125 Standard_Integer aYBottom;
126 Handle(WNT_WClass) myWClass;
127 Aspect_Handle myHWindow;
128 Aspect_Handle myHParentWindow;
129 Standard_Boolean myIsForeign;
130
131
132private:
133
134
135
136
137};
138
139
140#include <WNT_Window.lxx>
141
142
143
144
145
146#endif // _WNT_Window_HeaderFile