remove unused variables
authorJihoon Kim <jihoon48.kim@samsung.com>
Sat, 16 Oct 2010 01:54:02 +0000 (10:54 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Sat, 16 Oct 2010 01:54:02 +0000 (10:54 +0900)
.gitignore
src/lib/elm_actionsheet.c
src/lib/elm_animator.c
src/lib/elm_chronometer.c
src/lib/elm_coverflow.c
src/lib/elm_tab.c
src/lib/elm_tickernoti.c
src/lib/elm_viewflipper.c
src/lib/elm_wipercontrol.c
src/lib/els_box.c

index 6547b69..85d559d 100644 (file)
@@ -43,5 +43,4 @@ m4/ltoptions.m4
 m4/ltsugar.m4
 m4/ltversion.m4
 m4/lt~obsolete.m4
-src/lib/Elementary.h
 tags
index 33e4fab..6cc3333 100644 (file)
@@ -31,29 +31,29 @@ static const double ANIMATION_TIME = 0.4;
 
 typedef struct _Widget_Data
 {
-       Evas *e;
-       Evas_Object *parent, *win, *win_bg, *obj, *layout, *bt_box;
+   Evas *e;
+   Evas_Object *parent, *win, *win_bg, *obj, *layout, *bt_box;
 
-       char *title;
+   char *title;
 
-       /* last button delimeters: to use elm_box_pack_after() */
-       Evas_Object *bt_cancel, *bt_destructive, *bt_normal;
-       Evas_Object *bt_destructive_delim, *bt_normal_delim;
+   /* last button delimeters: to use elm_box_pack_after() */
+   Evas_Object *bt_cancel, *bt_destructive, *bt_normal;
+   Evas_Object *bt_destructive_delim, *bt_normal_delim;
 
-       Eina_List *cb_data_list;
+   Eina_List *cb_data_list;
 
-       Evas_Coord show_x, show_y, hide_x, hide_y;
-       Evas_Coord curr_x, curr_y;
-       Ecore_Timer *layout_timer;
+   Evas_Coord show_x, show_y, hide_x, hide_y;
+   Evas_Coord curr_x, curr_y;
+   Ecore_Timer *layout_timer;
 
 } Widget_Data;
 
 typedef struct _Button_Cb_Data_Wrapper
 {
-       Evas_Object *obj;       // elm_widget
-       void (*cb_func) (void *, Evas_Object *, void *);
-       void * cb_data;
-       char * button_title;
+   Evas_Object *obj;   // elm_widget
+   void (*cb_func) (void *, Evas_Object *, void *);
+   void * cb_data;
+   char * button_title;
 } Button_Cb_Data_Wrapper;
 
 /*
@@ -63,42 +63,48 @@ typedef struct _Button_Cb_Data_Wrapper
 /*
  * hooks
  */
-void
+static void
+_button_cb_data_wrapper_free(Button_Cb_Data_Wrapper *dw)
+{
+   if (dw->button_title) free(dw->button_title);
+   free(dw);
+}
+
+static void
 _really_del(void *data, Elm_Transit* transit)
 {
-       Widget_Data *wd = (Widget_Data *) data;
-
-       evas_object_del(wd->layout);
-       evas_object_del(wd->win_bg);
-
-       /* free widget data */
-       if(wd->title) free(wd->title);
-
-       // free eina_list
-       Eina_List *l;
-       Button_Cb_Data_Wrapper *dw;
-       EINA_LIST_FOREACH(wd->cb_data_list, l, dw)
-               _button_cb_data_wrapper_free(dw);
-       eina_list_free(wd->cb_data_list);
-               
-       free(wd);
+   Widget_Data *wd = (Widget_Data *) data;
+
+   evas_object_del(wd->layout);
+   evas_object_del(wd->win_bg);
+
+   /* free widget data */
+   if(wd->title) free(wd->title);
+
+   // free eina_list
+   Eina_List *l;
+   Button_Cb_Data_Wrapper *dw;
+   EINA_LIST_FOREACH(wd->cb_data_list, l, dw)
+      _button_cb_data_wrapper_free(dw);
+   eina_list_free(wd->cb_data_list);
+
+   free(wd);
 }
 
 static void
 _del_pre_hook(Evas_Object *obj)
 {
-       Widget_Data *wd = elm_widget_data_get(obj);
-
-       // cut sub objects
-       elm_widget_sub_object_del(obj, wd->layout);
-       elm_widget_sub_object_del(obj, wd->win_bg);
-       elm_widget_resize_object_set(obj, NULL);
-       elm_widget_hover_object_set(obj, NULL);
-       // cut from parent
-       elm_widget_sub_object_del(wd->parent, obj);
+   Widget_Data *wd = elm_widget_data_get(obj);
 
-       edje_object_signal_emit(elm_layout_edje_get(wd->win_bg), "hide", "actionsheet");
+   // cut sub objects
+   elm_widget_sub_object_del(obj, wd->layout);
+   elm_widget_sub_object_del(obj, wd->win_bg);
+   elm_widget_resize_object_set(obj, NULL);
+   elm_widget_hover_object_set(obj, NULL);
+   // cut from parent
+   elm_widget_sub_object_del(wd->parent, obj);
 
+   edje_object_signal_emit(elm_layout_edje_get(wd->win_bg), "hide", "actionsheet");
 }
 
 Button_Cb_Data_Wrapper *
@@ -108,38 +114,29 @@ _button_cb_data_wrapper_add(
                void *cb_data, 
                const char* button_title)
 {
-       Button_Cb_Data_Wrapper *dw;
-
-       dw = (Button_Cb_Data_Wrapper *)calloc(1, sizeof(Button_Cb_Data_Wrapper));
-       dw->obj = obj;
-       dw->cb_func = cb_func;
-       dw->cb_data = cb_data;
-       dw->button_title = strdup(button_title);
-       
-       return dw;
-}
-
-void
-_button_cb_data_wrapper_free(Button_Cb_Data_Wrapper *dw)
-{
-       if (dw->button_title) free(dw->button_title);
-       free(dw);
-}
+   Button_Cb_Data_Wrapper *dw;
 
+   dw = (Button_Cb_Data_Wrapper *)calloc(1, sizeof(Button_Cb_Data_Wrapper));
+   dw->obj = obj;
+   dw->cb_func = cb_func;
+   dw->cb_data = cb_data;
+   dw->button_title = strdup(button_title);
 
+   return dw;
+}
 
 static void
 _del_hook(Evas_Object *obj)
 {
-       Widget_Data *wd = elm_widget_data_get(obj);
-
-       // do animation 
-       Elm_Transit * transit = elm_transit_add(wd->layout);
-       elm_transit_fx_insert(transit, elm_fx_translation_add(wd->layout, wd->show_x, wd->show_y, wd->hide_x, wd->hide_y));
-       elm_transit_completion_callback_set(transit, _really_del, wd);
-       elm_transit_curve_style_set(transit, ELM_ANIMATOR_CURVE_IN);
-       elm_transit_run(transit, ANIMATION_TIME-0.1);
-       elm_transit_del(transit);
+   Widget_Data *wd = elm_widget_data_get(obj);
+
+   // do animation     
+   Elm_Transit * transit = elm_transit_add(wd->layout);
+   elm_transit_fx_insert(transit, elm_fx_translation_add(wd->layout, wd->show_x, wd->show_y, wd->hide_x, wd->hide_y));
+   elm_transit_completion_callback_set(transit, _really_del, wd);
+   elm_transit_curve_style_set(transit, ELM_ANIMATOR_CURVE_IN);
+   elm_transit_run(transit, ANIMATION_TIME-0.1);
+   elm_transit_del(transit);
 }
 
 static void
@@ -148,8 +145,6 @@ _theme_hook(Evas_Object *obj)
 
 }
 
-
-
 /*
  * callbacks
  */
@@ -162,131 +157,127 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
 static void
 _resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
-       int x, y, w, h;
-       int minw, minh;
-       Widget_Data *wd = elm_widget_data_get(obj);
+   int x, y, w, h;
+   int minw, minh;
+   Widget_Data *wd = elm_widget_data_get(obj);
 
-       // win_bg
-       evas_object_geometry_get(wd->parent,  &x, &y, &w, &h);  // assume parent object is a window
-       //fprintf(stderr, ">>> parent: %d %d %d %d\n", x, y, w, h);
-       evas_object_resize(wd->win_bg, w, h);
-       evas_object_move(wd->win_bg, x, y);
+   // win_bg
+   evas_object_geometry_get(wd->parent,  &x, &y, &w, &h);      // assume parent object is a window
+   //fprintf(stderr, ">>> parent: %d %d %d %d\n", x, y, w, h);
+   evas_object_resize(wd->win_bg, w, h);
+   evas_object_move(wd->win_bg, x, y);
 
-       // layout
-       evas_object_size_hint_weight_set(wd->layout, EVAS_HINT_EXPAND, 0); 
-       evas_object_size_hint_align_set(wd->layout, 0.5, 1);
+   // layout
+   evas_object_size_hint_weight_set(wd->layout, EVAS_HINT_EXPAND, 0); 
+   evas_object_size_hint_align_set(wd->layout, 0.5, 1);
 
-       edje_object_size_min_calc(elm_layout_edje_get(wd->layout), &minw, &minh);
-       fprintf(stderr, ">>> layout's min size(by calc): %d %d %d\n", minw, minh, w);
+   edje_object_size_min_calc(elm_layout_edje_get(wd->layout), &minw, &minh);
+   fprintf(stderr, ">>> layout's min size(by calc): %d %d %d\n", minw, minh, w);
 
-       evas_object_resize(wd->layout, w, minh);
+   evas_object_resize(wd->layout, w, minh);
 
-       // Store show/hide location into wd
-       //evas_object_move(wd->layout, 0, h - minh);
-       wd->show_x = 0;
-       wd->show_y = h - minh;
-       wd->hide_x = 0;
-       wd->hide_y = h;
+   // Store show/hide location into wd
+   //evas_object_move(wd->layout, 0, h - minh);
+   wd->show_x = 0;
+   wd->show_y = h - minh;
+   wd->hide_x = 0;
+   wd->hide_y = h;
 
-       evas_object_geometry_get(wd->bt_box, &x, &y, &w, &h);
-       fprintf(stderr, ">>> bt_box: %d %d %d %d\n", x, y, w, h);
-       evas_object_size_hint_min_get(wd->bt_box, &w, &h);
-       fprintf(stderr, ">>> bt_box(size_hint_min): %d %d \n", w, h);
+   evas_object_geometry_get(wd->bt_box, &x, &y, &w, &h);
+   fprintf(stderr, ">>> bt_box: %d %d %d %d\n", x, y, w, h);
+   evas_object_size_hint_min_get(wd->bt_box, &w, &h);
+   fprintf(stderr, ">>> bt_box(size_hint_min): %d %d \n", w, h);
 
 }
 
 static inline int
 _move_layout(Widget_Data *wd, const int until, const int offset)
 {
-       wd->curr_y += offset;
-       if(offset < 0) {
-               if(wd->curr_y < until) wd->curr_y = until;
-       } else {
-               if(wd->curr_y > until) wd->curr_y = until;
-       }
-       evas_object_move(wd->layout, wd->curr_x, wd->curr_y);
-       if(wd->curr_y == until) {
-               edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,actionsheet,event_block_off", "elm");
-               return 0;
-       }
-       else 
-               return 1;
+    wd->curr_y += offset;
+    if(offset < 0) 
+      {
+         if(wd->curr_y < until) wd->curr_y = until;
+      } 
+    else 
+      {
+         if(wd->curr_y > until) wd->curr_y = until;
+      }
+
+    evas_object_move(wd->layout, wd->curr_x, wd->curr_y);
+
+    if(wd->curr_y == until) 
+      {
+         edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,actionsheet,event_block_off", "elm");
+         return 0;
+      }
+    else 
+        return 1;
 }
 
 static void
 _show_animation_end_cb(void *data, Elm_Transit* transit)
 {
-       Widget_Data *wd = (Widget_Data *)data;
-       // unblock event 
-       edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,actionsheet,event_block_off", "elm");
+   Widget_Data *wd = (Widget_Data *)data;
+   // unblock event 
+   edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,actionsheet,event_block_off", "elm");
 }
 
-
 static int
 _show_layout(void *data)
 {
-       Widget_Data *wd = (Widget_Data *)data;
-       return _move_layout(wd, wd->show_y, -90);
-}
-
-static int
-_hide_layout(void *data)
-{
-       
+   Widget_Data *wd = (Widget_Data *)data;
+   return _move_layout(wd, wd->show_y, -90);
 }
 
 static void
 _show(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
-       //int x, y, w, h;
-       Widget_Data *wd = elm_widget_data_get(obj);
-
-       _resize(wd, wd->e, obj, obj);
-
-       evas_object_show(wd->win_bg);
-       evas_object_show(wd->layout);
-
-       // move to hide position
-       evas_object_move(wd->layout, wd->hide_x, wd->hide_y);
-       // block events
-       edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,actionsheet,event_block_on", "elm");
-       
-       // animate to show position
-       wd->curr_x = wd->hide_x;
-       wd->curr_y = wd->hide_y;
-
-       
-       //ecore_timer_add(0.033, _show_layout, wd);
-       
-       Elm_Transit * transit = elm_transit_add(wd->layout);
-       elm_transit_fx_insert(transit, elm_fx_translation_add(wd->layout, wd->hide_x, wd->hide_y, wd->show_x, wd->show_y));
-       elm_transit_completion_callback_set(transit, _show_animation_end_cb, wd);
-       elm_transit_curve_style_set(transit, ELM_ANIMATOR_CURVE_OUT);
-       elm_transit_run(transit, ANIMATION_TIME);
-       elm_transit_del(transit);
-
-       edje_object_signal_emit(elm_layout_edje_get(wd->layout), "show", "actionsheet");
-       edje_object_signal_emit(elm_layout_edje_get(wd->win_bg), "show", "actionsheet");
+   //int x, y, w, h;
+   Widget_Data *wd = elm_widget_data_get(obj);
+
+   _resize(wd, wd->e, obj, obj);
+
+   evas_object_show(wd->win_bg);
+   evas_object_show(wd->layout);
+
+   // move to hide position
+   evas_object_move(wd->layout, wd->hide_x, wd->hide_y);
+   // block events
+   edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,actionsheet,event_block_on", "elm");
 
+   // animate to show position
+   wd->curr_x = wd->hide_x;
+   wd->curr_y = wd->hide_y;
+
+
+   //ecore_timer_add(0.033, _show_layout, wd);
+
+   Elm_Transit * transit = elm_transit_add(wd->layout);
+   elm_transit_fx_insert(transit, elm_fx_translation_add(wd->layout, wd->hide_x, wd->hide_y, wd->show_x, wd->show_y));
+   elm_transit_completion_callback_set(transit, _show_animation_end_cb, wd);
+   elm_transit_curve_style_set(transit, ELM_ANIMATOR_CURVE_OUT);
+   elm_transit_run(transit, ANIMATION_TIME);
+   elm_transit_del(transit);
+
+   edje_object_signal_emit(elm_layout_edje_get(wd->layout), "show", "actionsheet");
+   edje_object_signal_emit(elm_layout_edje_get(wd->win_bg), "show", "actionsheet");
 }
 
 static void
 _hide(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
-       Widget_Data *wd = elm_widget_data_get(obj);
-
-       evas_object_hide(wd->layout);
+   Widget_Data *wd = elm_widget_data_get(obj);
 
+   evas_object_hide(wd->layout);
 }
 
 static void
 _button_cb_wrapper(void *data, Evas_Object *obj, const char *emission, const char *source)
 {
-       Button_Cb_Data_Wrapper *dw = (Button_Cb_Data_Wrapper *)data;
-       dw->cb_func(dw->cb_data, dw->obj, dw->button_title);
+   Button_Cb_Data_Wrapper *dw = (Button_Cb_Data_Wrapper *)data;
+   dw->cb_func(dw->cb_data, dw->obj, dw->button_title);
 }
 
-
 /**
  * Add a new actionsheet to the parent
  * Object constructor
@@ -299,65 +290,64 @@ _button_cb_wrapper(void *data, Evas_Object *obj, const char *emission, const cha
 EAPI Evas_Object *
 elm_actionsheet_add (Evas_Object *parent)
 {
-       Evas_Object *obj;
-       Evas *e;
-       Widget_Data *wd;
-
-       /* widget data */
-       wd = ELM_NEW(Widget_Data);      // allocate memory
-
-       /* widget object */
-       wd->e = evas_object_evas_get(parent);
-       obj = elm_widget_add(wd->e);    // get a new smart object(=widget)
-       elm_widget_type_set(obj, "actionsheet");        // set a smart object's type name
-
-       elm_widget_sub_object_add(parent, obj);
-       elm_widget_data_set(obj, wd);   // store wd pointer to smart_data->data 
-
-       elm_widget_del_pre_hook_set(obj, _del_pre_hook);
-       elm_widget_del_hook_set(obj, _del_hook);
-       elm_widget_theme_hook_set(obj, _theme_hook);    
-
-       /* actionsheet layout */
-       wd->layout = elm_layout_add(parent);
-       elm_layout_theme_set(wd->layout, "actionsheet", "base", "default");
-       evas_object_size_hint_weight_set(wd->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       evas_object_size_hint_align_set(wd->layout, 0.5, 1);
-       elm_widget_sub_object_add(obj, wd->layout);
-       elm_widget_hover_object_set(obj, wd->layout);
-
-       /* win_bg */
-       wd->win_bg = elm_layout_add(parent);
-       elm_layout_theme_set(wd->win_bg, "actionsheet", "bg", "default");
-       elm_widget_sub_object_add(obj, wd->win_bg);
-       elm_widget_resize_object_set(obj, wd->win_bg);
-
-       /* bt_box */
-       wd->bt_box = elm_box_add(wd->layout);
-       evas_object_size_hint_weight_set(wd->bt_box, 0, EVAS_HINT_EXPAND);
-       elm_layout_content_set(wd->layout, "v_sw", wd->bt_box);
-       evas_object_show(wd->bt_box);
-
-       /* set Widget_Data */
-       wd->parent = parent;
-       wd->obj = obj;
+   Evas_Object *obj;
+   Widget_Data *wd;
+
+   /* widget data */
+   wd = ELM_NEW(Widget_Data);  // allocate memory
+
+   /* widget object */
+   wd->e = evas_object_evas_get(parent);
+   obj = elm_widget_add(wd->e);        // get a new smart object(=widget)
+   elm_widget_type_set(obj, "actionsheet");    // set a smart object's type name
+
+   elm_widget_sub_object_add(parent, obj);
+   elm_widget_data_set(obj, wd);       // store wd pointer to smart_data->data 
+
+   elm_widget_del_pre_hook_set(obj, _del_pre_hook);
+   elm_widget_del_hook_set(obj, _del_hook);
+   elm_widget_theme_hook_set(obj, _theme_hook);        
+
+   /* actionsheet layout */
+   wd->layout = elm_layout_add(parent);
+   elm_layout_theme_set(wd->layout, "actionsheet", "base", "default");
+   evas_object_size_hint_weight_set(wd->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(wd->layout, 0.5, 1);
+   elm_widget_sub_object_add(obj, wd->layout);
+   elm_widget_hover_object_set(obj, wd->layout);
+
+   /* win_bg */
+   wd->win_bg = elm_layout_add(parent);
+   elm_layout_theme_set(wd->win_bg, "actionsheet", "bg", "default");
+   elm_widget_sub_object_add(obj, wd->win_bg);
+   elm_widget_resize_object_set(obj, wd->win_bg);
+
+   /* bt_box */
+   wd->bt_box = elm_box_add(wd->layout);
+   evas_object_size_hint_weight_set(wd->bt_box, 0, EVAS_HINT_EXPAND);
+   elm_layout_content_set(wd->layout, "v_sw", wd->bt_box);
+   evas_object_show(wd->bt_box);
+
+   /* set Widget_Data */
+   wd->parent = parent;
+   wd->obj = obj;
 
 #ifdef SKIP
 #endif
 
-       /* set callbacks */
-       /* win cb */
+   /* set callbacks */
+   /* win cb */
+
+   /* obj cb */
 
-       /* obj cb */
+   evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _show, obj);
+   evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _hide, obj);
 
-       evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _show, obj);
-       evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _hide, obj);
+   _resize(wd, wd->e, obj, obj);
 
-       _resize(wd, wd->e, obj, obj);
-       
 
-       fprintf(stderr, ">>>>> after:adding layout\n");
-       return obj;
+   fprintf(stderr, ">>>>> after:adding layout\n");
+   return obj;
 }
 
 /**
@@ -374,9 +364,9 @@ elm_actionsheet_button_title_get (
                const int index,
                char **title )
 {
-       Widget_Data *wd = (Widget_Data *) elm_widget_data_get(obj);
-       
-       return 0;
+//   Widget_Data *wd = (Widget_Data *) elm_widget_data_get(obj);
+
+   return 0;
 }
 
 /**
@@ -395,88 +385,89 @@ elm_actionsheet_button_add (
                void (*cb_func) (void *data, Evas_Object *obj, void *event_info),
                void *cb_data)
 {
-       Evas_Object **target = NULL;
-       Evas_Object **insert_after = NULL;
-       Evas_Object *ly_bt;
-       char *button_style;
-       Widget_Data *wd;
-       int x, y, w, h; 
-
-       wd = (Widget_Data *) elm_widget_data_get(obj);
-               
-       switch(type) {
-               case ELM_ACTIONSHEET_BT_CANCEL:
-                       target = &(wd->bt_cancel);      
-                       button_style = "cancel";
-                       break;
-               case ELM_ACTIONSHEET_BT_DESTRUCTIVE:
-                       target = &(wd->bt_destructive);
-                       button_style = "destructive";
-                       break;
-               case ELM_ACTIONSHEET_BT_NORMAL:
-                       target = &(wd->bt_normal);
-                       button_style = "normal";
-                       break;
-               default:
-                       return;
-       }
-       // case: cancel, destructive
-       // if button object is already exist, just change title
-       if ( type != ELM_ACTIONSHEET_BT_NORMAL && *target != NULL  ) {
-               elm_button_label_set(*target, title);
-       }
-       else {
-
-               *target = elm_layout_add(obj);
-               elm_layout_theme_set(*target, "actionsheet", "button", button_style);
-               edje_object_part_text_set(elm_layout_edje_get(*target), "text", title);
-               evas_object_size_hint_weight_set(*target, 0, EVAS_HINT_EXPAND);
-               evas_object_size_hint_align_set(*target, EVAS_HINT_FILL, 0);
-               evas_object_show(*target);
-
-               // set callback wrapper
-               Button_Cb_Data_Wrapper *dw = _button_cb_data_wrapper_add(obj, cb_func, cb_data, title);
-               edje_object_signal_callback_add(elm_layout_edje_get(*target), "elm,action,press", "", _button_cb_wrapper, dw);
-               // store data wrapper into eina list (to free all)
-               wd->cb_data_list = eina_list_append(wd->cb_data_list, dw);
-               
-               switch (type) {
-                       case ELM_ACTIONSHEET_BT_DESTRUCTIVE:
-                               elm_box_pack_start(wd->bt_box, *target);
-                               if(NULL == wd->bt_normal_delim) {
-                                               wd->bt_normal_delim = *target;
-                               }
-                               break;
-
-                       case ELM_ACTIONSHEET_BT_NORMAL:
-                               if(NULL == wd->bt_normal_delim) {
-                                       elm_box_pack_start(wd->bt_box, *target);
-                               }
-                               else {
-                                       elm_box_pack_after(wd->bt_box, *target, wd->bt_normal_delim);
-                               }
-                               wd->bt_normal_delim = *target;
-                               break;
-
-                       case ELM_ACTIONSHEET_BT_CANCEL:
-                               elm_box_pack_end(wd->bt_box, *target);
-                               break;
-
-                       default:
-                               fprintf(stderr, ">>> wrong button type\n");
-                               evas_object_del(*target);
-                               return;
-               }
-               int box_w, box_h;
-               evas_object_size_hint_min_get(wd->bt_box, &box_w, &box_h);
-               edje_object_size_min_calc(elm_layout_edje_get(*target), &w, &h);
-               //evas_object_size_hint_min_get(*target, &w, &h);
-               fprintf(stderr, ">>> calc. box's h: %d + %d\n", box_h, h);
-               evas_object_size_hint_min_set(wd->bt_box, box_w>w?box_w:w, box_h+h);
-
-       }
-
-       _resize(wd, wd->e, obj, obj);
+   Evas_Object **target = NULL;
+   char *button_style;
+   Widget_Data *wd;
+   int w, h;   
+   int box_w, box_h;
+
+   wd = (Widget_Data *) elm_widget_data_get(obj);
+
+   switch(type) 
+     {
+      case ELM_ACTIONSHEET_BT_CANCEL:
+         target = &(wd->bt_cancel);    
+         button_style = "cancel";
+         break;
+      case ELM_ACTIONSHEET_BT_DESTRUCTIVE:
+         target = &(wd->bt_destructive);
+         button_style = "destructive";
+         break;
+      case ELM_ACTIONSHEET_BT_NORMAL:
+         target = &(wd->bt_normal);
+         button_style = "normal";
+         break;
+      default:
+         return;
+     }
+   // case: cancel, destructive
+   // if button object is already exist, just change title
+   if ( type != ELM_ACTIONSHEET_BT_NORMAL && *target != NULL ) 
+     {
+        elm_button_label_set(*target, title);
+     }
+   else 
+     {
+        *target = elm_layout_add(obj);
+        elm_layout_theme_set(*target, "actionsheet", "button", button_style);
+        edje_object_part_text_set(elm_layout_edje_get(*target), "text", title);
+        evas_object_size_hint_weight_set(*target, 0, EVAS_HINT_EXPAND);
+        evas_object_size_hint_align_set(*target, EVAS_HINT_FILL, 0);
+        evas_object_show(*target);
+
+        // set callback wrapper
+        Button_Cb_Data_Wrapper *dw = _button_cb_data_wrapper_add(obj, cb_func, cb_data, title);
+        edje_object_signal_callback_add(elm_layout_edje_get(*target), "elm,action,press", "", _button_cb_wrapper, dw);
+        // store data wrapper into eina list (to free all)
+        wd->cb_data_list = eina_list_append(wd->cb_data_list, dw);
+
+        switch (type) {
+           case ELM_ACTIONSHEET_BT_DESTRUCTIVE:
+              elm_box_pack_start(wd->bt_box, *target);
+              if(NULL == wd->bt_normal_delim) {
+                   wd->bt_normal_delim = *target;
+              }
+              break;
+
+           case ELM_ACTIONSHEET_BT_NORMAL:
+              if(NULL == wd->bt_normal_delim) {
+                   elm_box_pack_start(wd->bt_box, *target);
+              }
+              else {
+                   elm_box_pack_after(wd->bt_box, *target, wd->bt_normal_delim);
+              }
+              wd->bt_normal_delim = *target;
+              break;
+
+           case ELM_ACTIONSHEET_BT_CANCEL:
+              elm_box_pack_end(wd->bt_box, *target);
+              break;
+
+           default:
+              fprintf(stderr, ">>> wrong button type\n");
+              evas_object_del(*target);
+              return;
+        }
+
+        evas_object_size_hint_min_get(wd->bt_box, &box_w, &box_h);
+        edje_object_size_min_calc(elm_layout_edje_get(*target), &w, &h);
+        //evas_object_size_hint_min_get(*target, &w, &h);
+        fprintf(stderr, ">>> calc. box's h: %d + %d\n", box_h, h);
+        evas_object_size_hint_min_set(wd->bt_box, box_w>w?box_w:w, box_h+h);
+
+   }
+
+   _resize(wd, wd->e, obj, obj);
 }
 
 
@@ -492,8 +483,8 @@ elm_actionsheet_title_set (
                Evas_Object *obj, 
                const char *title)
 {
-       Widget_Data *wd = (Widget_Data *) elm_widget_data_get(obj);
-
+//   Widget_Data *wd = (Widget_Data *) elm_widget_data_get(obj);
 }
 
 /* end of file */
+/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
index 19bd8da..c89fa82 100644 (file)
@@ -136,7 +136,7 @@ _animator_animate_cb(void *data)
 static void
 _animator_parent_del(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
 {
-       Elm_Animator *animator = data; 
+//     Elm_Animator *animator = data; 
        elm_animator_del(data);
 }
 
index b8e882b..eb3ba68 100644 (file)
@@ -43,7 +43,6 @@ _del_hook(Evas_Object *obj)
 static void
 _theme_hook(Evas_Object *obj)
 {
-   Widget_Data *wd = elm_widget_data_get(obj);
    _time_update(obj);
 }
 
@@ -77,7 +76,7 @@ _ticker(void *data)
 static void 
 _signal_chronometer_val_changed(void *data,Evas_Object *obj,const char *emission,const char *source)
 {
-       Widget_Data *wd=elm_widget_data_get(data);
+//     Widget_Data *wd=elm_widget_data_get(data);
        
        evas_object_smart_callback_call(data,"changed",NULL);
 }
index c4f613b..0a82ca2 100644 (file)
@@ -850,7 +850,6 @@ static Eina_Bool _bounce_to_right( Widget_Data* wd )
        evas_object_geometry_get( wd->obj, NULL, NULL, &w, NULL );
        
        Elm_Coverflow_Item* item =  eina_list_data_get( wd->valid_item_list );  
-       Evas_Coord a = item->idx * wd->dist_between_items;
                
        Evas_Coord right_outside_length = wd->cur_pos.x + (Evas_Coord) wd->valid_item_length - w;
        Evas_Coord sliding_length = wd->sliding_vector;
index 472befe..7e5c0f7 100644 (file)
@@ -839,7 +839,7 @@ static void light_check(Widget_Data *wd)
 static void select_check(Widget_Data *wd)\r
 {\r
        int i = 1;\r
-       int selected = -1;\r
+//     int selected = -1;\r
        const Eina_List *l;\r
        Elm_Tab_Item *item;\r
 \r
index 350cdb4..f5f2ceb 100644 (file)
@@ -80,7 +80,7 @@ static void
 _sizing_eval(Evas_Object *obj)
 {
    Widget_Data *wd = elm_widget_data_get(obj);
-   Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
+//   Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
    if (!wd) return;
 
 /*
index d0ffed9..f7796a8 100644 (file)
@@ -403,7 +403,6 @@ elm_viewflipper_add(Evas_Object * parent)
    Evas_Object *obj;\r
    Evas *e;\r
    Widget_Data *wd;\r
-   Evas_Coord w, h;\r
 \r
    wd = ELM_NEW(Widget_Data);\r
    e = evas_object_evas_get(parent);\r
index e12b5f9..22280bf 100644 (file)
@@ -48,7 +48,7 @@ _theme_hook(Evas_Object *obj)
 static void\r
 _sizing_eval(Evas_Object *obj)\r
 {\r
-       Widget_Data *wd = elm_widget_data_get(obj);\r
+//     Widget_Data *wd = elm_widget_data_get(obj);\r
 }\r
 \r
 /**\r
index 8a02dc3..6c824ad 100644 (file)
@@ -5,7 +5,7 @@ static void
 _smart_extents_calculate(Evas_Object *box, Evas_Object_Box_Data *priv, int horizontal, int homogeneous, int extended)
 {
        Evas_Coord minw, minh, maxw, maxh, mnw, mnh, ww;
-       Evas_Coord w, h, cw = 0, ch = 0, cmaxh = 0, sumw = 0;
+       Evas_Coord w, cw = 0, cmaxh = 0;
        const Eina_List *l;
        Evas_Object_Box_Option *opt;
     double wx;