diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2009-11-24 21:29:45 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2009-11-25 01:29:45 +0800 |
commit | ce6f2983d99033c0144a622295ae72ec567e2582 (patch) | |
tree | 1c839e8bb6444a2b1f0aad5d19215aa284ea8eb7 /libempathy-gtk/empathy-ui-utils.h | |
parent | 7731e5f2031462707a4e774d6ebe38d32641a6e5 (diff) | |
download | gsoc2013-empathy-ce6f2983d99033c0144a622295ae72ec567e2582.tar gsoc2013-empathy-ce6f2983d99033c0144a622295ae72ec567e2582.tar.gz gsoc2013-empathy-ce6f2983d99033c0144a622295ae72ec567e2582.tar.bz2 gsoc2013-empathy-ce6f2983d99033c0144a622295ae72ec567e2582.tar.lz gsoc2013-empathy-ce6f2983d99033c0144a622295ae72ec567e2582.tar.xz gsoc2013-empathy-ce6f2983d99033c0144a622295ae72ec567e2582.tar.zst gsoc2013-empathy-ce6f2983d99033c0144a622295ae72ec567e2582.zip |
Make possible to define different replace function for parsers
Diffstat (limited to 'libempathy-gtk/empathy-ui-utils.h')
-rw-r--r-- | libempathy-gtk/empathy-ui-utils.h | 46 |
1 files changed, 34 insertions, 12 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.h b/libempathy-gtk/empathy-ui-utils.h index 80332c98f..f125b06dd 100644 --- a/libempathy-gtk/empathy-ui-utils.h +++ b/libempathy-gtk/empathy-ui-utils.h @@ -118,10 +118,23 @@ gchar * empathy_make_absolute_url_len (const gchar *url, guint len); /* String parser */ -typedef void (*EmpathyStringParser) (GString *string, - const gchar *text, - gssize len, - gpointer user_data); + +typedef struct _EmpathyStringParser EmpathyStringParser; + +typedef void (*EmpathyStringReplace) (GString *string, + const gchar *text, + gssize len, + gpointer user_data); +typedef void (*EmpathyStringMatch) (GString *string, + const gchar *text, + gssize len, + EmpathyStringReplace replace_func, + EmpathyStringParser *sub_parsers); + +struct _EmpathyStringParser { + EmpathyStringMatch match_func; + EmpathyStringReplace replace_func; +}; void empathy_string_parser_substr (GString *string, @@ -130,16 +143,25 @@ empathy_string_parser_substr (GString *string, EmpathyStringParser *parsers); void -empathy_string_parser_link (GString *string, - const gchar *text, - gssize len, - gpointer user_data); +empathy_string_match_link (GString *string, + const gchar *text, + gssize len, + EmpathyStringReplace replace_func, + EmpathyStringParser *sub_parsers); void -empathy_string_parser_escape (GString *string, - const gchar *text, - gssize len, - gpointer user_data); +empathy_string_match_smiley (GString *string, + const gchar *text, + gssize len, + EmpathyStringReplace replace_func, + EmpathyStringParser *sub_parsers); + +void +empathy_string_match_escape (GString *string, + const gchar *text, + gssize len, + EmpathyStringReplace replace_func, + EmpathyStringParser *sub_parsers); G_END_DECLS |