!!see scripts/oef/draw.phtml modules/adm/doc/primitives/draw.phtml scripts/primitives/draw.phtml
!if $wims_read_parm!=$empty
  !set parms=$wims_read_parm
  !set parms=!replace internal $	$ by $\
$ in $parms
  !set size=!line 1 of $parms
  !distribute items $size into sx,sy
  !set ppm=!line 2 to -1 of $parms
!else
  !if $parms=$empty
    !exit
  !endif
  !distribute items $parms into sx,sy
  !set ppm=!item 3 to -1 of $parms
!endif

!set ppm=!replace internal \filedir/ by $ in $ppm
!for pm in ppm, sx, sy
  !set $pm=!slashsubst $($pm)
!next pp
!set ppm=!replace internal $	$ by $\
$ in $ppm
!set pp=!trim $ppm

!set a_=!word 1 of $pp
!if $a_=alt
  !set a_=!line 1 of $pp
  !set a_=!word 2 to -1 of $a_
  !set pp=!line 2 to -1 of $pp
  !set ins_attr=alt="$a_"
  !set wims_ins_alt=empty
!endif
!set a=!word 1 of $pp
!if $a=animate
  !set a=!line 1 of $pp
  !set a=!word 2 to -1 of $a
  !set pp=!line 2 to -1 of $pp
  !if $printable!=yes
    !distribute items $a into ins_anim_frames, ins_anim_delay, ins_anim_loop
  !endif
!endif
!readproc $docdir/.def
!! only in case that we come from adm/doc to read common_files
!! already read in other cases
!if $common_files!=yes
  !if /doc isin $(docdir)
    !set docdir1= !replace internal /doc by in $(docdir)
    !readproc $docdir1/var.proc
  !else
    !readproc $docdir/var.proc
  !endif
!endif
!! end only
!if $common_files=yes
  !set doc_=$docdir/files
!else
  !if $common_files=$empty or $common_files=no
    !set doc_=$docdir/$doc/files
  !else
    !set doc_=!replace datamodule by modules/data in $common_files
  !endif
!endif
!set insdraw_filebase=$(doc_)
!set insdraw_size=$sx,$sy
!set ins_align=middle
!insdraw $pp
