35 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_NAVIGATION)) |
35 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_NAVIGATION)) |
36 #define GST_NAVIGATION_GET_IFACE(obj) \ |
36 #define GST_NAVIGATION_GET_IFACE(obj) \ |
37 (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GST_TYPE_NAVIGATION, GstNavigationInterface)) |
37 (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GST_TYPE_NAVIGATION, GstNavigationInterface)) |
38 |
38 |
39 typedef struct _GstNavigation GstNavigation; |
39 typedef struct _GstNavigation GstNavigation; |
40 |
40 typedef struct _GstNavigationInterface GstNavigationInterface; |
41 typedef struct _GstNavigationInterface { |
41 |
|
42 struct _GstNavigationInterface { |
42 GTypeInterface g_iface; |
43 GTypeInterface g_iface; |
43 |
44 |
44 /* virtual functions */ |
45 /* virtual functions */ |
45 void (*send_event) (GstNavigation *navigation, GstStructure *structure); |
46 void (*send_event) (GstNavigation *navigation, GstStructure *structure); |
46 |
47 |
47 gpointer _gst_reserved[GST_PADDING]; |
48 gpointer _gst_reserved[GST_PADDING]; |
48 } GstNavigationInterface; |
49 }; |
49 #ifdef __SYMBIAN32__ |
50 #ifdef __SYMBIAN32__ |
50 IMPORT_C |
51 IMPORT_C |
51 #endif |
52 #endif |
52 |
53 |
53 |
54 |
54 GType gst_navigation_get_type (void); |
55 GType gst_navigation_get_type (void); |
55 |
56 |
56 /* virtual class function wrappers */ |
57 /* Navigation commands */ |
57 #ifdef __SYMBIAN32__ |
58 |
58 IMPORT_C |
59 /** |
59 #endif |
60 * GstNavigationCommand: |
60 |
61 * @GST_NAVIGATION_COMMAND_INVALID: An invalid command entry |
61 void gst_navigation_send_event (GstNavigation *navigation, GstStructure *structure); |
62 * @GST_NAVIGATION_COMMAND_MENU1: Execute navigation menu command 1. For DVD, |
62 #ifdef __SYMBIAN32__ |
63 * this enters the DVD root menu, or exits back to the title from the menu. |
63 IMPORT_C |
64 * @GST_NAVIGATION_COMMAND_MENU2: Execute navigation menu command 2. For DVD, |
64 #endif |
65 * this jumps to the DVD title menu. |
65 |
66 * @GST_NAVIGATION_COMMAND_MENU3: Execute navigation menu command 3. For DVD, |
|
67 * this jumps into the DVD root menu. |
|
68 * @GST_NAVIGATION_COMMAND_MENU4: Execute navigation menu command 4. For DVD, |
|
69 * this jumps to the Subpicture menu. |
|
70 * @GST_NAVIGATION_COMMAND_MENU5: Execute navigation menu command 5. For DVD, |
|
71 * the jumps to the audio menu. |
|
72 * @GST_NAVIGATION_COMMAND_MENU6: Execute navigation menu command 6. For DVD, |
|
73 * this jumps to the angles menu. |
|
74 * @GST_NAVIGATION_COMMAND_MENU7: Execute navigation menu command 7. For DVD, |
|
75 * this jumps to the chapter menu. |
|
76 * @GST_NAVIGATION_COMMAND_LEFT: Select the next button to the left in a menu, |
|
77 * if such a button exists. |
|
78 * @GST_NAVIGATION_COMMAND_RIGHT: Select the next button to the right in a menu, |
|
79 * if such a button exists. |
|
80 * @GST_NAVIGATION_COMMAND_UP: Select the button above the current one in a |
|
81 * menu, if such a button exists. |
|
82 * @GST_NAVIGATION_COMMAND_DOWN: Select the button below the current one in a |
|
83 * menu, if such a button exists. |
|
84 * @GST_NAVIGATION_COMMAND_ACTIVATE: Activate (click) the currently selected |
|
85 * button in a menu, if such a button exists. |
|
86 * @GST_NAVIGATION_COMMAND_PREV_ANGLE: Switch to the previous angle in a |
|
87 * multiangle feature. |
|
88 * @GST_NAVIGATION_COMMAND_NEXT_ANGLE: Switch to the next angle in a multiangle |
|
89 * feature. |
|
90 * |
|
91 * A set of commands that may be issued to an element providing the |
|
92 * #GstNavigation interface. The available commands can be queried via |
|
93 * the gst_navigation_query_new_commands() query. |
|
94 * |
|
95 * For convenience in handling DVD navigation, the MENU commands are aliased as: |
|
96 * GST_NAVIGATION_COMMAND_DVD_MENU = @GST_NAVIGATION_COMMAND_MENU1 |
|
97 * GST_NAVIGATION_COMMAND_DVD_TITLE_MENU = @GST_NAVIGATION_COMMAND_MENU2 |
|
98 * GST_NAVIGATION_COMMAND_DVD_ROOT_MENU = @GST_NAVIGATION_COMMAND_MENU3 |
|
99 * GST_NAVIGATION_COMMAND_DVD_SUBPICTURE_MENU = @GST_NAVIGATION_COMMAND_MENU4 |
|
100 * GST_NAVIGATION_COMMAND_DVD_AUDIO_MENU = @GST_NAVIGATION_COMMAND_MENU5 |
|
101 * GST_NAVIGATION_COMMAND_DVD_ANGLE_MENU = @GST_NAVIGATION_COMMAND_MENU6 |
|
102 * GST_NAVIGATION_COMMAND_DVD_CHAPTER_MENU = @GST_NAVIGATION_COMMAND_MENU7 |
|
103 * |
|
104 * Since: 0.10.23 |
|
105 */ |
|
106 typedef enum { |
|
107 GST_NAVIGATION_COMMAND_INVALID = 0, |
|
108 |
|
109 GST_NAVIGATION_COMMAND_MENU1 = 1, |
|
110 GST_NAVIGATION_COMMAND_MENU2 = 2, |
|
111 GST_NAVIGATION_COMMAND_MENU3 = 3, |
|
112 GST_NAVIGATION_COMMAND_MENU4 = 4, |
|
113 GST_NAVIGATION_COMMAND_MENU5 = 5, |
|
114 GST_NAVIGATION_COMMAND_MENU6 = 6, |
|
115 GST_NAVIGATION_COMMAND_MENU7 = 7, |
|
116 |
|
117 GST_NAVIGATION_COMMAND_LEFT = 20, |
|
118 GST_NAVIGATION_COMMAND_RIGHT = 21, |
|
119 GST_NAVIGATION_COMMAND_UP = 22, |
|
120 GST_NAVIGATION_COMMAND_DOWN = 23, |
|
121 GST_NAVIGATION_COMMAND_ACTIVATE = 24, |
|
122 |
|
123 GST_NAVIGATION_COMMAND_PREV_ANGLE = 30, |
|
124 GST_NAVIGATION_COMMAND_NEXT_ANGLE = 31 |
|
125 } GstNavigationCommand; |
|
126 |
|
127 /* Some aliases for the menu command types */ |
|
128 #define GST_NAVIGATION_COMMAND_DVD_MENU GST_NAVIGATION_COMMAND_MENU1 |
|
129 #define GST_NAVIGATION_COMMAND_DVD_TITLE_MENU GST_NAVIGATION_COMMAND_MENU2 |
|
130 #define GST_NAVIGATION_COMMAND_DVD_ROOT_MENU GST_NAVIGATION_COMMAND_MENU3 |
|
131 #define GST_NAVIGATION_COMMAND_DVD_SUBPICTURE_MENU GST_NAVIGATION_COMMAND_MENU4 |
|
132 #define GST_NAVIGATION_COMMAND_DVD_AUDIO_MENU GST_NAVIGATION_COMMAND_MENU5 |
|
133 #define GST_NAVIGATION_COMMAND_DVD_ANGLE_MENU GST_NAVIGATION_COMMAND_MENU6 |
|
134 #define GST_NAVIGATION_COMMAND_DVD_CHAPTER_MENU GST_NAVIGATION_COMMAND_MENU7 |
|
135 |
|
136 /* Queries */ |
|
137 typedef enum |
|
138 { |
|
139 GST_NAVIGATION_QUERY_INVALID = 0, |
|
140 GST_NAVIGATION_QUERY_COMMANDS = 1, |
|
141 GST_NAVIGATION_QUERY_ANGLES = 2 |
|
142 } GstNavigationQueryType; |
|
143 #ifdef __SYMBIAN32__ |
|
144 IMPORT_C |
|
145 #endif |
|
146 |
|
147 |
|
148 GstNavigationQueryType gst_navigation_query_get_type (GstQuery *query); |
|
149 #ifdef __SYMBIAN32__ |
|
150 IMPORT_C |
|
151 #endif |
|
152 |
|
153 |
|
154 GstQuery *gst_navigation_query_new_commands (void); |
|
155 #ifdef __SYMBIAN32__ |
|
156 IMPORT_C |
|
157 #endif |
|
158 |
|
159 void gst_navigation_query_set_commands (GstQuery *query, gint n_cmds, ...); |
|
160 #ifdef __SYMBIAN32__ |
|
161 IMPORT_C |
|
162 #endif |
|
163 |
|
164 void gst_navigation_query_set_commandsv (GstQuery *query, gint n_cmds, |
|
165 GstNavigationCommand *cmds); |
|
166 #ifdef __SYMBIAN32__ |
|
167 IMPORT_C |
|
168 #endif |
|
169 |
|
170 gboolean gst_navigation_query_parse_commands_length (GstQuery *query, |
|
171 guint *n_cmds); |
|
172 #ifdef __SYMBIAN32__ |
|
173 IMPORT_C |
|
174 #endif |
|
175 |
|
176 gboolean gst_navigation_query_parse_commands_nth (GstQuery *query, guint nth, |
|
177 GstNavigationCommand *cmd); |
|
178 #ifdef __SYMBIAN32__ |
|
179 IMPORT_C |
|
180 #endif |
|
181 |
|
182 |
|
183 GstQuery *gst_navigation_query_new_angles (void); |
|
184 #ifdef __SYMBIAN32__ |
|
185 IMPORT_C |
|
186 #endif |
|
187 |
|
188 void gst_navigation_query_set_angles (GstQuery *query, guint cur_angle, |
|
189 guint n_angles); |
|
190 #ifdef __SYMBIAN32__ |
|
191 IMPORT_C |
|
192 #endif |
|
193 |
|
194 gboolean gst_navigation_query_parse_angles (GstQuery *query, guint *cur_angle, |
|
195 guint *n_angles); |
|
196 |
|
197 /* Element messages */ |
|
198 /** |
|
199 * GstNavigationMessageType: |
|
200 * @GST_NAVIGATION_MESSAGE_INVALID: Returned from |
|
201 * gst_navigation_message_get_type() when the passed message is not a |
|
202 * navigation message. |
|
203 * @GST_NAVIGATION_MESSAGE_MOUSE_OVER: Sent when the mouse moves over or leaves a |
|
204 * clickable region of the output, such as a DVD menu button. |
|
205 * @GST_NAVIGATION_MESSAGE_COMMANDS_CHANGED: Sent when the set of available commands |
|
206 * changes and should re-queried by interested applications. |
|
207 * @GST_NAVIGATION_MESSAGE_ANGLES_CHANGED: Sent when display angles in a multi-angle |
|
208 * feature (such as a multiangle DVD) change - either angles have appeared or |
|
209 * disappeared. |
|
210 * |
|
211 * A set of notifications that may be received on the bus when navigation |
|
212 * related status changes. |
|
213 * |
|
214 * Since: 0.10.23 |
|
215 */ |
|
216 typedef enum { |
|
217 GST_NAVIGATION_MESSAGE_INVALID, |
|
218 GST_NAVIGATION_MESSAGE_MOUSE_OVER, |
|
219 GST_NAVIGATION_MESSAGE_COMMANDS_CHANGED, |
|
220 GST_NAVIGATION_MESSAGE_ANGLES_CHANGED |
|
221 } GstNavigationMessageType; |
|
222 #ifdef __SYMBIAN32__ |
|
223 IMPORT_C |
|
224 #endif |
|
225 |
|
226 |
|
227 GstNavigationMessageType gst_navigation_message_get_type (GstMessage *message); |
|
228 #ifdef __SYMBIAN32__ |
|
229 IMPORT_C |
|
230 #endif |
|
231 |
|
232 |
|
233 GstMessage *gst_navigation_message_new_mouse_over (GstObject *src, |
|
234 gboolean active); |
|
235 #ifdef __SYMBIAN32__ |
|
236 IMPORT_C |
|
237 #endif |
|
238 |
|
239 gboolean gst_navigation_message_parse_mouse_over (GstMessage *message, |
|
240 gboolean *active); |
|
241 #ifdef __SYMBIAN32__ |
|
242 IMPORT_C |
|
243 #endif |
|
244 |
|
245 |
|
246 GstMessage *gst_navigation_message_new_commands_changed (GstObject *src); |
|
247 #ifdef __SYMBIAN32__ |
|
248 IMPORT_C |
|
249 #endif |
|
250 |
|
251 |
|
252 GstMessage *gst_navigation_message_new_angles_changed (GstObject *src, |
|
253 guint cur_angle, |
|
254 guint n_angles); |
|
255 #ifdef __SYMBIAN32__ |
|
256 IMPORT_C |
|
257 #endif |
|
258 |
|
259 gboolean gst_navigation_message_parse_angles_changed (GstMessage *message, |
|
260 guint *cur_angle, |
|
261 guint *n_angles); |
|
262 |
|
263 /* event parsing functions */ |
|
264 /** |
|
265 * GstNavigationEventType: |
|
266 * @GST_NAVIGATION_EVENT_INVALID: Returned from |
|
267 * gst_navigation_event_get_type() when the passed event is not a navigation event. |
|
268 * @GST_NAVIGATION_EVENT_KEY_PRESS: A key press event. Use |
|
269 * gst_navigation_event_parse_key_event() to extract the details from the event. |
|
270 * @GST_NAVIGATION_EVENT_KEY_RELEASE: A key release event. Use |
|
271 * gst_navigation_event_parse_key_event() to extract the details from the event. |
|
272 * @GST_NAVIGATION_EVENT_MOUSE_BUTTON_PRESS: A mouse button press event. Use |
|
273 * gst_navigation_event_parse_mouse_button_event() to extract the details from the |
|
274 * event. |
|
275 * @GST_NAVIGATION_EVENT_MOUSE_BUTTON_RELEASE: A mouse button release event. Use |
|
276 * gst_navigation_event_parse_mouse_button_event() to extract the details from the |
|
277 * event. |
|
278 * @GST_NAVIGATION_EVENT_MOUSE_MOVE: A mouse movement event. Use |
|
279 * gst_navigation_event_parse_mouse_move_event() to extract the details from the |
|
280 * event. |
|
281 * @GST_NAVIGATION_EVENT_COMMAND: A navigation command event. Use |
|
282 * gst_navigation_event_parse_command() to extract the details from the event. |
|
283 * |
|
284 * Enum values for the various events that an element implementing the |
|
285 * GstNavigation interface might send up the pipeline. |
|
286 * |
|
287 * Since: 0.10.23 |
|
288 */ |
|
289 typedef enum { |
|
290 GST_NAVIGATION_EVENT_INVALID = 0, |
|
291 GST_NAVIGATION_EVENT_KEY_PRESS = 1, |
|
292 GST_NAVIGATION_EVENT_KEY_RELEASE = 2, |
|
293 GST_NAVIGATION_EVENT_MOUSE_BUTTON_PRESS = 3, |
|
294 GST_NAVIGATION_EVENT_MOUSE_BUTTON_RELEASE = 4, |
|
295 GST_NAVIGATION_EVENT_MOUSE_MOVE = 5, |
|
296 GST_NAVIGATION_EVENT_COMMAND = 6 |
|
297 } GstNavigationEventType; |
|
298 #ifdef __SYMBIAN32__ |
|
299 IMPORT_C |
|
300 #endif |
|
301 |
|
302 |
|
303 GstNavigationEventType gst_navigation_event_get_type (GstEvent *event); |
|
304 #ifdef __SYMBIAN32__ |
|
305 IMPORT_C |
|
306 #endif |
|
307 |
|
308 gboolean gst_navigation_event_parse_key_event (GstEvent *event, |
|
309 const gchar **key); |
|
310 #ifdef __SYMBIAN32__ |
|
311 IMPORT_C |
|
312 #endif |
|
313 |
|
314 gboolean gst_navigation_event_parse_mouse_button_event (GstEvent *event, |
|
315 gint *button, gdouble *x, gdouble *y); |
|
316 #ifdef __SYMBIAN32__ |
|
317 IMPORT_C |
|
318 #endif |
|
319 |
|
320 gboolean gst_navigation_event_parse_mouse_move_event (GstEvent *event, |
|
321 gdouble *x, gdouble *y); |
|
322 #ifdef __SYMBIAN32__ |
|
323 IMPORT_C |
|
324 #endif |
|
325 |
|
326 gboolean gst_navigation_event_parse_command (GstEvent *event, |
|
327 GstNavigationCommand *command); |
|
328 |
|
329 /* interface virtual function wrappers */ |
|
330 #ifdef __SYMBIAN32__ |
|
331 IMPORT_C |
|
332 #endif |
|
333 |
|
334 void gst_navigation_send_event (GstNavigation *navigation, |
|
335 GstStructure *structure); |
|
336 #ifdef __SYMBIAN32__ |
|
337 IMPORT_C |
|
338 #endif |
66 |
339 |
67 void gst_navigation_send_key_event (GstNavigation *navigation, |
340 void gst_navigation_send_key_event (GstNavigation *navigation, |
68 const char *event, const char *key); |
341 const char *event, const char *key); |
69 #ifdef __SYMBIAN32__ |
342 #ifdef __SYMBIAN32__ |
70 IMPORT_C |
343 IMPORT_C |
71 #endif |
344 #endif |
72 |
345 |
73 void gst_navigation_send_mouse_event (GstNavigation *navigation, |
346 void gst_navigation_send_mouse_event (GstNavigation *navigation, |
74 const char *event, int button, double x, double y); |
347 const char *event, int button, double x, double y); |
|
348 #ifdef __SYMBIAN32__ |
|
349 IMPORT_C |
|
350 #endif |
|
351 |
|
352 void gst_navigation_send_command (GstNavigation *navigation, |
|
353 GstNavigationCommand command); |
75 |
354 |
76 G_END_DECLS |
355 G_END_DECLS |
77 |
356 |
78 #endif /* __GST_NAVIGATION_H__ */ |
357 #endif /* __GST_NAVIGATION_H__ */ |