; gd.lisp ; William Halliburton (in-package :pink) (defmacro def-gd-img (name (type size) &body body) (let ((stream (gensym))) `(progn (defun ,(symb "GENERATOR-" name) (,stream) (cl-gd:with-image* ,size ,@body (write-image-to-stream ,stream :png))) (defaction ,name ((self ,type)) (let* ((request (ucw:context.request *context*)) (response (ucw:context.response *context*))) (setf (ucw::get-header response "Status") "200 OK" (ucw::get-header response "Content-Type") "image/png") (,(symb "GENERATOR-" name) (ucw::html-stream response)) (ucw::shutdown request) (ucw::send-headers response) (ucw::send-body response)))))) ;; gd-demo (defcomponent gd-demo (widget-component) () (:default-initargs :css-class "gd-demo")) (defmacro action-href-lambda (&body body) `(action-href (lambda () (with-call/cc ,@body)) :component ucw::*current-component*)) (defmacro