Renamed widget builder functions to be more consistent with the rest of wofi

This commit is contained in:
Scoopta 2020-07-11 16:39:09 -07:00
parent 2df1705673
commit ad73f24c75
5 changed files with 9 additions and 9 deletions

View File

@ -24,7 +24,7 @@
#include <gdk-pixbuf/gdk-pixbuf.h> #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); 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); 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 #endif

View File

@ -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 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 .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. Creates multiple widget builders. The number of builders created is specified by actions and is returned as an array.
.B struct mode* mode .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 \- The builder to construct a widget for
.TP .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 Frees the specified builder
.B struct widget_builder* builder .B struct widget_builder* builder

View File

@ -179,9 +179,9 @@ static struct widget_builder* populate_actions(char* file, size_t* text_count) {
++*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)) { if(!populate_widget(file, NULL, builder)) {
wofi_free_widget_builder(builder); wofi_widget_builder_free(builder);
return NULL; return NULL;
} }

View File

@ -20,7 +20,7 @@
#include <wofi.h> #include <wofi.h>
#include <utils.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)); struct widget_builder* builder = calloc(actions, sizeof(struct widget_builder));
for(size_t count = 0; count < actions; ++count) { 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; 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) { if(builder->widget != NULL) {
free(builder->widget); free(builder->widget);
} }

View File

@ -563,7 +563,7 @@ static gboolean _insert_widget(gpointer data) {
} }
if(node->builder != NULL) { if(node->builder != NULL) {
wofi_free_widget_builder(node->builder); wofi_widget_builder_free(node->builder);
} else { } else {
free(node->mode); free(node->mode);
for(size_t count = 0; count < node->action_count; ++count) { for(size_t count = 0; count < node->action_count; ++count) {