




function GHU_PageLayout()
	local class = GHClass("GHU_PageLayout");
	
	local areas = {linked={},floating={},};
	
	class.AddArea = function(self,areaType,width,height,xOff,yOff)
		if areaType == "linked" then
			table.insert(areas.linked,{width,height,xOff,yOff});
		elseif areaType == "floating" then
			table.insert(areas.floating,{width,height,xOff,yOff});
		else
			error("Unknown area type",areaType);
		end
			
	end
	class.ApplyAreas = function(self,page,font)
		assert(page.IsClass and page:IsClass("GHU_Page"),"Can only apply page layout to a page",page.GetType and page:GetType())
		assert(page:GetNumAreas() == 0,"Page is not empty");
		
		for areaType,t in pairs(areas) do
			for _,list in pairs(t) do
				local width,height,xOff,yOff = unpack(list);			
									
				local area = GHU_Area(page,width,height,xOff,yOff);
				page:InsertArea(area);
				local line = GHU_Line(area,width);
				area:InsertLine(line);
				local text = GHU_Text(line);
				text:SetFont(font);
				text:SetText("It is, however, one of those times where a desire for amusement comes together with a touch of creativity to form amusement. During the life of GHI, many interresting gadgets and items have been produced and shared. Codes have been written and new ideas have come to life through the art of creation. But once in a while, we are blessed to notice that something more than just standard items are made by users with great feeling and touch of the AddOn. And such event has occoured now.");
				line:InsertObject(text);
				
			end
		end
		
		
	end
	
	return class;
end











