Permalink
Browse files

* share/skins2/skin.catalog: added a default catalog as some platform…

…s 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.
  • Loading branch information...
1 parent 7b07426 commit 2a73b7289d44cad95e0ad4760240bb645dd58e78 Gildas Bazin committed Apr 30, 2004
Showing with 28 additions and 3 deletions.
  1. +3 −0 Makefile.am
  2. +20 −3 modules/gui/skins2/parser/skin_parser.cpp
  3. +1 −0 share/Makefile.am
  4. +4 −0 share/skins2/skin.catalog
View
@@ -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,22 +42,39 @@ 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";
if( !stat( path.c_str(), &statBuf ) )
{
// 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"
View
@@ -209,6 +209,7 @@ DIST_skins2 = \
\
skins2/fonts/FreeSans.ttf \
skins2/skin.dtd \
+ skins2/skin.catalog \
$(NULL)
DIST_http = \
@@ -0,0 +1,4 @@
+<?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>

0 comments on commit 2a73b72

Please sign in to comment.