Fix Debian builds
[wmaker-crm.git] / src / funcs.h
blob8dfcc5c9ebc2790c8d81adda69b0c0df0368e7b6
1 /*
2 * Window Maker window manager
4 * Copyright (c) 1997-2003 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,
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 void UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action);
49 Bool wRootMenuPerformShortcut(XEvent *event);
51 void wRootMenuBindShortcuts(Window window);
53 void OpenRootMenu(WScreen *scr, int x, int y, int keyboard);
55 void OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard);
57 void InitializeSwitchMenu(void);
59 void OpenWindowMenu(WWindow *wwin, int x, int y, int keyboard);
61 void OpenMiniwindowMenu(WWindow *wwin, int x, int y);
63 void OpenWorkspaceMenu(WScreen *scr, int x, int y);
65 void CloseWindowMenu(WScreen *scr);
67 WMagicNumber wAddDeathHandler(pid_t pid, WDeathHandler *callback, void *cdata);
69 void wColormapInstallForWindow(WScreen *scr, WWindow *wwin);
71 void wColormapInstallRoot(WScreen *scr);
73 void wColormapUninstallRoot(WScreen *scr);
75 void wColormapAllowClientInstallation(WScreen *scr, Bool starting);
77 Pixmap LoadIcon(WScreen *scr, char *path, char *mask, int title_height);
79 void PlaceIcon(WScreen *scr, int *x_ret, int *y_ret, int head);
81 int calcIntersectionArea(int x1, int y1, int w1, int h1,
82 int x2, int y2, int w2, int h2);
84 void PlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
85 unsigned int width, unsigned int height);
88 void StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next, Bool class_only);
90 #ifdef USECPP
91 char *MakeCPPArgs(char *path);
92 #endif
94 char *StrConcatDot(char *a, char *b);
96 char *ExpandOptions(WScreen *scr, char *cmdline);
98 void ExecuteShellCommand(WScreen *scr, char *command);
100 Bool IsDoubleClick(WScreen *scr, XEvent *event);
102 WWindow *NextToFocusAfter(WWindow *wwin);
103 WWindow *NextToFocusBefore(WWindow *wwin);
105 void SlideWindow(Window win, int from_x, int from_y, int to_x, int to_y);
107 char *ShrinkString(WMFont *font, char *string, int width);
109 char *FindImage(char *paths, char *file);
111 RImage*wGetImageForWindowName(WScreen *scr, char *winstance, char *wclass);
113 void ParseWindowName(WMPropList *value, char **winstance, char **wclass,
114 char *where);
116 void SendHelperMessage(WScreen *scr, char type, int workspace, char *msg);
118 char *GetShortcutString(char *text);
120 char *EscapeWM_CLASS(char *name, char *class);
122 void UnescapeWM_CLASS(char *str, char **name, char **class);
124 Bool UpdateDomainFile(WDDomain *domain);
126 #ifdef NUMLOCK_HACK
127 void wHackedGrabKey(int keycode, unsigned int modifiers,
128 Window grab_window, Bool owner_events, int pointer_mode,
129 int keyboard_mode);
130 #endif
132 void wHackedGrabButton(unsigned int button, unsigned int modifiers,
133 Window grab_window, Bool owner_events,
134 unsigned int event_mask, int pointer_mode,
135 int keyboard_mode, Window confine_to, Cursor cursor);
138 void ExecExitScript();
140 /****** I18N Wrapper for XFetchName,XGetIconName ******/
142 Bool wFetchName(Display *dpy, Window win, char **winname);
143 Bool wGetIconName(Display *dpy, Window win, char **iconname);
145 /* Free returned string it when done. (applies to the next 2 functions) */
146 char* GetCommandForWindow(Window win);
147 char* GetProgramNameForWindow(Window win);
149 Bool GetCommandForPid(int pid, char ***argv, int *argc);
151 int getWVisualID(int screen);
153 #endif