]> git.sesse.net Git - vlc/commitdiff
* share/skins2/skin.catalog: added a default catalog as some platforms don't provide...
authorGildas Bazin <gbazin@videolan.org>
Fri, 30 Apr 2004 15:30:43 +0000 (15:30 +0000)
committerGildas Bazin <gbazin@videolan.org>
Fri, 30 Apr 2004 15:30:43 +0000 (15:30 +0000)
* modules/gui/skins2/parser/skin_parser.cpp: try to load the skins catalog and if it fails, use the system's one.

Makefile.am
modules/gui/skins2/parser/skin_parser.cpp
share/Makefile.am
share/skins2/skin.catalog [new file with mode: 0644]

index e4c40933fcaae45b1e951245070ec791bf73cd56..48d6661a8ad7eed2ac54666b4438ab0a262c6fde 100644 (file)
@@ -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/ ;
index ed644c3df4d427224c20e436aa4cbb49f3bbadea..d06e260f3be6300450a2806e84ee1d97b250649b 100644 (file)
@@ -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"
index 7fecca51b188573eeb83a1bcd7ecf346998a629a..ceca858ec7c1a94426ee1e0af44e86dee66050a6 100644 (file)
@@ -209,6 +209,7 @@ DIST_skins2 = \
        \
        skins2/fonts/FreeSans.ttf \
        skins2/skin.dtd \
+       skins2/skin.catalog \
        $(NULL)
 
 DIST_http = \
diff --git a/share/skins2/skin.catalog b/share/skins2/skin.catalog
new file mode 100644 (file)
index 0000000..514174a
--- /dev/null
@@ -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>
\ No newline at end of file