www.pudn.com > uoth_src.zip > Region.h
#ifndef DSSI_REGION_H #define DSSI_REGION_H //----------------------------------------------------------------------------- // // @doc // // @module Region.h - Region information | // // This module contains the region information // // Copyright (c) 2002 - Descartes Systems Sciences, Inc. // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // 2. Neither the name of Descartes Systems Sciences, Inc nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // @end // // $History: ExpatImpl.h $ // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // // Required include files // //----------------------------------------------------------------------------- #include#include "ExpatImpl.h" #include "uoth.h" //----------------------------------------------------------------------------- // // Forward definitions // //----------------------------------------------------------------------------- class CDataParser; //----------------------------------------------------------------------------- // // Class definition // //----------------------------------------------------------------------------- class CRegion { public: enum _Element { Unknown = 0, Region = 1, Name = 2, MaskOffset = 3, MaskHitTest = 4, Comment = 5, }; enum _Constants { Max_Region = 100, }; // @access Constructors and destructors public: // @cmember General constructor CRegion (); // @cmember General destructor ~CRegion (); // @cmember Public methods public: // @cmember Initialize void Init (bool fConstruct); // @cmember Start a treasure void OnStart (CDataParser *pParser, const XML_Char **papszAttrs); // @cmember Start an XML element void OnStartElement (CDataParser *pParser, const XML_Char *pszName, const XML_Char **papszAttrs); // @cmember End an XML element void OnEndElement (CDataParser *pParser, const XML_Char *pszName); // @cmember Get information about the Treasure CString GetInformation (bool fTerse); // @cmember Public inline methods public: // @cmember Is this region valid bool IsValid () const { return m_nIndex > 0; } // @cmember Public static methods public: // @cmember Get next region static int GetNext (int nRegion, bool fForward, CFilter *pFilter); // @cmember Load the masks static bool LoadMasks (unzFile fpZip); // @access Protected methods protected: // @cmember Get the element number _Element GetElement (const XML_Char *pszName); // @access Public members public: // Defined int m_nIndex; int m_x, m_y; bool m_fInRect; CString m_strName; CString m_strComment; // Computed CRect m_rect; unsigned char *m_paucPixels; int m_nWidthBytes; static CAtlArray gm_vRegions; }; #endif // DSSI_REGION_H