Updating to version 0.20.2
[wmaker-crm.git] / src / funcs.h
blob3d22024327872a7302304786f1d5f53b73e26ffc
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 typedef void* WDeathHandlerID;
37 void RestoreDesktop(WScreen *scr);
39 void Restart(char *manager);
41 void SetupEnvironment(WScreen *scr);
43 void DispatchEvent(XEvent *event);
45 void WipeDesktop(WScreen *scr);
47 Bool wRootMenuPerformShortcut(XEvent *event);
49 void wRootMenuBindShortcuts(Window window);
51 void OpenRootMenu(WScreen *scr, int x, int y, int keyboard);
53 void OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard);
55 void OpenWindowMenu(WWindow *wwin, int x, int y, int keyboard);
57 void OpenWorkspaceMenu(WScreen *scr, int x, int y);
59 void CloseWindowMenu(WScreen *scr);
61 void UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action);
63 void UpdateSwitchMenuWorkspace(WScreen *scr, int workspace);
65 WDeathHandlerID wAddDeathHandler(pid_t pid, WDeathHandler *callback, void *cdata);
67 void wColormapInstallForWindow(WScreen *scr, WWindow *wwin);
69 void wColormapInstallRoot(WScreen *scr);
71 void wColormapUninstallRoot(WScreen *scr);
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);
80 #ifdef USECPP
81 char *MakeCPPArgs(char *path);
82 #endif
84 char *ExpandOptions(WScreen *scr, char *cmdline);
86 Bool IsDoubleClick(WScreen *scr, XEvent *event);
88 WWindow *NextFocusWindow(WScreen *scr);
89 WWindow *PrevFocusWindow(WScreen *scr);
91 void SlideWindow(Window win, int from_x, int from_y, int to_x, int to_y);
93 char *ShrinkString(WFont *font, char *string, int width);
95 char *FindImage(char **paths, char *file);
97 RImage*wGetImageForWindowName(WScreen *scr, char *winstance, char *wclass);
99 BOOL StringCompareHook(proplist_t pl1, proplist_t pl2);
101 int IsEof(FILE * stream); /* feof that stats pipes */
103 char *FlattenStringList(char **list, int count);
105 void ParseWindowName(proplist_t value, char **winstance, char **wclass,
106 char *where);
108 char *GetShortcutString(char *text);
110 #ifdef NUMLOCK_HACK
111 void wHackedGrabKey(int keycode, unsigned int modifiers,
112 Window grab_window, Bool owner_events, int pointer_mode,
113 int keyboard_mode);
114 #endif
116 void wHackedGrabButton(unsigned int button, unsigned int modifiers,
117 Window grab_window, Bool owner_events,
118 unsigned int event_mask, int pointer_mode,
119 int keyboard_mode, Window confine_to, Cursor cursor);
122 /* this function is in dock.c */
123 void ParseCommand(char *command, char ***argv, int *argc);
125 /* This function is in moveres.c. */
126 void wGetGeometryWindowSize(WScreen *scr, unsigned int *width,
127 unsigned int *height);
129 void ExecExitScript();
131 /****** I18N Wrapper for XFetchName,XGetIconName ******/
133 Bool wFetchName(Display *dpy, Window win, char **winname);
134 Bool wGetIconName(Display *dpy, Window win, char **iconname);
136 #ifdef I18N_MB
137 /*void wTextWidth(XFontSet *font, char *text, int length);*/
138 #define wDrawString(d,f,gc,x,y,text,textlen) \
139 XmbDrawString(dpy, d, (f)->font, gc, (x), (y), text, textlen)
141 #define wTextWidth(font,text,textlen) XmbTextEscapement(font,text,textlen)
143 #else /* !I18N_MB */
145 #define wTextWidth(font,text,textlen) XTextWidth(font,text,textlen)
147 /*void wTextWidth(XFontStruct *font, char *text, int length);*/
148 #define wDrawString(d,font,gc,x,y,text,textlen) \
149 XDrawString(dpy, d, gc, (x), (y), text, textlen)
151 #endif /* !I18N_MB */
154 #endif