mirror of
https://github.com/mpv-player/mpv
synced 2025-01-19 05:41:16 +00:00
ISO C90 warnings fixes
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19724 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
5a420940ad
commit
9ff3217bb0
@ -374,11 +374,12 @@ LRESULT CALLBACK SubUrlWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lPara
|
|||||||
|
|
||||||
void display_openurlwindow(gui_t *gui, int add)
|
void display_openurlwindow(gui_t *gui, int add)
|
||||||
{
|
{
|
||||||
if(add) addurl = 1;
|
|
||||||
HWND hWnd;
|
HWND hWnd;
|
||||||
HINSTANCE hInstance = GetModuleHandle(NULL);
|
HINSTANCE hInstance = GetModuleHandle(NULL);
|
||||||
WNDCLASS wc;
|
WNDCLASS wc;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
|
if(add) addurl = 1;
|
||||||
if(FindWindow(NULL, "MPlayer - Open URL...")) return;
|
if(FindWindow(NULL, "MPlayer - Open URL...")) return;
|
||||||
wc.style = CS_HREDRAW | CS_VREDRAW;
|
wc.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
wc.lpfnWndProc = OpenUrlWndProc;
|
wc.lpfnWndProc = OpenUrlWndProc;
|
||||||
@ -632,16 +633,16 @@ void update_playlistwindow(void)
|
|||||||
void display_playlistwindow(gui_t *gui)
|
void display_playlistwindow(gui_t *gui)
|
||||||
{
|
{
|
||||||
HWND hWnd = FindWindow(NULL, "MPlayer Playlist");
|
HWND hWnd = FindWindow(NULL, "MPlayer Playlist");
|
||||||
|
HINSTANCE hInstance = GetModuleHandle(NULL);
|
||||||
|
WNDCLASS wc;
|
||||||
|
int x, y;
|
||||||
|
|
||||||
if (hWnd)
|
if (hWnd)
|
||||||
{
|
{
|
||||||
SendMessage(hWnd, WM_CLOSE, 0, 0);
|
SendMessage(hWnd, WM_CLOSE, 0, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
HINSTANCE hInstance = GetModuleHandle(NULL);
|
|
||||||
WNDCLASS wc;
|
|
||||||
int x, y;
|
|
||||||
|
|
||||||
wc.style = CS_HREDRAW | CS_VREDRAW;
|
wc.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
wc.lpfnWndProc = PlayListWndProc;
|
wc.lpfnWndProc = PlayListWndProc;
|
||||||
wc.cbClsExtra = 0;
|
wc.cbClsExtra = 0;
|
||||||
@ -683,6 +684,9 @@ static LRESULT CALLBACK SkinBrowserWndProc(HWND hwnd, UINT iMsg, WPARAM wParam,
|
|||||||
{
|
{
|
||||||
case WM_CREATE:
|
case WM_CREATE:
|
||||||
{
|
{
|
||||||
|
HANDLE skinHandle = INVALID_HANDLE_VALUE;
|
||||||
|
WIN32_FIND_DATA finddata;
|
||||||
|
|
||||||
listbox = CreateWindow("listbox", NULL,
|
listbox = CreateWindow("listbox", NULL,
|
||||||
WS_CHILD | WS_VISIBLE | LBS_NOTIFY | LBS_NOINTEGRALHEIGHT |
|
WS_CHILD | WS_VISIBLE | LBS_NOTIFY | LBS_NOINTEGRALHEIGHT |
|
||||||
LBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP,
|
LBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP,
|
||||||
@ -695,9 +699,6 @@ static LRESULT CALLBACK SkinBrowserWndProc(HWND hwnd, UINT iMsg, WPARAM wParam,
|
|||||||
/* This opens the skins directory, lists the directory names, and adds them to the listbox */
|
/* This opens the skins directory, lists the directory names, and adds them to the listbox */
|
||||||
sprintf(skinspath, "%s/*.", get_path("skins"));
|
sprintf(skinspath, "%s/*.", get_path("skins"));
|
||||||
|
|
||||||
HANDLE skinHandle = INVALID_HANDLE_VALUE;
|
|
||||||
WIN32_FIND_DATA finddata;
|
|
||||||
|
|
||||||
skinHandle = FindFirstFile(skinspath, &finddata);
|
skinHandle = FindFirstFile(skinspath, &finddata);
|
||||||
if (skinHandle != INVALID_HANDLE_VALUE)
|
if (skinHandle != INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
@ -753,16 +754,16 @@ static LRESULT CALLBACK SkinBrowserWndProc(HWND hwnd, UINT iMsg, WPARAM wParam,
|
|||||||
void display_skinbrowser(gui_t* gui)
|
void display_skinbrowser(gui_t* gui)
|
||||||
{
|
{
|
||||||
HWND hWnd = FindWindow(NULL, "Skin Browser");
|
HWND hWnd = FindWindow(NULL, "Skin Browser");
|
||||||
|
HINSTANCE hInstance = GetModuleHandle(NULL);
|
||||||
|
WNDCLASS wc;
|
||||||
|
int x, y;
|
||||||
|
|
||||||
if (hWnd)
|
if (hWnd)
|
||||||
{
|
{
|
||||||
SendMessage(hWnd, WM_CLOSE, 0, 0);
|
SendMessage(hWnd, WM_CLOSE, 0, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
HINSTANCE hInstance = GetModuleHandle(NULL);
|
|
||||||
WNDCLASS wc;
|
|
||||||
int x, y;
|
|
||||||
|
|
||||||
wc.style = CS_HREDRAW | CS_VREDRAW;
|
wc.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
wc.lpfnWndProc = SkinBrowserWndProc;
|
wc.lpfnWndProc = SkinBrowserWndProc;
|
||||||
wc.cbClsExtra = 0;
|
wc.cbClsExtra = 0;
|
||||||
@ -1106,12 +1107,12 @@ static LRESULT CALLBACK EqWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lP
|
|||||||
|
|
||||||
void display_eqwindow(gui_t *gui)
|
void display_eqwindow(gui_t *gui)
|
||||||
{
|
{
|
||||||
if(!guiIntfStruct.sh_video) return;
|
|
||||||
|
|
||||||
HWND hWnd;
|
HWND hWnd;
|
||||||
HINSTANCE hInstance = GetModuleHandle(NULL);
|
HINSTANCE hInstance = GetModuleHandle(NULL);
|
||||||
WNDCLASS wc;
|
WNDCLASS wc;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
|
if(!guiIntfStruct.sh_video) return;
|
||||||
if(FindWindow(NULL, "MPlayer - Equalizer")) return;
|
if(FindWindow(NULL, "MPlayer - Equalizer")) return;
|
||||||
wc.style = CS_HREDRAW | CS_VREDRAW;
|
wc.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
wc.lpfnWndProc = EqWndProc;
|
wc.lpfnWndProc = EqWndProc;
|
||||||
|
@ -269,10 +269,11 @@ static widget *clickedinsidewidget(gui_t *gui, int window, int x, int y)
|
|||||||
/* updates sliders and the display */
|
/* updates sliders and the display */
|
||||||
static void updatedisplay(gui_t *gui, HWND hwnd)
|
static void updatedisplay(gui_t *gui, HWND hwnd)
|
||||||
{
|
{
|
||||||
if(!hwnd) return;
|
|
||||||
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
window_priv_t *priv = NULL;
|
window_priv_t *priv = NULL;
|
||||||
|
DWORD time = timeGetTime();
|
||||||
|
|
||||||
|
if(!hwnd) return;
|
||||||
|
|
||||||
/* load all potmeters hpotmeters */
|
/* load all potmeters hpotmeters */
|
||||||
for(i=0; i<gui->skin->widgetcount; i++)
|
for(i=0; i<gui->skin->widgetcount; i++)
|
||||||
@ -308,7 +309,6 @@ static void updatedisplay(gui_t *gui, HWND hwnd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* updating the display once a 100.second is enough imo */
|
/* updating the display once a 100.second is enough imo */
|
||||||
DWORD time = timeGetTime();
|
|
||||||
if((time - oldtime) < 100) return;
|
if((time - oldtime) < 100) return;
|
||||||
oldtime=time;
|
oldtime=time;
|
||||||
|
|
||||||
@ -410,9 +410,10 @@ static LRESULT CALLBACK SubProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
|
|||||||
{
|
{
|
||||||
static char path[MAX_PATH];
|
static char path[MAX_PATH];
|
||||||
BROWSEINFO bi;
|
BROWSEINFO bi;
|
||||||
|
LPITEMIDLIST pidl;
|
||||||
memset(&bi, 0, sizeof(BROWSEINFO));
|
memset(&bi, 0, sizeof(BROWSEINFO));
|
||||||
bi.lpszTitle = "Choose a Directory...";
|
bi.lpszTitle = "Choose a Directory...";
|
||||||
LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
|
pidl = SHBrowseForFolder(&bi);
|
||||||
if (SHGetPathFromIDList(pidl, path))
|
if (SHGetPathFromIDList(pidl, path))
|
||||||
{
|
{
|
||||||
gui->playlist->clear_playlist(gui->playlist);
|
gui->playlist->clear_playlist(gui->playlist);
|
||||||
@ -536,9 +537,9 @@ static LRESULT CALLBACK SubProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
|
|||||||
}
|
}
|
||||||
case WM_MOUSEWHEEL:
|
case WM_MOUSEWHEEL:
|
||||||
{
|
{
|
||||||
|
int x = GET_WHEEL_DELTA_WPARAM(wParam);
|
||||||
if(vo_nomouse_input)
|
if(vo_nomouse_input)
|
||||||
break;
|
break;
|
||||||
int x = GET_WHEEL_DELTA_WPARAM(wParam);
|
|
||||||
if (x > 0)
|
if (x > 0)
|
||||||
mplayer_put_key(MOUSE_BTN3);
|
mplayer_put_key(MOUSE_BTN3);
|
||||||
else
|
else
|
||||||
@ -920,9 +921,10 @@ static LRESULT CALLBACK EventProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM
|
|||||||
{
|
{
|
||||||
static char path[MAX_PATH];
|
static char path[MAX_PATH];
|
||||||
BROWSEINFO bi;
|
BROWSEINFO bi;
|
||||||
|
LPITEMIDLIST pidl;
|
||||||
memset(&bi, 0, sizeof(BROWSEINFO));
|
memset(&bi, 0, sizeof(BROWSEINFO));
|
||||||
bi.lpszTitle = "Choose a Directory...";
|
bi.lpszTitle = "Choose a Directory...";
|
||||||
LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
|
pidl = SHBrowseForFolder(&bi);
|
||||||
if (SHGetPathFromIDList(pidl, path))
|
if (SHGetPathFromIDList(pidl, path))
|
||||||
{
|
{
|
||||||
gui->playlist->clear_playlist(gui->playlist);
|
gui->playlist->clear_playlist(gui->playlist);
|
||||||
@ -1421,6 +1423,7 @@ extern int create_window(gui_t *gui, char *skindir)
|
|||||||
window *desc = NULL;
|
window *desc = NULL;
|
||||||
char dir[MAX_PATH];
|
char dir[MAX_PATH];
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
int x = -1, y = -1;
|
||||||
|
|
||||||
/* destroy the current main window */
|
/* destroy the current main window */
|
||||||
if(gui->skin) destroy_window(gui);
|
if(gui->skin) destroy_window(gui);
|
||||||
@ -1457,7 +1460,6 @@ extern int create_window(gui_t *gui, char *skindir)
|
|||||||
/* load the icon from the executable */
|
/* load the icon from the executable */
|
||||||
GetModuleFileName(NULL, dir, MAX_PATH);
|
GetModuleFileName(NULL, dir, MAX_PATH);
|
||||||
gui->icon = ExtractIcon(instance, dir, 0);
|
gui->icon = ExtractIcon(instance, dir, 0);
|
||||||
int x = -1, y = -1;
|
|
||||||
|
|
||||||
/* create the window class */
|
/* create the window class */
|
||||||
wc.style = CS_HREDRAW | CS_VREDRAW;
|
wc.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
@ -1539,8 +1541,9 @@ extern int create_window(gui_t *gui, char *skindir)
|
|||||||
gui_t *create_gui(char *skindir, char *skinName, void (*playercontrol)(int event))
|
gui_t *create_gui(char *skindir, char *skinName, void (*playercontrol)(int event))
|
||||||
{
|
{
|
||||||
gui_t *gui = calloc(1, sizeof(gui_t));
|
gui_t *gui = calloc(1, sizeof(gui_t));
|
||||||
|
char temp[MAX_PATH];
|
||||||
HWND runningmplayer = FindWindow("MPlayer GUI for Windows", "MPlayer for Windows");
|
HWND runningmplayer = FindWindow("MPlayer GUI for Windows", "MPlayer for Windows");
|
||||||
|
|
||||||
if(runningmplayer)
|
if(runningmplayer)
|
||||||
{
|
{
|
||||||
free(gui);
|
free(gui);
|
||||||
@ -1556,7 +1559,6 @@ gui_t *create_gui(char *skindir, char *skinName, void (*playercontrol)(int event
|
|||||||
gui->playlist = create_playlist();
|
gui->playlist = create_playlist();
|
||||||
|
|
||||||
if(!skinName) skinName = strdup("Blue");
|
if(!skinName) skinName = strdup("Blue");
|
||||||
char temp[MAX_PATH];
|
|
||||||
sprintf(temp, "%s\\%s", skindir, skinName);
|
sprintf(temp, "%s\\%s", skindir, skinName);
|
||||||
if(create_window(gui, temp)) return NULL;
|
if(create_window(gui, temp)) return NULL;
|
||||||
if(create_subwindow(gui, temp)) return NULL;
|
if(create_subwindow(gui, temp)) return NULL;
|
||||||
|
@ -550,12 +550,11 @@ static void remove_vop(char * str)
|
|||||||
/* this function gets called by mplayer to update the gui */
|
/* this function gets called by mplayer to update the gui */
|
||||||
int guiGetEvent(int type, char *arg)
|
int guiGetEvent(int type, char *arg)
|
||||||
{
|
{
|
||||||
if(!mygui || !mygui->skin) return 0;
|
|
||||||
|
|
||||||
stream_t *stream = (stream_t *) arg;
|
stream_t *stream = (stream_t *) arg;
|
||||||
#ifdef USE_DVDREAD
|
#ifdef USE_DVDREAD
|
||||||
dvd_priv_t *dvdp = (dvd_priv_t *) arg;
|
dvd_priv_t *dvdp = (dvd_priv_t *) arg;
|
||||||
#endif
|
#endif
|
||||||
|
if(!mygui || !mygui->skin) return 0;
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
@ -306,10 +306,11 @@ void renderinfobox(skin_t *skin, window_priv_t *priv)
|
|||||||
|
|
||||||
void renderwidget(skin_t *skin, image *dest, widget *item, int state)
|
void renderwidget(skin_t *skin, image *dest, widget *item, int state)
|
||||||
{
|
{
|
||||||
if(!dest) return;
|
|
||||||
image *img = NULL;
|
image *img = NULL;
|
||||||
int height;
|
int height;
|
||||||
int y;
|
int y;
|
||||||
|
|
||||||
|
if(!dest) return;
|
||||||
if((item->type == tyButton) || (item->type == tyHpotmeter) || (item->type == tyPotmeter))
|
if((item->type == tyButton) || (item->type == tyHpotmeter) || (item->type == tyPotmeter))
|
||||||
img = item->bitmap[0];
|
img = item->bitmap[0];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user