Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
11a5c30c
Commit
11a5c30c
authored
Jan 24, 2004
by
Cyril Deguet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* parser/xmlparser.cpp: added DTD validation
parent
c381c1c1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
232 additions
and
6 deletions
+232
-6
modules/gui/skins2/parser/xmlparser.cpp
modules/gui/skins2/parser/xmlparser.cpp
+22
-1
modules/gui/skins2/parser/xmlparser.hpp
modules/gui/skins2/parser/xmlparser.hpp
+2
-1
modules/gui/skins2/src/theme_loader.cpp
modules/gui/skins2/src/theme_loader.cpp
+4
-4
modules/gui/skins2/theme/skin.dtd
modules/gui/skins2/theme/skin.dtd
+204
-0
No files found.
modules/gui/skins2/parser/xmlparser.cpp
View file @
11a5c30c
...
...
@@ -2,7 +2,7 @@
* xmlparser.cpp
*****************************************************************************
* Copyright (C) 2004 VideoLAN
* $Id: xmlparser.cpp,v 1.
1 2004/01/24 13:08:12
asmax Exp $
* $Id: xmlparser.cpp,v 1.
2 2004/01/24 14:25:16
asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
...
...
@@ -33,6 +33,8 @@ XMLParser::XMLParser( intf_thread_t *pIntf, const string &rFileName ):
msg_Err
(
getIntf
(),
"Failed to open %s for parsing"
,
rFileName
.
c_str
()
);
}
xmlTextReaderSetParserProp
(
m_pReader
,
XML_PARSER_VALIDATE
,
1
);
}
...
...
@@ -66,6 +68,7 @@ int XMLParser::parse()
// Begin element
case
1
:
{
// Read the element name
const
xmlChar
*
eltName
=
xmlTextReaderConstName
(
m_pReader
);
if
(
!
eltName
)
...
...
@@ -86,6 +89,18 @@ int XMLParser::parse()
}
handleBeginElement
(
(
const
char
*
)
eltName
,
attributes
);
break
;
}
// End element
case
15
:
// Read the element name
const
xmlChar
*
eltName
=
xmlTextReaderConstName
(
m_pReader
);
if
(
!
eltName
)
{
return
-
1
;
}
handleEndElement
(
(
const
char
*
)
eltName
);
break
;
}
ret
=
xmlTextReaderRead
(
m_pReader
);
}
...
...
@@ -103,3 +118,9 @@ void XMLParser::handleBeginElement( const string &rName,
fprintf
(
stderr
,
" %s = %s
\n
"
,
(
*
it
).
first
,
(
*
it
).
second
);
}
}
void
XMLParser
::
handleEndElement
(
const
string
&
rName
)
{
fprintf
(
stderr
,
"--> %s
\n
"
,
rName
.
c_str
());
}
modules/gui/skins2/parser/xmlparser.hpp
View file @
11a5c30c
...
...
@@ -2,7 +2,7 @@
* xmlparser.hpp
*****************************************************************************
* Copyright (C) 2004 VideoLAN
* $Id: xmlparser.hpp,v 1.
1 2004/01/24 13:08:12
asmax Exp $
* $Id: xmlparser.hpp,v 1.
2 2004/01/24 14:25:16
asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
...
...
@@ -56,6 +56,7 @@ class XMLParser: public SkinObject
xmlTextReaderPtr
m_pReader
;
void
handleBeginElement
(
const
string
&
rName
,
AttrList_t
&
attributes
);
void
handleEndElement
(
const
string
&
rName
);
};
#endif
modules/gui/skins2/src/theme_loader.cpp
View file @
11a5c30c
...
...
@@ -2,7 +2,7 @@
* theme_loader.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: theme_loader.cpp,v 1.
5 2004/01/24 13:08:12
asmax Exp $
* $Id: theme_loader.cpp,v 1.
6 2004/01/24 14:25:16
asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
...
...
@@ -166,6 +166,9 @@ 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
)
...
...
@@ -208,9 +211,6 @@ bool ThemeLoader::parse( const string &xmlFile )
return
false
;
}
XMLParser
parser
(
getIntf
(),
xmlFile
);
parser
.
parse
();
// Build and store the theme
Builder
builder
(
getIntf
(),
context
.
m_data
);
getIntf
()
->
p_sys
->
p_theme
=
builder
.
build
();
...
...
modules/gui/skins2/theme/skin.dtd
0 → 100644
View file @
11a5c30c
<!--
-->
<!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"
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment