Commit Graph
4140 Commits
Author SHA1 Message Date
trurl a48dd05549 Generate a distinct FFI module for constants in WINGs C headers. 2026-04-18 20:18:01 -04:00
trurl abd24dd745 Use a sed script instead of a shell script to fix up autogenerated WINGs FFI bindings. 2026-04-18 20:14:52 -04:00
trurl 6097395d45 Create integration tests for WINGs WMPixmap API. 2026-04-17 22:42:31 -04:00
trurl c527a9f007 Spotfix for import path error. 2026-04-14 15:00:49 -04:00
trurl b4a91efedc Port WMColor to Rust. 2026-04-14 13:35:09 -04:00
trurl 49e2a9071d Mirror WMRange into Rust.
This is a simple value type with only a constructor method. We keep duplicate type definitions in C and Rust for now, with the intention of doing something smarter later on.
2026-04-14 13:16:26 -04:00
trurl e71673e46b Get rid of the W_PIXEL macro. 2026-04-14 12:55:51 -04:00
trurl 386e3ca307 Create new wrlib-rs crate for Rust bindings to libwraster. 2026-04-13 16:18:55 -04:00
trurl 36e5eb1bde Delete Cargo.lock which shouldn't be tracked. 2026-04-13 16:18:55 -04:00
trurl 5784b9cbda Eliminate accidentally commited temporary file. 2026-04-12 10:05:02 -04:00
trurl a5908610e9 Fix false positive improper_ctypes warnings for structs that are opaque types from C. 2026-04-12 10:05:02 -04:00
trurl 18e54ecdfc Switch to cdylib for Rust crates.
This avoids duplicate symbol definitions when the same static lib sub-dependency is linked in from multiple direct dependencies.
2026-04-12 09:32:48 -04:00
trurl 01cb6645e0 Eliminate accidentally commited temporary file. 2026-04-12 09:32:48 -04:00
trurl 84510b84b4 Fix false positive improper_ctypes warnings for structs that are opaque types from C. 2026-04-12 09:32:48 -04:00
trurl 2da6de7593 Rewrite WMFontPanel in Rust. 2026-04-06 19:27:30 -04:00
trurl 6c17cc3a12 Add allow(non_snake_case) for WMList and WMButton FFI functions. 2026-04-06 19:27:30 -04:00
trurl c24a199243 Start porting the base WINGs widget type to Rust.
Porting WINGs widgets to Rust will require using some WINGs abstractions. One of them is the base widget type, which is implemented by giving all widgets a common layout (with the first two fields always being the same basic types).
2026-04-06 19:27:30 -04:00
trurl 1ea3c1b8db Reimplement the WMAddListItem macro in Rust.
This was originally a macro in C. We reimplement it as a Rust function.
2026-04-06 19:27:30 -04:00
trurl 39efd22bed Reimplment the WMCreateCommandButton macro in Rust.
This is a macro in C, and it would be helpful to be able to do the same thing in Rust. It is simply ported over as a Rust function.
2026-04-06 19:27:30 -04:00
trurl 52fc9eec43 Clean up bindgen invocation for WINGs somewhat.
This is still a mess, but it's not all in one big line now.

Going forward, commits that need new bindgen functions and types should put them on their own lines. That will make it easier to figure out which commit introduced the use of a given symbol.
2026-04-06 19:27:30 -04:00
trurl d2a42971c8 Name the anonymous enum for WMButton behaviors.
This is needed so that bindgen cann refer to the enum properly when generating a corresponding Rust type.
2026-04-06 19:27:30 -04:00
trurl d02d67ec61 Eliminate accidentally commited temporary file. 2026-04-06 19:27:30 -04:00
trurl b1eca604b2 Fix false positive improper_ctypes warnings for structs that are opaque types from C. 2026-04-06 19:27:30 -04:00
trurl 797ef1ace8 Fix false positive improper_ctypes warnings for structs that are opaque types from C (#27)
This should be simple enough not to need further review. It gets rid of a bunch of warnings about struct fields defined with Rust-only types which are not visible from C.

Reviewed-on: #27
2026-04-05 19:58:39 -04:00
trurl b5e94932c9 Update snapshot test of font panel rendering.
This accounts for a bugfix in array iteration, which had been causing font entries to be duplicated.
2026-03-31 11:20:46 -04:00
trurl efec1e8d1e Fix off-by-one error in WMArray iteration macro behavior 2026-03-31 11:17:36 -04:00
trurl 2aa0b0bf53 Create an integration test for the WMFontPanel widget. 2026-03-26 23:48:29 -04:00
trurl d4c8f986a6 Bump to public insta-image crate. 2026-03-26 23:47:15 -04:00
trurl ec1761f4f3 Utilities for X11 image capture and acceptance testing.
These are put in their own crate so that we can link tests against libwings freely.

Once libwings is entirely rewritten in Rust, we should be able to move these tests back into the wings-rs crate.
2026-03-26 16:59:23 -04:00
trurl 32cf67b012 Fix panic when a handler triggers handler scheduling. 2026-03-07 21:19:00 -05:00
trurl ee28e9d0a2 Drop debugging print that was committed by accident. 2026-03-02 12:22:22 -05:00
trurl e882fd1f13 Make WMCreateCommandButton into a proper function instead of a macro. 2026-03-02 12:18:21 -05:00
trurl eaabf7e20c Fix panic when notification dispatch triggers notification dispatch.
The global `NotificationCenter` is kept behind a mutex, which was locked when notifications were dispatched.

As a result, if notification dispatch triggered dispatch of other notifications, we would fail to unlock the mutex and panic.

This change copies dispatch instructions out from inside the mutex, releases the mutex, and then actually does the dispatch.
2026-03-02 12:12:25 -05:00
trurl 7c7b9aa97c Rewrite WINGs handlers.c in Rust. 2026-02-15 23:15:22 -05:00
trurl 223a64286f Remove WINGs input handlers.
Input handlers date back to early versions of WINGs. They provide
a way to listen for state changes on file descriptors (including
networking sockets) as part of the WINGs event loop.

This functionality is not actually used in the Window Maker source
tree. It may have been more useful in the past, when WINGs provided
a networking socket API. The status quo appears to be that this is
largely dead code. Pumping the X11 event queue is special-cased in
the input handling code, so it can stay in for now.
2026-02-12 12:53:14 -05:00
trurl ce97a3b39f Drop select(2)-based input FD polling.
This is an intermediate step in the process of dropping input FD
polling entirely (except for pumping the X11 event queue).

There is code to use poll(2) instead of select(2) to wait for events
on file descriptors (which includes waiting for events from the X11
event queue). It appears not to have been used in quite some time,
or perhaps never, as it contains a typo (`poll fd` instead of `pollfd`
on its first line).

To reduce code bloat and make source code easier to navigate, it
makes sense to prefer only one of these codepaths.

After correcting this typo, waiting for X11 events appears to work, so
the poll(2)-based code seems to be good enough. Keeping the poll-based
code is vaguely preferable because poll(2) has a slightly better
interface than select(2), and poll(2) has been a standard Unix API
for 30 years.

Since this code is slated to be replaced, the decision to use the
poll(2)-based code here is probably not very important. But future
programmers may want to use this as a branching-off point for switching
to epoll(7) or some other, less-select(2)-like interface.
2026-02-12 12:53:14 -05:00
trurl 5075c877fa Remove WMDeleteTimerWithClientData.
This function requires tracking an explict client data pointer, which it would be preferable not to have in the Rust rewrite.

Removing this function entails tracking timer handlers explicitly, but this is not an undue burden.
2026-02-12 12:53:14 -05:00
trurl fa67563c2b Break out Sendable into its own utility module. 2025-12-20 13:09:32 -05:00
trurl cd711ba52b Restore function prototype for W_ClearNotificationCenter.
This was mistakenly removed when writing wutil-rs/src/notification.rs.
2025-12-20 12:38:29 -05:00
trurl d46810291b Remove unused import. 2025-12-20 12:38:29 -05:00
trurl 7c875284dc Add build-generated files to .gitignore. 2025-12-20 12:35:10 -05:00
trurl 52db12fbf2 Merge pull request 'Merge refactor/wings-rs into refactor/riir' (#13) from refactor/wings-rs into refactor/riir
Reviewed-on: #13
2025-12-15 13:03:10 -05:00
trurl b2481cf657 Name arguments directly instead of aping the Google C++ style guide. 2025-12-15 13:00:00 -05:00
trurl c371e26d05 Add new Rust source files to Makefile.am.
Forgot to do this earlier.
2025-12-15 13:00:00 -05:00
trurl 98421afc38 Rewrite all functions from WINGs wfont.c in Rust.
This starts to establish the structure for an in-place rewrite of WINGs. An
actual redesign of WINGs may follow, but for now there are no plans to alter the
structure of WINGs substantially.
2025-12-15 13:00:00 -05:00
trurl 9e49ed98a2 Make WINGs configuration visible from Rust. 2025-12-15 13:00:00 -05:00
trurl a466f17c35 Fix build order issues by moving wings-rs/ into WINGs/.
Having wings-rs depend on WINGs/WINGs/WINGsP.h was not working very well if all
of WINGs/ had to be built before wings-rs/. Moving wings-rs/ into WINGs/
addresses this.
2025-12-15 13:00:00 -05:00
trurl d33c05ef08 Ignore target dir for nested Cargo subdirs, too. 2025-12-15 13:00:00 -05:00
trurl 79873413db Tweak build so that WINGsP.rs gets generated at the right time. 2025-12-15 13:00:00 -05:00
trurl 57ac6b8178 Put the font and y (ascent) fields of W_Font behind accessors. 2025-12-15 13:00:00 -05:00