1 /* a ip image class in a workspace
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_IIMAGE (iimage_get_type())
31 #define IIMAGE( obj ) \
32 	(G_TYPE_CHECK_INSTANCE_CAST( (obj), TYPE_IIMAGE, iImage ))
33 #define IIMAGE_CLASS( klass ) \
34 	(G_TYPE_CHECK_CLASS_CAST( (klass), TYPE_IIMAGE, iImageClass))
35 #define IS_IIMAGE( obj ) \
36 	(G_TYPE_CHECK_INSTANCE_TYPE( (obj), TYPE_IIMAGE ))
37 #define IS_IIMAGE_CLASS( klass ) \
38 	(G_TYPE_CHECK_CLASS_TYPE( (klass), TYPE_IIMAGE ))
39 #define IIMAGE_GET_CLASS( obj ) \
40 	(G_TYPE_INSTANCE_GET_CLASS( (obj), TYPE_IIMAGE, iImageClass ))
41 
42 struct _iImage {
43 	Classmodel parent_class;
44 
45 	/* Class fields.
46 	 */
47 	ImageValue value;
48 
49 	/* List of classmodel which have displays on us.
50 	 */
51 	GSList *classmodels;
52 
53 	/* List of popup imageview windows we've made.
54 	 */
55 	GSList *views;
56 
57 	/* Track display pos/size/etc. here.
58 	 */
59 	int image_left, image_top;	/* Scroll position */
60 	int image_mag;			/* Scale */
61 
62 	/* View attachments.
63 	 */
64 	gboolean show_status;
65 	gboolean show_paintbox;
66 	gboolean show_convert;
67 	gboolean show_rulers;
68 
69 	/* Bar settings we remember.
70 	 */
71 	double scale, offset;
72 	gboolean falsecolour;
73 	gboolean type;
74 
75 	/* Private ... build iobject caption here.
76 	 */
77 	VipsBuf caption_buffer;
78 };
79 
80 typedef struct _iImageClass {
81 	ClassmodelClass parent_class;
82 
83 	/* My methods.
84 	 */
85 } iImageClass;
86 
87 GType iimage_get_type( void );
88 gboolean iimage_replace( iImage *iimage, const char *filename );
89 void iimage_header( GtkWidget *parent, Model *model );
90