]> git.sesse.net Git - vlc/blob - include/interface.h
32cc4b1cc699689278b59cf5be379259fce31de0
[vlc] / include / interface.h
1 /*****************************************************************************
2  * interface.h: interface access for other threads
3  * This library provides basic functions for threads to interact with user
4  * interface, such as message output.
5  *****************************************************************************
6  * Copyright (C) 1999, 2000 VideoLAN
7  *
8  * Authors:
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 /*****************************************************************************
26  * Required headers:
27  *  <X11/Xlib.h>
28  *  <X11/extensions/XShm.h>
29  *  "config.h"
30  *  "common.h"
31  *  "mtime.h"
32  *  "threads.h"
33  *  "input.h"
34  *  "video.h"
35  *  "video_output.h"
36  *  "audio_output.h"
37  *  "xconsole.h"
38  *****************************************************************************/
39
40 /*****************************************************************************
41  * intf_thread_t: describe an interface thread
42  *****************************************************************************
43  * This structe describes all interface-specific data of the main (interface)
44  * thread.
45  *****************************************************************************/
46 typedef struct _keyparam
47 {
48     int key;
49     int param;
50 } keyparm;
51
52 typedef struct _key
53 {
54     int received_key;
55     keyparm forwarded;
56     struct _key *  next;
57 } intf_key;
58
59 typedef intf_key * p_intf_key;
60
61 typedef struct intf_thread_s
62 {
63     boolean_t           b_die;                                 /* `die' flag */
64
65     /* Specific interfaces */
66     p_intf_console_t    p_console;                                /* console */
67     p_intf_sys_t        p_sys;                           /* system interface */
68     p_intf_key          p_keys;
69     
70     /* Plugin used and shortcuts to access its capabilities */
71     struct module_s *   p_module;
72     int              ( *pf_open )   ( struct intf_thread_s * );
73     void             ( *pf_close )  ( struct intf_thread_s * );
74     void             ( *pf_run )    ( struct intf_thread_s * );
75
76     /* Interface callback */
77     void             ( *pf_manage ) ( struct intf_thread_s * );
78
79     /* XXX: Channels array - new API */
80   //p_intf_channel_t *  p_channel[INTF_MAX_CHANNELS];/* channel descriptions */
81
82     /* Channels array - NULL if not used */
83     p_intf_channel_t    p_channel;                /* description of channels */
84
85     /* Main threads - NULL if not active */
86     p_input_thread_t    p_input;
87
88     /* Specific functions */
89     keyparm (*p_intf_get_key)(struct intf_thread_s *p_intf, int r_key) ;
90
91     /* XXX: new message passing stuff will go here */
92     vlc_mutex_t         change_lock;
93     boolean_t           b_menu_change;
94     boolean_t           b_menu;
95     
96 } intf_thread_t;
97
98 /*****************************************************************************
99  * Prototypes
100  *****************************************************************************/
101 intf_thread_t * intf_Create             ( void );
102 void            intf_Destroy            ( intf_thread_t * p_intf );
103
104 int             intf_ProcessKey         ( intf_thread_t * p_intf, int i_key );
105
106 void intf_AssignKey( intf_thread_t *p_intf, int r_key, int f_key, int param);
107 keyparm intf_GetKey( intf_thread_t *p_intf, int r_key);
108 void intf_AssignNormalKeys( intf_thread_t *p_intf);
109