Fri, 14 Feb 2020 01:49:34 -0600
closing merged branch
|
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 { |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | const gchar *name; |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | const gchar *incoming_description; |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | const gchar *outgoing_description; |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | const gchar *icon_name; |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | const gchar *unlocalized_name; |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | }; |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | G_DEFINE_BOXED_TYPE( |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
36 | PurpleAttentionType, |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | purple_attention_type, |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | purple_attention_type_copy, |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | g_free |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | ); |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | PurpleAttentionType * |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 | 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
|
44 | const gchar *name, |
|
38861
21858f98040c
Address the issues that Qulogic found
Gary Kramlich <grim@reaperworld.com>
parents:
38859
diff
changeset
|
45 | const gchar *incoming_description, |
|
21858f98040c
Address the issues that Qulogic found
Gary Kramlich <grim@reaperworld.com>
parents:
38859
diff
changeset
|
46 | const gchar *outgoing_description) |
|
38859
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
47 | { |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
48 | 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
|
49 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
50 | attn->unlocalized_name = unlocalized_name; |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | attn->name = name; |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
52 | attn->incoming_description = incoming_description; |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
53 | attn->outgoing_description = outgoing_description; |
|
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 | return attn; |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
56 | } |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
57 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
58 | PurpleAttentionType * |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
59 | 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
|
60 | PurpleAttentionType *attn_copy = NULL; |
|
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 | 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
|
63 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
64 | 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
|
65 | *attn_copy = *attn; |
|
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 | return attn_copy; |
|
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 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
70 | const gchar * |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
71 | 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
|
72 | 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
|
73 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
74 | return type->name; |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
75 | } |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
76 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
77 | void |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
78 | 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
|
79 | g_return_if_fail(type); |
|
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 | type->name = name; |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
82 | } |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
83 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
84 | const gchar * |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
85 | 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
|
86 | 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
|
87 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
88 | return type->incoming_description; |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
89 | } |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
90 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
91 | void |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
92 | 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
|
93 | g_return_if_fail(type); |
|
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 | type->incoming_description = desc; |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
96 | } |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
97 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
98 | const gchar * |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
99 | 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
|
100 | 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
|
101 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
102 | return type->outgoing_description; |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
103 | } |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
104 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
105 | void |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
106 | 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
|
107 | 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
|
108 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
109 | type->outgoing_description = desc; |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
110 | } |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
111 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
112 | const gchar * |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
113 | 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
|
114 | 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
|
115 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
116 | 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
|
117 | return NULL; |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
118 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
119 | return type->icon_name; |
|
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 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
122 | void |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
123 | 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
|
124 | g_return_if_fail(type); |
|
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 | type->icon_name = name; |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
127 | } |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
128 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
129 | const gchar * |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
130 | 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
|
131 | 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
|
132 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
133 | return type->unlocalized_name; |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
134 | } |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
135 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
136 | void |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
137 | 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
|
138 | g_return_if_fail(type); |
|
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 | type->unlocalized_name = ulname; |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
141 | } |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
142 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
143 | /****************************************************************************** |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
144 | * PurpleAttentionType API |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
145 | *****************************************************************************/ |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
146 | 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
|
147 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
148 | static void |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
149 | 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
|
150 | } |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
151 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
152 | gboolean |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
153 | 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
|
154 | PurpleProtocolAttentionInterface *iface = NULL; |
|
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 | 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
|
157 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
158 | 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
|
159 | if(iface && iface->send) { |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
160 | 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
|
161 | } |
|
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 | return FALSE; |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
164 | } |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
165 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
166 | GList * |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
167 | 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
|
168 | PurpleProtocolAttentionInterface *iface = NULL; |
|
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 | 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
|
171 | |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
172 | 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
|
173 | if(iface && iface->get_types) { |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
174 | 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
|
175 | } |
|
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 | return NULL; |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
178 | } |
|
ed15916ec9ed
First pass at moving attention to it's own files
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
179 |