Giter Site home page Giter Site logo

pylvgl's Introduction

pylvgl

Python bindings for the LittlevGL graphics library

This project aims at creating Python bindings (i.e. a Python module) for the LittlevGL embedded GUI library. It does so by providing a bindings generator, i.e. a Python script that generates the source code for the Python module, by inspecting the LittlevGL source code.

Use-cases

LittlevGL is aimed at embedded platforms with low resources available. As such, it may seem counter-intuitive to use it in combination with a high-level programming language such as Python. However, there are several use cases:

  • Use on embedded systems

    Embedded systems are getting more and more powerfull, allowing the use of Python as a programming language, which can significantly reduce the programming effort required to create a graphical user interface. Since full-blown user interface libraries such as Qt or wxWidgets may still be too demanding for these platforms, LittleVGL combined with pylvgl may be a suitable solution.

  • Prototyping on PC platform Even if Python is not used on the embedded platform, it can be used to prototype the embedded user interface

Installation

Run python setup.py install to build and install pylvgl. The pre-built source-code of the module, lvglmodule.c, is included in the github repository for convenience. It can be re-generated by running bindingsgen.py, but this is not required for installation.

Road-map

Already implemented:

  • Parsing of LittlevGL source code
  • Python bindings for all LittlevGL objects
  • Python constants for all LittlevGL enum constants
  • Support for styles
  • Action callbacks

To be implemented:

  • Destruction / deletion of items
  • ...

Limitations

  • lvgl.Style.copy() allocates a new lv_style_t struct, which is never freed, since the management of lv_style_t structs is troublesome. LittlevGL keeps references to those style objects, and as such it cannot be determined when it would be safe to free that data. In the current implementation. To be safe, the allocated memory is never freed (and thus a memory leak is present)

  • The bindings-generator currently assumes a 16 bit-per-pixel screen configuration. This is checked in the generated lvglmodule.c at compile-time.

Developer info

bindingsgen.py is the Python script that does the parsing of the LittleVGL source code and generates lvglmodule.c. Parsing is done using pycparser. It uses lvglmodule_template.c as a template.

pylvgl's People

Contributors

rreilink avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.