1 /* Imagedisplay widget stuff.
2  */
3 
4 /*
5 
6     Copyright (C) 1991-2003 The National Gallery
7 
8     This program is free software; you can redistribute it and/or modify
9     it under the terms of the GNU General Public License as published by
10     the Free Software Foundation; either version 2 of the License, or
11     (at your option) any later version.
12 
13     This program is distributed in the hope that it will be useful,
14     but WITHOUT ANY WARRANTY; without even the implied warranty of
15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16     GNU General Public License for more details.
17 
18     You should have received a copy of the GNU General Public License along
19     with this program; if not, write to the Free Software Foundation, Inc.,
20     51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21 
22  */
23 
24 /*
25 
26     These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
27 
28 */
29 
30 #define TYPE_IMAGEDISPLAY (imagedisplay_get_type())
31 #define IMAGEDISPLAY( obj ) \
32 	(G_TYPE_CHECK_INSTANCE_CAST( (obj), TYPE_IMAGEDISPLAY, Imagedisplay ))
33 #define IMAGEDISPLAY_CLASS( klass ) \
34 	(G_TYPE_CHECK_CLASS_CAST( (klass), \
35 		TYPE_IMAGEDISPLAY, ImagedisplayClass))
36 #define IS_IMAGEDISPLAY( obj ) \
37 	(G_TYPE_CHECK_INSTANCE_TYPE( (obj), TYPE_IMAGEDISPLAY ))
38 #define IS_IMAGEDISPLAY_CLASS( klass ) \
39 	(G_TYPE_CHECK_CLASS_TYPE( (klass), TYPE_IMAGEDISPLAY ))
40 #define IMAGEDISPLAY_GET_CLASS( obj ) \
41 	(G_TYPE_INSTANCE_GET_CLASS( (obj), \
42 		TYPE_IMAGEDISPLAY, ImagedisplayClass ))
43 
44 /* Display an entire image. Put in a scrolled window to see just part of it.
45  */
46 struct _Imagedisplay {
47 	GtkDrawingArea parent_object;
48 
49 	/* Image we display.
50 	 */
51 	Conversion *conv;		/* Conversion we display */
52 	guint changed_sid;		/* Watch conv with these */
53 	guint area_changed_sid;
54 	gboolean shrink_to_fit; 	/* Auto-shrink mode */
55 
56 	/* GCs also used by region paint.
57 	 */
58 	GdkGC *back_gc;
59 	GdkGC *top_gc;
60 	GdkGC *bottom_gc;
61 };
62 
63 /* Class structure.
64  */
65 typedef struct _ImagedisplayClass {
66 	/* Drawing area we paint in.
67 	 */
68 	GtkDrawingAreaClass parent_class;
69 
70 	/* Virtual methods.
71 	 */
72 	void (*conversion_changed)( Imagedisplay * );
73 	void (*area_changed)( Imagedisplay *, Rect * );
74 } ImagedisplayClass;
75 
76 void imagedisplay_queue_draw_area( Imagedisplay *id, Rect *area );
77 GType imagedisplay_get_type( void );
78 void imagedisplay_set_conversion( Imagedisplay *id, Conversion *conv );
79 Imagedisplay *imagedisplay_new( Conversion *conv );
80 void imagedisplay_set_shrink_to_fit( Imagedisplay *id, gboolean shrink_to_fit );
81