X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/clg/blobdiff_plain/112ac1d33aa8f9b7f3d2f9542d15431f152b1d35..cc74b2c987edc3e2bc85413e92f33e2690a32b1c:/gdk/gdk.lisp diff --git a/gdk/gdk.lisp b/gdk/gdk.lisp index e0f15d1..6528895 100644 --- a/gdk/gdk.lisp +++ b/gdk/gdk.lisp @@ -20,7 +20,7 @@ ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -;; $Id: gdk.lisp,v 1.17 2005-04-23 16:48:50 espen Exp $ +;; $Id: gdk.lisp,v 1.20 2006-02-08 22:20:22 espen Exp $ (in-package "GDK") @@ -425,7 +425,7 @@ (defbinding rgb-init () nil) (defmethod initialize-instance ((cursor cursor) &key type mask fg bg (x 0) (y 0) (display (display-get-default))) (setf - (slot-value cursor 'location) + (foreign-location cursor) (etypecase type (keyword (%cursor-new-for-display display type)) (pixbuf (%cursor-new-from-pixbuf display type x y)) @@ -705,3 +705,35 @@ (defbinding (keyval-is-upper-p "gdk_keyval_is_upper") () boolean (defbinding (keyval-is-lower-p "gdk_keyval_is_lower") () boolean (keyval unsigned-int)) +;;; Cairo interaction + +#+gtk2.8 +(progn + (defbinding cairo-create () cairo:context + (drawable drawable)) + + (defmacro with-cairo-context ((cr drawable) &body body) + `(let ((,cr (cairo-create ,drawable))) + (unwind-protect + (progn ,@body) + (unreference-foreign 'cairo:context (foreign-location ,cr)) + (invalidate-instance ,cr)))) + + (defbinding cairo-set-source-color () nil + (cr cairo:context) + (color color)) + + (defbinding cairo-set-source-pixbuf () nil + (cr cairo:context) + (pixbuf pixbuf) + (x double-float) + (y double-float)) + + (defbinding cairo-rectangle () nil + (cr cairo:context) + (rectangle rectangle)) + +;; (defbinding cairo-region () nil +;; (cr cairo:context) +;; (region region)) +)