Prevent crash when switchpanel is not initialised.
[wmaker-crm.git] / src / icon.h
blob368696f032fcc6933e8a8a86b4b465f3ba7e8a23
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 WMICON_H_
23 #define WMICON_H_
25 #include "wcore.h"
26 #include "window.h"
27 #include "funcs.h"
29 #define TILE_NORMAL 0
30 #define TILE_CLIP 1
31 #define TILE_DRAWER 2
33 typedef struct WIcon {
34 WCoreWindow *core;
35 WWindow *owner; /* owner window */
36 char *icon_name; /* the icon name hint */
38 Window icon_win; /* client suplied icon window */
40 char *file; /* the file with the icon image */
41 RImage *file_image; /* the image from the file */
43 unsigned int tile_type:4;
44 unsigned int show_title:1;
45 unsigned int selected:1;
46 unsigned int step:3; /* selection cycle step */
47 unsigned int shadowed:1; /* If the icon is to be blured */
48 unsigned int mapped:1;
49 unsigned int highlighted:1;
51 Pixmap pixmap;
53 WMHandlerID handlerID; /* timer handler ID for cycling select
54 * color */
55 } WIcon;
57 WIcon *icon_create_for_dock(WScreen *scr, char *command, char *wm_instance, char *wm_class, int tile);
58 WIcon *icon_create_for_wwindow(WWindow *wwin);
60 void set_icon_image_from_database(WIcon *icon, char *wm_instance, char *wm_class, char *command);
61 void wIconDestroy(WIcon *icon);
62 void wIconPaint(WIcon *icon);
63 void wIconUpdate(WIcon *icon);
64 void wIconSelect(WIcon *icon);
65 void wIconChangeTitle(WIcon *icon, WWindow *wwin);
66 void update_icon_pixmap(WIcon *icon);
68 Bool wIconChangeImageFile(WIcon *icon, char *file);
70 RImage *wIconValidateIconSize(RImage *icon, int max_size);
71 RImage *get_rimage_icon_from_wm_hints(WIcon *icon);
73 char *wIconStore(WIcon *icon);
74 char *get_name_for_instance_class(char *wm_instance, char *wm_class);
76 void wIconSetHighlited(WIcon *icon, Bool flag);
77 void set_icon_image_from_image(WIcon *icon, RImage *image);
79 #endif /* WMICON_H_ */