[MPlayer-cvslog] r38036 - in trunk/gui/win32: gui.c interface.c skinload.c skinload.h

ib subversion at mplayerhq.hu
Wed Apr 4 01:10:39 EEST 2018


Author: ib
Date: Wed Apr  4 01:10:39 2018
New Revision: 38036

Log:
Harmonize Win32 GUI and X11/GTK GUI window types.

Replace the symbolic constants by the X11/GTK GUI's enumeration
constants.

(Now that 0 is a valid window type, set it -1 in case of error.)

Modified:
   trunk/gui/win32/gui.c
   trunk/gui/win32/interface.c
   trunk/gui/win32/skinload.c
   trunk/gui/win32/skinload.h

Modified: trunk/gui/win32/gui.c
==============================================================================
--- trunk/gui/win32/gui.c	Wed Apr  4 00:53:17 2018	(r38035)
+++ trunk/gui/win32/gui.c	Wed Apr  4 01:10:39 2018	(r38036)
@@ -703,7 +703,7 @@ static LRESULT CALLBACK VideoProc(HWND h
                 window *desc = NULL;
 
                 for (i=0; i<gui->skin->windowcount; i++)
-                    if(gui->skin->windows[i]->type == wiVideo)
+                    if(gui->skin->windows[i]->type == wVideo)
                         desc = gui->skin->windows[i];
 
                 SelectObject(hMemDC, get_bitmap(hWnd));
@@ -1491,7 +1491,7 @@ int create_videowindow(gui_t *gui)
     vo_colorkey = 0xff00ff;
 
     for (i=0; i<gui->skin->windowcount; i++)
-        if(gui->skin->windows[i]->type == wiVideo)
+        if(gui->skin->windows[i]->type == wVideo)
             desc = gui->skin->windows[i];
 
     if(!desc)
@@ -1593,7 +1593,7 @@ int create_window(gui_t *gui, char *skin
 
     /* find the description of the mainwindow */
     for (i=0; i<gui->skin->windowcount; i++)
-        if(gui->skin->windows[i]->type == wiMain)
+        if(gui->skin->windows[i]->type == wMain)
             desc = gui->skin->windows[i];
 
     if(!desc)

Modified: trunk/gui/win32/interface.c
==============================================================================
--- trunk/gui/win32/interface.c	Wed Apr  4 00:53:17 2018	(r38035)
+++ trunk/gui/win32/interface.c	Wed Apr  4 01:10:39 2018	(r38036)
@@ -969,7 +969,7 @@ static int update_videowindow(void)
         unsigned int i;
 
         for (i=0; i<mygui->skin->windowcount; i++)
-            if(mygui->skin->windows[i]->type == wiVideo)
+            if(mygui->skin->windows[i]->type == wVideo)
                 desc = mygui->skin->windows[i];
 
         rd.right = rd.left+desc->base->bitmap[0]->width;

Modified: trunk/gui/win32/skinload.c
==============================================================================
--- trunk/gui/win32/skinload.c	Wed Apr  4 00:53:17 2018	(r38035)
+++ trunk/gui/win32/skinload.c	Wed Apr  4 01:10:39 2018	(r38036)
@@ -719,17 +719,21 @@ skin_t* loadskin(char* skindir, int desk
             skin->windows = realloc(skin->windows, sizeof(window *) * skin->windowcount);
             mywindow = skin->windows[(skin->windowcount) - 1] = calloc(1, sizeof(window));
             mywindow->name = strdup(desc + 7);
-            if(!strncmp(desc + 7, "main", 4)) mywindow->type = wiMain;
+            if(!strncmp(desc + 7, "main", 4)) mywindow->type = wMain;
             else if(!strncmp(desc+7, "video", 5) || /* legacy */ !strncmp(desc+7, "sub", 3))
             {
-                mywindow->type = wiVideo;
+                mywindow->type = wVideo;
                 mywindow->decoration = TRUE;
                 // legacy
                 if (desc[7] == 's') skin_legacy("sub", "video");
             }
-            else if(!strncmp(desc + 7, "menu", 4)) mywindow->type = wiMenu;
-            else if(!strncmp(desc + 7, "playbar", 7)) mywindow->type = wiPlaybar;
-            else mp_msg(MSGT_GPLAYER, MSGL_V, "[SKIN] warning found unknown windowtype");
+            else if(!strncmp(desc + 7, "menu", 4)) mywindow->type = wMenu;
+            else if(!strncmp(desc + 7, "playbar", 7)) mywindow->type = wPlaybar;
+            else
+            {
+                mywindow->type = -1;
+                mp_msg(MSGT_GPLAYER, MSGL_V, "[SKIN] warning found unknown windowtype");
+            }
         }
         else if(!strncmp(desc, "decoration", 10) && !strncmp(desc + 11, "enable", 6))
         {

Modified: trunk/gui/win32/skinload.h
==============================================================================
--- trunk/gui/win32/skinload.h	Wed Apr  4 00:53:17 2018	(r38035)
+++ trunk/gui/win32/skinload.h	Wed Apr  4 01:10:39 2018	(r38036)
@@ -128,10 +128,13 @@ skin_t *loadskin(char *skindir, int desk
 
 /* --- Window types --- */
 
-#define wiMain          1
-#define wiVideo         2
-#define wiMenu          3
-#define wiPlaybar       4
+enum
+{
+  wMain,
+  wVideo,
+  wPlaybar,
+  wMenu
+};
 
 /* --- User events --- */
 


More information about the MPlayer-cvslog mailing list