Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ EFL, or the *Enlightenment Foundation Libraries*, is a collection of libraries f

Python-EFL are the python bindings for the whole EFL stack (evas, ecore, edje, emotion, ethumb and elementary). You can use Python-EFL to build a portable GUI application in minutes.

The documentation for Python-EFL is available [here](https://docs.enlightenment.org/python-efl/current/).
The documentation for Python-EFL is available [here](https://docs.enlightenment.org/python-efl/current/). The tutorials section includes a ubuntu / mint install tutorial.

## Install from pypi

Expand Down
146 changes: 146 additions & 0 deletions doc/tutorials/01-install.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@

Tutorial 1 - Install
====================

Python-efl is the binding for EFL, an awesome and performance-obcessed
set of libraries. EFL stands for Enlightment Foundation Libraries. It
was started for the `Enlightment <https://www.enlightenment.org/>`__
desktop project and developed into a set of libraries. This tutorial
shows how to install python-efl.

Install Instructions
====================

First create a new folder called efl_dev

.. code:: python

mkdir efl_dev
cd efl_dev

Then see `EFL
downloads <https://download.enlightenment.org/rel/libs/efl/>`__ and
`Python-EFL <https://download.enlightenment.org/rel/bindings/python/>`__
downloads.

See the version you want is available on both. Let's choose 1.25.0 for
this tutorial

Download and extract both

.. code:: python

wget https://download.enlightenment.org/rel/libs/efl/efl-1.25.0.tar.xz
tar xvf efl-1.25.0.tar.xz
wget https://download.enlightenment.org/rel/bindings/python/python-efl-1.25.0.tar.xz
tar xvf python-efl-1.25.0.tar.xz

Install EFL
-----------

Now let us install EFL first. Let's install essentials

.. code:: python

sudo apt install build-essential check meson ninja-build

and dependencies

.. code:: python

sudo apt install libssl-dev libsystemd-dev libjpeg-dev libglib2.0-dev libgstreamer1.0-dev liblua5.2-dev libfreetype6-dev libfontconfig1-dev libfribidi-dev libavahi-client-dev libharfbuzz-dev libibus-1.0-dev libx11-dev libxext-dev libxrender-dev libgl1-mesa-dev libopenjp2-7-dev libwebp-dev libgif-dev libtiff5-dev libpoppler-dev libpoppler-cpp-dev libspectre-dev libraw-dev librsvg2-dev libudev-dev libmount-dev libdbus-1-dev libpulse-dev libsndfile1-dev libxcursor-dev libxcomposite-dev libxinerama-dev libxrandr-dev libxtst-dev libxss-dev libgstreamer-plugins-base1.0-dev doxygen libscim-dev libxdamage-dev libwebp-dev libunwind-dev

and what i found missing

.. code:: python

sudo apt install libluajit-5.1-dev

change dir

.. code:: python

cd efl-1.25.0

Now let us build the project

.. code:: python

meson build
ninja -C build
sudo ninja -C build install

You also have to make some files visible to pkgconfig. One way of doing
this is to open /etc/profile in a text editor as root (using for example
sudo nano /etc/profile) and add the following line to the end:

.. code:: python

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig

You may also need to refresh your library path to make sure your apps
can find the EFL libraries:

.. code:: python

sudo ldconfig

Install Python-EFL
------------------

.. code:: python

cd ../python-efl-1.25.0

Install python3-dev or corresponding. I was using Python3.9 so i did

.. code:: python

sudo apt install python3.9-dev

also python dbus

.. code:: python

sudo apt install python-dbus-dev

Then create and activate virtual environment

.. code:: python

python3.9 -m venv venv
. venv/bin/activate

Install cython

.. code:: python

pip install cython

Now build the package

.. code:: python

python setup.py build

and install

.. code:: python

python setup.py install

Conclusion
----------

Now if you run pip freeze you should get something similar

.. code:: python

Cython==0.29.24
python-efl==1.25.0

refs:

* https://www.enlightenment.org/docs/distros/ubuntu-start.md

* https://git.enlightenment.org/bindings/python/python-efl.git/tree/INSTALL
21 changes: 0 additions & 21 deletions doc/tutorials/01-window.rst

This file was deleted.

21 changes: 0 additions & 21 deletions doc/tutorials/02-sizehints.rst

This file was deleted.

57 changes: 57 additions & 0 deletions doc/tutorials/02-window.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

Tutorial 2 - Window
===================

Python-EFL is a wrapper around the Enlightenment GUI kit. This series of
tutorials is an update from the original author.

Simple window

Be sure to read first:

`How to install Python-efl on Ubuntu or Linux
Mint <https://www.pythonkitchen.com/how-to-install-python-efl-on-ubuntu-or-linux-mint/>`__

.. code:: python

'''
Abdur-Ramaan Janhangeer
Updated from Jeff Hoogland's tutos
for Python3.9 and Python-elf 1.25.0
'''
import efl.elementary as elm
from efl.elementary.label import Label
from efl.elementary.window import StandardWindow
from efl.evas import EVAS_HINT_EXPAND

EXPAND_BOTH = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND


class MainWindow(StandardWindow):
def __init__(self):
StandardWindow.__init__(self, "ex1", "Hello Elementary", size=(300, 200))
self.callback_delete_request_add(lambda o: elm.exit())
label = Label(self)
label.size_hint_weight = EXPAND_BOTH
label.text = "Hello Elementary!"
label.show()
self.resize_object_add(label)


if __name__ == "__main__":
elm.init()
gui = MainWindow()
gui.show()
elm.run()

Note: elm.shutdown is no longer needed as per the docs which says

.. code:: python

.. versionchanged:: 1.14

The Python module calls this function when it is exiting so you
should no longer have any need to call this manually. Calling it does
not carry any penalty though.

Updated from Jeff Hoogland's tutos
60 changes: 60 additions & 0 deletions doc/tutorials/03-weighthints.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
Tutorial 3 - Weight Hints
=========================

Python-EFL is a wrapper around the Enlightenment GUI kit. This series of
tutorials is an update from the original author.

Callback demo

.. code:: python

'''
Abdur-Ramaan Janhangeer
Updated from Jeff Hoogland's tutos
for Python3.9 and Python-elf 1.25.0
'''

import efl.elementary as elm
from efl.elementary.box import Box
from efl.elementary.button import Button
from efl.elementary.label import Label
from efl.elementary.window import StandardWindow
from efl.evas import EVAS_HINT_EXPAND

EXPAND_BOTH = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND


class MainWindow(StandardWindow):
def __init__(self):
StandardWindow.__init__(self, "ex1", "Good Bye Elementary", size=(300, 200))
self.callback_delete_request_add(lambda o: elm.exit())
our_label = Label(self)
our_label.size_hint_weight = EXPAND_BOTH
our_label.text = "Hello Elementary!"
our_label.show()

our_button = Button(self)
our_button.size_hint_weight = EXPAND_BOTH
our_button.text = "Good Bye Elementary!"
our_button.callback_clicked_add(self.button_pressed)
our_button.show()

our_box = Box(self)
our_box.size_hint_weight = EXPAND_BOTH
our_box.pack_end(our_label)
our_box.pack_end(our_button)
our_box.show()

self.resize_object_add(our_box)

def button_pressed(self, btn):
elm.exit()


if __name__ == "__main__":
elm.init()
gui = MainWindow()
gui.show()
elm.run()
elm.shutdown()

Loading