pattern.h
上传用户:hzhsqp
上传日期:2007-01-06
资源大小:1600k
文件大小:5k
- /*
- * pattern.h
- *
- * Pattern description.
- *
- * Portable Windows Library
- *
- * Copyright (c) 1993-1998 Equivalence Pty. Ltd.
- *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * The Original Code is Portable Windows Library.
- *
- * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
- *
- * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
- * All Rights Reserved.
- *
- * Contributor(s): ______________________________________.
- *
- * $Log: pattern.h,v $
- * Revision 1.16 1999/03/10 03:49:52 robertj
- * More documentation adjustments.
- *
- * Revision 1.15 1999/03/09 08:01:49 robertj
- * Changed comments for doc++ support (more to come).
- *
- * Revision 1.14 1998/09/23 06:24:34 robertj
- * Added open source copyright license.
- *
- * Revision 1.13 1995/03/14 12:41:57 robertj
- * Updated documentation to use HTML codes.
- *
- * Revision 1.12 1995/01/27 11:11:41 robertj
- * Added simple pattern bitmap constructor.
- *
- * Revision 1.11 1995/01/06 10:31:05 robertj
- * Documentation.
- *
- * Revision 1.10 1994/08/23 11:32:52 robertj
- * Oops
- *
- * Revision 1.9 1994/08/22 00:46:48 robertj
- * Added pragma fro GNU C++ compiler.
- *
- * Revision 1.8 1994/06/25 11:55:15 robertj
- * Unix version synchronisation.
- *
- * Revision 1.7 1994/01/03 04:42:23 robertj
- * Mass changes to common container classes and interactors etc etc etc.
- *
- * Revision 1.6 1993/12/31 06:45:38 robertj
- * Made inlines optional for debugging purposes.
- *
- * Revision 1.5 1993/12/29 04:40:47 robertj
- * Mac port.
- *
- * Revision 1.4 1993/12/01 16:09:05 robertj
- * Windows NT port.
- *
- * Revision 1.3 1993/08/21 01:50:33 robertj
- * Made Clone() function optional, default will assert if called.
- *
- * Revision 1.2 1993/07/14 12:49:16 robertj
- * Fixed RCS keywords.
- *
- */
- #define _PPATTERN
- #ifdef __GNUC__
- #pragma interface
- #endif
- class PCanvas;
- class PPixelImage;
- /**A class representing a graphic drawing pattern for filling areas. This is
- used by the Ref{PCanvas} class when drawing enclosed shapes such as
- rectangles, ellipses etc.
-
- This is very similar to the other "pixmap" class such as Ref{PCursor}, or
- Ref{PImgIcon}, but is more specialised for the purpose of filling a
- drawable area. This is relevant to some platforms that use a special type
- for this operation (eg MacOS).
- */
- class PPattern : public PContainer
- {
- PCONTAINERINFO(PPattern, PContainer);
- public:
- /**Create a pattern, loading it from the resource. The resource is of the
- type PATTERN.
-
- If no resource identifier is specified then an empty pattern is created.
- That is a solid foreground colour is used.
- */
- PPattern();
- PPattern(
- PRESOURCE_ID resID /// Resource identifier for the pattern.
- );
- /** Type for bit array for a pattern. */
- typedef BYTE Bits[8];
- /**Create a pattern from the arbitrary set of bits.
- */
- PPattern(
- Bits bits /// Bits used for a bi-level pattern.
- );
- /**Create a pattern from the arbitrary pixel image using the canvas as the
- target device.
- */
- PPattern(
- PCanvas & canvas, /// Canvas for the device dependent image.
- const PPixelImage & pix /// Device independent image to convert.
- );
- /**@name Overrides from class PObject */
- /**Determine if the two patterns are the same. Note that this is different
- from having two patterns that merely {bf look} the same. They must
- be references to the same pattern or if loaded from resources, the same
- resource ID.
- @return
- #EqualTo# if reference the same icon,
- #GreaterThan# if different.
- */
- virtual Comparison Compare(
- const PObject & obj /// Pattern to compare against.
- ) const;
- /**@name New functions for class */
- /**Get the dimensions of the pattern.
-
- @return
- width and height of pattern.
- */
- PDim GetDimensions() const;
- private:
- // Overrides from class PContainer
- virtual BOOL SetSize(
- PINDEX size // New size of pattern container, ignored.
- );
- // Do nothing, size is always one pattern.
- #ifdef DOC_PLUS_PLUS
- };
- #endif
- // Class declaration continued in platform specific header file ///////////////