Sun, 21 Jun 2020 04:16:15 -0500
Make it so only libpurple can directly include libpurple header files.
This is part of our on going effort to make it easier to develop against libpurple as well as making our filenames not part of our api.
Make it so only libpurple can directly include libpurple header files.
Testing Done:
Just a normal compile to make sure everything builds again.
Reviewed at https://reviews.imfreedom.org/r/8/
| 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 | ||
|
40474
1341be8e3402
Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents:
39738
diff
changeset
|
22 | #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION) |
|
1341be8e3402
Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents:
39738
diff
changeset
|
23 | # error "only <purple.h> may be included directly" |
|
1341be8e3402
Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents:
39738
diff
changeset
|
24 | #endif |
|
1341be8e3402
Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents:
39738
diff
changeset
|
25 | |
|
39659
e4dfb99b0cef
Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35812
diff
changeset
|
26 | #ifndef PURPLE_SMILEY_CUSTOM_H |
|
e4dfb99b0cef
Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35812
diff
changeset
|
27 | #define PURPLE_SMILEY_CUSTOM_H |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35717
diff
changeset
|
28 | /** |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35717
diff
changeset
|
29 | * SECTION:smiley-custom |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35717
diff
changeset
|
30 | * @include:smiley-custom.h |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35717
diff
changeset
|
31 | * @section_id: libpurple-smiley-custom |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35717
diff
changeset
|
32 | * @short_description: a persistent storage for user-defined smileys |
|
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35717
diff
changeset
|
33 | * @title: Custom smileys storage |
|
35776
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
34 | * |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
35 | * 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
|
36 | * #PurpleSmiley, defined by user. Some protocols support sending such smileys |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
37 | * 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
|
38 | * that supports this feature should set the flag |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
39 | * @PURPLE_CONNECTION_FLAG_ALLOW_CUSTOM_SMILEY of #PurpleConnectionFlags. |
|
35774
9227a7757e92
Comments: PurpleSmiley
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35717
diff
changeset
|
40 | */ |
| 35715 | 41 | |
| 42 | #include "smiley.h" | |
|
35717
45bde03f86a6
Custom smileys: simplify storage implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35715
diff
changeset
|
43 | #include "smiley-list.h" |
| 35715 | 44 | |
|
35776
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 | * purple_smiley_custom_add: |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
47 | * @image: the smiley's image. |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
48 | * @shortcut: textual representation of a smiley. |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
49 | * |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
50 | * 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
|
51 | * @image contents don't have to. |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
52 | * |
|
39738
14d425a528ad
Add missing transfer annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39659
diff
changeset
|
53 | * 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
|
54 | */ |
| 35715 | 55 | PurpleSmiley * |
|
35812
48c6ee645ca1
Imgstore vs PurpleImage: rip and fix
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35776
diff
changeset
|
56 | purple_smiley_custom_add(PurpleImage *image, const gchar *shortcut); |
| 35715 | 57 | |
|
35776
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
58 | /** |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
59 | * purple_smiley_custom_remove: |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
60 | * @smiley: the smiley to be removed. |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
61 | * |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
62 | * 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
|
63 | * other smileys) it will be removed from a disk. |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
64 | */ |
| 35715 | 65 | void |
| 66 | purple_smiley_custom_remove(PurpleSmiley *smiley); | |
| 67 | ||
|
35776
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
68 | /** |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
69 | * purple_smiley_custom_get_list: |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
70 | * |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
71 | * Returns the whole list of user-configured custom smileys. |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
72 | * |
|
39738
14d425a528ad
Add missing transfer annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39659
diff
changeset
|
73 | * Returns: (transfer none): A #PurpleSmileyList of custom smileys. |
|
35776
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
74 | */ |
|
35717
45bde03f86a6
Custom smileys: simplify storage implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35715
diff
changeset
|
75 | PurpleSmileyList * |
|
45bde03f86a6
Custom smileys: simplify storage implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35715
diff
changeset
|
76 | purple_smiley_custom_get_list(void); |
| 35715 | 77 | |
|
35776
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
78 | /** |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
79 | * _purple_smiley_custom_init: (skip) |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
80 | * |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
81 | * Initializes the custom smileys storage subsystem. |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
82 | * Stability: Private |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
83 | */ |
| 35715 | 84 | void |
|
35776
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
85 | _purple_smiley_custom_init(void); |
| 35715 | 86 | |
|
35776
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
87 | /** |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
88 | * _purple_smiley_custom_uninit: (skip) |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
89 | * |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
90 | * Uninitializes the custom smileys storage subsystem. |
|
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
91 | */ |
| 35715 | 92 | void |
|
35776
901a94245460
Comments: custom smileys
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35774
diff
changeset
|
93 | _purple_smiley_custom_uninit(void); |
| 35715 | 94 | |
|
39659
e4dfb99b0cef
Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35812
diff
changeset
|
95 | #endif /* PURPLE_SMILEY_CUSTOM_H */ |