From 84d0e5b50a136a21b45b605f566359b7ea77e1b4 Mon Sep 17 00:00:00 2001 From: rephorm Date: Mon, 7 Jan 2002 01:37:39 +0000 Subject: [PATCH] convert scrollbar to object system get rid of compiler warnings SVN revision: 5823 --- src/scrollbar.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++-- src/scrollbar.h | 5 ++++- src/view.c | 2 ++ 3 files changed, 57 insertions(+), 3 deletions(-) diff --git a/src/scrollbar.c b/src/scrollbar.c index 950deac86..34895d3bb 100644 --- a/src/scrollbar.c +++ b/src/scrollbar.c @@ -156,6 +156,11 @@ e_sb_base_down_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y, } D_RETURN; + UN(o); + UN(ox); + UN(oy); + UN(ow); + UN(oh); } static void @@ -189,6 +194,13 @@ e_sb_base_up_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y, i } D_RETURN; + UN(o); + UN(x); + UN(y); + UN(ox); + UN(oy); + UN(ow); + UN(oh); } static void @@ -207,6 +219,14 @@ e_sb_bar_down_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y, sb->mouse_y = y; D_RETURN; + UN(o); + UN(class); + UN(x); + UN(y); + UN(ox); + UN(oy); + UN(ow); + UN(oh); } static void @@ -223,6 +243,14 @@ e_sb_bar_up_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y, in D_RETURN; D_RETURN; + UN(o); + UN(class); + UN(x); + UN(y); + UN(ox); + UN(oy); + UN(ow); + UN(oh); } static void @@ -263,6 +291,15 @@ e_sb_bar_move_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y, } D_RETURN; + UN(o); + UN(class); + UN(bt); + UN(x); + UN(y); + UN(ox); + UN(oy); + UN(ow); + UN(oh); } static void @@ -313,6 +350,9 @@ e_scrollbar_new(void) sb = NEW(E_Scrollbar, 1); ZERO(sb, E_Scrollbar, 1); + + e_object_init(E_OBJECT(sb), (E_Cleanup_Func) e_scrollbar_cleanup); + sb->range = 1.0; sb->max = 1.0; sb->w = 12; @@ -322,8 +362,10 @@ e_scrollbar_new(void) } void -e_scrollbar_free(E_Scrollbar *sb) +e_scrollbar_cleanup(E_Scrollbar *sb) { + char name[PATH_MAX]; + D_ENTER; if (sb->evas) @@ -331,7 +373,14 @@ e_scrollbar_free(E_Scrollbar *sb) if (sb->base) ebits_free(sb->base); if (sb->bar) ebits_free(sb->bar); } - FREE(sb); + IF_FREE(sb->dir); + + sprintf(name, "scroll_up.%i.%s", sb->direction, sb->dir); + ecore_del_event_timer(name); + sprintf(name, "scroll_down.%i.%s", sb->direction, sb->dir); + ecore_del_event_timer(name); + + e_object_cleanup(E_OBJECT(sb)); D_RETURN; } diff --git a/src/scrollbar.h b/src/scrollbar.h index 8a7a32f9e..ae53c7feb 100644 --- a/src/scrollbar.h +++ b/src/scrollbar.h @@ -1,9 +1,12 @@ #include "e.h" +#include "object.h" typedef struct _E_Scrollbar E_Scrollbar; struct _E_Scrollbar { + E_Object o; + /* I<---val--->|<==range==>|<-->I<-max */ double val; double max; @@ -38,7 +41,7 @@ struct _E_Scrollbar }; E_Scrollbar *e_scrollbar_new(void); -void e_scrollbar_free(E_Scrollbar *sb); +void e_scrollbar_cleanup(E_Scrollbar *sb); void e_scrollbar_add_to_evas(E_Scrollbar *sb, Evas evas); void e_scrollbar_show(E_Scrollbar *sb); void e_scrollbar_hide(E_Scrollbar *sb); diff --git a/src/view.c b/src/view.c index 7a8c2c758..4f5348547 100644 --- a/src/view.c +++ b/src/view.c @@ -1770,6 +1770,8 @@ e_view_cleanup(E_View *v) e_iconbar_save_out_final(v->iconbar); e_object_unref(E_OBJECT(v->iconbar)); } + if (v->scrollbar.h) e_object_unref(E_OBJECT(v->scrollbar.h)); + if (v->scrollbar.v) e_object_unref(E_OBJECT(v->scrollbar.v)); sprintf(name, "resort_timer.%s", v->dir); ecore_del_event_timer(name);