a fix for the definable cursor code
[wmaker-crm.git] / src / funcs.h
blob9e602d7738eb64ed8d9e3e12d43e3a9a9b733584
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"
29 #include "defaults.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);
47 #ifdef LITE
48 #define UpdateSwitchMenu(a,b,c)
49 #else
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 #endif /* !LITE */
64 void OpenWindowMenu(WWindow *wwin, int x, int y, int keyboard);
66 void OpenMiniwindowMenu(WWindow *wwin, int x, int y);
68 void OpenWorkspaceMenu(WScreen *scr, int x, int y);
70 void CloseWindowMenu(WScreen *scr);
72 WMagicNumber wAddDeathHandler(pid_t pid, WDeathHandler *callback, void *cdata);
74 void wColormapInstallForWindow(WScreen *scr, WWindow *wwin);
76 void wColormapInstallRoot(WScreen *scr);
78 void wColormapUninstallRoot(WScreen *scr);
80 void wColormapAllowClientInstallation(WScreen *scr, Bool starting);
82 Pixmap LoadIcon(WScreen *scr, char *path, char *mask, int title_height);
84 void PlaceIcon(WScreen *scr, int *x_ret, int *y_ret);
86 void PlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
87 unsigned int width, unsigned int height);
90 void StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next);
92 #ifdef USECPP
93 char *MakeCPPArgs(char *path);
94 #endif
96 char *ExpandOptions(WScreen *scr, char *cmdline);
98 void ExecuteShellCommand(WScreen *scr, char *command);
100 void StartLogShell(WScreen *scr);
102 Bool IsDoubleClick(WScreen *scr, XEvent *event);
104 WWindow *NextToFocusAfter(WWindow *wwin);
105 WWindow *NextToFocusBefore(WWindow *wwin);
107 void SlideWindow(Window win, int from_x, int from_y, int to_x, int to_y);
109 char *ShrinkString(WMFont *font, char *string, int width);
111 char *FindImage(char *paths, char *file);
113 RImage*wGetImageForWindowName(WScreen *scr, char *winstance, char *wclass);
115 int IsEof(FILE * stream); /* feof that stats pipes */
117 void ParseWindowName(WMPropList *value, char **winstance, char **wclass,
118 char *where);
120 void SendHelperMessage(WScreen *scr, char type, int workspace, char *msg);
122 char *GetShortcutString(char *text);
124 char *EscapeWM_CLASS(char *name, char *class);
126 void UnescapeWM_CLASS(char *str, char **name, char **class);
128 Bool UpdateDomainFile(WDDomain *domain);
130 #ifdef NUMLOCK_HACK
131 void wHackedGrabKey(int keycode, unsigned int modifiers,
132 Window grab_window, Bool owner_events, int pointer_mode,
133 int keyboard_mode);
134 #endif
136 void wHackedGrabButton(unsigned int button, unsigned int modifiers,
137 Window grab_window, Bool owner_events,
138 unsigned int event_mask, int pointer_mode,
139 int keyboard_mode, Window confine_to, Cursor cursor);
142 void ExecExitScript();
144 /****** I18N Wrapper for XFetchName,XGetIconName ******/
146 Bool wFetchName(Display *dpy, Window win, char **winname);
147 Bool wGetIconName(Display *dpy, Window win, char **iconname);
151 #endif