[pitivi/ges: 284/287] viewer: Document _store_pixbuf and do_realize methods
- From: Jean-FranÃois Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi/ges: 284/287] viewer: Document _store_pixbuf and do_realize methods
- Date: Thu, 15 Mar 2012 16:49:44 +0000 (UTC)
commit 7d69607c98f743c8538ea7756d8d8d0b19a2fac6
Author: Jean-FranÃois Fortin Tam <nekohayo gmail com>
Date: Wed Feb 15 22:40:34 2012 -0500
viewer: Document _store_pixbuf and do_realize methods
pitivi/viewer.py | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/viewer.py b/pitivi/viewer.py
index b86d780..d1dd07c 100644
--- a/pitivi/viewer.py
+++ b/pitivi/viewer.py
@@ -902,8 +902,13 @@ class ViewerWidget(gtk.DrawingArea, Loggable):
self.transformation_properties = transformation_properties
def _store_pixbuf(self):
+ """
+ When not playing, store a pixbuf of the current viewer image.
+ This will allow it to be restored for the transformation box.
+ """
colormap = self.window.get_colormap()
if self.box and self.zoom != 1.0:
+ # The transformation box is active and dezoomed
# crop away 1 pixel border to avoid artefacts on the pixbuf
pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, 0, 8,
self.box.area.width - 2,
@@ -915,6 +920,7 @@ class ViewerWidget(gtk.DrawingArea, Loggable):
self.box.area.width - 2,
self.box.area.height - 2)
else:
+ # Normal mode
pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB,
0, 8, *self.window.get_size())
self.pixbuf = pixbuf.get_from_drawable(self.window, colormap,
@@ -922,6 +928,10 @@ class ViewerWidget(gtk.DrawingArea, Loggable):
self.stored = True
def do_realize(self):
+ """
+ Redefine gtk DrawingArea's do_realize method to handle multiple OSes.
+ This is called when creating the widget to get the window ID.
+ """
gtk.DrawingArea.do_realize(self)
if platform.system() == 'Windows':
self.window_xid = self.window.handle
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]