efl_ui: rename list empty item to list placeholder item.

Summary:
legacy full style item is introduced Efl.Ui.ListEmptyItem Class in new Efl Interface,
but using "Empty" name is too ambiguous to present style usage.
Thanks to @cedric and @segfaultxavi,
I found better name for this class, Efl.Ui.ListPlaceHolderItem,
as item hold the place which need to be replaced and relayouted by user generated content.

Depends on D8582

Reviewers: cedric, segfaultxavi, eagleeye

Reviewed By: eagleeye

Subscribers: cedric, #reviewers, segfaultxavi, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9034
This commit is contained in:
SangHyeon Jade Lee 2019-05-30 15:07:42 +09:00
parent 01cb1c32bd
commit 57233f552c
9 changed files with 73 additions and 73 deletions

View File

@ -293,7 +293,7 @@ group { "efl/list_item";
}
}
group { "efl/list_item:empty";
group { "efl/list_item:placeholder";
data.item: "selectraise" "on";
data.item: "focusraise" "on";
images.image: "bevel_curved_horiz_out.png" COMP;

View File

@ -87,7 +87,7 @@ elm_public_eolian_files = \
lib/elementary/efl_ui_item.eo \
lib/elementary/efl_ui_list_item.eo \
lib/elementary/efl_ui_list_default_item.eo \
lib/elementary/efl_ui_list_empty_item.eo \
lib/elementary/efl_ui_list_placeholder_item.eo \
lib/elementary/efl_ui_list.eo \
lib/elementary/efl_ui_grid_item.eo \
lib/elementary/efl_ui_grid_default_item.eo \
@ -1176,7 +1176,7 @@ lib_elementary_libelementary_la_SOURCES = \
lib/elementary/efl_ui_item.c \
lib/elementary/efl_ui_list_item.c \
lib/elementary/efl_ui_list_default_item.c \
lib/elementary/efl_ui_list_empty_item.c \
lib/elementary/efl_ui_list_placeholder_item.c \
lib/elementary/efl_ui_list.c \
lib/elementary/efl_ui_grid_item.c \
lib/elementary/efl_ui_grid_default_item.c \

View File

@ -106,7 +106,7 @@ elm_main(int argc EINA_UNUSED, char **argv)
Eo *slider, *scrl_btn;
int i;
char buf[256];
Eina_Bool emptystyle = EINA_FALSE;
Eina_Bool placeholder = EINA_FALSE;
win = elm_win_util_standard_add("list", "list");
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
@ -119,8 +119,8 @@ elm_main(int argc EINA_UNUSED, char **argv)
efl_gfx_hint_fill_set(wbox, EINA_TRUE, EINA_TRUE);
if ((argv[1] != NULL) &&
(!strcmp(argv[1], "empty")))
emptystyle = EINA_TRUE;
(!strcmp(argv[1], "placeholder")))
placeholder = EINA_TRUE;
priv_d.list = list = efl_add(EFL_UI_LIST_CLASS, wbox);
efl_gfx_hint_weight_set(list, EFL_GFX_HINT_EXPAND, 0.9);
@ -133,13 +133,13 @@ elm_main(int argc EINA_UNUSED, char **argv)
for (i = 0; i < NUM_ITEMS; i++)
{
if (emptystyle) item = efl_add(EFL_UI_LIST_EMPTY_ITEM_CLASS, list);
if (placeholder) item = efl_add(EFL_UI_LIST_PLACEHOLDER_ITEM_CLASS, list);
else item = efl_add(EFL_UI_LIST_DEFAULT_ITEM_CLASS, list);
/* disable case test */
if (i == 1) efl_ui_widget_disabled_set(item, EINA_TRUE);
if (emptystyle)
if (placeholder)
{
ibox = efl_add(EFL_UI_BOX_CLASS, item);
efl_ui_layout_orientation_set(ibox, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL);
@ -148,7 +148,7 @@ elm_main(int argc EINA_UNUSED, char **argv)
efl_gfx_hint_weight_set(txt, 0.95, EFL_GFX_HINT_EXPAND);
efl_text_halign_set(txt, 0.2);
efl_text_interactive_selection_allowed_set(txt, EINA_FALSE);
snprintf(buf, sizeof(buf), "empty style item [%d]", i);
snprintf(buf, sizeof(buf), "placeholder style item [%d]", i);
efl_text_set(txt, buf);
efl_pack_end(ibox, txt);

View File

@ -341,7 +341,7 @@ typedef Eo Efl_Ui_Focus_Manager;
# include <efl_ui_item.eo.h>
# include <efl_ui_list_item.eo.h>
# include <efl_ui_list_default_item.eo.h>
# include <efl_ui_list_empty_item.eo.h>
# include <efl_ui_list_placeholder_item.eo.h>
# include <efl_ui_list.eo.h>
# include <efl_ui_grid_item.eo.h>
# include <efl_ui_grid_default_item.eo.h>

View File

@ -1,57 +0,0 @@
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif
#define EFL_UI_LIST_EMPTY_ITEM_PROTECTED
#define EFL_PART_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_part_helper.h"
#define MY_CLASS EFL_UI_LIST_EMPTY_ITEM_CLASS
#define MY_CLASS_PFX efl_ui_list_empty_item
#define MY_CLASS_NAME "Efl.Ui.List_Empty_Item"
EOLIAN static Efl_Object *
_efl_ui_list_empty_item_efl_object_finalize(Eo *obj, void *pd EINA_UNUSED)
{
Eo *eo;
eo = efl_finalize(efl_super(obj, MY_CLASS));
ELM_WIDGET_DATA_GET_OR_RETURN(eo, wd, eo);
Eina_Error theme_apply_ret = efl_ui_layout_theme_set(obj, "list_item", NULL, "empty");
if (theme_apply_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC)
CRI("Empty Item(%p) failed to set theme [efl/list_item:empty]!", eo);
return eo;
}
EOLIAN static void
_efl_ui_list_empty_item_efl_object_destructor(Eo *obj, void *pd EINA_UNUSED)
{
efl_destructor(efl_super(obj, MY_CLASS));
}
/* Efl.Part */
ELM_PART_CONTENT_DEFAULT_GET(efl_ui_list_empty_item, "efl.content")
ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_list_empty_item, void)
/* Efl.Part end */
EOLIAN static Efl_Object *
_efl_ui_list_empty_item_efl_part_part_get(const Eo *obj, void *wd EINA_UNUSED, const char *part)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
if (eina_streq(part, "content"))
return ELM_PART_IMPLEMENT(EFL_UI_ITEM_PART_CONTENT_CLASS, obj, "efl.content");
return efl_part_get(efl_super(obj, MY_CLASS), part);
}
/* Internal EO APIs and hidden overrides */
#define EFL_UI_LIST_EMPTY_ITEM_EXTRA_OPS \
ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_list_empty_item)
#include "efl_ui_list_empty_item.eo.c"

View File

@ -0,0 +1,57 @@
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif
#define EFL_UI_LIST_PLACEHOLDER_ITEM_PROTECTED
#define EFL_PART_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_part_helper.h"
#define MY_CLASS EFL_UI_LIST_PLACEHOLDER_ITEM_CLASS
#define MY_CLASS_PFX efl_ui_list_placeholder_item
#define MY_CLASS_NAME "Efl.Ui.List_Placeholder_Item"
EOLIAN static Efl_Object *
_efl_ui_list_placeholder_item_efl_object_finalize(Eo *obj, void *pd EINA_UNUSED)
{
Eo *eo;
eo = efl_finalize(efl_super(obj, MY_CLASS));
ELM_WIDGET_DATA_GET_OR_RETURN(eo, wd, eo);
Eina_Error theme_apply_ret = efl_ui_layout_theme_set(obj, "list_item", NULL, "placeholder");
if (theme_apply_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC)
CRI("Empty Item(%p) failed to set theme [efl/list_item:placeholder]!", eo);
return eo;
}
EOLIAN static void
_efl_ui_list_placeholder_item_efl_object_destructor(Eo *obj, void *pd EINA_UNUSED)
{
efl_destructor(efl_super(obj, MY_CLASS));
}
/* Efl.Part */
ELM_PART_CONTENT_DEFAULT_GET(efl_ui_list_placeholder_item, "efl.content")
ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_list_placeholder_item, void)
/* Efl.Part end */
EOLIAN static Efl_Object *
_efl_ui_list_placeholder_item_efl_part_part_get(const Eo *obj, void *wd EINA_UNUSED, const char *part)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
if (eina_streq(part, "content"))
return ELM_PART_IMPLEMENT(EFL_UI_ITEM_PART_CONTENT_CLASS, obj, "efl.content");
return efl_part_get(efl_super(obj, MY_CLASS), part);
}
/* Internal EO APIs and hidden overrides */
#define EFL_UI_LIST_PLACEHOLDER_ITEM_EXTRA_OPS \
ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_list_placeholder_item)
#include "efl_ui_list_placeholder_item.eo.c"

View File

@ -1,12 +1,12 @@
class @beta Efl.Ui.List_Empty_Item extends Efl.Ui.List_Item implements Efl.Content
class @beta Efl.Ui.List_Placeholder_Item extends Efl.Ui.List_Item implements Efl.Content
{
[[List Empty Item class. This item have only one swallow space,
[[List Placeholder Item class. This item have only one swallow space,
thus user can decorate item by filling the swallow with
any kind of container.]]
data: null;
parts {
content: Efl.Ui.Item_Part_Content; [[the content part for list empty item.
content: Efl.Ui.Item_Part_Content; [[the content part for list placeholder item.
the content part is empty slot for user customizing.
fill the place with container widget such as layout, box, table.]]
}

View File

@ -122,7 +122,7 @@ pub_eo_files = [
'efl_ui_item.eo',
'efl_ui_list_item.eo',
'efl_ui_list_default_item.eo',
'efl_ui_list_empty_item.eo',
'efl_ui_list_placeholder_item.eo',
'efl_ui_list.eo',
'efl_ui_grid_item.eo',
'efl_ui_grid_default_item.eo',
@ -898,7 +898,7 @@ elementary_src = [
'efl_ui_item.c',
'efl_ui_list_item.c',
'efl_ui_list_default_item.c',
'efl_ui_list_empty_item.c',
'efl_ui_list_placeholder_item.c',
'efl_ui_list.c',
'efl_ui_grid_item.c',
'efl_ui_grid_default_item.c',

View File

@ -9,7 +9,7 @@
/* spec-meta-start
{"test-interface":"Efl.Content",
"test-widgets": ["Efl.Ui.Button", "Efl.Ui.Frame", "Efl.Ui.Grid_Default_Item",
"Efl.Ui.List_Default_Item", "Efl.Ui.List_Empty_Item",
"Efl.Ui.List_Default_Item", "Efl.Ui.List_Placeholder_Item",
"Efl.Ui.Navigation_Layout", "Efl.Ui.Panel", "Efl.Ui.Progressbar",
"Efl.Ui.Radio", "Efl.Ui.Popup", "Efl.Ui.Tab_Page", "Efl.Ui.Scroller"]}