comparison src/ui_tree_edit.c @ 1448:89dedc61b1bd

gint -> gboolean.
author zas_
date Sun, 15 Mar 2009 20:16:20 +0000
parents a3d3208b0c50
children 24a12aa0cb54
comparison
equal deleted inserted replaced
1447:a10d70ae85e9 1448:89dedc61b1bd
59 } 59 }
60 } 60 }
61 } 61 }
62 } 62 }
63 63
64 static gint tree_edit_click_end_cb(GtkWidget *widget, GdkEventButton *event, gpointer data) 64 static gboolean tree_edit_click_end_cb(GtkWidget *widget, GdkEventButton *event, gpointer data)
65 { 65 {
66 TreeEditData *ted = data; 66 TreeEditData *ted = data;
67 67
68 tree_edit_do(ted); 68 tree_edit_do(ted);
69 tree_edit_close(ted); 69 tree_edit_close(ted);
70 70
71 return TRUE; 71 return TRUE;
72 } 72 }
73 73
74 static gint tree_edit_click_cb(GtkWidget *widget, GdkEventButton *event, gpointer data) 74 static gboolean tree_edit_click_cb(GtkWidget *widget, GdkEventButton *event, gpointer data)
75 { 75 {
76 TreeEditData *ted = data; 76 TreeEditData *ted = data;
77 77
78 gint x, y; 78 gint x, y;
79 gint w, h; 79 gint w, h;
94 return TRUE; 94 return TRUE;
95 } 95 }
96 return FALSE; 96 return FALSE;
97 } 97 }
98 98
99 static gint tree_edit_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) 99 static gboolean tree_edit_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
100 { 100 {
101 TreeEditData *ted = data; 101 TreeEditData *ted = data;
102 102
103 switch (event->keyval) 103 switch (event->keyval)
104 { 104 {
172 gdk_keyboard_grab(ted->window->window, TRUE, GDK_CURRENT_TIME); 172 gdk_keyboard_grab(ted->window->window, TRUE, GDK_CURRENT_TIME);
173 173
174 return FALSE; 174 return FALSE;
175 } 175 }
176 176
177 gint tree_edit_by_path(GtkTreeView *tree, GtkTreePath *tpath, gint column, const gchar *text, 177 gboolean tree_edit_by_path(GtkTreeView *tree, GtkTreePath *tpath, gint column, const gchar *text,
178 gint (*edit_func)(TreeEditData *, const gchar *, const gchar *, gpointer), gpointer data) 178 gboolean (*edit_func)(TreeEditData *, const gchar *, const gchar *, gpointer), gpointer data)
179 { 179 {
180 TreeEditData *ted; 180 TreeEditData *ted;
181 GtkTreeViewColumn *tcolumn; 181 GtkTreeViewColumn *tcolumn;
182 GtkCellRenderer *cell = NULL; 182 GtkCellRenderer *cell = NULL;
183 GList *list; 183 GList *list;
247 *------------------------------------------------------------------- 247 *-------------------------------------------------------------------
248 * tree cell position retrieval 248 * tree cell position retrieval
249 *------------------------------------------------------------------- 249 *-------------------------------------------------------------------
250 */ 250 */
251 251
252 gint tree_view_get_cell_origin(GtkTreeView *widget, GtkTreePath *tpath, gint column, gint text_cell_only, 252 gboolean tree_view_get_cell_origin(GtkTreeView *widget, GtkTreePath *tpath, gint column, gboolean text_cell_only,
253 gint *x, gint *y, gint *width, gint *height) 253 gint *x, gint *y, gint *width, gint *height)
254 { 254 {
255 gint x_origin, y_origin; 255 gint x_origin, y_origin;
256 gint x_offset, y_offset; 256 gint x_offset, y_offset;
257 gint header_size; 257 gint header_size;
258 GtkTreeViewColumn *tv_column; 258 GtkTreeViewColumn *tv_column;
317 *y = y_origin + rect.y + header_size; 317 *y = y_origin + rect.y + header_size;
318 *height = rect.height; 318 *height = rect.height;
319 return TRUE; 319 return TRUE;
320 } 320 }
321 321
322 void tree_view_get_cell_clamped(GtkTreeView *widget, GtkTreePath *tpath, gint column, gint text_cell_only, 322 void tree_view_get_cell_clamped(GtkTreeView *widget, GtkTreePath *tpath, gint column, gboolean text_cell_only,
323 gint *x, gint *y, gint *width, gint *height) 323 gint *x, gint *y, gint *width, gint *height)
324 { 324 {
325 gint wx, wy, ww, wh; 325 gint wx, wy, ww, wh;
326 GdkWindow *window; 326 GdkWindow *window;
327 327
341 *x = CLAMP(*x, wx, wx + ww - (*width)); 341 *x = CLAMP(*x, wx, wx + ww - (*width));
342 *y = CLAMP(*y, wy, wy + wh); 342 *y = CLAMP(*y, wy, wy + wh);
343 *height = MIN(*height, wy + wh - (*y)); 343 *height = MIN(*height, wy + wh - (*y));
344 } 344 }
345 345
346 gint tree_view_row_get_visibility(GtkTreeView *widget, GtkTreeIter *iter, gint fully_visible) 346 gint tree_view_row_get_visibility(GtkTreeView *widget, GtkTreeIter *iter, gboolean fully_visible)
347 { 347 {
348 GtkTreeModel *store; 348 GtkTreeModel *store;
349 GtkTreePath *tpath; 349 GtkTreePath *tpath;
350 gint cx, cy; 350 gint cx, cy;
351 351
378 if (cy + crect.height < vrect.y) return -1; 378 if (cy + crect.height < vrect.y) return -1;
379 if (cy > vrect.y + vrect.height) return 1; 379 if (cy > vrect.y + vrect.height) return 1;
380 return 0; 380 return 0;
381 } 381 }
382 382
383 gint tree_view_row_make_visible(GtkTreeView *widget, GtkTreeIter *iter, gint center) 383 gint tree_view_row_make_visible(GtkTreeView *widget, GtkTreeIter *iter, gboolean center)
384 { 384 {
385 GtkTreePath *tpath; 385 GtkTreePath *tpath;
386 gint vis; 386 gint vis;
387 387
388 vis = tree_view_row_get_visibility(widget, iter, TRUE); 388 vis = tree_view_row_get_visibility(widget, iter, TRUE);
403 gtk_tree_path_free(tpath); 403 gtk_tree_path_free(tpath);
404 404
405 return vis; 405 return vis;
406 } 406 }
407 407
408 gint tree_view_move_cursor_away(GtkTreeView *widget, GtkTreeIter *iter, gint only_selected) 408 gboolean tree_view_move_cursor_away(GtkTreeView *widget, GtkTreeIter *iter, gboolean only_selected)
409 { 409 {
410 GtkTreeModel *store; 410 GtkTreeModel *store;
411 GtkTreePath *tpath; 411 GtkTreePath *tpath;
412 GtkTreePath *fpath; 412 GtkTreePath *fpath;
413 gboolean move = FALSE; 413 gboolean move = FALSE;
544 544
545 if (sd->timer_id != -1) g_source_remove(sd->timer_id); 545 if (sd->timer_id != -1) g_source_remove(sd->timer_id);
546 g_free(sd); 546 g_free(sd);
547 } 547 }
548 548
549 static gint widget_auto_scroll_cb(gpointer data) 549 static gboolean widget_auto_scroll_cb(gpointer data)
550 { 550 {
551 AutoScrollData *sd = data; 551 AutoScrollData *sd = data;
552 GdkWindow *window; 552 GdkWindow *window;
553 gint x, y; 553 gint x, y;
554 gint w, h; 554 gint w, h;