* configure.ac.in, modules/gui/gtk/gtk.c: Added a NEED_GTK_MAIN macro to the compiler
flags for the gtk module. When this macro isn't defined, then the gtk module
doesn't make use of the gtk_main module. I had to do this change because the
gtk_main trick can't work on win32 and render the whole gtk interface unusable.
if test "x${ac_cv_gtk_headers}" = "xyes"
then
PLUGINS="${PLUGINS} gtk"
if test "x${ac_cv_gtk_headers}" = "xyes"
then
PLUGINS="${PLUGINS} gtk"
+ if test "x${SYS}" != "xmingw32"; then
+ NEED_GTK_MAIN=yes
+ fi
ALIASES="${ALIASES} gvlc"
fi
CPPFLAGS="${CPPFLAGS_save}"
ALIASES="${ALIASES} gvlc"
fi
CPPFLAGS="${CPPFLAGS_save}"
if test "x${NEED_GTK_MAIN}" != "xno"
then
PLUGINS="${PLUGINS} gtk_main"
if test "x${NEED_GTK_MAIN}" != "xno"
then
PLUGINS="${PLUGINS} gtk_main"
+ CFLAGS_gtk = "${CFLAGS_gtk} -DNEED_GTK_MAIN"
CFLAGS_gtk_main="${CFLAGS_gtk_main} ${CFLAGS_gtk} ${CFLAGS_familiar}"
LDFLAGS_gtk_main="${LDFLAGS_gtk_main} ${LDFLAGS_gtk} ${LDFLAGS_familiar}"
fi
CFLAGS_gtk_main="${CFLAGS_gtk_main} ${CFLAGS_gtk} ${CFLAGS_familiar}"
LDFLAGS_gtk_main="${LDFLAGS_gtk_main} ${LDFLAGS_gtk} ${LDFLAGS_familiar}"
fi
* interface, such as message output.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* interface, such as message output.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: interface.h,v 1.34 2002/10/03 17:01:59 gbazin Exp $
+ * $Id: interface.h,v 1.35 2002/10/04 12:01:40 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
*****************************************************************************/
#ifdef WIN32
# define CONSOLE_INTRO_MSG \
*****************************************************************************/
#ifdef WIN32
# define CONSOLE_INTRO_MSG \
- AllocConsole(); \
- freopen( "CONOUT$", "w", stdout ); \
- freopen( "CONOUT$", "w", stderr ); \
- freopen( "CONIN$", "r", stdin ); \
- intf_Msg( VERSION_MESSAGE ); \
- intf_Msg( _("\nWarning: if you can't access the GUI anymore, "\
- "open a dos command box, go to the directory " \
- "where you installed VLC and run " \
- "\"vlc -I win32\"\n") )
+ AllocConsole(); \
+ freopen( "CONOUT$", "w", stdout ); \
+ freopen( "CONOUT$", "w", stderr ); \
+ freopen( "CONIN$", "r", stdin ); \
+ msg_Info( p_intf, VERSION_MESSAGE ); \
+ msg_Info( p_intf, _("\nWarning: if you can't access the GUI " \
+ "anymore, open a dos command box, go to the " \
+ "directory where you installed VLC and run " \
+ "\"vlc -I win32\"\n") )
#else
# define CONSOLE_INTRO_MSG
#endif
#else
# define CONSOLE_INTRO_MSG
#endif
* gtk.c : Gtk+ plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* gtk.c : Gtk+ plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: gtk.c,v 1.3 2002/09/30 11:05:39 sam Exp $
+ * $Id: gtk.c,v 1.4 2002/10/04 12:01:40 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
static void Close ( vlc_object_t * );
static void Run ( intf_thread_t * );
static void Close ( vlc_object_t * );
static void Run ( intf_thread_t * );
-static void Manage ( intf_thread_t * );
+static int Manage ( intf_thread_t * );
/*****************************************************************************
* Module descriptor
/*****************************************************************************
* Module descriptor
p_intf->p_sys->p_gtk_main = module_Need( p_this, "gtk_main", "gtk" );
if( p_intf->p_sys->p_gtk_main == NULL )
{
free( p_intf->p_sys );
return VLC_EMODULE;
}
p_intf->p_sys->p_gtk_main = module_Need( p_this, "gtk_main", "gtk" );
if( p_intf->p_sys->p_gtk_main == NULL )
{
free( p_intf->p_sys );
return VLC_EMODULE;
}
msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
module_Unneed( p_intf, p_intf->p_sys->p_gtk_main );
module_Unneed( p_intf, p_intf->p_sys->p_gtk_main );
/* Destroy structure */
free( p_intf->p_sys );
/* Destroy structure */
free( p_intf->p_sys );
{ "text/plain", 0, DROP_ACCEPT_TEXT_PLAIN }
};
{ "text/plain", 0, DROP_ACCEPT_TEXT_PLAIN }
};
+#else
+ /* gtk_init needs to know the command line. We don't care, so we
+ * give it an empty one */
+ char *p_args[] = { "" };
+ char **pp_args = p_args;
+ int i_args = 1;
+ int i_dummy;
+
+ /* gtk_init will register stuff with g_atexit, so we need to take
+ * the global lock if we want to be able to intercept the calls */
+ vlc_mutex_lock( &p_intf->p_libvlc->global_lock );
+ gtk_init( &i_args, &pp_args );
+ vlc_mutex_unlock( &p_intf->p_libvlc->global_lock );
+#endif
/* Create some useful widgets that will certainly be used */
p_intf->p_sys->p_window = create_intf_window();
/* Create some useful widgets that will certainly be used */
p_intf->p_sys->p_window = create_intf_window();
/* Show the control window */
gtk_widget_show( p_intf->p_sys->p_window );
/* Show the control window */
gtk_widget_show( p_intf->p_sys->p_window );
while( !p_intf->b_die )
{
Manage( p_intf );
while( !p_intf->b_die )
{
Manage( p_intf );
msleep( INTF_IDLE_SLEEP );
gdk_threads_enter();
}
msleep( INTF_IDLE_SLEEP );
gdk_threads_enter();
}
+#else
+ /* Sleep to avoid using all CPU - since some interfaces needs to access
+ * keyboard events, a 100ms delay is a good compromise */
+ i_dummy = gtk_timeout_add( INTF_IDLE_SLEEP / 1000, (GtkFunction)Manage,
+ p_intf );
+ /* Enter Gtk mode */
+ gtk_main();
+ /* Remove the timeout */
+ gtk_timeout_remove( i_dummy );
+#endif
/* Destroy the Tooltips structure */
gtk_object_destroy( GTK_OBJECT(p_intf->p_sys->p_tooltips) );
/* Destroy the Tooltips structure */
gtk_object_destroy( GTK_OBJECT(p_intf->p_sys->p_tooltips) );
gtk_object_destroy( GTK_OBJECT(p_intf->p_sys->p_popup) );
gtk_object_destroy( GTK_OBJECT(p_intf->p_sys->p_window) );
gtk_object_destroy( GTK_OBJECT(p_intf->p_sys->p_popup) );
gtk_object_destroy( GTK_OBJECT(p_intf->p_sys->p_window) );
}
/* following functions are local */
}
/* following functions are local */
* In this function, called approx. 10 times a second, we check what the
* main program wanted to tell us.
*****************************************************************************/
* In this function, called approx. 10 times a second, we check what the
* main program wanted to tell us.
*****************************************************************************/
-static void Manage( intf_thread_t *p_intf )
+static int Manage( intf_thread_t *p_intf )
p_intf->p_sys->b_playing = 0;
}
p_intf->p_sys->b_playing = 0;
}
+#ifndef NEED_GTK_MAIN
+ if( p_intf->b_die )
+ {
+ vlc_mutex_unlock( &p_intf->change_lock );
+
+ /* Prepare to die, young Skywalker */
+ gtk_main_quit();
+
+ return FALSE;
+ }
+#endif
+
vlc_mutex_unlock( &p_intf->change_lock );
vlc_mutex_unlock( &p_intf->change_lock );
* threads.c : threads implementation for the VideoLAN client
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
* threads.c : threads implementation for the VideoLAN client
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
- * $Id: threads.c,v 1.19 2002/10/03 17:01:58 gbazin Exp $
+ * $Id: threads.c,v 1.20 2002/10/04 12:01:40 gbazin Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* function and have a 100% correct vlc_cond_wait() implementation.
* As this function is not available on Win9x, we can use the faster
* CriticalSections */
* function and have a 100% correct vlc_cond_wait() implementation.
* As this function is not available on Win9x, we can use the faster
* CriticalSections */
- if( p_this->p_vlc->SignalObjectAndWait && !p_this->p_vlc->b_fast_mutex )
+ if( p_this->p_libvlc->SignalObjectAndWait &&
+ !p_this->p_libvlc->b_fast_mutex )
{
/* We are running on NT/2K/XP, we can use SignalObjectAndWait */
p_mutex->mutex = CreateMutex( 0, FALSE, 0 );
{
/* We are running on NT/2K/XP, we can use SignalObjectAndWait */
p_mutex->mutex = CreateMutex( 0, FALSE, 0 );
p_condvar->i_waiting_threads = 0;
/* Misc init */
p_condvar->i_waiting_threads = 0;
/* Misc init */
- p_condvar->i_win9x_cv = p_this->p_vlc->i_win9x_cv;
- p_condvar->SignalObjectAndWait = p_this->p_vlc->SignalObjectAndWait;
+ p_condvar->i_win9x_cv = p_this->p_libvlc->i_win9x_cv;
+ p_condvar->SignalObjectAndWait = p_this->p_libvlc->SignalObjectAndWait;
- if( (p_condvar->SignalObjectAndWait && !p_this->p_vlc->b_fast_mutex)
+ if( (p_condvar->SignalObjectAndWait && !p_this->p_libvlc->b_fast_mutex)
|| p_condvar->i_win9x_cv == 0 )
{
/* Create an auto-reset event. */
|| p_condvar->i_win9x_cv == 0 )
{
/* Create an auto-reset event. */
0x7fffffff, /* max count */
NULL ); /* unnamed */
0x7fffffff, /* max count */
NULL ); /* unnamed */
- if( p_this->p_vlc->i_win9x_cv == 1 )
+ if( p_condvar->i_win9x_cv == 1 )
/* Create a manual-reset event initially signaled. */
p_condvar->event = CreateEvent( NULL, TRUE, TRUE, NULL );
else
/* Create a manual-reset event initially signaled. */
p_condvar->event = CreateEvent( NULL, TRUE, TRUE, NULL );
else
* win32_specific.c: Win32 specific features
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* win32_specific.c: Win32 specific features
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: win32_specific.c,v 1.15 2002/09/17 14:56:13 sam Exp $
+ * $Id: win32_specific.c,v 1.16 2002/10/04 12:01:40 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Gildas Bazin <gbazin@netcourrier.com>
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Gildas Bazin <gbazin@netcourrier.com>
*****************************************************************************/
void system_Configure( vlc_t *p_this )
{
*****************************************************************************/
void system_Configure( vlc_t *p_this )
{
- p_this->p_vlc->b_fast_mutex = config_GetInt( p_this, "fast-mutex" );
- p_this->p_vlc->i_win9x_cv = config_GetInt( p_this, "win9x-cv-method" );
+ p_this->p_libvlc->b_fast_mutex = config_GetInt( p_this, "fast-mutex" );
+ p_this->p_libvlc->i_win9x_cv = config_GetInt( p_this, "win9x-cv-method" );
}
/*****************************************************************************
}
/*****************************************************************************