]> git.sesse.net Git - vlc/blob - modules/video_output/x11/x11.c
88522f878e77fe0d2f6a5d22b4a22ec0d1580c07
[vlc] / modules / video_output / x11 / x11.c
1 /*****************************************************************************
2  * x11.c : X11 plugin for vlc
3  *****************************************************************************
4  * Copyright (C) 1998-2001 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Vincent Seguin <seguin@via.ecp.fr>
8  *          Samuel Hocevar <sam@zoy.org>
9  *          David Kennedy <dkennedy@tinytoad.com>
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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24  *****************************************************************************/
25
26 /*****************************************************************************
27  * Preamble
28  *****************************************************************************/
29
30 #ifdef HAVE_CONFIG_H
31 # include "config.h"
32 #endif
33
34 #include <vlc_common.h>
35 #include <vlc_plugin.h>
36
37 /*****************************************************************************
38  * Exported prototypes
39  *****************************************************************************/
40 extern int  Activate   ( vlc_object_t * );
41 extern void Deactivate ( vlc_object_t * );
42
43 /*****************************************************************************
44  * Module descriptor
45  *****************************************************************************/
46 #define ALT_FS_TEXT N_("Alternate fullscreen method")
47 #define ALT_FS_LONGTEXT N_( \
48     "There are two ways to make a fullscreen window, unfortunately each one " \
49     "has its drawbacks.\n" \
50     "1) Let the window manager handle your fullscreen window (default), but " \
51     "things like taskbars will likely show on top of the video.\n" \
52     "2) Completely bypass the window manager, but then nothing will be able " \
53     "to show on top of the video.")
54
55 #define DISPLAY_TEXT N_("X11 display")
56 #define DISPLAY_LONGTEXT N_( \
57     "X11 hardware display to use. By default VLC will " \
58     "use the value of the DISPLAY environment variable.")
59
60 #define SHM_TEXT N_("Use shared memory")
61 #define SHM_LONGTEXT N_( \
62     "Use shared memory to communicate between VLC and the X server.")
63
64 #define SCREEN_TEXT N_("Screen for fullscreen mode.")
65 #define SCREEN_LONGTEXT N_( \
66     "Screen to use in fullscreen mode. For instance " \
67     "set it to 0 for first screen, 1 for the second.")
68
69 #define X11_EVENT_TEXT N_("key and mouse event handling at X11 plugin level.")
70 #define X11_EVENT_LONGTEXT N_( \
71     "This parameter accepts values : 1 (full event handling support), " \
72     "2 (event handling only for fullscreen) or 3 (No event handling). "  \
73     "Full event handling support is the default value.")
74
75 static const int pi_x11_event_values[] = { 1, 2, 3 };
76 static const char *const ppsz_x11_event_descriptions[] =
77      { N_("FullSupport"), N_("Fullscreen-Only"), N_("None") };
78
79 vlc_module_begin ()
80     set_shortname( "X11" )
81     set_category( CAT_VIDEO )
82     set_subcategory( SUBCAT_VIDEO_VOUT )
83     add_string( "x11-display", NULL, NULL, DISPLAY_TEXT, DISPLAY_LONGTEXT, true )
84     add_bool( "x11-altfullscreen", 0, NULL, ALT_FS_TEXT, ALT_FS_LONGTEXT, true )
85 #ifdef HAVE_SYS_SHM_H
86     add_bool( "x11-shm", 1, NULL, SHM_TEXT, SHM_LONGTEXT, true )
87 #endif
88 #ifdef HAVE_XINERAMA
89     add_integer ( "x11-xineramascreen", -1, NULL, SCREEN_TEXT, SCREEN_LONGTEXT, true )
90 #endif
91     add_integer( "x11-event", 1, NULL, X11_EVENT_TEXT, X11_EVENT_LONGTEXT, true )
92         change_integer_list( pi_x11_event_values, ppsz_x11_event_descriptions, NULL )
93     set_description( N_("X11 video output") )
94     set_capability( "video output", 70 )
95     set_callbacks( Activate, Deactivate )
96 vlc_module_end ()
97