annotate src/ui_tree_edit.h @ 671:8268cbe682f1

Include debug.h from main.h since debug macros may be used anywhere in the code.
author zas_
date Fri, 16 May 2008 10:02:56 +0000
parents 48c8e49b571c
children 1646720364cf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2 * (SLIK) SimpLIstic sKin functions
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
3 * (C) 2004 John Ellis
475
48c8e49b571c updated copyright in source files
nadvornik
parents: 446
diff changeset
4 * Copyright (C) 2008 The Geeqie Team
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
5 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
6 * Author: John Ellis
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
7 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
8 * This software is released under the GNU General Public License (GNU GPL).
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
9 * Please read the included file COPYING for more information.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
10 * This software comes with no warranty of any kind, use at your own risk!
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
11 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
12
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
13
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
14 #ifndef UI_TREE_EDIT_H
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
15 #define UI_TREE_EDIT_H
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
16
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
17
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
18 typedef struct _TreeEditData TreeEditData;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
19 struct _TreeEditData
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
20 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
21 GtkWidget *window;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
22 GtkWidget *entry;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
23
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
24 gchar *old_name;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
25 gchar *new_name;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
26
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
27 gint (*edit_func)(TreeEditData *ted, const gchar *oldname, const gchar *newname, gpointer data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
28 gpointer edit_data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
29
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
30 GtkTreeView *tree;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
31 GtkTreePath *path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
32 GtkTreeViewColumn *column;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
33 GtkCellRenderer *cell;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
34 };
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
35
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
36
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
37 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
38 * edit_func: return TRUE if rename successful, FALSE on failure.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
39 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
40 gint tree_edit_by_path(GtkTreeView *tree, GtkTreePath *tpath, gint column, const gchar *text,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
41 gint (*edit_func)(TreeEditData *, const gchar *, const gchar *, gpointer), gpointer data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
42
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
43
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
44 /* returns location of cell in screen coordinates */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
45 gint tree_view_get_cell_origin(GtkTreeView *widget, GtkTreePath *tpath, gint column, gint text_cell_only,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
46 gint *x, gint *y, gint *width, gint *height);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
47 /* similar to above, but limits the returned area to that of the tree window */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
48 void tree_view_get_cell_clamped(GtkTreeView *widget, GtkTreePath *tpath, gint column, gint text_cell_only,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
49 gint *x, gint *y, gint *width, gint *height);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
50
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
51 /* return 0 = row visible, -1 = row is above, 1 = row is below visible region
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
52 * if fully_visible is TRUE, the bahavior changes to return -1/1 if _any_ part of the cell is out of view */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
53 gint tree_view_row_get_visibility(GtkTreeView *widget, GtkTreeIter *iter, gint fully_visible);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
54
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
55 /* scrolls to make row visible, if necessary
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
56 * return is same as above (before the scroll)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
57 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
58 gint tree_view_row_make_visible(GtkTreeView *widget, GtkTreeIter *iter, gint center);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
59
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
60 /* if iter is location of cursor, moves cursor to nearest row */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
61 gint tree_view_move_cursor_away(GtkTreeView *widget, GtkTreeIter *iter, gint only_selected);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
62
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
63 /* utility to return row position of given GtkTreePath
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
64 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
65 gint tree_path_to_row(GtkTreePath *tpath);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
66
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
67
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
68 /* shifts a GdkColor values lighter or darker
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
69 * val is percent from 1 to 100, or -1 for default (usually 10%)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
70 * direction is -1 darker, 0 auto, 1 lighter
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
71 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
72 void shift_color(GdkColor *src, gshort val, gint direction);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
73
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
74 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
75 * Shifts a style's color for given state
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
76 * Useful for alternating dark/light rows in lists.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
77 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
78 * shift_value is 1 to 100, representing the percent of the shift.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
79 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
80 void style_shift_color(GtkStyle *style, GtkStateType type, gshort shift_value, gint direction);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
81
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
82 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
83 * The standard shift percent for alternating list row colors
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
84 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
85 #define STYLE_SHIFT_STANDARD 10
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
86
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
87 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
88 * auto scroll, set scroll_speed or region_size to -1 to their respective the defaults
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
89 * notify_func will be called before a scroll, return FALSE to turn off autoscroll
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
90 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
91 gint widget_auto_scroll_start(GtkWidget *widget, GtkAdjustment *v_adj, gint scroll_speed, gint region_size,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
92 gint (*notify_func)(GtkWidget *widget, gint x, gint y, gpointer data), gpointer notify_data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
93 void widget_auto_scroll_stop(GtkWidget *widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
94
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
95
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
96 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
97 * Various g_list utils, do not really fit anywhere, so they are here.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
98 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
99 GList *uig_list_insert_link(GList *list, GList *link, gpointer data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
100 GList *uig_list_insert_list(GList *parent, GList *insert_link, GList *list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
101
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
102
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
103 #endif