Commit 181e9215 authored by Cyril Deguet's avatar Cyril Deguet

* parser/builder.cpp: stores the curves in the theme (avoid a memory leak)

* parser/builder_data.def: forgot to commit that for months !
parent ce41dfb5
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* builder.cpp * builder.cpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: builder.cpp,v 1.4 2004/01/25 17:20:18 kuehne Exp $ * $Id: builder.cpp,v 1.5 2004/02/01 16:15:40 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -448,7 +448,6 @@ void Builder::addSlider( const BuilderData::Slider &rData ) ...@@ -448,7 +448,6 @@ void Builder::addSlider( const BuilderData::Slider &rData )
return; return;
} }
// XXX: memory leak!
Bezier *pCurve = getPoints( rData.m_points.c_str() ); Bezier *pCurve = getPoints( rData.m_points.c_str() );
if( pCurve == NULL ) if( pCurve == NULL )
{ {
...@@ -456,6 +455,7 @@ void Builder::addSlider( const BuilderData::Slider &rData ) ...@@ -456,6 +455,7 @@ void Builder::addSlider( const BuilderData::Slider &rData )
rData.m_points.c_str() ); rData.m_points.c_str() );
return; return;
} }
m_pTheme->m_curves.push_back( BezierPtr( pCurve ) );
// Get the visibility variable // Get the visibility variable
// XXX check when it is null // XXX check when it is null
......
Theme magnet:int alpha:uint32_t moveAlpha:uint32_t fadeTime:uint32_t
Bitmap id:string fileName:string alphaColor:uint32_t
Font id:string fontName:string size:int
Window id:string xPos:int yPos:int visible:bool dragDrop:bool playOnDrop:bool
Layout id:string width:int height:int minWidth:int maxWidth:int minHeight:int maxHeight:int windowId:string
Anchor xPos:int yPos:int range:int priority:int windowId:string
Button id:string xPos:int yPos:int leftTop:string rightBottom:string upId:string downId:string overId:string actionId:string tooltip:string help:string layer:int windowId:string layoutId:string
Checkbox id:string xPos:int yPos:int leftTop:string rightBottom:string up1Id:string down1Id:string over1Id:string up2Id:string down2Id:string over2Id:string state:string action1:string action2:string tooltip1:string tooltip2:string help:string layer:int windowId:string layoutId:string
Image id:string xPos:int yPos:int leftTop:string rightBottom:string visible:bool bmpId:string onclickId:string help:string layer:int windowId:string layoutId:string
Text id:string xPos:int yPos:int fontId:string text:string width:int help:string layer:int windowId:string layoutId:string
RadialSlider id:string visible:string xPos:int yPos:int leftTop:string rightBottom:string sequence:string nbImages:int minAngle:float maxAngle:float value:string tooltip:string help:string layer:int windowId:string layoutId:string
Slider id:string visible:string xPos:int yPos:int leftTop:string rightBottom:string upId:string downId:string overId:string points:string thickness:int value:string tooltip:string help:string layer:int windowId:string layoutId:string
List id:string xPos:int yPos:int width:int height:int leftTop:string rightBottom:string fontId:string var:string fgColor:uint32_t playColor:uint32_t bgColor1:uint32_t bgColor2:uint32_t selColor:uint32_t help:string layer:int windowId:string layoutId:string
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* theme.hpp * theme.hpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: theme.hpp,v 1.2 2004/01/25 23:04:06 asmax Exp $ * $Id: theme.hpp,v 1.3 2004/02/01 16:15:40 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr> * Olivier Teulière <ipkiss@via.ecp.fr>
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "../src/generic_layout.hpp" #include "../src/generic_layout.hpp"
#include "../src/window_manager.hpp" #include "../src/window_manager.hpp"
#include "../commands/cmd_generic.hpp" #include "../commands/cmd_generic.hpp"
#include "../utils/bezier.hpp"
#include "../utils/variable.hpp" #include "../utils/variable.hpp"
#include "../controls/ctrl_generic.hpp" #include "../controls/ctrl_generic.hpp"
#include <string> #include <string>
...@@ -72,6 +73,8 @@ class Theme: public SkinObject ...@@ -72,6 +73,8 @@ class Theme: public SkinObject
map<string, CtrlGenericPtr> m_controls; map<string, CtrlGenericPtr> m_controls;
/// Store the commands /// Store the commands
list<CmdGenericPtr> m_commands; list<CmdGenericPtr> m_commands;
/// Store the Bezier curves
list<BezierPtr> m_curves;
/// Store the variables /// Store the variables
list<VariablePtr> m_vars; list<VariablePtr> m_vars;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* bezier.hpp * bezier.hpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: bezier.hpp,v 1.2 2004/01/11 17:12:17 asmax Exp $ * $Id: bezier.hpp,v 1.3 2004/02/01 16:15:40 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr> * Olivier Teulière <ipkiss@via.ecp.fr>
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
#define BEZIER_HPP #define BEZIER_HPP
#include "../src/skin_common.hpp" #include "../src/skin_common.hpp"
#include "pointer.hpp"
#include <vector> #include <vector>
using namespace std;
#define MAX_BEZIER_POINT 1023 #define MAX_BEZIER_POINT 1023
...@@ -93,4 +93,6 @@ class Bezier: public SkinObject ...@@ -93,4 +93,6 @@ class Bezier: public SkinObject
}; };
typedef CountedPtr<Bezier> BezierPtr;
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment