2 * Copyright 2005, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Axel Dörfler, axeld@pinc-software.de
12 #include <LinkReceiver.h>
13 #include <MessageQueue.h>
14 #include <Messenger.h>
23 virtual ~EventStream();
25 virtual bool IsValid() = 0;
26 virtual void SendQuit() = 0;
28 virtual bool SupportsCursorThread() const;
30 virtual void UpdateScreenBounds(BRect bounds
) = 0;
32 virtual bool GetNextEvent(BMessage
** _event
) = 0;
33 virtual status_t
GetNextCursorPosition(BPoint
& where
,
34 bigtime_t timeout
= B_INFINITE_TIMEOUT
);
36 virtual status_t
InsertEvent(BMessage
* event
) = 0;
38 virtual BMessage
* PeekLatestMouseMoved() = 0;
42 class InputServerStream
: public EventStream
{
44 InputServerStream(BMessenger
& inputServerMessenger
);
49 virtual ~InputServerStream();
51 virtual bool IsValid();
52 virtual void SendQuit();
54 virtual bool SupportsCursorThread() const { return fCursorSemaphore
>= B_OK
; }
56 virtual void UpdateScreenBounds(BRect bounds
);
58 virtual bool GetNextEvent(BMessage
** _event
);
59 virtual status_t
GetNextCursorPosition(BPoint
& where
,
60 bigtime_t timeout
= B_INFINITE_TIMEOUT
);
62 virtual status_t
InsertEvent(BMessage
* event
);
64 virtual BMessage
* PeekLatestMouseMoved();
67 status_t
_MessageFromPort(BMessage
** _message
,
68 bigtime_t timeout
= B_INFINITE_TIMEOUT
);
70 BMessenger fInputServer
;
71 BMessageQueue fEvents
;
74 sem_id fCursorSemaphore
;
76 shared_cursor
* fCursorBuffer
;
77 BMessage
* fLatestMouseMoved
;
80 #endif /* EVENT_STREAM_H */