WINGs: Make fetchFile() more similar to copyFile() from getstyle.c
[wmaker-crm.git] / src / application.h
blob298e37590a7419d08b3cdd42eba7a682716ce8f7
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.
22 #ifndef WMAPPLICATION_H_
23 #define WMAPPLICATION_H_
25 /* for tracking single application instances */
26 typedef struct WApplication {
27 struct WApplication *next;
28 struct WApplication *prev;
30 Window main_window; /* ID of the group leader */
32 struct WWindow *main_window_desc; /* main (leader) window descriptor */
34 WMenu *menu; /* application menu */
36 struct WAppIcon *app_icon;
38 int refcount;
40 struct WWindow *last_focused; /* focused window before hide */
42 int last_workspace; /* last workspace used to work on the
43 * app */
44 WMHandlerID *urgent_bounce_timer;
45 struct {
46 unsigned int skip_next_animation:1;
47 unsigned int hidden:1;
48 unsigned int emulated:1;
49 unsigned int bouncing:1;
50 } flags;
51 } WApplication;
54 WApplication *wApplicationCreate(struct WWindow *wwin);
55 void wApplicationDestroy(WApplication *wapp);
57 WApplication *wApplicationOf(Window window);
59 void wApplicationExtractDirPackIcon(WScreen *scr,char *path, char *wm_instance,
60 char *wm_class);
61 void wApplicationSaveIconPathFor(char *iconPath, char *wm_instance,
62 char *wm_class);
64 void wAppBounce(WApplication *);
65 void wAppBounceWhileUrgent(WApplication *);
67 #ifdef NEWAPPICON
68 #define wApplicationActivate(wapp) do { \
69 if (wapp->app_icon) { \
70 wIconSetHighlited(wapp->app_icon->icon, True); \
71 wAppIconPaint(wapp->app_icon);\
72 } \
73 } while (0)
74 #define wApplicationDeactivate(wapp) do { \
75 if (wapp->app_icon) { \
76 wIconSetHighlited(wapp->app_icon->icon, False); \
77 wAppIconPaint(wapp->app_icon);\
78 } \
79 } while (0)
80 #else
81 #define wApplicationActivate(wapp) do { } while (0)
82 #define wApplicationDeactivate(wapp) do { } while (0)
83 #endif /* NEWAPPICON */
85 #endif