Crate rofi_plugin_sys
source ·Expand description
This crate provides raw FFI bindings to Rofi’s C plugin interface,
manually written from the headers in /usr/include/rofi
.
See the examples folder for examples on how to use this crate.
These bindings are raw, unsafe
and very low-level
so if you just want to write a Rofi plugin
you’ll probably want an easier-to-use library instead,
such as rofi-mode.
Set RUSTFLAGS="--cfg rofi_next"
when building
to change the API to use unreleased Rofi features
(as of 2023-10-31).
Items only available when this is turned on will be marked
“Semver-exempt and only available with cfg(rofi_next)
.”
in the documentation.
Re-exports§
Modules§
- Helper utilities.
- Small helper to fetch icons. This makes use of the ‘view’ threadpool.
- States returned by the rofi window.
- Functions related to Rofi’s menu view.
Structs§
- An opaque C type from GLib.
- Structure defining a switcher.
- Indicator what type of mode this is. For now it can be the classic switcher, or also implement a completer.
- Property structure.
- Theme highlight.
- Style of text highlight.
- Internal structure for matching.
- Structure to hold a range.
- Represents the color in a theme.
- Theme media description.
- Theme widget.
- Structure with data to process by each worker thread.
- Bitflags indicating location or gravity of window.
Enums§
- The type of a property.
- Cursor type.
- Theme image
- Style of line.
- Type of orientation.
- Distance unit type.
- Describes the media constraint type.
Constants§
- ABI version to check if loaded plugin is compatible.
- Mode to exit Rofi.
- Mode to skip to the next cycle-able dialog.
- Mode to go to the previous dialog.
- Mode to reload current dialog.
- Mode to reload the dialog and unset user input.
Statics§
- This array maps
PropertyType
to a user-readable name.
Functions§
- Acts on the user interaction. Returns the next mode state.
- Returns a new instance of the mode.
- Destroy the mode.
- Free the resources allocated for this mode.
- Get a string that can be used for completion. It should have no markup.
- Get the name of the mode as it should be presented to the user.
- Returns the string as it should be displayed for the entry and the state of how it should be displayed.
- Returns the icon for the selected line.
- Query the mode for a user display.
- Get the name of the mode.
- Get the number of entries in the mode.
- A helper function for modes: get the private data object.
- Initialize a mode.
- Check if a mode is a valid completer.
- Process the input so it can be used for matching and sorting. This includes removing Pango markup.
- Acts on the user interaction.
- Adds the display-name configuration option for the mode. Should be called once for each mode.
- A helper function for modes: set the private data object.
- Match entry against the set of tokens.
Type Aliases§
- Semver-exempt and only available with
cfg(rofi_next)
. - Handle the user accepting an entry in completion mode. Returns the next action to take.
- Create a new instance of this mode. Free (free) result after use, after using
mode_destroy
. - Destroy the current mode. Still ready to restart.
- Free the switcher.
- Obtains the string to complete.
- Get the string to display for the entry.
- Obtains the icon of the entry if available.
- Message to show in the message bar.
- Get the number of entries to display (unfiltered).
- Initialize the Mode.
- Preprocess the input for sorting.
- Process the result of the user selection.
- Token match for the matching algorithm.