-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathwidget-empty.c
37 lines (31 loc) · 1.01 KB
/
widget-empty.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "builtin-widgets.h"
static int create_widget_private(struct widget *w, struct config_format_entry *e,
struct config_format_tree *tree);
static void destroy_widget_private(struct widget *w);
struct widget_interface empty_interface = {
.theme_name = "empty",
.size_type = WIDGET_SIZE_CONSTANT,
.create_widget_private = create_widget_private,
.destroy_widget_private = destroy_widget_private
};
/**************************************************************************
Empty interface
**************************************************************************/
static int create_widget_private(struct widget *w, struct config_format_entry *e,
struct config_format_tree *tree)
{
if (!e->value) {
XWARNING("Failed to parse empty widget (width is required)");
return -1;
}
w->width = 0;
if (sscanf(e->value, "%d", &w->width) != 1) {
XWARNING("Failed to parse empty widget width, format is: empty %%d");
return -1;
}
w->private = 0;
return 0;
}
static void destroy_widget_private(struct widget *w)
{
}