diff --git a/gnome-desktop.spec b/gnome-desktop.spec index 9a62123..4f76965 100644 --- a/gnome-desktop.spec +++ b/gnome-desktop.spec @@ -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 - 2.27.5-5 +- Add slideshow api + * Fri Aug 14 2009 Matthias Clasen - 2.27.5-4 - Drop constantine-backgrounds-extras, too big diff --git a/slideshow-api.patch b/slideshow-api.patch new file mode 100644 index 0000000..7e9db17 --- /dev/null +++ b/slideshow-api.patch @@ -0,0 +1,147 @@ +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