Silence GTK deprecation warning in unused function
[geeqie.git] / src / ui-tree-edit.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 UI_TREE_EDIT_H
23 #define UI_TREE_EDIT_H
24
25 #include <gdk/gdk.h>
26 #include <glib.h>
27 #include <gtk/gtk.h>
28
29 struct TreeEditData
30 {
31         GtkWidget *window;
32         GtkWidget *entry;
33
34         gchar *old_name;
35         gchar *new_name;
36
37         gint (*edit_func)(TreeEditData *ted, const gchar *oldname, const gchar *newname, gpointer data);
38         gpointer edit_data;
39
40         GtkTreeView *tree;
41         GtkTreePath *path;
42         GtkTreeViewColumn *column;
43         GtkCellRenderer *cell;
44 };
45
46
47 /**
48  * @headerfile  tree_edit_by_path
49  * edit_func: return TRUE if rename successful, FALSE on failure.
50  */
51 gboolean tree_edit_by_path(GtkTreeView *tree, GtkTreePath *tpath, gint column, const gchar *text,
52                            gboolean (*edit_func)(TreeEditData *, const gchar *, const gchar *, gpointer), gpointer data);
53
54
55 /**
56  * @headerfile tree_view_get_cell_origin
57  * returns location of cell in screen coordinates
58  */
59 gboolean tree_view_get_cell_origin(GtkTreeView *widget, GtkTreePath *tpath, gint column, gboolean text_cell_only,
60                                    gint *x, gint *y, gint *width, gint *height);
61
62 /**
63  * @headerfile tree_view_get_cell_clamped
64  * similar to above, but limits the returned area to that of the tree window
65  */
66 void tree_view_get_cell_clamped(GtkTreeView *widget, GtkTreePath *tpath, gint column, gboolean text_cell_only,
67                                gint *x, gint *y, gint *width, gint *height);
68
69 /**
70  * @headerfile tree_view_row_get_visibility
71  * return 0 = row visible, -1 = row is above, 1 = row is below visible region \n
72  * if fully_visible is TRUE, the behavior changes to return -1/1 if _any_ part of the cell is out of view
73  */
74 gint tree_view_row_get_visibility(GtkTreeView *widget, GtkTreeIter *iter, gboolean fully_visible);
75
76 /**
77  * @headerfile tree_view_row_make_visible
78  * scrolls to make row visible, if necessary
79  * return is same as above (before the scroll)
80  */
81 gint tree_view_row_make_visible(GtkTreeView *widget, GtkTreeIter *iter, gboolean center);
82
83 /**
84  * @headerfile tree_view_move_cursor_away
85  * if iter is location of cursor, moves cursor to nearest row
86  */
87 gboolean tree_view_move_cursor_away(GtkTreeView *widget, GtkTreeIter *iter, gboolean only_selected);
88
89 /**
90  * @headerfile shift_color
91  * shifts a GdkRGBA values lighter or darker \n
92  * val is percent from 1 to 100, or -1 for default (usually 10%) \n
93  * direction is -1 darker, 0 auto, 1 lighter
94  */
95 void shift_color(GdkRGBA *src, gshort val, gint direction);
96
97 /**
98  * @def STYLE_SHIFT_STANDARD
99  * The standard shift percent for alternating list row colors
100  */
101 #define STYLE_SHIFT_STANDARD 10
102
103 /**
104  * @headerfile widget_auto_scroll_start
105  * auto scroll, set scroll_speed or region_size to -1 to their respective the defaults
106  * notify_func will be called before a scroll, return FALSE to turn off autoscroll
107  */
108 gint widget_auto_scroll_start(GtkWidget *widget, GtkAdjustment *v_adj, gint scroll_speed, gint region_size,
109                               gint (*notify_func)(GtkWidget *widget, gint x, gint y, gpointer data), gpointer notify_data);
110 void widget_auto_scroll_stop(GtkWidget *widget);
111
112
113 /*
114  * Various g_list utils, do not really fit anywhere, so they are here.
115  */
116 GList *uig_list_insert_link(GList *list, GList *link, gpointer data);
117 GList *uig_list_insert_list(GList *parent, GList *insert_link, GList *list);
118
119
120 #endif
121 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */