Guiliani  Version 2.5 revision 7293 (documentation build 13)
GfxWrapDave.h
1/*
2* Copyright (C) TES Electronic Solutions GmbH,
3* All Rights Reserved.
4* Contact: info@guiliani.de
5*
6* This file is part of the Guiliani HMI framework
7* for the development of graphical user interfaces on embedded systems.
8*/
9
10#ifndef GFXWRAPDAVE__H_
11#define GFXWRAPDAVE__H_
12
13#include "GfxWrap.h"
14
15#include "DAVETypes.h"
16#include "DAVEScreen.h"
17
18#include "GUIImageLoader.h"
19#include "GUIImageDataDAVE.h"
20
21#include "GUILayerConfig.h"
22
23// Dave driver
24#include "dave_base.h"
25#include "dave_driver.h"
26
27// If BSP supports TES own Device driver, then use it
28
29
31
43class CGfxWrapDAVE : public CGfxWrap
44{
45public:
51 static eC_Bool CreateInstance(
52 CGfxEnv* pkGfxEnv,
53 const eC_UInt& uiWorkingMemorySize = 64000);
54
57 virtual void CreateScreen();
58
59 virtual void DestroyScreen();
60
61 virtual eC_Bool Refresh(const RefreshCall_t eRefreshCallType);
62
63 virtual void SetForegroundColorImpl(const eC_UByte &ubRed, const eC_UByte &ubGreen, const eC_UByte &ubBlue, const eC_UByte &ubAlpha = 255);
64 virtual eC_Value SetLineWidth(const eC_Value& vWidth);
65 virtual void Line(const eC_Value& vX1, const eC_Value& vY1, const eC_Value& vX2, const eC_Value& vY2);
66 virtual void Rect(const eC_Value& vX1, const eC_Value& vY1, const eC_Value& vX2, const eC_Value& vY2);
67 virtual void FilledRect(const eC_Value& vX1, const eC_Value& vY1, const eC_Value& vX2, const eC_Value& vY2);
68
69 virtual void Ellipse(
70 const eC_Value& vX1, const eC_Value& vY1,
71 const eC_Value& vX2, const eC_Value& vY2,
72 const eC_Bool &bFilled = true);
73
74 virtual void Arc(
75 const eC_Value& vX1,
76 const eC_Value& vY1,
77 const eC_Value& vX2,
78 const eC_Value& vY2,
79 const eC_Value& vStartAngle,
80 const eC_Value& vEndAngle,
81 const eC_Value& vRotationAngle,
82 const eC_Bool &bFilled);
83
84 virtual void Ring(
85 const eC_Value& vX1,
86 const eC_Value& vY1,
87 const eC_Value& vX2,
88 const eC_Value& vY2,
89 const eC_Value& vRingWidth,
90 const eC_Value& vStartAngle,
91 const eC_Value& vEndAngle,
92 const eC_Value& vRotationAngle,
93 const eC_Bool & bFilled);
94
95 virtual void SetCliprect(const CGUIRect &NewClipRect);
96
114 virtual void BlitImgExtImpl(
115 const ImageResource_t &eID,
116 const eC_UInt &uiSrcX, const eC_UInt &uiSrcY, const eC_UInt &uiSrcWidth, const eC_UInt &uiSrcHeight,
117 const eC_Value& vDestX, const eC_Value& vDestY, const eC_Value& vDestWidth, const eC_Value& vDestHeight,
118 const eC_UByte &ubAlpha = 255,
119 const eC_Value& vAngle = eC_FromFloat(0),
120 const eC_Value& vRotCenterX = eC_FromFloat(0.5), const eC_Value& vRotCenterY = eC_FromFloat(0.5));
121
122 virtual void BlitImgExtImpl(const CGUIImageData& kImageData, const eC_Value& vAbsDestX, const eC_Value& vAbsDestY);
123
124 virtual eC_UInt GetImgWidthImpl(const ImageResource_t &eID) const;
125 virtual eC_UInt GetImgHeightImpl(const ImageResource_t &eID) const;
126 virtual eC_UInt GetImageSize(const ImageResource_t& eID) const {return 0;}
127
128 virtual void RefreshImage(const ImageResource_t& eID, void* pkMemory);
129
133 void SetAlpha(eC_UByte ubAlpha);
134
137
138 virtual eC_Bool DrawToBitmap(GUIBitmapPlaneID_t uiBitmapID);
139 virtual eC_Bool DrawToScreen();
140
141 virtual void SetTargetLayer(const eC_UInt& uiLayerID);
142
147 d2_device* GetDaveDevice();
148
149 virtual eC_UInt GetVirtualScreenWidth();
150 virtual eC_UInt GetVirtualScreenHeight();
151
152 virtual eC_UInt GetPhysicalScreenWidth();
153 virtual eC_UInt GetPhysicalScreenHeight();
154
159 static eC_UInt GetD1PixelFormat(const CGUICommonEnums::ImageType_t& ePixFormat);
160
165 static eC_UInt GetD2PixelFormat(const CGUICommonEnums::ImageType_t& ePixFormat);
166
167 virtual eC_Bool SupportCompressedFonts() const { return true; }
168
169 virtual void LoadGlyphData(
170 CGUIImageData* pkImageData,
171 const eC_UInt& uiGlyphWidth,
172 const eC_UInt& uiGlyphHeight,
173 eC_UByte* pkGlyphBitmap);
174
175 virtual void UnloadGlyphData(CGUIImageData* pkImageData);
176
177protected:
181
185
189
190 virtual void LoadImgImpl(const eC_String& kPath, const ImageResource_t &eID);
191 virtual void LoadImgImpl(
192 void* pkMemory,
193 const eC_UInt& uiWidth,
194 const eC_UInt& uiHeight,
195 const eC_UInt& eImageType,
196 const ImageResource_t &eID);
197
203 virtual eC_Bool LoadImgRAW(eC_File* pkImageFile, CGUIImageDataDAVE& kImageData);
204
210 virtual eC_Bool LoadImgRLE(eC_File* pkImageFile, CGUIImageDataDAVE& kImageData);
211
217 virtual eC_Bool LoadImgDecoder(const eC_String& kPath, const eC_UInt& uiImageIndex);
218
219 virtual void UnloadImg(const ImageResource_t &eID);
220
221 virtual eC_Bool ImageExists(const ImageResource_t eID) const;
222
224 GUIBitmapPlaneID_t uiNewBitmapID,
225 const CGUIObject& rkParentObject,
226 const eC_Value& vWidth,
227 const eC_Value& vHeight);
228
232 eC_Bool Init(void);
233
237 eC_Bool DeInit(void);
238
243 eC_Bool SetNOFImagesImpl(const eC_UInt uiNOFImages);
244
249 CGfxWrapDAVE(CGfxEnv* pkGfxEnv, const eC_UInt& uiWorkingMemorySize);
250
252 virtual ~CGfxWrapDAVE(void);
253
254protected:
256 typedef struct
257 {
258 eC_UInt uiID;
261
262protected:
265
268
270 eC_Int m_iD1Mode;
272 eC_Int m_iD2Mode;
274 d2_device* m_pkD2Handle;
276 d1_device* m_pkD1Handle;
277
279 d2_context *m_pkD2Context;
281 eC_TArray<CGUIImageDataDAVE*> m_pkImages;
282
285
287 dc_handle m_dc_handle;
288
292 d2_renderbuffer* m_pkRenderBuffer;
293};
294#endif
ImageResource_t
Enumeration of image resource ids.
Definition: GUIImageResource.h:126
Definition: DAVEScreen.h:23
The bitmap plane base class.
Definition: GUIBitmapPlane.h:152
ImageType_t
Definition: GUICommonEnums.h:80
Definition: GUIImageDataDAVE.h:21
Contains information about an image loaded by CGUIImageLoader.
Definition: GUIImageData.h:29
This is the Guiliani base class all controls are derived from.
Definition: GUIObject.h:79
Helper class to supply a platform independent rectangle implementation.
Definition: GUIRect.h:63
Definition: GfxEnv.h:53
D/AVE implementation of the graphics wrapper.
Definition: GfxWrapDave.h:44
virtual eC_UInt GetVirtualScreenWidth()
eC_Int m_iD2Mode
Dave L2 Mode.
Definition: GfxWrapDave.h:272
virtual void Arc(const eC_Value &vX1, const eC_Value &vY1, const eC_Value &vX2, const eC_Value &vY2, const eC_Value &vStartAngle, const eC_Value &vEndAngle, const eC_Value &vRotationAngle, const eC_Bool &bFilled)
void EndRenderBuffer()
virtual void LoadImgImpl(void *pkMemory, const eC_UInt &uiWidth, const eC_UInt &uiHeight, const eC_UInt &eImageType, const ImageResource_t &eID)
eC_Bool SetNOFImagesImpl(const eC_UInt uiNOFImages)
virtual void Line(const eC_Value &vX1, const eC_Value &vY1, const eC_Value &vX2, const eC_Value &vY2)
the following methods are protected to prevent calling them directly
virtual eC_UInt GetVirtualScreenHeight()
virtual eC_Bool LoadImgRLE(eC_File *pkImageFile, CGUIImageDataDAVE &kImageData)
virtual void RefreshImage(const ImageResource_t &eID, void *pkMemory)
static eC_UInt GetD1PixelFormat(const CGUICommonEnums::ImageType_t &ePixFormat)
virtual void Ellipse(const eC_Value &vX1, const eC_Value &vY1, const eC_Value &vX2, const eC_Value &vY2, const eC_Bool &bFilled=true)
eC_Int m_iD1Mode
Dave L1 Mode.
Definition: GfxWrapDave.h:270
eC_Bool m_bSeperatedMemory
true if memory is seperated (e.g. Linux)
Definition: GfxWrapDave.h:284
virtual void SetCliprect(const CGUIRect &NewClipRect)
virtual eC_Bool DrawToScreen()
virtual eC_UInt GetImageSize(const ImageResource_t &eID) const
Definition: GfxWrapDave.h:126
virtual eC_Bool Refresh(const RefreshCall_t eRefreshCallType)
void CheckDAVEError()
Checks DAVE device for errors and outputs a log-message with error-code and description.
void StartRenderBuffer()
eC_UInt m_uiNumberOfScreens
number of screen
Definition: GfxWrapDave.h:267
virtual void Ring(const eC_Value &vX1, const eC_Value &vY1, const eC_Value &vX2, const eC_Value &vY2, const eC_Value &vRingWidth, const eC_Value &vStartAngle, const eC_Value &vEndAngle, const eC_Value &vRotationAngle, const eC_Bool &bFilled)
d2_renderbuffer * m_pkRenderBuffer
a single renderbuffer for immediate mode
Definition: GfxWrapDave.h:292
virtual CGUIBitmapPlane * CreateGfxDependentBitmap(GUIBitmapPlaneID_t uiNewBitmapID, const CGUIObject &rkParentObject, const eC_Value &vWidth, const eC_Value &vHeight)
eC_Bool m_bFrameStarted
if frame has started
Definition: GfxWrapDave.h:290
eC_Bool Init(void)
virtual eC_Bool SupportCompressedFonts() const
Definition: GfxWrapDave.h:167
virtual eC_Bool LoadImgRAW(eC_File *pkImageFile, CGUIImageDataDAVE &kImageData)
virtual eC_Bool LoadImgDecoder(const eC_String &kPath, const eC_UInt &uiImageIndex)
virtual void LoadImgImpl(const eC_String &kPath, const ImageResource_t &eID)
d2_device * m_pkD2Handle
a device for DAVE
Definition: GfxWrapDave.h:274
static eC_Bool CreateInstance(CGfxEnv *pkGfxEnv, const eC_UInt &uiWorkingMemorySize=64000)
virtual void LoadGlyphData(CGUIImageData *pkImageData, const eC_UInt &uiGlyphWidth, const eC_UInt &uiGlyphHeight, eC_UByte *pkGlyphBitmap)
virtual eC_Bool ImageExists(const ImageResource_t eID) const
void InitScreens()
virtual eC_Value SetLineWidth(const eC_Value &vWidth)
CGfxWrapDAVE(CGfxEnv *pkGfxEnv, const eC_UInt &uiWorkingMemorySize)
void SetAlpha(eC_UByte ubAlpha)
virtual void SetTargetLayer(const eC_UInt &uiLayerID)
virtual eC_Bool DrawToBitmap(GUIBitmapPlaneID_t uiBitmapID)
virtual void BlitImgExtImpl(const ImageResource_t &eID, const eC_UInt &uiSrcX, const eC_UInt &uiSrcY, const eC_UInt &uiSrcWidth, const eC_UInt &uiSrcHeight, const eC_Value &vDestX, const eC_Value &vDestY, const eC_Value &vDestWidth, const eC_Value &vDestHeight, const eC_UByte &ubAlpha=255, const eC_Value &vAngle=eC_FromFloat(0), const eC_Value &vRotCenterX=eC_FromFloat(0.5), const eC_Value &vRotCenterY=eC_FromFloat(0.5))
virtual void UnloadGlyphData(CGUIImageData *pkImageData)
virtual void UnloadImg(const ImageResource_t &eID)
eC_TArray< CGUIImageDataDAVE * > m_pkImages
the array of the loaded images
Definition: GfxWrapDave.h:281
static eC_UInt GetD2PixelFormat(const CGUICommonEnums::ImageType_t &ePixFormat)
virtual void DestroyScreen()
Method to clean and release the screen which was created via the CreateScreen Method.
virtual eC_UInt GetPhysicalScreenHeight()
virtual ~CGfxWrapDAVE(void)
Destructor.
d2_device * GetDaveDevice()
virtual void FilledRect(const eC_Value &vX1, const eC_Value &vY1, const eC_Value &vX2, const eC_Value &vY2)
virtual eC_UInt GetPhysicalScreenWidth()
virtual void Rect(const eC_Value &vX1, const eC_Value &vY1, const eC_Value &vX2, const eC_Value &vY2)
virtual void CreateScreen()
virtual void SetForegroundColorImpl(const eC_UByte &ubRed, const eC_UByte &ubGreen, const eC_UByte &ubBlue, const eC_UByte &ubAlpha=255)
virtual eC_UInt GetImgWidthImpl(const ImageResource_t &eID) const
virtual eC_UInt GetImgHeightImpl(const ImageResource_t &eID) const
d1_device * m_pkD1Handle
A handle for the display controller.
Definition: GfxWrapDave.h:276
eC_Bool DeInit(void)
d2_context * m_pkD2Context
a dave context
Definition: GfxWrapDave.h:279
dc_handle m_dc_handle
A handle for the display controller.
Definition: GfxWrapDave.h:287
ScreenConfig_t * m_pkScreens
Pointer to memory areas of configured framebuffers.
Definition: GfxWrapDave.h:264
virtual void BlitImgExtImpl(const CGUIImageData &kImageData, const eC_Value &vAbsDestX, const eC_Value &vAbsDestY)
The graphics wrapper base class.
Definition: GfxWrap.h:84
RefreshCall_t
Definition: GfxWrap.h:109
config for screen
Definition: GfxWrapDave.h:257
CDAVEScreen * pScreen
pointer to screens
Definition: GfxWrapDave.h:259
eC_UInt uiID
id of screen
Definition: GfxWrapDave.h:258