22 #ifndef ULTIMA_SHARED_ENGINE_MESSAGES_H 23 #define ULTIMA_SHARED_ENGINE_MESSAGES_H 25 #include "common/keyboard.h" 26 #include "common/events.h" 27 #include "ultima/shared/core/rect.h" 28 #include "ultima/shared/core/base_object.h" 29 #include "ultima/shared/core/tree_item.h" 36 MSGFLAG_BREAK_IF_HANDLED = 2,
47 #define MESSAGEDEF(theClass) \ 48 static ClassDef type() { return ClassDef(#theClass, &CMessage::type); } \ 49 virtual ClassDef getType() const { return type(); } 50 #define MESSAGEDEFP(theClass, baseClass) \ 51 static ClassDef type() { return ClassDef(#theClass, &baseClass::type); } \ 52 virtual ClassDef getType() const { return type(); } 54 #define MESSAGE0(NAME) \ 55 class NAME: public CMessage { \ 56 public: NAME() : CMessage() {} \ 59 #define MESSAGE1(NAME, F1, N1, V1) \ 60 class NAME: public CMessage { \ 62 NAME(F1 N1 = V1) : CMessage(), _##N1(N1) {} \ 65 #define MESSAGE2(NAME, F1, N1, V1, F2, N2, V2) \ 66 class NAME: public CMessage { \ 67 public: F1 _##N1; F2 _##N2; \ 68 NAME(F1 N1 = V1, F2 N2 = V2) : CMessage(), _##N1(N1), _##N2(N2) {} \ 71 #define MESSAGE3(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3) \ 72 class NAME: public CMessage { \ 73 public: F1 _##N1; F2 _##N2; F3 _##N3; \ 74 NAME(F1 N1 = V1, F2 N2 = V2, F3 N3 = V3) : CMessage(), _##N1(N1), _##N2(N2), _##N3(N3) {} \ 77 #define MESSAGE4(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3, F4, N4, V4) \ 78 class NAME: public CMessage { \ 79 public: F1 _##N1; F2 _##N2; F3 _##N3; F4 _##N4; \ 80 NAME(F1 N1 = V1, F2 N2 = V2, F3 N3 = V3, F4 N4 = V4) : CMessage(), _##N1(N1), _##N2(N2), _##N3(N3), _##N4(N4) {} \ 102 int flags = MSGFLAG_SCAN | MSGFLAG_BREAK_IF_HANDLED);
109 int flags = MSGFLAG_SCAN | MSGFLAG_BREAK_IF_HANDLED);
114 virtual bool perform(
TreeItem *treeItem);
121 virtual bool isMouseMsg()
const;
122 virtual bool isButtonDownMsg()
const;
123 virtual bool isButtonUpMsg()
const;
124 virtual bool isMouseMoveMsg()
const;
125 virtual bool isDoubleClickMsg()
const;
130 MB_LEFT = 1, MB_MIDDLE = 2, MB_RIGHT = 4
145 _mousePos(pt), _buttons(buttons) {}
Definition: messages.h:302
Definition: messages.h:265
Definition: messages.h:87
Definition: messages.h:250
Definition: messages.h:260
Definition: messages.h:225
Definition: messages.h:255
Definition: messages.h:397
Definition: messages.h:297
Definition: tree_item.h:50
Definition: messages.h:357
Definition: messages.h:377
Definition: messages.h:382
Definition: messages.h:162
Definition: visual_item.h:39
Definition: message_target.h:35
Definition: messages.h:332
Definition: messages.h:152
Definition: detection.h:27
Definition: messages.h:392
Definition: messages.h:402
Definition: messages.h:215
Definition: messages.h:342
Definition: messages.h:327
Definition: messages.h:202
Definition: messages.h:317
Definition: messages.h:347
Definition: messages.h:322
Definition: messages.h:387
Definition: messages.h:280
Definition: messages.h:240
Definition: messages.h:307
Definition: messages.h:235
Definition: messages.h:372
Definition: messages.h:367
Definition: messages.h:362
Definition: messages.h:285
Definition: keyboard.h:294
Definition: messages.h:312
Definition: base_object.h:43
Definition: messages.h:337
Definition: messages.h:136
Definition: base_object.h:71
Definition: messages.h:230