ADTF Display Toolbox
Loading...
Searching...
No Matches
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
16namespace adtf
17{
18
19namespace disptb
20{
21
22namespace graphicslib
23{
24
28#define COORDS_NONE 0x00
29
33#define COORDS_SCREEN 0x01
34
38#define COORDS_LOGICAL 0x02
39
40namespace dengar
41{
42
49{
50public:
52 enum
53 {
55 DEVICE_GDI = 0x0001,
57 DEVICE_QT = 0x0002,
59 DEVICE_SWT = 0x0004,
61 DEVICE_X11 = 0x0008,
63 DEVICE_SDL = 0x0010,
64 // ---------------------------------------------------------------------
72 };
73};
74
80class IFont
81{
82public:
93
94public:
98 virtual ~IFont()
99 {
100 }
101
106 virtual tResult Release() = 0;
107
113 virtual tInt GetHeight() const = 0;
114
123 virtual tBool MeasureText(const tChar* str, tInt& nWidth, tInt& nHeight) const = 0;
124};
125
132{
133public:
142
143public:
147 virtual ~ITexture()
148 {
149 }
150
156 virtual tResult Release() = 0;
157
165 virtual tResult SetMode(tInt nMode) = 0;
166
170 virtual tVoid MakeCurrent() = 0;
171
177 virtual tResult Copy(IImage* pSource) = 0;
178
184 virtual tInt GetWidth() const = 0;
185
191 virtual tInt GetHeight() const = 0;
192
198 virtual tInt GetBitsPerPixel() const = 0;
199
205 virtual tInt GetPhysicalWidth() const = 0;
206
212 virtual tInt GetPhysicalHeight() const = 0;
213};
214
221{
222public:
247
266
267public:
272 {
273 }
274
282 virtual tBool IsSupported(tFeature nFeatureId) const = 0;
283
295 virtual tVoid EnableAlpha(tBool bAdditiveMode = tFalse) const = 0;
296
302 virtual tVoid DisableAlpha() const = 0;
303
309 virtual tVoid EnableAntialiasing() const = 0;
310
316 virtual tVoid DisableAntialiasing() const = 0;
317
323 virtual tVoid EnableLighting() const = 0;
324
330 virtual tVoid DisableLighting() const = 0;
331
339 virtual tVoid EnableDepthBuffer() const = 0;
340
346 virtual tVoid DisableDepthBuffer() const = 0;
347
353 virtual tVoid EnableBackFaceCulling() const = 0;
354
360 virtual tVoid DisableBackFaceCulling() const = 0;
361
370 virtual tVoid LineWidth(tFloat64 fWidth) = 0;
371
387 virtual tVoid LinePattern(tUInt16 ui16Pattern, tInt nFactor = 1) = 0;
388
398 virtual tVoid Color(const IColor* col) = 0;
399
411 virtual tVoid Color(tInt nRed, tInt nGreen, tInt nBlue, tInt nAlpha = 255) = 0;
412
424 virtual tVoid Color(tUInt8 nRed, tUInt8 nGreen, tUInt8 nBlue, tUInt8 nAlpha = 255) = 0;
425
437 virtual tVoid Color(tFloat64 fRed, tFloat64 fGreen, tFloat64 fBlue, tFloat64 fAlpha = 1.0) = 0;
438
448 virtual tVoid BgColor(const IColor* col) = 0;
449
461 virtual tVoid BgColor(tInt nRed, tInt nGreen, tInt nBlue, tInt nAlpha = 0) = 0;
462
474 virtual tVoid BgColor(tUInt8 nRed, tUInt8 nGreen, tUInt8 nBlue, tUInt8 nAlpha = 0) = 0;
475
487 virtual tVoid BgColor(tFloat64 fRed, tFloat64 fGreen, tFloat64 fBlue, tFloat64 fAlpha = 0.0) = 0;
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
562class IScene;
563
570
571class ICanvas : public IGraphicsMode, public ucom::ant::IObject
572{
573public:
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
749 virtual tVoid DrawCircleSegment(tInt x1,
750 tInt y1,
751 tInt x2,
752 tInt y2,
753 tFloat64 fDegreeStart,
754 tFloat64 fDegreeEnd,
755 tBool bNormalizeRect = tFalse) = 0;
756
766 virtual tVoid FillRect(tInt x1, tInt y1, tInt x2, tInt y2) = 0;
767
778 virtual tVoid FillCircle(tInt x1, tInt y1, tInt x2, tInt y2) = 0;
779
796 virtual tVoid FillCircleSegment(tInt x1,
797 tInt y1,
798 tInt x2,
799 tInt y2,
800 tFloat64 fDegreeStart,
801 tFloat64 fDegreeEnd,
802 tBool bNormalizeRect = tFalse) = 0;
803
811 virtual tVoid DrawPixel(tFloat32 x, tFloat32 y) = 0;
812
822 virtual tVoid DrawLine(tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2) = 0;
823
834 virtual tVoid DrawRect(tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2) = 0;
835
846 virtual tVoid DrawCircle(tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2) = 0;
847
861 virtual tVoid DrawCircleSegment(tFloat32 x1,
862 tFloat32 y1,
863 tFloat32 x2,
864 tFloat32 y2,
865 tFloat64 fDegreeStart,
866 tFloat64 fDegreeEnd,
867 tBool bNormalizeRect = tFalse) = 0;
868
878 virtual tVoid FillRect(tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2) = 0;
879
889 virtual tVoid FillCircle(tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2) = 0;
890
907 virtual tVoid FillCircleSegment(tFloat32 x1,
908 tFloat32 y1,
909 tFloat32 x2,
910 tFloat32 y2,
911 tFloat64 fDegreeStart,
912 tFloat64 fDegreeEnd,
913 tBool bNormalizeRect = tFalse) = 0;
914
922 virtual tVoid DrawPixel(IPoint* pt) = 0;
923
932 virtual tVoid DrawLine(IPoint* ptStart, IPoint* ptEnd) = 0;
933
941 virtual tVoid DrawRect(IRect* rect) = 0;
942
950 virtual tVoid DrawPolygon(IPoint** ppPoints, tInt nCount) = 0;
951
959 virtual tVoid DrawCircle(IRect* rect) = 0;
960
970 virtual tVoid DrawCircleSegment(IRect* rect, tFloat64 fDegreeStart, tFloat64 fDegreeEnd) = 0;
971
978 virtual tVoid FillRect(IRect* rect) = 0;
979
987 virtual tVoid FillPolygon(IPoint** ppPoints, tInt nCount) = 0;
988
995 virtual tVoid FillCircle(IRect* rect) = 0;
996
1006 virtual tVoid FillCircleSegment(IRect* rect, tFloat64 fDegreeStart, tFloat64 fDegreeEnd) = 0;
1007
1027 virtual IFont* CreateFont(const char* strName, tInt nHeight, IFont::tStyle eFontStyle = IFont::STYLE_Default) = 0;
1028
1034 virtual tVoid SetFontAngle(tFloat64 fAngle) = 0;
1035
1037 // * Returns the font angle
1038 // * @return angle of the font
1039 // */
1040 virtual tFloat64 GetFontAngle() = 0;
1041
1043 // * Sets the current font for drawing operations
1044 // * @param [in] pFont Pointer to font instance
1045 // * @return void
1046 // */
1047 virtual tVoid Font(IFont* pFont) = 0;
1048
1050 // * Sets an text to a given position
1051 // * @param [in] x x position of the text
1052 // * @param [in] y y position of the text
1053 // * @param [in] fmt format string the format follows the printf specification
1054 // * @param [in] ... unspecified parameters described in the format string
1055 // * @return void
1056 // */
1057 virtual tVoid OutputText(tInt x, tInt y, const tChar* fmt, ...) = 0;
1058
1060 // * Sets an text to a given position
1061 // * @param [in] x x position of the text
1062 // * @param [in] y y position of the text
1063 // * @param [in] fmt format string the format follows the printf specification
1064 // * @param [in] ... unspecified parameters described in the format string
1065 // * @return void
1066 // */
1067 virtual tVoid OutputText(tFloat32 x, tFloat32 y, const tChar* fmt, ...) = 0;
1068
1076 virtual ITexture* CreateTexture(const tBitmapFormat* psFormat, tInt nMode = 0) = 0;
1077
1083 virtual tVoid Texture(ITexture* pTexture) = 0;
1084
1094 virtual tVoid Blit(ITexture* pTexture, tInt x, tInt y, tInt nWidth, tInt nHeight) = 0;
1095
1109 virtual tVoid Blit(IImage* pImage, tInt x, tInt y, tInt nWidth, tInt nHeight) = 0;
1110
1120 virtual tVoid Capture(IImage** ppImage, tInt x, tInt y, tInt nWidth, tInt nHeight) = 0;
1121
1128 virtual IScene* BeginScene() = 0;
1129
1135 virtual tVoid EndScene() = 0;
1136
1142 virtual tVoid SetFlag(tUInt32 nFlag, tInt32 nValue) = 0;
1143
1149 virtual tInt32 GetFlag(tUInt32 nFlag) = 0;
1150
1156 virtual tResult PushFlags() = 0;
1157
1163 virtual tResult PopFlags() = 0;
1164
1168 virtual tVoid ResetFlags() = 0;
1169
1180 virtual tVoid DrawEllipse(tInt iOriginX, tInt iOriginY, tInt iWidth, tInt iHeight, tInt iAngle) = 0;
1181
1192 virtual tVoid DrawEllipse(
1193 tFloat32 f32OriginX, tFloat32 f32OriginY, tFloat32 f32Width, tFloat32 f32Height, tFloat32 f32Angle) = 0;
1194
1205 virtual tVoid FillEllipse(tInt iOriginX, tInt iOriginY, tInt iWidth, tInt iHeight, tInt iAngle) = 0;
1206
1217 virtual tVoid FillEllipse(
1218 tFloat32 f32OriginX, tFloat32 f32OriginY, tFloat32 f32Width, tFloat32 f32Height, tFloat32 f32Angle) = 0;
1219};
1220
1227{
1228public:
1232 typedef enum
1233 {
1240
1247
1254
1261
1268
1275
1282
1289
1296
1303
1310
1316 // EC_KeyDown = adtf::IKeyEventHandler::EC_KeyDown,
1317
1323 // EC_KeyUp = adtf::IKeyEventHandler::EC_KeyUp,
1324
1330 // EC_KeyInput = adtf::IKeyEventHandler::EC_KeyInput
1331
1333
1337 typedef enum
1338 {
1339 MS_LeftButtonDown = 0x1,
1340 MS_RightButtonDown = 0x2,
1341 MS_MiddleButtonDown = 0x4,
1342 MS_CtrlKeyDown = 0x8
1343 } tMouseState;
1344
1348 typedef enum
1349 {
1350 KS_CtrlKeyDown = 0x1,
1351 KS_AltKeyDown = 0x2,
1352 KS_ShiftKeyDown = 0x4
1353 /*KS_CtrlKeyDown = adtf::IKeyEventHandler::KS_CtrlKeyDown,
1354 KS_AltKeyDown = adtf::IKeyEventHandler::KS_AltKeyDown,
1355 KS_ShiftKeyDown = adtf::IKeyEventHandler::KS_ShiftKeyDown*/
1356 } tKeyState;
1357
1363 typedef enum
1364 {
1366 KEY_ESCAPE = 0x01000000,
1368 KEY_TAB = 0x01000001,
1370 KEY_BACKSPACE = 0x01000003,
1372 KEY_RETURN = 0x01000004,
1374 KEY_INSERT = 0x01000006,
1376 KEY_DELETE = 0x01000007,
1378 KEY_PRINT = 0x01000009,
1380 KEY_HOME = 0x01000010,
1382 KEY_END = 0x01000011,
1384 KEY_LEFT = 0x01000012,
1386 KEY_UP = 0x01000013,
1388 KEY_RIGHT = 0x01000014,
1390 KEY_DOWN = 0x01000015,
1392 KEY_PAGEUP = 0x01000016,
1394 KEY_PAGEDOWN = 0x01000017,
1398 KEY_NUMLOCK = 0x01000025,
1399
1401 KEY_F1 = 0x01000030,
1403 KEY_F2 = 0x01000031,
1405 KEY_F3 = 0x01000032,
1407 KEY_F4 = 0x01000033,
1409 KEY_F5 = 0x01000034,
1411 KEY_F6 = 0x01000035,
1413 KEY_F7 = 0x01000036,
1415 KEY_F8 = 0x01000037,
1417 KEY_F9 = 0x01000038,
1419 KEY_F10 = 0x01000039,
1421 KEY_F11 = 0x0100003a,
1423 KEY_F12 = 0x0100003b,
1424
1426 KEY_PLUS = 0x2b,
1431 KEY_PERIOD = 0x2e,
1432
1433 KEY_0 = 0x30,
1434 KEY_1 = 0x31,
1435 KEY_2 = 0x32,
1436 KEY_3 = 0x33,
1437 KEY_4 = 0x34,
1438 KEY_5 = 0x35,
1439 KEY_6 = 0x36,
1440 KEY_7 = 0x37,
1441 KEY_8 = 0x38,
1442 KEY_9 = 0x39,
1443
1444 KEY_A = 0x41,
1445 KEY_B = 0x42,
1446 KEY_C = 0x43,
1447 KEY_D = 0x44,
1448 KEY_E = 0x45,
1449 KEY_F = 0x46,
1450 KEY_G = 0x47,
1451 KEY_H = 0x48,
1452 KEY_I = 0x49,
1453 KEY_J = 0x4a,
1454 KEY_K = 0x4b,
1455 KEY_L = 0x4c,
1456 KEY_M = 0x4d,
1457 KEY_N = 0x4e,
1458 KEY_O = 0x4f,
1459 KEY_P = 0x50,
1460 KEY_Q = 0x51,
1461 KEY_R = 0x52,
1462 KEY_S = 0x53,
1463 KEY_T = 0x54,
1464 KEY_U = 0x55,
1465 KEY_V = 0x56,
1466 KEY_W = 0x57,
1467 KEY_X = 0x58,
1468 KEY_Y = 0x59,
1469 KEY_Z = 0x5a,
1470
1471 KEY_SHIFT = 0x01000020,
1472 KEY_CTRL = 0x01000021,
1473 KEY_ALT = 0x01000023
1474
1475 /*///the escape key.
1476 KEY_ESCAPE = adtf::IKeyEventHandler::KEY_ESCAPE,
1478 KEY_TAB = adtf::IKeyEventHandler::KEY_TAB,
1480 KEY_BACKSPACE = adtf::IKeyEventHandler::KEY_BACKSPACE,
1482 KEY_RETURN = adtf::IKeyEventHandler::KEY_RETURN,
1484 KEY_INSERT = adtf::IKeyEventHandler::KEY_INSERT,
1486 KEY_DELETE = adtf::IKeyEventHandler::KEY_DELETE,
1488 KEY_PRINT = adtf::IKeyEventHandler::KEY_PRINT,
1490 KEY_HOME = adtf::IKeyEventHandler::KEY_HOME,
1492 KEY_END = adtf::IKeyEventHandler::KEY_END,
1494 KEY_LEFT = adtf::IKeyEventHandler::KEY_LEFT,
1496 KEY_UP = adtf::IKeyEventHandler::KEY_UP,
1498 KEY_RIGHT = adtf::IKeyEventHandler::KEY_RIGHT,
1500 KEY_DOWN = adtf::IKeyEventHandler::KEY_DOWN,
1502 KEY_PAGEUP = adtf::IKeyEventHandler::KEY_PAGEUP,
1504 KEY_PAGEDOWN = adtf::IKeyEventHandler::KEY_PAGEDOWN,
1506 KEY_SPACE = adtf::IKeyEventHandler::KEY_SPACE,
1508 KEY_NUMLOCK = adtf::IKeyEventHandler::KEY_NUMLOCK,
1509
1511 KEY_F1 = adtf::IKeyEventHandler::KEY_F1,
1513 KEY_F2 = adtf::IKeyEventHandler::KEY_F2,
1515 KEY_F3 = adtf::IKeyEventHandler::KEY_F3,
1517 KEY_F4 = adtf::IKeyEventHandler::KEY_F4,
1519 KEY_F5 = adtf::IKeyEventHandler::KEY_F5,
1521 KEY_F6 = adtf::IKeyEventHandler::KEY_F6,
1523 KEY_F7 = adtf::IKeyEventHandler::KEY_F7,
1525 KEY_F8 = adtf::IKeyEventHandler::KEY_F8,
1527 KEY_F9 = adtf::IKeyEventHandler::KEY_F9,
1529 KEY_F10 = adtf::IKeyEventHandler::KEY_F10,
1531 KEY_F11 = adtf::IKeyEventHandler::KEY_F11,
1533 KEY_F12 = adtf::IKeyEventHandler::KEY_F12,
1534
1536 KEY_PLUS = adtf::IKeyEventHandler::KEY_PLUS,
1538 KEY_COMMA = adtf::IKeyEventHandler::KEY_COMMA,
1540 KEY_MINUS = adtf::IKeyEventHandler::KEY_MINUS,
1541 KEY_PERIOD = adtf::IKeyEventHandler::KEY_PERIOD,
1542
1543 KEY_0 = adtf::IKeyEventHandler::KEY_0,
1544 KEY_1 = adtf::IKeyEventHandler::KEY_1,
1545 KEY_2 = adtf::IKeyEventHandler::KEY_2,
1546 KEY_3 = adtf::IKeyEventHandler::KEY_3,
1547 KEY_4 = adtf::IKeyEventHandler::KEY_4,
1548 KEY_5 = adtf::IKeyEventHandler::KEY_5,
1549 KEY_6 = adtf::IKeyEventHandler::KEY_6,
1550 KEY_7 = adtf::IKeyEventHandler::KEY_7,
1551 KEY_8 = adtf::IKeyEventHandler::KEY_8,
1552 KEY_9 = adtf::IKeyEventHandler::KEY_9,
1553
1554 KEY_A = adtf::IKeyEventHandler::KEY_A,
1555 KEY_B = adtf::IKeyEventHandler::KEY_B,
1556 KEY_C = adtf::IKeyEventHandler::KEY_C,
1557 KEY_D = adtf::IKeyEventHandler::KEY_D,
1558 KEY_E = adtf::IKeyEventHandler::KEY_E,
1559 KEY_F = adtf::IKeyEventHandler::KEY_F,
1560 KEY_G = adtf::IKeyEventHandler::KEY_G,
1561 KEY_H = adtf::IKeyEventHandler::KEY_H,
1562 KEY_I = adtf::IKeyEventHandler::KEY_I,
1563 KEY_J = adtf::IKeyEventHandler::KEY_J,
1564 KEY_K = adtf::IKeyEventHandler::KEY_K,
1565 KEY_L = adtf::IKeyEventHandler::KEY_L,
1566 KEY_M = adtf::IKeyEventHandler::KEY_M,
1567 KEY_N = adtf::IKeyEventHandler::KEY_N,
1568 KEY_O = adtf::IKeyEventHandler::KEY_O,
1569 KEY_P = adtf::IKeyEventHandler::KEY_P,
1570 KEY_Q = adtf::IKeyEventHandler::KEY_Q,
1571 KEY_R = adtf::IKeyEventHandler::KEY_R,
1572 KEY_S = adtf::IKeyEventHandler::KEY_S,
1573 KEY_T = adtf::IKeyEventHandler::KEY_T,
1574 KEY_U = adtf::IKeyEventHandler::KEY_U,
1575 KEY_V = adtf::IKeyEventHandler::KEY_V,
1576 KEY_W = adtf::IKeyEventHandler::KEY_W,
1577 KEY_X = adtf::IKeyEventHandler::KEY_X,
1578 KEY_Y = adtf::IKeyEventHandler::KEY_Y,
1579 KEY_Z = adtf::IKeyEventHandler::KEY_Z,
1580
1581 KEY_SHIFT = adtf::IKeyEventHandler::KEY_SHIFT,
1582 KEY_CTRL = adtf::IKeyEventHandler::KEY_CTRL,
1583 KEY_ALT = adtf::IKeyEventHandler::KEY_ALT*/
1584 } tKey;
1585
1586public:
1607 virtual tResult OnCreate(tHandle hCanvas, tInt nLeft, tInt nTop, tInt nRight, tInt nBottom) = 0;
1608
1629 virtual tResult OnPaint(tHandle hCanvas, tInt nLeft, tInt nTop, tInt nRight, tInt nBottom) = 0;
1630
1651 virtual tResult OnSize(tHandle hCanvas, tInt nLeft, tInt nTop, tInt nRight, tInt nBottom) = 0;
1652
1666 virtual tResult OnIconify(tHandle hCanvas, tBool bIconified) = 0;
1667
1681 virtual tResult OnTimer(tHandle hCanvas) = 0;
1682
1699 virtual tResult OnIdle(tHandle hCanvas) = 0;
1700
1709 virtual tResult OnDestroy() = 0;
1710
1721 virtual tResult OnControlEvent(
1722 tControlEventCode eCode, tInt nParam1 = 0, tInt nParam2 = 0, tInt nFlags = 0, tVoid* pEventData = nullptr) = 0;
1723};
1724
1726#define ADTF_VIEWPORT_INTERNAL_CLASS "class"
1728#define ADTF_VIEWPORT_INTERNAL_TITLEWINDOW "titlewindow"
1730#define ADTF_VIEWPORT_INTERNAL_PARENT_SETTER "parentset"
1731
1732} // namespace dengar
1759
1760using dengar::IGraphicsFlags;
1761using dengar::IFont;
1762using dengar::ITexture;
1763using dengar::ITexture;
1764using dengar::IGraphicsMode;
1765using dengar::IScene;
1766using dengar::ICanvas;
1767using dengar::IUIEventHandler;
1768
1769} // namespace graphicslib
1770
1771} // namespace disptb
1772
1773} // namespace adtf
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
Sets an text to a given position.
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 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
Sets the current font for drawing operations.
virtual tVoid OutputText(tInt x, tInt y, const tChar *fmt,...)=0
Sets an text to a given position.
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 IFont * CreateFont(const char *strName, tInt nHeight, IFont::tStyle eFontStyle=IFont::STYLE_Default)=0
Creates a new font instance.
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 ITexture * CreateTexture(const tBitmapFormat *psFormat, tInt nMode=0)=0
Creates a Texture in the given format.
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
Returns the font angle.
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.
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.
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 OnControlEvent method.
@ EC_MouseMDblClk
middle button double click event
virtual tResult OnCreate(tHandle hCanvas, tInt nLeft, tInt nTop, tInt nRight, tInt nBottom)=0
On Create display Event Call.
Copyright © Audi Electronics Venture GmbH.
@ 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.
Namespace for functionality provided by the Display Toolbox.
Main namespace.
Copyright © Audi Electronics Venture GmbH.
Struct to specifie a bitmap.
Copyright © Audi Electronics Venture GmbH.