]> git.sesse.net Git - vlc/blob - modules/gui/skins2/src/theme.hpp
93d3554f95e3afb701ea902ecd48f90984c48f69
[vlc] / modules / gui / skins2 / src / theme.hpp
1 /*****************************************************************************
2  * theme.hpp
3  *****************************************************************************
4  * Copyright (C) 2003 VideoLAN
5  * $Id$
6  *
7  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
8  *          Olivier Teulière <ipkiss@via.ecp.fr>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
23  *****************************************************************************/
24
25 #ifndef THEME_HPP
26 #define THEME_HPP
27
28 #include "../src/generic_bitmap.hpp"
29 #include "../src/generic_font.hpp"
30 #include "../src/generic_layout.hpp"
31 #include "../src/window_manager.hpp"
32 #include "../commands/cmd_generic.hpp"
33 #include "../utils/bezier.hpp"
34 #include "../utils/variable.hpp"
35 #include "../controls/ctrl_generic.hpp"
36 #include <string>
37 #include <list>
38 #include <map>
39
40 class Builder;
41 class Interpreter;
42
43 /// Class storing the data of the current theme
44 class Theme: public SkinObject
45 {
46     private:
47         friend class Builder;
48         friend class Interpreter;
49     public:
50         Theme( intf_thread_t *pIntf ): SkinObject( pIntf ),
51             m_windowManager( getIntf() ) {}
52         virtual ~Theme();
53
54         void loadConfig();
55         void saveConfig();
56
57         GenericBitmap *getBitmapById( const string &id );
58         GenericFont *getFontById( const string &id );
59         TopWindow *getWindowById( const string &id );
60         GenericLayout *getLayoutById( const string &id );
61         CtrlGeneric *getControlById( const string &id );
62
63         WindowManager &getWindowManager() { return m_windowManager; }
64
65     private:
66         /// Store the bitmaps by ID
67         map<string, GenericBitmapPtr> m_bitmaps;
68         /// Store the fonts by ID
69         map<string, GenericFontPtr> m_fonts;
70         /// Store the windows by ID
71         map<string, TopWindowPtr> m_windows;
72         /// Store the layouts by ID
73         map<string, GenericLayoutPtr> m_layouts;
74         /// Store the controls by ID
75         map<string, CtrlGenericPtr> m_controls;
76         /// Store the commands
77         list<CmdGenericPtr> m_commands;
78         /// Store the Bezier curves
79         list<BezierPtr> m_curves;
80         /// Store the variables
81         list<VariablePtr> m_vars;
82
83         WindowManager m_windowManager;
84 };
85
86
87 #endif