2000-02-13 05:31:35 +01:00
|
|
|
/*****************************************************************************
|
1999-08-08 14:42:54 +02:00
|
|
|
* interface.h: interface access for other threads
|
|
|
|
* This library provides basic functions for threads to interact with user
|
|
|
|
* interface, such as message output.
|
2000-02-13 05:31:35 +01:00
|
|
|
*****************************************************************************
|
2000-03-03 08:03:34 +01:00
|
|
|
* 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.
|
2000-05-25 00:39:44 +02:00
|
|
|
*
|
2000-03-03 08:03:34 +01:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2000-05-25 00:39:44 +02:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2000-03-03 08:03:34 +01:00
|
|
|
*
|
2000-05-25 00:39:44 +02:00
|
|
|
* 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.
|
2000-03-03 08:03:34 +01:00
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
/*****************************************************************************
|
1999-08-08 14:42:54 +02:00
|
|
|
* Required headers:
|
|
|
|
* <X11/Xlib.h>
|
|
|
|
* <X11/extensions/XShm.h>
|
|
|
|
* "config.h"
|
|
|
|
* "common.h"
|
|
|
|
* "mtime.h"
|
2000-03-03 08:03:34 +01:00
|
|
|
* "threads.h"
|
1999-08-08 14:42:54 +02:00
|
|
|
* "input.h"
|
|
|
|
* "video.h"
|
|
|
|
* "video_output.h"
|
|
|
|
* "audio_output.h"
|
|
|
|
* "xconsole.h"
|
2000-02-13 05:31:35 +01:00
|
|
|
*****************************************************************************/
|
1999-08-08 14:42:54 +02:00
|
|
|
|
2000-02-13 05:31:35 +01:00
|
|
|
/*****************************************************************************
|
1999-08-08 14:42:54 +02:00
|
|
|
* intf_thread_t: describe an interface thread
|
2000-02-13 05:31:35 +01:00
|
|
|
*****************************************************************************
|
1999-08-08 14:42:54 +02:00
|
|
|
* This structe describes all interface-specific data of the main (interface)
|
|
|
|
* thread.
|
2000-02-13 05:31:35 +01:00
|
|
|
*****************************************************************************/
|
2000-02-14 09:44:59 +01:00
|
|
|
typedef int ( intf_sys_create_t ) ( p_intf_thread_t p_intf );
|
|
|
|
typedef void ( intf_sys_destroy_t ) ( p_intf_thread_t p_intf );
|
|
|
|
typedef void ( intf_sys_manage_t ) ( p_intf_thread_t p_intf );
|
|
|
|
|
2000-08-24 16:58:51 +02:00
|
|
|
|
|
|
|
typedef struct _keyparam
|
|
|
|
{
|
|
|
|
int key;
|
|
|
|
int param;
|
|
|
|
} keyparm;
|
|
|
|
|
2000-08-21 11:33:42 +02:00
|
|
|
typedef struct _key
|
|
|
|
{
|
|
|
|
int received_key;
|
2000-08-24 16:58:51 +02:00
|
|
|
keyparm forwarded;
|
2000-08-21 11:33:42 +02:00
|
|
|
struct _key * next;
|
|
|
|
} intf_key;
|
|
|
|
|
|
|
|
typedef intf_key * p_intf_key;
|
|
|
|
|
2000-01-11 00:36:06 +01:00
|
|
|
typedef struct intf_thread_s
|
1999-08-08 14:42:54 +02:00
|
|
|
{
|
2000-02-13 05:31:35 +01:00
|
|
|
boolean_t b_die; /* `die' flag */
|
1999-08-08 14:42:54 +02:00
|
|
|
|
2000-02-13 05:31:35 +01:00
|
|
|
/* Specific interfaces */
|
|
|
|
p_intf_console_t p_console; /* console */
|
|
|
|
p_intf_sys_t p_sys; /* system interface */
|
2000-08-21 11:33:42 +02:00
|
|
|
p_intf_key p_keys;
|
|
|
|
|
2000-02-21 10:15:04 +01:00
|
|
|
/* Plugin */
|
2000-02-14 09:44:59 +01:00
|
|
|
intf_sys_create_t * p_sys_create; /* create interface thread */
|
|
|
|
intf_sys_manage_t * p_sys_manage; /* main loop */
|
|
|
|
intf_sys_destroy_t * p_sys_destroy; /* destroy interface */
|
|
|
|
|
2000-04-14 06:19:51 +02:00
|
|
|
/* XXX: Channels array - new API */
|
2000-07-04 04:37:21 +02:00
|
|
|
//p_intf_channel_t * p_channel[INTF_MAX_CHANNELS];/* channel descriptions */
|
2000-06-15 01:55:41 +02:00
|
|
|
|
2000-01-31 17:56:37 +01:00
|
|
|
/* Channels array - NULL if not used */
|
2000-02-13 05:31:35 +01:00
|
|
|
p_intf_channel_t p_channel; /* description of channels */
|
2000-01-31 17:56:37 +01:00
|
|
|
|
2000-01-11 00:36:06 +01:00
|
|
|
/* Main threads - NULL if not active */
|
|
|
|
p_vout_thread_t p_vout;
|
2000-02-13 05:31:35 +01:00
|
|
|
p_input_thread_t p_input;
|
2000-02-14 09:44:59 +01:00
|
|
|
|
2000-08-24 16:58:51 +02:00
|
|
|
/* Specific functions */
|
2000-08-28 02:33:54 +02:00
|
|
|
keyparm (*p_intf_get_key)(struct intf_thread_s *p_intf, int r_key) ;
|
2000-08-24 16:58:51 +02:00
|
|
|
|
2000-11-21 02:41:45 +01:00
|
|
|
/* Warning messages level */
|
|
|
|
int i_warning_level;
|
1999-08-08 14:42:54 +02:00
|
|
|
} intf_thread_t;
|
|
|
|
|
2000-02-13 05:31:35 +01:00
|
|
|
/*****************************************************************************
|
1999-08-08 14:42:54 +02:00
|
|
|
* Prototypes
|
2000-02-13 05:31:35 +01:00
|
|
|
*****************************************************************************/
|
2000-01-11 00:36:06 +01:00
|
|
|
intf_thread_t * intf_Create ( void );
|
|
|
|
void intf_Run ( intf_thread_t * p_intf );
|
|
|
|
void intf_Destroy ( intf_thread_t * p_intf );
|
|
|
|
|
2000-01-31 17:56:37 +01:00
|
|
|
int intf_SelectChannel ( intf_thread_t * p_intf, int i_channel );
|
2000-01-19 11:04:23 +01:00
|
|
|
int intf_ProcessKey ( intf_thread_t * p_intf, int i_key );
|
2000-01-11 00:36:06 +01:00
|
|
|
|
2000-08-24 16:58:51 +02:00
|
|
|
void intf_AssignKey( intf_thread_t *p_intf, int r_key, int f_key, int param);
|
2000-08-28 02:33:54 +02:00
|
|
|
keyparm intf_GetKey( intf_thread_t *p_intf, int r_key);
|
2000-08-21 11:33:42 +02:00
|
|
|
void intf_AssignNormalKeys( intf_thread_t *p_intf);
|
|
|
|
|