+++ /dev/null
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// 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 "utc_util_elm_widget_create.h"
-
-typedef Evas_Object *(*widget_add)(Evas_Object*);
-
-char *widget_content_parts[][2]=
-{
- {"Elm_Bg", "overlay"},
- {"Elm_Bubble", "default,icon"},
- {"Elm_Button", "icon"},
- {"Elm_Check", "icon"},
- {"Elm_Conformant", "default"},
- {"Elm_Ctxpopup", "default"},
- {"Elm_Entry", "icon,end"},
- {"Elm_Fileselector_Button", "icon"},
- {"Elm_Fileselector_Entry", "button icon"},
- {"Elm_Hover", "left,top-left,top,top-right,right,bottom-right,bottom,bottom-left,middle,smart"},
- {"Elm_Hoversel", "icon"},
- {"Elm_Mapbuf", "default"},
- {"Elm_Naviframe", "default,icon,prev_btn,next_btn"},
- {"Elm_Notify", "default"},
- {"Elm_Panel", "default"},
- {"Elm_Panes", "left,right"},
- {"Elm_Progressbar", "icon"},
- {"Elm_Radio", "icon"},
- {"Elm_Scroller", "default"},
- {NULL, NULL},
-};
-
-char *widget_text_parts[][2]=
-{
- {"Elm_Bubble", "default info"},
- {"Elm_Button", "default"},
- {"Elm_Check", "default on off"},
- {"Elm_Entry", "default"},
- {"Elm_Fileselector_Button", "default"},
- {"Elm_Fileselector_Entry", "default"},
- {"Elm_Hoversel", "default"},
- {"Elm_Label", "default"},
- {"Elm_Multibuttonentry", "default"},
- {"Elm_Naviframe", "default subtitle"},
- {"Elm_Progressbar", "default"},
- {"Elm_Radio", "default"},
- {NULL, NULL},
-};
-
-char *widget_item_content_parts[][2]=
-{
- {"Elm_Ctxpopup", "icon"},
- {"Elm_Diskselector", "icon"},
- {"Elm_Flipselector", "icon"},
- {"Elm_Gengrid", "elm.swallow.icon elm.swallow.end"},
- {"Elm_List", "start end"},
- {"Elm_Menu", "default"},
- {"Elm_Naviframe", "default icon prev_btn next_btn"},
- {"Elm_Segment_Control", "icon"},
- {NULL, NULL},
-};
-
-char *widget_item_text_parts[][2]=
-{
- {"Elm_Ctxpopup", "default"},
- {"Elm_Diskselector", "default"},
- {"Elm_Flipselector", "default"},
- {"Elm_Gengrid", "default"},
- {"Elm_List", "default"},
- {"Elm_Menu", "default"},
- {"Elm_Multibuttonentry", "default"},
- {"Elm_Naviframe", "default subtitle"},
- {"Elm_Segment_Control", "default"},
- {"Elm_Toolbar", "default"},
- {NULL, NULL},
-};
-
-widget_add widgets_having_content_parts[] =
- {
- elm_bg_add,
- elm_bubble_add,
- elm_button_add,
- elm_check_add,
- elm_conformant_add,
- elm_ctxpopup_add,
- elm_entry_add,
- elm_fileselector_button_add,
- elm_fileselector_entry_add,
- elm_hoversel_add,
- elm_mapbuf_add,
- elm_naviframe_add,
- elm_notify_add,
- elm_panel_add,
- elm_panes_add,
- elm_progressbar_add,
- elm_radio_add,
- elm_scroller_add,
- elm_hover_add,
- NULL,
- };
-
-widget_add widgets_having_text_parts[] =
- {
- elm_bubble_add,
- elm_button_add,
- elm_check_add,
- elm_entry_add,
- elm_fileselector_button_add,
- elm_fileselector_entry_add,
- elm_hoversel_add,
- elm_label_add,
- elm_multibuttonentry_add,
- elm_naviframe_add,
- elm_progressbar_add,
- elm_radio_add,
- NULL,
- };
-
-widget_add widgets_having_item_content_parts[] =
- {
- elm_ctxpopup_add,
- elm_diskselector_add,
- elm_list_add,
- elm_menu_add,
- elm_naviframe_add,
- elm_segment_control_add,
- elm_gengrid_add,
- NULL,
- };
-
-widget_add widgets_having_item_text_parts[] =
- {
- elm_ctxpopup_add,
- elm_diskselector_add,
- elm_flipselector_add,
- elm_list_add,
- elm_menu_add,
- elm_multibuttonentry_add,
- elm_naviframe_add,
- elm_segment_control_add,
- elm_toolbar_add,
- elm_gengrid_add,
- NULL,
- };
-
-widget_add cursor_widget_list[] =
-{
- elm_entry_add,
- NULL,
-};
-widget_add widget_item_list[] =
-{
- elm_ctxpopup_add,
- elm_flipselector_add,
- elm_list_add,
- elm_menu_add,
- elm_multibuttonentry_add,
- elm_naviframe_add,
- elm_segment_control_add,
- elm_toolbar_add,
- elm_diskselector_add,
- elm_gengrid_add,
- elm_genlist_add,
- NULL,
-};
-
-widget_add all_widget_list[] =
- {
- elm_actionslider_add,
- elm_bg_add,
- elm_box_add,
- elm_bubble_add,
- elm_button_add,
- elm_calendar_add,
- elm_check_add,
- elm_clock_add,
- elm_colorselector_add,
- elm_conformant_add,
- elm_ctxpopup_add,
- elm_datetime_add,
- elm_dayselector_add,
- elm_diskselector_add,
- elm_entry_add,
- elm_fileselector_add,
- elm_fileselector_button_add,
- elm_fileselector_entry_add,
- elm_flip_add,
- elm_flipselector_add,
- elm_frame_add,
- elm_gengrid_add,
- elm_genlist_add,
- elm_gesture_layer_add,
- elm_grid_add,
- elm_hover_add,
- elm_hoversel_add,
- elm_icon_add,
- elm_image_add,
- elm_index_add,
- elm_label_add,
- elm_layout_add,
- elm_list_add,
- elm_map_add,
- elm_mapbuf_add,
- elm_menu_add,
- elm_multibuttonentry_add,
- elm_naviframe_add,
- elm_notify_add,
- elm_panel_add,
- elm_panes_add,
- elm_photo_add,
- elm_photocam_add,
- elm_popup_add,
- elm_progressbar_add,
- elm_radio_add,
- elm_scroller_add,
- elm_segment_control_add,
- elm_separator_add,
- elm_slider_add,
- elm_slideshow_add,
- elm_spinner_add,
- elm_table_add,
- elm_thumb_add,
- elm_toolbar_add,
- /*elm_web_add,*/
- elm_glview_add,
- NULL,
- };
-
-widget_add container_widget_list[] =
- {
- elm_box_add,
- elm_bubble_add,
- elm_datetime_add,
- elm_dayselector_add,
- elm_fileselector_entry_add,
- elm_flip_add,
- elm_frame_add,
- elm_grid_add,
- elm_layout_add,
- elm_naviframe_add,
- elm_notify_add,
- elm_panel_add,
- elm_panes_add,
- elm_popup_add,
- elm_scroller_add,
- elm_table_add,
- NULL,
- };
-
-Eina_List *
-utc_util_get_widgets_having_content_parts(Evas_Object* main_win)
-{
- if (!main_win) return NULL;
-
- int index = 0;
- Eina_List *widget_list = NULL;
- Evas_Object *obj = NULL;
-
- for(;;)
- {
- if (!widgets_having_content_parts[index]) break;
-
- obj = (*widgets_having_content_parts[index])(main_win);
- if (obj)
- widget_list = eina_list_append(widget_list, (void *) obj);
- index++;
- }
- return widget_list;
-}
-
-Eina_List *
-utc_util_get_widgets_having_text_parts(Evas_Object* main_win)
-{
- if (!main_win) return NULL;
-
- int index = 0;
- Eina_List *widget_list = NULL;
- Evas_Object *obj = NULL;
-
- for(;;)
- {
- if (!widgets_having_text_parts[index]) break;
-
- obj = (*widgets_having_text_parts[index])(main_win);
- widget_list = eina_list_append(widget_list, (void *) obj);
- if (elm_object_widget_type_get(obj) && !strcmp(elm_object_widget_type_get(obj), "naviframe"))
- {
- elm_naviframe_item_push(obj, "item", NULL, NULL, NULL, NULL);
- }
- index++;
- }
- return widget_list;
-}
-
-Eina_List *
-utc_util_get_widgets_having_item_content_parts(Evas_Object* main_win)
-{
- if (!main_win) return NULL;
-
- int index = 0;
- Eina_List *widget_list = NULL;
- Evas_Object *obj = NULL;
-
- for(;;)
- {
- if (!widgets_having_item_content_parts[index]) break;
-
- obj = (*widgets_having_item_content_parts[index])(main_win);
- if (obj)
- widget_list = eina_list_append(widget_list, (void *) obj);
- index++;
- }
- return widget_list;
-}
-
-Eina_List *
-utc_util_get_widgets_having_item_text_parts(Evas_Object* main_win)
-{
- if (!main_win) return NULL;
-
- int index = 0;
- Eina_List *widget_list = NULL;
- Evas_Object *obj = NULL;
-
- for(;;)
- {
- if (!widgets_having_item_text_parts[index]) break;
-
- obj = (*widgets_having_item_text_parts[index])(main_win);
- if (obj)
- widget_list = eina_list_append(widget_list, (void *) obj);
- index++;
- }
- return widget_list;
-}
-
-const char *get_widget_content_part(const char *widget_type)
-{
- if (!widget_type) return NULL;
-
- int index = 0;
-
- for (;;)
- {
- if (!widget_content_parts[index][0]) break;
-
- if (!strcmp(widget_content_parts[index][0], widget_type))
- {
- return widget_content_parts[index][1];
- }
- index++;
- }
- return NULL;
-}
-
-const char *get_widget_text_part(const char *widget_type)
-{
- if (!widget_type) return NULL;
-
- int index = 0;
-
- for (;;)
- {
- if (!widget_text_parts[index][0]) break;
-
- if (!strcmp(widget_text_parts[index][0], widget_type))
- {
- return widget_text_parts[index][1];
- }
- index++;
- }
- return NULL;
-}
-
-const char *get_widget_item_content_part(const char *widget_type)
-{
- if (!widget_type) return NULL;
-
- int index = 0;
-
- for (;;)
- {
- if (!widget_item_content_parts[index][0]) break;
-
- if (!strcmp(widget_item_content_parts[index][0], widget_type))
- {
- return widget_item_content_parts[index][1];
- }
- index++;
- }
- return NULL;
-}
-
-const char *get_widget_item_text_part(const char *widget_type)
-{
- if (!widget_type) return NULL;
-
- int index = 0;
-
- for (;;)
- {
- if (!widget_item_text_parts[index][0]) break;
-
- if (!strcmp(widget_item_text_parts[index][0], widget_type))
- {
- return widget_item_text_parts[index][1];
- }
- index++;
- }
- return NULL;
-}
-
-Eina_List *
-utc_util_elm_widget_list_get(Evas_Object* main_win)
-{
- if (!main_win) return NULL;
-
- int index = 0;
- Eina_List *widget_list = NULL;
- Evas_Object *obj = NULL;
-
- for(;;)
- {
- if (!all_widget_list[index]) break;
-
- obj = (*all_widget_list[index])(main_win);
- if (obj)
- widget_list = eina_list_append(widget_list, (void *) obj);
- index++;
- }
- return widget_list;
-}
-
-Eina_List *
-utc_util_elm_container_widget_list_get(Evas_Object* main_win)
-{
- if (!main_win) return NULL;
-
- int index = 0;
- Eina_List *widget_list = NULL;
- Evas_Object *obj = NULL;
-
- for(;;)
- {
- if (!container_widget_list[index]) break;
-
- obj = (*container_widget_list[index])(main_win);
- if (obj)
- widget_list = eina_list_append(widget_list, (void *) obj);
- index++;
- }
- return widget_list;
-}
-
-Eina_List *
-utc_util_cursor_widget_list_get(Evas_Object* main_win)
-{
- if (!main_win) return NULL;
-
- int index = 0;
- Eina_List *widget_list = NULL;
- Evas_Object *obj = NULL;
-
- for(;;)
- {
- if (!cursor_widget_list[index]) break;
-
- obj = (*cursor_widget_list[index])(main_win);
- if (obj)
- widget_list = eina_list_append(widget_list, (void *) obj);
- index++;
- }
- return widget_list;
-}
-
-Eina_List *
-utc_util_elm_widget_item_list_get(Evas_Object* main_win)
-{
- if (!main_win) return NULL;
-
- int index = 0;
- Eina_List *widget_list = NULL;
- Evas_Object *obj = NULL;
-
- for(;;)
- {
- if (!widget_item_list[index]) break;
-
- obj = (*widget_item_list[index])(main_win);
- if (obj)
- widget_list = eina_list_append(widget_list, (void *) obj);
- index++;
- }
- return widget_list;
-}
-
-static Elm_Gengrid_Item_Class *gic;
-static Elm_Genlist_Item_Class itc;
-
-Elm_Object_Item *
-get_widget_item( Evas_Object * obj)
-{
- if (!obj) return NULL;
-
- Elm_Object_Item *it = NULL;
-
- const char * type = elm_object_widget_type_get(obj);
- if (!type) return NULL;
-
- if(!strcmp(type, "Elm_Segment_Control"))
- {
- it = elm_segment_control_item_add(obj, NULL, "segment_control_item");
- }else if(!strcmp(type, "Elm_List"))
- {
- it = elm_list_item_append(obj, "list_item", NULL, NULL, NULL, NULL);
- }else if(!strcmp(type, "Elm_Menu"))
- {
- it = elm_menu_item_add(obj, NULL, NULL, "menu_item", NULL, NULL);
- }else if(!strcmp(type, "Elm_Genlist"))
- {
- itc.item_style = "1text.1icon";
- itc.func.text_get = NULL;
- itc.func.content_get = NULL;
- itc.func.state_get = NULL;
- itc.func.del = NULL;
- it = elm_genlist_item_append(obj, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
- }else if(!strcmp(type, "Elm_Gengrid "))
- {
- gic = elm_gengrid_item_class_new();
- gic->item_style = "default_grid";
- gic->func.text_get = NULL;
- gic->func.content_get = NULL;
- gic->func.state_get = NULL;
- gic->func.del = NULL;
- it = elm_gengrid_item_append(obj, gic, NULL, NULL, NULL);
- }else if(!strcmp(type, "Elm_Ctxpopup"))
- {
- it = elm_ctxpopup_item_append(obj, "ctxpopup_item", NULL, NULL, NULL);
- }else if(!strcmp(type, "Elm_Toolbar"))
- {
- it = elm_toolbar_item_append(obj, NULL, "toolbar_item", NULL, NULL);
- }else if(!strcmp(type, "Elm_Diskselector"))
- {
- it = elm_diskselector_item_append(obj, "diskselector_item", NULL, NULL, NULL);
- }else if(!strcmp(type, "Elm_Flipselector"))
- {
- it = elm_flipselector_item_append(obj, "flipselector_item", NULL, NULL);
- }else if(!strcmp(type, "Elm_Naviframe"))
- {
- it = elm_naviframe_item_push(obj, "item", NULL, NULL, NULL, NULL);
- }else if(!strcmp(type, "Elm_Multibuttonentry"))
- {
- it = elm_multibuttonentry_item_append(obj, "multibuttonentry_item", NULL, NULL);
- }
- return it;
-}