From 26df57608545752935795ce9e6b5b5eb722b5be0 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Mon, 4 Nov 2019 22:16:29 +0000
Subject: ocgx2 (4nov19)

git-svn-id: svn://tug.org/texlive/trunk@52639 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty | 38 +++++++++++++++++++--------
 1 file changed, 27 insertions(+), 11 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty')

diff --git a/Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty b/Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty
index fd1abcfc3a4..8b43adea539 100644
--- a/Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty
+++ b/Master/texmf-dist/tex/latex/ocgx2/ocgbase.sty
@@ -92,23 +92,39 @@
 %
 % The Current Maintainer of this work is A. Grahn.
 
-%process non-detectable dvipdfmx driver for passing to expl3
-\RequirePackage{xkeyval}
-\DeclareOptionX{dvipdfmx}{%
-  \PassOptionsToPackage{driver=dvipdfmx}{expl3}
-  \PassOptionsToPackage{dvipdfmx}{pdfbase}
-}
-\DeclareOptionX*{}\ProcessOptionsX*\relax %allow anything as an option
-
-\RequirePackage{pdfbase}
 \RequirePackage{expl3}
+\RequirePackage{l3keys2e}
 
-\def\g@ocgbase@date@tl{2019/07/04}
-\def\g@ocgbase@version@tl{0.16}
+\def\g@ocgbase@date@tl{2019/11/04}
+\def\g@ocgbase@version@tl{0.17}
 
 \ProvidesExplPackage{ocgbase}{\g@ocgbase@date@tl}{\g@ocgbase@version@tl}
 {support package for ocgx2.sty}
 
+%package options
+
+%unknown package option error message
+\msg_set:nnnn{ocgbase}{unknown~package~option}{Unknown~package~option~`#1'.}{
+  Package option~'#1'~is~unknown;\\
+  perhaps~it~is~spelled~incorrectly.
+}
+
+\keys_define:nn{ocgbase}{
+  xetex .code:n = {}, %dummy
+
+  dvipdfmx .choice:,
+  dvipdfmx / true .code:n = {\PassOptionsToPackage{dvipdfmx}{pdfbase}},
+  dvipdfmx / false .code:n = {},
+  dvipdfmx .default:n = {true},
+
+  unknown .code:n = {
+    \msg_error:nnx{ocgbase}{unknown~package~option}{\l_keys_key_tl}
+  }
+}
+\ProcessKeysOptions{ocgbase}
+
+\RequirePackage{pdfbase}
+
 \msg_set:nnnn{ocgbase}{support~outdated}{
   Support~package~`#1'~too~old.
 }{
-- 
cgit v1.2.3

