Renamed widget builder functions to be more consistent with the rest of wofi
This commit is contained in:
parent
2df1705673
commit
ad73f24c75
@ -24,7 +24,7 @@
|
||||
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
|
||||
struct widget_builder* wofi_create_widget_builder(struct mode* mode, size_t actions);
|
||||
struct widget_builder* wofi_widget_builder_init(struct mode* mode, size_t actions);
|
||||
|
||||
void wofi_widget_builder_set_search_text(struct widget_builder* builder, char* search_text);
|
||||
|
||||
@ -38,6 +38,6 @@ struct widget_builder* wofi_widget_builder_get_idx(struct widget_builder* builde
|
||||
|
||||
struct widget* wofi_widget_builder_get_widget(struct widget_builder* builder);
|
||||
|
||||
void wofi_free_widget_builder(struct widget_builder* builder);
|
||||
void wofi_widget_builder_free(struct widget_builder* builder);
|
||||
|
||||
#endif
|
||||
|
@ -6,7 +6,7 @@ wofi \- Widget builder API functions
|
||||
The functions documented here are used for building custom widgets with more power and flexibility than previously allowed. They are defined in wofi_widget_builder_api.h
|
||||
|
||||
.TP
|
||||
.B struct widget_builder* wofi_create_widget_builder(struct mode* mode, size_t actions)
|
||||
.B 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.
|
||||
|
||||
.B struct mode* mode
|
||||
@ -79,7 +79,7 @@ Constructs a new widget from the specified builder, the widget can be returned b
|
||||
\- The builder to construct a widget for
|
||||
|
||||
.TP
|
||||
.B void wofi_free_widget_builder(struct widget_builder* builder)
|
||||
.B void wofi_widget_builder_free(struct widget_builder* builder)
|
||||
Frees the specified builder
|
||||
|
||||
.B struct widget_builder* builder
|
||||
|
@ -179,9 +179,9 @@ static struct widget_builder* populate_actions(char* file, size_t* text_count) {
|
||||
++*text_count;
|
||||
|
||||
|
||||
struct widget_builder* builder = wofi_create_widget_builder(mode, *text_count);
|
||||
struct widget_builder* builder = wofi_widget_builder_init(mode, *text_count);
|
||||
if(!populate_widget(file, NULL, builder)) {
|
||||
wofi_free_widget_builder(builder);
|
||||
wofi_widget_builder_free(builder);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <wofi.h>
|
||||
#include <utils.h>
|
||||
|
||||
struct widget_builder* wofi_create_widget_builder(struct mode* mode, size_t actions) {
|
||||
struct widget_builder* wofi_widget_builder_init(struct mode* mode, size_t actions) {
|
||||
struct widget_builder* builder = calloc(actions, sizeof(struct widget_builder));
|
||||
|
||||
for(size_t count = 0; count < actions; ++count) {
|
||||
@ -84,7 +84,7 @@ struct widget* wofi_widget_builder_get_widget(struct widget_builder* builder) {
|
||||
return builder->widget;
|
||||
}
|
||||
|
||||
void wofi_free_widget_builder(struct widget_builder* builder) {
|
||||
void wofi_widget_builder_free(struct widget_builder* builder) {
|
||||
if(builder->widget != NULL) {
|
||||
free(builder->widget);
|
||||
}
|
||||
|
@ -563,7 +563,7 @@ static gboolean _insert_widget(gpointer data) {
|
||||
}
|
||||
|
||||
if(node->builder != NULL) {
|
||||
wofi_free_widget_builder(node->builder);
|
||||
wofi_widget_builder_free(node->builder);
|
||||
} else {
|
||||
free(node->mode);
|
||||
for(size_t count = 0; count < node->action_count; ++count) {
|
||||
|
Loading…
Reference in New Issue
Block a user