Cafu Engine
CompBorder.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_GUISYS_COMPONENT_BORDER_HPP_INCLUDED
8 #define CAFU_GUISYS_COMPONENT_BORDER_HPP_INCLUDED
9 
10 #include "CompBase.hpp"
11 
12 
13 namespace cf
14 {
15  namespace GuiSys
16  {
17  /// This components adds a border to its window.
19  {
20  public:
21 
22  /// The constructor.
24 
25  /// The copy constructor.
26  /// @param Comp The component to create a copy of.
28 
29  // Base class overrides.
30  ComponentBorderT* Clone() const;
31  const char* GetName() const { return "Border"; }
32  void Render() const;
33 
34 
35  // The TypeSys related declarations for this class.
36  const cf::TypeSys::TypeInfoT* GetType() const { return &TypeInfo; }
37  static void* CreateInstance(const cf::TypeSys::CreateParamsT& Params);
38  static const cf::TypeSys::TypeInfoT TypeInfo;
39 
40 
41  protected:
42 
43  // The Lua API methods of this class.
44  static int toString(lua_State* LuaState);
45 
46  static const luaL_Reg MethodsList[]; ///< The list of Lua methods for this class.
47  static const char* DocClass;
48  static const cf::TypeSys::MethsDocT DocMethods[];
49  static const cf::TypeSys::VarsDocT DocVars[];
50 
51 
52  private:
53 
54  void FillMemberVars(); ///< A helper method for the constructors.
55 
56  TypeSys::VarT<float> m_Width; ///< The width of the border.
57  TypeSys::VarT<Vector3fT> m_Color; ///< The border color.
58  TypeSys::VarT<float> m_Alpha; ///< The alpha component of the color.
59  };
60  }
61 }
62 
63 #endif
static const luaL_Reg MethodsList[]
The list of Lua methods for this class.
Definition: CompBorder.hpp:46
This is the base class for the components that a window is composed/aggregated of.
Definition: CompBase.hpp:51
ComponentBorderT()
The constructor.
Definition: CompBorder.cpp:44
ComponentBorderT * Clone() const
The virtual copy constructor.
Definition: CompBorder.cpp:72
const char * GetName() const
Returns the name of this component.
Definition: CompBorder.hpp:31
This components adds a border to its window.
Definition: CompBorder.hpp:18
void Render() const
This method implements the graphical output of this component.
Definition: CompBorder.cpp:78
Definition: TypeSys.hpp:52
Definition: TypeSys.hpp:57
This class keeps type information (about an entity class that occurs in the game).
Definition: TypeSys.hpp:79
Definition: TypeSys.hpp:68