]> git.sesse.net Git - vlc/blob - include/vlc_interface.h
* modules/gui/wxwindows/*: enable popup menu support in the "dialogs provider".
[vlc] / include / vlc_interface.h
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 VideoLAN
7  * $Id: vlc_interface.h,v 1.3 2003/07/17 18:58:23 gbazin Exp $
8  *
9  * Authors: Vincent Seguin <seguin@via.ecp.fr>
10  *
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.
15  *
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.
20  *
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  *****************************************************************************/
25
26 /*****************************************************************************
27  * intf_thread_t: describe an interface thread
28  *****************************************************************************
29  * This struct describes all interface-specific data of the main (interface)
30  * thread.
31  *****************************************************************************/
32 struct intf_thread_t
33 {
34     VLC_COMMON_MEMBERS
35
36     /* Thread properties and locks */
37     vlc_bool_t          b_block;
38
39     /* Specific interfaces */
40     intf_console_t *    p_console;                                /* console */
41     intf_sys_t *        p_sys;                           /* system interface */
42
43     /* Interface module */
44     module_t *   p_module;
45     void      ( *pf_run )    ( intf_thread_t * );
46
47     /* Specific for dialogs providers */
48     void      ( *pf_show_dialog ) ( intf_thread_t *, int, int );
49
50     /* XXX: new message passing stuff will go here */
51     vlc_mutex_t  change_lock;
52     vlc_bool_t   b_menu_change;
53     vlc_bool_t   b_menu;
54 };
55
56 /*****************************************************************************
57  * Prototypes
58  *****************************************************************************/
59 #define intf_Create(a,b) __intf_Create(VLC_OBJECT(a),b)
60 VLC_EXPORT( intf_thread_t *, __intf_Create,     ( vlc_object_t *, const char * ) );
61 VLC_EXPORT( int,               intf_RunThread,  ( intf_thread_t * ) );
62 VLC_EXPORT( void,              intf_StopThread, ( intf_thread_t * ) );
63 VLC_EXPORT( void,              intf_Destroy,    ( intf_thread_t * ) );
64
65 /*****************************************************************************
66  * Macros
67  *****************************************************************************/
68 #if defined( WIN32 ) && !defined( UNDER_CE )
69 #    define CONSOLE_INTRO_MSG \
70          AllocConsole(); \
71          freopen( "CONOUT$", "w", stdout ); \
72          freopen( "CONOUT$", "w", stderr ); \
73          freopen( "CONIN$", "r", stdin ); \
74          msg_Info( p_intf, COPYRIGHT_MESSAGE ); \
75          msg_Info( p_intf, _("\nWarning: if you can't access the GUI " \
76                              "anymore, open a dos command box, go to the " \
77                              "directory where you installed VLC and run " \
78                              "\"vlc -I wxwin\"\n") )
79 #else
80 #    define CONSOLE_INTRO_MSG
81 #endif
82
83 /* Interface dialog ids for dialog providers */
84 #define INTF_DIALOG_FILE_SIMPLE 1
85 #define INTF_DIALOG_FILE        2
86 #define INTF_DIALOG_DISC        3
87 #define INTF_DIALOG_NET         4
88 #define INTF_DIALOG_SAT         5
89
90 #define INTF_DIALOG_PLAYLIST   10
91 #define INTF_DIALOG_MESSAGES   11
92 #define INTF_DIALOG_FILEINFO   12
93 #define INTF_DIALOG_PREFS      13
94
95 #define INTF_DIALOG_POPUPMENU  20