From 0e16cadc7077d448a5b91be205226620e2bc5191 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Thu, 1 Jul 2010 13:48:58 +0200 Subject: Make CEGUI optional This makes the CEGUI dependency optional and off by default. Restoring previous behaviour of exiting on disconnect if disabled. --- client/application.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'client/application.h') diff --git a/client/application.h b/client/application.h index 1e48ab57..01ef517d 100644 --- a/client/application.h +++ b/client/application.h @@ -35,6 +35,8 @@ class InputsHandler; class Monitor; class CmdLineParser; class Menu; + +#ifdef USE_GUI class GUI; class GUITimer; class GUIBarrier; @@ -42,6 +44,7 @@ class GUIBarrier; #ifdef GUI_DEMO class TestTimer; #endif +#endif // USE_GUI class ConnectedEvent: public Event { @@ -131,7 +134,9 @@ typedef struct StickyInfo { typedef std::list KeyHandlersStack; +#ifdef USE_GUI typedef std::list GUIBarriers; +#endif // USE_GUI class Application : public ProcessLoop, public Platform::EventListener, @@ -147,11 +152,13 @@ public: DISCONECTING, }; +#ifdef USE_GUI enum GuiMode { GUI_MODE_FULL, GUI_MODE_ACTIVE_SESSION, GUI_MODE_MINIMAL, }; +#endif // USE_GUI Application(); virtual ~Application(); @@ -216,7 +223,9 @@ public: void quit(); void hide_me(); void beep(); +#ifdef USE_GUI bool is_disconnect_allowed(); +#endif const std::string& get_host(); int get_port(); @@ -272,6 +281,7 @@ private: void show_info_layer(); void hide_info_layer(); +#ifdef USE_GUI void attach_gui_barriers(); void detach_gui_barriers(); void show_gui(); @@ -279,6 +289,11 @@ private: void create_gui_barrier(RedScreen& screen, int id); void destroyed_gui_barrier(int id); void destroyed_gui_barriers(); +#else // USE_GUI + void show_gui() {} + void hide_gui() {} + +#endif // USE_GUI // returns the press value before operation (i.e., if it was already pressed) bool press_key(RedKey key); @@ -324,6 +339,7 @@ private: StickyInfo _sticky_info; std::vector _canvas_types; AutoRef _app_menu; +#ifdef USE_GUI std::auto_ptr _gui; AutoRef _gui_timer; GUIBarriers _gui_barriers; @@ -331,6 +347,7 @@ private: #ifdef GUI_DEMO AutoRef _gui_test_timer; #endif +#endif // USE_GUI bool _during_host_switch; State _state; -- cgit