diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleoo.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleoo.code.tex | 170 |
1 files changed, 85 insertions, 85 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleoo.code.tex b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleoo.code.tex index 38ceef34cdc..1cd938af521 100644 --- a/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleoo.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleoo.code.tex @@ -8,7 +8,7 @@ % % See the file doc/generic/pgf/licenses/LICENSE for more details. % -% Based on pgfmoduleoo.code.tex v1.8 by Till Tantau. This version adds inheritance. +% Based on pgfmoduleoo.code.tex v1.8 by Till Tantau. This version adds inheritance. @@ -66,7 +66,7 @@ }{% \pgfooclass@() }% -}% +} \long\def\pgfooclass@(#1)#2#3{% \def\pgfoo@classname{#2}% \expandafter\ifx\csname pgfooY\pgfoo@classname.@pgfooinit\endcsname\relax\else @@ -95,9 +95,9 @@ % Cleanup \let\method=\pgfoo@origmethod% \let\attribute=\pgfoo@origattribute% -}% +} -\def\pgfoo@emptyinit(){}% +\def\pgfoo@emptyinit(){} \def\pgfoo@escapeif#1#2\fi{\fi#1}% a little helper @@ -122,13 +122,13 @@ \fi }% % The final sequence is a sequence of base classes, in the order as - % they were given. + % they were given. \ifx\relax#2\relax\else \edef\pgfoo@seq{\pgfoo@seq[#2,].}% \fi \edef\pgfoo@temp{()(\pgfoo@seq)}% \expandafter\pgfoo@ciii@merge\pgfoo@temp -}% +} % #1 = MRO so far % #2 = remaining sequences @@ -140,19 +140,19 @@ \else\pgfoo@escapeif{% split #2 \pgfoo@ciii@merge@A(#1)(#2)% }\fi% -}% +} % a splitter: to be only called from \pgfoo@ciii@merge \def\pgfoo@ciii@merge@A(#1)(#2.#3){% \ifx\relax#3\relax % if #3 is empty, we can take the shortcut \pgfoo@ciii@mergeA@done(#1)(#2)% - \else\pgfoo@escapeif{% + \else\pgfoo@escapeif{% \pgfoo@ciii@merge@checkHead(#1)()(#2)()(#3)% }\fi -}% +} \def\pgfoo@ciii@mergeA@done(#1)([#2]){% \pgfoo@ciii@done(#1#2)% -}% +} % #1 = MRO so far % #2 = sequences with bad heads (dot after each sequence) @@ -165,21 +165,21 @@ \def\pgfoo@ciii@merge@checkHead(#1)(#2)([#3,#4])(#5)(#6){% \pgfutil@in@{[#3,}{#2}% \ifpgfutil@in@\pgfoo@escapeif{% #3 is already blacklisted - \pgfoo@ciii@clean\pgfoo@ciii@merge@checkHead@P{(#1)(#2[#3,#4].)(#5#6)}% + \pgfoo@ciii@clean\pgfoo@ciii@merge@checkHead@P{(#1)(#2[#3,#4].)(#5#6)}% }\else\pgfoo@escapeif{% - \ifx\relax#6\relax\pgfoo@escapeif{% no more sequences to test the head against! + \ifx\relax#6\relax\pgfoo@escapeif{% no more sequences to test the head against! % so, #3 is a good head, and we can recurse \pgfoo@ciii@goodHeadFound(#1)(#3)(#2[#4].#5)% }\else\pgfoo@escapeif{% split #6 and get to work \pgfoo@ciii@merge@checkHead@A(#1)(#2)([#3,#4])(#5)(#6)% }\fi }\fi -}% +} % splitter: to be only called from \pgfoo@ciii@merge@checkHead % we will check if #3 occurs in the tail of #6 \def\pgfoo@ciii@merge@checkHead@A(#1)(#2)([#3,#4])(#5)(#6.#7){% \pgfoo@ciii@merge@checkHead@B(#1)(#2)([#3,#4])(#5)(#6)(#7)% -}% +} % splitter: to be only called from \pgfoo@ciii@merge@checkHead@A % &worker: we will check if #3 occurs in #7. If it does, #3 is a bad head. \def\pgfoo@ciii@merge@checkHead@B(#1)(#2)([#3,#4])(#5)([#6,#7])(#8){% @@ -201,7 +201,7 @@ }\fi }\fi % }\fi -}% +} % #1 = MRO % #2 = good head @@ -223,7 +223,7 @@ \pgfoo@ciii@clean\pgfoo@ciii@merge{(#1#2,)(#3)}% }\fi }\fi -}% +} % mediates between the bad head exit of \pgfoo@ciii@merge@checkHead@B % and \pgfoo@ciii@merge@checkHead; we need the mediator because #3 @@ -235,12 +235,12 @@ \else\pgfoo@escapeif{% \pgfoo@ciii@merge@checkHead@Q(#1)(#2)(#3)% }\fi -}% +} % splitter for \pgfoo@ciii@merge@checkHead@P % #3 = the sequence containing the newest good head candidate \def\pgfoo@ciii@merge@checkHead@Q(#1)(#2)(#3.#4){% \pgfoo@ciii@merge@checkHead(#1)(#2)(#3)()(#4)% -}% +} % cyclically removes all occurrences of "[]," and "[]." (i.e., empty % sequences) in #2. When done, calls #1 with whatever remains. @@ -251,14 +251,14 @@ }\else\pgfoo@escapeif{% #1#2% }\fi -}% +} \def\pgfoo@ciii@clean@dot#1#2[].#3\pgfoo@ciii@clean@END{% \pgfoo@ciii@clean#1{#2#3}% -}% +} \def\pgfoo@ciii@done(#1,){% \def\pgfoo@mro{#1}% -}% +} % end of C3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -305,12 +305,12 @@ \fi \expandafter\long\expandafter\def\csname pgfooY\pgfoo@classname.\pgfoo@method\endcsname(#2){#3}% \edef\pgfoo@methods{\pgfoo@methods,\pgfoo@method}% -}% +} \def\pgfoo@inherit@methods{% % for non-derived classes: \expandafter\ifx\expandafter\relax\pgfoo@temp@baseclasses\relax - % if init is not defined, define an empty one + % if init is not defined, define an empty one \expandafter\ifx\csname pgfooY\pgfoo@classname.init\endcsname\relax \expandafter\let\csname pgfooY\pgfoo@classname.init\endcsname\pgfoo@emptyinit% \edef\pgfoo@methods{,init\pgfoo@methods}% @@ -323,7 +323,7 @@ % remember the list of collected methods \expandafter\let\csname pgfooY\pgfoo@classname @pgfoo@methods\endcsname\pgfoo@methods % get MRO - \expandafter\let\expandafter\pgfoo@mro\csname pgfooY\pgfoo@classname @pgfoo@mro\endcsname + \expandafter\let\expandafter\pgfoo@mro\csname pgfooY\pgfoo@classname @pgfoo@mro\endcsname % loop throough base classes in MRO \pgfutil@for\pgfoo@baseclass:=\pgfoo@mro\do{% \ifx\pgfoo@baseclass\pgfoo@classname % skip self @@ -332,7 +332,7 @@ \expandafter\let\expandafter\pgfoo@methods\csname pgfooY\pgfoo@baseclass @pgfoo@methods\endcsname \pgfutil@for\pgfoo@method:=\pgfoo@methods\do{% for each method % check if it is already defined in our class - \expandafter\ifx\csname pgfooY\pgfoo@classname.\pgfoo@method\endcsname\relax + \expandafter\ifx\csname pgfooY\pgfoo@classname.\pgfoo@method\endcsname\relax % if not, link the method name from our class to base class \edef\pgfoo@temp{\noexpand\let \expandafter\noexpand\csname pgfooY\pgfoo@classname.\pgfoo@method\endcsname @@ -342,7 +342,7 @@ }% }\fi }% -}% +} \def\pgfoosuper(#1,#2).#3({% #2.get id(\pgfoo@temp@id)% @@ -352,14 +352,14 @@ }% \expandafter\let\expandafter\pgfoo@mro\csname pgfooY\pgfoo@classname @pgfoo@mro\endcsname \expandafter\pgfoo@super@A\expandafter,\pgfoo@mro,.#3(% -}% +} \def\pgfoo@super@B#1,#2.#3({% \expandafter\ifx\csname pgfooY#1.#3\endcsname\relax \pgfoo@escapeif{\pgfoo@super@B#2.#3(}% \else \pgfoo@escapeif{\expandafter\pgfoo@caller\pgfoo@temp@id.#1.#3(}% \fi -}% +} @@ -384,18 +384,18 @@ \pgfoo@declareunpack#1;% \else% \pgfoo@declareattribute@\let{#1}\pgfutil@empty - \fi% - \fi% -}% -\def\pgfoo@declareunpack#1=#2;{\pgfoo@declareattribute@\def{#1}{{#2}}}% -\def\pgfoo@declareunpackspace#1 =#2;{\pgfoo@declareattribute@\def{#1}{{#2}}}% + \fi% + \fi% +} +\def\pgfoo@declareunpack#1=#2;{\pgfoo@declareattribute@\def{#1}{{#2}}} +\def\pgfoo@declareunpackspace#1 =#2;{\pgfoo@declareattribute@\def{#1}{{#2}}} % put the initial value in the class's namespace % put the attr name in a list \def\pgfoo@declareattribute@#1#2#3{% \expandafter#1\csname pgfooY\pgfoo@classname @#2\endcsname#3% \expandafter\def\expandafter\pgfoo@attributes\expandafter{\pgfoo@attributes,#2}% -}% +} % for each base class: % for each attribute declared in that class: @@ -411,14 +411,14 @@ \fi \expandafter\let\csname pgfooY\pgfoo@classname.@pgfoo@attributes\endcsname\pgfoo@attributes% % get MRO - \expandafter\let\expandafter\pgfoo@mro\csname pgfooY\pgfoo@classname @pgfoo@mro\endcsname + \expandafter\let\expandafter\pgfoo@mro\csname pgfooY\pgfoo@classname @pgfoo@mro\endcsname \def\pgfoo@allattributes{}% here we will store the attrs declared in base classes \pgfutil@for\pgfoo@baseclass:=\pgfoo@mro\do{% for each base class in MRO order % the attributes declared in this base class \expandafter\let\expandafter\pgfoo@attributes\csname pgfooY\pgfoo@baseclass.@pgfoo@attributes\endcsname \pgfutil@for\pgfoo@attribute:=\pgfoo@attributes\do{% for each attribute % check if we have already found it in some previous base class - \edef\pgfoo@temp{{,\pgfoo@attribute=}{\pgfoo@allattributes,}}% + \edef\pgfoo@temp{{,\pgfoo@attribute=}{\pgfoo@allattributes,}} \expandafter\pgfutil@in@\pgfoo@temp \ifpgfutil@in@\else % don't overwrite % append to the list @@ -430,14 +430,14 @@ \edef\pgfoo@allattributes{\expandafter\pgfutil@gobble\pgfoo@allattributes}% gobble comma \fi % this macro will hold a list of attributes from all base classes - % we run this macro at init and gc - \def\pgfoo@process@attributes{}% + % we run this macro at init and gc + \def\pgfoo@process@attributes{} \pgfutil@for\pgfoo@attributeclass:=\pgfoo@allattributes\do{% for each (attribute, class) pair % append to the attribute processor \expandafter\pgfoo@inherit@attributes@appendattribute\pgfoo@attributeclass.% }% \expandafter\let\csname pgfooY\pgfoo@classname .@pgfoo@process@attributes\endcsname\pgfoo@process@attributes -}% +} % #1=attr, #2=class which the attr comes from @@ -449,10 +449,10 @@ % \def\pgfoo@process@attributes{\pgfoo@process@attributes\pgfoo@attribute@op{#1}% % \csname pgfooY#2@#1\endcsname} % with \pgfoo@process@attributes and \csname expanded exactly once: -}% +} -% \pgfoo@attribute@op for garbage collection -\def\pgfoo@gc@attribute#1#2{\pgfoolet{#1}\relax}% +% \pgfoo@attribute@op for garbace collection +\def\pgfoo@gc@attribute#1#2{\pgfoolet{#1}\relax} \newcount\pgfoo@objectcount @@ -467,7 +467,7 @@ \def\pgfoovalueof#1{% \csname pgfooX\the\pgfoothis@count @#1\endcsname% -}% +} % The attribute get method @@ -480,7 +480,7 @@ \def\pgfooget#1#2{% \expandafter\let\expandafter#2\csname pgfooX\the\pgfoothis@count @#1\endcsname% -}% +} % The attribute set method @@ -493,7 +493,7 @@ \long\def\pgfooset#1#2{% \expandafter\gdef\csname pgfooX\the\pgfoothis@count @#1\endcsname{#2}% -}% +} % The attribute set method (expanded version) @@ -506,7 +506,7 @@ \long\def\pgfooeset#1#2{% \expandafter\xdef\csname pgfooX\the\pgfoothis@count @#1\endcsname{#2}% -}% +} % The attribute let method @@ -519,7 +519,7 @@ \def\pgfoolet#1#2{% \expandafter\global\expandafter\let\csname pgfooX\the\pgfoothis@count @#1\endcsname#2% -}% +} % Add something to an attribute at the end @@ -533,7 +533,7 @@ \expandafter\expandafter\expandafter\def% \expandafter\expandafter\expandafter\pgf@oo@temp\expandafter\expandafter\expandafter{\csname pgfooX\the\pgfoothis@count @#1\endcsname#2}% \expandafter\global\expandafter\let\csname pgfooX\the\pgfoothis@count @#1\endcsname\pgf@oo@temp% -}% +} % Add something to an attribute at the beginning @@ -550,7 +550,7 @@ \expandafter\expandafter\expandafter\pgf@oo@temp% \expandafter\expandafter\expandafter{\expandafter\pgf@oo@@temp\pgf@oo@temp}% \pgfoolet{#1}\pgf@oo@temp% -}% +} @@ -559,14 +559,14 @@ \def\pgfoo@collect@args{% \pgfutil@ifnextchar\bgroup\pgfoo@collect@args@group\pgfoo@collect@args@nogroup% -}% +} \def\pgfoo@collect@args@nogroup#1){% \pgfoo@toks{#1}% \pgfoo@continue% -}% +} \def\pgfoo@collect@args@group#1{% \pgfutil@ifnextchar){\pgfoo@toks{{#1}}\expandafter\pgfoo@continue\pgfutil@gobble}{\pgfoo@collect@args@nogroup{#1}}% -}% +} % Instantiate an object @@ -594,11 +594,11 @@ \pgfoo@new% }% }% -}% +} \def\pgfoo@new#1={% \def\pgfutil@reserved@a{#1}% \let\pgfutil@next\pgfoo@@new - \futurelet\pgfutil@let@token\pgfutil@ignorespaces}% + \futurelet\pgfutil@let@token\pgfutil@ignorespaces} \def\pgfoo@@new new #1({% \expandafter\ifx\csname pgfooY#1.get id\endcsname\relax% \pgferror{Unknown class '#1'}% @@ -612,17 +612,17 @@ \let\pgfoo@continue=\pgf@oo@new@cont% \expandafter\pgfoo@collect@args% \fi% -}% +} \def\pgf@oo@new@cont{% \expandafter\pgfoolastobj\expandafter.\expandafter i\expandafter n\expandafter i\expandafter t\expandafter(\the\pgfoo@toks)% \aftergroup\pgfoogc% cleanup after group -}% +} \def\pgfoo@new@attribute#1={% \def\pgfutil@reserved@a{#1}% \let\pgfutil@next\pgfoo@@new@attribute - \futurelet\pgfutil@let@token\pgfutil@ignorespaces}% + \futurelet\pgfutil@let@token\pgfutil@ignorespaces} \def\pgfoo@@new@attribute new #1({% \expandafter\ifx\csname pgfooY#1.get id\endcsname\relax% \pgferror{Unknown class '#1'}% @@ -637,14 +637,14 @@ \let\pgfoo@continue=\pgf@oo@new@cont% \expandafter\pgfoo@collect@args% \fi% -}% +} \def\pgfoo@new@create#1#2{% \advance\pgfoo@objectcount by 1\relax% \edef\pgfoolastobj{\noexpand\pgfoo@caller{\the\pgfoo@objectcount}}% \expandafter\gdef\csname pgfooX\the\pgfoo@objectcount @class\endcsname{#2}% \let#1\pgfoolastobj% -}% +} \def\pgfoo@caller#1.#2({% \expandafter\let\expandafter\pgfoo@caller@temp\csname pgfooY\csname pgfooX#1@class\endcsname.#2\endcsname% @@ -654,20 +654,20 @@ \ifx\pgfoo@caller@temp\relax% \pgferror{Object #1 has no method '#2'}% \fi% - \fi% + \fi% \def\pgf@marshal{% \pgfoothis@count=#1\relax% }% \let\pgfoo@continue\pgfoo@caller@cont% \pgfoo@collect@args% -}% +} \def\pgfoo@caller@cont{% \edef\pgf@marshal{% \pgf@marshal% \noexpand\pgfoo@caller@temp(\the\pgfoo@toks)% }% \expandafter\pgf@marshal\expandafter\pgfoothis@count\the\pgfoothis@count\relax% -}% +} \let\pgfoo@orig@caller=\pgfoo@caller % The special "this" object @@ -680,10 +680,10 @@ \fi% \let\pgfoo@continue\pgfoothis@cont% \pgfoo@collect@args% -}% +} \def\pgfoothis@cont{% \expandafter\pgfoo@caller@temp\expandafter(\the\pgfoo@toks)% -}% +} @@ -699,7 +699,7 @@ \def\pgfoo@id(#1){% \edef#1{\the\pgfoothis@count}% -}% +} % Yields the object with the given id % @@ -712,7 +712,7 @@ \def\pgfooobj#1{% \pgfoo@caller{#1}% -}% +} % Get the object @@ -729,7 +729,7 @@ \def\pgfoo@obj(#1){% \edef#1{\noexpand\pgfoo@caller{\the\pgfoothis@count}}% -}% +} @@ -737,10 +737,10 @@ % % Description: % -% This method frees space occupied by unused objects. Garbage are +% This method frees space ocupied by unused objects. Garbage are % objects that have been destroyed because of the end of the scope in % which they were created. In this case, however, the memory used by -% this object is not immediately reused because the attributes of the +% this object is not immediately reused because the attributes of the % object are actually stored in global variables. When the garbage % collector is called, it will set all these global variables to % \relax, thereby ensuring that no memory is needed for them. @@ -752,7 +752,7 @@ \let\pgfoo@next=\pgfoo@dogc% \pgfoo@next% }% -}% +} \def\pgfoo@dogc{% \advance\pgfoothis@count by 1\relax% \expandafter\ifx\csname pgfooX\the\pgfoothis@count @class\endcsname\relax% @@ -765,8 +765,8 @@ \expandafter\global\expandafter\let\csname pgfooX\the\pgfoothis@count @class\endcsname\relax% \fi% \pgfoo@next% -}% - +} + % @@ -786,10 +786,10 @@ \expandafter\let\csname pgfooX\the\pgfoo@objectcount @##1\endcsname\pgfoo@attrvalue }% \let\pgfoo@attribute@op\pgfoo@copy@attributes - \csname pgfooY\pgfoo@temp@classname .@pgfoo@process@attributes\endcsname + \csname pgfooY\pgfoo@temp@classname .@pgfoo@process@attributes\endcsname \aftergroup\pgfoogc% cleanup after group - }% -}% + } +} % @@ -799,7 +799,7 @@ % \pgfooclass{signal} -{% +{ % % This class implements signals. % @@ -808,35 +808,35 @@ % called, all connected methods get called. % Attribute - \attribute emitter;% + \attribute emitter; % Collects the objects that should be called. - + % Constructor - \method signal() {}% + \method signal() {} % Connect a slot (method) #2 of object #1 \method connect(#1,#2) {% {% #1.get id(\pgf@tempid)% - % Save in emitter + % Save in emmiter \pgfooget{emitter}\pgf@temp% \let\pgfoo@signal@call=\relax% avoid expansion \edef\pgf@temp{\pgf@temp\pgfoo@signal@call{\pgf@tempid}{#2}}% \pgfoolet{emitter}\pgf@temp% }% - }% + } \def\pgfoo@signal@call#1#2{% \def\pgf@temp{\pgfooobj{#1}.#2}% \expandafter\pgf@temp\expandafter(\pgfoo@signal@args)% - }% - + } + % Emit a signal \method emit(#1) {% \def\pgfoo@signal@args{#1}% \pgfoovalueof{emitter} - }% -}% + } +} |