interface.h 3.92 KB
Newer Older
1
/*****************************************************************************
Michel Kaempf's avatar
Michel Kaempf committed
2 3 4
 * interface.h: interface access for other threads
 * This library provides basic functions for threads to interact with user
 * interface, such as message output.
5
 *****************************************************************************
6 7 8 9 10 11 12 13
 * Copyright (C) 1999, 2000 VideoLAN
 *
 * Authors:
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
14
 * 
15 16
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
19
 *
20 21 22
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
23 24 25
 *****************************************************************************/

/*****************************************************************************
Michel Kaempf's avatar
Michel Kaempf committed
26 27 28 29 30 31
 * Required headers:
 *  <X11/Xlib.h>
 *  <X11/extensions/XShm.h>
 *  "config.h"
 *  "common.h"
 *  "mtime.h"
32
 *  "threads.h"
Michel Kaempf's avatar
Michel Kaempf committed
33 34 35 36 37
 *  "input.h"
 *  "video.h"
 *  "video_output.h"
 *  "audio_output.h"
 *  "xconsole.h"
38
 *****************************************************************************/
Michel Kaempf's avatar
Michel Kaempf committed
39

40
/*****************************************************************************
Michel Kaempf's avatar
Michel Kaempf committed
41
 * intf_thread_t: describe an interface thread
42
 *****************************************************************************
Michel Kaempf's avatar
Michel Kaempf committed
43 44
 * This structe describes all interface-specific data of the main (interface)
 * thread.
45
 *****************************************************************************/
Pierre Baillet's avatar
Pierre Baillet committed
46 47 48 49 50 51
typedef struct _keyparam
{
    int key;
    int param;
} keyparm;

Pierre Baillet's avatar
Pierre Baillet committed
52 53 54
typedef struct _key
{
    int received_key;
Pierre Baillet's avatar
Pierre Baillet committed
55
    keyparm forwarded;
Pierre Baillet's avatar
Pierre Baillet committed
56 57 58 59 60
    struct _key *  next;
} intf_key;

typedef intf_key * p_intf_key;

Vincent Seguin's avatar
Vincent Seguin committed
61
typedef struct intf_thread_s
Michel Kaempf's avatar
Michel Kaempf committed
62
{
63
    boolean_t           b_die;                                 /* `die' flag */
Michel Kaempf's avatar
Michel Kaempf committed
64

65 66 67
    /* Specific interfaces */
    p_intf_console_t    p_console;                                /* console */
    p_intf_sys_t        p_sys;                           /* system interface */
Pierre Baillet's avatar
Pierre Baillet committed
68 69
    p_intf_key          p_keys;
    
70 71 72 73 74 75 76 77
    /* Plugin used and shortcuts to access its capabilities */
    struct module_s *   p_module;
    int              ( *pf_open )   ( struct intf_thread_s * );
    void             ( *pf_close )  ( struct intf_thread_s * );
    void             ( *pf_run )    ( struct intf_thread_s * );

    /* Interface callback */
    void             ( *pf_manage ) ( struct intf_thread_s * );
78

Sam Hocevar's avatar
Sam Hocevar committed
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

Vincent Seguin's avatar
Vincent Seguin committed
85
    /* Main threads - NULL if not active */
86
    p_input_thread_t    p_input;
87

Pierre Baillet's avatar
Pierre Baillet committed
88
    /* Specific functions */
89
    keyparm (*p_intf_get_key)(struct intf_thread_s *p_intf, int r_key) ;
90 91 92 93 94

    /* XXX: new message passing stuff will go here */
    vlc_mutex_t         change_lock;
    boolean_t           b_menu_change;
    boolean_t           b_menu;
Pierre Baillet's avatar
Pierre Baillet committed
95
    
Michel Kaempf's avatar
Michel Kaempf committed
96 97
} intf_thread_t;

98
/*****************************************************************************
Michel Kaempf's avatar
Michel Kaempf committed
99
 * Prototypes
100
 *****************************************************************************/
Vincent Seguin's avatar
Vincent Seguin committed
101 102 103
intf_thread_t * intf_Create             ( void );
void            intf_Destroy            ( intf_thread_t * p_intf );

Vincent Seguin's avatar
Vincent Seguin committed
104
int             intf_ProcessKey         ( intf_thread_t * p_intf, int i_key );
Vincent Seguin's avatar
Vincent Seguin committed
105

Pierre Baillet's avatar
Pierre Baillet committed
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);
Pierre Baillet's avatar
Pierre Baillet committed
108 109
void intf_AssignNormalKeys( intf_thread_t *p_intf);