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
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
25 #include <sys/types.h>
31 typedef void (WCallBack
)(void *cdata
);
33 typedef void (WDeathHandler
)(pid_t pid
, unsigned int status
, void *cdata
);
35 void Shutdown(WShutdownMode mode
);
37 void RestoreDesktop(WScreen
*scr
);
39 void Exit(int status
);
41 void Restart(char *manager
, Bool abortOnFailure
);
43 void SetupEnvironment(WScreen
*scr
);
45 void DispatchEvent(XEvent
*event
);
48 #define UpdateSwitchMenu(a,b,c)
50 void UpdateSwitchMenu(WScreen
*scr
, WWindow
*wwin
, int action
);
52 Bool
wRootMenuPerformShortcut(XEvent
*event
);
54 void wRootMenuBindShortcuts(Window window
);
56 void OpenRootMenu(WScreen
*scr
, int x
, int y
, int keyboard
);
58 void OpenSwitchMenu(WScreen
*scr
, int x
, int y
, int keyboard
);
60 void InitializeSwitchMenu(void);
66 void OpenWindowMenu(WWindow
*wwin
, int x
, int y
, int keyboard
);
68 void OpenMiniwindowMenu(WWindow
*wwin
, int x
, int y
);
70 void OpenWorkspaceMenu(WScreen
*scr
, int x
, int y
);
72 void CloseWindowMenu(WScreen
*scr
);
74 WMagicNumber
wAddDeathHandler(pid_t pid
, WDeathHandler
*callback
, void *cdata
);
76 void wColormapInstallForWindow(WScreen
*scr
, WWindow
*wwin
);
78 void wColormapInstallRoot(WScreen
*scr
);
80 void wColormapUninstallRoot(WScreen
*scr
);
82 void wColormapAllowClientInstallation(WScreen
*scr
, Bool starting
);
84 Pixmap
LoadIcon(WScreen
*scr
, char *path
, char *mask
, int title_height
);
86 void PlaceIcon(WScreen
*scr
, int *x_ret
, int *y_ret
, int head
);
88 int calcIntersectionArea(int x1
, int y1
, int w1
, int h1
,
89 int x2
, int y2
, int w2
, int h2
);
91 void PlaceWindow(WWindow
*wwin
, int *x_ret
, int *y_ret
,
92 unsigned int width
, unsigned int height
);
95 void StartWindozeCycle(WWindow
*wwin
, XEvent
*event
, Bool next
);
98 char *MakeCPPArgs(char *path
);
101 char *StrConcatDot(char *a
, char *b
);
103 char *ExpandOptions(WScreen
*scr
, char *cmdline
);
105 void ExecuteShellCommand(WScreen
*scr
, char *command
);
107 void StartLogShell(WScreen
*scr
);
110 Bool
IsDoubleClick(WScreen
*scr
, XEvent
*event
);
112 WWindow
*NextToFocusAfter(WWindow
*wwin
);
113 WWindow
*NextToFocusBefore(WWindow
*wwin
);
115 void SlideWindow(Window win
, int from_x
, int from_y
, int to_x
, int to_y
);
117 char *ShrinkString(WMFont
*font
, char *string
, int width
);
119 char *FindImage(char *paths
, char *file
);
121 RImage
*wGetImageForWindowName(WScreen
*scr
, char *winstance
, char *wclass
);
123 void ParseWindowName(WMPropList
*value
, char **winstance
, char **wclass
,
126 void SendHelperMessage(WScreen
*scr
, char type
, int workspace
, char *msg
);
128 char *GetShortcutString(char *text
);
130 char *EscapeWM_CLASS(char *name
, char *class);
132 void UnescapeWM_CLASS(char *str
, char **name
, char **class);
134 Bool
UpdateDomainFile(WDDomain
*domain
);
137 void wHackedGrabKey(int keycode
, unsigned int modifiers
,
138 Window grab_window
, Bool owner_events
, int pointer_mode
,
142 void wHackedGrabButton(unsigned int button
, unsigned int modifiers
,
143 Window grab_window
, Bool owner_events
,
144 unsigned int event_mask
, int pointer_mode
,
145 int keyboard_mode
, Window confine_to
, Cursor cursor
);
148 void ExecExitScript();
150 /****** I18N Wrapper for XFetchName,XGetIconName ******/
152 Bool
wFetchName(Display
*dpy
, Window win
, char **winname
);
153 Bool
wGetIconName(Display
*dpy
, Window win
, char **iconname
);
155 /* Free returned string it when done. (applies to the next 2 functions) */
156 char* GetCommandForWindow(Window win
);
157 char* GetProgramNameForWindow(Window win
);
159 Bool
GetCommandForPid(int pid
, char ***argv
, int *argc
);