1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2003 VideoLAN
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 *****************************************************************************/
26 #include "builder.hpp"
27 #include "builder_data.hpp"
28 #include "interpreter.hpp"
29 #include "../src/png_bitmap.hpp"
30 #include "../src/os_factory.hpp"
31 #include "../src/generic_bitmap.hpp"
32 #include "../src/top_window.hpp"
33 #include "../src/anchor.hpp"
34 #include "../src/bitmap_font.hpp"
35 #include "../src/ft2_font.hpp"
36 #include "../src/theme.hpp"
37 #include "../controls/ctrl_button.hpp"
38 #include "../controls/ctrl_checkbox.hpp"
39 #include "../controls/ctrl_image.hpp"
40 #include "../controls/ctrl_list.hpp"
41 #include "../controls/ctrl_move.hpp"
42 #include "../controls/ctrl_resize.hpp"
43 #include "../controls/ctrl_slider.hpp"
44 #include "../controls/ctrl_radialslider.hpp"
45 #include "../controls/ctrl_text.hpp"
46 #include "../controls/ctrl_video.hpp"
47 #include "../utils/position.hpp"
48 #include "../utils/var_bool.hpp"
49 #include "../utils/var_text.hpp"
51 #include "vlc_image.h"
54 Builder::Builder( intf_thread_t *pIntf, const BuilderData &rData ):
55 SkinObject( pIntf ), m_rData( rData ), m_pTheme( NULL )
57 m_pImageHandler = image_HandlerCreate( pIntf );
62 if( m_pImageHandler ) image_HandlerDelete( m_pImageHandler );
65 CmdGeneric *Builder::parseAction( const string &rAction )
67 return Interpreter::instance( getIntf() )->parseAction( rAction, m_pTheme );
72 #define ADD_OBJECTS( type ) \
73 list<BuilderData::type>::const_iterator it##type; \
74 for( it##type = m_rData.m_list##type.begin(); \
75 it##type != m_rData.m_list##type.end(); it##type++ ) \
77 add##type( *it##type ); \
81 Theme *Builder::build()
83 m_pTheme = new Theme( getIntf() );
84 if( m_pTheme == NULL )
89 // Create everything from the data in the XML
91 ADD_OBJECTS( Bitmap );
92 ADD_OBJECTS( BitmapFont );
94 ADD_OBJECTS( Window );
95 ADD_OBJECTS( Layout );
96 ADD_OBJECTS( Anchor );
97 ADD_OBJECTS( Button );
98 ADD_OBJECTS( Checkbox );
101 ADD_OBJECTS( RadialSlider );
102 ADD_OBJECTS( Slider );
104 ADD_OBJECTS( Video );
110 // Macro to get a bitmap by its ID in the builder
111 #define GET_BMP( pBmp, id ) \
114 pBmp = m_pTheme->getBitmapById(id); \
117 msg_Err( getIntf(), "unknown bitmap id: %s", id.c_str() ); \
122 void Builder::addTheme( const BuilderData::Theme &rData )
124 WindowManager &rManager = m_pTheme->getWindowManager();
125 rManager.setMagnetValue( rData.m_magnet );
126 rManager.setAlphaValue( rData.m_alpha );
127 rManager.setMoveAlphaValue( rData.m_moveAlpha );
128 GenericFont *pFont = getFont( rData.m_tooltipfont );
131 rManager.createTooltip( *pFont );
135 msg_Warn( getIntf(), "Invalid tooltip font: %s",
136 rData.m_tooltipfont.c_str() );
141 void Builder::addBitmap( const BuilderData::Bitmap &rData )
143 GenericBitmap *pBmp =
144 new PngBitmap( getIntf(), m_pImageHandler,
145 rData.m_fileName, rData.m_alphaColor );
146 m_pTheme->m_bitmaps[rData.m_id] = GenericBitmapPtr( pBmp );
150 void Builder::addBitmapFont( const BuilderData::BitmapFont &rData )
152 GenericBitmap *pBmp =
153 new PngBitmap( getIntf(), m_pImageHandler, rData.m_file, 0 );
154 m_pTheme->m_bitmaps[rData.m_id] = GenericBitmapPtr( pBmp );
156 GenericFont *pFont = new BitmapFont( getIntf(), *pBmp, rData.m_type );
159 m_pTheme->m_fonts[rData.m_id] = GenericFontPtr( pFont );
168 void Builder::addFont( const BuilderData::Font &rData )
170 GenericFont *pFont = new FT2Font( getIntf(), rData.m_fontFile,
174 m_pTheme->m_fonts[rData.m_id] = GenericFontPtr( pFont );
183 void Builder::addWindow( const BuilderData::Window &rData )
186 new TopWindow( getIntf(), rData.m_xPos, rData.m_yPos,
187 m_pTheme->getWindowManager(),
188 rData.m_dragDrop, rData.m_playOnDrop );
190 m_pTheme->m_windows[rData.m_id] = TopWindowPtr( pWin );
194 void Builder::addLayout( const BuilderData::Layout &rData )
196 TopWindow *pWin = m_pTheme->getWindowById(rData.m_windowId);
199 msg_Err( getIntf(), "unknown window id: %s", rData.m_windowId.c_str() );
203 int minWidth = rData.m_minWidth != -1 ? rData.m_minWidth : rData.m_width;
204 int maxWidth = rData.m_maxWidth != -1 ? rData.m_maxWidth : rData.m_width;
205 int minHeight = rData.m_minHeight != -1 ? rData.m_minHeight :
207 int maxHeight = rData.m_maxHeight != -1 ? rData.m_maxHeight :
209 GenericLayout *pLayout = new GenericLayout( getIntf(), rData.m_width,
211 minWidth, maxWidth, minHeight,
213 m_pTheme->m_layouts[rData.m_id] = GenericLayoutPtr( pLayout );
215 // Attach the layout to its window
216 m_pTheme->getWindowManager().addLayout( *pWin, *pLayout );
220 void Builder::addAnchor( const BuilderData::Anchor &rData )
222 GenericLayout *pLayout = m_pTheme->getLayoutById(rData.m_layoutId);
223 if( pLayout == NULL )
225 msg_Err( getIntf(), "unknown layout id: %s", rData.m_layoutId.c_str() );
229 Bezier *pCurve = getPoints( rData.m_points.c_str() );
232 msg_Err( getIntf(), "Invalid format in tag points=\"%s\"",
233 rData.m_points.c_str() );
236 m_pTheme->m_curves.push_back( BezierPtr( pCurve ) );
238 Anchor *pAnc = new Anchor( getIntf(), rData.m_xPos, rData.m_yPos,
239 rData.m_range, rData.m_priority,
241 pLayout->addAnchor( pAnc );
245 void Builder::addButton( const BuilderData::Button &rData )
247 // Get the bitmaps of the button
248 GenericBitmap *pBmpUp = NULL;
249 GET_BMP( pBmpUp, rData.m_upId );
251 GenericBitmap *pBmpDown = pBmpUp;
252 GET_BMP( pBmpDown, rData.m_downId );
254 GenericBitmap *pBmpOver = pBmpUp;
255 GET_BMP( pBmpOver, rData.m_overId );
257 GenericLayout *pLayout = m_pTheme->getLayoutById(rData.m_layoutId);
258 if( pLayout == NULL )
260 msg_Err( getIntf(), "unknown layout id: %s", rData.m_layoutId.c_str() );
264 CmdGeneric *pCommand = parseAction( rData.m_actionId );
265 if( pCommand == NULL )
267 msg_Err( getIntf(), "Invalid action: %s", rData.m_actionId.c_str() );
271 // Get the visibility variable
272 // XXX check when it is null
273 Interpreter *pInterpreter = Interpreter::instance( getIntf() );
274 VarBool *pVisible = pInterpreter->getVarBool( rData.m_visible, m_pTheme );
276 CtrlButton *pButton = new CtrlButton( getIntf(), *pBmpUp, *pBmpOver,
277 *pBmpDown, *pCommand, UString( getIntf(), rData.m_tooltip.c_str() ),
278 UString( getIntf(), rData.m_help.c_str() ), pVisible );
280 // Compute the position of the control
281 // XXX (we suppose all the images have the same size...)
282 const Position pos = makePosition( rData.m_leftTop, rData.m_rightBottom,
283 rData.m_xPos, rData.m_yPos,
285 pBmpUp->getHeight(), *pLayout );
287 pLayout->addControl( pButton, pos, rData.m_layer );
289 m_pTheme->m_controls[rData.m_id] = CtrlGenericPtr( pButton );
293 void Builder::addCheckbox( const BuilderData::Checkbox &rData )
295 // Get the bitmaps of the checkbox
296 GenericBitmap *pBmpUp1 = NULL;
297 GET_BMP( pBmpUp1, rData.m_up1Id );
299 GenericBitmap *pBmpDown1 = pBmpUp1;
300 GET_BMP( pBmpDown1, rData.m_down1Id );
302 GenericBitmap *pBmpOver1 = pBmpUp1;
303 GET_BMP( pBmpOver1, rData.m_over1Id );
305 GenericBitmap *pBmpUp2 = NULL;
306 GET_BMP( pBmpUp2, rData.m_up2Id );
308 GenericBitmap *pBmpDown2 = pBmpUp2;
309 GET_BMP( pBmpDown2, rData.m_down2Id );
311 GenericBitmap *pBmpOver2 = pBmpUp2;
312 GET_BMP( pBmpOver2, rData.m_over2Id );
314 GenericLayout *pLayout = m_pTheme->getLayoutById(rData.m_layoutId);
315 if( pLayout == NULL )
317 msg_Err( getIntf(), "unknown layout id: %s", rData.m_layoutId.c_str() );
321 CmdGeneric *pCommand1 = parseAction( rData.m_action1 );
322 if( pCommand1 == NULL )
324 msg_Err( getIntf(), "Invalid action: %s", rData.m_action1.c_str() );
328 CmdGeneric *pCommand2 = parseAction( rData.m_action2 );
329 if( pCommand2 == NULL )
331 msg_Err( getIntf(), "Invalid action: %s", rData.m_action2.c_str() );
335 // Get the state variable
336 Interpreter *pInterpreter = Interpreter::instance( getIntf() );
337 VarBool *pVar = pInterpreter->getVarBool( rData.m_state, m_pTheme );
340 // TODO: default state
344 // Get the visibility variable
345 // XXX check when it is null
346 VarBool *pVisible = pInterpreter->getVarBool( rData.m_visible, m_pTheme );
348 // Create the control
349 CtrlCheckbox *pCheckbox = new CtrlCheckbox( getIntf(), *pBmpUp1,
350 *pBmpOver1, *pBmpDown1, *pBmpUp2, *pBmpOver2, *pBmpDown2, *pCommand1,
351 *pCommand2, UString( getIntf(), rData.m_tooltip1.c_str() ),
352 UString( getIntf(), rData.m_tooltip2.c_str() ), *pVar,
353 UString( getIntf(), rData.m_help.c_str() ), pVisible );
355 // Compute the position of the control
356 // XXX (we suppose all the images have the same size...)
357 const Position pos = makePosition( rData.m_leftTop, rData.m_rightBottom,
358 rData.m_xPos, rData.m_yPos,
360 pBmpUp1->getHeight(), *pLayout );
362 pLayout->addControl( pCheckbox, pos, rData.m_layer );
364 m_pTheme->m_controls[rData.m_id] = CtrlGenericPtr( pCheckbox );
368 void Builder::addImage( const BuilderData::Image &rData )
370 GenericBitmap *pBmp = NULL;
371 GET_BMP( pBmp, rData.m_bmpId );
373 GenericLayout *pLayout = m_pTheme->getLayoutById(rData.m_layoutId);
374 if( pLayout == NULL )
376 msg_Err( getIntf(), "unknown layout id: %s", rData.m_layoutId.c_str() );
380 TopWindow *pWindow = m_pTheme->getWindowById(rData.m_windowId);
381 if( pWindow == NULL )
383 msg_Err( getIntf(), "unknown window id: %s", rData.m_windowId.c_str() );
387 // Get the visibility variable
388 // XXX check when it is null
389 Interpreter *pInterpreter = Interpreter::instance( getIntf() );
390 VarBool *pVisible = pInterpreter->getVarBool( rData.m_visible, m_pTheme );
392 CtrlImage::resize_t resizeMethod =
393 (rData.m_resize == "scale" ? CtrlImage::kScale : CtrlImage::kMosaic);
394 CtrlImage *pImage = new CtrlImage( getIntf(), *pBmp, resizeMethod,
395 UString( getIntf(), rData.m_help.c_str() ), pVisible );
397 // Compute the position of the control
398 const Position pos = makePosition( rData.m_leftTop, rData.m_rightBottom,
400 rData.m_yPos, pBmp->getWidth(),
401 pBmp->getHeight(), *pLayout );
403 // XXX: test to be changed! XXX
404 if( rData.m_actionId == "move" )
406 CtrlMove *pMove = new CtrlMove( getIntf(), m_pTheme->getWindowManager(),
407 *pImage, *pWindow, UString( getIntf(), rData.m_help.c_str() ),
409 pLayout->addControl( pMove, pos, rData.m_layer );
411 else if( rData.m_actionId == "resizeSE" )
413 CtrlResize *pResize = new CtrlResize( getIntf(), *pImage, *pLayout,
414 UString( getIntf(), rData.m_help.c_str() ), NULL );
415 pLayout->addControl( pResize, pos, rData.m_layer );
419 pLayout->addControl( pImage, pos, rData.m_layer );
422 m_pTheme->m_controls[rData.m_id] = CtrlGenericPtr( pImage );
426 void Builder::addText( const BuilderData::Text &rData )
428 GenericLayout *pLayout = m_pTheme->getLayoutById(rData.m_layoutId);
429 if( pLayout == NULL )
431 msg_Err( getIntf(), "unknown layout id: %s", rData.m_layoutId.c_str() );
435 GenericFont *pFont = getFont( rData.m_fontId );
438 msg_Err( getIntf(), "Unknown font id: %s", rData.m_fontId.c_str() );
442 // Create a text variable
443 VarText *pVar = new VarText( getIntf() );
444 UString msg( getIntf(), rData.m_text.c_str() );
446 m_pTheme->m_vars.push_back( VariablePtr( pVar ) );
448 // Get the visibility variable
449 // XXX check when it is null
450 Interpreter *pInterpreter = Interpreter::instance( getIntf() );
451 VarBool *pVisible = pInterpreter->getVarBool( rData.m_visible, m_pTheme );
453 CtrlText *pText = new CtrlText( getIntf(), *pVar, *pFont,
454 UString( getIntf(), rData.m_help.c_str() ), rData.m_color, pVisible );
456 int height = pFont->getSize();
458 // Compute the position of the control
459 const Position pos = makePosition( rData.m_leftTop, rData.m_rightBottom,
460 rData.m_xPos, rData.m_yPos,
461 rData.m_width, height,
464 pLayout->addControl( pText, pos, rData.m_layer );
466 m_pTheme->m_controls[rData.m_id] = CtrlGenericPtr( pText );
470 void Builder::addRadialSlider( const BuilderData::RadialSlider &rData )
472 // Get the bitmaps of the slider
473 GenericBitmap *pSeq = NULL;
474 GET_BMP( pSeq, rData.m_sequence );
476 GenericLayout *pLayout = m_pTheme->getLayoutById(rData.m_layoutId);
477 if( pLayout == NULL )
479 msg_Err( getIntf(), "unknown layout id: %s", rData.m_layoutId.c_str() );
483 // Get the variable associated to the slider
484 Interpreter *pInterpreter = Interpreter::instance( getIntf() );
485 VarPercent *pVar = pInterpreter->getVarPercent( rData.m_value, m_pTheme );
488 msg_Err( getIntf(), "Unknown slider value: %s", rData.m_value.c_str() );
492 // Get the visibility variable
493 // XXX check when it is null
494 VarBool *pVisible = pInterpreter->getVarBool( rData.m_visible, m_pTheme );
496 // Create the control
497 CtrlRadialSlider *pRadial =
498 new CtrlRadialSlider( getIntf(), *pSeq, rData.m_nbImages, *pVar,
499 rData.m_minAngle, rData.m_maxAngle,
500 UString( getIntf(), rData.m_help.c_str() ),
503 // XXX: resizing is not supported
504 // Compute the position of the control
506 makePosition( rData.m_leftTop, rData.m_rightBottom, rData.m_xPos,
507 rData.m_yPos, pSeq->getWidth(),
508 pSeq->getHeight() / rData.m_nbImages, *pLayout );
510 pLayout->addControl( pRadial, pos, rData.m_layer );
512 m_pTheme->m_controls[rData.m_id] = CtrlGenericPtr( pRadial );
516 void Builder::addSlider( const BuilderData::Slider &rData )
518 // Get the bitmaps of the slider
519 GenericBitmap *pBmpUp = NULL;
520 GET_BMP( pBmpUp, rData.m_upId );
522 GenericBitmap *pBmpDown = pBmpUp;
523 GET_BMP( pBmpDown, rData.m_downId );
525 GenericBitmap *pBmpOver = pBmpUp;
526 GET_BMP( pBmpOver, rData.m_overId );
528 GenericLayout *pLayout = m_pTheme->getLayoutById(rData.m_layoutId);
529 if( pLayout == NULL )
531 msg_Err( getIntf(), "unknown layout id: %s", rData.m_layoutId.c_str() );
535 Bezier *pCurve = getPoints( rData.m_points.c_str() );
538 msg_Err( getIntf(), "Invalid format in tag points=\"%s\"",
539 rData.m_points.c_str() );
542 m_pTheme->m_curves.push_back( BezierPtr( pCurve ) );
544 // Get the visibility variable
545 // XXX check when it is null
546 Interpreter *pInterpreter = Interpreter::instance( getIntf() );
547 VarBool *pVisible = pInterpreter->getVarBool( rData.m_visible, m_pTheme );
549 // Get the variable associated to the slider
550 VarPercent *pVar = pInterpreter->getVarPercent( rData.m_value, m_pTheme );
553 msg_Err( getIntf(), "Unknown slider value: %s", rData.m_value.c_str() );
557 // Create the cursor and background controls
558 CtrlSliderCursor *pCursor = new CtrlSliderCursor( getIntf(), *pBmpUp,
559 *pBmpOver, *pBmpDown, *pCurve, *pVar, pVisible,
560 UString( getIntf(), rData.m_tooltip.c_str() ),
561 UString( getIntf(), rData.m_help.c_str() ) );
563 CtrlSliderBg *pBackground = new CtrlSliderBg( getIntf(), *pCursor,
564 *pCurve, *pVar, rData.m_thickness, pVisible,
565 UString( getIntf(), rData.m_help.c_str() ) );
567 // Compute the position of the control
568 const Position pos = makePosition( rData.m_leftTop, rData.m_rightBottom,
569 rData.m_xPos, rData.m_yPos,
570 pCurve->getWidth(), pCurve->getHeight(),
573 pLayout->addControl( pBackground, pos, rData.m_layer );
574 pLayout->addControl( pCursor, pos, rData.m_layer );
576 m_pTheme->m_controls[rData.m_id] = CtrlGenericPtr( pCursor );
577 m_pTheme->m_controls[rData.m_id + "_bg"] = CtrlGenericPtr( pBackground );
581 void Builder::addList( const BuilderData::List &rData )
583 GenericLayout *pLayout = m_pTheme->getLayoutById(rData.m_layoutId);
584 if( pLayout == NULL )
586 msg_Err( getIntf(), "unknown layout id: %s", rData.m_layoutId.c_str() );
590 GenericFont *pFont = getFont( rData.m_fontId );
593 msg_Err( getIntf(), "Unknown font id: %s", rData.m_fontId.c_str() );
597 // Get the list variable
598 Interpreter *pInterpreter = Interpreter::instance( getIntf() );
599 VarList *pVar = pInterpreter->getVarList( rData.m_var, m_pTheme );
602 msg_Err( getIntf(), "No such list variable: %s", rData.m_var.c_str() );
606 // Get the visibility variable
607 // XXX check when it is null
608 VarBool *pVisible = pInterpreter->getVarBool( rData.m_visible, m_pTheme );
610 // Create the list control
611 CtrlList *pList = new CtrlList( getIntf(), *pVar, *pFont,
612 rData.m_fgColor, rData.m_playColor, rData.m_bgColor1,
613 rData.m_bgColor2, rData.m_selColor,
614 UString( getIntf(), rData.m_help.c_str() ), pVisible );
616 // Compute the position of the control
617 const Position pos = makePosition( rData.m_leftTop, rData.m_rightBottom,
618 rData.m_xPos, rData.m_yPos,
619 rData.m_width, rData.m_height,
622 pLayout->addControl( pList, pos, rData.m_layer );
624 m_pTheme->m_controls[rData.m_id] = CtrlGenericPtr( pList );
628 void Builder::addVideo( const BuilderData::Video &rData )
630 GenericLayout *pLayout = m_pTheme->getLayoutById(rData.m_layoutId);
631 if( pLayout == NULL )
633 msg_Err( getIntf(), "unknown layout id: %s", rData.m_layoutId.c_str() );
637 // Get the visibility variable
638 // XXX check when it is null
639 Interpreter *pInterpreter = Interpreter::instance( getIntf() );
640 VarBool *pVisible = pInterpreter->getVarBool( rData.m_visible, m_pTheme );
642 CtrlVideo *pVideo = new CtrlVideo( getIntf(),
643 UString( getIntf(), rData.m_help.c_str() ), pVisible );
645 // Compute the position of the control
646 const Position pos = makePosition( rData.m_leftTop, rData.m_rightBottom,
647 rData.m_xPos, rData.m_yPos,
648 rData.m_width, rData.m_height,
651 pLayout->addControl( pVideo, pos, rData.m_layer );
653 m_pTheme->m_controls[rData.m_id] = CtrlGenericPtr( pVideo );
657 const Position Builder::makePosition( const string &rLeftTop,
658 const string &rRightBottom,
659 int xPos, int yPos, int width,
660 int height, const Box &rBox ) const
662 int left = 0, top = 0, right = 0, bottom = 0;
663 Position::Ref_t refLeftTop = Position::kLeftTop;
664 Position::Ref_t refRightBottom = Position::kLeftTop;
666 int boxWidth = rBox.getWidth();
667 int boxHeight = rBox.getHeight();
669 // Position of the left top corner
670 if( rLeftTop == "lefttop" )
674 refLeftTop = Position::kLeftTop;
676 else if( rLeftTop == "righttop" )
678 left = xPos - boxWidth + 1;
680 refLeftTop = Position::kRightTop;
682 else if( rLeftTop == "leftbottom" )
685 top = yPos - boxHeight + 1;
686 refLeftTop = Position::kLeftBottom;
688 else if( rLeftTop == "rightbottom" )
690 left = xPos - boxWidth + 1;
691 top = yPos - boxHeight + 1;
692 refLeftTop = Position::kRightBottom;
695 // Position of the right bottom corner
696 if( rRightBottom == "lefttop" )
698 right = xPos + width - 1;
699 bottom = yPos + height - 1;
700 refRightBottom = Position::kLeftTop;
702 else if( rRightBottom == "righttop" )
704 right = xPos + width - boxWidth;
705 bottom = yPos + height - 1;
706 refRightBottom = Position::kRightTop;
708 else if( rRightBottom == "leftbottom" )
710 right = xPos + width - 1;
711 bottom = yPos + height - boxHeight;
712 refRightBottom = Position::kLeftBottom;
714 else if( rRightBottom == "rightbottom" )
716 right = xPos + width - boxWidth;
717 bottom = yPos + height - boxHeight;
718 refRightBottom = Position::kRightBottom;
721 return Position( left, top, right, bottom, rBox, refLeftTop,
726 GenericFont *Builder::getFont( const string &fontId )
728 GenericFont *pFont = m_pTheme->getFontById(fontId);
729 if( !pFont && fontId == "defaultfont" )
731 // Get the resource path and try to load the default font
732 OSFactory *pOSFactory = OSFactory::instance( getIntf() );
733 const list<string> &resPath = pOSFactory->getResourcePath();
734 const string &sep = pOSFactory->getDirSeparator();
736 list<string>::const_iterator it;
737 for( it = resPath.begin(); it != resPath.end(); it++ )
739 string path = (*it) + sep + "fonts" + sep + "FreeSans.ttf";
740 pFont = new FT2Font( getIntf(), path, 12 );
743 // Font loaded successfully
744 m_pTheme->m_fonts["defaultfont"] = GenericFontPtr( pFont );
755 msg_Err( getIntf(), "Failed to open the default font" );
762 Bezier *Builder::getPoints( const char *pTag ) const
764 vector<float> xBez, yBez;
768 if( sscanf( pTag, "(%d,%d)%n", &x, &y, &n ) < 1 )
776 "Slider points cannot have negative coordinates!" );
787 if( *(pTag++) != ',' )
793 // Create the Bezier curve
794 return new Bezier( getIntf(), xBez, yBez );