Fri, 10 Mar 2023 16:37:41 -0600
Make PurpleRequestFieldChoice into a GObject
This also does an `hg cp`, though with all the renaming of the parameter names, maybe that wasn't as useful for tracking the diff.
I wonder if this should implement `GListModel`, but the values are currently arbitrary pointers, so it won't work right now.
Testing Done:
Compiled and opened Request Fields from Demo protocol.
Reviewed at https://reviews.imfreedom.org/r/2335/
|
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 |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
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 | * |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
9 | * This program is free software; you can redistribute it and/or modify |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
10 | * it under the terms of the GNU General Public License as published by |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
11 | * the Free Software Foundation; either version 2 of the License, or |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
12 | * (at your option) any later version. |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
14 | * This program is distributed in the hope that it will be useful, |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
17 | * GNU General Public License for more details. |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | * |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
20 | * along with this program; if not, see <https://www.gnu.org/licenses/>. |
|
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 | #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION) |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | # error "only <purple.h> may be included directly" |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | #endif |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | #ifndef PURPLE_PROTOCOL_WHITEBOARD_H |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | #define PURPLE_PROTOCOL_WHITEBOARD_H |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | #include <glib.h> |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | #include <glib-object.h> |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | #include <libpurple/account.h> |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | #include <libpurple/purplewhiteboard.h> |
|
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 | #define PURPLE_TYPE_PROTOCOL_WHITEBOARD (purple_protocol_whiteboard_get_type()) |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | G_DECLARE_INTERFACE(PurpleProtocolWhiteboard, purple_protocol_whiteboard, PURPLE, |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | PROTOCOL_WHITEBOARD, PurpleProtocol) |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | /** |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | * PurpleProtocolWhiteboard: |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | * |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 | * The #PurpleProtocolWhiteboard interface defines the behavior of a protocol's |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
44 | * whiteboard interface. |
|
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 | * Since: 3.0.0 |
|
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 | |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
49 | /** |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
50 | * PurpleProtocolWhiteboardInterface: |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | * @create: Creates a new whiteboard. |
|
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 | * The protocol whiteboard interface. |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
54 | * |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
55 | * This interface provides a gateway between purple and the protocol. |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
56 | * |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
57 | * Since: 3.0.0 |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
58 | */ |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
59 | struct _PurpleProtocolWhiteboardInterface { |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
60 | /*< private >*/ |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
61 | GTypeInterface parent; |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
62 | |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
63 | /*< public >*/ |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
64 | PurpleWhiteboard *(*create)(PurpleProtocolWhiteboard *whiteboard, PurpleAccount *account, const gchar *who, gint state); |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
65 | |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
66 | /*< private >*/ |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
67 | gpointer reserved[4]; |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
68 | }; |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
69 | |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
70 | G_BEGIN_DECLS |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
71 | |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
72 | /** |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
73 | * purple_protocol_whiteboard_create: |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
74 | * @whiteboard: The instance. |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
75 | * @account: The [class@Purple.Account]. |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
76 | * @who: The username of the contact who the whiteboard is being created for. |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
77 | * @state: The initial state of the whiteboard. |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
78 | * |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
79 | * Creates a new [class@Purple.Whiteboard]. |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
80 | * |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
81 | * Returns: (transfer full): The new whiteboard instance. |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
82 | * |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
83 | * Since: 3.0.0 |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
84 | */ |
|
41753
316c1207f787
Fix various small documentation errors
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41719
diff
changeset
|
85 | PurpleWhiteboard *purple_protocol_whiteboard_create(PurpleProtocolWhiteboard *whiteboard, PurpleAccount *account, const gchar *who, gint state); |
|
41719
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
86 | |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
87 | G_END_DECLS |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
88 | |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
89 | #endif /* PURPLE_PROTOCOL_WHITEBOARD_H */ |