summaryrefslogtreecommitdiff
path: root/inc/WNT_GraphicDevice.hxx
blob: cab6e3be6175b30dbd6d8f4affde0ce8bd95b543 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _WNT_GraphicDevice_HeaderFile
#define _WNT_GraphicDevice_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineHandle_HeaderFile
#include <Standard_DefineHandle.hxx>
#endif
#ifndef _Handle_WNT_GraphicDevice_HeaderFile
#include <Handle_WNT_GraphicDevice.hxx>
#endif

#ifndef _Quantity_Length_HeaderFile
#include <Quantity_Length.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Aspect_Handle_HeaderFile
#include <Aspect_Handle.hxx>
#endif
#ifndef _Standard_Address_HeaderFile
#include <Standard_Address.hxx>
#endif
#ifndef _WNT_ColorRef_HeaderFile
#include <WNT_ColorRef.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Aspect_GraphicDevice_HeaderFile
#include <Aspect_GraphicDevice.hxx>
#endif
#ifndef _WNT_Long_HeaderFile
#include <WNT_Long.hxx>
#endif
#ifndef _Handle_Aspect_ColorMap_HeaderFile
#include <Handle_Aspect_ColorMap.hxx>
#endif
#ifndef _Handle_WNT_HColorTable_HeaderFile
#include <Handle_WNT_HColorTable.hxx>
#endif
#ifndef _Handle_Aspect_GraphicDriver_HeaderFile
#include <Handle_Aspect_GraphicDriver.hxx>
#endif
class Aspect_GraphicDeviceDefinitionError;
class Aspect_BadAccess;
class WNT_Window;
class Quantity_Color;
class Aspect_ColorMap;
class WNT_HColorTable;
class Aspect_GraphicDriver;


//! This class defines Windows NT display device. <br>
//!          A Graphic Device defines color management. Windows can run in three <br>
//!          different color modes depending of the installed graphic board: <br>
//!           - Low color resolution which allows us to use 16 predefined pure <br>
//!             colors for drawing lines and unlimited number of dithered colors <br>
//!             for window's background, solid filled areas etc. Here Graphic Device <br>
//!             will approximate requested colors by existing ones for line colors <br>
//!             ( really this approximation is doing by Windows ). A dithering <br>
//!             technique will be used for window's backgrounds, solid fills etc. <br>
//!             ( this is doing by WIndows also ). A dithering techique will be use <br>
//!             for solid fill. <br>
//!           - Medium color resolution which requires a Windows palette manager. <br>
//!             This mode takes after X window system's PseudoColor Visual. The <br>
//!             application can create a LOGICAL PALETTE to represent 20 reserved <br>
//!             by Windows colors and 236 programmable ones. It's possible to reserve <br>
//!             odd entries in the palette for highlighting purposes ( but real <br>
//!             technique is not the same as in X window system - see Windows manual ). <br>
//!             It's possible to create several logical palettes. To do it create <br>
//!             other GraphicDevice but in this case color "flicking" is possible. <br>
//!           - High color resolution. Here 65 536 or 16 777 216 colors are available. <br>
//!             Any color we like will be exactly displayed on the screen, but <br>
//!             highlighting technique is not available. This mode often called <br>
//!             TrueColor but it's not the same as X window TrueColor. <br>
//!          A Graphic Device also defines physical dimensions of the screen. <br>
class WNT_GraphicDevice : public Aspect_GraphicDevice {

public:

  //! Creates a GraphicDevice and logical palette. <br>
//!          Builds an OpenGL colorcube on that palette depending <br>
//!          of the aColorCube flag and hardware. <br>
//!  Warning: Raises if createion of the logical palette failed. <br>
  Standard_EXPORT   WNT_GraphicDevice(const Standard_Boolean aColorCube = Standard_False,const Aspect_Handle aDevContext = 0);
  //! same as previous one (to provide access form CCL) <br>
  Standard_EXPORT   WNT_GraphicDevice(const Standard_Boolean aColorCube,const Standard_Integer aDevContext);
  //! Destroies all ressources attached to the GraphicDevice. <br>
  Standard_EXPORT   virtual  void Destroy() ;
~WNT_GraphicDevice()
{
  Destroy();
}
  //! Returns the color value in form specific to Windows NT. <br>
//!          Sets the color values in the logical palette if the <br>
//!          hardware supports it. If in this case there are not <br>
//!          free cell in the logical palette then this method will <br>
//!          search for nearest color in the palette. <br>
//!          If <aHighlight> is True then sets a highlight color. <br>
  Standard_EXPORT     WNT_ColorRef SetColor(const Quantity_Color& aColor,const Standard_Boolean aHighlight = Standard_False) ;
  //! See above <br>
  Standard_EXPORT   virtual  WNT_ColorRef SetColor(const Standard_Integer aRed,const Standard_Integer aGreen,const Standard_Integer aBlue,const Standard_Boolean aHighlight = Standard_False) ;
  //! Color allocation for images. <br>
  Standard_EXPORT   virtual  void SetColor(const WNT_Long& aPixel) ;
  //! Returns the color value in form specific to WIndows NT <br>
//!          in the <aColorTable>. See SetColor method. <br>
//!  Warning: The dimensions and index ranges of the <aColorMap> and <br>
//!          <aColorTable> must be the same; <br>
  Standard_EXPORT     void MapColors(const Handle(Aspect_ColorMap)& aColorMap,Handle(WNT_HColorTable)& aColorTable) ;
  //! Returns logical palette handle attached to the <br>
//!          GraphicDevice. <br>
        Aspect_Handle HPalette() const;
  //! Returns the Display size in PIXEL <br>
        void DisplaySize(Standard_Integer& aWidth,Standard_Integer& aHeight) const;
  //! Returns the Display size in working units units <br>
        void DisplaySize(Quantity_Length& aWidth,Quantity_Length& aHeight) const;
  //! Returns True if hardware is palette-compatible. <br>
        Standard_Boolean IsPaletteDevice() const;
  //! Returns number of available colors. <br>
        Standard_Integer NumColors() const;
  //! Returns highlight color. <br>
        WNT_ColorRef HighlightColor() const;
  //! Dummy method <br>
  Standard_EXPORT   virtual  Handle_Aspect_GraphicDriver GraphicDriver() const;

friend class WNT_Window;


  DEFINE_STANDARD_RTTI(WNT_GraphicDevice)

protected:

  
  Standard_EXPORT     void Init(const Standard_Boolean aColorCube,const Aspect_Handle aDevContext) ;

Quantity_Length myMWidth;
Quantity_Length myMHeight;
Standard_Integer myWidth;
Standard_Integer myHeight;
Standard_Integer myNumColors;
Standard_Integer myFreeIndex;
Aspect_Handle myPalette;
Standard_Address myLogPal;
WNT_ColorRef myHighlightColor;
Standard_Boolean myOpenGLPalette;


private: 




};


#include <WNT_GraphicDevice.lxx>



// other Inline functions and methods (like "C++: function call" methods)


#endif