comparison libpurple/media/enum-types.c @ 29141:ab1e29779722

Split the media API's enum types out into its own file.
author maiku@pidgin.im
date Wed, 21 Oct 2009 20:58:32 +0000
parents
children
comparison
equal deleted inserted replaced
29140:fb2c0674e828 29141:ab1e29779722
1 /**
2 * @file enum-types.c Enum types for Media API
3 * @ingroup core
4 */
5
6 /* purple
7 *
8 * Purple is the legal property of its developers, whose names are too numerous
9 * to list here. Please refer to the COPYRIGHT file distributed with this
10 * source distribution.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
25 */
26
27 #include "enum-types.h"
28
29 /*
30 * PurpleMediaCandidateType
31 */
32
33 GType
34 purple_media_candidate_type_get_type()
35 {
36 static GType type = 0;
37 if (type == 0) {
38 static const GEnumValue values[] = {
39 { PURPLE_MEDIA_CANDIDATE_TYPE_HOST,
40 "PURPLE_MEDIA_CANDIDATE_TYPE_HOST",
41 "host" },
42 { PURPLE_MEDIA_CANDIDATE_TYPE_SRFLX,
43 "PURPLE_MEDIA_CANDIDATE_TYPE_SRFLX",
44 "srflx" },
45 { PURPLE_MEDIA_CANDIDATE_TYPE_PRFLX,
46 "PURPLE_MEDIA_CANDIDATE_TYPE_PRFLX",
47 "prflx" },
48 { PURPLE_MEDIA_CANDIDATE_TYPE_RELAY,
49 "PURPLE_MEDIA_CANDIDATE_TYPE_RELAY",
50 "relay" },
51 { PURPLE_MEDIA_CANDIDATE_TYPE_MULTICAST,
52 "PURPLE_MEDIA_CANDIDATE_TYPE_MULTICAST",
53 "multicast" },
54 { 0, NULL, NULL }
55 };
56 type = g_enum_register_static("PurpleMediaCandidateType",
57 values);
58 }
59 return type;
60 }
61
62 /*
63 * PurpleMediaCaps
64 */
65
66 GType
67 purple_media_caps_get_type()
68 {
69 static GType type = 0;
70 if (type == 0) {
71 static const GEnumValue values[] = {
72 { PURPLE_MEDIA_CAPS_NONE,
73 "PURPLE_MEDIA_CAPS_NONE", "none" },
74 { PURPLE_MEDIA_CAPS_AUDIO,
75 "PURPLE_MEDIA_CAPS_AUDIO", "audio" },
76 { PURPLE_MEDIA_CAPS_AUDIO_SINGLE_DIRECTION,
77 "PURPLE_MEDIA_CAPS_AUDIO_SINGLE_DIRECTION",
78 "audio-single-direction" },
79 { PURPLE_MEDIA_CAPS_VIDEO,
80 "PURPLE_MEDIA_CAPS_VIDEO", "video" },
81 { PURPLE_MEDIA_CAPS_VIDEO_SINGLE_DIRECTION,
82 "PURPLE_MEDIA_CAPS_VIDEO_SINGLE_DIRECTION",
83 "video-single-direction" },
84 { PURPLE_MEDIA_CAPS_AUDIO_VIDEO,
85 "PURPLE_MEDIA_CAPS_AUDIO_VIDEO",
86 "audio-video" },
87 { PURPLE_MEDIA_CAPS_MODIFY_SESSION,
88 "PURPLE_MEDIA_CAPS_MODIFY_SESSION",
89 "modify-session" },
90 { PURPLE_MEDIA_CAPS_CHANGE_DIRECTION,
91 "PURPLE_MEDIA_CAPS_CHANGE_DIRECTION",
92 "change-direction" },
93 { 0, NULL, NULL }
94 };
95 type = g_enum_register_static("PurpleMediaCaps", values);
96 }
97 return type;
98 }
99
100 /*
101 * PurpleMediaInfoType
102 */
103
104 GType
105 purple_media_info_type_get_type()
106 {
107 static GType type = 0;
108 if (type == 0) {
109 static const GEnumValue values[] = {
110 { PURPLE_MEDIA_INFO_HANGUP,
111 "PURPLE_MEDIA_INFO_HANGUP", "hangup" },
112 { PURPLE_MEDIA_INFO_ACCEPT,
113 "PURPLE_MEDIA_INFO_ACCEPT", "accept" },
114 { PURPLE_MEDIA_INFO_REJECT,
115 "PURPLE_MEDIA_INFO_REJECT", "reject" },
116 { PURPLE_MEDIA_INFO_MUTE,
117 "PURPLE_MEDIA_INFO_MUTE", "mute" },
118 { PURPLE_MEDIA_INFO_UNMUTE,
119 "PURPLE_MEDIA_INFO_UNMUTE", "unmute" },
120 { PURPLE_MEDIA_INFO_PAUSE,
121 "PURPLE_MEDIA_INFO_PAUSE", "pause" },
122 { PURPLE_MEDIA_INFO_UNPAUSE,
123 "PURPLE_MEDIA_INFO_UNPAUSE", "unpause" },
124 { PURPLE_MEDIA_INFO_HOLD,
125 "PURPLE_MEDIA_INFO_HOLD", "hold" },
126 { PURPLE_MEDIA_INFO_UNHOLD,
127 "PURPLE_MEDIA_INFO_HOLD", "unhold" },
128 { 0, NULL, NULL }
129 };
130 type = g_enum_register_static("PurpleMediaInfoType", values);
131 }
132 return type;
133 }
134
135 /*
136 * PurpleMediaNetworkProtocol
137 */
138
139 GType
140 purple_media_network_protocol_get_type()
141 {
142 static GType type = 0;
143 if (type == 0) {
144 static const GEnumValue values[] = {
145 { PURPLE_MEDIA_NETWORK_PROTOCOL_UDP,
146 "PURPLE_MEDIA_NETWORK_PROTOCOL_UDP",
147 "udp" },
148 { PURPLE_MEDIA_NETWORK_PROTOCOL_TCP,
149 "PURPLE_MEDIA_NETWORK_PROTOCOL_TCP",
150 "tcp" },
151 { 0, NULL, NULL }
152 };
153 type = g_enum_register_static("PurpleMediaNetworkProtocol",
154 values);
155 }
156 return type;
157 }
158
159 /*
160 * PurpleMediaSessionType
161 */
162
163 GType
164 purple_media_session_type_get_type()
165 {
166 static GType type = 0;
167 if (type == 0) {
168 static const GFlagsValue values[] = {
169 { PURPLE_MEDIA_NONE,
170 "PURPLE_MEDIA_NONE", "none" },
171 { PURPLE_MEDIA_RECV_AUDIO,
172 "PURPLE_MEDIA_RECV_AUDIO", "recv-audio" },
173 { PURPLE_MEDIA_SEND_AUDIO,
174 "PURPLE_MEDIA_SEND_AUDIO", "send-audio" },
175 { PURPLE_MEDIA_RECV_VIDEO,
176 "PURPLE_MEDIA_RECV_VIDEO", "recv-video" },
177 { PURPLE_MEDIA_SEND_VIDEO,
178 "PURPLE_MEDIA_SEND_VIDEO", "send-audio" },
179 { PURPLE_MEDIA_AUDIO,
180 "PURPLE_MEDIA_AUDIO", "audio" },
181 { PURPLE_MEDIA_VIDEO,
182 "PURPLE_MEDIA_VIDEO", "video" },
183 { 0, NULL, NULL }
184 };
185 type = g_flags_register_static(
186 "PurpleMediaSessionType", values);
187 }
188 return type;
189 }
190
191 /*
192 * PurpleMediaState
193 */
194
195 GType
196 purple_media_state_changed_get_type()
197 {
198 static GType type = 0;
199 if (type == 0) {
200 static const GEnumValue values[] = {
201 { PURPLE_MEDIA_STATE_NEW,
202 "PURPLE_MEDIA_STATE_NEW", "new" },
203 { PURPLE_MEDIA_STATE_CONNECTED,
204 "PURPLE_MEDIA_STATE_CONNECTED", "connected" },
205 { PURPLE_MEDIA_STATE_END,
206 "PURPLE_MEDIA_STATE_END", "end" },
207 { 0, NULL, NULL }
208 };
209 type = g_enum_register_static("PurpleMediaState", values);
210 }
211 return type;
212 }
213