diff --git a/src/actions.c b/src/actions.c index 207ce4f6..3fb3fe62 100644 --- a/src/actions.c +++ b/src/actions.c @@ -47,6 +47,7 @@ #include "xinerama.h" #include "usermenu.h" #include "placement.h" +#include "misc.h" /****** Global Variables ******/ diff --git a/src/appicon.c b/src/appicon.c index 72fb3d00..d6d81648 100644 --- a/src/appicon.c +++ b/src/appicon.c @@ -48,6 +48,7 @@ #include "xinerama.h" #include "client.h" #include "placement.h" +#include "misc.h" #ifdef XDND #include "xdnd.h" #endif diff --git a/src/client.c b/src/client.c index cfe51815..e877229a 100644 --- a/src/client.c +++ b/src/client.c @@ -42,6 +42,7 @@ #include "appicon.h" #include "appmenu.h" #include "wmspec.h" +#include "misc.h" /****** Global Variables ******/ diff --git a/src/defaults.c b/src/defaults.c index 5300a23f..53d81734 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -61,6 +61,7 @@ #include "dock.h" #include "workspace.h" #include "properties.h" +#include "misc.h" #define MAX_SHORTCUT_LENGTH 32 diff --git a/src/dialog.c b/src/dialog.c index 69644958..91a3d830 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -52,7 +52,7 @@ #include "GNUstep.h" #include "screen.h" #include "dialog.h" -#include "funcs.h" +#include "misc.h" #include "stacking.h" #include "framewin.h" #include "window.h" diff --git a/src/dock.c b/src/dock.c index 529b9828..7f277c51 100644 --- a/src/dock.c +++ b/src/dock.c @@ -55,6 +55,7 @@ #include "superfluous.h" #include "xinerama.h" #include "placement.h" +#include "misc.h" /**** Local variables ****/ #define CLIP_REWIND 1 diff --git a/src/dockedapp.c b/src/dockedapp.c index d7fc7b7c..cc592e0d 100644 --- a/src/dockedapp.c +++ b/src/dockedapp.c @@ -33,7 +33,7 @@ #include "dock.h" #include "dockedapp.h" #include "dialog.h" -#include "funcs.h" +#include "misc.h" #include "defaults.h" #include "framewin.h" #include "xinerama.h" diff --git a/src/event.c b/src/event.c index 302497b6..a8f71f7b 100644 --- a/src/event.c +++ b/src/event.c @@ -70,6 +70,7 @@ #include "colormap.h" #include "screen.h" #include "shutdown.h" +#include "misc.h" /******** Global Variables **********/ extern XContext wWinContext; diff --git a/src/framewin.c b/src/framewin.c index fe6a1b29..39f55d6f 100644 --- a/src/framewin.c +++ b/src/framewin.c @@ -39,7 +39,7 @@ #include "wcore.h" #include "framewin.h" #include "stacking.h" -#include "funcs.h" +#include "misc.h" #define DBLCLICK_TIME wPreferences.dblclick_time diff --git a/src/funcs.h b/src/funcs.h index 7fb69581..1863d553 100644 --- a/src/funcs.h +++ b/src/funcs.h @@ -41,11 +41,6 @@ void OpenMiniwindowMenu(WWindow *wwin, int x, int y); void CloseWindowMenu(WScreen *scr); void DestroyWindowMenu(WScreen *scr); void StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next, Bool class_only); -void SendHelperMessage(WScreen *scr, char type, int workspace, char *msg); -void UnescapeWM_CLASS(char *str, char **name, char **class); - -void ParseWindowName(WMPropList *value, char **winstance, char **wclass, - char *where); void wHackedGrabButton(unsigned int button, unsigned int modifiers, Window grab_window, Bool owner_events, @@ -57,24 +52,11 @@ WMagicNumber wAddDeathHandler(pid_t pid, WDeathHandler *callback, void *cdata); Pixmap LoadIcon(WScreen *scr, char *path, char *mask, int title_height); -char * StrConcatDot(char *a, char *b); -char * ExpandOptions(WScreen *scr, char *cmdline); -char * ShrinkString(WMFont *font, char *string, int width); -char * FindImage(char *paths, char *file); -char * GetShortcutString(char *text); -char * GetShortcutKey(WShortKey key); -char * EscapeWM_CLASS(char *name, char *class); - Bool IsDoubleClick(WScreen *scr, XEvent *event); -Bool UpdateDomainFile(WDDomain *domain); WWindow * NextToFocusAfter(WWindow *wwin); WWindow * NextToFocusBefore(WWindow *wwin); -void move_window(Window win, int from_x, int from_y, int to_x, int to_y); -void SlideWindow(Window win, int from_x, int from_y, int to_x, int to_y); -void SlideWindows(Window *wins[], int n, int from_x, int from_y, int to_x, int to_y); - RImage * wGetImageForWindowName(WScreen *scr, char *winstance, char *wclass); #ifdef NUMLOCK_HACK @@ -83,14 +65,6 @@ void wHackedGrabKey(int keycode, unsigned int modifiers, int keyboard_mode); #endif -/****** I18N Wrapper for XFetchName,XGetIconName ******/ - -Bool wFetchName(Display *dpy, Window win, char **winname); -Bool wGetIconName(Display *dpy, Window win, char **iconname); - -/* Free returned string it when done. (applies to the next 2 functions) */ -char * GetCommandForWindow(Window win); - Bool GetCommandForPid(int pid, char ***argv, int *argc); int getWVisualID(int screen); diff --git a/src/icon.c b/src/icon.c index 2d013415..e0ea97ac 100644 --- a/src/icon.c +++ b/src/icon.c @@ -38,12 +38,12 @@ #include "window.h" #include "icon.h" #include "actions.h" -#include "funcs.h" #include "stacking.h" #include "application.h" #include "defaults.h" #include "appicon.h" #include "wmspec.h" +#include "misc.h" /**** Global varianebles ****/ extern WPreferences wPreferences; diff --git a/src/misc.c b/src/misc.c index 32d5659d..ef356083 100644 --- a/src/misc.c +++ b/src/misc.c @@ -38,13 +38,13 @@ #include #include +#include "misc.h" #include "WindowMaker.h" #include "GNUstep.h" #include "screen.h" #include "wcore.h" #include "window.h" #include "framewin.h" -#include "funcs.h" #include "dialog.h" #include "xutil.h" #include "xmodifier.h" @@ -53,6 +53,9 @@ extern WPreferences wPreferences; #define ICON_SIZE wPreferences.icon_size +/**** Local prototypes *****/ +static void UnescapeWM_CLASS(char *str, char **name, char **class); + /* XFetchName Wrapper */ Bool wFetchName(Display *dpy, Window win, char **winname) { @@ -862,7 +865,7 @@ char *EscapeWM_CLASS(char *name, char *class) return ret; } -void UnescapeWM_CLASS(char *str, char **name, char **class) +static void UnescapeWM_CLASS(char *str, char **name, char **class) { int i, j, k, dot; diff --git a/src/misc.h b/src/misc.h new file mode 100644 index 00000000..791bc592 --- /dev/null +++ b/src/misc.h @@ -0,0 +1,45 @@ +/* + * Window Maker window manager + * + * Copyright (c) 1997-2003 Alfredo K. Kojima + * Copyright (c) 2013 Window Maker Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#ifndef WMMISC_H_ +#define WMMISC_H_ + +#include "appicon.h" + + +Bool wFetchName(Display *dpy, Window win, char **winname); +Bool wGetIconName(Display *dpy, Window win, char **iconname); +Bool UpdateDomainFile(WDDomain * domain); + +void move_window(Window win, int from_x, int from_y, int to_x, int to_y); +void SlideWindow(Window win, int from_x, int from_y, int to_x, int to_y); +void SlideWindows(Window *wins[], int n, int from_x, int from_y, int to_x, int to_y); +void ParseWindowName(WMPropList * value, char **winstance, char **wclass, char *where); +void SendHelperMessage(WScreen * scr, char type, int workspace, char *msg); + +char *ShrinkString(WMFont * font, char *string, int width); +char *FindImage(char *paths, char *file); +char *ExpandOptions(WScreen * scr, char *cmdline); +char *GetShortcutString(char *text); +char *GetShortcutKey(WShortKey key); +char *EscapeWM_CLASS(char *name, char *class); +char *StrConcatDot(char *a, char *b); +char *GetCommandForWindow(Window win); +#endif diff --git a/src/rootmenu.c b/src/rootmenu.c index 5b8ff905..db812120 100644 --- a/src/rootmenu.c +++ b/src/rootmenu.c @@ -41,7 +41,7 @@ #include "WindowMaker.h" #include "actions.h" #include "menu.h" -#include "funcs.h" +#include "misc.h" #include "main.h" #include "dialog.h" #include "keybind.h" diff --git a/src/session.c b/src/session.c index 065e769f..c4ba5af0 100644 --- a/src/session.c +++ b/src/session.c @@ -81,6 +81,7 @@ #include "application.h" #include "appicon.h" #include "dock.h" +#include "misc.h" #include diff --git a/src/switchmenu.c b/src/switchmenu.c index 65692527..a890bbbb 100644 --- a/src/switchmenu.c +++ b/src/switchmenu.c @@ -33,7 +33,7 @@ #include "window.h" #include "actions.h" #include "client.h" -#include "funcs.h" +#include "misc.h" #include "stacking.h" #include "workspace.h" #include "framewin.h" diff --git a/src/switchpanel.c b/src/switchpanel.c index fcd61fa0..4ad9b8ce 100644 --- a/src/switchpanel.c +++ b/src/switchpanel.c @@ -31,7 +31,7 @@ #include "window.h" #include "defaults.h" #include "switchpanel.h" -#include "funcs.h" +#include "misc.h" #include "xinerama.h" extern Atom _XA_WM_IGNORE_FOCUS_EVENTS; diff --git a/src/texture.c b/src/texture.c index a29406a3..47258a55 100644 --- a/src/texture.c +++ b/src/texture.c @@ -31,7 +31,7 @@ #include "WindowMaker.h" #include "texture.h" -#include "funcs.h" +#include "misc.h" extern WPreferences wPreferences; diff --git a/src/wdefaults.c b/src/wdefaults.c index ce9af5f8..f71a8ddd 100644 --- a/src/wdefaults.c +++ b/src/wdefaults.c @@ -38,10 +38,10 @@ #include "window.h" #include "appicon.h" #include "screen.h" -#include "funcs.h" #include "workspace.h" #include "defaults.h" #include "icon.h" +#include "misc.h" #define APPLY_VAL(value, flag, attrib) \ if (value) {attr->flag = getBool(attrib, value); \ diff --git a/src/window.c b/src/window.c index c227b4cd..9ac5e78a 100644 --- a/src/window.c +++ b/src/window.c @@ -49,7 +49,6 @@ #include "properties.h" #include "actions.h" #include "client.h" -#include "funcs.h" #include "colormap.h" #include "keybind.h" #include "stacking.h" @@ -61,6 +60,7 @@ #include "superfluous.h" #include "rootmenu.h" #include "placement.h" +#include "misc.h" #ifdef MWM_HINTS # include "motif.h" diff --git a/src/winmenu.c b/src/winmenu.c index 7d49d2b2..aa2bb248 100644 --- a/src/winmenu.c +++ b/src/winmenu.c @@ -38,7 +38,7 @@ #include "client.h" #include "application.h" #include "keybind.h" -#include "funcs.h" +#include "misc.h" #include "framewin.h" #include "workspace.h" #include "winspector.h" diff --git a/src/winspector.c b/src/winspector.c index 08066da0..41d3afb5 100644 --- a/src/winspector.c +++ b/src/winspector.c @@ -35,7 +35,6 @@ #include "framewin.h" #include "window.h" #include "workspace.h" -#include "funcs.h" #include "defaults.h" #include "dialog.h" #include "icon.h" @@ -47,6 +46,7 @@ #include "dock.h" #include "client.h" #include "wmspec.h" +#include "misc.h" #include diff --git a/src/workspace.c b/src/workspace.c index 8b240872..b4cccd0c 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -39,7 +39,7 @@ #include "framewin.h" #include "window.h" #include "icon.h" -#include "funcs.h" +#include "misc.h" #include "menu.h" #include "application.h" #include "dock.h"