Mercurial > mplayer.hg
changeset 35681:80c5c89f77d6
Cosmetic: Rename ws functions for the sake of consistency.
wsXInit -> wsInit
wsXDone -> wsDone
wsEvents -> wsEvent
wsHandleEvents -> wsEvents
wsSetBackgroundRGB -> wsWindowBackground
wsClearWindow -> wsWindowClear
wsCreateWindow -> wsWindowCreate
wsDestroyWindow -> wsWindowDestroy
wsFullScreen -> wsWindowFullscreen
wsSetIcon -> wsWindowIcon
wsIconify -> wsWindowIconify
wsSetLayer -> wsWindowLayer
wsSearch -> wsWindowListSearch
wsMoveWindow -> wsWindowMove
wsMoveWindowWithin -> wsWindowMoveWithin
wsRaiseWindowTop -> wsWindowRaiseTop
wsPostRedisplay -> wsWindowRedraw
wsResizeWindow -> wsWindowResize
wsSetShape -> wsWindowShape
wsWindowPosition -> wsWindowUpdatePosition
wsUpdateXineramaInfo -> wsWindowUpdateXinerama
wsVisibleWindow -> wsWindowVisibility
wsConvert -> wsImageConvert
wsCreateImage -> wsImageCreate
wsDestroyImage -> wsImageDestroy
wsPutImage -> wsImageDraw
wsResizeImage -> wsImageResize
wsAutohideCursor -> wsMouseAutohide
wsVisibleMouse -> wsMouseVisibility
author | ib |
---|---|
date | Fri, 18 Jan 2013 00:35:38 +0000 |
parents | eca669983e9a |
children | fcb8f12cefa7 |
files | gui/dialog/dialog.c gui/dialog/preferences.c gui/interface.c gui/ui/actions.c gui/ui/main.c gui/ui/menu.c gui/ui/playbar.c gui/ui/render.c gui/ui/video.c gui/wm/ws.c gui/wm/ws.h |
diffstat | 11 files changed, 182 insertions(+), 182 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/dialog/dialog.c Thu Jan 17 23:35:53 2013 +0000 +++ b/gui/dialog/dialog.c Fri Jan 18 00:35:38 2013 +0000 @@ -178,7 +178,7 @@ */ void gtkAddIcon(GtkWidget *window) { - wsSetIcon(gdk_display, GDK_WINDOW_XWINDOW(window->window), &guiIcon); + wsWindowIcon(gdk_display, GDK_WINDOW_XWINDOW(window->window), &guiIcon); } void gtkClearList(GtkWidget *list) @@ -269,7 +269,7 @@ */ void gtkSetLayer(GtkWidget *window) { - wsSetLayer(gdk_display, GDK_WINDOW_XWINDOW(window->window), guiApp.videoWindow.isFullScreen); + wsWindowLayer(gdk_display, GDK_WINDOW_XWINDOW(window->window), guiApp.videoWindow.isFullScreen); gtkActive(window); } @@ -280,7 +280,7 @@ */ void gtkActive(GtkWidget *window) { - wsRaiseWindowTop(gdk_display, GDK_WINDOW_XWINDOW(window->window)); + wsWindowRaiseTop(gdk_display, GDK_WINDOW_XWINDOW(window->window)); } void gtkShow(int type, char *param)
--- a/gui/dialog/preferences.c Thu Jan 17 23:35:53 2013 +0000 +++ b/gui/dialog/preferences.c Fri Jan 18 00:35:38 2013 +0000 @@ -727,7 +727,7 @@ gtkActive( Preferences ); } else window=wsHideWindow; // NOTE TO MYSELF: doesn't work with a fullscreen window - if ( !guiInfo.Playing ) wsVisibleWindow( &guiApp.videoWindow,window ); + if ( !guiInfo.Playing ) wsWindowVisibility( &guiApp.videoWindow,window ); break; case 4: case 5:
--- a/gui/interface.c Thu Jan 17 23:35:53 2013 +0000 +++ b/gui/interface.c Fri Jan 18 00:35:38 2013 +0000 @@ -110,7 +110,7 @@ /* initialize graphical user interfaces */ - wsXInit(mDisplay); + wsInit(mDisplay); gtkInit(mDisplayName); /* load skin */ @@ -172,9 +172,9 @@ if (guiWinID >= 0) guiApp.mainWindow.Parent = guiWinID; - wsCreateWindow(&guiApp.videoWindow, guiApp.video.x, guiApp.video.y, guiApp.video.width, guiApp.video.height, 0, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, wsShowFrame | wsHideWindow | wsWaitMap | wsAspect, "MPlayer - Video"); - wsDestroyImage(&guiApp.videoWindow); - wsCreateImage(&guiApp.videoWindow, guiApp.video.Bitmap.Width, guiApp.video.Bitmap.Height); + wsWindowCreate(&guiApp.videoWindow, guiApp.video.x, guiApp.video.y, guiApp.video.width, guiApp.video.height, 0, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, wsShowFrame | wsHideWindow | wsWaitMap | wsAspect, "MPlayer - Video"); + wsImageDestroy(&guiApp.videoWindow); + wsImageCreate(&guiApp.videoWindow, guiApp.video.Bitmap.Width, guiApp.video.Bitmap.Height); wsXDNDMakeAwareness(&guiApp.videoWindow); WinID = guiApp.videoWindow.WindowID; @@ -185,8 +185,8 @@ // i=wsHideFrame|wsMaxSize|wsHideWindow; // if ( guiApp.mainDecoration ) i=wsShowFrame|wsMaxSize|wsHideWindow; i = wsShowFrame | wsMinSize | wsMaxSize | wsHideWindow; - wsCreateWindow(&guiApp.mainWindow, guiApp.main.x, guiApp.main.y, guiApp.main.width, guiApp.main.height, 0, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, i, "MPlayer"); - wsSetShape(&guiApp.mainWindow, guiApp.main.Mask.Image); + wsWindowCreate(&guiApp.mainWindow, guiApp.main.x, guiApp.main.y, guiApp.main.width, guiApp.main.height, 0, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, i, "MPlayer"); + wsWindowShape(&guiApp.mainWindow, guiApp.main.Mask.Image); wsXDNDMakeAwareness(&guiApp.mainWindow); mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[interface] mainWindow ID: 0x%x\n", (int)guiApp.mainWindow.WindowID); @@ -202,33 +202,33 @@ guiApp.videoWindow.KeyHandler = uiMainKeyHandle; guiApp.videoWindow.DandDHandler = uiDandDHandler; - wsSetBackgroundRGB(&guiApp.videoWindow, guiApp.video.R, guiApp.video.G, guiApp.video.B); - wsClearWindow(&guiApp.videoWindow); + wsWindowBackground(&guiApp.videoWindow, guiApp.video.R, guiApp.video.G, guiApp.video.B); + wsWindowClear(&guiApp.videoWindow); if (guiApp.video.Bitmap.Image) - wsConvert(&guiApp.videoWindow, guiApp.video.Bitmap.Image); + wsImageConvert(&guiApp.videoWindow, guiApp.video.Bitmap.Image); btnModify(evSetVolume, guiInfo.Volume); btnModify(evSetBalance, guiInfo.Balance); btnModify(evSetMoviePosition, guiInfo.Position); - wsSetIcon(wsDisplay, guiApp.mainWindow.WindowID, &guiIcon); - wsSetIcon(wsDisplay, guiApp.videoWindow.WindowID, &guiIcon); + wsWindowIcon(wsDisplay, guiApp.mainWindow.WindowID, &guiIcon); + wsWindowIcon(wsDisplay, guiApp.videoWindow.WindowID, &guiIcon); if (!guiApp.mainDecoration) wsWindowDecoration(&guiApp.mainWindow, False); - wsVisibleWindow(&guiApp.mainWindow, wsShowWindow); + wsWindowVisibility(&guiApp.mainWindow, wsShowWindow); if (gtkShowVideoWindow) { - wsVisibleWindow(&guiApp.videoWindow, wsShowWindow); + wsWindowVisibility(&guiApp.videoWindow, wsShowWindow); guiInfo.VideoWindow = True; if (gtkLoadFullscreen) uiFullScreen(); } else - wsSetBackgroundRGB(&guiApp.videoWindow, 0, 0, 0); + wsWindowBackground(&guiApp.videoWindow, 0, 0, 0); if (gtkLoadFullscreen) btnSet(evFullScreen, btnPressed); @@ -275,7 +275,7 @@ ass_bottom_margin = gtkASS.bottom_margin; cfg_write(); - wsXDone(); + wsDone(); } uiUnsetFile(); @@ -358,7 +358,7 @@ switch ((int)data) { case GUI_STOP: case GUI_PLAY: -// if ( !gtkShowVideoWindow ) wsVisibleWindow( &guiApp.videoWindow,wsHideWindow ); +// if ( !gtkShowVideoWindow ) wsWindowVisibility( &guiApp.videoWindow,wsHideWindow ); case GUI_PAUSE: guiInfo.Playing = (int)data; break; @@ -370,9 +370,9 @@ case GUI_HANDLE_EVENTS: if (!guiInfo.Playing || !guiInfo.VideoWindow) - wsHandleEvents(); + wsEvents(); - wsAutohideCursor(); + wsMouseAutohide(); gtkEventHandling(); break; @@ -417,7 +417,7 @@ case GUI_PREPARE: - wsVisibleMouse(&guiApp.videoWindow, wsHideMouseCursor); + wsMouseVisibility(&guiApp.videoWindow, wsHideMouseCursor); if (guiInfo.NewPlay == GUI_FILE_NEW) { audio_id = -1; @@ -728,7 +728,7 @@ // ...without video there will be no call to GUI_SETUP_VIDEO_WINDOW if (!guiInfo.VideoWindow) { - wsVisibleWindow(&guiApp.videoWindow, wsHideWindow); + wsWindowVisibility(&guiApp.videoWindow, wsHideWindow); btnSet(evFullScreen, (gtkLoadFullscreen ? btnPressed : btnReleased)); } @@ -778,22 +778,22 @@ if (!guiApp.videoWindow.isFullScreen || !guiApp.videoWindow.Mapped) { if (!guiApp.videoWindow.isFullScreen) - wsResizeWindow(&guiApp.videoWindow, guiInfo.VideoWidth, guiInfo.VideoHeight); + wsWindowResize(&guiApp.videoWindow, guiInfo.VideoWidth, guiInfo.VideoHeight); if (!guiApp.videoWindow.Mapped) - wsVisibleWindow(&guiApp.videoWindow, wsShowWindow); + wsWindowVisibility(&guiApp.videoWindow, wsShowWindow); } if (gtkLoadFullscreen ^ guiApp.videoWindow.isFullScreen) uiEventHandling(evFullScreen, True); if (guiWinID >= 0) - wsMoveWindow(&guiApp.mainWindow, True, 0, guiInfo.VideoHeight); + wsWindowMove(&guiApp.mainWindow, True, 0, guiInfo.VideoHeight); break; case GUI_HANDLE_X_EVENT: - wsEvents(data); + wsEvent(data); gtkEventHandling(); break; @@ -858,27 +858,27 @@ guiInfo.VideoWindow = True; if (!guiApp.videoWindow.isFullScreen) - wsResizeWindow(&guiApp.videoWindow, guiApp.video.width, guiApp.video.height); + wsWindowResize(&guiApp.videoWindow, guiApp.video.width, guiApp.video.height); if (!guiApp.videoWindow.Mapped) - wsVisibleWindow(&guiApp.videoWindow, wsShowWindow); + wsWindowVisibility(&guiApp.videoWindow, wsShowWindow); if (gtkLoadFullscreen ^ guiApp.videoWindow.isFullScreen) uiEventHandling(evFullScreen, False); } else { - wsVisibleWindow(&guiApp.videoWindow, wsHideWindow); + wsWindowVisibility(&guiApp.videoWindow, wsHideWindow); guiInfo.VideoWindow = False; btnSet(evFullScreen, (gtkLoadFullscreen ? btnPressed : btnReleased)); } gui(GUI_SET_STATE, (void *)GUI_STOP); - wsHandleEvents(); + wsEvents(); uiVideoRender = True; - wsSetBackgroundRGB(&guiApp.videoWindow, guiApp.video.R, guiApp.video.G, guiApp.video.B); - wsClearWindow(&guiApp.videoWindow); - wsPostRedisplay(&guiApp.videoWindow); - wsVisibleMouse(&guiApp.videoWindow, wsShowMouseCursor); + wsWindowBackground(&guiApp.videoWindow, guiApp.video.R, guiApp.video.G, guiApp.video.B); + wsWindowClear(&guiApp.videoWindow); + wsWindowRedraw(&guiApp.videoWindow); + wsMouseVisibility(&guiApp.videoWindow, wsShowMouseCursor); } break;
--- a/gui/ui/actions.c Thu Jan 17 23:35:53 2013 +0000 +++ b/gui/ui/actions.c Fri Jan 18 00:35:38 2013 +0000 @@ -54,19 +54,19 @@ if (!guiInfo.VideoWindow) return; - wsFullScreen(&guiApp.videoWindow); + wsWindowFullscreen(&guiApp.videoWindow); vo_fs = guiApp.videoWindow.isFullScreen; - wsSetLayer(wsDisplay, guiApp.mainWindow.WindowID, guiApp.videoWindow.isFullScreen); + wsWindowLayer(wsDisplay, guiApp.mainWindow.WindowID, guiApp.videoWindow.isFullScreen); if (guiApp.menuIsPresent) - wsSetLayer(wsDisplay, guiApp.menuWindow.WindowID, guiApp.videoWindow.isFullScreen); + wsWindowLayer(wsDisplay, guiApp.menuWindow.WindowID, guiApp.videoWindow.isFullScreen); if (guiInfo.Playing) - wsSetBackgroundRGB(&guiApp.videoWindow, 0, 0, 0); + wsWindowBackground(&guiApp.videoWindow, 0, 0, 0); else - wsSetBackgroundRGB(&guiApp.videoWindow, guiApp.video.R, guiApp.video.G, guiApp.video.B); + wsWindowBackground(&guiApp.videoWindow, guiApp.video.R, guiApp.video.G, guiApp.video.B); } /** @@ -90,8 +90,8 @@ gui(GUI_SET_STATE, (void *)GUI_PLAY); uiVideoRender = False; - wsSetBackgroundRGB(&guiApp.videoWindow, 0, 0, 0); - wsClearWindow(&guiApp.videoWindow); + wsWindowBackground(&guiApp.videoWindow, 0, 0, 0); + wsWindowClear(&guiApp.videoWindow); } /** @@ -186,37 +186,37 @@ mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0); } - wsResizeWindow(&guiApp.menuWindow, guiApp.menu.width, guiApp.menu.height); - wsResizeImage(&guiApp.menuWindow, guiApp.menu.width, guiApp.menu.height); - wsSetShape(&guiApp.menuWindow, guiApp.menu.Mask.Image); - wsVisibleWindow(&guiApp.menuWindow, wsHideWindow); + wsWindowResize(&guiApp.menuWindow, guiApp.menu.width, guiApp.menu.height); + wsImageResize(&guiApp.menuWindow, guiApp.menu.width, guiApp.menu.height); + wsWindowShape(&guiApp.menuWindow, guiApp.menu.Mask.Image); + wsWindowVisibility(&guiApp.menuWindow, wsHideWindow); } else uiMenuInit(); /* reload video window */ if (guiApp.video.Bitmap.Image) - wsResizeImage(&guiApp.videoWindow, guiApp.video.Bitmap.Width, guiApp.video.Bitmap.Height); + wsImageResize(&guiApp.videoWindow, guiApp.video.Bitmap.Width, guiApp.video.Bitmap.Height); if (!guiApp.videoWindow.isFullScreen && !guiInfo.Playing) { - wsResizeWindow(&guiApp.videoWindow, guiApp.video.width, guiApp.video.height); - wsMoveWindow(&guiApp.videoWindow, False, guiApp.video.x, guiApp.video.y); + wsWindowResize(&guiApp.videoWindow, guiApp.video.width, guiApp.video.height); + wsWindowMove(&guiApp.videoWindow, False, guiApp.video.x, guiApp.video.y); } if (guiApp.video.Bitmap.Image) - wsConvert(&guiApp.videoWindow, guiApp.video.Bitmap.Image); + wsImageConvert(&guiApp.videoWindow, guiApp.video.Bitmap.Image); if (!guiInfo.Playing) { uiVideoRender = True; - wsSetBackgroundRGB(&guiApp.videoWindow, guiApp.video.R, guiApp.video.G, guiApp.video.B); - wsClearWindow(&guiApp.videoWindow); - wsPostRedisplay(&guiApp.videoWindow); + wsWindowBackground(&guiApp.videoWindow, guiApp.video.R, guiApp.video.G, guiApp.video.B); + wsWindowClear(&guiApp.videoWindow); + wsWindowRedraw(&guiApp.videoWindow); } /* reload playbar */ if (bprev) - wsDestroyWindow(&guiApp.playbarWindow); + wsWindowDestroy(&guiApp.playbarWindow); uiPlaybarInit(); @@ -230,12 +230,12 @@ mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0); } - wsDestroyWindow(&guiApp.mainWindow); + wsWindowDestroy(&guiApp.mainWindow); - wsCreateWindow(&guiApp.mainWindow, guiApp.main.x, guiApp.main.y, guiApp.main.width, guiApp.main.height, 0, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, wsShowFrame | wsMinSize | wsMaxSize | wsHideWindow, "MPlayer"); - wsCreateImage(&guiApp.mainWindow, guiApp.main.Bitmap.Width, guiApp.main.Bitmap.Height); - wsSetShape(&guiApp.mainWindow, guiApp.main.Mask.Image); - wsSetIcon(wsDisplay, guiApp.mainWindow.WindowID, &guiIcon); + wsWindowCreate(&guiApp.mainWindow, guiApp.main.x, guiApp.main.y, guiApp.main.width, guiApp.main.height, 0, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, wsShowFrame | wsMinSize | wsMaxSize | wsHideWindow, "MPlayer"); + wsImageCreate(&guiApp.mainWindow, guiApp.main.Bitmap.Width, guiApp.main.Bitmap.Height); + wsWindowShape(&guiApp.mainWindow, guiApp.main.Mask.Image); + wsWindowIcon(wsDisplay, guiApp.mainWindow.WindowID, &guiIcon); guiApp.mainWindow.ReDraw = (void *)uiMainDraw; guiApp.mainWindow.MouseHandler = uiMainMouseHandle; @@ -247,7 +247,7 @@ if (!guiApp.mainDecoration) wsWindowDecoration(&guiApp.mainWindow, False); - wsVisibleWindow(&guiApp.mainWindow, wsShowWindow); + wsWindowVisibility(&guiApp.mainWindow, wsShowWindow); mainVisible = True; btnModify(evSetVolume, guiInfo.Volume); @@ -255,8 +255,8 @@ btnModify(evSetMoviePosition, guiInfo.Position); btnSet(evFullScreen, (guiApp.videoWindow.isFullScreen ? btnPressed : btnReleased)); - wsSetLayer(wsDisplay, guiApp.mainWindow.WindowID, guiApp.videoWindow.isFullScreen); - wsSetLayer(wsDisplay, guiApp.menuWindow.WindowID, guiApp.videoWindow.isFullScreen); + wsWindowLayer(wsDisplay, guiApp.mainWindow.WindowID, guiApp.videoWindow.isFullScreen); + wsWindowLayer(wsDisplay, guiApp.menuWindow.WindowID, guiApp.videoWindow.isFullScreen); } /**
--- a/gui/ui/main.c Thu Jan 17 23:35:53 2013 +0000 +++ b/gui/ui/main.c Fri Jan 18 00:35:38 2013 +0000 @@ -96,7 +96,7 @@ RenderAll( &guiApp.mainWindow,guiApp.mainItems,guiApp.IndexOfMainItems,mainDrawBuffer ); uiMainRender=False; } - wsPutImage( &guiApp.mainWindow ); + wsImageDraw( &guiApp.mainWindow ); // XFlush( wsDisplay ); } @@ -330,8 +330,8 @@ case evIconify: switch ( iparam ) { - case 0: wsIconify( &guiApp.mainWindow ); break; - case 1: wsIconify( &guiApp.videoWindow ); break; + case 0: wsWindowIconify( &guiApp.mainWindow ); break; + case 1: wsWindowIconify( &guiApp.videoWindow ); break; } break; case evHalfSize: @@ -341,7 +341,7 @@ { uiFullScreen(); } - wsResizeWindow( &guiApp.videoWindow, guiInfo.VideoWidth / 2, guiInfo.VideoHeight / 2 ); + wsWindowResize( &guiApp.videoWindow, guiInfo.VideoWidth / 2, guiInfo.VideoHeight / 2 ); btnSet( evFullScreen,btnReleased ); } break; @@ -352,8 +352,8 @@ { uiFullScreen(); } - wsResizeWindow( &guiApp.videoWindow, guiInfo.VideoWidth * 2, guiInfo.VideoHeight * 2 ); - wsMoveWindowWithin( &guiApp.videoWindow, False, guiApp.video.x, guiApp.video.y ); + wsWindowResize( &guiApp.videoWindow, guiInfo.VideoWidth * 2, guiInfo.VideoHeight * 2 ); + wsWindowMoveWithin( &guiApp.videoWindow, False, guiApp.video.x, guiApp.video.y ); btnSet( evFullScreen,btnReleased ); } break; @@ -364,7 +364,7 @@ { uiFullScreen(); } - wsResizeWindow( &guiApp.videoWindow, guiInfo.VideoWidth, guiInfo.VideoHeight ); + wsWindowResize( &guiApp.videoWindow, guiInfo.VideoWidth, guiInfo.VideoHeight ); btnSet( evFullScreen,btnReleased ); break; } else if ( !guiApp.videoWindow.isFullScreen ) break; @@ -373,7 +373,7 @@ { uiFullScreen(); if ( !guiApp.videoWindow.isFullScreen ) - wsResizeWindow( &guiApp.videoWindow, iparam ? guiInfo.VideoWidth : guiApp.video.width, iparam ? guiInfo.VideoHeight : guiApp.video.height ); + wsWindowResize( &guiApp.videoWindow, iparam ? guiInfo.VideoWidth : guiApp.video.width, iparam ? guiInfo.VideoHeight : guiApp.video.height ); } if ( guiApp.videoWindow.isFullScreen ) btnSet( evFullScreen,btnPressed ); else btnSet( evFullScreen,btnReleased ); @@ -388,7 +388,7 @@ case 1: default: movie_aspect=-1; } - wsClearWindow( &guiApp.videoWindow ); + wsWindowClear( &guiApp.videoWindow ); if ( guiInfo.StreamType == STREAMTYPE_VCD ) uiEventHandling( evPlayVCD, 0 ); else if ( guiInfo.StreamType == STREAMTYPE_DVD ) uiEventHandling( ivPlayDVD, 0 ); else @@ -406,8 +406,8 @@ last_redraw_time = now; } uiMainRender=True; - wsPostRedisplay( &guiApp.mainWindow ); - wsPostRedisplay( &guiApp.playbarWindow ); + wsWindowRedraw( &guiApp.mainWindow ); + wsWindowRedraw( &guiApp.playbarWindow ); break; /* system events */ case evNone: @@ -518,7 +518,7 @@ switch ( itemtype ) { case itPLMButton: - wsMoveWindow( &guiApp.mainWindow,True,RX - abs( sx ),RY - abs( sy ) ); + wsWindowMove( &guiApp.mainWindow,True,RX - abs( sx ),RY - abs( sy ) ); uiMainRender=False; break; case itPRMButton:
--- a/gui/ui/menu.c Thu Jan 17 23:35:53 2013 +0000 +++ b/gui/ui/menu.c Fri Jan 18 00:35:38 2013 +0000 @@ -64,10 +64,10 @@ } oldMenuItem=menuItem; /* --- */ - wsConvert( &guiApp.menuWindow,menuDrawBuffer ); + wsImageConvert( &guiApp.menuWindow,menuDrawBuffer ); menuRender=False; } - wsPutImage( &guiApp.menuWindow ); + wsImageDraw( &guiApp.menuWindow ); } void uiMenuMouseHandle( int RX,int RY ) @@ -81,7 +81,7 @@ y=RY - guiApp.menuWindow.Y; if ( ( x < 0 ) || ( y < 0 ) || ( x > guiApp.menu.width ) || ( y > guiApp.menu.height ) ) { - wsPostRedisplay( &guiApp.menuWindow ); + wsWindowRedraw( &guiApp.menuWindow ); return; } @@ -91,7 +91,7 @@ guiApp.menuItems[i].x,guiApp.menuItems[i].y, guiApp.menuItems[i].x+guiApp.menuItems[i].width,guiApp.menuItems[i].y+guiApp.menuItems[i].height ) ) { menuItem=i; break; } } - wsPostRedisplay( &guiApp.menuWindow ); + wsWindowRedraw( &guiApp.menuWindow ); } void uiShowMenu( int mx,int my ) @@ -109,12 +109,12 @@ menuItem = 0; - wsMoveWindow( &guiApp.menuWindow,True,x,y ); - wsRaiseWindowTop( wsDisplay,guiApp.menuWindow.WindowID ); - wsSetLayer( wsDisplay,guiApp.menuWindow.WindowID,1 ); + wsWindowMove( &guiApp.menuWindow,True,x,y ); + wsWindowRaiseTop( wsDisplay,guiApp.menuWindow.WindowID ); + wsWindowLayer( wsDisplay,guiApp.menuWindow.WindowID,1 ); menuRender=True; - wsVisibleWindow( &guiApp.menuWindow,wsShowWindow ); - wsPostRedisplay( &guiApp.menuWindow ); + wsWindowVisibility( &guiApp.menuWindow,wsShowWindow ); + wsWindowRedraw( &guiApp.menuWindow ); } void uiHideMenu( int mx,int my,int w ) @@ -128,7 +128,7 @@ // x=RX - guiApp.menuWindow.X; // y=RY - guiApp.menuWindow.Y; - wsVisibleWindow( &guiApp.menuWindow,wsHideWindow ); + wsWindowVisibility( &guiApp.menuWindow,wsHideWindow ); if ( ( x < 0 ) || ( y < 0 ) ) return; @@ -158,11 +158,11 @@ return; } - wsCreateWindow( &guiApp.menuWindow, + wsWindowCreate( &guiApp.menuWindow, guiApp.menu.x,guiApp.menu.y,guiApp.menu.width,guiApp.menu.height, 0,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsOverredirect|wsHideFrame|wsMaxSize|wsMinSize|wsHideWindow,"MPlayer menu" ); - wsSetShape( &guiApp.menuWindow,guiApp.menu.Mask.Image ); + wsWindowShape( &guiApp.menuWindow,guiApp.menu.Mask.Image ); mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[menu] menuWindow ID: 0x%x\n",(int)guiApp.menuWindow.WindowID ); @@ -170,5 +170,5 @@ guiApp.menuWindow.ReDraw=uiMenuDraw; // guiApp.menuWindow.MouseHandler=uiMenuMouseHandle; // guiApp.menuWindow.KeyHandler=uiMainKeyHandle; - menuRender=True; wsPostRedisplay( &guiApp.menuWindow ); + menuRender=True; wsWindowRedraw( &guiApp.menuWindow ); }
--- a/gui/ui/playbar.c Thu Jan 17 23:35:53 2013 +0000 +++ b/gui/ui/playbar.c Fri Jan 18 00:35:38 2013 +0000 @@ -83,7 +83,7 @@ uiPlaybarFade=0; vo_mouse_autohide=False; } - wsMoveWindow( &guiApp.playbarWindow,True,x,playbarLength ); + wsWindowMove( &guiApp.playbarWindow,True,x,playbarLength ); break; case 2: // fade out playbarLength+=10; @@ -93,10 +93,10 @@ uiPlaybarFade=0; playbarVisible=False; vo_mouse_autohide=True; - wsVisibleWindow( &guiApp.playbarWindow,wsHideWindow ); + wsWindowVisibility( &guiApp.playbarWindow,wsHideWindow ); return; } - wsMoveWindow( &guiApp.playbarWindow,True,x,playbarLength ); + wsWindowMove( &guiApp.playbarWindow,True,x,playbarLength ); break; } @@ -110,9 +110,9 @@ fast_memcpy( playbarDrawBuffer,guiApp.playbar.Bitmap.Image,guiApp.playbar.Bitmap.ImageSize ); RenderAll( &guiApp.playbarWindow,guiApp.playbarItems,guiApp.IndexOfPlaybarItems,playbarDrawBuffer ); - wsConvert( &guiApp.playbarWindow,playbarDrawBuffer ); + wsImageConvert( &guiApp.playbarWindow,playbarDrawBuffer ); } - wsPutImage( &guiApp.playbarWindow ); + wsImageDraw( &guiApp.playbarWindow ); } static void uiPlaybarMouseHandle( int Button, int X, int Y, int RX, int RY ) @@ -238,8 +238,8 @@ if ( y > guiApp.videoWindow.Height - guiApp.playbar.height ) { - if ( !uiPlaybarFade ) wsVisibleWindow( &guiApp.playbarWindow,wsShowWindow ); - uiPlaybarFade=1; playbarVisible=True; wsPostRedisplay( &guiApp.playbarWindow ); + if ( !uiPlaybarFade ) wsWindowVisibility( &guiApp.playbarWindow,wsShowWindow ); + uiPlaybarFade=1; playbarVisible=True; wsWindowRedraw( &guiApp.playbarWindow ); } else if ( !uiPlaybarFade ) uiPlaybarFade=2; } @@ -257,11 +257,11 @@ } guiApp.playbarWindow.Parent=guiApp.videoWindow.WindowID; - wsCreateWindow( &guiApp.playbarWindow, + wsWindowCreate( &guiApp.playbarWindow, guiApp.playbar.x,guiApp.playbar.y,guiApp.playbar.width,guiApp.playbar.height, 0,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsHideFrame|wsHideWindow,"PlayBar" ); - wsSetShape( &guiApp.playbarWindow,guiApp.playbar.Mask.Image ); + wsWindowShape( &guiApp.playbarWindow,guiApp.playbar.Mask.Image ); guiApp.playbarWindow.ReDraw=(void *)uiPlaybarDraw; guiApp.playbarWindow.MouseHandler=uiPlaybarMouseHandle;
--- a/gui/ui/render.c Thu Jan 17 23:35:53 2013 +0000 +++ b/gui/ui/render.c Fri Jan 18 00:35:38 2013 +0000 @@ -416,5 +416,5 @@ } } - wsConvert(window, db); + wsImageConvert(window, db); }
--- a/gui/ui/video.c Thu Jan 17 23:35:53 2013 +0000 +++ b/gui/ui/video.c Fri Jan 18 00:35:38 2013 +0000 @@ -47,7 +47,7 @@ if ( uiVideoRender && guiApp.videoWindow.State == wsWindowExpose ) { - if ( guiApp.video.Bitmap.Image ) wsPutImage( &guiApp.videoWindow ); + if ( guiApp.video.Bitmap.Image ) wsImageDraw( &guiApp.videoWindow ); } guiApp.videoWindow.State=0; } @@ -87,7 +87,7 @@ mplVideoMoved=1; if ( !guiApp.videoWindow.isFullScreen ) { - wsMoveWindow( &guiApp.videoWindow,True,RX - sx,RY - sy ); + wsWindowMove( &guiApp.videoWindow,True,RX - sx,RY - sy ); } break; case wsPMMouseButton: @@ -99,9 +99,9 @@ case wsRLMouseButton: if ( ( !mplVideoMoved )&&( guiApp.videoWindow.isFullScreen ) ) { - // NOTE TO MYSELF: this doesn't work, fix later with wsSetLayer()? - if( videoVisible++%2 ) wsRaiseWindowTop( wsDisplay,guiApp.mainWindow.WindowID ); - else wsRaiseWindowTop( wsDisplay,guiApp.videoWindow.WindowID ); + // NOTE TO MYSELF: this doesn't work, fix later with wsWindowLayer()? + if( videoVisible++%2 ) wsWindowRaiseTop( wsDisplay,guiApp.mainWindow.WindowID ); + else wsWindowRaiseTop( wsDisplay,guiApp.videoWindow.WindowID ); } msButton=0; mplVideoMoved=0;
--- a/gui/wm/ws.c Thu Jan 17 23:35:53 2013 +0000 +++ b/gui/wm/ws.c Fri Jan 18 00:35:38 2013 +0000 @@ -138,7 +138,7 @@ * * @param win pointer to a ws window structure or NULL */ -static void wsUpdateXineramaInfo(wsWindow *win) +static void wsWindowUpdateXinerama(wsWindow *win) { if (win) { vo_dx = win->X; @@ -238,7 +238,7 @@ return 0; } -void wsXInit(Display *display) +void wsInit(Display *display) { int eventbase; int errorbase; @@ -307,7 +307,7 @@ wsMaxY = DisplayHeight(wsDisplay, wsScreen); } - wsUpdateXineramaInfo(NULL); + wsWindowUpdateXinerama(NULL); wsGetScreenDepth(); @@ -377,7 +377,7 @@ } } -void wsXDone(void) +void wsDone(void) { //XCloseDisplay(wsDisplay); } @@ -416,7 +416,7 @@ // Handle events. // ---------------------------------------------------------------------------------------------- -static int wsSearch(Window win) +static int wsWindowListSearch(Window win) { int i; @@ -427,14 +427,14 @@ return -1; } -void wsEvents(XEvent *event) +void wsEvent(XEvent *event) { unsigned long i = 0; int l; int x, y; Window child_window = 0; - l = wsSearch(event->xany.window); + l = wsWindowListSearch(event->xany.window); if (l == -1) return; @@ -630,7 +630,7 @@ } if (wsWindowList[l]->wsCursor != None) { - wsVisibleMouse(wsWindowList[l], wsShowMouseCursor); + wsMouseVisibility(wsWindowList[l], wsShowMouseCursor); mouse_win = wsWindowList[l]; mouse_time = GetTimerMS(); } @@ -642,7 +642,7 @@ i = event->xbutton.button + 128; if (wsWindowList[l]->wsCursor != None) { - wsVisibleMouse(wsWindowList[l], wsShowMouseCursor); + wsMouseVisibility(wsWindowList[l], wsShowMouseCursor); mouse_win = wsWindowList[l]; mouse_time = GetTimerMS(); } @@ -654,7 +654,7 @@ i = event->xbutton.button; if (wsWindowList[l]->wsCursor != None) { - wsVisibleMouse(wsWindowList[l], wsShowMouseCursor); + wsMouseVisibility(wsWindowList[l], wsShowMouseCursor); mouse_win = wsWindowList[l]; mouse_time = GetTimerMS(); } @@ -687,14 +687,14 @@ XSync(wsDisplay, False); } -void wsHandleEvents(void) +void wsEvents(void) { - XEvent wsEvent; + XEvent xev; /* handle pending events */ while (XPending(wsDisplay)) { - XNextEvent(wsDisplay, &wsEvent); -// printf("### X event: %d [%d]\n",wsEvent.type,delay); - wsEvents(&wsEvent); + XNextEvent(wsDisplay, &xev); +// printf("### X event: %d [%d]\n",xev.type,delay); + wsEvent(&xev); } } @@ -707,7 +707,7 @@ * @param width width of the area to place the window in * @param height height of the area to place the window in */ -static void wsWindowPosition(wsWindow *win, int x, int y, int width, int height) +static void wsWindowUpdatePosition(wsWindow *win, int x, int y, int width, int height) { switch (x) { case -1: @@ -826,14 +826,14 @@ Window LeaderWindow; // ---------------------------------------------------------------------------------------------- -// wsCreateWindow: create a new window on the screen. +// wsWindowCreate: create a new window on the screen. // x,y : window position // w,h : window size // b : window border size // c : mouse cursor visible // p : properties - "decoration", visible titlebar, etc ... // ---------------------------------------------------------------------------------------------- -void wsCreateWindow(wsWindow *win, int x, int y, int w, int h, int b, int c, unsigned char p, char *label) +void wsWindowCreate(wsWindow *win, int x, int y, int w, int h, int b, int c, unsigned char p, char *label) { int depth; @@ -842,7 +842,7 @@ if (p & wsShowFrame) win->Decorations = True; - wsWindowPosition(win, x, y, w, h); + wsWindowUpdatePosition(win, x, y, w, h); win->Width = w; win->Height = h; @@ -959,7 +959,7 @@ wsMapWait(win); } - wsCreateImage(win, win->Width, win->Height); + wsImageCreate(win, win->Width, win->Height); /* End of creating -------------------------------------------------------------------------- */ { @@ -986,11 +986,11 @@ mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[ws] window is created. ( %s ).\n", label); } -void wsDestroyWindow(wsWindow *win) +void wsWindowDestroy(wsWindow *win) { int l; - l = wsSearch(win->WindowID); + l = wsWindowListSearch(win->WindowID); if (l != -1) wsWindowList[l] = NULL; @@ -1002,7 +1002,7 @@ XFreeGC(wsDisplay, win->wGC); XUnmapWindow(wsDisplay, win->WindowID); - wsDestroyImage(win); + wsImageDestroy(win); XDestroyWindow(wsDisplay, win->WindowID); #if 0 win->ReDraw = NULL; @@ -1036,7 +1036,7 @@ PropModeReplace, (unsigned char *)&wsMotifWmHints, 5); } -void wsSetShape(wsWindow *win, char *data) +void wsWindowShape(wsWindow *win, char *data) { #ifdef CONFIG_XSHAPE if (!wsUseXShape) @@ -1061,7 +1061,7 @@ * @param Win window * @param icon pointer to the icons */ -void wsSetIcon(Display *display, Window Win, guiIcon_t *icon) +void wsWindowIcon(Display *display, Window Win, guiIcon_t *icon) { XWMHints *wm; Atom iconatom; @@ -1098,7 +1098,7 @@ // ---------------------------------------------------------------------------------------------- // Set window background to 'color'. // ---------------------------------------------------------------------------------------------- -void wsSetBackgroundRGB(wsWindow *win, int r, int g, int b) +void wsWindowBackground(wsWindow *win, int r, int g, int b) { int color = 0; @@ -1138,7 +1138,7 @@ * * @param win pointer to a ws window structure */ -void wsClearWindow(wsWindow *win) +void wsWindowClear(wsWindow *win) { XClearWindow(wsDisplay, win->WindowID); } @@ -1146,13 +1146,13 @@ // ---------------------------------------------------------------------------------------------- // Move window to x, y. // ---------------------------------------------------------------------------------------------- -void wsMoveWindow(wsWindow *win, Bool abs, int x, int y) +void wsWindowMove(wsWindow *win, Bool abs, int x, int y) { if (abs) { win->X = x; win->Y = y; } else - wsWindowPosition(win, x, y, win->Width, win->Height); + wsWindowUpdatePosition(win, x, y, win->Width, win->Height); wsSizeHint(win); XMoveWindow(wsDisplay, win->WindowID, win->X, win->Y); @@ -1167,11 +1167,11 @@ * @param x x position of the window (real/absolute or mock) * @param y y position of the window (real/absolute or mock) */ -void wsMoveWindowWithin(wsWindow *win, Bool abs, int x, int y) +void wsWindowMoveWithin(wsWindow *win, Bool abs, int x, int y) { Bool fitting = True; - wsMoveWindow(win, abs, x, y); + wsWindowMove(win, abs, x, y); if (win->X + win->Width + 1 > wsMaxX) { fitting = False; @@ -1190,13 +1190,13 @@ } if (!fitting) - wsMoveWindow(win, True, win->X, win->Y); + wsWindowMove(win, True, win->X, win->Y); } // ---------------------------------------------------------------------------------------------- // Resize window to sx, sy. // ---------------------------------------------------------------------------------------------- -void wsResizeWindow(wsWindow *win, int sx, int sy) +void wsWindowResize(wsWindow *win, int sx, int sy) { win->Width = sx; win->Height = sy; @@ -1218,7 +1218,7 @@ * * @param win pointer to a ws window structure */ -void wsFullScreen(wsWindow *win) +void wsWindowFullscreen(wsWindow *win) { if (win->isFullScreen) { if (vo_fs_type & vo_wm_FULLSCREEN) @@ -1245,7 +1245,7 @@ win->isFullScreen = True; - wsUpdateXineramaInfo(win); + wsWindowUpdateXinerama(win); } /* unknown window manager and obsolete option -fsmode used */ @@ -1258,15 +1258,15 @@ if (!(vo_fs_type & vo_wm_FULLSCREEN)) { wsSizeHint(win); wsWindowDecoration(win, win->Decorations && !win->isFullScreen); - wsSetLayer(wsDisplay, win->WindowID, win->isFullScreen); + wsWindowLayer(wsDisplay, win->WindowID, win->isFullScreen); XMoveResizeWindow(wsDisplay, win->WindowID, win->X, win->Y, win->Width, win->Height); } /* some window managers lose ontop after fullscreen */ if (!win->isFullScreen & vo_ontop) - wsSetLayer(wsDisplay, win->WindowID, vo_ontop); + wsWindowLayer(wsDisplay, win->WindowID, vo_ontop); - wsRaiseWindowTop(wsDisplay, win->WindowID); + wsWindowRaiseTop(wsDisplay, win->WindowID); XFlush(wsDisplay); } @@ -1275,12 +1275,12 @@ * * @param win pointer to a ws window structure */ -void wsIconify(wsWindow *win) +void wsWindowIconify(wsWindow *win) { XIconifyWindow(wsDisplay, win->WindowID, 0); } -void wsVisibleWindow(wsWindow *win, int show) +void wsWindowVisibility(wsWindow *win, int show) { switch (show) { case wsShowWindow: @@ -1308,7 +1308,7 @@ * @param display display * @param Win window */ -void wsRaiseWindowTop(Display *display, Window Win) +void wsWindowRaiseTop(Display *display, Window Win) { XMapRaised(display, Win); // NOTE TO MYSELF: is that really enough? XRaiseWindow(display, Win); // NOTE TO MYSELF: is that really enough? @@ -1325,7 +1325,7 @@ * @param Win window * @param fullscreen whether to set fullscreen or normal layer */ -void wsSetLayer(Display *display, Window Win, Bool fullscreen) +void wsWindowLayer(Display *display, Window Win, Bool fullscreen) { vo_x11_setlayer(display, Win, fullscreen); } @@ -1333,7 +1333,7 @@ // ---------------------------------------------------------------------------------------------- // Redraw screen. // ---------------------------------------------------------------------------------------------- -void wsPostRedisplay(wsWindow *win) +void wsWindowRedraw(wsWindow *win) { if (win->ReDraw) { win->State = wsWindowExpose; @@ -1345,7 +1345,7 @@ // ---------------------------------------------------------------------------------------------- // Put 'Image' to window. // ---------------------------------------------------------------------------------------------- -void wsCreateImage(wsWindow *win, int Width, int Height) +void wsImageCreate(wsWindow *win, int Width, int Height) { #ifdef HAVE_SHM if (wsUseXShm) { @@ -1401,7 +1401,7 @@ win->ImageDatadw = (unsigned int *)win->xImage->data; } -void wsDestroyImage(wsWindow *win) +void wsImageDestroy(wsWindow *win) { if (win->xImage) { XDestroyImage(win->xImage); @@ -1417,7 +1417,7 @@ win->xImage = NULL; } -void wsConvert(wsWindow *win, unsigned char *Image) +void wsImageConvert(wsWindow *win, unsigned char *Image) { static struct SwsContext *sws_ctx; const uint8_t *src[4] = { Image, NULL, NULL, NULL }; @@ -1459,7 +1459,7 @@ } } -void wsPutImage(wsWindow *win) +void wsImageDraw(wsWindow *win) { #ifdef HAVE_SHM if (wsUseXShm) { @@ -1477,16 +1477,16 @@ } } -void wsResizeImage(wsWindow *win, int Width, int Height) +void wsImageResize(wsWindow *win, int Width, int Height) { - wsDestroyImage(win); - wsCreateImage(win, Width, Height); + wsImageDestroy(win); + wsImageCreate(win, Width, Height); } // ---------------------------------------------------------------------------------------------- // Show / hide mouse cursor. // ---------------------------------------------------------------------------------------------- -void wsVisibleMouse(wsWindow *win, int m) +void wsMouseVisibility(wsWindow *win, int m) { switch (m) { case wsShowMouseCursor: @@ -1512,10 +1512,10 @@ /** * @brief Handle automatic hiding of the cursor. */ -void wsAutohideCursor(void) +void wsMouseAutohide(void) { if (mouse_win && (GetTimerMS() - mouse_time >= MOUSEHIDE_DELAY)) { - wsVisibleMouse(mouse_win, wsHideMouseCursor); + wsMouseVisibility(mouse_win, wsHideMouseCursor); mouse_win = NULL; } }
--- a/gui/wm/ws.h Thu Jan 17 23:35:53 2013 +0000 +++ b/gui/wm/ws.h Fri Jan 18 00:35:38 2013 +0000 @@ -171,43 +171,43 @@ extern Display *wsDisplay; // ---------------------------------------------------------------------------------------------- -void wsXDone(void); -void wsXInit(Display *display); +void wsDone(void); +void wsInit(Display *display); void wsSetErrorHandler(void); -void wsAutohideCursor(void); -void wsEvents(XEvent *event); -void wsHandleEvents(void); +void wsMouseAutohide(void); +void wsEvent(XEvent *event); +void wsEvents(void); -void wsCreateWindow(wsWindow *win, int x, int y, int w, int h, int b, int c, unsigned char p, char *label); -void wsDestroyWindow(wsWindow *win); -void wsMoveWindow(wsWindow *win, Bool abs, int x, int y); -void wsMoveWindowWithin(wsWindow *win, Bool abs, int x, int y); -void wsResizeWindow(wsWindow *win, int sx, int sy); -void wsIconify(wsWindow *win); -void wsRaiseWindowTop(Display *display, Window Win); -void wsSetBackgroundRGB(wsWindow *win, int r, int g, int b); -void wsClearWindow(wsWindow *win); -void wsVisibleWindow(wsWindow *win, int show); +void wsWindowCreate(wsWindow *win, int x, int y, int w, int h, int b, int c, unsigned char p, char *label); +void wsWindowDestroy(wsWindow *win); +void wsWindowMove(wsWindow *win, Bool abs, int x, int y); +void wsWindowMoveWithin(wsWindow *win, Bool abs, int x, int y); +void wsWindowResize(wsWindow *win, int sx, int sy); +void wsWindowIconify(wsWindow *win); +void wsWindowRaiseTop(Display *display, Window Win); +void wsWindowBackground(wsWindow *win, int r, int g, int b); +void wsWindowClear(wsWindow *win); +void wsWindowVisibility(wsWindow *win, int show); void wsWindowDecoration(wsWindow *win, Bool decor); -void wsSetLayer(Display *display, Window Win, Bool fullscreen); -void wsFullScreen(wsWindow *win); -void wsPostRedisplay(wsWindow *win); -void wsSetShape(wsWindow *win, char *data); -void wsSetIcon(Display *display, Window Win, guiIcon_t *icon); +void wsWindowLayer(Display *display, Window Win, Bool fullscreen); +void wsWindowFullscreen(wsWindow *win); +void wsWindowRedraw(wsWindow *win); +void wsWindowShape(wsWindow *win, char *data); +void wsWindowIcon(Display *display, Window Win, guiIcon_t *icon); // ---------------------------------------------------------------------------------------------- // Show / hide mouse cursor. // ---------------------------------------------------------------------------------------------- -void wsVisibleMouse(wsWindow *win, int m); +void wsMouseVisibility(wsWindow *win, int m); // ---------------------------------------------------------------------------------------------- // Image handling // ---------------------------------------------------------------------------------------------- -void wsCreateImage(wsWindow *win, int Width, int Height); -void wsConvert(wsWindow *win, unsigned char *Image); -void wsPutImage(wsWindow *win); -void wsResizeImage(wsWindow *win, int Width, int Height); -void wsDestroyImage(wsWindow *win); +void wsImageCreate(wsWindow *win, int Width, int Height); +void wsImageConvert(wsWindow *win, unsigned char *Image); +void wsImageDraw(wsWindow *win); +void wsImageResize(wsWindow *win, int Width, int Height); +void wsImageDestroy(wsWindow *win); #endif /* MPLAYER_GUI_WS_H */