00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef RAUL_LASH_SERVER_INTERFACE_HPP
00019 #define RAUL_LASH_SERVER_INTERFACE_HPP
00020
00021 #include <string>
00022 #include <list>
00023 #include <lash/lash.h>
00024 #include <raul/LashClient.hpp>
00025 #include <raul/LashProject.hpp>
00026 #include <raul/SharedPtr.hpp>
00027 #include <sigc++/sigc++.h>
00028
00029 namespace Raul {
00030
00031
00032 class LashServerInterface : public LashClient, public sigc::trackable {
00033 public:
00034 static SharedPtr<LashServerInterface> create(
00035 lash_args_t* args,
00036 const std::string& name,
00037 int flags);
00038
00039 sigc::signal<void> signal_quit;
00040 sigc::signal<void, const SharedPtr<LashProject> > signal_project_add;
00041 sigc::signal<void, const SharedPtr<LashProject> > signal_project_remove;
00042
00043 void restore_project(const std::string& filename);
00044
00045 typedef std::list<SharedPtr<LashProject> > Projects;
00046 Projects& projects() { return _projects; }
00047
00048 SharedPtr<LashProject> project(const std::string& name);
00049
00050 private:
00051 LashServerInterface(lash_client_t* client);
00052 void handle_event(lash_event_t* ev);
00053 void project_closed(const std::string& name);
00054
00055 Projects _projects;
00056 };
00057
00058
00059 }
00060
00061 #endif // RAUL_LASH_SERVER_INTERFACE_HPP
00062