Fixed big memory leak in color panel code (patch from Pascal).
[wmaker-crm.git] / src / application.h
blobc17ac9dbec7c6a216e90c2f6fb46ea7eaf2765dc
1 /*
2 * Window Maker window manager
3 *
4 * Copyright (c) 1997, 1998 Alfredo K. Kojima
5 *
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.
23 #ifndef WMAPPLICATION_H_
24 #define WMAPPLICATION_H_
26 /* for tracking single application instances */
27 typedef struct WApplication {
28 struct WApplication *next;
29 struct WApplication *prev;
31 Window main_window; /* ID of the group leader */
33 struct WWindow *main_window_desc; /* main (leader) window descriptor */
35 WMenu *menu; /* application menu */
37 struct WAppIcon *app_icon;
39 int refcount;
41 struct WWindow *last_focused; /* focused window before hide */
43 int last_workspace; /* last workspace used to work on the
44 * app */
45 struct {
46 unsigned int skip_next_animation:1;
47 unsigned int hidden:1;
48 unsigned int emulated:1;
49 } flags;
50 } WApplication;
53 WApplication *wApplicationCreate(WScreen *scr, Window main_window);
54 void wApplicationDestroy(WApplication *wapp);
56 WApplication *wApplicationOf(Window window);
58 void wApplicationExtractDirPackIcon(WScreen *scr,char *path, char *wm_instance,
59 char *wm_class);
62 #ifdef NEWAPPICON
64 # define wApplicationActivate(wapp) {\
65 wapp->main_window_desc->flags.focused=1; \
66 wAppIconPaint(wapp->app_icon);\
68 #define wApplicationDeactivate(wapp) {\
69 wapp->main_window_desc->flags.focused=0;\
70 wAppIconPaint(wapp->app_icon);\
72 #endif
74 #endif