From 506e453a2f9ac1b3dc993405730f3966f5ac978b Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 10 Nov 2008 15:29:08 +0100 Subject: [PATCH] remove deprecated functions Signed-off-by: Julien Danjou --- CMakeLists.txt | 1 - client.c | 48 ------------------- hooks.c | 16 ------- lib/awful/client.lua.in | 23 --------- lib/awful/init.lua.in | 46 +++++------------- luaa.c | 100 ---------------------------------------- mouse.c | 13 ------ screen.c | 2 - statusbar.c | 51 -------------------- titlebar.c | 27 ----------- widget.c | 25 +--------- 11 files changed, 13 insertions(+), 339 deletions(-) delete mode 100644 statusbar.c diff --git a/CMakeLists.txt b/CMakeLists.txt index b45bff18..7a5bf833 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,6 @@ set(AWE_SRCS ${SOURCE_DIR}/mouse.c ${SOURCE_DIR}/screen.c ${SOURCE_DIR}/stack.c - ${SOURCE_DIR}/statusbar.c ${SOURCE_DIR}/wibox.c ${SOURCE_DIR}/systray.c ${SOURCE_DIR}/tag.c diff --git a/client.c b/client.c index bd7b33c4..abd991ce 100644 --- a/client.c +++ b/client.c @@ -960,36 +960,6 @@ luaA_client_get(lua_State *L) return 1; } -/** Get only visible clients for a screen (DEPRECATED). - * \param L The Lua VM state. - * \return The number of elements pushed on stack. - * \luastack - * \lparam A screen number. - * \lreturn A table with all visible clients for this screen. - */ -static int -luaA_client_visible_get(lua_State *L) -{ - int i = 1; - client_t *c; - int screen = luaL_checknumber(L, 1) - 1; - - luaA_checkscreen(screen); - - deprecate(L, "awful.client.visible()"); - - lua_newtable(L); - - for(c = globalconf.clients; c; c = c->next) - if(client_isvisible(c, screen)) - { - luaA_client_userdata_new(L, c); - lua_rawseti(L, -2, i++); - } - - return 1; -} - /** Check if a client is visible on its screen. * \param L The Lua VM state. * \return The number of elements pushed on stack. @@ -1237,13 +1207,6 @@ luaA_client_geometry(lua_State *L) return luaA_client_handlegeom(L, false); } -static int -luaA_client_coords(lua_State *L) -{ - deprecate(L, "client:geometry()"); - return luaA_client_geometry(L); -} - /** Return client geometry, using also titlebar and border width. * \param L The Lua VM state. * \return The number of elements pushed on stack. @@ -1257,13 +1220,6 @@ luaA_client_fullgeometry(lua_State *L) return luaA_client_handlegeom(L, true); } -static int -luaA_client_fullcoords(lua_State *L) -{ - deprecate(L, "client:fullgeometry()"); - return luaA_client_fullgeometry(L); -} - /** Client newindex. * \param L The Lua VM state. * \return The number of elements pushed on stack. @@ -1634,7 +1590,6 @@ luaA_client_module_newindex(lua_State *L) const struct luaL_reg awesome_client_methods[] = { { "get", luaA_client_get }, - { "visible_get", luaA_client_visible_get }, { "__index", luaA_client_module_index }, { "__newindex", luaA_client_module_newindex }, { NULL, NULL } @@ -1659,9 +1614,6 @@ const struct luaL_reg awesome_client_meta[] = { "__eq", luaA_client_eq }, { "__gc", luaA_client_gc }, { "__tostring", luaA_client_tostring }, - /* deprecated */ - { "coords", luaA_client_coords }, - { "fullcoords", luaA_client_fullcoords }, { NULL, NULL } }; diff --git a/hooks.c b/hooks.c index 0da2c475..6a8333f9 100644 --- a/hooks.c +++ b/hooks.c @@ -88,20 +88,6 @@ luaA_hooks_mouse_enter(lua_State *L) return luaA_registerfct(L, 1, &globalconf.hooks.mouse_enter); } -/** Set the function called each time the mouse enter a new window. This - * function is called with the client object as argument. (DEPRECATED) - * \param L The Lua VM state. - * \return The number of elements pushed on stack. - * \luastack - * \lparam A function to call each time a client gets mouse over it. - */ -static int -luaA_hooks_mouseover(lua_State *L) -{ - deprecate(L, "mouse_enter hook"); - return luaA_hooks_mouse_enter(L); -} - /** Set the function called on each client list change. * This function is called without any argument. * \param L The Lua VM state. @@ -201,7 +187,5 @@ const struct luaL_reg awesome_hooks_lib[] = { "tags", luaA_hooks_tags }, { "tagged", luaA_hooks_tagged }, { "timer", luaA_hooks_timer }, - /* deprecated */ - { "mouseover", luaA_hooks_mouseover }, { NULL, NULL } }; diff --git a/lib/awful/client.lua.in b/lib/awful/client.lua.in index 155633a7..3a516937 100644 --- a/lib/awful/client.lua.in +++ b/lib/awful/client.lua.in @@ -309,16 +309,6 @@ function focus.bydirection(dir, c) end end -function focusbydirection(dir, c) - util.deprecate("focus.bydirection()") - return focus.bydirection(dir, c) -end - -function focusbyidx(i, c) - util.deprecate("focus.byidx()") - return focus.byidx(i, c) -end - --- Focus a client by its relative index. -- @param i The index. -- @param c Optional client. @@ -355,13 +345,6 @@ function swap.byidx(i, c) end end --- Compatibility -local function __swap(self, i, c) - util.deprecate("swap.byidx()") - swap.byidx(i, c) -end -setmetatable(swap, { __call = __swap }) - --- Get the master window. -- @param screen Optional screen number, otherwise screen mouse is used. -- @return The master window. @@ -370,12 +353,6 @@ function getmaster(screen) return visible(s)[1] end ---- Get the master window, deprecated, see getmaster(). -function master(screen) - util.deprecate("getmaster()") - return getmaster(screen) -end - --- Set the client as slave: put it at the end of other windows. -- @param c The window to set as slave. function setslave(c) diff --git a/lib/awful/init.lua.in b/lib/awful/init.lua.in index 414f3373..e052113b 100644 --- a/lib/awful/init.lua.in +++ b/lib/awful/init.lua.in @@ -4,42 +4,20 @@ -- @release @AWESOME_VERSION@ --------------------------------------------------------------------------- -local client = require("awful.client") -local completion = require("awful.completion") -local hooks = require("awful.hooks") -local layout = require("awful.layout") -local placement = require("awful.placement") -local prompt = require("awful.prompt") -local screen = require("awful.screen") -local tag = require("awful.tag") -local titlebar = require("awful.titlebar") -local util = require("awful.util") -local widget = require("awful.widget") -local menu = require("awful.menu") - -local ipairs = ipairs -local unpack = unpack +require("awful.client") +require("awful.completion") +require("awful.hooks") +require("awful.layout") +require("awful.placement") +require("awful.prompt") +require("awful.screen") +require("awful.tag") +require("awful.titlebar") +require("awful.util") +require("awful.widget") +require("awful.menu") --- AWesome Functions very UsefuL module("awful") -local deprecated_functions = -{ - "color_strip_alpha", - "cycle", - "mkdir", - "spawn", - "pread", - "eval", - "escape", - "unescape" -} - -for k, v in ipairs(deprecated_functions) do - _M[v] = function (...) - util.deprecate("awful.util functions") - util[v](unpack(arg)) - end -end - -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/luaa.c b/luaa.c index 8db9925f..50a92803 100644 --- a/luaa.c +++ b/luaa.c @@ -47,7 +47,6 @@ #include "client.h" #include "screen.h" #include "event.h" -#include "titlebar.h" #include "mouse.h" #include "layouts/tile.h" #include "common/socket.h" @@ -67,14 +66,10 @@ extern const struct luaL_reg awesome_screen_methods[]; extern const struct luaL_reg awesome_screen_meta[]; extern const struct luaL_reg awesome_client_methods[]; extern const struct luaL_reg awesome_client_meta[]; -extern const struct luaL_reg awesome_titlebar_methods[]; -extern const struct luaL_reg awesome_titlebar_meta[]; extern const struct luaL_reg awesome_tag_methods[]; extern const struct luaL_reg awesome_tag_meta[]; extern const struct luaL_reg awesome_widget_methods[]; extern const struct luaL_reg awesome_widget_meta[]; -extern const struct luaL_reg awesome_statusbar_methods[]; -extern const struct luaL_reg awesome_statusbar_meta[]; extern const struct luaL_reg awesome_wibox_methods[]; extern const struct luaL_reg awesome_wibox_meta[]; extern const struct luaL_reg awesome_keybinding_methods[]; @@ -143,81 +138,6 @@ luaA_restart(lua_State *L __attribute__ ((unused))) return 0; } -/** Set default font. (DEPRECATED) - * \param L The Lua VM state. - * \return The number of elements pushed on stack. - * \luastack - * \lparam A string with a font name in Pango format. - */ -static int -luaA_font_set(lua_State *L) -{ - deprecate(L, "awesome.font attribute"); - if(lua_gettop(L) == 1) - { - const char *newfont = luaL_checkstring(L, 1); - draw_font_delete(&globalconf.font); - globalconf.font = draw_font_new(newfont); - } - - char *font = pango_font_description_to_string(globalconf.font->desc); - lua_pushstring(L, font); - g_free(font); - return 0; -} - -/** Set default colors (DEPRECATED). - * \param L The Lua VM state. - * \return The number of elements pushed on stack. - * \luastack - * \lparam A table with `fg' and `bg' elements, containing colors. - * \lreturn A table with `fg' and `bg' elements, containing colors. - */ -static int -luaA_colors(lua_State *L) -{ - deprecate(L, "awesome.fg and awesome.bg attributes"); - if(lua_gettop(L) == 1) - { - const char *buf; - size_t len; - int8_t colors_nbr = -1, i; - xcolor_init_request_t reqs[2]; - - luaA_checktable(L, 1); - - if((buf = luaA_getopt_lstring(L, 1, "fg", NULL, &len))) - reqs[++colors_nbr] = xcolor_init_unchecked(&globalconf.colors.fg, buf, len); - - if((buf = luaA_getopt_lstring(L, 1, "bg", NULL, &len))) - reqs[++colors_nbr] = xcolor_init_unchecked(&globalconf.colors.bg, buf, len); - - for(i = 0; i <= colors_nbr; i++) - xcolor_init_reply(reqs[i]); - } - - lua_newtable(L); - luaA_pushcolor(L, &globalconf.colors.fg); - lua_setfield(L, -2, "fg"); - luaA_pushcolor(L, &globalconf.colors.bg); - lua_setfield(L, -2, "bg"); - - return 1; -} - -/** Set default colors. (DEPRECATED) - * \param L The Lua VM state. - * \return The number of elements pushed on stack. - * - * \luastack - * \lparam A table with `fg' and `bg' elements, containing colors. - */ -static int -luaA_colors_set(lua_State *L) -{ - return luaA_colors(L); -} - static void luaA_openlib(lua_State *L, const char *name, const struct luaL_reg methods[], @@ -726,15 +646,6 @@ luaA_spawn(lua_State *L) return 0; } -/** Deprecated function, does nothing. - */ -static int -luaA_mouse_add(lua_State *L) -{ - deprecate(L, "awesome.buttons()"); - return 0; -} - /** awesome global table. * \param L The Lua VM state. * \return The number of elements pushed on stack. @@ -838,13 +749,8 @@ luaA_init(void) { "spawn", luaA_spawn }, { "restart", luaA_restart }, { "buttons", luaA_buttons }, - { "font_set", luaA_font_set }, - { "colors_set", luaA_colors_set }, - { "colors", luaA_colors }, { "__index", luaA_awesome_index }, { "__newindex", luaA_awesome_newindex }, - /* deprecated */ - { "mouse_add", luaA_mouse_add }, { NULL, NULL } }; @@ -881,9 +787,6 @@ luaA_init(void) /* Export tag */ luaA_openlib(L, "tag", awesome_tag_methods, awesome_tag_meta); - /* Export statusbar */ - luaA_openlib(L, "statusbar", awesome_statusbar_methods, awesome_statusbar_meta); - /* Export wibox */ luaA_openlib(L, "wibox", awesome_wibox_methods, awesome_wibox_meta); @@ -893,9 +796,6 @@ luaA_init(void) /* Export client */ luaA_openlib(L, "client", awesome_client_methods, awesome_client_meta); - /* Export titlebar */ - luaA_openlib(L, "titlebar", awesome_titlebar_methods, awesome_titlebar_meta); - /* Export keys */ luaA_openlib(L, "keybinding", awesome_keybinding_methods, awesome_keybinding_meta); diff --git a/mouse.c b/mouse.c index b7699661..c7a85b21 100644 --- a/mouse.c +++ b/mouse.c @@ -1372,21 +1372,8 @@ luaA_mouse_coords(lua_State *L) return 1; } -/** Deprecated - * \param L The Lua VM state. - * \return The number of elements pushed on stack. - */ -static int -luaA_mouse_new(lua_State *L) -{ - deprecate(L, "button()"); - return luaA_button_new(L); -} - const struct luaL_reg awesome_mouse_methods[] = { - /* deprecated */ - { "__call", luaA_mouse_new }, { "__index", luaA_mouse_index }, { "__newindex", luaA_mouse_newindex }, { "coords", luaA_mouse_coords }, diff --git a/screen.c b/screen.c index 45a78d12..ead968b5 100644 --- a/screen.c +++ b/screen.c @@ -501,8 +501,6 @@ luaA_screen_index(lua_State *L) switch(a_tokenize(buf, len)) { - case A_TK_COORDS: - deprecate(L, "geometry attribute"); case A_TK_GEOMETRY: luaA_pusharea(L, s->geometry); break; diff --git a/statusbar.c b/statusbar.c deleted file mode 100644 index 5102d2f4..00000000 --- a/statusbar.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * statusbar.c - statusbar functions - * - * Copyright © 2007-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 "luaa.h" -#include "wibox.h" - -/** Create a new statusbar (DEPRECATED). - * \param L The Lua VM state. - * - * \luastack - * \lparam A table with optionaly defined values: - * position, align, fg, bg, width and height. - * \lreturn A brand new statusbar. - */ -static int -luaA_statusbar_new(lua_State *L) -{ - deprecate(L, "wibox"); - - return luaA_wibox_new(L); -} - -const struct luaL_reg awesome_statusbar_methods[] = -{ - { "__call", luaA_statusbar_new }, - { NULL, NULL } -}; -const struct luaL_reg awesome_statusbar_meta[] = -{ - { NULL, NULL }, -}; - -// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/titlebar.c b/titlebar.c index 9bba1b8d..15253a51 100644 --- a/titlebar.c +++ b/titlebar.c @@ -145,23 +145,6 @@ titlebar_geometry_compute(client_t *c, area_t geometry, area_t *res) } } -/** Create a new titlebar (DEPRECATED). - * \param L The Lua VM state. - * \return The number of value pushed. - * - * \luastack - * \lparam A table with values: align, position, fg, bg, border_width, - * border_color, width and height. - * \lreturn A brand new titlebar. - */ -static int -luaA_titlebar_new(lua_State *L) -{ - deprecate(L, "wibox"); - - return luaA_wibox_new(L); -} - /** Detach a wibox titlebar from its client. * \param c The client. */ @@ -351,14 +334,4 @@ luaA_titlebar_newindex(lua_State *L, wibox_t *titlebar, awesome_token_t tok) return 0; } -const struct luaL_reg awesome_titlebar_methods[] = -{ - { "__call", luaA_titlebar_new }, - { NULL, NULL } -}; -const struct luaL_reg awesome_titlebar_meta[] = -{ - { NULL, NULL } -}; - // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/widget.c b/widget.c index d25fc750..ac712330 100644 --- a/widget.c +++ b/widget.c @@ -361,17 +361,6 @@ widget_invalidate_bywidget(widget_t *widget) } } -/** Deprecated function to add mouse bindings. - * \param L The Lua VM state. - * \return The number of elements pushed on stack. - */ -static int -luaA_widget_mouse_add(lua_State *L) -{ - deprecate(L, "widget:buttons()"); - return 0; -} - /** Create a new widget. * \param L The Lua VM state. * @@ -398,18 +387,7 @@ luaA_widget_new(lua_State *L) type = luaA_getopt_string(L, 2, "type", NULL); - /* deprecated, compatibility code */ - if(!a_strcmp(type, "tasklist") - || !a_strcmp(type, "taglist")) - { - deprecate(L, "awful.widget.tasklist and awful.widget.taglist"); - luaA_warn(L, "requesting old widgets, return a table to allow smooth execution.\n"); - lua_newtable(L); - lua_pushcfunction(L, luaA_widget_mouse_add); - lua_setfield(L, -2, "mouse_add"); - return 1; - } - else if((wc = name_func_lookup(type, WidgetList))) + if((wc = name_func_lookup(type, WidgetList))) w = wc(align); else { @@ -542,7 +520,6 @@ const struct luaL_reg awesome_widget_methods[] = const struct luaL_reg awesome_widget_meta[] = { { "buttons", luaA_widget_buttons }, - { "mouse_add", luaA_widget_mouse_add }, { "__index", luaA_widget_index }, { "__newindex", luaA_widget_newindex }, { "__gc", luaA_widget_gc },