. nouveaux plugins - ne fonctionnent pas encore tous
[vlc.git] / plugins / gnome / intf_gnome_callbacks.c
1 #include "defs.h"
2
3 #include "config.h"
4 #include "common.h"
5 #include "threads.h"
6
7 #include <gnome.h>
8
9 #include "intf_gnome_thread.h"
10 #include "intf_gnome_callbacks.h"
11 #include "intf_gnome_interface.h"
12 #include "intf_gnome_support.h"
13
14 #define GET_GNOME_STRUCT( item, parent ) \
15 gtk_object_get_data( \
16     GTK_OBJECT( lookup_widget(GTK_WIDGET(item), parent) ), \
17     "p_gnome" );
18
19 void
20 on_modules_activate                    (GtkMenuItem     *menuitem,
21                                         gpointer         user_data)
22 {
23
24 }
25
26
27 void
28 on_exit_activate                       (GtkMenuItem     *menuitem,
29                                         gpointer         user_data)
30 {
31     gnome_thread_t *p_gnome;
32
33     p_gnome = GET_GNOME_STRUCT( menuitem, "intf_window" );
34
35     p_gnome->b_die = 1;
36 }
37
38
39 void
40 on_open_activate                       (GtkMenuItem     *menuitem,
41                                         gpointer         user_data)
42 {
43
44 }
45
46
47 void
48 on_preferences_activate                (GtkMenuItem     *menuitem,
49                                         gpointer         user_data)
50 {
51
52 }
53
54
55 void
56 on_plugins_activate                    (GtkMenuItem     *menuitem,
57                                         gpointer         user_data)
58 {
59
60 }
61
62
63 void
64 on_about_activate                      (GtkMenuItem     *menuitem,
65                                         gpointer         user_data)
66 {
67     gnome_thread_t *p_gnome;
68
69     p_gnome = GET_GNOME_STRUCT( menuitem, "intf_window" );
70
71     if( !GTK_IS_WIDGET( p_gnome->p_about ) )
72     {
73         p_gnome->p_about = create_intf_about ();
74     }
75     gtk_widget_show( p_gnome->p_about );
76 }
77
78
79 void
80 on_stop_clicked                        (GtkButton       *button,
81                                         gpointer         user_data)
82 {
83
84 }
85
86
87 void
88 on_control_activate                    (GtkMenuItem     *menuitem,
89                                         gpointer         user_data)
90 {
91     gnome_thread_t *p_gnome;
92
93     p_gnome = GET_GNOME_STRUCT( menuitem, "intf_window" );
94
95     /* lock the change structure */
96     vlc_mutex_lock( &p_gnome->change_lock );
97
98     if( p_gnome->b_window )
99     {
100         gtk_widget_hide( p_gnome->p_window );
101         p_gnome->b_window = 0;
102     }
103     else
104     {
105         if( !GTK_IS_WIDGET( p_gnome->p_window ) )
106         {
107             p_gnome->p_window = create_intf_window ();
108         }
109         gtk_widget_show( p_gnome->p_window );
110         gtk_object_set_data( GTK_OBJECT(p_gnome->p_window),
111                              "p_gnome", p_gnome );
112         p_gnome->b_window = 1;
113     }
114
115     /* unlock the change structure */
116     vlc_mutex_unlock( &p_gnome->change_lock );
117 }
118
119
120 void
121 on_playlist_activate                   (GtkMenuItem     *menuitem,
122                                         gpointer         user_data)
123 {
124     gnome_thread_t *p_gnome;
125
126     p_gnome = GET_GNOME_STRUCT( menuitem, "intf_window" );
127
128     /* lock the change structure */
129     vlc_mutex_lock( &p_gnome->change_lock );
130
131     if( p_gnome->b_playlist )
132     {
133         gtk_widget_hide( p_gnome->p_playlist );
134         p_gnome->b_playlist = 0;
135     }
136     else
137     {
138         if( !GTK_IS_WIDGET( p_gnome->p_playlist ) )
139         {
140             p_gnome->p_playlist = create_intf_playlist ();
141         }
142         gtk_widget_show( p_gnome->p_playlist );
143         gtk_object_set_data( GTK_OBJECT(p_gnome->p_playlist),
144                              "p_gnome", p_gnome );
145         p_gnome->b_playlist = 1;
146     }
147
148     /* unlock the change structure */
149     vlc_mutex_unlock( &p_gnome->change_lock );
150 }
151
152 void
153 on_popup_control_activate              (GtkMenuItem     *menuitem,
154                                         gpointer         user_data)
155 {
156     gnome_thread_t *p_gnome;
157
158     p_gnome = GET_GNOME_STRUCT( menuitem, "intf_popup" );
159
160     /* lock the change structure */
161     vlc_mutex_lock( &p_gnome->change_lock );
162
163     if( p_gnome->b_window )
164     {
165         gtk_widget_hide( p_gnome->p_window );
166         p_gnome->b_window = 0;
167     }
168     else
169     {
170         if( !GTK_IS_WIDGET( p_gnome->p_window ) )
171         {
172             p_gnome->p_window = create_intf_window ();
173         }
174         gtk_widget_show( p_gnome->p_window );
175         gtk_object_set_data( GTK_OBJECT(p_gnome->p_window),
176                              "p_gnome", p_gnome );
177         p_gnome->b_window = 1;
178     }
179
180     /* unlock the change structure */
181     vlc_mutex_unlock( &p_gnome->change_lock );
182 }
183
184
185 void
186 on_popup_playlist_activate             (GtkMenuItem     *menuitem,
187                                         gpointer         user_data)
188 {
189     gnome_thread_t *p_gnome;
190
191     p_gnome = GET_GNOME_STRUCT( menuitem, "intf_popup" );
192
193     /* lock the change structure */
194     vlc_mutex_lock( &p_gnome->change_lock );
195
196     if( p_gnome->b_playlist )
197     {
198         gtk_widget_hide( p_gnome->p_playlist );
199         p_gnome->b_playlist = 0;
200     }
201     else
202     {
203         if( !GTK_IS_WIDGET( p_gnome->p_playlist ) )
204         {
205             p_gnome->p_playlist = create_intf_playlist ();
206         }
207         gtk_widget_show( p_gnome->p_playlist );
208         gtk_object_set_data( GTK_OBJECT(p_gnome->p_playlist),
209                              "p_gnome", p_gnome );
210         p_gnome->b_playlist = 1;
211     }
212
213     /* unlock the change structure */
214     vlc_mutex_unlock( &p_gnome->change_lock );
215 }
216
217
218
219 void
220 on_popup_exit_activate                 (GtkMenuItem     *menuitem,
221                                         gpointer         user_data)
222 {
223     gnome_thread_t *p_gnome;
224
225     p_gnome = GET_GNOME_STRUCT( menuitem, "intf_popup" );
226
227     p_gnome->b_die = 1;
228 }
229
230
231 void
232 on_popup_about_activate                (GtkMenuItem     *menuitem,
233                                         gpointer         user_data)
234 {
235     gnome_thread_t *p_gnome;
236
237     p_gnome = GET_GNOME_STRUCT( menuitem, "intf_popup" );
238
239     if( !GTK_IS_WIDGET( p_gnome->p_about ) )
240     {
241         p_gnome->p_about = create_intf_about ();
242     }
243     gtk_widget_show( p_gnome->p_about );
244 }
245
246
247 void
248 on_intf_window_destroy                 (GtkObject       *object,
249                                         gpointer         user_data)
250 {
251    fprintf( stderr, "interface window destroyed !\n" );
252 }
253
254
255 void
256 on_intf_playlist_destroy               (GtkObject       *object,
257                                         gpointer         user_data)
258 {
259    fprintf( stderr, "playlist window destroyed !\n" );
260 }
261
262
263
264 void
265 on_channel1_activate                   (GtkMenuItem     *menuitem,
266                                         gpointer         user_data)
267 {
268
269 }
270
271
272 void
273 on_channel2_activate                   (GtkMenuItem     *menuitem,
274                                         gpointer         user_data)
275 {
276
277 }
278
279
280 void
281 on_channel3_activate                   (GtkMenuItem     *menuitem,
282                                         gpointer         user_data)
283 {
284
285 }
286
287
288 void
289 on_channel4_activate                   (GtkMenuItem     *menuitem,
290                                         gpointer         user_data)
291 {
292
293 }
294
295
296 void
297 on_channel5_activate                   (GtkMenuItem     *menuitem,
298                                         gpointer         user_data)
299 {
300
301 }
302
303
304 void
305 on_popup_channel1_activate             (GtkMenuItem     *menuitem,
306                                         gpointer         user_data)
307 {
308
309 }
310
311
312 void
313 on_popup_channel2_activate             (GtkMenuItem     *menuitem,
314                                         gpointer         user_data)
315 {
316
317 }
318
319
320 void
321 on_popup_channel3_activate             (GtkMenuItem     *menuitem,
322                                         gpointer         user_data)
323 {
324
325 }
326
327
328 void
329 on_popup_channel4_activate             (GtkMenuItem     *menuitem,
330                                         gpointer         user_data)
331 {
332
333 }
334
335
336 void
337 on_popup_channel5_activate             (GtkMenuItem     *menuitem,
338                                         gpointer         user_data)
339 {
340
341 }
342
343
344 void
345 on_popup_config_channels_activate      (GtkMenuItem     *menuitem,
346                                         gpointer         user_data)
347 {
348
349 }
350
351
352 void
353 on_config_channels_activate            (GtkMenuItem     *menuitem,
354                                         gpointer         user_data)
355 {
356
357 }
358
359
360 void
361 on_user_guide_activate                 (GtkMenuItem     *menuitem,
362                                         gpointer         user_data)
363 {
364
365 }
366
367
368 void
369 on_popup_stop_activate                 (GtkMenuItem     *menuitem,
370                                         gpointer         user_data)
371 {
372
373 }
374
375
376 void
377 on_popup_play_activate                 (GtkMenuItem     *menuitem,
378                                         gpointer         user_data)
379 {
380     gnome_thread_t *p_gnome;
381
382     p_gnome = GET_GNOME_STRUCT( menuitem, "intf_popup" );
383
384     vlc_mutex_lock( &p_gnome->change_lock );
385     p_gnome->b_activity_changed = 1;
386     p_gnome->b_activity = 1;
387     vlc_mutex_unlock( &p_gnome->change_lock );
388 }
389
390
391 void
392 on_playlist_close_clicked              (GtkButton       *button,
393                                         gpointer         user_data)
394 {
395
396 }
397
398
399 void
400 on_play_clicked                        (GtkButton       *button,
401                                         gpointer         user_data)
402 {
403     gnome_thread_t *p_gnome;
404
405     p_gnome = GET_GNOME_STRUCT( button, "intf_window" );
406
407     vlc_mutex_lock( &p_gnome->change_lock );
408     p_gnome->b_activity_changed = 1;
409     p_gnome->b_activity = 1;
410     vlc_mutex_unlock( &p_gnome->change_lock );
411 }
412
413
414 void
415 on_channel0_activate                   (GtkMenuItem     *menuitem,
416                                         gpointer         user_data)
417 {
418
419 }
420
421
422 void
423 on_popup_channel0_activate             (GtkMenuItem     *menuitem,
424                                         gpointer         user_data)
425 {
426
427 }
428
429
430 void
431 on_open_clicked                        (GtkButton       *button,
432                                         gpointer         user_data)
433 {
434     GnomeUIInfo test_uiinfo[] =
435     {
436         {
437             GNOME_APP_UI_ITEM, N_( "Barf" ),
438             NULL,
439             on_exit_activate, NULL, NULL,
440             GNOME_APP_PIXMAP_NONE, NULL,
441             0, 0, NULL
442         }
443     };
444
445     gnome_thread_t *p_gnome;
446
447     p_gnome = GET_GNOME_STRUCT( button, "intf_window" );
448
449     gnome_app_insert_menus (GNOME_APP (p_gnome->p_window),
450                               "_View/Channel/None",
451                               test_uiinfo);
452 }
453
454
455 void
456 on_pause_clicked                       (GtkButton       *button,
457                                         gpointer         user_data)
458 {
459     gnome_thread_t *p_gnome;
460
461     p_gnome = GET_GNOME_STRUCT( button, "intf_window" );
462
463     vlc_mutex_lock( &p_gnome->change_lock );
464     p_gnome->b_activity_changed = 1;
465     p_gnome->b_activity = 0;
466     vlc_mutex_unlock( &p_gnome->change_lock );
467 }
468
469
470 void
471 on_popup_pause_activate                (GtkMenuItem     *menuitem,
472                                         gpointer         user_data)
473 {
474     gnome_thread_t *p_gnome;
475
476     p_gnome = GET_GNOME_STRUCT( menuitem, "intf_popup" );
477
478     vlc_mutex_lock( &p_gnome->change_lock );
479     p_gnome->b_activity_changed = 1;
480     p_gnome->b_activity = 0;
481     vlc_mutex_unlock( &p_gnome->change_lock );
482 }
483
484
485
486 void
487 on_mute_clicked                        (GtkButton       *button,
488                                         gpointer         user_data)
489 {
490
491 }
492
493
494 void
495 on_popup_mute_activate                 (GtkMenuItem     *menuitem,
496                                         gpointer         user_data)
497 {
498
499 }
500