mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-22 22:28:02 +01:00
WindowMaker: Header files clean code
Changes:
- Spaces replaced by tabs in the structs
- Removed unused variables:
- has_titlebar, never used
- Functions sort by return type
This commit is contained in:
committed by
Carlos R. Mafra
parent
0db76b822d
commit
1b0ed30b9b
@@ -28,36 +28,26 @@ typedef struct WDDomain {
|
|||||||
time_t timestamp;
|
time_t timestamp;
|
||||||
} WDDomain;
|
} WDDomain;
|
||||||
|
|
||||||
#if 0
|
|
||||||
WMPropList* wDefaultsInit(int screen_number);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
WDDomain * wDefaultsInitDomain(char *domain, Bool requireDictionary);
|
WDDomain * wDefaultsInitDomain(char *domain, Bool requireDictionary);
|
||||||
|
|
||||||
void wDefaultsMergeGlobalMenus(WDDomain *menuDomain);
|
void wDefaultsMergeGlobalMenus(WDDomain *menuDomain);
|
||||||
|
|
||||||
void wReadDefaults(WScreen *scr, WMPropList *new_dict);
|
void wReadDefaults(WScreen *scr, WMPropList *new_dict);
|
||||||
|
|
||||||
void wDefaultUpdateIcons(WScreen *scr);
|
void wDefaultUpdateIcons(WScreen *scr);
|
||||||
|
|
||||||
void wReadStaticDefaults(WMPropList *dict);
|
void wReadStaticDefaults(WMPropList *dict);
|
||||||
|
|
||||||
void wDefaultsCheckDomains(void *arg);
|
void wDefaultsCheckDomains(void *arg);
|
||||||
|
|
||||||
void wSaveDefaults(WScreen *scr);
|
void wSaveDefaults(WScreen *scr);
|
||||||
|
void wDefaultFillAttributes(WScreen *scr, char *instance, char *class,
|
||||||
|
WWindowAttributes *attr, WWindowAttributes *mask,
|
||||||
|
Bool useGlobalDefault);
|
||||||
|
|
||||||
|
|
||||||
char * wDefaultGetIconFile(WScreen *scr, char *instance, char *class,
|
char * wDefaultGetIconFile(WScreen *scr, char *instance, char *class,
|
||||||
Bool noDefault);
|
Bool noDefault);
|
||||||
|
|
||||||
RImage * wDefaultGetImage(WScreen *scr, char *winstance, char *wclass, int max_size);
|
RImage * wDefaultGetImage(WScreen *scr, char *winstance, char *wclass, int max_size);
|
||||||
|
|
||||||
void wDefaultFillAttributes(WScreen *scr, char *instance, char *class,
|
|
||||||
WWindowAttributes *attr, WWindowAttributes *mask,
|
|
||||||
Bool useGlobalDefault);
|
|
||||||
|
|
||||||
int wDefaultGetStartWorkspace(WScreen *scr, char *instance, char *class);
|
int wDefaultGetStartWorkspace(WScreen *scr, char *instance, char *class);
|
||||||
|
|
||||||
void wDefaultChangeIcon(WScreen *scr, char *instance, char* class, char *file);
|
void wDefaultChangeIcon(WScreen *scr, char *instance, char* class, char *file);
|
||||||
|
|
||||||
#endif /* WMDEFAULTS_H_ */
|
#endif /* WMDEFAULTS_H_ */
|
||||||
|
|||||||
117
src/funcs.h
117
src/funcs.h
@@ -28,117 +28,81 @@
|
|||||||
#include "defaults.h"
|
#include "defaults.h"
|
||||||
|
|
||||||
typedef void (WCallBack)(void *cdata);
|
typedef void (WCallBack)(void *cdata);
|
||||||
|
|
||||||
typedef void (WDeathHandler)(pid_t pid, unsigned int status, void *cdata);
|
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 Exit(int status) __attribute__((noreturn));
|
||||||
|
|
||||||
void Restart(char *manager, Bool abortOnFailure);
|
void Restart(char *manager, Bool abortOnFailure);
|
||||||
|
|
||||||
void SetupEnvironment(WScreen *scr);
|
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);
|
||||||
|
|
||||||
Bool wRootMenuPerformShortcut(XEvent *event);
|
|
||||||
|
|
||||||
void wRootMenuBindShortcuts(Window window);
|
void wRootMenuBindShortcuts(Window window);
|
||||||
|
|
||||||
void OpenRootMenu(WScreen *scr, int x, int y, int keyboard);
|
void OpenRootMenu(WScreen *scr, int x, int y, int keyboard);
|
||||||
|
|
||||||
void OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard);
|
void OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard);
|
||||||
|
|
||||||
void InitializeSwitchMenu(void);
|
void InitializeSwitchMenu(void);
|
||||||
|
|
||||||
void OpenWindowMenu(WWindow *wwin, int x, int y, int keyboard);
|
void OpenWindowMenu(WWindow *wwin, int x, int y, int keyboard);
|
||||||
|
|
||||||
void OpenWindowMenu2(WWindow *wwin, int x, int y, int keyboard);
|
void OpenWindowMenu2(WWindow *wwin, int x, int y, int keyboard);
|
||||||
|
|
||||||
void OpenMiniwindowMenu(WWindow *wwin, int x, int y);
|
void OpenMiniwindowMenu(WWindow *wwin, int x, int y);
|
||||||
|
|
||||||
void CloseWindowMenu(WScreen *scr);
|
void CloseWindowMenu(WScreen *scr);
|
||||||
|
|
||||||
void DestroyWindowMenu(WScreen *scr);
|
void DestroyWindowMenu(WScreen *scr);
|
||||||
|
|
||||||
WMagicNumber wAddDeathHandler(pid_t pid, WDeathHandler *callback, void *cdata);
|
|
||||||
|
|
||||||
void wColormapInstallForWindow(WScreen *scr, WWindow *wwin);
|
void wColormapInstallForWindow(WScreen *scr, WWindow *wwin);
|
||||||
|
|
||||||
void wColormapInstallRoot(WScreen *scr);
|
void wColormapInstallRoot(WScreen *scr);
|
||||||
|
|
||||||
void wColormapUninstallRoot(WScreen *scr);
|
void wColormapUninstallRoot(WScreen *scr);
|
||||||
|
|
||||||
void wColormapAllowClientInstallation(WScreen *scr, Bool starting);
|
void wColormapAllowClientInstallation(WScreen *scr, Bool starting);
|
||||||
|
|
||||||
Pixmap LoadIcon(WScreen *scr, char *path, char *mask, int title_height);
|
|
||||||
|
|
||||||
void PlaceIcon(WScreen *scr, int *x_ret, int *y_ret, int head);
|
void PlaceIcon(WScreen *scr, int *x_ret, int *y_ret, int head);
|
||||||
|
void StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next, Bool class_only);
|
||||||
int calcIntersectionArea(int x1, int y1, int w1, int h1,
|
void SendHelperMessage(WScreen *scr, char type, int workspace, char *msg);
|
||||||
int x2, int y2, int w2, int h2);
|
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);
|
||||||
|
|
||||||
|
|
||||||
void StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next, Bool class_only);
|
|
||||||
|
|
||||||
#ifdef USECPP
|
|
||||||
char *MakeCPPArgs(char *path);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
char *StrConcatDot(char *a, char *b);
|
|
||||||
|
|
||||||
char *ExpandOptions(WScreen *scr, char *cmdline);
|
|
||||||
|
|
||||||
void ExecuteShellCommand(WScreen *scr, char *command);
|
|
||||||
|
|
||||||
Bool RelaunchWindow(WWindow *wwin);
|
|
||||||
|
|
||||||
Bool IsDoubleClick(WScreen *scr, XEvent *event);
|
|
||||||
|
|
||||||
WWindow *NextToFocusAfter(WWindow *wwin);
|
|
||||||
WWindow *NextToFocusBefore(WWindow *wwin);
|
|
||||||
|
|
||||||
void SlideWindow(Window win, int from_x, int from_y, int to_x, int to_y);
|
|
||||||
|
|
||||||
char *ShrinkString(WMFont *font, char *string, int width);
|
|
||||||
|
|
||||||
char *FindImage(char *paths, char *file);
|
|
||||||
|
|
||||||
RImage*wGetImageForWindowName(WScreen *scr, char *winstance, char *wclass);
|
|
||||||
|
|
||||||
void ParseWindowName(WMPropList *value, char **winstance, char **wclass,
|
void ParseWindowName(WMPropList *value, char **winstance, char **wclass,
|
||||||
char *where);
|
char *where);
|
||||||
|
|
||||||
void SendHelperMessage(WScreen *scr, char type, int workspace, char *msg);
|
|
||||||
|
|
||||||
char *GetShortcutString(char *text);
|
|
||||||
|
|
||||||
char *EscapeWM_CLASS(char *name, char *class);
|
|
||||||
|
|
||||||
void UnescapeWM_CLASS(char *str, char **name, char **class);
|
|
||||||
|
|
||||||
Bool UpdateDomainFile(WDDomain *domain);
|
|
||||||
|
|
||||||
#ifdef NUMLOCK_HACK
|
|
||||||
void wHackedGrabKey(int keycode, unsigned int modifiers,
|
|
||||||
Window grab_window, Bool owner_events, int pointer_mode,
|
|
||||||
int keyboard_mode);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void wHackedGrabButton(unsigned int button, unsigned int modifiers,
|
void wHackedGrabButton(unsigned int button, unsigned int modifiers,
|
||||||
Window grab_window, Bool owner_events,
|
Window grab_window, Bool owner_events,
|
||||||
unsigned int event_mask, int pointer_mode,
|
unsigned int event_mask, int pointer_mode,
|
||||||
int keyboard_mode, Window confine_to, Cursor cursor);
|
int keyboard_mode, Window confine_to, Cursor cursor);
|
||||||
|
|
||||||
|
WMagicNumber wAddDeathHandler(pid_t pid, WDeathHandler *callback, void *cdata);
|
||||||
|
|
||||||
void ExecExitScript();
|
Pixmap LoadIcon(WScreen *scr, char *path, char *mask, int title_height);
|
||||||
|
|
||||||
|
|
||||||
|
int calcIntersectionArea(int x1, int y1, int w1, int h1,
|
||||||
|
int x2, int y2, int w2, int h2);
|
||||||
|
|
||||||
|
#ifdef USECPP
|
||||||
|
char *MakeCPPArgs(char *path);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
char * StrConcatDot(char *a, char *b);
|
||||||
|
char * ExpandOptions(WScreen *scr, char *cmdline);
|
||||||
|
char * ShrinkString(WMFont *font, char *string, int width);
|
||||||
|
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);
|
||||||
|
|
||||||
|
WWindow * NextToFocusAfter(WWindow *wwin);
|
||||||
|
WWindow * NextToFocusBefore(WWindow *wwin);
|
||||||
|
|
||||||
|
void SlideWindow(Window win, int from_x, int from_y, int to_x, int to_y);
|
||||||
|
|
||||||
|
RImage * wGetImageForWindowName(WScreen *scr, char *winstance, char *wclass);
|
||||||
|
|
||||||
|
#ifdef NUMLOCK_HACK
|
||||||
|
void wHackedGrabKey(int keycode, unsigned int modifiers,
|
||||||
|
Window grab_window, Bool owner_events, int pointer_mode,
|
||||||
|
int keyboard_mode);
|
||||||
|
#endif
|
||||||
|
|
||||||
/****** I18N Wrapper for XFetchName,XGetIconName ******/
|
/****** I18N Wrapper for XFetchName,XGetIconName ******/
|
||||||
|
|
||||||
@@ -152,5 +116,4 @@ char* GetProgramNameForWindow(Window win);
|
|||||||
Bool GetCommandForPid(int pid, char ***argv, int *argc);
|
Bool GetCommandForPid(int pid, char ***argv, int *argc);
|
||||||
|
|
||||||
int getWVisualID(int screen);
|
int getWVisualID(int screen);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
10
src/icon.h
10
src/icon.h
@@ -26,11 +26,9 @@
|
|||||||
#include "window.h"
|
#include "window.h"
|
||||||
#include "funcs.h"
|
#include "funcs.h"
|
||||||
|
|
||||||
|
|
||||||
#define TILE_NORMAL 0
|
#define TILE_NORMAL 0
|
||||||
#define TILE_CLIP 1
|
#define TILE_CLIP 1
|
||||||
|
|
||||||
|
|
||||||
typedef struct WIcon {
|
typedef struct WIcon {
|
||||||
WCoreWindow *core;
|
WCoreWindow *core;
|
||||||
WWindow *owner; /* owner window */
|
WWindow *owner; /* owner window */
|
||||||
@@ -43,7 +41,6 @@ typedef struct WIcon {
|
|||||||
|
|
||||||
unsigned int tile_type:4;
|
unsigned int tile_type:4;
|
||||||
unsigned int show_title:1;
|
unsigned int show_title:1;
|
||||||
unsigned int has_titlebar:1;
|
|
||||||
unsigned int force_paint:1; /* True for icon update and repaint */
|
unsigned int force_paint:1; /* True for icon update and repaint */
|
||||||
unsigned int selected:1;
|
unsigned int selected:1;
|
||||||
unsigned int step:3; /* selection cycle step */
|
unsigned int step:3; /* selection cycle step */
|
||||||
@@ -59,12 +56,14 @@ typedef struct WIcon {
|
|||||||
|
|
||||||
WIcon * wIconCreateWithIconFile(WScreen *scr, char *iconfile, int tile);
|
WIcon * wIconCreateWithIconFile(WScreen *scr, char *iconfile, int tile);
|
||||||
WIcon * wIconCreate(WWindow *wwin);
|
WIcon * wIconCreate(WWindow *wwin);
|
||||||
|
|
||||||
void wIconDestroy(WIcon *icon);
|
void wIconDestroy(WIcon *icon);
|
||||||
void wIconPaint(WIcon *icon);
|
void wIconPaint(WIcon *icon);
|
||||||
void wIconUpdate(WIcon *icon);
|
void wIconUpdate(WIcon *icon);
|
||||||
void wIconChangeTitle(WIcon *icon, char *new_title);
|
|
||||||
Bool wIconChangeImageFile(WIcon *icon, char *file);
|
|
||||||
void wIconSelect(WIcon *icon);
|
void wIconSelect(WIcon *icon);
|
||||||
|
void wIconChangeTitle(WIcon *icon, char *new_title);
|
||||||
|
|
||||||
|
Bool wIconChangeImageFile(WIcon *icon, char *file);
|
||||||
|
|
||||||
RImage * wIconValidateIconSize(WScreen *scr, RImage *icon, int max_size);
|
RImage * wIconValidateIconSize(WScreen *scr, RImage *icon, int max_size);
|
||||||
|
|
||||||
@@ -73,5 +72,4 @@ char *wIconStore(WIcon *icon);
|
|||||||
#ifdef NEWAPPICON
|
#ifdef NEWAPPICON
|
||||||
void wIconSetHighlited(WIcon *icon, Bool flag);
|
void wIconSetHighlited(WIcon *icon, Bool flag);
|
||||||
#endif /* NEWAPPICON */
|
#endif /* NEWAPPICON */
|
||||||
|
|
||||||
#endif /* WMICON_H_ */
|
#endif /* WMICON_H_ */
|
||||||
|
|||||||
Reference in New Issue
Block a user