[eog] Remove EogPixbufCellRenderer



commit 94b9e815a26767a7fc58ff34eb78562df3cac8fb
Author: Felix Riemann <friemann svn gnome org>
Date:   Sat May 2 17:24:52 2009 +0200

    Remove EogPixbufCellRenderer
    
    Remove our own pixbuf cell renderer as the same functionality is
    included in gtk+ now.
---
 ChangeLog                      |    9 +++
 src/Makefile.am                |    2 -
 src/eog-pixbuf-cell-renderer.c |  115 ----------------------------------------
 src/eog-pixbuf-cell-renderer.h |   53 ------------------
 src/eog-thumb-view.c           |    3 +-
 5 files changed, 10 insertions(+), 172 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index edfe266..5e63aea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-05-02  Felix Riemann  <friemann svn gnome org>
+
+	* src/Makefile.am:
+	* src/eog-pixbuf-cell-renderer.c:
+	* src/eog-pixbuf-cell-renderer.h:
+	* src/eog-thumb-view.c (eog_thumb_view_init):
+	Remove our own pixbuf cell renderer as the same functionality is
+	included in gtk+ now.
+
 2009-05-01  Felix Riemann  <friemann svn gnome org>
 
 	* src/main.c (main):
diff --git a/src/Makefile.am b/src/Makefile.am
index df34146..46b364d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -23,7 +23,6 @@ NOINST_H_FILES =			\
 	eog-pixbuf-util.h		\
 	eog-preferences-dialog.h	\
 	eog-config-keys.h		\
-	eog-pixbuf-cell-renderer.h	\
 	eog-image-jpeg.h		\
 	eog-image-private.h		\
 	eog-uri-converter.h		\
@@ -87,7 +86,6 @@ libeog_la_SOURCES =			\
 	eog-statusbar.c			\
 	eog-thumb-nav.c			\
 	eog-transform.c			\
-	eog-pixbuf-cell-renderer.c	\
 	eog-image.c			\
 	eog-image-jpeg.c		\
 	eog-image-save-info.c		\
diff --git a/src/eog-pixbuf-cell-renderer.c b/src/eog-pixbuf-cell-renderer.c
deleted file mode 100644
index 62459fc..0000000
--- a/src/eog-pixbuf-cell-renderer.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/* Eye Of Gnome - Pixbuf Cellrenderer
- *
- * Copyright (C) 2007 The GNOME Foundation
- *
- * Author: Lucas Rocha <lucasr gnome org>
- *
- * Based on gnome-control-center code (capplets/appearance/wp-cellrenderer.c) by:
- *      - Denis Washington <denisw svn gnome org>
- *      - Jens Granseuer <jensgr gmx net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "eog-pixbuf-cell-renderer.h"
-
-#include <math.h>
-
-G_DEFINE_TYPE (EogPixbufCellRenderer, eog_pixbuf_cell_renderer, GTK_TYPE_CELL_RENDERER_PIXBUF)
-
-static void eog_pixbuf_cell_renderer_render (GtkCellRenderer *cell,
-                                             GdkWindow *window,
-                                             GtkWidget *widget,
-                                             GdkRectangle *background_area,
-                                             GdkRectangle *cell_area,
-                                             GdkRectangle *expose_area,
-                                             GtkCellRendererState flags);
-
-static void
-eog_pixbuf_cell_renderer_class_init (EogPixbufCellRendererClass *klass)
-{
-	GtkCellRendererClass *renderer_class;
-
-	renderer_class = (GtkCellRendererClass *) klass;
-	renderer_class->render = eog_pixbuf_cell_renderer_render;
-}
-
-static void
-eog_pixbuf_cell_renderer_init (EogPixbufCellRenderer *renderer)
-{
-}
-
-GtkCellRenderer *
-eog_pixbuf_cell_renderer_new (void)
-{
-	return g_object_new (eog_pixbuf_cell_renderer_get_type (), NULL);
-}
-
-static void
-eog_pixbuf_cell_renderer_render (GtkCellRenderer *cell,
-                                 GdkWindow *window,
-                                 GtkWidget *widget,
-                                 GdkRectangle *background_area,
-                                 GdkRectangle *cell_area,
-                                 GdkRectangle *expose_area,
-                                 GtkCellRendererState flags)
-{
-	if ((flags & (GTK_CELL_RENDERER_SELECTED|GTK_CELL_RENDERER_PRELIT)) != 0) {
-		cairo_t *cr;
-		gint radius = 5;
-		gint x, y, w, h;
-		GtkStateType state;
-
-		x = background_area->x;
-		y = background_area->y;
-		w = background_area->width;
-		h = background_area->height;
-
-		/* Sometimes width is -1 - not sure what to do here */
-		if (w == -1) return;
-
-		if ((flags & GTK_CELL_RENDERER_SELECTED) != 0) {
-			if (GTK_WIDGET_HAS_FOCUS (widget))
-				state = GTK_STATE_SELECTED;
-			else
-				state = GTK_STATE_ACTIVE;
-		} else
-			state = GTK_STATE_PRELIGHT;
-
-		/* draw the selection indicator */
-		cr = gdk_cairo_create (GDK_DRAWABLE (window));
-		gdk_cairo_set_source_color (cr, &widget->style->base[state]);
-
-		cairo_arc (cr, x + radius, y + radius, radius, M_PI, M_PI * 1.5);
-		cairo_arc (cr, x + w - radius, y + radius, radius, M_PI * 1.5, 0);
-		cairo_arc (cr, x + w - radius, y + h - radius, radius, 0, M_PI * 0.5);
-		cairo_arc (cr, x + radius, y + h - radius, radius, M_PI * 0.5, M_PI);
-		cairo_close_path (cr);
-
-		/* FIXME: this should not be hardcoded to 4 */
-		cairo_rectangle (cr, x + 4, y + 4, w - 8, h - 8);
-
-		/*cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);*/
-		cairo_fill (cr);
-		cairo_destroy (cr);
-	}
-
-	(* GTK_CELL_RENDERER_CLASS (eog_pixbuf_cell_renderer_parent_class)->render)
-	    (cell, window, widget, background_area, cell_area, expose_area, flags);
-}
diff --git a/src/eog-pixbuf-cell-renderer.h b/src/eog-pixbuf-cell-renderer.h
deleted file mode 100644
index 78becbb..0000000
--- a/src/eog-pixbuf-cell-renderer.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Eye Of Gnome - Pixbuf Cellrenderer
- *
- * Copyright (C) 2007 The GNOME Foundation
- *
- * Author: Lucas Rocha <lucasr gnome org>
- *
- * Based on gnome-control-center code (capplets/appearance/wp-cellrenderer.c) by:
- *      - Denis Washington <denisw svn gnome org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU 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.
- */
-
-#ifndef __EOG_PIXBUF_CELL_RENDERER_H__
-#define __EOG_PIXBUF_CELL_RENDERER_H__
-
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
-
-typedef struct _EogPixbufCellRenderer EogPixbufCellRenderer;
-typedef struct _EogPixbufCellRendererClass EogPixbufCellRendererClass;
-
-struct _EogPixbufCellRenderer
-{
-	GtkCellRendererPixbuf parent;
-};
-
-struct _EogPixbufCellRendererClass
-{
-	GtkCellRendererPixbufClass parent;
-};
-
-G_GNUC_INTERNAL
-GType            eog_pixbuf_cell_renderer_get_type (void) G_GNUC_CONST;
-
-G_GNUC_INTERNAL
-GtkCellRenderer *eog_pixbuf_cell_renderer_new (void);
-
-G_END_DECLS
-
-#endif /* __EOG_PIXBUF_CELL_RENDERER_H__ */
diff --git a/src/eog-thumb-view.c b/src/eog-thumb-view.c
index 6ecdc77..c3d3a12 100644
--- a/src/eog-thumb-view.c
+++ b/src/eog-thumb-view.c
@@ -25,7 +25,6 @@
 
 #include "eog-thumb-view.h"
 #include "eog-list-store.h"
-#include "eog-pixbuf-cell-renderer.h"
 #include "eog-image.h"
 #include "eog-job-queue.h"
 
@@ -506,7 +505,7 @@ eog_thumb_view_init (EogThumbView *thumbview)
 
 	thumbview->priv = EOG_THUMB_VIEW_GET_PRIVATE (thumbview);
 
-	thumbview->priv->pixbuf_cell = eog_pixbuf_cell_renderer_new ();
+	thumbview->priv->pixbuf_cell = gtk_cell_renderer_pixbuf_new ();
 
 	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (thumbview),
 	      	  		    thumbview->priv->pixbuf_cell,



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