1 /*****************************************************************************
2 * vlc_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 the VideoLAN team
9 * Authors: Vincent Seguin <seguin@via.ecp.fr>
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.
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.
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 *****************************************************************************/
27 typedef struct intf_dialog_args_t intf_dialog_args_t;
31 * This file contains structures and function prototypes for
32 * interface management in vlc
36 /*****************************************************************************
37 * intf_thread_t: describe an interface thread
38 *****************************************************************************
39 * This struct describes all interface-specific data of the main (interface)
41 *****************************************************************************/
44 * \defgroup vlc_interface Interface
45 * These functions and structures are for interface management
52 /* Thread properties and locks */
56 /* Specific interfaces */
57 intf_console_t * p_console; /** console */
58 intf_sys_t * p_sys; /** system interface */
60 /** Interface module */
62 void ( *pf_run ) ( intf_thread_t * ); /** Run function */
64 /** Specific for dialogs providers */
65 void ( *pf_show_dialog ) ( intf_thread_t *, int, int,
66 intf_dialog_args_t * );
68 /** Interaction stuff */
70 int ( *pf_interact ) ( intf_thread_t *, interaction_dialog_t *, vlc_bool_t );
72 /** Video window callbacks */
73 void * ( *pf_request_window ) ( intf_thread_t *, vout_thread_t *,
75 unsigned int *, unsigned int * );
76 void ( *pf_release_window ) ( intf_thread_t *, void * );
77 int ( *pf_control_window ) ( intf_thread_t *, void *, int, va_list );
79 /* XXX: new message passing stuff will go here */
80 vlc_mutex_t change_lock;
81 vlc_bool_t b_menu_change;
84 /* Provides the ability to switch an interface on the fly */
85 char *psz_switch_intf;
88 /*****************************************************************************
89 * intf_dialog_args_t: arguments structure passed to a dialogs provider.
90 *****************************************************************************
91 * This struct describes the arguments passed to the dialogs provider.
92 * For now they are only used with INTF_DIALOG_FILE_GENERIC.
93 *****************************************************************************/
94 struct intf_dialog_args_t
101 void (*pf_callback) ( intf_dialog_args_t * );
104 /* Specifically for INTF_DIALOG_FILE_GENERIC */
105 char *psz_extensions;
107 vlc_bool_t b_multiple;
110 /*****************************************************************************
112 *****************************************************************************/
113 #define intf_Create(a,b) __intf_Create(VLC_OBJECT(a),b)
114 VLC_EXPORT( intf_thread_t *, __intf_Create, ( vlc_object_t *, const char * ) );
115 VLC_EXPORT( int, intf_RunThread, ( intf_thread_t * ) );
116 VLC_EXPORT( void, intf_StopThread, ( intf_thread_t * ) );
117 VLC_EXPORT( void, intf_Destroy, ( intf_thread_t * ) );
121 /*****************************************************************************
123 *****************************************************************************/
124 #if defined( WIN32 ) && !defined( UNDER_CE )
125 # define CONSOLE_INTRO_MSG \
126 if( !getenv( "PWD" ) || !getenv( "PS1" ) ) /* detect cygwin shell */ \
129 freopen( "CONOUT$", "w", stdout ); \
130 freopen( "CONOUT$", "w", stderr ); \
131 freopen( "CONIN$", "r", stdin ); \
133 msg_Info( p_intf, COPYRIGHT_MESSAGE ); \
134 msg_Info( p_intf, _("\nWarning: if you can't access the GUI " \
135 "anymore, open a dos command box, go to the " \
136 "directory where you installed VLC and run " \
137 "\"vlc -I wxwin\"\n") )
139 # define CONSOLE_INTRO_MSG
142 /* Interface dialog ids for dialog providers */
143 #define INTF_DIALOG_FILE_SIMPLE 1
144 #define INTF_DIALOG_FILE 2
145 #define INTF_DIALOG_DISC 3
146 #define INTF_DIALOG_NET 4
147 #define INTF_DIALOG_CAPTURE 5
148 #define INTF_DIALOG_SAT 6
150 #define INTF_DIALOG_DIRECTORY 7
152 #define INTF_DIALOG_STREAMWIZARD 8
153 #define INTF_DIALOG_WIZARD 9
155 #define INTF_DIALOG_PLAYLIST 10
156 #define INTF_DIALOG_MESSAGES 11
157 #define INTF_DIALOG_FILEINFO 12
158 #define INTF_DIALOG_PREFS 13
159 #define INTF_DIALOG_BOOKMARKS 14
161 #define INTF_DIALOG_POPUPMENU 20
163 #define INTF_DIALOG_FILE_GENERIC 30
165 #define INTF_DIALOG_UPDATEVLC 90
166 #define INTF_DIALOG_VLM 91
168 #define INTF_DIALOG_EXIT 99
170 /* Useful text messages shared by interfaces */
171 #define INTF_ABOUT_MSG LICENSE_MSG