Commit c3b1800a authored by Sam Hocevar's avatar Sam Hocevar

  * configure.in and Makefile.in patches for better SDL support and
    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.
parent e630779b
Ethan C. Baldridge <BaldridgeE@cadmus.com>
* Directory browsing code in modules.c
Arkadiusz Miskiewicz <misiek@pld.ORG.PL>
* Makefile and configure patches.
...@@ -18,7 +18,12 @@ SYS=@SYS@ ...@@ -18,7 +18,12 @@ SYS=@SYS@
PLUGINS=@PLUGINS@ PLUGINS=@PLUGINS@
INSTALL=@INSTALL@ INSTALL=@INSTALL@
ARCH=@ARCH@ ARCH=@ARCH@
prefix=@prefix@ prefix=@prefix@
bindir=@bindir@
datadir=@datadir@
libdir=@libdir@
CC=@CC@ CC=@CC@
SHELL=@SHELL@ SHELL=@SHELL@
...@@ -304,7 +309,6 @@ PLUGIN_FB = plugins/fb/fb.o \ ...@@ -304,7 +309,6 @@ PLUGIN_FB = plugins/fb/fb.o \
plugins/fb/vout_fb.o plugins/fb/vout_fb.o
PLUGIN_GGI = plugins/ggi/ggi.o \ PLUGIN_GGI = plugins/ggi/ggi.o \
plugins/ggi/intf_ggi.o \
plugins/ggi/vout_ggi.o plugins/ggi/vout_ggi.o
PLUGIN_GLIDE = plugins/glide/glide.o \ PLUGIN_GLIDE = plugins/glide/glide.o \
...@@ -444,15 +448,15 @@ distclean: clean ...@@ -444,15 +448,15 @@ distclean: clean
rm -rf .dep rm -rf .dep
install: install:
mkdir -p $(prefix)/bin mkdir -p $(DESTDIR)$(bindir)
$(INSTALL) vlc $(prefix)/bin $(INSTALL) vlc $(DESTDIR)$(bindir)
# ugly # ugly
for alias in "" @ALIASES@ ; do if test $$alias ; then rm -f $(prefix)/bin/$$alias && ln -s vlc $(prefix)/bin/$$alias ; fi ; done for alias in "" @ALIASES@ ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
mkdir -p $(prefix)/lib/videolan/vlc mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
$(INSTALL) -m 644 $(PLUGINS:%=lib/%.so) $(prefix)/lib/videolan/vlc $(INSTALL) -m 644 $(PLUGINS:%=lib/%.so) $(DESTDIR)$(libdir)/videolan/vlc
mkdir -p $(prefix)/share/videolan mkdir -p $(DESTDIR)$(datadir)/videolan
$(INSTALL) -m 644 share/*.psf $(prefix)/share/videolan $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/videolan
$(INSTALL) -m 644 share/*.png $(prefix)/share/videolan $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan
show: show:
@echo CC: $(CC) @echo CC: $(CC)
......
...@@ -171,14 +171,14 @@ AC_ARG_WITH(sdl, ...@@ -171,14 +171,14 @@ AC_ARG_WITH(sdl,
[ PLUGINS=${PLUGINS}"sdl "; [ PLUGINS=${PLUGINS}"sdl ";
if test "x$withval" != "xyes"; if test "x$withval" != "xyes";
then then
LIB_SDL="-l"$withval LIB_SDL="L /usr/X11R6/lib -l"$withval
else else
LIB_SDL="-lSDL" LIB_SDL="-L/usr/X11R6/lib -lSDL"
fi ]) fi ])
if test "x$withval" == "x"; if test "x$withval" == "x";
then then
PLUGINS=${PLUGINS}"sdl " PLUGINS=${PLUGINS}"sdl "
LIB_SDL="-lSDL" LIB_SDL="-L/usr/X11R6/lib -lSDL"
fi fi
AC_ARG_WITH(glide, AC_ARG_WITH(glide,
[ --with-glide[=name] Glide (3dfx) support (default disabled)], [ --with-glide[=name] Glide (3dfx) support (default disabled)],
......
/***************************************************************************** /*****************************************************************************
* ggi.c : GGI plugin for vlc * ggi.c : GGI plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
*
* Authors:
* *
* Authors: Samuel Hocevar <sam@zoy.org>
*
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
#define MODULE_NAME ggi
/***************************************************************************** /*****************************************************************************
* Preamble * Preamble
*****************************************************************************/ *****************************************************************************/
...@@ -31,88 +33,80 @@ ...@@ -31,88 +33,80 @@
#include "common.h" /* boolean_t, byte_t */ #include "common.h" /* boolean_t, byte_t */
#include "threads.h" #include "threads.h"
#include "mtime.h" #include "mtime.h"
#include "tests.h"
#include "plugins.h"
#include "interface.h"
#include "audio_output.h"
#include "video.h" #include "video.h"
#include "video_output.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 ); MODULE_CONFIG_START
static void intf_GetPlugin( p_intf_thread_t p_intf ); ADD_WINDOW( "Configuration for GGI module" )
ADD_COMMENT( "For now, the GGI module cannot be configured" )
/* Video output */ MODULE_CONFIG_END
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 ); * Capabilities defined in the other files.
void vout_GGIEnd ( p_vout_thread_t p_vout ); ******************************************************************************/
void vout_GGIDestroy ( p_vout_thread_t p_vout ); extern void vout_getfunctions( function_list_t * p_function_list );
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 );
/***************************************************************************** /*****************************************************************************
* 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_module->psz_name = MODULE_STRING;
p_module->psz_longname = "General Graphics Interface module";
p_info->psz_name = "GGI"; p_module->psz_version = VERSION;
p_info->psz_version = VERSION;
p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
p_info->aout_GetPlugin = NULL; p_module->i_capabilities = MODULE_CAPABILITY_NULL
p_info->vout_GetPlugin = vout_GetPlugin; | MODULE_CAPABILITY_VOUT;
p_info->intf_GetPlugin = intf_GetPlugin;
p_info->yuv_GetPlugin = NULL;
/* if the GGI libraries are there, assume we can enter the return( 0 );
* initialization part at least, even if we fail afterwards */ }
p_info->i_score = 0x100;
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 */ vout_getfunctions( &p_module->p_functions->vout );
if( TestMethod( VOUT_METHOD_VAR, "ggi" ) )
{ p_module->p_config = p_config;
p_info->i_score += 0x200;
}
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.
*****************************************************************************/ *****************************************************************************/
int DeactivateModule( module_t * p_module )
static void vout_GetPlugin( p_vout_thread_t p_vout )
{ {
p_vout->p_sys_create = vout_GGICreate; free( p_module->p_functions );
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;
}
static void intf_GetPlugin( p_intf_thread_t p_intf ) return( 0 );
{
p_intf->p_sys_create = intf_GGICreate;
p_intf->p_sys_destroy = intf_GGIDestroy;
p_intf->p_sys_manage = intf_GGIManage;
} }
/*****************************************************************************
* 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 );
}
}
}
/***************************************************************************** /*****************************************************************************
* vout_ggi.c: GGI video output display method * 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 * 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 * it under the terms of the GNU General Public License as published by
...@@ -35,12 +36,16 @@ ...@@ -35,12 +36,16 @@
#include "common.h" #include "common.h"
#include "threads.h" #include "threads.h"
#include "mtime.h" #include "mtime.h"
#include "plugins.h" #include "tests.h"
#include "modules.h"
#include "video.h" #include "video.h"
#include "video_output.h" #include "video_output.h"
#include "intf_msg.h" #include "intf_msg.h"
#include "interface.h"
#include "main.h"
/***************************************************************************** /*****************************************************************************
* vout_sys_t: video output GGI method descriptor * vout_sys_t: video output GGI method descriptor
...@@ -53,38 +58,78 @@ typedef struct vout_sys_s ...@@ -53,38 +58,78 @@ typedef struct vout_sys_s
/* GGI system informations */ /* GGI system informations */
ggi_visual_t p_display; /* display device */ ggi_visual_t p_display; /* display device */
/* Buffers informations */ /* Buffer information */
ggi_directbuffer * p_buffer[2]; /* buffers */ ggi_directbuffer * p_buffer[2]; /* buffers */
boolean_t b_must_acquire; /* must be acquired before writing */ boolean_t b_must_acquire; /* must be acquired before writing */
} vout_sys_t; } vout_sys_t;
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes.
*****************************************************************************/ *****************************************************************************/
static int GGIOpenDisplay ( vout_thread_t *p_vout, char *psz_display, void *p_data ); static int vout_Probe ( probedata_t *p_data );
static void GGICloseDisplay ( vout_thread_t *p_vout ); 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 * 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 * vout properties to choose the correct mode, and change them according to the
* mode actually used. * 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 */ /* Allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) ); p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL ) if( p_vout->p_sys == NULL )
{ {
intf_ErrMsg("error: %s", strerror(ENOMEM) ); intf_ErrMsg( "vout error: %s", strerror(ENOMEM) );
return( 1 ); return( 1 );
} }
/* Open and initialize device */ /* 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 ); free( p_vout->p_sys );
return( 1 ); return( 1 );
} }
...@@ -92,11 +137,11 @@ int vout_GGICreate( vout_thread_t *p_vout, char *psz_display, int i_root_window, ...@@ -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. * 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 */ /* Acquire first buffer */
if( p_vout->p_sys->b_must_acquire ) if( p_vout->p_sys->b_must_acquire )
...@@ -108,11 +153,11 @@ int vout_GGIInit( vout_thread_t *p_vout ) ...@@ -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 */ /* Release buffer */
if( p_vout->p_sys->b_must_acquire ) if( p_vout->p_sys->b_must_acquire )
...@@ -122,35 +167,53 @@ void vout_GGIEnd( vout_thread_t *p_vout ) ...@@ -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 ); GGICloseDisplay( p_vout );
free( p_vout->p_sys ); 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 * This function should be called regularly by video output thread. It returns
* a non null value if an error occured. * 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 ); 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 * This function send the currently rendered image to the display, wait until
* it is displayed and switch the two rendering buffer, preparing next frame. * 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 */ /* Change display frame */
if( p_vout->p_sys->b_must_acquire ) if( p_vout->p_sys->b_must_acquire )
...@@ -179,36 +242,39 @@ void vout_GGIDisplay( vout_thread_t *p_vout ) ...@@ -179,36 +242,39 @@ void vout_GGIDisplay( vout_thread_t *p_vout )
* Open and initialize display according to preferences specified in the vout * Open and initialize display according to preferences specified in the vout
* thread fields. * 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_mode mode; /* mode descriptor */
ggi_color col_fg; /* foreground color */ ggi_color col_fg; /* foreground color */
ggi_color col_bg; /* background color */ ggi_color col_bg; /* background color */
int i_index; /* all purposes index */ int i_index; /* all purposes index */
char *psz_display;
/* Initialize library */ /* Initialize library */
if( ggiInit() ) if( ggiInit() )
{ {
intf_ErrMsg("error: can't initialize GGI library"); intf_ErrMsg( "vout error: can't initialize GGI library" );
return( 1 ); return( 1 );
} }
/* Open display */ /* Open display */
psz_display = main_GetPszVariable( VOUT_DISPLAY_VAR, NULL );
p_vout->p_sys->p_display = ggiOpen( psz_display, NULL ); p_vout->p_sys->p_display = ggiOpen( psz_display, NULL );
if( p_vout->p_sys->p_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(); ggiExit();
return( 1 ); return( 1 );
} }
/* give the data back to the interface */
*(ggi_visual_t *)p_data = p_vout->p_sys->p_display;
/* Find most appropriate mode */ /* Find most appropriate mode */
mode.frames = 2; /* 2 buffers */ mode.frames = 2; /* 2 buffers */
mode.visible.x = p_vout->i_width; /* minimum width */ mode.visible.x = main_GetIntVariable( VOUT_WIDTH_VAR,
mode.visible.y = p_vout->i_height; /* minimum height */ VOUT_WIDTH_DEFAULT );
mode.visible.y = main_GetIntVariable( VOUT_HEIGHT_VAR,
VOUT_HEIGHT_DEFAULT );
mode.virt.x = GGI_AUTO; mode.virt.x = GGI_AUTO;
mode.virt.y = GGI_AUTO; mode.virt.y = GGI_AUTO;
mode.size.x = 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 ...@@ -224,7 +290,7 @@ static int GGIOpenDisplay( vout_thread_t *p_vout, char *psz_display, void *p_dat
/* Set mode */ /* Set mode */
if( ggiSetMode( p_vout->p_sys->p_display, &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 ); ggiClose( p_vout->p_sys->p_display );
ggiExit(); ggiExit();
return( 1 ); return( 1 );
...@@ -239,7 +305,7 @@ static int GGIOpenDisplay( vout_thread_t *p_vout, char *psz_display, void *p_dat ...@@ -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 ); (ggi_directbuffer *)ggiDBGetBuffer( p_vout->p_sys->p_display, i_index );
if( p_vout->p_sys->p_buffer[ i_index ] == NULL ) 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 ); ggiClose( p_vout->p_sys->p_display );
ggiExit(); ggiExit();
return( 1 ); return( 1 );
...@@ -252,7 +318,7 @@ static int GGIOpenDisplay( vout_thread_t *p_vout, char *psz_display, void *p_dat ...@@ -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 ]->noaccess != 0) ||
(p_vout->p_sys->p_buffer[ i_index ]->align != 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 ); ggiClose( p_vout->p_sys->p_display );
ggiExit(); ggiExit();
return( 1 ); return( 1 );
...@@ -279,7 +345,7 @@ static int GGIOpenDisplay( vout_thread_t *p_vout, char *psz_display, void *p_dat ...@@ -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, ggiSetGCBackground(p_vout->p_sys->p_display,
ggiMapColor(p_vout->p_sys->p_display,&col_bg)) ) 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 ); ggiClose( p_vout->p_sys->p_display );
ggiExit(); ggiExit();
return( 1 ); return( 1 );
...@@ -289,7 +355,7 @@ static int GGIOpenDisplay( vout_thread_t *p_vout, char *psz_display, void *p_dat ...@@ -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, if( ggiSetGCClipping(p_vout->p_sys->p_display, 0, 0,
mode.visible.x, mode.visible.y ) ) 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 ); ggiClose( p_vout->p_sys->p_display );
ggiExit(); ggiExit();
return( 1 ); return( 1 );
......
...@@ -129,11 +129,13 @@ create_intf_window (void) ...@@ -129,11 +129,13 @@ create_intf_window (void)
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_playlist", gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_playlist",
menubar_view_menu_uiinfo[0].widget, menubar_view_menu_uiinfo[0].widget,
(GtkDestroyNotify) gtk_widget_unref); (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_widget_ref (menubar_view_menu_uiinfo[1].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_modules", gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_modules",
menubar_view_menu_uiinfo[1].widget, menubar_view_menu_uiinfo[1].widget,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_set_sensitive (menubar_view_menu_uiinfo[1].widget, FALSE);
gtk_widget_ref (menubar_uiinfo[2].widget); gtk_widget_ref (menubar_uiinfo[2].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_settings", gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_settings",
...@@ -144,6 +146,7 @@ create_intf_window (void) ...@@ -144,6 +146,7 @@ create_intf_window (void)
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_preferences", gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_preferences",
menubar_settings_menu_uiinfo[0].widget, menubar_settings_menu_uiinfo[0].widget,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_set_sensitive (menubar_settings_menu_uiinfo[0].widget, FALSE);
gtk_widget_ref (menubar_uiinfo[3].widget); gtk_widget_ref (menubar_uiinfo[3].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_help", gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_help",
...@@ -193,6 +196,7 @@ create_intf_window (void) ...@@ -193,6 +196,7 @@ create_intf_window (void)
gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_back", toolbar_back, gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_back", toolbar_back,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_back); 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); tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_STOP);
toolbar_stop = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), toolbar_stop = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
...@@ -205,6 +209,7 @@ create_intf_window (void) ...@@ -205,6 +209,7 @@ create_intf_window (void)
gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_stop", toolbar_stop, gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_stop", toolbar_stop,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_stop); 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); tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_FORWARD);
toolbar_play = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), toolbar_play = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
...@@ -267,6 +272,7 @@ create_intf_window (void) ...@@ -267,6 +272,7 @@ create_intf_window (void)
gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_playlist", toolbar_playlist, gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_playlist", toolbar_playlist,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_playlist); 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); tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_FIRST);
toolbar_prev = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), toolbar_prev = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
...@@ -317,7 +323,7 @@ create_intf_window (void) ...@@ -317,7 +323,7 @@ create_intf_window (void)
gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5); gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5);
gtk_misc_set_padding (GTK_MISC (label6), 5, 0); 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_widget_ref (hscale);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "hscale", hscale, gtk_object_set_data_full (GTK_OBJECT (intf_window), "hscale", hscale,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
......
...@@ -124,6 +124,7 @@ ...@@ -124,6 +124,7 @@
<widget> <widget>
<class>GtkPixmapMenuItem</class> <class>GtkPixmapMenuItem</class>
<name>menubar_playlist</name> <name>menubar_playlist</name>
<sensitive>False</sensitive>
<tooltip>Open the playlist window</tooltip> <tooltip>Open the playlist window</tooltip>
<signal> <signal>
<name>activate</name> <name>activate</name>
...@@ -138,6 +139,7 @@ ...@@ -138,6 +139,7 @@
<widget> <widget>
<class>GtkPixmapMenuItem</class> <class>GtkPixmapMenuItem</class>
<name>menubar_modules</name> <name>menubar_modules</name>
<sensitive>False</sensitive>
<tooltip>Open the plugin manager</tooltip> <tooltip>Open the plugin manager</tooltip>
<signal> <signal>
<name>activate</name> <name>activate</name>
...@@ -163,6 +165,7 @@ ...@@ -163,6 +165,7 @@
<widget> <widget>
<class>GtkPixmapMenuItem</class> <class>GtkPixmapMenuItem</class>
<name>menubar_preferences</name> <name>menubar_preferences</name>
<sensitive>False</sensitive>
<signal> <signal>
<name>activate</name> <name>activate</name>
<handler>on_menubar_preferences_activate</handler> <handler>on_menubar_preferences_activate</handler>
...@@ -241,6 +244,7 @@ ...@@ -241,6 +244,7 @@
<class>GtkButton</class> <class>GtkButton</class>
<child_name>Toolbar:button</child_name> <child_name>Toolbar:button</child_name>
<name>toolbar_back</name> <name>toolbar_back</name>
<sensitive>False</sensitive>
<tooltip>Go Backwards</tooltip> <tooltip>Go Backwards</tooltip>
<signal> <signal>
<name>clicked</name> <name>clicked</name>
...@@ -258,6 +262,7 @@ ...@@ -258,6 +262,7 @@
<class>GtkButton</class> <class>GtkButton</class>
<child_name>Toolbar:button</child_name> <child_name>Toolbar:button</child_name>
<name>toolbar_stop</name> <name>toolbar_stop</name>
<sensitive>False</sensitive>
<tooltip>Stop Stream</tooltip> <tooltip>Stop Stream</tooltip>
<signal> <signal>
<name>clicked</name> <name>clicked</name>
...@@ -328,6 +333,7 @@ ...@@ -328,6 +333,7 @@
<class>GtkButton</class> <class>GtkButton</class>
<child_name>Toolbar:button</child_name> <child_name>Toolbar:button</child_name>
<name>toolbar_playlist</name> <name>toolbar_playlist</name>
<sensitive>False</sensitive>
<tooltip>Open Playlist</tooltip> <tooltip>Open Playlist</tooltip>
<signal> <signal>
<name>clicked</name> <name>clicked</name>
...@@ -428,7 +434,7 @@ ...@@ -428,7 +434,7 @@
<value_pos>GTK_POS_BOTTOM</value_pos> <value_pos>GTK_POS_BOTTOM</value_pos>
<digits>1</digits> <digits>1</digits>
<policy>GTK_UPDATE_DELAYED</policy> <policy>GTK_UPDATE_DELAYED</policy>
<value>43.75</value> <value>0</value>
<lower>0</lower> <lower>0</lower>
<upper>100</upper> <upper>100</upper>
<step>1</step> <step>1</step>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment