summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-08-05 12:56:03 -0400
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-08-06 09:26:35 +0200
commitc9299f0caa048f22be9bf9b24e1989e4469d5691 (patch)
tree47483ed3d6a4d878dd0268027e4f4be258fe56a1
parent88910d6a65cd6d803dcb06bcf9b8112d2f44f26a (diff)
efl_ui/clock: remove legacy api/widget use internally
new widgets should use unified api internally Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D9500
-rw-r--r--src/lib/elementary/efl_ui_clock.c65
1 files changed, 21 insertions, 44 deletions
diff --git a/src/lib/elementary/efl_ui_clock.c b/src/lib/elementary/efl_ui_clock.c
index 63b9e17618..6cf3b01305 100644
--- a/src/lib/elementary/efl_ui_clock.c
+++ b/src/lib/elementary/efl_ui_clock.c
@@ -202,7 +202,7 @@ field_value_display(Eo *obj, Evas_Object *item_obj)
202 if (tim.tm_hour < 12) strcpy(buf, "AM"); 202 if (tim.tm_hour < 12) strcpy(buf, "AM");
203 else strcpy(buf, "PM"); 203 else strcpy(buf, "PM");
204 } 204 }
205 elm_object_text_set(item_obj, buf); 205 efl_text_set(item_obj, buf);
206} 206}
207 207
208static Evas_Object * 208static Evas_Object *
@@ -212,17 +212,16 @@ field_create(Eo *obj, Efl_Ui_Clock_Type field_type)
212 212
213 if (field_type == EFL_UI_CLOCK_TYPE_AMPM) 213 if (field_type == EFL_UI_CLOCK_TYPE_AMPM)
214 { 214 {
215 field_obj = elm_button_add(obj); 215 field_obj = efl_add(EFL_UI_BUTTON_CLASS, obj,
216 efl_event_callback_add 216 efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _ampm_clicked_cb, obj));
217 (field_obj, EFL_INPUT_EVENT_CLICKED, _ampm_clicked_cb, obj);
218 } 217 }
219 else 218 else
220 { 219 {
221 field_obj = elm_entry_add(obj); 220 field_obj = efl_add(EFL_UI_TEXT_CLASS,obj,
222 elm_entry_single_line_set(field_obj, EINA_TRUE); 221 efl_text_multiline_set(efl_added, EINA_FALSE),
223 elm_entry_editable_set(field_obj, EINA_FALSE); 222 efl_text_interactive_editable_set(efl_added, EINA_FALSE),
224 elm_entry_input_panel_enabled_set(field_obj, EINA_FALSE); 223 efl_ui_text_input_panel_enabled_set(efl_added, EINA_FALSE),
225 elm_entry_context_menu_disabled_set(field_obj, EINA_TRUE); 224 efl_ui_text_context_menu_disabled_set(efl_added, EINA_TRUE));
226 } 225 }
227 evas_object_data_set(field_obj, "_field_type", (void *)field_type); 226 evas_object_data_set(field_obj, "_field_type", (void *)field_type);
228 227
@@ -369,13 +368,9 @@ _field_list_arrange(Evas_Object *obj)
369 _part_name_snprintf(buf, sizeof(buf), obj, EDC_PART_FIELD_STR, 368 _part_name_snprintf(buf, sizeof(buf), obj, EDC_PART_FIELD_STR,
370 field->location); 369 field->location);
371 370
371 efl_gfx_entity_visible_set(efl_content_unset(efl_part(obj, buf)), EINA_FALSE);
372 if (field->visible && field->fmt_exist) 372 if (field->visible && field->fmt_exist)
373 { 373 efl_content_set(efl_part(obj, buf), field->item_obj);
374 evas_object_hide(elm_layout_content_unset(obj, buf));
375 elm_layout_content_set(obj, buf, field->item_obj);
376 }
377 else
378 evas_object_hide(elm_layout_content_unset(obj, buf));
379 } 374 }
380 sd->freeze_sizing = freeze; 375 sd->freeze_sizing = freeze;
381 376
@@ -505,25 +500,19 @@ _reload_format(Evas_Object *obj)
505 { 500 {
506 snprintf(buf, sizeof(buf), EDC_PART_FIELD_ENABLE_SIG_STR, 501 snprintf(buf, sizeof(buf), EDC_PART_FIELD_ENABLE_SIG_STR,
507 field->location); 502 field->location);
508 if (elm_widget_is_legacy(obj)) 503 efl_layout_signal_emit(obj, buf, "efl");
509 elm_layout_signal_emit(obj, buf, "elm");
510 else
511 elm_layout_signal_emit(obj, buf, "efl");
512 } 504 }
513 else 505 else
514 { 506 {
515 snprintf(buf, sizeof(buf), EDC_PART_FIELD_DISABLE_SIG_STR, 507 snprintf(buf, sizeof(buf), EDC_PART_FIELD_DISABLE_SIG_STR,
516 field->location); 508 field->location);
517 if (elm_widget_is_legacy(obj)) 509 efl_layout_signal_emit(obj, buf, "efl");
518 elm_layout_signal_emit(obj, buf, "elm");
519 else
520 elm_layout_signal_emit(obj, buf, "efl");
521 } 510 }
522 if (field->location + 1) 511 if (field->location + 1)
523 { 512 {
524 _part_name_snprintf(buf, sizeof(buf), obj, EDC_PART_SEPARATOR_STR, 513 _part_name_snprintf(buf, sizeof(buf), obj, EDC_PART_SEPARATOR_STR,
525 field->location + 1); 514 field->location + 1);
526 elm_layout_text_set(obj, buf, field->separator); 515 efl_text_set(efl_part(obj, buf), field->separator);
527 } 516 }
528 } 517 }
529 518
@@ -602,16 +591,13 @@ _efl_ui_clock_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Clock_Data *sd)
602 { 591 {
603 snprintf(buf, sizeof(buf), EDC_PART_FIELD_ENABLE_SIG_STR, 592 snprintf(buf, sizeof(buf), EDC_PART_FIELD_ENABLE_SIG_STR,
604 field->location); 593 field->location);
605 if (elm_widget_is_legacy(obj)) 594 efl_layout_signal_emit(obj, buf, "efl");
606 elm_layout_signal_emit(obj, buf, "elm");
607 else
608 elm_layout_signal_emit(obj, buf, "efl");
609 595
610 if (field->location) 596 if (field->location)
611 { 597 {
612 _part_name_snprintf(buf, sizeof(buf), obj, EDC_PART_SEPARATOR_STR, 598 _part_name_snprintf(buf, sizeof(buf), obj, EDC_PART_SEPARATOR_STR,
613 field->location); 599 field->location);
614 elm_layout_text_set(obj, buf, field->separator); 600 efl_text_set(efl_part(obj, buf), field->separator);
615 } 601 }
616 602
617 field_value_display(obj, field->item_obj); 603 field_value_display(obj, field->item_obj);
@@ -620,10 +606,7 @@ _efl_ui_clock_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Clock_Data *sd)
620 { 606 {
621 snprintf(buf, sizeof(buf), EDC_PART_FIELD_DISABLE_SIG_STR, 607 snprintf(buf, sizeof(buf), EDC_PART_FIELD_DISABLE_SIG_STR,
622 field->location); 608 field->location);
623 if (elm_widget_is_legacy(obj)) 609 efl_layout_signal_emit(obj, buf, "efl");
624 elm_layout_signal_emit(obj, buf, "elm");
625 else
626 elm_layout_signal_emit(obj, buf, "efl");
627 } 610 }
628 } 611 }
629 612
@@ -1019,18 +1002,15 @@ _efl_ui_clock_field_visible_set(Eo *obj, Efl_Ui_Clock_Data *sd, Efl_Ui_Clock_Typ
1019 1002
1020 snprintf(buf, sizeof(buf), EDC_PART_FIELD_ENABLE_SIG_STR, 1003 snprintf(buf, sizeof(buf), EDC_PART_FIELD_ENABLE_SIG_STR,
1021 field->location); 1004 field->location);
1022 if (elm_widget_is_legacy(obj)) 1005 efl_layout_signal_emit(obj, buf, "efl");
1023 elm_layout_signal_emit(obj, buf, "elm");
1024 else
1025 elm_layout_signal_emit(obj, buf, "efl");
1026 1006
1027 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 1007 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
1028 edje_object_message_signal_process(wd->resize_obj); 1008 edje_object_message_signal_process(wd->resize_obj);
1029 1009
1030 _part_name_snprintf(buf, sizeof(buf), obj, EDC_PART_FIELD_STR, 1010 _part_name_snprintf(buf, sizeof(buf), obj, EDC_PART_FIELD_STR,
1031 field->location); 1011 field->location);
1032 elm_layout_content_unset(obj, buf); 1012 efl_content_unset(efl_part(obj, buf));
1033 elm_layout_content_set(obj, buf, field->item_obj); 1013 efl_content_set(efl_part(obj, buf), field->item_obj);
1034 } 1014 }
1035 else 1015 else
1036 { 1016 {
@@ -1040,17 +1020,14 @@ _efl_ui_clock_field_visible_set(Eo *obj, Efl_Ui_Clock_Data *sd, Efl_Ui_Clock_Typ
1040 1020
1041 snprintf(buf, sizeof(buf), EDC_PART_FIELD_DISABLE_SIG_STR, 1021 snprintf(buf, sizeof(buf), EDC_PART_FIELD_DISABLE_SIG_STR,
1042 field->location); 1022 field->location);
1043 if (elm_widget_is_legacy(obj)) 1023 efl_layout_signal_emit(obj, buf, "efl");
1044 elm_layout_signal_emit(obj, buf, "elm");
1045 else
1046 elm_layout_signal_emit(obj, buf, "efl");
1047 1024
1048 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 1025 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
1049 edje_object_message_signal_process(wd->resize_obj); 1026 edje_object_message_signal_process(wd->resize_obj);
1050 1027
1051 _part_name_snprintf(buf, sizeof(buf), obj, EDC_PART_FIELD_STR, 1028 _part_name_snprintf(buf, sizeof(buf), obj, EDC_PART_FIELD_STR,
1052 field->location); 1029 field->location);
1053 evas_object_hide(elm_layout_content_unset(obj, buf)); 1030 efl_gfx_entity_visible_set(efl_content_unset(efl_part(obj, buf)), EINA_FALSE);
1054 } 1031 }
1055 sd->freeze_sizing = EINA_FALSE; 1032 sd->freeze_sizing = EINA_FALSE;
1056 efl_ui_layout_finger_size_multiplier_set(obj, sd->enabled_field_count, 1); 1033 efl_ui_layout_finger_size_multiplier_set(obj, sd->enabled_field_count, 1);