libpurple/attention.c

Wed, 05 Feb 2020 02:27:50 -0600

author
Richard Laager <rlaager@pidgin.im>
date
Wed, 05 Feb 2020 02:27:50 -0600
changeset 40293
c60c4f96749d
parent 40244
7a330cab3546
permissions
-rw-r--r--

Fix some line wrapping

This file is not terribly consistent.

38859
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /* purple
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 *
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Purple is the legal property of its developers, whose names are too numerous
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 * to list here. Please refer to the COPYRIGHT file distributed with this
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * source distribution.
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 *
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * (at your option) any later version.
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 *
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * GNU General Public License for more details.
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 *
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 */
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22 #include "attention.h"
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 /******************************************************************************
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25 * PurpleAttentionType API
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26 *****************************************************************************/
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 struct _PurpleAttentionType {
40244
7a330cab3546 Remove documentation for non-public struct fields.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38861
diff changeset
28 /* The name to show in GUI elements. */
38859
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29 const gchar *name;
40244
7a330cab3546 Remove documentation for non-public struct fields.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38861
diff changeset
30 /* Shown when received. */
38859
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 const gchar *incoming_description;
40244
7a330cab3546 Remove documentation for non-public struct fields.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38861
diff changeset
32 /* Shown when sent. */
38859
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 const gchar *outgoing_description;
40244
7a330cab3546 Remove documentation for non-public struct fields.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38861
diff changeset
34 /* Optional name of the icon to display. */
38859
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 const gchar *icon_name;
40244
7a330cab3546 Remove documentation for non-public struct fields.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38861
diff changeset
36 /* An unlocalized name for UIs that would rather use that. */
38859
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 const gchar *unlocalized_name;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38 };
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 G_DEFINE_BOXED_TYPE(
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 PurpleAttentionType,
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 purple_attention_type,
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 purple_attention_type_copy,
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44 g_free
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 );
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 PurpleAttentionType *
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 purple_attention_type_new(const gchar *unlocalized_name,
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 const gchar *name,
38861
21858f98040c Address the issues that Qulogic found
Gary Kramlich <grim@reaperworld.com>
parents: 38859
diff changeset
50 const gchar *incoming_description,
21858f98040c Address the issues that Qulogic found
Gary Kramlich <grim@reaperworld.com>
parents: 38859
diff changeset
51 const gchar *outgoing_description)
38859
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 {
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53 PurpleAttentionType *attn = g_new0(PurpleAttentionType, 1);
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 attn->unlocalized_name = unlocalized_name;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 attn->name = name;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 attn->incoming_description = incoming_description;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 attn->outgoing_description = outgoing_description;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 return attn;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 }
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 PurpleAttentionType *
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64 purple_attention_type_copy(PurpleAttentionType *attn) {
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 PurpleAttentionType *attn_copy = NULL;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 g_return_val_if_fail(attn != NULL, NULL);
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69 attn_copy = g_new(PurpleAttentionType, 1);
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 *attn_copy = *attn;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72 return attn_copy;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 }
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 const gchar *
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76 purple_attention_type_get_name(const PurpleAttentionType *type) {
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 g_return_val_if_fail(type, NULL);
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 return type->name;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80 }
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
82 void
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
83 purple_attention_type_set_name(PurpleAttentionType *type, const gchar *name) {
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
84 g_return_if_fail(type);
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
85
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
86 type->name = name;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
87 }
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
88
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
89 const gchar *
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
90 purple_attention_type_get_incoming_desc(const PurpleAttentionType *type) {
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
91 g_return_val_if_fail(type, NULL);
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
92
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93 return type->incoming_description;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94 }
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
95
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
96 void
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
97 purple_attention_type_set_incoming_desc(PurpleAttentionType *type, const gchar *desc) {
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
98 g_return_if_fail(type);
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
99
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
100 type->incoming_description = desc;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
101 }
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
102
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
103 const gchar *
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
104 purple_attention_type_get_outgoing_desc(const PurpleAttentionType *type) {
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
105 g_return_val_if_fail(type, NULL);
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
106
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
107 return type->outgoing_description;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
108 }
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
109
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
110 void
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
111 purple_attention_type_set_outgoing_desc(PurpleAttentionType *type, const gchar *desc) {
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
112 g_return_if_fail(type != NULL);
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
113
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
114 type->outgoing_description = desc;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
115 }
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
116
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
117 const gchar *
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
118 purple_attention_type_get_icon_name(const PurpleAttentionType *type) {
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
119 g_return_val_if_fail(type, NULL);
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
120
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
121 if(type->icon_name == NULL || *(type->icon_name) == '\0')
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
122 return NULL;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
123
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
124 return type->icon_name;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
125 }
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
126
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
127 void
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
128 purple_attention_type_set_icon_name(PurpleAttentionType *type, const gchar *name) {
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
129 g_return_if_fail(type);
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
130
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
131 type->icon_name = name;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
132 }
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
133
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
134 const gchar *
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
135 purple_attention_type_get_unlocalized_name(const PurpleAttentionType *type) {
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
136 g_return_val_if_fail(type, NULL);
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
137
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
138 return type->unlocalized_name;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
139 }
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
140
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
141 void
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
142 purple_attention_type_set_unlocalized_name(PurpleAttentionType *type, const gchar *ulname) {
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
143 g_return_if_fail(type);
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
144
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
145 type->unlocalized_name = ulname;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
146 }
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
147
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
148 /******************************************************************************
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
149 * PurpleAttentionType API
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
150 *****************************************************************************/
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
151 G_DEFINE_INTERFACE(PurpleProtocolAttention, purple_protocol_attention, G_TYPE_INVALID);
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
152
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
153 static void
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
154 purple_protocol_attention_default_init(PurpleProtocolAttentionInterface *iface) {
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
155 }
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
156
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
157 gboolean
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
158 purple_protocol_attention_send(PurpleProtocolAttention *attn, PurpleConnection *gc, const gchar *username, guint type) {
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
159 PurpleProtocolAttentionInterface *iface = NULL;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
160
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
161 g_return_val_if_fail(PURPLE_IS_PROTOCOL_ATTENTION(attn), FALSE);
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
162
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
163 iface = PURPLE_PROTOCOL_ATTENTION_GET_IFACE(attn);
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
164 if(iface && iface->send) {
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
165 return iface->send(attn, gc, username, type);
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
166 }
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
167
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
168 return FALSE;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
169 }
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
170
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
171 GList *
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
172 purple_protocol_attention_get_types(PurpleProtocolAttention *attn, PurpleAccount *account) {
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
173 PurpleProtocolAttentionInterface *iface = NULL;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
174
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
175 g_return_val_if_fail(PURPLE_IS_PROTOCOL_ATTENTION(attn), NULL);
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
176
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
177 iface = PURPLE_PROTOCOL_ATTENTION_GET_IFACE(attn);
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
178 if(iface && iface->get_types) {
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
179 return iface->get_types(attn, account);
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
180 }
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
181
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
182 return NULL;
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
183 }
ed15916ec9ed First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
184

mercurial