1 /****************************************************************************
2     Copyright (C) 1987-2015 by Jeffery P. Hansen
3 
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8 
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13 
14     You should have received a copy of the GNU General Public License along
15     with this program; if not, write to the Free Software Foundation, Inc.,
16     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 ****************************************************************************/
18 #ifndef __icon_h
19 #define __icon_h
20 
21 /*
22    Metrics for a gate icon.  (x,y) is the position within a pixmap at
23    which the icon is located, (w,h) is the size of the icon, and
24    (ox, oy) is the position of the icon origin within the icon.
25 */
26 typedef struct {
27   short x,y,w,h,ox,oy;
28 } iconDimensions;
29 
30 
31 typedef struct {
32   Pixmap	pm;			/* Pixmap icon is stored on (for each zoom value) */
33   int		x,y;			/* Position of icon on pixmap */
34   int		width,height;		/* Size of icon on pixmap */
35   int		ox,oy;			/* Origin position (relative to (x,y)) */
36 } Icon;
37 
38 typedef struct {
39   Pixmap	p[ZOOM_MAX+1];		/* The pixmaps in the set (by zoom factor) */
40   int 		width,height;		/* Base size of pixmap */
41 } PixmapZoomSet;
42 
43 void init_iconTables(void);
44 
45 Pixmap Pixmap_register(char *name,unsigned char bits[],unsigned w,unsigned h);
46 Pixmap Pixmap_registerFromFile(char *name,char *file);
47 Pixmap Pixmap_registerFromFileWithParms(char *name,char *file,int*,int*,int*,int*);
48 Pixmap Pixmap_find(char *name);
49 Pixmap Pixmap_zoom(Pixmap,int);
50 void Pixmap_initZoomSet(Pixmap p,int w,int h);
51 void Pixmap_deleteZoomSet(Pixmap p);
52 
53 Icon *new_Icon(Pixmap P,int x,int y,int w,int h,int ox,int oy);
54 Icon *new_IconID(Pixmap P,iconDimensions *id,int yoffset);
55 void Icon_draw(Display *D,Window W,GC gc,int x,int y,Icon *ico);
56 
57 #endif
58