Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
9b341915
Commit
9b341915
authored
Nov 12, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Merged trunk changesets 9290 and 9291 to 0.8.1 branch.
parent
e5895bd4
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
279 deletions
+35
-279
evc/vlc.c
evc/vlc.c
+0
-255
src/extras/libc.c
src/extras/libc.c
+4
-4
src/vlc.c
src/vlc.c
+31
-3
toolbox
toolbox
+0
-17
No files found.
evc/vlc.c
deleted
100644 → 0
View file @
e5895bd4
/*****************************************************************************
* vlc.c: the vlc player, WinCE version
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id$
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#include "config.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <commctrl.h>
#include "../share/resource.h"
#include <vlc/vlc.h>
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
static
LRESULT
CALLBACK
About
(
HWND
hDlg
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
);
static
long
FAR
PASCAL
WndProc
(
HWND
hWnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
);
/*****************************************************************************
* Global variables.
*****************************************************************************/
HINSTANCE
hInst
;
HWND
hwndCB
;
/*****************************************************************************
* main: parse command line, start interface and spawn threads
*****************************************************************************/
int
WINAPI
WinMain
(
HINSTANCE
hInstance
,
HINSTANCE
hPrevInstance
,
LPTSTR
lpCmdLine
,
int
nCmdShow
)
{
int
i_ret
;
int
i_argc
=
4
;
char
*
ppsz_argv
[]
=
{
lpCmdLine
,
"-vv"
,
"--intf"
,
"dummy"
,
NULL
,
NULL
};
HWND
window
;
MSG
message
;
HACCEL
hAccelTable
;
WNDCLASS
wc
;
char
psz_title
[
100
];
wchar_t
pwz_title
[
100
];
i_argc
=
5
;
ppsz_argv
[
4
]
=
"test.wav"
;
/* Store our instance for future reference */
hInst
=
hInstance
;
/* Register window class */
memset
(
&
wc
,
0
,
sizeof
(
wc
)
);
wc
.
style
=
CS_HREDRAW
|
CS_VREDRAW
;
wc
.
lpfnWndProc
=
(
WNDPROC
)
WndProc
;
wc
.
cbClsExtra
=
0
;
wc
.
cbWndExtra
=
0
;
wc
.
hInstance
=
hInst
;
wc
.
hIcon
=
0
;
wc
.
hCursor
=
0
;
wc
.
hbrBackground
=
(
HBRUSH
)
GetStockObject
(
WHITE_BRUSH
);
wc
.
lpszMenuName
=
0
;
wc
.
lpszClassName
=
L"VLC"
;
RegisterClass
(
&
wc
);
/* Print the version information */
sprintf
(
psz_title
,
"VLC media player %s"
,
VLC_Version
()
);
MultiByteToWideChar
(
CP_ACP
,
0
,
psz_title
,
-
1
,
pwz_title
,
100
);
/* Create our nice window */
window
=
CreateWindow
(
L"VLC"
,
pwz_title
,
WS_VISIBLE
/*| WS_SIZEBOX | WS_CAPTION*/
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
//CW_USEDEFAULT, CW_USEDEFAULT,
200
,
200
,
NULL
,
NULL
,
hInst
,
NULL
);
ShowWindow
(
window
,
nCmdShow
);
UpdateWindow
(
window
);
hAccelTable
=
LoadAccelerators
(
hInst
,
(
LPCTSTR
)
IDC_NIOUP
);
/* Create a libvlc structure */
i_ret
=
VLC_Create
();
if
(
i_ret
<
0
)
{
DestroyWindow
(
window
);
return
i_ret
;
}
/* Initialize libvlc */
i_ret
=
VLC_Init
(
0
,
i_argc
,
ppsz_argv
);
if
(
i_ret
<
0
)
{
VLC_Destroy
(
0
);
DestroyWindow
(
window
);
return
i_ret
;
}
/* Run libvlc, in non-blocking mode */
i_ret
=
VLC_Play
(
0
);
/* Add a non-blocking interface and keep the return value */
i_ret
=
VLC_AddIntf
(
0
,
NULL
,
VLC_FALSE
,
VLC_TRUE
);
while
(
GetMessage
(
&
message
,
NULL
,
0
,
0
)
)
{
if
(
!
TranslateAccelerator
(
message
.
hwnd
,
hAccelTable
,
&
message
)
)
{
TranslateMessage
(
&
message
);
DispatchMessage
(
&
message
);
}
}
/* Kill the threads */
VLC_Die
(
0
);
/* Finish the threads */
VLC_CleanUp
(
0
);
/* Destroy the libvlc structure */
VLC_Destroy
(
0
);
DestroyWindow
(
window
);
return
i_ret
;
}
/*****************************************************************************
* Message handler for the About box.
*****************************************************************************/
static
LRESULT
CALLBACK
About
(
HWND
hDlg
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
RECT
rt
,
rt1
;
int
DlgWidth
,
DlgHeight
;
// dialog width and height in pixel units
int
NewPosX
,
NewPosY
;
switch
(
message
)
{
case
WM_INITDIALOG
:
/* trying to center the About dialog */
if
(
GetWindowRect
(
hDlg
,
&
rt1
)
)
{
GetClientRect
(
GetParent
(
hDlg
),
&
rt
);
DlgWidth
=
rt1
.
right
-
rt1
.
left
;
DlgHeight
=
rt1
.
bottom
-
rt1
.
top
;
NewPosX
=
(
rt
.
right
-
rt
.
left
-
DlgWidth
)
/
2
;
NewPosY
=
(
rt
.
bottom
-
rt
.
top
-
DlgHeight
)
/
2
;
/* if the About box is larger than the physical screen */
if
(
NewPosX
<
0
)
NewPosX
=
0
;
if
(
NewPosY
<
0
)
NewPosY
=
0
;
SetWindowPos
(
hDlg
,
0
,
NewPosX
,
NewPosY
,
0
,
0
,
SWP_NOZORDER
|
SWP_NOSIZE
);
}
return
TRUE
;
case
WM_COMMAND
:
if
((
LOWORD
(
wParam
)
==
IDOK
)
||
(
LOWORD
(
wParam
)
==
IDCANCEL
))
{
EndDialog
(
hDlg
,
LOWORD
(
wParam
));
return
TRUE
;
}
break
;
}
return
FALSE
;
}
/*****************************************************************************
* Message handler for the main window
*****************************************************************************/
static
long
FAR
PASCAL
WndProc
(
HWND
hWnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
HDC
hdc
;
int
wmId
,
wmEvent
;
int
x
,
y
;
PAINTSTRUCT
ps
;
switch
(
message
)
{
case
WM_LBUTTONDOWN
:
x
=
LOWORD
(
lParam
);
y
=
HIWORD
(
lParam
);
hdc
=
GetDC
(
hWnd
);
Rectangle
(
hdc
,
x
-
4
,
y
-
4
,
x
+
4
,
y
+
4
);
ReleaseDC
(
hWnd
,
hdc
);
break
;
case
WM_COMMAND
:
wmId
=
LOWORD
(
wParam
);
wmEvent
=
HIWORD
(
wParam
);
// Parse the menu selections:
switch
(
wmId
)
{
case
IDM_HELP_ABOUT
:
DialogBox
(
hInst
,
(
LPCTSTR
)
IDD_ABOUTBOX
,
hWnd
,
(
DLGPROC
)
About
);
break
;
case
IDM_PLOP
:
/* Do random stuff */
break
;
case
IDM_FILE_EXIT
:
DestroyWindow
(
hWnd
);
break
;
default:
return
DefWindowProc
(
hWnd
,
message
,
wParam
,
lParam
);
}
break
;
case
WM_CREATE
:
hwndCB
=
CommandBar_Create
(
hInst
,
hWnd
,
1
);
CommandBar_InsertMenubar
(
hwndCB
,
hInst
,
IDM_MENU
,
0
);
//CommandBar_AddAdornments(hwndCB, 0, 0);
break
;
case
WM_PAINT
:
{
RECT
rt
;
hdc
=
BeginPaint
(
hWnd
,
&
ps
);
GetClientRect
(
hWnd
,
&
rt
);
DrawText
(
hdc
,
L"VLC roulaize!"
,
_tcslen
(
L"VLC roulaize!"
),
&
rt
,
DT_SINGLELINE
|
DT_VCENTER
|
DT_CENTER
);
EndPaint
(
hWnd
,
&
ps
);
break
;
}
case
WM_DESTROY
:
CommandBar_Destroy
(
hwndCB
);
PostQuitMessage
(
0
);
break
;
default:
return
DefWindowProc
(
hWnd
,
message
,
wParam
,
lParam
);
}
return
0
;
}
src/extras/libc.c
View file @
9b341915
...
@@ -621,12 +621,12 @@ char **vlc_parse_cmdline( const char *psz_cmdline, int *i_args )
...
@@ -621,12 +621,12 @@ char **vlc_parse_cmdline( const char *psz_cmdline, int *i_args )
{
{
int
argc
=
0
;
int
argc
=
0
;
char
**
argv
=
0
;
char
**
argv
=
0
;
char
*
s
,
*
psz_parser
,
*
psz_arg
;
char
*
s
,
*
psz_parser
,
*
psz_arg
,
*
psz_orig
;
int
i_bcount
=
0
;
int
i_bcount
=
0
;
if
(
!
psz_cmdline
)
return
0
;
if
(
!
psz_cmdline
)
return
0
;
psz_
cmdline
=
strdup
(
psz_cmdline
);
psz_
orig
=
strdup
(
psz_cmdline
);
psz_arg
=
psz_parser
=
s
=
psz_
cmdline
;
psz_arg
=
psz_parser
=
s
=
psz_
orig
;
while
(
*
s
)
while
(
*
s
)
{
{
...
@@ -686,6 +686,6 @@ char **vlc_parse_cmdline( const char *psz_cmdline, int *i_args )
...
@@ -686,6 +686,6 @@ char **vlc_parse_cmdline( const char *psz_cmdline, int *i_args )
}
}
if
(
i_args
)
*
i_args
=
argc
;
if
(
i_args
)
*
i_args
=
argc
;
free
(
psz_
cmdline
);
free
(
psz_
orig
);
return
argv
;
return
argv
;
}
}
src/vlc.c
View file @
9b341915
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
/*****************************************************************************
/*****************************************************************************
* Local prototypes.
* Local prototypes.
*****************************************************************************/
*****************************************************************************/
#if
ndef WIN32
#if
!defined(WIN32) && !defined(UNDER_CE)
static
void
SigHandler
(
int
i_signal
);
static
void
SigHandler
(
int
i_signal
);
#endif
#endif
...
@@ -80,7 +80,7 @@ int main( int i_argc, char *ppsz_argv[] )
...
@@ -80,7 +80,7 @@ int main( int i_argc, char *ppsz_argv[] )
return
i_ret
;
return
i_ret
;
}
}
#if
ndef WIN32
#if
!defined(WIN32) && !defined(UNDER_CE)
/* Set the signal handlers. SIGTERM is not intercepted, because we need at
/* Set the signal handlers. SIGTERM is not intercepted, because we need at
* least one method to kill the program when all other methods failed, and
* least one method to kill the program when all other methods failed, and
* when we don't want to use SIGKILL.
* when we don't want to use SIGKILL.
...
@@ -113,7 +113,7 @@ int main( int i_argc, char *ppsz_argv[] )
...
@@ -113,7 +113,7 @@ int main( int i_argc, char *ppsz_argv[] )
return
i_ret
;
return
i_ret
;
}
}
#if
ndef WIN32
#if
!defined(WIN32) && !defined(UNDER_CE)
/*****************************************************************************
/*****************************************************************************
* SigHandler: system signal handler
* SigHandler: system signal handler
*****************************************************************************
*****************************************************************************
...
@@ -155,3 +155,31 @@ static void SigHandler( int i_signal )
...
@@ -155,3 +155,31 @@ static void SigHandler( int i_signal )
}
}
}
}
#endif
#endif
#if defined(UNDER_CE)
#include "vlc_common.h"
/*****************************************************************************
* WinMain: parse command line, start interface and spawn threads. (WinCE only)
*****************************************************************************/
int
WINAPI
WinMain
(
HINSTANCE
hInstance
,
HINSTANCE
hPrevInstance
,
LPTSTR
lpCmdLine
,
int
nCmdShow
)
{
char
**
argv
,
psz_cmdline
[
MAX_PATH
];
int
argc
,
i_ret
;
WideCharToMultiByte
(
CP_ACP
,
0
,
lpCmdLine
,
-
1
,
psz_cmdline
,
MAX_PATH
,
NULL
,
NULL
);
argv
=
vlc_parse_cmdline
(
psz_cmdline
,
&
argc
);
argv
=
realloc
(
argv
,
(
argc
+
1
)
*
sizeof
(
char
*
)
);
if
(
!
argv
)
return
-
1
;
if
(
argc
)
memmove
(
argv
+
1
,
argv
,
argc
*
sizeof
(
char
*
)
);
argv
[
0
]
=
""
;
/* Fake program path */
i_ret
=
main
(
argc
+
1
,
argv
);
/* No need to free the argv memory */
return
i_ret
;
}
#endif
toolbox
View file @
9b341915
...
@@ -338,20 +338,11 @@ EOF
...
@@ -338,20 +338,11 @@ EOF
# Top of the project file
# Top of the project file
perl
-pe
'if(/SOURCES/){last;}'
<
${
target
}
.in
>
${
target
}
perl
-pe
'if(/SOURCES/){last;}'
<
${
target
}
.in
>
${
target
}
# The source files
# The source files
if
test
"
${
target
}
"
=
"evc/vlc.vcp"
then
cat
>>
${
target
}
<<
EOF
# Begin Source File
${
M
}
SOURCE="..
\\
evc
\\
vlc.c"
${
M
}
# End Source File
${
M
}
EOF
else
cat
>>
${
target
}
<<
EOF
cat
>>
${
target
}
<<
EOF
# Begin Source File
${
M
}
# Begin Source File
${
M
}
SOURCE="..
\\
src
\\
vlc.c"
${
M
}
SOURCE="..
\\
src
\\
vlc.c"
${
M
}
# End Source File
${
M
}
# End Source File
${
M
}
EOF
EOF
fi
# Bottom of the project file - handles resource files too
# Bottom of the project file - handles resource files too
perl
-e
'while(<>){if(/SOURCES/){last;}}while(<>){print $_}'
<
${
target
}
.in
>>
${
target
}
perl
-e
'while(<>){if(/SOURCES/){last;}}while(<>){print $_}'
<
${
target
}
.in
>>
${
target
}
done
done
...
@@ -365,14 +356,6 @@ fi
...
@@ -365,14 +356,6 @@ fi
##
##
if
test
"
${
action
}
"
=
"po"
if
test
"
${
action
}
"
=
"po"
then
then
# create a fake file containing win32 strings
rm
-f
modules/gui/win32/strings.cpp
#printf "/* Automatically generated by 'toolbox --update-po', please don't compile */\n" > modules/gui/win32/strings.cpp
#find modules/gui/win32 -name '*.dfm' | while read file
#do
# printf "\n/*\n * from $file:\n */\n\n" >> modules/gui/win32/strings.cpp
# perl -ne 'chop; chop; if( / (Caption|Text|Hint) / || $buffer =~ /[+=] *$/ ) { $buffer =~ s/\+ *$//; $buffer .= $_; } if( $buffer =~ /'"'"' *$/) { $buffer =~ s/'"'"'/"/g; $buffer =~ s/\\/\\\\/g; $buffer =~ s/=/= _(/; print $buffer." );\n"; $buffer = "";}' < $file | grep -v '"-*"' | grep -v '"http://' | grep -v '"vlcs"' >> modules/gui/win32/strings.cpp || exit 1
#done
# find out the source files
# find out the source files
rm
-f
po/POTFILES.in
rm
-f
po/POTFILES.in
echo
"# automatically created by toolbox --update-po"
>
po/POTFILES.in
echo
"# automatically created by toolbox --update-po"
>
po/POTFILES.in
...
...
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