Commit 774b440e authored by Edward Hervey's avatar Edward Hervey

* pitivi/check.py:

Added check for autodetect plugins existence.
* pitivi/bin.py:
* pitivi/discoverer.py:
* pitivi/effects.py:
* pitivi/pitivi.py:
* pitivi/playground.py:
* pitivi/project.py:
* pitivi/settings.py:
* pitivi/sourcelist.py:
* pitivi/ui/mainwindow.py:
* pitivi/ui/viewer.py:
Better debug levels
* pitivi/timeline.py:
gnlfilesource is only used by TimelineFileSource
Added more signals to TimelineComposition
* pitivi/ui/Makefile.am:
* pitivi/ui/complexinterface.py:
* pitivi/ui/complexsource.py:
* pitivi/ui/ruler.py:
Added complexinterface.py, complexsource.py and ruler.py
* pitivi/ui/complexlayer.py:
* pitivi/ui/complexstack.py:
* pitivi/ui/complextimeline.py:
Better designed ComplexTimeline, layer and tracks
* pitivi/ui/timeline.py:
CTRL + scroll does vertical scrolling in complex timeline.
* pitivi/ui/timelineobjects.py:
ooops, don't need pango anymore


git-svn-id: svn+ssh://svn.gnome.org/svn/pitivi/trunk@686 d3729300-e425-0410-8a4c-d956edccc248
parent d4026f68
2006-02-06 Edward Hervey <edward@fluendo.com>
* pitivi/check.py:
Added check for autodetect plugins existence.
* pitivi/bin.py:
* pitivi/discoverer.py:
* pitivi/effects.py:
* pitivi/pitivi.py:
* pitivi/playground.py:
* pitivi/project.py:
* pitivi/settings.py:
* pitivi/sourcelist.py:
* pitivi/ui/mainwindow.py:
* pitivi/ui/viewer.py:
Better debug levels
* pitivi/timeline.py:
gnlfilesource is only used by TimelineFileSource
Added more signals to TimelineComposition
* pitivi/ui/Makefile.am:
* pitivi/ui/complexinterface.py:
* pitivi/ui/complexsource.py:
* pitivi/ui/ruler.py:
Added complexinterface.py, complexsource.py and ruler.py
* pitivi/ui/complexlayer.py:
* pitivi/ui/complexstack.py:
* pitivi/ui/complextimeline.py:
Better designed ComplexTimeline, layer and tracks
* pitivi/ui/timeline.py:
CTRL + scroll does vertical scrolling in complex timeline.
* pitivi/ui/timelineobjects.py:
ooops, don't need pango anymore
2006-01-27 Edward Hervey <edward@fluendo.com>
* pitivi/Makefile.am:
......
......@@ -34,7 +34,7 @@ class SmartBin(gst.Pipeline):
height = 0
def __init__(self, name, displayname=""):
gst.info('name : %s, displayname : %s' % (name, displayname))
gst.log('name : %s, displayname : %s' % (name, displayname))
gobject.GObject.__init__(self)
self.name = name
self.displayname = displayname
......@@ -132,7 +132,7 @@ class SmartFileBin(SmartBin):
"""
def __init__(self, factory):
gst.debug("new SmartFileBin for factory:%s, audio:%s, video:%s" % (factory, factory.is_audio, factory.is_video))
gst.log("new SmartFileBin for factory:%s, audio:%s, video:%s" % (factory, factory.is_audio, factory.is_video))
self.factory = factory
self.has_video = factory.is_video
self.has_audio = factory.is_audio
......@@ -177,7 +177,7 @@ class SmartTimelineBin(SmartBin):
"""
def __init__(self, project):
gst.info("new SmartTimelineBin for project %s" % project)
gst.log("new SmartTimelineBin for project %s" % project)
self.project = project
# TODO : change this to use the project settings
......@@ -186,7 +186,7 @@ class SmartTimelineBin(SmartBin):
self.width = project.settings.videowidth
self.height = project.settings.videoheight
self.info("source is %s" % project.timeline.timeline)
self.log("source is %s" % project.timeline.timeline)
self.source = project.timeline.timeline
self.project.settings.connect("settings-changed", self._settings_changed_cb)
project.timeline.videocomp.connect("start-duration-changed", self._start_duration_changed)
......@@ -313,7 +313,7 @@ class SmartDefaultBin(SmartBin):
"""
def __init__(self):
gst.info("Creating new smartdefaultbin")
gst.log("Creating new smartdefaultbin")
self.videotestsrc = gst.element_factory_make("videotestsrc", "vtestsrc")
self.silence = gst.element_factory_make("audiotestsrc", "silence")
self.silence.set_property("wave", 4)
......
......@@ -42,7 +42,11 @@ def initial_checks():
sys.exit()
def _checks():
if not gst.registry_get_default().find_plugin("gnonlin"):
reg = gst.registry_get_default()
if not reg.find_plugin("gnonlin"):
return ("Could not find the GNonLin plugins!",
"Make sure the plugins were installed and are available in the GStreamer plugins path")
if not reg.find_plugin("autodetect"):
return ("Could not find the autodetect plugins!",
"Make sure you have installed gst-plugins-good and is available in the GStreamer plugin path")
return None
......@@ -54,7 +54,7 @@ class Discoverer(gobject.GObject):
}
def __init__(self, project):
gst.info("new discoverer for project %s" % project)
gst.log("new discoverer for project %s" % project)
gobject.GObject.__init__(self)
self.project = project
self.queue = []
......
......@@ -39,7 +39,7 @@ class Magician:
"""
def __init__(self, pitivi):
gst.info("New Magician")
gst.log("New Magician")
self.pitivi = pitivi
self.simple_video = []
self.simple_audio = []
......
......@@ -59,7 +59,7 @@ class Pitivi(gobject.GObject):
"""
initialize pitivi with the command line arguments
"""
gst.info("starting up pitivi...")
gst.log("starting up pitivi...")
gobject.GObject.__init__(self)
# TODO parse cmd line arguments
......
......@@ -54,7 +54,7 @@ class PlayGround(gobject.GObject):
}
def __init__(self):
gst.info("Starting up playground")
gst.log("Starting up playground")
gobject.GObject.__init__(self)
# List of used pipelines
self.pipelines = []
......@@ -235,9 +235,8 @@ class PlayGround(gobject.GObject):
if not self.current or not self.asinkthread or not self.vsinkthread:
gst.warning("returning ???")
return
gst.debug("setting to play")
self.state = gst.STATE_PLAYING
gst.info("%s" % self.current.set_state(self.state))
gst.log("%s" % self.current.set_state(self.state))
## gst.debug("set_state() done, getting state now")
## value = self.current.get_state(None)
## gst.debug("got_state : %s" % str(value))
......
......@@ -46,7 +46,7 @@ class Project(gobject.GObject):
name : the name of the project
uri : the uri of the project
"""
gst.info("name:%s, uri:%s" % (name, uri))
gst.log("name:%s, uri:%s" % (name, uri))
gobject.GObject.__init__(self)
self.name = name
self.uri = uri
......
......@@ -115,7 +115,7 @@ def available_muxers():
for fact in flist:
if "Codec/Muxer" == fact.get_klass():
res.append(fact)
gst.info(str(res))
gst.log(str(res))
return res
def available_video_encoders():
......@@ -125,7 +125,7 @@ def available_video_encoders():
for fact in flist:
if "Codec/Encoder/Video" in fact.get_klass():
res.append(fact)
gst.info(str(res))
gst.log(str(res))
return res
def available_audio_encoders():
......@@ -135,7 +135,7 @@ def available_audio_encoders():
for fact in flist:
if "Codec/Encoder/Audio" in fact.get_klass():
res.append(fact)
gst.info(str(res))
gst.log(str(res))
return res
def encoders_muxer_compatible(encoders, muxer):
......
......@@ -49,7 +49,7 @@ class SourceList(gobject.GObject):
}
def __init__(self, project):
gst.info("new sourcelist for project %s" % project)
gst.log("new sourcelist for project %s" % project)
gobject.GObject.__init__(self)
self.project = project
self.sources = {}
......
......@@ -55,7 +55,7 @@ class Timeline(gobject.GObject):
# for the time being we hardcode an audio and a video composition
def __init__(self, project):
gst.info("new Timeline for project %s" % project)
gst.log("new Timeline for project %s" % project)
gobject.GObject.__init__(self)
self.project = project
......@@ -127,7 +127,7 @@ class TimelineObject(gobject.GObject):
def __init__(self, factory=None, start=-1, duration=-1,
media_type=MEDIA_TYPE_NONE, name=""):
gobject.GObject.__init__(self)
gst.info("new TimelineObject :%s" % name)
gst.log("new TimelineObject :%s" % name)
self.start = -1
self.duration = -1
self.linked = None
......@@ -252,20 +252,6 @@ class TimelineSource(TimelineObject):
def __init__(self, **kw):
TimelineObject.__init__(self, **kw)
def _make_gnl_object(self):
if self.media_type == MEDIA_TYPE_AUDIO:
caps = gst.caps_from_string("audio/x-raw-int;audio/x-raw-float")
elif self.media_type == MEDIA_TYPE_VIDEO:
caps = gst.caps_from_string("video/x-raw-yuv;video/x-raw-rgb")
else:
raise NameError, "media type is NONE !"
self.factory.lastbinid = self.factory.lastbinid + 1
self.gnlobject = gst.element_factory_make("gnlfilesource", "source-" + self.name + str(self.factory.lastbinid))
self.gnlobject.set_property("location", self.factory.name)
self.gnlobject.set_property("caps", caps)
self.gnlobject.set_property("start", long(0))
self.gnlobject.set_property("duration", long(self.factory.length))
class TimelineFileSource(TimelineSource):
......@@ -291,6 +277,20 @@ class TimelineFileSource(TimelineSource):
media_duration = self.factory.length
self.set_media_start_duration_time(media_start, media_duration)
def _make_gnl_object(self):
if self.media_type == MEDIA_TYPE_AUDIO:
caps = gst.caps_from_string("audio/x-raw-int;audio/x-raw-float")
elif self.media_type == MEDIA_TYPE_VIDEO:
caps = gst.caps_from_string("video/x-raw-yuv;video/x-raw-rgb")
else:
raise NameError, "media type is NONE !"
self.factory.lastbinid = self.factory.lastbinid + 1
self.gnlobject = gst.element_factory_make("gnlfilesource", "source-" + self.name + str(self.factory.lastbinid))
self.gnlobject.set_property("location", self.factory.name)
self.gnlobject.set_property("caps", caps)
self.gnlobject.set_property("start", long(0))
self.gnlobject.set_property("duration", long(self.factory.length))
def _make_brother(self):
""" make the brother element """
self.gnlobject.info("making filesource brother")
......@@ -391,13 +391,52 @@ class TimelineComposition(TimelineSource):
* Signals:
_ 'condensed-list-changed' : condensed list
_ 'global-effect-added' : a global-effect was added to the composition
_ 'global-effect-removed' : a global-effect was removed from the composition
_ 'simple-effect-added' : a simple-effect was added to the composition
_ 'simple-effect-removed' : a simple-effect was removed from the composition
_ 'complex-effect-added' : a complex-effect was added to the composition
_ 'complex-effect-removed' : a complex-effect was removed from the composition
_ 'transition-added' : a transition was added to the composition
_ 'transition-removed' : a transitions was removed from the composition
_ 'source-added' : a TimelineSource was added to the composition
_ 'source-removed' : a TimelineSource was removed from the composition
"""
__gsignals__ = {
'condensed-list-changed' : ( gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_PYOBJECT, ))
(gobject.TYPE_PYOBJECT, )),
'global-effect-added' : ( gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_PYOBJECT, )),
'global-effect-removed' : ( gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_PYOBJECT, )),
'simple-effect-added' : ( gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_PYOBJECT, )),
'simple-effect-removed' : ( gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_PYOBJECT, )),
'complex-effect-added' : ( gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_PYOBJECT, )),
'complex-effect-removed' : ( gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_PYOBJECT, )),
'transitions-added' : ( gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_PYOBJECT, )),
'transition-removed' : ( gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_PYOBJECT, )),
'source-added' : ( gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_PYOBJECT, )),
'source-removed' : ( gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_PYOBJECT, )),
}
global_effects = [] # list of effects starting from highest priority
......@@ -624,6 +663,7 @@ class TimelineComposition(TimelineSource):
self.linked.add_source(source.brother, position, auto_linked=False)
self.gnlobject.info("added source %s" % source.gnlobject)
gst.info("%s" % str(self.sources))
self.emit('source-added', source)
def insert_source_after(self, source, existingsource, push_following=True, auto_linked=True):
"""
......
......@@ -4,7 +4,9 @@ ui_PYTHON = \
__init__.py \
complexlayer.py \
complexstack.py \
complexsource.py \
complextimeline.py \
complexinterface.py \
exportsettingswidget.py \
glade.py \
gstwidget.py \
......@@ -14,6 +16,7 @@ ui_PYTHON = \
timeline.py \
timelineobjects.py \
viewer.py \
ruler.py \
plumber.py
ui_DATA = \
......
#!/usr/bin/python
# PiTiVi , Non-linear video editor
#
# pitivi/ui/complexlayer.py
#
# Copyright (c) 2006, Edward Hervey <bilboed@bilboed.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
import gst
#
# Complex Timeline interfaces v1 (01 Feb 2006)
#
#
# ZoomableWidgetInterface
# -----------------------
# Interface for the Complex Timeline widgets for setting, getting,
# distributing and modifying the zoom ratio and the size of the widget.
#
# A zoomratio is the number of pixels per second
# ex : 10.0 = 10 pixels for a second
# ex : 0.1 = 1 pixel for 10 seconds
# ex : 1.0 = 1 pixel for a second
#
# Methods:
# . set_zoomratio(ratio)
# . get_zoomratio(ratio)
# . pixel_to_ns(pixels)
# . ns_to_pixels(time)
# . get_pixel_width()
#
#
# LayeredWidgetInterface
# ----------------
# Interface for 'layered' widgets.
# The layers correspond to the top-level Composition of the Timeline Model.
# It's purpose is to handle the contained layers' height and position
# It uses the LayerInfoList which is shared across the various widgets
# implementing the LayeredInterface, so that those widgets have layers which
# are synchronized (in height, number and content).
#
# The widgets implementing this interface should use it's methods to request
# expansion/resize/adding of layers, and should implement the needed virtual
# methods for actually resizing the layers.
#
# . set_layerinfo(layerinfo)
# . expand_layer(layerposition, boolean)
# . change_layer_height(layerposition, newheight)
# . layer_expanded(layerposition, boolean) Implement
# . layer_height_changed(layerposition, newheight)
# . add_layer(layerposition, composition)
#
class ZoomableWidgetInterface:
zoomratio = 10.0
def get_pixel_width(self):
"""
Returns the width in pixels corresponding to the duration of the object
"""
dur = self.get_duration()
width = self.ns_to_pixel(dur)
gst.log("Got time %s, returning width : %d" % (gst.TIME_ARGS(dur), width))
return width
def get_pixel_position(self):
"""
Returns the pixel offset of the widget in it's container, according to:
_ the start position of the object in it's timeline container,
_ and the set zoom ratio
"""
start = self.get_start_time()
pos = self.ns_to_pixel(start)
gst.log("Got start time %s, returning offset %d" % (gst.TIME_ARGS(start), pos))
return pos
def pixel_to_ns(self, pixel):
"""
Returns the pixel equivalent in nanoseconds according to the zoomratio
"""
return int(pixel * gst.SECOND / self.zoomratio)
def ns_to_pixel(self, duration):
"""
Returns the pixel equivalent of the given duration, according to the
set zoom ratio
"""
if duration == gst.CLOCK_TIME_NONE:
return 0
return int((float(duration) / gst.SECOND) * self.zoomratio)
def get_duration(self):
"""
Return the duration in nanoseconds of the object
To be implemented by subclasses
"""
raise NotImplementedError
def get_start_time(self):
"""
Return the start time in nanosecond of the object
To be implemented by subclasses
"""
raise NotImplementedError
def duration_changed(self):
self.queue_resize()
def start_changed(self):
self.queue_resize()
def start_duration_changed(self):
gst.info("start/duration changed")
self.queue_resize()
def get_zoom_ratio(self):
return self.zoomratio
def set_zoom_ratio(self, zoomratio):
if self.zoomratio == zoomratio:
return
gst.debug("Changing zoomratio to %f" % zoomratio)
self.zoomratio = zoomratio
self.zoomChanged()
def zoomChanged(self):
raise NotImplementedError
class LayeredWidgetInterface:
def __init__(self, infolist):
self.layerinfolist = None
self.__expandedSig = 0
self.__heightChangedSig = 0
self.__addedSig = 0
self.__removedSig = 0
self.setLayerInfoList(infolist)
def setLayerInfoList(self, infolist):
""" set the LayerInfoList and connect the signal handlers """
if self.layerinfolist:
# remove existing signal handlers
for sigid in [self.__expandedSig, self.__heightChangedSig,
self.__addedSig, self.__removedSig]:
self.layerinfolist.disconnect(sigid)
# save list and set signal handlers
self.layerinfolist = infolist
self.__expandedSig = self.layerinfolist.connect('layer-expanded',
self.__expanded_cb)
self.__heightChangedSig = self.layerinfolist.connect('layer-height-changed',
self.__layer_height_changed_cb)
self.__addedSig = self.layerinfolist.connect('layer-added',
self.__layer_added_cb)
self.__removedSig = self.layerinfolist.connect('layer-removed',
self.__layer_removed_cb)
gst.info("calling layerAdded for all the existing layers")
for i in range(len(self.layerinfolist)):
self.layerAdded(i)
def expandLayer(self, layerposition, expanded):
""" expand (or reduce) the layer at given position """
self.layerinfolist.expandLayer(layerposition, expanded)
def changeLayerHeight(self, layerposition, height):
""" set the layer at the given position to the requested height """
pass
def __expanded_cb(self, list, layerposition, expanded):
self.layerExpanded(layerposition, expanded)
def __layer_height_changed_cb(self, list, layerposition):
self.layerHeightChanged(layerposition)
def __layer_added_cb(self, list, position):
self.layerAdded(position)
def __layer_removed_cb(self, list, position):
self.layerRemoved(position)
def layerExpanded(self, layerposition, expanded):
raise NotImplementedError
def layerHeightChanged(self, layerposition):
raise NotImplementedError
def layerAdded(self, position):
"""
A layer was added, position is the position where it was added
"""
raise NotImplementedError
def layerRemoved(self, position):
"""
A layer was removed, position is the position where it previously was
"""
raise NotImplementedError
#!/usr/bin/python
# PiTiVi , Non-linear video editor
#
# pitivi/ui/timeline.py
# pitivi/ui/complexlayer.py
#
# Copyright (c) 2005, Edward Hervey <bilboed@bilboed.com>
# Copyright (c) 2006, Edward Hervey <bilboed@bilboed.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
......@@ -21,69 +21,243 @@
# Boston, MA 02111-1307, USA.
import gtk
import gobject
import gst
class ComplexTimelineLayer(gtk.Layout):
__gsignals__ = {"expose-event":"override",
"size-request":"override"
}
from complexinterface import ZoomableWidgetInterface
minwidth = 100
#
# Layer system v1 (01 Feb 2006)
#
#
# The layer information are stored in a LayerInfo.
# The complete layers information is stored in a LayerInfoList which is a
# standard python list with signals capabilities.
#
# LayerInfo
# ---------
# Contents:
# . composition (Model.TimelineComposition)
# . expanded (boolean, default=True)
# . currentHeight (pixels)
# . minimumHeight (pixels)
# . previousHeight (pixels)
#
#
# LayerInfoList (gobject.GObject)
# -------------------------------
# Provides the common python list accessors
# Signals:
# . 'layer-expanded' (layerposition (int), expanded (boolean))
# The given layer is now expanded or not
# . 'layer-height-changed' (layerposition (int))
# The given layer's height has changed
# . 'layer-added'
# A layer was added
# . 'layer-removed'
# A layer was removed
#
def __init__(self, composition):
gtk.Layout.__init__(self)
class LayerInfo:
""" Information on a layer for the complex timeline widgets """
def __init__(self, composition, minimumHeight,
expanded=True, currentHeight=None,
yposition=0):
"""
If currentHeight is None, it will be set to the given minimumHeight.
"""
self.composition = composition
self.minimumHeight = minimumHeight
self.expanded = expanded
self.yposition = 0
self.currentHeight = currentHeight or self.minimumHeight
self.previousHeight = self.minimumHeight
class LayerInfoList(gobject.GObject):
""" List, on steroids, of the LayerInfo"""
__gsignals__ = {
'layer-expanded' : ( gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
( gobject.TYPE_INT, gobject.TYPE_BOOLEAN )),
'layer-height-changed' : ( gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
( gobject.TYPE_INT, )),
'layer-added' : ( gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
( gobject.TYPE_INT, ) ),
'layer-removed' : ( gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
( gobject.TYPE_INT, ) ),
}
__defaultLayerMinimumHeight = 20
__defaultLayerHeight = 50
def __init__(self, timeline, layerminimumheight=None):
gobject.GObject.__init__(self)
self.timeline = timeline
self.layerMinimumHeight = layerminimumheight or self.__defaultLayerMinimumHeight
self.totalHeight = 0
self.topSizeGroup = gtk.SizeGroup(gtk.SIZE_GROUP_VERTICAL)
self._list = []
self.__fillList()
def __fillList(self):
gst.debug("filling up LayerInfoList")
self.addComposition(self.timeline.videocomp)
self.addComposition(self.timeline.audiocomp, minimumHeight=50)
def addComposition(self, composition, pos=-1, minimumHeight=None):
"""
Insert the composition at the given position (default end)
Returns the created LayerInfo
"""
gst.debug("adding a LayerInfo for composition %r" % composition)
if self.findCompositionLayerInfo(composition):
gst.warning("composition[%r] is already controlled!" % composition)
return
layer = LayerInfo(composition, minimumHeight or self.layerMinimumHeight)
if pos == -1:
self._list.append(layer)
else:
self._list.insert(pos, layer)
self.totalHeight += layer.currentHeight
self.recalculatePositions()
self.emit('layer-added', pos)
return layer
def removeComposition(self, composition):
"""
Remove the given composition from the List
Returns True if it was removed
"""
layer = self.findCompositionLayerInfo(composition)
if not layer:
gst.warning("composition[%r] is not controlled by LayerInfoList" % composition)
return False
position = self._list.index(layer)
self._list.remove(layer)
self.totalHeight -= layer.currentHeight
self.recalculatePositions()
self.emit('layer-removed', position)
def findCompositionLayerInfo(self, composition):
""" Returns the LayerInfo corresponding to the given composition """
for layer in self._list:
if layer.composition == composition:
return layer
return None
def recalculatePositions(self):
""" Recalculate the Y Position of each layer """
ypos = 0
for layer in self._list:
layer.yposition = ypos
ypos += layer.currentHeight
def __iter__(self):
return self._list.__iter__()
def __len__(self):
return self._list.__len__()
def __getitem__(self, y):
return self._list.__getitem__(y)
def expandLayer(self, position, expanded):
""" expand (or reduce) the layer at given position """
try:
layer = self._list[position]
except:
return
if layer.expanded == expanded:
return
layer.expanded = expanded
## def do_size_allocate(self, allocation):
## print "layer allocation", list(allocation)
## self.allocation = allocation
## if self.flags() & gtk.REALIZED:
## self.window.move_resize(*allocation)
def do_size_reque