1 #include "e_illume_private.h"
2 #include "e_mod_config_animation.h"
4 /* local function prototypes */
5 static void *_e_mod_illume_config_animation_create(E_Config_Dialog *cfd);
6 static void _e_mod_illume_config_animation_free(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
7 static Evas_Object *_e_mod_illume_config_animation_ui(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
8 static void _e_mod_illume_config_animation_change(void *data, Evas_Object *obj, void *event);
9 static Eina_Bool _e_mod_illume_config_animation_timeout(void *data);
12 Ecore_Timer *_anim_change_timer = NULL;
15 e_mod_illume_config_animation_show(E_Container *con, const char *params __UNUSED__)
18 E_Config_Dialog_View *v;
20 if (e_config_dialog_find("E", "_config_illume_animation_settings")) return;
22 v = E_NEW(E_Config_Dialog_View, 1);
25 v->create_cfdata = _e_mod_illume_config_animation_create;
26 v->free_cfdata = _e_mod_illume_config_animation_free;
27 v->basic.create_widgets = _e_mod_illume_config_animation_ui;
32 cfd = e_config_dialog_new(con, _("Animation Settings"), "E",
33 "_config_illume_animation_settings",
34 "enlightenment/animation_settings", 0, v, NULL);
37 e_dialog_resizable_set(cfd->dia, 1);
40 /* local function prototypes */
42 _e_mod_illume_config_animation_create(E_Config_Dialog *cfd __UNUSED__)
48 _e_mod_illume_config_animation_free(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata __UNUSED__)
50 if (_anim_change_timer) ecore_timer_del(_anim_change_timer);
51 _anim_change_timer = NULL;
55 _e_mod_illume_config_animation_ui(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata __UNUSED__)
57 Evas_Object *list, *of, *ow;
60 list = e_widget_list_add(evas, 0, 0);
62 of = e_widget_framelist_add(evas, _("Keyboard"), 0);
63 rg = e_widget_radio_group_new(&(_e_illume_cfg->animation.vkbd.duration));
64 ow = e_widget_radio_add(evas, _("Slow"), 2000, rg);
65 e_widget_framelist_object_append(of, ow);
66 evas_object_smart_callback_add(ow, "changed",
67 _e_mod_illume_config_animation_change, NULL);
68 ow = e_widget_radio_add(evas, _("Medium"), 1000, rg);
69 e_widget_framelist_object_append(of, ow);
70 evas_object_smart_callback_add(ow, "changed",
71 _e_mod_illume_config_animation_change, NULL);
72 ow = e_widget_radio_add(evas, _("Fast"), 500, rg);
73 e_widget_framelist_object_append(of, ow);
74 evas_object_smart_callback_add(ow, "changed",
75 _e_mod_illume_config_animation_change, NULL);
76 ow = e_widget_radio_add(evas, _("Very Fast"), 250, rg);
77 e_widget_framelist_object_append(of, ow);
78 evas_object_smart_callback_add(ow, "changed",
79 _e_mod_illume_config_animation_change, NULL);
80 ow = e_widget_radio_add(evas, _("Off"), 0, rg);
81 e_widget_framelist_object_append(of, ow);
82 evas_object_smart_callback_add(ow, "changed",
83 _e_mod_illume_config_animation_change, NULL);
84 e_widget_list_object_append(list, of, 1, 0, 0.0);
86 of = e_widget_framelist_add(evas, _("Quickpanel"), 0);
87 rg = e_widget_radio_group_new(&(_e_illume_cfg->animation.quickpanel.duration));
88 ow = e_widget_radio_add(evas, _("Slow"), 2000, rg);
89 e_widget_framelist_object_append(of, ow);
90 evas_object_smart_callback_add(ow, "changed",
91 _e_mod_illume_config_animation_change, NULL);
92 ow = e_widget_radio_add(evas, _("Medium"), 1000, rg);
93 e_widget_framelist_object_append(of, ow);
94 evas_object_smart_callback_add(ow, "changed",
95 _e_mod_illume_config_animation_change, NULL);
96 ow = e_widget_radio_add(evas, _("Fast"), 500, rg);
97 e_widget_framelist_object_append(of, ow);
98 evas_object_smart_callback_add(ow, "changed",
99 _e_mod_illume_config_animation_change, NULL);
100 ow = e_widget_radio_add(evas, _("Very Fast"), 250, rg);
101 e_widget_framelist_object_append(of, ow);
102 evas_object_smart_callback_add(ow, "changed",
103 _e_mod_illume_config_animation_change, NULL);
104 ow = e_widget_radio_add(evas, _("Off"), 0, rg);
105 e_widget_framelist_object_append(of, ow);
106 evas_object_smart_callback_add(ow, "changed",
107 _e_mod_illume_config_animation_change, NULL);
108 e_widget_list_object_append(list, of, 1, 0, 0.0);
114 _e_mod_illume_config_animation_change(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
116 if (_anim_change_timer) ecore_timer_del(_anim_change_timer);
118 ecore_timer_add(0.5, _e_mod_illume_config_animation_timeout, data);
122 _e_mod_illume_config_animation_timeout(void *data __UNUSED__)
124 e_config_save_queue();
125 _anim_change_timer = NULL;
126 return ECORE_CALLBACK_CANCEL;