4 #include <msp/core/application.h>
5 #include <msp/gl/font.h>
6 #include <msp/gltk/resources.h>
7 #include "libmarklin/catalogue.h"
8 #include "libmarklin/control.h"
9 #include "libmarklin/trafficmanager.h"
10 #include "3d/layout.h"
15 class Engineer: public Msp::Application
18 Engineer(int argc, char **argv);
21 Marklin::Control &get_control() { return control; }
22 unsigned get_screen_width() const { return screen_w; }
23 unsigned get_screen_height() const { return screen_h; }
24 unsigned get_font_size() const { return font_size; }
25 Msp::GL::Font &get_font() { return *font; }
26 void add_train(unsigned);
28 void quit() { exit(0); }
30 typedef std::list<TrainPanel *> TrainPanelSeq;
37 Marklin::Catalogue catalogue;
38 Marklin::Layout layout;
39 Marklin::Layout3D layout_3d;
40 Marklin::Control control;
41 Marklin::Point cam_pos;
43 Msp::GLtk::Resources ui_res;
44 MainPanel *main_panel;
45 TrainPanelSeq train_panels;
46 std::string status_text;
48 Marklin::TrafficManager *trfc_mgr;
52 void key_press(unsigned, unsigned);
53 void button_press(int, int, unsigned);
54 void button_release(int, int, unsigned);
55 void pointer_motion(int, int);
57 void turnout_route_changed(unsigned);
58 void sensor_state_changed(bool, unsigned);
60 Marklin::Track3D *pick_track(int, int);
62 static Msp::Application::RegApp<Engineer> reg;