Xputty - damn tiny abstraction Layer to create X11 window/widgets with cairo surfaces

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Xputty - damn tiny abstraction Layer to create X11 window/widgets with cairo surfaces

Hermann Meyer

For creating LV2 UI's I end up more and more writing the same code, so I decided to wrote a Layer for it.
It's supposed to create, manage, draw, and destroy X11 widgets with a cairo surface to draw.
Additional to subscribe to and handle events.

I decided to put it in the Public Domain, so everyone could do what ever he /she want's with it.

The repository contain a example folder showing some of the features supported by the layer.
It's a tiny, but powerful abstraction of the X11 low level API to easier the process to create nice GUI's.
Documentation is included in the source code, it's a single header and a single c file.
All together just 654 lines, were most lines taken by documentation.

So, here you go:
https://github.com/brummer10/Xputty


_______________________________________________
Linux-audio-dev mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-dev
Reply | Threaded
Open this post in threaded view
|

Re: Xputty - damn tiny abstraction Layer to create X11 window/widgets with cairo surfaces

SxDx
Dear Hermann,

let me use your announcement to try sending an email to
the LAD list. Seems like free.fr is now "whitelisted" for LAD,
which allows me to salute your work! Let's make writing
basic and simple software great again! :)

Regards,
Cédric.
 
On 7/16/19 1:48 PM, Hermann Meyer wrote:

> For creating LV2 UI's I end up more and more writing the same code, so I decided to wrote a Layer for it.
> It's supposed to create, manage, draw, and destroy X11 widgets with a cairo surface to draw.
> Additional to subscribe to and handle events.
>
> I decided to put it in the Public Domain, so everyone could do what ever he /she want's with it.
>
> The repository contain a example folder showing some of the features supported by the layer.
> It's a tiny, but powerful abstraction of the X11 low level API to easier the process to create nice GUI's.
> Documentation is included in the source code, it's a single header and a single c file.
> All together just 654 lines, were most lines taken by documentation.
>
> So, here you go:
> https://github.com/brummer10/Xputty
>
>
> _______________________________________________
> Linux-audio-dev mailing list
> [hidden email]
> https://lists.linuxaudio.org/listinfo/linux-audio-dev
>
_______________________________________________
Linux-audio-dev mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-dev
Reply | Threaded
Open this post in threaded view
|

Re: Xputty - damn tiny abstraction Layer to create X11 window/widgets with cairo surfaces

Hermann Meyer
Hi Cédric

Well, I must admit that it is grown already a bit, and still is work in
progress.

Things have changed and it is no longer a single header. I've
implemented widgets to be transparent, usage of adjustments and
currently working on proper scaling support modes.

My goal is to implement it as simple as possible, so, that just a
setting is required to decide how a widget is presented on screen, but
allow as well to fine tune anything more deep.

However, I've setup a online Documentation for libxputty here:

https://brummer10.github.io/Xputty/html/xputty_8h.html

regards

hermann


Am 20.07.19 um 13:03 schrieb Cedric Roux:

> Dear Hermann,
>
> let me use your announcement to try sending an email to
> the LAD list. Seems like free.fr is now "whitelisted" for LAD,
> which allows me to salute your work! Let's make writing
> basic and simple software great again! :)
>
> Regards,
> Cédric.
>
> On 7/16/19 1:48 PM, Hermann Meyer wrote:
>> For creating LV2 UI's I end up more and more writing the same code, so I decided to wrote a Layer for it.
>> It's supposed to create, manage, draw, and destroy X11 widgets with a cairo surface to draw.
>> Additional to subscribe to and handle events.
>>
>> I decided to put it in the Public Domain, so everyone could do what ever he /she want's with it.
>>
>> The repository contain a example folder showing some of the features supported by the layer.
>> It's a tiny, but powerful abstraction of the X11 low level API to easier the process to create nice GUI's.
>> Documentation is included in the source code, it's a single header and a single c file.
>> All together just 654 lines, were most lines taken by documentation.
>>
>> So, here you go:
>> https://github.com/brummer10/Xputty
>>
>>
>>
_______________________________________________
Linux-audio-dev mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-dev
Reply | Threaded
Open this post in threaded view
|

Re: Xputty - damn tiny abstraction Layer to create X11 window/widgets with cairo surfaces

Will J Godfrey
On Sat, 20 Jul 2019 17:24:47 +0200
Hermann Meyer <[hidden email]> wrote:

>However, I've setup a online Documentation for libxputty here:
>
>https://brummer10.github.io/Xputty/html/xputty_8h.html
>
>regards
>
>hermann

And *that* is the best news of the lot!
So many projects have little or no documentation until they are a very long way
into development.

--
It wasn't me! (Well actually, it probably was)

... the hard part is not dodging what life throws at you,
but trying to catch the good bits.
_______________________________________________
Linux-audio-dev mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-dev
Reply | Threaded
Open this post in threaded view
|

Re: Xputty - damn tiny abstraction Layer to create X11 window/widgets with cairo surfaces

Hermann Meyer

Am 20.07.19 um 21:35 schrieb Will J Godfrey:

> On Sat, 20 Jul 2019 17:24:47 +0200
> Hermann Meyer <[hidden email]> wrote:
>
>> However, I've setup a online Documentation for libxputty here:
>>
>> https://brummer10.github.io/Xputty/html/xputty_8h.html
>>
>> regards
>>
>> hermann
> And *that* is the best news of the lot!
> So many projects have little or no documentation until they are a very long way
> into development.
>

Yea, I've made the experience that I never ever do any documentation
"afterwards". So this time I would do it from the beginning on. At least
it helps as well myself, to not forgot what it is about.

However, today I make a big step regarding transparent widgets. Those
who've done any development with X11 and cairo knows that it could be
tricky.

Today I find out that the big difference is to NOT USE 
cairo_image_surface_create. Avoid it. When working in a X11 context, the
way to go is cairo_surface_create_similar on the xlib surface as buffer.
This avoid unnecessary coping the image data from the graphic server to
CPU and back. The CPU footprint boils down to below 2% on full screen
action here. Even on resize action, when the surfaces needs to be
resized/destroyed and new created.

Before this change CPU could reach 80% and more and the desktop starts
to stutter.
_______________________________________________
Linux-audio-dev mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-dev
Reply | Threaded
Open this post in threaded view
|

Re: Xputty - damn tiny abstraction Layer to create X11 window/widgets with cairo surfaces

Hermann Meyer

Am 21.07.19 um 16:25 schrieb Hermann Meyer:

>
> Am 20.07.19 um 21:35 schrieb Will J Godfrey:
>> On Sat, 20 Jul 2019 17:24:47 +0200
>> Hermann Meyer <[hidden email]> wrote:
>>
>>> However, I've setup a online Documentation for libxputty here:
>>>
>>> https://brummer10.github.io/Xputty/html/xputty_8h.html
>>>
>>> regards
>>>
>>> hermann
>> And *that* is the best news of the lot!
>> So many projects have little or no documentation until they are a
>> very long way
>> into development.
>>
>
> Yea, I've made the experience that I never ever do any documentation
> "afterwards". So this time I would do it from the beginning on. At least
> it helps as well myself, to not forgot what it is about.
>
> However, today I make a big step regarding transparent widgets. Those
> who've done any development with X11 and cairo knows that it could be
> tricky.
>
> Today I find out that the big difference is to NOT USE
> cairo_image_surface_create. Avoid it. When working in a X11 context, the
> way to go is cairo_surface_create_similar on the xlib surface as buffer.
> This avoid unnecessary coping the image data from the graphic server to
> CPU and back. The CPU footprint boils down to below 2% on full screen
> action here. Even on resize action, when the surfaces needs to be
> resized/destroyed and new created.
>
> Before this change CPU could reach 80% and more and the desktop starts
> to stutter.
>

. . . and now the first widgets been implemented, like buttons, sliders,
and a knob. Also a theming engine is in place. A example for how to use
it is in the examples folder.
_______________________________________________
Linux-audio-dev mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-dev
Reply | Threaded
Open this post in threaded view
|

Re: Xputty - damn tiny abstraction Layer to create X11 window/widgets with cairo surfaces

Hermann Meyer

Am 28.07.19 um 21:22 schrieb Hermann Meyer:

>
> Am 21.07.19 um 16:25 schrieb Hermann Meyer:
>>
>> Am 20.07.19 um 21:35 schrieb Will J Godfrey:
>>> On Sat, 20 Jul 2019 17:24:47 +0200
>>> Hermann Meyer <[hidden email]> wrote:
>>>
>>>> However, I've setup a online Documentation for libxputty here:
>>>>
>>>> https://brummer10.github.io/Xputty/html/xputty_8h.html
>>>>
>>>> regards
>>>>
>>>> hermann
>>> And *that* is the best news of the lot!
>>> So many projects have little or no documentation until they are a
>>> very long way
>>> into development.
>>>
>>
>> Yea, I've made the experience that I never ever do any documentation
>> "afterwards". So this time I would do it from the beginning on. At least
>> it helps as well myself, to not forgot what it is about.
>>
>> However, today I make a big step regarding transparent widgets. Those
>> who've done any development with X11 and cairo knows that it could be
>> tricky.
>>
>> Today I find out that the big difference is to NOT USE
>> cairo_image_surface_create. Avoid it. When working in a X11 context, the
>> way to go is cairo_surface_create_similar on the xlib surface as buffer.
>> This avoid unnecessary coping the image data from the graphic server to
>> CPU and back. The CPU footprint boils down to below 2% on full screen
>> action here. Even on resize action, when the surfaces needs to be
>> resized/destroyed and new created.
>>
>> Before this change CPU could reach 80% and more and the desktop starts
>> to stutter.
>>
>
> . . . and now the first widgets been implemented, like buttons, sliders,
> and a knob. Also a theming engine is in place. A example for how to use
> it is in the examples folder.
>

In the mean time I've done some more work on this, and added some more
widgets. menus, combo-box, tooltip, label and meter widgets been in
place now. Also I've added a LV2 plugin example which show how easy and
lightweight the creation of a LV2 UI could be.

Yea, and all is documented in the Docs.

https://github.com/brummer10/Xputty

regards

hermann
_______________________________________________
Linux-audio-dev mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-dev
Reply | Threaded
Open this post in threaded view
|

Re: Xputty - damn tiny abstraction Layer to create X11 window/widgets with cairo surfaces

Hermann Meyer

snip:

. . . and now include a example file-browser which demonstrate how to
create a file picker with Xputty to be used in a LV2 UI. also demoing
the dynamic create/destroy of X11 Window's with the help of the
underling Xputty structure.

https://github.com/brummer10/Xputty


Beside, comments are welcome.


regards

hermann
_______________________________________________
Linux-audio-dev mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-dev