2 * Window Maker window manager
4 * Copyright (c) 1997, 1998 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>
30 typedef void (WCallBack
)(void *cdata
);
32 typedef void (WDeathHandler
)(pid_t pid
, unsigned int status
, void *cdata
);
34 void RestoreDesktop(WScreen
*scr
);
36 void Restart(char *manager
);
38 void SetupEnvironment(WScreen
*scr
);
40 void DispatchEvent(XEvent
*event
);
42 void WipeDesktop(WScreen
*scr
);
44 Bool
wRootMenuPerformShortcut(XEvent
*event
);
46 void wRootMenuBindShortcuts(Window window
);
48 void OpenRootMenu(WScreen
*scr
, int x
, int y
, int keyboard
);
50 void OpenSwitchMenu(WScreen
*scr
, int x
, int y
, int keyboard
);
52 void OpenWindowMenu(WWindow
*wwin
, int x
, int y
, int keyboard
);
54 void OpenWorkspaceMenu(WScreen
*scr
, int x
, int y
);
56 void CloseWindowMenu(WScreen
*scr
);
58 void UpdateSwitchMenu(WScreen
*scr
, WWindow
*wwin
, int action
);
60 void UpdateSwitchMenuWorkspace(WScreen
*scr
, int workspace
);
62 WMagicNumber
wAddDeathHandler(pid_t pid
, WDeathHandler
*callback
, void *cdata
);
64 void wColormapInstallForWindow(WScreen
*scr
, WWindow
*wwin
);
66 void wColormapInstallRoot(WScreen
*scr
);
68 void wColormapUninstallRoot(WScreen
*scr
);
70 void wColormapAllowClientInstallation(WScreen
*scr
, Bool starting
);
72 Pixmap
LoadIcon(WScreen
*scr
, char *path
, char *mask
, int title_height
);
74 void PlaceIcon(WScreen
*scr
, int *x_ret
, int *y_ret
);
76 void PlaceWindow(WWindow
*wwin
, int *x_ret
, int *y_ret
,
77 unsigned int width
, unsigned int height
);
80 char *MakeCPPArgs(char *path
);
83 char *ExpandOptions(WScreen
*scr
, char *cmdline
);
85 Bool
IsDoubleClick(WScreen
*scr
, XEvent
*event
);
87 WWindow
*NextFocusWindow(WScreen
*scr
);
88 WWindow
*PrevFocusWindow(WScreen
*scr
);
90 void SlideWindow(Window win
, int from_x
, int from_y
, int to_x
, int to_y
);
92 char *ShrinkString(WFont
*font
, char *string
, int width
);
94 char *FindImage(char **paths
, char *file
);
96 RImage
*wGetImageForWindowName(WScreen
*scr
, char *winstance
, char *wclass
);
98 BOOL
StringCompareHook(proplist_t pl1
, proplist_t pl2
);
100 int IsEof(FILE * stream
); /* feof that stats pipes */
102 char *FlattenStringList(char **list
, int count
);
104 void ParseWindowName(proplist_t value
, char **winstance
, char **wclass
,
107 char *GetShortcutString(char *text
);
109 char *EscapeWM_CLASS(char *name
, char *class);
111 void UnescapeWM_CLASS(char *str
, char **name
, char **class);
114 void wHackedGrabKey(int keycode
, unsigned int modifiers
,
115 Window grab_window
, Bool owner_events
, int pointer_mode
,
119 void wHackedGrabButton(unsigned int button
, unsigned int modifiers
,
120 Window grab_window
, Bool owner_events
,
121 unsigned int event_mask
, int pointer_mode
,
122 int keyboard_mode
, Window confine_to
, Cursor cursor
);
125 /* this function is in dock.c */
126 void ParseCommand(char *command
, char ***argv
, int *argc
);
128 /* This function is in moveres.c. */
129 void wGetGeometryWindowSize(WScreen
*scr
, unsigned int *width
,
130 unsigned int *height
);
132 void ExecExitScript();
134 /****** I18N Wrapper for XFetchName,XGetIconName ******/
136 Bool
wFetchName(Display
*dpy
, Window win
, char **winname
);
137 Bool
wGetIconName(Display
*dpy
, Window win
, char **iconname
);
140 /*void wTextWidth(XFontSet *font, char *text, int length);*/
141 #define wDrawString(d,f,gc,x,y,text,textlen) \
142 XmbDrawString(dpy, d, (f)->font, gc, (x), (y), text, textlen)
144 #define wTextWidth(font,text,textlen) XmbTextEscapement(font,text,textlen)
148 #define wTextWidth(font,text,textlen) XTextWidth(font,text,textlen)
150 /*void wTextWidth(XFontStruct *font, char *text, int length);*/
151 #define wDrawString(d,font,gc,x,y,text,textlen) \
152 XDrawString(dpy, d, gc, (x), (y), text, textlen)
154 #endif /* !I18N_MB */