0027067: Avoid use of virtual methods for implementation of destructors in legacy...
[occt.git] / src / Aspect / Aspect_Window.hxx
CommitLineData
42cf5bc1 1// Created by: NW,JPB,CAL
2// Copyright (c) 1991-1999 Matra Datavision
3// Copyright (c) 1999-2014 OPEN CASCADE SAS
4//
5// This file is part of Open CASCADE Technology software library.
6//
7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#ifndef _Aspect_Window_HeaderFile
17#define _Aspect_Window_HeaderFile
18
19#include <Standard.hxx>
20#include <Standard_Type.hxx>
21
22#include <Aspect_Background.hxx>
23#include <Aspect_GradientBackground.hxx>
b6bf4ec1 24#include <Aspect_FBConfig.hxx>
42cf5bc1 25#include <Aspect_FillMethod.hxx>
26#include <Standard_Boolean.hxx>
27#include <MMgt_TShared.hxx>
28#include <Quantity_NameOfColor.hxx>
29#include <Aspect_GradientFillMethod.hxx>
30#include <Aspect_TypeOfResize.hxx>
31#include <Quantity_Ratio.hxx>
32#include <Standard_Integer.hxx>
33#include <Aspect_Drawable.hxx>
34class Aspect_WindowDefinitionError;
35class Aspect_WindowError;
36class Aspect_Background;
37class Quantity_Color;
38class Aspect_GradientBackground;
39
40
41class Aspect_Window;
42DEFINE_STANDARD_HANDLE(Aspect_Window, MMgt_TShared)
43
44//! Defines a window.
45class Aspect_Window : public MMgt_TShared
46{
47
48public:
42cf5bc1 49
50 //! Modifies the window background.
51 Standard_EXPORT void SetBackground (const Aspect_Background& ABack);
52
53 //! Modifies the window background from a Named Color.
54 Standard_EXPORT void SetBackground (const Quantity_NameOfColor theNameOfColor);
55
56 //! Modifies the window background.
57 Standard_EXPORT void SetBackground (const Quantity_Color& color);
58
59 //! Modifies the window gradient background.
60 Standard_EXPORT void SetBackground (const Aspect_GradientBackground& ABackground);
61
62 //! Modifies the window gradient background.
63 Standard_EXPORT void SetBackground (const Quantity_Color& theFirstColor, const Quantity_Color& theSecondColor, const Aspect_GradientFillMethod theFillMethod);
64
65 //! Opens the window <me>.
66 Standard_EXPORT virtual void Map() const = 0;
67
68 //! Closes the window <me>.
69 Standard_EXPORT virtual void Unmap() const = 0;
70
71 //! Apply the resizing to the window <me>.
72 Standard_EXPORT virtual Aspect_TypeOfResize DoResize() const = 0;
73
74 //! Apply the mapping change to the window <me>.
75 //! and returns TRUE if the window is mapped at screen.
76 Standard_EXPORT virtual Standard_Boolean DoMapping() const = 0;
77
42cf5bc1 78 //! Returns the window background.
79 Standard_EXPORT Aspect_Background Background() const;
80
81 //! Returns the current image background fill mode.
82 Standard_EXPORT Aspect_FillMethod BackgroundFillMethod() const;
83
84 //! Returns the window gradient background.
85 Standard_EXPORT Aspect_GradientBackground GradientBackground() const;
86
87 //! Returns True if the window <me> is opened
88 //! and False if the window is closed.
89 Standard_EXPORT virtual Standard_Boolean IsMapped() const = 0;
90
91 //! Returns True if the window <me> is virtual
92 Standard_EXPORT Standard_Boolean IsVirtual() const;
93
94 //! Setup the virtual state
95 Standard_EXPORT void SetVirtual (const Standard_Boolean theVirtual);
96
97 //! Returns The Window RATIO equal to the physical
98 //! WIDTH/HEIGHT dimensions
99 Standard_EXPORT virtual Quantity_Ratio Ratio() const = 0;
100
101 //! Returns The Window POSITION in PIXEL
102 Standard_EXPORT virtual void Position (Standard_Integer& X1, Standard_Integer& Y1, Standard_Integer& X2, Standard_Integer& Y2) const = 0;
103
104 //! Returns The Window SIZE in PIXEL
105 Standard_EXPORT virtual void Size (Standard_Integer& Width, Standard_Integer& Height) const = 0;
106
107 //! Returns native Window handle (HWND on Windows, Window with Xlib, and so on)
108 Standard_EXPORT virtual Aspect_Drawable NativeHandle() const = 0;
109
110 //! Returns parent of native Window handle (HWND on Windows, Window with Xlib, and so on)
111 Standard_EXPORT virtual Aspect_Drawable NativeParentHandle() const = 0;
112
b6bf4ec1 113 //! Returns native Window FB config (GLXFBConfig on Xlib)
114 Standard_EXPORT virtual Aspect_FBConfig NativeFBConfig() const = 0;
42cf5bc1 115
92efcf78 116 DEFINE_STANDARD_RTTIEXT(Aspect_Window,MMgt_TShared)
42cf5bc1 117
118protected:
119
120
121 //! Initializes the datas of a Window.
122 Standard_EXPORT Aspect_Window();
123
124 Aspect_Background MyBackground;
125 Aspect_GradientBackground MyGradientBackground;
126 Aspect_FillMethod MyBackgroundFillMethod;
127 Standard_Boolean MyIsVirtual;
128
129
130private:
131
132
133
134
135};
136
137
138
139
140
141
142
143#endif // _Aspect_Window_HeaderFile