[f-spot/FSPOT_0_6_0_STABLE] new DissolveTransition extension
- From: Stephane Delcroix <sdelcroix src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [f-spot/FSPOT_0_6_0_STABLE] new DissolveTransition extension
- Date: Wed, 19 Aug 2009 13:04:04 +0000 (UTC)
commit b808212b74cfaa754dd5029888e73353f7609aab
Author: Stephane Delcroix <stephane delcroix org>
Date: Tue Aug 18 14:35:26 2009 +0200
new DissolveTransition extension
configure.ac | 2 +
extensions/Makefile.am | 3 +-
.../DissolveTransition.addin.xml | 15 +++++
.../DissolveTransition/DissolveTransition.cs | 58 ++++++++++++++++++++
.../Transitions/DissolveTransition/Makefile.am | 53 ++++++++++++++++++
extensions/Transitions/Makefile.am | 2 +
src/Widgets/PushTransition.cs | 3 +-
7 files changed, 134 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 73eae22..5ef12f5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -347,6 +347,8 @@ extensions/Tools/ChangePhotoPath/Makefile
extensions/Tools/HashJob/Makefile
extensions/Tools/DevelopInUFraw/Makefile
extensions/Tools/MergeDb/Makefile
+extensions/Transitions/Makefile
+extensions/Transitions/DissolveTransition/Makefile
tests/Makefile
tests/src/Makefile
f-spot.pc
diff --git a/extensions/Makefile.am b/extensions/Makefile.am
index 4793cca..c400ea6 100644
--- a/extensions/Makefile.am
+++ b/extensions/Makefile.am
@@ -1,7 +1,8 @@
SUBDIRS = \
Services \
Exporters \
- Tools
+ Tools \
+ Transitions
addinsdir = $(pkglibdir)
addins_DATA = f-spot.global.addins
diff --git a/extensions/Transitions/DissolveTransition/DissolveTransition.addin.xml b/extensions/Transitions/DissolveTransition/DissolveTransition.addin.xml
new file mode 100644
index 0000000..03cb0ad
--- /dev/null
+++ b/extensions/Transitions/DissolveTransition/DissolveTransition.addin.xml
@@ -0,0 +1,15 @@
+<Addin namespace="FSpot"
+ id="DissolveTransition"
+ version="0.6.0.1"
+ name="Dissolve Transition"
+ description="A Slideshow transition that dissolve images"
+ author="Stephane Delcroix"
+ url="http://f-spot.org/Extensions"
+ category="Transitions">
+ <Dependencies>
+ <Addin id="Core" version="0.6.0.1"/>
+ </Dependencies>
+ <Extension path = "/FSpot/SlideShow">
+ <Transition transition_type="DissolveTransition.DissolveTransition"/>
+ </Extension>
+</Addin>
diff --git a/extensions/Transitions/DissolveTransition/DissolveTransition.cs b/extensions/Transitions/DissolveTransition/DissolveTransition.cs
new file mode 100644
index 0000000..cb23805
--- /dev/null
+++ b/extensions/Transitions/DissolveTransition/DissolveTransition.cs
@@ -0,0 +1,58 @@
+//
+// FSpot.Widgets.DissolveTransition.cs
+//
+// Author(s):
+// Stephane Delcroix <stephane delcroix org>
+//
+// Copyright (c) 2009 Novell, Inc.
+//
+// This is open source software. See COPYING for details.
+//
+
+using System;
+
+using Cairo;
+using Gdk;
+
+using FSpot.Utils;
+using FSpot.Widgets;
+using Mono.Unix;
+
+using Color = Cairo.Color;
+
+namespace DissolveTransition
+{
+ public class DissolveTransition : CairoTransition
+ {
+ public DissolveTransition () : base (Catalog.GetString ("Dissolve"))
+ {
+ }
+
+ protected override void Draw (Context cr, Pixbuf prev, Pixbuf next, int width, int height, double progress)
+ {
+ cr.Color = new Color (0, 0, 0, progress);
+ if (next != null) {
+ double scale = Math.Min ((double)width/(double)next.Width, (double)height/(double)next.Height);
+ cr.Save ();
+
+ cr.Rectangle (0, 0, width, .5 * (height - scale*next.Height));
+ cr.Fill ();
+
+ cr.Rectangle (0, height - .5 * (height - scale*next.Height), width, .5 * (height - scale*next.Height));
+ cr.Fill ();
+
+ cr.Rectangle (0, 0, .5 * (width - scale*next.Width), height);
+ cr.Fill ();
+
+ cr.Rectangle (width - .5 * (width - scale*next.Width), 0, .5 * (width - scale*next.Width), height);
+ cr.Fill ();
+
+ cr.Rectangle (0, 0, width, height);
+ cr.Scale (scale, scale);
+ CairoHelper.SetSourcePixbuf (cr, next, .5 * ((double)width/scale - next.Width), .5 * ((double)height/scale - next.Height));
+ cr.PaintWithAlpha (progress);
+ cr.Restore ();
+ }
+ }
+ }
+}
diff --git a/extensions/Transitions/DissolveTransition/Makefile.am b/extensions/Transitions/DissolveTransition/Makefile.am
new file mode 100644
index 0000000..dd513b1
--- /dev/null
+++ b/extensions/Transitions/DissolveTransition/Makefile.am
@@ -0,0 +1,53 @@
+include $(top_srcdir)/Makefile.include
+
+PLUGIN_NAME = DissolveTransition
+
+PLUGIN_MANIFEST = $(PLUGIN_NAME).addin.xml
+
+PLUGIN_ASSEMBLY = $(PLUGIN_NAME).dll
+
+PLUGIN_SOURCES = \
+ $(srcdir)/DissolveTransition.cs
+
+
+REFS = \
+ -r:$(top_builddir)/src/f-spot.exe \
+ -r:$(top_builddir)/src/FSpot.Core.dll \
+ -r:$(top_builddir)/src/FSpot.Utils.dll \
+ -r:$(top_builddir)/src/FSpot.Widgets.dll\
+ -r:Mono.Cairo \
+ -pkg:gtk-sharp-2.0 \
+ -r:Mono.Posix \
+ $(LINK_MONO_ADDINS) \
+ $(LINK_SEMWEB) \
+ $(LINK_GPHOTO2) \
+ $(LINK_GIOSHARP) \
+ $(LINK_DBUS) \
+ $(LINK_BEAGLE)
+
+PKGS =
+
+RESOURCES = \
+ -resource:$(srcdir)/$(PLUGIN_MANIFEST)
+
+all: $(PLUGIN_ASSEMBLY)
+
+mpack: $(PLUGIN_ASSEMBLY)
+ mautil p $(PLUGIN_ASSEMBLY)
+
+$(PLUGIN_ASSEMBLY): $(PLUGIN_SOURCES) $(PLUGIN_MANIFEST)
+ $(CSC_LIB) -out:$@ $(CSC_DEFINES) $(PLUGIN_SOURCES) $(REFS) $(PKGS) $(ASSEMBLIES) $(RESOURCES)
+
+plugindir = $(pkglibdir)/extensions
+
+plugin_DATA = \
+ $(PLUGIN_ASSEMBLY)
+
+EXTRA_DIST = \
+ $(PLUGIN_SOURCES) \
+ $(PLUGIN_MANIFEST)
+
+CLEANFILES = \
+ $(PLUGIN_ASSEMBLY) \
+ $(PLUGIN_ASSEMBLY).mdb \
+ *.mpack
diff --git a/extensions/Transitions/Makefile.am b/extensions/Transitions/Makefile.am
new file mode 100644
index 0000000..112a18f
--- /dev/null
+++ b/extensions/Transitions/Makefile.am
@@ -0,0 +1,2 @@
+SUBDIRS = \
+ DissolveTransition
diff --git a/src/Widgets/PushTransition.cs b/src/Widgets/PushTransition.cs
index 2a54484..4a68e2e 100644
--- a/src/Widgets/PushTransition.cs
+++ b/src/Widgets/PushTransition.cs
@@ -13,6 +13,7 @@ using System;
using Cairo;
using Gdk;
+using Mono.Unix;
using FSpot.Utils;
@@ -22,7 +23,7 @@ namespace FSpot.Widgets
{
public class PushTransition : CairoTransition
{
- public PushTransition () : base ("Push")
+ public PushTransition () : base (Catalog.GetString ("Push"))
{
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]