Mon, 03 Feb 2020 21:15:02 -0600
closing merged branch
| 35715 | 1 | /* purple |
| 2 | * | |
| 3 | * Purple is the legal property of its developers, whose names are too numerous | |
| 4 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 5 | * source distribution. | |
| 6 | * | |
| 7 | * This program is free software; you can redistribute it and/or modify | |
| 8 | * it under the terms of the GNU General Public License as published by | |
| 9 | * the Free Software Foundation; either version 2 of the License, or | |
| 10 | * (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU General Public License | |
| 18 | * along with this program; if not, write to the Free Software | |
| 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA | |
| 20 | */ | |
| 21 | ||
|
39659
e4dfb99b0cef
Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35812
diff
changeset
|
22 | #ifndef PURPLE_SMILEY_CUSTOM_H |
|
e4dfb99b0cef
Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35812
diff
changeset
|
23 | #define PURPLE_SMILEY_CUSTOM_H |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35717
diff
changeset
|
24 | /** |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35717
diff
changeset
|
25 | * SECTION:smiley-custom |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35717
diff
changeset
|
26 | * @include:smiley-custom.h |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35717
diff
changeset
|
27 | * @section_id: libpurple-smiley-custom |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35717
diff
changeset
|
28 | * @short_description: a persistent storage for user-defined smileys |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35717
diff
changeset
|
29 | * @title: Custom smileys storage |
|
35776
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
30 | * |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
31 | * A custom smiley is a non-standard (not defined by a particular protocol) |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
32 | * #PurpleSmiley, defined by user. Some protocols support sending such smileys |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
33 | * for other buddies, that do not have such image on their machine. Protocol |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
34 | * that supports this feature should set the flag |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
35 | * @PURPLE_CONNECTION_FLAG_ALLOW_CUSTOM_SMILEY of #PurpleConnectionFlags. |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35717
diff
changeset
|
36 | */ |
| 35715 | 37 | |
| 38 | #include "smiley.h" | |
|
35717
45bde03f86a6
Custom smileys: simplify storage implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35715
diff
changeset
|
39 | #include "smiley-list.h" |
| 35715 | 40 | |
|
35776
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
41 | /** |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
42 | * purple_smiley_custom_add: |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
43 | * @image: the smiley's image. |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
44 | * @shortcut: textual representation of a smiley. |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
45 | * |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
46 | * Adds a new smiley to the store. The @shortcut should be unique, but the |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
47 | * @image contents don't have to. |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
48 | * |
|
39738
14d425a528ad
Add missing transfer annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39659
diff
changeset
|
49 | * Returns: (transfer none): A new #PurpleSmiley, or %NULL if error occurred. |
|
35776
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
50 | */ |
| 35715 | 51 | PurpleSmiley * |
|
35812
48c6ee645ca1
Imgstore vs PurpleImage: rip and fix
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35776
diff
changeset
|
52 | purple_smiley_custom_add(PurpleImage *image, const gchar *shortcut); |
| 35715 | 53 | |
|
35776
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
54 | /** |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
55 | * purple_smiley_custom_remove: |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
56 | * @smiley: the smiley to be removed. |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
57 | * |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
58 | * Removes a @smiley from the store. If the @smiley file is unique (not used by |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
59 | * other smileys) it will be removed from a disk. |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
60 | */ |
| 35715 | 61 | void |
| 62 | purple_smiley_custom_remove(PurpleSmiley *smiley); | |
| 63 | ||
|
35776
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
64 | /** |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
65 | * purple_smiley_custom_get_list: |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
66 | * |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
67 | * Returns the whole list of user-configured custom smileys. |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
68 | * |
|
39738
14d425a528ad
Add missing transfer annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39659
diff
changeset
|
69 | * Returns: (transfer none): A #PurpleSmileyList of custom smileys. |
|
35776
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
70 | */ |
|
35717
45bde03f86a6
Custom smileys: simplify storage implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35715
diff
changeset
|
71 | PurpleSmileyList * |
|
45bde03f86a6
Custom smileys: simplify storage implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35715
diff
changeset
|
72 | purple_smiley_custom_get_list(void); |
| 35715 | 73 | |
|
35776
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
74 | /** |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
75 | * _purple_smiley_custom_init: (skip) |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
76 | * |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
77 | * Initializes the custom smileys storage subsystem. |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
78 | * Stability: Private |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
79 | */ |
| 35715 | 80 | void |
|
35776
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
81 | _purple_smiley_custom_init(void); |
| 35715 | 82 | |
|
35776
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
83 | /** |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
84 | * _purple_smiley_custom_uninit: (skip) |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
85 | * |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
86 | * Uninitializes the custom smileys storage subsystem. |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
87 | */ |
| 35715 | 88 | void |
|
35776
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
89 | _purple_smiley_custom_uninit(void); |
| 35715 | 90 | |
|
39659
e4dfb99b0cef
Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35812
diff
changeset
|
91 | #endif /* PURPLE_SMILEY_CUSTOM_H */ |