2 Copyright 2007, Francois Revol. All Rights Reserved.
3 This file may be used under the terms of the Be Sample Code License.
5 #ifndef _PEN_INPUT_LOOPER_H
6 #define _PEN_INPUT_LOOPER_H
8 #include <MessageRunner.h>
12 /* internal messages */
14 #define MSG_METHOD_ACTIVATED 'IMAc'
15 #define MSGF_ACTIVE "active" /* bool */
17 #define MSG_BEGIN_INK 'InkB'
18 #define MSG_END_INK 'InkE'
20 #define MSG_SHOW_WIN 'ShoW'
21 #define MSG_HIDE_WIN 'HidW'
23 #define MSG_CHECK_PEN_DOWN 'ChkP'
27 #define MSG_SET_BACKEND 'SetB'
28 #define MSGF_BACKEND "backend" /* string */
30 #define MSG_SHOW_INK 'InkS' /* toggle */
35 class PenInputServerMethod
;
36 class PenInputInkWindow
;
37 class PenInputBackend
;
39 class PenInputLooper
: public BLooper
42 PenInputLooper(PenInputServerMethod
*method
);
44 void DispatchMessage(BMessage
*message
, BHandler
*handler
);
45 void MessageReceived(BMessage
*message
);
46 void EnqueueMessage(BMessage
*message
);
49 // virtual ~PenInputLooper();
50 void MethodActivated(bool active
);
53 friend class PenInputInkWindow
;
54 void HandleMethodActivated(bool active
);
55 PenInputServerMethod
*fOwner
;
56 PenInputInkWindow
*fInkWindow
;
57 PenInputBackend
*fBackend
;
59 BMessenger fInkWindowMsgr
;
62 BMessageRunner
*fThresholdRunner
;
63 BMessage
*fCachedMouseDown
;
66 bigtime_t fMouseDownThreshold
;
69 #endif /* _PEN_INPUT_LOOPER_H */