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

2021-06-29 Thread Cedric Bail
On Tuesday, June 29th, 2021 at 12:38 PM, Andreas Volz  
wrote:
> Am 28.06.21 um 22:40 schrieb Cedric Bail:
> > On Monday, June 28th, 2021 at 11:47 AM, Andreas Volz li...@brachttal.net 
> > wrote:
> > > Am 28.06.21 um 17:52 schrieb Cedric Bail:
> > > > On Sunday, June 27th, 2021 at 12:55 PM, Andreas Volz 
> > > > li...@brachttal.net wrote:
[...]
> > > > > 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.
[...]
> > > > Yes, I think this would be part of the efl_part API. Which should be 
> > > > something
> > > > like:
> > > >  efl::eo::downcast(layout.part("title")).text_set("hello");

> > > 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.
> > 

> > With the efl_part, in the case of an external, you should actually get the 
> > object
> > itself, not some kind of wrapper. You might have to do something like:
> > 

> > Eo *obj = efl_content_get(efl_part(layout, "yourpart"));
> > 

> > I am guessing you will need to do some casting in the C++ API, no idea on
> > that part I haven't played with it in a very long time and don't remember
> > enough.
> 

> I searched my local headers and found a file
> 

> efl_canvas_layout_part_external.eo[1] which defines (nearly) what I
> need. This shows internally the same code as you quoted above. I would
> have found it before but it seems the online docs are not recent. Maybe
> they need to be re-generated?
> 

> https://www.enlightenment.org/develop/api/efl/canvas/layout_part_external/property/content
> => This topic does not exist yet

I don't know how that part was updated before.
 

> But I still don't know how to set a non-text value on a efl_part. This
> were the reasons those tpes have been used in the old API.
> 

> typedef enum _Edje_External_Param_Type
> {
> EDJE_EXTERNAL_PARAM_TYPE_INT,
> EDJE_EXTERNAL_PARAM_TYPE_DOUBLE,
> EDJE_EXTERNAL_PARAM_TYPE_STRING,
> EDJE_EXTERNAL_PARAM_TYPE_BOOL,
> EDJE_EXTERNAL_PARAM_TYPE_CHOICE,
> EDJE_EXTERNAL_PARAM_TYPE_MAX
> } Edje_External_Param_Type;
> 

> With this you could put a e.g. spinner in a Layout and assign a INT
> value and it just works. Without knowing what widget type exactly is used.

The new interface is build around the idea that you have interfaces. Text is an
interface, not an object per say in the example above. For spinner, I believe 
they
expose an Range_Display interface. So for setting the range value, you would do 
something
like the following:
efl::eo::downcast(layout.part("spin")).range_value_set(10);

Cedric

publickey - cedric@ddlm.me - 0x1869A77F.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


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

2021-06-29 Thread Andreas Volz




Am 28.06.21 um 22:40 schrieb Cedric Bail:



On Monday, June 28th, 2021 at 11:47 AM, Andreas Volz  
wrote:

Am 28.06.21 um 17:52 schrieb Cedric Bail:

On Sunday, June 27th, 2021 at 12:55 PM, Andreas Volz li...@brachttal.net 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::downcastefl::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.


With the efl_part, in the case of an external, you should actually get the 
object
itself, not some kind of wrapper. You might have to do something like:
  Eo *obj = efl_content_get(efl_part(layout, "yourpart"));

I am guessing you will need to do some casting in the C++ API, no idea on
that part I haven't played with it in a very long time and don't remember
enough.


I searched my local headers and found a file 
efl_canvas_layout_part_external.eo[1] which defines (nearly) what I 
need. This shows internally the same code as you quoted above. I would 
have found it before but it seems the online docs are not recent. Maybe 
they need to be re-generated?


https://www.enlightenment.org/develop/api/efl/canvas/layout_part_external/property/content
=> This topic does not exist yet

But I still don't know how to set a non-text value on a efl_part. This 
were the reasons those tpes have been used in the old API.


typedef enum _Edje_External_Param_Type
 {
   EDJE_EXTERNAL_PARAM_TYPE_INT,
   EDJE_EXTERNAL_PARAM_TYPE_DOUBLE,
   EDJE_EXTERNAL_PARAM_TYPE_STRING,
   EDJE_EXTERNAL_PARAM_TYPE_BOOL,
   EDJE_EXTERNAL_PARAM_TYPE_CHOICE,
   EDJE_EXTERNAL_PARAM_TYPE_MAX
 } Edje_External_Param_Type;

With this you could put a e.g. spinner in a Layout and assign a INT 
value and it just works. Without knowing what widget type exactly is used.


regards
Andreas

[1] 
https://git.enlightenment.org/core/efl.git/tree/src/lib/edje/efl_canvas_layout_part_external.eo



___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


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

2021-06-28 Thread Cedric Bail


On Monday, June 28th, 2021 at 11:47 AM, Andreas Volz  
wrote:
> Am 28.06.21 um 17:52 schrieb Cedric Bail:
> > On Sunday, June 27th, 2021 at 12:55 PM, Andreas Volz li...@brachttal.net 
> > 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::downcastefl::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.

With the efl_part, in the case of an external, you should actually get the 
object
itself, not some kind of wrapper. You might have to do something like:
 Eo *obj = efl_content_get(efl_part(layout, "yourpart"));

I am guessing you will need to do some casting in the C++ API, no idea on
that part I haven't played with it in a very long time and don't remember
enough.

Cedric

publickey - cedric@ddlm.me - 0x1869A77F.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


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

2021-06-28 Thread Andreas Volz




Am 28.06.21 um 17:52 schrieb Cedric Bail:

Hi,

On Sunday, June 27th, 2021 at 12:55 PM, Andreas Volz  
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(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


___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


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

2021-06-28 Thread Cedric Bail
Hi,

On Sunday, June 27th, 2021 at 12:55 PM, Andreas Volz  
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(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);

Cedric

publickey - cedric@ddlm.me - 0x1869A77F.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel