Thu, 15 May 2014 23:02:22 +0200
Coverity: fix null pointer dereferences
|
35709
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
1 | /* purple |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
2 | * |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
3 | * Purple is the legal property of its developers, whose names are too numerous |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
5 | * source distribution. |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
6 | * |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
7 | * This program is free software; you can redistribute it and/or modify |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
8 | * it under the terms of the GNU General Public License as published by |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
9 | * the Free Software Foundation; either version 2 of the License, or |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
10 | * (at your option) any later version. |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
11 | * |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
12 | * This program is distributed in the hope that it will be useful, |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
15 | * GNU General Public License for more details. |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
16 | * |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
17 | * You should have received a copy of the GNU General Public License |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
18 | * along with this program; if not, write to the Free Software |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
20 | */ |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
21 | |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
22 | #ifndef _PURPLE_SMILEY_PARSER_H_ |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
23 | #define _PURPLE_SMILEY_PARSER_H_ |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35764
diff
changeset
|
24 | /** |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35764
diff
changeset
|
25 | * SECTION:smiley-parser |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35764
diff
changeset
|
26 | * @include:smiley-parser.h |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35764
diff
changeset
|
27 | * @section_id: libpurple-smiley-parser |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35764
diff
changeset
|
28 | * @short_description: a efficient smiley processor |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35764
diff
changeset
|
29 | * @title: Smiley parser |
|
35779
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
30 | * |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
31 | * This module is a fast and easy method for searching (and optionally replacing) |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
32 | * #PurpleSmiley's in a text. It may use all suitable smiley sets to smileyify |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
33 | * the message in one step. The priority if always the following: remote |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
34 | * smileys > local custom smileys > theme smileys. |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35764
diff
changeset
|
35 | */ |
|
35709
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
36 | |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
37 | #include "purple.h" |
|
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
38 | |
|
35779
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
39 | /** |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
40 | * PurpleSmileyParseCb: |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
41 | * @out: the message buffer. |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
42 | * @smiley: found smiley. |
|
35788
afa6d777bc7c
Smileys: avoid breaking (x)html by not replacing smileys inside tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35787
diff
changeset
|
43 | * @conv: the conversation of a message (or %NULL, if not passed). |
|
35779
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
44 | * @ui_data: the data being passed to #purple_smiley_parse. |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
45 | * |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
46 | * A replace callback for the found @smiley. It should append a HTML tag |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
47 | * representing the @smiley to the @out string. It must not modify the |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
48 | * @out string in other way than appending to its end. |
|
35788
afa6d777bc7c
Smileys: avoid breaking (x)html by not replacing smileys inside tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35787
diff
changeset
|
49 | * |
|
afa6d777bc7c
Smileys: avoid breaking (x)html by not replacing smileys inside tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35787
diff
changeset
|
50 | * If callback decides not to replace a smiley, it must not modify |
|
afa6d777bc7c
Smileys: avoid breaking (x)html by not replacing smileys inside tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35787
diff
changeset
|
51 | * @out in any way. |
|
afa6d777bc7c
Smileys: avoid breaking (x)html by not replacing smileys inside tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35787
diff
changeset
|
52 | * |
|
afa6d777bc7c
Smileys: avoid breaking (x)html by not replacing smileys inside tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35787
diff
changeset
|
53 | * Returns: %TRUE if the smiley was inserted. |
|
35779
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
54 | */ |
|
35788
afa6d777bc7c
Smileys: avoid breaking (x)html by not replacing smileys inside tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35787
diff
changeset
|
55 | typedef gboolean (*PurpleSmileyParseCb)(GString *out, PurpleSmiley *smiley, |
|
35752
77cec2a188ee
Smileys: add PurpleConversation to the parser callback
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35747
diff
changeset
|
56 | PurpleConversation *conv, gpointer ui_data); |
|
35747
25085b485441
Remote smileys: parse them too
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35716
diff
changeset
|
57 | |
|
35779
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
58 | /** |
|
35792
d18a48a68edf
Smiley parser: better symbol names
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35788
diff
changeset
|
59 | * purple_smiley_parser_smileify: |
|
35779
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
60 | * @conv: the conversation of a message. |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
61 | * @html_message: the html message, or escaped plain message. |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
62 | * @use_remote_smileys: %TRUE if remote smileys of @conv should be parsed. |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
63 | * @cb: the callback to replace smiley text with an image. |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
64 | * @ui_data: the user data to be passed to @cb and |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
65 | * #purple_smiley_theme_get_smileys. |
|
35752
77cec2a188ee
Smileys: add PurpleConversation to the parser callback
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35747
diff
changeset
|
66 | * |
|
35793
4a11e5ecb4ca
Smiley parser: fill docs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35792
diff
changeset
|
67 | * Replaces all textual smiley representations with proper smiley images |
|
4a11e5ecb4ca
Smiley parser: fill docs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35792
diff
changeset
|
68 | * configured for libpurple. |
|
35755
d91c44b4a8e6
Remote smileys: correctly handle failed smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35752
diff
changeset
|
69 | * |
|
35779
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
70 | * The @use_remote_smileys parameter should be %TRUE for incoming messages, |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
71 | * %FALSE for outgoing. |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
72 | * |
|
35793
4a11e5ecb4ca
Smiley parser: fill docs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35792
diff
changeset
|
73 | * This function is intended for replacing all smileys before displaying. For |
|
4a11e5ecb4ca
Smiley parser: fill docs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35792
diff
changeset
|
74 | * replacing custom smileys before sending to the other party, |
|
4a11e5ecb4ca
Smiley parser: fill docs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35792
diff
changeset
|
75 | * see #purple_smiley_parser_replace. |
|
4a11e5ecb4ca
Smiley parser: fill docs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35792
diff
changeset
|
76 | * |
|
4a11e5ecb4ca
Smiley parser: fill docs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35792
diff
changeset
|
77 | * Returns: (transfer full): the smileifed message. Should be #g_free'd when |
|
35779
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
78 | * done using it. Returns %NULL if and only if @html_message was %NULL. |
|
35747
25085b485441
Remote smileys: parse them too
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35716
diff
changeset
|
79 | */ |
|
35709
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
80 | gchar * |
|
35792
d18a48a68edf
Smiley parser: better symbol names
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35788
diff
changeset
|
81 | purple_smiley_parser_smileify(PurpleConversation *conv, const gchar *html_message, |
|
35761
dfbba8ed898d
Smileys: better control over smiley lists priority
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35756
diff
changeset
|
82 | gboolean use_remote_smileys, PurpleSmileyParseCb cb, gpointer ui_data); |
|
35709
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
83 | |
|
35779
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
84 | /** |
|
35792
d18a48a68edf
Smiley parser: better symbol names
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35788
diff
changeset
|
85 | * purple_smiley_parser_replace: |
|
35793
4a11e5ecb4ca
Smiley parser: fill docs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35792
diff
changeset
|
86 | * @smileys: the list of smileys to replace. |
|
4a11e5ecb4ca
Smiley parser: fill docs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35792
diff
changeset
|
87 | * @html_message: the html message, or escaped plain message. |
|
4a11e5ecb4ca
Smiley parser: fill docs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35792
diff
changeset
|
88 | * @cb: the callback to replace smiley text with an image. |
|
4a11e5ecb4ca
Smiley parser: fill docs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35792
diff
changeset
|
89 | * @ui_data: the user data to be passed to @cb. |
|
4a11e5ecb4ca
Smiley parser: fill docs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35792
diff
changeset
|
90 | * |
|
4a11e5ecb4ca
Smiley parser: fill docs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35792
diff
changeset
|
91 | * Replaces all textual smiley representations from @smileys list with images. |
|
35788
afa6d777bc7c
Smileys: avoid breaking (x)html by not replacing smileys inside tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35787
diff
changeset
|
92 | * |
|
35793
4a11e5ecb4ca
Smiley parser: fill docs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35792
diff
changeset
|
93 | * This function is intended for replacing custom smileys before sending to the |
|
4a11e5ecb4ca
Smiley parser: fill docs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35792
diff
changeset
|
94 | * other party. For replacing all sets of smileys (custom, remote and theme) at |
|
4a11e5ecb4ca
Smiley parser: fill docs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35792
diff
changeset
|
95 | * once (ie. before displaying), use #purple_smiley_parser_smileify. |
|
35788
afa6d777bc7c
Smileys: avoid breaking (x)html by not replacing smileys inside tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35787
diff
changeset
|
96 | * |
|
35793
4a11e5ecb4ca
Smiley parser: fill docs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35792
diff
changeset
|
97 | * Returns: (transfer full): the smileifed message. Should be #g_free'd when |
|
4a11e5ecb4ca
Smiley parser: fill docs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35792
diff
changeset
|
98 | * done using it. Returns %NULL if and only if @html_message was %NULL. |
|
35788
afa6d777bc7c
Smileys: avoid breaking (x)html by not replacing smileys inside tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35787
diff
changeset
|
99 | */ |
|
afa6d777bc7c
Smileys: avoid breaking (x)html by not replacing smileys inside tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35787
diff
changeset
|
100 | gchar * |
|
35792
d18a48a68edf
Smiley parser: better symbol names
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35788
diff
changeset
|
101 | purple_smiley_parser_replace(PurpleSmileyList *smileys, |
|
d18a48a68edf
Smiley parser: better symbol names
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35788
diff
changeset
|
102 | const gchar *html_message, PurpleSmileyParseCb cb, gpointer ui_data); |
|
35788
afa6d777bc7c
Smileys: avoid breaking (x)html by not replacing smileys inside tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35787
diff
changeset
|
103 | |
|
afa6d777bc7c
Smileys: avoid breaking (x)html by not replacing smileys inside tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35787
diff
changeset
|
104 | /** |
|
35792
d18a48a68edf
Smiley parser: better symbol names
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35788
diff
changeset
|
105 | * purple_smiley_parser_find: |
|
35779
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
106 | * @smileys: the list of smileys to find. |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
107 | * @message: the message. |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
108 | * @is_html: %TRUE if the message is HTML, %FALSE if it's plain, unescaped. |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
109 | * |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
110 | * Searches for all smileys from the @smileys list present in @message. |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
111 | * Each smiley is returned only once, regardless how many times it appeared in |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
112 | * text. However, distinct smileys may share common image file (thus, their |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
113 | * paths will be the same). |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
114 | * |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
115 | * Returns: (transfer container): the #GList of found smileys. Use #g_list_free |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
116 | * when no longer need it. |
|
d971ab073228
Comments: smiley parser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
117 | */ |
|
35756
fe6aba70046e
Custom smileys: make it possible to find them by prpl
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35755
diff
changeset
|
118 | GList * |
|
35792
d18a48a68edf
Smiley parser: better symbol names
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35788
diff
changeset
|
119 | purple_smiley_parser_find(PurpleSmileyList *smileys, const gchar *message, |
|
35764
066c0f932b33
Smileys: MSN: reimplement msn_msg_grab_emoticons to use new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35761
diff
changeset
|
120 | gboolean is_html); |
|
35756
fe6aba70046e
Custom smileys: make it possible to find them by prpl
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35755
diff
changeset
|
121 | |
|
35787
8738f1797803
Smiley parser: don't replace smileys inside HTML tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35779
diff
changeset
|
122 | /** |
|
8738f1797803
Smiley parser: don't replace smileys inside HTML tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35779
diff
changeset
|
123 | * _purple_smiley_parser_init: (skip) |
|
8738f1797803
Smiley parser: don't replace smileys inside HTML tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35779
diff
changeset
|
124 | * |
|
8738f1797803
Smiley parser: don't replace smileys inside HTML tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35779
diff
changeset
|
125 | * Initializes the smileys parser subsystem. |
|
8738f1797803
Smiley parser: don't replace smileys inside HTML tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35779
diff
changeset
|
126 | */ |
|
8738f1797803
Smiley parser: don't replace smileys inside HTML tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35779
diff
changeset
|
127 | void |
|
8738f1797803
Smiley parser: don't replace smileys inside HTML tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35779
diff
changeset
|
128 | _purple_smiley_parser_init(void); |
|
8738f1797803
Smiley parser: don't replace smileys inside HTML tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35779
diff
changeset
|
129 | |
|
8738f1797803
Smiley parser: don't replace smileys inside HTML tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35779
diff
changeset
|
130 | /** |
|
8738f1797803
Smiley parser: don't replace smileys inside HTML tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35779
diff
changeset
|
131 | * _purple_smiley_parser_uninit: (skip) |
|
8738f1797803
Smiley parser: don't replace smileys inside HTML tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35779
diff
changeset
|
132 | * |
|
8738f1797803
Smiley parser: don't replace smileys inside HTML tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35779
diff
changeset
|
133 | * Uninitializes the smileys parser subsystem. |
|
8738f1797803
Smiley parser: don't replace smileys inside HTML tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35779
diff
changeset
|
134 | */ |
|
8738f1797803
Smiley parser: don't replace smileys inside HTML tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35779
diff
changeset
|
135 | void |
|
8738f1797803
Smiley parser: don't replace smileys inside HTML tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35779
diff
changeset
|
136 | _purple_smiley_parser_uninit(void); |
|
8738f1797803
Smiley parser: don't replace smileys inside HTML tags
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35779
diff
changeset
|
137 | |
|
35709
0d7a84931572
Smileys: implement and use new parser, only themes for now
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
138 | #endif /* _PURPLE_SMILEY_PARSER_H_ */ |