]> git.sesse.net Git - vlc/blob - modules/gui/skins2/parser/builder.cpp
* parser/builder.cpp, parser/skin_parser.cpp: unique IDs are generated
[vlc] / modules / gui / skins2 / parser / builder.cpp
1 /*****************************************************************************
2  * builder.cpp
3  *****************************************************************************
4  * Copyright (C) 2003 VideoLAN
5  * $Id: builder.cpp,v 1.8 2004/03/01 18:33:31 asmax Exp $
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 #include <string.h>
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/generic_window.hpp"
33 #include "../src/anchor.hpp"
34 #include "../src/ft2_font.hpp"
35 #include "../src/theme.hpp"
36 #include "../controls/ctrl_button.hpp"
37 #include "../controls/ctrl_checkbox.hpp"
38 #include "../controls/ctrl_image.hpp"
39 #include "../controls/ctrl_list.hpp"
40 #include "../controls/ctrl_move.hpp"
41 #include "../controls/ctrl_resize.hpp"
42 #include "../controls/ctrl_slider.hpp"
43 #include "../controls/ctrl_radialslider.hpp"
44 #include "../controls/ctrl_text.hpp"
45 #include "../utils/position.hpp"
46 #include "../utils/var_bool.hpp"
47 #include "../utils/var_text.hpp"
48
49
50 Builder::Builder( intf_thread_t *pIntf, const BuilderData &rData):
51     SkinObject( pIntf ), m_rData( rData ), m_pTheme( NULL )
52 {
53 }
54
55
56 CmdGeneric *Builder::parseAction( const string &rAction )
57 {
58     return Interpreter::instance( getIntf() )->parseAction( rAction, m_pTheme );
59 }
60
61
62 // Useful macro
63 #define ADD_OBJECTS( type ) \
64     list<BuilderData::type>::const_iterator it##type; \
65     for( it##type = m_rData.m_list##type.begin(); \
66          it##type != m_rData.m_list##type.end(); it##type++ ) \
67     { \
68         add##type( *it##type ); \
69     }
70
71
72 Theme *Builder::build()
73 {
74     m_pTheme = new Theme( getIntf() );
75     if( m_pTheme == NULL )
76     {
77         return NULL;
78     }
79
80     // Create everything from the data in the XML
81     ADD_OBJECTS( Theme );
82     ADD_OBJECTS( Bitmap );
83     ADD_OBJECTS( Font );
84     ADD_OBJECTS( Window );
85     ADD_OBJECTS( Layout );
86     ADD_OBJECTS( Anchor );
87     ADD_OBJECTS( Button );
88     ADD_OBJECTS( Checkbox );
89     ADD_OBJECTS( Image );
90     ADD_OBJECTS( Text );
91     ADD_OBJECTS( RadialSlider );
92     ADD_OBJECTS( Slider );
93     ADD_OBJECTS( List );
94
95     return m_pTheme;
96 }
97
98
99 // Macro to get a bitmap by its ID in the builder
100 #define GET_BMP( pBmp, id ) \
101     if( id != "none" ) \
102     { \
103         pBmp = m_pTheme->m_bitmaps[id].get(); \
104         if( pBmp == NULL ) \
105         { \
106             msg_Err( getIntf(), "unknown bitmap id: %s", id.c_str() ); \
107             return; \
108         } \
109     }
110
111 void Builder::addTheme( const BuilderData::Theme &rData )
112 {
113     m_pTheme->getWindowManager().setMagnetValue( rData.m_magnet );
114     m_pTheme->getWindowManager().setAlphaValue( rData.m_alpha );
115     m_pTheme->getWindowManager().setMoveAlphaValue( rData.m_moveAlpha );
116 }
117
118
119 void Builder::addBitmap( const BuilderData::Bitmap &rData )
120 {
121     GenericBitmap *pBmp = new PngBitmap( getIntf(), rData.m_fileName,
122                                          rData.m_alphaColor );
123     m_pTheme->m_bitmaps[rData.m_id] = GenericBitmapPtr( pBmp );
124 }
125
126
127 void Builder::addFont( const BuilderData::Font &rData )
128 {
129     GenericFont *pFont = new FT2Font( getIntf(), rData.m_fontName,
130                                       rData.m_size );
131     pFont->init();
132     m_pTheme->m_fonts[rData.m_id] = GenericFontPtr( pFont );
133 }
134
135
136 void Builder::addWindow( const BuilderData::Window &rData )
137 {
138     // XXX:  font to fix
139     GenericFont *pFont = new FT2Font( getIntf(), "FreeSans.ttf", 12 );
140     pFont->init();
141     GenericWindow *pWin =
142         new GenericWindow( getIntf(), rData.m_xPos, rData.m_yPos,
143                            m_pTheme->getWindowManager(), *pFont,
144                            rData.m_dragDrop, rData.m_playOnDrop );
145
146     m_pTheme->m_windows[rData.m_id] = GenericWindowPtr( pWin );
147 }
148
149
150 void Builder::addLayout( const BuilderData::Layout &rData )
151 {
152     GenericWindow *pWin = m_pTheme->m_windows[rData.m_windowId].get();
153     if( pWin == NULL )
154     {
155         msg_Err( getIntf(), "unknown window id: %s", rData.m_windowId.c_str() );
156         return;
157     }
158
159     int minWidth = rData.m_minWidth != -1 ? rData.m_minWidth : rData.m_width;
160     int maxWidth = rData.m_maxWidth != -1 ? rData.m_maxWidth : rData.m_width;
161     int minHeight = rData.m_minHeight != -1 ? rData.m_minHeight :
162                     rData.m_height;
163     int maxHeight = rData.m_maxHeight != -1 ? rData.m_maxHeight :
164                     rData.m_height;
165     GenericLayout *pLayout = new GenericLayout( getIntf(), rData.m_width,
166                                                 rData.m_height,
167                                                 minWidth, maxWidth, minHeight,
168                                                 maxHeight );
169     m_pTheme->m_layouts[rData.m_id] = GenericLayoutPtr( pLayout );
170
171     // Attach the layout to its window
172     pWin->setActiveLayout( pLayout );
173 }
174
175
176 void Builder::addAnchor( const BuilderData::Anchor &rData )
177 {
178     GenericWindow *pWin = m_pTheme->m_windows[rData.m_windowId].get();
179     if( pWin == NULL )
180     {
181         msg_Err( getIntf(), "unknown window id: %s", rData.m_windowId.c_str() );
182         return;
183     }
184
185     Anchor *pAnc = new Anchor( getIntf(), rData.m_xPos, rData.m_yPos,
186                                rData.m_range, rData.m_priority, *pWin );
187     pWin->addAnchor( pAnc );
188 }
189
190
191 void Builder::addButton( const BuilderData::Button &rData )
192 {
193     // Get the bitmaps of the button
194     GenericBitmap *pBmpUp = NULL;
195     GET_BMP( pBmpUp, rData.m_upId );
196
197     GenericBitmap *pBmpDown = pBmpUp;
198     GET_BMP( pBmpDown, rData.m_downId );
199
200     GenericBitmap *pBmpOver = pBmpUp;
201     GET_BMP( pBmpOver, rData.m_overId );
202
203     GenericLayout *pLayout = m_pTheme->m_layouts[rData.m_layoutId].get();
204     if( pLayout == NULL )
205     {
206         msg_Err( getIntf(), "unknown layout id: %s", rData.m_layoutId.c_str() );
207         return;
208     }
209
210     CmdGeneric *pCommand = parseAction( rData.m_actionId );
211     if( pCommand == NULL )
212     {
213         msg_Err( getIntf(), "Invalid action: %s", rData.m_actionId.c_str() );
214         return;
215     }
216
217     CtrlButton *pButton = new CtrlButton( getIntf(), *pBmpUp, *pBmpOver,
218         *pBmpDown, *pCommand, UString( getIntf(), rData.m_tooltip.c_str() ),
219         UString( getIntf(), rData.m_help.c_str() ), NULL );
220
221     // Compute the position of the control
222     // XXX (we suppose all the images have the same size...)
223     const Position pos = makePosition( rData.m_leftTop, rData.m_rightBottom,
224                                        rData.m_xPos, rData.m_yPos,
225                                        pBmpUp->getWidth(),
226                                        pBmpUp->getHeight(), *pLayout );
227
228     pLayout->addControl( pButton, pos, rData.m_layer );
229
230     m_pTheme->m_controls[rData.m_id] = CtrlGenericPtr( pButton );
231 }
232
233
234 void Builder::addCheckbox( const BuilderData::Checkbox &rData )
235 {
236     // Get the bitmaps of the checkbox
237     GenericBitmap *pBmpUp1 = NULL;
238     GET_BMP( pBmpUp1, rData.m_up1Id );
239
240     GenericBitmap *pBmpDown1 = pBmpUp1;
241     GET_BMP( pBmpDown1, rData.m_down1Id );
242
243     GenericBitmap *pBmpOver1 = pBmpUp1;
244     GET_BMP( pBmpOver1, rData.m_over1Id );
245
246     GenericBitmap *pBmpUp2 = NULL;
247     GET_BMP( pBmpUp2, rData.m_up2Id );
248
249     GenericBitmap *pBmpDown2 = pBmpUp2;
250     GET_BMP( pBmpDown2, rData.m_down2Id );
251
252     GenericBitmap *pBmpOver2 = pBmpUp2;
253     GET_BMP( pBmpOver2, rData.m_over2Id );
254
255     GenericLayout *pLayout = m_pTheme->m_layouts[rData.m_layoutId].get();
256     if( pLayout == NULL )
257     {
258         msg_Err( getIntf(), "unknown layout id: %s", rData.m_layoutId.c_str() );
259         return;
260     }
261
262     CmdGeneric *pCommand1 = parseAction( rData.m_action1 );
263     if( pCommand1 == NULL )
264     {
265         msg_Err( getIntf(), "Invalid action: %s", rData.m_action1.c_str() );
266         return;
267     }
268
269     CmdGeneric *pCommand2 = parseAction( rData.m_action2 );
270     if( pCommand2 == NULL )
271     {
272         msg_Err( getIntf(), "Invalid action: %s", rData.m_action2.c_str() );
273         return;
274     }
275
276     // Get the state variable
277     Interpreter *pInterpreter = Interpreter::instance( getIntf() );
278     VarBool *pVar = pInterpreter->getVarBool( rData.m_state, m_pTheme );
279     if( pVar == NULL )
280     {
281         // TODO: default state
282         return;
283     }
284
285     // Create the control
286     CtrlCheckbox *pCheckbox = new CtrlCheckbox( getIntf(), *pBmpUp1,
287         *pBmpOver1, *pBmpDown1, *pBmpUp2, *pBmpOver2, *pBmpDown2, *pCommand1,
288         *pCommand2, UString( getIntf(), rData.m_tooltip1.c_str() ),
289         UString( getIntf(), rData.m_tooltip2.c_str() ), *pVar,
290         UString( getIntf(), rData.m_help.c_str() ), NULL );
291
292     // Compute the position of the control
293     // XXX (we suppose all the images have the same size...)
294     const Position pos = makePosition( rData.m_leftTop, rData.m_rightBottom,
295                                        rData.m_xPos, rData.m_yPos,
296                                        pBmpUp1->getWidth(),
297                                        pBmpUp1->getHeight(), *pLayout );
298
299     pLayout->addControl( pCheckbox, pos, rData.m_layer );
300
301     m_pTheme->m_controls[rData.m_id] = CtrlGenericPtr( pCheckbox );
302 }
303
304
305 void Builder::addImage( const BuilderData::Image &rData )
306 {
307     GenericBitmap *pBmp = NULL;
308     GET_BMP( pBmp, rData.m_bmpId );
309
310     GenericLayout *pLayout = m_pTheme->m_layouts[rData.m_layoutId].get();
311     if( pLayout == NULL )
312     {
313         msg_Err( getIntf(), "unknown layout id: %s", rData.m_layoutId.c_str() );
314         return;
315     }
316
317     GenericWindow *pWindow = m_pTheme->m_windows[rData.m_windowId].get();
318     if( pWindow == NULL )
319     {
320         msg_Err( getIntf(), "unknown window id: %s", rData.m_windowId.c_str() );
321         return;
322     }
323
324     CtrlImage *pImage = new CtrlImage( getIntf(), *pBmp,
325                                 UString( getIntf(), rData.m_help.c_str() ),
326                                 NULL);
327
328     // Compute the position of the control
329     const Position pos = makePosition( rData.m_leftTop, rData.m_rightBottom,
330                                        rData.m_xPos,
331                                        rData.m_yPos, pBmp->getWidth(),
332                                        pBmp->getHeight(), *pLayout );
333
334     // XXX: test to be changed! XXX
335     if( rData.m_onclickId == "move" )
336     {
337         CtrlMove *pMove = new CtrlMove( getIntf(), m_pTheme->getWindowManager(),
338              *pImage, *pWindow, UString( getIntf(), rData.m_help.c_str() ),
339              NULL);
340         pLayout->addControl( pMove, pos, rData.m_layer );
341     }
342     else if( rData.m_onclickId == "resize" )
343     {
344         CtrlResize *pResize = new CtrlResize( getIntf(), *pImage, *pLayout,
345                 UString( getIntf(), rData.m_help.c_str() ), NULL );
346         pLayout->addControl( pResize, pos, rData.m_layer );
347     }
348     else
349     {
350         pLayout->addControl( pImage, pos, rData.m_layer );
351     }
352
353     m_pTheme->m_controls[rData.m_id] = CtrlGenericPtr( pImage );
354 }
355
356
357 void Builder::addText( const BuilderData::Text &rData )
358 {
359     GenericLayout *pLayout = m_pTheme->m_layouts[rData.m_layoutId].get();
360     if( pLayout == NULL )
361     {
362         msg_Err( getIntf(), "unknown layout id: %s", rData.m_layoutId.c_str() );
363         return;
364     }
365
366     GenericFont *pFont = m_pTheme->m_fonts[rData.m_fontId].get();
367     if( pFont == NULL )
368     {
369         msg_Err( getIntf(), "Unknown font id: %s", rData.m_fontId.c_str() );
370         return;
371     }
372
373     // Create a text variable
374     VarText *pVar = new VarText( getIntf() );
375     UString msg( getIntf(), rData.m_text.c_str() );
376     pVar->set( msg );
377     m_pTheme->m_vars.push_back( VariablePtr( pVar ) );
378
379     CtrlText *pText = new CtrlText( getIntf(), *pVar, *pFont,
380             UString( getIntf(), rData.m_help.c_str() ), rData.m_color, NULL );
381
382     int height = pFont->getSize();
383
384     pLayout->addControl( pText, Position( rData.m_xPos, rData.m_yPos,
385                                           rData.m_xPos + rData.m_width,
386                                           rData.m_yPos + height, *pLayout ),
387                          rData.m_layer );
388
389     m_pTheme->m_controls[rData.m_id] = CtrlGenericPtr( pText );
390 }
391
392
393 void Builder::addRadialSlider( const BuilderData::RadialSlider &rData )
394 {
395     // Get the bitmaps of the slider
396     GenericBitmap *pSeq = NULL;
397     GET_BMP( pSeq, rData.m_sequence );
398
399     GenericLayout *pLayout = m_pTheme->m_layouts[rData.m_layoutId].get();
400     if( pLayout == NULL )
401     {
402         msg_Err( getIntf(), "unknown layout id: %s", rData.m_layoutId.c_str() );
403         return;
404     }
405
406     // Get the variable associated to the slider
407     Interpreter *pInterpreter = Interpreter::instance( getIntf() );
408     VarPercent *pVar = pInterpreter->getVarPercent( rData.m_value, m_pTheme );
409     if( pVar == NULL )
410     {
411         msg_Err( getIntf(), "Unknown slider value: %s", rData.m_value.c_str() );
412         return;
413     }
414
415     // Create the control
416     CtrlRadialSlider *pRadial =
417         new CtrlRadialSlider( getIntf(), *pSeq, rData.m_nbImages, *pVar,
418                               rData.m_minAngle, rData.m_maxAngle,
419                               UString( getIntf(), rData.m_help.c_str() ),
420                               NULL );
421
422     // XXX: resizing is not supported
423     // Compute the position of the control
424     const Position pos =
425         makePosition( rData.m_leftTop, rData.m_rightBottom, rData.m_xPos,
426                       rData.m_yPos, pSeq->getWidth(),
427                       pSeq->getHeight() / rData.m_nbImages, *pLayout );
428
429     pLayout->addControl( pRadial, pos, rData.m_layer );
430
431     m_pTheme->m_controls[rData.m_id] = CtrlGenericPtr( pRadial );
432 }
433
434
435 void Builder::addSlider( const BuilderData::Slider &rData )
436 {
437     // Get the bitmaps of the slider
438     GenericBitmap *pBmpUp = NULL;
439     GET_BMP( pBmpUp, rData.m_upId );
440
441     GenericBitmap *pBmpDown = pBmpUp;
442     GET_BMP( pBmpDown, rData.m_downId );
443
444     GenericBitmap *pBmpOver = pBmpUp;
445     GET_BMP( pBmpOver, rData.m_overId );
446
447     GenericLayout *pLayout = m_pTheme->m_layouts[rData.m_layoutId].get();
448     if( pLayout == NULL )
449     {
450         msg_Err( getIntf(), "unknown layout id: %s", rData.m_layoutId.c_str() );
451         return;
452     }
453
454     Bezier *pCurve = getPoints( rData.m_points.c_str() );
455     if( pCurve == NULL )
456     {
457         msg_Err( getIntf(), "Invalid format in tag points=\"%s\"",
458                  rData.m_points.c_str() );
459         return;
460     }
461     m_pTheme->m_curves.push_back( BezierPtr( pCurve ) );
462
463     // Get the visibility variable
464     // XXX check when it is null
465     Interpreter *pInterpreter = Interpreter::instance( getIntf() );
466     VarBool *pVisible = pInterpreter->getVarBool( rData.m_visible, m_pTheme );
467
468     // Get the variable associated to the slider
469     VarPercent *pVar = pInterpreter->getVarPercent( rData.m_value, m_pTheme );
470     if( pVar == NULL )
471     {
472         msg_Err( getIntf(), "Unknown slider value: %s", rData.m_value.c_str() );
473         return;
474     }
475
476     // Create the cursor and background controls
477     CtrlSliderCursor *pCursor = new CtrlSliderCursor( getIntf(), *pBmpUp,
478         *pBmpOver, *pBmpDown, *pCurve, *pVar, pVisible,
479         UString( getIntf(), rData.m_tooltip.c_str() ),
480         UString( getIntf(), rData.m_help.c_str() ) );
481
482     CtrlSliderBg *pBackground = new CtrlSliderBg( getIntf(), *pCursor,
483         *pCurve, *pVar, rData.m_thickness, pVisible,
484         UString( getIntf(), rData.m_help.c_str() ) );
485
486     // Compute the position of the control
487     const Position pos = makePosition( rData.m_leftTop, rData.m_rightBottom,
488                                        rData.m_xPos, rData.m_yPos,
489                                        pCurve->getWidth(), pCurve->getHeight(),
490                                        *pLayout );
491
492     pLayout->addControl( pBackground, pos, rData.m_layer );
493     pLayout->addControl( pCursor, pos, rData.m_layer );
494
495     m_pTheme->m_controls[rData.m_id] = CtrlGenericPtr( pCursor );
496     m_pTheme->m_controls[rData.m_id + "_bg"] = CtrlGenericPtr( pBackground );
497 }
498
499
500 void Builder::addList( const BuilderData::List &rData )
501 {
502     GenericLayout *pLayout = m_pTheme->m_layouts[rData.m_layoutId].get();
503     if( pLayout == NULL )
504     {
505         msg_Err( getIntf(), "unknown layout id: %s", rData.m_layoutId.c_str() );
506         return;
507     }
508
509     GenericFont *pFont = m_pTheme->m_fonts[rData.m_fontId].get();
510     if( pFont == NULL )
511     {
512         msg_Err( getIntf(), "Unknown font id: %s", rData.m_fontId.c_str() );
513         return;
514     }
515
516     // Get the list variable
517     Interpreter *pInterpreter = Interpreter::instance( getIntf() );
518     VarList *pVar = pInterpreter->getVarList( rData.m_var, m_pTheme );
519     if( pVar == NULL )
520     {
521         msg_Err( getIntf(), "No such list variable: %s", rData.m_var.c_str() );
522         return;
523     }
524
525     // Create the list control
526     CtrlList *pList = new CtrlList( getIntf(), *pVar, *pFont,
527        rData.m_fgColor, rData.m_playColor, rData.m_bgColor1,
528        rData.m_bgColor2, rData.m_selColor,
529        UString( getIntf(), rData.m_help.c_str() ), NULL );
530
531     // Compute the position of the control
532     const Position pos = makePosition( rData.m_leftTop, rData.m_rightBottom,
533                                        rData.m_xPos, rData.m_yPos,
534                                        rData.m_width, rData.m_height,
535                                        *pLayout );
536
537     pLayout->addControl( pList, pos, rData.m_layer );
538
539     m_pTheme->m_controls[rData.m_id] = CtrlGenericPtr( pList );
540 }
541
542
543 const Position Builder::makePosition( const string &rLeftTop,
544                                       const string &rRightBottom,
545                                       int xPos, int yPos, int width,
546                                       int height, const Box &rBox ) const
547 {
548     int left = 0, top = 0, right = 0, bottom = 0;
549     Position::Ref_t refLeftTop = Position::kLeftTop;
550     Position::Ref_t refRightBottom = Position::kLeftTop;
551
552     int boxWidth = rBox.getWidth();
553     int boxHeight = rBox.getHeight();
554
555     // Position of the left top corner
556     if( rLeftTop == "lefttop" )
557     {
558         left = xPos;
559         top = yPos;
560         refLeftTop = Position::kLeftTop;
561     }
562     else if( rLeftTop == "righttop" )
563     {
564         left = xPos - boxWidth + 1;
565         top = yPos;
566         refLeftTop = Position::kRightTop;
567     }
568     else if( rLeftTop == "leftbottom" )
569     {
570         left = xPos;
571         top = yPos - boxHeight + 1;
572         refLeftTop = Position::kLeftBottom;
573     }
574     else if( rLeftTop == "rightbottom" )
575     {
576         left = xPos - boxWidth + 1;
577         top = yPos - boxHeight + 1;
578         refLeftTop = Position::kRightBottom;
579     }
580
581     // Position of the right bottom corner
582     if( rRightBottom == "lefttop" )
583     {
584         right = xPos + width - 1;
585         bottom = yPos + height - 1;
586         refRightBottom = Position::kLeftTop;
587     }
588     else if( rRightBottom == "righttop" )
589     {
590         right = xPos + width - boxWidth;
591         bottom = yPos + height - 1;
592         refRightBottom = Position::kRightTop;
593     }
594     else if( rRightBottom == "leftbottom" )
595     {
596         right = xPos + width - 1;
597         bottom = yPos + height - boxHeight;
598         refRightBottom = Position::kLeftBottom;
599     }
600     else if( rRightBottom == "rightbottom" )
601     {
602         right = xPos + width - boxWidth;
603         bottom = yPos + height - boxHeight;
604         refRightBottom = Position::kRightBottom;
605     }
606
607     return Position( left, top, right, bottom, rBox, refLeftTop,
608                      refRightBottom );
609 }
610
611
612 Bezier *Builder::getPoints( const char *pTag ) const
613 {
614     vector<float> xBez, yBez;
615     int x, y, n;
616     while( 1 )
617     {
618         if( sscanf( pTag, "(%d,%d)%n", &x, &y, &n ) < 2 )
619         {
620             return NULL;
621         }
622         if( x < 0 || y < 0 )
623         {
624             msg_Err( getIntf(),
625                      "Slider points cannot have negative coordinates!" );
626             return NULL;
627         }
628         xBez.push_back( x );
629         yBez.push_back( y );
630         pTag += n;
631         if( *pTag == '\0' )
632         {
633             break;
634         }
635         if( *(pTag++) != ',' )
636         {
637             return NULL;
638         }
639     }
640
641     // Create the Bezier curve
642     return new Bezier( getIntf(), xBez, yBez );
643 }
644