;;;;
;;;;
;;;; canvrect.stk         -- Canvas::Rectangles
;;;;
;;;; Copyright © 2021 Erick Gallesio - I3S-CNRS/Polytech Nice-Sophia <eg@unice.fr>
;;;;
;;;;
;;;; This program is free software; you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
;;;; the Free Software Foundation; either version 2 of the License, or
;;;; (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program; if not, write to the Free Software
;;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
;;;; USA.
;;;;
;;;;           Author: Erick Gallesio [eg@unice.fr]
;;;;    Creation date:  2-Jul-2021 13:01
;;;;

;;;
;;; GTK Bindings
;;;
(define-gtk goo-canvas-rect-new (#:pointer #:double #:double
                                 #:double #:double #:pointer)  #:pointer
  "goo_canvas_rect_new" canvas)


;;;; ======================================================================
;;;;
;;;;    < c a n v a s - r e c t a n g l e >   c l a s s
;;;;
;;;; ======================================================================
(define-class <canvas-rectangle> (<gtk-canvas-item-simple>)
  ((radius-x   #:accessor       radius-x
               #:init-keyword   #:radius-x
               #:allocation     #:gtk-property)
   (radius-y   #:accessor       radius-y
               #:init-keyword   #:radius-y
               #:allocation     #:gtk-property)))

(define-method make-canvas-item ((self <canvas-rectangle>) parent)
  (let ((x (goo-canvas-rect-new parent 0 0 0 0 (void))))
    (cpointer-type-set! x 'canvas-rectangle)
    x))


;;;
;;; Exports
;;;
(export <canvas-rectangle> radius-x radius-y)
