]> git.sesse.net Git - vlc/blob - include/interface.h
5a8a4356c2722fd6426e77ad7a025165ab0c1ec5
[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  *  <sys/uio.h>
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 int   ( intf_sys_create_t )   ( p_intf_thread_t p_intf );
48 typedef void  ( intf_sys_destroy_t )  ( p_intf_thread_t p_intf );
49 typedef void  ( intf_sys_manage_t )   ( p_intf_thread_t p_intf );
50
51 typedef struct intf_thread_s
52 {
53     boolean_t           b_die;                                 /* `die' flag */
54
55     /* Specific interfaces */
56     p_intf_console_t    p_console;                                /* console */
57     p_intf_sys_t        p_sys;                           /* system interface */
58
59     /* Plugin */
60     plugin_id_t             intf_plugin;                 /* interface plugin */
61     intf_sys_create_t *     p_sys_create;         /* create interface thread */
62     intf_sys_manage_t *     p_sys_manage;                       /* main loop */
63     intf_sys_destroy_t *    p_sys_destroy;              /* destroy interface */
64
65     /* XXX: Channels array - new API */
66     //p_intf_channel_t *  p_channel[INTF_MAX_CHANNELS];/* channel descriptions */
67     /* Channels array - NULL if not used */
68     p_intf_channel_t    p_channel;                /* description of channels */
69
70     /* Main threads - NULL if not active */
71     p_vout_thread_t     p_vout;
72     p_input_thread_t    p_input;
73
74 } intf_thread_t;
75
76 /*****************************************************************************
77  * Prototypes
78  *****************************************************************************/
79 intf_thread_t * intf_Create             ( void );
80 void            intf_Run                ( intf_thread_t * p_intf );
81 void            intf_Destroy            ( intf_thread_t * p_intf );
82
83 int             intf_SelectChannel      ( intf_thread_t * p_intf, int i_channel );
84 int             intf_ProcessKey         ( intf_thread_t * p_intf, int i_key );
85