Page MenuHomePhabricator

elementary: allow Efl.Ui.Factory to have a chance to call constructor function.

Authored by cedric on Aug 16 2019, 5:28 PM.

Diff Detail

rEFL core/efl
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
cedric created this revision.Aug 16 2019, 5:28 PM
cedric requested review of this revision.Aug 16 2019, 5:28 PM
cedric updated this revision to Diff 24140.Aug 16 2019, 6:01 PM


cedric updated this revision to Diff 24147.Aug 16 2019, 6:05 PM

phab please!

bu5hm4n requested changes to this revision.Aug 18 2019, 6:26 AM
bu5hm4n added inline comments.

Can you elaborate what it is going ? I do not understand whats the purpose of this function...


Why not having a propery for that ?

This revision now requires changes to proceed.Aug 18 2019, 6:26 AM
cedric added inline comments.Aug 19 2019, 3:23 PM

We do have constructor property that must be called during the construction of an object. The factory need a way to allow any inherited factory to do that without having to reimplement the efl_add in every layer that inherit from a factory. This function is what provide the ability of the factory to call itself with the newly created object before that object has been finalized allowing for constructor property to be called.


Because in case it is NULL, we do not want to set it directly on the object I would think (If the class does define a style, setting it to NULL would override that).

cedric updated this revision to Diff 24219.Aug 19 2019, 3:40 PM

Rebase and take comment into account.

lauromoura accepted this revision.Aug 20 2019, 12:26 PM
bu5hm4n added inline comments.Aug 20 2019, 10:48 PM

But having a API that requires you to use efl_key_data is kind of clumsy, can this not just be a parameter of the building API that defaults to NULL?

cedric added inline comments.Aug 20 2019, 11:00 PM

The thing is that it would be illogical as every level of inheritance would want to have their own parameters. Basically the problem is how to do linear information transfer when doing a full vertical inheritance tree walk. I am not even sure this is the proper way. I have tried also to use an event on the factory to carry the information., but it doesn't really help.

bu5hm4n added inline comments.Aug 20 2019, 11:10 PM

Mhm, what about this (just directly out of my mind):

  • You can pass a second object to the create method
  • This object is a simple key value storage, where every key is assosiated with 1 Eina_Value
  • Each Factory can decide which keys they apply, and can simply apply them via reflection.

Does that work ?


I can also implement that if you have other things to do ... :)

cedric planned changes to this revision.Aug 21 2019, 9:46 AM
cedric added inline comments.

Why adding an object to store key/value when the object itself can do that?

Arguably, I should move this to rely on model and reorder setting up the model. Model being the object that the factory see before the item is created and can associate data with more easily.

bu5hm4n added inline comments.Aug 21 2019, 9:52 AM

Because that stuff is not obviously to be used, and is not beeing able to be documented properly. Not starting with the fact that binded languages will suck with this, or just not provide it.
Additionally, a user could just use the same key and you run into issues. This is just very implicit, and not obvious at all to me.
Additionally² the keys used here will suck, or we are running into issues where the user might uses the same thing...

cedric updated this revision to Diff 24346.Aug 21 2019, 11:03 AM

rebase and avoid using key/data API to please @bu5hm4n :-)

This revision is now accepted and ready to land.Aug 21 2019, 11:04 AM
This revision was automatically updated to reflect the committed changes.