diff options
Diffstat (limited to 'Master/texmf-dist/metapost/metauml/metauml_class.mp')
-rw-r--r-- | Master/texmf-dist/metapost/metauml/metauml_class.mp | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/Master/texmf-dist/metapost/metauml/metauml_class.mp b/Master/texmf-dist/metapost/metauml/metauml_class.mp index 6e8e4330e3b..f99b134c0d4 100644 --- a/Master/texmf-dist/metapost/metauml/metauml_class.mp +++ b/Master/texmf-dist/metapost/metauml/metauml_class.mp @@ -20,12 +20,24 @@ if known _metauml_class_mp: fi; _metauml_class_mp:=1; -input metauml_defaults; -input util_log; +% Sadly, this copy of the macro is needed to prevent multiple file loads being shown by MetaPost. +% The guard values (such as _metauml_mp) do ensure that the file isn't loaded multiple times, +% but this macro makes sure that MetaPost won't try to load the file and display a message for that. +def inputonce text libraryFile= + if not known scantokens ("_" & str libraryFile & "_mp"): + %includeonce% show "Loading " & str libraryFile; + scantokens ("input " & str libraryFile); + else: + %includeonce% show str libraryFile & " already loaded."; + fi; +enddef; + +inputonce metauml_defaults; +inputonce util_log; -input util_picture; -input util_picture_stack; -input util_shade; +inputonce util_picture; +inputonce util_picture_stack; +inputonce util_shade; string accessPublic, accessProtected, accessPrivate; accessPublic:="+"; @@ -111,7 +123,17 @@ enddef; ClassInfo.iClass; +ClassInfoCopy.iClassNameOnly(iClass); +iClassNameOnly.iName.top := 10; +iClassNameOnly.iName.bottom := 10; +iClassNameOnly.iAttributeStack.top := 0; +iClassNameOnly.iAttributeStack.bottom := 0; +iClassNameOnly.iMethodStack.top := 0; +iClassNameOnly.iMethodStack.bottom := 0; + ClassInfoCopy.iInterface(iClass); +iInterface.iAttributeStack.top := 0; +iInterface.iAttributeStack.bottom := 0; iInterface.iName.iFont.name := metauml_defaultFontOblique; ClassInfoCopy.iAbstractClass(iInterface); @@ -221,6 +243,14 @@ vardef EInterface@#(text _info)(expr name)(text methods)= EClass@#(_info)(name)()(methods); enddef; +vardef ClassName@#(expr name)= + EClass@#(iClassNameOnly)(name)()(); +enddef; + +vardef EClassName@#(text _info)(expr name)= + EClass@#(_info)(name)()(); +enddef; + vardef AbstractClass@#(expr name)(text attributes)(text methods)= EClass@#(iAbstractClass)(name)(attributes)(methods); enddef; |