Deduplicate cr3 image loader
[geeqie.git] / src / bar.h
1 /*
2  * Copyright (C) 2004 John Ellis
3  * Copyright (C) 2008 - 2016 The Geeqie Team
4  *
5  * Author: Vladimir Nadvornik
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21
22 #ifndef BAR_H
23 #define BAR_H
24
25 #include <gdk/gdk.h>
26 #include <glib.h>
27 #include <gtk/gtk.h>
28
29 struct FileData;
30 struct LayoutWindow;
31
32 enum PaneType {
33         PANE_UNDEF = 0,
34         PANE_COMMENT,
35         PANE_EXIF,
36         PANE_HISTOGRAM,
37         PANE_KEYWORDS,
38         PANE_GPS,
39         PANE_RATING
40 };
41
42 struct PaneData {
43         void (*pane_set_fd)(GtkWidget *pane, FileData *fd); /**< filled in by pane */
44         void (*pane_notify_selection)(GtkWidget *pane, gint count); /**< filled in by pane */
45         gint (*pane_event)(GtkWidget *pane, GdkEvent *event); /**< filled in by pane */
46         void (*pane_write_config)(GtkWidget *pane, GString *outstr, gint indent); /**< filled in by pane */
47         GtkWidget *title; /**< filled in by pane */
48         gboolean expanded; /**< filled in by pane */
49         gchar *id; /**< filled in by pane */
50         PaneType type; /**< filled in by pane */
51
52         GtkWidget *bar; /**< filled in by bar */
53         LayoutWindow *lw; /**< filled in by bar */
54 };
55
56
57
58
59 GtkWidget *bar_new(LayoutWindow *lw);
60 GtkWidget *bar_new_from_config(LayoutWindow *lw, const gchar **attribute_names, const gchar **attribute_values);
61 GtkWidget *bar_update_from_config(GtkWidget *bar, const gchar **attribute_names, const gchar **attribute_values, LayoutWindow *lw, gboolean startup);
62
63 void bar_close(GtkWidget *bar);
64
65 void bar_write_config(GtkWidget *bar, GString *outstr, gint indent);
66
67 void bar_populate_default(GtkWidget *bar);
68
69 void bar_add(GtkWidget *bar, GtkWidget *pane);
70 GtkWidget *bar_find_pane_by_id(GtkWidget *bar, PaneType type, const gchar *id);
71
72 void bar_clear(GtkWidget *bar);
73
74 void bar_set_fd(GtkWidget *bar, FileData *fd);
75 void bar_notify_selection(GtkWidget *bar, gint count);
76 gboolean bar_event(GtkWidget *bar, GdkEvent *event);
77
78 GtkWidget *bar_pane_expander_title(const gchar *title);
79 void bar_update_expander(GtkWidget *pane);
80 gboolean bar_pane_translate_title(PaneType type, const gchar *id, gchar **title);
81
82 #endif
83 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */