%D \module
%D   [       file=meta-scn,
%D        version=2019.07.19,
%D          title=\METAPOST\ Graphics,
%D       subtitle=LMTX support,
%D         author=Hans Hagen,
%D           date=\ currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\unprotect

\permanent\protected\def\defineMPparameterset[#1]{\clf_lmt_parameters_define{#1}}
\permanent\protected\def\presetMPparameters  [#1]{\clf_lmt_parameters_preset{#1}}
\permanent\protected\def\resetMPparameters   [#1]{\clf_lmt_parameters_reset {#1}}

\permanent\tolerant\protected\def\useMPmacro[#1]#*[#2]#*[#3]%
  {\ifarguments\or
     \let\currentMPinstance\defaultMPinstance
     \meta_enable_include
     \meta_process_graphic{lmt_#1;}%
   \or
     \doifelseassignment{#2}
       {\let\currentMPinstance\defaultMPinstance
        \meta_enable_include
        \clf_lmt_parameters_preset{#1}[#2]%
        \meta_process_graphic{lmt_#1;}%
        \clf_lmt_parameters_reset{#1}}%
       {\meta_begin_graphic_group{#1}%
        \meta_enable_include
        \meta_process_graphic{lmt_#1;}%
        \meta_end_graphic_group}%
   \or
     \meta_begin_graphic_group{#1}%
     \meta_enable_include
     \clf_lmt_parameters_preset{#2}[#3]%
     \meta_process_graphic{lmt_#2;}%
     \clf_lmt_parameters_reset{#2}%
     \meta_end_graphic_group
   \fi}

\protect
