X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fevent.h;fp=source%2Fcore%2Fevent.h;h=0000000000000000000000000000000000000000;hb=fe77fc6b869a71bf94d501a0762579f4ddbc5094;hp=091d637814d57e3999885e29952fcab7d843e9ca;hpb=7292f4413397b7f2e4689f7597f4b9e73435352e;p=libs%2Fcore.git diff --git a/source/core/event.h b/source/core/event.h deleted file mode 100644 index 091d637..0000000 --- a/source/core/event.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -This file is part of libmspframework -Copyright © 2006 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ -#ifndef MSP_FRAMEWORK_EVENT_H_ -#define MSP_FRAMEWORK_EVENT_H_ - -#include -#include "pollable.h" - -namespace Msp { - -class Application; - -/** -Events can be used in multi-threaded applictions to trigger actions in the main -thread. -*/ -class EventManager -{ -public: - class Event - { - public: - sigc::signal signal_triggered; - - Event(EventManager &m, unsigned i): mgr(m), id(i) { } - unsigned get_id() const { return id; } - void trigger(); - private: - EventManager &mgr; - unsigned id; - }; - - EventManager(Application &); - Event &create_event(); -private: - class Pipe: public Pollable - { - public: - Pipe(); - int write(char *, unsigned); - int read(char *, unsigned); - private: - int fd[2]; - - int get_fd() { return fd[0]; } - }; - - Application &app; - Pipe pipe; - unsigned next_id; - std::list events; - - void data_available(short); -}; - -} // namespace Msp - -#endif