libxputty 0.1
Loading...
Searching...
No Matches
libxputty

A damn tiny abstraction Layer to create cross compatible window/widgets

with cairo surfaces for MSWindows (HWND) and Linux (X11).

build on Linux

Building libxputty on Linux depends on

  • libcairo2-dev
  • libx11-dev

To build the static library (recommended) just run

make

from the top directory. to build it as shared library run

make shared

That will build libxputty as static and as shared library. and

sudo make install

will install them both.

Most common use case is to add libxputty as submodule

to your project and invoke make from your top directory.

build for MSWindows cross compile on Linux

To build libxputty cross compiled on Linux for MSWindows the easiest way is to use

PawPaw

to set up the needed dependencies to build for MSWindows.

The advance of it is that PawPaw builds the dependencies as static libraries

so that the resulting libxputty comes without any external dependencies.

To do so, install wine and the mingw g++ and gcc compiler packages (w64-x86-64, w64-i686)

and clone the repository

git clone https://github.com/DISTRHO/PawPaw

build the windows build environment.

cd PawPaw

./bootstrap-plugins.sh win64

That may take a while, . . .

You need to build the environment only once.

To use the build environment run

source local.env win64

from the PawPaw root directory.

That will export all needed settings to build

MSWindows compatible binaries within this terminal session.

After source the local.env you could cd to libxputty and run

make

to build the static lib for windows.

using build.sh

For using with PawPaw. When you've cloned PawPaw

and have created the windows (win64) build environment you may as well create a

build environment for Linux. The advance of it is that PawPaw

creates static libraries to build libxputty, that means in turn, less external dependency's

for the final application/plugin. To do so, run

./bootstrap-plugins.sh linux

from the PawPaw directory

When done you could simply use build.sh like so

./build.sh windows

./build.sh linux

build.sh will create a sub shell, load the selected build environment and run make in it.

When done, the sub shell will close and there are no external variables loaded

into your main shell.

So you could use your terminal with it's normal environment setup afterwards.

build on MSWindows

setup msys2 shell and install

  • base-devel
  • git
  • make
  • mingw-w64-x86_64-gcc
  • mingw-w64-x86_64-lv2
  • mingw-w64-x86_64-cairo
  • mingw-w64-x86_64-pkgconf
  • pkgconf

then run

make

from the msys2 shell.

Features

  • easy creation of widgets and windows
  • easy handling of multiple windows including multiple widgets
  • easy memory management by the xputty main struct
  • easy to use main struct to handle the lifetime of all widgets and windows
    • Xputty main;
    • main_init(&main);
    • create_windows();
    • main_run(&main);
    • main_quit(&main);
  • easy embedding Windows into other native windows
  • all events been handled by function pointers, thus allow
    • easy connection to event handlers by simply overwriting the defaults with you own handlers
    • implement you own events by add a function pointer and connect to it
    • block free connection between dialog boxes and the main window
  • easy to use x/y adjustments to create your own controller widgets like sliders, knobs, buttons or trackballs
  • double buffered cairo surfaces to enable transparent drawing on child widgets
  • handle child widgets via childlist
  • multiple implemented resizing options
  • a couple of defined Widgets and Dialogs ready to use
  • static linking to create position independent applications

Example

Here is a simple example how to write a basic GUI with libxputty

EXAMPLE

     0BSD 

BSD Zero Clause License