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

Contents of /mcclim/pixmap.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations)
Fri Mar 21 21:36:59 2003 UTC (11 years, 1 month ago) by mikemac
Branch: MAIN
CVS Tags: McCLIM-0-9, mcclim-0-9-4, McCLIM-0-9-5, McCLIM-0-9-4, McCLIM-0-9-6, McCLIM-0-9-1, McCLIM-0-9-3, McCLIM-0-9-2
Changes since 1.6: +1 -1 lines
make all of the package names passed to in-package be lowercase keywords for ACL's java mode
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 pixmap-y))
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 deallocate-pixmap ((pixmap mirrored-pixmap))
72 (port-deallocate-pixmap (port pixmap) pixmap))
73
74 (defmethod sheet-native-transformation ((pixmap mirrored-pixmap))
75 +identity-transformation+)
76
77 (defmethod sheet-native-region ((pixmap mirrored-pixmap))
78 (make-rectangle* 0 0
79 (pixmap-width pixmap)
80 (pixmap-height pixmap)))
81
82 (defmethod sheet-device-transformation ((pixmap mirrored-pixmap))
83 (medium-transformation (pixmap-medium pixmap)))
84
85 (defmethod sheet-device-region ((pixmap mirrored-pixmap))
86 (region-intersection
87 (sheet-native-region pixmap)
88 (transform-region
89 (sheet-device-transformation pixmap)
90 (medium-clipping-region (pixmap-medium pixmap)))))

  ViewVC Help
Powered by ViewVC 1.1.5