2 * WindowMaker 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 typedef void* WMagicNumber
;
36 void RestoreDesktop(WScreen
*scr
);
38 void Restart(char *manager
);
40 void SetupEnvironment(WScreen
*scr
);
42 void DispatchEvent(XEvent
*event
);
44 void WipeDesktop(WScreen
*scr
);
46 Bool
wRootMenuPerformShortcut(XEvent
*event
);
48 void wRootMenuBindShortcuts(Window window
);
50 void OpenRootMenu(WScreen
*scr
, int x
, int y
, int keyboard
);
52 void OpenSwitchMenu(WScreen
*scr
, int x
, int y
, int keyboard
);
54 void OpenWindowMenu(WWindow
*wwin
, int x
, int y
, int keyboard
);
56 void OpenWorkspaceMenu(WScreen
*scr
, int x
, int y
);
58 void CloseWindowMenu(WScreen
*scr
);
60 void UpdateSwitchMenu(WScreen
*scr
, WWindow
*wwin
, int action
);
62 void UpdateSwitchMenuWorkspace(WScreen
*scr
, int workspace
);
64 WMagicNumber
wAddDeathHandler(pid_t pid
, WDeathHandler
*callback
, void *cdata
);
66 WMagicNumber
wAddWindowSavedState(char *instance
, char *class, char *command
,
67 pid_t pid
, WSavedState
*state
);
69 WMagicNumber
wGetWindowSavedState(Window win
);
71 void wDeleteWindowSavedState(WMagicNumber id
);
73 void wColormapInstallForWindow(WScreen
*scr
, WWindow
*wwin
);
75 void wColormapInstallRoot(WScreen
*scr
);
77 void wColormapUninstallRoot(WScreen
*scr
);
80 Pixmap
LoadIcon(WScreen
*scr
, char *path
, char *mask
, int title_height
);
82 void PlaceIcon(WScreen
*scr
, int *x_ret
, int *y_ret
);
84 void PlaceWindow(WWindow
*wwin
, int *x_ret
, int *y_ret
);
87 char *MakeCPPArgs(char *path
);
90 char *ExpandOptions(WScreen
*scr
, char *cmdline
);
92 Bool
IsDoubleClick(WScreen
*scr
, XEvent
*event
);
94 WWindow
*NextFocusWindow(WScreen
*scr
);
95 WWindow
*PrevFocusWindow(WScreen
*scr
);
97 void SlideWindow(Window win
, int from_x
, int from_y
, int to_x
, int to_y
);
99 char *ShrinkString(WFont
*font
, char *string
, int width
);
101 char *FindImage(char **paths
, char *file
);
103 RImage
*wGetImageForWindowName(WScreen
*scr
, char *winstance
, char *wclass
);
105 BOOL
StringCompareHook(proplist_t pl1
, proplist_t pl2
);
107 int IsEof(FILE * stream
); /* feof that stats pipes */
109 char *FlattenStringList(char **list
, int count
);
111 void ParseWindowName(proplist_t value
, char **winstance
, char **wclass
,
114 char *GetShortcutString(char *text
);
117 void wHackedGrabKey(int keycode
, unsigned int modifiers
,
118 Window grab_window
, Bool owner_events
, int pointer_mode
,
121 void wHackedGrabButton(unsigned int button
, unsigned int modifiers
,
122 Window grab_window
, Bool owner_events
,
123 unsigned int event_mask
, int pointer_mode
,
124 int keyboard_mode
, Window confine_to
, Cursor cursor
);
126 void wHackedUngrabButton(unsigned int button
, unsigned int modifiers
,
130 /* this function is in dock.c */
131 void ParseCommand(char *command
, char ***argv
, int *argc
);
133 /* This function is in moveres.c. */
134 void wGetGeometryWindowSize(WScreen
*scr
, unsigned int *width
,
135 unsigned int *height
);
137 void ExecExitScript();
139 /****** I18N Wrapper for XFetchName,XGetIconName ******/
141 Bool
wFetchName(Display
*dpy
, Window win
, char **winname
);
142 Bool
wGetIconName(Display
*dpy
, Window win
, char **iconname
);
145 /*void wTextWidth(XFontSet *font, char *text, int length);*/
146 #define wDrawString(d,f,gc,x,y,text,textlen) \
147 XmbDrawString(dpy, d, (f)->font, gc, (x), (y), text, textlen)
149 #define wTextWidth(font,text,textlen) XmbTextEscapement(font,text,textlen)
153 #define wTextWidth(font,text,textlen) XTextWidth(font,text,textlen)
155 /*void wTextWidth(XFontStruct *font, char *text, int length);*/
156 #define wDrawString(d,font,gc,x,y,text,textlen) \
157 XDrawString(dpy, d, gc, (x), (y), text, textlen)
159 #endif /* !I18N_MB */