Cleanup main.h header
[geeqie.git] / src / pan-view / pan-item.h
1 /*
2  * Copyright (C) 2006 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 PAN_VIEW_PAN_ITEM_H
23 #define PAN_VIEW_PAN_ITEM_H
24
25 #include "pan-types.h"
26 #include "pixbuf-renderer.h"
27
28 void pan_item_free(PanItem *pi);
29
30 void pan_item_set_key(PanItem *pi, const gchar *key);
31 void pan_item_added(PanWindow *pw, PanItem *pi);
32 void pan_item_remove(PanWindow *pw, PanItem *pi);
33
34 // Determine sizes
35 void pan_item_size_by_item(PanItem *pi, PanItem *child, gint border);
36 void pan_item_size_coordinates(PanItem *pi, gint border, gint *w, gint *h);
37
38 // Find items
39 PanItem *pan_item_find_by_key(PanWindow *pw, PanItemType type, const gchar *key);
40 GList *pan_item_find_by_path(PanWindow *pw, PanItemType type, const gchar *path,
41                              gboolean ignore_case, gboolean partial);
42 GList *pan_item_find_by_fd(PanWindow *pw, PanItemType type, FileData *fd,
43                            gboolean ignore_case, gboolean partial);
44 PanItem *pan_item_find_by_coord(PanWindow *pw, PanItemType type,
45                                 gint x, gint y, const gchar *key);
46
47 // Item box type
48 PanItem *pan_item_box_new(PanWindow *pw, FileData *fd, gint x, gint y, gint width, gint height,
49                           gint border_size,
50                           guint8 base_r, guint8 base_g, guint8 base_b, guint8 base_a,
51                           guint8 bord_r, guint8 bord_g, guint8 bord_b, guint8 bord_a);
52 void pan_item_box_shadow(PanItem *pi, gint offset, gint fade);
53 gint pan_item_box_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *pr,
54                        gint x, gint y, gint width, gint height);
55
56 // Item triangle type
57 PanItem *pan_item_tri_new(PanWindow *pw, FileData *fd, gint x, gint y, gint width, gint height,
58                           gint x1, gint y1, gint x2, gint y2, gint x3, gint y3,
59                           guint8 r, guint8 g, guint8 b, guint8 a);
60 void pan_item_tri_border(PanItem *pi, gint borders,
61                          guint8 r, guint8 g, guint8 b, guint8 a);
62 gint pan_item_tri_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *pr,
63                        gint x, gint y, gint width, gint height);
64
65 // Item text type
66 PanItem *pan_item_text_new(PanWindow *pw, gint x, gint y, const gchar *text,
67                            PanTextAttrType attr, PanBorderType border,
68                            guint8 r, guint8 g, guint8 b, guint8 a);
69 gint pan_item_text_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *pr,
70                         gint x, gint y, gint width, gint height);
71
72 // Item thumbnail type
73 PanItem *pan_item_thumb_new(PanWindow *pw, FileData *fd, gint x, gint y);
74 gint pan_item_thumb_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *pr,
75                          gint x, gint y, gint width, gint height);
76
77 // Item image type
78 PanItem *pan_item_image_new(PanWindow *pw, FileData *fd, gint x, gint y, gint w, gint h);
79 gint pan_item_image_draw(PanWindow *pw, PanItem *pi, GdkPixbuf *pixbuf, PixbufRenderer *pr,
80                          gint x, gint y, gint width, gint height);
81
82 // Alignment
83 struct PanTextAlignment {
84         PanWindow *pw;
85
86         GList *column1;
87         GList *column2;
88
89         gint x;
90         gint y;
91         gchar *key;
92 };
93
94 PanTextAlignment *pan_text_alignment_new(PanWindow *pw, gint x, gint y, const gchar *key);
95 void pan_text_alignment_free(PanTextAlignment *ta);
96
97 PanItem *pan_text_alignment_add(PanTextAlignment *ta, const gchar *label, const gchar *text);
98 void pan_text_alignment_calc(PanTextAlignment *ta, PanItem *box);
99
100 #endif