Consolidate all convert_* functions into libi3.

Some minor fixes along the way as well. Very minor stuff, unlikely
to ever be visible to the user.
This commit is contained in:
Fernando Tarlá Cardoso Lemos
2011-11-11 21:18:37 -02:00
committed by Michael Stapelberg
parent 061f24b247
commit fb11cc2d14
14 changed files with 129 additions and 288 deletions

View File

@ -179,4 +179,20 @@ uint32_t get_mod_mask_for(uint32_t keysym,
*/
i3Font load_font(const char *pattern, bool fallback);
/**
* Converts the given string to UTF-8 from UCS-2 big endian. The return value
* must be freed after use.
*
*/
char *convert_ucs2_to_utf8(xcb_char2b_t *text, size_t num_glyphs);
/**
* Converts the given string to UCS-2 big endian for use with
* xcb_image_text_16(). The amount of real glyphs is stored in real_strlen,
* a buffer containing the UCS-2 encoded string (16 bit per glyph) is
* returned. It has to be freed when done.
*
*/
xcb_char2b_t *convert_utf8_to_ucs2(char *input, int *real_strlen);
#endif

View File

@ -91,15 +91,6 @@ void exec_i3_utility(char *name, char *argv[]);
void check_error(xcb_connection_t *conn, xcb_void_cookie_t cookie,
char *err_message);
/**
* Converts the given string to UCS-2 big endian for use with
* xcb_image_text_16(). The amount of real glyphs is stored in real_strlen, a
* buffer containing the UCS-2 encoded string (16 bit per glyph) is
* returned. It has to be freed when done.
*
*/
char *convert_utf8_to_ucs2(char *input, int *real_strlen);
/**
* This function resolves ~ in pathnames.
* It may resolve wildcards in the first part of the path, but if no match

View File

@ -99,7 +99,7 @@ void xcb_raise_window(xcb_connection_t *conn, xcb_window_t window);
* real length (amount of glyphs) using the given font.
*
*/
int predict_text_width(char *text, int length);
int predict_text_width(const xcb_char2b_t *text, int length);
/**
* Configures the given window to have the size/position specified by given rect