From: "Rodolfo García Peñas (kix)" <[email protected]>
The file placement.h hold the definitions for placement.c
---
src/Makefile.am | 1 +
src/actions.c | 2 +-
src/appicon.c | 1 +
src/dock.c | 1 +
src/funcs.h | 6 ------
src/placement.h | 34 ++++++++++++++++++++++++++++++++++
src/window.c | 1 +
src/xinerama.c | 2 +-
8 files changed, 40 insertions(+), 8 deletions(-)
create mode 100644 src/placement.h
diff --git a/src/Makefile.am b/src/Makefile.am
index 9c77bb4..a205c4d 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 6521870..207ce4f 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 573344c..322ee61 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 21d6aee..0140bd1 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 0d063b0..3902d0b 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 0000000..5f7a907
--- /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 affafcf..c227b4c 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 4bd9ca4..f9fe31e 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 */
--
1.7.10.4
--
To unsubscribe, send mail to [email protected].