#pragma once
#include "Hash.h"
//===========================================================================//
// File:	 region.h														 //
// Project:  gosGml				                                         //
// Contents:																 //
//---------------------------------------------------------------------------//
// Date      Who    Modification                                             //
// 8/11/00   DP     ReCreated												 //
//---------------------------------------------------------------------------//
// Copyright (C) 2000 Microsoft Corp.						                 //
// All Rights reserved worldwide                                             //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL               //
//===========================================================================//


/*struct rect
{
    long Bottom;
    long Left;
    long Right;
    long Top;
};*/

struct ImageDataC //ImageData Container
{
	ImageData* I;
	rect* R;
	ImageDataC* Next;
};

class Region
{
	public:
		Region(int regionSpacing=10);//number of regions; more regions makes it faster to search but slower to create regions. also, more=more memory. try 5,10, or 20. don't do more than 30 since you won't really gain anything unless you have very long pages with tall images
		~Region();
		void AddRegion(rect* Region, ImageData* IDP);
		ImageData* TestForHit(int x, int y);
		void Clear();

	private:
		//Region(); //call me not
		Region(Region&);//don't call this
		Region& operator= (Region const &); //don't call the assignment operator
		int UID;

		Hash<ImageDataC*,int>* H; //hash table, each item is a pointer to the head of a linked list of images
		int RegionSpacing;
};



