/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <vlc/vlc.h>
-#include <vlc/aout.h>
-#include <vlc/vout.h>
-#include <vlc/input.h>
-#include <vlc/intf.h>
+#include "interface.hpp"
+#include "extrapanel.hpp"
+#include "timer.hpp"
+#include "video.hpp"
+#include <vlc_keys.h>
+
+#include "charset.h"
-#include "wxwidgets.h"
+#include <vlc/aout.h>
+#include "charset.h"
/* include the toolbar graphics */
#include "bitmaps/play.xpm"
* (where it is special and put into the "Apple" menu) */
About_Event = wxID_ABOUT,
UpdateVLC_Event,
+ VLM_Event,
Iconize_Event
};
EVT_MENU(Exit_Event, Interface::OnExit)
EVT_MENU(About_Event, Interface::OnAbout)
EVT_MENU(UpdateVLC_Event, Interface::OnShowDialog)
+ EVT_MENU(VLM_Event, Interface::OnShowDialog)
EVT_MENU(Playlist_Event, Interface::OnShowDialog)
EVT_MENU(Logs_Event, Interface::OnShowDialog)
if( ws->GetSettings( WindowSettings::ID_MAIN, b_shown, p, s ) )
Move( p );
+
+ /* Set minimum window size to prevent user from glitching it */
+ wxSize s2;
+ s = GetSize();
+
+ /* save smallest possible default minimum size */
+ default_size = GetSize();
+
+ /* save slider size for height only for MinSizing */
+ slider_size = slider_sizer->GetSize();
+
+ /* and save extended gui size for MinSize scheme */
+ s2 = extra_frame->GetSize();
+ s2.SetWidth( s2.GetWidth() +
+ 2 * wxSystemSettings::GetMetric( wxSYS_FRAMESIZE_X ) );
+ extended_size = s2;
+
+ /* Set initial minimum window size */
+ if( config_GetInt( p_intf, "wx-embed" ) )
+ {
+ s2 = video_window->GetSize();
+ s.SetHeight( s.GetHeight() - s2.GetHeight() );
+ }
+ if( config_GetInt( p_intf, "wx-extended" ) )
+ {
+ s.SetWidth( extended_size.GetWidth() );
+ s.SetHeight( s.GetHeight() + extended_size.GetHeight() );
+ }
+#if (wxCHECK_VERSION(2,5,4))
+ SetMinSize( s );
+#else
+ frame_sizer->SetMinSize( s );
+#endif
+
+ /* Show extended GUI if requested */
+ if( ( b_extra = config_GetInt( p_intf, "wx-extended" ) ) )
+ frame_sizer->Show( extra_frame );
}
Interface::~Interface()
GetPosition(), GetSize() );
}
+ PopEventHandler(true);
+
if( video_window ) delete video_window;
#ifdef wxHAS_TASK_BAR_ICON
view_menu->Append( Logs_Event, wxU(_("&Messages...\tCtrl-M")) );
view_menu->Append( FileInfo_Event,
wxU(_("Stream and Media &info...\tCtrl-I")) );
+ view_menu->Append( VLM_Event,
+ wxU(_("VLM Control...\tCtrl-I")) );
/* Create the "Auto-generated" menus */
p_settings_menu = SettingsMenu( p_intf, this );
#endif
#endif
}
+
+/* Patch by zcot for menu wrapping */
+#if defined(WIN32)
+ /* Find out size of msw menu bar */
+ i_size = 0;
+ SIZE sizing;
+ HDC hdc = GetDC( NULL );
+ for( unsigned int i = 0; i < menubar->GetMenuCount(); i++ )
+ {
+ GetTextExtentPoint32( hdc, menubar->GetLabelTop(i).c_str(),
+ menubar->GetLabelTop(i).Length(), &sizing );
+
+ // [ SM_CXDLGFRAME + pixels + textextent + pixels + SM_CXDLGFRAME ]
+ i_size += sizing.cx + 2 + GetSystemMetrics( SM_CXDLGFRAME ) * 2;
+ }
+ ReleaseDC( NULL, hdc );
+ i_size += GetSystemMetrics( SM_CXSIZEFRAME ) * 2 + 4;
+#endif
+/* End patch by zcot */
+
frame_sizer->SetMinSize( i_size, -1 );
/* Intercept all menu events in our custom event handler */
wxU(_(HELP_PLO)) );
}
+#if !( (wxMAJOR_VERSION <= 2) && (wxMINOR_VERSION <= 6) && (wxRELEASE_NUMBER < 2) )
wxControl *p_dummy_ctrl =
new wxControl( toolbar, -1, wxDefaultPosition,
wxSize(35, 16 ), wxBORDER_NONE );
toolbar->AddControl( p_dummy_ctrl );
+#endif
volctrl = new VLCVolCtrl( p_intf, toolbar );
toolbar->AddControl( volctrl );
//prevent continuous layout
if( slider_frame->IsShown() ) return;
+
+ wxSize ms = GetMinSize();
+ ms.SetHeight( ms.GetHeight() + slider_size.GetHeight() );
+#if ( wxCHECK_VERSION( 2,5,4 ) )
+ SetMinSize( ms );
+#else
+ frame_sizer->SetMinSize( ms );
+#endif
}
else
{
//prevent continuous layout
if( !slider_frame->IsShown() ) return;
+
+ wxSize ms = GetMinSize();
+ ms.SetHeight( ms.GetHeight() - slider_size.GetHeight() );
+#if ( wxCHECK_VERSION( 2,5,4 ) )
+ SetMinSize( ms );
+#else
+ frame_sizer->SetMinSize( ms );
+#endif
}
if( layout && p_intf->p_sys->b_video_autosize )
msg.Printf( wxString(wxT("VLC media player " PACKAGE_VERSION)) +
wxU(_(" (wxWidgets interface)\n\n")) +
wxU(_("(c) 1996-2005 - the VideoLAN Team\n\n")) +
+ wxU(_("Compiled by "))+ wxU(VLC_CompileBy())+ wxU("@") +
+ wxU(VLC_CompileHost())+ wxT(".")+ wxU(VLC_CompileDomain())+ wxT(".\n") +
+ wxU(_("Compiler: "))+ wxU(VLC_Compiler())+wxT( ".\n") +
+ wxU(_("Based on SVN revision: "))+wxU(VLC_Changeset())+wxT(".\n\n") +
#ifdef __WXMSW__
- wxU( vlc_wraptext(INTF_ABOUT_MSG,WRAPCOUNT,VLC_TRUE) ) + wxT("\n\n") +
+ wxU( vlc_wraptext(LICENSE_MSG,WRAPCOUNT,VLC_TRUE) ) + wxT("\n\n") +
#else
- wxU( INTF_ABOUT_MSG ) + wxT("\n\n") +
+ wxU( LICENSE_MSG ) + wxT("\n\n") +
#endif
wxU(_("The VideoLAN team <videolan@videolan.org>\n"
"http://www.videolan.org/\n\n")) );
break;
case OpenAdv_Event:
i_id = INTF_DIALOG_FILE;
+ break;
case OpenFile_Event:
i_id = INTF_DIALOG_FILE;
break;
case UpdateVLC_Event:
i_id = INTF_DIALOG_UPDATEVLC;
break;
+ case VLM_Event:
+ i_id = INTF_DIALOG_VLM;
+ break;
default:
i_id = INTF_DIALOG_FILE;
break;
{
extra_frame->Hide();
frame_sizer->Hide( extra_frame );
+ wxSize ms = GetMinSize();
+ ms.SetHeight( ms.GetHeight() - extended_size.GetHeight() );
+ ms.SetWidth( default_size.GetWidth() );
+#if ( wxCHECK_VERSION( 2,5,4 ) )
+ SetMinSize( ms );
+#else
+ frame_sizer->SetMinSize( ms );
+#endif
}
else
{
extra_frame->Show();
frame_sizer->Show( extra_frame );
- }
- frame_sizer->Layout();
- frame_sizer->Fit(this);
-}
-
-#if 0
- if( b_undock == VLC_TRUE )
- {
- fprintf(stderr,"Deleting window\n");
- if( extra_window )
- {
- delete extra_window;
- extra_window = NULL;
- }
- }
- else
- {
- extra_frame->Hide();
- frame_sizer->Hide( extra_frame );
- frame_sizer->Layout();
- frame_sizer->Fit(this);
- }
- }
- else
- {
- if( b_undock == VLC_TRUE )
- {
- fprintf(stderr,"Creating window\n");
- extra_frame->Hide();
- frame_sizer->Hide( extra_frame );
-#if (wxCHECK_VERSION(2,5,0))
- frame_sizer->Detach( extra_frame );
-#else
- frame_sizer->Remove( extra_frame );
-#endif
- frame_sizer->Layout();
- frame_sizer->Fit(this);
- extra_window = new ExtraWindow( p_intf, this, extra_frame );
- }
- else
- {
- fprintf(stderr,"Deleting window\n");
- if( extra_window )
- {
- delete extra_window;
- }
- extra_frame->Show();
- frame_sizer->Show( extra_frame );
- frame_sizer->Layout();
- frame_sizer->Fit(this);
- }
- }
-}
-
-void Interface::OnUndock(wxCommandEvent& event)
-{
- b_undock = (b_undock == VLC_TRUE ? VLC_FALSE : VLC_TRUE );
-
- if( b_extra == VLC_TRUE )
- {
- if( b_undock == VLC_FALSE )
- {
- fprintf(stderr,"Deleting window\n");
- if( extra_window )
- {
- delete extra_window;
- extra_window = NULL;
- }
- extra_frame->Show();
- frame_sizer->Show( extra_frame );
- frame_sizer->Layout();
- frame_sizer->Fit(this);
- }
- else
- {
- fprintf(stderr,"Creating window\n");
- extra_frame->Hide();
- frame_sizer->Hide( extra_frame );
-#if (wxCHECK_VERSION(2,5,0))
- frame_sizer->Detach( extra_frame );
+ wxSize ms = GetMinSize();
+ ms.SetHeight( ms.GetHeight() + extended_size.GetHeight() );
+ ms.SetWidth( extended_size.GetWidth() );
+#if ( wxCHECK_VERSION( 2,5,4 ) )
+ SetMinSize( ms );
#else
- frame_sizer->Remove( extra_frame );
+ frame_sizer->SetMinSize( ms );
#endif
- frame_sizer->Layout();
- frame_sizer->Fit(this);
- extra_window = new ExtraWindow( p_intf, this, extra_frame );
- }
}
+ frame_sizer->Layout();
+ frame_sizer->Fit(this);
}
-#endif
-
void Interface::OnPlayStream( wxCommandEvent& WXUNUSED(event) )
{
return;
}
- /* FIXME --fenrir */
-#if 0
- if( p_playlist->p_input != NULL )
- {
- vlc_mutex_lock( &p_playlist->p_input->stream.stream_lock );
- if( p_playlist->p_input->stream.p_selected_area->i_id > 1 )
- {
- vlc_value_t val; val.b_bool = VLC_TRUE;
- vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
- var_Set( p_playlist->p_input, "prev-title", val );
- } else
- vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
- }
- vlc_mutex_unlock( &p_playlist->object_lock );
-#endif
-
playlist_Prev( p_playlist );
vlc_object_release( p_playlist );
}
{
return;
}
-
- /* FIXME --fenrir */
-#if 0
- var_Change( p_input, "title", VLC_VAR_CHOICESCOUNT, &val, NULL );
- vlc_mutex_lock( &p_playlist->object_lock );
- if( p_playlist->p_input != NULL )
- {
- vlc_mutex_lock( &p_playlist->p_input->stream.stream_lock );
- if( p_playlist->p_input->stream.i_area_nb > 1 &&
- p_playlist->p_input->stream.p_selected_area->i_id <
- p_playlist->p_input->stream.i_area_nb - 1 )
- {
- vlc_value_t val; val.b_bool = VLC_TRUE;
- vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
- var_Set( p_playlist->p_input, "next-title", val );
- } else
- vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
- }
- vlc_mutex_unlock( &p_playlist->object_lock );
-#endif
playlist_Next( p_playlist );
vlc_object_release( p_playlist );
}
}
for( size_t i = 0; i < filenames.GetCount(); i++ )
- playlist_Add( p_playlist, (const char *)filenames[i].mb_str(),
- (const char *)filenames[i].mb_str(),
+ {
+ char *psz_utf8 = wxFromLocale( filenames[i] );
+
+ playlist_Add( p_playlist, psz_utf8, psz_utf8,
PLAYLIST_APPEND | ((i | b_enqueue) ? 0 : PLAYLIST_GO),
PLAYLIST_END );
+ wxLocaleFree( psz_utf8 );
+ }
vlc_object_release( p_playlist );