From ad73f24c755e3696acdc3532e1fb3f908ba8e970 Mon Sep 17 00:00:00 2001 From: Scoopta Date: Sat, 11 Jul 2020 16:39:09 -0700 Subject: [PATCH] Renamed widget builder functions to be more consistent with the rest of wofi --- inc/widget_builder_api.h | 4 ++-- man/wofi-widget-builder.3 | 4 ++-- modes/drun.c | 4 ++-- src/widget_builder.c | 4 ++-- src/wofi.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/inc/widget_builder_api.h b/inc/widget_builder_api.h index 75883d4..dd26d33 100644 --- a/inc/widget_builder_api.h +++ b/inc/widget_builder_api.h @@ -24,7 +24,7 @@ #include -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 diff --git a/man/wofi-widget-builder.3 b/man/wofi-widget-builder.3 index 6ae686e..67a3b9c 100644 --- a/man/wofi-widget-builder.3 +++ b/man/wofi-widget-builder.3 @@ -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 diff --git a/modes/drun.c b/modes/drun.c index 217d5d9..13e848d 100644 --- a/modes/drun.c +++ b/modes/drun.c @@ -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; } diff --git a/src/widget_builder.c b/src/widget_builder.c index 1cd1e1d..6fc7b69 100644 --- a/src/widget_builder.c +++ b/src/widget_builder.c @@ -20,7 +20,7 @@ #include #include -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); } diff --git a/src/wofi.c b/src/wofi.c index f02488d..b41d79f 100644 --- a/src/wofi.c +++ b/src/wofi.c @@ -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) {