From be25ab672d09b2db00cdf1047a0651468c495564 Mon Sep 17 00:00:00 2001 From: Till Adam Date: Tue, 5 Mar 2002 17:14:10 +0000 Subject: [PATCH] * remove a bunch of unused variables * scrollbars should not need to know the dir the view they are part of is in, because that can change without further notice. Access the dir through scrollbar->view->model->dir and replace the dir with the name of the view for named callbacks SVN revision: 6040 --- src/iconbar.c | 3 +-- src/menubuild.c | 2 +- src/scrollbar.c | 46 +++++++++++++++++++++++++++------------------- src/scrollbar.h | 1 - src/view.c | 1 - src/view_layout.c | 5 ++--- 6 files changed, 31 insertions(+), 27 deletions(-) diff --git a/src/iconbar.c b/src/iconbar.c index 4f4abdce2..f88da85f5 100644 --- a/src/iconbar.c +++ b/src/iconbar.c @@ -382,7 +382,6 @@ void e_iconbar_realize(E_Iconbar * ib) { Evas_List l; - double x, y, w, h; D_ENTER; D("realize iconbar\n"); @@ -521,7 +520,7 @@ e_iconbar_fix(E_Iconbar * ib) &x, &y, &w, &h)) { D("Error: no geometry for iconbar, must not exist, clean it up.\n"); - e_object_unref(ib); + e_object_unref(E_OBJECT (ib)); D_RETURN; } diff --git a/src/menubuild.c b/src/menubuild.c index 29c69bd77..85cbb5d66 100644 --- a/src/menubuild.c +++ b/src/menubuild.c @@ -610,7 +610,7 @@ static E_Menu * e_build_menu_iconified_borders_build(E_Build_Menu * bm) { E_Menu *menu = NULL; - Evas_List l, entries = NULL; + Evas_List l; D_ENTER; diff --git a/src/scrollbar.c b/src/scrollbar.c index 78e9ce1b8..3b6e8d7c7 100644 --- a/src/scrollbar.c +++ b/src/scrollbar.c @@ -81,7 +81,8 @@ e_scrollbar_setup_bits(E_Scrollbar * sb) if (sb->direction == 1) { /* load from the current dir's layout */ - snprintf(buf, PATH_MAX, "%s/.e_layout/scroll_base_v.bits.db", sb->dir); + snprintf(buf, PATH_MAX, "%s/.e_layout/scroll_base_v.bits.db", + sb->view->model->dir); sb->base = ebits_load(buf); /* if not loaded, load defaults */ @@ -93,7 +94,8 @@ e_scrollbar_setup_bits(E_Scrollbar * sb) } /* load from current dir's layout */ - snprintf(buf, PATH_MAX, "%s/.e_layout/scroll_bar_v.bits.db", sb->dir); + snprintf(buf, PATH_MAX, "%s/.e_layout/scroll_bar_v.bits.db", + sb->view->model->dir); sb->bar = ebits_load(buf); /* if not loaded, load defaults */ @@ -107,7 +109,8 @@ e_scrollbar_setup_bits(E_Scrollbar * sb) else { /* load from the current dir's layout */ - snprintf(buf, PATH_MAX, "%s/.e_layout/scroll_base_h.bits.db", sb->dir); + snprintf(buf, PATH_MAX, "%s/.e_layout/scroll_base_h.bits.db", + sb->view->model->dir); sb->base = ebits_load(buf); /* if not loaded, load defaults */ @@ -119,7 +122,8 @@ e_scrollbar_setup_bits(E_Scrollbar * sb) } /* load from current dir's layout */ - snprintf(buf, PATH_MAX, "%s/.e_layout/scroll_bar_h.bits.db", sb->dir); + snprintf(buf, PATH_MAX, "%s/.e_layout/scroll_bar_h.bits.db", + sb->view->model->dir); sb->bar = ebits_load(buf); /* if not loaded, load defaults */ @@ -203,7 +207,8 @@ e_sb_base_down_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y, sb->scroll_step = -16; sb->scroll_speed = 0.01; - snprintf(name, PATH_MAX, "scroll_up.%i.%s", sb->direction, sb->dir); + snprintf(name, PATH_MAX, "scroll_up.%i.%s", sb->direction, + sb->view->name); ecore_add_event_timer(name, sb->scroll_speed, e_sb_scroll_timer, 0, sb); } @@ -212,7 +217,8 @@ e_sb_base_down_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y, sb->scroll_step = 16; sb->scroll_speed = 0.01; - snprintf(name, PATH_MAX, "scroll_down.%i.%s", sb->direction, sb->dir); + snprintf(name, PATH_MAX, "scroll_down.%i.%s", sb->direction, + sb->view->name); ecore_add_event_timer(name, sb->scroll_speed, e_sb_scroll_timer, 0, sb); } @@ -235,12 +241,12 @@ e_sb_base_down_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y, { sb->scroll_step = -sb->scroll_step; snprintf(name, PATH_MAX, "scroll_up.%i.%s", sb->direction, - sb->dir); + sb->view->name); } else /* scroll down (or right) */ { snprintf(name, PATH_MAX, "scroll_down.%i.%s", sb->direction, - sb->dir); + sb->view->name); } /* scroll once in the chosen direction */ @@ -314,7 +320,8 @@ e_sb_base_up_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y, { sb->scroll_step = 0; - snprintf(name, PATH_MAX, "scroll_up.%i.%s", sb->direction, sb->dir); + snprintf(name, PATH_MAX, "scroll_up.%i.%s", sb->direction, + sb->view->name); ecore_del_event_timer(name); } @@ -322,7 +329,8 @@ e_sb_base_up_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y, { sb->scroll_step = 0; - snprintf(name, PATH_MAX, "scroll_down.%i.%s", sb->direction, sb->dir); + snprintf(name, PATH_MAX, "scroll_down.%i.%s", sb->direction, + sb->view->name); ecore_del_event_timer(name); } @@ -332,14 +340,14 @@ e_sb_base_up_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y, { sb->scroll_step = 0; snprintf(name, PATH_MAX, "scroll_up.%i.%s", sb->direction, - sb->dir); + sb->view->name); ecore_del_event_timer(name); } else if (sb->scroll_step > 0) { sb->scroll_step = 0; snprintf(name, PATH_MAX, "scroll_down.%i.%s", sb->direction, - sb->dir); + sb->view->name); ecore_del_event_timer(name); } } @@ -396,7 +404,7 @@ e_sb_bar_up_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y, sb->mouse_down = 0; else D_RETURN; - + sb->view->changed = 1; D_RETURN; @@ -484,7 +492,8 @@ e_sb_scroll_timer(int val, void *data) if (sb->val < 0) sb->val = 0; - snprintf(name, PATH_MAX, "scroll_up.%i.%s", sb->direction, sb->dir); + snprintf(name, PATH_MAX, "scroll_up.%i.%s", sb->direction, + sb->view->name); ecore_add_event_timer(name, sb->scroll_speed, e_sb_scroll_timer, 0, sb); } @@ -494,7 +503,8 @@ e_sb_scroll_timer(int val, void *data) if ((sb->val + sb->range) > sb->max) sb->val = sb->max - sb->range; - snprintf(name, PATH_MAX, "scroll_down.%i.%s", sb->direction, sb->dir); + snprintf(name, PATH_MAX, "scroll_down.%i.%s", sb->direction, + sb->view->name); ecore_add_event_timer(name, sb->scroll_speed, e_sb_scroll_timer, 0, sb); } @@ -523,7 +533,6 @@ e_scrollbar_new(E_View * v) e_object_init(E_OBJECT(sb), (E_Cleanup_Func) e_scrollbar_cleanup); sb->view = v; - e_strdup(sb->dir, v->model->dir); sb->range = 1.0; sb->max = 1.0; @@ -547,11 +556,10 @@ e_scrollbar_cleanup(E_Scrollbar * sb) if (sb->bar) ebits_free(sb->bar); } - IF_FREE(sb->dir); - snprintf(name, PATH_MAX, "scroll_up.%i.%s", sb->direction, sb->dir); + snprintf(name, PATH_MAX, "scroll_up.%i.%s", sb->direction, sb->view->name); ecore_del_event_timer(name); - snprintf(name, PATH_MAX, "scroll_down.%i.%s", sb->direction, sb->dir); + snprintf(name, PATH_MAX, "scroll_down.%i.%s", sb->direction, sb->view->name); ecore_del_event_timer(name); e_object_cleanup(E_OBJECT(sb)); diff --git a/src/scrollbar.h b/src/scrollbar.h index cb4dae9c5..5a0472c40 100644 --- a/src/scrollbar.h +++ b/src/scrollbar.h @@ -25,7 +25,6 @@ struct _E_Scrollbar double range; E_View *view; - char *dir; Evas evas; Ebits_Object bar; diff --git a/src/view.c b/src/view.c index e8469d95c..a06de40cc 100644 --- a/src/view.c +++ b/src/view.c @@ -2166,7 +2166,6 @@ e_dnd_data_request(Ecore_Event * ev) * Atom destination_atom; * } Ecore_Event_Dnd_Data_Request; */ - Evas_List l; E_View *v; Evas_List ll; char *data = NULL; diff --git a/src/view_layout.c b/src/view_layout.c index b895ea182..afee6e877 100644 --- a/src/view_layout.c +++ b/src/view_layout.c @@ -3,13 +3,12 @@ #include "util.h" static void e_view_layout_cleanup(E_View_Layout *layout); +static int e_view_layout_add_element(E_View_Layout *layout, char *name); E_View_Layout * e_view_layout_new(E_View *v) { E_View_Layout *layout; - Ebits_Object bits; - char buf[PATH_MAX]; D_ENTER; @@ -116,7 +115,7 @@ e_view_layout_realize(E_View_Layout *layout) D_RETURN; } -int +static int e_view_layout_add_element(E_View_Layout *layout, char *name) { E_View_Layout_Element *el;