]> git.sesse.net Git - vlc/blob - include/interface.h
* Header cleaning: filled all empty authors fields, added CVS $Id stuff.
[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  * $Id: interface.h,v 1.22 2001/03/21 13:42:33 sam Exp $
8  *
9  * Authors: Vincent Seguin <seguin@via.ecp.fr>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  * 
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
24  *****************************************************************************/
25
26 /*****************************************************************************
27  * Required headers:
28  *  <X11/Xlib.h>
29  *  <X11/extensions/XShm.h>
30  *  "config.h"
31  *  "common.h"
32  *  "mtime.h"
33  *  "threads.h"
34  *  "input.h"
35  *  "video.h"
36  *  "video_output.h"
37  *  "audio_output.h"
38  *  "xconsole.h"
39  *****************************************************************************/
40
41 /*****************************************************************************
42  * intf_thread_t: describe an interface thread
43  *****************************************************************************
44  * This structe describes all interface-specific data of the main (interface)
45  * thread.
46  *****************************************************************************/
47 typedef struct _keyparam
48 {
49     int key;
50     int param;
51 } keyparm;
52
53 typedef struct _key
54 {
55     int received_key;
56     keyparm forwarded;
57     struct _key *  next;
58 } intf_key;
59
60 typedef intf_key * p_intf_key;
61
62 typedef struct intf_thread_s
63 {
64     boolean_t           b_die;                                 /* `die' flag */
65
66     /* Specific interfaces */
67     p_intf_console_t    p_console;                                /* console */
68     p_intf_sys_t        p_sys;                           /* system interface */
69     p_intf_key          p_keys;
70     
71     /* Plugin used and shortcuts to access its capabilities */
72     struct module_s *   p_module;
73     int              ( *pf_open )   ( struct intf_thread_s * );
74     void             ( *pf_close )  ( struct intf_thread_s * );
75     void             ( *pf_run )    ( struct intf_thread_s * );
76
77     /* Interface callback */
78     void             ( *pf_manage ) ( struct intf_thread_s * );
79
80     /* XXX: Channels array - new API */
81   //p_intf_channel_t *  p_channel[INTF_MAX_CHANNELS];/* channel descriptions */
82
83     /* Channels array - NULL if not used */
84     p_intf_channel_t    p_channel;                /* description of channels */
85
86     /* Main threads - NULL if not active */
87     p_input_thread_t    p_input;
88
89     /* Specific functions */
90     keyparm (*p_intf_get_key)(struct intf_thread_s *p_intf, int r_key) ;
91
92     /* XXX: new message passing stuff will go here */
93     vlc_mutex_t         change_lock;
94     boolean_t           b_menu_change;
95     boolean_t           b_menu;
96     
97 } intf_thread_t;
98
99 /*****************************************************************************
100  * Prototypes
101  *****************************************************************************/
102 intf_thread_t * intf_Create             ( void );
103 void            intf_Destroy            ( intf_thread_t * p_intf );
104
105 int             intf_ProcessKey         ( intf_thread_t * p_intf, int i_key );
106
107 void intf_AssignKey( intf_thread_t *p_intf, int r_key, int f_key, int param);
108 keyparm intf_GetKey( intf_thread_t *p_intf, int r_key);
109 void intf_AssignNormalKeys( intf_thread_t *p_intf);
110