view/base.py

Go to the documentation of this file.
00001 #
00002 # Base classes
00003 #
00004 # Copyright (c) 2006 Cristian L. Vlasceanu
00005 #
00006 # Permission is hereby granted, free of charge, to any person
00007 # obtaining a copy of this software and associated documentation
00008 # files (the "Software"), to deal in the Software without
00009 # restriction, including without limitation the rights to use,
00010 # copy, modify, merge, publish, distribute, sublicense, and/or
00011 # sell copies of the Software, and to permit persons to whom
00012 # the Software is furnished to do so, subject to the following
00013 # conditions:
00014 # 
00015 # The above copyright notice and this permission notice shall be
00016 # included in all copies or substantial portions of the Software.
00017 # 
00018 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
00019 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00020 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
00021 # AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
00022 # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
00023 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00024 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
00025 # OR OTHER DEALINGS IN THE SOFTWARE.
00026 # 
00027 # NOTE: The above applies solely to Python source code provided 
00028 # herein, and it DOES NOT COVER the Zero Debugger Engine and plug-ins.
00029 #
00030 import gobject
00031 
00032 class Base(gobject.GObject):
00033         def __init__(self):
00034                 gobject.GObject.__init__(self)
00035 
00036 
00037 class Composite(Base):
00038         """
00039         A collection of views
00040         """
00041         def __init__(self):
00042                 Base.__init__(self)
00043                 self.__views = []
00044 
00045         def add(self, view):
00046                 self.__views.append(view)
00047 
00048         def update(self, event):
00049                 for v in self.__views:
00050                         v.update(event)
00051 
00052         def clear(self):
00053                 for v in self.__views:
00054                         v.clear()
00055