view src/image.h @ 23:17acca639a86

##### Note: GQview CVS on sourceforge is not always up to date, please use ##### ##### an offical release when making enhancements and translation updates. ##### Fri Mar 18 19:52:38 2005 John Ellis <johne@verizon.net> * pixbuf-renderer.c: Fix broken 2pass queueing so it merges a single queue item for each tile, and now that a tile holds a queue pointer there is no need to walk the tile list to find a possible merge victim. Thu Mar 17 19:23:56 2005 John Ellis <johne@verizon.net> * image.c, pixbuf-renderer.[ch]: More progress, and 2 pass zoom now works again (mostly). Tue Mar 15 23:17:41 2005 John Ellis <johne@verizon.net> * image.[ch]: Start conversion to use of PixbufRenderer. * pixbuf-renderer.[ch]: Additions and fixes for use by ImageWindow. * fullscreen.c, image-overlay.c, img-view.c, info.c, layout.c, layout_image.c, print.c: Changes for above ImageWindow conversion. * typedefs.h: Remove unused ImageWindow variables. Mon Mar 14 20:45:50 2005 John Ellis <johne@verizon.net> * pan-view.c: Convert to using new PixbufRenderer. * pixbuf-renderer.[ch]: Clean up and fixes. Sun Mar 13 10:21:35 2005 John Ellis <johne@verizon.net> * image.c (image_scroller_start): Unref scroller pixbuf after adding it as an overlay to avoid leaking it. * pixbuf-renderer.[ch]: All functions defined in header file are now implemented. Fri Mar 11 17:05:36 2005 John Ellis <johne@verizon.net> * pixbuf-renderer.[ch]: Set up object properties and additional. Mar 10 19:22:18 2005 John Ellis <johne@verizon.net> * pixbuf-renderer.[ch]: FIx scrolling to use old method of gdk_draw and not gdk_scroll, as scroll often invalidates the entire window (!). Also merged in source tiles code from image.c. * pan-view.c: Change picked up when testing PixbufRender zoom. Tue Mar 8 23:26:00 2005 John Ellis <johne@verizon.net> * pixbuf-renderer.[ch]: Start of turning image drawing portion of ImageWindow into an actual GtkWidget. * src/Makefile.am: Add pixbuf-renderer.[ch]. * pan-view.c: Added temporary hack button and callback for testing PixbufRenderer widget.
author gqview
date Sat, 19 Mar 2005 01:15:17 +0000
parents ef790149ae21
children acd9885ebd78
line wrap: on
line source

/*
 * GQview
 * (C) 2004 John Ellis
 *
 * Author: John Ellis
 *
 * This software is released under the GNU General Public License (GNU GPL).
 * Please read the included file COPYING for more information.
 * This software comes with no warranty of any kind, use at your own risk!
 */


#ifndef IMAGE_H
#define IMAGE_H


ImageWindow *image_new(gint frame);

/* additional setup */
void image_attach_window(ImageWindow *imd, GtkWidget *window,
			 const gchar *title, const gchar *title_right, gint show_zoom);
void image_set_update_func(ImageWindow *imd,
			   void (*func)(ImageWindow *imd, gpointer data),
			   gpointer data);
void image_set_button_func(ImageWindow *imd,
	void (*func)(ImageWindow *, gint button, guint32 time, gdouble x, gdouble y, guint state, gpointer),
	gpointer data);
void image_set_scroll_func(ImageWindow *imd,
	void (*func)(ImageWindow *, GdkScrollDirection direction, guint32 time, gdouble x, gdouble y, guint state, gpointer),
        gpointer data);
void image_set_scroll_notify_func(ImageWindow *imd,
				  void (*func)(ImageWindow *imd, gint x, gint y, gint width, gint height, gpointer data),
				  gpointer data);
void image_set_complete_func(ImageWindow *imd,
			     void (*func)(ImageWindow *, gint preload, gpointer),
			     gpointer data);
void image_set_new_func(ImageWindow *imd,
			void (*func)(ImageWindow *, gpointer),
			gpointer data);

/* path, name */
const gchar *image_get_path(ImageWindow *imd);
const gchar *image_get_name(ImageWindow *imd);

/* merely changes path string, does not change the image! */
void image_set_path(ImageWindow *imd, const gchar *newpath);

/* load a new image */
void image_change_path(ImageWindow *imd, const gchar *path, gdouble zoom);
void image_change_pixbuf(ImageWindow *imd, GdkPixbuf *pixbuf, gdouble zoom);
void image_change_from_collection(ImageWindow *imd, CollectionData *cd, CollectInfo *info, gdouble zoom);
CollectionData *image_get_collection(ImageWindow *imd, CollectInfo **info);
void image_change_from_image(ImageWindow *imd, ImageWindow *source);

GdkPixbuf *image_get_pixbuf(ImageWindow *imd);

/* manipulation */
void image_area_changed(ImageWindow *imd, gint x, gint y, gint width, gint height);
void image_reload(ImageWindow *imd);
void image_scroll(ImageWindow *imd, gint x, gint y);
void image_scroll_to_point(ImageWindow *imd, gint x, gint y,
			   gdouble x_align, gdouble y_align);
void image_alter(ImageWindow *imd, AlterType type);

/* zoom */
void image_zoom_adjust(ImageWindow *imd, gdouble increment);
void image_zoom_adjust_at_point(ImageWindow *imd, gdouble increment, gint x, gint y);
void image_zoom_set_limits(ImageWindow *imd, gdouble min, gdouble max);
void image_zoom_set(ImageWindow *imd, gdouble zoom);
void image_zoom_set_fill_geometry(ImageWindow *imd, gint vertical);
gdouble image_zoom_get(ImageWindow *imd);
gdouble image_zoom_get_real(ImageWindow *imd);
gchar *image_zoom_get_as_text(ImageWindow *imd);
gdouble image_zoom_get_default(ImageWindow *imd, gint mode);

/* read ahead, pass NULL to cancel */
void image_prebuffer_set(ImageWindow *imd, const gchar *path);

/* auto refresh, interval is 1/1000 sec, 0 uses default, -1 disables */
void image_auto_refresh(ImageWindow *imd, gint interval);

/* allow top window to be resized ? */
void image_top_window_set_sync(ImageWindow *imd, gint allow_sync);

/* background of image */
void image_background_set_black(ImageWindow *imd, gint black);
void image_background_set_color(ImageWindow *imd, GdkColor *color);

/* set delayed page flipping */
void image_set_delay_flip(ImageWindow *imd, gint delay);

/* wallpaper util */
void image_to_root_window(ImageWindow *imd, gint scaled);

/* overlays */
gint image_overlay_add(ImageWindow *imd, GdkPixbuf *pixbuf, gint x, gint y,
		       gint relative, gint always);
void image_overlay_set(ImageWindow *imd, gint id, GdkPixbuf *pixbuf, gint x, gint y);
gint image_overlay_get(ImageWindow *imd, gint id, GdkPixbuf **pixbuf, gint *x, gint *y);
void image_overlay_remove(ImageWindow *imd, gint id);



void image_set_image_as_tiles(ImageWindow *imd, gint width, gint height,
			      gint tile_width, gint tile_height, gint cache_size,
			      ImageTileRequestFunc func_tile_request,
			      ImageTileDisposeFunc func_tile_dispose,
			      gpointer data,
			      gdouble zoom);


#endif