]> git.sesse.net Git - vlc/blob - plugins/gtk/gtk_common.h
* Fixed a bug that made vlc segfault when choosing a program, change to
[vlc] / plugins / gtk / gtk_common.h
1 /*****************************************************************************
2  * gtk_common.h: private Gtk+ interface description
3  *****************************************************************************
4  * Copyright (C) 1999, 2000 VideoLAN
5  * $Id: gtk_common.h,v 1.6 2002/03/25 02:06:24 jobi Exp $
6  *
7  * Authors: Samuel Hocevar <sam@zoy.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  * 
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24 /*****************************************************************************
25  * Drag'n'drop stuff
26  *****************************************************************************/
27 #define DROP_ACCEPT_TEXT_URI_LIST  0
28 #define DROP_ACCEPT_TEXT_PLAIN     1
29 #define DROP_ACCEPT_STRING         2
30
31 #define MAX_ATEXIT                 10
32
33 /*****************************************************************************
34  * Useful inline function
35  ****************************************************************************/
36 static __inline__ intf_thread_t * GetIntf( GtkWidget *item, char * psz_parent )
37 {
38     return( gtk_object_get_data( GTK_OBJECT( lookup_widget(item, psz_parent) ),
39                                                      "p_intf" ) );
40 }
41
42 /*****************************************************************************
43  * intf_sys_t: description and status of Gtk+ interface
44  *****************************************************************************/
45 typedef struct intf_sys_s
46 {
47     /* special actions */
48     boolean_t           b_playing;
49     boolean_t           b_popup_changed;                   /* display menu ? */
50     boolean_t           b_window_changed;        /* window display toggled ? */
51     boolean_t           b_playlist_changed;    /* playlist display toggled ? */
52     boolean_t           b_slider_free;                      /* slider status */
53
54     /* menus handlers */
55     boolean_t           b_program_update;   /* do we need to update programs 
56                                                                         menu */
57     boolean_t           b_title_update;  /* do we need to update title menus */
58     boolean_t           b_chapter_update;            /* do we need to update
59                                                                chapter menus */
60     boolean_t           b_audio_update;  /* do we need to update audio menus */
61     boolean_t           b_spu_update;      /* do we need to update spu menus */
62
63     /* windows and widgets */
64     GtkWidget *         p_window;                             /* main window */
65     GtkWidget *         p_popup;                               /* popup menu */
66     GtkWidget *         p_playlist;                              /* playlist */
67     GtkWidget *         p_modules;                         /* module manager */
68     GtkWidget *         p_about;                             /* about window */
69     GtkWidget *         p_fileopen;                      /* file open window */
70     GtkWidget *         p_disc;                     /* disc selection window */
71     GtkWidget *         p_sat;                       /* sat selection window */
72     GtkWidget *         p_network;                  /* network stream window */
73     GtkWidget *         p_jump;                               /* jump window */
74
75     /* The slider */
76     GtkFrame *          p_slider_frame;
77     GtkAdjustment *     p_adj;                   /* slider adjustment object */
78     float               f_adj_oldvalue;                    /* previous value */
79
80     /* The messages window */
81     GtkWidget *         p_messages;                       /* messages window */
82     GtkText *           p_messages_text;                   /* messages frame */
83     intf_subscription_t*p_sub;                     /* interface subscription */
84
85     /* Playlist management */
86     int                 i_playing;                 /* playlist selected item */
87
88     /* The window labels for DVD mode */
89     GtkLabel *          p_label_title;
90     GtkLabel *          p_label_chapter;
91     gint                i_part;                           /* current chapter */
92
93     /* XXX: Ugly kludge, see gtk.c */
94     void             ( *pf_callback[MAX_ATEXIT] ) ( void );
95
96 } intf_sys_t;
97
98 /*****************************************************************************
99  * Prototypes
100  *****************************************************************************/
101 gint GtkModeManage   ( intf_thread_t * p_intf );
102 void GtkDisplayDate  ( GtkAdjustment *p_adj );
103