From 50c841678bb9b914a4f0ef628b66d50b4e8b9fed Mon Sep 17 00:00:00 2001 From: Dmitry Kalyanov Date: Sat, 14 Nov 2009 07:21:26 +0300 Subject: [PATCH] Add Gdk/Cairo-integration --- cairo/cairo.lisp | 34 ++++++++++++++++++++++++++++++++++ cairo/cairo.package.lisp | 6 +++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/cairo/cairo.lisp b/cairo/cairo.lisp index 7830d18..4cd1928 100644 --- a/cairo/cairo.lisp +++ b/cairo/cairo.lisp @@ -28,3 +28,37 @@ to the expose event handler." (cl-cairo2::with-context-pointer (,context ,context-pointer) ,@body) (cl-cairo2:destroy ,context)))) + +(defcfun gdk_cairo_set_source_pixbuf :void + (cr :pointer) + (pixbuf (g-object pixbuf)) + (pixbuf-x :int) + (pixbuf-y :int)) + +(defun gdk-cairo-set-source-pixbuf (pixbuf pixbuf-x pixbuf-y &optional (context cl-cairo2:*context*)) + (gdk_cairo_set_source_pixbuf (slot-value context 'cl-cairo2:pointer) + pixbuf pixbuf-x pixbuf-y)) + +(defcfun gdk_cairo_set_source_pixmap :void + (cr :pointer) + (pixmap (g-object pixmap)) + (pixmap-x :double) + (pixmap-y :double)) + +(defun gdk-cairo-set-source-pixmap (pixmap pixmap-x pixmap-y &optional (context cl-cairo2:*context*)) + (gdk_cairo_set_source_pixmap (slot-value context 'cl-cairo2:pointer) + pixmap pixmap-x pixmap-y)) + +(defcfun gdk_cairo_region :void + (cr :pointer) + (region (g-boxed-foreign region))) + +(defun gdk-cairo-region (region &optional (context cl-cairo2:*context*)) + (gdk_cairo_region (slot-value context 'cl-cairo2:pointer) region)) + +(defcfun gdk_cairo_reset_clip :void + (cr :pointer) + (drawable (g-object drawable))) + +(defun gdk-cairo-reset-clip (drawable &optional (context cl-cairo2:*context*)) + (gdk_cairo_reset_clip (slot-value context 'cl-cairo2:pointer) drawable)) \ No newline at end of file diff --git a/cairo/cairo.package.lisp b/cairo/cairo.package.lisp index eb08246..9e4073a 100644 --- a/cairo/cairo.package.lisp +++ b/cairo/cairo.package.lisp @@ -2,4 +2,8 @@ (:use #:cl #:gdk #:cffi #:gobject) (:export #:gdk-context #:create-gdk-context - #:with-gdk-context)) + #:with-gdk-context + #:gdk-cairo-set-source-pixbuf + #:gdk-cairo-set-source-pixmap + #:gdk-cairo-region + #:gdk-cairo-reset-clip)) -- 1.7.10.4