0024002: Overall code and build procedure refactoring -- automatic
[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>
24#include <Aspect_FillMethod.hxx>
25#include <Standard_Boolean.hxx>
26#include <MMgt_TShared.hxx>
27#include <Quantity_NameOfColor.hxx>
28#include <Aspect_GradientFillMethod.hxx>
29#include <Aspect_TypeOfResize.hxx>
30#include <Quantity_Ratio.hxx>
31#include <Standard_Integer.hxx>
32#include <Aspect_Drawable.hxx>
33class Aspect_WindowDefinitionError;
34class Aspect_WindowError;
35class Aspect_Background;
36class Quantity_Color;
37class Aspect_GradientBackground;
38
39
40class Aspect_Window;
41DEFINE_STANDARD_HANDLE(Aspect_Window, MMgt_TShared)
42
43//! Defines a window.
44class Aspect_Window : public MMgt_TShared
45{
46
47public:
48
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
78 //! Destroy the Window
79 Standard_EXPORT virtual void Destroy() = 0;
80
81 //! Returns the window background.
82 Standard_EXPORT Aspect_Background Background() const;
83
84 //! Returns the current image background fill mode.
85 Standard_EXPORT Aspect_FillMethod BackgroundFillMethod() const;
86
87 //! Returns the window gradient background.
88 Standard_EXPORT Aspect_GradientBackground GradientBackground() const;
89
90 //! Returns True if the window <me> is opened
91 //! and False if the window is closed.
92 Standard_EXPORT virtual Standard_Boolean IsMapped() const = 0;
93
94 //! Returns True if the window <me> is virtual
95 Standard_EXPORT Standard_Boolean IsVirtual() const;
96
97 //! Setup the virtual state
98 Standard_EXPORT void SetVirtual (const Standard_Boolean theVirtual);
99
100 //! Returns The Window RATIO equal to the physical
101 //! WIDTH/HEIGHT dimensions
102 Standard_EXPORT virtual Quantity_Ratio Ratio() const = 0;
103
104 //! Returns The Window POSITION in PIXEL
105 Standard_EXPORT virtual void Position (Standard_Integer& X1, Standard_Integer& Y1, Standard_Integer& X2, Standard_Integer& Y2) const = 0;
106
107 //! Returns The Window SIZE in PIXEL
108 Standard_EXPORT virtual void Size (Standard_Integer& Width, Standard_Integer& Height) const = 0;
109
110 //! Returns native Window handle (HWND on Windows, Window with Xlib, and so on)
111 Standard_EXPORT virtual Aspect_Drawable NativeHandle() const = 0;
112
113 //! Returns parent of native Window handle (HWND on Windows, Window with Xlib, and so on)
114 Standard_EXPORT virtual Aspect_Drawable NativeParentHandle() const = 0;
115
116
117
118
119 DEFINE_STANDARD_RTTI(Aspect_Window,MMgt_TShared)
120
121protected:
122
123
124 //! Initializes the datas of a Window.
125 Standard_EXPORT Aspect_Window();
126
127 Aspect_Background MyBackground;
128 Aspect_GradientBackground MyGradientBackground;
129 Aspect_FillMethod MyBackgroundFillMethod;
130 Standard_Boolean MyIsVirtual;
131
132
133private:
134
135
136
137
138};
139
140
141
142
143
144
145
146#endif // _Aspect_Window_HeaderFile