PixelLightAPI  .
Theme.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: Theme.h                                        *
00003  *
00004  *  Copyright (C) 2002-2012 The PixelLight Team (http://www.pixellight.org/)
00005  *
00006  *  This file is part of PixelLight.
00007  *
00008  *  PixelLight is free software: you can redistribute it and/or modify
00009  *  it under the terms of the GNU Lesser General Public License as published by
00010  *  the Free Software Foundation, either version 3 of the License, or
00011  *  (at your option) any later version.
00012  *
00013  *  PixelLight is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016  *  GNU Lesser General Public License for more details.
00017  *
00018  *  You should have received a copy of the GNU Lesser General Public License
00019  *  along with PixelLight. If not, see <http://www.gnu.org/licenses/>.
00020 \*********************************************************/
00021 
00022 
00023 #ifndef __PLGUI_THEME_H__
00024 #define __PLGUI_THEME_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include <PLCore/Base/Object.h>
00032 #include <PLMath/Vector2i.h>
00033 #include <PLGraphics/Color/Color4.h>
00034 #include "PLGui/Gui/Resources/Image.h"
00035 #include "PLGui/Gui/Resources/Font.h"
00036 #include "PLGui/PLGuiDefinitions.h"
00037 
00038 
00039 //[-------------------------------------------------------]
00040 //[ Forward declarations                                  ]
00041 //[-------------------------------------------------------]
00042 namespace PLGraphics {
00043     class Color4;
00044 }
00045 namespace PLGui {
00046     class Gui;
00047     class Graphics;
00048 }
00049 
00050 
00051 //[-------------------------------------------------------]
00052 //[ Namespace                                             ]
00053 //[-------------------------------------------------------]
00054 namespace PLGui {
00055 
00056 
00057 //[-------------------------------------------------------]
00058 //[ Classes                                               ]
00059 //[-------------------------------------------------------]
00060 /**
00061 *  @brief
00062 *    Theme
00063 */
00064 class Theme : public PLCore::Object {
00065 
00066 
00067     //[-------------------------------------------------------]
00068     //[ Class definition                                      ]
00069     //[-------------------------------------------------------]
00070     pl_class(PLGUI_RTTI_EXPORT, Theme, "PLGui", PLCore::Object, "GUI theme class")
00071     pl_class_end
00072 
00073 
00074     //[-------------------------------------------------------]
00075     //[ Friends                                               ]
00076     //[-------------------------------------------------------]
00077     friend class Gui;
00078 
00079 
00080     //[-------------------------------------------------------]
00081     //[ Public functions                                      ]
00082     //[-------------------------------------------------------]
00083     public:
00084         /**
00085         *  @brief
00086         *    Constructor
00087         *
00088         *  @param[in] cGui
00089         *    Owner GUI
00090         *  @param[in] sName
00091         *    Name of modifier
00092         */
00093         PLGUI_API Theme(Gui &cGui, const PLCore::String &sName = "");
00094 
00095         /**
00096         *  @brief
00097         *    Destructor
00098         */
00099         PLGUI_API virtual ~Theme();
00100 
00101         /**
00102         *  @brief
00103         *    Get owner GUI
00104         *
00105         *  @return
00106         *    Pointer to GUI object (never a null pointer)
00107         */
00108         PLGUI_API Gui *GetGui() const;
00109 
00110         /**
00111         *  @brief
00112         *    Get name of theme
00113         *
00114         *  @return
00115         *    Name of theme
00116         */
00117         PLGUI_API PLCore::String GetName() const;
00118 
00119         /**
00120         *  @brief
00121         *    Get default font
00122         *
00123         *  @return
00124         *    Default font
00125         */
00126         PLGUI_API const PLGui::Font &GetDefaultFont() const;
00127 
00128         /**
00129         *  @brief
00130         *    Get default icon
00131         *
00132         *  @return
00133         *    Default icon
00134         */
00135         PLGUI_API const PLGui::Image &GetDefaultIcon() const;
00136 
00137         /**
00138         *  @brief
00139         *    Get window border size
00140         *
00141         *  @return
00142         *    Border size
00143         */
00144         PLGUI_API int GetWindowBorderSize() const;
00145 
00146         /**
00147         *  @brief
00148         *    Get window title bar height
00149         *
00150         *  @return
00151         *    Title bar height
00152         */
00153         PLGUI_API int GetWindowTitleBarHeight() const;
00154 
00155         /**
00156         *  @brief
00157         *    Get menu bar height
00158         *
00159         *  @return
00160         *    Menu bar height
00161         */
00162         PLGUI_API int GetMenuBarHeight() const;
00163 
00164         /**
00165         *  @brief
00166         *    Get default window color
00167         *
00168         *  @return
00169         *    Window color
00170         */
00171         PLGUI_API PLGraphics::Color4 GetWindowColor() const;
00172 
00173         /**
00174         *  @brief
00175         *    Get panel border size
00176         *
00177         *  @return
00178         *    Border size
00179         */
00180         PLGUI_API int GetPanelBorderSize() const;
00181 
00182         /**
00183         *  @brief
00184         *    Get default panel color
00185         *
00186         *  @return
00187         *    Panel color
00188         */
00189         PLGUI_API PLGraphics::Color4 GetPanelColor() const;
00190 
00191         /**
00192         *  @brief
00193         *    Get system button size
00194         *
00195         *  @return
00196         *    Size of system button (X and Y)
00197         */
00198         PLGUI_API PLMath::Vector2i GetSysButtonSize() const;
00199 
00200 
00201     //[-------------------------------------------------------]
00202     //[ Public virtual Theme functions                        ]
00203     //[-------------------------------------------------------]
00204     public:
00205         // General drawing functions
00206         virtual void DrawRect(Graphics &cGraphics, const PLMath::Vector2i &vPos1, const PLMath::Vector2i &vPos2, ELineStyle nStyle, const PLGraphics::Color4 &cColor, int nWidth, int nRound = 0) = 0;
00207         virtual void DrawBorder(Graphics &cGraphics, const PLMath::Vector2i &vPos1, const PLMath::Vector2i &vPos2, EBorderStyle nBorderStyle) = 0;
00208         virtual void DrawFocusRect(Graphics &cGraphics, const PLMath::Vector2i &vPos1, const PLMath::Vector2i &vPos2) = 0;
00209         virtual void DrawSeparator(Graphics &cGraphics, const PLMath::Vector2i &vPos1, const PLMath::Vector2i &vPos2, EOrientation nOrientation) = 0;
00210         virtual void DrawRule(Graphics &cGraphics, const PLMath::Vector2i &vPos1, const PLMath::Vector2i &vPos2, EOrientation nOrientation) = 0;
00211 
00212         // Widgets
00213         virtual void DrawPanel(Graphics &cGraphics, const PLMath::Vector2i &vPos1, const PLMath::Vector2i &vPos2, EBorderStyle nBorderStyle) = 0;
00214         virtual void DrawWindow(Graphics &cGraphics, const PLMath::Vector2i &vPos1, const PLMath::Vector2i &vPos2, bool bBorder, PLCore::uint32 nWidgetState, const PLCore::String &sTitle, const PLGui::Image &cIcon) = 0;
00215         virtual void DrawSystemButton(Graphics &cGraphics, const PLMath::Vector2i &vPos, ESystemCommand nSystemCommand, PLCore::uint32 nWidgetState) = 0;
00216         virtual void DrawButton(Graphics &cGraphics, const PLMath::Vector2i &vPos1, const PLMath::Vector2i &vPos2, const PLCore::String &sTitle, const Image &cImage, PLCore::uint32 nWidgetState) = 0;
00217         virtual void DrawToggleButton(Graphics &cGraphics, const PLMath::Vector2i &vPos1, const PLMath::Vector2i &vPos2, const PLCore::String &sTitle, const Image &cImage, PLCore::uint32 nWidgetState, ECheckState nChecked) = 0;
00218         virtual void DrawRadioButton(Graphics &cGraphics, const PLMath::Vector2i &vPos1, const PLMath::Vector2i &vPos2, const PLCore::String &sTitle, PLCore::uint32 nWidgetState, ECheckState nChecked) = 0;
00219         virtual void DrawCheckBox(Graphics &cGraphics, const PLMath::Vector2i &vPos1, const PLMath::Vector2i &vPos2, const PLCore::String &sTitle, PLCore::uint32 nWidgetState, ECheckState nChecked) = 0;
00220         virtual void DrawTooltip(Graphics &cGraphics, const PLMath::Vector2i &vPos1, const PLMath::Vector2i &vPos2, PLCore::uint32 nWidgetState) = 0;
00221         virtual void DrawSlider(Graphics &cGraphics, const PLMath::Vector2i &vPos1, const PLMath::Vector2i &vPos2, EOrientation nOrientation, PLCore::uint32 nWidgetState) = 0;
00222         virtual void DrawSliderHandle(Graphics &cGraphics, const PLMath::Vector2i &vPos1, const PLMath::Vector2i &vPos2, EOrientation nOrientation, PLCore::uint32 nWidgetState) = 0;
00223         virtual void DrawScrollBar(Graphics &cGraphics, const PLMath::Vector2i &vPos1, const PLMath::Vector2i &vPos2, EOrientation nOrientation, PLCore::uint32 nWidgetState) = 0;
00224         virtual void DrawScrollBarPlusButton(Graphics &cGraphics, const PLMath::Vector2i &vPos1, const PLMath::Vector2i &vPos2, EOrientation nOrientation, PLCore::uint32 nWidgetState) = 0;
00225         virtual void DrawScrollBarMinusButton(Graphics &cGraphics, const PLMath::Vector2i &vPos1, const PLMath::Vector2i &vPos2, EOrientation nOrientation, PLCore::uint32 nWidgetState) = 0;
00226         virtual void DrawScrollBarHandle(Graphics &cGraphics, const PLMath::Vector2i &vPos1, const PLMath::Vector2i &vPos2, EOrientation nOrientation, PLCore::uint32 nWidgetState) = 0;
00227         virtual void DrawSplitter(Graphics &cGraphics, const PLMath::Vector2i &vPos1, const PLMath::Vector2i &vPos2, EOrientation nOrientation) = 0;
00228         virtual void DrawMenuBar(Graphics &cGraphics, const PLMath::Vector2i &vPos1, const PLMath::Vector2i &vPos2, EOrientation nOrientation, PLCore::uint32 nWidgetState) = 0;
00229         virtual void DrawPopupMenu(Graphics &cGraphics, const PLMath::Vector2i &vPos1, const PLMath::Vector2i &vPos2, EOrientation nOrientation, PLCore::uint32 nWidgetState) = 0;
00230         virtual void DrawMenuItem(Graphics &cGraphics, const PLMath::Vector2i &vPos1, const PLMath::Vector2i &vPos2, const PLCore::String &sTitle, const Image &cImage, bool bDrawArrow, EMenuItemType nType, EOrientation nOrientation, PLCore::uint32 nWidgetState) = 0;
00231 
00232 
00233     //[-------------------------------------------------------]
00234     //[ Protected data                                        ]
00235     //[-------------------------------------------------------]
00236     protected:
00237         // Gui
00238         Gui                 *m_pGui;                    /**< Owner GUI */
00239         PLCore::String       m_sName;                   /**< Theme name */
00240 
00241         // Default resources
00242         PLGui::Font          m_cDefaultFont;            /**< Default font */
00243         PLGui::Image         m_cDefaultIcon;            /**< Default icon */
00244 
00245         // Window
00246         int                  m_nWindowBorderSize;       /**< Border size of a window */
00247         int                  m_nWindowTitleBarHeight;   /**< Title bar height of a window */
00248         int                  m_nMenuBarHeight;          /**< Menu bar height */
00249         PLGraphics::Color4   m_cWindowColor;            /**< Default window color */
00250 
00251         // Panel
00252         int                  m_nPanelBorderSize;        /**< Border size of a panel */
00253         PLGraphics::Color4   m_cPanelColor;             /**< Default panel color */
00254 
00255         // SystemButton
00256         PLMath::Vector2i     m_vSysButtonSize;          /**< System button size */
00257 
00258 
00259 };
00260 
00261 
00262 //[-------------------------------------------------------]
00263 //[ Namespace                                             ]
00264 //[-------------------------------------------------------]
00265 } // PLGui
00266 
00267 
00268 #endif // __PLGUI_THEME_H__


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:01
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported