Add OPEN_PLMENU option to parse command generated proplist style menus
[wmaker-crm.git] / src / funcs.h
bloba7df6cbe3b447cd3176507f5fea7442a8212ca22
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 along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #ifndef WMFUNCS_H_
22 #define WMFUNCS_H_
24 #include <sys/types.h>
25 #include <stdio.h>
27 #include "window.h"
28 #include "defaults.h"
30 typedef void (WCallBack)(void *cdata);
31 typedef void (WDeathHandler)(pid_t pid, unsigned int status, void *cdata);
33 void DispatchEvent(XEvent *event);
34 void UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action);
35 void OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard);
36 void InitializeSwitchMenu(void);
37 void OpenWindowMenu(WWindow *wwin, int x, int y, int keyboard);
38 void OpenWindowMenu2(WWindow *wwin, int x, int y, int keyboard);
39 void OpenMiniwindowMenu(WWindow *wwin, int x, int y);
40 void CloseWindowMenu(WScreen *scr);
41 void DestroyWindowMenu(WScreen *scr);
42 void PlaceIcon(WScreen *scr, int *x_ret, int *y_ret, int head);
43 void StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next, Bool class_only);
44 void SendHelperMessage(WScreen *scr, char type, int workspace, char *msg);
45 void UnescapeWM_CLASS(char *str, char **name, char **class);
46 void PlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
47 unsigned int width, unsigned int height);
49 void ParseWindowName(WMPropList *value, char **winstance, char **wclass,
50 char *where);
52 void wHackedGrabButton(unsigned int button, unsigned int modifiers,
53 Window grab_window, Bool owner_events,
54 unsigned int event_mask, int pointer_mode,
55 int keyboard_mode, Window confine_to, Cursor cursor);
57 WMagicNumber wAddDeathHandler(pid_t pid, WDeathHandler *callback, void *cdata);
59 Pixmap LoadIcon(WScreen *scr, char *path, char *mask, int title_height);
62 int calcIntersectionArea(int x1, int y1, int w1, int h1,
63 int x2, int y2, int w2, int h2);
65 char * StrConcatDot(char *a, char *b);
66 char * ExpandOptions(WScreen *scr, char *cmdline);
67 char * ShrinkString(WMFont *font, char *string, int width);
68 char * FindImage(char *paths, char *file);
69 char * GetShortcutString(char *text);
70 char * EscapeWM_CLASS(char *name, char *class);
72 Bool IsDoubleClick(WScreen *scr, XEvent *event);
73 Bool UpdateDomainFile(WDDomain *domain);
75 WWindow * NextToFocusAfter(WWindow *wwin);
76 WWindow * NextToFocusBefore(WWindow *wwin);
78 void move_window(Window win, int from_x, int from_y, int to_x, int to_y);
79 void SlideWindow(Window win, int from_x, int from_y, int to_x, int to_y);
81 RImage * wGetImageForWindowName(WScreen *scr, char *winstance, char *wclass);
83 #ifdef NUMLOCK_HACK
84 void wHackedGrabKey(int keycode, unsigned int modifiers,
85 Window grab_window, Bool owner_events, int pointer_mode,
86 int keyboard_mode);
87 #endif
89 /****** I18N Wrapper for XFetchName,XGetIconName ******/
91 Bool wFetchName(Display *dpy, Window win, char **winname);
92 Bool wGetIconName(Display *dpy, Window win, char **iconname);
94 /* Free returned string it when done. (applies to the next 2 functions) */
95 char * GetCommandForWindow(Window win);
97 Bool GetCommandForPid(int pid, char ***argv, int *argc);
99 int getWVisualID(int screen);
100 #endif