6 * Portable Windows Library
8 * Copyright (c) 1993-1998 Equivalence Pty. Ltd.
10 * The contents of this file are subject to the Mozilla Public License
11 * Version 1.0 (the "License"); you may not use this file except in
12 * compliance with the License. You may obtain a copy of the License at
13 * http://www.mozilla.org/MPL/
15 * Software distributed under the License is distributed on an "AS IS"
16 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17 * the License for the specific language governing rights and limitations
20 * The Original Code is Portable Windows Library.
22 * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
24 * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
25 * All Rights Reserved.
27 * Contributor(s): ______________________________________.
30 * Revision 1.17 2001/05/22 12:49:33 robertj
31 * Did some seriously wierd rewrite of platform headers to eliminate the
32 * stupid GNU compiler warning about braces not matching.
34 * Revision 1.16 1999/03/10 03:49:52 robertj
35 * More documentation adjustments.
37 * Revision 1.15 1999/03/09 08:01:48 robertj
38 * Changed comments for doc++ support (more to come).
40 * Revision 1.14 1999/02/16 08:08:45 robertj
41 * MSVC 6.0 compatibility changes.
43 * Revision 1.13 1998/09/23 06:24:11 robertj
44 * Added open source copyright license.
46 * Revision 1.12 1995/03/14 12:41:42 robertj
47 * Updated documentation to use HTML codes.
49 * Revision 1.11 1994/12/21 11:53:14 robertj
50 * Documentation and variable normalisation.
52 * Revision 1.10 1994/12/05 11:34:10 robertj
53 * Major rewrite of images, pictures and pixmaps.
54 * Renamed PPict, PPixels and PImage to make sure all uses are found.
56 * Revision 1.9 1994/08/23 11:32:52 robertj
59 * Revision 1.8 1994/08/22 00:46:48 robertj
60 * Added pragma fro GNU C++ compiler.
62 * Revision 1.7 1994/06/25 11:55:15 robertj
63 * Unix version synchronisation.
65 * Revision 1.6 1994/03/07 07:38:19 robertj
66 * Major enhancementsacross the board.
68 * Revision 1.5 1994/01/03 04:42:23 robertj
69 * Mass changes to common container classes and interactors etc etc etc.
71 * Revision 1.4 1993/10/16 20:33:20 robertj
72 * Changed memory canvas to output to PImage which is no longer a bitmap.
74 * Revision 1.3 1993/08/21 01:50:33 robertj
75 * Made Clone() function optional, default will assert if called.
77 * Revision 1.2 1993/07/14 12:49:16 robertj
83 #define _PMEMORYCANVAS
90 /**A drawable area that will go to a \Ref{PImage} in memory. Note that the
91 \Ref{PImage} object passed to the PMemoryCanvas is undefined while the
92 PMemoryCanvas exists. Not until the PMemoryCanvas is destroyed is the
93 \Ref{PImage} object guarenteed to be updated.
95 *********************************** NOTE ***********************************
96 On Some platforms, canvases are a limited resource. Do NOT create and leave
97 them around for long periods. As soon as it is not required till the next
98 user event, destroy it!
99 ****************************************************************************
101 class PMemoryCanvas
: public PCanvas
103 PCLASSINFO(PMemoryCanvas
, PCanvas
);
106 /**Create a canvas using the specified image. The image will receive the
107 drawing operations made to the canvas. The two types of images,
108 \Ref{PPixelImage} and \Ref{PPictImage} will store the commands
109 differently according to their internal representation of an image.
112 const PImage
& img
/// Image to draw into.
115 /** Destroy the canvas and image. */
116 virtual ~PMemoryCanvas();
119 /**@name Overrides from class PCanvas */
120 /**Get the drawable area of the image, for instance, this would be the
121 dimensions of the \Ref{PPixelImage} used by the canvas.
124 rectangle for the maximum size of the drawable area.
126 virtual PRect
GetDrawingBounds() const;
129 /**@name New functions for class */
130 /**Get the image created by the canvas. While this will allow you to
131 obtain a reference to the image instance being drawn to by the canvas,
132 the state of the image is indeterminate while the PMemoryCanvas instance
133 still exists. For example in X windows when a PPixelImage is being
134 created, the pixels are not tranferred from the X server to the client
135 until the PMemoryCanvas is destroyed.
137 const PImage
GetImage();
141 /// Image to draw into.
144 // New functions for class
146 // Internal function for common constructor code.
149 // Include platform dependent part of class
150 #include <pwlib/mcanvas.h>
154 // End Of File ///////////////////////////////////////////////////////////////