1 #ifndef RT_AnnotationDefines_H_
2 #define RT_AnnotationDefines_H_
8 #ifndef LOG_FONT_FACE_NAME_SIZE
9 #define LOG_FONT_FACE_NAME_SIZE 32
12 #ifndef DEFAULT_LINE_WIDTH
13 #define DEFAULT_LINE_WIDTH 1
15 #ifndef DEFAULT_LINE_COLOR
16 #define DEFAULT_LINE_COLOR 0xFF000000
18 #ifndef DEFAULT_BGROUNG_COLOR
19 #define DEFAULT_BGROUNG_COLOR 0xFF0000FF
21 #ifndef DEFAULT_FILL_COLOR
22 #define DEFAULT_FILL_COLOR 0xFF000000
42 static bool CalculateCheckMarkPoints(
Point& pt1,
Point& pt2,
Point aPoints[]) {
44 aPoints[0].
y = pt1.
y + (pt2.
y - pt1.
y)*2.0 / 3.0;
45 aPoints[1].
x = (pt1.
x + pt2.
x) / 2;
51 using tee3::avd::WindowId;
52 using tee3::avd::DesktopId;
119 static uint32 AllSupportedTools() {
140 template<
class ItemType,
int GrowSize>
166 bool Add(ItemType item,
bool bCheckDuplicate =
false) {
168 if (bCheckDuplicate &&
GetIndex(item) >= 0)
202 if (i < m_usedSize) {
204 if (i < m_usedSize - 1)
206 sizeof(ItemType)*(m_usedSize - i - 1));
256 bool SetAt(
int nIndex, ItemType item) {
282 bool Compare(ItemType* item1, ItemType* item2) {
283 if (memcmp(item1, item2,
sizeof(ItemType)) == 0)
291 ItemType* ppNew =
new ItemType[
m_allocSize + GrowSize];
311 template<
class ItemType,
int GrowSize>
337 bool Add(ItemType item,
bool bCheckDuplicate =
false) {
339 if (bCheckDuplicate &&
GetIndex(item) >= 0)
348 bool InsertAt(
int nIndex, ItemType item,
bool bCheckDuplicate =
false) {
349 if (bCheckDuplicate &&
GetIndex(item) >= 0)
352 if (nIndex >= 0 && nIndex <=
m_nUsed) {
358 sizeof(ItemType)*(
m_nUsed - nIndex));
370 for (i = 0; i <
m_nUsed; i++) {
380 sizeof(ItemType)*(m_nUsed - i - 1));
392 sizeof(ItemType)*(
m_nUsed - i - 1));
422 ItemType retVal = NULL;
431 bool SetAt(
int nIndex, ItemType item) {
432 if (nIndex >= 0 && nIndex <
m_nUsed) {
442 switch (
sizeof(ItemType)) {
445 int dwItem = (int)item;
446 for (
int i = 0; i <
m_nUsed; i++) {
454 short wItem = (short)item;
455 for (
int i = 0; i <
m_nUsed; i++) {
463 char cbItem = (char)item;
464 for (
int i = 0; i <
m_nUsed; i++) {
471 for (
int i = 0; i <
m_nUsed; i++) {
486 bool Compare(ItemType* item1, ItemType* item2) {
487 if (memcmp(item1, item2,
sizeof(ItemType)) == 0)
495 ItemType* ppNew =
new ItemType[
m_nAlloc + GrowSize];
497 memset(ppNew, 0, (
m_nAlloc + GrowSize)*
sizeof(ItemType));
517 template <
class ItemType>
543 ItemType* pNewHead =
new ItemType[nSize];
545 memset(pNewHead, 0,
sizeof(ItemType)*nSize);
570 #endif //RT_AnnotationDefines_H_
ItemType * m_head
Definition: annotationdefines.h:307
bool Compare(ItemType *item1, ItemType *item2)
Definition: annotationdefines.h:282
virtual void setFillColor(const Color &color)
Definition: annotationdefines.h:67
char lfOutPrecision
Definition: annotationdefines.h:35
int lineWidth() const
Definition: annotationdefines.h:73
char lfUnderline
Definition: annotationdefines.h:32
bool Expand()
Definition: annotationdefines.h:493
bool SetAt(int nIndex, ItemType item)
Definition: annotationdefines.h:431
EMArrayBaseT(const EMArrayBaseT &other)
Definition: annotationdefines.h:320
char lfCharSet
Definition: annotationdefines.h:34
Definition: annotationbasedefines.h:23
virtual void setDisplayWindowId(const WindowId &id)
Definition: annotationdefines.h:64
virtual ~EMArrayBaseT2()
Definition: annotationdefines.h:157
bool Add(ItemType item, bool bCheckDuplicate=false)
Definition: annotationdefines.h:337
int displayWidth() const
Definition: annotationdefines.h:74
EMDynamicBuffer(uint32 nSize=1024)
Definition: annotationdefines.h:520
int x
Definition: annotationbasedefines.h:12
static WindowId Cast(uint64 id)
Definition: common.h:412
WindowId drawWindowId() const
Definition: annotationdefines.h:88
~EMDynamicBuffer()
Definition: annotationdefines.h:526
EMArrayBaseT2(const EMArrayBaseT2 &other)
Definition: annotationdefines.h:149
bool Expand()
Definition: annotationdefines.h:289
Rect displayRect() const
Definition: annotationdefines.h:91
#define LOG_FONT_FACE_NAME_SIZE
Definition: annotationdefines.h:9
virtual void setDrawWindowId(const WindowId &id)
Definition: annotationdefines.h:63
Definition: annotationdefines.h:312
Definition: annotationdefines.h:55
Rect annotationRect() const
Definition: annotationdefines.h:92
int GetSize()
Definition: annotationdefines.h:537
LineArrowType line_arrow_
Definition: annotationdefines.h:107
ItemType * GetHead()
Definition: annotationdefines.h:560
int height() const
Definition: annotationbasedefines.h:32
virtual void setZoomMode(bool isZoom)
Definition: annotationdefines.h:71
ItemType * m_ppHead
Definition: annotationdefines.h:513
bool RemoveAt(int i)
Definition: annotationdefines.h:214
EMArrayBaseT & operator=(const EMArrayBaseT &other)
Definition: annotationdefines.h:407
int GetCount()
Definition: annotationdefines.h:333
int m_usedSize
Definition: annotationdefines.h:309
Color lineColor() const
Definition: annotationdefines.h:89
Color fillColor() const
Definition: annotationdefines.h:90
int m_allocSize
Definition: annotationdefines.h:308
Rect annotation_rect_
Definition: annotationdefines.h:115
void clear()
Definition: annotationdefines.h:94
uint32 m_nSize
Definition: annotationdefines.h:567
ItemType * m_pHead
Definition: annotationdefines.h:566
unsigned int uint32
Definition: defines.h:393
int width() const
Definition: annotationbasedefines.h:31
bool InsertAt(int nIndex, ItemType item, bool bCheckDuplicate=false)
Definition: annotationdefines.h:348
char lfFaceName[LOG_FONT_FACE_NAME_SIZE]
Definition: annotationdefines.h:39
int GetCount()
Definition: annotationdefines.h:162
char lfQuality
Definition: annotationdefines.h:37
#define DEFAULT_LINE_WIDTH
Definition: annotationdefines.h:13
AVDContext()
Definition: annotationdefines.h:57
void Reset()
Definition: annotationdefines.h:530
char lfPitchAndFamily
Definition: annotationdefines.h:38
#define DEFAULT_LINE_COLOR
Definition: annotationdefines.h:16
virtual void setLineWidth(int width)
Definition: annotationdefines.h:65
bool RemoveAt(int i)
Definition: annotationdefines.h:388
bool SetAt(int nIndex, ItemType item)
Definition: annotationdefines.h:256
ItemType * GetHead()
Definition: annotationdefines.h:481
bool Remove(ItemType item)
Definition: annotationdefines.h:194
char lfItalic
Definition: annotationdefines.h:31
virtual void setDisplayRect(const Rect &rc)
Definition: annotationdefines.h:69
EMArrayBaseT()
Definition: annotationdefines.h:314
void RemoveAll()
Definition: annotationdefines.h:399
ItemType * GetHead()
Definition: annotationdefines.h:277
int line_width_
Definition: annotationdefines.h:108
int m_nUsed
Definition: annotationdefines.h:515
WindowId display_window_id_
Definition: annotationdefines.h:110
char lfStrikeOut
Definition: annotationdefines.h:33
EMArrayBaseT2()
Definition: annotationdefines.h:143
#define RT_ASSERTE(expr)
Definition: defines.h:242
bool Add(ItemType item, bool bCheckDuplicate=false)
Definition: annotationdefines.h:166
Definition: annotationbasedefines.h:41
int GetIndex(ItemType item)
Definition: annotationdefines.h:268
bool InsertAt(int nIndex, ItemType item)
Definition: annotationdefines.h:177
Definition: annotationbasedefines.h:7
virtual void setAnnotationRect(const Rect &rc)
Definition: annotationdefines.h:70
virtual void setLineColor(const Color &color)
Definition: annotationdefines.h:66
struct rtcimp::tagRect Rect
long lfWidth
Definition: annotationdefines.h:27
long lfWeight
Definition: annotationdefines.h:30
Definition: annotationdefines.h:141
char lfClipPrecision
Definition: annotationdefines.h:36
virtual ~EMArrayBaseT()
Definition: annotationdefines.h:328
ItemType operator[](int i)
Definition: annotationdefines.h:421
LineArrowType lineArrow() const
Definition: annotationdefines.h:72
LineArrowType
Definition: common.h:499
bool Remove(ItemType item)
Definition: annotationdefines.h:368
Definition: annotationdefines.h:518
virtual void setLineArrow(const LineArrowType &arrow)
Definition: annotationdefines.h:68
long lfHeight
Definition: annotationdefines.h:26
int y
Definition: annotationbasedefines.h:13
bool Compare(ItemType *item1, ItemType *item2)
Definition: annotationdefines.h:486
bool zoom_
Definition: annotationdefines.h:116
WindowId dispayWindowId() const
Definition: annotationdefines.h:87
Rect display_rect_
Definition: annotationdefines.h:114
#define DEFAULT_FILL_COLOR
Definition: annotationdefines.h:22
int GetIndex(ItemType item)
Definition: annotationdefines.h:441
bool SetSize(uint32 nSize)
Definition: annotationdefines.h:541
long lfEscapement
Definition: annotationdefines.h:28
Color line_color_
Definition: annotationdefines.h:112
WindowId draw_window_id_
Definition: annotationdefines.h:111
Definition: annotationbasedefines.h:11
Color fill_color_
Definition: annotationdefines.h:113
struct rtcimp::tagLOGFONTA LogFont
ItemType operator[](int i)
Definition: annotationdefines.h:247
bool zoomMode() const
Definition: annotationdefines.h:93
long lfOrientation
Definition: annotationdefines.h:29
EMArrayBaseT2 & operator=(const EMArrayBaseT2 &other)
Definition: annotationdefines.h:233
int m_nAlloc
Definition: annotationdefines.h:514
void RemoveAll()
Definition: annotationdefines.h:225
Definition: annotationdefines.h:25