annotate src/ui_tree_edit.h @ 458:7a69309b91c8

Allow the user to set the drag'n drop icon size through Preferences > Advanced > Behavior > Drag'n drop icon size. It is saved to rc file as dnd_icon_size.
author zas_
date Mon, 21 Apr 2008 10:09:01 +0000
parents ddabc4873a3f
children 48c8e49b571c
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
4 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
5 * Author: John Ellis
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
6 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
7 * This software is released under the GNU General Public License (GNU GPL).
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
8 * Please read the included file COPYING for more information.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
9 * 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
10 */
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 #ifndef UI_TREE_EDIT_H
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
14 #define UI_TREE_EDIT_H
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
15
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 typedef struct _TreeEditData TreeEditData;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
18 struct _TreeEditData
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
19 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
20 GtkWidget *window;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
21 GtkWidget *entry;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
22
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
23 gchar *old_name;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
24 gchar *new_name;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
25
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
26 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
27 gpointer edit_data;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
28
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
29 GtkTreeView *tree;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
30 GtkTreePath *path;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
31 GtkTreeViewColumn *column;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
32 GtkCellRenderer *cell;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
33 };
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 * edit_func: return TRUE if rename successful, FALSE on failure.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
38 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
39 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
40 gint (*edit_func)(TreeEditData *, const gchar *, const gchar *, gpointer), gpointer data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
41
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 /* returns location of cell in screen coordinates */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
44 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
45 gint *x, gint *y, gint *width, gint *height);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
46 /* 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
47 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
48 gint *x, gint *y, gint *width, gint *height);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
49
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
50 /* 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
51 * 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
52 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
53
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
54 /* scrolls to make row visible, if necessary
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
55 * return is same as above (before the scroll)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
56 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
57 gint tree_view_row_make_visible(GtkTreeView *widget, GtkTreeIter *iter, gint center);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
58
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
59 /* if iter is location of cursor, moves cursor to nearest row */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
60 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
61
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
62 /* utility to return row position of given GtkTreePath
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
63 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
64 gint tree_path_to_row(GtkTreePath *tpath);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
65
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 /* shifts a GdkColor values lighter or darker
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
68 * 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
69 * direction is -1 darker, 0 auto, 1 lighter
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
70 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
71 void shift_color(GdkColor *src, gshort val, gint direction);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
72
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 * Shifts a style's color for given state
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
75 * Useful for alternating dark/light rows in lists.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
76 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
77 * shift_value is 1 to 100, representing the percent of the shift.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
78 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
79 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
80
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 * The standard shift percent for alternating list row colors
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
83 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
84 #define STYLE_SHIFT_STANDARD 10
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
85
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 * 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
88 * 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
89 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
90 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
91 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
92 void widget_auto_scroll_stop(GtkWidget *widget);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
93
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 * 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
97 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
98 GList *uig_list_insert_link(GList *list, GList *link, gpointer data);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
99 GList *uig_list_insert_list(GList *parent, GList *insert_link, GList *list);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
100
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 #endif