23
#ifndef STACKMANAGER_H
24
#define STACKMANAGER_H
26
#include "BaseWindow.h"
33
class ActiveInterfaceObject;
39
class WindowCompositor
44
void SetClientSize(int w, int h);
45
// void DrawGrid(Graphics *g);
46
void Draw(IEvent &event, bool force_draw);
49
void DrawPopup(bool force_draw);
50
void DrawMenu(bool force_draw);
51
void DrawOverlay(bool force_draw);
52
void DrawTooltip(bool force_draw);
53
void DrawFloatingWindows(bool force_draw, const std::list<smptr(BaseWindow)>& WindowList, bool drawModal, bool UseFBO);
55
void RenderMainWindowComposition(bool force_draw, bool UseFBO);
56
void RenderWindowComposition(smptr(BaseWindow) window, bool force_draw);
60
Render a textured quad the quad has the size of the texture. The texture maybe the main window texture or a BaseWindow texture.
62
@param HWTexture Texture to render.
63
@param x Coordinates of the top left corner of the quad.
64
@param y Coordinates of the top left corner of the quad.
65
@param RenderToMainTexture If true, render to the main window texture. If false, render to the default back buffer.
66
@param BluredBackground If true, the texture is blended with the blurred version of the main window texture.
68
void PresentBufferToScreen(TRefGL<IOpenGLTexture2D> HWTexture, int x, int y, bool RenderToMainTexture, bool BluredBackground = false);
69
void PresentRendering();
72
Set the composition render target as the texture to draw into.
74
void SetCompositionRT();
77
Draw a Texture into the composition render target.
78
@param x Destination coordinates.
79
@param y Destination coordinates.
81
void CopyTextureToCompositionRT(TRefGL<IOpenGLTexture2D> HWTexture, int x, int y);
83
void AddToDrawList(smptr(ActiveInterfaceObject) ic);
87
bool MouseDown(Point pt);
89
bool MouseMove(Point pt);
90
bool MouseUp(Point pt);
91
smptr(BaseWindow) GetSelectedWindow();
93
void ProcessEvent(IEvent &ievent);
95
void RegisterWindow(smptr(BaseWindow));
96
void UnRegisterWindow(smptr(BaseWindow));
97
void MoveWindowToFront(smptr(BaseWindow));
98
void MoveWindowToBack(smptr(BaseWindow));
100
TRefGL<IOpenGLFrameBufferObject>& GetWindowFrameBufferObject(){ return m_FrameBufferObject;}
101
TRefGL<IOpenGLFrameBufferObject> m_FrameBufferObject;
103
TRefGL< IOpenGLBaseTexture > GetScreenBlurTexture();
105
// We use Rectangle texture to attach to the framebuffer because some GPU like the Geforce FX 5600 do not
106
// have support for ARB_texture_non_power_of_two. However it does support ARB_texture_recatangle.
107
struct RenderTargetTextures
109
TRefGL<IOpenGLTexture2D> color_rt;
110
TRefGL<IOpenGLTexture2D> depth_rt;
112
TRefGL<IOpenGLTexture2D> m_MainColorRT;
113
TRefGL<IOpenGLTexture2D> m_MainDepthRT;
114
TRefGL<IOpenGLTexture2D> m_CompositionRT;
116
RenderTargetTextures& GetWindowBuffer(smptr(BaseWindow) window);
118
void StartModalWindow(smptr(BaseWindow) );
119
void StopModalWindow(smptr(BaseWindow) );
121
std::vector<Rect> EventRect;
122
void PushEventRectangle(Rect rect);
123
void PopEventRectangle();
124
void EmptyEventRegion();
127
void AddMenu(MenuPage* menu, smptr(BaseWindow) window, bool OverrideCurrentMenuChain = true);
128
void RemoveMenu(MenuPage* menu);
131
void PushModalWindow(smptr(BaseWindow) window);
133
// typedef void(*AuxDrawCallback)();
134
// AuxDrawCallback m_fAuxDrawCallback;
136
// void SetAuxDrawCallback(AuxDrawCallback f) { m_fAuxDrawCallback = f; }
140
void SetWidgetDrawingOverlay(smptr(BaseArea) ic, smptr(BaseWindow) OverlayWindow);
141
smptr(BaseArea) GetWidgetDrawingOverlay();
143
void SetTooltip(smptr(BaseArea) TooltipArea, const TCHAR *TooltipText, int x, int y);
145
Return true if the mouse is still inside the area that initiated the tooltip;
147
@param x The mouse x coordinate on screen.
148
@param y The mouse y coordinate on screen.
149
@return Return true is the mouse is still inside the area.
151
bool ValidateMouseInsideTooltipArea(int x, int y);
153
Return true if there is a valid tooltip active.
155
@return Return true if there is a valid tooltip active.
157
bool IsTooltipActive();
158
void CancelTooltip();
160
void SetAreaEventRoot(int x, int y)
162
m_EventRoot.Set(x, y);
165
void SetMouseFocusArea(smptr(BaseArea) area);
166
smptr(BaseArea) GetMouseFocusArea();
167
void SetMouseOverArea(smptr(BaseArea) area);
168
smptr(BaseArea) GetMouseOverArea();
169
void SetPreviousMouseOverArea(smptr(BaseArea) area);
170
smptr(BaseArea) GetPreviousMouseOverArea();
172
const IEvent* GetCurrentEvent() const {return m_CurrentEvent;}
173
long ProcessEventOnObject(IEvent &ievent, smptr(BaseObject) object, long TraverseInfo, long ProcessEventInfo);
175
smptr(BaseWindow) GetCurrentWindow() {return m_CurrentWindow;}
176
smptr(BaseWindow) GetFocusAreaWindow() {return m_FocusAreaWindow;}
178
void SetBackgroundPaintLayer(AbstractPaintLayer* bkg);
181
void SetCurrentWindow(smptr(BaseWindow) window) {m_CurrentWindow = window;}
182
void SetFocusAreaWindow(smptr(BaseWindow) window) {m_FocusAreaWindow = window;}
183
void SetCurrentEvent(IEvent* event) {m_CurrentEvent = event;}
185
void FormatRenderTargets(int width, int height);
187
void UpdatePostProcessRT();
190
Floating Area need to be informed when the main window has been resized.
192
@param Width New width of the window.
193
@param Height New height of the window.
195
void FloatingAreaConfigureNotify(int Width, int Height);
197
smptr(BaseWindow) m_CurrentWindow;
198
smptr(BaseWindow) m_FocusAreaWindow;
199
smptr(BaseWindow) m_MenuWindow; // the window that owns the menu being displayed;
200
IEvent* m_CurrentEvent;
202
smptr(BaseArea) m_MouseFocusArea; // the base ares that has the mouse down.
203
smptr(BaseArea) m_MouseOverArea; // the base area that has the mouse directly over itself.
204
smptr(BaseArea) m_PreviousMouseOverArea;
206
smptr(BaseArea) OverlayDrawingCommand;
207
smptr(BaseWindow) m_OverlayWindow; // the window that owns the overlay;
208
smptr(BaseWindow) m_TooltipWindow; // the window that owns the tooltip;
211
AbstractPaintLayer* m_Background;
213
std::list<smptr(BaseWindow)> m_WindowList;
214
std::list<smptr(BaseWindow)> m_ModalWindowList;
215
std::list<smptr(ActiveInterfaceObject)> *m_DrawList;
216
std::list<Rect> *m_EventRectList;
218
std::list<MenuPage*> *m_MenuList;
220
smptr(BaseWindow) m_SelectedWindow;
222
std::map< smptr(BaseWindow), struct RenderTargetTextures > m_WindowToTextureMap;
224
smptr(BaseWindow) m_ModalWindow;
225
Point m_MouseLastPos;
226
Point m_MouseCurrentPos;
237
NString m_TooltipText;
238
smptr(BaseArea) m_TooltipArea;
242
bool m_FullSceneBlurUpdated;
243
TRefGL<IOpenGLTexture2D> m_BlurTexture;
244
TRefGL<IOpenGLTexture2D> m_FullSceneMip0;
245
TRefGL<IOpenGLTexture2D> m_FullSceneMip1;
246
TRefGL<IOpenGLTexture2D> m_FullSceneMip2;
248
//PBuffer *m_pbuffer;
251
WindowCompositor(const WindowCompositor&);
252
// Does not make sense for a singleton. This is a self assignment.
253
WindowCompositor& operator=(const WindowCompositor&);
254
// Declare operator address-of as private
255
WindowCompositor* operator &();
258
friend class GfxServerImpl;
259
friend class BaseArea;
260
friend class WindowThread;
23
#ifndef STACKMANAGER_H
24
#define STACKMANAGER_H
26
#include "BaseWindow.h"
33
class ActiveInterfaceObject;
39
class WindowCompositor
44
void SetClientSize(int w, int h);
45
// void DrawGrid(Graphics *g);
46
void Draw(IEvent &event, bool force_draw);
49
void DrawPopup(bool force_draw);
50
void DrawMenu(bool force_draw);
51
void DrawOverlay(bool force_draw);
52
void DrawTooltip(bool force_draw);
53
void DrawFloatingWindows(bool force_draw, const std::list<smptr(BaseWindow)>& WindowList, bool drawModal, bool UseFBO);
55
void RenderMainWindowComposition(bool force_draw, bool UseFBO);
56
void RenderWindowComposition(smptr(BaseWindow) window, bool force_draw);
60
Render a textured quad the quad has the size of the texture. The texture maybe the main window texture or a BaseWindow texture.
62
@param HWTexture Texture to render.
63
@param x Coordinates of the top left corner of the quad.
64
@param y Coordinates of the top left corner of the quad.
65
@param RenderToMainTexture If true, render to the main window texture. If false, render to the default back buffer.
66
@param BluredBackground If true, the texture is blended with the blurred version of the main window texture.
68
void PresentBufferToScreen(TRefGL<IOpenGLTexture2D> HWTexture, int x, int y, bool RenderToMainTexture, bool BluredBackground = false);
69
void PresentRendering();
72
Set the composition render target as the texture to draw into.
74
void SetCompositionRT();
77
Draw a Texture into the composition render target.
78
@param x Destination coordinates.
79
@param y Destination coordinates.
81
void CopyTextureToCompositionRT(TRefGL<IOpenGLTexture2D> HWTexture, int x, int y);
83
void AddToDrawList(smptr(ActiveInterfaceObject) ic);
87
bool MouseDown(Point pt);
89
bool MouseMove(Point pt);
90
bool MouseUp(Point pt);
91
smptr(BaseWindow) GetSelectedWindow();
93
void ProcessEvent(IEvent &ievent);
95
void RegisterWindow(smptr(BaseWindow));
96
void UnRegisterWindow(smptr(BaseWindow));
97
void MoveWindowToFront(smptr(BaseWindow));
98
void MoveWindowToBack(smptr(BaseWindow));
100
TRefGL<IOpenGLFrameBufferObject>& GetWindowFrameBufferObject(){ return m_FrameBufferObject;}
101
TRefGL<IOpenGLFrameBufferObject> m_FrameBufferObject;
103
TRefGL< IOpenGLBaseTexture > GetScreenBlurTexture();
105
// We use Rectangle texture to attach to the framebuffer because some GPU like the Geforce FX 5600 do not
106
// have support for ARB_texture_non_power_of_two. However it does support ARB_texture_recatangle.
107
struct RenderTargetTextures
109
TRefGL<IOpenGLTexture2D> color_rt;
110
TRefGL<IOpenGLTexture2D> depth_rt;
112
TRefGL<IOpenGLTexture2D> m_MainColorRT;
113
TRefGL<IOpenGLTexture2D> m_MainDepthRT;
114
TRefGL<IOpenGLTexture2D> m_CompositionRT;
116
RenderTargetTextures& GetWindowBuffer(smptr(BaseWindow) window);
118
void StartModalWindow(smptr(BaseWindow) );
119
void StopModalWindow(smptr(BaseWindow) );
121
std::vector<Rect> EventRect;
122
void PushEventRectangle(Rect rect);
123
void PopEventRectangle();
124
void EmptyEventRegion();
127
void AddMenu(MenuPage* menu, smptr(BaseWindow) window, bool OverrideCurrentMenuChain = true);
128
void RemoveMenu(MenuPage* menu);
131
void PushModalWindow(smptr(BaseWindow) window);
133
// typedef void(*AuxDrawCallback)();
134
// AuxDrawCallback m_fAuxDrawCallback;
136
// void SetAuxDrawCallback(AuxDrawCallback f) { m_fAuxDrawCallback = f; }
140
void SetWidgetDrawingOverlay(smptr(BaseArea) ic, smptr(BaseWindow) OverlayWindow);
141
smptr(BaseArea) GetWidgetDrawingOverlay();
143
void SetTooltip(smptr(BaseArea) TooltipArea, const TCHAR *TooltipText, int x, int y);
145
Return true if the mouse is still inside the area that initiated the tooltip;
147
@param x The mouse x coordinate on screen.
148
@param y The mouse y coordinate on screen.
149
@return Return true is the mouse is still inside the area.
151
bool ValidateMouseInsideTooltipArea(int x, int y);
153
Return true if there is a valid tooltip active.
155
@return Return true if there is a valid tooltip active.
157
bool IsTooltipActive();
158
void CancelTooltip();
160
void SetAreaEventRoot(int x, int y)
162
m_EventRoot.Set(x, y);
165
void SetMouseFocusArea(smptr(BaseArea) area);
166
smptr(BaseArea) GetMouseFocusArea();
167
void SetMouseOverArea(smptr(BaseArea) area);
168
smptr(BaseArea) GetMouseOverArea();
169
void SetPreviousMouseOverArea(smptr(BaseArea) area);
170
smptr(BaseArea) GetPreviousMouseOverArea();
172
const IEvent* GetCurrentEvent() const {return m_CurrentEvent;}
173
long ProcessEventOnObject(IEvent &ievent, smptr(BaseObject) object, long TraverseInfo, long ProcessEventInfo);
175
smptr(BaseWindow) GetCurrentWindow() {return m_CurrentWindow;}
176
smptr(BaseWindow) GetFocusAreaWindow() {return m_FocusAreaWindow;}
178
void SetBackgroundPaintLayer(AbstractPaintLayer* bkg);
181
void SetCurrentWindow(smptr(BaseWindow) window) {m_CurrentWindow = window;}
182
void SetFocusAreaWindow(smptr(BaseWindow) window) {m_FocusAreaWindow = window;}
183
void SetCurrentEvent(IEvent* event) {m_CurrentEvent = event;}
185
void FormatRenderTargets(int width, int height);
187
void UpdatePostProcessRT();
190
Floating Area need to be informed when the main window has been resized.
192
@param Width New width of the window.
193
@param Height New height of the window.
195
void FloatingAreaConfigureNotify(int Width, int Height);
197
smptr(BaseWindow) m_CurrentWindow;
198
smptr(BaseWindow) m_FocusAreaWindow;
199
smptr(BaseWindow) m_MenuWindow; // the window that owns the menu being displayed;
200
IEvent* m_CurrentEvent;
202
smptr(BaseArea) m_MouseFocusArea; // the base ares that has the mouse down.
203
smptr(BaseArea) m_MouseOverArea; // the base area that has the mouse directly over itself.
204
smptr(BaseArea) m_PreviousMouseOverArea;
206
smptr(BaseArea) OverlayDrawingCommand;
207
smptr(BaseWindow) m_OverlayWindow; // the window that owns the overlay;
208
smptr(BaseWindow) m_TooltipWindow; // the window that owns the tooltip;
211
AbstractPaintLayer* m_Background;
213
std::list<smptr(BaseWindow)> m_WindowList;
214
std::list<smptr(BaseWindow)> m_ModalWindowList;
215
std::list<smptr(ActiveInterfaceObject)> *m_DrawList;
216
std::list<Rect> *m_EventRectList;
218
std::list<MenuPage*> *m_MenuList;
220
smptr(BaseWindow) m_SelectedWindow;
222
std::map< smptr(BaseWindow), struct RenderTargetTextures > m_WindowToTextureMap;
224
smptr(BaseWindow) m_ModalWindow;
225
Point m_MouseLastPos;
226
Point m_MouseCurrentPos;
237
NString m_TooltipText;
238
smptr(BaseArea) m_TooltipArea;
242
bool m_FullSceneBlurUpdated;
243
TRefGL<IOpenGLTexture2D> m_BlurTexture;
244
TRefGL<IOpenGLTexture2D> m_FullSceneMip0;
245
TRefGL<IOpenGLTexture2D> m_FullSceneMip1;
246
TRefGL<IOpenGLTexture2D> m_FullSceneMip2;
248
//PBuffer *m_pbuffer;
251
WindowCompositor(const WindowCompositor&);
252
// Does not make sense for a singleton. This is a self assignment.
253
WindowCompositor& operator=(const WindowCompositor&);
254
// Declare operator address-of as private
255
WindowCompositor* operator &();
258
friend class GfxServerImpl;
259
friend class BaseArea;
260
friend class WindowThread;
264
264
#endif // STACKMANAGER_H
b'\\ No newline at end of file'