>From a397dce191c54c41d113d0f80a6daaa897d4a86b Mon Sep 17 00:00:00 2001
From: Rodolfo García Peñas (kix) <[email protected]>
Date: Wed, 25 Jan 2012 08:24:45 +0100
Subject: [PATCH 23/24] WindowMaker: More multiple externs removed.

Multiple externs has been removed from the files, creating new files moveres.h, 
placement.h and dockedapp.h to put the shared definitions inside.
---
 src/Makefile.am   |    2 ++
 src/actions.c     |    4 +---
 src/actions.h     |    2 ++
 src/main.c        |    9 +++++----
 src/moveres.c     |    1 +
 src/moveres.h     |    1 +
 src/placement.c   |    5 +----
 src/placement.h   |    1 +
 src/startup.c     |    5 -----
 src/startup.h     |    1 +
 src/superfluous.c |   13 ++-----------
 src/superfluous.h |    6 ++++++
 src/window.c      |    4 +---
 src/workspace.c   |    2 --
 14 files changed, 24 insertions(+), 32 deletions(-)
 create mode 100644 src/moveres.h
 create mode 100644 src/placement.h

diff --git a/src/Makefile.am b/src/Makefile.am
index 14c1eb9..f660170 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -54,9 +54,11 @@ wmaker_SOURCES =     \
        motif.c \
        motif.h \
        moveres.c \
+       moveres.h \
        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 fb88903..7640e26 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -47,11 +47,9 @@
 #include "xinerama.h"
 #include "main.h"
 #include "event.h"
+#include "placement.h"
 
 /****** Global Variables ******/
-int ignore_wks_change = 0;
-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);
 static void save_old_geometry(WWindow *wwin);
diff --git a/src/actions.h b/src/actions.h
index da196ae..1001d18 100644
--- a/src/actions.h
+++ b/src/actions.h
@@ -31,6 +31,8 @@
 #define MAX_IGNORE_XINERAMA    (1 << 5)
 #define MAX_KEYBOARD           (1 << 6)
 
+int ignore_wks_change;
+
 void wSetFocusTo(WScreen *scr, WWindow *wwin);
 
 int wMouseMoveWindow(WWindow *wwin, XEvent *ev);
diff --git a/src/main.c b/src/main.c
index 77887cc..0bf4320 100644
--- a/src/main.c
+++ b/src/main.c
@@ -53,6 +53,8 @@
 #include "session.h"
 #include "dialog.h"
 #include "startup.h"
+#include "actions.h"
+#include "monitor.h"
 
 #include <WINGs/WUtil.h>
 
@@ -63,10 +65,6 @@
 /* general info */
 char *ProgName;
 
-/* special flags */
-char WDelayedActionSet = 0;
-/******** End Global Variables *****/
-
 static char *DisplayName = NULL;
 
 static char **Arguments;
@@ -471,6 +469,9 @@ int main(int argc, char **argv)
        Locale = NULL;
        wScreenCount = 0;
 
+       ignore_wks_change = 0;
+       WDelayedActionSet = 0;
+
        /* setup common stuff for the monitor and wmaker itself */
        WMInitializeApplication("WindowMaker", &argc, argv);
 
diff --git a/src/moveres.c b/src/moveres.c
index f75165c..ceddbda 100644
--- a/src/moveres.c
+++ b/src/moveres.c
@@ -41,6 +41,7 @@
 #include "geomview.h"
 #include "screen.h"
 #include "xinerama.h"
+#include "moveres.h"
 
 #include <WINGs/WINGsP.h>
 
diff --git a/src/moveres.h b/src/moveres.h
new file mode 100644
index 0000000..9f647cd
--- /dev/null
+++ b/src/moveres.h
@@ -0,0 +1 @@
+void InteractivePlaceWindow(WWindow * wwin, int *x_ret, int *y_ret, unsigned 
width, unsigned height);
diff --git a/src/placement.c b/src/placement.c
index 24b1ba3..062be18 100644
--- a/src/placement.c
+++ b/src/placement.c
@@ -38,6 +38,7 @@
 #include "application.h"
 #include "dock.h"
 #include "xinerama.h"
+#include "moveres.h"
 
 #define X_ORIGIN WMAX(usableArea.x1,\
     wPreferences.window_place_origin.x)
@@ -45,10 +46,6 @@
 #define Y_ORIGIN WMAX(usableArea.y1,\
     wPreferences.window_place_origin.y)
 
-/* interactive window placement is in moveres.c */
-extern void InteractivePlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
-                                  unsigned width, unsigned height);
-
 /* Returns True if it is an icon and is in this workspace */
 static Bool
 iconPosition(WCoreWindow *wcore, int sx1, int sy1, int sx2, int sy2,
diff --git a/src/placement.h b/src/placement.h
new file mode 100644
index 0000000..b383843
--- /dev/null
+++ b/src/placement.h
@@ -0,0 +1 @@
+int calcIntersectionLength(int p1, int l1, int p2, int l2);
diff --git a/src/startup.c b/src/startup.c
index 83ba9a5..af803da 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -84,11 +84,6 @@
 # define SA_NODEFER 0
 #endif
 
-#ifndef HAVE_INOTIFY
-/* special flags */
-extern char WDelayedActionSet;
-#endif
-
 /***** Local *****/
 static WScreen **wScreen = NULL;
 static unsigned int _NumLockMask = 0;
diff --git a/src/startup.h b/src/startup.h
index 3b67d0e..9407c09 100644
--- a/src/startup.h
+++ b/src/startup.h
@@ -1 +1,2 @@
 void StartUp(Bool defaultScreenOnly);
+char WDelayedActionSet;
diff --git a/src/superfluous.c b/src/superfluous.c
index 99523df..e8edbae 100644
--- a/src/superfluous.c
+++ b/src/superfluous.c
@@ -32,11 +32,8 @@
 #include <wraster.h>
 
 #include "WindowMaker.h"
-#include "screen.h"
-#include "dock.h"
 #include "superfluous.h"
 #include "framewin.h"
-#include "window.h"
 #include "actions.h"
 #include "xinerama.h"
 #include "stacking.h"
@@ -228,10 +225,9 @@ Pixmap MakeGhostIcon(WScreen * scr, Drawable drawable)
        return pixmap;
 }
 
-#ifdef WINDOW_BIRTH_ZOOM
-
 void DoWindowBirth(WWindow *wwin)
 {
+#ifdef WINDOW_BIRTH_ZOOM
        int center_x, center_y;
        int width = wwin->frame->core->width;
        int height = wwin->frame->core->height;
@@ -243,13 +239,8 @@ void DoWindowBirth(WWindow *wwin)
        center_y = wwin->frame_y + (height - h) / 2;
 
        animateResize(scr, center_x, center_y, 1, 1, wwin->frame_x, 
wwin->frame_y, width, height);
-}
-#else
-void DoWindowBirth(WWindow *wwin)
-{
-       /* dummy stub */
-}
 #endif
+}
 
 #define BOUNCE_HZ      25
 #define BOUNCE_DELAY   (1000/BOUNCE_HZ)
diff --git a/src/superfluous.h b/src/superfluous.h
index d6987ac..788343a 100644
--- a/src/superfluous.h
+++ b/src/superfluous.h
@@ -21,8 +21,14 @@
 #ifndef WMSUPERFLUOUS_H
 #define WMSUPERFLUOUS_H
 
+#include "window.h"
+#include "wconfig.h"
+#include "screen.h"
+#include "dock.h"
+
 #define PIECES ((64/ICON_KABOOM_PIECE_SIZE)*(64/ICON_KABOOM_PIECE_SIZE))
 
+void DoWindowBirth(WWindow *wwin);
 void DoKaboom(WScreen *scr, Window win, int x, int y);
 Pixmap MakeGhostDock(WDock *dock, int sx, int dx, int y);
 Pixmap MakeGhostIcon(WScreen *scr, Drawable drawable);
diff --git a/src/window.c b/src/window.c
index e6385cc..96e8247 100644
--- a/src/window.c
+++ b/src/window.c
@@ -57,6 +57,7 @@
 #include "xinerama.h"
 #include "appmenu.h"
 #include "appicon.h"
+#include "superfluous.h"
 
 #ifdef MWM_HINTS
 # include "motif.h"
@@ -66,9 +67,6 @@
 
 #define MOD_MASK wPreferences.modifier_mask
 
-/* superfluous... */
-extern void DoWindowBirth(WWindow *wwin);
-
 /***** Local Stuff *****/
 static WWindowState *windowState = NULL;
 static FocusMode getFocusMode(WWindow *wwin);
diff --git a/src/workspace.c b/src/workspace.c
index a0606c1..3aa141f 100644
--- a/src/workspace.c
+++ b/src/workspace.c
@@ -53,8 +53,6 @@
 #define MAX_SHORTCUT_LENGTH 32
 #define WORKSPACE_NAME_DISPLAY_PADDING 32
 
-extern int ignore_wks_change;
-
 static WMPropList *dWorkspaces = NULL;
 static WMPropList *dClip, *dName;
 
-- 
1.7.2.3

-- 
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/
>From a397dce191c54c41d113d0f80a6daaa897d4a86b Mon Sep 17 00:00:00 2001
From: Rodolfo García Peñas (kix) <[email protected]>
Date: Wed, 25 Jan 2012 08:24:45 +0100
Subject: [PATCH 23/24] WindowMaker: More multiple externs removed.

Multiple externs has been removed from the files, creating new files moveres.h, placement.h and dockedapp.h to put the shared definitions inside.
---
 src/Makefile.am   |    2 ++
 src/actions.c     |    4 +---
 src/actions.h     |    2 ++
 src/main.c        |    9 +++++----
 src/moveres.c     |    1 +
 src/moveres.h     |    1 +
 src/placement.c   |    5 +----
 src/placement.h   |    1 +
 src/startup.c     |    5 -----
 src/startup.h     |    1 +
 src/superfluous.c |   13 ++-----------
 src/superfluous.h |    6 ++++++
 src/window.c      |    4 +---
 src/workspace.c   |    2 --
 14 files changed, 24 insertions(+), 32 deletions(-)
 create mode 100644 src/moveres.h
 create mode 100644 src/placement.h

diff --git a/src/Makefile.am b/src/Makefile.am
index 14c1eb9..f660170 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -54,9 +54,11 @@ wmaker_SOURCES = 	\
 	motif.c \
 	motif.h \
 	moveres.c \
+	moveres.h \
 	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 fb88903..7640e26 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -47,11 +47,9 @@
 #include "xinerama.h"
 #include "main.h"
 #include "event.h"
+#include "placement.h"
 
 /****** Global Variables ******/
-int ignore_wks_change = 0;
-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);
 static void save_old_geometry(WWindow *wwin);
diff --git a/src/actions.h b/src/actions.h
index da196ae..1001d18 100644
--- a/src/actions.h
+++ b/src/actions.h
@@ -31,6 +31,8 @@
 #define MAX_IGNORE_XINERAMA    (1 << 5)
 #define MAX_KEYBOARD           (1 << 6)
 
+int ignore_wks_change;
+
 void wSetFocusTo(WScreen *scr, WWindow *wwin);
 
 int wMouseMoveWindow(WWindow *wwin, XEvent *ev);
diff --git a/src/main.c b/src/main.c
index 77887cc..0bf4320 100644
--- a/src/main.c
+++ b/src/main.c
@@ -53,6 +53,8 @@
 #include "session.h"
 #include "dialog.h"
 #include "startup.h"
+#include "actions.h"
+#include "monitor.h"
 
 #include <WINGs/WUtil.h>
 
@@ -63,10 +65,6 @@
 /* general info */
 char *ProgName;
 
-/* special flags */
-char WDelayedActionSet = 0;
-/******** End Global Variables *****/
-
 static char *DisplayName = NULL;
 
 static char **Arguments;
@@ -471,6 +469,9 @@ int main(int argc, char **argv)
 	Locale = NULL;
 	wScreenCount = 0;
 
+	ignore_wks_change = 0;
+	WDelayedActionSet = 0;
+
 	/* setup common stuff for the monitor and wmaker itself */
 	WMInitializeApplication("WindowMaker", &argc, argv);
 
diff --git a/src/moveres.c b/src/moveres.c
index f75165c..ceddbda 100644
--- a/src/moveres.c
+++ b/src/moveres.c
@@ -41,6 +41,7 @@
 #include "geomview.h"
 #include "screen.h"
 #include "xinerama.h"
+#include "moveres.h"
 
 #include <WINGs/WINGsP.h>
 
diff --git a/src/moveres.h b/src/moveres.h
new file mode 100644
index 0000000..9f647cd
--- /dev/null
+++ b/src/moveres.h
@@ -0,0 +1 @@
+void InteractivePlaceWindow(WWindow * wwin, int *x_ret, int *y_ret, unsigned width, unsigned height);
diff --git a/src/placement.c b/src/placement.c
index 24b1ba3..062be18 100644
--- a/src/placement.c
+++ b/src/placement.c
@@ -38,6 +38,7 @@
 #include "application.h"
 #include "dock.h"
 #include "xinerama.h"
+#include "moveres.h"
 
 #define X_ORIGIN WMAX(usableArea.x1,\
     wPreferences.window_place_origin.x)
@@ -45,10 +46,6 @@
 #define Y_ORIGIN WMAX(usableArea.y1,\
     wPreferences.window_place_origin.y)
 
-/* interactive window placement is in moveres.c */
-extern void InteractivePlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
-				   unsigned width, unsigned height);
-
 /* Returns True if it is an icon and is in this workspace */
 static Bool
 iconPosition(WCoreWindow *wcore, int sx1, int sy1, int sx2, int sy2,
diff --git a/src/placement.h b/src/placement.h
new file mode 100644
index 0000000..b383843
--- /dev/null
+++ b/src/placement.h
@@ -0,0 +1 @@
+int calcIntersectionLength(int p1, int l1, int p2, int l2);
diff --git a/src/startup.c b/src/startup.c
index 83ba9a5..af803da 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -84,11 +84,6 @@
 # define SA_NODEFER 0
 #endif
 
-#ifndef HAVE_INOTIFY
-/* special flags */
-extern char WDelayedActionSet;
-#endif
-
 /***** Local *****/
 static WScreen **wScreen = NULL;
 static unsigned int _NumLockMask = 0;
diff --git a/src/startup.h b/src/startup.h
index 3b67d0e..9407c09 100644
--- a/src/startup.h
+++ b/src/startup.h
@@ -1 +1,2 @@
 void StartUp(Bool defaultScreenOnly);
+char WDelayedActionSet;
diff --git a/src/superfluous.c b/src/superfluous.c
index 99523df..e8edbae 100644
--- a/src/superfluous.c
+++ b/src/superfluous.c
@@ -32,11 +32,8 @@
 #include <wraster.h>
 
 #include "WindowMaker.h"
-#include "screen.h"
-#include "dock.h"
 #include "superfluous.h"
 #include "framewin.h"
-#include "window.h"
 #include "actions.h"
 #include "xinerama.h"
 #include "stacking.h"
@@ -228,10 +225,9 @@ Pixmap MakeGhostIcon(WScreen * scr, Drawable drawable)
 	return pixmap;
 }
 
-#ifdef WINDOW_BIRTH_ZOOM
-
 void DoWindowBirth(WWindow *wwin)
 {
+#ifdef WINDOW_BIRTH_ZOOM
 	int center_x, center_y;
 	int width = wwin->frame->core->width;
 	int height = wwin->frame->core->height;
@@ -243,13 +239,8 @@ void DoWindowBirth(WWindow *wwin)
 	center_y = wwin->frame_y + (height - h) / 2;
 
 	animateResize(scr, center_x, center_y, 1, 1, wwin->frame_x, wwin->frame_y, width, height);
-}
-#else
-void DoWindowBirth(WWindow *wwin)
-{
-	/* dummy stub */
-}
 #endif
+}
 
 #define BOUNCE_HZ	25
 #define BOUNCE_DELAY	(1000/BOUNCE_HZ)
diff --git a/src/superfluous.h b/src/superfluous.h
index d6987ac..788343a 100644
--- a/src/superfluous.h
+++ b/src/superfluous.h
@@ -21,8 +21,14 @@
 #ifndef WMSUPERFLUOUS_H
 #define WMSUPERFLUOUS_H
 
+#include "window.h"
+#include "wconfig.h"
+#include "screen.h"
+#include "dock.h"
+
 #define PIECES ((64/ICON_KABOOM_PIECE_SIZE)*(64/ICON_KABOOM_PIECE_SIZE))
 
+void DoWindowBirth(WWindow *wwin);
 void DoKaboom(WScreen *scr, Window win, int x, int y);
 Pixmap MakeGhostDock(WDock *dock, int sx, int dx, int y);
 Pixmap MakeGhostIcon(WScreen *scr, Drawable drawable);
diff --git a/src/window.c b/src/window.c
index e6385cc..96e8247 100644
--- a/src/window.c
+++ b/src/window.c
@@ -57,6 +57,7 @@
 #include "xinerama.h"
 #include "appmenu.h"
 #include "appicon.h"
+#include "superfluous.h"
 
 #ifdef MWM_HINTS
 # include "motif.h"
@@ -66,9 +67,6 @@
 
 #define MOD_MASK wPreferences.modifier_mask
 
-/* superfluous... */
-extern void DoWindowBirth(WWindow *wwin);
-
 /***** Local Stuff *****/
 static WWindowState *windowState = NULL;
 static FocusMode getFocusMode(WWindow *wwin);
diff --git a/src/workspace.c b/src/workspace.c
index a0606c1..3aa141f 100644
--- a/src/workspace.c
+++ b/src/workspace.c
@@ -53,8 +53,6 @@
 #define MAX_SHORTCUT_LENGTH 32
 #define WORKSPACE_NAME_DISPLAY_PADDING 32
 
-extern int ignore_wks_change;
-
 static WMPropList *dWorkspaces = NULL;
 static WMPropList *dClip, *dName;
 
-- 
1.7.2.3

Reply via email to