Mac OS X-style window cycling.
[wmaker-crm.git] / src / funcs.h
Commit [+]AuthorDateLineData
9d2e6ef9 scottc1998-09-29 22:36:29 +00001/*
9af1c6c4 dan1998-10-21 14:43:47 +00002 * Window Maker window manager
6830b057 dan2004-10-12 21:28:27 +00003 *
4153e2fd dan2003-01-16 23:30:45 +00004 * Copyright (c) 1997-2003 Alfredo K. Kojima
6830b057 dan2004-10-12 21:28:27 +00005 *
9d2e6ef9 scottc1998-09-29 22:36:29 +00006 * 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.
10 *
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.
15 *
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
6830b057 dan2004-10-12 21:28:27 +000018 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
9d2e6ef9 scottc1998-09-29 22:36:29 +000019 * USA.
20 */
21
22#ifndef WMFUNCS_H_
23#define WMFUNCS_H_
24
25#include <sys/types.h>
26#include <stdio.h>
27
28#include "window.h"
41996df7 dan2001-12-20 22:16:01 +000029#include "defaults.h"
9d2e6ef9 scottc1998-09-29 22:36:29 +000030
31typedef void (WCallBack)(void *cdata);
32
33typedef void (WDeathHandler)(pid_t pid, unsigned int status, void *cdata);
34
0261c326 dan1999-01-06 15:22:33 +000035void Shutdown(WShutdownMode mode);
36
9d2e6ef9 scottc1998-09-29 22:36:29 +000037void RestoreDesktop(WScreen *scr);
38
9007a657 dan1998-11-23 11:32:19 +000039void Exit(int status);
40
8bdc78fc dan1999-04-17 20:25:07 +000041void Restart(char *manager, Bool abortOnFailure);
9d2e6ef9 scottc1998-09-29 22:36:29 +000042
43void SetupEnvironment(WScreen *scr);
44
45void DispatchEvent(XEvent *event);
46
5ef342d9 kojima2001-09-06 21:42:28 +000047void UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action);
9d2e6ef9 scottc1998-09-29 22:36:29 +000048
49Bool wRootMenuPerformShortcut(XEvent *event);
50
51void wRootMenuBindShortcuts(Window window);
52
53void OpenRootMenu(WScreen *scr, int x, int y, int keyboard);
54
55void OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard);
56
851835c7 dan2002-09-11 15:02:43 +000057void InitializeSwitchMenu(void);
58
9d2e6ef9 scottc1998-09-29 22:36:29 +000059void OpenWindowMenu(WWindow *wwin, int x, int y, int keyboard);
60
0261c326 dan1999-01-06 15:22:33 +000061void OpenMiniwindowMenu(WWindow *wwin, int x, int y);
62
9d2e6ef9 scottc1998-09-29 22:36:29 +000063void OpenWorkspaceMenu(WScreen *scr, int x, int y);
64
65void CloseWindowMenu(WScreen *scr);
66
59eb9475 dan1998-11-03 12:53:26 +000067WMagicNumber wAddDeathHandler(pid_t pid, WDeathHandler *callback, void *cdata);
9d2e6ef9 scottc1998-09-29 22:36:29 +000068
69void wColormapInstallForWindow(WScreen *scr, WWindow *wwin);
70
71void wColormapInstallRoot(WScreen *scr);
72
73void wColormapUninstallRoot(WScreen *scr);
74
59eb9475 dan1998-11-03 12:53:26 +000075void wColormapAllowClientInstallation(WScreen *scr, Bool starting);
9d2e6ef9 scottc1998-09-29 22:36:29 +000076
77Pixmap LoadIcon(WScreen *scr, char *path, char *mask, int title_height);
78
27a396d7 dan2003-06-06 04:11:00 +000079void PlaceIcon(WScreen *scr, int *x_ret, int *y_ret, int head);
9d2e6ef9 scottc1998-09-29 22:36:29 +000080
a10214a5 kojima2002-11-28 22:04:07 +000081int calcIntersectionArea(int x1, int y1, int w1, int h1,
6830b057 dan2004-10-12 21:28:27 +000082 int x2, int y2, int w2, int h2);
a10214a5 kojima2002-11-28 22:04:07 +000083
abde3e0c dan1998-10-23 17:07:08 +000084void PlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
85 unsigned int width, unsigned int height);
9d2e6ef9 scottc1998-09-29 22:36:29 +000086
caa86529 kojima2000-04-07 22:47:04 +000087
18408fff Iain Patterson2009-09-14 14:37:15 +010088void StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next, Bool class_only);
caa86529 kojima2000-04-07 22:47:04 +000089
9d2e6ef9 scottc1998-09-29 22:36:29 +000090#ifdef USECPP
91char *MakeCPPArgs(char *path);
92#endif
93
a8950af8 kojima2002-02-20 15:01:44 +000094char *StrConcatDot(char *a, char *b);
95
9d2e6ef9 scottc1998-09-29 22:36:29 +000096char *ExpandOptions(WScreen *scr, char *cmdline);
97
0261c326 dan1999-01-06 15:22:33 +000098void ExecuteShellCommand(WScreen *scr, char *command);
99
9d2e6ef9 scottc1998-09-29 22:36:29 +0000100Bool IsDoubleClick(WScreen *scr, XEvent *event);
101
754230a6 kojima2000-02-16 18:26:15 +0000102WWindow *NextToFocusAfter(WWindow *wwin);
103WWindow *NextToFocusBefore(WWindow *wwin);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000104
105void SlideWindow(Window win, int from_x, int from_y, int to_x, int to_y);
106
3d5f435b kojima1999-05-30 05:02:55 +0000107char *ShrinkString(WMFont *font, char *string, int width);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000108
0261c326 dan1999-01-06 15:22:33 +0000109char *FindImage(char *paths, char *file);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000110
111RImage*wGetImageForWindowName(WScreen *scr, char *winstance, char *wclass);
112
33cc542e dan2001-10-04 03:07:34 +0000113void ParseWindowName(WMPropList *value, char **winstance, char **wclass,
9d2e6ef9 scottc1998-09-29 22:36:29 +0000114 char *where);
115
0261c326 dan1999-01-06 15:22:33 +0000116void SendHelperMessage(WScreen *scr, char type, int workspace, char *msg);
117
9d2e6ef9 scottc1998-09-29 22:36:29 +0000118char *GetShortcutString(char *text);
119
59eb9475 dan1998-11-03 12:53:26 +0000120char *EscapeWM_CLASS(char *name, char *class);
121
122void UnescapeWM_CLASS(char *str, char **name, char **class);
123
41996df7 dan2001-12-20 22:16:01 +0000124Bool UpdateDomainFile(WDDomain *domain);
125
9d2e6ef9 scottc1998-09-29 22:36:29 +0000126#ifdef NUMLOCK_HACK
127void wHackedGrabKey(int keycode, unsigned int modifiers,
6830b057 dan2004-10-12 21:28:27 +0000128 Window grab_window, Bool owner_events, int pointer_mode,
129 int keyboard_mode);
9af1c6c4 dan1998-10-21 14:43:47 +0000130#endif
9d2e6ef9 scottc1998-09-29 22:36:29 +0000131
6830b057 dan2004-10-12 21:28:27 +0000132void 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);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000136
9d2e6ef9 scottc1998-09-29 22:36:29 +0000137
9d2e6ef9 scottc1998-09-29 22:36:29 +0000138void ExecExitScript();
139
140/****** I18N Wrapper for XFetchName,XGetIconName ******/
141
142Bool wFetchName(Display *dpy, Window win, char **winname);
143Bool wGetIconName(Display *dpy, Window win, char **iconname);
144
9aca0d5f dan2004-10-12 01:34:32 +0000145/* Free returned string it when done. (applies to the next 2 functions) */
146char* GetCommandForWindow(Window win);
147char* GetProgramNameForWindow(Window win);
148
149Bool GetCommandForPid(int pid, char ***argv, int *argc);
150
9d2e6ef9 scottc1998-09-29 22:36:29 +0000151#endif