Simplify vflist_get_formatted()
[geeqie.git] / src / layout.h
1 /*
2  * Copyright (C) 2004 John Ellis
3  * Copyright (C) 2008 - 2016 The Geeqie Team
4  *
5  * Author: John Ellis
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 LAYOUT_H
23 #define LAYOUT_H
24
25 #define LAYOUT_ID_CURRENT "_current_"
26
27 extern GList *layout_window_list;
28
29
30 LayoutWindow *layout_new(FileData *dir_fd, LayoutOptions *lop);
31 LayoutWindow *layout_new_with_geometry(FileData *dir_fd, LayoutOptions *lop,
32                                        const gchar *geometry);
33 LayoutWindow *layout_new_from_config(const gchar **attribute_names, const gchar **attribute_values, gboolean use_commandline);
34 void layout_update_from_config(LayoutWindow *lw, const gchar **attribute_names, const gchar **attribute_values);
35 LayoutWindow *layout_new_from_default();
36
37 void layout_close(LayoutWindow *lw);
38 void layout_free(LayoutWindow *lw);
39
40 gboolean layout_valid(LayoutWindow **lw);
41
42 void layout_show_config_window(LayoutWindow *lw);
43
44 void layout_apply_options(LayoutWindow *lw, LayoutOptions *lop);
45
46 void layout_sync_options_with_current_state(LayoutWindow *lw);
47 void layout_load_attributes(LayoutOptions *layout, const gchar **attribute_names, const gchar **attribute_values);
48 void layout_write_attributes(LayoutOptions *layout, GString *outstr, gint indent);
49 void layout_write_config(LayoutWindow *lw, GString *outstr, gint indent);
50
51
52 LayoutWindow *layout_find_by_image(ImageWindow *imd);
53 LayoutWindow *layout_find_by_image_fd(ImageWindow *imd);
54 LayoutWindow *layout_find_by_layout_id(const gchar *id);
55
56
57 const gchar *layout_get_path(LayoutWindow *lw);
58 gboolean layout_set_path(LayoutWindow *lw, const gchar *path);
59 gboolean layout_set_fd(LayoutWindow *lw, FileData *fd);
60
61 void layout_status_update_progress(LayoutWindow *lw, gdouble val, const gchar *text);
62 void layout_status_update_info(LayoutWindow *lw, const gchar *text);
63 void layout_status_update_image(LayoutWindow *lw);
64 void layout_status_update_all(LayoutWindow *lw);
65
66 GList *layout_list(LayoutWindow *lw);
67 guint layout_list_count(LayoutWindow *lw, gint64 *bytes);
68 FileData *layout_list_get_fd(LayoutWindow *lw, gint index);
69 gint layout_list_get_index(LayoutWindow *lw, FileData *fd);
70 void layout_list_sync_fd(LayoutWindow *lw, FileData *fd);
71
72 GList *layout_selection_list(LayoutWindow *lw);
73 /* return list of pointers to int for selection */
74 GList *layout_selection_list_by_index(LayoutWindow *lw);
75 guint layout_selection_count(LayoutWindow *lw, gint64 *bytes);
76 void layout_select_all(LayoutWindow *lw);
77 void layout_select_none(LayoutWindow *lw);
78 void layout_select_invert(LayoutWindow *lw);
79 void layout_select_list(LayoutWindow *lw, GList *list);
80
81 void layout_mark_to_selection(LayoutWindow *lw, gint mark, MarkToSelectionMode mode);
82 void layout_selection_to_mark(LayoutWindow *lw, gint mark, SelectionToMarkMode mode);
83
84 void layout_mark_filter_toggle(LayoutWindow *lw, gint mark);
85
86 void layout_refresh(LayoutWindow *lw);
87
88 void layout_thumb_set(LayoutWindow *lw, gboolean enable);
89 gboolean layout_thumb_get(LayoutWindow *lw);
90
91 void layout_marks_set(LayoutWindow *lw, gboolean enable);
92 gboolean layout_marks_get(LayoutWindow *lw);
93
94 void layout_file_filter_set(LayoutWindow *lw, gboolean enable);
95
96 void layout_sort_set(LayoutWindow *lw, SortType type, gboolean ascend);
97 gboolean layout_sort_get(LayoutWindow *lw, SortType *type, gboolean *ascend);
98
99 gboolean layout_geometry_get(LayoutWindow *lw, gint *x, gint *y, gint *w, gint *h);
100 gboolean layout_geometry_get_dividers(LayoutWindow *lw, gint *h, gint *v);
101
102 void layout_views_set(LayoutWindow *lw, DirViewType dir_view_type, FileViewType file_view_type);
103 gboolean layout_views_get(LayoutWindow *lw, DirViewType *dir_view_type, FileViewType *file_view_type);
104
105 void layout_views_set_sort(LayoutWindow *lw, SortType method, gboolean ascend);
106
107 void layout_status_update(LayoutWindow *lw, const gchar *text);
108
109 void layout_style_set(LayoutWindow *lw, gint style, const gchar *order);
110
111 void layout_menu_update_edit(void);
112 void layout_styles_update(void);
113 void layout_colors_update(void);
114
115
116 gboolean layout_geometry_get_tools(LayoutWindow *lw, gint *x, gint *y, gint *w, gint *h, gint *divider_pos);
117 void layout_tools_float_set(LayoutWindow *lw, gboolean popped, gboolean hidden);
118 gboolean layout_tools_float_get(LayoutWindow *lw, gboolean *popped, gboolean *hidden);
119
120 void layout_tools_float_toggle(LayoutWindow *lw);
121 void layout_tools_hide_toggle(LayoutWindow *lw);
122
123
124 void layout_toolbar_toggle(LayoutWindow *lw);
125 void layout_info_pixel_set(LayoutWindow *lw, gboolean show);
126
127 void layout_split_change(LayoutWindow *lw, ImageSplitMode mode);
128
129 void save_layout(LayoutWindow *lw);
130 gchar *layout_get_unique_id();
131 #endif
132 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */