2005-11-17 17:58:19 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2005, Haiku, Inc. All Rights Reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Axel Dörfler, axeld@pinc-software.de
|
|
|
|
*/
|
|
|
|
#ifndef EVENT_STREAM_H
|
|
|
|
#define EVENT_STREAM_H
|
|
|
|
|
|
|
|
|
* the new input event dispatcher is now actually used, although it doesn't
distribute any messages to the clients yet.
* removed the working thread from RootLayer - for now, its event handlers are
still called using input filters in the new event dispatcher, though (to
get things started).
* ServerApp is now using a BMessenger to identify its client, and no longer
stores the port/token separately.
* the input_server handshake is a bit simpler now, as it can now just reply
to the app_server message, removed unused code from ServerProtocol.h
* calmed down the MultiLocker (it always printed thread statistics on startup,
because it's compiled in debug mode).
* removed the cursor thread stuff from AppServer.cpp
* the new event dispatcher now uses a cursor thread when supported (only in
native mode, not in the test environment), although it improves cursor
movement under Qemu, the effect is not as good as expected - this might
need some more investigations (might just be a thread priority problem).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15012 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-18 14:30:06 +03:00
|
|
|
#include <LinkReceiver.h>
|
2005-11-17 17:58:19 +03:00
|
|
|
#include <MessageQueue.h>
|
2005-11-20 19:03:11 +03:00
|
|
|
#include <Messenger.h>
|
|
|
|
|
2005-11-17 17:58:19 +03:00
|
|
|
|
|
|
|
struct shared_cursor;
|
|
|
|
|
|
|
|
|
|
|
|
class EventStream {
|
|
|
|
public:
|
|
|
|
EventStream();
|
|
|
|
virtual ~EventStream();
|
|
|
|
|
|
|
|
virtual bool IsValid() = 0;
|
|
|
|
virtual void SendQuit() = 0;
|
|
|
|
|
|
|
|
virtual bool SupportsCursorThread() const;
|
|
|
|
|
2005-11-26 19:22:06 +03:00
|
|
|
virtual void UpdateScreenBounds(BRect bounds) = 0;
|
|
|
|
|
2005-11-17 17:58:19 +03:00
|
|
|
virtual bool GetNextEvent(BMessage** _event) = 0;
|
* the new input event dispatcher is now actually used, although it doesn't
distribute any messages to the clients yet.
* removed the working thread from RootLayer - for now, its event handlers are
still called using input filters in the new event dispatcher, though (to
get things started).
* ServerApp is now using a BMessenger to identify its client, and no longer
stores the port/token separately.
* the input_server handshake is a bit simpler now, as it can now just reply
to the app_server message, removed unused code from ServerProtocol.h
* calmed down the MultiLocker (it always printed thread statistics on startup,
because it's compiled in debug mode).
* removed the cursor thread stuff from AppServer.cpp
* the new event dispatcher now uses a cursor thread when supported (only in
native mode, not in the test environment), although it improves cursor
movement under Qemu, the effect is not as good as expected - this might
need some more investigations (might just be a thread priority problem).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15012 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-18 14:30:06 +03:00
|
|
|
virtual bool GetNextCursorPosition(BPoint& where);
|
2006-01-11 15:25:06 +03:00
|
|
|
|
|
|
|
virtual BMessage* PeekLatestMouseMoved() = 0;
|
2005-11-17 17:58:19 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
* the new input event dispatcher is now actually used, although it doesn't
distribute any messages to the clients yet.
* removed the working thread from RootLayer - for now, its event handlers are
still called using input filters in the new event dispatcher, though (to
get things started).
* ServerApp is now using a BMessenger to identify its client, and no longer
stores the port/token separately.
* the input_server handshake is a bit simpler now, as it can now just reply
to the app_server message, removed unused code from ServerProtocol.h
* calmed down the MultiLocker (it always printed thread statistics on startup,
because it's compiled in debug mode).
* removed the cursor thread stuff from AppServer.cpp
* the new event dispatcher now uses a cursor thread when supported (only in
native mode, not in the test environment), although it improves cursor
movement under Qemu, the effect is not as good as expected - this might
need some more investigations (might just be a thread priority problem).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15012 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-18 14:30:06 +03:00
|
|
|
class InputServerStream : public EventStream {
|
2005-11-17 17:58:19 +03:00
|
|
|
public:
|
* the new input event dispatcher is now actually used, although it doesn't
distribute any messages to the clients yet.
* removed the working thread from RootLayer - for now, its event handlers are
still called using input filters in the new event dispatcher, though (to
get things started).
* ServerApp is now using a BMessenger to identify its client, and no longer
stores the port/token separately.
* the input_server handshake is a bit simpler now, as it can now just reply
to the app_server message, removed unused code from ServerProtocol.h
* calmed down the MultiLocker (it always printed thread statistics on startup,
because it's compiled in debug mode).
* removed the cursor thread stuff from AppServer.cpp
* the new event dispatcher now uses a cursor thread when supported (only in
native mode, not in the test environment), although it improves cursor
movement under Qemu, the effect is not as good as expected - this might
need some more investigations (might just be a thread priority problem).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15012 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-18 14:30:06 +03:00
|
|
|
InputServerStream(BMessenger& inputServerMessenger);
|
|
|
|
#if TEST_MODE
|
|
|
|
InputServerStream();
|
|
|
|
#endif
|
|
|
|
|
2005-11-17 17:58:19 +03:00
|
|
|
virtual ~InputServerStream();
|
|
|
|
|
|
|
|
virtual bool IsValid();
|
|
|
|
virtual void SendQuit();
|
|
|
|
|
|
|
|
virtual bool SupportsCursorThread() const { return fCursorSemaphore >= B_OK; }
|
|
|
|
|
2005-11-26 19:22:06 +03:00
|
|
|
virtual void UpdateScreenBounds(BRect bounds);
|
|
|
|
|
2005-11-17 17:58:19 +03:00
|
|
|
virtual bool GetNextEvent(BMessage** _event);
|
|
|
|
virtual bool GetNextCursorPosition(BPoint& where);
|
|
|
|
|
2006-01-11 15:25:06 +03:00
|
|
|
virtual BMessage* PeekLatestMouseMoved();
|
|
|
|
|
2005-11-17 17:58:19 +03:00
|
|
|
private:
|
|
|
|
status_t _MessageFromPort(BMessage** _message,
|
|
|
|
bigtime_t timeout = B_INFINITE_TIMEOUT);
|
|
|
|
|
* the new input event dispatcher is now actually used, although it doesn't
distribute any messages to the clients yet.
* removed the working thread from RootLayer - for now, its event handlers are
still called using input filters in the new event dispatcher, though (to
get things started).
* ServerApp is now using a BMessenger to identify its client, and no longer
stores the port/token separately.
* the input_server handshake is a bit simpler now, as it can now just reply
to the app_server message, removed unused code from ServerProtocol.h
* calmed down the MultiLocker (it always printed thread statistics on startup,
because it's compiled in debug mode).
* removed the cursor thread stuff from AppServer.cpp
* the new event dispatcher now uses a cursor thread when supported (only in
native mode, not in the test environment), although it improves cursor
movement under Qemu, the effect is not as good as expected - this might
need some more investigations (might just be a thread priority problem).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15012 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-18 14:30:06 +03:00
|
|
|
BMessenger fInputServer;
|
2005-11-17 17:58:19 +03:00
|
|
|
BMessageQueue fEvents;
|
|
|
|
port_id fPort;
|
|
|
|
bool fQuitting;
|
|
|
|
sem_id fCursorSemaphore;
|
|
|
|
area_id fCursorArea;
|
|
|
|
shared_cursor* fCursorBuffer;
|
2006-01-11 15:25:06 +03:00
|
|
|
BMessage* fLatestMouseMoved;
|
2005-11-17 17:58:19 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* EVENT_STREAM_H */
|