lua: move padding to screen

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-07-01 22:37:35 +02:00
parent 16bc2a8de8
commit 1437f68ae1
1 changed files with 9 additions and 10 deletions

9
lua.c
View File

@ -144,19 +144,18 @@ luaA_restart(lua_State *L __attribute__ ((unused)))
* `bottom'. * `bottom'.
*/ */
static int static int
luaA_padding_set(lua_State *L) luaA_screen_padding_set(lua_State *L)
{ {
int screen = luaL_checknumber(L, 1) - 1; int screen = luaL_checknumber(L, 1) - 1;
if(screen >= 0 && screen < globalconf.screens_info->nscreen) luaA_checkscreen(screen);
{
luaA_checktable(L, 2); luaA_checktable(L, 2);
globalconf.screens[screen].padding.right = luaA_getopt_number(L, 2, "right", 0); globalconf.screens[screen].padding.right = luaA_getopt_number(L, 2, "right", 0);
globalconf.screens[screen].padding.left = luaA_getopt_number(L, 2, "left", 0); globalconf.screens[screen].padding.left = luaA_getopt_number(L, 2, "left", 0);
globalconf.screens[screen].padding.top = luaA_getopt_number(L, 2, "top", 0); globalconf.screens[screen].padding.top = luaA_getopt_number(L, 2, "top", 0);
globalconf.screens[screen].padding.bottom = luaA_getopt_number(L, 2, "bottom", 0); globalconf.screens[screen].padding.bottom = luaA_getopt_number(L, 2, "bottom", 0);
}
ewmh_update_workarea(screen_virttophys(screen)); ewmh_update_workarea(screen_virttophys(screen));
@ -479,7 +478,6 @@ luaA_init(void)
{ "quit", luaA_quit }, { "quit", luaA_quit },
{ "exec", luaA_exec }, { "exec", luaA_exec },
{ "restart", luaA_restart }, { "restart", luaA_restart },
{ "padding_set", luaA_padding_set },
{ "mouse_add", luaA_mouse_add }, { "mouse_add", luaA_mouse_add },
{ "font_set", luaA_font_set }, { "font_set", luaA_font_set },
{ "colors_set", luaA_colors_set }, { "colors_set", luaA_colors_set },
@ -487,6 +485,7 @@ luaA_init(void)
}; };
static const struct luaL_reg awesome_screen_lib[] = static const struct luaL_reg awesome_screen_lib[] =
{ {
{ "padding_set", luaA_screen_padding_set },
{ "coords_get", luaA_screen_coords_get }, { "coords_get", luaA_screen_coords_get },
{ "count", luaA_screen_count }, { "count", luaA_screen_count },
{ "focus", luaA_screen_focus }, { "focus", luaA_screen_focus },