>From a4ba6ae7010944be9095a2c13c45ddfa50cc7a83 Mon Sep 17 00:00:00 2001
From: Rodolfo García Peñas (kix) <[email protected]>
Date: Wed, 25 Jan 2012 07:08:16 +0100
Subject: [PATCH 16/24] WindowMaker: WDDomain struct and variables defined in 
WindowMaker.h

The struct WDDomain and the variables WDWindowMaker, WDWindowAttributes, 
WDRootMenu are defined in WindowMaker.h. Now the externs are not needed.
---
 src/WindowMaker.h |   13 +++++++++++++
 src/application.c |    5 -----
 src/defaults.c    |    3 ---
 src/defaults.h    |   21 ---------------------
 src/dialog.c      |    2 --
 src/main.c        |   10 +++++-----
 src/rootmenu.c    |    1 -
 src/screen.c      |    1 -
 src/startup.c     |    3 ---
 src/wdefaults.c   |    1 -
 src/winspector.c  |    2 --
 11 files changed, 18 insertions(+), 44 deletions(-)

diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index 69539b6..4003aba 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -304,6 +304,14 @@ typedef struct WCoord {
     int x, y;
 } WCoord;
 
+typedef struct WDDomain {
+       char *domain_name;
+       WMPropList *dictionary;
+       char *path;
+       time_t timestamp;
+} WDDomain;
+
+
 typedef struct WPreferences {
     char *pixmap_path;                /* : separated list of paths to find 
pixmaps */
     char *icon_path;                  /* : separated list of paths to find 
icons */
@@ -487,4 +495,9 @@ int randr_event_base;
 Time LastTimestamp;
 Time LastFocusChange;
 
+/* defaults domains */
+WDDomain *WDWindowMaker;
+WDDomain *WDWindowAttributes;
+WDDomain *WDRootMenu;
+
 #endif
diff --git a/src/application.c b/src/application.c
index 863fed7..538f145 100644
--- a/src/application.c
+++ b/src/application.c
@@ -50,11 +50,6 @@
 
 #include "xinerama.h"
 
-/******** Global variables ********/
-extern WDDomain *WDWindowAttributes;
-
-/******** Local variables ********/
-
 static WWindow *makeMainWindow(WScreen * scr, Window window)
 {
        WWindow *wwin;
diff --git a/src/defaults.c b/src/defaults.c
index 2608818..3e421b4 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -69,9 +69,6 @@
 #endif
 
 /***** Global *****/
-extern WDDomain *WDWindowMaker;
-extern WDDomain *WDWindowAttributes;
-extern WDDomain *WDRootMenu;
 extern int wScreenCount;
 extern WShortKey wKeyBindings[WKBD_LAST];
 
diff --git a/src/defaults.h b/src/defaults.h
index 2dcf339..9383fe1 100644
--- a/src/defaults.h
+++ b/src/defaults.h
@@ -21,34 +21,15 @@
 #ifndef WMDEFAULTS_H_
 #define WMDEFAULTS_H_
 
-typedef struct WDDomain {
-    char *domain_name;
-    WMPropList *dictionary;
-    char *path;
-    time_t timestamp;
-} WDDomain;
-
-#if 0
-WMPropList* wDefaultsInit(int screen_number);
-#endif
-
-
 WDDomain* wDefaultsInitDomain(char *domain, Bool requireDictionary);
 
 void wDefaultsMergeGlobalMenus(WDDomain *menuDomain);
-
 void wDefaultsDestroyDomain(WDDomain *domain);
-
 void wReadDefaults(WScreen *scr, WMPropList *new_dict);
-
 void wDefaultUpdateIcons(WScreen *scr);
-
 void wReadStaticDefaults(WMPropList *dict);
-
 void wDefaultsCheckDomains(void *arg);
-
 void wSaveDefaults(WScreen *scr);
-
 char *wDefaultGetIconFile(WScreen *scr, char *instance, char *class,
                           Bool noDefault);
 
@@ -59,8 +40,6 @@ void wDefaultFillAttributes(WScreen *scr, char *instance, 
char *class,
                             Bool useGlobalDefault);
 
 int wDefaultGetStartWorkspace(WScreen *scr, char *instance, char *class);
-
 void wDefaultChangeIcon(WScreen *scr, char *instance, char* class, char *file);
 
 #endif /* WMDEFAULTS_H_ */
-
diff --git a/src/dialog.c b/src/dialog.c
index 286e059..03d59e9 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -1430,8 +1430,6 @@ void wShowLegalPanel(WScreen * scr)
  ***********************************************************************
  */
 
-extern WDDomain *WDWindowAttributes;
-
 typedef struct _CrashPanel {
        WMWindow *win;          /* main window */
 
diff --git a/src/main.c b/src/main.c
index 0969f62..d9ce2a3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -79,11 +79,6 @@ WMPropList *wAttributeDomainName;
 
 WShortKey wKeyBindings[WKBD_LAST];
 
-/* defaults domains */
-WDDomain *WDWindowMaker = NULL;
-WDDomain *WDWindowAttributes = NULL;
-WDDomain *WDRootMenu = NULL;
-
 /* special flags */
 char WDelayedActionSet = 0;
 /******** End Global Variables *****/
@@ -487,6 +482,11 @@ int main(int argc, char **argv)
        /* timestamp on the last time we did XSetInputFocus() */
        LastFocusChange = CurrentTime;
 
+       /* defaults domains */
+       WDWindowMaker = NULL;
+       WDWindowAttributes = NULL;
+       WDRootMenu = NULL;
+
        /* setup common stuff for the monitor and wmaker itself */
        WMInitializeApplication("WindowMaker", &argc, argv);
 
diff --git a/src/rootmenu.c b/src/rootmenu.c
index 0c3f13e..c592cbd 100644
--- a/src/rootmenu.c
+++ b/src/rootmenu.c
@@ -56,7 +56,6 @@
 #define MAX_SHORTCUT_LENGTH 32
 
 extern char *Locale;
-extern WDDomain *WDRootMenu;
 
 static WMenu *readMenuPipe(WScreen * scr, char **file_name);
 static WMenu *readMenuFile(WScreen * scr, char *file_name);
diff --git a/src/screen.c b/src/screen.c
index 5cca7bb..16e600e 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -70,7 +70,6 @@
 
 /**** Global variables ****/
 extern int wScreenCount;
-extern WDDomain *WDWindowMaker;
 
 /**** Local ****/
 #define STIPPLE_WIDTH 2
diff --git a/src/startup.c b/src/startup.c
index 26ccc8f..032ab53 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -83,9 +83,6 @@
 #endif
 
 /****** Global Variables ******/
-extern WDDomain *WDWindowMaker;
-extern WDDomain *WDRootMenu;
-extern WDDomain *WDWindowAttributes;
 extern WShortKey wKeyBindings[WKBD_LAST];
 extern int wScreenCount;
 
diff --git a/src/wdefaults.c b/src/wdefaults.c
index 103e178..b72ddc4 100644
--- a/src/wdefaults.c
+++ b/src/wdefaults.c
@@ -44,7 +44,6 @@
 
 /* Global stuff */
 extern WMPropList *wAttributeDomainName;
-extern WDDomain *WDWindowAttributes;
 
 /* Local stuff */
 
diff --git a/src/winspector.c b/src/winspector.c
index fc55b79..4ded0e2 100644
--- a/src/winspector.c
+++ b/src/winspector.c
@@ -117,8 +117,6 @@ typedef struct InspectorPanel {
        unsigned int choosingIcon:1;
 } InspectorPanel;
 
-extern WDDomain *WDWindowAttributes;
-
 static InspectorPanel *panelList = NULL;
 static WMPropList *ANoTitlebar = NULL;
 static WMPropList *ANoResizebar;
-- 
1.7.2.3

-- 
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/
>From a4ba6ae7010944be9095a2c13c45ddfa50cc7a83 Mon Sep 17 00:00:00 2001
From: Rodolfo García Peñas (kix) <[email protected]>
Date: Wed, 25 Jan 2012 07:08:16 +0100
Subject: [PATCH 16/24] WindowMaker: WDDomain struct and variables defined in WindowMaker.h

The struct WDDomain and the variables WDWindowMaker, WDWindowAttributes, WDRootMenu are defined in WindowMaker.h. Now the externs are not needed.
---
 src/WindowMaker.h |   13 +++++++++++++
 src/application.c |    5 -----
 src/defaults.c    |    3 ---
 src/defaults.h    |   21 ---------------------
 src/dialog.c      |    2 --
 src/main.c        |   10 +++++-----
 src/rootmenu.c    |    1 -
 src/screen.c      |    1 -
 src/startup.c     |    3 ---
 src/wdefaults.c   |    1 -
 src/winspector.c  |    2 --
 11 files changed, 18 insertions(+), 44 deletions(-)

diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index 69539b6..4003aba 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -304,6 +304,14 @@ typedef struct WCoord {
     int x, y;
 } WCoord;
 
+typedef struct WDDomain {
+	char *domain_name;
+	WMPropList *dictionary;
+	char *path;
+	time_t timestamp;
+} WDDomain;
+
+
 typedef struct WPreferences {
     char *pixmap_path;		       /* : separated list of paths to find pixmaps */
     char *icon_path;		       /* : separated list of paths to find icons */
@@ -487,4 +495,9 @@ int randr_event_base;
 Time LastTimestamp;
 Time LastFocusChange;
 
+/* defaults domains */
+WDDomain *WDWindowMaker;
+WDDomain *WDWindowAttributes;
+WDDomain *WDRootMenu;
+
 #endif
diff --git a/src/application.c b/src/application.c
index 863fed7..538f145 100644
--- a/src/application.c
+++ b/src/application.c
@@ -50,11 +50,6 @@
 
 #include "xinerama.h"
 
-/******** Global variables ********/
-extern WDDomain *WDWindowAttributes;
-
-/******** Local variables ********/
-
 static WWindow *makeMainWindow(WScreen * scr, Window window)
 {
 	WWindow *wwin;
diff --git a/src/defaults.c b/src/defaults.c
index 2608818..3e421b4 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -69,9 +69,6 @@
 #endif
 
 /***** Global *****/
-extern WDDomain *WDWindowMaker;
-extern WDDomain *WDWindowAttributes;
-extern WDDomain *WDRootMenu;
 extern int wScreenCount;
 extern WShortKey wKeyBindings[WKBD_LAST];
 
diff --git a/src/defaults.h b/src/defaults.h
index 2dcf339..9383fe1 100644
--- a/src/defaults.h
+++ b/src/defaults.h
@@ -21,34 +21,15 @@
 #ifndef WMDEFAULTS_H_
 #define WMDEFAULTS_H_
 
-typedef struct WDDomain {
-    char *domain_name;
-    WMPropList *dictionary;
-    char *path;
-    time_t timestamp;
-} WDDomain;
-
-#if 0
-WMPropList* wDefaultsInit(int screen_number);
-#endif
-
-
 WDDomain* wDefaultsInitDomain(char *domain, Bool requireDictionary);
 
 void wDefaultsMergeGlobalMenus(WDDomain *menuDomain);
-
 void wDefaultsDestroyDomain(WDDomain *domain);
-
 void wReadDefaults(WScreen *scr, WMPropList *new_dict);
-
 void wDefaultUpdateIcons(WScreen *scr);
-
 void wReadStaticDefaults(WMPropList *dict);
-
 void wDefaultsCheckDomains(void *arg);
-
 void wSaveDefaults(WScreen *scr);
-
 char *wDefaultGetIconFile(WScreen *scr, char *instance, char *class,
                           Bool noDefault);
 
@@ -59,8 +40,6 @@ void wDefaultFillAttributes(WScreen *scr, char *instance, char *class,
                             Bool useGlobalDefault);
 
 int wDefaultGetStartWorkspace(WScreen *scr, char *instance, char *class);
-
 void wDefaultChangeIcon(WScreen *scr, char *instance, char* class, char *file);
 
 #endif /* WMDEFAULTS_H_ */
-
diff --git a/src/dialog.c b/src/dialog.c
index 286e059..03d59e9 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -1430,8 +1430,6 @@ void wShowLegalPanel(WScreen * scr)
  ***********************************************************************
  */
 
-extern WDDomain *WDWindowAttributes;
-
 typedef struct _CrashPanel {
 	WMWindow *win;		/* main window */
 
diff --git a/src/main.c b/src/main.c
index 0969f62..d9ce2a3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -79,11 +79,6 @@ WMPropList *wAttributeDomainName;
 
 WShortKey wKeyBindings[WKBD_LAST];
 
-/* defaults domains */
-WDDomain *WDWindowMaker = NULL;
-WDDomain *WDWindowAttributes = NULL;
-WDDomain *WDRootMenu = NULL;
-
 /* special flags */
 char WDelayedActionSet = 0;
 /******** End Global Variables *****/
@@ -487,6 +482,11 @@ int main(int argc, char **argv)
 	/* timestamp on the last time we did XSetInputFocus() */
 	LastFocusChange = CurrentTime;
 
+	/* defaults domains */
+	WDWindowMaker = NULL;
+	WDWindowAttributes = NULL;
+	WDRootMenu = NULL;
+
 	/* setup common stuff for the monitor and wmaker itself */
 	WMInitializeApplication("WindowMaker", &argc, argv);
 
diff --git a/src/rootmenu.c b/src/rootmenu.c
index 0c3f13e..c592cbd 100644
--- a/src/rootmenu.c
+++ b/src/rootmenu.c
@@ -56,7 +56,6 @@
 #define MAX_SHORTCUT_LENGTH 32
 
 extern char *Locale;
-extern WDDomain *WDRootMenu;
 
 static WMenu *readMenuPipe(WScreen * scr, char **file_name);
 static WMenu *readMenuFile(WScreen * scr, char *file_name);
diff --git a/src/screen.c b/src/screen.c
index 5cca7bb..16e600e 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -70,7 +70,6 @@
 
 /**** Global variables ****/
 extern int wScreenCount;
-extern WDDomain *WDWindowMaker;
 
 /**** Local ****/
 #define STIPPLE_WIDTH 2
diff --git a/src/startup.c b/src/startup.c
index 26ccc8f..032ab53 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -83,9 +83,6 @@
 #endif
 
 /****** Global Variables ******/
-extern WDDomain *WDWindowMaker;
-extern WDDomain *WDRootMenu;
-extern WDDomain *WDWindowAttributes;
 extern WShortKey wKeyBindings[WKBD_LAST];
 extern int wScreenCount;
 
diff --git a/src/wdefaults.c b/src/wdefaults.c
index 103e178..b72ddc4 100644
--- a/src/wdefaults.c
+++ b/src/wdefaults.c
@@ -44,7 +44,6 @@
 
 /* Global stuff */
 extern WMPropList *wAttributeDomainName;
-extern WDDomain *WDWindowAttributes;
 
 /* Local stuff */
 
diff --git a/src/winspector.c b/src/winspector.c
index fc55b79..4ded0e2 100644
--- a/src/winspector.c
+++ b/src/winspector.c
@@ -117,8 +117,6 @@ typedef struct InspectorPanel {
 	unsigned int choosingIcon:1;
 } InspectorPanel;
 
-extern WDDomain *WDWindowAttributes;
-
 static InspectorPanel *panelList = NULL;
 static WMPropList *ANoTitlebar = NULL;
 static WMPropList *ANoResizebar;
-- 
1.7.2.3

Reply via email to