[mcclim-devel] [PATCH] Fix copy-from-pixmap to work inside with-output-to-pixmap

Evgeny M. Zubok evgeny.zubok at tochka.ru
Tue May 19 10:02:05 UTC 2009


The attached patch fixes bug when I'm trying to copy pixmap to
medium-var inside the body of with-output-to-pixmap macro. The
explanation below.


>From CLIM 2.0 (LispWorks)

with-output-to-pixmap [Macro] 
Arguments: (medium-var medium &key width height) &body body 

Summary: Binds `medium-var' to a "pixmap medium" (that is, a medium that
does output to a pixmap with the characteristics appropriate to the
medium `medium') and then evaluates body in that context. All the output
done to the medium designated by `medium-var' inside of body is drawn on
the pixmap stream. The pixmap medium supports the medium output
protocol, including all of the graphics functions. `width' and `height'
are integers that give the dimensions of the pixmap. If they are
omitted, the pixmap will be large enough to contain all the output done
by body. `medium-var' must be a symbol; it is not evaluated. The returned
value is a pixmap that can be drawn onto medium using copy-from-pixmap.



As soon as "The pixmap medium supports the medium output protocol,
including all of the graphics functions." then the copy-from-pixmap also
has to work inside with-output-to-pixmap macro. I've written simple and
quick example (attached) to illustrate this. In the handle-repaint
method the temporary pixmap `temp-pixmap' is created with yellow
background and filled circle in centre. Then `temp-pixmap' is copied
with copy-from-pixmap inside with-output-to-pixmap macro into newly
created `target-pixmap' and the second circle is drawn above. Finally
the `target-pixmap' is copied to canvas. (copy-from-pixmap-test::run) to
run the example.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mcclim_fix_sheet-direct-mirror.patch
Type: text/x-diff
Size: 466 bytes
Desc: Patch
URL: <https://mailman.common-lisp.net/pipermail/mcclim-devel/attachments/20090519/3ce84e9a/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: copy-from-pixmap-test.lisp
Type: application/octet-stream
Size: 1092 bytes
Desc: Example
URL: <https://mailman.common-lisp.net/pipermail/mcclim-devel/attachments/20090519/3ce84e9a/attachment.obj>


More information about the mcclim-devel mailing list