ADTF_DISPLAY_TOOLBOX  3.8.0 (ADTF 3.14.3)
gfxlibinterfaces.h
Go to the documentation of this file.
1 
7 #pragma once
8 #undef CreateFont
13 #include <adtf_utils.h>
14 #include <adtf_ucom3.h>
15 
16 namespace adtf
17 {
18 
19 namespace disptb
20 {
21 
22 namespace graphicslib
23 {
24 
28 #define COORDS_NONE 0x00
29 
33 #define COORDS_SCREEN 0x01
34 
38 #define COORDS_LOGICAL 0x02
39 
40 namespace dengar
41 {
42 
43 
50 {
51 public:
53  enum
54  {
56  DEVICE_GDI = 0x0001,
58  DEVICE_QT = 0x0002,
60  DEVICE_SWT = 0x0004,
62  DEVICE_X11 = 0x0008,
64  DEVICE_SDL = 0x0010,
65  // ---------------------------------------------------------------------
67  SUPPORT_OPENGL = 0x0100,
69  FULLSCREEN_MODE = 0x0200,
72  SUPPORT_ADTF25 = 0x0400
73  };
74 };
75 
81 class IFont
82 {
83 public:
85  typedef enum
86  {
93  } tStyle;
94 
95 public:
96 
100  virtual ~IFont()
101  {}
102 
107  virtual tResult Release() = 0;
108 
114  virtual tInt GetHeight() const = 0;
115 
124  virtual tBool MeasureText(const tChar* str, tInt& nWidth, tInt& nHeight) const = 0;
125 };
126 
132 class ITexture
133 {
134 public:
136  typedef enum
137  {
143 
144 public:
145 
149  virtual ~ITexture()
150  {}
151 
157  virtual tResult Release() = 0;
158 
166  virtual tResult SetMode(tInt nMode) = 0;
167 
171  virtual tVoid MakeCurrent() = 0;
172 
178  virtual tResult Copy(IImage* pSource) = 0;
179 
185  virtual tInt GetWidth() const = 0;
186 
192  virtual tInt GetHeight() const = 0;
193 
199  virtual tInt GetBitsPerPixel() const = 0;
200 
206  virtual tInt GetPhysicalWidth() const = 0;
207 
213  virtual tInt GetPhysicalHeight() const = 0;
214 };
215 
222 {
223 public:
224 
226  typedef enum
227  {
248  } tMode;
249 
251  typedef enum
252  {
268 
269 public:
270 
274  virtual ~IGraphicsMode()
275  {}
276 
284  virtual tBool IsSupported(tFeature nFeatureId) const = 0;
285 
297  virtual tVoid EnableAlpha(tBool bAdditiveMode = tFalse) const = 0;
298 
304  virtual tVoid DisableAlpha() const = 0;
305 
311  virtual tVoid EnableAntialiasing() const = 0;
312 
318  virtual tVoid DisableAntialiasing() const = 0;
319 
325  virtual tVoid EnableLighting() const = 0;
326 
332  virtual tVoid DisableLighting() const = 0;
333 
341  virtual tVoid EnableDepthBuffer() const = 0;
342 
348  virtual tVoid DisableDepthBuffer() const = 0;
349 
355  virtual tVoid EnableBackFaceCulling() const = 0;
356 
362  virtual tVoid DisableBackFaceCulling() const = 0;
363 
372  virtual tVoid LineWidth(tFloat64 fWidth) = 0;
373 
386  virtual tVoid LinePattern(tUInt16 ui16Pattern, tInt nFactor = 1) = 0;
387 
397  virtual tVoid Color(const IColor* col) = 0;
398 
410  virtual tVoid Color(tInt nRed, tInt nGreen, tInt nBlue, tInt nAlpha = 255) = 0;
411 
423  virtual tVoid Color(tUInt8 nRed, tUInt8 nGreen, tUInt8 nBlue, tUInt8 nAlpha = 255) = 0;
424 
436  virtual tVoid Color(tFloat64 fRed, tFloat64 fGreen, tFloat64 fBlue, tFloat64 fAlpha = 1.0) = 0;
437 
447  virtual tVoid BgColor(const IColor* col) = 0;
448 
460  virtual tVoid BgColor(tInt nRed, tInt nGreen, tInt nBlue, tInt nAlpha = 0) = 0;
461 
473  virtual tVoid BgColor(tUInt8 nRed, tUInt8 nGreen, tUInt8 nBlue, tUInt8 nAlpha = 0) = 0;
474 
486  virtual tVoid BgColor(tFloat64 fRed, tFloat64 fGreen, tFloat64 fBlue, tFloat64 fAlpha = 0.0) = 0;
487 
488 
499  virtual tVoid Begin(tMode eMode) = 0;
500 
509  virtual tVoid Coord(tInt x, tInt y) = 0;
510 
519  virtual tVoid Coord(tFloat32 x, tFloat32 y) = 0;
520 
528  virtual tVoid Coord(IPoint* pt) = 0;
529 
540  virtual tVoid Coord(IPoint** ppPoints, tInt nCount) = 0;
541 
551  virtual tVoid CoordTexture(tFloat32 u, tFloat32 v) = 0;
552 
559  virtual tVoid End() = 0;
560 };
561 
562 class IScene;
563 
571 class ICanvas : public IGraphicsMode, public ucom::ant::IObject
572 {
573 public:
575  ADTF_IID(ICanvas, "canvas.adtf_disptb.iid");
576 
578  virtual tResult Create(tInt nWidth, tInt nHeight, tInt nBitsPerPixel) = 0;
579 
580  virtual tVoid PushMatrix() = 0;
581 
582  virtual tVoid PopMatrix() = 0;
583 
584  virtual tVoid Translate(tFloat fx, tFloat fy, tFloat fz) = 0;
585 
586  virtual tVoid Scale(tFloat fx, tFloat fy, tFloat fz) = 0;
587 
588  virtual tVoid Rotate(tFloat fangle, tFloat fx, tFloat fy, tFloat fz) = 0;
590 
595  virtual tInt GetWidth() const = 0;
596 
601  virtual tInt GetHeight() const = 0;
602 
607  virtual tInt GetBitsPerPixel() const = 0;
608 
618  virtual tVoid SetMapping(tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2) = 0;
619 
625  virtual tVoid ClearMapping() = 0;
626 
632  virtual tInt MapPixelX(tFloat32 x) = 0;
633 
639  virtual tInt MapPixelY(tFloat32 y) = 0;
640 
646  virtual tInt MapPixelX(tInt x) = 0;
647 
653  virtual tInt MapPixelY(tInt y) = 0;
654 
660  virtual tFloat32 UnmapPixelX(tInt x) = 0;
661 
667  virtual tFloat32 UnmapPixelY(tInt y) = 0;
668 
674  virtual tVoid Clear() = 0;
675 
683  virtual tResult CreateTexture(IImage* pImage, ITexture*& pTexture) = 0;
684 
690  virtual tVoid DrawTexture(ITexture* pTexture, tFloat32 vPoints[8]) = 0;
691 
699  virtual tVoid DrawPixel(tInt x, tInt y) = 0;
700 
710  virtual tVoid DrawLine(tInt x1, tInt y1, tInt x2, tInt y2) = 0;
711 
722  virtual tVoid DrawRect(tInt x1, tInt y1, tInt x2, tInt y2) = 0;
723 
734  virtual tVoid DrawCircle(tInt x1, tInt y1, tInt x2, tInt y2) = 0;
735 
748  virtual tVoid DrawCircleSegment(tInt x1, tInt y1, tInt x2, tInt y2, tFloat64 fDegreeStart, tFloat64 fDegreeEnd,
749  tBool bNormalizeRect = tFalse) = 0;
750 
760  virtual tVoid FillRect(tInt x1, tInt y1, tInt x2, tInt y2) = 0;
761 
772  virtual tVoid FillCircle(tInt x1, tInt y1, tInt x2, tInt y2) = 0;
773 
789  virtual tVoid FillCircleSegment(tInt x1, tInt y1, tInt x2, tInt y2, tFloat64 fDegreeStart, tFloat64 fDegreeEnd,
790  tBool bNormalizeRect = tFalse) = 0;
791 
799  virtual tVoid DrawPixel(tFloat32 x, tFloat32 y) = 0;
800 
810  virtual tVoid DrawLine(tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2) = 0;
811 
822  virtual tVoid DrawRect(tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2) = 0;
823 
834  virtual tVoid DrawCircle(tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2) = 0;
835 
848  virtual tVoid
849  DrawCircleSegment(tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2, tFloat64 fDegreeStart, tFloat64 fDegreeEnd,
850  tBool bNormalizeRect = tFalse) = 0;
851 
861  virtual tVoid FillRect(tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2) = 0;
862 
872  virtual tVoid FillCircle(tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2) = 0;
873 
889  virtual tVoid
890  FillCircleSegment(tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2, tFloat64 fDegreeStart, tFloat64 fDegreeEnd,
891  tBool bNormalizeRect = tFalse) = 0;
892 
900  virtual tVoid DrawPixel(IPoint* pt) = 0;
901 
910  virtual tVoid
911  DrawLine(IPoint* ptStart, IPoint* ptEnd) = 0;
912 
920  virtual tVoid DrawRect(IRect* rect) = 0;
921 
929  virtual tVoid DrawPolygon(IPoint** ppPoints, tInt nCount) = 0;
930 
938  virtual tVoid DrawCircle(IRect* rect) = 0;
939 
949  virtual tVoid
950  DrawCircleSegment(IRect* rect, tFloat64 fDegreeStart, tFloat64 fDegreeEnd) = 0;
951 
958  virtual tVoid FillRect(IRect* rect) = 0;
959 
967  virtual tVoid FillPolygon(IPoint** ppPoints, tInt nCount) = 0;
968 
975  virtual tVoid FillCircle(IRect* rect) = 0;
976 
986  virtual tVoid
987  FillCircleSegment(IRect* rect, tFloat64 fDegreeStart, tFloat64 fDegreeEnd) = 0;
988 
1008  virtual IFont* CreateFont(const char* strName, tInt nHeight,
1009  IFont::tStyle eFontStyle = IFont::STYLE_Default) = 0;
1010 
1016  virtual tVoid SetFontAngle(tFloat64 fAngle) = 0;
1017 
1019  // * Returns the font angle
1020  // * @return angle of the font
1021  // */
1022  virtual tFloat64 GetFontAngle() = 0;
1023 
1025  // * Sets the current font for drawing operations
1026  // * @param [in] pFont Pointer to font instance
1027  // * @return void
1028  // */
1029  virtual tVoid Font(IFont* pFont) = 0;
1030 
1032  // * Sets an text to a given position
1033  // * @param [in] x x position of the text
1034  // * @param [in] y y position of the text
1035  // * @param [in] fmt format string the format follows the printf specification
1036  // * @param [in] ... unspecified parameters described in the format string
1037  // * @return void
1038  // */
1039  virtual tVoid OutputText(tInt x, tInt y, const tChar* fmt, ...) = 0;
1040 
1042  // * Sets an text to a given position
1043  // * @param [in] x x position of the text
1044  // * @param [in] y y position of the text
1045  // * @param [in] fmt format string the format follows the printf specification
1046  // * @param [in] ... unspecified parameters described in the format string
1047  // * @return void
1048  // */
1049  virtual tVoid OutputText(tFloat32 x, tFloat32 y, const tChar* fmt, ...) = 0;
1050 
1058  virtual ITexture* CreateTexture(const tBitmapFormat* psFormat, tInt nMode = 0) = 0;
1059 
1065  virtual tVoid Texture(ITexture* pTexture) = 0;
1066 
1076  virtual tVoid Blit(ITexture* pTexture, tInt x, tInt y, tInt nWidth, tInt nHeight) = 0;
1077 
1091  virtual tVoid Blit(IImage* pImage, tInt x, tInt y, tInt nWidth, tInt nHeight) = 0;
1092 
1102  virtual tVoid Capture(IImage** ppImage, tInt x, tInt y, tInt nWidth, tInt nHeight) = 0;
1103 
1110  virtual IScene* BeginScene() = 0;
1111 
1117  virtual tVoid EndScene() = 0;
1118 
1124  virtual tVoid SetFlag(tUInt32 nFlag, tInt32 nValue) = 0;
1125 
1131  virtual tInt32 GetFlag(tUInt32 nFlag) = 0;
1132 
1138  virtual tResult PushFlags() = 0;
1139 
1145  virtual tResult PopFlags() = 0;
1146 
1150  virtual tVoid ResetFlags() = 0;
1151 
1162  virtual tVoid DrawEllipse(tInt iOriginX,
1163  tInt iOriginY,
1164  tInt iWidth,
1165  tInt iHeight,
1166  tInt iAngle) = 0;
1167 
1178  virtual tVoid DrawEllipse(tFloat32 f32OriginX,
1179  tFloat32 f32OriginY,
1180  tFloat32 f32Width,
1181  tFloat32 f32Height,
1182  tFloat32 f32Angle) = 0;
1183 
1184 
1195  virtual tVoid FillEllipse(tInt iOriginX, tInt iOriginY, tInt iWidth, tInt iHeight, tInt iAngle) = 0;
1196 
1207  virtual tVoid FillEllipse(tFloat32 f32OriginX,
1208  tFloat32 f32OriginY,
1209  tFloat32 f32Width,
1210  tFloat32 f32Height,
1211  tFloat32 f32Angle) = 0;
1212 };
1213 
1214 
1221 {
1222 public:
1226  typedef enum
1227  {
1234 
1241 
1248 
1255 
1262 
1269 
1276 
1283 
1290 
1297 
1304 
1310  //EC_KeyDown = adtf::IKeyEventHandler::EC_KeyDown,
1311 
1316  EC_KeyUp = 13,
1317  //EC_KeyUp = adtf::IKeyEventHandler::EC_KeyUp,
1318 
1323  EC_KeyInput = 14
1324  //EC_KeyInput = adtf::IKeyEventHandler::EC_KeyInput
1325 
1327 
1331  typedef enum
1332  {
1333  MS_LeftButtonDown = 0x1,
1334  MS_RightButtonDown = 0x2,
1335  MS_MiddleButtonDown = 0x4,
1336  MS_CtrlKeyDown = 0x8
1337  } tMouseState;
1338 
1342  typedef enum
1343  {
1344  KS_CtrlKeyDown = 0x1,
1345  KS_AltKeyDown = 0x2,
1346  KS_ShiftKeyDown = 0x4
1347  /*KS_CtrlKeyDown = adtf::IKeyEventHandler::KS_CtrlKeyDown,
1348  KS_AltKeyDown = adtf::IKeyEventHandler::KS_AltKeyDown,
1349  KS_ShiftKeyDown = adtf::IKeyEventHandler::KS_ShiftKeyDown*/
1350  } tKeyState;
1351 
1357  typedef enum
1358  {
1360  KEY_ESCAPE = 0x01000000,
1362  KEY_TAB = 0x01000001,
1364  KEY_BACKSPACE = 0x01000003,
1366  KEY_RETURN = 0x01000004,
1368  KEY_INSERT = 0x01000006,
1370  KEY_DELETE = 0x01000007,
1372  KEY_PRINT = 0x01000009,
1374  KEY_HOME = 0x01000010,
1376  KEY_END = 0x01000011,
1378  KEY_LEFT = 0x01000012,
1380  KEY_UP = 0x01000013,
1382  KEY_RIGHT = 0x01000014,
1384  KEY_DOWN = 0x01000015,
1386  KEY_PAGEUP = 0x01000016,
1388  KEY_PAGEDOWN = 0x01000017,
1390  KEY_SPACE = 0x20,
1392  KEY_NUMLOCK = 0x01000025,
1393 
1395  KEY_F1 = 0x01000030,
1397  KEY_F2 = 0x01000031,
1399  KEY_F3 = 0x01000032,
1401  KEY_F4 = 0x01000033,
1403  KEY_F5 = 0x01000034,
1405  KEY_F6 = 0x01000035,
1407  KEY_F7 = 0x01000036,
1409  KEY_F8 = 0x01000037,
1411  KEY_F9 = 0x01000038,
1413  KEY_F10 = 0x01000039,
1415  KEY_F11 = 0x0100003a,
1417  KEY_F12 = 0x0100003b,
1418 
1420  KEY_PLUS = 0x2b,
1422  KEY_COMMA = 0x2c,
1424  KEY_MINUS = 0x2d,
1425  KEY_PERIOD = 0x2e,
1426 
1427  KEY_0 = 0x30,
1428  KEY_1 = 0x31,
1429  KEY_2 = 0x32,
1430  KEY_3 = 0x33,
1431  KEY_4 = 0x34,
1432  KEY_5 = 0x35,
1433  KEY_6 = 0x36,
1434  KEY_7 = 0x37,
1435  KEY_8 = 0x38,
1436  KEY_9 = 0x39,
1437 
1438  KEY_A = 0x41,
1439  KEY_B = 0x42,
1440  KEY_C = 0x43,
1441  KEY_D = 0x44,
1442  KEY_E = 0x45,
1443  KEY_F = 0x46,
1444  KEY_G = 0x47,
1445  KEY_H = 0x48,
1446  KEY_I = 0x49,
1447  KEY_J = 0x4a,
1448  KEY_K = 0x4b,
1449  KEY_L = 0x4c,
1450  KEY_M = 0x4d,
1451  KEY_N = 0x4e,
1452  KEY_O = 0x4f,
1453  KEY_P = 0x50,
1454  KEY_Q = 0x51,
1455  KEY_R = 0x52,
1456  KEY_S = 0x53,
1457  KEY_T = 0x54,
1458  KEY_U = 0x55,
1459  KEY_V = 0x56,
1460  KEY_W = 0x57,
1461  KEY_X = 0x58,
1462  KEY_Y = 0x59,
1463  KEY_Z = 0x5a,
1464 
1465  KEY_SHIFT = 0x01000020,
1466  KEY_CTRL = 0x01000021,
1467  KEY_ALT = 0x01000023
1468 
1469  /*///the escape key.
1470  KEY_ESCAPE = adtf::IKeyEventHandler::KEY_ESCAPE,
1472  KEY_TAB = adtf::IKeyEventHandler::KEY_TAB,
1474  KEY_BACKSPACE = adtf::IKeyEventHandler::KEY_BACKSPACE,
1476  KEY_RETURN = adtf::IKeyEventHandler::KEY_RETURN,
1478  KEY_INSERT = adtf::IKeyEventHandler::KEY_INSERT,
1480  KEY_DELETE = adtf::IKeyEventHandler::KEY_DELETE,
1482  KEY_PRINT = adtf::IKeyEventHandler::KEY_PRINT,
1484  KEY_HOME = adtf::IKeyEventHandler::KEY_HOME,
1486  KEY_END = adtf::IKeyEventHandler::KEY_END,
1488  KEY_LEFT = adtf::IKeyEventHandler::KEY_LEFT,
1490  KEY_UP = adtf::IKeyEventHandler::KEY_UP,
1492  KEY_RIGHT = adtf::IKeyEventHandler::KEY_RIGHT,
1494  KEY_DOWN = adtf::IKeyEventHandler::KEY_DOWN,
1496  KEY_PAGEUP = adtf::IKeyEventHandler::KEY_PAGEUP,
1498  KEY_PAGEDOWN = adtf::IKeyEventHandler::KEY_PAGEDOWN,
1500  KEY_SPACE = adtf::IKeyEventHandler::KEY_SPACE,
1502  KEY_NUMLOCK = adtf::IKeyEventHandler::KEY_NUMLOCK,
1503 
1505  KEY_F1 = adtf::IKeyEventHandler::KEY_F1,
1507  KEY_F2 = adtf::IKeyEventHandler::KEY_F2,
1509  KEY_F3 = adtf::IKeyEventHandler::KEY_F3,
1511  KEY_F4 = adtf::IKeyEventHandler::KEY_F4,
1513  KEY_F5 = adtf::IKeyEventHandler::KEY_F5,
1515  KEY_F6 = adtf::IKeyEventHandler::KEY_F6,
1517  KEY_F7 = adtf::IKeyEventHandler::KEY_F7,
1519  KEY_F8 = adtf::IKeyEventHandler::KEY_F8,
1521  KEY_F9 = adtf::IKeyEventHandler::KEY_F9,
1523  KEY_F10 = adtf::IKeyEventHandler::KEY_F10,
1525  KEY_F11 = adtf::IKeyEventHandler::KEY_F11,
1527  KEY_F12 = adtf::IKeyEventHandler::KEY_F12,
1528 
1530  KEY_PLUS = adtf::IKeyEventHandler::KEY_PLUS,
1532  KEY_COMMA = adtf::IKeyEventHandler::KEY_COMMA,
1534  KEY_MINUS = adtf::IKeyEventHandler::KEY_MINUS,
1535  KEY_PERIOD = adtf::IKeyEventHandler::KEY_PERIOD,
1536 
1537  KEY_0 = adtf::IKeyEventHandler::KEY_0,
1538  KEY_1 = adtf::IKeyEventHandler::KEY_1,
1539  KEY_2 = adtf::IKeyEventHandler::KEY_2,
1540  KEY_3 = adtf::IKeyEventHandler::KEY_3,
1541  KEY_4 = adtf::IKeyEventHandler::KEY_4,
1542  KEY_5 = adtf::IKeyEventHandler::KEY_5,
1543  KEY_6 = adtf::IKeyEventHandler::KEY_6,
1544  KEY_7 = adtf::IKeyEventHandler::KEY_7,
1545  KEY_8 = adtf::IKeyEventHandler::KEY_8,
1546  KEY_9 = adtf::IKeyEventHandler::KEY_9,
1547 
1548  KEY_A = adtf::IKeyEventHandler::KEY_A,
1549  KEY_B = adtf::IKeyEventHandler::KEY_B,
1550  KEY_C = adtf::IKeyEventHandler::KEY_C,
1551  KEY_D = adtf::IKeyEventHandler::KEY_D,
1552  KEY_E = adtf::IKeyEventHandler::KEY_E,
1553  KEY_F = adtf::IKeyEventHandler::KEY_F,
1554  KEY_G = adtf::IKeyEventHandler::KEY_G,
1555  KEY_H = adtf::IKeyEventHandler::KEY_H,
1556  KEY_I = adtf::IKeyEventHandler::KEY_I,
1557  KEY_J = adtf::IKeyEventHandler::KEY_J,
1558  KEY_K = adtf::IKeyEventHandler::KEY_K,
1559  KEY_L = adtf::IKeyEventHandler::KEY_L,
1560  KEY_M = adtf::IKeyEventHandler::KEY_M,
1561  KEY_N = adtf::IKeyEventHandler::KEY_N,
1562  KEY_O = adtf::IKeyEventHandler::KEY_O,
1563  KEY_P = adtf::IKeyEventHandler::KEY_P,
1564  KEY_Q = adtf::IKeyEventHandler::KEY_Q,
1565  KEY_R = adtf::IKeyEventHandler::KEY_R,
1566  KEY_S = adtf::IKeyEventHandler::KEY_S,
1567  KEY_T = adtf::IKeyEventHandler::KEY_T,
1568  KEY_U = adtf::IKeyEventHandler::KEY_U,
1569  KEY_V = adtf::IKeyEventHandler::KEY_V,
1570  KEY_W = adtf::IKeyEventHandler::KEY_W,
1571  KEY_X = adtf::IKeyEventHandler::KEY_X,
1572  KEY_Y = adtf::IKeyEventHandler::KEY_Y,
1573  KEY_Z = adtf::IKeyEventHandler::KEY_Z,
1574 
1575  KEY_SHIFT = adtf::IKeyEventHandler::KEY_SHIFT,
1576  KEY_CTRL = adtf::IKeyEventHandler::KEY_CTRL,
1577  KEY_ALT = adtf::IKeyEventHandler::KEY_ALT*/
1578  } tKey;
1579 
1580 public:
1601  virtual tResult OnCreate(tHandle hCanvas, tInt nLeft, tInt nTop, tInt nRight, tInt nBottom) = 0;
1602 
1623  virtual tResult OnPaint(tHandle hCanvas, tInt nLeft, tInt nTop, tInt nRight, tInt nBottom) = 0;
1624 
1645  virtual tResult OnSize(tHandle hCanvas, tInt nLeft, tInt nTop, tInt nRight, tInt nBottom) = 0;
1646 
1660  virtual tResult OnIconify(tHandle hCanvas, tBool bIconified) = 0;
1661 
1675  virtual tResult OnTimer(tHandle hCanvas) = 0;
1676 
1692  virtual tResult OnIdle(tHandle hCanvas) = 0;
1693 
1702  virtual tResult OnDestroy() = 0;
1703 
1714  virtual tResult OnControlEvent(tControlEventCode eCode,
1715  tInt nParam1 = 0,
1716  tInt nParam2 = 0,
1717  tInt nFlags = 0,
1718  tVoid* pEventData = nullptr) = 0;
1719 };
1720 
1722 #define ADTF_VIEWPORT_INTERNAL_CLASS "class"
1724 #define ADTF_VIEWPORT_INTERNAL_TITLEWINDOW "titlewindow"
1726 #define ADTF_VIEWPORT_INTERNAL_PARENT_SETTER "parentset"
1727 
1728 
1729 }
1733 {
1734 
1738 
1742 
1749 
1757 };
1758 
1759 using dengar::IGraphicsFlags;
1760 using dengar::IFont;
1761 using dengar::ITexture;
1762 using dengar::ITexture;
1763 using dengar::IGraphicsMode;
1764 using dengar::IScene;
1765 using dengar::ICanvas;
1766 using dengar::IUIEventHandler;
1767 
1768 }
1769 
1770 }
1771 
1772 }
virtual tVoid Clear()=0
Clears the canvas and all drawings to background color.
virtual tFloat32 UnmapPixelX(tInt x)=0
Unmap x coordinate from screen region to global coordinates.
virtual tVoid DrawPixel(tFloat32 x, tFloat32 y)=0
Draws a pixel at the given position.
virtual tVoid DrawLine(IPoint *ptStart, IPoint *ptEnd)=0
Draws a line between two points.
virtual tVoid FillCircleSegment(tInt x1, tInt y1, tInt x2, tInt y2, tFloat64 fDegreeStart, tFloat64 fDegreeEnd, tBool bNormalizeRect=tFalse)=0
Fills a circle segment (see.
virtual tVoid FillCircle(tInt x1, tInt y1, tInt x2, tInt y2)=0
Fills a circle with the current color.
virtual tInt32 GetFlag(tUInt32 nFlag)=0
Returns a flagvalue.
virtual tVoid Blit(ITexture *pTexture, tInt x, tInt y, tInt nWidth, tInt nHeight)=0
Blits a texture on canvas.
virtual tVoid OutputText(tFloat32 x, tFloat32 y, const tChar *fmt,...)=0
‍**
virtual tVoid FillCircleSegment(IRect *rect, tFloat64 fDegreeStart, tFloat64 fDegreeEnd)=0
Fills a circle segment with current color.
virtual tVoid DrawCircle(tInt x1, tInt y1, tInt x2, tInt y2)=0
Draws a circle.
virtual IFont * CreateFont(const char *strName, tInt nHeight, IFont::tStyle eFontStyle=IFont::STYLE_Default)=0
Creates a new font instance.
virtual tVoid DrawPixel(IPoint *pt)=0
Draws a pixel.
virtual tVoid ResetFlags()=0
Restores the default settings of all flags.
virtual tVoid Texture(ITexture *pTexture)=0
Sets a texture on canvas.
virtual tVoid DrawPixel(tInt x, tInt y)=0
Draws a pixel at the given position.
virtual tVoid FillEllipse(tInt iOriginX, tInt iOriginY, tInt iWidth, tInt iHeight, tInt iAngle)=0
Fills a ellipse.
virtual tVoid Font(IFont *pFont)=0
‍**
virtual tVoid OutputText(tInt x, tInt y, const tChar *fmt,...)=0
‍**
virtual tVoid DrawPolygon(IPoint **ppPoints, tInt nCount)=0
Draws a polygon.
ADTF_IID(ICanvas, "canvas.adtf_disptb.iid")
Define an interface id for this class
virtual tVoid SetMapping(tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2)=0
Define a rectangle for the screen mapping.
virtual tVoid FillCircleSegment(tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2, tFloat64 fDegreeStart, tFloat64 fDegreeEnd, tBool bNormalizeRect=tFalse)=0
Fills a circle segment (see.
virtual tVoid DrawRect(tInt x1, tInt y1, tInt x2, tInt y2)=0
Draws a rectangle using two given corners.
virtual tResult PopFlags()=0
Restores the flags from the top the flag stack.
virtual tVoid DrawLine(tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2)=0
Draws a line between two given points.
virtual tVoid DrawEllipse(tFloat32 f32OriginX, tFloat32 f32OriginY, tFloat32 f32Width, tFloat32 f32Height, tFloat32 f32Angle)=0
Draws a ellipse.
virtual tVoid FillCircle(tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2)=0
Fills a circle with current color.
virtual tInt GetWidth() const =0
Returns the width of the canvas.
virtual tVoid DrawEllipse(tInt iOriginX, tInt iOriginY, tInt iWidth, tInt iHeight, tInt iAngle)=0
Draws a ellipse.
virtual tVoid FillPolygon(IPoint **ppPoints, tInt nCount)=0
Fills a polygon by the given point array.
virtual tVoid Blit(IImage *pImage, tInt x, tInt y, tInt nWidth, tInt nHeight)=0
Blits an Image on canvas.
virtual tInt MapPixelY(tFloat32 y)=0
Map y coordinate to screen region.
virtual tResult CreateTexture(IImage *pImage, ITexture *&pTexture)=0
Handy method to create a texture from an image.
virtual tVoid FillEllipse(tFloat32 f32OriginX, tFloat32 f32OriginY, tFloat32 f32Width, tFloat32 f32Height, tFloat32 f32Angle)=0
Fills a ellipse.
virtual tVoid DrawCircleSegment(IRect *rect, tFloat64 fDegreeStart, tFloat64 fDegreeEnd)=0
Draws a circle segment inside a given rectangle.
virtual tVoid ClearMapping()=0
clears the mapping
virtual tInt MapPixelX(tFloat32 x)=0
Map x coordinate to screen region.
virtual tResult PushFlags()=0
Stores the current set flags onto the flag stack.
virtual tVoid DrawCircleSegment(tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2, tFloat64 fDegreeStart, tFloat64 fDegreeEnd, tBool bNormalizeRect=tFalse)=0
Draws a circle segment (see.
virtual tVoid FillRect(tInt x1, tInt y1, tInt x2, tInt y2)=0
Fills a rectangle with the current color.
virtual IScene * BeginScene()=0
Starts a 3D Scene context within the canvas.
virtual tVoid EndScene()=0
Ends the 3D Scene context within the canvas.
virtual tVoid DrawRect(tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2)=0
Draws a rectangle.
virtual tVoid Capture(IImage **ppImage, tInt x, tInt y, tInt nWidth, tInt nHeight)=0
Captures the current canvas positions to an image.
virtual tVoid DrawCircle(IRect *rect)=0
Draws a circle inside a given rectangle.
virtual tVoid DrawRect(IRect *rect)=0
Draws a rectangle.
virtual tInt MapPixelY(tInt y)=0
Map y coordinate to screen region.
virtual tVoid DrawCircle(tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2)=0
Draws a circle.
virtual tVoid FillCircle(IRect *rect)=0
Fills a circle with current color.
virtual tVoid DrawCircleSegment(tInt x1, tInt y1, tInt x2, tInt y2, tFloat64 fDegreeStart, tFloat64 fDegreeEnd, tBool bNormalizeRect=tFalse)=0
Draws a circle segment (see.
virtual tInt GetBitsPerPixel() const =0
Returns the resolution of the canvas.
virtual tVoid DrawLine(tInt x1, tInt y1, tInt x2, tInt y2)=0
Draws a line between two given points.
virtual tInt GetHeight() const =0
Returns the height of the canvas.
virtual tFloat32 UnmapPixelY(tInt y)=0
Unmap y coordinate from screen region to global coordinates.
virtual tVoid FillRect(tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2)=0
Fills a rect with current color.
virtual tFloat64 GetFontAngle()=0
‍**
virtual tVoid DrawTexture(ITexture *pTexture, tFloat32 vPoints[8])=0
Draws a texture into a polygon which is described with 4 points.
virtual tInt MapPixelX(tInt x)=0
Map x coordinate to screen region.
virtual tVoid FillRect(IRect *rect)=0
Fills a rect with current color.
virtual tVoid SetFontAngle(tFloat64 fAngle)=0
Sets the font angle.
virtual tVoid SetFlag(tUInt32 nFlag, tInt32 nValue)=0
Sets a flag with value.
virtual ITexture * CreateTexture(const tBitmapFormat *psFormat, tInt nMode=0)=0
Creates a Texture in the given format.
Interface for color representation.
Definition: color_intf.h:27
Default Font handling interface for basic font support.
tStyle
The enumeration marks the style of the font.
@ STYLE_Antialiased
the font supports anti aliased.
virtual tResult Release()=0
Releases the font.
virtual ~IFont()
virtual destructor to ensure proper cleanup.
virtual tBool MeasureText(const tChar *str, tInt &nWidth, tInt &nHeight) const =0
The methods returns the measurement of the text in nWidth and nHeight.
virtual tInt GetHeight() const =0
This function returns the height of the font in point.
@ FULLSCREEN_MODE
The device is in full screen mode.
@ SUPPORT_ADTF25
this needs to be put into the flags to synchronize to avoid deadlocks with 2.5 adtf x system cBaseDis...
Graphics mode interface for common graphic support.
virtual tVoid BgColor(const IColor *col)=0
This function sets the current background color to col value.
virtual tVoid DisableBackFaceCulling() const =0
This function disables the back face culling.
virtual tVoid Coord(IPoint *pt)=0
Set the context to the given coordinates.
virtual tVoid Coord(tFloat32 x, tFloat32 y)=0
Set the context to the given coordinates.
virtual tVoid EnableDepthBuffer() const =0
This function enables the depth buffer if feature is supported.
virtual tVoid EnableAntialiasing() const =0
This function enables the anti aliasing if feature is supported.
virtual tVoid EnableAlpha(tBool bAdditiveMode=tFalse) const =0
This function enables the alpha graphics mode.
tFeature
This enumeration enables / disables or describes the features for the graphics mode.
virtual tVoid DisableAlpha() const =0
This function disables the alpha graphics mode.
virtual tVoid DisableLighting() const =0
This function disables the lighting.
virtual tVoid DisableAntialiasing() const =0
This function disables the anti aliasing.
virtual tVoid Coord(IPoint **ppPoints, tInt nCount)=0
Set the context to the coordinate list.
virtual tVoid BgColor(tFloat64 fRed, tFloat64 fGreen, tFloat64 fBlue, tFloat64 fAlpha=0.0)=0
This function sets the current background color to col value.
virtual tVoid Coord(tInt x, tInt y)=0
Set the context to the given coordinates.
virtual tVoid DisableDepthBuffer() const =0
This function disables the depth buffer.
virtual tVoid Color(const IColor *col)=0
This function sets the current color to col value.
virtual tVoid End()=0
Ends a device context.
virtual tVoid EnableBackFaceCulling() const =0
This function enables the back face culling if supported.
virtual ~IGraphicsMode()
virtual destructor to ensure proper cleanup.
tMode
enumeration for the supported modes.
virtual tVoid BgColor(tInt nRed, tInt nGreen, tInt nBlue, tInt nAlpha=0)=0
This function sets the current background color to col value.
virtual tVoid LinePattern(tUInt16 ui16Pattern, tInt nFactor=1)=0
This function adjusts the Line Style for all Lines in drawing operations.
virtual tVoid CoordTexture(tFloat32 u, tFloat32 v)=0
Set the context to the coordinate list.
virtual tVoid Color(tFloat64 fRed, tFloat64 fGreen, tFloat64 fBlue, tFloat64 fAlpha=1.0)=0
This function sets the current color.
virtual tVoid BgColor(tUInt8 nRed, tUInt8 nGreen, tUInt8 nBlue, tUInt8 nAlpha=0)=0
This function sets the current background color to col value.
virtual tVoid Color(tInt nRed, tInt nGreen, tInt nBlue, tInt nAlpha=255)=0
This function sets the current color.
virtual tBool IsSupported(tFeature nFeatureId) const =0
This function returns if the features shown in tFeature is supported.
virtual tVoid LineWidth(tFloat64 fWidth)=0
This function sets the current line width to the fWidth value.
virtual tVoid EnableLighting() const =0
This function enables the lighting if feature is supported.
virtual tVoid Begin(tMode eMode)=0
Start graphics command.
virtual tVoid Color(tUInt8 nRed, tUInt8 nGreen, tUInt8 nBlue, tUInt8 nAlpha=255)=0
This function sets the current color.
Image and bitmap handling.
Definition: image_intf.h:29
The interface for common texture handling.
virtual tInt GetPhysicalWidth() const =0
Gets the physical width of the texture (in byte).
virtual tResult Release()=0
The Function releases the Texture.
virtual tVoid MakeCurrent()=0
Sets this texture as the current texture.
virtual tInt GetWidth() const =0
Gets the width of a texture (in pixel).
virtual ~ITexture()
virtual destructor to ensure proper cleanup.
virtual tInt GetPhysicalHeight() const =0
Gets the physical height of the texture (in byte).
virtual tResult SetMode(tInt nMode)=0
Set the Mode shown in tTextureMode.
tTextureMode
The enumeration shows the texture modes.
virtual tResult Copy(IImage *pSource)=0
Fills the texture using a IImage.
virtual tInt GetBitsPerPixel() const =0
Gets the number of bits per line of a texture.
virtual tInt GetHeight() const =0
Gets the height of a texture (in pixel).
User interface event handler for all displays within the adtf.
tMouseState
The MouseStates for the tControlEventCode with Mouse.
virtual tResult OnDestroy()=0
Destroy display.
virtual tResult OnTimer(tHandle hCanvas)=0
On Gui timer callback.
virtual tResult OnSize(tHandle hCanvas, tInt nLeft, tInt nTop, tInt nRight, tInt nBottom)=0
On Resize display Event.
virtual tResult OnPaint(tHandle hCanvas, tInt nLeft, tInt nTop, tInt nRight, tInt nBottom)=0
On Redraw display event.
virtual tResult OnIconify(tHandle hCanvas, tBool bIconified)=0
On Change window iconic state Event.
tKey
These are the standard adtf_graphics keys.
virtual tResult OnIdle(tHandle hCanvas)=0
Gui idle callback.
tKeyState
The KeyStates for the tControlEventCode with Key.
virtual tResult OnControlEvent(tControlEventCode eCode, tInt nParam1=0, tInt nParam2=0, tInt nFlags=0, tVoid *pEventData=nullptr)=0
Control Event by Key or Mouse Events.
tControlEventCode
The Control Event Code Enumeration for the IUIEventHandler::OnControlEvent method.
@ EC_MouseRDown
right button down event nParam1 = x position of mouse event nParam2 = y position of mouse event ...
@ EC_MouseRDblClk
right button double click event nParam1 = x position of mouse event nParam2 = y position of mouse...
@ EC_MouseLDown
left button down event nParam1 = x position of mouse event nParam2 = y position of mouse event ...
@ EC_MouseWheel
mouse wheel event nParam1 = number of steps the wheel is rotated nParam2 = 0 nFlags = see tMous...
@ EC_MouseLDblClk
left button double click event nParam1 = x position of mouse event nParam2 = y position of mouse ...
@ EC_KeyInput
key input event nParam1 = see tKey nParam2 = see tKeyState
@ EC_MouseMove
mouse move event nParam1 = x position of mouse event nParam2 = y position of mouse event nFlags...
@ EC_MouseMDblClk
middle button double click event nParam1 = x position of mouse event nParam2 = y position of mous...
@ EC_MouseRUp
right button up event nParam1 = x position of mouse event nParam2 = y position of mouse event n...
@ EC_KeyUp
key up event nParam1 = see tKey nParam2 = see tKeyState
@ EC_MouseMDown
middle button down event nParam1 = x position of mouse event nParam2 = y position of mouse event ...
@ EC_MouseMUp
middle button up event nParam1 = x position of mouse event nParam2 = y position of mouse event ...
@ EC_MouseLUp
left button up event nParam1 = x position of mouse event nParam2 = y position of mouse event nF...
@ EC_KeyDown
key down event nParam1 = see tKey nParam2 = see tKeyState
virtual tResult OnCreate(tHandle hCanvas, tInt nLeft, tInt nTop, tInt nRight, tInt nBottom)=0
On Create display Event Call.
Copyright © Audi Electronics Venture GmbH.
tCanvasFlags
Servaral flags for ICanvas::SetFlag.
@ CANVAS_FLAG_TEXT_BASELINE_ON_TOP
Set the text baseline on top of the text (0: baseline is on button of a glyphe, 1: baseline is on top...
@ CANVAS_FLAG_TEXT_FLIP_HORIZONTALLY
Set the text direction with or opposed the x-axis direction (0: with the x-axis direction,...
@ CANVAS_FLAG_TEXT_ROTATE_WITH_COORDINATE_SYSTEM
Set the text to scale with the level of zoom.
@ CANVAS_FLAG_TEXT_SCALE_WITH_COORDINATE_SYSTEM
Set the text to scale with the coordinatesystem.
Copyright © Audi Electronics Venture GmbH.
Main namespace.
Copyright © Audi Electronics Venture GmbH.
Struct to specifie a bitmap.
Copyright © Audi Electronics Venture GmbH.