From 0e819f2328d89fb9e0d4e769257ec07b86080a1e Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Wed, 6 Oct 2010 20:14:19 +0200 Subject: [PATCH] xcolor: Rename to color Signed-off-by: Uli Schlachter --- color.c | 14 +++++++------- color.h | 12 ++++++------ objects/window.c | 4 ++-- objects/window.h | 2 +- xwindow.c | 2 +- xwindow.h | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/color.c b/color.c index 615849c55..fb7bce6cd 100644 --- a/color.c +++ b/color.c @@ -78,15 +78,15 @@ color_parse(const char *colstr, ssize_t len, /** Send a request to initialize a X color. * If you are only interested in the rgba values and don't need the color's * pixel value, you should use color_init_unchecked() instead. - * \param color xcolor_t struct to store color into. + * \param color color_t struct to store color into. * \param colstr Color specification. * \param len The length of colstr (which still MUST be NULL terminated). * \return request informations. */ -xcolor_init_request_t -xcolor_init_unchecked(xcolor_t *color, const char *colstr, ssize_t len) +color_init_request_t +color_init_unchecked(color_t *color, const char *colstr, ssize_t len) { - xcolor_init_request_t req; + color_init_request_t req; uint8_t red, green, blue, alpha; p_clear(&req, 1); @@ -123,11 +123,11 @@ xcolor_init_unchecked(xcolor_t *color, const char *colstr, ssize_t len) } /** Initialize a X color. - * \param req xcolor_init request. + * \param req color_init request. * \return True if color allocation was successful. */ bool -xcolor_init_reply(xcolor_init_request_t req) +color_init_reply(color_init_request_t req) { if(req.has_error) return false; @@ -157,7 +157,7 @@ xcolor_init_reply(xcolor_init_request_t req) * \return The number of elements pushed on stack. */ int -luaA_pushxcolor(lua_State *L, const xcolor_t c) +luaA_pushcolor(lua_State *L, const color_t c) { uint8_t r = (unsigned) c.red * 0xff / 0xffff; uint8_t g = (unsigned) c.green * 0xff / 0xffff; diff --git a/color.h b/color.h index 66732209f..47459f622 100644 --- a/color.h +++ b/color.h @@ -35,21 +35,21 @@ typedef struct uint16_t blue; uint16_t alpha; bool initialized; -} xcolor_t; +} color_t; typedef struct { xcb_alloc_color_cookie_t cookie_hexa; uint16_t alpha; - xcolor_t *color; + color_t *color; bool has_error; const char *colstr; -} xcolor_init_request_t; +} color_init_request_t; -xcolor_init_request_t xcolor_init_unchecked(xcolor_t *, const char *, ssize_t); -bool xcolor_init_reply(xcolor_init_request_t); +color_init_request_t color_init_unchecked(color_t *, const char *, ssize_t); +bool color_init_reply(color_init_request_t); -int luaA_pushxcolor(lua_State *, const xcolor_t); +int luaA_pushcolor(lua_State *, const color_t); #endif diff --git a/objects/window.c b/objects/window.c index c36512078..6b6ba319b 100644 --- a/objects/window.c +++ b/objects/window.c @@ -148,7 +148,7 @@ luaA_window_set_border_color(lua_State *L, window_t *window) const char *color_name = luaL_checklstring(L, -1, &len); if(color_name && - xcolor_init_reply(xcolor_init_unchecked(&window->border_color, color_name, len))) + color_init_reply(color_init_unchecked(&window->border_color, color_name, len))) { xwindow_set_border_color(window_get(window), &window->border_color); luaA_object_emit_signal(L, -3, "property::border_color", 0); @@ -342,7 +342,7 @@ luaA_window_set_border_width(lua_State *L, window_t *c) } LUA_OBJECT_EXPORT_PROPERTY(window, window_t, window, lua_pushnumber) -LUA_OBJECT_EXPORT_PROPERTY(window, window_t, border_color, luaA_pushxcolor) +LUA_OBJECT_EXPORT_PROPERTY(window, window_t, border_color, luaA_pushcolor) LUA_OBJECT_EXPORT_PROPERTY(window, window_t, border_width, lua_pushnumber) void diff --git a/objects/window.h b/objects/window.h index 632f21372..15e5b2470 100644 --- a/objects/window.h +++ b/objects/window.h @@ -64,7 +64,7 @@ typedef enum /** Button bindings */ \ button_array_t buttons; \ /** Border color */ \ - xcolor_t border_color; \ + color_t border_color; \ /** Border width */ \ uint16_t border_width; \ /** The window type */ \ diff --git a/xwindow.c b/xwindow.c index c84cc2ff1..3514dfb5e 100644 --- a/xwindow.c +++ b/xwindow.c @@ -250,7 +250,7 @@ xwindow_set_cursor(xcb_window_t w, xcb_cursor_t c) * \param color The color. */ void -xwindow_set_border_color(xcb_window_t w, xcolor_t *color) +xwindow_set_border_color(xcb_window_t w, color_t *color) { if(w) xcb_change_window_attributes(globalconf.connection, w, XCB_CW_BORDER_PIXEL, &color->pixel); diff --git a/xwindow.h b/xwindow.h index 655d35384..7999effa4 100644 --- a/xwindow.h +++ b/xwindow.h @@ -37,7 +37,7 @@ void xwindow_set_opacity(xcb_window_t, double); void xwindow_grabkeys(xcb_window_t, key_array_t *); void xwindow_takefocus(xcb_window_t); void xwindow_set_cursor(xcb_window_t, xcb_cursor_t); -void xwindow_set_border_color(xcb_window_t, xcolor_t *); +void xwindow_set_border_color(xcb_window_t, color_t *); #endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80