Move get_colorpixel to libi3, use it everywhere else

This commit is contained in:
Michael Stapelberg
2011-10-23 17:38:21 +01:00
parent 0086bcb2b4
commit cb9bbcfccf
19 changed files with 90 additions and 131 deletions

View File

@ -93,4 +93,20 @@ int ipc_recv_message(int sockfd, uint32_t message_type,
*/
void fake_configure_notify(xcb_connection_t *conn, xcb_rectangle_t r, xcb_window_t window, int border_width);
/**
* Returns the colorpixel to use for the given hex color (think of HTML). Only
* works for true-color (vast majority of cases) at the moment, avoiding a
* roundtrip to X11.
*
* The hex_color has to start with #, for example #FF00FF.
*
* NOTE that get_colorpixel() does _NOT_ check the given color code for validity.
* This has to be done by the caller.
*
* NOTE that this function may in the future rely on a global xcb_connection_t
* variable called 'conn' to be present.
*
*/
uint32_t get_colorpixel(const char *hex) __attribute__((const));
#endif