[prev in list] [next in list] [prev in thread] [next in thread] 

List:       enlightenment-devel
Subject:    Re: [E-devel] Using python (or other) bindings from c application
From:       Christophe Sadoine <chris () indefini ! org>
Date:       2017-09-25 13:29:19
Message-ID: CANjaSno7CxymeUbp_ro2a3E5XFpBym0ipw19EnXyX1OAE_S-9g () mail ! gmail ! com
[Download RAW message or body]

On 21 September 2017 at 18:00, Davide Andreoli <dave@gurumeditation.it> wrote:
> 2017-09-21 9:09 GMT+02:00 Christophe Sadoine <chris@indefini.org>:
>
>> Hello,
>>
>> As the title says, I have a c application and I would like to let the
>> user extend it with plugins.
>> I can do it in c of course, but I wonder if I can also do it with python?
>>
>> So what I need first, is a way to pass an Evas/Efl Object Pointer to
>> the python api,
>> And then it would be nice to be able to manipulate in c the objects we
>> created in the bindings.
>>
>> Has this been done or is it easily doable?
>>
>
> yes, it's doable using python-efl. And it is used in edgar (an E module that
> load python gadgets). You can see the source at:
> https://git.enlightenment.org/enlightenment/modules/edgar.git/tree/src/e_mod_edgar.c
>
> In that source file you should find everything is needed to load python
> modules from C
> (your plugins) and to export some C functions to PY (your plugins API)

Thank you!
I was able to make a small working sample out of it.
But like edgar I had to copy the file efl.eo_api.h.
I think this file should be installed with python-efl and accessible
with pkg-config.
Also when using object_from_instance for an elementary object you must
import elementary. if it is an edje object, import edje, etc.
if not it return 0. Maybe it would be nice to have some error message?

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic