1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2003 the VideoLAN team
7 * Authors: Cyril Deguet <asmax@via.ecp.fr>
8 * Olivier Teulière <ipkiss@via.ecp.fr>
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.
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.
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 *****************************************************************************/
28 #include "builder_data.hpp"
29 #include "../src/skin_common.hpp"
43 /// Class for skin construction
44 class Builder: public SkinObject
47 Builder( intf_thread_t *pIntf, const BuilderData &rData,
48 const string &rPath );
51 /// Create a Theme object, ready to use.
52 /// Return NULL in case of problem
55 /// Parse an action tag and returns a command
56 CmdGeneric *parseAction( const string &rAction );
60 const BuilderData &m_rData;
64 /// Theme under construction
67 void addTheme( const BuilderData::Theme &rData );
68 void addBitmap( const BuilderData::Bitmap &rData );
69 void addSubBitmap( const BuilderData::SubBitmap &rData );
70 void addBitmapFont( const BuilderData::BitmapFont &rData );
71 void addFont( const BuilderData::Font &rData );
72 void addPopupMenu( const BuilderData::PopupMenu &rData );
73 void addMenuItem( const BuilderData::MenuItem &rData );
74 void addMenuSeparator( const BuilderData::MenuSeparator &rData );
75 void addWindow( const BuilderData::Window &rData );
76 void addLayout( const BuilderData::Layout &rData );
77 void addAnchor( const BuilderData::Anchor &rData );
78 void addButton( const BuilderData::Button &rData );
79 void addCheckbox( const BuilderData::Checkbox &rData );
80 void addImage( const BuilderData::Image &rData );
81 void addText( const BuilderData::Text &rData );
82 void addRadialSlider( const BuilderData::RadialSlider &rData );
83 void addSlider( const BuilderData::Slider &rData );
84 void addList( const BuilderData::List &rData );
85 void addTree( const BuilderData::Tree &rData );
86 void addVideo( const BuilderData::Video &rData );
88 /// Compute the position of a control
89 const Position makePosition( const string &rLeftTop,
90 const string &rRightBottom,
91 int xPos, int yPos, int width, int height,
92 const Box &rBox ) const;
94 // Build the full path of a file
95 string getFilePath( const string &fileName ) const;
97 /// Get a font from its id
98 GenericFont *getFont( const string &fontId );
100 /// Function to parse "points" tags
101 Bezier *getPoints( const char *pTag ) const;
103 /// Image handler (used to load image files)
104 image_handler_t *m_pImageHandler;