Mercurial > mplayer.hg
changeset 33529:276eef06fb3d
Store icon data in a struct variable.
This is a preparation for differently sized icons to come.
author | ib |
---|---|
date | Tue, 14 Jun 2011 18:55:04 +0000 |
parents | 6f20f2a42b76 |
children | 7ced3616af42 |
files | gui/interface.c gui/mplayer/play.c gui/mplayer/widgets.c gui/mplayer/widgets.h gui/wm/ws.c gui/wm/ws.h |
diffstat | 6 files changed, 22 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/interface.c Tue Jun 14 18:01:22 2011 +0000 +++ b/gui/interface.c Tue Jun 14 18:55:04 2011 +0000 @@ -295,8 +295,8 @@ btnModify(evSetBalance, guiIntfStruct.Balance); btnModify(evSetMoviePosition, guiIntfStruct.Position); - wsSetIcon(wsDisplay, appMPlayer.mainWindow.WindowID, guiIcon, guiIconMask); - wsSetIcon(wsDisplay, appMPlayer.subWindow.WindowID, guiIcon, guiIconMask); + wsSetIcon(wsDisplay, appMPlayer.mainWindow.WindowID, &guiIcon); + wsSetIcon(wsDisplay, appMPlayer.subWindow.WindowID, &guiIcon); guiIntfStruct.Playing = 0;
--- a/gui/mplayer/play.c Tue Jun 14 18:01:22 2011 +0000 +++ b/gui/mplayer/play.c Tue Jun 14 18:55:04 2011 +0000 @@ -270,7 +270,7 @@ wsCreateWindow(&appMPlayer.mainWindow, appMPlayer.main.x, appMPlayer.main.y, appMPlayer.main.width, appMPlayer.main.height, wsNoBorder, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, wsShowFrame | wsMaxSize | wsHideWindow, "MPlayer"); wsCreateImage(&appMPlayer.mainWindow, appMPlayer.main.Bitmap.Width, appMPlayer.main.Bitmap.Height); wsSetShape(&appMPlayer.mainWindow, appMPlayer.main.Mask.Image); - wsSetIcon(wsDisplay, appMPlayer.mainWindow.WindowID, guiIcon, guiIconMask); + wsSetIcon(wsDisplay, appMPlayer.mainWindow.WindowID, &guiIcon); appMPlayer.mainWindow.ReDraw = (void *)mplMainDraw; appMPlayer.mainWindow.MouseHandler = mplMainMouseHandle;
--- a/gui/mplayer/widgets.c Tue Jun 14 18:01:22 2011 +0000 +++ b/gui/mplayer/widgets.c Tue Jun 14 18:55:04 2011 +0000 @@ -69,8 +69,7 @@ // --- init & close gtk -Pixmap guiIcon; -Pixmap guiIconMask; +guiIcon_t guiIcon; void gtkInit( void ) { @@ -100,14 +99,14 @@ // start up GTK which realizes the pixmaps gtk_main_iteration_do(FALSE); - guiIcon=GDK_PIXMAP_XID( gdkIcon ); - guiIconMask=GDK_PIXMAP_XID( gdkIconMask ); + guiIcon.normal=GDK_PIXMAP_XID( gdkIcon ); + guiIcon.normal_mask=GDK_PIXMAP_XID( gdkIconMask ); gtkInitialized=1; } void gtkAddIcon( GtkWidget * window ) -{ wsSetIcon( gdk_display,GDK_WINDOW_XWINDOW( window->window ),guiIcon,guiIconMask ); } +{ wsSetIcon( gdk_display,GDK_WINDOW_XWINDOW( window->window ),&guiIcon ); } void gtkClearList( GtkWidget * list ) { gtk_clist_clear( GTK_CLIST( list ) ); }
--- a/gui/mplayer/widgets.h Tue Jun 14 18:01:22 2011 +0000 +++ b/gui/mplayer/widgets.h Tue Jun 14 18:55:04 2011 +0000 @@ -23,13 +23,13 @@ #include <stdlib.h> #include <gdk/gdkkeysyms.h> #include <gtk/gtk.h> +#include <X11/Xlib.h> #include "config.h" #include "osdep/shmem.h" #include "play.h" #include "mplayer.h" #include "gui/interface.h" -#include "gui/wm/ws.h" #define GTK_MB_SIMPLE 0 #define GTK_MB_MODAL 1 @@ -53,8 +53,12 @@ extern char * sbMPlayerDirInHome; extern char * sbMPlayerPrefixDir; -extern Pixmap guiIcon; -extern Pixmap guiIconMask; +typedef struct { + Pixmap normal; + Pixmap normal_mask; +} guiIcon_t; + +extern guiIcon_t guiIcon; void widgetsCreate( void );
--- a/gui/wm/ws.c Tue Jun 14 18:01:22 2011 +0000 +++ b/gui/wm/ws.c Tue Jun 14 18:55:04 2011 +0000 @@ -1250,7 +1250,7 @@ #endif } -void wsSetIcon( Display * dsp,Window win,Pixmap icon,Pixmap mask ) +void wsSetIcon( Display * dsp,Window win,guiIcon_t * icon ) { XWMHints * wm; CARD32 data[2]; @@ -1259,14 +1259,14 @@ wm=XGetWMHints( dsp,win ); if ( !wm ) wm=XAllocWMHints(); - wm->icon_pixmap=icon; - wm->icon_mask=mask; + wm->icon_pixmap=icon->normal; + wm->icon_mask=icon->normal_mask; wm->flags|=IconPixmapHint | IconMaskHint; XSetWMHints( dsp,win,wm ); - data[0]=icon; - data[1]=mask; + data[0]=icon->normal; + data[1]=icon->normal_mask; iconatom=XInternAtom( dsp,"KWM_WIN_ICON",0 ); XChangeProperty( dsp,win,iconatom,iconatom,32,PropModeReplace,(unsigned char *)data,2 );
--- a/gui/wm/ws.h Tue Jun 14 18:01:22 2011 +0000 +++ b/gui/wm/ws.h Tue Jun 14 18:55:04 2011 +0000 @@ -22,6 +22,8 @@ #ifndef MPLAYER_GUI_WS_H #define MPLAYER_GUI_WS_H +#include "gui/mplayer/widgets.h" + #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/keysym.h> @@ -243,7 +245,7 @@ void wsFullScreen( wsTWindow * win ); void wsPostRedisplay( wsTWindow * win ); void wsSetShape( wsTWindow * win, char * data ); -void wsSetIcon( Display * dsp, Window win, Pixmap icon, Pixmap mask ); +void wsSetIcon( Display * dsp, Window win, guiIcon_t * icon ); // ---------------------------------------------------------------------------------------------- // Draw string at x,y with fc ( foreground color ) and bc ( background color ).