libpurple/purpleprotocolwhiteboard.c

Thu, 07 Aug 2025 21:32:18 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Thu, 07 Aug 2025 21:32:18 -0500
changeset 43300
0604c6839974
parent 42594
eddde70cedd8
permissions
-rw-r--r--

Clean up and modernize PurpleImage

Testing Done:
Ran the tests under valgrind and called in the turtles.

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

41719
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * Purple - Internet Messaging Library
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * Purple is the legal property of its developers, whose names are too numerous
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41960
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
41719
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * source distribution.
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41960
diff changeset
9 * This library is free software; you can redistribute it and/or modify it
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41960
diff changeset
10 * under the terms of the GNU General Public License as published by the Free
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41960
diff changeset
11 * Software Foundation; either version 2 of the License, or (at your option)
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41960
diff changeset
12 * any later version.
41719
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41960
diff changeset
14 * This library is distributed in the hope that it will be useful, but WITHOUT
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41960
diff changeset
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41960
diff changeset
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41960
diff changeset
17 * more details.
41719
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41960
diff changeset
19 * You should have received a copy of the GNU General Public License along with
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 41960
diff changeset
20 * this library; if not, see <https://www.gnu.org/licenses/>.
41719
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 */
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #include "purpleprotocolwhiteboard.h"
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25 /******************************************************************************
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26 * GObject Implementation
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 *****************************************************************************/
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28 G_DEFINE_INTERFACE(PurpleProtocolWhiteboard, purple_protocol_whiteboard,
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29 PURPLE_TYPE_PROTOCOL)
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 static void
41960
c8a4853205e3 Bump C standard to C99 for libpurple files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41719
diff changeset
32 purple_protocol_whiteboard_default_init(G_GNUC_UNUSED PurpleProtocolWhiteboardInterface *iface)
41719
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 {
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34 }
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36 /******************************************************************************
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 * Public API
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38 *****************************************************************************/
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39 PurpleWhiteboard *
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 purple_protocol_whiteboard_create(PurpleProtocolWhiteboard *whiteboard,
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 PurpleAccount *account, const gchar *who,
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 gint state)
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 {
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44 PurpleProtocolWhiteboardInterface *iface = NULL;
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 g_return_val_if_fail(PURPLE_IS_PROTOCOL_WHITEBOARD(whiteboard), NULL);
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 iface = PURPLE_PROTOCOL_WHITEBOARD_GET_IFACE(whiteboard);
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 if(iface != NULL && iface->create != NULL) {
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 return iface->create(whiteboard, account, who, state);
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 }
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53 return NULL;
affc85fd4f3a Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54 }

mercurial