From: "Rodolfo García Peñas (kix)" <[email protected]>
The new shutdown.h file includes the shutdown modes and the functions
to shutdown Window Maker.
The function definitios were moved from funcs.h and the struct WShutdownMode
from WindowMaker.h.
Now, externs are not needed, only include shutdown.h
---
src/WindowMaker.h | 10 ----------
src/event.c | 1 +
src/funcs.h | 2 --
src/main.c | 1 +
src/rootmenu.c | 1 +
src/shutdown.c | 1 +
src/shutdown.h | 31 +++++++++++++++++++++++++++++++
7 files changed, 35 insertions(+), 12 deletions(-)
create mode 100644 src/shutdown.h
diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index 425ae39..051a19a 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -87,16 +87,6 @@ typedef struct WObjDescriptor {
void *parent; /* parent object (WWindow or WMenu) */
} WObjDescriptor;
-
-/* shutdown modes */
-typedef enum {
- WSExitMode,
- WSLogoutMode,
- WSKillMode,
- WSRestartPreparationMode
-} WShutdownMode;
-
-
/* internal buttons */
#define WBUT_CLOSE 0
#define WBUT_BROKENCLOSE 1
diff --git a/src/event.c b/src/event.c
index 830da08..bff3772 100644
--- a/src/event.c
+++ b/src/event.c
@@ -69,6 +69,7 @@
#include "rootmenu.h"
#include "colormap.h"
#include "screen.h"
+#include "shutdown.h"
/******** Global Variables **********/
extern XContext wWinContext;
diff --git a/src/funcs.h b/src/funcs.h
index 24c6c94..a7df6cb 100644
--- a/src/funcs.h
+++ b/src/funcs.h
@@ -30,8 +30,6 @@
typedef void (WCallBack)(void *cdata);
typedef void (WDeathHandler)(pid_t pid, unsigned int status, void *cdata);
-void Shutdown(WShutdownMode mode);
-void RestoreDesktop(WScreen *scr);
void DispatchEvent(XEvent *event);
void UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action);
void OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard);
diff --git a/src/main.c b/src/main.c
index d916547..d23267d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -50,6 +50,7 @@
#include "keybind.h"
#include "xmodifier.h"
#include "session.h"
+#include "shutdown.h"
#include "dialog.h"
#include <WINGs/WUtil.h>
diff --git a/src/rootmenu.c b/src/rootmenu.c
index f7a875a..c1742c8 100644
--- a/src/rootmenu.c
+++ b/src/rootmenu.c
@@ -50,6 +50,7 @@
#include "defaults.h"
#include "framewin.h"
#include "session.h"
+#include "shutdown.h"
#include "xmodifier.h"
#include <WINGs/WUtil.h>
diff --git a/src/shutdown.c b/src/shutdown.c
index d86bd0d..67c39ab 100644
--- a/src/shutdown.c
+++ b/src/shutdown.c
@@ -37,6 +37,7 @@
#include "winspector.h"
#include "wmspec.h"
#include "colormap.h"
+#include "shutdown.h"
extern Atom _XA_WM_DELETE_WINDOW;
extern Time LastTimestamp;
diff --git a/src/shutdown.h b/src/shutdown.h
new file mode 100644
index 0000000..a88398f
--- /dev/null
+++ b/src/shutdown.h
@@ -0,0 +1,31 @@
+/* shutdown.c - Shutdown functions
+ *
+ * Window Maker window manager
+ *
+ * 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.
+ */
+
+/* shutdown modes */
+typedef enum {
+ WSExitMode,
+ WSLogoutMode,
+ WSKillMode,
+ WSRestartPreparationMode
+} WShutdownMode;
+
+void Shutdown(WShutdownMode mode);
+void RestoreDesktop(WScreen *scr);
--
1.7.10.4
--
To unsubscribe, send mail to [email protected].