Commit 1628f2f2 authored by Cyril Deguet's avatar Cyril Deguet

* all: replaced the flex parser by the libxml one

* src/window_manager.cpp: improved the raise window algorithm
* src/tooltip.cpp: fixed a segfault after changing a theme
parent b6abc4fa
......@@ -67,16 +67,12 @@ SOURCES_skins2 = \
parser/builder.cpp \
parser/builder.hpp \
parser/builder_data.hpp \
parser/flex.c \
parser/interpreter.cpp \
parser/interpreter.hpp \
parser/parser_context.hpp \
parser/skin.c \
parser/skin.h \
parser/skin_parser.cpp \
parser/skin_parser.hpp \
parser/xmlparser.cpp \
parser/xmlparser.hpp \
parser/wrappers.cpp \
parser/wrappers.h \
\
src/anchor.cpp \
src/anchor.hpp \
......
......@@ -2,7 +2,7 @@
* builder.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: builder.cpp,v 1.2 2004/01/11 17:12:17 asmax Exp $
* $Id: builder.cpp,v 1.3 2004/01/25 11:44:19 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -47,7 +47,7 @@
#include "../utils/var_text.hpp"
Builder::Builder( intf_thread_t *pIntf, BuilderData &rData):
Builder::Builder( intf_thread_t *pIntf, const BuilderData &rData):
SkinObject( pIntf ), m_rData( rData ), m_pTheme( NULL )
{
}
......
......@@ -2,7 +2,7 @@
* builder.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: builder.hpp,v 1.2 2004/01/11 17:12:17 asmax Exp $
* $Id: builder.hpp,v 1.3 2004/01/25 11:44:19 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -47,7 +47,7 @@ class Theme;
class Builder: public SkinObject
{
public:
Builder( intf_thread_t *pIntf, BuilderData &rData );
Builder( intf_thread_t *pIntf, const BuilderData &rData );
virtual ~Builder() {}
/// Create a Theme object, ready to use.
......@@ -59,7 +59,7 @@ class Builder: public SkinObject
private:
/// Data from the XML
BuilderData &m_rData;
const BuilderData &m_rData;
/// Theme under construction
Theme *m_pTheme;
......
......@@ -2,7 +2,7 @@
* builder_data.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: builder_data.hpp,v 1.2 2004/01/11 17:12:17 asmax Exp $
* $Id: builder_data.hpp,v 1.3 2004/01/25 11:44:19 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
......@@ -32,7 +32,6 @@ using namespace std;
#include <vlc/vlc.h>
#include <list>
#include <map>
#include <string>
/// Structure for mapping data from XML file
......
This source diff could not be displayed because it is too large. You can view the blob instead.
flexml -SH -a skin.act skin.dtd
sed -e 's/\([SE]Tag_.*\)(void)/\1(void *pContext)/' \
-e 's/int main().*//' skin.c > skin.c.new && mv -f skin.c.new skin.c
sed -e 's/\([SE]Tag_.*\)(void)/\1(void*)/' \
-e 's/extern int yylex(void)/extern int yylex(void*)/' \
-e 's/\/\* XML processor entry point. \*\//#define YY_DECL int yylex(void *pContext)/' skin.h > skin.h.new && mv -f skin.h.new skin.h
flex -oflex.c -B -L skin.l
sed -e 's/\([SE]Tag_[^()]*\)()/\1(pContext)/g' flex.c > flex.c.new && mv -f flex.c.new flex.c
<!-- vim: set filetype=xml : -->
<!DOCTYPE actions SYSTEM "flexml-act.dtd">
<actions>
<top>
<![CDATA[
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include "parser/wrappers.h"
]]>
</top>
<start tag="Bitmap">
<![CDATA[
AddBitmap( pContext, {id}, {file}, {alphacolor} );
]]>
</start>
<start tag="Event">
<![CDATA[
AddEvent( pContext, {id}, {event}, {key} );
]]>
</start>
<start tag="Font">
<![CDATA[
AddFont( pContext, {id}, {font}, {size}, {color},
{italic}, {underline} );
]]>
</start>
<start tag="ThemeInfo">
<![CDATA[
AddThemeInfo( pContext, {name}, {author}, {email}, {webpage} );
]]>
</start>
<start tag="Window">
<![CDATA[
StartWindow( pContext, {id}, {x}, {y}, {visible}, {dragdrop},
{playondrop} );
]]>
</start>
<end tag="Window">
<![CDATA[
EndWindow( pContext );
]]>
</end>
<start tag="Layout">
<![CDATA[
StartLayout( pContext, {id}, {width}, {height}, {minwidth},
{maxwidth}, {minheight}, {maxheight} );
]]>
</start>
<end tag="Layout">
<![CDATA[
EndLayout( pContext );
]]>
</end>
<start tag="Group">
<![CDATA[
StartGroup( pContext, {x}, {y} );
]]>
</start>
<end tag="Group">
<![CDATA[
EndGroup( pContext );
]]>
</end>
<start tag="Anchor">
<![CDATA[
AddAnchor( pContext, {x}, {y}, {range}, {priority} );
]]>
</start>
<start tag="Image">
<![CDATA[
AddImage( pContext, {id}, {visible}, {x}, {y}, {lefttop},
{rightbottom}, {image}, {onclick}, {help} );
]]>
</start>
<start tag="Rectangle">
<![CDATA[
AddRectangle( pContext, {id}, {visible}, {x}, {y}, {w}, {h},
{color}, {onclick}, {help} );
]]>
</start>
<start tag="Button">
<![CDATA[
AddButton( pContext, {id}, {x}, {y}, {lefttop}, {rightbottom},
{up}, {down}, {over}, {action}, {tooltiptext}, {help} );
]]>
</start>
<start tag="CheckBox">
<![CDATA[
AddCheckBox( pContext, {id},
{x}, {y}, {lefttop}, {rightbottom},
{up1}, {down1}, {over1}, {up2}, {down2}, {over2},
{state}, {action1}, {action2}, {tooltiptext1},
{tooltiptext2}, {help} );
]]>
</start>
<start tag="Slider">
<![CDATA[
AddSlider( pContext, {id}, {visible}, {x}, {y},
{lefttop}, {rightbottom}, {up}, {down},
{over}, {points}, {thickness}, {value}, {tooltiptext},
{help} );
]]>
</start>
<start tag="RadialSlider">
<![CDATA[
AddRadialSlider( pContext, {id}, {visible}, {x}, {y},
{lefttop}, {rightbottom}, {sequence}, {nbimages},
{minangle}, {maxangle}, {value}, {tooltiptext},
{help} );
]]>
</start>
<start tag="Text">
<![CDATA[
AddText( pContext, {id}, {visible}, {x}, {y}, {text}, {font},
{align}, {width}, {display}, {scroll}, {scrollspace},
{help} );
]]>
</start>
<start tag="Playlist">
<![CDATA[
AddPlaylist( pContext, {id}, {visible}, {x}, {y}, {width},
{height}, {lefttop}, {rightbottom}, {font}, {var},
{fgcolor}, {playcolor}, {bgcolor1}, {bgcolor2},
{selcolor}, {help} );
]]>
</start>
<end tag="Playlist">
<![CDATA[
AddPlaylistEnd( pContext );
]]>
</end>
<start tag="Theme">
<![CDATA[
StartTheme( pContext, {version}, {magnet}, {alpha}, {movealpha}, {fadetime} );
]]>
</start>
<end tag="Theme">
<![CDATA[
EndTheme( pContext );
]]>
</end>
</actions>
/* XML application for skin.dtd.
* Includes actions from skin.act.
* Generated 2004/01/03 15:23:36.
*
* This program was generated with the FleXML XML processor generator,
* (Id: flexml.pl,v 1.24 1999/12/13 16:18:30 krisrose Exp).
* Copyright 1999 Kristoffer Rose. All rights reserved.
*
* You can redistribute and/or modify this program provided the following
* two conditions hold:
*
* 1. The program is distributed WITHOUT ANY WARRANTY from the author of
* FleXML; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* 2. The program distribution conditions do not in any way affect the
* distribution conditions of the FleXML system used to generate this
* file or any version of FleXML derived from that system.
*
* Notice that these are explicit rights granted to you for files
* generated by the FleXML system. For your rights in connection with
* the FleXML system itself please consult the GNU General Public License.
*/
#include "skin.h"
#line 5 "skin.act"
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include "parser/wrappers.h"
void STag_Bitmap(void *pContext)
{
#line 12 "skin.act"
AddBitmap( pContext, A_Bitmap_id, A_Bitmap_file, A_Bitmap_alphacolor );
} /* STag_Bitmap */
void STag_Event(void *pContext)
{
#line 17 "skin.act"
AddEvent( pContext, A_Event_id, A_Event_event, A_Event_key );
} /* STag_Event */
void STag_Font(void *pContext)
{
#line 22 "skin.act"
AddFont( pContext, A_Font_id, A_Font_font, A_Font_size, A_Font_color,
A_Font_italic, A_Font_underline );
} /* STag_Font */
void STag_ThemeInfo(void *pContext)
{
#line 28 "skin.act"
AddThemeInfo( pContext, A_ThemeInfo_name, A_ThemeInfo_author, A_ThemeInfo_email, A_ThemeInfo_webpage );
} /* STag_ThemeInfo */
void STag_Window(void *pContext)
{
#line 33 "skin.act"
StartWindow( pContext, A_Window_id, A_Window_x, A_Window_y, A_Window_visible, A_Window_dragdrop,
A_Window_playondrop );
} /* STag_Window */
void ETag_Window(void *pContext)
{
#line 39 "skin.act"
EndWindow( pContext );
} /* ETag_Window */
void STag_Layout(void *pContext)
{
#line 44 "skin.act"
StartLayout( pContext, A_Layout_id, A_Layout_width, A_Layout_height, A_Layout_minwidth,
A_Layout_maxwidth, A_Layout_minheight, A_Layout_maxheight );
} /* STag_Layout */
void ETag_Layout(void *pContext)
{
#line 50 "skin.act"
EndLayout( pContext );
} /* ETag_Layout */
void STag_Group(void *pContext)
{
#line 56 "skin.act"
StartGroup( pContext, A_Group_x, A_Group_y );
} /* STag_Group */
void ETag_Group(void *pContext)
{
#line 61 "skin.act"
EndGroup( pContext );
} /* ETag_Group */
void STag_Anchor(void *pContext)
{
#line 66 "skin.act"
AddAnchor( pContext, A_Anchor_x, A_Anchor_y, A_Anchor_range, A_Anchor_priority );
} /* STag_Anchor */
void STag_Image(void *pContext)
{
#line 71 "skin.act"
AddImage( pContext, A_Image_id, A_Image_visible, A_Image_x, A_Image_y, A_Image_lefttop,
A_Image_rightbottom, A_Image_image, A_Image_onclick, A_Image_help );
} /* STag_Image */
void STag_Rectangle(void *pContext)
{
#line 77 "skin.act"
AddRectangle( pContext, A_Rectangle_id, A_Rectangle_visible, A_Rectangle_x, A_Rectangle_y, A_Rectangle_w, A_Rectangle_h,
A_Rectangle_color, A_Rectangle_onclick, A_Rectangle_help );
} /* STag_Rectangle */
void STag_Button(void *pContext)
{
#line 83 "skin.act"
AddButton( pContext, A_Button_id, A_Button_x, A_Button_y, A_Button_lefttop, A_Button_rightbottom,
A_Button_up, A_Button_down, A_Button_over, A_Button_action, A_Button_tooltiptext, A_Button_help );
} /* STag_Button */
void STag_CheckBox(void *pContext)
{
#line 89 "skin.act"
AddCheckBox( pContext, A_CheckBox_id,
A_CheckBox_x, A_CheckBox_y, A_CheckBox_lefttop, A_CheckBox_rightbottom,
A_CheckBox_up1, A_CheckBox_down1, A_CheckBox_over1, A_CheckBox_up2, A_CheckBox_down2, A_CheckBox_over2,
A_CheckBox_state, A_CheckBox_action1, A_CheckBox_action2, A_CheckBox_tooltiptext1,
A_CheckBox_tooltiptext2, A_CheckBox_help );
} /* STag_CheckBox */
void STag_Slider(void *pContext)
{
#line 98 "skin.act"
AddSlider( pContext, A_Slider_id, A_Slider_visible, A_Slider_x, A_Slider_y,
A_Slider_lefttop, A_Slider_rightbottom, A_Slider_up, A_Slider_down,
A_Slider_over, A_Slider_points, A_Slider_thickness, A_Slider_value, A_Slider_tooltiptext,
A_Slider_help );
} /* STag_Slider */
void STag_RadialSlider(void *pContext)
{
#line 106 "skin.act"
AddRadialSlider( pContext, A_RadialSlider_id, A_RadialSlider_visible, A_RadialSlider_x, A_RadialSlider_y,
A_RadialSlider_lefttop, A_RadialSlider_rightbottom, A_RadialSlider_sequence, A_RadialSlider_nbimages,
A_RadialSlider_minangle, A_RadialSlider_maxangle, A_RadialSlider_value, A_RadialSlider_tooltiptext,
A_RadialSlider_help );
} /* STag_RadialSlider */
void STag_Text(void *pContext)
{
#line 114 "skin.act"
AddText( pContext, A_Text_id, A_Text_visible, A_Text_x, A_Text_y, A_Text_text, A_Text_font,
A_Text_align, A_Text_width, A_Text_display, A_Text_scroll, A_Text_scrollspace,
A_Text_help );
} /* STag_Text */
void STag_Playlist(void *pContext)
{
#line 121 "skin.act"
AddPlaylist( pContext, A_Playlist_id, A_Playlist_visible, A_Playlist_x, A_Playlist_y, A_Playlist_width,
A_Playlist_height, A_Playlist_lefttop, A_Playlist_rightbottom, A_Playlist_font, A_Playlist_var,
A_Playlist_fgcolor, A_Playlist_playcolor, A_Playlist_bgcolor1, A_Playlist_bgcolor2,
A_Playlist_selcolor, A_Playlist_help );
} /* STag_Playlist */
void ETag_Playlist(void *pContext)
{
#line 129 "skin.act"
AddPlaylistEnd( pContext );
} /* ETag_Playlist */
void STag_Theme(void *pContext)
{
#line 134 "skin.act"
StartTheme( pContext, A_Theme_version, A_Theme_magnet, A_Theme_alpha, A_Theme_movealpha, A_Theme_fadetime );
} /* STag_Theme */
void ETag_Theme(void *pContext)
{
#line 139 "skin.act"
EndTheme( pContext );
} /* ETag_Theme */
/* Dummy main: filter XML from stdin. */
/* XML application entry points. */
void ETag_Bitmap(void *pContext) {}
void ETag_Event(void *pContext) {}
void ETag_Font(void *pContext) {}
void ETag_ThemeInfo(void *pContext) {}
void ETag_Anchor(void *pContext) {}
void ETag_Image(void *pContext) {}
void ETag_Rectangle(void *pContext) {}
void ETag_Button(void *pContext) {}
void ETag_CheckBox(void *pContext) {}
void ETag_Slider(void *pContext) {}
void ETag_RadialSlider(void *pContext) {}
void ETag_Text(void *pContext) {}
<!--
-->
<!ELEMENT Theme (ThemeInfo,(Bitmap|Font|Window|Event)*)>
<!ATTLIST Theme
version CDATA "1.0"
magnet CDATA "15"
alpha CDATA "255"
movealpha CDATA "255"
fadetime CDATA "400"
>
<!-- main elements -->
<!ELEMENT Bitmap EMPTY>
<!ATTLIST Bitmap
id CDATA #REQUIRED
file CDATA #REQUIRED
alphacolor CDATA #REQUIRED
>
<!ELEMENT Event EMPTY>
<!ATTLIST Event
id CDATA #REQUIRED
event CDATA #REQUIRED
key CDATA "none"
>
<!ELEMENT Font EMPTY>
<!ATTLIST Font
id CDATA #REQUIRED
font CDATA "arial"
size CDATA "12"
color CDATA "#000000"
italic CDATA "false"
underline CDATA "false"
>
<!ELEMENT ThemeInfo EMPTY>
<!ATTLIST ThemeInfo
name CDATA #IMPLIED
author CDATA #IMPLIED
email CDATA #IMPLIED
webpage CDATA #IMPLIED
>
<!ELEMENT Window (Layout)+>
<!ATTLIST Window
id CDATA #REQUIRED
visible CDATA "true"
x CDATA "\0"
y CDATA "\0"
dragdrop CDATA "true"
playondrop CDATA "true"
>
<!ELEMENT Layout (Group)>
<!ATTLIST Layout
id CDATA "none"
width CDATA #REQUIRED
height CDATA #REQUIRED
minwidth CDATA "-1"
maxwidth CDATA "-1"
minheight CDATA "-1"
maxheight CDATA "-1"
>
<!ELEMENT Group (Group|Image|Button|Playlist|Slider|RadialSlider|Text|CheckBox|
Rectangle|Anchor)+>
<!ATTLIST Group
x CDATA "\0"
y CDATA "\0"
>
<!-- Anchors -->
<!ELEMENT Anchor EMPTY>
<!ATTLIST Anchor
x CDATA "\0"
y CDATA "\0"
priority CDATA #REQUIRED
range CDATA "10"
>
<!-- Controls -->
<!ELEMENT Image EMPTY>
<!ATTLIST Image
id CDATA "none"
visible CDATA "true"
x CDATA "\0"
y CDATA "\0"
lefttop CDATA "lefttop"
rightbottom CDATA "lefttop"
image CDATA #REQUIRED
onclick CDATA "none"
help CDATA "\0"
>
<!ELEMENT Rectangle EMPTY>
<!ATTLIST Rectangle
id CDATA "none"
visible CDATA "true"
x CDATA "\0"
y CDATA "\0"
w CDATA "50"
h CDATA "50"
color CDATA "#C0C0C0"
onclick CDATA "none"
help CDATA "\0"
>
<!ELEMENT Button EMPTY>
<!ATTLIST Button
id CDATA "none"
x CDATA "\0"
y CDATA "\0"
lefttop CDATA "lefttop"
rightbottom CDATA "lefttop"
up CDATA #REQUIRED
down CDATA "none"
over CDATA "none"
action CDATA "none"
tooltiptext CDATA "\0"
help CDATA "\0"
>
<!ELEMENT CheckBox EMPTY>
<!ATTLIST CheckBox
id CDATA "none"
x CDATA "\0"
y CDATA "\0"
lefttop CDATA "lefttop"
rightbottom CDATA "lefttop"
up1 CDATA #REQUIRED
down1 CDATA "none"
over1 CDATA "none"
up2 CDATA #REQUIRED
down2 CDATA "none"
over2 CDATA "none"
state CDATA #REQUIRED
action1 CDATA "none"
action2 CDATA "none"
tooltiptext1 CDATA "\0"
tooltiptext2 CDATA "\0"
help CDATA "\0"
>
<!ELEMENT Slider EMPTY>
<!ATTLIST Slider
id CDATA "none"
visible CDATA "true"
x CDATA "\0"
y CDATA "\0"
lefttop CDATA "lefttop"
rightbottom CDATA "lefttop"
up CDATA #REQUIRED
down CDATA "none"
over CDATA "none"
points CDATA #REQUIRED
thickness CDATA "10"
value CDATA "none"
tooltiptext CDATA "\0"
help CDATA "\0"
>
<!ELEMENT RadialSlider EMPTY>
<!ATTLIST RadialSlider
id CDATA "none"
visible CDATA "true"
x CDATA "\0"
y CDATA "\0"
lefttop CDATA "lefttop"
rightbottom CDATA "lefttop"
sequence CDATA #REQUIRED
nbimages CDATA #REQUIRED
minangle CDATA "\0"
maxangle CDATA "360"
value CDATA "none"
tooltiptext CDATA "\0"
help CDATA "\0"
>
<!ELEMENT Text EMPTY>
<!ATTLIST Text
id CDATA "none"
visible CDATA "true"
x CDATA "\0"
y CDATA "\0"
text CDATA ""
font CDATA #REQUIRED
align CDATA "left"
width CDATA "\0"
display CDATA "none"
scroll CDATA "true"
scrollspace CDATA "20"
help CDATA "\0"
>
<!ELEMENT Playlist Slider>
<!ATTLIST Playlist
id CDATA #REQUIRED
visible CDATA "true"
x CDATA "\0"
y CDATA "\0"
width CDATA "\0"
height CDATA "\0"
lefttop CDATA "lefttop"
rightbottom CDATA "lefttop"
font CDATA #REQUIRED
var CDATA "playlist"
fgcolor CDATA "#000000"
playcolor CDATA "#FF0000"
bgcolor1 CDATA "#FFFFFF"
bgcolor2 CDATA "#FFFFFF"
selcolor CDATA "#0000FF"
help CDATA "\0"
>
/* XML processor/application API for skin.dtd.
* Generated 2004/01/03 15:23:36.
*
* This program was generated with the FleXML XML processor generator,
* (Id: flexml.pl,v 1.24 1999/12/13 16:18:30 krisrose Exp).
* Copyright 1999 Kristoffer Rose. All rights reserved.
*
* You can redistribute and/or modify this program provided the following
* two conditions hold:
*
* 1. The program is distributed WITHOUT ANY WARRANTY from the author of
* FleXML; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* 2. The program distribution conditions do not in any way affect the
* distribution conditions of the FleXML system used to generate this
* file or any version of FleXML derived from that system.
*
* Notice that these are explicit rights granted to you for files
* generated by the FleXML system. For your rights in connection with
* the FleXML system itself please consult the GNU General Public License.
*/
#ifndef _FLEXML_skin_H
/* XML application entry points. */
extern void STag_Theme(void*);
extern void ETag_Theme(void*);
extern void STag_Bitmap(void*);
extern void ETag_Bitmap(void*);
extern void STag_Event(void*);
extern void ETag_Event(void*);
extern void STag_Font(void*);
extern void ETag_Font(void*);
extern void STag_ThemeInfo(void*);
extern void ETag_ThemeInfo(void*);
extern void STag_Window(void*);
extern void ETag_Window(void*);
extern void STag_Layout(void*);
extern void ETag_Layout(void*);
extern void STag_Group(void*);
extern void ETag_Group(void*);
extern void STag_Anchor(void*);
extern void ETag_Anchor(void*);
extern void STag_Image(void*);
extern void ETag_Image(void*);
extern void STag_Rectangle(void*);
extern void ETag_Rectangle(void*);
extern void STag_Button(void*);
extern void ETag_Button(void*);
extern void STag_CheckBox(void*);
extern void ETag_CheckBox(void*);
extern void STag_Slider(void*);
extern void ETag_Slider(void*);
extern void STag_RadialSlider(void*);
extern void ETag_RadialSlider(void*);
extern void STag_Text(void*);
extern void ETag_Text(void*);
extern void STag_Playlist(void*);
extern void ETag_Playlist(void*);
/* XML application data. */
typedef char* AT_Text_id;
#define AU_Text_id NULL
typedef char* AT_ThemeInfo_author;
#define AU_ThemeInfo_author NULL
typedef char* AT_Playlist_fgcolor;
#define AU_Playlist_fgcolor NULL
typedef char* AT_CheckBox_down2;
#define AU_CheckBox_down2 NULL
typedef char* AT_Image_lefttop;
#define AU_Image_lefttop NULL
typedef char* AT_Slider_visible;
#define AU_Slider_visible NULL
typedef char* AT_CheckBox_down1;
#define AU_CheckBox_down1 NULL
typedef char* AT_Image_rightbottom;
#define AU_Image_rightbottom NULL
typedef char* AT_Event_id;
#define AU_Event_id NULL
typedef char* AT_Rectangle_h;
#define AU_Rectangle_h NULL
typedef char* AT_Slider_lefttop;
#define AU_Slider_lefttop NULL
typedef char* AT_Slider_over;
#define AU_Slider_over NULL
typedef char* AT_Window_id;
#define AU_Window_id NULL
typedef char* AT_Theme_alpha;
#define AU_Theme_alpha NULL
typedef char* AT_Text_text;
#define AU_Text_text NULL
typedef char* AT_Playlist_rightbottom;
#define AU_Playlist_rightbottom NULL
typedef char* AT_Event_event;
#define AU_Event_event NULL
typedef char* AT_Slider_value;
#define AU_Slider_value NULL
typedef char* AT_Font_underline;
#define AU_Font_underline NULL
typedef char* AT_Image_onclick;
#define AU_Image_onclick NULL
typedef char* AT_Anchor_priority;
#define AU_Anchor_priority NULL
typedef char* AT_Font_italic;
#define AU_Font_italic NULL
typedef char* AT_Button_y;
#define AU_Button_y NULL
typedef char* AT_RadialSlider_sequence;
#define AU_RadialSlider_sequence NULL
typedef char* AT_Playlist_var;
#define AU_Playlist_var NULL
typedef char* AT_CheckBox_y;
#define AU_CheckBox_y NULL
typedef char* AT_Window_playondrop;
#define AU_Window_playondrop NULL
typedef char* AT_RadialSlider_minangle;
#define AU_RadialSlider_minangle NULL
typedef char* AT_RadialSlider_visible;
#define AU_RadialSlider_visible NULL
typedef char* AT_Playlist_playcolor;
#define AU_Playlist_playcolor NULL
typedef char* AT_Anchor_range;
#define AU_Anchor_range NULL
typedef char* AT_Theme_fadetime;
#define AU_Theme_fadetime NULL
typedef char* AT_CheckBox_x;
#define AU_CheckBox_x NULL
typedef char* AT_Bitmap_file;
#define AU_Bitmap_file NULL
typedef char* AT_Slider_down;
#define AU_Slider_down NULL
typedef char* AT_CheckBox_over2;
#define AU_CheckBox_over2 NULL
typedef char* AT_Slider_y;
#define AU_Slider_y NULL
typedef char* AT_Slider_id;
#define AU_Slider_id NULL
typedef char* AT_Window_dragdrop;
#define AU_Window_dragdrop NULL
typedef char* AT_Text_x;
#define AU_Text_x NULL
typedef char* AT_Image_y;
#define AU_Image_y NULL
typedef char* AT_Font_color;
#define AU_Font_color NULL
typedef char* AT_Slider_rightbottom;
#define AU_Slider_rightbottom NULL
typedef char* AT_Group_y;
#define AU_Group_y NULL
typedef char* AT_Text_font;
#define AU_Text_font NULL
typedef char* AT_Button_over;
#define AU_Button_over NULL
typedef char* AT_Theme_version;
#define AU_Theme_version NULL
typedef char* AT_Image_id;
#define AU_Image_id NULL
typedef char* AT_CheckBox_lefttop;
#define AU_CheckBox_lefttop NULL
typedef char* AT_Text_scrollspace;
#define AU_Text_scrollspace NULL
typedef char* AT_Button_action;
#define AU_Button_action NULL
typedef char* AT_Button_lefttop;
#define AU_Button_lefttop NULL
typedef char* AT_Button_id;
#define AU_Button_id NULL
typedef char* AT_Rectangle_visible;
#define AU_Rectangle_visible NULL
typedef char* AT_Rectangle_color;
#define AU_Rectangle_color NULL
typedef char* AT_Playlist_width;
#define AU_Playlist_width NULL
typedef char* AT_RadialSlider_maxangle;
#define AU_RadialSlider_maxangle NULL
typedef char* AT_Window_y;
#define AU_Window_y NULL
typedef char* AT_Slider_help;
#define AU_Slider_help NULL
typedef char* AT_Text_width;
#define AU_Text_width NULL
typedef char* AT_Slider_points;
#define AU_Slider_points NULL
typedef char* AT_CheckBox_up1;
#define AU_CheckBox_up1 NULL
typedef char* AT_Theme_magnet;
#define AU_Theme_magnet NULL
typedef char* AT_Theme_movealpha;
#define AU_Theme_movealpha NULL
typedef char* AT_RadialSlider_lefttop;
#define AU_RadialSlider_lefttop NULL
typedef char* AT_Button_up;
#define AU_Button_up NULL
typedef char* AT_RadialSlider_y;
#define AU_RadialSlider_y NULL
typedef char* AT_CheckBox_action1;
#define AU_CheckBox_action1 NULL
typedef char* AT_Playlist_id;
#define AU_Playlist_id NULL
typedef char* AT_Text_align;
#define AU_Text_align NULL
typedef char* AT_CheckBox_tooltiptext1;
#define AU_CheckBox_tooltiptext1 NULL
typedef char* AT_Group_x;
#define AU_Group_x NULL
typedef char* AT_Text_display;
#define AU_Text_display NULL
typedef char* AT_Bitmap_id;
#define AU_Bitmap_id NULL
typedef char* AT_Playlist_y;
#define AU_Playlist_y NULL
typedef char* AT_Text_scroll;
#define AU_Text_scroll NULL
typedef char* AT_Playlist_lefttop;
#define AU_Playlist_lefttop NULL
typedef char* AT_Rectangle_x;
#define AU_Rectangle_x NULL
typedef char* AT_Layout_minheight;
#define AU_Layout_minheight NULL
typedef char* AT_Button_rightbottom;
#define AU_Button_rightbottom NULL
typedef char* AT_Slider_thickness;
#define AU_Slider_thickness NULL
typedef char* AT_RadialSlider_tooltiptext;
#define AU_RadialSlider_tooltiptext NULL
typedef char* AT_RadialSlider_value;
#define AU_RadialSlider_value NULL
typedef char* AT_Text_visible;
#define AU_Text_visible NULL
typedef char* AT_Slider_tooltiptext;
#define AU_Slider_tooltiptext NULL
typedef char* AT_Rectangle_onclick;
#define AU_Rectangle_onclick NULL
typedef char* AT_Layout_width;
#define AU_Layout_width NULL
typedef char* AT_Rectangle_help;
#define AU_Rectangle_help NULL
typedef char* AT_CheckBox_tooltiptext2;
#define AU_CheckBox_tooltiptext2 NULL
typedef char* AT_Layout_maxheight;
#define AU_Layout_maxheight NULL
typedef char* AT_RadialSlider_help;
#define AU_RadialSlider_help NULL
typedef char* AT_Playlist_font;
#define AU_Playlist_font NULL
typedef char* AT_Rectangle_id;
#define AU_Rectangle_id NULL
typedef char* AT_CheckBox_help;
#define AU_CheckBox_help NULL
typedef char* AT_Image_help;
#define AU_Image_help NULL
typedef char* AT_Playlist_bgcolor1;
#define AU_Playlist_bgcolor1 NULL
typedef char* AT_Bitmap_alphacolor;
#define AU_Bitmap_alphacolor NULL
typedef char* AT_Image_image;
#define AU_Image_image NULL
typedef char* AT_Font_id;
#define AU_Font_id NULL
typedef char* AT_Button_x;
#define AU_Button_x NULL
typedef char* AT_CheckBox_id;
#define AU_CheckBox_id NULL
typedef char* AT_Layout_id;
#define AU_Layout_id NULL
typedef char* AT_Event_key;
#define AU_Event_key NULL
typedef char* AT_CheckBox_over1;
#define AU_CheckBox_over1 NULL
typedef char* AT_Slider_up;
#define AU_Slider_up NULL
typedef char* AT_Layout_minwidth;
#define AU_Layout_minwidth NULL
typedef char* AT_CheckBox_rightbottom;
#define AU_CheckBox_rightbottom NULL
typedef char* AT_Anchor_x;
#define AU_Anchor_x NULL
typedef char* AT_Font_font;
#define AU_Font_font NULL
typedef char* AT_Layout_maxwidth;
#define AU_Layout_maxwidth NULL
typedef char* AT_Playlist_help;
#define AU_Playlist_help NULL
typedef char* AT_Playlist_visible;
#define AU_Playlist_visible NULL
typedef char* AT_Slider_x;
#define AU_Slider_x NULL
typedef char* AT_CheckBox_up2;
#define AU_CheckBox_up2 NULL
typedef char* AT_Text_help;
#define AU_Text_help NULL
typedef char* AT_CheckBox_action2;
#define AU_CheckBox_action2 NULL
typedef char* AT_CheckBox_state;
#define AU_CheckBox_state NULL
typedef char* AT_Font_size;
#define AU_Font_size NULL
typedef char* AT_ThemeInfo_webpage;
#define AU_ThemeInfo_webpage NULL
typedef char* AT_RadialSlider_x;
#define AU_RadialSlider_x NULL
typedef char* AT_Button_tooltiptext;
#define AU_Button_tooltiptext NULL
typedef char* AT_Image_visible;
#define AU_Image_visible NULL
typedef char* AT_Window_visible;
#define AU_Window_visible NULL
typedef char* AT_RadialSlider_id;
#define AU_RadialSlider_id NULL
typedef char* AT_Anchor_y;
#define AU_Anchor_y NULL
typedef char* AT_RadialSlider_nbimages;
#define AU_RadialSlider_nbimages NULL
typedef char* AT_Playlist_bgcolor2;
#define AU_Playlist_bgcolor2 NULL
typedef char* AT_Playlist_x;
#define AU_Playlist_x NULL
typedef char* AT_ThemeInfo_email;
#define AU_ThemeInfo_email NULL
typedef char* AT_Window_x;
#define AU_Window_x NULL
typedef char* AT_Button_down;
#define AU_Button_down NULL
typedef char* AT_Playlist_height;
#define AU_Playlist_height NULL
typedef char* AT_Layout_height;
#define AU_Layout_height NULL
typedef char* AT_ThemeInfo_name;
#define AU_ThemeInfo_name NULL
typedef char* AT_Button_help;
#define AU_Button_help NULL
typedef char* AT_Text_y;
#define AU_Text_y NULL
typedef char* AT_Rectangle_w;
#define AU_Rectangle_w NULL
typedef char* AT_Image_x;
#define AU_Image_x NULL
typedef char* AT_Rectangle_y;
#define AU_Rectangle_y NULL
typedef char* AT_Playlist_selcolor;
#define AU_Playlist_selcolor NULL
typedef char* AT_RadialSlider_rightbottom;
#define AU_RadialSlider_rightbottom NULL
/* FleXML-provided data. */
extern char* pcdata;
extern AT_Text_id A_Text_id;
extern AT_ThemeInfo_author A_ThemeInfo_author;
extern AT_Playlist_fgcolor A_Playlist_fgcolor;
extern AT_CheckBox_down2 A_CheckBox_down2;
extern AT_Image_lefttop A_Image_lefttop;
extern AT_Slider_visible A_Slider_visible;
extern AT_CheckBox_down1 A_CheckBox_down1;
extern AT_Image_rightbottom A_Image_rightbottom;
extern AT_Event_id A_Event_id;
extern AT_Rectangle_h A_Rectangle_h;
extern AT_Slider_lefttop A_Slider_lefttop;
extern AT_Slider_over A_Slider_over;
extern AT_Window_id A_Window_id;
extern AT_Theme_alpha A_Theme_alpha;
extern AT_Text_text A_Text_text;
extern AT_Playlist_rightbottom A_Playlist_rightbottom;
extern AT_Event_event A_Event_event;
extern AT_Slider_value A_Slider_value;
extern AT_Font_underline A_Font_underline;
extern AT_Image_onclick A_Image_onclick;
extern AT_Anchor_priority A_Anchor_priority;
extern AT_Font_italic A_Font_italic;
extern AT_Button_y A_Button_y;
extern AT_RadialSlider_sequence A_RadialSlider_sequence;
extern AT_Playlist_var A_Playlist_var;
extern AT_CheckBox_y A_CheckBox_y;
extern AT_Window_playondrop A_Window_playondrop;
extern AT_RadialSlider_minangle A_RadialSlider_minangle;
extern AT_RadialSlider_visible A_RadialSlider_visible;
extern AT_Playlist_playcolor A_Playlist_playcolor;
extern AT_Anchor_range A_Anchor_range;
extern AT_Theme_fadetime A_Theme_fadetime;
extern AT_CheckBox_x A_CheckBox_x;
extern AT_Bitmap_file A_Bitmap_file;
extern AT_Slider_down A_Slider_down;
extern AT_CheckBox_over2 A_CheckBox_over2;
extern AT_Slider_y A_Slider_y;
extern AT_Slider_id A_Slider_id;
extern AT_Window_dragdrop A_Window_dragdrop;
extern AT_Text_x A_Text_x;
extern AT_Image_y A_Image_y;
extern AT_Font_color A_Font_color;
extern AT_Slider_rightbottom A_Slider_rightbottom;
extern AT_Group_y A_Group_y;
extern AT_Text_font A_Text_font;
extern AT_Button_over A_Button_over;
extern AT_Theme_version A_Theme_version;
extern AT_Image_id A_Image_id;
extern AT_CheckBox_lefttop A_CheckBox_lefttop;
extern AT_Text_scrollspace A_Text_scrollspace;
extern AT_Button_action A_Button_action;
extern AT_Button_lefttop A_Button_lefttop;
extern AT_Button_id A_Button_id;
extern AT_Rectangle_visible A_Rectangle_visible;
extern AT_Rectangle_color A_Rectangle_color;
extern AT_Playlist_width A_Playlist_width;
extern AT_RadialSlider_maxangle A_RadialSlider_maxangle;
extern AT_Window_y A_Window_y;
extern AT_Slider_help A_Slider_help;
extern AT_Text_width A_Text_width;
extern AT_Slider_points A_Slider_points;
extern AT_CheckBox_up1 A_CheckBox_up1;
extern AT_Theme_magnet A_Theme_magnet;
extern AT_Theme_movealpha A_Theme_movealpha;
extern AT_RadialSlider_lefttop A_RadialSlider_lefttop;
extern AT_Button_up A_Button_up;
extern AT_RadialSlider_y A_RadialSlider_y;
extern AT_CheckBox_action1 A_CheckBox_action1;
extern AT_Playlist_id A_Playlist_id;
extern AT_Text_align A_Text_align;
extern AT_CheckBox_tooltiptext1 A_CheckBox_tooltiptext1;
extern AT_Group_x A_Group_x;
extern AT_Text_display A_Text_display;
extern AT_Bitmap_id A_Bitmap_id;
extern AT_Playlist_y A_Playlist_y;
extern AT_Text_scroll A_Text_scroll;
extern AT_Playlist_lefttop A_Playlist_lefttop;
extern AT_Rectangle_x A_Rectangle_x;
extern AT_Layout_minheight A_Layout_minheight;
extern AT_Button_rightbottom A_Button_rightbottom;
extern AT_Slider_thickness A_Slider_thickness;
extern AT_RadialSlider_tooltiptext A_RadialSlider_tooltiptext;
extern AT_RadialSlider_value A_RadialSlider_value;
extern AT_Text_visible A_Text_visible;
extern AT_Slider_tooltiptext A_Slider_tooltiptext;
extern AT_Rectangle_onclick A_Rectangle_onclick;
extern AT_Layout_width A_Layout_width;
extern AT_Rectangle_help A_Rectangle_help;
extern AT_CheckBox_tooltiptext2 A_CheckBox_tooltiptext2;
extern AT_Layout_maxheight A_Layout_maxheight;
extern AT_RadialSlider_help A_RadialSlider_help;
extern AT_Playlist_font A_Playlist_font;
extern AT_Rectangle_id A_Rectangle_id;
extern AT_CheckBox_help A_CheckBox_help;
extern AT_Image_help A_Image_help;
extern AT_Playlist_bgcolor1 A_Playlist_bgcolor1;
extern AT_Bitmap_alphacolor A_Bitmap_alphacolor;
extern AT_Image_image A_Image_image;
extern AT_Font_id A_Font_id;
extern AT_Button_x A_Button_x;
extern AT_CheckBox_id A_CheckBox_id;
extern AT_Layout_id A_Layout_id;
extern AT_Event_key A_Event_key;
extern AT_CheckBox_over1 A_CheckBox_over1;
extern AT_Slider_up A_Slider_up;
extern AT_Layout_minwidth A_Layout_minwidth;
extern AT_CheckBox_rightbottom A_CheckBox_rightbottom;
extern AT_Anchor_x A_Anchor_x;
extern AT_Font_font A_Font_font;
extern AT_Layout_maxwidth A_Layout_maxwidth;
extern AT_Playlist_help A_Playlist_help;
extern AT_Playlist_visible A_Playlist_visible;
extern AT_Slider_x A_Slider_x;
extern AT_CheckBox_up2 A_CheckBox_up2;
extern AT_Text_help A_Text_help;
extern AT_CheckBox_action2 A_CheckBox_action2;
extern AT_CheckBox_state A_CheckBox_state;
extern AT_Font_size A_Font_size;
extern AT_ThemeInfo_webpage A_ThemeInfo_webpage;
extern AT_RadialSlider_x A_RadialSlider_x;
extern AT_Button_tooltiptext A_Button_tooltiptext;
extern AT_Image_visible A_Image_visible;
extern AT_Window_visible A_Window_visible;
extern AT_RadialSlider_id A_RadialSlider_id;
extern AT_Anchor_y A_Anchor_y;
extern AT_RadialSlider_nbimages A_RadialSlider_nbimages;
extern AT_Playlist_bgcolor2 A_Playlist_bgcolor2;
extern AT_Playlist_x A_Playlist_x;
extern AT_ThemeInfo_email A_ThemeInfo_email;
extern AT_Window_x A_Window_x;
extern AT_Button_down A_Button_down;
extern AT_Playlist_height A_Playlist_height;
extern AT_Layout_height A_Layout_height;
extern AT_ThemeInfo_name A_ThemeInfo_name;
extern AT_Button_help A_Button_help;
extern AT_Text_y A_Text_y;
extern AT_Rectangle_w A_Rectangle_w;
extern AT_Image_x A_Image_x;
extern AT_Rectangle_y A_Rectangle_y;
extern AT_Playlist_selcolor A_Playlist_selcolor;
extern AT_RadialSlider_rightbottom A_RadialSlider_rightbottom;
/* XML application utilities. */
extern int element_context(int);
#define YY_DECL int yylex(void *pContext)
extern int yylex(void*);
#endif
/* Validating XML processor for skin.dtd.
* Generated 2004/01/03 15:23:36.
*
* This program was generated with the FleXML XML processor generator,
* (Id: flexml.pl,v 1.24 1999/12/13 16:18:30 krisrose Exp).
* Copyright 1999 Kristoffer Rose. All rights reserved.
*
* You can redistribute and/or modify this program provided the following
* two conditions hold:
*
* 1. The program is distributed WITHOUT ANY WARRANTY from the author of
* FleXML; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* 2. The program distribution conditions do not in any way affect the
* distribution conditions of the FleXML system used to generate this
* file or any version of FleXML derived from that system.
*
* Notice that these are explicit rights granted to you for files
* generated by the FleXML system. For your rights in connection with
* the FleXML system itself please consult the GNU General Public License.
*/
%{
/* Version strings. */
const char rcs_flexml_skeleton[] =
"$" "Id: skel,v 1.16 1999/12/09 04:01:51 krisrose Exp $";
const char rcs_flexml[] =
"$" "Id: flexml.pl,v 1.24 1999/12/13 16:18:30 krisrose Exp $";
/* ANSI headers. */
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <stdarg.h>
#include <ctype.h>
/* Generated definitions. */
#define FLEXML_BUFFERSTACKSIZE 100000
/* XML processor api. */
#include "skin.h"
/* FleXML-provided data. */
char* pcdata;
AT_Text_id A_Text_id;
AT_ThemeInfo_author A_ThemeInfo_author;
AT_Playlist_fgcolor A_Playlist_fgcolor;
AT_CheckBox_down2 A_CheckBox_down2;
AT_Image_lefttop A_Image_lefttop;
AT_Slider_visible A_Slider_visible;
AT_CheckBox_down1 A_CheckBox_down1;
AT_Image_rightbottom A_Image_rightbottom;
AT_Event_id A_Event_id;
AT_Rectangle_h A_Rectangle_h;
AT_Slider_lefttop A_Slider_lefttop;
AT_Slider_over A_Slider_over;
AT_Window_id A_Window_id;
AT_Theme_alpha A_Theme_alpha;
AT_Text_text A_Text_text;
AT_Playlist_rightbottom A_Playlist_rightbottom;
AT_Event_event A_Event_event;
AT_Slider_value A_Slider_value;
AT_Font_underline A_Font_underline;
AT_Image_onclick A_Image_onclick;
AT_Anchor_priority A_Anchor_priority;
AT_Font_italic A_Font_italic;
AT_Button_y A_Button_y;
AT_RadialSlider_sequence A_RadialSlider_sequence;
AT_Playlist_var A_Playlist_var;
AT_CheckBox_y A_CheckBox_y;
AT_Window_playondrop A_Window_playondrop;
AT_RadialSlider_minangle A_RadialSlider_minangle;
AT_RadialSlider_visible A_RadialSlider_visible;
AT_Playlist_playcolor A_Playlist_playcolor;
AT_Anchor_range A_Anchor_range;
AT_Theme_fadetime A_Theme_fadetime;
AT_CheckBox_x A_CheckBox_x;
AT_Bitmap_file A_Bitmap_file;
AT_Slider_down A_Slider_down;
AT_CheckBox_over2 A_CheckBox_over2;
AT_Slider_y A_Slider_y;
AT_Slider_id A_Slider_id;
AT_Window_dragdrop A_Window_dragdrop;
AT_Text_x A_Text_x;
AT_Image_y A_Image_y;
AT_Font_color A_Font_color;
AT_Slider_rightbottom A_Slider_rightbottom;
AT_Group_y A_Group_y;
AT_Text_font A_Text_font;
AT_Button_over A_Button_over;
AT_Theme_version A_Theme_version;
AT_Image_id A_Image_id;
AT_CheckBox_lefttop A_CheckBox_lefttop;
AT_Text_scrollspace A_Text_scrollspace;
AT_Button_action A_Button_action;
AT_Button_lefttop A_Button_lefttop;
AT_Button_id A_Button_id;
AT_Rectangle_visible A_Rectangle_visible;
AT_Rectangle_color A_Rectangle_color;
AT_Playlist_width A_Playlist_width;
AT_RadialSlider_maxangle A_RadialSlider_maxangle;
AT_Window_y A_Window_y;
AT_Slider_help A_Slider_help;
AT_Text_width A_Text_width;
AT_Slider_points A_Slider_points;
AT_CheckBox_up1 A_CheckBox_up1;
AT_Theme_magnet A_Theme_magnet;
AT_Theme_movealpha A_Theme_movealpha;
AT_RadialSlider_lefttop A_RadialSlider_lefttop;
AT_Button_up A_Button_up;
AT_RadialSlider_y A_RadialSlider_y;
AT_CheckBox_action1 A_CheckBox_action1;
AT_Playlist_id A_Playlist_id;
AT_Text_align A_Text_align;
AT_CheckBox_tooltiptext1 A_CheckBox_tooltiptext1;
AT_Group_x A_Group_x;
AT_Text_display A_Text_display;
AT_Bitmap_id A_Bitmap_id;
AT_Playlist_y A_Playlist_y;
AT_Text_scroll A_Text_scroll;
AT_Playlist_lefttop A_Playlist_lefttop;
AT_Rectangle_x A_Rectangle_x;
AT_Layout_minheight A_Layout_minheight;
AT_Button_rightbottom A_Button_rightbottom;
AT_Slider_thickness A_Slider_thickness;
AT_RadialSlider_tooltiptext A_RadialSlider_tooltiptext;
AT_RadialSlider_value A_RadialSlider_value;
AT_Text_visible A_Text_visible;
AT_Slider_tooltiptext A_Slider_tooltiptext;
AT_Rectangle_onclick A_Rectangle_onclick;
AT_Layout_width A_Layout_width;
AT_Rectangle_help A_Rectangle_help;
AT_CheckBox_tooltiptext2 A_CheckBox_tooltiptext2;
AT_Layout_maxheight A_Layout_maxheight;
AT_RadialSlider_help A_RadialSlider_help;
AT_Playlist_font A_Playlist_font;
AT_Rectangle_id A_Rectangle_id;
AT_CheckBox_help A_CheckBox_help;
AT_Image_help A_Image_help;
AT_Playlist_bgcolor1 A_Playlist_bgcolor1;
AT_Bitmap_alphacolor A_Bitmap_alphacolor;
AT_Image_image A_Image_image;
AT_Font_id A_Font_id;
AT_Button_x A_Button_x;
AT_CheckBox_id A_CheckBox_id;
AT_Layout_id A_Layout_id;
AT_Event_key A_Event_key;
AT_CheckBox_over1 A_CheckBox_over1;
AT_Slider_up A_Slider_up;
AT_Layout_minwidth A_Layout_minwidth;
AT_CheckBox_rightbottom A_CheckBox_rightbottom;
AT_Anchor_x A_Anchor_x;
AT_Font_font A_Font_font;
AT_Layout_maxwidth A_Layout_maxwidth;
AT_Playlist_help A_Playlist_help;
AT_Playlist_visible A_Playlist_visible;
AT_Slider_x A_Slider_x;
AT_CheckBox_up2 A_CheckBox_up2;
AT_Text_help A_Text_help;
AT_CheckBox_action2 A_CheckBox_action2;
AT_CheckBox_state A_CheckBox_state;
AT_Font_size A_Font_size;
AT_ThemeInfo_webpage A_ThemeInfo_webpage;
AT_RadialSlider_x A_RadialSlider_x;
AT_Button_tooltiptext A_Button_tooltiptext;
AT_Image_visible A_Image_visible;
AT_Window_visible A_Window_visible;
AT_RadialSlider_id A_RadialSlider_id;
AT_Anchor_y A_Anchor_y;
AT_RadialSlider_nbimages A_RadialSlider_nbimages;
AT_Playlist_bgcolor2 A_Playlist_bgcolor2;
AT_Playlist_x A_Playlist_x;
AT_ThemeInfo_email A_ThemeInfo_email;
AT_Window_x A_Window_x;
AT_Button_down A_Button_down;
AT_Playlist_height A_Playlist_height;
AT_Layout_height A_Layout_height;
AT_ThemeInfo_name A_ThemeInfo_name;
AT_Button_help A_Button_help;
AT_Text_y A_Text_y;
AT_Rectangle_w A_Rectangle_w;
AT_Image_x A_Image_x;
AT_Rectangle_y A_Rectangle_y;
AT_Playlist_selcolor A_Playlist_selcolor;
AT_RadialSlider_rightbottom A_RadialSlider_rightbottom;
/* XML state. */
#ifdef FLEX_DEBUG
# define ENTER(state) debug_enter(state,#state)
# define LEAVE debug_leave()
# define SET(state) debug_set(state,#state)
static void debug_enter(int, char*);
static void debug_leave(void);
static void debug_set(int, char*);
#else
# define ENTER(state) (yy_push_state(state))
# define LEAVE (yy_pop_state())
# define SET(state) BEGIN(state)
#endif
/* Generic actions. */
#define SKIP /*skip*/
#define SUCCEED return 0
#define FAIL return fail
static int fail(const char*, ...);
/* Text buffer stack handling. */
char bufferstack[FLEXML_BUFFERSTACKSIZE];
char* limit = bufferstack + FLEXML_BUFFERSTACKSIZE;
typedef struct BufferLast_s {
struct BufferLast_s *old; char* saved; char new[1];
} BufferLast;
BufferLast* last = (BufferLast*)0;
char* next = bufferstack;
#define BUFFERSET(P) (P = next)
#define BUFFERPUTC(C) (assert(next<limit), *(next++) = (C))
#define BUFFERDONE (BUFFERPUTC('\0'))
#define BUFFERLITERAL(C,P) bufferliteral(C,&(P),yytext)
static void bufferliteral(char c, char** pp, char* text)
{
char *s = strchr(text,c), *e = strrchr(text,c);
assert(s <= e); BUFFERSET(*pp);
while (++s<e) {
if (isspace(*s)) { BUFFERPUTC(' '); while (isspace(*s)) ++s; }
else BUFFERPUTC(*s);
}
BUFFERDONE;
}
#ifdef FLEXML_HasMixed
static void pushbuffer(char* p)
{
BufferLast* l = (BufferLast*)next;
assert(next < limit);
l->old = last;
l->saved = p;
next = l->new;
last = l;
}
static char* popbuffer(void)
{
BufferLast* l = last;
assert(last != (BufferLast*)0);
last = l->old;
next = (char*)l;
return l->saved;
}
#endif
/* General internal entities are `unput' back onto the input stream... */
#define ENTITYTEXT(T) \
{ char *s = (T), *e = s+strlen(s);\
while (--e >= s) { unput(*e); }}
%}
/* Flex standard options. */
%option stack
%option noyy_top_state
%option noinput
%option noreject
%option noyymore
%option noyywrap
/* Flex user-requested options. */
%option nounput
/* XML character classes (currently restricted to ASCII). */
/* "Common syntactic structures." */
S [ \t\n\r\f]+
s [ \t\n\r\f]*
/* "Names and Tokens." */
NameChar [A-Za-z0-9.:_-]
Name [A-Za-z_:]{NameChar}*
Names {Name}({S}{Name})*
Nmtoken ({NameChar})+
Nmtokens {Nmtoken}({S}{Nmtoken})*
/* Miscellaneous. */
VersionNum [a-zA-Z0-9_.:-]+
Eq {s}"="{s}
Literal \'[^'']*\'|\"[^""]*\"
/* Parser states (flex `exclusive start conditions'):
*
* PROLOG the XML prolog of the document before <?xml...>
* DOCTYPE the XML prolog of the document after <?xml...>
* EPILOG after the root element
* INCOMMENT inside an XML comment <!--....-->
* INPI inside an XML PI <?...?>
* VALUE1 inside a '...'-delimited literal
* VALUE2 inside a "..."-delimited literal
* CDATA inside a <![CDATA[...]]> section.
* ROOT_<tag> expect root element <tag>
* AL_<tag> inside the attribute list for <tag>
* IN_<tag> inside a <tag> with element contents (ready for end tag)
* IMPOSSIBLE dummy to permit disabling rules; must be last
*/
%x PROLOG DOCTYPE EPILOG INCOMMENT INPI VALUE1 VALUE2 CDATA
%x ROOT_Theme AL_Theme S_Theme S_Theme_1 S_Theme_2 S_Theme_3 E_Theme
%x ROOT_Bitmap AL_Bitmap E_Bitmap
%x ROOT_Event AL_Event E_Event
%x ROOT_Font AL_Font E_Font
%x ROOT_ThemeInfo AL_ThemeInfo E_ThemeInfo
%x ROOT_Window AL_Window S_Window S_Window_1 S_Window_2 E_Window
%x ROOT_Layout AL_Layout S_Layout E_Layout
%x ROOT_Group AL_Group S_Group S_Group_1 S_Group_2 E_Group
%x ROOT_Anchor AL_Anchor E_Anchor
%x ROOT_Image AL_Image E_Image
%x ROOT_Rectangle AL_Rectangle E_Rectangle
%x ROOT_Button AL_Button E_Button
%x ROOT_CheckBox AL_CheckBox E_CheckBox
%x ROOT_Slider AL_Slider E_Slider
%x ROOT_RadialSlider AL_RadialSlider E_RadialSlider
%x ROOT_Text AL_Text E_Text
%x ROOT_Playlist AL_Playlist S_Playlist E_Playlist
%x IMPOSSIBLE
%{
/* State names. */
char* statenames[IMPOSSIBLE];
void FleXML_init(void)
{
statenames[PROLOG] = NULL;
statenames[DOCTYPE] = NULL;
statenames[EPILOG] = NULL;
statenames[INCOMMENT] = NULL;
statenames[INPI] = NULL;
statenames[VALUE1] = NULL;
statenames[VALUE2] = NULL;
statenames[CDATA] = NULL;
statenames[ROOT_Theme] = NULL;
statenames[AL_Theme] = NULL;
statenames[S_Theme] = "Theme";
statenames[S_Theme_1] = "Theme";
statenames[S_Theme_2] = "Theme";
statenames[S_Theme_3] = "Theme";
statenames[E_Theme] = "Theme";
statenames[ROOT_Bitmap] = NULL;
statenames[AL_Bitmap] = NULL;
statenames[E_Bitmap] = "Bitmap";
statenames[ROOT_Event] = NULL;
statenames[AL_Event] = NULL;
statenames[E_Event] = "Event";
statenames[ROOT_Font] = NULL;
statenames[AL_Font] = NULL;
statenames[E_Font] = "Font";
statenames[ROOT_ThemeInfo] = NULL;
statenames[AL_ThemeInfo] = NULL;
statenames[E_ThemeInfo] = "ThemeInfo";
statenames[ROOT_Window] = NULL;
statenames[AL_Window] = NULL;
statenames[S_Window] = "Window";
statenames[S_Window_1] = "Window";
statenames[S_Window_2] = "Window";
statenames[E_Window] = "Window";
statenames[ROOT_Layout] = NULL;
statenames[AL_Layout] = NULL;
statenames[S_Layout] = "Layout";
statenames[E_Layout] = "Layout";
statenames[ROOT_Group] = NULL;
statenames[AL_Group] = NULL;
statenames[S_Group] = "Group";
statenames[S_Group_1] = "Group";
statenames[S_Group_2] = "Group";
statenames[E_Group] = "Group";
statenames[ROOT_Anchor] = NULL;
statenames[AL_Anchor] = NULL;
statenames[E_Anchor] = "Anchor";
statenames[ROOT_Image] = NULL;
statenames[AL_Image] = NULL;
statenames[E_Image] = "Image";
statenames[ROOT_Rectangle] = NULL;
statenames[AL_Rectangle] = NULL;
statenames[E_Rectangle] = "Rectangle";
statenames[ROOT_Button] = NULL;
statenames[AL_Button] = NULL;
statenames[E_Button] = "Button";
statenames[ROOT_CheckBox] = NULL;
statenames[AL_CheckBox] = NULL;
statenames[E_CheckBox] = "CheckBox";
statenames[ROOT_Slider] = NULL;
statenames[AL_Slider] = NULL;
statenames[E_Slider] = "Slider";
statenames[ROOT_RadialSlider] = NULL;
statenames[AL_RadialSlider] = NULL;
statenames[E_RadialSlider] = "RadialSlider";
statenames[ROOT_Text] = NULL;
statenames[AL_Text] = NULL;
statenames[E_Text] = "Text";
statenames[ROOT_Playlist] = NULL;
statenames[AL_Playlist] = NULL;
statenames[S_Playlist] = "Playlist";
statenames[E_Playlist] = "Playlist";
}
%}
%%
/* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */
SET(PROLOG); FleXML_init();
/* COMMENTS and PIs: handled uniformly for efficiency. */
<ROOT_Theme,AL_Theme,S_Theme,S_Theme_1,S_Theme_2,S_Theme_3,E_Theme,ROOT_Bitmap,AL_Bitmap,E_Bitmap,ROOT_Event,AL_Event,E_Event,ROOT_Font,AL_Font,E_Font,ROOT_ThemeInfo,AL_ThemeInfo,E_ThemeInfo,ROOT_Window,AL_Window,S_Window,S_Window_1,S_Window_2,E_Window,ROOT_Layout,AL_Layout,S_Layout,E_Layout,ROOT_Group,AL_Group,S_Group,S_Group_1,S_Group_2,E_Group,ROOT_Anchor,AL_Anchor,E_Anchor,ROOT_Image,AL_Image,E_Image,ROOT_Rectangle,AL_Rectangle,E_Rectangle,ROOT_Button,AL_Button,E_Button,ROOT_CheckBox,AL_CheckBox,E_CheckBox,ROOT_Slider,AL_Slider,E_Slider,ROOT_RadialSlider,AL_RadialSlider,E_RadialSlider,ROOT_Text,AL_Text,E_Text,ROOT_Playlist,AL_Playlist,S_Playlist,E_Playlist,PROLOG,DOCTYPE,EPILOG>{
"<!--" ENTER(INCOMMENT);
"<?" ENTER(INPI);
}
<INCOMMENT>{
"-->" LEAVE;
"--" |
. |
\n SKIP;
<<EOF>> FAIL("EOF in comment.");
}
<INPI>{
"?>" LEAVE;
. |
\n SKIP;
<<EOF>> FAIL("EOF in PI (processing instruction).");
}
/* SPACES: skipped uniformly */
<ROOT_Theme,AL_Theme,S_Theme,S_Theme_1,S_Theme_2,S_Theme_3,E_Theme,ROOT_Bitmap,AL_Bitmap,E_Bitmap,ROOT_Event,AL_Event,E_Event,ROOT_Font,AL_Font,E_Font,ROOT_ThemeInfo,AL_ThemeInfo,E_ThemeInfo,ROOT_Window,AL_Window,S_Window,S_Window_1,S_Window_2,E_Window,ROOT_Layout,AL_Layout,S_Layout,E_Layout,ROOT_Group,AL_Group,S_Group,S_Group_1,S_Group_2,E_Group,ROOT_Anchor,AL_Anchor,E_Anchor,ROOT_Image,AL_Image,E_Image,ROOT_Rectangle,AL_Rectangle,E_Rectangle,ROOT_Button,AL_Button,E_Button,ROOT_CheckBox,AL_CheckBox,E_CheckBox,ROOT_Slider,AL_Slider,E_Slider,ROOT_RadialSlider,AL_RadialSlider,E_RadialSlider,ROOT_Text,AL_Text,E_Text,ROOT_Playlist,AL_Playlist,S_Playlist,E_Playlist,PROLOG,DOCTYPE,EPILOG>{S} SKIP;
/* PROLOG: determine root element and process it. */
<PROLOG>{
"<?xml"({S}version{Eq}(\'{VersionNum}\'|\"{VersionNum}\"))?"?>" SET(DOCTYPE);
"<?xml"[^>]*">" FAIL("Bad declaration %s.",yytext);
}
<PROLOG,DOCTYPE>{
"<!DOCTYPE"{S}"Layout"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Layout);
"<!DOCTYPE"{S}"Event"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Event);
"<!DOCTYPE"{S}"Image"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Image);
"<!DOCTYPE"{S}"Playlist"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Playlist);
"<!DOCTYPE"{S}"Text"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Text);
"<!DOCTYPE"{S}"Rectangle"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Rectangle);
"<!DOCTYPE"{S}"Anchor"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Anchor);
"<!DOCTYPE"{S}"Group"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Group);
"<!DOCTYPE"{S}"Theme"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Theme);
"<!DOCTYPE"{S}"Font"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Font);
"<!DOCTYPE"{S}"RadialSlider"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_RadialSlider);
"<!DOCTYPE"{S}"ThemeInfo"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_ThemeInfo);
"<!DOCTYPE"{S}"Slider"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Slider);
"<!DOCTYPE"{S}"CheckBox"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_CheckBox);
"<!DOCTYPE"{S}"Button"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Button);
"<!DOCTYPE"{S}"Bitmap"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Bitmap);
"<!DOCTYPE"{S}"Window"{S}SYSTEM{S}("'skin.dtd'"|"\"skin.dtd\""){s}">" SET(ROOT_Window);
"<!"[^>-][^>]*">" FAIL("Bad declaration %s.",yytext);
. FAIL("Unexpected character `%c' in prolog.", yytext[0]);
<<EOF>> FAIL("EOF in prolog.");
}
/* RULES DERIVED FROM DTD. */
/* <!--
* --> */
/* version CDATA "1.0"
* magnet CDATA "15"
* alpha CDATA "255"
* movealpha CDATA "255"
* fadetime CDATA "400"
* > */
<ROOT_Theme>"<Theme"{s} {
A_Theme_version = "1.0";
A_Theme_magnet = "15";
A_Theme_alpha = "255";
A_Theme_movealpha = "255";
A_Theme_fadetime = "400";
ENTER(AL_Theme);
}
<AL_Theme>{
"version"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Theme_version);
"version"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Theme_version);
"magnet"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Theme_magnet);
"magnet"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Theme_magnet);
"alpha"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Theme_alpha);
"alpha"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Theme_alpha);
"movealpha"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Theme_movealpha);
"movealpha"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Theme_movealpha);
"fadetime"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Theme_fadetime);
"fadetime"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Theme_fadetime);
">" {
LEAVE; STag_Theme(); pcdata = NULL; ENTER(S_Theme);
}
"/>" FAIL("`Theme' element cannot be empty.");
. FAIL("Unexpected character `%c' in attribute list of Theme element.", yytext[0]);
{Name} FAIL("Bad attribute `%s' in `Theme' element start tag.",yytext);
<<EOF>> FAIL("EOF in attribute list of `Theme' element.");
}
<E_Theme,S_Theme_1,S_Theme_3>{
"</Theme"{s}">" {
LEAVE;
ETag_Theme();
switch (YY_START) {
case ROOT_Theme: SET(EPILOG); break;
}
}
"</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Theme>' expected.",yytext);
. FAIL("Unexpected character `%c': `</Theme>' expected.",yytext[0]);
<<EOF>> FAIL("Premature EOF: `</Theme>' expected.");
}
/* <!-- main elements --> */
/* id CDATA #REQUIRED
* file CDATA #REQUIRED
* alphacolor CDATA #REQUIRED
* > */
<ROOT_Bitmap,S_Theme_2,S_Theme_1,S_Theme_3>"<Bitmap"{s} {
A_Bitmap_id = NULL;
A_Bitmap_file = NULL;
A_Bitmap_alphacolor = NULL;
ENTER(AL_Bitmap);
}
<AL_Bitmap>{
"id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Bitmap_id);
"id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Bitmap_id);
"file"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Bitmap_file);
"file"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Bitmap_file);
"alphacolor"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Bitmap_alphacolor);
"alphacolor"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Bitmap_alphacolor);
">" {
if (!A_Bitmap_id) FAIL("Required attribute `id' not set for `Bitmap' element.");
if (!A_Bitmap_file) FAIL("Required attribute `file' not set for `Bitmap' element.");
if (!A_Bitmap_alphacolor) FAIL("Required attribute `alphacolor' not set for `Bitmap' element.");
LEAVE; STag_Bitmap(); pcdata = NULL; ENTER(E_Bitmap);
}
"/>" {
if (!A_Bitmap_id) FAIL("Required attribute `id' not set for `Bitmap' element.");
if (!A_Bitmap_file) FAIL("Required attribute `file' not set for `Bitmap' element.");
if (!A_Bitmap_alphacolor) FAIL("Required attribute `alphacolor' not set for `Bitmap' element.");
LEAVE; STag_Bitmap(); pcdata = NULL; ETag_Bitmap();
switch (YY_START) {
case S_Theme_2: case S_Theme_1: case S_Theme_3: SET(S_Theme_3); break;
case ROOT_Bitmap: SET(EPILOG); break;
}
}
. FAIL("Unexpected character `%c' in attribute list of Bitmap element.", yytext[0]);
{Name} FAIL("Bad attribute `%s' in `Bitmap' element start tag.",yytext);
<<EOF>> FAIL("EOF in attribute list of `Bitmap' element.");
}
<E_Bitmap>{
"</Bitmap"{s}">" {
LEAVE;
ETag_Bitmap();
switch (YY_START) {
case S_Theme_2: case S_Theme_1: case S_Theme_3: SET(S_Theme_3); break;
case ROOT_Bitmap: SET(EPILOG); break;
}
}
"</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Bitmap>' expected.",yytext);
. FAIL("Unexpected character `%c': `</Bitmap>' expected.",yytext[0]);
<<EOF>> FAIL("Premature EOF: `</Bitmap>' expected.");
}
/* id CDATA #REQUIRED
* event CDATA #REQUIRED
* key CDATA "none"
* > */
<ROOT_Event,S_Theme_2,S_Theme_1,S_Theme_3>"<Event"{s} {
A_Event_id = NULL;
A_Event_event = NULL;
A_Event_key = "none";
ENTER(AL_Event);
}
<AL_Event>{
"id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Event_id);
"id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Event_id);
"event"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Event_event);
"event"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Event_event);
"key"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Event_key);
"key"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Event_key);
">" {
if (!A_Event_id) FAIL("Required attribute `id' not set for `Event' element.");
if (!A_Event_event) FAIL("Required attribute `event' not set for `Event' element.");
LEAVE; STag_Event(); pcdata = NULL; ENTER(E_Event);
}
"/>" {
if (!A_Event_id) FAIL("Required attribute `id' not set for `Event' element.");
if (!A_Event_event) FAIL("Required attribute `event' not set for `Event' element.");
LEAVE; STag_Event(); pcdata = NULL; ETag_Event();
switch (YY_START) {
case S_Theme_2: case S_Theme_1: case S_Theme_3: SET(S_Theme_3); break;
case ROOT_Event: SET(EPILOG); break;
}
}
. FAIL("Unexpected character `%c' in attribute list of Event element.", yytext[0]);
{Name} FAIL("Bad attribute `%s' in `Event' element start tag.",yytext);
<<EOF>> FAIL("EOF in attribute list of `Event' element.");
}
<E_Event>{
"</Event"{s}">" {
LEAVE;
ETag_Event();
switch (YY_START) {
case S_Theme_2: case S_Theme_1: case S_Theme_3: SET(S_Theme_3); break;
case ROOT_Event: SET(EPILOG); break;
}
}
"</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Event>' expected.",yytext);
. FAIL("Unexpected character `%c': `</Event>' expected.",yytext[0]);
<<EOF>> FAIL("Premature EOF: `</Event>' expected.");
}
/* id CDATA #REQUIRED
* font CDATA "arial"
* size CDATA "12"
* color CDATA "#000000"
* italic CDATA "false"
* underline CDATA "false"
* > */
<ROOT_Font,S_Theme_2,S_Theme_1,S_Theme_3>"<Font"{s} {
A_Font_id = NULL;
A_Font_font = "arial";
A_Font_size = "12";
A_Font_color = "#000000";
A_Font_italic = "false";
A_Font_underline = "false";
ENTER(AL_Font);
}
<AL_Font>{
"id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Font_id);
"id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Font_id);
"font"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Font_font);
"font"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Font_font);
"size"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Font_size);
"size"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Font_size);
"color"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Font_color);
"color"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Font_color);
"italic"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Font_italic);
"italic"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Font_italic);
"underline"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Font_underline);
"underline"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Font_underline);
">" {
if (!A_Font_id) FAIL("Required attribute `id' not set for `Font' element.");
LEAVE; STag_Font(); pcdata = NULL; ENTER(E_Font);
}
"/>" {
if (!A_Font_id) FAIL("Required attribute `id' not set for `Font' element.");
LEAVE; STag_Font(); pcdata = NULL; ETag_Font();
switch (YY_START) {
case ROOT_Font: SET(EPILOG); break;
case S_Theme_2: case S_Theme_1: case S_Theme_3: SET(S_Theme_3); break;
}
}
. FAIL("Unexpected character `%c' in attribute list of Font element.", yytext[0]);
{Name} FAIL("Bad attribute `%s' in `Font' element start tag.",yytext);
<<EOF>> FAIL("EOF in attribute list of `Font' element.");
}
<E_Font>{
"</Font"{s}">" {
LEAVE;
ETag_Font();
switch (YY_START) {
case ROOT_Font: SET(EPILOG); break;
case S_Theme_2: case S_Theme_1: case S_Theme_3: SET(S_Theme_3); break;
}
}
"</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Font>' expected.",yytext);
. FAIL("Unexpected character `%c': `</Font>' expected.",yytext[0]);
<<EOF>> FAIL("Premature EOF: `</Font>' expected.");
}
/* name CDATA #IMPLIED
* author CDATA #IMPLIED
* email CDATA #IMPLIED
* webpage CDATA #IMPLIED
* > */
<ROOT_ThemeInfo,S_Theme>"<ThemeInfo"{s} {
A_ThemeInfo_name = NULL;
A_ThemeInfo_author = NULL;
A_ThemeInfo_email = NULL;
A_ThemeInfo_webpage = NULL;
ENTER(AL_ThemeInfo);
}
<AL_ThemeInfo>{
"name"{Eq}\' ENTER(VALUE1); BUFFERSET(A_ThemeInfo_name);
"name"{Eq}\" ENTER(VALUE2); BUFFERSET(A_ThemeInfo_name);
"author"{Eq}\' ENTER(VALUE1); BUFFERSET(A_ThemeInfo_author);
"author"{Eq}\" ENTER(VALUE2); BUFFERSET(A_ThemeInfo_author);
"email"{Eq}\' ENTER(VALUE1); BUFFERSET(A_ThemeInfo_email);
"email"{Eq}\" ENTER(VALUE2); BUFFERSET(A_ThemeInfo_email);
"webpage"{Eq}\' ENTER(VALUE1); BUFFERSET(A_ThemeInfo_webpage);
"webpage"{Eq}\" ENTER(VALUE2); BUFFERSET(A_ThemeInfo_webpage);
">" {
LEAVE; STag_ThemeInfo(); pcdata = NULL; ENTER(E_ThemeInfo);
}
"/>" {
LEAVE; STag_ThemeInfo(); pcdata = NULL; ETag_ThemeInfo();
switch (YY_START) {
case S_Theme: SET(S_Theme_1); break;
case ROOT_ThemeInfo: SET(EPILOG); break;
}
}
. FAIL("Unexpected character `%c' in attribute list of ThemeInfo element.", yytext[0]);
{Name} FAIL("Bad attribute `%s' in `ThemeInfo' element start tag.",yytext);
<<EOF>> FAIL("EOF in attribute list of `ThemeInfo' element.");
}
<E_ThemeInfo>{
"</ThemeInfo"{s}">" {
LEAVE;
ETag_ThemeInfo();
switch (YY_START) {
case S_Theme: SET(S_Theme_1); break;
case ROOT_ThemeInfo: SET(EPILOG); break;
}
}
"</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</ThemeInfo>' expected.",yytext);
. FAIL("Unexpected character `%c': `</ThemeInfo>' expected.",yytext[0]);
<<EOF>> FAIL("Premature EOF: `</ThemeInfo>' expected.");
}
/* id CDATA #REQUIRED
* visible CDATA "true"
* x CDATA "\0"
* y CDATA "\0"
* dragdrop CDATA "true"
* playondrop CDATA "true"
* > */
<ROOT_Window,S_Theme_2,S_Theme_1,S_Theme_3>"<Window"{s} {
A_Window_id = NULL;
A_Window_visible = "true";
A_Window_x = "\0";
A_Window_y = "\0";
A_Window_dragdrop = "true";
A_Window_playondrop = "true";
ENTER(AL_Window);
}
<AL_Window>{
"id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Window_id);
"id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Window_id);
"visible"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Window_visible);
"visible"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Window_visible);
"x"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Window_x);
"x"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Window_x);
"y"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Window_y);
"y"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Window_y);
"dragdrop"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Window_dragdrop);
"dragdrop"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Window_dragdrop);
"playondrop"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Window_playondrop);
"playondrop"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Window_playondrop);
">" {
if (!A_Window_id) FAIL("Required attribute `id' not set for `Window' element.");
LEAVE; STag_Window(); pcdata = NULL; ENTER(S_Window);
}
"/>" FAIL("`Window' element cannot be empty.");
. FAIL("Unexpected character `%c' in attribute list of Window element.", yytext[0]);
{Name} FAIL("Bad attribute `%s' in `Window' element start tag.",yytext);
<<EOF>> FAIL("EOF in attribute list of `Window' element.");
}
<S_Window_2,E_Window>{
"</Window"{s}">" {
LEAVE;
ETag_Window();
switch (YY_START) {
case ROOT_Window: SET(EPILOG); break;
case S_Theme_2: case S_Theme_1: case S_Theme_3: SET(S_Theme_3); break;
}
}
"</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Window>' expected.",yytext);
. FAIL("Unexpected character `%c': `</Window>' expected.",yytext[0]);
<<EOF>> FAIL("Premature EOF: `</Window>' expected.");
}
/* id CDATA "none"
* width CDATA #REQUIRED
* height CDATA #REQUIRED
* minwidth CDATA "-1"
* maxwidth CDATA "-1"
* minheight CDATA "-1"
* maxheight CDATA "-1"
* > */
<ROOT_Layout,S_Window,S_Window_1,S_Window_2>"<Layout"{s} {
A_Layout_id = "none";
A_Layout_width = NULL;
A_Layout_height = NULL;
A_Layout_minwidth = "-1";
A_Layout_maxwidth = "-1";
A_Layout_minheight = "-1";
A_Layout_maxheight = "-1";
ENTER(AL_Layout);
}
<AL_Layout>{
"id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Layout_id);
"id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Layout_id);
"width"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Layout_width);
"width"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Layout_width);
"height"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Layout_height);
"height"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Layout_height);
"minwidth"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Layout_minwidth);
"minwidth"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Layout_minwidth);
"maxwidth"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Layout_maxwidth);
"maxwidth"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Layout_maxwidth);
"minheight"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Layout_minheight);
"minheight"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Layout_minheight);
"maxheight"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Layout_maxheight);
"maxheight"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Layout_maxheight);
">" {
if (!A_Layout_width) FAIL("Required attribute `width' not set for `Layout' element.");
if (!A_Layout_height) FAIL("Required attribute `height' not set for `Layout' element.");
LEAVE; STag_Layout(); pcdata = NULL; ENTER(S_Layout);
}
"/>" FAIL("`Layout' element cannot be empty.");
. FAIL("Unexpected character `%c' in attribute list of Layout element.", yytext[0]);
{Name} FAIL("Bad attribute `%s' in `Layout' element start tag.",yytext);
<<EOF>> FAIL("EOF in attribute list of `Layout' element.");
}
<E_Layout>{
"</Layout"{s}">" {
LEAVE;
ETag_Layout();
switch (YY_START) {
case S_Window: case S_Window_1: case S_Window_2: SET(S_Window_2); break;
case ROOT_Layout: SET(EPILOG); break;
}
}
"</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Layout>' expected.",yytext);
. FAIL("Unexpected character `%c': `</Layout>' expected.",yytext[0]);
<<EOF>> FAIL("Premature EOF: `</Layout>' expected.");
}
/* Rectangle|Anchor)+> */
/* x CDATA "\0"
* y CDATA "\0"
* > */
<ROOT_Group,S_Group_2,S_Layout,S_Group_1,S_Group>"<Group"{s} {
A_Group_x = "\0";
A_Group_y = "\0";
ENTER(AL_Group);
}
<AL_Group>{
"x"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Group_x);
"x"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Group_x);
"y"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Group_y);
"y"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Group_y);
">" {
LEAVE; STag_Group(); pcdata = NULL; ENTER(S_Group);
}
"/>" FAIL("`Group' element cannot be empty.");
. FAIL("Unexpected character `%c' in attribute list of Group element.", yytext[0]);
{Name} FAIL("Bad attribute `%s' in `Group' element start tag.",yytext);
<<EOF>> FAIL("EOF in attribute list of `Group' element.");
}
<S_Group_2,E_Group>{
"</Group"{s}">" {
LEAVE;
ETag_Group();
switch (YY_START) {
case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
case S_Layout: SET(E_Layout); break;
case ROOT_Group: SET(EPILOG); break;
}
}
"</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Group>' expected.",yytext);
. FAIL("Unexpected character `%c': `</Group>' expected.",yytext[0]);
<<EOF>> FAIL("Premature EOF: `</Group>' expected.");
}
/* <!-- Anchors --> */
/* x CDATA "\0"
* y CDATA "\0"
* priority CDATA #REQUIRED
* range CDATA "10"
* > */
<ROOT_Anchor,S_Group_2,S_Group_1,S_Group>"<Anchor"{s} {
A_Anchor_x = "\0";
A_Anchor_y = "\0";
A_Anchor_priority = NULL;
A_Anchor_range = "10";
ENTER(AL_Anchor);
}
<AL_Anchor>{
"x"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Anchor_x);
"x"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Anchor_x);
"y"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Anchor_y);
"y"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Anchor_y);
"priority"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Anchor_priority);
"priority"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Anchor_priority);
"range"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Anchor_range);
"range"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Anchor_range);
">" {
if (!A_Anchor_priority) FAIL("Required attribute `priority' not set for `Anchor' element.");
LEAVE; STag_Anchor(); pcdata = NULL; ENTER(E_Anchor);
}
"/>" {
if (!A_Anchor_priority) FAIL("Required attribute `priority' not set for `Anchor' element.");
LEAVE; STag_Anchor(); pcdata = NULL; ETag_Anchor();
switch (YY_START) {
case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
case ROOT_Anchor: SET(EPILOG); break;
}
}
. FAIL("Unexpected character `%c' in attribute list of Anchor element.", yytext[0]);
{Name} FAIL("Bad attribute `%s' in `Anchor' element start tag.",yytext);
<<EOF>> FAIL("EOF in attribute list of `Anchor' element.");
}
<E_Anchor>{
"</Anchor"{s}">" {
LEAVE;
ETag_Anchor();
switch (YY_START) {
case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
case ROOT_Anchor: SET(EPILOG); break;
}
}
"</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Anchor>' expected.",yytext);
. FAIL("Unexpected character `%c': `</Anchor>' expected.",yytext[0]);
<<EOF>> FAIL("Premature EOF: `</Anchor>' expected.");
}
/* <!-- Controls --> */
/* id CDATA "none"
* visible CDATA "true"
* x CDATA "\0"
* y CDATA "\0"
* lefttop CDATA "lefttop"
* rightbottom CDATA "lefttop"
* image CDATA #REQUIRED
* onclick CDATA "none"
* help CDATA "\0"
* > */
<ROOT_Image,S_Group_2,S_Group_1,S_Group>"<Image"{s} {
A_Image_id = "none";
A_Image_visible = "true";
A_Image_x = "\0";
A_Image_y = "\0";
A_Image_lefttop = "lefttop";
A_Image_rightbottom = "lefttop";
A_Image_image = NULL;
A_Image_onclick = "none";
A_Image_help = "\0";
ENTER(AL_Image);
}
<AL_Image>{
"id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Image_id);
"id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Image_id);
"visible"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Image_visible);
"visible"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Image_visible);
"x"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Image_x);
"x"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Image_x);
"y"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Image_y);
"y"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Image_y);
"lefttop"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Image_lefttop);
"lefttop"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Image_lefttop);
"rightbottom"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Image_rightbottom);
"rightbottom"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Image_rightbottom);
"image"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Image_image);
"image"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Image_image);
"onclick"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Image_onclick);
"onclick"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Image_onclick);
"help"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Image_help);
"help"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Image_help);
">" {
if (!A_Image_image) FAIL("Required attribute `image' not set for `Image' element.");
LEAVE; STag_Image(); pcdata = NULL; ENTER(E_Image);
}
"/>" {
if (!A_Image_image) FAIL("Required attribute `image' not set for `Image' element.");
LEAVE; STag_Image(); pcdata = NULL; ETag_Image();
switch (YY_START) {
case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
case ROOT_Image: SET(EPILOG); break;
}
}
. FAIL("Unexpected character `%c' in attribute list of Image element.", yytext[0]);
{Name} FAIL("Bad attribute `%s' in `Image' element start tag.",yytext);
<<EOF>> FAIL("EOF in attribute list of `Image' element.");
}
<E_Image>{
"</Image"{s}">" {
LEAVE;
ETag_Image();
switch (YY_START) {
case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
case ROOT_Image: SET(EPILOG); break;
}
}
"</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Image>' expected.",yytext);
. FAIL("Unexpected character `%c': `</Image>' expected.",yytext[0]);
<<EOF>> FAIL("Premature EOF: `</Image>' expected.");
}
/* id CDATA "none"
* visible CDATA "true"
* x CDATA "\0"
* y CDATA "\0"
* w CDATA "50"
* h CDATA "50"
* color CDATA "#C0C0C0"
* onclick CDATA "none"
* help CDATA "\0"
* > */
<ROOT_Rectangle,S_Group_2,S_Group_1,S_Group>"<Rectangle"{s} {
A_Rectangle_id = "none";
A_Rectangle_visible = "true";
A_Rectangle_x = "\0";
A_Rectangle_y = "\0";
A_Rectangle_w = "50";
A_Rectangle_h = "50";
A_Rectangle_color = "#C0C0C0";
A_Rectangle_onclick = "none";
A_Rectangle_help = "\0";
ENTER(AL_Rectangle);
}
<AL_Rectangle>{
"id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Rectangle_id);
"id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Rectangle_id);
"visible"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Rectangle_visible);
"visible"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Rectangle_visible);
"x"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Rectangle_x);
"x"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Rectangle_x);
"y"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Rectangle_y);
"y"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Rectangle_y);
"w"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Rectangle_w);
"w"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Rectangle_w);
"h"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Rectangle_h);
"h"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Rectangle_h);
"color"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Rectangle_color);
"color"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Rectangle_color);
"onclick"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Rectangle_onclick);
"onclick"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Rectangle_onclick);
"help"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Rectangle_help);
"help"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Rectangle_help);
">" {
LEAVE; STag_Rectangle(); pcdata = NULL; ENTER(E_Rectangle);
}
"/>" {
LEAVE; STag_Rectangle(); pcdata = NULL; ETag_Rectangle();
switch (YY_START) {
case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
case ROOT_Rectangle: SET(EPILOG); break;
}
}
. FAIL("Unexpected character `%c' in attribute list of Rectangle element.", yytext[0]);
{Name} FAIL("Bad attribute `%s' in `Rectangle' element start tag.",yytext);
<<EOF>> FAIL("EOF in attribute list of `Rectangle' element.");
}
<E_Rectangle>{
"</Rectangle"{s}">" {
LEAVE;
ETag_Rectangle();
switch (YY_START) {
case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
case ROOT_Rectangle: SET(EPILOG); break;
}
}
"</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Rectangle>' expected.",yytext);
. FAIL("Unexpected character `%c': `</Rectangle>' expected.",yytext[0]);
<<EOF>> FAIL("Premature EOF: `</Rectangle>' expected.");
}
/* id CDATA "none"
* x CDATA "\0"
* y CDATA "\0"
* lefttop CDATA "lefttop"
* rightbottom CDATA "lefttop"
* up CDATA #REQUIRED
* down CDATA "none"
* over CDATA "none"
* action CDATA "none"
* tooltiptext CDATA "\0"
* help CDATA "\0"
* > */
<ROOT_Button,S_Group_2,S_Group_1,S_Group>"<Button"{s} {
A_Button_id = "none";
A_Button_x = "\0";
A_Button_y = "\0";
A_Button_lefttop = "lefttop";
A_Button_rightbottom = "lefttop";
A_Button_up = NULL;
A_Button_down = "none";
A_Button_over = "none";
A_Button_action = "none";
A_Button_tooltiptext = "\0";
A_Button_help = "\0";
ENTER(AL_Button);
}
<AL_Button>{
"id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Button_id);
"id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Button_id);
"x"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Button_x);
"x"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Button_x);
"y"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Button_y);
"y"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Button_y);
"lefttop"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Button_lefttop);
"lefttop"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Button_lefttop);
"rightbottom"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Button_rightbottom);
"rightbottom"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Button_rightbottom);
"up"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Button_up);
"up"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Button_up);
"down"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Button_down);
"down"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Button_down);
"over"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Button_over);
"over"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Button_over);
"action"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Button_action);
"action"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Button_action);
"tooltiptext"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Button_tooltiptext);
"tooltiptext"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Button_tooltiptext);
"help"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Button_help);
"help"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Button_help);
">" {
if (!A_Button_up) FAIL("Required attribute `up' not set for `Button' element.");
LEAVE; STag_Button(); pcdata = NULL; ENTER(E_Button);
}
"/>" {
if (!A_Button_up) FAIL("Required attribute `up' not set for `Button' element.");
LEAVE; STag_Button(); pcdata = NULL; ETag_Button();
switch (YY_START) {
case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
case ROOT_Button: SET(EPILOG); break;
}
}
. FAIL("Unexpected character `%c' in attribute list of Button element.", yytext[0]);
{Name} FAIL("Bad attribute `%s' in `Button' element start tag.",yytext);
<<EOF>> FAIL("EOF in attribute list of `Button' element.");
}
<E_Button>{
"</Button"{s}">" {
LEAVE;
ETag_Button();
switch (YY_START) {
case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
case ROOT_Button: SET(EPILOG); break;
}
}
"</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Button>' expected.",yytext);
. FAIL("Unexpected character `%c': `</Button>' expected.",yytext[0]);
<<EOF>> FAIL("Premature EOF: `</Button>' expected.");
}
/* id CDATA "none"
* x CDATA "\0"
* y CDATA "\0"
* lefttop CDATA "lefttop"
* rightbottom CDATA "lefttop"
* up1 CDATA #REQUIRED
* down1 CDATA "none"
* over1 CDATA "none"
* up2 CDATA #REQUIRED
* down2 CDATA "none"
* over2 CDATA "none"
* state CDATA #REQUIRED
* action1 CDATA "none"
* action2 CDATA "none"
* tooltiptext1 CDATA "\0"
* tooltiptext2 CDATA "\0"
* help CDATA "\0"
* > */
<ROOT_CheckBox,S_Group_2,S_Group_1,S_Group>"<CheckBox"{s} {
A_CheckBox_id = "none";
A_CheckBox_x = "\0";
A_CheckBox_y = "\0";
A_CheckBox_lefttop = "lefttop";
A_CheckBox_rightbottom = "lefttop";
A_CheckBox_up1 = NULL;
A_CheckBox_down1 = "none";
A_CheckBox_over1 = "none";
A_CheckBox_up2 = NULL;
A_CheckBox_down2 = "none";
A_CheckBox_over2 = "none";
A_CheckBox_state = NULL;
A_CheckBox_action1 = "none";
A_CheckBox_action2 = "none";
A_CheckBox_tooltiptext1 = "\0";
A_CheckBox_tooltiptext2 = "\0";
A_CheckBox_help = "\0";
ENTER(AL_CheckBox);
}
<AL_CheckBox>{
"id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_id);
"id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_id);
"x"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_x);
"x"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_x);
"y"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_y);
"y"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_y);
"lefttop"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_lefttop);
"lefttop"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_lefttop);
"rightbottom"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_rightbottom);
"rightbottom"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_rightbottom);
"up1"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_up1);
"up1"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_up1);
"down1"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_down1);
"down1"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_down1);
"over1"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_over1);
"over1"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_over1);
"up2"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_up2);
"up2"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_up2);
"down2"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_down2);
"down2"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_down2);
"over2"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_over2);
"over2"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_over2);
"state"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_state);
"state"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_state);
"action1"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_action1);
"action1"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_action1);
"action2"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_action2);
"action2"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_action2);
"tooltiptext1"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_tooltiptext1);
"tooltiptext1"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_tooltiptext1);
"tooltiptext2"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_tooltiptext2);
"tooltiptext2"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_tooltiptext2);
"help"{Eq}\' ENTER(VALUE1); BUFFERSET(A_CheckBox_help);
"help"{Eq}\" ENTER(VALUE2); BUFFERSET(A_CheckBox_help);
">" {
if (!A_CheckBox_up1) FAIL("Required attribute `up1' not set for `CheckBox' element.");
if (!A_CheckBox_up2) FAIL("Required attribute `up2' not set for `CheckBox' element.");
if (!A_CheckBox_state) FAIL("Required attribute `state' not set for `CheckBox' element.");
LEAVE; STag_CheckBox(); pcdata = NULL; ENTER(E_CheckBox);
}
"/>" {
if (!A_CheckBox_up1) FAIL("Required attribute `up1' not set for `CheckBox' element.");
if (!A_CheckBox_up2) FAIL("Required attribute `up2' not set for `CheckBox' element.");
if (!A_CheckBox_state) FAIL("Required attribute `state' not set for `CheckBox' element.");
LEAVE; STag_CheckBox(); pcdata = NULL; ETag_CheckBox();
switch (YY_START) {
case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
case ROOT_CheckBox: SET(EPILOG); break;
}
}
. FAIL("Unexpected character `%c' in attribute list of CheckBox element.", yytext[0]);
{Name} FAIL("Bad attribute `%s' in `CheckBox' element start tag.",yytext);
<<EOF>> FAIL("EOF in attribute list of `CheckBox' element.");
}
<E_CheckBox>{
"</CheckBox"{s}">" {
LEAVE;
ETag_CheckBox();
switch (YY_START) {
case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
case ROOT_CheckBox: SET(EPILOG); break;
}
}
"</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</CheckBox>' expected.",yytext);
. FAIL("Unexpected character `%c': `</CheckBox>' expected.",yytext[0]);
<<EOF>> FAIL("Premature EOF: `</CheckBox>' expected.");
}
/* id CDATA "none"
* visible CDATA "true"
* x CDATA "\0"
* y CDATA "\0"
* lefttop CDATA "lefttop"
* rightbottom CDATA "lefttop"
* up CDATA #REQUIRED
* down CDATA "none"
* over CDATA "none"
* points CDATA #REQUIRED
* thickness CDATA "10"
* value CDATA "none"
* tooltiptext CDATA "\0"
* help CDATA "\0"
* > */
<ROOT_Slider,S_Playlist,S_Group_2,S_Group_1,S_Group>"<Slider"{s} {
A_Slider_id = "none";
A_Slider_visible = "true";
A_Slider_x = "\0";
A_Slider_y = "\0";
A_Slider_lefttop = "lefttop";
A_Slider_rightbottom = "lefttop";
A_Slider_up = NULL;
A_Slider_down = "none";
A_Slider_over = "none";
A_Slider_points = NULL;
A_Slider_thickness = "10";
A_Slider_value = "none";
A_Slider_tooltiptext = "\0";
A_Slider_help = "\0";
ENTER(AL_Slider);
}
<AL_Slider>{
"id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_id);
"id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_id);
"visible"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_visible);
"visible"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_visible);
"x"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_x);
"x"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_x);
"y"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_y);
"y"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_y);
"lefttop"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_lefttop);
"lefttop"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_lefttop);
"rightbottom"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_rightbottom);
"rightbottom"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_rightbottom);
"up"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_up);
"up"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_up);
"down"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_down);
"down"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_down);
"over"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_over);
"over"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_over);
"points"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_points);
"points"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_points);
"thickness"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_thickness);
"thickness"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_thickness);
"value"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_value);
"value"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_value);
"tooltiptext"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_tooltiptext);
"tooltiptext"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_tooltiptext);
"help"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Slider_help);
"help"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Slider_help);
">" {
if (!A_Slider_up) FAIL("Required attribute `up' not set for `Slider' element.");
if (!A_Slider_points) FAIL("Required attribute `points' not set for `Slider' element.");
LEAVE; STag_Slider(); pcdata = NULL; ENTER(E_Slider);
}
"/>" {
if (!A_Slider_up) FAIL("Required attribute `up' not set for `Slider' element.");
if (!A_Slider_points) FAIL("Required attribute `points' not set for `Slider' element.");
LEAVE; STag_Slider(); pcdata = NULL; ETag_Slider();
switch (YY_START) {
case S_Playlist: SET(E_Playlist); break;
case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
case ROOT_Slider: SET(EPILOG); break;
}
}
. FAIL("Unexpected character `%c' in attribute list of Slider element.", yytext[0]);
{Name} FAIL("Bad attribute `%s' in `Slider' element start tag.",yytext);
<<EOF>> FAIL("EOF in attribute list of `Slider' element.");
}
<E_Slider>{
"</Slider"{s}">" {
LEAVE;
ETag_Slider();
switch (YY_START) {
case S_Playlist: SET(E_Playlist); break;
case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
case ROOT_Slider: SET(EPILOG); break;
}
}
"</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Slider>' expected.",yytext);
. FAIL("Unexpected character `%c': `</Slider>' expected.",yytext[0]);
<<EOF>> FAIL("Premature EOF: `</Slider>' expected.");
}
/* id CDATA "none"
* visible CDATA "true"
* x CDATA "\0"
* y CDATA "\0"
* lefttop CDATA "lefttop"
* rightbottom CDATA "lefttop"
* sequence CDATA #REQUIRED
* nbimages CDATA #REQUIRED
* minangle CDATA "\0"
* maxangle CDATA "360"
* value CDATA "none"
* tooltiptext CDATA "\0"
* help CDATA "\0"
* > */
<ROOT_RadialSlider,S_Group_2,S_Group_1,S_Group>"<RadialSlider"{s} {
A_RadialSlider_id = "none";
A_RadialSlider_visible = "true";
A_RadialSlider_x = "\0";
A_RadialSlider_y = "\0";
A_RadialSlider_lefttop = "lefttop";
A_RadialSlider_rightbottom = "lefttop";
A_RadialSlider_sequence = NULL;
A_RadialSlider_nbimages = NULL;
A_RadialSlider_minangle = "\0";
A_RadialSlider_maxangle = "360";
A_RadialSlider_value = "none";
A_RadialSlider_tooltiptext = "\0";
A_RadialSlider_help = "\0";
ENTER(AL_RadialSlider);
}
<AL_RadialSlider>{
"id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_id);
"id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_id);
"visible"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_visible);
"visible"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_visible);
"x"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_x);
"x"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_x);
"y"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_y);
"y"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_y);
"lefttop"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_lefttop);
"lefttop"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_lefttop);
"rightbottom"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_rightbottom);
"rightbottom"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_rightbottom);
"sequence"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_sequence);
"sequence"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_sequence);
"nbimages"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_nbimages);
"nbimages"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_nbimages);
"minangle"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_minangle);
"minangle"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_minangle);
"maxangle"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_maxangle);
"maxangle"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_maxangle);
"value"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_value);
"value"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_value);
"tooltiptext"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_tooltiptext);
"tooltiptext"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_tooltiptext);
"help"{Eq}\' ENTER(VALUE1); BUFFERSET(A_RadialSlider_help);
"help"{Eq}\" ENTER(VALUE2); BUFFERSET(A_RadialSlider_help);
">" {
if (!A_RadialSlider_sequence) FAIL("Required attribute `sequence' not set for `RadialSlider' element.");
if (!A_RadialSlider_nbimages) FAIL("Required attribute `nbimages' not set for `RadialSlider' element.");
LEAVE; STag_RadialSlider(); pcdata = NULL; ENTER(E_RadialSlider);
}
"/>" {
if (!A_RadialSlider_sequence) FAIL("Required attribute `sequence' not set for `RadialSlider' element.");
if (!A_RadialSlider_nbimages) FAIL("Required attribute `nbimages' not set for `RadialSlider' element.");
LEAVE; STag_RadialSlider(); pcdata = NULL; ETag_RadialSlider();
switch (YY_START) {
case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
case ROOT_RadialSlider: SET(EPILOG); break;
}
}
. FAIL("Unexpected character `%c' in attribute list of RadialSlider element.", yytext[0]);
{Name} FAIL("Bad attribute `%s' in `RadialSlider' element start tag.",yytext);
<<EOF>> FAIL("EOF in attribute list of `RadialSlider' element.");
}
<E_RadialSlider>{
"</RadialSlider"{s}">" {
LEAVE;
ETag_RadialSlider();
switch (YY_START) {
case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
case ROOT_RadialSlider: SET(EPILOG); break;
}
}
"</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</RadialSlider>' expected.",yytext);
. FAIL("Unexpected character `%c': `</RadialSlider>' expected.",yytext[0]);
<<EOF>> FAIL("Premature EOF: `</RadialSlider>' expected.");
}
/* id CDATA "none"
* visible CDATA "true"
* x CDATA "\0"
* y CDATA "\0"
* text CDATA ""
* font CDATA #REQUIRED
* align CDATA "left"
* width CDATA "\0"
* display CDATA "none"
* scroll CDATA "true"
* scrollspace CDATA "20"
* help CDATA "\0"
* > */
<ROOT_Text,S_Group_2,S_Group_1,S_Group>"<Text"{s} {
A_Text_id = "none";
A_Text_visible = "true";
A_Text_x = "\0";
A_Text_y = "\0";
A_Text_text = NULL;
A_Text_font = NULL;
A_Text_align = "left";
A_Text_width = "\0";
A_Text_display = "none";
A_Text_scroll = "true";
A_Text_scrollspace = "20";
A_Text_help = "\0";
ENTER(AL_Text);
}
<AL_Text>{
"id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_id);
"id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_id);
"visible"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_visible);
"visible"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_visible);
"x"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_x);
"x"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_x);
"y"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_y);
"y"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_y);
"text"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_text);
"text"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_text);
"font"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_font);
"font"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_font);
"align"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_align);
"align"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_align);
"width"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_width);
"width"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_width);
"display"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_display);
"display"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_display);
"scroll"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_scroll);
"scroll"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_scroll);
"scrollspace"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_scrollspace);
"scrollspace"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_scrollspace);
"help"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Text_help);
"help"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Text_help);
">" {
if (!A_Text_font) FAIL("Required attribute `font' not set for `Text' element.");
LEAVE; STag_Text(); pcdata = NULL; ENTER(E_Text);
}
"/>" {
if (!A_Text_font) FAIL("Required attribute `font' not set for `Text' element.");
LEAVE; STag_Text(); pcdata = NULL; ETag_Text();
switch (YY_START) {
case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
case ROOT_Text: SET(EPILOG); break;
}
}
. FAIL("Unexpected character `%c' in attribute list of Text element.", yytext[0]);
{Name} FAIL("Bad attribute `%s' in `Text' element start tag.",yytext);
<<EOF>> FAIL("EOF in attribute list of `Text' element.");
}
<E_Text>{
"</Text"{s}">" {
LEAVE;
ETag_Text();
switch (YY_START) {
case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
case ROOT_Text: SET(EPILOG); break;
}
}
"</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Text>' expected.",yytext);
. FAIL("Unexpected character `%c': `</Text>' expected.",yytext[0]);
<<EOF>> FAIL("Premature EOF: `</Text>' expected.");
}
/* id CDATA #REQUIRED
* visible CDATA "true"
* x CDATA "\0"
* y CDATA "\0"
* width CDATA "\0"
* height CDATA "\0"
* lefttop CDATA "lefttop"
* rightbottom CDATA "lefttop"
* font CDATA #REQUIRED
* var CDATA "playlist"
* fgcolor CDATA "#000000"
* playcolor CDATA "#FF0000"
* bgcolor1 CDATA "#FFFFFF"
* bgcolor2 CDATA "#FFFFFF"
* selcolor CDATA "#0000FF"
* help CDATA "\0"
* > */
<ROOT_Playlist,S_Group_2,S_Group_1,S_Group>"<Playlist"{s} {
A_Playlist_id = NULL;
A_Playlist_visible = "true";
A_Playlist_x = "\0";
A_Playlist_y = "\0";
A_Playlist_width = "\0";
A_Playlist_height = "\0";
A_Playlist_lefttop = "lefttop";
A_Playlist_rightbottom = "lefttop";
A_Playlist_font = NULL;
A_Playlist_var = "playlist";
A_Playlist_fgcolor = "#000000";
A_Playlist_playcolor = "#FF0000";
A_Playlist_bgcolor1 = "#FFFFFF";
A_Playlist_bgcolor2 = "#FFFFFF";
A_Playlist_selcolor = "#0000FF";
A_Playlist_help = "\0";
ENTER(AL_Playlist);
}
<AL_Playlist>{
"id"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_id);
"id"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_id);
"visible"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_visible);
"visible"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_visible);
"x"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_x);
"x"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_x);
"y"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_y);
"y"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_y);
"width"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_width);
"width"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_width);
"height"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_height);
"height"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_height);
"lefttop"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_lefttop);
"lefttop"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_lefttop);
"rightbottom"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_rightbottom);
"rightbottom"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_rightbottom);
"font"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_font);
"font"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_font);
"var"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_var);
"var"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_var);
"fgcolor"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_fgcolor);
"fgcolor"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_fgcolor);
"playcolor"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_playcolor);
"playcolor"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_playcolor);
"bgcolor1"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_bgcolor1);
"bgcolor1"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_bgcolor1);
"bgcolor2"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_bgcolor2);
"bgcolor2"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_bgcolor2);
"selcolor"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_selcolor);
"selcolor"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_selcolor);
"help"{Eq}\' ENTER(VALUE1); BUFFERSET(A_Playlist_help);
"help"{Eq}\" ENTER(VALUE2); BUFFERSET(A_Playlist_help);
">" {
if (!A_Playlist_id) FAIL("Required attribute `id' not set for `Playlist' element.");
if (!A_Playlist_font) FAIL("Required attribute `font' not set for `Playlist' element.");
LEAVE; STag_Playlist(); pcdata = NULL; ENTER(S_Playlist);
}
"/>" FAIL("`Playlist' element cannot be empty.");
. FAIL("Unexpected character `%c' in attribute list of Playlist element.", yytext[0]);
{Name} FAIL("Bad attribute `%s' in `Playlist' element start tag.",yytext);
<<EOF>> FAIL("EOF in attribute list of `Playlist' element.");
}
<E_Playlist>{
"</Playlist"{s}">" {
LEAVE;
ETag_Playlist();
switch (YY_START) {
case S_Group_2: case S_Group_1: case S_Group: SET(S_Group_2); break;
case ROOT_Playlist: SET(EPILOG); break;
}
}
"</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</Playlist>' expected.",yytext);
. FAIL("Unexpected character `%c': `</Playlist>' expected.",yytext[0]);
<<EOF>> FAIL("Premature EOF: `</Playlist>' expected.");
}
/* EPILOG: after the root element. */
<EPILOG>{
. FAIL("Unexpected character `%c' after document.", yytext[0]);
<<EOF>> SUCCEED;
}
/* CHARACTER DATA. */
<IMPOSSIBLE,VALUE1,VALUE2>{
/* Non-defined standard entities... */
"&amp;" BUFFERPUTC('&');
"&lt;" BUFFERPUTC('<');
"&gt;" BUFFERPUTC('>');
"&apos;" BUFFERPUTC('\'');
"&quot;" BUFFERPUTC('"');
/* Character entities. */
"&#"[[:digit:]]+";" BUFFERPUTC((unsigned char)atoi(yytext+2));
"&#x"[[:xdigit:]]+";" BUFFERPUTC((unsigned char)strtol(yytext+3,NULL,16));
}
<IMPOSSIBLE,VALUE1,VALUE2,CDATA>{
"\n" |
"\r" |
"\r\n" |
"\n\r" BUFFERPUTC('\n');
}
<IMPOSSIBLE>{
"<![CDATA[" ENTER(CDATA);
"]]>" FAIL("Unexpected `]]>' in character data.");
}
<VALUE1>{
\' BUFFERDONE; LEAVE;
<<EOF>> FAIL("EOF in literal (\"'\" expected).");
}
<VALUE2>{
\" BUFFERDONE; LEAVE;
<<EOF>> FAIL("EOF in literal (`\"' expected).");
}
<IMPOSSIBLE,VALUE1,VALUE2>{
[^<&] BUFFERPUTC(yytext[0]);
[<&] FAIL("Spurious `%c' in character data.",yytext[0]);
}
<CDATA>{
"]]>" LEAVE;
"]]" BUFFERPUTC(yytext[0]); BUFFERPUTC(yytext[1]);
. BUFFERPUTC(yytext[0]);
<<EOF>> FAIL("EOF in CDATA section.");
}
/* Impossible rules to avoid warnings from flex(1). */
<INITIAL,IMPOSSIBLE>{
.|[\n] FAIL("The Impossible Happened: INITIAL or IMPOSSIBLE state entered?");
}
%%
/* Element context stack lookup. */
int element_context(int i)
{
return (0<i && i<yy_start_stack_depth
? yy_start_stack[yy_start_stack_ptr - i]
: 0);
}
#ifdef FLEX_DEBUG
void print_yy_stack(char* fmt, ...)
{
int i = 0; va_list ap; va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
for (i=1; i<yy_start_stack_ptr; i++)
fprintf(stderr, "%s/", statenames[yy_start_stack[i]]);
fprintf(stderr,"%s\n", statenames[YY_START]);
va_end(ap);
}
static void debug_enter(int state, char* statename) {
yy_push_state(state);
if (yy_flex_debug) print_yy_stack("--ENTER(%s) : ",statename);
}
static void debug_leave(void) {
if (yy_flex_debug) print_yy_stack("--LEAVE : ");
yy_pop_state();
}
static void debug_set(int state, char* statename) {
BEGIN(state);
if (yy_flex_debug) print_yy_stack("--SET(%s) : ",statename);
}
#endif
static int fail(const char* fmt, ...)
{
va_list ap; va_start(ap, fmt);
#ifdef FLEXML_yylineno
fprintf(stderr, "Invalid XML (XML input line %d, state %d): ", yylineno, YY_START);
#else
fprintf(stderr, "Invalid XML (state %d): ",YY_START);
#endif
vfprintf(stderr, fmt, ap);
fprintf(stderr, "\n");
va_end(ap);
return 1;
}
/*****************************************************************************
* skin_parser.cpp
*****************************************************************************
* Copyright (C) 2004 VideoLAN
* $Id: skin_parser.cpp,v 1.1 2004/01/25 11:44:19 asmax Exp $
*
* Authors: Cyril Deguet <asmax@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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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.
*****************************************************************************/
#include "skin_parser.hpp"
#include <math.h>
// Current DTD version
#define SKINS_DTD_VERSION "2.0"
SkinParser::SkinParser( intf_thread_t *pIntf, const string &rFileName ):
XMLParser( pIntf, rFileName ), m_xOffset( 0 ), m_yOffset( 0 )
{
}
void SkinParser::handleBeginElement( const string &rName, AttrList_t &attr )
{
if( rName == "Anchor" )
{
const BuilderData::Anchor anchor( atoi( attr["x"] ) + m_xOffset,
atoi( attr["y"] ) + m_yOffset, atoi( attr["range"] ),
atoi( attr["priority"] ), m_curWindowId );
m_data.m_listAnchor.push_back( anchor );
}
else if( rName == "Bitmap" )
{
const BuilderData::Bitmap bitmap( attr["id"], attr["file"],
ConvertColor( attr["alphacolor"] ) );
m_data.m_listBitmap.push_back( bitmap );
}
else if( rName == "Button" )
{
const BuilderData::Button button( attr["id"], atoi( attr["x"] ) +
m_xOffset, atoi( attr["y"] ) + m_yOffset, attr["lefttop"],
attr["rightbottom"], attr["up"], attr["down"], attr["over"],
attr["action"], attr["tooltiptext"], attr["help"], m_curLayer,
m_curWindowId, m_curLayoutId );
m_curLayer++;
m_data.m_listButton.push_back( button );
}
else if( rName == "CheckBox" )
{
const BuilderData::Checkbox checkbox( attr["id"], atoi( attr["x"] ) +
m_xOffset, atoi( attr["y"] ) + m_yOffset, attr["lefttop"],
attr["rightbottom"], attr["up1"], attr["down1"], attr["over1"],
attr["up2"], attr["down2"], attr["over2"], attr["state"],
attr["action1"], attr["action2"], attr["tooltiptext1"],
attr["tooltiptext2"], attr["help"], m_curLayer, m_curWindowId,
m_curLayoutId );
m_curLayer++;
m_data.m_listCheckbox.push_back( checkbox );
}
else if( rName == "Font" )
{
const BuilderData::Font fontData( attr["id"], attr["font"],
atoi( attr["size"] ) );
m_data.m_listFont.push_back( fontData );
}
else if( rName == "Group" )
{
m_xOffset += atoi( attr["x"] );
m_yOffset += atoi( attr["y"] );
m_xOffsetList.push_back( atoi( attr["x"] ) );
m_yOffsetList.push_back( atoi( attr["y"] ) );
}
else if( rName == "Image" )
{
const BuilderData::Image imageData( attr["id"], atoi( attr["x"] ) +
m_xOffset, atoi( attr["y"] ) + m_yOffset, attr["lefttop"],
attr["rightbottom"], ConvertBoolean( attr["visible"] ),
attr["image"], attr["onclick"], attr["help"], m_curLayer,
m_curWindowId, m_curLayoutId );
m_curLayer++;
m_data.m_listImage.push_back( imageData );
}
else if( rName == "Layout" )
{
const BuilderData::Layout layout( attr["id"], atoi( attr["width"] ),
atoi( attr["height"] ), atoi( attr["minwidth"] ),
atoi( attr["maxwidth"] ), atoi( attr["minheight"] ),
atoi( attr["maxheight"] ), m_curWindowId );
m_data.m_listLayout.push_back( layout );
m_curLayoutId = attr["id"];
m_curLayer = 0;
}
else if( rName == "Playlist" )
{
const BuilderData::List listData( attr["id"], atoi( attr["x"] ) +
m_xOffset, atoi( attr["y"] ) + m_yOffset, atoi( attr["width"]),
atoi( attr["height"] ), attr["lefttop"], attr["rightbottom"],
attr["font"], attr["var"], ConvertColor( attr["fgcolor"] ),
ConvertColor( attr["playcolor"] ),
ConvertColor( attr["bgcolor1"] ),
ConvertColor( attr["bgcolor2"] ),
ConvertColor( attr["selcolor"] ), attr["help"],
m_curLayer, m_curWindowId, m_curLayoutId );
m_curLayer++;
m_curListId = attr["id"];
m_data.m_listList.push_back( listData );
}
else if( rName == "RadialSlider" )
{
const BuilderData::RadialSlider radial( attr["id"], attr["visible"],
atoi( attr["x"] ) + m_xOffset, atoi( attr["y"] ) + m_yOffset,
attr["lefttop"], attr["rightbottom"], attr["sequence"],
atoi( attr["nbImages"] ), atof( attr["minAngle"] ) * M_PI / 180,
atof( attr["maxAngle"] ) * M_PI / 180, attr["value"],
attr["tooltiptext"], attr["help"], m_curLayer, m_curWindowId,
m_curLayoutId );
m_curLayer++;
m_data.m_listRadialSlider.push_back( radial );
}
else if( rName == "Slider" )
{
string newValue = attr["value"];
if( m_curListId != "" )
{
// Slider associated to a list
newValue = "playlist.slider";
}
const BuilderData::Slider slider( attr["id"], attr["visible"],
atoi( attr["x"] ) + m_xOffset, atoi( attr["y"] ) + m_yOffset,
attr["lefttop"], attr["rightbottom"], attr["up"], attr["down"],
attr["over"], attr["points"], atoi( attr["thickness"] ),
newValue, attr["tooltiptext"], attr["help"], m_curLayer,
m_curWindowId, m_curLayoutId );
m_curLayer++;
m_data.m_listSlider.push_back( slider );
}
else if( rName == "Text" )
{
const BuilderData::Text textData( attr["id"], atoi( attr["x"] ) +
m_xOffset, atoi( attr["y"] ) + m_yOffset, attr["font"],
attr["text"], atoi( attr["width"] ), attr["help"], m_curLayer,
m_curWindowId, m_curLayoutId );
m_curLayer++;
m_data.m_listText.push_back( textData );
}
else if( rName == "Theme" )
{
// Check the version
if( strcmp( attr["version"], SKINS_DTD_VERSION ) )
{
msg_Err( getIntf(), "Bad theme version : %s (you need version %s)",
attr["version"], SKINS_DTD_VERSION );
}
const BuilderData::Theme theme( atoi( attr["magnet"] ),
atoi( attr["alpha"] ), atoi( attr["movealpha"] ),
atoi( attr["fadetime"] ) );
m_data.m_listTheme.push_back( theme );
}
else if( rName == "ThemeInfo" )
{
msg_Warn( getIntf(), "skin: %s author: %s", attr["name"],
attr["author"] );
}
else if( rName == "Window" )
{
const BuilderData::Window window( attr["id"],
atoi( attr["x"] ) + m_xOffset, atoi( attr["y"] ) + m_yOffset,
ConvertBoolean( attr["visible"] ),
ConvertBoolean( attr["dragdrop"] ),
ConvertBoolean( attr["playondrop"] ) );
m_data.m_listWindow.push_back( window );
m_curWindowId = attr["id"];
}
}
void SkinParser::handleEndElement( const string &rName )
{
if( rName == "Group" )
{
m_xOffset -= m_xOffsetList.back();
m_yOffset -= m_yOffsetList.back();
m_xOffsetList.pop_back();
m_yOffsetList.pop_back();
}
else if( rName == "Playlist" )
{
m_curListId = "";
}
}
bool SkinParser::ConvertBoolean( const char *value ) const
{
return strcmp( value, "true" ) == 0;
}
int SkinParser::ConvertColor( const char *transcolor ) const
{
unsigned long iRed, iGreen, iBlue;
iRed = iGreen = iBlue = 0;
sscanf( transcolor, "#%2lX%2lX%2lX", &iRed, &iGreen, &iBlue );
return ( iRed << 16 | iGreen << 8 | iBlue );
}
/*****************************************************************************
* parser_context.hpp
* skin_parser.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: parser_context.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
* Copyright (C) 2004 VideoLAN
* $Id: skin_parser.hpp,v 1.1 2004/01/25 11:44:19 asmax Exp $
*
* Authors: Cyril Deguet <asmax@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
......@@ -22,37 +21,42 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#ifndef PARSER_CONTEXT_HPP
#define PARSER_CONTEXT_HPP
#ifndef SKIN_PARSER_HPP
#define SKIN_PARSER_HPP
#include <vlc/intf.h>
#include "xmlparser.hpp"
#include "builder_data.hpp"
#include <list>
/// Context for the FLEX parser
class ParserContext
/// Parser for the skin DTD
class SkinParser: public XMLParser
{
public:
ParserContext( intf_thread_t *pIntf ):
m_pIntf( pIntf ), m_xOffset( 0 ), m_yOffset( 0 ) {}
SkinParser( intf_thread_t *pIntf, const string &rFileName );
virtual ~SkinParser() {}
intf_thread_t *m_pIntf;
const BuilderData &getData() const { return m_data; }
private:
/// Container for mapping data from the XML
BuilderData m_data;
/// Current IDs
string m_curWindowId;
string m_curLayoutId;
string m_curListId;
/// Current offset of the controls
int m_xOffset, m_yOffset;
list<int> m_xOffsetList, m_yOffsetList;
/// Layer of the current control in the layout
int m_curLayer;
/// Callbacks
virtual void handleBeginElement( const string &rName, AttrList_t &attr );
virtual void handleEndElement( const string &rName );
/// Helper functions
bool ConvertBoolean( const char *value ) const;
int ConvertColor( const char *transcolor ) const;
};
#endif
/*****************************************************************************
* wrappers.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: wrappers.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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.
*****************************************************************************/
#include <math.h>
#include "wrappers.h"
#include "parser_context.hpp"
// Current DTD version
#define SKINS_DTD_VERSION "2.0"
// Local functions
static bool ConvertBoolean( const char *value );
static int ConvertColor( const char *transcolor );
// Useful macros
#define DATA ((ParserContext*)pContext)->m_data
#define WIN_ID ((ParserContext*)pContext)->m_curWindowId
#define LAY_ID ((ParserContext*)pContext)->m_curLayoutId
#define CUR_LIST ((ParserContext*)pContext)->m_curListId
#define X_OFFSET ((ParserContext*)pContext)->m_xOffset
#define Y_OFFSET ((ParserContext*)pContext)->m_yOffset
#define LAYER ((ParserContext*)pContext)->m_curLayer
void AddBitmap( void *pContext, char *name, char *file,
char *transcolor )
{
const BuilderData::Bitmap bitmap( name, file,
ConvertColor( transcolor ) );
DATA.m_listBitmap.push_back( bitmap );
}
void AddEvent( void *pContext, char *name, char *event, char *key )
{
// const BuilderData:: Command( name, event, key );
}
void AddFont( void *pContext, char *name, char *font, char *size,
char *color, char *italic, char *underline )
{
const BuilderData::Font fontData( name, font, atoi( size ) );
DATA.m_listFont.push_back( fontData );
}
void AddThemeInfo( void *pContext, char *name, char *author,
char *email, char *webpage )
{
msg_Warn( ((ParserContext*)pContext)->m_pIntf,
"skin: %s author: %s", name, author );
}
void StartWindow( void *pContext, char *name, char *x, char *y,
char *visible, char *dragdrop, char *playOnDrop )
{
const BuilderData::Window window( name, atoi( x ) + X_OFFSET,
atoi( y ) + Y_OFFSET, ConvertBoolean( visible ),
ConvertBoolean( dragdrop ), ConvertBoolean( playOnDrop ));
DATA.m_listWindow.push_back( window );
WIN_ID = name;
}
void EndWindow( void *pContext )
{
// ((Builder*)pContext)->endWindow();
}
void StartLayout( void *pContext, char *id, char *width, char *height,
char *minwidth, char *maxwidth, char *minheight,
char *maxheight )
{
const BuilderData::Layout layout( id, atoi( width ), atoi( height ),
atoi( minwidth ), atoi( maxwidth ),
atoi( minheight ), atoi( maxheight ),
WIN_ID );
DATA.m_listLayout.push_back( layout );
LAY_ID = id;
LAYER = 0;
}
void EndLayout( void *pContext )
{
// ((Builder*)pContext)->endLayout();
}
void StartTheme( void *pContext, char *version, char *magnet,
char *alpha, char *movealpha, char *fadetime )
{
// Check the version
if( strcmp( version, SKINS_DTD_VERSION ) )
{
msg_Err( ((ParserContext*)pContext)->m_pIntf, "Bad theme version :"
" %s (you need version %s)", version, SKINS_DTD_VERSION );
}
const BuilderData::Theme theme( atoi( magnet ),
atoi( alpha ), atoi( movealpha ), atoi( fadetime ) );
DATA.m_listTheme.push_back( theme );
}
void EndTheme( void *pContext )
{
// ((Builder*)pContext)->endTheme();
}
void StartGroup( void *pContext, char *x, char *y )
{
X_OFFSET += atoi( x );
Y_OFFSET += atoi( y );
((ParserContext*)pContext)->m_xOffsetList.push_back( atoi( x ) );
((ParserContext*)pContext)->m_yOffsetList.push_back( atoi( y ) );
}
void EndGroup( void *pContext )
{
X_OFFSET -= ((ParserContext*)pContext)->m_xOffsetList.back();
Y_OFFSET -= ((ParserContext*)pContext)->m_yOffsetList.back();
((ParserContext*)pContext)->m_xOffsetList.pop_back();
((ParserContext*)pContext)->m_yOffsetList.pop_back();
}
void AddAnchor( void *pContext, char *x, char *y, char *len,
char *priority )
{
const BuilderData::Anchor anchor( atoi( x ) + X_OFFSET,
atoi( y ) + Y_OFFSET, atoi( len ), atoi( priority ), WIN_ID );
DATA.m_listAnchor.push_back( anchor );
}
//---------------------------------------------------------------------------
// CONTROLS
//---------------------------------------------------------------------------
void AddImage( void *pContext, char *id, char *visible, char *x,
char *y, char *lefttop, char *rightbottom, char *image,
char *event, char *help )
{
const BuilderData::Image imageData( id, atoi( x ) + X_OFFSET,
atoi( y ) + Y_OFFSET, lefttop, rightbottom, ConvertBoolean( visible ),
image, event, help, LAYER, WIN_ID, LAY_ID );
LAYER++;
DATA.m_listImage.push_back( imageData );
}
void AddRectangle( void *pContext, char *id, char *visible, char *x,
char *y, char *w, char *h, char *color, char *event,
char *help )
{
// msg_Warn( ((Builder*)pContext)->getIntf(), "Do we _really_ need a Rectangle control?" );
}
void AddButton( void *pContext,
char *id,
char *x, char *y, char *lefttop, char *rightbottom,
char *up, char *down, char *over,
char *action, char *tooltiptext, char *help )
{
const BuilderData::Button button( id, atoi( x ) + X_OFFSET,
atoi( y ) + Y_OFFSET, lefttop, rightbottom, up, down, over, action,
tooltiptext, help, LAYER, WIN_ID, LAY_ID );
LAYER++;
DATA.m_listButton.push_back( button );
}
void AddCheckBox( void *pContext, char *id,
char *x, char *y, char *lefttop, char *rightbottom,
char *up1, char *down1, char *over1, char *up2,
char *down2, char *over2, char *state, char *action1,
char *action2, char *tooltiptext1, char *tooltiptext2,
char *help )
{
const BuilderData::Checkbox checkbox( id, atoi( x ) + X_OFFSET,
atoi( y ) + Y_OFFSET, lefttop, rightbottom, up1, down1, over1, up2,
down2, over2, state, action1, action2, tooltiptext1, tooltiptext2,
help, LAYER, WIN_ID, LAY_ID );
LAYER++;
DATA.m_listCheckbox.push_back( checkbox );
}
void AddSlider( void *pContext, char *id, char *visible, char *x, char *y,
char *lefttop, char *rightbottom,
char *up, char *down, char *over, char *points,
char *thickness, char *value, char *tooltiptext, char *help )
{
string newValue = value;
if( CUR_LIST != "" )
{
// Slider associated to a list
// XXX
newValue = "playlist.slider";
}
const BuilderData::Slider slider( id, visible, atoi( x ) + X_OFFSET,
atoi( y ) + Y_OFFSET, lefttop, rightbottom, up, down, over, points,
atoi( thickness ), newValue, tooltiptext, help, LAYER, WIN_ID, LAY_ID );
LAYER++;
DATA.m_listSlider.push_back( slider );
}
void AddRadialSlider( void *pContext, char *id, char *visible, char *x, char *y,
char *lefttop, char *rightbottom, char *sequence,
char *nbImages, char *minAngle, char *maxAngle,
char *value, char *tooltiptext, char *help )
{
const BuilderData::RadialSlider radial( id, visible, atoi( x ) + X_OFFSET,
atoi( y ) + Y_OFFSET, lefttop, rightbottom, sequence, atoi( nbImages ),
atof( minAngle ) * M_PI / 180, atof( maxAngle ) * M_PI / 180, value,
tooltiptext, help, LAYER, WIN_ID, LAY_ID );
LAYER++;
DATA.m_listRadialSlider.push_back( radial );
}
void AddPlaylist( void *pContext, char *id, char *visible, char *x,
char *y, char *width, char *height, char *lefttop,
char *rightbottom, char *font, char *var, char *fgcolor,
char *playcolor, char *bgcolor1, char *bgcolor2,
char *selcolor, char *help )
{
const BuilderData::List listData( id, atoi( x ) + X_OFFSET,
atoi( y ) + Y_OFFSET, atoi( width), atoi( height ), lefttop,
rightbottom, font, var, ConvertColor( fgcolor ),
ConvertColor( playcolor ), ConvertColor( bgcolor1 ),
ConvertColor( bgcolor2 ), ConvertColor( selcolor ), help, LAYER,
WIN_ID, LAY_ID );
LAYER++;
CUR_LIST = id;
DATA.m_listList.push_back( listData );
}
void AddPlaylistEnd( void *pContext )
{
CUR_LIST = "";
}
void AddText( void *pContext, char *id, char *visible, char *x,
char *y, char *text, char *font, char *align, char *width,
char *display, char *scroll, char *scrollspace, char *help )
{
const BuilderData::Text textData( id, atoi( x ) + X_OFFSET,
atoi( y ) + Y_OFFSET, font, text, atoi( width ), help, LAYER, WIN_ID,
LAY_ID );
LAYER++;
DATA.m_listText.push_back( textData );
}
//---------------------------------------------------------------------------
// Useful functions
//---------------------------------------------------------------------------
static bool ConvertBoolean( const char *value )
{
return strcmp( value, "true" ) == 0;
}
static int ConvertColor( const char *transcolor )
{
unsigned long iRed, iGreen, iBlue;
iRed = iGreen = iBlue = 0;
sscanf( transcolor, "#%2lX%2lX%2lX", &iRed, &iGreen, &iBlue );
return ( iRed << 16 | iGreen << 8 | iBlue );
}
#if defined(__cplusplus)
extern "C" {
#endif
//---------------------------------------------------------------------------
// Divers
//---------------------------------------------------------------------------
void AddAnchor( void *pContext, char *x, char *y, char *len,
char *priority );
void AddBitmap( void *pContext, char *name, char *file,
char *transcolor );
void AddEvent( void *pContext, char *name, char *event, char *key );
void AddFont( void *pContext, char *name, char *font, char *size,
char *color, char *italic, char *underline );
void StartGroup( void *pContext, char *x, char *y );
void EndGroup( void *pContext );
//---------------------------------------------------------------------------
// Theme
//---------------------------------------------------------------------------
void AddThemeInfo( void *pContext, char *name, char *author,
char *email, char *webpage );
void StartTheme( void *pContext, char *version, char *magnet,
char *alpha, char *movealpha, char *fadetime );
void EndTheme( void *pContext );
//---------------------------------------------------------------------------
// Window
//---------------------------------------------------------------------------
void StartWindow( void *pContext, char *name, char *x, char *y,
char *visible, char *dragdrop, char *playOnDrop );
void EndWindow( void *pContext );
//---------------------------------------------------------------------------
// Layout
//---------------------------------------------------------------------------
void StartLayout( void *pContext, char *id, char *width, char *height,
char *minwidth, char *maxwidth, char *minheight,
char *maxheight );
void EndLayout( void *pContext );
//---------------------------------------------------------------------------
// Control
//---------------------------------------------------------------------------
void AddImage( void *pContext, char *id, char *visible, char *x,
char *y, char *lefttop, char *rightbottom, char *image,
char *event, char *help );
void AddRectangle( void *pContext, char *id, char *visible, char *x,
char *y, char *w, char *h, char *color, char *event,
char *help );
void AddButton( void *pContext, char *id,
char *x, char *y, char *lefttop, char *rightbottom,
char *up, char *down, char *over,
char *action, char *tooltiptext, char *help );
void AddCheckBox( void *pContext, char *id,
char *x, char *y, char *lefttop, char *rightbottom,
char *up1, char *down1, char *over1, char *up2,
char *down2, char *over2, char *state, char *action1,
char *action2, char *tooltiptext1, char *tooltiptext2,
char *help );
void AddSlider( void *pContext, char *id, char *visible, char *x, char *y,
char *lefttop, char *rightbottom,
char *up, char *down, char *over, char *points,
char *thickness, char *value, char *tooltiptext, char *help );
void AddRadialSlider( void *pContext, char *id, char *visible, char *x, char *y,
char *lefttop, char *rightbottom, char *sequence,
char *nbImages, char *minAngle, char *maxAngle,
char *value, char *tooltiptext, char *help );
void AddText( void *pContext, char *id, char *visible, char *x, char *y,
char *text, char *font, char *align, char *width, char *display,
char *scroll, char *scrollspace, char *help );
void AddPlaylist( void *pContext, char *id, char *visible, char *x,
char *y, char *width, char *height, char *lefttop,
char *rightbottom, char *font, char *var, char *fgcolor,
char *playcolor, char *bgcolor1, char *bgcolor2, char *selcolor,
char *help );
void AddPlaylistEnd( void *pContext );
//---------------------------------------------------------------------------
#if defined(__cplusplus)
}
#endif
......@@ -2,10 +2,9 @@
* xmlparser.cpp
*****************************************************************************
* Copyright (C) 2004 VideoLAN
* $Id: xmlparser.cpp,v 1.2 2004/01/24 14:25:16 asmax Exp $
* $Id: xmlparser.cpp,v 1.3 2004/01/25 11:44:19 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <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
......@@ -34,7 +33,12 @@ XMLParser::XMLParser( intf_thread_t *pIntf, const string &rFileName ):
rFileName.c_str() );
}
// Activate DTD validation
xmlTextReaderSetParserProp( m_pReader, XML_PARSER_DEFAULTATTRS, 1 );
xmlTextReaderSetParserProp( m_pReader, XML_PARSER_VALIDATE, 1 );
// Set the error handler
xmlTextReaderSetErrorHandler( m_pReader, handleError, this );
}
......@@ -47,13 +51,15 @@ XMLParser::~XMLParser()
}
int XMLParser::parse()
bool XMLParser::parse()
{
if( !m_pReader )
{
return -1;
}
m_errors = false;
int ret = xmlTextReaderRead( m_pReader );
while (ret == 1)
{
......@@ -104,23 +110,17 @@ int XMLParser::parse()
}
ret = xmlTextReaderRead( m_pReader );
}
return 0;
return (ret == 0 && !m_errors );
}
void XMLParser::handleBeginElement( const string &rName,
AttrList_t &attributes )
void XMLParser::handleError( void *pArg, const char *pMsg,
xmlParserSeverities severity,
xmlTextReaderLocatorPtr locator)
{
fprintf(stderr,"%s\n", rName.c_str());
AttrList_t::const_iterator it;
for (it = attributes.begin(); it != attributes.end(); it++)
{
fprintf(stderr," %s = %s\n", (*it).first, (*it).second);
}
XMLParser *pThis = (XMLParser*)pArg;
int line = xmlTextReaderLocatorLineNumber( locator );
msg_Err( pThis->getIntf(), "XML parser error (line %d) : %s", line, pMsg );
pThis->m_errors = true;
}
void XMLParser::handleEndElement( const string &rName )
{
fprintf(stderr,"--> %s\n", rName.c_str());
}
......@@ -2,10 +2,9 @@
* xmlparser.hpp
*****************************************************************************
* Copyright (C) 2004 VideoLAN
* $Id: xmlparser.hpp,v 1.2 2004/01/24 14:25:16 asmax Exp $
* $Id: xmlparser.hpp,v 1.3 2004/01/25 11:44:19 asmax Exp $
*
* Authors: Cyril Deguet <asmax@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
......@@ -38,9 +37,10 @@ class XMLParser: public SkinObject
XMLParser( intf_thread_t *pIntf, const string &rFileName );
virtual ~XMLParser();
int parse();
/// Parse the file. Returns true on success
bool parse();
private:
protected:
// Key comparison function for type "const char*"
struct ltstr
{
......@@ -52,11 +52,20 @@ class XMLParser: public SkinObject
/// Type for attribute lists
typedef map<const char*, const char*, ltstr> AttrList_t;
/// Callbacks
virtual void handleBeginElement( const string &rName, AttrList_t &attr ) {}
virtual void handleEndElement( const string &rName ) {}
private:
/// Reader context
xmlTextReaderPtr m_pReader;
/// Flag for validation errors
bool m_errors;
void handleBeginElement( const string &rName, AttrList_t &attributes );
void handleEndElement( const string &rName );
/// Callback for validation errors
static void handleError( void *pArg, const char *pMsg,
xmlParserSeverities severity,
xmlTextReaderLocatorPtr locator);
};
#endif
......@@ -2,7 +2,7 @@
* theme_loader.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: theme_loader.cpp,v 1.6 2004/01/24 14:25:16 asmax Exp $
* $Id: theme_loader.cpp,v 1.7 2004/01/25 11:44:19 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -25,8 +25,7 @@
#include "theme_loader.hpp"
#include "theme.hpp"
#include "../parser/builder.hpp"
#include "../parser/parser_context.hpp"
#include "../parser/xmlparser.hpp"
#include "../parser/skin_parser.hpp"
#include "../src/os_factory.hpp"
#include "../src/window_manager.hpp"
......@@ -54,12 +53,6 @@ int tar_close ( TAR *t );
#define DEFAULT_XML_FILE "theme.xml"
extern "C"
{
extern FILE *yyin;
int yylex( void *pContext );
void yyrestart( FILE *input_file );
}
bool ThemeLoader::load( const string &fileName )
{
......@@ -166,20 +159,6 @@ void ThemeLoader::deleteTempFiles( const string &path )
bool ThemeLoader::parse( const string &xmlFile )
{
XMLParser parser( getIntf(), xmlFile );
parser.parse();
// Set the file to parse
FILE *file = fopen( xmlFile.c_str(), "r" );
if( file == NULL )
{
// Skin cannot be opened
msg_Err( getIntf(), "Cannot open the specified skin file: %s",
xmlFile.c_str() );
return false;
}
yyrestart( file );
// File loaded
msg_Dbg( getIntf(), "Using skin file: %s", xmlFile.c_str() );
......@@ -197,22 +176,19 @@ bool ThemeLoader::parse( const string &xmlFile )
}
// Start the parser
ParserContext context( getIntf() );
int lex = yylex( &context );
fclose( file );
if( lex )
SkinParser parser( getIntf(), xmlFile );
bool ret = parser.parse();
if( !ret )
{
msg_Err( getIntf(), "Failed to parse %s", xmlFile.c_str() );
// Set old working directory to current
chdir( cwd );
delete[] cwd;
msg_Warn( getIntf(), "yylex failed: %i", lex );
return false;
}
// Build and store the theme
Builder builder( getIntf(), context.m_data );
Builder builder( getIntf(), parser.getData() );
getIntf()->p_sys->p_theme = builder.build();
// Set old working directory to current.
......
......@@ -2,7 +2,7 @@
* tooltip.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: tooltip.cpp,v 1.2 2004/01/11 17:12:17 asmax Exp $
* $Id: tooltip.cpp,v 1.3 2004/01/25 11:44:19 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -48,7 +48,7 @@ Tooltip::Tooltip( intf_thread_t *pIntf, const GenericFont &rFont, int delay ):
Tooltip::~Tooltip()
{
// VarManager::instance( getIntf() )->getTooltipText().delObserver( this );
VarManager::instance( getIntf() )->getTooltipText().delObserver( this );
SKINS_DELETE( m_pTimer );
SKINS_DELETE( m_pOsTooltip );
if( m_pImage )
......
......@@ -2,7 +2,7 @@
* window_manager.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: window_manager.cpp,v 1.3 2004/01/18 00:50:24 asmax Exp $
* $Id: window_manager.cpp,v 1.4 2004/01/25 11:44:19 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -142,9 +142,13 @@ void WindowManager::raise( GenericWindow *pWindow )
// Raise all the windows
WinSet_t::const_iterator it;
for( it = m_allWindows.begin(); it != m_allWindows.end(); it++ )
{
if( *it != pWindow )
{
(*it)->raise();
}
}
pWindow->raise();
}
......
......@@ -44,8 +44,8 @@
<!ATTLIST Window
id CDATA #REQUIRED
visible CDATA "true"
x CDATA "\0"
y CDATA "\0"
x CDATA "0"
y CDATA "0"
dragdrop CDATA "true"
playondrop CDATA "true"
>
......@@ -63,15 +63,15 @@
<!ELEMENT Group (Group|Image|Button|Playlist|Slider|RadialSlider|Text|CheckBox|
Rectangle|Anchor)+>
<!ATTLIST Group
x CDATA "\0"
y CDATA "\0"
x CDATA "0"
y CDATA "0"
>
<!-- Anchors -->
<!ELEMENT Anchor EMPTY>
<!ATTLIST Anchor
x CDATA "\0"
y CDATA "\0"
x CDATA "0"
y CDATA "0"
priority CDATA #REQUIRED
range CDATA "10"
>
......@@ -81,8 +81,8 @@
<!ATTLIST Image
id CDATA "none"
visible CDATA "true"
x CDATA "\0"
y CDATA "\0"
x CDATA "0"
y CDATA "0"
lefttop CDATA "lefttop"
rightbottom CDATA "lefttop"
image CDATA #REQUIRED
......@@ -93,8 +93,8 @@
<!ATTLIST Rectangle
id CDATA "none"
visible CDATA "true"
x CDATA "\0"
y CDATA "\0"
x CDATA "0"
y CDATA "0"
w CDATA "50"
h CDATA "50"
color CDATA "#C0C0C0"
......@@ -104,8 +104,8 @@
<!ELEMENT Button EMPTY>
<!ATTLIST Button
id CDATA "none"
x CDATA "\0"
y CDATA "\0"
x CDATA "0"
y CDATA "0"
lefttop CDATA "lefttop"
rightbottom CDATA "lefttop"
up CDATA #REQUIRED
......@@ -118,8 +118,8 @@
<!ELEMENT CheckBox EMPTY>
<!ATTLIST CheckBox
id CDATA "none"
x CDATA "\0"
y CDATA "\0"
x CDATA "0"
y CDATA "0"
lefttop CDATA "lefttop"
rightbottom CDATA "lefttop"
up1 CDATA #REQUIRED
......@@ -139,8 +139,8 @@
<!ATTLIST Slider
id CDATA "none"
visible CDATA "true"
x CDATA "\0"
y CDATA "\0"
x CDATA "0"
y CDATA "0"
lefttop CDATA "lefttop"
rightbottom CDATA "lefttop"
up CDATA #REQUIRED
......@@ -156,13 +156,13 @@
<!ATTLIST RadialSlider
id CDATA "none"
visible CDATA "true"
x CDATA "\0"
y CDATA "\0"
x CDATA "0"
y CDATA "0"
lefttop CDATA "lefttop"
rightbottom CDATA "lefttop"
sequence CDATA #REQUIRED
nbimages CDATA #REQUIRED
minangle CDATA "\0"
minangle CDATA "0"
maxangle CDATA "360"
value CDATA "none"
tooltiptext CDATA "\0"
......@@ -172,12 +172,12 @@
<!ATTLIST Text
id CDATA "none"
visible CDATA "true"
x CDATA "\0"
y CDATA "\0"
text CDATA ""
x CDATA "0"
y CDATA "0"
text CDATA "\0"
font CDATA #REQUIRED
align CDATA "left"
width CDATA "\0"
width CDATA "0"
display CDATA "none"
scroll CDATA "true"
scrollspace CDATA "20"
......@@ -187,10 +187,10 @@
<!ATTLIST Playlist
id CDATA #REQUIRED
visible CDATA "true"
x CDATA "\0"
y CDATA "\0"
width CDATA "\0"
height CDATA "\0"
x CDATA "0"
y CDATA "0"
width CDATA "0"
height CDATA "0"
lefttop CDATA "lefttop"
rightbottom CDATA "lefttop"
font CDATA #REQUIRED
......
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