EAPI Elm_Effect *elm_fx_resizable_flip_add(Evas_Object *front, Evas_Object *back, Elm_Fx_Flip_Axis axis, Eina_Bool cw);
/* ImageAnimation Fx */
- EAPI Elm_Effect *elm_fx_imageanimation_add(Evas_Object *icon, const char** images, unsigned int img_cnt);
+ EAPI Elm_Effect *elm_fx_image_animation_add(Evas_Object *icon, const char** images, unsigned int img_cnt);
/* NavigationBar */
typedef enum
EAPI Evas_Object *elm_dayselector_add(Evas_Object *parent);
EAPI Eina_Bool elm_dayselector_check_state_get(Evas_Object *obj, Elm_DaySelector_Day day);
- EAPI void elm_dayselector_title_set(Evas_Object *parent, const char *title);
/* WebView */
/* commented out until it is completed
-/*
- * SLP
- * Copyright (c) 2009 Samsung Electronics, Inc.
- * All rights reserved.
- *
- * This software is a confidential and proprietary information
- * of Samsung Electronics, Inc. ("Confidential Information"). You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with Samsung Electronics.
- */
+#include <Elementary.h>
+#include "elm_priv.h"
/**
* @defgroup Animatedicon Animatedicon
* This is an animatedicon.
*/
-#include <Elementary.h>
-#include "elm_priv.h"
-
/**
* internal data structure of animated icon object
*/
typedef struct _Widget_Data Widget_Data;
-struct _Widget_Data {
+
+struct _Widget_Data
+{
Evas_Object *base;
Evas_Object *parent;
Elm_Transit *transit;
Evas_Object *icon;
Ecore_Timer *timer;
-
char** images;
- int item_num;
+ int img_cnt;
double duration;
unsigned int repeat;
double interval;
};
+static const char *widtype = NULL;
+
static void _del_hook(Evas_Object *obj);
static void _theme_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
-
static void _resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
*
* @param obj animatedicon object.
* @param images the image files to be animated.
- * @param item_num the number of images.
+ * @param img_cnt the number of images.
*
* @ingroup Animatedicon
*/
EAPI void
-elm_animatedicon_file_set(Evas_Object *obj, const char **images, const int item_num)
+elm_animatedicon_file_set(Evas_Object *obj, const char **images, const int img_cnt)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
}
wd->images = (char **)images;
- wd->item_num = item_num;
+ wd->img_cnt = img_cnt;
elm_icon_file_set(wd->icon, wd->images[0], NULL);
}
if (!wd) return;
wd->transit = elm_transit_add(wd->parent);
- elm_transit_fx_insert(wd->transit, elm_fx_imageanimation_add(wd->icon, wd->images, wd->item_num));
+ elm_transit_fx_insert(wd->transit, elm_fx_image_animation_add(wd->icon, wd->images, wd->img_cnt));
elm_transit_event_block_disabled_set(wd->transit, EINA_FALSE);
if (wd->repeat >= 0) {
elm_transit_repeat_set(wd->transit, wd->repeat);
{
Evas_Object *parent;
Evas_Object *base;
- Evas_Object *title;
Evas_Object *check[7];
};
{
_sizing_eval(obj);
}
-
+*/
static void
_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
- _sizing_eval(obj);
+ Evas_Coord w, h;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+
+ edje_object_size_min_get(wd->base, &w, &h);
+ evas_object_size_hint_min_set(obj, w, h);
+ evas_object_resize(obj, w, h);
}
-*/
+
static void
_check_clicked(void *data, Evas_Object *obj, void *event_info)
{
if(!wd) return;
_elm_theme_object_set(obj, wd->base, "dayselector", "base", elm_widget_style_get(obj));
- _elm_theme_object_set(obj, wd->title, "label", "dayselector", "default");
for(idx=0; idx<7; ++idx)
elm_object_style_set(wd->check[idx], "dayselector");
}
-/**
- * Set the title.
- *
- * @param obj Dayselector
- * @param title title
- *
- * @ingroup Dayselector
- */
-EAPI void
-elm_dayselector_title_set(Evas_Object* obj, const char* title)
-{
- ELM_CHECK_WIDTYPE(obj, widtype);
- Widget_Data* wd = (Widget_Data*) elm_widget_data_get(obj);
- edje_object_part_text_set(wd->title, "elm.text", title);
-}
/**
* Get the state of given check object.
elm_object_style_set(wd->base, "dayselector");
elm_widget_resize_object_set(obj, wd->base);
- //Title
- wd->title = edje_object_add(e);
- elm_widget_sub_object_add(obj, wd->title);
- _elm_theme_object_set(obj, wd->title, "label", "dayselector", "default");
- edje_object_part_swallow(wd->base, "title", wd->title);
-
//Buttons
- for(idx=0; idx<7; ++idx)
+
+ //Left-side Button
+ wd->check[0]=elm_check_add(wd->base);
+ elm_widget_sub_object_add(obj, wd->check[0]);
+ evas_object_smart_callback_add(wd->check[0], "changed", _check_clicked, obj);
+
+ for(idx=1; idx<6; ++idx)
{
wd->check[idx]=elm_check_add(wd->base);
- elm_object_style_set(wd->check[idx], "dayselector");
elm_widget_sub_object_add(obj, wd->check[idx]);
evas_object_smart_callback_add(wd->check[idx], "changed", _check_clicked, obj);
}
+ //Right-side Button
+ wd->check[6]=elm_check_add(wd->base);
+ elm_widget_sub_object_add(obj, wd->check[6]);
+ evas_object_smart_callback_add(wd->check[6], "changed", _check_clicked, obj);
+
elm_check_label_set(wd->check[ELM_DAYSELECTOR_SUN], "S");
edje_object_part_swallow(wd->base, "sun", wd->check[0]);
+ elm_object_style_set(wd->check[0], "dayselector_sun");
elm_check_label_set(wd->check[ELM_DAYSELECTOR_MON], "M");
edje_object_part_swallow(wd->base, "mon", wd->check[1]);
+ elm_object_style_set(wd->check[1], "dayselector_mon");
elm_check_label_set(wd->check[ELM_DAYSELECTOR_TUE], "T");
edje_object_part_swallow(wd->base, "tue", wd->check[2]);
+ elm_object_style_set(wd->check[2], "dayselector_tue");
elm_check_label_set(wd->check[ELM_DAYSELECTOR_WED], "W");
edje_object_part_swallow(wd->base, "wed", wd->check[3]);
+ elm_object_style_set(wd->check[3], "dayselector_wed");
elm_check_label_set(wd->check[ELM_DAYSELECTOR_THU], "T");
edje_object_part_swallow(wd->base, "thu", wd->check[4]);
+ elm_object_style_set(wd->check[4], "dayselector_thu");
elm_check_label_set(wd->check[ELM_DAYSELECTOR_FRI], "F");
edje_object_part_swallow(wd->base, "fri", wd->check[5]);
+ elm_object_style_set(wd->check[5], "dayselector_fri");
elm_check_label_set(wd->check[ELM_DAYSELECTOR_SAT], "S");
edje_object_part_swallow(wd->base, "sat", wd->check[6]);
-/*
- evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _dayselector_resize, wd);
+ elm_object_style_set(wd->check[6], "dayselector_sat");
+
+// evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _dayselector_resize, wd);
evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
- _sizing_eval(obj);
-*/
+// _sizing_eval(obj);
+
return obj;
}
void (*animation_op) (void *data, Elm_Animator *animator, double frame);
void (*begin_op) (void *data, Eina_Bool auto_reverse, unsigned int repeat_cnt);
void (*end_op) (void *data, Eina_Bool auto_reverse, unsigned int repeat_cnt);
+ void (*del_op) (void* data);
unsigned int shared_cnt;
void *user_data;
};
if (effect->shared_cnt > 0)
return;
+
+ if(effect->del_op)
+ (*effect->del_op)(effect);
+
if (effect->user_data)
free(effect->user_data);
free(effect);
// ImageAnimation FX
/////////////////////////////////////////////////////////////////////////////////////
typedef struct _image_animation Elm_Fx_Image_Animation;
-static void _elm_fx_imageanimation_op(void *data, Elm_Animator *animator,
+static void _elm_fx_image_animation_begin(void *data, Eina_Bool auto_reverse,
+ unsigned int repeat_cnt);
+static void _elm_fx_image_animation_op(void *data, Elm_Animator *animator,
double frame);
-EAPI Elm_Effect *elm_fx_imageanimation_add(Evas_Object *obj, const char **images,
+EAPI Elm_Effect *elm_fx_image_animation_add(Evas_Object *obj, const char **images,
unsigned int item_num);
struct _image_animation
{
Evas_Object *obj;
char **images;
- int count;
int img_cnt;
};
+
static void
-_elm_fx_imageanimation_op(void *data, Elm_Animator *animator, double frame)
+_elm_fx_image_animation_begin(void *data, Eina_Bool auto_reverse,
+ unsigned int repeat_cnt)
{
- Elm_Fx_Image_Animation *image_animation = (Elm_Fx_Image_Animation *) data;
+ Elm_Fx_Image_Animation *image_animation = data;
+ evas_object_show(image_animation->obj);
+}
- if (!image_animation->obj)
- return;
- image_animation->count = floor(frame * image_animation->img_cnt);
+
+static void
+_elm_fx_image_animation_op(void *data, Elm_Animator *animator, double frame)
+{
+ Elm_Fx_Image_Animation *image_animation = (Elm_Fx_Image_Animation *) data;
elm_icon_file_set(image_animation->obj,
- image_animation->images[image_animation->count], NULL);
+ image_animation->images[ (int) floor(frame * image_animation->img_cnt) ], NULL);
+}
+
+static void
+_elm_fx_image_animation_del(void *data)
+{
+ fprintf(stderr, "image animation del!");
}
/**
- * Add ImageAnimation effect.
+ * Add image_animation effect.
*
* @param obj Icon object
* @param images Array of image file path.
* @ingroup Transit
*/
EAPI Elm_Effect *
-elm_fx_imageanimation_add(Evas_Object *obj, const char **images,
+elm_fx_image_animation_add(Evas_Object *obj, const char **images,
unsigned int img_cnt)
{
Elm_Effect *effect;
Elm_Fx_Image_Animation *image_animation;
- if (!images || !(*images))
+ if ((!obj) || !images || !(*images))
return NULL;
effect = calloc(1, sizeof(Elm_Effect));
image_animation->obj = obj;
image_animation->images = (char **) images;
- image_animation->count = 0;
image_animation->img_cnt = img_cnt;
- effect->animation_op = _elm_fx_imageanimation_op;
+ effect->begin_op = _elm_fx_image_animation_begin;
+ effect->animation_op = _elm_fx_image_animation_op;
+ effect->del_op = _elm_fx_image_animation_del;
effect->user_data = image_animation;
return effect;