/[gtk-cffi]/gtk-cffi/gdk/rectangle.lisp
ViewVC logotype

Contents of /gtk-cffi/gdk/rectangle.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations)
Sun Aug 12 17:42:30 2012 UTC (20 months ago) by rklochkov
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
Synced with current version of CFFI
1 (in-package :gdk-cffi)
2
3 (defclass rectangle (struct)
4 ())
5
6 (defmethod new-struct ((class (eql 'rectangle)))
7 (foreign-alloc 'cairo_rectangle_t))
8
9 (defcstruct-accessors (rectangle . cairo_rectangle_t))
10
11 (defcfun gdk-rectangle-intersect :boolean
12 (src1 (struct rectangle)) (src2 (struct rectangle))
13 (dest (struct rectangle :out t)))
14
15 (defgeneric intersect (rect1 rect2))
16 (defmethod intersect ((rect1 rectangle) (rect2 rectangle))
17 "Returns new GdkRectangle: intersection of rect1 and rect2"
18 (let ((dest (make-instance 'rectangle)))
19 (when (gdk-rectangle-intersect rect1 rect2 dest)
20 dest)))
21
22 (defcfun gdk-rectangle-union :void
23 (src1 (struct rectangle)) (src2 (struct rectangle))
24 (dest (struct rectangle :out t)))
25
26 (defgeneric rectangle-union (rect1 rect2))
27 (defmethod rectangle-union ((rect1 rectangle) (rect2 rectangle))
28 (let ((dest (make-instance 'rectangle)))
29 (gdk-rectangle-union rect1 rect2 dest)))
30
31 (defcfun gdk-rectangle-get-type g-type)

  ViewVC Help
Powered by ViewVC 1.1.5