Reimplement the WMAddListItem macro in Rust.

This was originally a macro in C. We reimplement it as a Rust function.
This commit is contained in:
2026-04-06 19:27:30 -04:00
parent 39efd22bed
commit 1ea3c1b8db
3 changed files with 16 additions and 0 deletions
+1
View File
@@ -6,6 +6,7 @@ RUST_SOURCES = \
src/configuration.rs \
src/font.rs \
src/lib.rs \
src/list.rs \
src/pango_extras.rs \
src/screen.rs
+1
View File
@@ -6,5 +6,6 @@ pub mod WINGsP;
pub mod button;
pub mod configuration;
pub mod font;
pub mod list;
pub(crate) mod pango_extras;
pub mod screen;
+14
View File
@@ -0,0 +1,14 @@
pub mod ffi {
use crate::WINGsP::*;
use std::ffi::c_char;
/// Appends an item with the label `text` to `list`.
///
/// ## Rust rewrite notes
///
/// This was originally a macro.
pub unsafe fn WMAddListItem(list: *mut WMList, text: *const c_char) -> *mut WMListItem {
unsafe { WMInsertListItem(list, -1, text) }
}
}