rpms/gnome-desktop/devel slideshow-api.patch, NONE, 1.1 gnome-desktop.spec, 1.222, 1.223
Matthias Clasen
mclasen at fedoraproject.org
Mon Aug 17 03:19:55 UTC 2009
Author: mclasen
Update of /cvs/pkgs/rpms/gnome-desktop/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv13355
Modified Files:
gnome-desktop.spec
Added Files:
slideshow-api.patch
Log Message:
Add slideshow api
slideshow-api.patch:
gnome-bg.c | 87 +++++++++++++++++++++++++++++++++++++++++++++++---
libgnomeui/gnome-bg.h | 8 ++++
2 files changed, 89 insertions(+), 6 deletions(-)
--- NEW FILE slideshow-api.patch ---
diff -up gnome-desktop-2.27.5/libgnome-desktop/gnome-bg.c.slideshow-api gnome-desktop-2.27.5/libgnome-desktop/gnome-bg.c
--- gnome-desktop-2.27.5/libgnome-desktop/gnome-bg.c.slideshow-api 2009-04-26 18:40:20.000000000 -0400
+++ gnome-desktop-2.27.5/libgnome-desktop/gnome-bg.c 2009-08-13 01:14:41.403741426 -0400
@@ -177,7 +177,8 @@ static GdkPixbuf *create_img_thumbnail (
GnomeDesktopThumbnailFactory *factory,
GdkScreen *screen,
int dest_width,
- int dest_height);
+ int dest_height,
+ int frame_num);
static SlideShow * get_as_slideshow (GnomeBG *bg,
const char *filename);
static Slide * get_current_slide (SlideShow *show,
@@ -1055,7 +1056,7 @@ fit_factor (int from_width, int from_hei
GdkPixbuf *
gnome_bg_create_thumbnail (GnomeBG *bg,
- GnomeDesktopThumbnailFactory *factory,
+ GnomeDesktopThumbnailFactory *factory,
GdkScreen *screen,
int dest_width,
int dest_height)
@@ -1069,7 +1070,7 @@ gnome_bg_create_thumbnail (GnomeBG
draw_color (bg, result);
- thumb = create_img_thumbnail (bg, factory, screen, dest_width, dest_height);
+ thumb = create_img_thumbnail (bg, factory, screen, dest_width, dest_height, -1);
if (thumb) {
draw_image (bg->placement, thumb, result);
@@ -1752,7 +1753,8 @@ create_img_thumbnail (GnomeBG
GnomeDesktopThumbnailFactory *factory,
GdkScreen *screen,
int dest_width,
- int dest_height)
+ int dest_height,
+ int frame_num)
{
if (bg->filename) {
GdkPixbuf *thumb = get_as_thumbnail (bg, factory, bg->filename);
@@ -1771,7 +1773,10 @@ create_img_thumbnail (GnomeBG
slideshow_ref (show);
- slide = get_current_slide (show, &alpha);
+ if (frame_num == -1)
+ slide = get_current_slide (show, &alpha);
+ else
+ slide = g_queue_peek_nth (show->slides, frame_num);
if (slide->fixed) {
GdkPixbuf *tmp;
@@ -2636,3 +2641,75 @@ slideshow_changes_with_size (SlideShow *
return show->changes_with_size;
}
+gboolean
+gnome_bg_changes_with_time (GnomeBG *bg)
+{
+ SlideShow *show;
+
+ g_return_val_if_fail (bg != NULL, FALSE);
+
+ show = get_as_slideshow (bg, bg->filename);
+ if (show)
+ return g_queue_get_length (show->slides) > 1;
+
+ return FALSE;
+}
+
+/* frame_num is only counting static frames here,
+ * we are skipping transitions
+ * returns NULL if frame_num is out of bounds
+ */
+GdkPixbuf *
+gnome_bg_create_frame_thumbnail (GnomeBG *bg,
+ GnomeDesktopThumbnailFactory *factory,
+ GdkScreen *screen,
+ int dest_width,
+ int dest_height,
+ int frame_num)
+{
+ SlideShow *show;
+ GdkPixbuf *result;
+ GdkPixbuf *thumb;
+ GList *l;
+ int i, skipped;
+ gboolean found;
+
+ g_return_val_if_fail (bg != NULL, FALSE);
+
+ show = get_as_slideshow (bg, bg->filename);
+
+ if (!show)
+ return NULL;
+
+ i = 0;
+ skipped = 0;
+ found = FALSE;
+ for (l = show->slides->head; l; l = l->next) {
+ Slide *slide = l->data;
+ if (!slide->fixed) {
+ skipped++;
+ continue;
+ }
+ if (i == frame_num) {
+ found = TRUE;
+ break;
+ }
+ i++;
+ }
+ if (!found)
+ return NULL;
+
+ result = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, dest_width, dest_height);
+
+ draw_color (bg, result);
+
+ thumb = create_img_thumbnail (bg, factory, screen, dest_width, dest_height, frame_num + skipped);
+
+ if (thumb) {
+ draw_image (bg->placement, thumb, result);
+ g_object_unref (thumb);
+ }
+
+ return result;
+}
+
diff -up gnome-desktop-2.27.5/libgnome-desktop/libgnomeui/gnome-bg.h.slideshow-api gnome-desktop-2.27.5/libgnome-desktop/libgnomeui/gnome-bg.h
--- gnome-desktop-2.27.5/libgnome-desktop/libgnomeui/gnome-bg.h.slideshow-api 2009-04-19 13:39:06.000000000 -0400
+++ gnome-desktop-2.27.5/libgnome-desktop/libgnomeui/gnome-bg.h 2009-08-12 23:09:11.297992749 -0400
@@ -104,7 +104,13 @@ GdkPixbuf * gnome_bg_create_thumbna
int dest_height);
gboolean gnome_bg_is_dark (GnomeBG *bg);
gboolean gnome_bg_changes_with_size (GnomeBG *bg);
-
+gboolean gnome_bg_changes_with_time (GnomeBG *bg);
+GdkPixbuf * gnome_bg_create_frame_thumbnail (GnomeBG *bg,
+ GnomeDesktopThumbnailFactory *factory,
+ GdkScreen *screen,
+ int dest_width,
+ int dest_height,
+ int frame_num);
/* Set a pixmap as root - not a GnomeBG method. At some point
* if we decide to stabilize the API then we may want to make
Index: gnome-desktop.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-desktop/devel/gnome-desktop.spec,v
retrieving revision 1.222
retrieving revision 1.223
diff -u -p -r1.222 -r1.223
--- gnome-desktop.spec 14 Aug 2009 19:51:01 -0000 1.222
+++ gnome-desktop.spec 17 Aug 2009 03:19:54 -0000 1.223
@@ -12,10 +12,12 @@
Summary: Shared code among gnome-panel, gnome-session, nautilus, etc
Name: gnome-desktop
Version: 2.27.5
-Release: 4%{?dist}
+Release: 5%{?dist}
URL: http://www.gnome.org
Source0: http://download.gnome.org/sources/gnome-desktop/2.27/%{name}-%{version}.tar.bz2
Patch1: concatenate-edid-descriptors.patch
+# from upstream
+Patch2: slideshow-api.patch
License: GPLv2+ and LGPLv2+
Group: System Environment/Libraries
@@ -75,6 +77,7 @@ libgnomedesktop.
%prep
%setup -q
%patch1 -p1 -b .concatenate-edid-descriptors
+%patch2 -p1 -b .slideshow-api
%build
%configure --with-gnome-distributor="Red Hat, Inc" \
@@ -122,6 +125,9 @@ rm -rf $RPM_BUILD_ROOT
%doc %{_datadir}/gtk-doc/html/gnome-desktop/
%changelog
+* Sun Aug 16 2009 Matthias Clasen <mclasen at redhat.com> - 2.27.5-5
+- Add slideshow api
+
* Fri Aug 14 2009 Matthias Clasen <mclasen at redhat.com> - 2.27.5-4
- Drop constantine-backgrounds-extras, too big
More information about the scm-commits
mailing list