This update includes the 0.20.3pre3 code
[wmaker-crm.git] / src / funcs.h
bloba10f4bbdf17e6e7726f49454b9d787710aecf1d7
1 /*
2 * Window Maker window manager
3 *
4 * Copyright (c) 1997, 1998 Alfredo K. Kojima
5 *
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,
19 * USA.
22 #ifndef WMFUNCS_H_
23 #define WMFUNCS_H_
25 #include <sys/types.h>
26 #include <stdio.h>
28 #include "window.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 Exit(int status);
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 void wColormapInstallForWindow(WScreen *scr, WWindow *wwin);
68 void wColormapInstallRoot(WScreen *scr);
70 void wColormapUninstallRoot(WScreen *scr);
72 void wColormapAllowClientInstallation(WScreen *scr, Bool starting);
74 Pixmap LoadIcon(WScreen *scr, char *path, char *mask, int title_height);
76 void PlaceIcon(WScreen *scr, int *x_ret, int *y_ret);
78 void PlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
79 unsigned int width, unsigned int height);
81 #ifdef USECPP
82 char *MakeCPPArgs(char *path);
83 #endif
85 char *ExpandOptions(WScreen *scr, char *cmdline);
87 Bool IsDoubleClick(WScreen *scr, XEvent *event);
89 WWindow *NextFocusWindow(WScreen *scr);
90 WWindow *PrevFocusWindow(WScreen *scr);
92 void SlideWindow(Window win, int from_x, int from_y, int to_x, int to_y);
94 char *ShrinkString(WFont *font, char *string, int width);
96 char *FindImage(char **paths, char *file);
98 RImage*wGetImageForWindowName(WScreen *scr, char *winstance, char *wclass);
100 BOOL StringCompareHook(proplist_t pl1, proplist_t pl2);
102 int IsEof(FILE * stream); /* feof that stats pipes */
104 char *FlattenStringList(char **list, int count);
106 void ParseWindowName(proplist_t value, char **winstance, char **wclass,
107 char *where);
109 char *GetShortcutString(char *text);
111 char *EscapeWM_CLASS(char *name, char *class);
113 void UnescapeWM_CLASS(char *str, char **name, char **class);
115 #ifdef NUMLOCK_HACK
116 void wHackedGrabKey(int keycode, unsigned int modifiers,
117 Window grab_window, Bool owner_events, int pointer_mode,
118 int keyboard_mode);
119 #endif
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);
127 /* this function is in dock.c */
128 void ParseCommand(char *command, char ***argv, int *argc);
130 /* This function is in moveres.c. */
131 void wGetGeometryWindowSize(WScreen *scr, unsigned int *width,
132 unsigned int *height);
134 void ExecExitScript();
136 /****** I18N Wrapper for XFetchName,XGetIconName ******/
138 Bool wFetchName(Display *dpy, Window win, char **winname);
139 Bool wGetIconName(Display *dpy, Window win, char **iconname);
141 #ifdef I18N_MB
142 /*void wTextWidth(XFontSet *font, char *text, int length);*/
143 #define wDrawString(d,f,gc,x,y,text,textlen) \
144 XmbDrawString(dpy, d, (f)->font, gc, (x), (y), text, textlen)
146 #define wTextWidth(font,text,textlen) XmbTextEscapement(font,text,textlen)
148 #else /* !I18N_MB */
150 #define wTextWidth(font,text,textlen) XTextWidth(font,text,textlen)
152 /*void wTextWidth(XFontStruct *font, char *text, int length);*/
153 #define wDrawString(d,font,gc,x,y,text,textlen) \
154 XDrawString(dpy, d, gc, (x), (y), text, textlen)
156 #endif /* !I18N_MB */
159 #endif