X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fevent.h;fp=source%2Fevent.h;h=0000000000000000000000000000000000000000;hp=091d637814d57e3999885e29952fcab7d843e9ca;hb=e1ea831a640fba534e7e42e399f04cdf681ef8d3;hpb=0bcb8d4d6f33cbdad7b921cac787740bfe8e212e diff --git a/source/event.h b/source/event.h deleted file mode 100644 index 091d637..0000000 --- a/source/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