From 26621fd598ee050fee870aba582dcf7f6edba39e Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 28 Apr 2008 12:03:11 +0200 Subject: [PATCH] [emptybox] Remove Signed-off-by: Julien Danjou --- Makefile.am | 1 - common/configopts.c | 20 ------------ widget.h | 1 - widgets/emptybox.c | 74 --------------------------------------------- 4 files changed, 96 deletions(-) delete mode 100644 widgets/emptybox.c diff --git a/Makefile.am b/Makefile.am index c768d0cec..a0ca5c97b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -34,7 +34,6 @@ WIDGETS += widgets/focusicon.c WIDGETS += widgets/progressbar.c WIDGETS += widgets/tasklist.c WIDGETS += widgets/graph.c -WIDGETS += widgets/emptybox.c WIDGETS += widgets/common.c widgets/common.h diff --git a/common/configopts.c b/common/configopts.c index d45d4d643..701ffce72 100644 --- a/common/configopts.c +++ b/common/configopts.c @@ -319,23 +319,6 @@ cfg_opt_t widget_textbox_opts[] = CFG_ALIGNMENT((char *) "text_align", (char *) "center", CFGF_NONE), CFG_AWESOME_END() }; -/** This section defines emptybox widget options. */ -cfg_opt_t widget_emptybox_opts[] = -{ - /** X coordinate, do not set for auto. */ - CFG_INT((char *) "x", 0xffffffff, CFGF_NONE), - /** Y coordinate, do not set for auto. */ - CFG_INT((char *) "y", 0xffffffff, CFGF_NONE), - /** Widget alignment. */ - CFG_ALIGNMENT((char *) "align", (char *) "auto", CFGF_NONE), - /** Mouse bindings. */ - CFG_SEC((char *) "mouse", mouse_generic_opts, CFGF_MULTI), - /** Widget width. Set to 0 for auto. */ - CFG_INT((char *) "width", 0, CFGF_NONE), - /** Style to use for drawing. */ - CFG_SEC((char *) "style", style_opts, CFGF_NONE), - CFG_AWESOME_END() -}; /** This section defines tasklist widget options */ cfg_opt_t widget_tasklist_opts[] = { @@ -460,8 +443,6 @@ cfg_opt_t statusbar_opts[] = CFG_INT((char *) "width", 0, CFGF_NONE), /** Textbox widget(s). */ CFG_SEC((char *) "textbox", widget_textbox_opts, CFGF_TITLE | CFGF_MULTI | CFGF_NO_TITLE_DUPES), - /** Emptybox widget(s). */ - CFG_SEC((char *) "emptybox", widget_emptybox_opts, CFGF_TITLE | CFGF_MULTI | CFGF_NO_TITLE_DUPES), /** Taglist widget(s). */ CFG_SEC((char *) "taglist", widget_taglist_opts, CFGF_TITLE | CFGF_MULTI | CFGF_NO_TITLE_DUPES), /** Layoutinfo widget(s). */ @@ -748,7 +729,6 @@ cfg_new(void) cfg_set_validate_func(cfg, "rules|rule|titlebar|height", config_validate_unsigned_int); cfg_set_validate_func(cfg, "rules|rule|screen", config_validate_unsigned_int); cfg_set_validate_func(cfg, "screen|statusbar|textbox|width", config_validate_unsigned_int); - cfg_set_validate_func(cfg, "screen|statusbar|emptybox|width", config_validate_unsigned_int); cfg_set_validate_func(cfg, "screen|statusbar|graph|width", config_validate_unsigned_int); cfg_set_validate_func(cfg, "screen|statusbar|progressbar|width", config_validate_unsigned_int); cfg_set_validate_func(cfg, "screen|statusbar|progressbar|border_width", config_validate_unsigned_int); diff --git a/widget.h b/widget.h index 3cf03629b..9e939f6fb 100644 --- a/widget.h +++ b/widget.h @@ -42,7 +42,6 @@ void widget_common_new(widget_t*, statusbar_t *, cfg_t *); WidgetConstructor layoutinfo_new; WidgetConstructor taglist_new; WidgetConstructor textbox_new; -WidgetConstructor emptybox_new; WidgetConstructor iconbox_new; WidgetConstructor focusicon_new; WidgetConstructor progressbar_new; diff --git a/widgets/emptybox.c b/widgets/emptybox.c deleted file mode 100644 index b3d704e6b..000000000 --- a/widgets/emptybox.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - * emptybox.c - empty widget - * - * Copyright © 2008 Julien Danjou - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - */ - -#include "widget.h" -#include "common/configopts.h" - -extern AwesomeConf globalconf; - -typedef struct -{ - style_t style; -} Data; - -static int -emptybox_draw(widget_t *widget, DrawCtx *ctx, int offset, - int used __attribute__ ((unused))) -{ - Data *d = widget->data; - - if(!widget->user_supplied_x) - widget->area.x = widget_calculate_offset(widget->statusbar->width, - widget->area.width, - offset, - widget->alignment); - if(!widget->user_supplied_y) - widget->area.y = 0; - - draw_rectangle(ctx, widget->area, 1.0, true, d->style.bg); - - return widget->area.width; -} - -widget_t * -emptybox_new(statusbar_t *statusbar, cfg_t *config) -{ - widget_t *w; - Data *d; - - w = p_new(widget_t, 1); - widget_common_new(w, statusbar, config); - w->draw = emptybox_draw; - w->alignment = cfg_getalignment(config, "align"); - - w->data = d = p_new(Data, 1); - - draw_style_init(globalconf.connection, statusbar->phys_screen, - cfg_getsec(config, "style"), - &d->style, - &globalconf.screens[statusbar->screen].styles.normal); - - w->area.width = cfg_getint(config, "width"); - w->area.height = statusbar->height; - - return w; -} -// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80