extern void box_fini(win_info *win);
/**
+ * @brief Retrieves list containing only icons to show.
+ *
+ * @param[in] type list type
+ *
+ * @return The list
+ */
+
+Eina_List *box_list_get(indicator_icon_area_type type);
+
+/**
* @brief Retrieves size of a given list.
*
- * @param[in] list list type of list to get size
+ * @param[in] type list type of list to get size
*
* @return The size of the list
*/
-extern unsigned int box_get_list_size(Box_List list);
+extern unsigned int box_get_list_size(indicator_icon_area_type type);
/**
* @brief Retrieves count of max allowed number of non fixed icons.
extern void box_noti_ani_handle(int bStart);
/**
- * @brief Sets icon state.
- *
- * @param[in] bShow state to set
- * @param file NOT USED
- * @param line NOT USED
- *
- */
-extern void box_icon_state_set(int bShow,char* file,int line);
-
-/**
- * @brief Gets icon state.
- *
- * @return state of the icon
- */
-extern int box_icon_state_get(void);
-
-/**
* @brief Gets count in noti list except minictrl.
*
* @return count of icons
extern void box_update_display(win_info *win);
/**
- * @brief Gets enabled system area icons count.
+ * @brief Creates box.
*
- * @return count of icons
- */
-extern int box_get_enabled_system_count(void);
-
-/**
- * @brief Gets enabled connection/system area icons count.
+ * @param[in] parent parent fo box container
*
- * @return count of icons
- */
-int box_get_enabled_connection_system_count(void);
-
-/**
- * @brief Gets enabled minicontrol area icons count.
+ * @return box
*
- * @return count of icons
*/
-extern int box_get_enabled_minictrl_count(void);
+Evas_Object *box_add(Evas_Object *parent);
#endif /*__INDICATOR_BOX_UTIL_H__*/
*/
extern void icon_reset_list(void);
-/**
- * @brief Handles more noti icon.
- * @remarks The icon will be shown if more that #PORT_NONFIXED_ICON_COUNT otherwise the icon will be hidden
- *
- * @param win win info
- *
- */
-extern void icon_handle_more_notify_icon(win_info *win);
-
-/**
- * @brief Makes util.
- *
- * @remarks Will be removed
- *
- */
-extern void* icon_util_make(void *input);
/**
- * @brief Checks if non fixed icons count is greater than #PORT_NONFIXED_ICON_COUNT.
+ * @brief Checks if non fixed icons count is greater than #PORT_NONFIXED_ICON_COUNT
+ * and shows or hides more noti icon.
*
* @return EINA_TRUE if icons count is greater then #PORT_NONFIXED_ICON_COUNT, EINA_FALSE otherwise
*
*/
-Eina_Bool check_for_icons_overflow(void);
-
-/**
- * @brief Checks to show more noti icon.
- *
- * @remarks Will be removed
- *
- * @param[in] win win info
- * @param[in] overflow indicates if there is to much icons pending to be shown
- *
- */
-void check_to_show_more_noti(win_info *win, Eina_Bool overflow);
+void check_to_show_more_noti(win_info *win);
#endif /*__INDICATOR_ICON_UTIL_H__*/
INDICATOR_DIGIT_ICON,
};
-enum indicator_icon_area_type {
+typedef enum indicator_icon_area_type {
+ INDICATOR_ICON_AREA_MORE_NOTI = -1,
INDICATOR_ICON_AREA_FIXED = 0,
INDICATOR_ICON_AREA_SYSTEM,
INDICATOR_ICON_AREA_MINICTRL,
INDICATOR_ICON_AREA_NOTI,
INDICATOR_ICON_AREA_ALARM,
- INDICATOR_ICON_AREA_CONNECTION_SYSTEM
-};
+ INDICATOR_ICON_AREA_CONNECTION_SYSTEM,
+ INDICATOR_ICON_AREA_CNT
+} indicator_icon_area_type;
typedef enum indicator_icon_ani {
ICON_ANI_NONE = 0,
int land_w;
int angle;
Evas_Object *_fixed_box[FIXED_COUNT];
- Evas_Object *_non_fixed_box;
+ Evas_Object *_system_box;
Evas_Object *_minictrl_box;
Evas_Object *_noti_box;
Evas_Object *_connection_system_box;
Evas_Object *_dynamic_box_noti;
Evas_Object *_alarm_box;
Evas_Object *_digit_box;
+ Evas_Object *_more_noti_box;
struct {
int x;
Eina_Bool initialized; /* TRUE is module was correctly initialized */
} icon_s;
-//int rssi_get_sim_number(TapiHandle *handle_obj);
+/**
+ * @brief Gets box for given area type
+ *
+ * #param[in] win struct to extract box poiner from
+ * @param[in] type area type
+ *
+ * @return box
+ */
+Evas_Object *indicator_box_object_get(win_info *win, indicator_icon_area_type type);
+
+/**
+ * @brief Gets box pointer for given area type
+ *
+ * #param[in] win struct to extract box poiner from
+ * @param[in] type area type
+ *
+ * @return pointer to box
+ */
+Evas_Object **indicator_box_object_ptr_get(win_info *win, indicator_icon_area_type type);
#endif /*__INDICATOR_H__*/
extern void list_free_all(void);
/**
+ * @brief Retrieves list of icons.
+ *
+ * @remarks The lists are of all icons registered to indicator app,
+ * not only visible icons
+ *
+ * @param[in] type type of icon area
+ */
+Eina_List *list_list_get(indicator_icon_area_type type);
+
+/**
* @brief Retrieves count of icons that are set to be visible on indicator.
*
* @remarks Number of visible icons may be different that returned value.
*
* @return count of icons that are set to be visible
*/
-unsigned int list_get_active_icons_cnt(enum indicator_icon_area_type area);
+unsigned int list_get_wish_to_show_icons_cnt(enum indicator_icon_area_type area);
+
+/**
+ * @brief Retrieves count of notification icons that are set to be visible on indicator.
+ *
+ * @remarks Number of visible icons may be different that returned value.
+ * This is due to limited space on indicator and GUI Guide.
+ *
+ * @param[in] count_more_noti indicates if more_noti icon should be taken into account or not
+ * @return count of icons that are set to be visible in notification area
+ */
+unsigned int list_get_wish_to_show_noti_icons_cnt(bool count_more_noti);
/**
* @brief Updates list related to the given icon with the icon.
*/
extern void list_update(icon_s *icon);
+void list_move_noti_icon_to_top(icon_s *icon);
/**
* @brief Inserts icon to the list related to the given icon.
*
extern void list_remove_icon(icon_s *icon);
/**
- * @brief Searches for icon that is pending to be shown, but is not shown yet.
+ * @brief Searches for icon that is pending to be shown, but have not been shown yet.
*
* @param[in] area area of icon - #indicator_icon_area_type
* @param[in] priority priority of icon
extern icon_s *list_try_to_find_icon_to_show(int area, int priority);
/**
- * @brief Searches for icon to be removed from indicator.
- *
- * @remarks It searches for visible icon. In fixed are the icon is specified by priority.
- * In other areas icon with lowest priority will be choosen.
+ * @brief Searches for icon to hide due to icons overflow..
*
- * @param[in] area area in which the icon must be removed - #indicator_icon_area_type
- * @param[in] priority priority of icon to remove (only for #INDICATOR_ICON_AREA_FIXED area)
+ * @param[in] area area of icon - #indicator_icon_area_type
+ * @param[in] priority priority of icon
*
* @return pointer to icon to show, NULL if icon were not found
*/
extern icon_s *list_try_to_find_icon_to_remove(int area, int priority);
-/**
- * @brief Retrives visible notification icons count.
- *
- * @return number of visible notification icons
- */
-extern unsigned int list_get_noti_count(void);
-
#endif /*__INDICATOR_ICON_LIST_H__*/
*
*/
-//#include <Ecore_X.h>
#include <Eina.h>
#include <device/display.h>
Eina_List *_view_alarm_list;
Eina_List *_view_connection_system_list;
-/* FIXME */
-#if 0
-win_info *_win;
-#endif
-static int icon_show_state = 0;
-int previous_noti_count = 0;
-
-
-static Evas_Object *_box_add(Evas_Object * parent)
+Evas_Object *box_add(Evas_Object *parent)
{
Evas_Object *obj = NULL;
}
-#if 0
-static void _update_window(win_info *win)
+Eina_List *box_list_get(indicator_icon_area_type type)
{
- int root_w, root_h;
- Ecore_X_Window xwin, root;
-
- retm_if(win == NULL, "Invalid parameter!");
-
- xwin = elm_win_xwindow_get(win->win);
- if (!xwin) return;
- root = ecore_x_window_root_get(xwin);
- if (!root) return;
- ecore_x_window_size_get(root, &root_w, &root_h);
-
- if (win->angle == 0 || win->angle == 180) win->w = root_w;
- else win->w = root_h;
-
- switch (win->angle) {
- case 0:
- ecore_x_window_shape_input_rectangle_set(xwin, root_w - win->w, 0, win->w, win->h);
- break;
- case 90:
- ecore_x_window_shape_input_rectangle_set(xwin, 0, 0, win->h, win->w);
- break;
- case 180:
- ecore_x_window_shape_input_rectangle_set(xwin, 0, 0, win->w, win->h);
- break;
- case 270:
- ecore_x_window_shape_input_rectangle_set(xwin, 0, root_h - win->w, win->h, win->w);
- break;
+ switch (type) {
+ case INDICATOR_ICON_AREA_FIXED:
+ return _view_fixed_list;
+ case INDICATOR_ICON_AREA_SYSTEM:
+ return _view_system_list;
+ case INDICATOR_ICON_AREA_MINICTRL:
+ return _view_minictrl_list;
+ case INDICATOR_ICON_AREA_NOTI:
+ return _view_noti_list;
+ case INDICATOR_ICON_AREA_CONNECTION_SYSTEM:
+ return _view_connection_system_list;
+ case INDICATOR_ICON_AREA_ALARM:
+ return _view_alarm_list;
default:
- break;
+ return NULL;
}
}
-#endif
-
-#if 0
-void box_delete_noti_icon_all(win_info *win)
-{
- icon_s *icon;
- Eina_List *l;
- elm_box_unpack_all(win->_noti_box);
- EINA_LIST_FOREACH(_view_noti_list, l, icon) {
- if (icon->obj_exist == EINA_TRUE) {
- if (icon_del(icon) == EINA_TRUE) {
- icon->obj_exist = EINA_FALSE;
- }
- }
+Eina_List **box_list_ptr_get(indicator_icon_area_type type)
+{
+ switch (type) {
+ case INDICATOR_ICON_AREA_FIXED:
+ return &_view_fixed_list;
+ case INDICATOR_ICON_AREA_SYSTEM:
+ return &_view_system_list;
+ case INDICATOR_ICON_AREA_MINICTRL:
+ return &_view_minictrl_list;
+ case INDICATOR_ICON_AREA_NOTI:
+ return &_view_noti_list;
+ case INDICATOR_ICON_AREA_CONNECTION_SYSTEM:
+ return &_view_connection_system_list;
+ case INDICATOR_ICON_AREA_ALARM:
+ return &_view_alarm_list;
+ default:
+ return NULL;
}
}
-#endif
-
static void _fixed_box_pack_icon(win_info *win, icon_s *icon)
{
case INDICATOR_TXT_WITH_IMG_ICON:
break;
case INDICATOR_DIGIT_ICON:
- switch(icon->digit_area) {
+ switch (icon->digit_area) {
case DIGIT_UNITY:
evas_object_show(icon->img_obj.obj);
elm_box_pack_end(win->_digit_box, icon->img_obj.obj);
}
-
static void _box_pack_icon(icon_s *icon, Evas_Object *box)
{
ret_if(!icon);
#ifdef _support_screen_reader
util_icon_access_register(icon);
#endif
- if (icon->area == INDICATOR_ICON_AREA_NOTI || icon->area == INDICATOR_ICON_AREA_ALARM) {
+
+ if (icon->area == INDICATOR_ICON_AREA_NOTI || icon->area == INDICATOR_ICON_AREA_ALARM)
util_start_noti_ani(icon);
- }
}
-
static void _create_img_obj(icon_s *icon)
{
Evas_Object *img_eo = NULL;
}
-
static void _update_icon(win_info *win, Eina_List *list)
{
icon_s *icon;
ret_if(!win);
ret_if(!list);
- EINA_LIST_FOREACH(list, l, icon) {
- if (icon->obj_exist == EINA_FALSE) {
+ EINA_LIST_REVERSE_FOREACH(list, l, icon) {
+ if (icon->obj_exist == EINA_FALSE)
icon_add(win, icon);
- }
if (icon->obj_exist == EINA_TRUE) {
- if (icon->area == INDICATOR_ICON_AREA_FIXED
- && icon->priority <= INDICATOR_PRIORITY_FIXED_MAX) {
+ if (icon->area == INDICATOR_ICON_AREA_FIXED) {
_create_img_obj(icon);
_fixed_box_pack_icon(win, icon);
- }
- if (icon->area == INDICATOR_ICON_AREA_SYSTEM
- && icon->priority >= INDICATOR_PRIORITY_SYSTEM_MIN
- && icon->priority <= INDICATOR_PRIORITY_SYSTEM_MAX) {
- _create_img_obj(icon);
- _box_pack_icon(icon, win->_non_fixed_box);
- }
- if (icon->area == INDICATOR_ICON_AREA_MINICTRL
- && icon->priority >= INDICATOR_PRIORITY_MINICTRL_MIN
- && icon->priority <= INDICATOR_PRIORITY_MINICTRL_MAX) {
- _create_img_obj(icon);
- _box_pack_icon(icon, win->_minictrl_box);
- }
- if (icon->area == INDICATOR_ICON_AREA_CONNECTION_SYSTEM
- && icon->priority >= INDICATOR_PRIORITY_CONNECTION_SYSTEM_MIN
- && icon->priority <= INDICATOR_PRIORITY_CONNECTION_SYSTEM_MAX) {
- _create_img_obj(icon);
- _box_pack_icon(icon, win->_connection_system_box);
- }
- if (icon->area == INDICATOR_ICON_AREA_NOTI) {
- _create_img_obj(icon);
- _box_pack_icon(icon, win->_noti_box);
- }
- if (icon->area == INDICATOR_ICON_AREA_ALARM) {
+ } else {
_create_img_obj(icon);
- _box_pack_icon(icon, win->_alarm_box);
+ _box_pack_icon(icon, indicator_box_object_get(win, icon->area));
}
+
}
}
}
-
-extern unsigned int box_get_list_size(Box_List list)
+extern unsigned int box_get_list_size(indicator_icon_area_type type)
{
int count = 0;
- switch (list) {
- case FIXED_LIST:
- count = eina_list_count(_view_fixed_list);
- break;
- case SYSTEM_LIST:
- count = eina_list_count(_view_system_list);
- break;
- case MINICTRL_LIST:
- count = eina_list_count(_view_minictrl_list);
- break;
- case CONNECTION_SYSTEM_LIST:
- count = eina_list_count(_view_connection_system_list);
- break;
- case NOTI_LIST:
- count = eina_list_count(_view_noti_list);
- break;
- default:
- _D("List dose not exist");
- break;
- }
+ count = eina_list_count(box_list_get(type));
return count;
}
-
static void _update_display(win_info *win)
{
int i = 0;
ret_if(!win);
- if (box_get_list_size(SYSTEM_LIST)) {
+ if (box_get_list_size(INDICATOR_ICON_AREA_SYSTEM)) {
util_signal_emit(win->data, "indicator.system.show", "indicator.prog");
} else {
util_signal_emit(win->data, "indicator.system.hide", "indicator.prog");
}
- if (box_get_list_size(MINICTRL_LIST)) {
+ if (box_get_list_size(INDICATOR_ICON_AREA_MINICTRL)) {
util_signal_emit(win->data, "indicator.minictrl.show", "indicator.prog");
} else {
util_signal_emit(win->data, "indicator.minictrl.hide", "indicator.prog");
}
- if (box_get_list_size(CONNECTION_SYSTEM_LIST)) {
+ if (box_get_list_size(INDICATOR_ICON_AREA_CONNECTION_SYSTEM)) {
util_signal_emit(win->data, "indicator.connection/system.show", "indicator.prog");
} else {
util_signal_emit(win->data, "indicator.connection/system.hide", "indicator.prog");
}
- if (box_get_list_size(NOTI_LIST)) {
+ if (box_get_list_size(INDICATOR_ICON_AREA_NOTI)) {
util_signal_emit(win->data, "indicator.noti.show", "indicator.prog");
} else {
util_signal_emit(win->data, "indicator.noti.hide", "indicator.prog");
}
- for (i = 0; i < FIXED_COUNT; ++i) {
- elm_box_unpack_all(win->_fixed_box[i]);
- }
-
- elm_box_unpack_all(win->_non_fixed_box);
- elm_box_unpack_all(win->_minictrl_box);
- elm_box_unpack_all(win->_connection_system_box);
- elm_box_unpack_all(win->_noti_box);
- elm_box_unpack_all(win->_alarm_box);
- elm_box_unpack_all(win->_digit_box);
- _update_icon(win, _view_fixed_list);
- _update_icon(win, _view_connection_system_list);
- _update_icon(win, _view_system_list);
- _update_icon(win, _view_minictrl_list);
- _update_icon(win, _view_noti_list);
- _update_icon(win, _view_alarm_list);
+ if (_view_fixed_list) {
+ for (i = 0; i < FIXED_COUNT; ++i)
+ elm_box_unpack_all(win->_fixed_box[i]);
+ _update_icon(win, _view_fixed_list);
+ }
-#if 0
- if (win) _update_window(win);
-#endif
+ indicator_icon_area_type type;
+ for (type = INDICATOR_ICON_AREA_SYSTEM; type < INDICATOR_ICON_AREA_CNT; type++) {
+ if (box_list_get(type)) {
+ elm_box_unpack_all(indicator_box_object_get(win, type));
+ _update_icon(win, box_list_get(type));
+ }
+ }
}
{
ret_if(!win);
-#if 0
- _update_window(win);
-#endif
icon_reset_list();
- Eina_Bool overflow = check_for_icons_overflow();
-
_update_display(win);
-
- check_to_show_more_noti(win, overflow);
-
+ check_to_show_more_noti(win);
}
extern int box_add_icon_to_list(icon_s *icon)
{
struct appdata *ad = NULL;
- int noti_count = 0;
retv_if(!icon, 0);
- ad = (struct appdata*)icon->ad;
+ ad = (struct appdata *)icon->ad;
if (box_exist_icon(icon)) return OK;
- if (INDICATOR_ICON_AREA_FIXED == icon->area) {
- icon->exist_in_view = EINA_TRUE;
+ icon->exist_in_view = EINA_TRUE;
+
+ if (INDICATOR_ICON_AREA_FIXED == icon->area)
_view_fixed_list = eina_list_append(_view_fixed_list, icon);
- } else if(INDICATOR_ICON_AREA_SYSTEM == icon->area) {
- icon_s *data;
- Eina_List *l = NULL;
- EINA_LIST_FOREACH(_view_system_list, l, data) {
- if (data->priority <= icon->priority) {
- icon->exist_in_view = EINA_TRUE;
- _view_system_list = eina_list_prepend_relative_list(_view_system_list, icon, l);
- _D("System (eina_list_append_relative_list) %s",icon->name);
- goto __CATCH;
- }
- }
- /* if finding condition is failed, append it at tail */
- icon->exist_in_view = EINA_TRUE;
- _view_system_list = eina_list_append(_view_system_list, icon);
- _D("System prepend (Priority low) : %s",icon->name);
+ else if (icon->area == INDICATOR_ICON_AREA_ALARM)
+ _view_alarm_list = eina_list_append(_view_alarm_list, icon);
- } else if(INDICATOR_ICON_AREA_MINICTRL == icon->area) {
- _D("Pack to MINICTRL list : %s", icon->name);
+ else {
icon_s *data;
- Eina_List *l;
-
- EINA_LIST_FOREACH(_view_minictrl_list, l, data) {
- if (data->priority <= icon->priority) {
- icon->exist_in_view = EINA_TRUE;
- _view_minictrl_list = eina_list_prepend_relative_list(_view_minictrl_list, icon, l);
- goto __CATCH;
- }
- }
- /* if finding condition is failed, append it at tail */
- icon->exist_in_view = EINA_TRUE;
- _view_minictrl_list = eina_list_append(_view_minictrl_list, icon);
-
- } else if(INDICATOR_ICON_AREA_NOTI == icon->area) {
- if(strncmp(icon->name, MORE_NOTI, strlen(MORE_NOTI))==0)
- {
- icon->exist_in_view = EINA_TRUE;
- _view_noti_list = eina_list_prepend(_view_noti_list, icon);
- goto __CATCH;
- }
-
-
- /* if finding condition is failed, append it at tail */
- icon->exist_in_view = EINA_TRUE;
- _view_noti_list = eina_list_append(_view_noti_list, icon);
+ Eina_List *l = NULL;
+ Eina_List **list;
- } else if(INDICATOR_ICON_AREA_CONNECTION_SYSTEM == icon->area) {
- _D("Pack to Connection/System list : %s", icon->name);
- icon_s *data;
- Eina_List *l;
+ list = box_list_ptr_get(icon->area);
- EINA_LIST_FOREACH(_view_connection_system_list, l, data) {
- if (data->priority <= icon->priority) {
- icon->exist_in_view = EINA_TRUE;
- _view_connection_system_list = eina_list_append_relative_list(_view_connection_system_list, icon, l);
+ EINA_LIST_FOREACH(*list, l, data) {
+ if (data->priority >= icon->priority) {
+ *list = eina_list_prepend_relative_list(*list, icon, l);
goto __CATCH;
}
}
-
- /* if finding condition is failed, append it at tail */
- icon->exist_in_view = EINA_TRUE;
- _view_connection_system_list = eina_list_append(_view_connection_system_list, icon);
-
- } else {
- icon->exist_in_view = EINA_TRUE;
- _view_alarm_list = eina_list_append(_view_alarm_list, icon);
+ *list = eina_list_append(*list, icon);
}
__CATCH:
- previous_noti_count = noti_count;
if (icon->area == INDICATOR_ICON_AREA_NOTI
|| icon->area == INDICATOR_ICON_AREA_SYSTEM
|| icon->area == INDICATOR_ICON_AREA_MINICTRL
|| icon->area == INDICATOR_ICON_AREA_CONNECTION_SYSTEM) {
- int bDisplay = 0;
- bDisplay = 1;
- if (ad->opacity_mode == INDICATOR_OPACITY_TRANSPARENT
- && bDisplay == 1) {
- util_send_status_message_start(ad,2.5);
- }
+ if (ad->opacity_mode == INDICATOR_OPACITY_TRANSPARENT)
+ util_send_status_message_start(ad, 2.5);
}
return OK;
}
-
extern int box_append_icon_to_list(icon_s *icon)
{
- Eina_List *l;
- icon_s *data;
-
retv_if(!icon, 0);
if (box_exist_icon(icon)) return OK;
- switch (icon->area) {
- case INDICATOR_ICON_AREA_FIXED:
- icon->exist_in_view = EINA_TRUE;
- _view_fixed_list = eina_list_append(_view_fixed_list, icon);
- break;
- case INDICATOR_ICON_AREA_SYSTEM:
- icon->exist_in_view = EINA_TRUE;
- _view_system_list = eina_list_append(_view_system_list, icon);
- break;
- case INDICATOR_ICON_AREA_MINICTRL:
- icon->exist_in_view = EINA_TRUE;
- _view_minictrl_list = eina_list_append(_view_minictrl_list, icon);
- break;
- case INDICATOR_ICON_AREA_CONNECTION_SYSTEM:
- icon->exist_in_view = EINA_TRUE;
- _view_connection_system_list = eina_list_append(_view_connection_system_list, icon);
- break;
- case INDICATOR_ICON_AREA_NOTI:
- EINA_LIST_FOREACH(_view_noti_list, l, data) {
- if (strncmp(data->name, MORE_NOTI, strlen(MORE_NOTI)) == 0) {
- icon->exist_in_view = EINA_TRUE;
- _view_noti_list = eina_list_append_relative_list(_view_noti_list, icon, l);
- return OK;
- }
- }
- icon->exist_in_view = EINA_TRUE;
- _view_noti_list = eina_list_append(_view_noti_list, icon);
- break;
- default:
- _D("Icon area does not exists");
- break;
- }
+ Eina_List **list;
+ list = box_list_ptr_get(icon->area);
+
+ icon->exist_in_view = EINA_TRUE;
+ *list = eina_list_append(*list, icon);
+
return OK;
}
-
int box_remove_icon_from_list(icon_s *icon)
{
retv_if(!icon, 0);
- switch (icon->area) {
- case INDICATOR_ICON_AREA_FIXED:
- icon->exist_in_view = EINA_FALSE;
- _view_fixed_list = eina_list_remove(_view_fixed_list, icon);
- break;
- case INDICATOR_ICON_AREA_SYSTEM:
- icon->exist_in_view = EINA_FALSE;
- _view_system_list = eina_list_remove(_view_system_list, icon);
- break;
- case INDICATOR_ICON_AREA_MINICTRL:
- icon->exist_in_view = EINA_FALSE;
- _view_minictrl_list = eina_list_remove(_view_minictrl_list, icon);
- break;
- case INDICATOR_ICON_AREA_NOTI:
- icon->exist_in_view = EINA_FALSE;
- _view_noti_list = eina_list_remove(_view_noti_list, icon);
- break;
- case INDICATOR_ICON_AREA_CONNECTION_SYSTEM:
- icon->exist_in_view = EINA_FALSE;
- _view_connection_system_list = eina_list_remove(_view_connection_system_list, icon);
- break;
- case INDICATOR_ICON_AREA_ALARM:
- icon->exist_in_view = EINA_FALSE;
- _view_alarm_list = eina_list_remove(_view_alarm_list, icon);
- break;
- default:
- _D("icon area dose not exists");
- break;
- }
+ Eina_List **list;
+ list = box_list_ptr_get(icon->area);
-#if 0
- int noti_count = 0;
+ icon->exist_in_view = EINA_FALSE;
+ *list = eina_list_remove(*list, icon);
- noti_count = box_get_list_size(NOTI_LIST);
- if (noti_count > 0) {
- util_signal_emit(_win->data, "indicator.noti.show", "indicator.prog");
- } else {
- _D("Need to stop blink animation and hide icon");
- util_signal_emit_by_win(_win->data,"indicator.noti.hide", "indicator.prog");
- }
-#endif
#ifdef _SUPPORT_SCREEN_READER
util_icon_access_unregister(icon);
#endif
}
-
extern void box_init(win_info *win)
{
char *str_text = NULL;
/* Make Fixed Box Object */
for (i = 0; i < FIXED_COUNT; ++i) {
if (win->_fixed_box[i] == NULL) {
- win->_fixed_box[i] = _box_add(win->layout);
+ win->_fixed_box[i] = box_add(win->layout);
ret_if(!(win->_fixed_box[i]));
Eina_Strbuf *temp_str = eina_strbuf_new();
}
}
/* Make Non Fixed Box(CONNECTION/SYSTEM) Object */
- win->_connection_system_box = _box_add(win->layout);
+ win->_connection_system_box = box_add(win->layout);
ret_if(!(win->_connection_system_box));
evas_object_size_hint_align_set(win->_connection_system_box, EVAS_HINT_FILL, EVAS_HINT_FILL);
edje_object_part_swallow(elm_layout_edje_get(win->layout), CONNECTION_SYSTEM_BOX_PART_NAME, win->_connection_system_box);
/* Make Non Fixed Box(SYSTEM) Object */
- win->_non_fixed_box = _box_add(win->layout);
- ret_if(!(win->_non_fixed_box));
+ win->_system_box = box_add(win->layout);
+ ret_if(!(win->_system_box));
- evas_object_size_hint_align_set(win->_non_fixed_box, EVAS_HINT_FILL, EVAS_HINT_FILL);
- edje_object_part_swallow(elm_layout_edje_get(win->layout), SYSTEM_BOX_PART_NAME, win->_non_fixed_box);
+ evas_object_size_hint_align_set(win->_system_box, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ edje_object_part_swallow(elm_layout_edje_get(win->layout), SYSTEM_BOX_PART_NAME, win->_system_box);
/* Make Non Fixed Box(MINICTRL) Object */
- win->_minictrl_box = _box_add(win->layout);
+ win->_minictrl_box = box_add(win->layout);
ret_if(!(win->_minictrl_box));
evas_object_size_hint_align_set(win->_minictrl_box, EVAS_HINT_FILL, EVAS_HINT_FILL);
edje_object_part_swallow(elm_layout_edje_get(win->layout), MINICTRL_BOX_PART_NAME, win->_minictrl_box);
/* Make Non Fixed Box(NOTI) Box Object */
- win->_noti_box = _box_add(win->layout);
+ win->_noti_box = box_add(win->layout);
ret_if(!(win->_noti_box));
evas_object_size_hint_align_set(win->_noti_box, EVAS_HINT_FILL, EVAS_HINT_FILL);
edje_object_part_swallow(elm_layout_edje_get(win->layout), NOTI_BOX_PART_NAME, win->_noti_box);
- win->_alarm_box = _box_add(win->layout);
+ win->_alarm_box = box_add(win->layout);
ret_if(!(win->_alarm_box));
evas_object_size_hint_align_set(win->_alarm_box, EVAS_HINT_FILL, EVAS_HINT_FILL);
edje_object_part_swallow(elm_layout_edje_get(win->layout), "indicator.alarm.icon", win->_alarm_box);
- win->_digit_box = _box_add(win->layout);
+ win->_digit_box = box_add(win->layout);
ret_if(!(win->_digit_box));
evas_object_size_hint_align_set(win->_digit_box, EVAS_HINT_FILL, EVAS_HINT_FILL);
}
-
-
extern void box_fini(win_info *win)
{
int i = 0;
ret_if(!win);
ret_if(!(win->layout));
+ indicator_icon_area_type type;
+ for (type = INDICATOR_ICON_AREA_SYSTEM; type < INDICATOR_ICON_AREA_CNT; type++) {
+ Evas_Object **obj = indicator_box_object_ptr_get(win, type);
+ if (obj && *obj) {
+ edje_object_part_unswallow(elm_layout_edje_get(win->layout), *obj);
+ elm_box_unpack_all(*obj);
+ evas_object_del(*obj);
+ *obj = NULL;
+ }
+ }
+
if (win->_digit_box != NULL) {
edje_object_part_unswallow(elm_layout_edje_get(win->layout), win->_digit_box);
elm_box_unpack_all(win->_digit_box);
win->_digit_box = NULL;
}
- if (win->_non_fixed_box != NULL) {
- edje_object_part_unswallow(elm_layout_edje_get(win->layout), win->_non_fixed_box);
- elm_box_unpack_all(win->_non_fixed_box);
- evas_object_del(win->_non_fixed_box);
- win->_non_fixed_box = NULL;
- }
-
- if (win->_connection_system_box != NULL) {
- edje_object_part_unswallow(elm_layout_edje_get(win->layout), win->_connection_system_box);
- elm_box_unpack_all(win->_connection_system_box);
- evas_object_del(win->_connection_system_box);
- win->_connection_system_box = NULL;
- }
-
- if (win->_minictrl_box != NULL) {
- edje_object_part_unswallow(elm_layout_edje_get(win->layout), win->_minictrl_box);
- elm_box_unpack_all(win->_minictrl_box);
- evas_object_del(win->_minictrl_box);
- win->_minictrl_box = NULL;
- }
-
- if (win->_noti_box != NULL) {
- edje_object_part_unswallow(elm_layout_edje_get(win->layout), win->_noti_box);
- elm_box_unpack_all(win->_noti_box);
- evas_object_del(win->_noti_box);
- win->_noti_box = NULL;
- }
-
- if (win->_alarm_box != NULL) {
- edje_object_part_unswallow(elm_layout_edje_get(win->layout), win->_alarm_box);
- elm_box_unpack_all(win->_alarm_box);
- evas_object_del(win->_alarm_box);
- win->_alarm_box = NULL;
- }
-
for (i = 0; i < FIXED_COUNT; ++i) {
if (win->_fixed_box[i] != NULL) {
edje_object_part_unswallow(elm_layout_edje_get(win->layout), win->_fixed_box[i]);
return;
}
-
-int box_get_enabled_noti_count(void)
-{
- int enabled_noti_cnt = 0;
-
- int system_cnt = box_get_list_size(SYSTEM_LIST);
- int minictrl_cnt = box_get_list_size(MINICTRL_LIST);
- _D("System Count : %d, Minictrl Count : %d", system_cnt, minictrl_cnt);
-
- enabled_noti_cnt = MAX_NOTI_ICONS_PORT - system_cnt - minictrl_cnt;
- if(enabled_noti_cnt <= 0) {
- enabled_noti_cnt = 1; // Notification icon must show at least 1.
- }
-
- _D("Notification icon enabled_noti_cnt %d",enabled_noti_cnt);
-
- return enabled_noti_cnt;
-}
-
-
-
-int box_get_enabled_system_count(void)
-{
- int system_cnt = 0;
- int noti_cnt = box_get_list_size(NOTI_LIST);
- int minictrl_cnt = box_get_list_size(MINICTRL_LIST);
-
- _D("Noti count : %d , MiniCtrl count : %d", noti_cnt, minictrl_cnt);
-
- system_cnt = PORT_SYSTEM_ICON_COUNT; // MAX = 5(UI Guide).
-
- if(noti_cnt > 0) {
- system_cnt--; // Notification icon must show at least 1.
- }
-
- if(minictrl_cnt > 0) {
- system_cnt--; // Minictrl icon must show at least 1.
- }
-
- return system_cnt;
-}
-
-
-int box_get_enabled_connection_system_count(void)
-{
- _D("box_get_enabled_connection_system_count");
-
- return PORT_CONNECTION_SYSTEM_ICON_COUNT; /* MAX = 2 */
-}
-
-int box_get_enabled_minictrl_count(void)
-{
- int icon_count = 0;
- int noti_count = box_get_list_size(NOTI_LIST);
- int system_count = box_get_list_size(SYSTEM_LIST);
-
- icon_count = PORT_MINICTRL_ICON_COUNT; // = 2. MIN (1) / MAX (6)
-
- if(noti_count) { // noti_count >= 1
- if(system_count >= 3) {
- icon_count--; // icon_count = 2 -> 1
- } else if(system_count <= 1) {
- icon_count++; // icon_count = 2 -> 3
- }
- } else { // noti_count == 0
- if(system_count >= 4) {
- icon_count--; // icon_count = 2 -> 1
- } else if(system_count <= 2) {
- icon_count++; // icon_count = 2 -> 3
- }
- }
-
- _D("Noti count : %d, System count : %d, Minictrl count : %d", noti_count, system_count, icon_count);
-
- return icon_count;
-}
-
-
-
int box_get_max_count_in_non_fixed_list(void)
{
return PORT_NONFIXED_ICON_COUNT;
}
-
-Icon_AddType box_is_enable_to_insert_in_non_fixed_list(icon_s *obj)
-{
- icon_s *icon;
- Eina_List *l;
-
- int higher_cnt = 0;
- int same_cnt = 0;
- int same_top_cnt = 0;
- int lower_cnt = 0;
- int noti_cnt = box_get_list_size(NOTI_LIST);
- Eina_List * tmp_list = NULL;
-
- retv_if(!obj, 0);
-
- switch (obj->area) {
- case INDICATOR_ICON_AREA_SYSTEM:
- tmp_list = _view_system_list;
- break;
- case INDICATOR_ICON_AREA_MINICTRL:
- tmp_list = _view_minictrl_list;
- break;
- case INDICATOR_ICON_AREA_NOTI:
- tmp_list = _view_noti_list;
- break;
- default:
- _D("obj area does not exists");
- break;
- }
-
- EINA_LIST_FOREACH(tmp_list, l, icon) {
- /* If same Icon exist in non-fixed view list, it need not to add icon */
- if (!strcmp(icon->name, obj->name)) {
- return CANNOT_ADD;
- }
-
- if (icon->priority > obj->priority) {
- ++higher_cnt;
- } else if (icon->priority == obj->priority) {
- ++same_cnt;
- if (icon->always_top == EINA_TRUE) {
- ++same_top_cnt;
- }
- } else {
- lower_cnt++;
- }
- }
-
- if (obj->area == INDICATOR_ICON_AREA_SYSTEM) {
- if (higher_cnt + same_cnt + lower_cnt >= box_get_enabled_system_count()) {
- if (obj->always_top == EINA_TRUE) {
- if(same_top_cnt >= box_get_enabled_system_count()) {
- return CANNOT_ADD;
- } else {
- return CAN_ADD_WITH_DEL_SYSTEM;
- }
- } else {
- if (higher_cnt >= box_get_enabled_system_count()) {
- return CANNOT_ADD;
- } else {
- return CAN_ADD_WITH_DEL_SYSTEM;
- }
- }
- } else {
- return CAN_ADD_WITHOUT_DEL;
- }
- } else if (obj->area == INDICATOR_ICON_AREA_MINICTRL) {
- if (higher_cnt + same_cnt + lower_cnt >= box_get_enabled_minictrl_count()) {
- if (obj->always_top == EINA_TRUE) {
- if (same_top_cnt >= box_get_enabled_minictrl_count()) {
- return CANNOT_ADD;
- } else {
- return CAN_ADD_WITH_DEL_MINICTRL;
- }
- } else {
- if (higher_cnt >= box_get_enabled_minictrl_count()) {
- return CANNOT_ADD;
- } else {
- return CAN_ADD_WITH_DEL_MINICTRL;
- }
- }
- } else {
- return CAN_ADD_WITHOUT_DEL;
- }
- } else {
- if (noti_cnt > MAX_NOTI_ICONS_PORT) {
- return CAN_ADD_WITH_DEL_NOTI;
- } else {
- return CAN_ADD_WITHOUT_DEL;
- }
- }
-
- return CANNOT_ADD;
-}
-
-
-
int box_get_priority_in_move_area(win_info *win, Evas_Coord curr_x, Evas_Coord curr_y)
{
Evas_Coord x, y, h, w;
}
-
int box_check_indicator_area(win_info *win, Evas_Coord curr_x, Evas_Coord curr_y)
{
Evas_Coord x, y, w, h;
}
-
int box_check_home_icon_area(win_info *win, Evas_Coord curr_x, Evas_Coord curr_y)
{
Evas_Coord x, y, w, h;
}
-
int box_check_more_icon_area(win_info *win, Evas_Coord curr_x, Evas_Coord curr_y)
{
Evas_Coord x, y, w, h;
}
-
-void box_icon_state_set(int bShow, char* file, int line)
-{
- icon_show_state = bShow;
-}
-
-
-
-int box_icon_state_get(void)
-{
- return icon_show_state;
-}
-
-
-
extern Eina_Bool box_exist_icon(icon_s *obj)
{
retv_if(!obj, ECORE_CALLBACK_CANCEL);
- switch (obj->area) {
- case INDICATOR_ICON_AREA_FIXED:
- if (eina_list_data_find(_view_fixed_list, obj)) {
- return EINA_TRUE;
- } else {
- return EINA_FALSE;
- }
- case INDICATOR_ICON_AREA_SYSTEM:
- if (eina_list_data_find(_view_system_list, obj)) {
- return EINA_TRUE;
- } else {
- return EINA_FALSE;
- }
- case INDICATOR_ICON_AREA_MINICTRL:
- if (eina_list_data_find(_view_minictrl_list, obj)) {
- return EINA_TRUE;
- } else {
- return EINA_FALSE;
- }
- case INDICATOR_ICON_AREA_CONNECTION_SYSTEM:
- if (eina_list_data_find(_view_connection_system_list, obj)) {
- return EINA_TRUE;
- } else {
- return EINA_FALSE;
- }
- case INDICATOR_ICON_AREA_NOTI:
- if (eina_list_data_find(_view_noti_list, obj)) {
- return EINA_TRUE;
- } else {
- return EINA_FALSE;
- }
- default:
- break;
- }
-
- return EINA_FALSE;
+ if (eina_list_data_find(box_list_get(obj->area), obj))
+ return EINA_TRUE;
+ else
+ return EINA_FALSE;
}
-
int box_handle_animated_gif(icon_s *icon)
{
display_state_e state;
retvm_if(icon == NULL, FAIL, "Invalid parameter!");
- if (elm_image_animated_available_get(icon_eo) == EINA_FALSE) {
+ if (elm_image_animated_available_get(icon_eo) == EINA_FALSE)
return FAIL;
- }
int ret = device_display_get_state(&state);
if (ret != DEVICE_ERROR_NONE) {
}
switch (state) {
- case DISPLAY_STATE_SCREEN_OFF: //LCD OFF
+ case DISPLAY_STATE_SCREEN_OFF:
elm_image_animated_play_set(icon_eo, EINA_FALSE);
break;
- case DISPLAY_STATE_NORMAL: //LCD ON
+ case DISPLAY_STATE_NORMAL:
default:
elm_image_animated_set(icon_eo, EINA_TRUE);
if (!elm_image_animated_play_get(icon_eo))
}
-
void box_noti_ani_handle(int bStart)
{
icon_s *icon;
EINA_LIST_FOREACH(_view_noti_list, l, icon) {
if (icon->obj_exist == EINA_TRUE) {
- if (bStart == 1) {
+ if (bStart == 1)
util_start_noti_ani(icon);
- } else {
+ else
util_stop_noti_ani(icon);
- }
}
}
}
#define PORT_MORE_NOTI_ICON 1
-static unsigned int update_icon_flag = 1; // For battery problem
-static Eina_Bool icons_overflow = EINA_FALSE;
+static unsigned int update_icon_flag = 1; /* For battery problem */
static void _reset_on_timer_icon_animation(icon_s *icon)
{
}
-
static Eina_Bool _animate_on_timer_cb(void *data)
{
icon_s *icon = NULL;
return ECORE_CALLBACK_CANCEL;
}
- if ((ecore_time_unix_get() - icon->last_animation_timestamp) < ON_TIMER_ICON_ANIMATION_FRAME_TIME) {
+ if ((ecore_time_unix_get() - icon->last_animation_timestamp) < ON_TIMER_ICON_ANIMATION_FRAME_TIME)
return ECORE_CALLBACK_RENEW;
- }
Evas_Object *img_edje = elm_layout_edje_get(icon->img_obj.obj);
retv_if(!img_edje, ECORE_CALLBACK_CANCEL);
snprintf(signal_to_emit, SIGNAL_SIZE, icon->signal_to_emit_prefix, icon->animation_state);
- edje_object_signal_emit(img_edje, signal_to_emit,"prog");
+ edje_object_signal_emit(img_edje, signal_to_emit, "prog");
if (icon->animation_state == UD_ICON_ANI_STATE_MAX) {
icon->animation_state = UD_ICON_ANI_STATE_0;
- } else {
+ } else
icon->animation_state++;
- }
+
icon->last_animation_timestamp = ecore_time_unix_get();
return ECORE_CALLBACK_RENEW;
}
-
static const char *_icon_ani_type_set_send_signal(icon_s *icon, Icon_Ani_Type type)
{
retv_if(!icon, NULL);
_reset_on_timer_icon_animation(icon);
send_signal = "dummy.signal";
- if (type == ICON_ANI_DOWNLOADING) {
+ if (type == ICON_ANI_DOWNLOADING)
strncpy(icon->signal_to_emit_prefix, DOWNLOAD_ICON_ANIMATION_SIGNAL, sizeof(DOWNLOAD_ICON_ANIMATION_SIGNAL));
- }
- if (type == ICON_ANI_UPLOADING) {
- strncpy(icon->signal_to_emit_prefix, UPLOAD_ICON_ANIMATION_SIGNAL,sizeof(UPLOAD_ICON_ANIMATION_SIGNAL));
- }
+ if (type == ICON_ANI_UPLOADING)
+ strncpy(icon->signal_to_emit_prefix, UPLOAD_ICON_ANIMATION_SIGNAL, sizeof(UPLOAD_ICON_ANIMATION_SIGNAL));
+
icon->animation_in_progress = EINA_TRUE;
- icon->p_animation_timer = ecore_timer_add(ON_TIMER_ICON_ANIMATION_FRAME_TIME,_animate_on_timer_cb, icon);
+ icon->p_animation_timer = ecore_timer_add(ON_TIMER_ICON_ANIMATION_FRAME_TIME, _animate_on_timer_cb, icon);
}
break;
default:
}
-
void icon_ani_set(icon_s *icon, Icon_Ani_Type type)
{
Evas_Object *img_edje = NULL;
switch (icon->type) {
case INDICATOR_IMG_ICON:
img_edje = elm_layout_edje_get(icon->img_obj.obj);
- edje_object_signal_emit(img_edje, send_signal,"elm.swallow.icon");
+ edje_object_signal_emit(img_edje, send_signal, "elm.swallow.icon");
break;
case INDICATOR_TXT_ICON:
break;
break;
case INDICATOR_DIGIT_ICON:
img_edje = elm_layout_edje_get(icon->img_obj.obj);
- edje_object_signal_emit(img_edje, send_signal,"elm.swallow.icon");
+ edje_object_signal_emit(img_edje, send_signal, "elm.swallow.icon");
break;
default:
break;
}
-
static void _fixed_icon_layout_file_set(icon_s *icon, Evas_Object *ly)
{
ret_if(!icon);
ret_if(!ly);
- if(icon->type == INDICATOR_DIGIT_ICON && icon->digit_area == DIGIT_DOZENS) {
+ if (icon->type == INDICATOR_DIGIT_ICON && icon->digit_area == DIGIT_DOZENS)
elm_layout_file_set(ly, util_get_res_file_path(ICON_THEME_FILE), "elm/indicator/icon/dozen_digit");
- } else {
+ else
elm_layout_file_set(ly, util_get_res_file_path(ICON_THEME_FILE), "elm/indicator/icon/base");
- }
}
-
static void _noti_ani_icon_layout_file_set(int noti_is_ani, Evas_Object *ly)
{
ret_if(!ly);
if (noti_is_ani) {
evas_object_data_set(ly, PRIVATE_DATA_KEY_ICON_B_ANI, (void *) 1);
elm_layout_file_set(ly, util_get_res_file_path(ICON_NONFIXED_THEME_ANI_FILE), "elm/indicator/icon/base");
- } else {
+ } else
elm_layout_file_set(ly, util_get_res_file_path(ICON_NONFIXED_THEME_FILE), "elm/indicator/icon/base");
- }
}
-
static Evas_Object *_img_icon_add(win_info *win, icon_s *icon)
{
char path[PATH_MAX];
_reset_on_timer_icon_animation(icon);
- if (icon->img_obj.width <= 0) {
+ if (icon->img_obj.width <= 0)
icon->img_obj.width = DEFAULT_ICON_WIDTH;
- }
- if (icon->img_obj.height <= 0) {
+ if (icon->img_obj.height <= 0)
icon->img_obj.height = DEFAULT_ICON_HEIGHT;
- }
memset(path, 0x00, sizeof(path));
ly = elm_layout_add(win->layout);
retv_if(!ly, NULL);
- if (icon->area == INDICATOR_ICON_AREA_FIXED) {
+ if (icon->area == INDICATOR_ICON_AREA_FIXED)
_fixed_icon_layout_file_set(icon, ly);
- } else {
+ else {
noti_is_ani = util_check_noti_ani(imgpath);
_noti_ani_icon_layout_file_set(noti_is_ani, ly);
}
b_ani = (int) evas_object_data_get(ly, PRIVATE_DATA_KEY_ICON_B_ANI);
if (!b_ani) {
- /* Absolute path? */
- if (strncmp(imgpath, "/", 1) != 0) {
+ if (strncmp(imgpath, "/", 1) != 0)
snprintf(path, sizeof(path), "%s/%s", util_get_icon_dir(), imgpath);
- } else {
+ else
strncpy(path, imgpath, sizeof(path)-1);
- }
- if (!ecore_file_exists(path)) {
+ if (!ecore_file_exists(path))
_E("icon file does not exist : %s", path);
- }
+
elm_image_file_set(evas_icon, path, NULL);
}
}
-
-char *icon_label_set(const char *buf, char *font_name, char *font_style, int font_size, void *data)
-{
- Eina_Strbuf *temp_buf = NULL;
- char *ret_str = NULL;
- char *label_font = ICON_FONT_NAME;
- char *label_font_style = ICON_FONT_STYLE;
- int label_font_size = ICON_FONT_SIZE;
- Eina_Bool buf_result = EINA_FALSE;
-
- retvm_if(data == NULL || buf == NULL, NULL, "Invalid parameter!");
-
- temp_buf = eina_strbuf_new();
- if (font_name != NULL)
- label_font = font_name;
- if (font_style != NULL)
- label_font_style = font_style;
- if (font_size > 0)
- label_font_size = font_size;
-
- buf_result = eina_strbuf_append_printf(temp_buf, CUSTOM_LABEL_STRING,
- label_font, label_font_style,
- label_font_size, buf);
-
- if (buf_result != EINA_FALSE)
- ret_str = eina_strbuf_string_steal(temp_buf);
-
- eina_strbuf_free(temp_buf);
-
- return ret_str;
-}
-
-
-
Eina_Bool icon_add(win_info *win, icon_s *icon)
{
retv_if(!icon, EINA_FALSE);
}
-
Eina_Bool icon_del(icon_s *icon)
{
Evas_Object *icon_obj;
if (icon->obj_exist != EINA_FALSE) {
if (icon->img_obj.obj) {
- icon_obj =
- evas_object_data_get(icon->img_obj.obj, DATA_KEY_IMG_ICON);
+ icon_obj = evas_object_data_get(icon->img_obj.obj, DATA_KEY_IMG_ICON);
evas_object_del(icon_obj);
evas_object_del(icon->img_obj.obj);
icon->img_obj.obj = NULL;
}
-
-/******************************************************************************
- *
- * Static functions : util functions - check priority
- *
- *****************************************************************************/
-
-static int _show_others_in_same_priority(icon_s *icon)
-{
- icon_s *wish_add_icon;
- int area = icon->area;
- retvm_if(icon == NULL, FAIL, "Invalid parameter!");
-
- wish_add_icon = list_try_to_find_icon_to_show(icon->area, icon->priority);
- if (wish_add_icon == NULL)
- {
- return OK;
- }
-
- if (box_exist_icon(wish_add_icon))
- {
- /* Already shown icon */
- return OK;
- }
-
- if(area == INDICATOR_ICON_AREA_NOTI)
- {
- box_append_icon_to_list(wish_add_icon);
- }
- else
- {
- box_add_icon_to_list(wish_add_icon);
- }
-
- return OK;
-}
-
-
-
-static int _hide_others_in_view_list(icon_s *icon)
-{
- icon_s *wish_remove_icon = NULL;
- retvm_if(icon == NULL, FAIL, "Invalid parameter!");
-
- if (INDICATOR_ICON_AREA_SYSTEM == icon->area || INDICATOR_ICON_AREA_NOTI == icon->area || INDICATOR_ICON_AREA_MINICTRL == icon->area)
- {
- Icon_AddType ret;
-
- /* In Case of Nonfixed icon, remove same or
- * lower priority icon. Check count of non-fixed view list
- * to insert icon
- */
- ret = box_is_enable_to_insert_in_non_fixed_list(icon);
- icon->wish_to_show = EINA_TRUE;
- list_update(icon);
-
- switch (ret) {
- case CAN_ADD_WITH_DEL_NOTI:
- wish_remove_icon = list_try_to_find_icon_to_remove(INDICATOR_ICON_AREA_NOTI,0);
- box_remove_icon_from_list(wish_remove_icon);
-
- retvm_if(wish_remove_icon == NULL, FAIL, "Unexpected Error : CAN_ADD_WITH_DEL_NOTI");
- break;
- case CAN_ADD_WITH_DEL_SYSTEM:
- wish_remove_icon = list_try_to_find_icon_to_remove(INDICATOR_ICON_AREA_SYSTEM,0);
-
- box_remove_icon_from_list(wish_remove_icon);
- retvm_if(wish_remove_icon == NULL, FAIL, "Unexpected Error : CAN_ADD_WITH_DEL_SYSTEM");
- break;
- case CAN_ADD_WITH_DEL_MINICTRL:
- wish_remove_icon = list_try_to_find_icon_to_remove(INDICATOR_ICON_AREA_MINICTRL,0);
-
- box_remove_icon_from_list(wish_remove_icon);
- retvm_if(wish_remove_icon == NULL, FAIL, "Unexpected Error : CAN_ADD_WITH_DEL_MINICTRL");
- break;
- case CAN_ADD_WITHOUT_DEL:
- break;
- case CANNOT_ADD:
- return FAIL;
- }
-
- return OK;
- }
- else if (INDICATOR_ICON_AREA_FIXED == icon->area)
- {
- /* In Case of fixed icon, remove same priority icon */
- wish_remove_icon = list_try_to_find_icon_to_remove(INDICATOR_ICON_AREA_FIXED,icon->priority);
-
- /* First icon in the priority */
- if (wish_remove_icon == NULL)
- {
- return OK;
- }
-
- /* Already shown icon */
- if (wish_remove_icon == icon)
- {
- return FAIL;
- }
-
- icon->wish_to_show = EINA_TRUE;
- list_update(icon);
-
- /* Wish_remove_icon is always_top icon */
- if (wish_remove_icon->always_top)
- {
- return FAIL;
- }
-
- /* Other Icon of Same Priority should remove in view list */
- box_remove_icon_from_list(wish_remove_icon);
- }
-
- return OK;
-}
-
-
-
-/******************************************************************************
- *
- * Util Functions : external
- *
- *****************************************************************************/
-
-#if 0
-int icon_width_set(icon_s *icon)
-{
- return 0;
-}
-#endif
-
-
static int _icon_update(icon_s *icon)
{
struct appdata *ad = NULL;
memset(buf, 0x00, sizeof(buf));
if (icon->type == INDICATOR_IMG_ICON || icon->type == INDICATOR_TXT_WITH_IMG_ICON || icon->type == INDICATOR_DIGIT_ICON) {
- if (icon->area== INDICATOR_ICON_AREA_FIXED) {
- if(icon->type == INDICATOR_DIGIT_ICON && icon->digit_area == DIGIT_DOZENS) {
+ if (icon->area == INDICATOR_ICON_AREA_FIXED) {
+ if (icon->type == INDICATOR_DIGIT_ICON && icon->digit_area == DIGIT_DOZENS)
elm_layout_file_set(icon->img_obj.obj, util_get_res_file_path(ICON_THEME_FILE), "elm/indicator/icon/dozen_digit");
- } else {
+ else
elm_layout_file_set(icon->img_obj.obj, util_get_res_file_path(ICON_THEME_FILE), "elm/indicator/icon/base");
- }
+
} else {
- if(util_check_noti_ani(icon->img_obj.data)) {
+ if (util_check_noti_ani(icon->img_obj.data))
elm_layout_file_set(icon->img_obj.obj, util_get_res_file_path(ICON_NONFIXED_THEME_ANI_FILE), "elm/indicator/icon/base");
- } else{
+ else
elm_layout_file_set(icon->img_obj.obj, util_get_res_file_path(ICON_NONFIXED_THEME_FILE), "elm/indicator/icon/base");
- }
}
img_eo = evas_object_data_get(icon->img_obj.obj, DATA_KEY_IMG_ICON);
util_start_noti_ani(icon);
/* Check absolute path */
- retvm_if(icon->img_obj.data == NULL, FAIL,"Invalid parameter!");
+ retvm_if(icon->img_obj.data == NULL, FAIL, "Invalid parameter!");
if (strncmp(icon->img_obj.data, "/", 1) != 0) {
- snprintf(buf, sizeof(buf), "%s/%s", util_get_icon_dir(),icon->img_obj.data);
+ snprintf(buf, sizeof(buf), "%s/%s", util_get_icon_dir(), icon->img_obj.data);
elm_image_file_set(img_eo, buf, NULL);
} else {
- retvm_if(icon->img_obj.data[0] == '\0', FAIL,"Invalid parameter!");
+ retvm_if(icon->img_obj.data[0] == '\0', FAIL, "Invalid parameter!");
elm_image_file_set(img_eo, icon->img_obj.data, NULL);
}
- if (icon->img_obj.width >= 0 && icon->img_obj.height>=0) {
+ if (icon->img_obj.width >= 0 && icon->img_obj.height >= 0) {
evas_object_size_hint_min_set(img_eo,
ELM_SCALE_SIZE(icon->img_obj.width),
ELM_SCALE_SIZE(icon->img_obj.height));
- } else {
+ } else
evas_object_size_hint_min_set(img_eo, ELM_SCALE_SIZE(DEFAULT_ICON_WIDTH), ELM_SCALE_SIZE(DEFAULT_ICON_HEIGHT));
- }
}
- if (icon->area == INDICATOR_ICON_AREA_SYSTEM) {
- int bDisplay = 0;
- bDisplay = 1;
- if(ad->opacity_mode == INDICATOR_OPACITY_TRANSPARENT && bDisplay == 1) {
- util_send_status_message_start(ad,2.5);
- }
- }
+ if (icon->area == INDICATOR_ICON_AREA_SYSTEM && ad->opacity_mode == INDICATOR_OPACITY_TRANSPARENT)
+ util_send_status_message_start(ad, 2.5);
return OK;
}
+void icon_noti_priority_set(icon_s *icon)
+{
+ icon->priority = time(NULL) * (-1);
+}
+
void icon_show(icon_s *icon)
{
ret_if(!icon);
ret_if(!(icon->ad));
+ icon->wish_to_show = EINA_TRUE;
+
ad = (struct appdata *)icon->ad;
- if (icon->obj_exist != EINA_FALSE) {
- if (icon->priority == INDICATOR_PRIORITY_NOTI_2) {
+ if (icon->area == INDICATOR_ICON_AREA_NOTI) {
+ icon_noti_priority_set(icon);
+ list_update(icon);
+ }
+
+ if (icon->obj_exist == EINA_TRUE) {
+ if (icon->priority == INDICATOR_ICON_AREA_NOTI) {
box_remove_icon_from_list(icon);
box_add_icon_to_list(icon);
box_update_display(&(ad->win));
- } else {
+ return;
+ } else
_icon_update(icon);
- }
- }
- if (_hide_others_in_view_list(icon) == FAIL) {
- return;
}
-
box_add_icon_to_list(icon);
-
box_update_display(&(ad->win));
}
+
void icon_hide(icon_s *icon)
{
- int ret;
-
- retm_if(icon == NULL, "Invalid parameter!");
+ retm_if(!icon, "Invalid parameter!");
struct appdata *ad = (struct appdata *)icon->ad;
icon->wish_to_show = EINA_FALSE;
- if (icon->exist_in_view == EINA_TRUE) {
- ret = box_remove_icon_from_list(icon);
-
- if (ret == FAIL)
- _E("Failed to unpack!");
+ if (icon->exist_in_view == EINA_TRUE)
+ box_remove_icon_from_list(icon);
- _show_others_in_same_priority(icon);
-
- box_update_display(&(ad->win));
-
- }
+ box_update_display(&(ad->win));
}
memset(buf, 0x00, sizeof(buf));
if (count) {
snprintf(buf, sizeof(buf), "%d", count);
- util_signal_emit(data,"badge,show,1","elm.image.badge");
+ util_signal_emit(data, "badge,show,1", "elm.image.badge");
} else {
- util_signal_emit(data,"badge,hide,1","elm.image.badge");
+ util_signal_emit(data, "badge,hide,1", "elm.image.badge");
}
- util_part_text_emit(data,"elm.text.badge", buf);
+ util_part_text_emit(data, "elm.text.badge", buf);
_cnt = count;
}
}
}
-
void icon_set_update_flag(unsigned int val)
{
- _D("SET UPDATE FLAG %d",val);
+ _D("SET UPDATE FLAG %d", val);
update_icon_flag = val;
}
icon_s *wish_remove_icon = NULL;
wish_remove_icon = list_try_to_find_icon_to_remove(area, 0);
- if (!wish_remove_icon)
- return EINA_FALSE;
+ retv_if(!wish_remove_icon, EINA_FALSE);
box_remove_icon_from_list(wish_remove_icon);
{
icon_s *wish_add_icon = NULL;
wish_add_icon = list_try_to_find_icon_to_show(area, 0);
- if (wish_add_icon == NULL) {
- return EINA_FALSE;
- }
- if (box_exist_icon(wish_add_icon))
- return EINA_FALSE;
+ retv_if(!wish_add_icon, EINA_FALSE);
- box_append_icon_to_list(wish_add_icon);
+ retv_if(box_exist_icon(wish_add_icon), EINA_FALSE);
+
+ box_add_icon_to_list(wish_add_icon);
return EINA_TRUE;
}
-Eina_Bool check_for_icons_overflow(void)
+static Eina_Bool check_for_icons_overflow(void)
{
- int sys_cnt = list_get_active_icons_cnt(INDICATOR_ICON_AREA_SYSTEM);
- int minictrl_cnt = list_get_active_icons_cnt(INDICATOR_ICON_AREA_MINICTRL);
- int noti_cnt = list_get_active_icons_cnt(INDICATOR_ICON_AREA_NOTI);
+ int sys_cnt = list_get_wish_to_show_icons_cnt(INDICATOR_ICON_AREA_SYSTEM);
+ int minictrl_cnt = list_get_wish_to_show_icons_cnt(INDICATOR_ICON_AREA_MINICTRL);
+ int noti_cnt = list_get_wish_to_show_icons_cnt(INDICATOR_ICON_AREA_NOTI);
if ((sys_cnt + minictrl_cnt + noti_cnt) <= PORT_NONFIXED_ICON_COUNT)
return EINA_FALSE;
}
-void check_to_show_more_noti(win_info *win, Eina_Bool overflow)
+void check_to_show_more_noti(win_info *win)
{
- if (icons_overflow)
+ static Eina_Bool previous_overflow_state;
+ Eina_Bool overflow;
+
+ overflow = check_for_icons_overflow();
+
+ if (previous_overflow_state == overflow)
+ return;
+
+ previous_overflow_state = overflow;
+
+ if (overflow)
indicator_more_notify_icon_change(EINA_TRUE);
else
indicator_more_notify_icon_change(EINA_FALSE);
static void get_icons_cnt_per_area(int *s, int *m, int *n)
{
- int system_cnt = box_get_list_size(SYSTEM_LIST);
- int minictrl_cnt = box_get_list_size(MINICTRL_LIST);
- int noti_cnt = box_get_list_size(NOTI_LIST);
+ int system_cnt = list_get_wish_to_show_icons_cnt(INDICATOR_ICON_AREA_SYSTEM);
+ int minictrl_cnt = list_get_wish_to_show_icons_cnt(INDICATOR_ICON_AREA_MINICTRL);
+ int noti_cnt = list_get_wish_to_show_icons_cnt(INDICATOR_ICON_AREA_NOTI);
int system = 0;
int minictrl = 0;
int max_icon_cnt = PORT_NONFIXED_ICON_COUNT;
- if ((system_cnt + minictrl_cnt + noti_cnt) > PORT_NONFIXED_ICON_COUNT) {
- max_icon_cnt = PORT_NONFIXED_ICON_COUNT - PORT_MORE_NOTI_ICON;
- icons_overflow = EINA_TRUE;
- } else
- icons_overflow = EINA_FALSE;
+ if ((system_cnt + minictrl_cnt + noti_cnt) > PORT_NONFIXED_ICON_COUNT)
+ max_icon_cnt--;
if (system_cnt > 0) {
system_cnt--;
total++;
}
- while (total <= max_icon_cnt) {
+ while (total < max_icon_cnt) {
if (system_cnt > 0) {
system_cnt--;
int system, minictrl, noti;
get_icons_cnt_per_area(&system, &minictrl, ¬i);
- while(box_get_list_size(SYSTEM_LIST) > system) {
+ while (box_get_list_size(INDICATOR_ICON_AREA_SYSTEM) > system) {
if (!remove_icon_with_area(INDICATOR_ICON_AREA_SYSTEM))
break;
}
- while (box_get_list_size(SYSTEM_LIST) < system) {
+ while (box_get_list_size(INDICATOR_ICON_AREA_SYSTEM) < system) {
if (!add_icon_with_area(INDICATOR_ICON_AREA_SYSTEM))
break;
}
- while (box_get_list_size(MINICTRL_LIST) > minictrl) {
+ while (box_get_list_size(INDICATOR_ICON_AREA_MINICTRL) > minictrl) {
if (!remove_icon_with_area(INDICATOR_ICON_AREA_MINICTRL))
break;
}
- while (box_get_list_size(MINICTRL_LIST) < minictrl) {
+ while (box_get_list_size(INDICATOR_ICON_AREA_MINICTRL) < minictrl) {
if (!add_icon_with_area(INDICATOR_ICON_AREA_MINICTRL))
break;
}
- while (box_get_list_size(NOTI_LIST) > noti) {
+ while (box_get_list_size(INDICATOR_ICON_AREA_NOTI) > noti) {
if (!remove_icon_with_area(INDICATOR_ICON_AREA_NOTI))
break;
}
- while (box_get_list_size(NOTI_LIST) < noti) {
+ while (box_get_list_size(INDICATOR_ICON_AREA_NOTI) < noti) {
- if (!add_icon_with_area(INDICATOR_ICON_AREA_SYSTEM))
+ if (!add_icon_with_area(INDICATOR_ICON_AREA_NOTI))
break;
}
}
-
-void* icon_util_make(void* input)
-{
- icon_s *icon = (icon_s *)input;
-
- retvm_if(input == NULL, NULL, "Invalid parameter!");
-
- icon_s *obj = NULL;
- obj = calloc(1, sizeof(icon_s));
-
- if (obj) {
- memset(obj, 0, sizeof(icon_s));
- memcpy(obj,input,sizeof(icon_s));
- obj->name = strdup(icon->name);
- }
-
- return obj;
-}
-
/* End of file */
--- /dev/null
+/*
+ * Indicator
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "indicator.h"
+#include "log.h"
+
+Evas_Object *indicator_box_object_get(win_info *win, indicator_icon_area_type type)
+{
+ switch(type) {
+ case INDICATOR_ICON_AREA_SYSTEM:
+ return win->_system_box;
+ case INDICATOR_ICON_AREA_MINICTRL:
+ return win->_minictrl_box;
+ case INDICATOR_ICON_AREA_NOTI:
+ return win->_noti_box;
+ case INDICATOR_ICON_AREA_ALARM:
+ return win->_alarm_box;
+ case INDICATOR_ICON_AREA_CONNECTION_SYSTEM:
+ return win->_connection_system_box;
+ default:
+ _D("Invalid area type");
+ return NULL;
+ }
+}
+
+Evas_Object **indicator_box_object_ptr_get(win_info *win, indicator_icon_area_type type)
+{
+ switch(type) {
+ case INDICATOR_ICON_AREA_SYSTEM:
+ return &win->_system_box;
+ case INDICATOR_ICON_AREA_MINICTRL:
+ return &win->_minictrl_box;
+ case INDICATOR_ICON_AREA_NOTI:
+ return &win->_noti_box;
+ case INDICATOR_ICON_AREA_ALARM:
+ return &win->_alarm_box;
+ case INDICATOR_ICON_AREA_CONNECTION_SYSTEM:
+ return &win->_connection_system_box;
+ default:
+ _D("Invalid area type");
+ return NULL;
+ }
+}
extern void icon_free(icon_s *icon)
{
- if (icon) {
- if (icon->obj_exist == EINA_TRUE) {
+ if (icon)
+ if (icon->obj_exist == EINA_TRUE)
if (icon_del(icon) == EINA_TRUE) {
icon->obj_exist = EINA_FALSE;
icon->img_obj.obj = NULL;
}
- }
- }
}
-
-
static void _list_free(Eina_List *list)
{
Eina_List *l;
return;
}
+Eina_List *list_list_get(indicator_icon_area_type type)
+{
+ switch (type) {
+ case INDICATOR_ICON_AREA_FIXED:
+ return fixed_icon_list;
+ case INDICATOR_ICON_AREA_SYSTEM:
+ return system_icon_list;
+ case INDICATOR_ICON_AREA_MINICTRL:
+ return minictrl_icon_list;
+ case INDICATOR_ICON_AREA_NOTI:
+ return noti_icon_list;
+ case INDICATOR_ICON_AREA_CONNECTION_SYSTEM:
+ return connection_system_icon_list;
+ case INDICATOR_ICON_AREA_ALARM:
+ return alarm_icon_list;
+ default:
+ _E("Invalid area type");
+ return NULL;
+ }
+}
+static Eina_List **_list_list_ptr_get(indicator_icon_area_type type)
+{
+ switch (type) {
+ case INDICATOR_ICON_AREA_FIXED:
+ return &fixed_icon_list;
+ case INDICATOR_ICON_AREA_SYSTEM:
+ return &system_icon_list;
+ case INDICATOR_ICON_AREA_MINICTRL:
+ return &minictrl_icon_list;
+ case INDICATOR_ICON_AREA_NOTI:
+ return ¬i_icon_list;
+ case INDICATOR_ICON_AREA_CONNECTION_SYSTEM:
+ return &connection_system_icon_list;
+ case INDICATOR_ICON_AREA_ALARM:
+ return &alarm_icon_list;
+ default:
+ _E("Invalid area type");
+ return NULL;
+ }
+}
+
extern void list_free_all(void)
{
_list_free(fixed_icon_list);
}
-unsigned int list_get_active_icons_cnt(enum indicator_icon_area_type area)
+unsigned int list_get_wish_to_show_icons_cnt(enum indicator_icon_area_type area)
{
int count = 0;
Eina_List *l;
- icon_s *data;
-
- switch (area) {
- case INDICATOR_ICON_AREA_FIXED:
- EINA_LIST_REVERSE_FOREACH(fixed_icon_list, l, data) {
- if (data->wish_to_show)
- count++;
- }
- break;
- case INDICATOR_ICON_AREA_SYSTEM:
- EINA_LIST_REVERSE_FOREACH(system_icon_list, l, data) {
- if (data->wish_to_show)
- count++;
- }
- break;
- case INDICATOR_ICON_AREA_MINICTRL:
- EINA_LIST_REVERSE_FOREACH(minictrl_icon_list, l, data) {
- if (data->wish_to_show)
- count++;
- }
- break;
- case INDICATOR_ICON_AREA_NOTI:
- EINA_LIST_REVERSE_FOREACH(noti_icon_list, l, data) {
- if (data->wish_to_show)
- count++;
- }
- break;
- default:
- _D("List dose not exist");
- break;
- }
+ icon_s *icon;
+ EINA_LIST_REVERSE_FOREACH(list_list_get(area), l, icon)
+ if (icon->wish_to_show)
+ count++;
return count;
}
Eina_List *l;
icon_s *data;
- /* FIXME */
- //retv_if(!list, NULL);
- retv_if(!icon, NULL);
+ retv_if(!icon, list);
- /* Insert icon to list */
- EINA_LIST_REVERSE_FOREACH(list, l, data) {
- if (data->priority == icon->priority
- && data->always_top == EINA_TRUE)
- continue;
-
- if (data->priority <= icon->priority) {
- list = eina_list_append_relative_list(list, icon, l);
+ EINA_LIST_FOREACH(list, l, data) {
+ if (data->priority >= icon->priority) {
+ list = eina_list_prepend_relative_list(list, icon, l);
return list;
}
}
-
- /* If finding condition is failed, append it at tail */
- list = eina_list_prepend(list, icon);
+ list = eina_list_append(list, icon);
return list;
}
-
extern void list_update(icon_s *icon)
{
ret_if(!icon);
- switch (icon->area) {
- case INDICATOR_ICON_AREA_FIXED:
- fixed_icon_list = eina_list_remove(fixed_icon_list, icon);
- fixed_icon_list = _insert_icon_to_list(fixed_icon_list, icon);
- break;
- case INDICATOR_ICON_AREA_SYSTEM:
- system_icon_list = eina_list_remove(system_icon_list, icon);
- system_icon_list = _insert_icon_to_list(system_icon_list, icon);
- break;
- case INDICATOR_ICON_AREA_NOTI:
- noti_icon_list = eina_list_remove(noti_icon_list, icon);
+ Eina_List *l;
+ icon_s *data;
+
+ if (icon->area == INDICATOR_ICON_AREA_NOTI) {
+ EINA_LIST_FOREACH(noti_icon_list, l, data) {
+ if (!strcmp(icon->name, data->name)) {
+ noti_icon_list = eina_list_remove_list(noti_icon_list, l);
+ break;
+ }
+ }
noti_icon_list = _insert_icon_to_list(noti_icon_list, icon);
- break;
- case INDICATOR_ICON_AREA_MINICTRL:
- minictrl_icon_list = eina_list_remove(minictrl_icon_list, icon);
- minictrl_icon_list = _insert_icon_to_list(minictrl_icon_list, icon);
- break;
- case INDICATOR_ICON_AREA_ALARM:
- alarm_icon_list = eina_list_remove(alarm_icon_list, icon);
- alarm_icon_list = _insert_icon_to_list(alarm_icon_list, icon);
- break;
- default:
- break;
- }
+ } else {
+ Eina_List **list;
+ list = _list_list_ptr_get(icon->area);
+ *list = eina_list_remove(*list, icon);
+ *list = _insert_icon_to_list(*list, icon);
+ }
return;
}
-
static indicator_error_e _icon_exist_in_list(Eina_List *list, icon_s *icon)
{
Eina_List *l;
icon_s *data;
- /* Check name */
- EINA_LIST_REVERSE_FOREACH(fixed_icon_list, l, data) {
- if (data->name == icon->name) {
- _D("[%s] is already exist in the list", icon->name);
+ EINA_LIST_REVERSE_FOREACH(list, l, data) {
+ if (!strcmp(data->name, icon->name)) {
+ _D("[%s] already exists in the list", icon->name);
return INDICATOR_ERROR_FAIL;
}
}
ret_if(!icon);
ret_if(!icon->name);
- switch (icon->area) {
- case INDICATOR_ICON_AREA_FIXED:
- if (INDICATOR_ERROR_NONE != _icon_exist_in_list(fixed_icon_list, icon)) return;
-
- /* Set internal data */
- icon->wish_to_show = EINA_FALSE;
- fixed_icon_list = _insert_icon_to_list(fixed_icon_list, icon);
- break;
- case INDICATOR_ICON_AREA_SYSTEM:
- if (INDICATOR_ERROR_NONE != _icon_exist_in_list(system_icon_list, icon)) return;
-
- /* Set internal data */
- icon->wish_to_show = EINA_FALSE;
- system_icon_list = _insert_icon_to_list(system_icon_list, icon);
- break;
- case INDICATOR_ICON_AREA_NOTI:
- if (INDICATOR_ERROR_NONE != _icon_exist_in_list(noti_icon_list, icon)) return;
-
- /* Set internal data */
- icon->wish_to_show = EINA_FALSE;
- noti_icon_list = _insert_icon_to_list(noti_icon_list, icon);
- break;
- case INDICATOR_ICON_AREA_MINICTRL:
- if (INDICATOR_ERROR_NONE != _icon_exist_in_list(minictrl_icon_list, icon)) return;
+ Eina_List **list;
- /* Set internal data */
- icon->wish_to_show = EINA_FALSE;
- minictrl_icon_list = _insert_icon_to_list(minictrl_icon_list, icon);
- break;
- case INDICATOR_ICON_AREA_ALARM:
- if (INDICATOR_ERROR_NONE != _icon_exist_in_list(alarm_icon_list, icon)) return;
+ list = _list_list_ptr_get(icon->area);
- /* Set internal data */
- icon->wish_to_show = EINA_FALSE;
- alarm_icon_list = eina_list_append(alarm_icon_list, icon);
- break;
+ ret_if(!list);
- case INDICATOR_ICON_AREA_CONNECTION_SYSTEM:
- if (INDICATOR_ERROR_NONE != _icon_exist_in_list(connection_system_icon_list, icon)) return;
+ if (_icon_exist_in_list(*list, icon) != INDICATOR_ERROR_NONE)
+ return;
- /* Set internal data */
- icon->wish_to_show = EINA_FALSE;
- connection_system_icon_list = eina_list_append(connection_system_icon_list, icon);
- break;
- default:
- break;
- }
+ icon->wish_to_show = EINA_FALSE;
+ *list = _insert_icon_to_list(*list, icon);
return;
}
{
ret_if(!icon);
- switch (icon->area) {
- case INDICATOR_ICON_AREA_FIXED:
- ret_if(!fixed_icon_list);
- fixed_icon_list = eina_list_remove(fixed_icon_list, icon);
- break;
- case INDICATOR_ICON_AREA_SYSTEM:
- ret_if(!system_icon_list);
- system_icon_list = eina_list_remove(system_icon_list, icon);
- break;
- case INDICATOR_ICON_AREA_NOTI:
- ret_if(!noti_icon_list);
- noti_icon_list = eina_list_remove(noti_icon_list, icon);
- break;
- case INDICATOR_ICON_AREA_MINICTRL:
- ret_if(!minictrl_icon_list);
- minictrl_icon_list = eina_list_remove(minictrl_icon_list, icon);
- break;
- case INDICATOR_ICON_AREA_ALARM:
- ret_if(!alarm_icon_list);
- alarm_icon_list = eina_list_remove(alarm_icon_list, icon);
- break;
- case INDICATOR_ICON_AREA_CONNECTION_SYSTEM:
- ret_if(!connection_system_icon_list);
- connection_system_icon_list = eina_list_remove(connection_system_icon_list, icon);
- break;
- default:
- _E("default");
- break;
- }
+ Eina_List **list;
+
+ list = _list_list_ptr_get(icon->area);
+
+ ret_if(!list);
+ *list = eina_list_remove(*list, icon);
}
icon_s *data = NULL;
icon_s *icon = NULL;
- switch (area) {
- case INDICATOR_ICON_AREA_FIXED:
- EINA_LIST_REVERSE_FOREACH(fixed_icon_list, l, data) {
- if (data->priority == priority
- && data->wish_to_show == EINA_TRUE
- && data->exist_in_view == EINA_FALSE) {
- icon = data;
- break;
- }
+ EINA_LIST_FOREACH(list_list_get(area), l, data) {
+ if (data->wish_to_show == EINA_TRUE && data->exist_in_view == EINA_FALSE) {
+ icon = data;
+ break;
}
- break;
- case INDICATOR_ICON_AREA_SYSTEM:
- EINA_LIST_REVERSE_FOREACH(system_icon_list, l, data) {
- if (data->wish_to_show == EINA_TRUE
- && data->exist_in_view == EINA_FALSE) {
- icon = data;
- break;
- }
- }
- break;
- case INDICATOR_ICON_AREA_NOTI:
- EINA_LIST_REVERSE_FOREACH(noti_icon_list, l, data) {
- if (data->wish_to_show == EINA_TRUE
- && data->exist_in_view == EINA_FALSE) {
- icon = data;
- break;
- }
- }
- break;
- case INDICATOR_ICON_AREA_MINICTRL:
- EINA_LIST_REVERSE_FOREACH(minictrl_icon_list, l, data) {
- if (data->wish_to_show == EINA_TRUE
- && data->exist_in_view == EINA_FALSE) {
- icon = data;
- break;
- }
- }
- break;
- case INDICATOR_ICON_AREA_ALARM:
- EINA_LIST_REVERSE_FOREACH(alarm_icon_list, l, data) {
- if (data->wish_to_show == EINA_TRUE
- && data->exist_in_view == EINA_FALSE) {
- icon = data;
- break;
- }
- }
- break;
-
- case INDICATOR_ICON_AREA_CONNECTION_SYSTEM:
- EINA_LIST_REVERSE_FOREACH(connection_system_icon_list, l, data) {
- if (data->wish_to_show == EINA_TRUE
- && data->exist_in_view == EINA_FALSE) {
- icon = data;
- break;
- }
- }
- break;
- default:
- _E("default");
- break;
}
-
- retv_if(!icon, NULL);
-
return icon;
}
-
extern icon_s *list_try_to_find_icon_to_remove(int area, int priority)
{
Eina_List *l;
icon_s *data = NULL;
icon_s *icon = NULL;
-
- switch (area) {
- case INDICATOR_ICON_AREA_FIXED:
- EINA_LIST_REVERSE_FOREACH(fixed_icon_list, l, data) {
- if (data->priority == priority
- && data->wish_to_show == EINA_TRUE) {
- icon = data;
- break;
- }
- }
- break;
- case INDICATOR_ICON_AREA_SYSTEM:
- /* Find lowest priority of icon */
- EINA_LIST_FOREACH(system_icon_list, l, data) {
- if (data->wish_to_show == EINA_TRUE
- && data->always_top == EINA_FALSE
- && data->exist_in_view == EINA_TRUE) {
- icon = data;
- break;
- }
- }
- break;
- case INDICATOR_ICON_AREA_NOTI:
- /* Find lowest priority of icon */
- EINA_LIST_REVERSE_FOREACH(noti_icon_list, l, data) {
- if (data->wish_to_show == EINA_TRUE
- && data->always_top == EINA_FALSE
- && data->exist_in_view == EINA_TRUE) {
- icon = data;
- break;
- }
- }
- break;
- case INDICATOR_ICON_AREA_MINICTRL:
- /* Find lowest priority of icon */
- EINA_LIST_REVERSE_FOREACH(minictrl_icon_list, l, data) {
- if (data->wish_to_show == EINA_TRUE
- && data->always_top == EINA_FALSE
- && data->exist_in_view == EINA_TRUE) {
- icon = data;
- break;
- }
- }
- break;
- case INDICATOR_ICON_AREA_ALARM:
- /* Find lowest priority of icon */
- EINA_LIST_FOREACH(alarm_icon_list, l, data) {
- if (data->wish_to_show == EINA_TRUE
- && data->always_top == EINA_FALSE
- && data->exist_in_view == EINA_TRUE) {
- icon = data;
- break;
- }
+ EINA_LIST_REVERSE_FOREACH(list_list_get(area), l, data) {
+ if (data->wish_to_show == EINA_TRUE && data->exist_in_view == EINA_TRUE) {
+ icon = data;
+ break;
}
- break;
- case INDICATOR_ICON_AREA_CONNECTION_SYSTEM:
- /* Find lowest priority of icon */
- EINA_LIST_FOREACH(connection_system_icon_list, l, data) {
- if (data->wish_to_show == EINA_TRUE
- && data->always_top == EINA_FALSE
- && data->exist_in_view == EINA_TRUE) {
- icon = data;
- break;
- }
- }
- break;
- default:
- _E("default");
- break;
}
-
- retv_if(!icon, NULL);
-
return icon;
}
-
-
-extern unsigned int list_get_noti_count(void)
-{
- Eina_List *l;
- icon_s *data = NULL;
- int cnt = 0;
-
- EINA_LIST_FOREACH(noti_icon_list, l, data) {
- if (data->wish_to_show == EINA_TRUE
- || data->exist_in_view == EINA_TRUE) {
- if (!strcmp(data->name, "more_notify")) continue; // Except more noti
- cnt++;
- }
- }
-
- return cnt;
-}
-
/* End of file */
#include "icon.h"
#include "log.h"
-#define ICON_PRIORITY INDICATOR_PRIORITY_SYSTEM_1
+#define ICON_PRIORITY INDICATOR_PRIORITY_SYSTEM_5
#define MODULE_NAME "alarm"
static int bShown = 0;
#include "icon.h"
#include "log.h"
-#define ICON_PRIORITY INDICATOR_PRIORITY_SYSTEM_3
+#define ICON_PRIORITY INDICATOR_PRIORITY_SYSTEM_4
#define MODULE_NAME "mmc"
static int register_ext_storage_module(void *data);
#include "modules.h"
#include "main.h"
#include "log.h"
+#include "util.h"
+#include "box.h"
#define ICON_PRIORITY INDICATOR_PRIORITY_NOTI_MIN
#define MODULE_NAME "more_notify"
+#define PART_NAME_MORE_NOTI "elm.swallow.more_noti"
+
static int register_more_notify_module(void *data);
static int unregister_more_notify_module(void);
-static bool bShow = 0;
-
icon_s more_notify = {
.name = MODULE_NAME,
.priority = ICON_PRIORITY,
.always_top = EINA_TRUE,
.exist_in_view = EINA_FALSE,
.img_obj = {0,},
+ .img_obj.data = "Notify/B03_notify_more.png",
.obj_exist = EINA_FALSE,
- .area = INDICATOR_ICON_AREA_NOTI,
+ .area = INDICATOR_ICON_AREA_MORE_NOTI,
.init = register_more_notify_module,
- .fini = unregister_more_notify_module,
+ .fini = unregister_more_notify_module
};
enum {
MUSIC_PAUSED,
};
-static char *icon_path[] = {
- "Notify/B03_notify_more.png",
- NULL
-};
-
-
static void set_app_state(void *data)
{
more_notify.ad = data;
}
-icon_s *more_noti_get_icon(void)
-{
- return &more_notify;
-}
-
-static void show_image_icon_by_win(win_info* win)
-{
- more_notify.img_obj.data = icon_path[0];
- icon_show(&more_notify);
-}
-
-
-static void hide_image_icon_by_win(win_info* win)
-{
- icon_hide(&more_notify);
-}
-
-
void indicator_more_notify_icon_change(Eina_Bool val)
{
_D("indicator_more_notify_change. Val=%s", (val) ? "true" : "false");
struct appdata *ad = more_notify.ad;
retm_if(ad == NULL, "Invalid parameter!");
- if (bShow == val)
- return;
-
- bShow = val;
-
if (val) {
- show_image_icon_by_win(&ad->win);
- _D("_handle_more_notify_show");
+ util_signal_emit(ad->win.data, "indicator.more_noti.show", "indicator.prog");
+ evas_object_show(more_notify.img_obj.obj);
} else {
- hide_image_icon_by_win(&ad->win);
- _D("_handle_more_notify_hide");
+ util_signal_emit(ad->win.data, "indicator.more_noti.hide", "indicator.prog");
+ evas_object_hide(more_notify.img_obj.obj);
}
return;
}
+Evas_Object *icon_create_and_swallow(icon_s *icon, const char *part_name)
+{
+ struct appdata *ad = (struct appdata *)icon->ad;
+ retv_if(!ad, NULL);
+
+ Evas_Object *obj = NULL;
+
+ icon_add(&ad->win, icon);
+ retv_if(!icon->img_obj.obj, NULL);
+
+ obj = box_add(ad->win.layout);
+ retv_if(!obj, NULL);
+
+ elm_box_pack_end(obj, icon->img_obj.obj);
+
+ evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ edje_object_part_swallow(elm_layout_edje_get(ad->win.layout), part_name, obj);
+
+ return obj;
+}
static int register_more_notify_module(void *data)
{
+ _D("register_more_notify_module");
+
retvm_if(data == NULL, FAIL, "Invalid parameter!");
+ struct appdata *ad = (struct appdata *)data;
+
set_app_state(data);
+ ad->win._more_noti_box = icon_create_and_swallow(&more_notify, PART_NAME_MORE_NOTI);
+
return OK;
}
static int unregister_more_notify_module(void)
{
+ struct appdata *ad = (struct appdata *)more_notify.ad;
+
+ icon_del(&more_notify);
+ edje_object_part_unswallow(ad->win.layout, ad->win._more_noti_box);
+
return OK;
}
.type = INDICATOR_IMG_ICON,
.name = MODULE_NAME_MUTE,
.priority = ICON_PRIORITY_MUTE,
- .always_top = EINA_TRUE,
+ .always_top = EINA_FALSE,
.exist_in_view = EINA_FALSE,
.img_obj = {"Call/B03_Call_Mute.png",},
.obj_exist = EINA_FALSE,
.type = INDICATOR_IMG_ICON,
.name = MODULE_NAME_SPEAKER,
.priority = ICON_PRIORITY_SPEAKER,
- .always_top = EINA_TRUE,
+ .always_top = EINA_FALSE,
.exist_in_view = EINA_FALSE,
.img_obj = {"Call/B03_Call_Speaker_on.png",},
.obj_exist = EINA_FALSE,
#include "main.h"
#include "log.h"
-#define ICON_PRIORITY INDICATOR_PRIORITY_SYSTEM_4
+#define ICON_PRIORITY INDICATOR_PRIORITY_SYSTEM_3
#define MODULE_NAME "gps"
#define TIMER_INTERVAL 0.3
#include "log.h"
#include "util.h"
-#define ICON_PRIORITY INDICATOR_PRIORITY_SYSTEM_6
+#define ICON_PRIORITY INDICATOR_PRIORITY_SYSTEM_1
#define MODULE_NAME "silent"
static int register_silent_module(void *data);
}
-
Eina_Bool util_win_prop_angle_get(Ecore_X_Window win, int *req)
{
Eina_Bool res = EINA_FALSE;