[latex3-commits] [l3svn] branch master updated: More driver rearrangement

noreply at latex-project.org noreply at latex-project.org
Wed Jun 14 22:25:37 CEST 2017


This is an automated email from the git hooks/post-receive script.

joseph pushed a commit to branch master
in repository l3svn.

The following commit(s) were added to refs/heads/master by this push:
       new  1ce7a8d   More driver rearrangement
1ce7a8d is described below

commit 1ce7a8d9314842447b23d06f9182aaadd0dede8b
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed Jun 14 21:24:35 2017 +0100

    More driver rearrangement
    
    As we now have only two colour models, it makes sense to collect them
    up.
    
    Next job is to work out a way of storing colour data: based on
    talking to David, it's likely we want something that doesn't store
    the driver-dependent form at all.
---
 l3kernel/l3drivers.dtx                  |  208 ++++++++++++++++---------------
 l3kernel/testfiles/m3expl001.luatex.tlg |   10 +-
 l3kernel/testfiles/m3expl001.tlg        |   10 +-
 l3kernel/testfiles/m3expl003.luatex.tlg |   10 +-
 l3kernel/testfiles/m3expl003.tlg        |   10 +-
 5 files changed, 128 insertions(+), 120 deletions(-)

diff --git a/l3kernel/l3drivers.dtx b/l3kernel/l3drivers.dtx
index b48b911..f1a2357 100644
--- a/l3kernel/l3drivers.dtx
+++ b/l3kernel/l3drivers.dtx
@@ -492,13 +492,119 @@
 % mix all of the code by concept is almost unmanageable.) The key parts which
 % are shared are
 % \begin{itemize}
-%   \item Color support is either \texttt{dvips}-like or \texttt{pdfmode}:
-%     other drivers inherit from one of those two.
+%   \item Color support is either \texttt{dvips}-like or \texttt{pdfmode}-like.
 %   \item \texttt{pdfmode} and \texttt{(x)dvipdfmx} share drawing routines.
 %   \item \texttt{xdvipdfmx} is largely the same as \texttt{dvipdfmx} so
 %     takes most of the same code.
 % \end{itemize}
 %
+% \subsection{Color support}
+%
+% Whilst \texttt{(x)dvipdfmx} does have its own approach to color specials,
+% it is easier to use \texttt{dvips}-like ones for all cases except direct
+% PDF output. As such the color code is collected here in two blocks.
+%
+% \subsubsection{\texttt{dvips}-style}
+%
+%    \begin{macrocode}
+%<*dvisvgm|dvipdfmx|dvips|xdvipdfmx>
+%    \end{macrocode}
+%
+% \begin{variable}{\l_@@_color_current_tl}
+%   The current color in driver-dependent format.
+%    \begin{macrocode}
+\tl_new:N \l_@@_color_current_tl
+\tl_set:Nn \l_@@_color_current_tl { gray~0 }
+%<*package>
+\AtBeginDocument
+  {
+    \@ifpackageloaded { color }
+      { \tl_set:Nn \l_@@_color_current_tl { \current at color } }
+      { }
+  }
+%</package>
+%    \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[int]{\@@_color_ensure_current:}
+% \begin{macro}[aux]{\@@_color_reset:}
+%   Directly set the color using the specials: no optimisation here.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_color_ensure_current:
+  {
+    \tex_special:D { color~push~\l_@@_color_current_tl }
+    \group_insert_after:N \@@_color_reset:
+  }
+\cs_new_protected:Npn \@@_color_reset:
+  { \tex_special:D { color~pop } }
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%    \begin{macrocode}
+%</dvisvgm|dvipdfmx|dvips|xdvipdfmx>
+%    \end{macrocode}
+%
+% \subsubsection{\texttt{pdfmode}}
+%
+%    \begin{macrocode}
+%<*pdfmode>
+%    \end{macrocode}
+%
+% \begin{variable}{\l_@@_color_current_tl}
+%   The current color in driver-dependent format: pick up the package-mode
+%   data if available.
+%    \begin{macrocode}
+\tl_new:N \l_@@_color_current_tl
+\tl_set:Nn \l_@@_color_current_tl { 0~g~0~G }
+%<*package>
+\AtBeginDocument
+  {
+    \@ifpackageloaded { color }
+      { \tl_set:Nn \l_@@_color_current_tl { \current at color } }
+      { }
+  }
+%</package>
+%    \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_color_stack_int}
+%   \pdfTeX{} and \LuaTeX{} have multiple stacks available, and to track
+%   which one is in use a variable is required.
+%    \begin{macrocode}
+\int_new:N \l_@@_color_stack_int
+%    \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[int]{\@@_color_ensure_current:}
+% \begin{macro}[aux]{\@@_color_reset:}
+%   There is a dedicated primitive/primitive interface for setting colors.
+%   As with scoping, this approach is not suitable for cached operations.
+%    \begin{macrocode}
+\cs_new_protected:Npx \@@_color_ensure_current:
+  {
+    \cs_if_exist:NTF \luatex_pdfextension:D
+      { \luatex_pdfextension:D colorstack }
+      { \pdftex_pdfcolorstack:D }
+        \exp_not:N \l_@@_color_stack_int push
+          { \exp_not:N \l_@@_color_current_tl }
+    \group_insert_after:N \exp_not:N \@@_color_reset:
+  }
+\cs_new_protected:Npx \@@_color_reset:
+  {
+    \cs_if_exist:NTF \luatex_pdfextension:D
+      { \luatex_pdfextension:D colorstack }
+      { \pdftex_pdfcolorstack:D }
+        \exp_not:N \l_@@_color_stack_int pop \scan_stop:
+  }
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%    \begin{macrocode}
+%</pdfmode>
+%    \end{macrocode}
+%
 % \subsection{\texttt{dvips} driver}
 %
 %    \begin{macrocode}
@@ -627,52 +733,6 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \subsubsection{Color}
-%
-% The color support code for \texttt{dvips} is also used by other drivers
-% except \texttt{pdfmode}: rather than repeat everything it's therefore defined
-% here.
-%    \begin{macrocode}
-%</dvips>
-%<*!pdfmode>
-%    \end{macrocode}
-%
-% \begin{variable}{\l_@@_color_current_tl}
-%   The current color in driver-dependent format.
-%    \begin{macrocode}
-\tl_new:N \l_@@_color_current_tl
-\tl_set:Nn \l_@@_color_current_tl { gray~0 }
-%<*package>
-\AtBeginDocument
-  {
-    \@ifpackageloaded { color }
-      { \tl_set:Nn \l_@@_color_current_tl { \current at color } }
-      { }
-  }
-%</package>
-%    \end{macrocode}
-% \end{variable}
-%
-% \begin{macro}[int]{\@@_color_ensure_current:}
-% \begin{macro}[aux]{\@@_color_reset:}
-%   Directly set the color using the specials: no optimisation here.
-%    \begin{macrocode}
-\cs_new_protected:Npn \@@_color_ensure_current:
-  {
-    \tex_special:D { color~push~\l_@@_color_current_tl }
-    \group_insert_after:N \@@_color_reset:
-  }
-\cs_new_protected:Npn \@@_color_reset:
-  { \tex_special:D { color~pop } }
-%    \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-%    \begin{macrocode}
-%</!pdfmode>
-%<*dvips>
-%    \end{macrocode}
-%
 % \subsection{Images}
 %
 % \begin{macro}[int]{\@@_image_getbb_eps:n}
@@ -1273,58 +1333,6 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \subsubsection{Color}
-%
-% \begin{variable}{\l_@@_color_current_tl}
-%   The current color in driver-dependent format: pick up the package-mode
-%   data if available.
-%    \begin{macrocode}
-\tl_new:N \l_@@_color_current_tl
-\tl_set:Nn \l_@@_color_current_tl { 0~g~0~G }
-%<*package>
-\AtBeginDocument
-  {
-    \@ifpackageloaded { color }
-      { \tl_set:Nn \l_@@_color_current_tl { \current at color } }
-      { }
-  }
-%</package>
-%    \end{macrocode}
-% \end{variable}
-%
-% \begin{variable}{\l_@@_color_stack_int}
-%   \pdfTeX{} and \LuaTeX{} have multiple stacks available, and to track
-%   which one is in use a variable is required.
-%    \begin{macrocode}
-\int_new:N \l_@@_color_stack_int
-%    \end{macrocode}
-% \end{variable}
-%
-% \begin{macro}[int]{\@@_color_ensure_current:}
-% \begin{macro}[aux]{\@@_color_reset:}
-%   There is a dedicated primitive/primitive interface for setting colors.
-%   As with scoping, this approach is not suitable for cached operations.
-%    \begin{macrocode}
-\cs_new_protected:Npx \@@_color_ensure_current:
-  {
-    \cs_if_exist:NTF \luatex_pdfextension:D
-      { \luatex_pdfextension:D colorstack }
-      { \pdftex_pdfcolorstack:D }
-        \exp_not:N \l_@@_color_stack_int push
-          { \exp_not:N \l_@@_color_current_tl }
-    \group_insert_after:N \exp_not:N \@@_color_reset:
-  }
-\cs_new_protected:Npx \@@_color_reset:
-  {
-    \cs_if_exist:NTF \luatex_pdfextension:D
-      { \luatex_pdfextension:D colorstack }
-      { \pdftex_pdfcolorstack:D }
-        \exp_not:N \l_@@_color_stack_int pop \scan_stop:
-  }
-%    \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
 % \subsection{Images}
 %
 % \begin{variable}{\l_@@_image_attr_tl}
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 028ff79..e9556a7 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -5651,6 +5651,11 @@ Defining key expl/log-functions/true on line ...
 Defining key expl/log-functions/false on line ...
 Defining \c__expl_def_ext_tl on line ...
  (l3pdfmode.def
+Defining \l__driver_color_current_tl on line ...
+Defining \l__driver_color_stack_int on line ...
+\l__driver_color_stack_int=\count192
+Defining \__driver_color_ensure_current: on line ...
+Defining \__driver_color_reset: on line ...
 Defining \__driver_literal:n on line ...
 Defining \__driver_scope_begin: on line ...
 Defining \__driver_scope_end: on line ...
@@ -5660,11 +5665,6 @@ Defining \__driver_box_use_rotate:Nn on line ...
 Defining \l__driver_cos_fp on line ...
 Defining \l__driver_sin_fp on line ...
 Defining \__driver_box_use_scale:Nnn on line ...
-Defining \l__driver_color_current_tl on line ...
-Defining \l__driver_color_stack_int on line ...
-\l__driver_color_stack_int=\count192
-Defining \__driver_color_ensure_current: on line ...
-Defining \__driver_color_reset: on line ...
 Defining \l__driver_image_attr_tl on line ...
 Defining \__driver_image_getbb_jpg:n on line ...
 Defining \__driver_image_getbb_png:n on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 6fd1eee..7501329 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -5843,6 +5843,11 @@ Defining key expl/log-functions/true on line ...
 Defining key expl/log-functions/false on line ...
 Defining \c__expl_def_ext_tl on line ...
  (l3pdfmode.def
+Defining \l__driver_color_current_tl on line ...
+Defining \l__driver_color_stack_int on line ...
+\l__driver_color_stack_int=\count194
+Defining \__driver_color_ensure_current: on line ...
+Defining \__driver_color_reset: on line ...
 Defining \__driver_literal:n on line ...
 Defining \__driver_scope_begin: on line ...
 Defining \__driver_scope_end: on line ...
@@ -5852,11 +5857,6 @@ Defining \__driver_box_use_rotate:Nn on line ...
 Defining \l__driver_cos_fp on line ...
 Defining \l__driver_sin_fp on line ...
 Defining \__driver_box_use_scale:Nnn on line ...
-Defining \l__driver_color_current_tl on line ...
-Defining \l__driver_color_stack_int on line ...
-\l__driver_color_stack_int=\count194
-Defining \__driver_color_ensure_current: on line ...
-Defining \__driver_color_reset: on line ...
 Defining \l__driver_image_attr_tl on line ...
 Defining \__driver_image_getbb_jpg:n on line ...
 Defining \__driver_image_getbb_png:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index 88a09bf..0176dba 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -5652,6 +5652,11 @@ Defining key expl/log-functions/true on line ...
 Defining key expl/log-functions/false on line ...
 Defining \c__expl_def_ext_tl on line ...
  (l3pdfmode.def
+Defining \l__driver_color_current_tl on line ...
+Defining \l__driver_color_stack_int on line ...
+\l__driver_color_stack_int=\count192
+Defining \__driver_color_ensure_current: on line ...
+Defining \__driver_color_reset: on line ...
 Defining \__driver_literal:n on line ...
 Defining \__driver_scope_begin: on line ...
 Defining \__driver_scope_end: on line ...
@@ -5661,11 +5666,6 @@ Defining \__driver_box_use_rotate:Nn on line ...
 Defining \l__driver_cos_fp on line ...
 Defining \l__driver_sin_fp on line ...
 Defining \__driver_box_use_scale:Nnn on line ...
-Defining \l__driver_color_current_tl on line ...
-Defining \l__driver_color_stack_int on line ...
-\l__driver_color_stack_int=\count192
-Defining \__driver_color_ensure_current: on line ...
-Defining \__driver_color_reset: on line ...
 Defining \l__driver_image_attr_tl on line ...
 Defining \__driver_image_getbb_jpg:n on line ...
 Defining \__driver_image_getbb_png:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index f201b2e..e861aab 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -5844,6 +5844,11 @@ Defining key expl/log-functions/true on line ...
 Defining key expl/log-functions/false on line ...
 Defining \c__expl_def_ext_tl on line ...
  (l3pdfmode.def
+Defining \l__driver_color_current_tl on line ...
+Defining \l__driver_color_stack_int on line ...
+\l__driver_color_stack_int=\count194
+Defining \__driver_color_ensure_current: on line ...
+Defining \__driver_color_reset: on line ...
 Defining \__driver_literal:n on line ...
 Defining \__driver_scope_begin: on line ...
 Defining \__driver_scope_end: on line ...
@@ -5853,11 +5858,6 @@ Defining \__driver_box_use_rotate:Nn on line ...
 Defining \l__driver_cos_fp on line ...
 Defining \l__driver_sin_fp on line ...
 Defining \__driver_box_use_scale:Nnn on line ...
-Defining \l__driver_color_current_tl on line ...
-Defining \l__driver_color_stack_int on line ...
-\l__driver_color_stack_int=\count194
-Defining \__driver_color_ensure_current: on line ...
-Defining \__driver_color_reset: on line ...
 Defining \l__driver_image_attr_tl on line ...
 Defining \__driver_image_getbb_jpg:n on line ...
 Defining \__driver_image_getbb_png:n on line ...

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the latex3-commits mailing list