1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

Moving header functions to main.h

The functions of main.c should be included in main.h, not in funcs.h.
This patch adds the main.h file and moves the function prototypes to
this file.

The not needed "include funcs.h" are removed.
This commit is contained in:
Rodolfo García Peñas (kix)
2012-06-24 12:35:24 +02:00
committed by Carlos R. Mafra
parent ebbc5c48ba
commit 6bdc1318c1
15 changed files with 49 additions and 27 deletions

View File

@@ -448,19 +448,12 @@ typedef struct WPreferences {
} flags; /* internal flags */ } flags; /* internal flags */
} WPreferences; } WPreferences;
/****** Global Variables ******/ /****** Global Variables ******/
extern Display *dpy; extern Display *dpy;
extern unsigned int ValidModMask; extern unsigned int ValidModMask;
extern char WProgramState; extern char WProgramState;
extern char WProgramSigState; extern char WProgramSigState;
/****** Global Functions ******/
extern void wAbort(Bool dumpCore);
/****** Notifications ******/ /****** Notifications ******/
extern const char *WMNManaged; extern const char *WMNManaged;
extern const char *WMNUnmanaged; extern const char *WMNUnmanaged;
@@ -477,4 +470,3 @@ extern const char *WMNWorkspaceNameChanged;
extern const char *WMNResetStacking; extern const char *WMNResetStacking;
#endif #endif

View File

@@ -38,7 +38,7 @@
#include "actions.h" #include "actions.h"
#include "stacking.h" #include "stacking.h"
#include "dock.h" #include "dock.h"
#include "funcs.h" #include "main.h"
#include "defaults.h" #include "defaults.h"
#include "workspace.h" #include "workspace.h"
#include "superfluous.h" #include "superfluous.h"

View File

@@ -56,7 +56,7 @@
#include "keybind.h" #include "keybind.h"
#include "xmodifier.h" #include "xmodifier.h"
#include "icon.h" #include "icon.h"
#include "funcs.h" #include "main.h"
#include "actions.h" #include "actions.h"
#include "dock.h" #include "dock.h"
#include "workspace.h" #include "workspace.h"

View File

@@ -45,7 +45,7 @@
#include "dock.h" #include "dock.h"
#include "dockedapp.h" #include "dockedapp.h"
#include "dialog.h" #include "dialog.h"
#include "funcs.h" #include "main.h"
#include "properties.h" #include "properties.h"
#include "menu.h" #include "menu.h"
#include "client.h" #include "client.h"

View File

@@ -54,7 +54,7 @@
#include "window.h" #include "window.h"
#include "actions.h" #include "actions.h"
#include "client.h" #include "client.h"
#include "funcs.h" #include "main.h"
#include "keybind.h" #include "keybind.h"
#include "application.h" #include "application.h"
#include "stacking.h" #include "stacking.h"

View File

@@ -32,9 +32,6 @@ typedef void (WDeathHandler)(pid_t pid, unsigned int status, void *cdata);
void Shutdown(WShutdownMode mode); void Shutdown(WShutdownMode mode);
void RestoreDesktop(WScreen *scr); void RestoreDesktop(WScreen *scr);
void Exit(int status) __attribute__((noreturn));
void Restart(char *manager, Bool abortOnFailure);
void SetupEnvironment(WScreen *scr);
void DispatchEvent(XEvent *event); void DispatchEvent(XEvent *event);
void UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action); void UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action);
void OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard); void OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard);
@@ -52,8 +49,6 @@ void PlaceIcon(WScreen *scr, int *x_ret, int *y_ret, int head);
void StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next, Bool class_only); void StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next, Bool class_only);
void SendHelperMessage(WScreen *scr, char type, int workspace, char *msg); void SendHelperMessage(WScreen *scr, char type, int workspace, char *msg);
void UnescapeWM_CLASS(char *str, char **name, char **class); void UnescapeWM_CLASS(char *str, char **name, char **class);
void ExecuteShellCommand(WScreen *scr, char *command);
void ExecExitScript();
void PlaceWindow(WWindow *wwin, int *x_ret, int *y_ret, void PlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
unsigned int width, unsigned int height); unsigned int width, unsigned int height);
@@ -84,7 +79,6 @@ char * FindImage(char *paths, char *file);
char * GetShortcutString(char *text); char * GetShortcutString(char *text);
char * EscapeWM_CLASS(char *name, char *class); char * EscapeWM_CLASS(char *name, char *class);
Bool RelaunchWindow(WWindow *wwin);
Bool IsDoubleClick(WScreen *scr, XEvent *event); Bool IsDoubleClick(WScreen *scr, XEvent *event);
Bool UpdateDomainFile(WDDomain *domain); Bool UpdateDomainFile(WDDomain *domain);

View File

@@ -485,7 +485,7 @@ void wAbort(Bool dumpCore)
exit(1); exit(1);
} }
void print_help() static void print_help(void)
{ {
printf(_("Usage: %s [options]\n"), ProgName); printf(_("Usage: %s [options]\n"), ProgName);
puts(_("The Window Maker window manager for the X window system")); puts(_("The Window Maker window manager for the X window system"));
@@ -511,7 +511,7 @@ void print_help()
puts(_(" --help show this message")); puts(_(" --help show this message"));
} }
void check_defaults() static void check_defaults(void)
{ {
char *path; char *path;
@@ -537,7 +537,7 @@ void check_defaults()
* files have changed, using linux kernel inotify mechanism * files have changed, using linux kernel inotify mechanism
*/ */
static void inotifyWatchConfig() static void inotifyWatchConfig(void)
{ {
char *watchPath = NULL; char *watchPath = NULL;
inotifyFD = inotify_init(); /* Initialise an inotify instance */ inotifyFD = inotify_init(); /* Initialise an inotify instance */
@@ -563,7 +563,7 @@ static void inotifyWatchConfig()
} }
#endif /* HAVE_INOTIFY */ #endif /* HAVE_INOTIFY */
static void execInitScript() static void execInitScript(void)
{ {
char *file, *paths; char *file, *paths;
@@ -581,7 +581,7 @@ static void execInitScript()
} }
} }
void ExecExitScript() void ExecExitScript(void)
{ {
char *file, *paths; char *file, *paths;

33
src/main.h Normal file
View File

@@ -0,0 +1,33 @@
/*
* Window Maker window manager
*
* Copyright (c) 1997-2003 Alfredo K. Kojima
* Copyright (c) 1998-2003 Dan Pascu
*
* 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.
*/
#ifndef WMMAIN_H_
#define WMMAIN_H_
void Exit(int status) __attribute__((noreturn));
void Restart(char *manager, Bool abortOnFailure);
void SetupEnvironment(WScreen *scr);
void ExecuteShellCommand(WScreen *scr, char *command);
Bool RelaunchWindow(WWindow *wwin);
void wAbort(Bool dumpCore);
void ExecExitScript(void);
#endif

View File

@@ -37,7 +37,7 @@
#include "screen.h" #include "screen.h"
#include "window.h" #include "window.h"
#include "dialog.h" #include "dialog.h"
#include "funcs.h" #include "main.h"
/****** Global Variables ******/ /****** Global Variables ******/
extern WPreferences wPreferences; extern WPreferences wPreferences;

View File

@@ -42,6 +42,7 @@
#include "actions.h" #include "actions.h"
#include "menu.h" #include "menu.h"
#include "funcs.h" #include "funcs.h"
#include "main.h"
#include "dialog.h" #include "dialog.h"
#include "keybind.h" #include "keybind.h"
#include "stacking.h" #include "stacking.h"

View File

@@ -46,6 +46,7 @@
#include "pixmap.h" #include "pixmap.h"
#include "menu.h" #include "menu.h"
#include "funcs.h" #include "funcs.h"
#include "main.h"
#include "actions.h" #include "actions.h"
#include "properties.h" #include "properties.h"
#include "dock.h" #include "dock.h"

View File

@@ -76,7 +76,7 @@
#include "session.h" #include "session.h"
#include "framewin.h" #include "framewin.h"
#include "workspace.h" #include "workspace.h"
#include "funcs.h" #include "main.h"
#include "properties.h" #include "properties.h"
#include "application.h" #include "application.h"
#include "appicon.h" #include "appicon.h"

View File

@@ -31,6 +31,7 @@
#include "window.h" #include "window.h"
#include "client.h" #include "client.h"
#include "funcs.h" #include "funcs.h"
#include "main.h"
#include "properties.h" #include "properties.h"
#include "session.h" #include "session.h"
#include "winspector.h" #include "winspector.h"

View File

@@ -55,7 +55,7 @@
#include "window.h" #include "window.h"
#include "actions.h" #include "actions.h"
#include "client.h" #include "client.h"
#include "funcs.h" #include "main.h"
#include "dock.h" #include "dock.h"
#include "workspace.h" #include "workspace.h"
#include "keybind.h" #include "keybind.h"

View File

@@ -33,7 +33,7 @@
#include "WindowMaker.h" #include "WindowMaker.h"
#include "actions.h" #include "actions.h"
#include "menu.h" #include "menu.h"
#include "funcs.h" #include "main.h"
#include "window.h" #include "window.h"
#include "client.h" #include "client.h"
#include "application.h" #include "application.h"