1 /* a row in a workspace ... part of a subcolumn 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_ROW (row_get_type()) 31 #define ROW( obj ) \ 32 (G_TYPE_CHECK_INSTANCE_CAST( (obj), TYPE_ROW, Row )) 33 #define ROW_CLASS( klass ) \ 34 (G_TYPE_CHECK_CLASS_CAST( (klass), TYPE_ROW, RowClass)) 35 #define IS_ROW( obj ) \ 36 (G_TYPE_CHECK_INSTANCE_TYPE( (obj), TYPE_ROW )) 37 #define IS_ROW_CLASS( klass ) \ 38 (G_TYPE_CHECK_CLASS_TYPE( (klass), TYPE_ROW )) 39 #define ROW_GET_CLASS( obj ) \ 40 (G_TYPE_INSTANCE_GET_CLASS( (obj), TYPE_ROW, RowClass )) 41 42 /* For when we're flashing the showstate up. 43 */ 44 typedef enum { 45 ROW_SHOW_NONE, 46 ROW_SHOW_PARENT, 47 ROW_SHOW_CHILD 48 } RowShowState; 49 50 struct _Row { 51 Heapmodel parent_class; 52 53 /* Our context. 54 */ 55 Subcolumn *scol; /* Enclosing subcolumn */ 56 Rhs *child_rhs; /* Child RHS */ 57 Column *top_col; /* Enclosing top level column */ 58 Workspace *ws; /* Enclosing workspace */ 59 Row *top_row; /* Enclosing root row */ 60 61 Symbol *sym; /* Symbol we represent */ 62 63 Expr *expr; /* The expr we edit */ 64 gboolean err; /* Set if this row is on the error list */ 65 66 gboolean selected; /* Selected or not */ 67 gboolean is_class; /* Display spin buttons */ 68 gboolean popup; /* Set to pop up view on 1st display */ 69 gboolean to_save; /* Should be saved (part of only-save-modded) */ 70 71 GSList *parents; /* rows which depend on us */ 72 GSList *children; /* rows we depend on */ 73 gboolean dirty; /* If we're marked for recomp */ 74 GSList *recomp; /* If root of class display, subs to recomp */ 75 GSList *recomp_save; /* Previous recomp list */ 76 77 gboolean depend; /* For spotting dependency loops */ 78 79 RowShowState show; /* For showing parent/child stuff */ 80 }; 81 82 typedef struct _RowClass { 83 HeapmodelClass parent_class; 84 85 /* My methods. 86 */ 87 } RowClass; 88 89 const char *row_name( Row *row ); 90 void row_qualified_name_relative( Symbol *context, Row *row, VipsBuf *buf ); 91 void row_qualified_name( Row *row, VipsBuf *buf ); 92 void *row_name_print( Row *row ); 93 94 void row_error_set( Row *row ); 95 void row_error_clear( Row *row ); 96 97 Workspace *row_get_workspace( Row *row ); 98 99 GType row_get_type( void ); 100 void row_link_symbol( Row *row, Symbol *sym, PElement *root ); 101 Row *row_new( Subcolumn *scol, Symbol *sym, PElement *root ); 102 103 void *row_dirty( Row *row, gboolean clear_dirty ); 104 void *row_dirty_intrans( Row *row, gboolean clear_dirty ); 105 106 void row_recomp( Row *row ); 107 108 void *row_is_selected( Row *row ); 109 void *row_deselect( Row *row ); 110 void *row_select_ensure( Row *row ); 111 void *row_select( Row *row ); 112 void *row_select_extend( Row *row ); 113 void *row_select_toggle( Row *row ); 114 void row_select_modifier( Row *row, guint state ); 115 116 void row_show_dependents( Row *row ); 117 void row_hide_dependents( Row *row ); 118 void row_set_status( Row *row ); 119 120 Row *row_parse_name( Symbol *context, const char *path ); 121 122