Fri, 14 Feb 2025 02:12:52 -0600
Annotate libpurple constructors that return base types
In that case, annotating the actual type will help bindings use the correct type.
Testing Done:
Compared the gir before and after:
```diff
--- Purple-3.0.gir 2025-02-14 00:51:54.467548255 -0500
+++ build/libpurple/Purple-3.0.gir 2025-02-14 02:45:56.050535272 -0500
@@ -19676,8 +19676,9 @@
<return-value transfer-ownership="full">
<doc xml:space="preserve"
filename="libpurple/purplenoopcredentialprovider.h"
- line="62">The new #PurpleNoopCredentialProvider instance.</doc>
- <type name="CredentialProvider" c:type="PurpleCredentialProvider*"/>
+ line="62">The new credential provider.</doc>
+ <type name="NoopCredentialProvider"
+ c:type="PurpleCredentialProvider*"/>
</return-value>
</constructor>
</class>
@@ -20412,7 +20413,7 @@
<doc xml:space="preserve"
filename="libpurple/purplenotificationaddcontact.h"
line="65">The new notification.</doc>
- <type name="Notification" c:type="PurpleNotification*"/>
+ <type name="NotificationAddContact" c:type="PurpleNotification*"/>
</return-value>
<parameters>
<parameter name="id"
@@ -20507,7 +20508,8 @@
<doc xml:space="preserve"
filename="libpurple/purplenotificationauthorizationrequest.h"
line="65">The new notification.</doc>
- <type name="Notification" c:type="PurpleNotification*"/>
+ <type name="NotificationAuthorizationRequest"
+ c:type="PurpleNotification*"/>
</return-value>
<parameters>
<parameter name="id"
@@ -20608,11 +20610,12 @@
line="55">Creates a new [class@Notification] for a connection error on @account.</doc>
<source-position filename="libpurple/purplenotificationconnectionerror.h"
line="67"/>
- <return-value transfer-ownership="full" nullable="1">
+ <return-value transfer-ownership="full">
<doc xml:space="preserve"
filename="libpurple/purplenotificationconnectionerror.h"
line="62">The new notification.</doc>
- <type name="Notification" c:type="PurpleNotification*"/>
+ <type name="NotificationConnectionError"
+ c:type="PurpleNotification*"/>
</return-value>
<parameters>
<parameter name="id"
@@ -20668,7 +20671,7 @@
<doc xml:space="preserve"
filename="libpurple/purplenotificationlink.h"
line="61">The new notification.</doc>
- <type name="Notification" c:type="PurpleNotification*"/>
+ <type name="NotificationLink" c:type="PurpleNotification*"/>
</return-value>
<parameters>
<parameter name="id"
@@ -21881,8 +21884,8 @@
<return-value transfer-ownership="full">
<doc xml:space="preserve"
filename="libpurple/purpleplugininfo.h"
- line="207">A new #PurplePluginInfo instance.</doc>
- <type name="GPlugin.PluginInfo" c:type="GPluginPluginInfo*"/>
+ line="207">The new plugin info.</doc>
+ <type name="PluginInfo" c:type="GPluginPluginInfo*"/>
</return-value>
<parameters>
<parameter name="first_property" transfer-ownership="none">
@@ -31364,7 +31367,7 @@
<doc xml:space="preserve"
filename="libpurple/request/purplerequestfieldaccount.h"
line="79">The new field.</doc>
- <type name="RequestField" c:type="PurpleRequestField*"/>
+ <type name="RequestFieldAccount" c:type="PurpleRequestField*"/>
</return-value>
<parameters>
<parameter name="id" transfer-ownership="none">
@@ -31737,7 +31740,7 @@
<doc xml:space="preserve"
filename="libpurple/request/purplerequestfieldbool.h"
line="61">The new field.</doc>
- <type name="RequestField" c:type="PurpleRequestField*"/>
+ <type name="RequestFieldBool" c:type="PurpleRequestField*"/>
</return-value>
<parameters>
<parameter name="id" transfer-ownership="none">
@@ -31918,7 +31921,7 @@
<doc xml:space="preserve"
filename="libpurple/request/purplerequestfieldchoice.h"
line="61">The new field.</doc>
- <type name="RequestField" c:type="PurpleRequestField*"/>
+ <type name="RequestFieldChoice" c:type="PurpleRequestField*"/>
</return-value>
<parameters>
<parameter name="id" transfer-ownership="none">
@@ -32281,7 +32284,7 @@
<doc xml:space="preserve"
filename="libpurple/request/purplerequestfieldimage.h"
line="63">The new field.</doc>
- <type name="RequestField" c:type="PurpleRequestField*"/>
+ <type name="RequestFieldImage" c:type="PurpleRequestField*"/>
</return-value>
<parameters>
<parameter name="id" transfer-ownership="none">
@@ -32508,7 +32511,7 @@
<doc xml:space="preserve"
filename="libpurple/request/purplerequestfieldint.h"
line="61">The new field.</doc>
- <type name="RequestField" c:type="PurpleRequestField*"/>
+ <type name="RequestFieldInt" c:type="PurpleRequestField*"/>
</return-value>
<parameters>
<parameter name="id" transfer-ownership="none">
@@ -32825,7 +32828,7 @@
<doc xml:space="preserve"
filename="libpurple/request/purplerequestfieldlabel.h"
line="58">The new field.</doc>
- <type name="RequestField" c:type="PurpleRequestField*"/>
+ <type name="RequestFieldLabel" c:type="PurpleRequestField*"/>
</return-value>
<parameters>
<parameter name="id" transfer-ownership="none">
@@ -32876,7 +32879,7 @@
<doc xml:space="preserve"
filename="libpurple/request/purplerequestfieldlist.h"
line="58">The new field.</doc>
- <type name="RequestField" c:type="PurpleRequestField*"/>
+ <type name="RequestFieldList" c:type="PurpleRequestField*"/>
</return-value>
<parameters>
<parameter name="id" transfer-ownership="none">
@@ -33230,7 +33233,7 @@
<doc xml:space="preserve"
filename="libpurple/request/purplerequestfieldstring.h"
line="60">The new field.</doc>
- <type name="RequestField" c:type="PurpleRequestField*"/>
+ <type name="RequestFieldString" c:type="PurpleRequestField*"/>
</return-value>
<parameters>
<parameter name="id" transfer-ownership="none">
@@ -35252,8 +35255,8 @@
<return-value transfer-ownership="full">
<doc xml:space="preserve"
filename="libpurple/purplesqlitehistoryadapter.h"
- line="60">The new #PurpleSqliteHistoryAdapter instance.</doc>
- <type name="HistoryAdapter" c:type="PurpleHistoryAdapter*"/>
+ line="60">The new history adapter.</doc>
+ <type name="SqliteHistoryAdapter" c:type="PurpleHistoryAdapter*"/>
</return-value>
<parameters>
<parameter name="filename" transfer-ownership="none">
```
Reviewed at https://reviews.imfreedom.org/r/3837/
|
42922
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | /* |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
2 | * Purple - Internet Messaging Library |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
5 | * Purple is the legal property of its developers, whose names are too numerous |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
7 | * source distribution. |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
9 | * This library is free software; you can redistribute it and/or modify it |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
10 | * under the terms of the GNU General Public License as published by the Free |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
11 | * Software Foundation; either version 2 of the License, or (at your option) |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
12 | * any later version. |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
14 | * This library is distributed in the hope that it will be useful, but WITHOUT |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
16 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
17 | * more details. |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | * |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License along with |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
20 | * this library; if not, see <https://www.gnu.org/licenses/>. |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | */ |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
22 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION) |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | # error "only <purple.h> may be included directly" |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | #endif |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | #ifndef PURPLE_NOTIFICATION_ADD_CONTACT_H |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | #define PURPLE_NOTIFICATION_ADD_CONTACT_H |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | #include <glib.h> |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | #include <glib-object.h> |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | #include "purpleaddcontactrequest.h" |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | #include "purplenotification.h" |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | #include "purpleversion.h" |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
36 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | G_BEGIN_DECLS |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | /** |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | * PurpleNotificationAddContact: |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | * |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | * A [class@Notification] for [class@AddContactRequest]s. |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 | * |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
44 | * Since: 3.0 |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
45 | */ |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
46 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
47 | #define PURPLE_TYPE_NOTIFICATION_ADD_CONTACT (purple_notification_add_contact_get_type()) |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
48 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
49 | PURPLE_AVAILABLE_IN_3_0 |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
50 | G_DECLARE_FINAL_TYPE(PurpleNotificationAddContact, |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | purple_notification_add_contact, |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
52 | PURPLE, NOTIFICATION_ADD_CONTACT, |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
53 | PurpleNotification) |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
54 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
55 | /** |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
56 | * purple_notification_add_contact_new: |
|
42928
2f12cdef0048
Update Purple.NotificationAddContact to take an id parameter
Gary Kramlich <grim@reaperworld.com>
parents:
42922
diff
changeset
|
57 | * @id: (nullable): An identifier for this notification. |
|
42922
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
58 | * @request: The add contact request. |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
59 | * |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
60 | * Creates a new [class@Notification] for @request. |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
61 | * |
|
42928
2f12cdef0048
Update Purple.NotificationAddContact to take an id parameter
Gary Kramlich <grim@reaperworld.com>
parents:
42922
diff
changeset
|
62 | * Since @request has a [class@Contact] which has a [class@Account], |
|
2f12cdef0048
Update Purple.NotificationAddContact to take an id parameter
Gary Kramlich <grim@reaperworld.com>
parents:
42922
diff
changeset
|
63 | * [property@Notification:account] will automatically be set to that. |
|
2f12cdef0048
Update Purple.NotificationAddContact to take an id parameter
Gary Kramlich <grim@reaperworld.com>
parents:
42922
diff
changeset
|
64 | * |
|
43176
04f562dc0ff2
Annotate libpurple constructors that return base types
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42928
diff
changeset
|
65 | * Returns: (transfer full) (type PurpleNotificationAddContact): The new |
|
04f562dc0ff2
Annotate libpurple constructors that return base types
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42928
diff
changeset
|
66 | * notification. |
|
42922
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
67 | * |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
68 | * Since: 3.0 |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
69 | */ |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
70 | PURPLE_AVAILABLE_IN_3_0 |
|
42928
2f12cdef0048
Update Purple.NotificationAddContact to take an id parameter
Gary Kramlich <grim@reaperworld.com>
parents:
42922
diff
changeset
|
71 | PurpleNotification *purple_notification_add_contact_new(const char *id, PurpleAddContactRequest *request); |
|
42922
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
72 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
73 | /** |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
74 | * purple_notification_add_contact_get_request: |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
75 | * @notification: The instance. |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
76 | * |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
77 | * Gets the [class@AddContactRequest] for @notification. |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
78 | * |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
79 | * Returns: (transfer none): The add contact request. |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
80 | * |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
81 | * Since: 3.0 |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
82 | */ |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
83 | PURPLE_AVAILABLE_IN_3_0 |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
84 | PurpleAddContactRequest *purple_notification_add_contact_get_request(PurpleNotificationAddContact *notification); |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
85 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
86 | G_END_DECLS |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
87 | |
|
46b64a8cbec4
Create Purple.NotificationAddContact
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
88 | #endif /* PURPLE_NOTIFICATION_ADD_CONTACT_H */ |