2 * Window Maker window manager
4 * Copyright (c) 1997-2003 Alfredo K. Kojima
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 #include <sys/types.h>
30 typedef void (WCallBack
)(void *cdata
);
31 typedef void (WDeathHandler
)(pid_t pid
, unsigned int status
, void *cdata
);
33 void Shutdown(WShutdownMode mode
);
34 void RestoreDesktop(WScreen
*scr
);
35 void Exit(int status
) __attribute__((noreturn
));
36 void Restart(char *manager
, Bool abortOnFailure
);
37 void SetupEnvironment(WScreen
*scr
);
38 void DispatchEvent(XEvent
*event
);
39 void UpdateSwitchMenu(WScreen
*scr
, WWindow
*wwin
, int action
);
40 void wRootMenuBindShortcuts(Window window
);
41 void OpenRootMenu(WScreen
*scr
, int x
, int y
, int keyboard
);
42 void OpenSwitchMenu(WScreen
*scr
, int x
, int y
, int keyboard
);
43 void InitializeSwitchMenu(void);
44 void OpenWindowMenu(WWindow
*wwin
, int x
, int y
, int keyboard
);
45 void OpenWindowMenu2(WWindow
*wwin
, int x
, int y
, int keyboard
);
46 void OpenMiniwindowMenu(WWindow
*wwin
, int x
, int y
);
47 void CloseWindowMenu(WScreen
*scr
);
48 void DestroyWindowMenu(WScreen
*scr
);
49 void wColormapInstallForWindow(WScreen
*scr
, WWindow
*wwin
);
50 void wColormapInstallRoot(WScreen
*scr
);
51 void wColormapUninstallRoot(WScreen
*scr
);
52 void wColormapAllowClientInstallation(WScreen
*scr
, Bool starting
);
53 void PlaceIcon(WScreen
*scr
, int *x_ret
, int *y_ret
, int head
);
54 void StartWindozeCycle(WWindow
*wwin
, XEvent
*event
, Bool next
, Bool class_only
);
55 void SendHelperMessage(WScreen
*scr
, char type
, int workspace
, char *msg
);
56 void UnescapeWM_CLASS(char *str
, char **name
, char **class);
57 void ExecuteShellCommand(WScreen
*scr
, char *command
);
58 void ExecExitScript();
59 void PlaceWindow(WWindow
*wwin
, int *x_ret
, int *y_ret
,
60 unsigned int width
, unsigned int height
);
62 void ParseWindowName(WMPropList
*value
, char **winstance
, char **wclass
,
65 void wHackedGrabButton(unsigned int button
, unsigned int modifiers
,
66 Window grab_window
, Bool owner_events
,
67 unsigned int event_mask
, int pointer_mode
,
68 int keyboard_mode
, Window confine_to
, Cursor cursor
);
70 WMagicNumber
wAddDeathHandler(pid_t pid
, WDeathHandler
*callback
, void *cdata
);
72 Pixmap
LoadIcon(WScreen
*scr
, char *path
, char *mask
, int title_height
);
75 int calcIntersectionArea(int x1
, int y1
, int w1
, int h1
,
76 int x2
, int y2
, int w2
, int h2
);
79 char *MakeCPPArgs(char *path
);
82 char * StrConcatDot(char *a
, char *b
);
83 char * ExpandOptions(WScreen
*scr
, char *cmdline
);
84 char * ShrinkString(WMFont
*font
, char *string
, int width
);
85 char * FindImage(char *paths
, char *file
);
86 char * GetShortcutString(char *text
);
87 char * EscapeWM_CLASS(char *name
, char *class);
89 Bool
wRootMenuPerformShortcut(XEvent
*event
);
90 Bool
RelaunchWindow(WWindow
*wwin
);
91 Bool
IsDoubleClick(WScreen
*scr
, XEvent
*event
);
92 Bool
UpdateDomainFile(WDDomain
*domain
);
94 WWindow
* NextToFocusAfter(WWindow
*wwin
);
95 WWindow
* NextToFocusBefore(WWindow
*wwin
);
97 void SlideWindow(Window win
, int from_x
, int from_y
, int to_x
, int to_y
);
99 RImage
* wGetImageForWindowName(WScreen
*scr
, char *winstance
, char *wclass
);
102 void wHackedGrabKey(int keycode
, unsigned int modifiers
,
103 Window grab_window
, Bool owner_events
, int pointer_mode
,
107 /****** I18N Wrapper for XFetchName,XGetIconName ******/
109 Bool
wFetchName(Display
*dpy
, Window win
, char **winname
);
110 Bool
wGetIconName(Display
*dpy
, Window win
, char **iconname
);
112 /* Free returned string it when done. (applies to the next 2 functions) */
113 char * GetCommandForWindow(Window win
);
114 char * GetProgramNameForWindow(Window win
);
116 Bool
GetCommandForPid(int pid
, char ***argv
, int *argc
);
118 int getWVisualID(int screen
);