Re: [E-devel] C API => Unified API

Andreas Volz <[email protected]>
Newsgroups gmane.comp.window-managers.enlightenment.devel
Message-ID <[email protected]>

Am 28.06.21 um 17:52 schrieb Cedric Bail:
> Hi,
> 
> On Sunday, June 27th, 2021 at 12:55 PM, Andreas Volz <[email protected]> wrote:
>> I often don't find a Unified API equivalent in the new Unified API.
>> Sure, the easy and obvious ones no problem. But sometimes the design
>> seems to be changed a lot. Is there a general advice?
>>
> 
>> For example I use edje_object_part_external_param_*() much in my
>> application. I thought it might be an equivalent in Efl.Ui.Layout_Part
>> but I don't see an obvious function.
>>
> 
>> So any hints in general or this special case?
> 
> Yes, I think this would be part of the efl_part API. Which should be something
> like:
>   efl::eo::downcast<efl::Text>(layout.part("title")).text_set("hello");
> 
> or in C:
>   efl_text_set(efl_part(layout, "title"), "hello");
> 
> The efl_part object returned is an Eo object that can only be used for one call. If
> you want to use it for more than that you need to increase its ref counting. Something
> like that:
>   Eo *part = efl_ref(efl_part(layout, "title"));
>   efl_text_set(part, "hello");
>   ...
>   efl_unref(part);

Hm, I'd assume this works for text objects. But with the external API[1] 
you could get/set also int/bool data if you know the object supports it 
without detail information of what UI type is the object. With the C API 
this is possible.

[1] 
https://docs.enlightenment.org/api/release/edje-1.0.1-doc/doc/html/edje__external_8c.html#ac8f8c0c632cc00864e319741e606ece0

regards
Amdreas
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.