[MPlayer-cvslog] r35756 - in trunk/gui: skin/skin.c util/bitmap.c wm/ws.c

ib subversion at mplayerhq.hu
Tue Jan 15 23:10:59 CET 2013


Author: ib
Date: Tue Jan 15 23:10:59 2013
New Revision: 35756

Log:
Relocate some functions.

This is mainly for cosmetic reasons.

Modified:
   trunk/gui/skin/skin.c
   trunk/gui/util/bitmap.c
   trunk/gui/wm/ws.c

Modified: trunk/gui/skin/skin.c
==============================================================================
--- trunk/gui/skin/skin.c	Tue Jan 15 20:12:02 2013	(r35755)
+++ trunk/gui/skin/skin.c	Tue Jan 15 23:10:59 2013	(r35756)
@@ -126,39 +126,6 @@ static int in_window(char *name)
 }
 
 /**
- * @brief Read a skin @a image file.
- *
- * @param fname filename (with path)
- * @param img pointer suitable to store the image data
- *
- * @return return code of #bpRead()
- */
-int skinImageRead(char *fname, guiImage *img)
-{
-    int i = bpRead(fname, img);
-
-    switch (i) {
-    case -1:
-        skin_error(MSGTR_SKIN_BITMAP_16bit, fname);
-        break;
-
-    case -2:
-        skin_error(MSGTR_SKIN_BITMAP_FileNotFound, fname);
-        break;
-
-    case -5:
-        skin_error(MSGTR_SKIN_BITMAP_PNGReadError, fname);
-        break;
-
-    case -8:
-        skin_error(MSGTR_SKIN_BITMAP_ConversionError, fname);
-        break;
-    }
-
-    return i;
-}
-
-/**
  * @brief Get next free item in current @a window.
  *
  * @return pointer to next free item (ok) or NULL (error)
@@ -1000,6 +967,39 @@ static _item skinItem[] = {
 };
 
 /**
+ * @brief Read a skin @a image file.
+ *
+ * @param fname filename (with path)
+ * @param img pointer suitable to store the image data
+ *
+ * @return return code of #bpRead()
+ */
+int skinImageRead(char *fname, guiImage *img)
+{
+    int i = bpRead(fname, img);
+
+    switch (i) {
+    case -1:
+        skin_error(MSGTR_SKIN_BITMAP_16bit, fname);
+        break;
+
+    case -2:
+        skin_error(MSGTR_SKIN_BITMAP_FileNotFound, fname);
+        break;
+
+    case -5:
+        skin_error(MSGTR_SKIN_BITMAP_PNGReadError, fname);
+        break;
+
+    case -8:
+        skin_error(MSGTR_SKIN_BITMAP_ConversionError, fname);
+        break;
+    }
+
+    return i;
+}
+
+/**
  * @brief Build the skin file path for a skin name.
  *
  * @param dir skins directory

Modified: trunk/gui/util/bitmap.c
==============================================================================
--- trunk/gui/util/bitmap.c	Tue Jan 15 20:12:02 2013	(r35755)
+++ trunk/gui/util/bitmap.c	Tue Jan 15 23:10:59 2013	(r35756)
@@ -37,6 +37,32 @@
 #include "mp_msg.h"
 
 /**
+ * @brief Check whether a (PNG) file exists.
+ *
+ * @param fname filename (with path, but may lack extension)
+ *
+ * @return path including extension (ok) or NULL (not accessible)
+ */
+static const char *fExist(const char *fname)
+{
+    static const char ext[][4] = { "png", "PNG" };
+    static char buf[512];
+    unsigned int i;
+
+    if (access(fname, R_OK) == 0)
+        return fname;
+
+    for (i = 0; i < FF_ARRAY_ELEMS(ext); i++) {
+        snprintf(buf, sizeof(buf), "%s.%s", fname, ext[i]);
+
+        if (access(buf, R_OK) == 0)
+            return buf;
+    }
+
+    return NULL;
+}
+
+/**
  * @brief Read and decode a PNG file into bitmap data.
  *
  * @param fname filename (with path)
@@ -201,32 +227,6 @@ static int convert_ARGB(guiImage *img)
 }
 
 /**
- * @brief Check whether a (PNG) file exists.
- *
- * @param fname filename (with path, but may lack extension)
- *
- * @return path including extension (ok) or NULL (not accessible)
- */
-static const char *fExist(const char *fname)
-{
-    static const char ext[][4] = { "png", "PNG" };
-    static char buf[512];
-    unsigned int i;
-
-    if (access(fname, R_OK) == 0)
-        return fname;
-
-    for (i = 0; i < FF_ARRAY_ELEMS(ext); i++) {
-        snprintf(buf, sizeof(buf), "%s.%s", fname, ext[i]);
-
-        if (access(buf, R_OK) == 0)
-            return buf;
-    }
-
-    return NULL;
-}
-
-/**
  * @brief Read a PNG file.
  *
  * @param fname filename (with path, but may lack extension)

Modified: trunk/gui/wm/ws.c
==============================================================================
--- trunk/gui/wm/ws.c	Tue Jan 15 20:12:02 2013	(r35755)
+++ trunk/gui/wm/ws.c	Tue Jan 15 23:10:59 2013	(r35756)
@@ -110,17 +110,6 @@ unsigned long wsKeyTable[512];
 int wsUseXShm   = True;
 int wsUseXShape = True;
 
-static int wsSearch(Window win)
-{
-    int i;
-
-    for (i = 0; i < wsWLCount; i++)
-        if (wsWindowList[i] && wsWindowList[i]->WindowID == win)
-            return i;
-
-    return -1;
-}
-
 /* --- */
 
 #define PACK_RGB16(r, g, b, pixel) pixel = (b >> 3); \
@@ -168,25 +157,6 @@ enum PixelFormat out_pix_fmt = PIX_FMT_N
 
 #define MWM_TEAROFF_WINDOW      (1L << 0)
 
-void wsWindowDecoration(wsWindow *win, Bool decor)
-{
-    wsMotifHints = XInternAtom(wsDisplay, "_MOTIF_WM_HINTS", 0);
-
-    if (wsMotifHints == None)
-        return;
-
-    memset(&wsMotifWmHints, 0, sizeof(MotifWmHints));
-    wsMotifWmHints.flags = MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS;
-
-    if (decor) {
-        wsMotifWmHints.functions   = MWM_FUNC_MOVE | MWM_FUNC_CLOSE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE | MWM_FUNC_RESIZE;
-        wsMotifWmHints.decorations = MWM_DECOR_ALL;
-    }
-
-    XChangeProperty(wsDisplay, win->WindowID, wsMotifHints, wsMotifHints, 32,
-                    PropModeReplace, (unsigned char *)&wsMotifWmHints, 5);
-}
-
 // ----------------------------------------------------------------------------------------------
 //   Init X Window System.
 // ----------------------------------------------------------------------------------------------
@@ -688,6 +658,36 @@ void wsCreateWindow(wsWindow *win, int x
     mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[ws] window is created. ( %s ).\n", label);
 }
 
+void wsWindowDecoration(wsWindow *win, Bool decor)
+{
+    wsMotifHints = XInternAtom(wsDisplay, "_MOTIF_WM_HINTS", 0);
+
+    if (wsMotifHints == None)
+        return;
+
+    memset(&wsMotifWmHints, 0, sizeof(MotifWmHints));
+    wsMotifWmHints.flags = MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS;
+
+    if (decor) {
+        wsMotifWmHints.functions   = MWM_FUNC_MOVE | MWM_FUNC_CLOSE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE | MWM_FUNC_RESIZE;
+        wsMotifWmHints.decorations = MWM_DECOR_ALL;
+    }
+
+    XChangeProperty(wsDisplay, win->WindowID, wsMotifHints, wsMotifHints, 32,
+                    PropModeReplace, (unsigned char *)&wsMotifWmHints, 5);
+}
+
+static int wsSearch(Window win)
+{
+    int i;
+
+    for (i = 0; i < wsWLCount; i++)
+        if (wsWindowList[i] && wsWindowList[i]->WindowID == win)
+            return i;
+
+    return -1;
+}
+
 void wsDestroyWindow(wsWindow *win)
 {
     int l;


More information about the MPlayer-cvslog mailing list