]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins2/parser/builder.hpp
* all: added a INI file parser in skins2. For instance if the file
[vlc] / modules / gui / skins2 / parser / builder.hpp
index eb336b66e92acff738d626759d00b31d4f5aa795..d0831b68ab2d16bb05a38b3e8be52f086dc75cd5 100644 (file)
@@ -1,11 +1,11 @@
 /*****************************************************************************
  * builder.hpp
  *****************************************************************************
- * Copyright (C) 2003 VideoLAN
- * $Id: builder.hpp,v 1.2 2004/01/11 17:12:17 asmax Exp $
+ * Copyright (C) 2003 the VideoLAN team
+ * $Id$
  *
  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
- *          Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Olivier Teulière <ipkiss@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 #ifndef BUILDER_HPP
 #define BUILDER_HPP
 
 #include "builder_data.hpp"
-#include "../src/os_graphics.hpp"
-#include "../src/generic_window.hpp"
-#include "../src/generic_layout.hpp"
-#include "../src/generic_bitmap.hpp"
-#include "../src/generic_font.hpp"
-#include "../commands/cmd_generic.hpp"
-#include "../controls/ctrl_generic.hpp"
-#include "../utils/bezier.hpp"
+#include "../src/skin_common.hpp"
 
 #include <string>
 #include <list>
-#include <set>
 #include <map>
 
 class Theme;
+class Bezier;
+class CmdGeneric;
+class GenericFont;
+class Position;
+class Box;
 
 
 /// Class for skin construction
 class Builder: public SkinObject
 {
     public:
-        Builder( intf_thread_t *pIntf, BuilderData &rData );
-        virtual ~Builder() {}
+        Builder( intf_thread_t *pIntf, const BuilderData &rData,
+                 const string &rPath );
+        virtual ~Builder();
 
         /// Create a Theme object, ready to use.
         /// Return NULL in case of problem
@@ -59,17 +57,22 @@ class Builder: public SkinObject
 
     private:
         /// Data from the XML
-        BuilderData &m_rData;
+        const BuilderData &m_rData;
+        /// Path of the theme
+        const string m_path;
 
         /// Theme under construction
         Theme *m_pTheme;
 
-        /// Set of used id
-        set<string> m_idSet;
-
         void addTheme( const BuilderData::Theme &rData );
+        void addIniFile( const BuilderData::IniFile &rData );
         void addBitmap( const BuilderData::Bitmap &rData );
+        void addSubBitmap( const BuilderData::SubBitmap &rData );
+        void addBitmapFont( const BuilderData::BitmapFont &rData );
         void addFont( const BuilderData::Font &rData );
+        void addPopupMenu( const BuilderData::PopupMenu &rData );
+        void addMenuItem( const BuilderData::MenuItem &rData );
+        void addMenuSeparator( const BuilderData::MenuSeparator &rData );
         void addWindow( const BuilderData::Window &rData );
         void addLayout( const BuilderData::Layout &rData );
         void addAnchor( const BuilderData::Anchor &rData );
@@ -80,12 +83,8 @@ class Builder: public SkinObject
         void addRadialSlider( const BuilderData::RadialSlider &rData );
         void addSlider( const BuilderData::Slider &rData );
         void addList( const BuilderData::List &rData );
-
-        /// Generate a new id
-        const string generateId() const;
-
-        /// Check if the id is unique, and if not generate a new one
-        const string uniqueId( const string &id );
+        void addTree( const BuilderData::Tree &rData );
+        void addVideo( const BuilderData::Video &rData );
 
         /// Compute the position of a control
         const Position makePosition( const string &rLeftTop,
@@ -93,8 +92,20 @@ class Builder: public SkinObject
                                      int xPos, int yPos, int width, int height,
                                      const Box &rBox ) const;
 
+        // Build the full path of a file
+        string getFilePath( const string &fileName ) const;
+
+        /// Get a font from its id
+        GenericFont *getFont( const string &fontId );
+
         /// Function to parse "points" tags
         Bezier *getPoints( const char *pTag ) const;
+
+        /// Compute a color value
+        uint32_t getColor( const string &rVal ) const;
+
+        /// Image handler (used to load image files)
+        image_handler_t *m_pImageHandler;
 };
 
 #endif