From 68208a01a0ae6200ef594fc8880430eff6f37882 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Tue, 8 Jan 2013 09:08:26 +0100 Subject: [PATCH] New shutdown.h file 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 ee6dbf90..039a67ba 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 2ac11f3b..ace2a3cf 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 24c6c94b..a7df6cbe 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 51808b0a..f63b1a6e 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 diff --git a/src/rootmenu.c b/src/rootmenu.c index 2fcd0ae9..0b263cd9 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 diff --git a/src/shutdown.c b/src/shutdown.c index d86bd0d7..67c39abd 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 00000000..a88398fe --- /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); -- 2.11.4.GIT