1 /* a column 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_COLUMN (column_get_type())
31 #define COLUMN( obj ) \
32 	(G_TYPE_CHECK_INSTANCE_CAST( (obj), TYPE_COLUMN, Column ))
33 #define COLUMN_CLASS( klass ) \
34 	(G_TYPE_CHECK_CLASS_CAST( (klass), TYPE_COLUMN, ColumnClass))
35 #define IS_COLUMN( obj ) \
36 	(G_TYPE_CHECK_INSTANCE_TYPE( (obj), TYPE_COLUMN ))
37 #define IS_COLUMN_CLASS( klass ) \
38 	(G_TYPE_CHECK_CLASS_TYPE( (klass), TYPE_COLUMN ))
39 #define COLUMN_GET_CLASS( obj ) \
40 	(G_TYPE_INSTANCE_GET_CLASS( (obj), TYPE_COLUMN, ColumnClass ))
41 
42 struct _Column {
43 	Filemodel parent_object;
44 
45 	/* Our context.
46 	 */
47 	Subcolumn *scol;	/* Subcolumn we enclose */
48 	Workspace *ws;		/* Enclosing workspace */
49 
50         /* Appearance state info.
51          */
52         int x, y;		/* Position */
53         gboolean open;		/* Currently popped down */
54         gboolean selected;
55 
56 	/* Other state.
57 	 */
58         int next;		/* Index of next symbol we make */
59         Row *last_select;	/* Last row clicked ... for x sel */
60 
61 	/* A pending scrollto.
62 	 */
63 	guint scrollto_timeout;
64 	ModelScrollPosition pending_position;
65 };
66 
67 typedef struct _ColumnClass {
68 	FilemodelClass parent_class;
69 
70 	/* My methods.
71 	 */
72 } ColumnClass;
73 
74 void *column_map( Column *col, row_map_fn fn, void *a, void *b );
75 void *column_map_symbol( Column *col, symbol_map_fn fn, void *a );
76 
77 void *column_select_symbols( Column *col );
78 
79 GtkType column_get_type( void );
80 
81 Column *column_new( Workspace *ws, const char *name );
82 
83 Column *column_get_last_new( void );
84 void column_clear_last_new( void );
85 
86 Row *column_get_bottom( Column *col );
87 gboolean column_add_n_names( Column *col,
88 	const char *name, VipsBuf *buf, int nparam );
89 gboolean column_is_empty( Column *col );
90 
91 void column_set_offset( int x_off, int y_off );
92 
93 char *column_name_new( Column *col );
94 
95 void column_set_open( Column *col, gboolean open );
96 
97 void column_scrollto( Column *col, ModelScrollPosition position );
98