diff --git a/src/Makefile.am b/src/Makefile.am index 9c77bb41..a205c4d1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -56,6 +56,7 @@ wmaker_SOURCES = \ pixmap.c \ pixmap.h \ placement.c \ + placement.h \ properties.c \ properties.h \ resources.c \ diff --git a/src/actions.c b/src/actions.c index 65218707..207ce4f6 100644 --- a/src/actions.c +++ b/src/actions.c @@ -46,6 +46,7 @@ #include "workspace.h" #include "xinerama.h" #include "usermenu.h" +#include "placement.h" /****** Global Variables ******/ @@ -55,7 +56,6 @@ extern Time LastFocusChange; extern WPreferences wPreferences; extern Atom _XA_WM_TAKE_FOCUS; extern void ProcessPendingEvents(); -extern int calcIntersectionLength(int p1, int l1, int p2, int l2); static void find_Maximus_geometry(WWindow *wwin, WArea usableArea, int *new_x, int *new_y, unsigned int *new_width, unsigned int *new_height); diff --git a/src/appicon.c b/src/appicon.c index 573344c2..322ee619 100644 --- a/src/appicon.c +++ b/src/appicon.c @@ -47,6 +47,7 @@ #include "dialog.h" #include "xinerama.h" #include "client.h" +#include "placement.h" #ifdef XDND #include "xdnd.h" #endif diff --git a/src/dock.c b/src/dock.c index 21d6aeec..0140bd19 100644 --- a/src/dock.c +++ b/src/dock.c @@ -54,6 +54,7 @@ #include "framewin.h" #include "superfluous.h" #include "xinerama.h" +#include "placement.h" /**** Local variables ****/ #define CLIP_REWIND 1 diff --git a/src/funcs.h b/src/funcs.h index 0d063b03..3902d0b6 100644 --- a/src/funcs.h +++ b/src/funcs.h @@ -40,12 +40,9 @@ void OpenWindowMenu2(WWindow *wwin, int x, int y, int keyboard); void OpenMiniwindowMenu(WWindow *wwin, int x, int y); void CloseWindowMenu(WScreen *scr); void DestroyWindowMenu(WScreen *scr); -void PlaceIcon(WScreen *scr, int *x_ret, int *y_ret, int head); 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 PlaceWindow(WWindow *wwin, int *x_ret, int *y_ret, - unsigned int width, unsigned int height); void ParseWindowName(WMPropList *value, char **winstance, char **wclass, char *where); @@ -60,9 +57,6 @@ WMagicNumber wAddDeathHandler(pid_t pid, WDeathHandler *callback, void *cdata); Pixmap LoadIcon(WScreen *scr, char *path, char *mask, int title_height); -int calcIntersectionArea(int x1, int y1, int w1, int h1, - int x2, int y2, int w2, int h2); - char * StrConcatDot(char *a, char *b); char * ExpandOptions(WScreen *scr, char *cmdline); char * ShrinkString(WMFont *font, char *string, int width); diff --git a/src/placement.h b/src/placement.h new file mode 100644 index 00000000..5f7a907f --- /dev/null +++ b/src/placement.h @@ -0,0 +1,34 @@ +/* placement.h - window and icon placement on screen + * + * 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. + */ + +void PlaceIcon(WScreen *scr, int *x_ret, int *y_ret, int head); + +/* Computes the intersecting length of two line sections */ +int calcIntersectionLength(int p1, int l1, int p2, int l2); + +/* Computes the intersecting area of two rectangles */ +int calcIntersectionArea(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2); + +void PlaceWindow(WWindow *wwin, int *x_ret, int *y_ret, unsigned width, unsigned height); + +/* Set the points x and y inside the screen */ +void get_right_position_on_screen(WScreen *scr, int *x, int *y, int size_x, int size_y); diff --git a/src/window.c b/src/window.c index affafcfb..c227b4cd 100644 --- a/src/window.c +++ b/src/window.c @@ -60,6 +60,7 @@ #include "appicon.h" #include "superfluous.h" #include "rootmenu.h" +#include "placement.h" #ifdef MWM_HINTS # include "motif.h" diff --git a/src/xinerama.c b/src/xinerama.c index 4bd9ca44..f9fe31e7 100644 --- a/src/xinerama.c +++ b/src/xinerama.c @@ -25,7 +25,7 @@ #include "screen.h" #include "window.h" #include "framewin.h" -#include "funcs.h" +#include "placement.h" #ifdef XINERAMA # ifdef SOLARIS_XINERAMA /* sucks */