0028726: Quantity_NameOfColor should be replaced by Quantity_Color in function input...
[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>
87432b82 28#include <Quantity_Color.hxx>
42cf5bc1 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;
42cf5bc1 37class Aspect_GradientBackground;
38
42cf5bc1 39class Aspect_Window;
40DEFINE_STANDARD_HANDLE(Aspect_Window, MMgt_TShared)
41
42//! Defines a window.
43class Aspect_Window : public MMgt_TShared
44{
45
46public:
42cf5bc1 47
48 //! Modifies the window background.
49 Standard_EXPORT void SetBackground (const Aspect_Background& ABack);
87432b82 50
42cf5bc1 51 //! Modifies the window background.
52 Standard_EXPORT void SetBackground (const Quantity_Color& color);
53
54 //! Modifies the window gradient background.
55 Standard_EXPORT void SetBackground (const Aspect_GradientBackground& ABackground);
56
57 //! Modifies the window gradient background.
58 Standard_EXPORT void SetBackground (const Quantity_Color& theFirstColor, const Quantity_Color& theSecondColor, const Aspect_GradientFillMethod theFillMethod);
59
60 //! Opens the window <me>.
61 Standard_EXPORT virtual void Map() const = 0;
62
63 //! Closes the window <me>.
64 Standard_EXPORT virtual void Unmap() const = 0;
65
66 //! Apply the resizing to the window <me>.
67 Standard_EXPORT virtual Aspect_TypeOfResize DoResize() const = 0;
68
69 //! Apply the mapping change to the window <me>.
70 //! and returns TRUE if the window is mapped at screen.
71 Standard_EXPORT virtual Standard_Boolean DoMapping() const = 0;
72
42cf5bc1 73 //! Returns the window background.
74 Standard_EXPORT Aspect_Background Background() const;
75
76 //! Returns the current image background fill mode.
77 Standard_EXPORT Aspect_FillMethod BackgroundFillMethod() const;
78
79 //! Returns the window gradient background.
80 Standard_EXPORT Aspect_GradientBackground GradientBackground() const;
81
82 //! Returns True if the window <me> is opened
83 //! and False if the window is closed.
84 Standard_EXPORT virtual Standard_Boolean IsMapped() const = 0;
85
86 //! Returns True if the window <me> is virtual
87 Standard_EXPORT Standard_Boolean IsVirtual() const;
88
89 //! Setup the virtual state
90 Standard_EXPORT void SetVirtual (const Standard_Boolean theVirtual);
91
92 //! Returns The Window RATIO equal to the physical
93 //! WIDTH/HEIGHT dimensions
94 Standard_EXPORT virtual Quantity_Ratio Ratio() const = 0;
95
96 //! Returns The Window POSITION in PIXEL
97 Standard_EXPORT virtual void Position (Standard_Integer& X1, Standard_Integer& Y1, Standard_Integer& X2, Standard_Integer& Y2) const = 0;
98
99 //! Returns The Window SIZE in PIXEL
100 Standard_EXPORT virtual void Size (Standard_Integer& Width, Standard_Integer& Height) const = 0;
101
102 //! Returns native Window handle (HWND on Windows, Window with Xlib, and so on)
103 Standard_EXPORT virtual Aspect_Drawable NativeHandle() const = 0;
104
105 //! Returns parent of native Window handle (HWND on Windows, Window with Xlib, and so on)
106 Standard_EXPORT virtual Aspect_Drawable NativeParentHandle() const = 0;
107
b6bf4ec1 108 //! Returns native Window FB config (GLXFBConfig on Xlib)
109 Standard_EXPORT virtual Aspect_FBConfig NativeFBConfig() const = 0;
42cf5bc1 110
92efcf78 111 DEFINE_STANDARD_RTTIEXT(Aspect_Window,MMgt_TShared)
42cf5bc1 112
113protected:
114
42cf5bc1 115 //! Initializes the datas of a Window.
116 Standard_EXPORT Aspect_Window();
117
87432b82 118protected:
119
42cf5bc1 120 Aspect_Background MyBackground;
121 Aspect_GradientBackground MyGradientBackground;
122 Aspect_FillMethod MyBackgroundFillMethod;
123 Standard_Boolean MyIsVirtual;
124
42cf5bc1 125};
126
42cf5bc1 127#endif // _Aspect_Window_HeaderFile