libpurple/protocols/gg/image-prpl.h

Tue, 07 Mar 2023 01:04:42 -0600

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Tue, 07 Mar 2023 01:04:42 -0600
changeset 42128
118067ca0367
parent 40439
e9838d634d5e
permissions
-rw-r--r--

Convert PurpleRequestPage into a GObject

And rename it from `PurpleRequestFields`.

Also, implements `GListModel` for the groups, but nothing uses it that way get.

Testing Done:
Compiled, and opened Request Fields from Demo protocol.

Reviewed at https://reviews.imfreedom.org/r/2323/

33348
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
1 /* purple
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
2 *
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
3 * Purple is the legal property of its developers, whose names are too numerous
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
4 * to list here. Please refer to the COPYRIGHT file distributed with this
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
5 * source distribution.
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
6 *
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
7 * Rewritten from scratch during Google Summer of Code 2012
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
8 * by Tomek Wasilczyk (http://www.wasilczyk.pl).
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
9 *
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
10 * Previously implemented by:
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
11 * - Arkadiusz Miskiewicz <misiek@pld.org.pl> - first implementation (2001);
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
12 * - Bartosz Oler <bartosz@bzimage.us> - reimplemented during GSoC 2005;
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
13 * - Krzysztof Klinikowski <grommasher@gmail.com> - some parts (2009-2011).
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
14 *
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
15 * This program is free software; you can redistribute it and/or modify
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
16 * it under the terms of the GNU General Public License as published by
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
17 * the Free Software Foundation; either version 2 of the License, or
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
18 * (at your option) any later version.
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
19 *
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
20 * This program is distributed in the hope that it will be useful,
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
23 * GNU General Public License for more details.
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
24 *
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
25 * You should have received a copy of the GNU General Public License
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
26 * along with this program; if not, write to the Free Software
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
28 */
2394cd23ce8f Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
29
39819
3554dac2991b Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35843
diff changeset
30 #ifndef PURPLE_GG_IMAGE_PRPL_H
3554dac2991b Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35843
diff changeset
31 #define PURPLE_GG_IMAGE_PRPL_H
33298
519acf37d16e Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
32
40439
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 39819
diff changeset
33 #include <purple.h>
33298
519acf37d16e Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
34 #include <libgadu.h>
519acf37d16e Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
35
33301
3f18ba8aed0f Gadu-Gadu sending images refactoring; notify about too large images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33298
diff changeset
36 #define GGP_IMAGE_SIZE_MAX 255000
34418
c27e31267e8d Gadu-Gadu: fix compilation on 64-bit targets
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34365
diff changeset
37 #define GGP_IMAGE_ID_FORMAT "%016" G_GINT64_MODIFIER "x"
33301
3f18ba8aed0f Gadu-Gadu sending images refactoring; notify about too large images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33298
diff changeset
38
34362
758e72362ca4 Gadu-Gadu: code polishing
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34361
diff changeset
39 typedef struct _ggp_image_session_data ggp_image_session_data;
33298
519acf37d16e Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
40
33301
3f18ba8aed0f Gadu-Gadu sending images refactoring; notify about too large images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33298
diff changeset
41 typedef enum
3f18ba8aed0f Gadu-Gadu sending images refactoring; notify about too large images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33298
diff changeset
42 {
3f18ba8aed0f Gadu-Gadu sending images refactoring; notify about too large images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33298
diff changeset
43 GGP_IMAGE_PREPARE_OK = 0,
3f18ba8aed0f Gadu-Gadu sending images refactoring; notify about too large images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33298
diff changeset
44 GGP_IMAGE_PREPARE_FAILURE,
3f18ba8aed0f Gadu-Gadu sending images refactoring; notify about too large images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33298
diff changeset
45 GGP_IMAGE_PREPARE_TOO_BIG
3f18ba8aed0f Gadu-Gadu sending images refactoring; notify about too large images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33298
diff changeset
46 } ggp_image_prepare_result;
3f18ba8aed0f Gadu-Gadu sending images refactoring; notify about too large images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33298
diff changeset
47
35820
9b4fccc8ceac GG: reference images, not their ids
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35819
diff changeset
48 void
9b4fccc8ceac GG: reference images, not their ids
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35819
diff changeset
49 ggp_image_setup(PurpleConnection *gc);
9b4fccc8ceac GG: reference images, not their ids
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35819
diff changeset
50
9b4fccc8ceac GG: reference images, not their ids
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35819
diff changeset
51 void
9b4fccc8ceac GG: reference images, not their ids
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35819
diff changeset
52 ggp_image_cleanup(PurpleConnection *gc);
9b4fccc8ceac GG: reference images, not their ids
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35819
diff changeset
53
9b4fccc8ceac GG: reference images, not their ids
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35819
diff changeset
54 ggp_image_prepare_result
9b4fccc8ceac GG: reference images, not their ids
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35819
diff changeset
55 ggp_image_prepare(PurpleConversation *conv, PurpleImage *image, uint64_t *id);
33298
519acf37d16e Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
56
35820
9b4fccc8ceac GG: reference images, not their ids
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35819
diff changeset
57 void
9b4fccc8ceac GG: reference images, not their ids
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35819
diff changeset
58 ggp_image_recv(PurpleConnection *gc,
33298
519acf37d16e Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
59 const struct gg_event_image_reply *image_reply);
35820
9b4fccc8ceac GG: reference images, not their ids
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35819
diff changeset
60
9b4fccc8ceac GG: reference images, not their ids
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35819
diff changeset
61 void
9b4fccc8ceac GG: reference images, not their ids
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35819
diff changeset
62 ggp_image_send(PurpleConnection *gc,
33301
3f18ba8aed0f Gadu-Gadu sending images refactoring; notify about too large images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33298
diff changeset
63 const struct gg_event_image_request *image_request);
35820
9b4fccc8ceac GG: reference images, not their ids
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35819
diff changeset
64
9b4fccc8ceac GG: reference images, not their ids
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35819
diff changeset
65 PurpleImage *
35843
b5d03ca6a680 Gadu-Gadu: use remote features of PurpleImage instead of handling image queue
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35820
diff changeset
66 ggp_image_request(PurpleConnection *gc, uin_t uin, uint64_t id);
33298
519acf37d16e Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
67
39819
3554dac2991b Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35843
diff changeset
68 #endif /* PURPLE_GG_IMAGE_PRPL_H */

mercurial