#!/usr/bin/env python
"""
Footprint PCB layouting program
Copyright (C) 2012 Danny Milosavljevic
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""

# it is recommended that all the length and position values are in mm.

class Canvas(object):
	def __init__(self, items, connections):
		self.items = items
		self.connections = connections

class Item(object):
	def __init__(self, name, rect, layer = None):
		self.rect = rect
		self.name = intern(name)
		self.layer = layer
	def repaint(self, area): # these are supposed to return a list of metafile commands.
		return []

class Group(Item):
	def __init__(self, name, rect, layer = None, members = set()):
		Item.__init__(self, name, rect, layer)
		self.members = members
	def repaint(self, area): # these are supposed to return a list of metafile commands.
		result = []
		for x in self.members:
			result.extend(x.repaint())

class Connection(object):
	def __init__(self, items):
		self.items = items
	def repaint(self, area): # these are supposed to return a list of metafile commands.
		return []

