Sat, 11 Mar 2023 04:33:46 -0600
Cleanup request field files
A variety of small followups to splitting the request objects into separate files:
* Make `PurpleRequestField` into an abstract type and drop the field type enum.
* Add request files to GObject introspection.
* Replace `purple_debug` with GLib logging.
* Remove extra `#include` where possible.
* Remove most early `typedef` which were there for `#include` loops.
* Put `G_DEFINE_TYPE` in a consistent place.
* Add `Since` tags to objects since they are new (but not the functions), and also to all of `PurpleRequestPage`/`PurpleRequestGroup` which were fully renamed.
* Use website for GNU reference in license header.
* Clean up old entries in `ChangeLog.API`.
Testing Done:
Compiled, then checked Class Hierarchy in docs and confirmed that the structs were now there.
Reviewed at https://reviews.imfreedom.org/r/2342/
|
40584
6f198a69ac48
A bunch of documentation cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
40474
diff
changeset
|
1 | /* |
|
6f198a69ac48
A bunch of documentation cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
40474
diff
changeset
|
2 | * Purple - Internet Messaging Library |
|
6f198a69ac48
A bunch of documentation cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
40474
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
| 5477 | 4 | * |
| 15884 | 5 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 7 | * source distribution. | |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
8 | * |
| 5477 | 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License as published by | |
| 11 | * the Free Software Foundation; either version 2 of the License, or | |
| 12 | * (at your option) any later version. | |
| 13 | * | |
| 14 | * This program is distributed in the hope that it will be useful, | |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 17 | * GNU General Public License for more details. | |
| 18 | * | |
| 19 | * You should have received a copy of the GNU General Public License | |
|
40584
6f198a69ac48
A bunch of documentation cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
40474
diff
changeset
|
20 | * along with this program; if not, see <https://www.gnu.org/licenses/>. |
| 5477 | 21 | */ |
|
35487
494f09f7f331
Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents:
35486
diff
changeset
|
22 | |
|
40474
1341be8e3402
Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
23 | #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:
40439
diff
changeset
|
24 | # 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:
40439
diff
changeset
|
25 | #endif |
|
1341be8e3402
Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
26 | |
|
42142
809019093568
Make PurpleRequestFieldImage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42141
diff
changeset
|
27 | #ifndef PURPLE_REQUEST_FIELD_IMAGE_H |
|
809019093568
Make PurpleRequestFieldImage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42141
diff
changeset
|
28 | #define PURPLE_REQUEST_FIELD_IMAGE_H |
|
40584
6f198a69ac48
A bunch of documentation cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
40474
diff
changeset
|
29 | |
|
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:
40330
diff
changeset
|
30 | #include <glib.h> |
| 5477 | 31 | #include <glib-object.h> |
| 32 | ||
|
32554
0d844fac6679
Fix a bunch of tiny problems generating our doxygen documentation
Mark Doliner <markdoliner@pidgin.im>
parents:
32531
diff
changeset
|
33 | /** |
|
42142
809019093568
Make PurpleRequestFieldImage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42141
diff
changeset
|
34 | * PurpleRequestFieldImage: |
|
35400
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35395
diff
changeset
|
35 | * |
|
42142
809019093568
Make PurpleRequestFieldImage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42141
diff
changeset
|
36 | * An image request field. |
|
42144
92dd14dc8a73
Cleanup request field files
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42142
diff
changeset
|
37 | * |
|
92dd14dc8a73
Cleanup request field files
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42142
diff
changeset
|
38 | * Since: 3.0.0 |
|
32554
0d844fac6679
Fix a bunch of tiny problems generating our doxygen documentation
Mark Doliner <markdoliner@pidgin.im>
parents:
32531
diff
changeset
|
39 | */ |
|
42142
809019093568
Make PurpleRequestFieldImage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42141
diff
changeset
|
40 | typedef struct _PurpleRequestFieldImage PurpleRequestFieldImage; |
|
42124
472dc8caeda3
Convert PurpleRequestField into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42123
diff
changeset
|
41 | |
|
42142
809019093568
Make PurpleRequestFieldImage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42141
diff
changeset
|
42 | #include "purplerequestfield.h" |
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32888
diff
changeset
|
43 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32604
diff
changeset
|
44 | G_BEGIN_DECLS |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5809
diff
changeset
|
45 | |
|
42142
809019093568
Make PurpleRequestFieldImage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42141
diff
changeset
|
46 | #define PURPLE_TYPE_REQUEST_FIELD_IMAGE (purple_request_field_image_get_type()) |
|
809019093568
Make PurpleRequestFieldImage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42141
diff
changeset
|
47 | G_DECLARE_FINAL_TYPE(PurpleRequestFieldImage, purple_request_field_image, |
|
809019093568
Make PurpleRequestFieldImage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42141
diff
changeset
|
48 | PURPLE, REQUEST_FIELD_IMAGE, PurpleRequestField) |
| 11357 | 49 | |
| 50 | /** | |
|
35400
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35395
diff
changeset
|
51 | * purple_request_field_image_new: |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35050
diff
changeset
|
52 | * @id: The field ID. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35050
diff
changeset
|
53 | * @text: The label of the field. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35050
diff
changeset
|
54 | * @buf: The image data. |
|
35400
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35395
diff
changeset
|
55 | * @size: The size of the data in @buf. |
|
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35395
diff
changeset
|
56 | * |
| 11357 | 57 | * Creates an image field. |
| 58 | * | |
| 40188 | 59 | * Returns: (transfer full): The new field. |
| 11357 | 60 | */ |
|
42142
809019093568
Make PurpleRequestFieldImage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42141
diff
changeset
|
61 | PurpleRequestField *purple_request_field_image_new(const char *id, const char *text, const char *buf, gsize size); |
| 11357 | 62 | |
| 63 | /** | |
|
35400
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35395
diff
changeset
|
64 | * purple_request_field_image_set_scale: |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35050
diff
changeset
|
65 | * @field: The image field. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35050
diff
changeset
|
66 | * @x: The x scale factor. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35050
diff
changeset
|
67 | * @y: The y scale factor. |
|
12399
535d819a4c74
[gaim-migrate @ 14706]
Richard Laager <rlaager@pidgin.im>
parents:
11502
diff
changeset
|
68 | * |
|
35400
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35395
diff
changeset
|
69 | * Sets the scale factors of an image field. |
|
12399
535d819a4c74
[gaim-migrate @ 14706]
Richard Laager <rlaager@pidgin.im>
parents:
11502
diff
changeset
|
70 | */ |
|
42142
809019093568
Make PurpleRequestFieldImage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42141
diff
changeset
|
71 | void purple_request_field_image_set_scale(PurpleRequestFieldImage *field, unsigned int x, unsigned int y); |
|
12399
535d819a4c74
[gaim-migrate @ 14706]
Richard Laager <rlaager@pidgin.im>
parents:
11502
diff
changeset
|
72 | |
|
535d819a4c74
[gaim-migrate @ 14706]
Richard Laager <rlaager@pidgin.im>
parents:
11502
diff
changeset
|
73 | /** |
|
35400
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35395
diff
changeset
|
74 | * purple_request_field_image_get_buffer: |
|
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35395
diff
changeset
|
75 | * @field: The image field. |
| 11357 | 76 | * |
| 77 | * Returns pointer to the image. | |
| 78 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35050
diff
changeset
|
79 | * Returns: Pointer to the image. |
| 11357 | 80 | */ |
|
42142
809019093568
Make PurpleRequestFieldImage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42141
diff
changeset
|
81 | const char *purple_request_field_image_get_buffer(PurpleRequestFieldImage *field); |
| 11357 | 82 | |
| 83 | /** | |
|
35400
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35395
diff
changeset
|
84 | * purple_request_field_image_get_size: |
|
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35395
diff
changeset
|
85 | * @field: The image field. |
| 11357 | 86 | * |
| 87 | * Returns size (in bytes) of the image. | |
| 88 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35050
diff
changeset
|
89 | * Returns: Size of the image. |
| 11357 | 90 | */ |
|
42142
809019093568
Make PurpleRequestFieldImage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42141
diff
changeset
|
91 | gsize purple_request_field_image_get_size(PurpleRequestFieldImage *field); |
| 11357 | 92 | |
| 93 | /** | |
|
35400
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35395
diff
changeset
|
94 | * purple_request_field_image_get_scale_x: |
|
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35395
diff
changeset
|
95 | * @field: The image field. |
| 11357 | 96 | * |
| 97 | * Returns X scale coefficient of the image. | |
| 98 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35050
diff
changeset
|
99 | * Returns: X scale coefficient of the image. |
| 11357 | 100 | */ |
|
42142
809019093568
Make PurpleRequestFieldImage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42141
diff
changeset
|
101 | unsigned int purple_request_field_image_get_scale_x(PurpleRequestFieldImage *field); |
| 11357 | 102 | |
| 103 | /** | |
|
35400
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35395
diff
changeset
|
104 | * purple_request_field_image_get_scale_y: |
|
a22531410e3f
Convert docs from doxygen to gtk-doc format for request.h and util.h
Ankit Vani <a@nevitus.org>
parents:
35395
diff
changeset
|
105 | * @field: The image field. |
| 11357 | 106 | * |
| 107 | * Returns Y scale coefficient of the image. | |
| 108 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35050
diff
changeset
|
109 | * Returns: Y scale coefficient of the image. |
| 11357 | 110 | */ |
|
42142
809019093568
Make PurpleRequestFieldImage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42141
diff
changeset
|
111 | unsigned int purple_request_field_image_get_scale_y(PurpleRequestFieldImage *field); |
|
33237
2574432da068
Validation for Request API: common validators
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33219
diff
changeset
|
112 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32604
diff
changeset
|
113 | G_END_DECLS |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5809
diff
changeset
|
114 | |
|
42142
809019093568
Make PurpleRequestFieldImage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42141
diff
changeset
|
115 | #endif /* PURPLE_REQUEST_FIELD_IMAGE_H */ |