diff --git a/0001-Add-man-page.patch b/0001-Add-man-page.patch new file mode 100644 index 0000000..98fc62c --- /dev/null +++ b/0001-Add-man-page.patch @@ -0,0 +1,99 @@ +From cee0a39712e8aa42642364fca1fbe77dab905ba4 Mon Sep 17 00:00:00 2001 +From: Hicham HAOUARI +Date: Wed, 8 Dec 2010 15:12:40 +0000 +Subject: [PATCH] Add man page + +--- + Makefile.am | 5 ++++- + pitivi.1 | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 60 insertions(+), 1 deletions(-) + create mode 100644 pitivi.1 + +diff --git a/Makefile.am b/Makefile.am +index a011e1e..8cd3ebb 100755 +--- a/Makefile.am ++++ b/Makefile.am +@@ -10,6 +10,8 @@ desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) + mimedir = $(datadir)/mime/packages + mime_DATA = pitivi.xml + ++man_MANS = pitivi.1 ++ + EXTRA_DIST = \ + pitivi.spec \ + pitivi.spec.in \ +@@ -36,7 +38,8 @@ EXTRA_DIST += \ + intltool-extract.in \ + intltool-merge.in \ + intltool-update.in \ +- $(desktop_in_files) ++ $(desktop_in_files) \ ++ $(man_MANS) + + + locale-uninstalled: +diff --git a/pitivi.1 b/pitivi.1 +new file mode 100644 +index 0000000..61e0fd8 +--- /dev/null ++++ b/pitivi.1 +@@ -0,0 +1,56 @@ ++.\" Copyright (C) 2010 The GNOME Foundation ++.\" ++.\" This is free software; you may 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 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. ++.TH pitivi 1 "2010\-12\-08" "GNOME" ++.SH NAME ++pitivi \- Non-linear video editor ++.SH SYNOPSIS ++.B pitivi ++.RI [PROJECT_FILE] ++.P ++.B pitivi ++.RI -i ++.RI [-a] ++.RI [MEDIA_FILE]... ++.SH DESCRIPTION ++.B pitivi ++is a free, intuitive and featureful movie editor for the Linux desktop. ++.P ++.B pitivi ++starts the video editor, optionally loading PROJECT_FILE. If no project is ++given, pitivi creates a new project. Alternatively, when -i is specified, ++arguments are treated as clips to be imported into the project. If -a is ++specified, these clips will also be added to the end of the project timeline. ++.SH OPTIONS ++.TP ++.B \-h, \-\-help ++Show help message and exit ++.TP ++.B \-i, \-\-import ++Import each MEDIA_FILE into the project ++.TP ++.B \-a, \-\-add-to-timeline ++Add each MEDIA_FILE to timeline after importing ++.TP ++.B \-d, \-\-debug ++Run pitivi in the Python Debugger ++.TP ++.B \-n, \-\-no-ui ++Run pitivi with no gui ++.SH AUTHOR ++This manual page was written by Hicham HAOUARI , ++for the Fedora project (but may be used by others). ++.SH BUGS ++Please report bugs to http://bugzilla.gnome.org/enter_bug.cgi?product=pitivi +-- +1.7.3.3 + diff --git a/0001-backport-canvas-fixes-to-0.13.5.patch b/0001-backport-canvas-fixes-to-0.13.5.patch new file mode 100644 index 0000000..851900f --- /dev/null +++ b/0001-backport-canvas-fixes-to-0.13.5.patch @@ -0,0 +1,253 @@ +From df2ffd5fbdaf487957b83696e29f1ab3430aea4c Mon Sep 17 00:00:00 2001 +From: Alessandro Decina +Date: Mon, 4 Oct 2010 15:02:49 +0200 +Subject: [PATCH] backport canvas fixes to 0.13.5 + +--- + pitivi/ui/controller.py | 3 +++ + pitivi/ui/preview.py | 7 ++++--- + pitivi/ui/previewer.py | 9 +++++---- + pitivi/ui/timeline.py | 33 +++++++++++++++------------------ + pitivi/ui/timelinecanvas.py | 32 +++++++++++--------------------- + pitivi/ui/trackobject.py | 10 ++++++---- + 6 files changed, 44 insertions(+), 50 deletions(-) + +diff --git a/pitivi/ui/controller.py b/pitivi/ui/controller.py +index 685cc2f..57bbb55 100644 +--- a/pitivi/ui/controller.py ++++ b/pitivi/ui/controller.py +@@ -166,6 +166,9 @@ class Controller(object): + def _event_common(self, item, target, event): + if not self._canvas: + self._canvas = item.get_canvas() ++ # might there be a better way to do this? ++ self._hadj = self._canvas.app.gui.timeline.hadj ++ self._vadj = self._canvas.app.gui.timeline.vadj + self._last_event = event + s = event.get_state() + self._shift_down = s & gtk.gdk.SHIFT_MASK +diff --git a/pitivi/ui/preview.py b/pitivi/ui/preview.py +index 196f1c7..0b2b65e 100644 +--- a/pitivi/ui/preview.py ++++ b/pitivi/ui/preview.py +@@ -49,6 +49,8 @@ class Preview(goocanvas.ItemSimple, goocanvas.Item, Zoomable): + self.height = float(height) + self.element = element + self.props.pointer_events = False ++ # ghetto hack ++ self.hadj = instance.gui.timeline.hadj + + ## properties + +@@ -100,12 +102,11 @@ class Preview(goocanvas.ItemSimple, goocanvas.Item, Zoomable): + border_width), self.height) + + def do_simple_paint(self, cr, bounds): +- +- ++ x1 = -self.hadj.get_value() + cr.identity_matrix() + if self.element.factory: + self.previewer.render_cairo(cr, intersect(self.bounds, bounds), +- self.element, self.bounds.y1) ++ self.element, x1, self.bounds.y1) + + def do_simple_is_item_at(self, x, y, cr, pointer_event): + return (between(0, x, self.nsToPixel(self.element.duration)) and +diff --git a/pitivi/ui/previewer.py b/pitivi/ui/previewer.py +index a356542..ce84c3d 100644 +--- a/pitivi/ui/previewer.py ++++ b/pitivi/ui/previewer.py +@@ -154,7 +154,7 @@ class Previewer(Signallable, Loggable): + self.default_thumb = cairo.ImageSurface.create_from_png(path) + self._connectSettings(instance.settings) + +- def render_cairo(self, cr, bounds, element, y1): ++ def render_cairo(self, cr, bounds, element, hscroll_pos, y1): + """Render a preview of element onto a cairo context within the current + bounds, which may or may not be the entire object and which may or may + not intersect the visible portion of the object""" +@@ -165,7 +165,7 @@ class Previewer(Signallable, Loggable): + + class DefaultPreviewer(Previewer): + +- def render_cairo(self, cr, bounds, element, y1): ++ def render_cairo(self, cr, bounds, element, hscroll_pos, y1): + # TODO: draw a single thumbnail + pass + +@@ -207,7 +207,7 @@ class RandomAccessPreviewer(Previewer): + + ## public interface + +- def render_cairo(self, cr, bounds, element, y1): ++ def render_cairo(self, cr, bounds, element, hscroll_pos, y1): + if not self._view: + return + # The idea is to conceptually divide the clip into a sequence of +@@ -229,7 +229,8 @@ class RandomAccessPreviewer(Previewer): + # tdur = duration in ns of thumbnail + # sof = start of file in pixel coordinates + x1 = bounds.x1; +- sof = Zoomable.nsToPixel(element.start - element.in_point) ++ sof = Zoomable.nsToPixel(element.start - element.in_point) +\ ++ hscroll_pos + + # i = left edge of thumbnail to be drawn. We start with x1 and + # subtract the distance to the nearest leftward rectangle. +diff --git a/pitivi/ui/timeline.py b/pitivi/ui/timeline.py +index 77a4c7d..c707c60 100644 +--- a/pitivi/ui/timeline.py ++++ b/pitivi/ui/timeline.py +@@ -252,27 +252,20 @@ class Timeline(gtk.Table, Loggable, Zoomable): + + # proportional timeline + self._canvas = TimelineCanvas(self.app) +- timelinewindow = gtk.ScrolledWindow(self.hadj, self.vadj) +- timelinewindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) +- timelinewindow.add(self._canvas) +- timelinewindow.set_shadow_type(gtk.SHADOW_IN) +- timelinewindow.set_name("timelinewindow") +- +- # temp fix for padding between scrollbar and scrolled window +- #FIXME: should be set at an global position for easy editing? +- gtk.rc_parse_string(""" +- style 'timelinewindow' +- { +- GtkScrolledWindow::scrollbar-spacing = 0 +- } +- widget '*.timelinewindow' style 'timelinewindow' +- """) +- +- self.attach(timelinewindow, 1, 2, 1, 2) ++ self._root_item = self._canvas.get_root_item() ++ self.attach(self._canvas, 1, 2, 1, 2) ++ ++ # scrollbar ++ self._hscrollbar = gtk.HScrollbar(self.hadj) ++ self._vscrollbar = gtk.VScrollbar(self.vadj) ++ self.attach(self._hscrollbar, 1, 2, 2, 3, yoptions=0) ++ self.attach(self._vscrollbar, 2, 3, 1, 2, xoptions=0) ++ self.hadj.connect("value-changed", self._updateScrollPosition) ++ self.vadj.connect("value-changed", self._updateScrollPosition) + + # error infostub + self.infostub = InfoStub() +- self.attach(self.infostub, 1, 2, 2, 3, yoptions=0) ++ self.attach(self.infostub, 1, 2, 4, 5, yoptions=0) + + self.show_all() + self.infostub.hide() +@@ -472,6 +465,10 @@ class Timeline(gtk.Table, Loggable, Zoomable): + + ## Zooming and Scrolling + ++ def _updateScrollPosition(self, adjustment): ++ self._root_item.set_simple_transform( -self.hadj.get_value(), ++ -self.vadj.get_value(), 1.0, 0) ++ + def _zoomAdjustmentChangedCb(self, adjustment): + # GTK crack + self._updateZoom = False +diff --git a/pitivi/ui/timelinecanvas.py b/pitivi/ui/timelinecanvas.py +index 31f3595..e38a577 100644 +--- a/pitivi/ui/timelinecanvas.py ++++ b/pitivi/ui/timelinecanvas.py +@@ -63,8 +63,9 @@ class PlayheadController(Controller, Zoomable): + Controller.__init__(self, *args, **kwargs) + + def set_pos(self, item, pos): +- self._canvas.app.current.seeker.seek( +- Zoomable.pixelToNs(pos[0])) ++ x, y = pos ++ x += self._hadj.get_value() ++ self._canvas.app.current.seeker.seek(Zoomable.pixelToNs(x)) + + class TimelineCanvas(goocanvas.Canvas, Zoomable, Loggable): + +@@ -124,7 +125,9 @@ class TimelineCanvas(goocanvas.Canvas, Zoomable, Loggable): + self.set_size_request(-1, height) + + def from_event(self, event): +- return Point(*self.convert_from_pixels(event.x, event.y)) ++ x, y = event.x, event.y ++ x += self.app.gui.timeline.hadj.get_value() ++ return Point(*self.convert_from_pixels(x, y)) + + def setExpanded(self, track_object, expanded): + track_ui = None +@@ -179,19 +182,6 @@ class TimelineCanvas(goocanvas.Canvas, Zoomable, Loggable): + event.area.x, event.area.y, + event.area.width, event.area.height) + +- y = 0 +- for track in self._tracks[:-1]: +- y += track.height +- self.style.paint_box(event.window, +- gtk.STATE_NORMAL, +- gtk.SHADOW_OUT, +- event.area, +- self, +- "", +- event.area.x - 5, y + 1, +- event.area.width + 10, TRACK_SPACING - 2) +- y += TRACK_SPACING +- + goocanvas.Canvas.do_expose_event(self, event) + + ## implements selection marquee +@@ -217,7 +207,9 @@ class TimelineCanvas(goocanvas.Canvas, Zoomable, Loggable): + self._got_motion_notify = True + cur = self.from_event(event) + pos, size = self._normalize(self._mousedown, cur) +- self._marquee.props.x, self._marquee.props.y = pos ++ x, y = pos ++ x += self.app.gui.timeline.hadj.get_value() ++ self._marquee.props.x, self._marquee.props.y = (x, y) + self._marquee.props.width, self._marquee.props.height = size + return True + return False +@@ -274,10 +266,8 @@ class TimelineCanvas(goocanvas.Canvas, Zoomable, Loggable): + + def _request_size(self): + alloc = self.get_allocation() +- w = Zoomable.nsToPixel(self.max_duration) +- h = max(self._height, alloc.height) +- self.set_bounds(0, 0, w, h) +- self._playhead.props.height = h + 10 ++ self.set_bounds(0, 0, alloc.width, alloc.height) ++ self._playhead.props.height = alloc.height + 10 + + def zoomChanged(self): + if self.timeline: +diff --git a/pitivi/ui/trackobject.py b/pitivi/ui/trackobject.py +index 19b1aee..7ed0254 100644 +--- a/pitivi/ui/trackobject.py ++++ b/pitivi/ui/trackobject.py +@@ -121,8 +121,9 @@ class TimelineController(controller.Controller): + + def set_pos(self, item, pos): + x, y = pos +- position = Zoomable.pixelToNs(x) +- priority = int((y - self._y_offset) // (LAYER_HEIGHT_EXPANDED + LAYER_SPACING)) ++ position = Zoomable.pixelToNs(x + self._hadj.get_value()) ++ priority = int((y - self._y_offset + self._vadj.get_value()) // ++ (LAYER_HEIGHT_EXPANDED + LAYER_SPACING)) + self._context.setMode(self._getMode()) + self._context.editTo(position, priority) + +@@ -229,8 +230,9 @@ class TrackObject(View, goocanvas.Group, Zoomable): + mode = SELECT_ADD + timeline.setSelectionToObj(element, mode) + else: +- self._view.app.current.seeker.seek( +- Zoomable.pixelToNs(pos[0])) ++ x, y = pos ++ x += self._hadj.get_value() ++ self._view.app.current.seeker.seek(Zoomable.pixelToNs(x)) + timeline.setSelectionToObj(element, SELECT) + + def __init__(self, instance, element, track, timeline): +-- +1.7.1.1 + diff --git a/pitivi.spec b/pitivi.spec index c05bcc0..8b461db 100644 --- a/pitivi.spec +++ b/pitivi.spec @@ -3,15 +3,20 @@ Name: pitivi Version: %{major}.%{minor} -Release: 2%{?dist} +Release: 3%{?dist} Summary: Non-linear video editor Group: Applications/Multimedia License: LGPLv2+ URL: http://www.pitivi.org/ Source0: http://ftp.gnome.org/pub/GNOME/sources/pitivi/%{major}/pitivi-%{version}.tar.bz2 +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: intltool BuildRequires: python BuildRequires: desktop-file-utils +BuildRequires: pygobject2 +BuildRequires: gstreamer-python +BuildRequires: gnonlin +BuildRequires: gstreamer-plugins-good Requires: gnonlin Requires: gstreamer-plugins-good Requires: gstreamer-python @@ -22,6 +27,13 @@ Requires: python-setuptools Requires: hicolor-icon-theme BuildArch: noarch +#Patch0: fix crash when zooming with the slider +# https://bugzilla.redhat.com/show_bug.cgi?id=654119 +Patch0: https://bugs.launchpad.net/ubuntu/+source/pygoocanvas/+bug/640630/+attachment/1671260/+files/0001-backport-canvas-fixes-to-0.13.5.patch +#Patch1: Add man page +# https://bugzilla.gnome.org/show_bug.cgi?id=636787 +Patch1: 0001-Add-man-page.patch + %description Pitivi is an application using the GStreamer multimedia framework to manipulate a large set of multimedia sources. @@ -37,12 +49,21 @@ do sed -e '/^#!/,1d' < $f > $f.tmp && mv $f.tmp $f done +%patch0 -p1 -b .fix-zoom-crash +%patch1 -p1 -b .add-man-page +# Since DISPLAY is unset, don't import Pitivi in tests/test_binary_search.py and don't run tests/test_basic.py +# Don't run tests/test_still_image.py either as it fails : https://bugzilla.gnome.org/show_bug.cgi?id=636807 +sed -i '/from pitivi.application import Pitivi/d' tests/test_binary_search.py +sed -i "s|'test_integration'|'test_integration' ,'test_basic', 'test_still_image'|g" tests/runtests.py +autoreconf -if -I common/m4 + %build %configure --libdir=%{_datadir} make %{?_smp_mflags} %install +rm -rf $RPM_BUILD_ROOT make DESTDIR=%{buildroot} install desktop-file-install --delete-original \ --dir %{buildroot}%{_datadir}/applications \ @@ -51,6 +72,9 @@ desktop-file-install --delete-original \ %find_lang %{name} +%check +make check + %clean rm -rf %{buildroot} @@ -78,8 +102,18 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{_datadir}/applications/%{name}.desktop %{_datadir}/icons/hicolor/*/apps/%{name}.* %{_datadir}/mime/packages/%{name}.xml +%{_mandir}/man1/%{name}.1.gz %changelog +* Wed Dec 08 2010 Hicham HAOUARI - 0.13.5-3 +- Add buildroot tag +- Clean buildroot in %%install section +- Add patch from lp #640630 to fix rhbz #654119 +- Add man page +- Add %%check section +- Add pygobject2, gstreamer-python, gnonlin and gstreamer-plugins-good + to BR so that we can run %%check + * Tue Dec 07 2010 Hicham HAOUARI - 0.13.5-2 - Add scriptlet to update icon cache (rhbz #625580)