1 /* Eye Of Gnome - Pixbuf Cellrenderer 2 * 3 * Lifted from eog-2.20.0 with minor changes, Thanks! - Anders Brander 4 * 5 * Copyright (C) 2007 The GNOME Foundation 6 * 7 * Author: Lucas Rocha <lucasr@gnome.org> 8 * 9 * Based on gnome-control-center code (capplets/appearance/wp-cellrenderer.c) by: 10 * - Denis Washington <denisw@svn.gnome.org> 11 * 12 * This program is free software; you can redistribute it and/or modify 13 * it under the terms of the GNU General Public License as published by 14 * the Free Software Foundation; either version 2 of the License, or 15 * (at your option) any later version. 16 * 17 * This program is distributed in the hope that it will be useful, 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 * GNU General Public License for more details. 21 * 22 * You should have received a copy of the GNU General Public License 23 * along with this program; if not, write to the Free Software 24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 */ 26 27 #ifndef __EOG_PIXBUF_CELL_RENDERER_H__ 28 #define __EOG_PIXBUF_CELL_RENDERER_H__ 29 30 #include <gtk/gtk.h> 31 32 G_BEGIN_DECLS 33 34 typedef struct _EogPixbufCellRenderer EogPixbufCellRenderer; 35 typedef struct _EogPixbufCellRendererClass EogPixbufCellRendererClass; 36 37 struct _EogPixbufCellRenderer 38 { 39 GtkCellRendererPixbuf parent; 40 }; 41 42 struct _EogPixbufCellRendererClass 43 { 44 GtkCellRendererPixbufClass parent; 45 }; 46 47 typedef struct _BangPosition { 48 GdkDrawable *drawable; 49 gint x; 50 gint y; 51 } BangPosition; 52 53 /** 54 * This is an evil evil evil hack that should never be used by any sane person. 55 * eog_pixbuf_cell_renderer_render() will store the position and the drawable 56 * a pixbuf has been drawn to - this function returns this information in a 57 * BangPositon. This will allow an aggressive caller to bang the GdkDrawable 58 * directly instead of using conventional methods of setting the icon. 59 * Please understand: THE INFORMATION RETURNED CAN BE WRONG AND/OR OUTDATED! 60 * The key used in the tree is simply two XOR'ed pointers, collisions can 61 * easily exist. 62 */ 63 extern gboolean eog_pixbuf_cell_renderer_get_bang_position(GtkIconView *iconview, GdkPixbuf *pixbuf, BangPosition *bp); 64 65 GtkCellRenderer *eog_pixbuf_cell_renderer_new (void); 66 67 G_END_DECLS 68 69 #endif /* __EOG_PIXBUF_CELL_RENDERER_H__ */ 70