Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
8229bf31
Commit
8229bf31
authored
Apr 28, 2003
by
Olivier Teulière
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/gui/skins/win32/win32_run.cpp: clean exit of wxWindows thread
parent
772985d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
5 deletions
+67
-5
modules/gui/skins/src/skin_common.h
modules/gui/skins/src/skin_common.h
+9
-1
modules/gui/skins/win32/win32_run.cpp
modules/gui/skins/win32/win32_run.cpp
+58
-4
No files found.
modules/gui/skins/src/skin_common.h
View file @
8229bf31
...
...
@@ -2,7 +2,7 @@
* skin_common.h: Private Skin interface description
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: skin_common.h,v 1.
6 2003/04/28 14:12:33 asmax
Exp $
* $Id: skin_common.h,v 1.
7 2003/04/28 22:44:26 ipkiss
Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
...
...
@@ -38,6 +38,9 @@ class Messages;
class
SoutDialog
;
class
PrefsDialog
;
class
FileInfo
;
#ifdef WIN32
class
ExitTimer
;
#endif
#ifdef X11_SKINS
#include <X11/Xlib.h>
...
...
@@ -86,6 +89,11 @@ struct intf_sys_t
Display
*
display
;
#endif
#ifdef WIN32
bool
b_wx_die
;
ExitTimer
*
p_kludgy_timer
;
#endif
};
#endif
...
...
modules/gui/skins/win32/win32_run.cpp
View file @
8229bf31
...
...
@@ -2,7 +2,7 @@
* win32_run.cpp:
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: win32_run.cpp,v 1.1
0 2003/04/28 00:18:27
ipkiss Exp $
* $Id: win32_run.cpp,v 1.1
1 2003/04/28 22:44:26
ipkiss Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
...
...
@@ -65,12 +65,24 @@ public:
Instance
(
intf_thread_t
*
_p_intf
);
bool
OnInit
();
int
OnExit
();
OpenDialog
*
open
;
private:
intf_thread_t
*
p_intf
;
};
class
ExitTimer
:
public
wxTimer
{
public:
ExitTimer
(
intf_thread_t
*
_p_intf
);
void
Notify
();
private:
intf_thread_t
*
p_intf
;
};
//---------------------------------------------------------------------------
// Implementation of Instance class
...
...
@@ -90,12 +102,20 @@ IMPLEMENT_APP_NO_MAIN(Instance)
bool
Instance
::
OnInit
()
{
p_intf
->
p_sys
->
p_icon
=
new
wxIcon
(
vlc_xpm
);
// Create all the dialog boxes
p_intf
->
p_sys
->
OpenDlg
=
new
OpenDialog
(
p_intf
,
NULL
,
FILE_ACCESS
);
p_intf
->
p_sys
->
MessagesDlg
=
new
Messages
(
p_intf
,
NULL
);
p_intf
->
p_sys
->
SoutDlg
=
new
SoutDialog
(
p_intf
,
NULL
);
p_intf
->
p_sys
->
PrefsDlg
=
new
PrefsDialog
(
p_intf
,
NULL
);
p_intf
->
p_sys
->
InfoDlg
=
new
FileInfo
(
p_intf
,
NULL
);
// Start a timer checking if we must exit the main loop
p_intf
->
p_sys
->
b_wx_die
=
0
;
p_intf
->
p_sys
->
p_kludgy_timer
=
new
ExitTimer
(
p_intf
);
p_intf
->
p_sys
->
p_kludgy_timer
->
Start
(
100
);
// OK, initialization is over, now the other thread can go on working...
vlc_mutex_lock
(
&
p_intf
->
p_sys
->
init_lock
);
vlc_cond_signal
(
&
p_intf
->
p_sys
->
init_cond
);
vlc_mutex_unlock
(
&
p_intf
->
p_sys
->
init_lock
);
...
...
@@ -103,6 +123,37 @@ bool Instance::OnInit()
return
TRUE
;
}
int
Instance
::
OnExit
()
{
// Delete evertything
delete
p_intf
->
p_sys
->
p_kludgy_timer
;
delete
p_intf
->
p_sys
->
InfoDlg
;
delete
p_intf
->
p_sys
->
PrefsDlg
;
delete
p_intf
->
p_sys
->
SoutDlg
;
delete
p_intf
->
p_sys
->
MessagesDlg
;
delete
p_intf
->
p_sys
->
OpenDlg
;
delete
p_intf
->
p_sys
->
p_icon
;
return
0
;
}
//---------------------------------------------------------------------------
// Implementation of ExitTimer class
// This timer is only there to call wxApp::ExitMainLoop() from the wxWindows
// thread (otherwise we never exit from the wxEntry call).
//---------------------------------------------------------------------------
ExitTimer
::
ExitTimer
(
intf_thread_t
*
_p_intf
)
:
wxTimer
()
{
p_intf
=
_p_intf
;
}
void
ExitTimer
::
Notify
()
{
if
(
p_intf
->
p_sys
->
b_wx_die
)
wxTheApp
->
ExitMainLoop
();
}
//---------------------------------------------------------------------------
#if !defined(__BUILTIN__) && defined( WIN32 )
...
...
@@ -171,9 +222,9 @@ void OSRun( intf_thread_t *p_intf )
// Don't even enter the main loop
return
;
}
//
vlc_mutex_lock( &p_intf->p_sys->init_lock );
//
vlc_cond_wait( &p_intf->p_sys->init_cond, &p_intf->p_sys->init_lock );
//
vlc_mutex_unlock( &p_intf->p_sys->init_lock );
vlc_mutex_lock
(
&
p_intf
->
p_sys
->
init_lock
);
vlc_cond_wait
(
&
p_intf
->
p_sys
->
init_cond
,
&
p_intf
->
p_sys
->
init_lock
);
vlc_mutex_unlock
(
&
p_intf
->
p_sys
->
init_lock
);
// Create refresh timer
SetTimer
(
((
OSTheme
*
)
p_intf
->
p_sys
->
p_theme
)
->
GetParentWindow
(),
42
,
200
,
...
...
@@ -287,6 +338,9 @@ void OSRun( intf_thread_t *p_intf )
// Check if vlc is closing
Proc
->
IsClosing
();
}
// Tell wxWindows it's time to exit
p_intf
->
p_sys
->
b_wx_die
=
1
;
}
//---------------------------------------------------------------------------
bool
IsVLCEvent
(
unsigned
int
msg
)
...
...
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