1 /*
2  * This is a plug-in for GIMP.
3  *
4  * Generates clickable image maps.
5  *
6  * Copyright (C) 1998-2004 Maurits Rijk  m.rijk@chello.nl
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 3 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
19  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef _IMAP_SELECTION_H
24 #define _IMAP_SELECTION_H
25 
26 #include "imap_command.h"
27 #include "imap_object.h"
28 
29 typedef struct {
30   GtkListStore          *store;
31   GtkTreeSelection      *selection;
32 
33   GtkWidget    *container;
34   GtkWidget    *list;
35   GtkWidget    *selected_child;
36   ObjectList_t *object_list;
37   gint          selected_row;
38   gint          nr_rows;
39   gboolean      is_visible;
40   gboolean      select_lock;
41   gboolean      doubleclick;
42 
43   CommandFactory_t cmd_move_up;
44   CommandFactory_t cmd_move_down;
45   CommandFactory_t cmd_delete;
46   CommandFactory_t cmd_edit;
47 } Selection_t;
48 
49 Selection_t *make_selection(ObjectList_t *list);
50 void selection_toggle_visibility(Selection_t *selection);
51 void selection_freeze(Selection_t *selection);
52 void selection_thaw(Selection_t *selection);
53 
54 #define selection_set_move_up_command(selection, command) \
55         ((selection)->cmd_move_up = (command))
56 #define selection_set_move_down_command(selection, command) \
57         ((selection)->cmd_move_down = (command))
58 #define selection_set_delete_command(selection, command) \
59         ((selection)->cmd_delete = (command))
60 #define selection_set_edit_command(selection, command) \
61         ((selection)->cmd_edit = (command))
62 
63 #endif /* _IMAP_SELECTION_H */
64 
65