color: do not take pointer to push
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
45702de158
commit
ada6056c89
2
client.c
2
client.c
|
@ -1761,7 +1761,7 @@ luaA_client_index(lua_State *L)
|
||||||
lua_pushnumber(L, c->border);
|
lua_pushnumber(L, c->border);
|
||||||
break;
|
break;
|
||||||
case A_TK_BORDER_COLOR:
|
case A_TK_BORDER_COLOR:
|
||||||
luaA_pushxcolor(L, &c->border_color);
|
luaA_pushxcolor(L, c->border_color);
|
||||||
break;
|
break;
|
||||||
case A_TK_TITLEBAR:
|
case A_TK_TITLEBAR:
|
||||||
return wibox_push(L, c->titlebar);
|
return wibox_push(L, c->titlebar);
|
||||||
|
|
10
color.c
10
color.c
|
@ -294,12 +294,12 @@ xcolor_to_color(const xcolor_t *xcol, color_t *col)
|
||||||
* \return The number of elements pushed on stack.
|
* \return The number of elements pushed on stack.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
luaA_pushxcolor(lua_State *L, const xcolor_t *c)
|
luaA_pushxcolor(lua_State *L, const xcolor_t c)
|
||||||
{
|
{
|
||||||
uint8_t r = (unsigned)c->red * 0xff / 0xffff;
|
uint8_t r = (unsigned) c.red * 0xff / 0xffff;
|
||||||
uint8_t g = (unsigned)c->green * 0xff / 0xffff;
|
uint8_t g = (unsigned) c.green * 0xff / 0xffff;
|
||||||
uint8_t b = (unsigned)c->blue * 0xff / 0xffff;
|
uint8_t b = (unsigned) c.blue * 0xff / 0xffff;
|
||||||
uint8_t a = (unsigned)c->alpha * 0xff / 0xffff;
|
uint8_t a = (unsigned) c.alpha * 0xff / 0xffff;
|
||||||
char s[10];
|
char s[10];
|
||||||
int len;
|
int len;
|
||||||
/* do not print alpha if it's full */
|
/* do not print alpha if it's full */
|
||||||
|
|
2
color.h
2
color.h
|
@ -76,7 +76,7 @@ bool xcolor_init_reply(xcolor_init_request_t);
|
||||||
|
|
||||||
bool xcolor_to_color(const xcolor_t *, color_t *);
|
bool xcolor_to_color(const xcolor_t *, color_t *);
|
||||||
|
|
||||||
int luaA_pushxcolor(lua_State *, const xcolor_t *);
|
int luaA_pushxcolor(lua_State *, const xcolor_t);
|
||||||
int luaA_pushcolor(lua_State *, const color_t *);
|
int luaA_pushcolor(lua_State *, const color_t *);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
4
luaa.c
4
luaa.c
|
@ -558,10 +558,10 @@ luaA_awesome_index(lua_State *L)
|
||||||
lua_pushstring(L, globalconf.conffile);
|
lua_pushstring(L, globalconf.conffile);
|
||||||
break;
|
break;
|
||||||
case A_TK_FG:
|
case A_TK_FG:
|
||||||
luaA_pushxcolor(L, &globalconf.colors.fg);
|
luaA_pushxcolor(L, globalconf.colors.fg);
|
||||||
break;
|
break;
|
||||||
case A_TK_BG:
|
case A_TK_BG:
|
||||||
luaA_pushxcolor(L, &globalconf.colors.bg);
|
luaA_pushxcolor(L, globalconf.colors.bg);
|
||||||
break;
|
break;
|
||||||
case A_TK_VERSION:
|
case A_TK_VERSION:
|
||||||
lua_pushliteral(L, AWESOME_VERSION);
|
lua_pushliteral(L, AWESOME_VERSION);
|
||||||
|
|
6
wibox.c
6
wibox.c
|
@ -861,7 +861,7 @@ luaA_wibox_index(lua_State *L)
|
||||||
lua_pushnumber(L, wibox->border.width);
|
lua_pushnumber(L, wibox->border.width);
|
||||||
break;
|
break;
|
||||||
case A_TK_BORDER_COLOR:
|
case A_TK_BORDER_COLOR:
|
||||||
luaA_pushxcolor(L, &wibox->border.color);
|
luaA_pushxcolor(L, wibox->border.color);
|
||||||
break;
|
break;
|
||||||
case A_TK_ALIGN:
|
case A_TK_ALIGN:
|
||||||
if(wibox->type == WIBOX_TYPE_NORMAL)
|
if(wibox->type == WIBOX_TYPE_NORMAL)
|
||||||
|
@ -869,10 +869,10 @@ luaA_wibox_index(lua_State *L)
|
||||||
lua_pushstring(L, draw_align_tostr(wibox->align));
|
lua_pushstring(L, draw_align_tostr(wibox->align));
|
||||||
break;
|
break;
|
||||||
case A_TK_FG:
|
case A_TK_FG:
|
||||||
luaA_pushxcolor(L, &wibox->ctx.fg);
|
luaA_pushxcolor(L, wibox->ctx.fg);
|
||||||
break;
|
break;
|
||||||
case A_TK_BG:
|
case A_TK_BG:
|
||||||
luaA_pushxcolor(L, &wibox->ctx.bg);
|
luaA_pushxcolor(L, wibox->ctx.bg);
|
||||||
break;
|
break;
|
||||||
case A_TK_BG_IMAGE:
|
case A_TK_BG_IMAGE:
|
||||||
luaA_object_push_item(L, 1, wibox->bg_image);
|
luaA_object_push_item(L, 1, wibox->bg_image);
|
||||||
|
|
Loading…
Reference in New Issue