0026936: Drawbacks of inlining in new type system in OCCT 7.0 -- manual
[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:
49
50
51 //! Modifies the window background.
52 Standard_EXPORT void SetBackground (const Aspect_Background& ABack);
53
54 //! Modifies the window background from a Named Color.
55 Standard_EXPORT void SetBackground (const Quantity_NameOfColor theNameOfColor);
56
57 //! Modifies the window background.
58 Standard_EXPORT void SetBackground (const Quantity_Color& color);
59
60 //! Modifies the window gradient background.
61 Standard_EXPORT void SetBackground (const Aspect_GradientBackground& ABackground);
62
63 //! Modifies the window gradient background.
64 Standard_EXPORT void SetBackground (const Quantity_Color& theFirstColor, const Quantity_Color& theSecondColor, const Aspect_GradientFillMethod theFillMethod);
65
66 //! Opens the window <me>.
67 Standard_EXPORT virtual void Map() const = 0;
68
69 //! Closes the window <me>.
70 Standard_EXPORT virtual void Unmap() const = 0;
71
72 //! Apply the resizing to the window <me>.
73 Standard_EXPORT virtual Aspect_TypeOfResize DoResize() const = 0;
74
75 //! Apply the mapping change to the window <me>.
76 //! and returns TRUE if the window is mapped at screen.
77 Standard_EXPORT virtual Standard_Boolean DoMapping() const = 0;
78
79 //! Destroy the Window
80 Standard_EXPORT virtual void Destroy() = 0;
81
82 //! Returns the window background.
83 Standard_EXPORT Aspect_Background Background() const;
84
85 //! Returns the current image background fill mode.
86 Standard_EXPORT Aspect_FillMethod BackgroundFillMethod() const;
87
88 //! Returns the window gradient background.
89 Standard_EXPORT Aspect_GradientBackground GradientBackground() const;
90
91 //! Returns True if the window <me> is opened
92 //! and False if the window is closed.
93 Standard_EXPORT virtual Standard_Boolean IsMapped() const = 0;
94
95 //! Returns True if the window <me> is virtual
96 Standard_EXPORT Standard_Boolean IsVirtual() const;
97
98 //! Setup the virtual state
99 Standard_EXPORT void SetVirtual (const Standard_Boolean theVirtual);
100
101 //! Returns The Window RATIO equal to the physical
102 //! WIDTH/HEIGHT dimensions
103 Standard_EXPORT virtual Quantity_Ratio Ratio() const = 0;
104
105 //! Returns The Window POSITION in PIXEL
106 Standard_EXPORT virtual void Position (Standard_Integer& X1, Standard_Integer& Y1, Standard_Integer& X2, Standard_Integer& Y2) const = 0;
107
108 //! Returns The Window SIZE in PIXEL
109 Standard_EXPORT virtual void Size (Standard_Integer& Width, Standard_Integer& Height) const = 0;
110
111 //! Returns native Window handle (HWND on Windows, Window with Xlib, and so on)
112 Standard_EXPORT virtual Aspect_Drawable NativeHandle() const = 0;
113
114 //! Returns parent of native Window handle (HWND on Windows, Window with Xlib, and so on)
115 Standard_EXPORT virtual Aspect_Drawable NativeParentHandle() const = 0;
116
b6bf4ec1 117 //! Returns native Window FB config (GLXFBConfig on Xlib)
118 Standard_EXPORT virtual Aspect_FBConfig NativeFBConfig() const = 0;
42cf5bc1 119
120 DEFINE_STANDARD_RTTI(Aspect_Window,MMgt_TShared)
121
122protected:
123
124
125 //! Initializes the datas of a Window.
126 Standard_EXPORT Aspect_Window();
127
128 Aspect_Background MyBackground;
129 Aspect_GradientBackground MyGradientBackground;
130 Aspect_FillMethod MyBackgroundFillMethod;
131 Standard_Boolean MyIsVirtual;
132
133
134private:
135
136
137
138
139};
140
141
142
143
144
145
146
147#endif // _Aspect_Window_HeaderFile