1wofi-widget-builder(3) Library Functions Manual wofi-widget-builder(3)
2
3
4
6 wofi - Widget builder API functions
7
8
10 The functions documented here are used for building custom widgets with
11 more power and flexibility than previously allowed. They are defined in
12 wofi_widget_builder_api.h
13
14
15 struct widget_builder* wofi_widget_builder_init(struct mode* mode,
16 size_t actions)
17 Creates multiple widget builders. The number of builders created
18 is specified by actions and is returned as an array.
19
20 struct mode* mode - The struct mode* given to your mode's init()
21 function.
22
23 size_t actions - The number of builders to create
24
25
26 void wofi_widget_builder_set_search_text(struct widget_builder*
27 builder, char* search_text)
28 Sets the search text for the widget specified by the builder
29
30 struct widget_builder* builder - The builder that contains the
31 widget to set the search text for
32
33 char* search_text - The text to set as the search text
34
35
36 void wofi_widget_builder_set_action(struct widget_builder* builder,
37 char* action)
38 Sets the action for the widget specified by the builder
39
40 struct widget_builder* builder - The builder that contains the
41 widget to set the action for
42
43 char* action - The text to set as the action
44
45
46 void wofi_widget_builder_insert_text(struct widget_builder* builder,
47 char* text, ...)
48 Inserts text into the widget specified by the builder
49
50 struct widget_builder* builder - The builder that contains the
51 widget to add the text to
52
53 char* text - The text to add to the widget
54
55 ... - The names of the CSS classes for this text. The class
56 that will be assigned is .mode_name-css_name where mode_name is
57 the name of the mode, i.e. drun etc. This should have a NULL
58 sentinel
59
60
61 void wofi_widget_builder_insert_text_with_list(struct widget_builder*
62 builder, char* text, struct wl_list* classes)
63 Inserts text into the widget specified by the builder
64
65 struct widget_builder* builder - The builder that contains the
66 widget to add the text to
67
68 char* text - The text to add to the widget
69
70 struct wl_list* classes - The names of the CSS classes for this
71 text. The class that will be assigned is .mode_name-css_name
72 where mode_name is the name of the mode, i.e. drun etc. This
73 list should contain struct css_class nodes.
74
75
76 void wofi_widget_builder_insert_image(struct widget_builder* builder,
77 GdkPixbuf* pixbuf, ...)
78 Inserts an image into the widget specified by the builder
79
80 struct widget_builder* builder - The builder that contains the
81 widget to add the image to
82
83 GdkPixbuf* pixbuf - The image to add to the widget
84
85 ... - The names of the CSS classes for this image. The class
86 that will be assigned is .mode_name-css_name where mode_name is
87 the name of the mode, i.e. drun etc. This should have a NULL
88 sentinel
89
90
91 void wofi_widget_builder_insert_image_with_list(struct widget_builder*
92 builder, GdkPixbuf* pixbuf, struct wl_list* classes)
93 Inserts an image into the widget specified by the builder
94
95 struct widget_builder* builder - The builder that contains the
96 widget to add the image to
97
98 GdkPixbuf* pixbuf - The image to add to the widget
99
100 struct wl_list* classes - The names of the CSS classes for this
101 image. The class that will be assigned is .mode_name-css_name
102 where mode_name is the name of the mode, i.e. drun etc. This
103 list should contain struct css_class nodes.
104
105
106 struct widget_builder* wofi_widget_builder_get_idx(struct wid‐
107 get_builder* builder, size_t idx)
108 Gets the widget_builder at the provided index in the array
109
110 struct widget_builder* builder - The array of builders to get
111 the builder from
112
113 size_t idx - The index in the array to get
114
115
116 struct widget* wofi_widget_builder_get_widget(struct widget_builder*
117 builder)
118 Constructs a new widget from the specified builder, the widget
119 can be returned by struct widget* get_widget(void)
120
121 struct widget_builder* builder - The builder to construct a wid‐
122 get for
123
124
125 void wofi_widget_builder_free(struct widget_builder* builder)
126 Frees the specified builder
127
128 struct widget_builder* builder - The builder to free
129
130
131
132 wofi-widget-builder(3)