* modules/gui/wxwindows/menus.cpp: fixes for menu auto-generation.
* src/video_output/video_output.c: added a "fullscreen" object variable.
* modules/video_output/directx/*: added an always-on-top object variable and modified to take into account the fullscreen object variable.
* vlcproc.cpp: VlcProc class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: vlcproc.cpp,v 1.23 2003/05/20 23:17:59 gbazin Exp $
+ * $Id: vlcproc.cpp,v 1.24 2003/05/21 13:27:25 gbazin Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
if( play )
{
// Append and play
- for( size_t i = 0; i < p_open_dialog->mrl.GetCount(); i++ )
+ for( size_t i = 0; i < p_intf->p_sys->OpenDlg->mrl.GetCount(); i++ )
{
playlist_Add( p_playlist,
(const char *)p_intf->p_sys->OpenDlg->mrl[i].mb_str(),
else
{
// Append only
- for( size_t i = 0; i < p_open_dialog->mrl.GetCount(); i++ )
+ for( size_t i = 0; i < p_intf->p_sys->OpenDlg->mrl.GetCount(); i++ )
{
playlist_Add( p_playlist,
(const char *)p_intf->p_sys->OpenDlg->mrl[i].mb_str(),
* menus.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: menus.cpp,v 1.11 2003/05/17 22:48:09 gbazin Exp $
+ * $Id: menus.cpp,v 1.12 2003/05/21 13:27:25 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
const wxPoint& pos )
{
vlc_object_t *p_object;
- char *ppsz_varnames[19];
- int pi_objects[19];
+ char *ppsz_varnames[29];
+ int pi_objects[29];
int i = 0;
/* Initializations */
- memset( pi_objects, 0, 19 * sizeof(int) );
+ memset( pi_objects, 0, 29 * sizeof(int) );
/* Audio menu */
ppsz_varnames[i++] = _("Audio menu");
{
ppsz_varnames[i] = "fullscreen";
pi_objects[i++] = p_object->i_object_id;
+ ppsz_varnames[i] = "directx-on-top";
+ pi_objects[i++] = p_object->i_object_id;
vlc_object_release( p_object );
}
wxMenu *VideoMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
{
vlc_object_t *p_object;
- char *ppsz_varnames[4];
- int pi_objects[4];
+ char *ppsz_varnames[6];
+ int pi_objects[6];
int i = 0;
/* Initializations */
- memset( pi_objects, 0, 4 * sizeof(int) );
+ memset( pi_objects, 0, 6 * sizeof(int) );
p_object = (vlc_object_t *)vlc_object_find( _p_intf, VLC_OBJECT_VOUT,
FIND_ANYWHERE );
{
ppsz_varnames[i] = "fullscreen";
pi_objects[i++] = p_object->i_object_id;
+ ppsz_varnames[i] = "directx-on-top";
+ pi_objects[i++] = p_object->i_object_id;
vlc_object_release( p_object );
}
/* Get the descriptive name of the variable */
var_Change( p_object, psz_var, VLC_VAR_GETTEXT, &text, NULL );
+ var_Get( p_object, psz_var, &val );
+
if( i_type & VLC_VAR_HASCHOICE )
{
menu->Append( MenuDummy_Event,
break;
case VLC_VAR_BOOL:
+ val.b_bool = !val.b_bool;
menuitem = new wxMenuItemExt( menu, ++i_item_id,
wxU(text.psz_string ?
text.psz_string : psz_var),
wxT(""), wxITEM_CHECK, strdup(psz_var),
p_object->i_object_id, val, i_type );
menu->Append( menuitem );
- Check( i_item_id -1, val.b_bool ? FALSE : TRUE );
+ Check( i_item_id, val.b_bool ? FALSE : TRUE );
break;
default:
return;
}
+ if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
if( text.psz_string ) free( text.psz_string );
}
}
/* clean up everything */
- if( i_type == VLC_VAR_STRING ) free( val.psz_string );
+ if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
var_Change( p_object, psz_var, VLC_VAR_FREELIST, &val_list, &text_list );
return menu;
* vout.c: Windows DirectX video output display method
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: directx.c,v 1.19 2003/05/15 22:27:37 massiot Exp $
+ * $Id: directx.c,v 1.20 2003/05/21 13:27:25 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
static int DirectXLockSurface ( vout_thread_t *p_vout, picture_t *p_pic );
static int DirectXUnlockSurface ( vout_thread_t *p_vout, picture_t *p_pic );
+/* Object variables callbacks */
+static int OnTopCallback( vlc_object_t *, char const *,
+ vlc_value_t, vlc_value_t, void * );
+
/*****************************************************************************
* Module descriptor
*****************************************************************************/
static int OpenVideo( vlc_object_t *p_this )
{
vout_thread_t * p_vout = (vout_thread_t *)p_this;
- vlc_value_t val;
+ vlc_value_t val, text;
/* Allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
/* Add a variable to indicate if the window should be on top of others */
var_Create( p_vout, "directx-on-top", VLC_VAR_BOOL );
+ text.psz_string = _("Always on top");
+ var_Change( p_vout, "directx-on-top", VLC_VAR_SETTEXT, &text, NULL );
val.b_bool = config_GetInt( p_vout, "directx-on-top" );
var_Set( p_vout, "directx-on-top", val );
+ p_vout->p_sys->b_on_top_change = val.b_bool;
+ var_AddCallback( p_vout, "directx-on-top", OnTopCallback, NULL );
return VLC_SUCCESS;
static int Manage( vout_thread_t *p_vout )
{
WINDOWPLACEMENT window_placement;
- HWND hwnd;
- HMENU hMenu;
- vlc_value_t val;
/* If we do not control our window, we check for geometry changes
* ourselves because the parent might not send us its events. */
if( p_vout->i_changes & VOUT_FULLSCREEN_CHANGE
|| p_vout->p_sys->i_changes & VOUT_FULLSCREEN_CHANGE )
{
+ vlc_value_t val;
+
p_vout->b_fullscreen = ! p_vout->b_fullscreen;
/* We need to switch between Maximized and Normal sized window */
p_vout->i_changes &= ~VOUT_FULLSCREEN_CHANGE;
p_vout->p_sys->i_changes &= ~VOUT_FULLSCREEN_CHANGE;
+
+ /* Update the object variable without triggering a callback */
+ val.b_bool = p_vout->b_fullscreen;
+ var_Change( p_vout, "fullscreen", VLC_VAR_SETVALUE, &val, NULL );
}
/*
/*
* "Always on top" status change
*/
- hwnd = p_vout->p_sys->hwnd;
- hMenu = GetSystemMenu( hwnd , FALSE );
- var_Get( p_vout, "directx-on-top", &val );
- if( val.b_bool )
+ if( p_vout->p_sys->b_on_top_change )
{
+ vlc_value_t val;
+ HMENU hMenu = GetSystemMenu( p_vout->p_sys->hwnd, FALSE );
+
+ var_Get( p_vout, "directx-on-top", &val );
+
/* Set the window on top if necessary */
- if( !( GetWindowLong( hwnd, GWL_EXSTYLE ) & WS_EX_TOPMOST ) )
+ if( val.b_bool && !( GetWindowLong( p_vout->p_sys->hwnd, GWL_EXSTYLE )
+ & WS_EX_TOPMOST ) )
{
CheckMenuItem( hMenu, IDM_TOGGLE_ON_TOP,
MF_BYCOMMAND | MFS_CHECKED );
- SetWindowPos( hwnd, HWND_TOPMOST, 0, 0, 0, 0,
- SWP_NOSIZE | SWP_NOMOVE );
+ SetWindowPos( p_vout->p_sys->hwnd, HWND_TOPMOST, 0, 0, 0, 0,
+ SWP_NOSIZE | SWP_NOMOVE );
}
- }
- else
- {
+ else
/* The window shouldn't be on top */
- if( GetWindowLong( hwnd, GWL_EXSTYLE ) & WS_EX_TOPMOST )
+ if( !val.b_bool && ( GetWindowLong( p_vout->p_sys->hwnd, GWL_EXSTYLE )
+ & WS_EX_TOPMOST ) )
{
CheckMenuItem( hMenu, IDM_TOGGLE_ON_TOP,
MF_BYCOMMAND | MFS_UNCHECKED );
- SetWindowPos( hwnd, HWND_NOTOPMOST, 0, 0, 0, 0,
+ SetWindowPos( p_vout->p_sys->hwnd, HWND_NOTOPMOST, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE );
}
+
+ p_vout->p_sys->b_on_top_change = VLC_FALSE;
}
/* Check if the event thread is still running */
else
return VLC_EGENERIC;
}
+
+/*****************************************************************************
+ * object variables callbacks: a bunch of object variables are used by the
+ * interfaces to interact with the vout.
+ *****************************************************************************/
+static int OnTopCallback( vlc_object_t *p_this, char const *psz_cmd,
+ vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+ p_vout->p_sys->b_on_top_change = VLC_TRUE;
+ return VLC_SUCCESS;
+}
* vout.h: Windows DirectX video output header file
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vout.h,v 1.4 2003/03/28 17:02:25 gbazin Exp $
+ * $Id: vout.h,v 1.5 2003/05/21 13:27:25 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
volatile vlc_bool_t b_cursor_hidden;
volatile mtime_t i_lastmoved;
+ /* Misc */
+ vlc_bool_t b_on_top_change;
+
event_thread_t * p_event;
};
* thread, and destroy a previously oppened video output thread.
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: video_output.c,v 1.221 2003/05/11 18:40:11 hartman Exp $
+ * $Id: video_output.c,v 1.222 2003/05/21 13:27:25 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
static void MaskToShift ( int *, int *, uint32_t );
static void InitWindowSize ( vout_thread_t *, int *, int * );
+/* Object variables callbacks */
+static int FullscreenCallback( vlc_object_t *, char const *,
+ vlc_value_t, vlc_value_t, void * );
+
/*****************************************************************************
* vout_Request: find a video output thread, create one, or destroy one.
*****************************************************************************
input_thread_t * p_input_thread;
int i_index; /* loop variable */
char * psz_plugin;
- vlc_value_t val;
+ vlc_value_t val, text;
/* Allocate descriptor */
p_vout = vlc_object_create( p_parent, VLC_OBJECT_VOUT );
return NULL;
}
+ /* Create a few object variables for interface interaction */
+ var_Create( p_vout, "fullscreen", VLC_VAR_BOOL );
+ text.psz_string = _("Fullscreen");
+ var_Change( p_vout, "fullscreen", VLC_VAR_SETTEXT, &text, NULL );
+ var_AddCallback( p_vout, "fullscreen", FullscreenCallback, NULL );
+
/* Calculate delay created by internal caching */
p_input_thread = (input_thread_t *)vlc_object_find( p_vout,
VLC_OBJECT_INPUT, FIND_ANYWHERE );
vlc_value_t val;
val.b_bool = VLC_TRUE;
var_Set( p_vout, "intf-change", val );
- return 0;
+ return VLC_SUCCESS;
+}
+
+/*****************************************************************************
+ * object variables callbacks: a bunch of object variables are used by the
+ * interfaces to interact with the vout.
+ *****************************************************************************/
+static int FullscreenCallback( vlc_object_t *p_this, char const *psz_cmd,
+ vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+ vlc_value_t val;
+ p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
+ val.b_bool = VLC_TRUE;
+ var_Set( p_vout, "intf-change", val );
+ return VLC_SUCCESS;
}