summaryrefslogtreecommitdiffstats
path: root/client/inputs_channel.cpp
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2009-11-08 16:34:12 +0200
committerYaniv Kamay <ykamay@redhat.com>2009-11-09 14:39:33 +0200
commit8d5b738ba169c44d223ab6d99ec12e763ce5bc8e (patch)
tree3c1d4dd1b3c32f9a03dd456ea921a66ed7f6c7fd /client/inputs_channel.cpp
parent082934699611d5985ecf3386259d270d75e41c12 (diff)
downloadspice-8d5b738ba169c44d223ab6d99ec12e763ce5bc8e.tar.gz
spice-8d5b738ba169c44d223ab6d99ec12e763ce5bc8e.tar.xz
spice-8d5b738ba169c44d223ab6d99ec12e763ce5bc8e.zip
spice client: creating a general process loop.
The process loop is responsible for: 1) waiting for events 2) timers 3) events queue for actions that should be performed in the context of the thread and are pushed from other threads. The benefits: 1) remove duplicity: till now, there was one implementaion of events loop for the channels and another one for the main thread. 2) timers can be executed on each thread and not only on the main thread. 3) events can be pushed to each thread and not only to the main thread. In this commit, only the main thread was modified to use the new process loop.
Diffstat (limited to 'client/inputs_channel.cpp')
-rw-r--r--client/inputs_channel.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/client/inputs_channel.cpp b/client/inputs_channel.cpp
index 8035bfb3..d686be22 100644
--- a/client/inputs_channel.cpp
+++ b/client/inputs_channel.cpp
@@ -28,9 +28,9 @@ class SetInputsHandlerEvent: public Event {
public:
SetInputsHandlerEvent(InputsChannel& channel) : _channel (channel) {}
- virtual void responce(Application& application)
+ virtual void response(AbstractProcessLoop& events_loop)
{
- application.set_inputs_handler(_channel);
+ static_cast<Application*>(events_loop.get_owner())->set_inputs_handler(_channel);
}
private:
@@ -41,7 +41,7 @@ class KeyModifiersEvent: public Event {
public:
KeyModifiersEvent(InputsChannel& channel) : _channel (channel) {}
- virtual void responce(Application& application)
+ virtual void response(AbstractProcessLoop& events_loop)
{
Lock lock(_channel._update_modifiers_lock);
_channel._active_modifiers_event = false;
@@ -56,9 +56,9 @@ class RemoveInputsHandlerEvent: public SyncEvent {
public:
RemoveInputsHandlerEvent(InputsChannel& channel) : _channel (channel) {}
- virtual void do_responce(Application& application)
+ virtual void do_response(AbstractProcessLoop& events_loop)
{
- application.remove_inputs_handler(_channel);
+ static_cast<Application*>(events_loop.get_owner())->remove_inputs_handler(_channel);
}
private: