[MPlayer-cvslog] r35725 - in trunk/gui/wm: ws.c ws.h wsxdnd.c wsxdnd.h

ib subversion at mplayerhq.hu
Thu Jan 10 12:55:27 CET 2013


Author: ib
Date: Thu Jan 10 12:55:27 2013
New Revision: 35725

Log:
Cosmetic: Harmonize parameter names.

Use 'display' for Display pointers, 'Win' for Window
and 'win' for wsTWindow pointers.

Modified:
   trunk/gui/wm/ws.c
   trunk/gui/wm/ws.h
   trunk/gui/wm/wsxdnd.c
   trunk/gui/wm/wsxdnd.h

Modified: trunk/gui/wm/ws.c
==============================================================================
--- trunk/gui/wm/ws.c	Thu Jan 10 12:24:36 2013	(r35724)
+++ trunk/gui/wm/ws.c	Thu Jan 10 12:55:27 2013	(r35725)
@@ -240,15 +240,14 @@ static void wsUpdateXineramaInfo(wsTWind
     }
 }
 
-void wsXInit(Display *mDisplay)
+void wsXInit(Display *display)
 {
     int eventbase;
     int errorbase;
 
     mp_msg(MSGT_GPLAYER, MSGL_V, "X init.\n");
 
-    // NOTE TO MYSELF: Use global mDisplay, get rid of wsDisplay.
-    wsDisplay = mDisplay;
+    wsDisplay = display;
 
     XSetErrorHandler(wsErrorHandler);
 
@@ -969,9 +968,9 @@ void wsMainLoop(void)
 #define WIN_LAYER_NORMAL                 4
 #define WIN_LAYER_ONTOP                 10
 
-void wsSetLayer(Display *wsDisplay, Window win, int layer)
+void wsSetLayer(Display *display, Window Win, int layer)
 {
-    vo_x11_setlayer(wsDisplay, win, layer);
+    vo_x11_setlayer(display, Win, layer);
 }
 
 /**
@@ -1230,13 +1229,13 @@ void wsIconify(wsTWindow *win)
 /**
  * @brief Map a window and raise it to the top.
  *
- * @param dpy display
- * @param win window
+ * @param display display
+ * @param Win window
  */
-void wsRaiseWindowTop(Display *dpy, Window win)
+void wsRaiseWindowTop(Display *display, Window Win)
 {
-    XMapRaised(dpy, win);
-    XRaiseWindow(dpy, win);
+    XMapRaised(display, Win);
+    XRaiseWindow(display, Win);
 }
 
 // ----------------------------------------------------------------------------------------------
@@ -1551,18 +1550,18 @@ void wsSetShape(wsTWindow *win, char *da
  *        This function sets the X icon hint as well as
  *        the properties KWM_WIN_ICON and _NET_WM_ICON.
  *
- * @param dpy display
- * @param win window
+ * @param display display
+ * @param Win window
  * @param icon pointer to the icons
  */
-void wsSetIcon(Display *dpy, Window win, guiIcon_t *icon)
+void wsSetIcon(Display *display, Window Win, guiIcon_t *icon)
 {
     XWMHints *wm;
     Atom iconatom;
     long data[2];
 
     if (icon->normal) {
-        wm = XGetWMHints(dpy, win);
+        wm = XGetWMHints(display, Win);
 
         if (!wm)
             wm = XAllocWMHints();
@@ -1571,20 +1570,20 @@ void wsSetIcon(Display *dpy, Window win,
         wm->icon_mask   = icon->normal_mask;
         wm->flags      |= IconPixmapHint | IconMaskHint;
 
-        XSetWMHints(dpy, win, wm);
+        XSetWMHints(display, Win, wm);
         XFree(wm);
     }
 
     if (icon->small || icon->normal) {
-        iconatom = XInternAtom(dpy, "KWM_WIN_ICON", False);
+        iconatom = XInternAtom(display, "KWM_WIN_ICON", False);
         data[0]  = (icon->small ? icon->small : icon->normal);
         data[1]  = (icon->small ? icon->small_mask : icon->normal_mask);
 
-        XChangeProperty(dpy, win, iconatom, iconatom, 32, PropModeReplace, (unsigned char *)data, 2);
+        XChangeProperty(display, Win, iconatom, iconatom, 32, PropModeReplace, (unsigned char *)data, 2);
     }
 
     if (icon->collection) {
-        iconatom = XInternAtom(dpy, "_NET_WM_ICON", False);
-        XChangeProperty(dpy, win, iconatom, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)icon->collection, icon->collection_size);
+        iconatom = XInternAtom(display, "_NET_WM_ICON", False);
+        XChangeProperty(display, Win, iconatom, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)icon->collection, icon->collection_size);
     }
 }

Modified: trunk/gui/wm/ws.h
==============================================================================
--- trunk/gui/wm/ws.h	Thu Jan 10 12:24:36 2013	(r35724)
+++ trunk/gui/wm/ws.h	Thu Jan 10 12:55:27 2013	(r35725)
@@ -213,7 +213,7 @@ extern int wsUseXShm;
 extern unsigned long wsKeyTable[512];
 
 void wsXDone(void);
-void wsXInit(Display *disp);
+void wsXInit(Display *display);
 
 int wsGetDepthOnScreen(void);
 
@@ -237,7 +237,7 @@ void wsMoveWindow(wsTWindow *win, Bool a
 void wsMoveWindowWithin(wsTWindow *win, Bool abs, int x, int y);
 void wsResizeWindow(wsTWindow *win, int sx, int sy);
 void wsIconify(wsTWindow *win);
-void wsRaiseWindowTop(Display *dpy, Window win);
+void wsRaiseWindowTop(Display *display, Window Win);
 void wsSetBackground(wsTWindow *win, int color);
 void wsSetForegroundRGB(wsTWindow *win, int r, int g, int b);
 void wsSetBackgroundRGB(wsTWindow *win, int r, int g, int b);
@@ -245,11 +245,11 @@ void wsSetBackgroundRGB(wsTWindow *win, 
 void wsSetTitle(wsTWindow *win, char *name);
 void wsVisibleWindow(wsTWindow *win, int show);
 void wsWindowDecoration(wsTWindow *win, Bool decor);
-void wsSetLayer(Display *wsDisplay, Window win, int layer);
+void wsSetLayer(Display *display, Window Win, int layer);
 void wsFullScreen(wsTWindow *win);
 void wsPostRedisplay(wsTWindow *win);
 void wsSetShape(wsTWindow *win, char *data);
-void wsSetIcon(Display *dpy, Window win, guiIcon_t *icon);
+void wsSetIcon(Display *display, Window Win, guiIcon_t *icon);
 
 // ----------------------------------------------------------------------------------------------
 //    Show / hide mouse cursor.

Modified: trunk/gui/wm/wsxdnd.c
==============================================================================
--- trunk/gui/wm/wsxdnd.c	Thu Jan 10 12:24:36 2013	(r35724)
+++ trunk/gui/wm/wsxdnd.c	Thu Jan 10 12:55:27 2013	(r35725)
@@ -61,19 +61,19 @@ void wsXDNDInitialize(void)
     XA_XdndTypeList = XInternAtom(wsDisplay, "XdndTypeList", False);
 }
 
-void wsXDNDMakeAwareness(wsTWindow* window) {
+void wsXDNDMakeAwareness(wsTWindow* win) {
     long int xdnd_version = XDND_VERSION;
-    XChangeProperty (wsDisplay, window->WindowID, XA_XdndAware, XA_ATOM,
+    XChangeProperty (wsDisplay, win->WindowID, XA_XdndAware, XA_ATOM,
             32, PropModeAppend, (char *)&xdnd_version, 1);
 }
 
-void wsXDNDClearAwareness(wsTWindow* window) {
-    XDeleteProperty (wsDisplay, window->WindowID, XA_XdndAware);
+void wsXDNDClearAwareness(wsTWindow* win) {
+    XDeleteProperty (wsDisplay, win->WindowID, XA_XdndAware);
 }
 
 #define MAX_DND_FILES 64
 Bool
-wsXDNDProcessSelection(wsTWindow* wnd, XEvent *event)
+wsXDNDProcessSelection(wsTWindow* win, XEvent *event)
 {
     Atom ret_type;
     int ret_format;
@@ -96,7 +96,7 @@ wsXDNDProcessSelection(wsTWindow* wnd, X
     xevent.xclient.window = selowner;
     xevent.xclient.message_type = XA_XdndFinished;
     xevent.xclient.format = 32;
-    XDND_FINISHED_TARGET_WIN(&xevent) = wnd->WindowID;
+    XDND_FINISHED_TARGET_WIN(&xevent) = win->WindowID;
     XSendEvent(wsDisplay, selowner, 0, 0, &xevent);
 
     if (!delme){
@@ -140,8 +140,8 @@ wsXDNDProcessSelection(wsTWindow* wnd, X
       }
 
       /* Handle the files */
-      if(wnd->DandDHandler){
-	wnd->DandDHandler(num,files);
+      if(win->DandDHandler){
+	win->DandDHandler(num,files);
       }
     }
 

Modified: trunk/gui/wm/wsxdnd.h
==============================================================================
--- trunk/gui/wm/wsxdnd.h	Thu Jan 10 12:24:36 2013	(r35724)
+++ trunk/gui/wm/wsxdnd.h	Thu Jan 10 12:55:27 2013	(r35725)
@@ -22,10 +22,10 @@
 #include "ws.h"
 
 void wsXDNDInitialize(void);
-Bool wsXDNDProcessSelection(wsTWindow* wnd,XEvent *event);
+Bool wsXDNDProcessSelection(wsTWindow* win,XEvent *event);
 Bool wsXDNDProcessClientMessage(XClientMessageEvent *event);
-void wsXDNDMakeAwareness(wsTWindow* window);
-void wsXDNDClearAwareness(wsTWindow* window);
+void wsXDNDMakeAwareness(wsTWindow* win);
+void wsXDNDClearAwareness(wsTWindow* win);
 
 /* header was ripped from xdnd's example on its page */
 


More information about the MPlayer-cvslog mailing list