]> git.sesse.net Git - vlc/blobdiff - plugins/x11/x11.c
* ./src/misc/modules.c: added the --plugin-path option to give vlc an
[vlc] / plugins / x11 / x11.c
index a726c071676478d915680a0592e5b67bdbab09db..8844017e8ea58fcdd48316c67ec4c7c7010ce797 100644 (file)
@@ -1,9 +1,12 @@
 /*****************************************************************************
  * x11.c : X11 plugin for vlc
  *****************************************************************************
- * Copyright (C) 2000, 2001 VideoLAN
+ * Copyright (C) 1998-2001 VideoLAN
+ * $Id: x11.c,v 1.19 2002/06/27 19:01:28 sam Exp $
  *
- * Authors: Samuel Hocevar <sam@zoy.org>
+ * Authors: Vincent Seguin <seguin@via.ecp.fr>
+ *          Samuel Hocevar <sam@zoy.org>
+ *          David Kennedy <dkennedy@tinytoad.com>
  *      
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
 
-#define MODULE_NAME x11
-
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include "defs.h"
-
 #include <stdlib.h>                                      /* malloc(), free() */
+#include <string.h>                                            /* strerror() */
 
-#include "config.h"
-#include "common.h"                                     /* boolean_t, byte_t */
-#include "threads.h"
-#include "mtime.h"
-
-#include "video.h"
-#include "video_output.h"
+#include <vlc/vlc.h>
 
-#include "modules.h"
-#include "modules_inner.h"
+#include "xcommon.h"
 
 /*****************************************************************************
  * Building configuration tree
  *****************************************************************************/
-MODULE_CONFIG_START
-ADD_WINDOW( "Configuration for X11 module" )
-    ADD_COMMENT( "For now, the X11 module cannot be configured" )
-MODULE_CONFIG_END
-
-/*****************************************************************************
- * Capabilities defined in the other files.
- ******************************************************************************/
-extern void vout_getfunctions( function_list_t * p_function_list );
-
-/*****************************************************************************
- * InitModule: get the module structure and configuration.
- *****************************************************************************
- * We have to fill psz_name, psz_longname and psz_version. These variables
- * will be strdup()ed later by the main application because the module can
- * be unloaded later to save memory, and we want to be able to access this
- * data even after the module has been unloaded.
- *****************************************************************************/
-int InitModule( module_t * p_module )
-{
-    p_module->psz_name = MODULE_STRING;
-    p_module->psz_longname = "X11 module";
-    p_module->psz_version = VERSION;
-
-    p_module->i_capabilities = MODULE_CAPABILITY_NULL
-                                | MODULE_CAPABILITY_VOUT;
 
-    return( 0 );
-}
+#define ALT_FS_TEXT N_("alternate fullscreen method")
+#define ALT_FS_LONGTEXT N_( \
+    "There are two ways to make a fullscreen window, unfortunately each one " \
+    "has its drawbacks.\n" \
+    "1) Let the window manager handle your fullscreen window (default). But " \
+    "things like taskbars will likely show on top of the video.\n" \
+    "2) Completly bypass the window manager, but then nothing will be able " \
+    "to show on top of the video.")
+
+#define DISPLAY_TEXT N_("X11 display name")
+#define DISPLAY_LONGTEXT N_( \
+    "Specify the X11 hardware display you want to use. By default vlc will " \
+    "use the value of the DISPLAY environment variable.")
+
+#define DRAWABLE_TEXT N_("X11 drawable")
+#define DRAWABLE_LONGTEXT N_( \
+    "Specify a X11 drawable to use instead of opening a new window. This " \
+    "option is DANGEROUS, use with care.")
 
-/*****************************************************************************
- * ActivateModule: set the module to an usable state.
- *****************************************************************************
- * This function fills the capability functions and the configuration
- * structure. Once ActivateModule() has been called, the i_usage can
- * be set to 0 and calls to NeedModule() be made to increment it. To unload
- * the module, one has to wait until i_usage == 0 and call DeactivateModule().
- *****************************************************************************/
-int ActivateModule( module_t * p_module )
-{
-    p_module->p_functions = malloc( sizeof( module_functions_t ) );
-    if( p_module->p_functions == NULL )
-    {
-        return( -1 );
-    }
-
-    vout_getfunctions( &p_module->p_functions->vout );
-
-    p_module->p_config = p_config;
-
-    return( 0 );
-}
-
-/*****************************************************************************
- * DeactivateModule: make sure the module can be unloaded.
- *****************************************************************************
- * This function must only be called when i_usage == 0. If it successfully
- * returns, i_usage can be set to -1 and the module unloaded. Be careful to
- * lock usage_lock during the whole process.
- *****************************************************************************/
-int DeactivateModule( module_t * p_module )
-{
-    free( p_module->p_functions );
-
-    return( 0 );
-}
+MODULE_CONFIG_START
+ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
+ADD_STRING  ( "x11-display", NULL, NULL, DISPLAY_TEXT, DISPLAY_LONGTEXT )
+ADD_BOOL    ( "x11-altfullscreen", 0, NULL, ALT_FS_TEXT, ALT_FS_LONGTEXT )
+ADD_INTEGER ( "x11-drawable", -1, NULL, DRAWABLE_TEXT, DRAWABLE_LONGTEXT )
+MODULE_CONFIG_STOP
+
+MODULE_INIT_START
+    SET_DESCRIPTION( _("X11 module") )
+    ADD_CAPABILITY( VOUT, 50 )
+MODULE_INIT_STOP
+
+MODULE_ACTIVATE_START
+    _M( vout_getfunctions )( &p_module->p_functions->vout );
+MODULE_ACTIVATE_STOP
+
+MODULE_DEACTIVATE_START
+MODULE_DEACTIVATE_STOP