Mercurial > mplayer.hg
changeset 35662:782461b26312
Relocate some functions.
This is mainly for cosmetic reasons.
author | ib |
---|---|
date | Tue, 15 Jan 2013 22:10:59 +0000 |
parents | 60e8674e38dc |
children | d1f84b219340 |
files | gui/skin/skin.c gui/util/bitmap.c gui/wm/ws.c |
diffstat | 3 files changed, 89 insertions(+), 89 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/skin/skin.c Tue Jan 15 19:12:02 2013 +0000 +++ b/gui/skin/skin.c Tue Jan 15 22:10:59 2013 +0000 @@ -126,39 +126,6 @@ } /** - * @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 @@ }; /** + * @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
--- a/gui/util/bitmap.c Tue Jan 15 19:12:02 2013 +0000 +++ b/gui/util/bitmap.c Tue Jan 15 22:10:59 2013 +0000 @@ -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 @@ } /** - * @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)
--- a/gui/wm/ws.c Tue Jan 15 19:12:02 2013 +0000 +++ b/gui/wm/ws.c Tue Jan 15 22:10:59 2013 +0000 @@ -110,17 +110,6 @@ 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 @@ #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 @@ 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;