Hi all,
the python-efl integration for erigo is quite finished, you can try it
using my pyefl branch:
devs/davemds/erigo_generator
Everything is really simple, the only file that implement the generator is
this:
https://git.enlightenment.org/bindings/python/python-efl.git/tree/efl/utils/erigo.py?h=devs/davemds/erigo_generator

and this the incredible simple example:
https://git.enlightenment.org/bindings/python/python-efl.git/tree/examples/elementary/test_erigo.py?h=devs/davemds/erigo_generator

that load this json file:
https://git.enlightenment.org/bindings/python/python-efl.git/tree/examples/elementary/erigo_prj/test_gui.egui?h=devs/davemds/erigo_generator

In practice you just need to subclass the ErigoGui class provided, create
an instance
passing the json file and implement your callback inside this class. Thats
it!
Example usage:

from efl import elementaryfrom efl.utils.erigo import ErigoGui

class MyGui(ErigoGui):
    def btn_clicked_cb(self, btn):
        print('User clicked a button', btn)
    ...and all other widdget callbacks

egui = MyGui('path/to/json_file')


Nothing more :)

And now the real purpose of this mail: the issue we need to resolve to
complete the work,
in random order:

*1. Classes custom constructor*
In the json file the custom constructor (and their params)  are listed
inside the Properties
list, this is quite annoying for my implementation and seems to me quite
wrong.
Why don't you move that in the  "Desc" section of the widget? along the
"class" attribute?
It seems to me more natural this way. Example:

"elm_win1":
    {
      "Desc":
      {
        "parent":null,
        "class":"Elm_Win",
        "Elm_Win.constructor":[null, "ELM_WIN_BASIC"],
        "public":true
      },
      "Properties":
      {
        "Evas.Object.visibility":[true],
        "Evas.Object.size":[381, 480],
      }
   }

Or still better just as:
"constructor":[null, "ELM_WIN_BASIC"]


*2. The Win **mainmenu*
Every window have a mainmenu, in the json I always find the specification
of a Menu widget but it is not a children of other widgets nor it is
a resize object of the window. How can I know about it? How can I know
it is the mainmenu of the window? How did you implemented this in the
preview?

*3. The "visibility" property*
I spoken with Tasn yet about this, and opened a ticket on phab (T2035),
I really think we must rename this to "visible"

*4. Function call as properties*
There are some rare case where the json file have functions call inside
the "Properties" section of a widget, for example in the Radio widget:
"Properties":
{
   "Evas.Object.size_hint_weight":[1, 1],
   "Evas.Object.visibility":[true],
   "Elm_Radio.group_add":["elm_radio1"],
 },

group_add in this case is a function not a property, not that this
create me too much problem, it's easy to manage in python, it just
slow down the process a little bit, as I need to check at runtime
if that is a prop or not. Maybe is better to have a "Functions"
sections? Would be better for my implementation and seems more
correct.

*5. Enums*
Now enums are written in the json files as if they where normal
strings, for example:

"Elm_Win.constructor":["dia-win", "ELM_WIN_DIALOG_BASIC"]

I solved this yet, but with an hackish and slow solution, it could be
better if we can find a way to express them in a way that they don't
get confused with strings. But honestly I do not have any idea.

*6. Labels with markup text*
this just need to be fixed in some way inside erigo, it not possible atm to
use
markup in Labels.


It's all for now :)
Help me to fix this issues and we will have full erigo support in pyefl
starting from 1.14

bye
davemds
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to