* interface, such as message output.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: interface.h,v 1.23 2001/12/09 17:01:35 sam Exp $
+ * $Id: interface.h,v 1.35 2002/10/04 12:01:40 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-/*****************************************************************************
- * Required headers:
- * <X11/Xlib.h>
- * <X11/extensions/XShm.h>
- * "config.h"
- * "common.h"
- * "mtime.h"
- * "threads.h"
- * "input.h"
- * "video.h"
- * "video_output.h"
- * "audio_output.h"
- * "xconsole.h"
- *****************************************************************************/
-
/*****************************************************************************
* intf_thread_t: describe an interface thread
*****************************************************************************
- * This structe describes all interface-specific data of the main (interface)
+ * This struct describes all interface-specific data of the main (interface)
* thread.
*****************************************************************************/
-typedef struct intf_thread_s
+struct intf_thread_t
{
- boolean_t b_die; /* `die' flag */
+ VLC_COMMON_MEMBERS
+
+ /* Thread properties and locks */
+ vlc_bool_t b_block;
/* Specific interfaces */
- p_intf_console_t p_console; /* console */
- p_intf_sys_t p_sys; /* system interface */
+ intf_console_t * p_console; /* console */
+ intf_sys_t * p_sys; /* system interface */
- /* 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 * );
-
- /* XXX: Channels array - new API */
- //p_intf_channel_t * p_channel[INTF_MAX_CHANNELS];/* channel descriptions */
-
- /* Channels array - NULL if not used */
- p_intf_channel_t p_channel; /* description of channels */
-
- /* Input thread - NULL if not active */
- p_input_thread_t p_input;
+ /* Interface module */
+ module_t * p_module;
+ void ( *pf_run ) ( intf_thread_t * );
/* XXX: new message passing stuff will go here */
- vlc_mutex_t change_lock;
- boolean_t b_menu_change;
- boolean_t b_menu;
-
-} intf_thread_t;
+ vlc_mutex_t change_lock;
+ vlc_bool_t b_menu_change;
+ vlc_bool_t b_menu;
+};
/*****************************************************************************
* Prototypes
*****************************************************************************/
-intf_thread_t * intf_Create ( void );
-void intf_Destroy ( intf_thread_t * p_intf );
+#define intf_Create(a) __intf_Create(VLC_OBJECT(a))
+VLC_EXPORT( intf_thread_t *, __intf_Create, ( vlc_object_t * ) );
+VLC_EXPORT( vlc_error_t, intf_RunThread, ( intf_thread_t * ) );
+VLC_EXPORT( void, intf_StopThread, ( intf_thread_t * ) );
+VLC_EXPORT( void, intf_Destroy, ( intf_thread_t * ) );
+/*****************************************************************************
+ * Macros
+ *****************************************************************************/
+#ifdef WIN32
+# define CONSOLE_INTRO_MSG \
+ AllocConsole(); \
+ freopen( "CONOUT$", "w", stdout ); \
+ freopen( "CONOUT$", "w", stderr ); \
+ freopen( "CONIN$", "r", stdin ); \
+ msg_Info( p_intf, VERSION_MESSAGE ); \
+ msg_Info( p_intf, _("\nWarning: if you can't access the GUI " \
+ "anymore, open a dos command box, go to the " \
+ "directory where you installed VLC and run " \
+ "\"vlc -I win32\"\n") )
+#else
+# define CONSOLE_INTRO_MSG
+#endif