pidgin/pidginnotification.h

Wed, 01 Jan 2025 15:32:28 -0600

author
Gary Kramlich <grim@reaperworld.com>
date
Wed, 01 Jan 2025 15:32:28 -0600
changeset 43120
a7fd7e06c486
parent 42940
240eb66a3795
child 43177
595a5f31003a
permissions
-rw-r--r--

Prepare for the 2.90.1 release

Testing Done:
Ran `meson dist`

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

42940
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * Pidgin - Internet Messenger
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * Pidgin is the legal property of its developers, whose names are too numerous
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * source distribution.
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 *
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * (at your option) any later version.
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 *
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 * GNU General Public License for more details.
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 *
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 * along with this program; if not, see <https://www.gnu.org/licenses/>.
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 */
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #if !defined(PIDGIN_GLOBAL_HEADER_INSIDE) && !defined(PIDGIN_COMPILATION)
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 # error "only <pidgin.h> may be included directly"
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25 #endif
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 #ifndef PIDGIN_NOTIFICATION_H
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28 #define PIDGIN_NOTIFICATION_H
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 #include <glib.h>
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 #include <gtk/gtk.h>
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34 #include <adwaita.h>
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36 #include <purple.h>
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38 #include "pidginversion.h"
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 G_BEGIN_DECLS
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 /**
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 * PidginNotification:
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44 *
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 * #PidginNotification is a widget that displays [class@Purple.Notification]'s
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 * from [class@Purple.NotificationManager].
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 *
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 * Depending on the [class@Purple.Notification] that this is created for,
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 * different actions will be displayed.
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 *
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 * Since: 3.0
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 */
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54 #define PIDGIN_TYPE_NOTIFICATION (pidgin_notification_get_type())
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 PIDGIN_AVAILABLE_IN_3_0
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 G_DECLARE_DERIVABLE_TYPE(PidginNotification, pidgin_notification, PIDGIN,
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 NOTIFICATION, GtkBox)
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 struct _PidginNotificationClass {
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 /*< private >*/
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 GtkBoxClass parent;
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64 /*< private >*/
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 gpointer reserved[4];
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66 };
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68 /**
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69 * pidgin_notification_new:
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 * @notification: A [class@Purple.Notification] to display.
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 *
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72 * Creates a new widget that will display @notification.
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 *
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 * Returns: (transfer full): The new instance.
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 *
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76 * Since: 3.0
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 */
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78 PIDGIN_AVAILABLE_IN_3_0
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 GtkWidget *pidgin_notification_new(PurpleNotification *notification);
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81 /**
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
82 * pidgin_notification_get_notification:
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
83 * @notification: The instance.
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
84 *
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
85 * Gets the [class@Purple.Notification] that @notification is displaying.
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
86 *
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
87 * Returns: (transfer none): The notification.
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
88 *
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
89 * Since: 3.0
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
90 */
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
91 PIDGIN_AVAILABLE_IN_3_0
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
92 PurpleNotification *pidgin_notification_get_notification(PidginNotification *notification);
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94 /**
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
95 * pidgin_notification_get_child:
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
96 * @notification: The instance.
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
97 *
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
98 * Gets the child widget from @notification.
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
99 *
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
100 * This child is meant to hold actions that can be performed for this
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
101 * notification.
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
102 *
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
103 * Returns: (transfer none) (nullable): The child widget if set, otherwise
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
104 * %NULL.
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
105 *
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
106 * Since: 3.0
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
107 */
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
108 PIDGIN_AVAILABLE_IN_3_0
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
109 GtkWidget *pidgin_notification_get_child(PidginNotification *notification);
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
110
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
111 /**
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
112 * pidgin_notification_set_child:
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
113 * @notification: The instance.
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
114 * @child: (nullable): The new child widget.
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
115 *
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
116 * Sets the child of @notification to @child.
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
117 *
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
118 * Since: 3.0
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
119 */
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
120 PIDGIN_AVAILABLE_IN_3_0
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
121 void pidgin_notification_set_child(PidginNotification *notification, GtkWidget *child);
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
122
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
123 G_END_DECLS
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
124
240eb66a3795 Create Pidgin.Notification to simplify the custom widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
125 #endif /* PIDGIN_NOTIFICATION_H */

mercurial