Giter Club home page Giter Club logo

libui-node's Introduction

libui-node

libui Node.js bindings.

libui is a simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports.

It is in early stage of development, but is evolving at great pace and is really awesome.

It could become an awesome, lightweight alternative to Electron to develop multiplatform GUI.

Join the chat at https://gitter.im/parro-it/libui-node Travis Build Status AppVeyor Build Status NPM module NPM downloads

Linux Linux

macOS macOS

Windows Windows

Supported platform

  • Windows: Windows Vista SP2 with Platform Update or newer
  • Unix: GTK+ 3.10 or newer
  • Mac OS X: OS X 10.8 or newer

Node version requirement

The project run on any node version > 0.12.

Installation

We had published a first pre-release to npm. You can now install libui-node as a simple dependency in your project:

npm install -S libui-node

libui prebuilt binaries are automatically downloaded after install.

This is tested with:

  • Linux 64bit
  • Linux 32bit
  • Windows 64bit
  • macOS

If you get error on windows, check this node-gyp issue

Documentation

You can find ongoing documentation in docs folder.

Please look in examples folder for working examples.

Some example uses ES6 syntax. We will soon configure babel transpilation for them. Meanwhile, if you are testing the project on Node.js < 6, you can check examples/core-api.js that use ES5 syntax.

Run examples

First, you have to clone the GitHub repo and npm install it:

git clone https://github.com/parro-it/libui-node.git
npm install

Then, to run the control gallery example (requires Node.js >= 6), type:

npm start

For the core api, example, type:

npm run start-core

Project status

  • All current libui API, except for these ones are implemented.
  • This is not yet battle-tested in a real app, but the control gallery example you saw in the screenshot above is fully working.

Future directions of the project

This binding is actually implementing low-level API straight to the libui ones. We plan to add another level of API on top of it to simplify GUI building. You can get a taste of how they will be in example utils.js file.

This new API will support transpilation from JSX to further simplify GUI building.

These works will become in future the base for a React-Native like project.

Contribution & design

  • Each libui widget implementation is written in it's own C++ file in src folder.
  • Each widget is implemented in it's own C++ class, each class is a simple wrapper for related libui C functions.
  • There is an header file called src/ui-node.h that contains all classes definitions.
  • Widget events does not follow node convention: if you attach an handler to an event, previous one will be overwritten and never be called. This will be resolved on future high-level API repo, where each widget will be an EventEmitter instance.
  • We build the project using the awesome nbind tool, that automate the process of linking a straight C++ class to Node.js stuff...

Useful NPM scripts

  • test - run AVA tests && XO linting.
  • start - start the control gallery example
  • build - rebuild C++ sources

Related projects

  • libui - Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports.
  • nbind - Magical headers that make your C++ library accessible from JavaScript
  • proton-native - A React environment for cross platform native desktop apps https://proton-native.js.org

Contributors

Andrea Parodi | Juha Järvi | Niklas Mischkulnig | Gustav Hansen ---|---|---|--- Andrea Parodi | Juha Järvi | Niklas Mischkulnig | Gustav Hansen

License

The MIT License (MIT)

Copyright (c) 2018 parro-it

libui-node's People

Contributors

gitter-badger avatar jjrv avatar mischnic avatar oakmac avatar parro-it avatar rivertam avatar sam0x17 avatar

Watchers

 avatar  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.