]> git.sesse.net Git - vlc/blob - plugins/x11/x11.c
* ./plugins/chroma/i420_rgb8.c: plain C 8 bpp transformation.
[vlc] / plugins / x11 / x11.c
1 /*****************************************************************************
2  * x11.c : X11 plugin for vlc
3  *****************************************************************************
4  * Copyright (C) 1998-2001 VideoLAN
5  * $Id: x11.c,v 1.13 2002/03/17 13:53:21 gbazin Exp $
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., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
24  *****************************************************************************/
25
26 /*****************************************************************************
27  * Preamble
28  *****************************************************************************/
29 #include <stdlib.h>                                      /* malloc(), free() */
30 #include <string.h>                                            /* strerror() */
31
32 #include <videolan/vlc.h>
33
34 #include "xcommon.h"
35
36 /*****************************************************************************
37  * Building configuration tree
38  *****************************************************************************/
39
40 #define ALT_FS_TEXT "Alternate fullscreen method"
41 #define ALT_FS_LONGTEXT "There are two ways to make a fullscreen window, " \
42                         "unfortunately each one has its drawbacks.\n" \
43                         "1) Let the window manager handle your fullscreen " \
44                         "window (default). But things like taskbars will " \
45                         "likely show on top of the video\n" \
46                         "2) Completly bypass the window manager, but then " \
47                         "nothing will be able to show on top of the video"
48
49 MODULE_CONFIG_START
50 ADD_CATEGORY_HINT( "Miscellaneous", NULL )
51 ADD_BOOL    ( "x11_altfullscreen", NULL, ALT_FS_TEXT, ALT_FS_LONGTEXT )
52 MODULE_CONFIG_STOP
53
54 MODULE_INIT_START
55     SET_DESCRIPTION( "X11 module" )
56     ADD_CAPABILITY( VOUT, 50 )
57     ADD_SHORTCUT( "x11" )
58 MODULE_INIT_STOP
59
60 MODULE_ACTIVATE_START
61     _M( vout_getfunctions )( &p_module->p_functions->vout );
62 MODULE_ACTIVATE_STOP
63
64 MODULE_DEACTIVATE_START
65 MODULE_DEACTIVATE_STOP
66
67 #if 0
68 /*****************************************************************************
69  * vout_SetPalette: sets an 8 bpp palette
70  *****************************************************************************
71  * This function sets the palette given as an argument. It does not return
72  * anything, but could later send information on which colors it was unable
73  * to set.
74  *****************************************************************************/
75 static void vout_SetPalette( p_vout_thread_t p_vout,
76                              u16 *red, u16 *green, u16 *blue, u16 *transp )
77 {
78     int i, j;
79     XColor p_colors[255];
80
81     /* allocate palette */
82     for( i = 0, j = 255; i < 255; i++, j-- )
83     {
84         /* kludge: colors are indexed reversely because color 255 seems
85          * to be reserved for black even if we try to set it to white */
86         p_colors[ i ].pixel = j;
87         p_colors[ i ].pad   = 0;
88         p_colors[ i ].flags = DoRed | DoGreen | DoBlue;
89         p_colors[ i ].red   = red[ j ];
90         p_colors[ i ].blue  = blue[ j ];
91         p_colors[ i ].green = green[ j ];
92     }
93
94     XStoreColors( p_vout->p_sys->p_display,
95                   p_vout->p_sys->colormap, p_colors, 256 );
96 }
97 #endif
98