Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
8d3e7704
Commit
8d3e7704
authored
Dec 01, 2005
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/gui/wxwidgets: fixes and improvements to the main interface code.
parent
507fe5c1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
35 deletions
+50
-35
modules/gui/wxwidgets/input_manager.cpp
modules/gui/wxwidgets/input_manager.cpp
+13
-5
modules/gui/wxwidgets/input_manager.hpp
modules/gui/wxwidgets/input_manager.hpp
+1
-0
modules/gui/wxwidgets/interface.cpp
modules/gui/wxwidgets/interface.cpp
+22
-22
modules/gui/wxwidgets/video.cpp
modules/gui/wxwidgets/video.cpp
+14
-8
No files found.
modules/gui/wxwidgets/input_manager.cpp
View file @
8d3e7704
...
...
@@ -71,6 +71,7 @@ InputManager::InputManager( intf_thread_t *_p_intf, Interface *_p_main_intf,
i_old_playing_status
=
STATUS_STOP
;
i_old_rate
=
INPUT_RATE_DEFAULT
;
b_slider_free
=
VLC_TRUE
;
i_input_hide_delay
=
0
;
/* Create slider */
slider
=
new
wxSlider
(
this
,
SliderScroll_Event
,
0
,
0
,
SLIDER_MAX_POS
);
...
...
@@ -280,10 +281,15 @@ void InputManager::Update()
{
slider
->
SetValue
(
0
);
}
else
else
if
(
!
i_input_hide_delay
)
{
i_input_hide_delay
=
mdate
()
+
200000
;
}
else
if
(
i_input_hide_delay
<
mdate
()
)
{
if
(
disc_frame
->
IsShown
()
)
HideDiscFrame
();
if
(
slider
->
IsShown
()
)
HideSlider
();
i_input_hide_delay
=
0
;
}
}
else
if
(
p_input
->
b_dead
)
...
...
@@ -292,6 +298,10 @@ void InputManager::Update()
vlc_object_release
(
p_input
);
p_input
=
NULL
;
}
else
{
i_input_hide_delay
=
0
;
}
if
(
p_input
&&
!
p_input
->
b_die
)
{
...
...
@@ -416,8 +426,7 @@ void InputManager::ShowSlider( bool show )
{
if
(
!!
show
==
!!
slider
->
IsShown
()
)
return
;
if
(
p_intf
->
p_sys
->
b_video_autosize
)
UpdateVideoWindow
(
p_intf
,
p_main_intf
->
video_window
);
UpdateVideoWindow
(
p_intf
,
p_main_intf
->
video_window
);
sizer
->
Show
(
slider
,
show
);
sizer
->
Layout
();
...
...
@@ -430,8 +439,7 @@ void InputManager::ShowDiscFrame( bool show )
{
if
(
!!
show
==
!!
disc_frame
->
IsShown
()
)
return
;
if
(
p_intf
->
p_sys
->
b_video_autosize
)
UpdateVideoWindow
(
p_intf
,
p_main_intf
->
video_window
);
UpdateVideoWindow
(
p_intf
,
p_main_intf
->
video_window
);
sizer
->
Show
(
disc_frame
,
show
);
sizer
->
Layout
();
...
...
modules/gui/wxwidgets/input_manager.hpp
View file @
8d3e7704
...
...
@@ -84,6 +84,7 @@ namespace wxvlc
int
i_old_playing_status
;
///< Previous playing status
int
i_old_rate
;
///< Previous playing rate
mtime_t
i_input_hide_delay
;
///< Allows delaying slider hidding
};
};
...
...
modules/gui/wxwidgets/interface.cpp
View file @
8d3e7704
...
...
@@ -222,7 +222,8 @@ Interface::Interface( intf_thread_t *_p_intf, long style ):
/* Create a main panel that will fill in the interface window */
main_sizer
=
new
wxBoxSizer
(
wxVERTICAL
);
SetSizer
(
main_sizer
);
main_panel
=
new
wxPanel
(
this
);
main_panel
=
new
wxPanel
(
this
,
-
1
,
wxDefaultPosition
,
wxDefaultSize
,
wxCLIP_CHILDREN
);
main_sizer
->
Add
(
main_panel
,
1
,
wxEXPAND
);
main_panel
->
SetFocus
();
...
...
@@ -260,6 +261,11 @@ Interface::Interface( intf_thread_t *_p_intf, long style ):
statusbar
->
SetStatusWidths
(
3
,
i_status_width
);
statusbar
->
SetStatusText
(
wxString
::
Format
(
wxT
(
"x%.2f"
),
1.0
),
1
);
/* Get minimum window size to prevent user from glitching it */
panel_sizer
->
Layout
();
panel_sizer
->
Fit
(
main_panel
);
main_sizer
->
Layout
();
main_sizer
->
Fit
(
this
);
main_min_size
=
GetSize
();
/* Video window */
video_window
=
0
;
if
(
config_GetInt
(
p_intf
,
"wx-embed"
)
)
...
...
@@ -273,10 +279,8 @@ Interface::Interface( intf_thread_t *_p_intf, long style ):
panel_sizer
->
Add
(
input_manager
,
0
,
wxEXPAND
,
0
);
/* Layout everything */
panel_sizer
->
Layout
();
panel_sizer
->
Fit
(
main_panel
);
main_sizer
->
Layout
();
main_sizer
->
Fit
(
this
);
panel_sizer
->
Layout
();
panel_sizer
->
Fit
(
main_panel
);
main_sizer
->
Layout
();
main_sizer
->
Fit
(
this
);
#if wxUSE_DRAG_AND_DROP
/* Associate drop targets with the main interface */
...
...
@@ -299,12 +303,6 @@ Interface::Interface( intf_thread_t *_p_intf, long style ):
if
(
ws
->
GetSettings
(
WindowSettings
::
ID_MAIN
,
b_shown
,
p
,
s
)
)
Move
(
p
);
/* Get minimum window size to prevent user from glitching it */
s
=
GetSize
();
if
(
video_window
&&
video_window
->
IsShown
()
)
s
.
SetHeight
(
s
.
GetHeight
()
-
video_window
->
GetSize
().
GetHeight
()
);
main_min_size
=
s
;
/* Show extended GUI if requested */
wxCommandEvent
dummy
;
if
(
config_GetInt
(
p_intf
,
"wx-extended"
)
)
OnExtended
(
dummy
);
...
...
@@ -353,11 +351,8 @@ void Interface::OnControlEvent( wxCommandEvent& event )
switch
(
event
.
GetId
()
)
{
case
0
:
if
(
p_intf
->
p_sys
->
b_video_autosize
)
{
main_sizer
->
Layout
();
main_sizer
->
Fit
(
this
);
}
main_sizer
->
Layout
();
main_sizer
->
Fit
(
this
);
break
;
case
1
:
...
...
@@ -659,11 +654,7 @@ void Interface::SetIntfMinSize()
ms
.
SetWidth
(
ext_min_size
.
GetWidth
()
);
}
#if ( wxCHECK_VERSION( 2,5,4 ) )
SetMinSize
(
ms
);
#else
main_sizer
->
SetMinSize
(
ms
);
#endif
SetSizeHints
(
ms
);
}
/*****************************************************************************
...
...
@@ -824,6 +815,8 @@ void Interface::OnShowDialog( wxCommandEvent& event )
void
Interface
::
OnExtended
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
{
UpdateVideoWindow
(
p_intf
,
video_window
);
if
(
!
extra_frame
)
{
/* Create the extra panel */
...
...
@@ -833,7 +826,6 @@ void Interface::OnExtended( wxCommandEvent& WXUNUSED(event) )
}
b_extra
=
!
b_extra
;
panel_sizer
->
Show
(
extra_frame
,
b_extra
);
SetIntfMinSize
();
...
...
@@ -999,6 +991,14 @@ void Interface::TogglePlayButton( int i_playing_status )
}
GetToolBar
()
->
Realize
();
#if defined( __WXMSW__ )
/* Needed to work around a bug in wxToolBar::Realize() */
GetToolBar
()
->
SetSize
(
GetSize
().
GetWidth
(),
GetToolBar
()
->
GetSize
().
GetHeight
()
);
GetToolBar
()
->
Update
();
#endif
GetToolBar
()
->
ToggleTool
(
PlayStream_Event
,
true
);
GetToolBar
()
->
ToggleTool
(
PlayStream_Event
,
false
);
}
...
...
modules/gui/wxwidgets/video.cpp
View file @
8d3e7704
...
...
@@ -70,7 +70,9 @@ wxWindow *CreateVideoWindow( intf_thread_t *p_intf, wxWindow *p_parent )
void
UpdateVideoWindow
(
intf_thread_t
*
p_intf
,
wxWindow
*
p_window
)
{
#if (wxCHECK_VERSION(2,5,0))
#if (wxCHECK_VERSION(2,5,3))
if
(
!
p_intf
->
p_sys
->
b_video_autosize
)
return
;
if
(
p_window
&&
mdate
()
-
((
VideoWindow
*
)
p_window
)
->
i_creation_date
<
2000000
)
return
;
/* Hack to prevent saving coordinates if window is not yet
* properly created. Yuck :( */
...
...
@@ -84,15 +86,16 @@ void UpdateVideoWindow( intf_thread_t *p_intf, wxWindow *p_window )
* Constructor.
*****************************************************************************/
VideoWindow
::
VideoWindow
(
intf_thread_t
*
_p_intf
,
wxWindow
*
_p_parent
)
:
wxWindow
(
_p_parent
,
-
1
)
wxWindow
(
_p_parent
,
-
1
,
wxDefaultPosition
,
wxDefaultSize
,
wxCLIP_CHILDREN
)
{
/* Initializations */
p_intf
=
_p_intf
;
p_parent
=
_p_parent
;
p_child_window
=
0
;
vlc_mutex_init
(
p_intf
,
&
lock
);
b_auto_size
=
config_GetInt
(
p_intf
,
"wx-autosize"
)
;
b_auto_size
=
p_intf
->
p_sys
->
b_video_autosize
;
p_vout
=
NULL
;
i_creation_date
=
0
;
...
...
@@ -118,15 +121,18 @@ VideoWindow::VideoWindow( intf_thread_t *_p_intf, wxWindow *_p_parent ):
SetSize
(
child_size
);
}
p_child_window
=
new
wxWindow
(
this
,
-
1
,
wxDefaultPosition
,
child_size
);
#ifdef __WXGTK__
p_child_window
=
new
wxWindow
(
this
,
-
1
,
wxDefaultPosition
,
child_size
,
wxCLIP_CHILDREN
);
#endif
if
(
!
b_auto_size
)
{
SetBackgroundColour
(
*
wxBLACK
);
p_child_window
->
SetBackgroundColour
(
*
wxBLACK
);
if
(
p_child_window
)
p_child_window
->
SetBackgroundColour
(
*
wxBLACK
);
}
p_child_window
->
Show
();
if
(
p_child_window
)
p_child_window
->
Show
();
Show
();
b_shown
=
VLC_TRUE
;
...
...
@@ -333,8 +339,8 @@ int VideoWindow::ControlWindow( void *p_window, int i_query, va_list args )
unsigned
int
*
pi_width
=
va_arg
(
args
,
unsigned
int
*
);
unsigned
int
*
pi_height
=
va_arg
(
args
,
unsigned
int
*
);
*
pi_width
=
GetSize
().
GetWidth
();
*
pi_height
=
GetSize
().
GetHeight
();
*
pi_width
=
GetSize
().
GetWidth
();
*
pi_height
=
GetSize
().
GetHeight
();
i_ret
=
VLC_SUCCESS
;
}
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment