3rdparty/licenseReport: Add seperate LGPL checks
[haiku.git] / src / add-ons / input_server / methods / pen / PenInputLooper.h
blob891222fc674c7939474a2c1a65ab3a637f19e58b
1 /*
2 Copyright 2007, Francois Revol. All Rights Reserved.
3 This file may be used under the terms of the Be Sample Code License.
4 */
5 #ifndef _PEN_INPUT_LOOPER_H
6 #define _PEN_INPUT_LOOPER_H
8 #include <MessageRunner.h>
9 #include <Messenger.h>
10 #include <Looper.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'
25 /* menu messages */
27 #define MSG_SET_BACKEND 'SetB'
28 #define MSGF_BACKEND "backend" /* string */
30 #define MSG_SHOW_INK 'InkS' /* toggle */
33 class BMenu;
34 class BWindow;
35 class PenInputServerMethod;
36 class PenInputInkWindow;
37 class PenInputBackend;
39 class PenInputLooper : public BLooper
41 public:
42 PenInputLooper(PenInputServerMethod *method);
43 virtual void Quit();
44 void DispatchMessage(BMessage *message, BHandler *handler);
45 void MessageReceived(BMessage *message);
46 void EnqueueMessage(BMessage *message);
47 status_t InitCheck();
49 // virtual ~PenInputLooper();
50 void MethodActivated(bool active);
52 private:
53 friend class PenInputInkWindow;
54 void HandleMethodActivated(bool active);
55 PenInputServerMethod *fOwner;
56 PenInputInkWindow *fInkWindow;
57 PenInputBackend *fBackend;
58 BMenu *fDeskbarMenu;
59 BMessenger fInkWindowMsgr;
60 bool fMouseDown;
61 bool fStroking;
62 BMessageRunner *fThresholdRunner;
63 BMessage *fCachedMouseDown;
64 /* config */
65 bool fShowInk;
66 bigtime_t fMouseDownThreshold;
69 #endif /* _PEN_INPUT_LOOPER_H */