diff options
author | emersion <contact@emersion.fr> | 2018-09-22 11:25:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-22 11:25:07 +0200 |
commit | b148da848ae9075822cd8ddd743532f3ce78f923 (patch) | |
tree | 0f0e3cf936553aeb28f39c5506eb94b8abcadc8f /include/pango.h | |
parent | Merge pull request #2678 from RyanDwyer/reconfigure-on-reposition (diff) | |
parent | Use pango_layout_set_text instead of pango_layout_set_markup (diff) | |
download | sway-b148da848ae9075822cd8ddd743532f3ce78f923.tar.gz sway-b148da848ae9075822cd8ddd743532f3ce78f923.tar.zst sway-b148da848ae9075822cd8ddd743532f3ce78f923.zip |
Merge pull request #2679 from RyanDwyer/fix-pango-escaping
Fix pango escaping and refactor escape_markup_text
Diffstat (limited to 'include/pango.h')
-rw-r--r-- | include/pango.h | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/include/pango.h b/include/pango.h index 09a535a5..6ab83c16 100644 --- a/include/pango.h +++ b/include/pango.h | |||
@@ -6,17 +6,13 @@ | |||
6 | #include <cairo/cairo.h> | 6 | #include <cairo/cairo.h> |
7 | #include <pango/pangocairo.h> | 7 | #include <pango/pangocairo.h> |
8 | 8 | ||
9 | /* Utility function which escape characters a & < > ' ". | 9 | /** |
10 | * Utility function which escape characters a & < > ' ". | ||
10 | * | 11 | * |
11 | * If the dest parameter is NULL, then the function returns the length of | 12 | * The function returns the length of the escaped string, optionally writing the |
12 | * of the escaped src string. The dest_length doesn't matter. | 13 | * escaped string to dest if provided. |
13 | * | ||
14 | * If the dest parameter is not NULL then the fuction escapes the src string | ||
15 | * an puts the escaped string in dest and returns the lenght of the escaped string. | ||
16 | * The dest_length parameter is the size of dest array. If the size of dest is not | ||
17 | * enough, then the function returns -1. | ||
18 | */ | 14 | */ |
19 | int escape_markup_text(const char *src, char *dest, int dest_length); | 15 | size_t escape_markup_text(const char *src, char *dest); |
20 | PangoLayout *get_pango_layout(cairo_t *cairo, const char *font, | 16 | PangoLayout *get_pango_layout(cairo_t *cairo, const char *font, |
21 | const char *text, double scale, bool markup); | 17 | const char *text, double scale, bool markup); |
22 | void get_text_size(cairo_t *cairo, const char *font, int *width, int *height, | 18 | void get_text_size(cairo_t *cairo, const char *font, int *width, int *height, |