Thu, 10 Apr 2014 23:09:48 +0200
Imgstore vs PurpleImage: rip and fix
|
22443
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1 | /* purple |
|
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
2 | * |
|
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
3 | * Purple is the legal property of its developers, whose names are too numerous |
|
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
5 | * source distribution. |
|
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
6 | * |
|
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
7 | * This program is free software; you can redistribute it and/or modify |
|
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
8 | * it under the terms of the GNU General Public License as published by |
|
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
9 | * the Free Software Foundation; either version 2 of the License, or |
|
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
10 | * (at your option) any later version. |
|
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
11 | * |
|
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
12 | * This program is distributed in the hope that it will be useful, |
|
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
15 | * GNU General Public License for more details. |
|
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
16 | * |
|
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
17 | * You should have received a copy of the GNU General Public License |
|
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
18 | * along with this program; if not, write to the Free Software |
|
35698
302a7cb4c1ab
Initial generic PurpleSmiley implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35487
diff
changeset
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
22443
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
20 | */ |
|
35487
494f09f7f331
Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents:
35486
diff
changeset
|
21 | |
|
494f09f7f331
Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents:
35486
diff
changeset
|
22 | #ifndef _PURPLE_SMILEY_H_ |
|
494f09f7f331
Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents:
35486
diff
changeset
|
23 | #define _PURPLE_SMILEY_H_ |
|
35442
84e906df98dd
Add section blocks for purple-socket.h to xmlnode.h
Ankit Vani <a@nevitus.org>
parents:
35402
diff
changeset
|
24 | /** |
|
84e906df98dd
Add section blocks for purple-socket.h to xmlnode.h
Ankit Vani <a@nevitus.org>
parents:
35402
diff
changeset
|
25 | * SECTION:smiley |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
26 | * @include:smiley.h |
|
35442
84e906df98dd
Add section blocks for purple-socket.h to xmlnode.h
Ankit Vani <a@nevitus.org>
parents:
35402
diff
changeset
|
27 | * @section_id: libpurple-smiley |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
28 | * @short_description: a link between emoticon image and its textual representation |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
29 | * @title: Smileys |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
30 | * |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
31 | * A #PurpleSmiley is a base class for associating emoticon images and their |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
32 | * textual representation. It's intended for various smiley-related tasks: |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
33 | * parsing the text against them, displaying in the smiley selector, or handling |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
34 | * remote data (using #PurpleRemoteSmiley). |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
35 | * |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
36 | * The #PurpleSmiley:shortcut is always unescaped, but <link linkend="libpurple-smiley-parser">smiley parser</link> |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
37 | * may deal with special characters. |
|
35442
84e906df98dd
Add section blocks for purple-socket.h to xmlnode.h
Ankit Vani <a@nevitus.org>
parents:
35402
diff
changeset
|
38 | */ |
|
22443
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
39 | |
|
35812
48c6ee645ca1
Imgstore vs PurpleImage: rip and fix
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
40 | #include "image.h" |
|
23013
18f4fad1f9af
Make PurpleSmiley a GObject.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22896
diff
changeset
|
41 | |
|
35744
34964f8d43fe
Remote smileys: initial implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35701
diff
changeset
|
42 | #include <glib-object.h> |
|
22443
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
43 | |
|
35701
34f4a4318d19
Initial PurpleSmileyList implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35699
diff
changeset
|
44 | typedef struct _PurpleSmiley PurpleSmiley; |
|
34f4a4318d19
Initial PurpleSmileyList implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35699
diff
changeset
|
45 | typedef struct _PurpleSmileyClass PurpleSmileyClass; |
|
23013
18f4fad1f9af
Make PurpleSmiley a GObject.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22896
diff
changeset
|
46 | |
|
35701
34f4a4318d19
Initial PurpleSmileyList implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35699
diff
changeset
|
47 | #define PURPLE_TYPE_SMILEY (purple_smiley_get_type()) |
|
34f4a4318d19
Initial PurpleSmileyList implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35699
diff
changeset
|
48 | #define PURPLE_SMILEY(smiley) (G_TYPE_CHECK_INSTANCE_CAST((smiley), PURPLE_TYPE_SMILEY, PurpleSmiley)) |
|
34f4a4318d19
Initial PurpleSmileyList implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35699
diff
changeset
|
49 | #define PURPLE_SMILEY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_SMILEY, PurpleSmileyClass)) |
|
34f4a4318d19
Initial PurpleSmileyList implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35699
diff
changeset
|
50 | #define PURPLE_IS_SMILEY(smiley) (G_TYPE_CHECK_INSTANCE_TYPE((smiley), PURPLE_TYPE_SMILEY)) |
|
34f4a4318d19
Initial PurpleSmileyList implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35699
diff
changeset
|
51 | #define PURPLE_IS_SMILEY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_SMILEY)) |
|
34f4a4318d19
Initial PurpleSmileyList implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35699
diff
changeset
|
52 | #define PURPLE_SMILEY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_SMILEY, PurpleSmileyClass)) |
|
22443
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
53 | |
|
35402
6eae3b385153
Convert docs from doxygen to gtk-doc format for purple-socket to smiley
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
54 | /** |
|
6eae3b385153
Convert docs from doxygen to gtk-doc format for purple-socket to smiley
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
55 | * PurpleSmiley: |
|
6eae3b385153
Convert docs from doxygen to gtk-doc format for purple-socket to smiley
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
56 | * |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
57 | * A generic smiley. It can either be a theme smiley, or a custom smiley. |
|
35402
6eae3b385153
Convert docs from doxygen to gtk-doc format for purple-socket to smiley
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
58 | */ |
|
34531
fc9377274d13
Exposed the instance and class structures of PurpleSmiley so that it can be subclassed
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
59 | struct _PurpleSmiley |
|
fc9377274d13
Exposed the instance and class structures of PurpleSmiley so that it can be subclassed
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
60 | { |
|
34691
3acdd397a9c1
Removed reserved fields from instance structs.
Ankit Vani <a@nevitus.org>
parents:
34531
diff
changeset
|
61 | /*< private >*/ |
|
34531
fc9377274d13
Exposed the instance and class structures of PurpleSmiley so that it can be subclassed
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
62 | GObject parent; |
|
fc9377274d13
Exposed the instance and class structures of PurpleSmiley so that it can be subclassed
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
63 | }; |
|
fc9377274d13
Exposed the instance and class structures of PurpleSmiley so that it can be subclassed
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
64 | |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
65 | /** |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
66 | * PurpleSmileyClass: |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
67 | * @get_image: gets image contents for a @smiley. May not require |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
68 | * #PurpleSmiley:path being set. See #purple_smiley_get_image. |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
69 | * |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
70 | * Base class for #PurpleSmiley objects. |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
71 | */ |
|
34531
fc9377274d13
Exposed the instance and class structures of PurpleSmiley so that it can be subclassed
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
72 | struct _PurpleSmileyClass |
|
fc9377274d13
Exposed the instance and class structures of PurpleSmiley so that it can be subclassed
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
73 | { |
|
34691
3acdd397a9c1
Removed reserved fields from instance structs.
Ankit Vani <a@nevitus.org>
parents:
34531
diff
changeset
|
74 | /*< private >*/ |
|
34531
fc9377274d13
Exposed the instance and class structures of PurpleSmiley so that it can be subclassed
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
75 | GObjectClass parent_class; |
|
fc9377274d13
Exposed the instance and class structures of PurpleSmiley so that it can be subclassed
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
76 | |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
77 | /*< public >*/ |
|
35812
48c6ee645ca1
Imgstore vs PurpleImage: rip and fix
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
78 | PurpleImage * (*get_image)(PurpleSmiley *smiley); |
|
35749
d71c41a54bb3
Smileys: implement get_image interface
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35744
diff
changeset
|
79 | |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
80 | /*< private >*/ |
|
34531
fc9377274d13
Exposed the instance and class structures of PurpleSmiley so that it can be subclassed
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
81 | void (*purple_reserved1)(void); |
|
fc9377274d13
Exposed the instance and class structures of PurpleSmiley so that it can be subclassed
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
82 | void (*purple_reserved2)(void); |
|
fc9377274d13
Exposed the instance and class structures of PurpleSmiley so that it can be subclassed
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
83 | void (*purple_reserved3)(void); |
|
fc9377274d13
Exposed the instance and class structures of PurpleSmiley so that it can be subclassed
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
84 | void (*purple_reserved4)(void); |
|
fc9377274d13
Exposed the instance and class structures of PurpleSmiley so that it can be subclassed
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
85 | }; |
|
fc9377274d13
Exposed the instance and class structures of PurpleSmiley so that it can be subclassed
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
86 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32438
diff
changeset
|
87 | G_BEGIN_DECLS |
|
22443
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
88 | |
|
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
89 | /** |
|
35402
6eae3b385153
Convert docs from doxygen to gtk-doc format for purple-socket to smiley
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
90 | * purple_smiley_get_type: |
|
6eae3b385153
Convert docs from doxygen to gtk-doc format for purple-socket to smiley
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
91 | * |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
92 | * Returns: the #GType for a smiley. |
|
23013
18f4fad1f9af
Make PurpleSmiley a GObject.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22896
diff
changeset
|
93 | */ |
|
35698
302a7cb4c1ab
Initial generic PurpleSmiley implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35487
diff
changeset
|
94 | GType |
|
302a7cb4c1ab
Initial generic PurpleSmiley implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35487
diff
changeset
|
95 | purple_smiley_get_type(void); |
|
22443
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
96 | |
|
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
97 | /** |
|
35699
7bc9ddd6f6af
Smiley: make generic implementation a bit more complete
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35698
diff
changeset
|
98 | * purple_smiley_new: |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
99 | * @shortcut: the smiley shortcut (unescaped). |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
100 | * @path: the smiley image file path. |
|
35402
6eae3b385153
Convert docs from doxygen to gtk-doc format for purple-socket to smiley
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
101 | * |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
102 | * Creates new smiley, which is ready to display (its file exists |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
103 | * and is a valid image). |
|
35699
7bc9ddd6f6af
Smiley: make generic implementation a bit more complete
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35698
diff
changeset
|
104 | * |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
105 | * Returns: the new #PurpleSmiley. |
|
22443
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
106 | */ |
|
35699
7bc9ddd6f6af
Smiley: make generic implementation a bit more complete
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35698
diff
changeset
|
107 | PurpleSmiley * |
|
7bc9ddd6f6af
Smiley: make generic implementation a bit more complete
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35698
diff
changeset
|
108 | purple_smiley_new(const gchar *shortcut, const gchar *path); |
|
22443
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
109 | |
|
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
110 | /** |
|
35402
6eae3b385153
Convert docs from doxygen to gtk-doc format for purple-socket to smiley
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
111 | * purple_smiley_get_shortcut: |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
112 | * @smiley: the smiley. |
|
22443
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
113 | * |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
114 | * Returns the @smiley's associated shortcut (e.g. <literal>(homer)</literal> or |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
115 | * <literal>:-)</literal>). |
|
22443
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
116 | * |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
117 | * Returns: the unescaped shortcut. |
|
22443
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
118 | */ |
|
35698
302a7cb4c1ab
Initial generic PurpleSmiley implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35487
diff
changeset
|
119 | const gchar * |
|
302a7cb4c1ab
Initial generic PurpleSmiley implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35487
diff
changeset
|
120 | purple_smiley_get_shortcut(const PurpleSmiley *smiley); |
|
22443
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
121 | |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
122 | /** |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
123 | * purple_smiley_is_ready: |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
124 | * @smiley: the smiley. |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
125 | * |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
126 | * Checks, if the @smiley is ready to be displayed. For #PurpleSmiley it's |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
127 | * always %TRUE, but for deriving classes it may vary. |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
128 | * |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
129 | * Being ready means either its #PurpleSmiley:path is set and file exists, |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
130 | * or its contents is available via #purple_smiley_get_image. The latter is |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
131 | * always true, but not always efficient. |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
132 | * |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
133 | * Returns: %TRUE, if the @smiley is ready to be displayed. |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
134 | */ |
|
35698
302a7cb4c1ab
Initial generic PurpleSmiley implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35487
diff
changeset
|
135 | gboolean |
|
302a7cb4c1ab
Initial generic PurpleSmiley implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35487
diff
changeset
|
136 | purple_smiley_is_ready(const PurpleSmiley *smiley); |
|
22443
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
137 | |
|
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
138 | /** |
|
35698
302a7cb4c1ab
Initial generic PurpleSmiley implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35487
diff
changeset
|
139 | * purple_smiley_get_path: |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
140 | * @smiley: the smiley. |
|
22443
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
141 | * |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
142 | * Returns a full path to a @smiley image file. |
|
26386
49343310498a
Clean up the PurpleSmiley documentation.
Paul Aurich <darkrain42@pidgin.im>
parents:
23321
diff
changeset
|
143 | * |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
144 | * A @smiley may not be saved to disk (the path will be NULL), but could still be |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
145 | * accessible using #purple_smiley_get_data. |
|
35749
d71c41a54bb3
Smileys: implement get_image interface
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35744
diff
changeset
|
146 | * |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
147 | * Returns: a full path to the file, or %NULL if it's not stored to the disk |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
148 | * or an error occured. |
|
22443
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
149 | */ |
|
35698
302a7cb4c1ab
Initial generic PurpleSmiley implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35487
diff
changeset
|
150 | const gchar * |
|
302a7cb4c1ab
Initial generic PurpleSmiley implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35487
diff
changeset
|
151 | purple_smiley_get_path(PurpleSmiley *smiley); |
|
22443
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
152 | |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
153 | /** |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
154 | * purple_smiley_get_image: |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
155 | * @smiley: the smiley. |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
156 | * |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
157 | * Returns (and possibly loads) the image contents for a @smiley. |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
158 | * If you want to save it, increase a ref count for the returned object. |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
159 | * |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
160 | * Returns: (transfer none): the image contents for a @smiley. |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35771
diff
changeset
|
161 | */ |
|
35812
48c6ee645ca1
Imgstore vs PurpleImage: rip and fix
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
162 | PurpleImage * |
|
35749
d71c41a54bb3
Smileys: implement get_image interface
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35744
diff
changeset
|
163 | purple_smiley_get_image(PurpleSmiley *smiley); |
|
d71c41a54bb3
Smileys: implement get_image interface
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35744
diff
changeset
|
164 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32438
diff
changeset
|
165 | G_END_DECLS |
|
22443
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
166 | |
|
7b8772af6bb7
Apply the custom smiley patches from #1187, from Jorge Villaseño (Masca) and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
167 | #endif /* _PURPLE_SMILEY_H_ */ |