>From 0cdf9e44e60b93a03e6b7c5b5eb78ebe1e6745d6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?"Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20(kix)"?= <[email protected]>
Date: Sat, 23 Jun 2012 18:57:08 +0200
Subject: [PATCH] Simplify the header files
Remove the not-used includes that don't need include includes in the
.c files.
The exception rootmenu.h: The file included info not used, and the
important info was in funcs.h. Remove the rootmenu.h stuff and moved
the function definitios from funcs.h, so we need include rootmenu.h
where needed.
---
src/WindowMaker.h | 1 -
src/appicon.h | 4 ----
src/dock.h | 7 -------
src/event.c | 1 +
src/funcs.h | 3 ---
src/icon.h | 2 --
src/menu.c | 1 +
src/properties.h | 2 --
src/rootmenu.c | 10 ----------
src/rootmenu.h | 22 +++-------------------
src/screen.c | 1 +
src/screen.h | 3 ---
src/texture.h | 1 -
src/window.c | 1 +
src/window.h | 3 ---
15 files changed, 7 insertions(+), 55 deletions(-)
diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index 745cd42..165edf9 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -21,7 +21,6 @@
#ifndef WINDOWMAKER_H_
#define WINDOWMAKER_H_
-#include "wconfig.h"
#include <assert.h>
#include <limits.h>
#include <WINGs/WINGs.h>
diff --git a/src/appicon.h b/src/appicon.h
index 1fbd976..7f0c252 100644
--- a/src/appicon.h
+++ b/src/appicon.h
@@ -23,11 +23,7 @@
#ifndef WMAPPICON_H_
#define WMAPPICON_H_
-#include <wraster.h>
-
-#include "window.h"
#include "icon.h"
-#include "application.h"
typedef struct WAppIcon {
short xindex;
diff --git a/src/dock.h b/src/dock.h
index be10095..4a8c2dc 100644
--- a/src/dock.h
+++ b/src/dock.h
@@ -23,10 +23,7 @@
#ifndef WMDOCK_H_
#define WMDOCK_H_
-
#include "appicon.h"
-#include "funcs.h"
-
typedef struct WDock {
WScreen *screen_ptr;
@@ -64,10 +61,6 @@ typedef struct WDock {
struct WDDomain *defaults;
} WDock;
-
-
-
-
WDock *wDockCreate(WScreen *scr, int type);
WDock *wDockRestoreState(WScreen *scr, WMPropList *dock_state, int type);
diff --git a/src/event.c b/src/event.c
index d31ba35..be98466 100644
--- a/src/event.c
+++ b/src/event.c
@@ -66,6 +66,7 @@
#include "balloon.h"
#include "xinerama.h"
#include "wmspec.h"
+#include "rootmenu.h"
/******** Global Variables **********/
extern XContext wWinContext;
diff --git a/src/funcs.h b/src/funcs.h
index 48fd5b3..598f602 100644
--- a/src/funcs.h
+++ b/src/funcs.h
@@ -37,8 +37,6 @@ void Restart(char *manager, Bool abortOnFailure);
void SetupEnvironment(WScreen *scr);
void DispatchEvent(XEvent *event);
void UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action);
-void wRootMenuBindShortcuts(Window window);
-void OpenRootMenu(WScreen *scr, int x, int y, int keyboard);
void OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard);
void InitializeSwitchMenu(void);
void OpenWindowMenu(WWindow *wwin, int x, int y, int keyboard);
@@ -86,7 +84,6 @@ char * FindImage(char *paths, char *file);
char * GetShortcutString(char *text);
char * EscapeWM_CLASS(char *name, char *class);
-Bool wRootMenuPerformShortcut(XEvent *event);
Bool RelaunchWindow(WWindow *wwin);
Bool IsDoubleClick(WScreen *scr, XEvent *event);
Bool UpdateDomainFile(WDDomain *domain);
diff --git a/src/icon.h b/src/icon.h
index 62a1844..23e30e9 100644
--- a/src/icon.h
+++ b/src/icon.h
@@ -22,8 +22,6 @@
#ifndef WMICON_H_
#define WMICON_H_
-#include "wcore.h"
-#include "window.h"
#include "funcs.h"
#define TILE_NORMAL 0
diff --git a/src/menu.c b/src/menu.c
index f438385..6231e06 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -42,6 +42,7 @@
#include "xinerama.h"
#include "workspace.h"
#include "dialog.h"
+#include "rootmenu.h"
/****** Global Variables ******/
diff --git a/src/properties.h b/src/properties.h
index 10c73d2..c54803b 100644
--- a/src/properties.h
+++ b/src/properties.h
@@ -22,8 +22,6 @@
#ifndef WMPROPERTIES_H_
#define WMPROPERTIES_H_
-#include "GNUstep.h"
-
unsigned char* PropGetCheckProperty(Window window, Atom hint, Atom type,
int format, int count, int *retCount);
diff --git a/src/rootmenu.c b/src/rootmenu.c
index c32411d..f3a111e 100644
--- a/src/rootmenu.c
+++ b/src/rootmenu.c
@@ -1615,13 +1615,6 @@ void OpenRootMenu(WScreen * scr, int x, int y, int
keyboard)
{
WMenu *menu = NULL;
WMPropList *definition;
- /*
- static WMPropList *domain=NULL;
-
- if (!domain) {
- domain = WMCreatePLString("WMRootMenu");
- }
- */
scr->flags.root_menu_changed_shortcuts = 0;
scr->flags.added_workspace_menu = 0;
@@ -1644,9 +1637,6 @@ void OpenRootMenu(WScreen * scr, int x, int y, int
keyboard)
definition = WDRootMenu->dictionary;
- /*
- definition = PLGetDomain(domain);
- */
if (definition) {
if (WMIsPLArray(definition)) {
if (!scr->root_menu || WDRootMenu->timestamp >
scr->root_menu->timestamp) {
diff --git a/src/rootmenu.h b/src/rootmenu.h
index e7ed855..3988588 100644
--- a/src/rootmenu.h
+++ b/src/rootmenu.h
@@ -22,23 +22,7 @@
#ifndef WMROOTMENU_H
#define WMROOTMENU_H
-#include "WindowMaker.h"
-
-
-typedef void *WRootMenuData;
-
-
-typedef struct _WRootMenuReader {
- Bool (*checkMenuChange)(char *path, time_t lastAccessTime);
-
- WRootMenuData (*openMenuFile)(char *path);
- Bool (*hasMoreData)(WRootMenuData *data);
- Bool (*nextCommand)(WRootMenuData *data,
- char **title,
- char **command,
- char **parameter,
- char **shortcut);
- void (*closeMenuFile)(WRootMenuData *data);
-} WRootMenuReader;
-
+Bool wRootMenuPerformShortcut(XEvent * event);
+void wRootMenuBindShortcuts(Window window);
+void OpenRootMenu(WScreen * scr, int x, int y, int keyboard);
#endif /* WMROOTMENU_H */
diff --git a/src/screen.c b/src/screen.c
index 27decbd..c9ae4c5 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -55,6 +55,7 @@
#include "balloon.h"
#include "geomview.h"
#include "wmspec.h"
+#include "rootmenu.h"
#include "xinerama.h"
diff --git a/src/screen.h b/src/screen.h
index f021096..b4d1ac6 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -21,10 +21,7 @@
#ifndef WMSCREEN_H_
#define WMSCREEN_H_
-#include "wconfig.h"
#include "WindowMaker.h"
-#include <sys/types.h>
-
#include <WINGs/WUtil.h>
#define WTB_LEFT 0
diff --git a/src/texture.h b/src/texture.h
index 1dbe6db..0ce66c5 100644
--- a/src/texture.h
+++ b/src/texture.h
@@ -22,7 +22,6 @@
#ifndef WMTEXTURE_H_
#define WMTEXTURE_H_
-#include "screen.h"
#include "wcore.h"
/* texture relief */
diff --git a/src/window.c b/src/window.c
index 91ad63f..c7f41d0 100644
--- a/src/window.c
+++ b/src/window.c
@@ -58,6 +58,7 @@
#include "appmenu.h"
#include "appicon.h"
#include "superfluous.h"
+#include "rootmenu.h"
#ifdef MWM_HINTS
# include "motif.h"
diff --git a/src/window.h b/src/window.h
index 28adcc5..39df2f2 100644
--- a/src/window.h
+++ b/src/window.h
@@ -21,9 +21,6 @@
#ifndef WMWINDOW_H_
#define WMWINDOW_H_
-#include <wraster.h>
-
-#include "wconfig.h"
#include "GNUstep.h"
#include "texture.h"
#include "menu.h"
--
1.7.10
--
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/
>From 0cdf9e44e60b93a03e6b7c5b5eb78ebe1e6745d6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?"Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20(kix)"?= <[email protected]>
Date: Sat, 23 Jun 2012 18:57:08 +0200
Subject: [PATCH] Simplify the header files
Remove the not-used includes that don't need include includes in the
.c files.
The exception rootmenu.h: The file included info not used, and the
important info was in funcs.h. Remove the rootmenu.h stuff and moved
the function definitios from funcs.h, so we need include rootmenu.h
where needed.
---
src/WindowMaker.h | 1 -
src/appicon.h | 4 ----
src/dock.h | 7 -------
src/event.c | 1 +
src/funcs.h | 3 ---
src/icon.h | 2 --
src/menu.c | 1 +
src/properties.h | 2 --
src/rootmenu.c | 10 ----------
src/rootmenu.h | 22 +++-------------------
src/screen.c | 1 +
src/screen.h | 3 ---
src/texture.h | 1 -
src/window.c | 1 +
src/window.h | 3 ---
15 files changed, 7 insertions(+), 55 deletions(-)
diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index 745cd42..165edf9 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -21,7 +21,6 @@
#ifndef WINDOWMAKER_H_
#define WINDOWMAKER_H_
-#include "wconfig.h"
#include <assert.h>
#include <limits.h>
#include <WINGs/WINGs.h>
diff --git a/src/appicon.h b/src/appicon.h
index 1fbd976..7f0c252 100644
--- a/src/appicon.h
+++ b/src/appicon.h
@@ -23,11 +23,7 @@
#ifndef WMAPPICON_H_
#define WMAPPICON_H_
-#include <wraster.h>
-
-#include "window.h"
#include "icon.h"
-#include "application.h"
typedef struct WAppIcon {
short xindex;
diff --git a/src/dock.h b/src/dock.h
index be10095..4a8c2dc 100644
--- a/src/dock.h
+++ b/src/dock.h
@@ -23,10 +23,7 @@
#ifndef WMDOCK_H_
#define WMDOCK_H_
-
#include "appicon.h"
-#include "funcs.h"
-
typedef struct WDock {
WScreen *screen_ptr;
@@ -64,10 +61,6 @@ typedef struct WDock {
struct WDDomain *defaults;
} WDock;
-
-
-
-
WDock *wDockCreate(WScreen *scr, int type);
WDock *wDockRestoreState(WScreen *scr, WMPropList *dock_state, int type);
diff --git a/src/event.c b/src/event.c
index d31ba35..be98466 100644
--- a/src/event.c
+++ b/src/event.c
@@ -66,6 +66,7 @@
#include "balloon.h"
#include "xinerama.h"
#include "wmspec.h"
+#include "rootmenu.h"
/******** Global Variables **********/
extern XContext wWinContext;
diff --git a/src/funcs.h b/src/funcs.h
index 48fd5b3..598f602 100644
--- a/src/funcs.h
+++ b/src/funcs.h
@@ -37,8 +37,6 @@ void Restart(char *manager, Bool abortOnFailure);
void SetupEnvironment(WScreen *scr);
void DispatchEvent(XEvent *event);
void UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action);
-void wRootMenuBindShortcuts(Window window);
-void OpenRootMenu(WScreen *scr, int x, int y, int keyboard);
void OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard);
void InitializeSwitchMenu(void);
void OpenWindowMenu(WWindow *wwin, int x, int y, int keyboard);
@@ -86,7 +84,6 @@ char * FindImage(char *paths, char *file);
char * GetShortcutString(char *text);
char * EscapeWM_CLASS(char *name, char *class);
-Bool wRootMenuPerformShortcut(XEvent *event);
Bool RelaunchWindow(WWindow *wwin);
Bool IsDoubleClick(WScreen *scr, XEvent *event);
Bool UpdateDomainFile(WDDomain *domain);
diff --git a/src/icon.h b/src/icon.h
index 62a1844..23e30e9 100644
--- a/src/icon.h
+++ b/src/icon.h
@@ -22,8 +22,6 @@
#ifndef WMICON_H_
#define WMICON_H_
-#include "wcore.h"
-#include "window.h"
#include "funcs.h"
#define TILE_NORMAL 0
diff --git a/src/menu.c b/src/menu.c
index f438385..6231e06 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -42,6 +42,7 @@
#include "xinerama.h"
#include "workspace.h"
#include "dialog.h"
+#include "rootmenu.h"
/****** Global Variables ******/
diff --git a/src/properties.h b/src/properties.h
index 10c73d2..c54803b 100644
--- a/src/properties.h
+++ b/src/properties.h
@@ -22,8 +22,6 @@
#ifndef WMPROPERTIES_H_
#define WMPROPERTIES_H_
-#include "GNUstep.h"
-
unsigned char* PropGetCheckProperty(Window window, Atom hint, Atom type,
int format, int count, int *retCount);
diff --git a/src/rootmenu.c b/src/rootmenu.c
index c32411d..f3a111e 100644
--- a/src/rootmenu.c
+++ b/src/rootmenu.c
@@ -1615,13 +1615,6 @@ void OpenRootMenu(WScreen * scr, int x, int y, int keyboard)
{
WMenu *menu = NULL;
WMPropList *definition;
- /*
- static WMPropList *domain=NULL;
-
- if (!domain) {
- domain = WMCreatePLString("WMRootMenu");
- }
- */
scr->flags.root_menu_changed_shortcuts = 0;
scr->flags.added_workspace_menu = 0;
@@ -1644,9 +1637,6 @@ void OpenRootMenu(WScreen * scr, int x, int y, int keyboard)
definition = WDRootMenu->dictionary;
- /*
- definition = PLGetDomain(domain);
- */
if (definition) {
if (WMIsPLArray(definition)) {
if (!scr->root_menu || WDRootMenu->timestamp > scr->root_menu->timestamp) {
diff --git a/src/rootmenu.h b/src/rootmenu.h
index e7ed855..3988588 100644
--- a/src/rootmenu.h
+++ b/src/rootmenu.h
@@ -22,23 +22,7 @@
#ifndef WMROOTMENU_H
#define WMROOTMENU_H
-#include "WindowMaker.h"
-
-
-typedef void *WRootMenuData;
-
-
-typedef struct _WRootMenuReader {
- Bool (*checkMenuChange)(char *path, time_t lastAccessTime);
-
- WRootMenuData (*openMenuFile)(char *path);
- Bool (*hasMoreData)(WRootMenuData *data);
- Bool (*nextCommand)(WRootMenuData *data,
- char **title,
- char **command,
- char **parameter,
- char **shortcut);
- void (*closeMenuFile)(WRootMenuData *data);
-} WRootMenuReader;
-
+Bool wRootMenuPerformShortcut(XEvent * event);
+void wRootMenuBindShortcuts(Window window);
+void OpenRootMenu(WScreen * scr, int x, int y, int keyboard);
#endif /* WMROOTMENU_H */
diff --git a/src/screen.c b/src/screen.c
index 27decbd..c9ae4c5 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -55,6 +55,7 @@
#include "balloon.h"
#include "geomview.h"
#include "wmspec.h"
+#include "rootmenu.h"
#include "xinerama.h"
diff --git a/src/screen.h b/src/screen.h
index f021096..b4d1ac6 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -21,10 +21,7 @@
#ifndef WMSCREEN_H_
#define WMSCREEN_H_
-#include "wconfig.h"
#include "WindowMaker.h"
-#include <sys/types.h>
-
#include <WINGs/WUtil.h>
#define WTB_LEFT 0
diff --git a/src/texture.h b/src/texture.h
index 1dbe6db..0ce66c5 100644
--- a/src/texture.h
+++ b/src/texture.h
@@ -22,7 +22,6 @@
#ifndef WMTEXTURE_H_
#define WMTEXTURE_H_
-#include "screen.h"
#include "wcore.h"
/* texture relief */
diff --git a/src/window.c b/src/window.c
index 91ad63f..c7f41d0 100644
--- a/src/window.c
+++ b/src/window.c
@@ -58,6 +58,7 @@
#include "appmenu.h"
#include "appicon.h"
#include "superfluous.h"
+#include "rootmenu.h"
#ifdef MWM_HINTS
# include "motif.h"
diff --git a/src/window.h b/src/window.h
index 28adcc5..39df2f2 100644
--- a/src/window.h
+++ b/src/window.h
@@ -21,9 +21,6 @@
#ifndef WMWINDOW_H_
#define WMWINDOW_H_
-#include <wraster.h>
-
-#include "wconfig.h"
#include "GNUstep.h"
#include "texture.h"
#include "menu.h"
--
1.7.10