Page MenuHomePhabricator

Eolian: enum with keyword legacy
Closed, WontfixPublic


Dear Mr. Daniel Kolesa, Hello.

Please see the following snippet of /src/lib/elementary/efl_access.eo

enum Efl.Access.Role                                                               
   [[Describes the role of an object visible to Accessibility Clients.]]           
   legacy: elm_atspi_role;                                                         
   invalid, [[Role: invalid]]

This is creating following enum for both eo.h and eo.legacy.h

typedef enum                                                                       
  ELM_ATSPI_ROLE_INVALID = 0, /**< Role: invalid */

But IMHO both header files should have different enum value.
For example, if there is line "legacy_prefix: elm_atspi_role;" then eo.legacy.h should have ELM_ATSPI_ROLE_ for its prefix.
And for the eo.h, "eo_prefix:" would be used instead of "legacy:".
Please let me know your opinion. Thank you in advance.

Shinwoo Kim.

kimcinoo created this task.Dec 6 2017, 6:15 PM
q66 added a comment.Dec 7 2017, 4:27 AM

yeah, you're probably right; the current legacy field was never even meant to be a proper feature, more like a temporary hack to get enums for legacy APIs to behave as we want them to...

I'm not really sure about adding a prefix for "new" APIs, the enum values should all follow the same pattern ideally (ENUM_NAME_FIELD_NAME). But we'll see...

q66 triaged this task as Normal priority.Dec 7 2017, 4:27 AM
q66 added a project: Restricted Project.Apr 13 2018, 3:43 AM