Commit 2a73b728 authored by Gildas Bazin's avatar Gildas Bazin

* share/skins2/skin.catalog: added a default catalog as some platforms don't...

* share/skins2/skin.catalog: added a default catalog as some platforms don't provide one (eg. win32).
* modules/gui/skins2/parser/skin_parser.cpp: try to load the skins catalog and if it fails, use the system's one.
parent 7b07426b
......@@ -621,6 +621,9 @@ package-win32-base:
for i in $(srcdir)/share/skins2/default/*.*; do \
cp $$i $(srcdir)/vlc-${VERSION}/skins2/default/ || true ; \
done
for i in $(srcdir)/share/skins2/*.*; do \
cp $$i $(srcdir)/vlc-${VERSION}/skins2/ || true ; \
done
mkdir -p "$(srcdir)/vlc-${VERSION}/http/admin"
cp $(srcdir)/share/http/*.html $(srcdir)/vlc-${VERSION}/http/ ;
......
......@@ -42,15 +42,31 @@ SkinParser::SkinParser( intf_thread_t *pIntf, const string &rFileName,
// Avoid duplicate initialization (mutex needed ?)
if( !m_initialized )
{
// Initialize XML catalog support
xmlInitializeCatalog();
// Get the resource path and look for the DTD
OSFactory *pOSFactory = OSFactory::instance( getIntf() );
const list<string> &resPath = pOSFactory->getResourcePath();
const string &sep = pOSFactory->getDirSeparator();
list<string>::const_iterator it;
struct stat statBuf;
// Try to load the catalog first (needed at least on win32 where
// we don't have a default catalog)
for( it = resPath.begin(); it != resPath.end(); it++ )
{
string catalog_path = (*it) + sep + "skin.catalog";
if( !stat( catalog_path.c_str(), &statBuf ) )
{
msg_Dbg( getIntf(), "Using catalog %s", catalog_path.c_str() );
xmlLoadCatalog( catalog_path.c_str() );
break;
}
}
if( it == resPath.end() )
{
// Ok, try the default one
xmlInitializeCatalog();
}
for( it = resPath.begin(); it != resPath.end(); it++ )
{
string path = (*it) + sep + "skin.dtd";
......@@ -58,6 +74,7 @@ SkinParser::SkinParser( intf_thread_t *pIntf, const string &rFileName,
{
// DTD found
msg_Dbg( getIntf(), "Using DTD %s", path.c_str() );
// Add an entry in the default catalog
xmlCatalogAdd( (xmlChar*)"public",
(xmlChar*)("-//VideoLAN//DTD VLC Skins V"
......
......@@ -209,6 +209,7 @@ DIST_skins2 = \
\
skins2/fonts/FreeSans.ttf \
skins2/skin.dtd \
skins2/skin.catalog \
$(NULL)
DIST_http = \
......
<?xml version="1.0"?>
<!DOCTYPE Theme PUBLIC "-//VideoLAN//DTD VLC Skins V2.0//EN" "skin.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
</catalog>
\ No newline at end of file
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