wofi-widget-builder(3)

πŸ“¦
version 1.5.3 Β· 2 versions
  • 1.5.3 Β· alpine 3.24, arch rolling, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 1.2.4 Β· ubuntu jammy
, in alpine 3.24, arch rolling, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

🌸 NAME 🌸

wofi β€” Widget builder API functions πŸ’…

(oh and hey, this whole thing lives in the manual as wofi-widget-builder(3), just so you know what page you're on, bestie 🫢)


✨ DESCRIPTION ✨

okay so listen. the functions documented here are for building custom widgets β€” and they give you way more power and flexibility than anything that was allowed before. no cap. they're all defined in wofi_widget_builder_api.h πŸŽ€


🌟 struct widget_builder* wofi_widget_builder_init(struct mode* mode, size_t actions)

Creates multiple widget builders. The number of builders created is specified by actions and is returned as an array. it's giving factory energy fr fr 🏭✨

  • struct mode* mode β€” The struct mode* given to your mode's init() function.
  • size_t actions β€” The number of builders to create

🌟 void wofi_widget_builder_set_search_text(struct widget_builder* builder, char* search_text)

Sets the search text for the widget specified by the builder πŸ”

  • struct widget_builder* builder β€” The builder that contains the widget to set the search text for
  • char* search_text β€” The text to set as the search text

🌟 void wofi_widget_builder_set_action(struct widget_builder* builder, char* action)

Sets the action for the widget specified by the builder ⚑

  • struct widget_builder* builder β€” The builder that contains the widget to set the action for
  • char* action β€” The text to set as the action

🌟 void wofi_widget_builder_insert_text(struct widget_builder* builder, char* text, ...)

Inserts text into the widget specified by the builder πŸ“πŸ’–

  • struct widget_builder* builder β€” The builder that contains the widget to add the text to
  • char* text β€” The text to add to the widget
  • ... β€” The names of the CSS classes for this text. The class that will be assigned is .mode_name-css_name where mode_name is the name of the mode, i.e. drun etc. This should have a NULL sentinel

🌟 void wofi_widget_builder_insert_text_with_list(struct widget_builder* builder, char* text, struct wl_list* classes)

Inserts text into the widget specified by the builder πŸ“πŸ¦‹ (same vibe as the one above, just with a whole list instead of vibes-args)

  • struct widget_builder* builder β€” The builder that contains the widget to add the text to
  • char* text β€” The text to add to the widget
  • struct wl_list* classes β€” The names of the CSS classes for this text. The class that will be assigned is .mode_name-css_name where mode_name is the name of the mode, i.e. drun etc. This list should contain struct css_class nodes.

🌟 void wofi_widget_builder_insert_image(struct widget_builder* builder, GdkPixbuf* pixbuf, ...)

Inserts an image into the widget specified by the builder πŸ–ΌοΈβœ¨

  • struct widget_builder* builder β€” The builder that contains the widget to add the image to
  • GdkPixbuf* pixbuf β€” The image to add to the widget
  • ... β€” The names of the CSS classes for this image. The class that will be assigned is .mode_name-css_name where mode_name is the name of the mode, i.e. drun etc. This should have a NULL sentinel

🌟 void wofi_widget_builder_insert_image_with_list(struct widget_builder* builder, GdkPixbuf* pixbuf, struct wl_list* classes)

Inserts an image into the widget specified by the builder πŸ–ΌοΈπŸŒˆ

  • struct widget_builder* builder β€” The builder that contains the widget to add the image to
  • GdkPixbuf* pixbuf β€” The image to add to the widget
  • struct wl_list* classes β€” The names of the CSS classes for this image. The class that will be assigned is .mode_name-css_name where mode_name is the name of the mode, i.e. drun etc. This list should contain struct css_class nodes.

🌟 struct widget_builder* wofi_widget_builder_get_idx(struct widget_builder* builder, size_t idx)

Gets the widget_builder at the provided index in the array 🎯

  • struct widget_builder* builder β€” The array of builders to get the builder from
  • size_t idx β€” The index in the array to get

🌟 struct widget* wofi_widget_builder_get_widget(struct widget_builder* builder)

Constructs a new widget from the specified builder β€” the widget can be returned by struct widget* get_widget(void) πŸ‘‘

  • struct widget_builder* builder β€” The builder to construct a widget for

🌟 void wofi_widget_builder_free(struct widget_builder* builder)

Frees the specified builder 🧹 (be a good citizen, bestie, free your builders)

  • struct widget_builder* builder β€” The builder to free

and that's the whole page, periodt πŸ’œ this was the wofi-widget-builder(3) page from the Library Functions Manual β€” go build something iconic with it, you're literally the main character of your own widget tree πŸŒˆπŸ‘‘βœ¨