]> git.sesse.net Git - vlc/blob - plugins/gtk/gtk_modules.c
*Bugfixes, cleanings in gtk.
[vlc] / plugins / gtk / gtk_modules.c
1 /*****************************************************************************
2  * gtk_modules.c : functions to build modules configuration boxes.
3  *****************************************************************************
4  * Copyright (C) 2000, 2001 VideoLAN
5  * $Id: gtk_modules.c,v 1.2 2001/05/15 14:49:48 stef Exp $
6  *
7  * Authors: Samuel Hocevar <sam@zoy.org>
8  *          Stéphane Borel <stef@via.ecp.fr>
9  *      
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  * 
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
23  *****************************************************************************/
24
25 #define MODULE_NAME gtk
26 #include "modules_inner.h"
27
28 /*****************************************************************************
29  * Preamble
30  *****************************************************************************/
31 #include "defs.h"
32 #include <sys/types.h>                                              /* off_t */
33 #include <stdlib.h>
34
35 #include <gtk/gtk.h>
36
37 #include <string.h>
38
39 #include "config.h"
40 #include "common.h"
41 #include "threads.h"
42 #include "mtime.h"
43
44 #include "stream_control.h"
45 #include "input_ext-intf.h"
46
47 #include "interface.h"
48 #include "intf_playlist.h"
49 #include "intf_msg.h"
50
51 #include "gtk_callbacks.h"
52 #include "gtk_interface.h"
53 #include "gtk_support.h"
54 #include "gtk_playlist.h"
55 #include "intf_gtk.h"
56
57 #include "main.h"
58
59 gboolean GtkModulesShow( GtkWidget       *widget,
60                          GdkEventButton  *event,
61                          gpointer         user_data )
62 {
63     intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" );
64
65     if( !GTK_IS_WIDGET( p_intf->p_sys->p_modules ) )
66     {
67 //        p_intf->p_sys->p_modules = create_intf_modules();
68         gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_modules ),
69                              "p_intf", p_intf );
70     }
71     gtk_widget_show( p_intf->p_sys->p_modules );
72     gdk_window_raise( p_intf->p_sys->p_modules->window );
73
74     return FALSE;
75 }
76
77 void GtkModulesCancel( GtkButton * button, gpointer user_data )
78 {
79     intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_modules" );
80
81     gtk_widget_hide( p_intf->p_sys->p_modules );
82 }
83
84 /****************************************************************************
85  * Callbacks for menuitems
86  ****************************************************************************/
87 void GtkModulesActivate( GtkMenuItem * menuitem, gpointer user_data )
88 {
89     GtkModulesShow( GTK_WIDGET( menuitem ), NULL, user_data );
90 }