2015-01-26 14:20 GMT+01:00 Daniel Zaoui <[email protected]>:

> Hi Davide,
>
> I saw your stuff on Yakov's laptop, really impressive!
>
> I wanted to add something about the generators, JSON... We plan to
> implement a library that will parse the JSON file and give access to the
> information via APIs. You can see it as the Eolian library (not
> generator) for applications layer. Erigo and all the apps generators
> would use it. The advantages are that we won't have to duplicate parsing
> for every tool, versioning will be supported, meaning we can move from
> JSON to a specific format just by adding support inside this library...
>

This new library can be useful for static code generators, but it's not
really
suitable for the runtime generation approach I'm using right now.

Firstly it will require me to write python bindings for that new library.
While
json parsing is yet there in py and in every other language me think.
So basically you avoid me the json parsing (a single line of code in py),
while you create the necessity to bind/implement/learn a new API.

Secondly it will much more slower in the runtime execution, as the python
code that generate the UI will have to call c functions all the time to
fetch the
infos about widgets. Going back and forth between py and C is slow,  will
really
slow down the execution, I think at the point that it will not make sense
anymore
to have  this runtime-generation anymore.

My current implementation is possible and good only because you are using
JSON for storing the widget infos, parsing json from python is really
powerfull and fast.

So please don't remove the JSON format!


>
> I already began to write this library a few months ago but then had to
> move to other stuff. I will update you when l come back to it.
>
> My comments below (just for the enums as Yakov replies for the others).
>
> Anyway, thank you for your review, it is really useful.
>
> JackDanielZ
>
> On 01/26/15 13:56, Davide Andreoli wrote:
> > 2015-01-26 12:41 GMT+01:00 Yakov Goldberg <[email protected]>:
> >
> >> Hey  Davide,
> >>     that's cooooool :)
> >>
> >> I installed everything and played with it: changed your test_gui.egui in
> >> Erigo and run it again through erigo.py! Great!
> >>
> >> Just could you explain something.
> >>        You don't generate Python from Json.
> >>        As I understand you read Json, save this data internally and call
> >> it when needed, which doesn't actually matter in terms of speed and
> >> convenience for Python, right?
> >>
> > right, it generate/instantiate the needed classes/widgets on runtime,
> > reading
> > the json file. No need to generate the python code.
> > I do in this way because it's simpler (it's coded in py) and beautiful :)
> >
> > Btw, I plan to also write the static code generator (inside erigo in C)
> as
> > soon
> > as the runtime approach will be finished and stable, so that user can
> > choose the preferred method.
> > I'm not sure about performance, it's quite fast now as the code to
> generate
> > it's simple. But I dont have a static code to do a comparison. We will
> > understand this when also the static generator will be implemented.
> >
> >
> >> The rest is on the way...
> >>
> >>
> >> On 01/26/2015 12:22 AM, Davide Andreoli wrote:
> >>> 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.
>
> This part still needs work. The best would be to have something like
> "Elm_Win.dialog_basic" instead and then retrieve the C name and the
> value via Eolian. So we can run the application and generate the code
> with the right enum.
>
> >>>
> >>> *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
> >>>
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> Dive into the World of Parallel Programming. The Go Parallel Website,
> >> sponsored by Intel and developed in partnership with Slashdot Media, is
> >> your
> >> hub for all things parallel software development, from weekly thought
> >> leadership blogs to news, videos, case studies, tutorials and more.
> Take a
> >> look and join the conversation now. http://goparallel.sourceforge.net/
> >> _______________________________________________
> >> enlightenment-devel mailing list
> >> [email protected]
> >> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> >>
> >
> ------------------------------------------------------------------------------
> > Dive into the World of Parallel Programming. The Go Parallel Website,
> > sponsored by Intel and developed in partnership with Slashdot Media, is
> your
> > hub for all things parallel software development, from weekly thought
> > leadership blogs to news, videos, case studies, tutorials and more. Take
> a
> > look and join the conversation now. http://goparallel.sourceforge.net/
> > _______________________________________________
> > enlightenment-devel mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> >
>
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is
> your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> enlightenment-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to