wmaker: Do not allocate memory for a temporary string for the Window Shortcut menu
[wmaker-crm.git] / src / appicon.h
blob44913b8191bbe3fc7aae39bedecb0a041ed1f3db
1 /* appicon.h- application icon
3 * Window Maker window manager
5 * Copyright (c) 1997-2003 Alfredo K. Kojima
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #ifndef WMAPPICON_H_
24 #define WMAPPICON_H_
26 #include <wraster.h>
28 #include "window.h"
29 #include "icon.h"
30 #include "application.h"
32 typedef struct WAppIcon {
33 short xindex;
34 short yindex;
35 struct WAppIcon *next;
36 struct WAppIcon *prev;
37 WIcon *icon;
38 int x_pos, y_pos; /* absolute screen coordinate */
39 char *command; /* command used to launch app */
40 #ifdef USE_DOCK_XDND
41 char *dnd_command; /* command to use when something is */
42 /* dropped on us */
43 #endif
44 char *paste_command; /* command to run when
45 * something is pasted */
46 char *wm_class;
47 char *wm_instance;
48 pid_t pid; /* for apps launched from the dock */
49 Window main_window;
50 struct WDock *dock; /* In which dock is docked. */
51 struct _AppSettingsPanel *panel; /* Settings Panel */
52 unsigned int docked:1;
53 unsigned int omnipresent:1; /* If omnipresent when
54 * docked in clip */
55 unsigned int attracted:1; /* If it was attracted by the clip */
56 unsigned int launching:1;
57 unsigned int running:1; /* application is already running */
58 unsigned int relaunching:1; /* launching 2nd instance */
59 unsigned int forced_dock:1;
60 unsigned int auto_launch:1; /* launch app on startup */
61 unsigned int remote_start:1;
62 unsigned int updated:1;
63 unsigned int editing:1; /* editing docked icon */
64 unsigned int drop_launch:1; /* launching from drop action */
65 unsigned int paste_launch:1; /* launching from paste action */
66 unsigned int destroyed:1; /* appicon was destroyed */
67 unsigned int buggy_app:1; /* do not make dock rely on hints
68 * set by app */
69 unsigned int lock:1; /* do not allow to be destroyed */
70 } WAppIcon;
72 WAppIcon *wAppIconCreateForDock(WScreen *scr, const char *command, const char *wm_instance,
73 const char *wm_class, int tile);
74 Bool wHandleAppIconMove(WAppIcon *aicon, XEvent *event);
76 void wAppIconDestroy(WAppIcon *aicon);
77 void wAppIconPaint(WAppIcon *aicon);
78 void wAppIconMove(WAppIcon *aicon, int x, int y);
79 void create_appicon_for_application(WApplication *wapp, WWindow *wwin);
80 void removeAppIconFor(WApplication * wapp);
81 void save_appicon(WAppIcon *aicon);
82 void paint_app_icon(WApplication *wapp);
83 void unpaint_app_icon(WApplication *wapp);
84 void wApplicationExtractDirPackIcon(const char *path, const char *wm_instance,
85 const char *wm_class);
86 WAppIcon *wAppIconFor(Window window);
88 void appIconMouseDown(WObjDescriptor * desc, XEvent * event);
90 #endif