======================================================
Require the use of with-glib-lock, except with the globally exported
-open-input-gfile, open-output-gfile, and gdirectory-read.
+open-input-gfile, open-output-gfile, and gdirectory-read. Color
+procedures can now be found in the (pango) package.
mit-scheme-pucked-glib 0.6 - Matt Birkholz, 2018-01-12
======================================================
* Require the use of with-glib-lock, except with the globally
exported open-input-gfile, open-output-gfile, and gdirectory-read.
+ Color procedures can now be found in the (pango) package.
+
+ -- Matt Birkholz <matt@birchwood-abbey.net> Fri, 16 Mar 2018 00:00:00 -0700
mit-scheme-pucked-glib (0.6) birchwood; urgency=low
(define (bit-ior . ints)
(reduce bitwise-ior 0 ints))
\f
-(define-integrable (color? object)
- (and (flo:flonum? object) (fix:= 4 (flo:vector-length object))))
-
-(define-integrable (make-color) (flo:vector-cons 4))
-
-(define-integrable-operator (color-red o)
- (if (color? o) (flo:vector-ref o 0) (error:wrong-type-argument o "a color")))
-
-(define-integrable-operator (color-green o)
- (if (color? o) (flo:vector-ref o 1) (error:wrong-type-argument o "a color")))
-
-(define-integrable-operator (color-blue o)
- (if (color? o) (flo:vector-ref o 2) (error:wrong-type-argument o "a color")))
-
-(define-integrable-operator (color-alpha o)
- (if (color? o) (flo:vector-ref o 3) (error:wrong-type-argument o "a color")))
-
-(define-integrable-operator (set-color-red! o r)
- (if (color? o) (flo:vector-set! o 0 r)(error:wrong-type-argument o"a color")))
-
-(define-integrable-operator (set-color-green! o g)
- (if (color? o) (flo:vector-set! o 1 g)(error:wrong-type-argument o"a color")))
-
-(define-integrable-operator (set-color-blue! o b)
- (if (color? o) (flo:vector-set! o 2 b)(error:wrong-type-argument o"a color")))
-
-(define-integrable-operator (set-color-alpha! o a)
- (if (color? o) (flo:vector-set! o 3 a)(error:wrong-type-argument o"a color")))
-
-(define-integrable-operator (make-rgba-color red green blue alpha)
- (let ((color (make-color)))
- (set-color-red! color red)
- (set-color-green! color green)
- (set-color-blue! color blue)
- (set-color-alpha! color alpha)
- color))
-
-(define (guarantee-color object operator)
- (if (color? object)
- object
- (error:wrong-type-argument object "a color" operator)))
-\f
;;; GLib Mutex
(define glib-mutex)