mirror of
https://github.com/mpv-player/mpv
synced 2025-03-09 15:47:44 +00:00
Initial win32 gui release.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18918 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
71045b33a3
commit
c5cf04f543
17
Gui/Makefile
17
Gui/Makefile
@ -9,6 +9,16 @@ OPTIMIZE = $(OPTFLAGS)
|
||||
|
||||
CFLAGS = $(OPTIMIZE) $(INCDIR) $(DEBUG)
|
||||
|
||||
ifeq ($(TARGET_WIN32),yes)
|
||||
SRCS = win32/dialogs.c \
|
||||
win32/gui.c \
|
||||
win32/interface.c \
|
||||
win32/playlist.c \
|
||||
win32/preferences.c \
|
||||
win32/skinload.c \
|
||||
win32/widgetrender.c \
|
||||
win32/wincfg.c
|
||||
else
|
||||
SRCS = wm/ws.c \
|
||||
wm/wsxdnd.c \
|
||||
app.c \
|
||||
@ -34,8 +44,8 @@ SRCS = wm/ws.c \
|
||||
mplayer/gtk/opts.c \
|
||||
mplayer/gtk/url.c \
|
||||
mplayer/gtk/eq.c \
|
||||
mplayer/gtk/common.c \
|
||||
|
||||
mplayer/gtk/common.c
|
||||
endif
|
||||
OBJS = $(SRCS:.c=.o)
|
||||
|
||||
.SUFFIXES: .c .o
|
||||
@ -57,7 +67,8 @@ clean:
|
||||
mplayer/*.o mplayer/*~ \
|
||||
mplayer/gtk/*.o mplayer/gtk/*~ \
|
||||
skin/*.o skin/*~ \
|
||||
wm/*.o wm/*~
|
||||
wm/*.o wm/*~ \
|
||||
win32/*.o
|
||||
|
||||
#dep: depend
|
||||
#
|
||||
|
8
configure
vendored
8
configure
vendored
@ -6942,6 +6942,7 @@ if test "$_gui" = yes ; then
|
||||
|
||||
# Required libraries
|
||||
test "$_png" != yes && die "PNG support required for GUI compilation, please install libpng and libpng-dev packages."
|
||||
if not win32 ; then
|
||||
test "$_x11" != yes && die "X11 support required for GUI compilation"
|
||||
|
||||
echocheck "XShape extension"
|
||||
@ -7046,6 +7047,13 @@ if test "$_gtk1" = yes ; then
|
||||
_ld_gui='$(GTKLIB) $(GLIBLIB)'
|
||||
fi
|
||||
|
||||
else
|
||||
_ld_win32libs="-lcomdlg32 -lcomctl32 -lshell32 -lkernel32 $_ld_win32libs"
|
||||
_def_gui='#define HAVE_NEW_GUI 1'
|
||||
_def_gtk2_gui='#undef HAVE_GTK2_GUI'
|
||||
_ld_gui='$(GTKLIB) $(GLIBLIB)'
|
||||
fi
|
||||
|
||||
echo "Creating Gui/config.mak"
|
||||
cat > Gui/config.mak << EOF
|
||||
# -------- Generated by configure -----------
|
||||
|
@ -35,6 +35,10 @@
|
||||
#include "aspect.h"
|
||||
#include "geometry.h"
|
||||
|
||||
#ifdef HAVE_NEW_GUI
|
||||
#include "Gui/interface.h"
|
||||
#endif
|
||||
|
||||
#ifndef WM_XBUTTONDOWN
|
||||
# define WM_XBUTTONDOWN 0x020B
|
||||
# define WM_XBUTTONUP 0x020C
|
||||
@ -1311,6 +1315,13 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
|
||||
vo_dx = 0;
|
||||
vo_dy = 0;
|
||||
|
||||
#ifdef HAVE_NEW_GUI
|
||||
if(use_gui && WinID != -1){
|
||||
vo_dwidth = d_image_width;
|
||||
vo_dheight = d_image_height;
|
||||
guiGetEvent(guiSetShVideo, 0);
|
||||
}
|
||||
#endif
|
||||
/*release all directx objects*/
|
||||
if (g_cc != NULL)g_cc->lpVtbl->Release(g_cc);
|
||||
g_cc=NULL;
|
||||
|
23
mplayer.c
23
mplayer.c
@ -2538,10 +2538,16 @@ int gui_no_filename=0;
|
||||
tv_param_immediate = 1;
|
||||
#endif
|
||||
|
||||
#if defined(WIN32) && defined(HAVE_NEW_GUI)
|
||||
char *cmdline = GetCommandLine();
|
||||
if(!strstr(cmdline, "-slave"))
|
||||
use_gui=1;
|
||||
#else
|
||||
if ( argv[0] )
|
||||
if(!strcmp(argv[0],"gmplayer") ||
|
||||
(strrchr(argv[0],'/') && !strcmp(strrchr(argv[0],'/'),"/gmplayer") ) )
|
||||
use_gui=1;
|
||||
#endif
|
||||
|
||||
mconfig = m_config_new();
|
||||
m_config_register_options(mconfig,mplayer_opts);
|
||||
@ -2570,6 +2576,21 @@ int gui_no_filename=0;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(WIN32) && defined(HAVE_NEW_GUI)
|
||||
void *runningmplayer = FindWindow("MPlayer GUI for Windows", "MPlayer for Windows");
|
||||
if(runningmplayer && filename && use_gui){
|
||||
COPYDATASTRUCT csData;
|
||||
char file[MAX_PATH];
|
||||
char *filepart = filename;
|
||||
if(GetFullPathName(filename, MAX_PATH, file, &filepart)){
|
||||
csData.dwData = 0;
|
||||
csData.cbData = strlen(file)*2;
|
||||
csData.lpData = file;
|
||||
SendMessage(runningmplayer, WM_COPYDATA, (WPARAM)runningmplayer, (LPARAM)&csData);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
if(proc_priority){
|
||||
int i;
|
||||
@ -2598,12 +2619,14 @@ int gui_no_filename=0;
|
||||
play_tree_iter_free(playtree_iter);
|
||||
playtree_iter=NULL;
|
||||
|
||||
#ifndef WIN32 //Allow playing movies from network drives. eg. \\Desktop\c\somemovie.avi
|
||||
if (getcwd(cwd, PATH_MAX) != (char *)NULL)
|
||||
{
|
||||
strcat(cwd, "/");
|
||||
// Prefix relative paths with current working directory
|
||||
play_tree_add_bpf(playtree, cwd);
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
// Import initital playtree into GUI.
|
||||
import_initial_playtree_into_gui(playtree, mconfig, enqueue);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user