1 /* a ip region 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_IREGION (iregion_get_type()) 31 #define IREGION( obj ) \ 32 (G_TYPE_CHECK_INSTANCE_CAST( (obj), TYPE_IREGION, iRegion )) 33 #define IREGION_CLASS( klass ) \ 34 (G_TYPE_CHECK_CLASS_CAST( (klass), TYPE_IREGION, iRegionClass)) 35 #define IS_IREGION( obj ) \ 36 (G_TYPE_CHECK_INSTANCE_TYPE( (obj), TYPE_IREGION )) 37 #define IS_IREGION_CLASS( klass ) \ 38 (G_TYPE_CHECK_CLASS_TYPE( (klass), TYPE_IREGION )) 39 #define IREGION_GET_CLASS( obj ) \ 40 (G_TYPE_INSTANCE_GET_CLASS( (obj), TYPE_IREGION, iRegionClass )) 41 42 /* Handy for indexing arrays. 43 */ 44 typedef enum iRegionType { 45 IREGION_MARK = 0, 46 IREGION_HGUIDE, 47 IREGION_VGUIDE, 48 IREGION_ARROW, 49 IREGION_REGION, 50 IREGION_AREA 51 } iRegionType; 52 53 /* Our instance vars ... packaged up for code sharing. 54 */ 55 typedef struct { 56 /* Stuff from the heap. 57 */ 58 Element image_class; /* Child image class */ 59 Imageinfo *ii; 60 Rect area; 61 62 /* Client display stuff. 63 */ 64 Classmodel *classmodel; 65 iRegiongroup *iregiongroup; 66 } iRegionInstance; 67 68 struct _iRegion { 69 iImage parent_class; 70 71 /* Class fields shared with iarrow.c. 72 */ 73 iRegionInstance instance; 74 }; 75 76 typedef struct _iRegionClass { 77 iImageClass parent_class; 78 79 /* My methods. 80 */ 81 } iRegionClass; 82 83 void iregion_instance_destroy( iRegionInstance *instance ); 84 void iregion_instance_init( iRegionInstance *instance, Classmodel *classmodel ); 85 gboolean iregion_instance_update( iRegionInstance *instance, PElement *root ); 86 87 void iregion_edit( GtkWidget *parent, Model *model ); 88 void iregion_parent_add( iContainer *child ); 89 xmlNode *iregion_save( Model *model, xmlNode *xnode ); 90 gboolean iregion_load( Model *model, 91 ModelLoadState *state, Model *parent, xmlNode *xnode ); 92 93 void *iregion_update_heap( Heapmodel *heapmodel ); 94 95 gboolean iregion_class_get( Classmodel *classmodel, PElement *root ); 96 gboolean iregion_class_new( Classmodel *classmodel, 97 PElement *fn, PElement *out ); 98 99 GType iregion_get_type( void ); 100