# HG changeset patch # User Tero Marttila # Date 1232992372 -7200 # Node ID 74e562e16399018058e8a78fba1631c5b7125998 # Parent 712b943195a6c7a9a37f23c6c1b27a167fdd1ba5 back-out incomplete Console/GUI stuff from default branch diff -r 712b943195a6 -r 74e562e16399 src/Graphics/CMakeLists.txt --- a/src/Graphics/CMakeLists.txt Sat Jan 24 01:19:38 2009 +0200 +++ b/src/Graphics/CMakeLists.txt Mon Jan 26 19:52:52 2009 +0200 @@ -2,7 +2,7 @@ FILE(GLOB GRAPHICS_HEADER_FILES "*.hh") # what ClanLib components we need -set (GRAPHICS_CLANLIB_COMPONENTS Display GL GUI PARENT_SCOPE) +set (GRAPHICS_CLANLIB_COMPONENTS Display GL PARENT_SCOPE) # list of source files set (GRAPHICS_SOURCES ${GRAPHICS_SOURCE_FILES} ${GRAPHICS_HEADER_FILES} PARENT_SCOPE) diff -r 712b943195a6 -r 74e562e16399 src/Graphics/Console.cc --- a/src/Graphics/Console.cc Sat Jan 24 01:19:38 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ - -#include "Console.hh" - -namespace graphics -{ - -Console::Console (const CL_Rect& pos, CL_Component* parent) : - CL_Component(pos, parent), - messages(), input(getInputPosition(), this) -{ - // hide by default - show(false); - -} - -CL_Rect Console::getInputPosition (void) { - CL_Rect pos = get_position(); - - return CL_Rect(pos.left, pos.bottom - 30, pos.right, pos.bottom); -} - - -} diff -r 712b943195a6 -r 74e562e16399 src/Graphics/Console.hh --- a/src/Graphics/Console.hh Sat Jan 24 01:19:38 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -#ifndef GRAPHICS_CONSOLE_HH -#define GRAPHICS_CONSOLE_HH - -#include "GUI.hh" - -#include - -namespace graphics -{ - -class Console : public CL_Component { -protected: - /** our list of messages */ - std::list messages; - - /** our input dialog */ - CL_InputBox input; - -public: - /** - * Construct a new console, positioned in the given area, with the given parent - */ - Console (const CL_Rect& pos, CL_Component* parent); - -private: - /** - * Calculate the position for the input box - */ - CL_Rect getInputPosition (void); -}; - -} - -#endif diff -r 712b943195a6 -r 74e562e16399 src/Graphics/GUI.hh --- a/src/Graphics/GUI.hh Sat Jan 24 01:19:38 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -#ifndef GRAPHICS_GUI_HH -#define GRAPHICS_GUI_HH - -#include "GUIStyle.hh" - -#include - - -namespace graphics -{ - -/** - * Our CL_GUIManager, for when we use ClanLib's GUI stuff - */ -class GUI : public CL_GUIManager { -public: - /** - * Construct default manager - */ - GUI (CL_ResourceManager *resources) : - CL_GUIManager(new GUIStyle(resources)) - { - - } - - -}; - -} - -#endif diff -r 712b943195a6 -r 74e562e16399 src/Graphics/GUIStyle.hh --- a/src/Graphics/GUIStyle.hh Sat Jan 24 01:19:38 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -#ifndef GRAPHICS_GUI_STYLE_HH -#define GRAPHICS_GUI_STYLE_HH - -#include "GUI.hh" - -#include - -namespace graphics -{ - -/** - * Our CL_StyleManager used for drawing ClanLib's GUI components - */ -class GUIStyle : public CL_StyleManager_Silver { -public: - /** - * Construct GUI style - */ - GUIStyle (CL_ResourceManager *resources) : - CL_StyleManager_Silver(resources) - { - - } - - /** - * Handle attaching style objects to components - */ - virtual void connect_styles (const std::string &type, CL_Component *component) { - - // default to parent impl - CL_StyleManager_Silver::connect_styles(type, component); - } -}; - -} - -#endif