/[mcclim]/mcclim/pixmap.lisp
ViewVC logotype

Contents of /mcclim/pixmap.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations)
Sun Apr 21 12:41:14 2002 UTC (12 years ago) by brian
Branch: MAIN
Changes since 1.3: +13 -1 lines
Sundry fixes to run without multiprocessing support.

Added images/ to hold bitmaps for tests.

Added looks/ to hold neutral look-and-feel realizer packages.

Added Examples/gadget-test to test many gadgets with a look and feel.

Added a pixie look and feel, and a pixie/clx to work with the clx backend.

Added drawing support in the CLX backend for ovals and circles.

Fixed pixmaps to work with with-output-to-pixmap with draw-image, etc.

Moved sheet-leaf-mixin to standard-gadget-pane so it doesn't break radio-box-pane, etc.

Misc fixes.
1 ;;; -*- Mode: Lisp; Package: CLIM-INTERNALS -*-
2
3 ;;; (c) copyright 2001 by Iban HATCHONDO (hatchond@mei.u-bordeaux.fr)
4
5 ;;; This library is free software; you can redistribute it and/or
6 ;;; modify it under the terms of the GNU Library General Public
7 ;;; License as published by the Free Software Foundation; either
8 ;;; version 2 of the License, or (at your option) any later version.
9 ;;;
10 ;;; This library is distributed in the hope that it will be useful,
11 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ;;; Library General Public License for more details.
14 ;;;
15 ;;; You should have received a copy of the GNU Library General Public
16 ;;; License along with this library; if not, write to the
17 ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 ;;; Boston, MA 02111-1307 USA.
19
20 (in-package :CLIM-INTERNALS)
21
22 (defclass pixmap ()
23 ((sheet :initarg :sheet :reader pixmap-sheet)
24 (width :initarg :width :reader pixmap-width)
25 (height :initarg :height :reader pixmap-height)
26 ))
27
28 (defgeneric pixmap-mirror (mirrored-pixmap))
29 (defgeneric allocate-pixmap (sheet width height))
30 (defgeneric deallocate-pixmap (pixmap))
31 (defgeneric copy-to-pixmap (medium medium-x medium-y width height
32 &optional pixmap (pixmap-x 0) (pixmap-y 0)))
33 (defgeneric copy-from-pixmap (pixmap from-x from-y width height
34 medium medium-x medium-y))
35 (defgeneric copy-area (medium from-x from-y width height to-x to-y))
36 (defgeneric medium-copy-area (from-drawable from-x from-y width height
37 to-drawable to-x to-y))
38
39 (defclass mirrored-pixmap (pixmap)
40 ((port :initform nil :initarg :port :accessor port)
41 (medium :initform nil :accessor pixmap-medium)
42 (region :initform nil :accessor sheet-region)
43 ))
44
45 ; added this. CHECKME -- BTS
46 (defmethod (setf %sheet-medium) (value (pixmap mirrored-pixmap))
47 (setf (slot-value pixmap 'medium) value))
48
49 (defmethod invalidate-cached-transformations ((sheet mirrored-pixmap))
50 (values))
51
52 (defmethod invalidate-cached-regions ((sheet mirrored-pixmap))
53 (values))
54
55 ; BTS stopped adding. ^-- CHECKME
56
57 (defmethod initialize-instance :after ((pixmap mirrored-pixmap) &rest args)
58 (declare (ignore args))
59 (with-slots (width height region) pixmap
60 (setf region (make-bounding-rectangle 0 0 width height))))
61
62 (defmethod pixmap-mirror ((pixmap mirrored-pixmap))
63 (port-lookup-mirror (port pixmap) pixmap))
64
65 (defmethod allocate-pixmap ((sheet sheet) width height)
66 (port-allocate-pixmap (port sheet) sheet width height))
67
68 (defmethod deallocate-pixmap ((pixmap pixmap))
69 (port-deallocate-pixmap (port (medium-sheet pixmap)) pixmap))
70
71 (defmethod sheet-native-transformation ((pixmap mirrored-pixmap))
72 +identity-transformation+)
73
74 (defmethod sheet-native-region ((pixmap mirrored-pixmap))
75 (make-rectangle* 0 0
76 (pixmap-width pixmap)
77 (pixmap-height pixmap)))
78
79 (defmethod sheet-device-transformation ((pixmap mirrored-pixmap))
80 (medium-transformation (pixmap-medium pixmap)))
81
82 (defmethod sheet-device-region ((pixmap mirrored-pixmap))
83 (region-intersection
84 (sheet-native-region pixmap)
85 (transform-region
86 (sheet-device-transformation pixmap)
87 (medium-clipping-region (pixmap-medium pixmap)))))

  ViewVC Help
Powered by ViewVC 1.1.5