libui-node
Advanced tools
Comparing version 0.2.0-rc1 to 0.2.0
{ | ||
"name": "libui-node", | ||
"version": "0.2.0-rc1", | ||
"version": "0.2.0", | ||
"description": "Node.js bindings for libui", | ||
@@ -5,0 +5,0 @@ "repository": "parro-it/libui-node", |
# libui-node | ||
> Node.js bindings for [libui](https://github.com/andlabs/libui) library. | ||
> libui Node.js bindings. | ||
[libui](https://github.com/andlabs/libui) is a lightweight, portable GUI library that uses the native GUI technologies of each platform it supports. | ||
> [libui](https://github.com/andlabs/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 alternative to Electron to develop multiplatform GUI, expecially suited to develop small apps. | ||
> 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](https://badges.gitter.im/parro-it/libui-node.svg)](https://gitter.im/parro-it/libui-node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
[![Travis Build Status](https://img.shields.io/travis/parro-it/libui-node/master.svg)](http://travis-ci.org/parro-it/libui-node) | ||
@@ -28,3 +24,3 @@ [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/ebcssfrpaypfwha4?svg=true)](https://ci.appveyor.com/project/parro-it/libui-node) | ||
# Supported platform | ||
# Supported platforms | ||
@@ -34,12 +30,23 @@ * Windows: Windows Vista SP2 with Platform Update or newer | ||
* Mac OS X: OS X 10.8 or newer | ||
* Node.js version 4 or greater. | ||
# Node version requirement | ||
# Prerequisites | ||
The project run on any node version > 0.12. | ||
## Windows | ||
- [windows-build-tools](https://www.npmjs.com/package/windows-build-tools) or Visual Studio 2015 to compile the project. | ||
- [Visual C++ Redistributable Package per Visual Studio 2013](https://www.microsoft.com/it-it/download/details.aspx?id=40784) | ||
## Linux | ||
If they are not provided by default in your distribution: | ||
- [build-essential](https://packages.ubuntu.com/xenial/build-essential) to compile the project. | ||
- [GTK+ 3](https://packages.ubuntu.com/source/xenial/gtk+3.0) | ||
## macOS | ||
- [Xcode 8](https://developer.apple.com/xcode/) to compile the project. | ||
# Installation | ||
We had published a first pre-release to npm. | ||
You can now install `libui-node` as a simple dependency in your project: | ||
```bash | ||
@@ -51,22 +58,24 @@ npm install -S libui-node | ||
This is tested with: | ||
If you get this error on Windows: | ||
* Linux 64bit | ||
* Linux 32bit | ||
* Windows 64bit | ||
* macOS | ||
``` | ||
'__pfnDliNotifyHook2': redefinition; different type modifiers | ||
``` | ||
If you get error on windows, check [this node-gyp issue](https://github.com/nodejs/node-gyp/issues/972) | ||
you need to install latest npm version: | ||
```bash | ||
$ npm i -g npm | ||
``` | ||
# Documentation | ||
see [this node-gyp issue](https://github.com/nodejs/node-gyp/issues/972) | ||
for more details. | ||
You can find ongoing documentation in [docs folder](docs). | ||
# Documentation & examples | ||
Please look in [examples folder](https://github.com/parro-it/libui-node/tree/master/examples) for working examples. | ||
Documentation is in [docs folder](docs). | ||
You can also find working examples in [examples folder](https://github.com/parro-it/libui-node/tree/master/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. | ||
## How to run the examples | ||
# Run examples | ||
First, you have to clone the GitHub repo and npm install it: | ||
@@ -91,33 +100,17 @@ | ||
# Project status | ||
To run other examples: | ||
```bash | ||
node <path to example file> | ||
``` | ||
* All current `libui` API, except for [these ones](https://github.com/parro-it/libui-node/issues?q=is%3Aissue+is%3Aopen+label%3A%22Missing+bind%22) 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](https://github.com/parro-it/libui-node/blob/master/examples/utils.js). | ||
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 implementaion 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. | ||
* Each `libui` control implementation is written in it's own C++ file in `src` folder. | ||
* Each control is implemented in it's own C++ class, each class is a simple wrapper of related libui C functions. | ||
* Header files are in `src/includes` folder. | ||
* Control events does not follow `node` convention: if you attach an handler to an event, previous one will be overwritten and never be called. | ||
* We build the project using the awesome [nbind](https://github.com/charto/nbind) tool, that automate the process of linking a straight C++ class to Node.js stuff... | ||
## Useful NPM scripts | ||
# Related projects | ||
* test - run AVA tests && XO linting. | ||
* start - start the control gallery example | ||
* build - rebuild C++ sources | ||
## Related projects | ||
* [libui](https://github.com/andlabs/libui) - Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports. | ||
@@ -124,0 +117,0 @@ * [nbind](https://github.com/charto/nbind) - Magical headers that make your C++ library accessible from JavaScript |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1
116056
130