icons.h revision 645f5050
1/* 2 * Copyright 1989 Massachusetts Institute of Technology 3 * 4 * Permission to use, copy, modify, and distribute this software and its 5 * documentation for any purpose and without fee is hereby granted, provided 6 * that the above copyright notice appear in all copies and that both that 7 * copyright notice and this permission notice appear in supporting 8 * documentation, and that the name of M.I.T. not be used in advertising 9 * or publicity pertaining to distribution of the software without specific, 10 * written prior permission. M.I.T. makes no representations about the 11 * suitability of this software for any purpose. It is provided "as is" 12 * without express or implied warranty. 13 * 14 * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T. 16 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 17 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 18 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 19 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 20 */ 21/* 22 * [ ctwm ] 23 * 24 * Copyright 1992 Claude Lecommandeur. 25 * 26 * Permission to use, copy, modify and distribute this software [ctwm] and 27 * its documentation for any purpose is hereby granted without fee, provided 28 * that the above copyright notice appear in all copies and that both that 29 * copyright notice and this permission notice appear in supporting documen- 30 * tation, and that the name of Claude Lecommandeur not be used in adverti- 31 * sing or publicity pertaining to distribution of the software without 32 * specific, written prior permission. Claude Lecommandeur make no represen- 33 * tations about the suitability of this software for any purpose. It is 34 * provided "as is" without express or implied warranty. 35 * 36 * Claude Lecommandeur DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 37 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO 38 * EVENT SHALL Claude Lecommandeur BE LIABLE FOR ANY SPECIAL, INDIRECT OR 39 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF 40 * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 41 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 42 * PERFORMANCE OF THIS SOFTWARE. 43 * 44 * Author: Claude Lecommandeur [ lecom@sic.epfl.ch ][ April 1992 ] 45 */ 46 47/********************************************************************** 48 * 49 * $XConsortium: icons.h,v 1.4 89/07/18 17:16:24 jim Exp $ 50 * 51 * Icon releated definitions 52 * 53 * 10-Apr-89 Tom LaStrange Initial Version. 54 * 55 **********************************************************************/ 56 57#include "screen.h" 58 59#ifndef ICONS_H 60#define ICONS_H 61 62typedef enum {match_none, match_class, match_name, match_icon} Matchtype; 63 64struct Icon 65{ 66 Matchtype match; 67 Window w; /* the icon window */ 68 Window bm_w; /* the icon bitmap window */ 69 Image *image; /* image icon structure */ 70 int x; /* icon text x coordinate */ 71 int y; /* icon text y coordiante */ 72 int w_width; /* width of the icon window */ 73 int w_height; /* height of the icon window */ 74 int width; /* width of the icon bitmap */ 75 int height; /* height of the icon bitmap */ 76 char *pattern; /* Why this icon was choosed */ 77 Pixel border; /* border color */ 78 ColorPair iconc; 79 Bool has_title, title_shrunk; 80 int border_width; 81 struct IconRegion *ir; 82}; 83 84struct IconRegion 85{ 86 struct IconRegion *next; 87 int x, y, w, h; 88 int grav1, grav2; 89 int stepx, stepy; /* allocation granularity */ 90 short TitleJustification; /* J_LEFT, J_CENTER or J_RIGHT */ 91 short Justification; /* J_LEFT, J_CENTER J_RIGHT or J_BORDER */ 92 short Alignement; /* J_TOP, J_CENTER, J_BOTTOM or J_BORDER */ 93 name_list *clientlist; 94 struct IconEntry *entries; 95}; 96 97struct IconEntry 98{ 99 struct IconEntry *next; 100 int x, y, w, h; 101 TwmWindow *twm_win; 102 short used; 103}; 104 105extern int IconUp (TwmWindow *tmp_win); 106extern void IconDown (TwmWindow *tmp_win); 107extern name_list **AddIconRegion(char *geom, int grav1, int grav2, 108 int stepx, int stepy, 109 char *ijust, char *just, char *align); 110extern int CreateIconWindow(TwmWindow *tmp_win, int def_x, int def_y); 111extern void DeleteIconsList(TwmWindow *tmp_win); 112extern void ShrinkIconTitle (TwmWindow *tmp_win); 113extern void ExpandIconTitle (TwmWindow *tmp_win); 114extern void ReshapeIcon (Icon *icon); 115extern int GetIconOffset (Icon *icon); 116extern Bool AnimateIcons (ScreenInfo *scr, Icon *icon); 117 118#endif /* ICONS_H */ 119