Guiliani  Version 2.6 revision 7293 (documentation build 12)
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 Polygon(
96 eC_Value* pvPoints,
97 const eC_UInt& uiCount,
98 const eC_Bool& bFilled);
99
100 virtual void SetCliprect(const CGUIRect &NewClipRect);
101
119 virtual void BlitImgExtImpl(
120 const ImageResource_t &eID,
121 const eC_UInt &uiSrcX, const eC_UInt &uiSrcY, const eC_UInt &uiSrcWidth, const eC_UInt &uiSrcHeight,
122 const eC_Value& vDestX, const eC_Value& vDestY, const eC_Value& vDestWidth, const eC_Value& vDestHeight,
123 const eC_UByte &ubAlpha = 255,
124 const eC_Value& vAngle = eC_FromFloat(0),
125 const eC_Value& vRotCenterX = eC_FromFloat(0.5), const eC_Value& vRotCenterY = eC_FromFloat(0.5));
126
127 virtual void BlitImgExtImpl(const CGUIImageData& kImageData, const eC_Value& vAbsDestX, const eC_Value& vAbsDestY);
128
129 virtual eC_UInt GetImgWidthImpl(const ImageResource_t &eID) const;
130 virtual eC_UInt GetImgHeightImpl(const ImageResource_t &eID) const;
131 virtual eC_UInt GetImageSize(const ImageResource_t& eID) const {return 0;}
132
133 virtual void RefreshImage(const ImageResource_t& eID, void* pkMemory);
134
138 void SetAlpha(eC_UByte ubAlpha);
139
142
143 virtual eC_Bool DrawToBitmap(GUIBitmapPlaneID_t uiBitmapID);
144 virtual eC_Bool DrawToScreen();
145
146 virtual void SetTargetLayer(const eC_UInt& uiLayerID);
147
152 d2_device* GetDaveDevice();
153
154 virtual eC_UInt GetVirtualScreenWidth();
155 virtual eC_UInt GetVirtualScreenHeight();
156
157 virtual eC_UInt GetPhysicalScreenWidth();
158 virtual eC_UInt GetPhysicalScreenHeight();
159
164 static eC_UInt GetD1PixelFormat(const CGUICommonEnums::ImageType_t& ePixFormat);
165
170 static eC_UInt GetD2PixelFormat(const CGUICommonEnums::ImageType_t& ePixFormat);
171
172 virtual eC_Bool SupportCompressedFonts() const { return true; }
173
174 virtual void LoadGlyphData(
175 CGUIImageData* pkImageData,
176 const eC_UInt& uiGlyphWidth,
177 const eC_UInt& uiGlyphHeight,
178 eC_UByte* pkGlyphBitmap);
179
180 virtual void UnloadGlyphData(CGUIImageData* pkImageData);
181
182protected:
186
190
194
195 virtual void LoadImgImpl(const eC_String& kPath, const ImageResource_t &eID);
196 virtual void LoadImgImpl(
197 void* pkMemory,
198 const eC_UInt& uiWidth,
199 const eC_UInt& uiHeight,
200 const eC_UInt& eImageType,
201 const ImageResource_t &eID);
202
208 virtual eC_Bool LoadImgRAW(eC_File* pkImageFile, CGUIImageDataDAVE& kImageData);
209
215 virtual eC_Bool LoadImgRLE(eC_File* pkImageFile, CGUIImageDataDAVE& kImageData);
216
222 virtual eC_Bool LoadImgDecoder(const eC_String& kPath, const eC_UInt& uiImageIndex);
223
224 virtual void UnloadImg(const ImageResource_t &eID);
225
226 virtual eC_Bool ImageExists(const ImageResource_t eID) const;
227
229 GUIBitmapPlaneID_t uiNewBitmapID,
230 const CGUIObject& rkParentObject,
231 const eC_Value& vWidth,
232 const eC_Value& vHeight);
233
237 eC_Bool Init(void);
238
242 eC_Bool DeInit(void);
243
248 eC_Bool SetNOFImagesImpl(const eC_UInt uiNOFImages);
249
254 CGfxWrapDAVE(CGfxEnv* pkGfxEnv, const eC_UInt& uiWorkingMemorySize);
255
257 virtual ~CGfxWrapDAVE(void);
258
259protected:
261 typedef struct
262 {
263 eC_UInt uiID;
266
267protected:
270
273
275 eC_Int m_iD1Mode;
277 eC_Int m_iD2Mode;
279 d2_device* m_pkD2Handle;
281 d1_device* m_pkD1Handle;
282
284 d2_context *m_pkD2Context;
286 eC_TArray<CGUIImageDataDAVE*> m_pkImages;
287
290
292 dc_handle m_dc_handle;
293
297 d2_renderbuffer* m_pkRenderBuffer;
298};
299#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:81
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:277
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:275
eC_Bool m_bSeperatedMemory
true if memory is seperated (e.g. Linux)
Definition: GfxWrapDave.h:289
virtual void Polygon(eC_Value *pvPoints, const eC_UInt &uiCount, const eC_Bool &bFilled)
virtual void SetCliprect(const CGUIRect &NewClipRect)
virtual eC_Bool DrawToScreen()
virtual eC_UInt GetImageSize(const ImageResource_t &eID) const
Definition: GfxWrapDave.h:131
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:272
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:297
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:295
eC_Bool Init(void)
virtual eC_Bool SupportCompressedFonts() const
Definition: GfxWrapDave.h:172
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:279
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:286
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:281
eC_Bool DeInit(void)
d2_context * m_pkD2Context
a dave context
Definition: GfxWrapDave.h:284
dc_handle m_dc_handle
A handle for the display controller.
Definition: GfxWrapDave.h:292
ScreenConfig_t * m_pkScreens
Pointer to memory areas of configured framebuffers.
Definition: GfxWrapDave.h:269
virtual void BlitImgExtImpl(const CGUIImageData &kImageData, const eC_Value &vAbsDestX, const eC_Value &vAbsDestY)
The graphics wrapper base class.
Definition: GfxWrap.h:88
RefreshCall_t
Definition: GfxWrap.h:113
config for screen
Definition: GfxWrapDave.h:262
CDAVEScreen * pScreen
pointer to screens
Definition: GfxWrapDave.h:264
eC_UInt uiID
id of screen
Definition: GfxWrapDave.h:263