forked from enlightenment/efl
edje: add required attribute in Edje_Part
Summary: When using EDC written by another person, developer usually does not need to know all specified parts in EDC but editable like swallow, text or textblock parts. The required flag tells whether the part is intended to be used outside EDC. Reviewers: jpeg, cedric, raster, Hermet Reviewed By: jpeg, raster Subscribers: raster, NikaWhite, kimcinoo, jpeg Differential Revision: https://phab.enlightenment.org/D3579
This commit is contained in:
parent
f8e07c4d7c
commit
5a3c015e9e
|
@ -294,6 +294,8 @@ static void st_collections_group_parts_part_use_alternate_font_metrics(void);
|
||||||
static void st_collections_group_parts_part_clip_to_id(void);
|
static void st_collections_group_parts_part_clip_to_id(void);
|
||||||
static void st_collections_group_parts_part_render(void);
|
static void st_collections_group_parts_part_render(void);
|
||||||
static void st_collections_group_parts_part_no_render(void);
|
static void st_collections_group_parts_part_no_render(void);
|
||||||
|
static void st_collections_group_parts_part_required(void);
|
||||||
|
static void st_collections_group_parts_part_norequired(void);
|
||||||
static void st_collections_group_parts_part_source(void);
|
static void st_collections_group_parts_part_source(void);
|
||||||
static void st_collections_group_parts_part_source2(void);
|
static void st_collections_group_parts_part_source2(void);
|
||||||
static void st_collections_group_parts_part_source3(void);
|
static void st_collections_group_parts_part_source3(void);
|
||||||
|
@ -768,6 +770,7 @@ New_Statement_Handler statement_handlers[] =
|
||||||
{"collections.group.parts.part.use_alternate_font_metrics", st_collections_group_parts_part_use_alternate_font_metrics},
|
{"collections.group.parts.part.use_alternate_font_metrics", st_collections_group_parts_part_use_alternate_font_metrics},
|
||||||
{"collections.group.parts.part.clip_to", st_collections_group_parts_part_clip_to_id},
|
{"collections.group.parts.part.clip_to", st_collections_group_parts_part_clip_to_id},
|
||||||
{"collections.group.parts.part.no_render", st_collections_group_parts_part_no_render},
|
{"collections.group.parts.part.no_render", st_collections_group_parts_part_no_render},
|
||||||
|
{"collections.group.parts.part.required", st_collections_group_parts_part_required},
|
||||||
{"collections.group.parts.part.source", st_collections_group_parts_part_source},
|
{"collections.group.parts.part.source", st_collections_group_parts_part_source},
|
||||||
{"collections.group.parts.part.source2", st_collections_group_parts_part_source2},
|
{"collections.group.parts.part.source2", st_collections_group_parts_part_source2},
|
||||||
{"collections.group.parts.part.source3", st_collections_group_parts_part_source3},
|
{"collections.group.parts.part.source3", st_collections_group_parts_part_source3},
|
||||||
|
@ -1119,6 +1122,8 @@ New_Statement_Handler statement_handlers_short[] =
|
||||||
noprecise; -> precise_is_inside: 0;
|
noprecise; -> precise_is_inside: 0;
|
||||||
render; -> no_render: 0;
|
render; -> no_render: 0;
|
||||||
norender; -> no_render: 1;
|
norender; -> no_render: 1;
|
||||||
|
required; -> required: 1;
|
||||||
|
norequired; -> norequired: 0;
|
||||||
scale; -> scale: 1;
|
scale; -> scale: 1;
|
||||||
noscale; -> scale: 0;
|
noscale; -> scale: 0;
|
||||||
desc {
|
desc {
|
||||||
|
@ -1147,6 +1152,8 @@ New_Statement_Handler statement_handlers_short_single[] =
|
||||||
{"collections.group.parts.part.noscale", st_collections_group_parts_part_noscale},
|
{"collections.group.parts.part.noscale", st_collections_group_parts_part_noscale},
|
||||||
{"collections.group.parts.part.render", st_collections_group_parts_part_render},
|
{"collections.group.parts.part.render", st_collections_group_parts_part_render},
|
||||||
{"collections.group.parts.part.norender", st_collections_group_parts_part_no_render},
|
{"collections.group.parts.part.norender", st_collections_group_parts_part_no_render},
|
||||||
|
{"collections.group.parts.part.required", st_collections_group_parts_part_required},
|
||||||
|
{"collections.group.parts.part.norequired", st_collections_group_parts_part_norequired},
|
||||||
{"collections.group.parts.part.description.vis", st_collections_group_parts_part_description_vis},
|
{"collections.group.parts.part.description.vis", st_collections_group_parts_part_description_vis},
|
||||||
{"collections.group.parts.part.description.hid", st_collections_group_parts_part_description_hid},
|
{"collections.group.parts.part.description.hid", st_collections_group_parts_part_description_hid},
|
||||||
{"collections.group.mouse", st_collections_group_mouse},
|
{"collections.group.mouse", st_collections_group_mouse},
|
||||||
|
@ -4395,6 +4402,7 @@ _part_copy(Edje_Part *ep, Edje_Part *ep2)
|
||||||
ep->multiline = ep2->multiline;
|
ep->multiline = ep2->multiline;
|
||||||
ep->access = ep2->access;
|
ep->access = ep2->access;
|
||||||
ep->no_render = ep2->no_render;
|
ep->no_render = ep2->no_render;
|
||||||
|
ep->required = ep2->required;
|
||||||
ep->dragable.x = ep2->dragable.x;
|
ep->dragable.x = ep2->dragable.x;
|
||||||
ep->dragable.step_x = ep2->dragable.step_x;
|
ep->dragable.step_x = ep2->dragable.step_x;
|
||||||
ep->dragable.count_x = ep2->dragable.count_x;
|
ep->dragable.count_x = ep2->dragable.count_x;
|
||||||
|
@ -5746,6 +5754,7 @@ edje_cc_handlers_part_make(int id)
|
||||||
ep->access = 0;
|
ep->access = 0;
|
||||||
ep->clip_to_id = -1;
|
ep->clip_to_id = -1;
|
||||||
ep->no_render = 0;
|
ep->no_render = 0;
|
||||||
|
ep->required = 0;
|
||||||
ep->dragable.confine_id = -1;
|
ep->dragable.confine_id = -1;
|
||||||
ep->dragable.threshold_id = -1;
|
ep->dragable.threshold_id = -1;
|
||||||
ep->dragable.event_id = -1;
|
ep->dragable.event_id = -1;
|
||||||
|
@ -6799,6 +6808,33 @@ st_collections_group_parts_part_render(void)
|
||||||
current_part->no_render = EINA_FALSE;
|
current_part->no_render = EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@page edcref
|
||||||
|
@property
|
||||||
|
required
|
||||||
|
@parameters
|
||||||
|
[1 or 0]
|
||||||
|
@effect
|
||||||
|
If the required flag is set, this part will be considered
|
||||||
|
stable and it is safe to use by any application."
|
||||||
|
@since 1.18
|
||||||
|
@endproperty
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
st_collections_group_parts_part_required(void)
|
||||||
|
{
|
||||||
|
if (check_range_arg_count(0, 1) == 1)
|
||||||
|
current_part->required = parse_bool(0);
|
||||||
|
else /* lazEDC form */
|
||||||
|
current_part->required = EINA_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
st_collections_group_parts_part_norequired(void)
|
||||||
|
{
|
||||||
|
current_part->required = EINA_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@page edcref
|
@page edcref
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -364,6 +364,7 @@ _edje_collection_convert(Eet_File *ef, Edje_Part_Collection_Directory_Entry *ce,
|
||||||
replacement->select_mode = part->select_mode;
|
replacement->select_mode = part->select_mode;
|
||||||
replacement->multiline = part->multiline;
|
replacement->multiline = part->multiline;
|
||||||
replacement->api = part->api;
|
replacement->api = part->api;
|
||||||
|
replacement->required = part->required;
|
||||||
|
|
||||||
edc->parts[k++] = replacement;
|
edc->parts[k++] = replacement;
|
||||||
|
|
||||||
|
|
|
@ -113,6 +113,7 @@ struct _Old_Edje_Part
|
||||||
unsigned char select_mode;
|
unsigned char select_mode;
|
||||||
unsigned char multiline;
|
unsigned char multiline;
|
||||||
Edje_Part_Api api;
|
Edje_Part_Api api;
|
||||||
|
unsigned char required;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _Old_Edje_Part_Description_Spec_Image
|
struct _Old_Edje_Part_Description_Spec_Image
|
||||||
|
|
|
@ -430,6 +430,7 @@ _edje_edd_old_init(void)
|
||||||
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_part, Old_Edje_Part, "items", items, _edje_edd_old_edje_pack_element);
|
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_part, Old_Edje_Part, "items", items, _edje_edd_old_edje_pack_element);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "api.name", api.name, EET_T_STRING);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "api.name", api.name, EET_T_STRING);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "api.description", api.description, EET_T_STRING);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "api.description", api.description, EET_T_STRING);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "required", required, EET_T_UCHAR);
|
||||||
|
|
||||||
eet_eina_file_data_descriptor_class_set(&eddc, sizeof (eddc), "Edje_Part_Collection", sizeof (Old_Edje_Part_Collection));
|
eet_eina_file_data_descriptor_class_set(&eddc, sizeof (eddc), "Edje_Part_Collection", sizeof (Old_Edje_Part_Collection));
|
||||||
_edje_edd_old_edje_part_collection =
|
_edje_edd_old_edje_part_collection =
|
||||||
|
|
|
@ -405,6 +405,7 @@ case EDJE_PART_TYPE_##Tp: \
|
||||||
replacement->select_mode = part->select_mode;
|
replacement->select_mode = part->select_mode;
|
||||||
replacement->multiline = part->multiline;
|
replacement->multiline = part->multiline;
|
||||||
replacement->api = part->api;
|
replacement->api = part->api;
|
||||||
|
replacement->required = part->required;
|
||||||
|
|
||||||
edc->parts[k++] = replacement;
|
edc->parts[k++] = replacement;
|
||||||
|
|
||||||
|
|
|
@ -138,6 +138,7 @@ struct _Old_Edje_Part
|
||||||
unsigned char select_mode; /**< entry selection mode */
|
unsigned char select_mode; /**< entry selection mode */
|
||||||
unsigned char multiline; /**< multiline enabled */
|
unsigned char multiline; /**< multiline enabled */
|
||||||
Edje_Part_Api api; /**< part API */
|
Edje_Part_Api api; /**< part API */
|
||||||
|
unsigned char required; /**< required */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1762,6 +1762,7 @@ _edje_edd_init(void)
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "api.name", api.name, EET_T_STRING);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "api.name", api.name, EET_T_STRING);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "api.description", api.description, EET_T_STRING);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "api.description", api.description, EET_T_STRING);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "nested_children_count", nested_children_count, EET_T_UCHAR);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "nested_children_count", nested_children_count, EET_T_UCHAR);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "required", required, EET_T_UCHAR);
|
||||||
|
|
||||||
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Limit);
|
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Limit);
|
||||||
_edje_edd_edje_part_limit = eet_data_descriptor_file_new(&eddc);
|
_edje_edd_edje_part_limit = eet_data_descriptor_file_new(&eddc);
|
||||||
|
|
|
@ -1194,6 +1194,7 @@ struct _Edje_Part
|
||||||
unsigned char access; /* it will be used accessibility feature */
|
unsigned char access; /* it will be used accessibility feature */
|
||||||
unsigned char nested_children_count;
|
unsigned char nested_children_count;
|
||||||
unsigned char no_render; /* for proxy sources and masks, since 1.15 */
|
unsigned char no_render; /* for proxy sources and masks, since 1.15 */
|
||||||
|
unsigned char required; /* required part, since 1.18 */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _Edje_Part_Image_Id
|
struct _Edje_Part_Image_Id
|
||||||
|
|
Loading…
Reference in New Issue