cheese r1112 - in trunk: . src



Author: cosimoc
Date: Fri Oct 17 17:23:45 2008
New Revision: 1112
URL: http://svn.gnome.org/viewvc/cheese?rev=1112&view=rev

Log:
2008-10-17  Cosimo Cecchi  <cosimoc gnome org>

	* configure.ac:
	* src/Makefile.am:
	* src/cheese-thumb-view.c: (cheese_thumb_view_thread_append_item),
	(cheese_thumb_view_init):
	* src/cheese.c: (main):
	* src/eog-thumbnail.c: (art_rgb_run_alpha):
	Drop libgnome/libgnome-vfs dependencies (#556580).


Modified:
   trunk/ChangeLog
   trunk/configure.ac
   trunk/src/Makefile.am
   trunk/src/cheese-thumb-view.c
   trunk/src/cheese.c
   trunk/src/eog-thumbnail.c

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Fri Oct 17 17:23:45 2008
@@ -61,10 +61,9 @@
 GIO_REQUIRED=2.16.0
 GTK_REQUIRED=2.10.0
 GDK_REQUIRED=2.12.0
-LIBGNOMEUI_REQUIRED=2.20.0
+LIBGNOMEDESKTOP_REQUIRED=2.25.1
 GCONF_REQUIRED=2.16.0
 GSTREAMER_REQUIRED=0.10.20
-GNOME_VFS_REQUIRED=2.18.0
 LIBEBOOK_REQUIRED=1.12.0
 CAIRO_REQUIRED=1.4.0
 DBUS_REQUIRED=1.0
@@ -79,11 +78,10 @@
   gio-2.0 >= $GIO_REQUIRED \
   gtk+-2.0 >= $GTK_REQUIRED \
   gdk-2.0 >= $GDK_REQUIRED \
-  libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED \
+  gnome-desktop-2.0 >= $LIBGNOMEDESKTOP_REQUIRED \
   gconf-2.0 >= $GCONF_REQUIRED \
   gstreamer-0.10 >= $GSTREAMER_REQUIRED \
   gstreamer-plugins-base-0.10 >= $GSTREAMER_REQUIRED \
-  gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED \
   libebook-1.2 >= $LIBEBOOK_REQUIRED \
   cairo >= $CAIRO_REQUIRED \
   dbus-1 >= $DBUS_REQUIRED \

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Fri Oct 17 17:23:45 2008
@@ -7,6 +7,7 @@
 	-DPACKAGE_DATADIR=\""$(datadir)/cheese"\"	\
 	-DPACKAGE_LOCALEDIR=\""$(datadir)/locale"\"	\
 	-DAPPNAME_DATA_DIR=\"$(pkgdatadir)\"		\
+	-DGNOME_DESKTOP_USE_UNSTABLE_API=1		\
 	$(CHEESE_CFLAGS)
 
 bin_PROGRAMS = cheese

Modified: trunk/src/cheese-thumb-view.c
==============================================================================
--- trunk/src/cheese-thumb-view.c	(original)
+++ trunk/src/cheese-thumb-view.c	Fri Oct 17 17:23:45 2008
@@ -25,7 +25,8 @@
 
 #include <glib.h>
 #include <gtk/gtk.h>
-#include <libgnomeui/libgnomeui.h>
+#include <libgnomeui/gnome-desktop-thumbnail.h>
+#include <string.h>
 
 #include "cheese-fileutil.h"
 #include "eog-thumbnail.h"
@@ -45,7 +46,7 @@
   CheeseFileUtil *fileutil;
   GFileMonitor   *photo_file_monitor;
   GFileMonitor   *video_file_monitor;
-  GnomeThumbnailFactory *factory;
+  GnomeDesktopThumbnailFactory *factory;
   gboolean multiplex_thumbnail_generator;
 } CheeseThumbViewPrivate;
 
@@ -82,7 +83,7 @@
   CheeseThumbView           *thumb_view = item->thumb_view;
   CheeseThumbViewPrivate    *priv       = CHEESE_THUMB_VIEW_GET_PRIVATE (thumb_view);
 
-  GnomeThumbnailFactory *factory = priv->factory;
+  GnomeDesktopThumbnailFactory *factory = priv->factory;
   GFile                 *file    = item->file;
   GtkTreeIter            iter    = item->iter;
   GdkPixbuf             *pixbuf  = NULL;
@@ -106,18 +107,18 @@
   uri      = g_file_get_uri (file);
   filename = g_file_get_path (file);
 
-  thumb_loc = gnome_thumbnail_factory_lookup (factory, uri, mtime.tv_sec);
+  thumb_loc = gnome_desktop_thumbnail_factory_lookup (factory, uri, mtime.tv_sec);
 
   if (!thumb_loc)
   {
-    pixbuf = gnome_thumbnail_factory_generate_thumbnail (factory, uri, mime_type);
+    pixbuf = gnome_desktop_thumbnail_factory_generate_thumbnail (factory, uri, mime_type);
     if (!pixbuf)
     {
       g_warning ("could not generate thumbnail for %s (%s)\n", filename, mime_type);
     }
     else
     {
-      gnome_thumbnail_factory_save_thumbnail (factory, pixbuf, uri, mtime.tv_sec);
+      gnome_desktop_thumbnail_factory_save_thumbnail (factory, pixbuf, uri, mtime.tv_sec);
     }
   }
   else
@@ -584,7 +585,7 @@
   g_mkdir_with_parents (path_videos, 0775);
   g_mkdir_with_parents (path_photos, 0775);
 
-  priv->factory = gnome_thumbnail_factory_new (GNOME_THUMBNAIL_SIZE_NORMAL);
+  priv->factory = gnome_desktop_thumbnail_factory_new (GNOME_DESKTOP_THUMBNAIL_SIZE_NORMAL);
 
   /* connect signal to video path */
   file                     = g_file_new_for_path (path_videos);

Modified: trunk/src/cheese.c
==============================================================================
--- trunk/src/cheese.c	(original)
+++ trunk/src/cheese.c	Fri Oct 17 17:23:45 2008
@@ -29,7 +29,6 @@
 #include <gio/gio.h>
 #include <gtk/gtk.h>
 #include <gst/gst.h>
-#include <libgnomevfs/gnome-vfs.h>
 
 #include "cheese-fileutil.h"
 #include "cheese-window.h"
@@ -198,9 +197,6 @@
     return -1;
   }
 
-  /* Needed for gnome_thumbnail functions */
-  gnome_vfs_init ();
-
   g_set_print_handler ((GPrintFunc) cheese_print_handler);
 
   gtk_window_set_default_icon_name ("cheese");

Modified: trunk/src/eog-thumbnail.c
==============================================================================
--- trunk/src/eog-thumbnail.c	(original)
+++ trunk/src/eog-thumbnail.c	Fri Oct 17 17:23:45 2008
@@ -29,8 +29,6 @@
 #include <cheese-config.h>
 #endif
 
-#include <libart_lgpl/art_rgb.h>
-
 #include "eog-thumbnail.h"
 
 
@@ -103,6 +101,25 @@
 	}
 }
 
+/* copied from libart_lgpl/art_rgb.c */
+
+static void
+art_rgb_run_alpha (guint8 *buf, guint8 r, guint8 g, guint8 b, int alpha, int n)
+{
+	int i;
+	int v;
+
+	for (i = 0; i < n; i++)
+	{
+		v = *buf;
+		*buf++ = v + (((r - v) * alpha + 0x80) >> 8);
+		v = *buf;
+		*buf++ = v + (((g - v) * alpha + 0x80) >> 8);
+		v = *buf;
+		*buf++ = v + (((b - v) * alpha + 0x80) >> 8);
+	}
+}
+
 static GdkPixbuf *
 eog_thumbnail_stretch_frame_image (GdkPixbuf *frame_image, 
 				   gint left_offset, 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]