]> git.sesse.net Git - vlc/commitdiff
* configure.in and Makefile.in patches for better SDL support and
authorSam Hocevar <sam@videolan.org>
Sun, 18 Feb 2001 19:14:27 +0000 (19:14 +0000)
committerSam Hocevar <sam@videolan.org>
Sun, 18 Feb 2001 19:14:27 +0000 (19:14 +0000)
    support for $(bindir) $(datadir) and $(libdir) stuff, courtesy
    of Arkadiusz Miskiewicz <misiek@pld.ORG.PL>
  * Ported ggi.so to the new modules API. As for the other modules, only
    the "q" key works. Moreover, VLC doesn't exit cleanly if you close the
    GGI window.
  * Deactivated non-working widgets in the Gnome interface.
  * Added CONTRIBUTORS file.

  Hint of the day: don't expect to code quite long in your bed when sleepy.

CONTRIBUTORS [new file with mode: 0644]
Makefile.in
configure.in
plugins/ggi/ggi.c
plugins/ggi/intf_ggi.c [deleted file]
plugins/ggi/vout_ggi.c
plugins/gnome/gnome_interface.c
plugins/gnome/intf_gnome.glade

diff --git a/CONTRIBUTORS b/CONTRIBUTORS
new file mode 100644 (file)
index 0000000..3be352a
--- /dev/null
@@ -0,0 +1,10 @@
+
+Ethan C. Baldridge <BaldridgeE@cadmus.com>
+
+  * Directory browsing code in modules.c
+
+
+Arkadiusz Miskiewicz <misiek@pld.ORG.PL>
+
+  * Makefile and configure patches.
+
index 1dd3b4f2deb8379bed345bb4410c4e99ebc0dad9..3d0628cc6ea18b3572af82cc8711c6800e00de0b 100644 (file)
@@ -18,7 +18,12 @@ SYS=@SYS@
 PLUGINS=@PLUGINS@
 INSTALL=@INSTALL@
 ARCH=@ARCH@
+
 prefix=@prefix@
+bindir=@bindir@
+datadir=@datadir@
+libdir=@libdir@
+
 CC=@CC@
 SHELL=@SHELL@
 
@@ -304,7 +309,6 @@ PLUGIN_FB = plugins/fb/fb.o \
                plugins/fb/vout_fb.o
 
 PLUGIN_GGI =   plugins/ggi/ggi.o \
-               plugins/ggi/intf_ggi.o \
                plugins/ggi/vout_ggi.o
 
 PLUGIN_GLIDE = plugins/glide/glide.o \
@@ -444,15 +448,15 @@ distclean: clean
        rm -rf .dep
 
 install:
-       mkdir -p $(prefix)/bin
-       $(INSTALL) vlc $(prefix)/bin
+       mkdir -p $(DESTDIR)$(bindir)
+       $(INSTALL) vlc $(DESTDIR)$(bindir)
 # ugly
-       for alias in "" @ALIASES@ ; do if test $$alias ; then rm -f $(prefix)/bin/$$alias && ln -s vlc $(prefix)/bin/$$alias ; fi ; done
-       mkdir -p $(prefix)/lib/videolan/vlc
-       $(INSTALL) -m 644 $(PLUGINS:%=lib/%.so) $(prefix)/lib/videolan/vlc
-       mkdir -p $(prefix)/share/videolan
-       $(INSTALL) -m 644 share/*.psf $(prefix)/share/videolan
-       $(INSTALL) -m 644 share/*.png $(prefix)/share/videolan
+       for alias in "" @ALIASES@ ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
+       mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
+       $(INSTALL) -m 644 $(PLUGINS:%=lib/%.so) $(DESTDIR)$(libdir)/videolan/vlc
+       mkdir -p $(DESTDIR)$(datadir)/videolan
+       $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/videolan
+       $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan
 
 show:
        @echo CC: $(CC)
index d010d0f439947fc2e121b9fb0e78b447559244df..69d22dfa7ebfba53455039b37a638dc6662704ff 100644 (file)
@@ -171,14 +171,14 @@ AC_ARG_WITH(sdl,
   [ PLUGINS=${PLUGINS}"sdl ";
     if test "x$withval" != "xyes";
     then
-      LIB_SDL="-l"$withval
+      LIB_SDL="L /usr/X11R6/lib -l"$withval
     else
-      LIB_SDL="-lSDL"
+      LIB_SDL="-L/usr/X11R6/lib -lSDL"
     fi ])
     if test "x$withval" == "x";
     then
       PLUGINS=${PLUGINS}"sdl "
-      LIB_SDL="-lSDL"
+      LIB_SDL="-L/usr/X11R6/lib -lSDL"
     fi
 AC_ARG_WITH(glide,
   [  --with-glide[=name]     Glide (3dfx) support (default disabled)],
index 3dd6a7819fa3d14d0f4dcfdcfd469ef45d8ab4c7..2381f3d2347a2c475251df7aaca3b08101ed1e1e 100644 (file)
@@ -1,10 +1,10 @@
 /*****************************************************************************
  * ggi.c : GGI plugin for vlc
  *****************************************************************************
- * Copyright (C) 2000 VideoLAN
- *
- * Authors:
+ * Copyright (C) 2000, 2001 VideoLAN
  *
+ * Authors: Samuel Hocevar <sam@zoy.org>
+ *      
  * 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
  * the Free Software Foundation; either version 2 of the License, or
@@ -20,6 +20,8 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
 
+#define MODULE_NAME ggi
+
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
 #include "common.h"                                     /* boolean_t, byte_t */
 #include "threads.h"
 #include "mtime.h"
-#include "tests.h"
-#include "plugins.h"
 
-#include "interface.h"
-#include "audio_output.h"
 #include "video.h"
 #include "video_output.h"
 
+#include "modules.h"
+#include "modules_inner.h"
+
 /*****************************************************************************
- * Exported prototypes
+ * Building configuration tree
  *****************************************************************************/
-static void vout_GetPlugin( p_vout_thread_t p_vout );
-static void intf_GetPlugin( p_intf_thread_t p_intf );
-
-/* Video output */
-int     vout_GGICreate       ( vout_thread_t *p_vout, char *psz_display,
-                               int i_root_window, void *p_data );
-int     vout_GGIInit         ( p_vout_thread_t p_vout );
-void    vout_GGIEnd          ( p_vout_thread_t p_vout );
-void    vout_GGIDestroy      ( p_vout_thread_t p_vout );
-int     vout_GGIManage       ( p_vout_thread_t p_vout );
-void    vout_GGIDisplay      ( p_vout_thread_t p_vout );
-void    vout_GGISetPalette   ( p_vout_thread_t p_vout,
-                               u16 *red, u16 *green, u16 *blue, u16 *transp );
-
-/* Interface */
-int     intf_GGICreate       ( p_intf_thread_t p_intf );
-void    intf_GGIDestroy      ( p_intf_thread_t p_intf );
-void    intf_GGIManage       ( p_intf_thread_t p_intf );
+MODULE_CONFIG_START
+ADD_WINDOW( "Configuration for GGI module" )
+    ADD_COMMENT( "For now, the GGI module cannot be configured" )
+MODULE_CONFIG_END
+
+/*****************************************************************************
+ * Capabilities defined in the other files.
+ ******************************************************************************/
+extern void vout_getfunctions( function_list_t * p_function_list );
 
 /*****************************************************************************
- * GetConfig: get the plugin structure and configuration
+ * 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.
  *****************************************************************************/
-plugin_info_t * GetConfig( void )
+int InitModule( module_t * p_module )
 {
-    plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
-
-    p_info->psz_name    = "GGI";
-    p_info->psz_version = VERSION;
-    p_info->psz_author  = "the VideoLAN team <vlc@videolan.org>";
+    p_module->psz_name = MODULE_STRING;
+    p_module->psz_longname = "General Graphics Interface module";
+    p_module->psz_version = VERSION;
 
-    p_info->aout_GetPlugin = NULL;
-    p_info->vout_GetPlugin = vout_GetPlugin;
-    p_info->intf_GetPlugin = intf_GetPlugin;
-    p_info->yuv_GetPlugin  = NULL;
+    p_module->i_capabilities = MODULE_CAPABILITY_NULL
+                                | MODULE_CAPABILITY_VOUT;
 
-    /* if the GGI libraries are there, assume we can enter the
-     * initialization part at least, even if we fail afterwards */
-    p_info->i_score = 0x100;
+    return( 0 );
+}
 
-    if( TestProgram( "ggivlc" ) )
+/*****************************************************************************
+ * 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 )
     {
-        p_info->i_score += 0x180;
+        return( -1 );
     }
 
-    /* If this plugin was requested, score it higher */
-    if( TestMethod( VOUT_METHOD_VAR, "ggi" ) )
-    {
-        p_info->i_score += 0x200;
-    }
+    vout_getfunctions( &p_module->p_functions->vout );
+
+    p_module->p_config = p_config;
 
-    return( p_info );
+    return( 0 );
 }
 
 /*****************************************************************************
- * Following functions are only called through the p_info structure
+ * 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.
  *****************************************************************************/
-
-static void vout_GetPlugin( p_vout_thread_t p_vout )
+int DeactivateModule( module_t * p_module )
 {
-    p_vout->p_sys_create  = vout_GGICreate;
-    p_vout->p_sys_init    = vout_GGIInit;
-    p_vout->p_sys_end     = vout_GGIEnd;
-    p_vout->p_sys_destroy = vout_GGIDestroy;
-    p_vout->p_sys_manage  = vout_GGIManage;
-    p_vout->p_sys_display = vout_GGIDisplay;
-}
+    free( p_module->p_functions );
 
-static void intf_GetPlugin( p_intf_thread_t p_intf )
-{
-    p_intf->p_sys_create  = intf_GGICreate;
-    p_intf->p_sys_destroy = intf_GGIDestroy;
-    p_intf->p_sys_manage  = intf_GGIManage;
+    return( 0 );
 }
 
diff --git a/plugins/ggi/intf_ggi.c b/plugins/ggi/intf_ggi.c
deleted file mode 100644 (file)
index 8d336bf..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/*****************************************************************************
- * intf_ggi.c: GGI interface plugin
- * Since GII doesnt seem to work well for keyboard events, the GGI display is
- * used, and therefore the GII interface can't be spawned without a video output
- * thread. It also needs a kludge to get the visual from the video output GGI
- * driver.
- *****************************************************************************
- * Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf_ggi.c,v 1.7 2001/01/05 18:46:43 massiot Exp $
- *
- * Authors:
- *
- * 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
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include "defs.h"
-
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ggi/ggi.h>
-
-#include "config.h"
-#include "common.h"
-#include "threads.h"
-#include "mtime.h"
-#include "plugins.h"
-
-#include "stream_control.h"
-#include "input_ext-intf.h"
-
-#include "video.h"
-#include "video_output.h"
-
-#include "interface.h"
-#include "intf_msg.h"
-
-#include "main.h"
-
-/*****************************************************************************
- * intf_sys_t: description and status of GGI interface
- *****************************************************************************/
-typedef struct intf_sys_s
-{
-    /* GGI system information */
-    ggi_visual_t                 p_display;                       /* display */
-
-} intf_sys_t;
-
-/*****************************************************************************
- * External prototypes
- *****************************************************************************/
-
-/* vout_SysGetVisual: get back visual from video output thread - in video_ggi.c
- * This function is used to get back the display pointer once the video output
- * thread has been spawned. */
-ggi_visual_t    vout_SysGetVisual( vout_thread_t *p_vout );
-
-/*****************************************************************************
- * intf_GGICreate: initialize and create GII interface
- *****************************************************************************/
-int intf_GGICreate( intf_thread_t *p_intf )
-{
-    /* Check that b_video is set */
-    if( !p_main->b_video )
-    {
-        intf_ErrMsg("error: GGI interface require a video output thread");
-        return( 1 );
-    }
-
-    /* Allocate instance and initialize some members */
-    p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
-    if( p_intf->p_sys == NULL )
-    {
-        intf_ErrMsg("error: %s", strerror(ENOMEM) );
-        return( 1 );
-    }
-
-    /* Spawn video output thread */
-    p_intf->p_vout = vout_CreateThread( main_GetPszVariable( VOUT_DISPLAY_VAR,
-                                                             NULL), 0,
-                                        main_GetIntVariable( VOUT_WIDTH_VAR,
-                                                         VOUT_WIDTH_DEFAULT ),
-                                        main_GetIntVariable( VOUT_HEIGHT_VAR,
-                                                        VOUT_HEIGHT_DEFAULT ),
-                                        NULL, 0,
-                                        (void *)&p_intf->p_sys->p_display );
-
-    if( p_intf->p_vout == NULL )                                  /* error */
-    {
-        intf_ErrMsg("error: can't create video output thread" );
-        free( p_intf->p_sys );
-        return( 1 );
-    }
-    
-    /* Assign basic keys */
-    intf_AssignNormalKeys( p_intf );
-
-    
-    return( 0 );
-}
-
-/*****************************************************************************
- * intf_GGIDestroy: destroy interface
- *****************************************************************************/
-void intf_GGIDestroy( intf_thread_t *p_intf )
-{
-    /* Close input thread, if any (blocking) */
-    if( p_intf->p_input )
-    {
-        input_DestroyThread( p_intf->p_input, NULL );
-    }
-
-    /* Close video output thread, if any (blocking) */
-    if( p_intf->p_vout )
-    {
-        vout_DestroyThread( p_intf->p_vout, NULL );
-    }
-
-    /* Destroy structure */
-    free( p_intf->p_sys );
-}
-
-
-/*****************************************************************************
- * intf_GGIManage: event loop
- *****************************************************************************/
-void intf_GGIManage( intf_thread_t *p_intf )
-{
-    int         i_key;                                        /* unicode key */
-
-    /* For all events in queue */
-    while( ggiKbhit( p_intf->p_sys->p_display ) )
-    {
-        i_key = ggiGetc( p_intf->p_sys->p_display );
-        if( intf_ProcessKey( p_intf, i_key ) )
-        {
-            intf_DbgMsg("unhandled key '%c' (%i)", (char) i_key, i_key );
-        }
-    }
-}
-
-
-
index 8833348a444c2c63d7f3f82d40aa9910b1223bc8..4005f13ed5ea35ff970e16a699424d7dedba887e 100644 (file)
@@ -1,9 +1,10 @@
 /*****************************************************************************
  * vout_ggi.c: GGI video output display method
  *****************************************************************************
- * Copyright (C) 1998, 1999, 2000 VideoLAN
+ * Copyright (C) 1998, 1999, 2000, 2001 VideoLAN
  *
- * Authors:
+ * Authors: Vincent Seguin <seguin@via.ecp.fr>
+ *          Samuel Hocevar <sam@zoy.org>
  *
  * 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
 #include "common.h"
 #include "threads.h"
 #include "mtime.h"
-#include "plugins.h"
+#include "tests.h"
+#include "modules.h"
 
 #include "video.h"
 #include "video_output.h"
 
 #include "intf_msg.h"
+#include "interface.h"
+
+#include "main.h"
 
 /*****************************************************************************
  * vout_sys_t: video output GGI method descriptor
@@ -53,38 +58,78 @@ typedef struct vout_sys_s
     /* GGI system informations */
     ggi_visual_t        p_display;                         /* display device */
 
-    /* Buffers informations */
+    /* Buffer information */
     ggi_directbuffer *  p_buffer[2];                              /* buffers */
     boolean_t           b_must_acquire;   /* must be acquired before writing */
 } vout_sys_t;
 
 /*****************************************************************************
- * Local prototypes
+ * Local prototypes.
  *****************************************************************************/
-static int     GGIOpenDisplay   ( vout_thread_t *p_vout, char *psz_display, void *p_data );
-static void    GGICloseDisplay  ( vout_thread_t *p_vout );
+static int  vout_Probe     ( probedata_t *p_data );
+static int  vout_Create    ( struct vout_thread_s * );
+static int  vout_Init      ( struct vout_thread_s * );
+static void vout_End       ( struct vout_thread_s * );
+static void vout_Destroy   ( struct vout_thread_s * );
+static int  vout_Manage    ( struct vout_thread_s * );
+static void vout_Display   ( struct vout_thread_s * );
+
+static int  GGIOpenDisplay ( vout_thread_t *p_vout );
+static void GGICloseDisplay( vout_thread_t *p_vout );
+
+/*****************************************************************************
+ * Functions exported as capabilities. They are declared as static so that
+ * we don't pollute the namespace too much.
+ *****************************************************************************/
+void vout_getfunctions( function_list_t * p_function_list )
+{
+    p_function_list->pf_probe = vout_Probe;
+    p_function_list->functions.vout.pf_create     = vout_Create;
+    p_function_list->functions.vout.pf_init       = vout_Init;
+    p_function_list->functions.vout.pf_end        = vout_End;
+    p_function_list->functions.vout.pf_destroy    = vout_Destroy;
+    p_function_list->functions.vout.pf_manage     = vout_Manage;
+    p_function_list->functions.vout.pf_display    = vout_Display;
+    p_function_list->functions.vout.pf_setpalette = NULL;
+}
 
 /*****************************************************************************
- * vout_GGICreate: allocate GGI video thread output method
+ * vout_Probe: probe the video driver and return a score
+ *****************************************************************************
+ * This function tries to initialize GGI and returns a score to the
+ * plugin manager so that it can select the best plugin.
+ *****************************************************************************/
+static int vout_Probe( probedata_t *p_data )
+{
+    if( TestMethod( VOUT_METHOD_VAR, "ggi" ) )
+    {
+        return( 999 );
+    }
+
+    return( 40 );
+}
+
+/*****************************************************************************
+ * vout_Create: allocate GGI video thread output method
  *****************************************************************************
  * This function allocate and initialize a GGI vout method. It uses some of the
  * vout properties to choose the correct mode, and change them according to the
  * mode actually used.
  *****************************************************************************/
-int vout_GGICreate( vout_thread_t *p_vout, char *psz_display, int i_root_window, void *p_data )
+int vout_Create( vout_thread_t *p_vout )
 {
     /* Allocate structure */
     p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
     if( p_vout->p_sys == NULL )
     {
-        intf_ErrMsg("error: %s", strerror(ENOMEM) );
+        intf_ErrMsg( "vout error: %s", strerror(ENOMEM) );
         return( 1 );
     }
 
     /* Open and initialize device */
-    if( GGIOpenDisplay( p_vout, psz_display, p_data ) )
+    if( GGIOpenDisplay( p_vout ) )
     {
-        intf_ErrMsg("error: can't initialize GGI display");
+        intf_ErrMsg( "vout error: can't initialize GGI display" );
         free( p_vout->p_sys );
         return( 1 );
     }
@@ -92,11 +137,11 @@ int vout_GGICreate( vout_thread_t *p_vout, char *psz_display, int i_root_window,
 }
 
 /*****************************************************************************
- * vout_GGIInit: initialize GGI video thread output method
+ * vout_Init: initialize GGI video thread output method
  *****************************************************************************
  * This function initialize the GGI display device.
  *****************************************************************************/
-int vout_GGIInit( vout_thread_t *p_vout )
+int vout_Init( vout_thread_t *p_vout )
 {
     /* Acquire first buffer */
     if( p_vout->p_sys->b_must_acquire )
@@ -108,11 +153,11 @@ int vout_GGIInit( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_GGIEnd: terminate Sys video thread output method
+ * vout_End: terminate GGI video thread output method
  *****************************************************************************
- * Terminate an output method created by vout_GGICreate
+ * Terminate an output method created by vout_Create
  *****************************************************************************/
-void vout_GGIEnd( vout_thread_t *p_vout )
+void vout_End( vout_thread_t *p_vout )
 {
     /* Release buffer */
     if( p_vout->p_sys->b_must_acquire )
@@ -122,35 +167,53 @@ void vout_GGIEnd( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_GGIDestroy: destroy Sys video thread output method
+ * vout_Destroy: destroy GGI video thread output method
  *****************************************************************************
- * Terminate an output method created by vout_GGICreate
+ * Terminate an output method created by vout_Create
  *****************************************************************************/
-void vout_GGIDestroy( vout_thread_t *p_vout )
+void vout_Destroy( vout_thread_t *p_vout )
 {
     GGICloseDisplay( p_vout );
+
     free( p_vout->p_sys );
 }
 
 /*****************************************************************************
- * vout_GGIManage: handle Sys events
+ * vout_Manage: handle GGI events
  *****************************************************************************
  * This function should be called regularly by video output thread. It returns
  * a non null value if an error occured.
  *****************************************************************************/
-int vout_GGIManage( vout_thread_t *p_vout )
+int vout_Manage( vout_thread_t *p_vout )
 {
-    /* FIXME: 8bpp: change palette ?? */
+    int         i_key;                                        /* unicode key */
+
+    /* For all events in queue */
+    while( ggiKbhit( p_vout->p_sys->p_display ) )
+    {
+        i_key = ggiGetc( p_vout->p_sys->p_display );
+        switch( i_key )
+        {
+        case 'q':
+            /* FIXME pass message ! */
+            p_main->p_intf->b_die = 1;
+            break;
+
+        default:
+            break;
+        }
+    }
+
     return( 0 );
 }
 
 /*****************************************************************************
- * vout_GGIDisplay: displays previously rendered output
+ * vout_Display: displays previously rendered output
  *****************************************************************************
  * This function send the currently rendered image to the display, wait until
  * it is displayed and switch the two rendering buffer, preparing next frame.
  *****************************************************************************/
-void vout_GGIDisplay( vout_thread_t *p_vout )
+void vout_Display( vout_thread_t *p_vout )
 {
     /* Change display frame */
     if( p_vout->p_sys->b_must_acquire )
@@ -179,36 +242,39 @@ void vout_GGIDisplay( vout_thread_t *p_vout )
  * Open and initialize display according to preferences specified in the vout
  * thread fields.
  *****************************************************************************/
-static int GGIOpenDisplay( vout_thread_t *p_vout, char *psz_display, void *p_data )
+static int GGIOpenDisplay( vout_thread_t *p_vout )
 {
     ggi_mode    mode;                                     /* mode descriptor */
     ggi_color   col_fg;                                  /* foreground color */
     ggi_color   col_bg;                                  /* background color */
     int         i_index;                               /* all purposes index */
+    char        *psz_display;
 
     /* Initialize library */
     if( ggiInit() )
     {
-        intf_ErrMsg("error: can't initialize GGI library");
+        intf_ErrMsg( "vout error: can't initialize GGI library" );
         return( 1 );
     }
 
     /* Open display */
+    psz_display = main_GetPszVariable( VOUT_DISPLAY_VAR, NULL );
+
     p_vout->p_sys->p_display = ggiOpen( psz_display, NULL );
+
     if( p_vout->p_sys->p_display == NULL )
     {
-        intf_ErrMsg("error: can't open GGI default display");
+        intf_ErrMsg( "vout error: can't open GGI default display" );
         ggiExit();
         return( 1 );
     }
 
-    /* give the data back to the interface */
-    *(ggi_visual_t *)p_data = p_vout->p_sys->p_display;
-
     /* Find most appropriate mode */
     mode.frames =       2;                                      /* 2 buffers */
-    mode.visible.x =    p_vout->i_width;                    /* minimum width */
-    mode.visible.y =    p_vout->i_height;                  /* minimum height */
+    mode.visible.x =    main_GetIntVariable( VOUT_WIDTH_VAR,
+                                             VOUT_WIDTH_DEFAULT );
+    mode.visible.y =    main_GetIntVariable( VOUT_HEIGHT_VAR,
+                                             VOUT_HEIGHT_DEFAULT );
     mode.virt.x =       GGI_AUTO;
     mode.virt.y =       GGI_AUTO;
     mode.size.x =       GGI_AUTO;
@@ -224,7 +290,7 @@ static int GGIOpenDisplay( vout_thread_t *p_vout, char *psz_display, void *p_dat
     /* Set mode */
     if( ggiSetMode( p_vout->p_sys->p_display, &mode ) )
     {
-        intf_ErrMsg("error: can't set GGI mode");
+        intf_ErrMsg( "vout error: can't set GGI mode" );
         ggiClose( p_vout->p_sys->p_display );
         ggiExit();
         return( 1 );
@@ -239,7 +305,7 @@ static int GGIOpenDisplay( vout_thread_t *p_vout, char *psz_display, void *p_dat
             (ggi_directbuffer *)ggiDBGetBuffer( p_vout->p_sys->p_display, i_index );
         if( p_vout->p_sys->p_buffer[ i_index ] == NULL )
         {
-            intf_ErrMsg("error: double buffering is not possible");
+            intf_ErrMsg( "vout error: double buffering is not possible" );
             ggiClose( p_vout->p_sys->p_display );
             ggiExit();
             return( 1 );
@@ -252,7 +318,7 @@ static int GGIOpenDisplay( vout_thread_t *p_vout, char *psz_display, void *p_dat
             (p_vout->p_sys->p_buffer[ i_index ]->noaccess != 0) ||
             (p_vout->p_sys->p_buffer[ i_index ]->align != 0) )
         {
-            intf_ErrMsg("error: incorrect video memory type");
+            intf_ErrMsg( "vout error: incorrect video memory type" );
             ggiClose( p_vout->p_sys->p_display );
             ggiExit();
             return( 1 );
@@ -279,7 +345,7 @@ static int GGIOpenDisplay( vout_thread_t *p_vout, char *psz_display, void *p_dat
         ggiSetGCBackground(p_vout->p_sys->p_display,
                            ggiMapColor(p_vout->p_sys->p_display,&col_bg)) )
     {
-        intf_ErrMsg("error: can't set colors");
+        intf_ErrMsg( "vout error: can't set colors" );
         ggiClose( p_vout->p_sys->p_display );
         ggiExit();
         return( 1 );
@@ -289,7 +355,7 @@ static int GGIOpenDisplay( vout_thread_t *p_vout, char *psz_display, void *p_dat
     if( ggiSetGCClipping(p_vout->p_sys->p_display, 0, 0,
                          mode.visible.x, mode.visible.y ) )
     {
-        intf_ErrMsg("error: can't set clipping");
+        intf_ErrMsg( "vout error: can't set clipping" );
         ggiClose( p_vout->p_sys->p_display );
         ggiExit();
         return( 1 );
index a139c82c42044f5d22f0b8ad22ca040a19083817..a9bd318fa63e7134ebce953eea584da9bb780632 100644 (file)
@@ -129,11 +129,13 @@ create_intf_window (void)
   gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_playlist",
                             menubar_view_menu_uiinfo[0].widget,
                             (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_set_sensitive (menubar_view_menu_uiinfo[0].widget, FALSE);
 
   gtk_widget_ref (menubar_view_menu_uiinfo[1].widget);
   gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_modules",
                             menubar_view_menu_uiinfo[1].widget,
                             (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_set_sensitive (menubar_view_menu_uiinfo[1].widget, FALSE);
 
   gtk_widget_ref (menubar_uiinfo[2].widget);
   gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_settings",
@@ -144,6 +146,7 @@ create_intf_window (void)
   gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_preferences",
                             menubar_settings_menu_uiinfo[0].widget,
                             (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_set_sensitive (menubar_settings_menu_uiinfo[0].widget, FALSE);
 
   gtk_widget_ref (menubar_uiinfo[3].widget);
   gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_help",
@@ -193,6 +196,7 @@ create_intf_window (void)
   gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_back", toolbar_back,
                             (GtkDestroyNotify) gtk_widget_unref);
   gtk_widget_show (toolbar_back);
+  gtk_widget_set_sensitive (toolbar_back, FALSE);
 
   tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_STOP);
   toolbar_stop = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
@@ -205,6 +209,7 @@ create_intf_window (void)
   gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_stop", toolbar_stop,
                             (GtkDestroyNotify) gtk_widget_unref);
   gtk_widget_show (toolbar_stop);
+  gtk_widget_set_sensitive (toolbar_stop, FALSE);
 
   tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_FORWARD);
   toolbar_play = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
@@ -267,6 +272,7 @@ create_intf_window (void)
   gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_playlist", toolbar_playlist,
                             (GtkDestroyNotify) gtk_widget_unref);
   gtk_widget_show (toolbar_playlist);
+  gtk_widget_set_sensitive (toolbar_playlist, FALSE);
 
   tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_FIRST);
   toolbar_prev = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
@@ -317,7 +323,7 @@ create_intf_window (void)
   gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5);
   gtk_misc_set_padding (GTK_MISC (label6), 5, 0);
 
-  hscale = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (43.75, 0, 100, 1, 6.25, 0)));
+  hscale = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 1, 6.25, 0)));
   gtk_widget_ref (hscale);
   gtk_object_set_data_full (GTK_OBJECT (intf_window), "hscale", hscale,
                             (GtkDestroyNotify) gtk_widget_unref);
index 1358a8f9d4c365e3dbb6d83b57066e186b15a838..621d5e27a3ea8f8dc66ccc63aa28c5dcf351aa08 100644 (file)
            <widget>
              <class>GtkPixmapMenuItem</class>
              <name>menubar_playlist</name>
+             <sensitive>False</sensitive>
              <tooltip>Open the playlist window</tooltip>
              <signal>
                <name>activate</name>
            <widget>
              <class>GtkPixmapMenuItem</class>
              <name>menubar_modules</name>
+             <sensitive>False</sensitive>
              <tooltip>Open the plugin manager</tooltip>
              <signal>
                <name>activate</name>
            <widget>
              <class>GtkPixmapMenuItem</class>
              <name>menubar_preferences</name>
+             <sensitive>False</sensitive>
              <signal>
                <name>activate</name>
                <handler>on_menubar_preferences_activate</handler>
          <class>GtkButton</class>
          <child_name>Toolbar:button</child_name>
          <name>toolbar_back</name>
+         <sensitive>False</sensitive>
          <tooltip>Go Backwards</tooltip>
          <signal>
            <name>clicked</name>
          <class>GtkButton</class>
          <child_name>Toolbar:button</child_name>
          <name>toolbar_stop</name>
+         <sensitive>False</sensitive>
          <tooltip>Stop Stream</tooltip>
          <signal>
            <name>clicked</name>
          <class>GtkButton</class>
          <child_name>Toolbar:button</child_name>
          <name>toolbar_playlist</name>
+         <sensitive>False</sensitive>
          <tooltip>Open Playlist</tooltip>
          <signal>
            <name>clicked</name>
        <value_pos>GTK_POS_BOTTOM</value_pos>
        <digits>1</digits>
        <policy>GTK_UPDATE_DELAYED</policy>
-       <value>43.75</value>
+       <value>0</value>
        <lower>0</lower>
        <upper>100</upper>
        <step>1</step>