Git Product home page Git Product logo

libxputty's Introduction

libxputty

A damn tiny abstraction Layer to create cross compatible window/widgets with cairo surfaces for MSWindows (HWND) and Linux (X11).

This repository contain only the library files to allow easily and lightweight embedding into other projects.

API Documentation is here: Documentation

A simple example is here: EXAMPLE

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

  • full documented API Documentation

  • static linking to create position independent applications

       0BSD 
    

BSD Zero Clause License

libxputty's People

Contributors

brummer10 avatar schnitzeltony avatar nedko avatar nick87720z avatar trebmuh avatar orivej avatar redtide avatar

Stargazers

Sándor Balázs avatar  avatar Lucas Thompson avatar Peter Semiletov avatar moon avatar  avatar  avatar Andrejs Agejevs avatar Thorsten Maerz avatar Bocke avatar  avatar Richard Gill avatar Tatsuya Shiozawa avatar Roland Chastain avatar  avatar  avatar  avatar Billy Messenger avatar  avatar Colin James avatar Dennis Schulmeister-Zimolong avatar Andrew Prentice avatar  avatar Andrew Grathwohl avatar Josef Pospíšil avatar Jérémie Astor avatar Paul Batchelor avatar

Watchers

 avatar James Cloos avatar Dennis Schulmeister-Zimolong avatar  avatar Thorsten Maerz avatar  avatar  avatar  avatar

libxputty's Issues

Makefile: Linking?

Hi Hermann,

me again. I also took a short view to the build process. And I found this:

libxputty/Build/Makefile

Lines 147 to 148 in 10aac63

$(XDG_OBJ): $(XDG_SOURCES)
$(CC) $(CFLAGS) -MMD -Wall -DHAVE_MMAP -c $(addprefix $(XDG_DIR),$(patsubst %.o,%.c,$@)) -o $@ $(INCLUDES) $(LDFLAGS)

On the one hand, you suppress linking using the -c flag. And on the other hand you pass the LDFLAGS. Is it a bug or does it make sense? Please apologize my question, but I'm still having a real struggle with linking at all.

Viele Grüße
Sven

Fails to build with glibc 2.38 and `-Werror=format-security`

When building mamba 2.5 with libxputty at 62ec1cf and with gcc 12.3 (with -Werror=format-security) and glibc 2.38, the build fails like this:

../xputty/xfilepicker.c:225:5: error: format not a string literal and no format arguments [-Werror=format-security]
  225 |     asprintf(&filepicker->path, path);
      |     ^~~~~~~~

The full log is available at https://hydra.nixos.org/build/230518081.

I guess this popped up now because asprintf and friends is in glibc 2.38 available by default and because of that, the format warning is actually triggered on said function.

Anyways, while it's indeed a workaround to switch to -Wno-error, I think it's still reasonable to fix that warning properly in the code.

widget_get_png_from_file

Hi Hermann,

finally I found some time (which I don't have got ;-)) to take a closer look to libxputty. Some smart solutions and it looks really efficient for low complexity UIs. And I'm going to use it in two of my next tutorial videos (in April 2023).

However, I initially struggled to load a .png image file (I mean the file, not converted to .c and hard compiled) and to visualize it. You created widget_get_png (Widget_t *w, const unsigned char* name), which looks like doing this job. However, it expects a data stream for name and not the filename. A bit confusing ;-). And there are a lot of similar methods in xpngloader.h, but all expect img data for name instead of a filename.

On the other hand, there is a widget_get_svg (Widget_t *w, const char* name) in xsvgloader.h doing exactly what I expect. name is the filename there.

Therefore my feature request: Add a png loading function from a .png file. Like widget_get_png_from_file (Widget_t *w, const char* name) to not break the API. And it would be nice to rename the parameter name for the png stream-accepting widget_get... functions to data or stream or ... . Just for more clearness.

Viele Grüße
Sven

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.