~ctwm/ctwm/trunk

1 by Claude Lecommandeur
CTWM version 1.1
1
/*
554.1.6 by Matthew Fuller
Collapse away redundant license texts in most .h files. These are all
2
 * Icon releated definitions
3
 *
4
 *
1 by Claude Lecommandeur
CTWM version 1.1
5
 * Copyright 1989 Massachusetts Institute of Technology
6
 *
7
 * $XConsortium: icons.h,v 1.4 89/07/18 17:16:24 jim Exp $
8
 *
9
 * 10-Apr-89 Tom LaStrange        Initial Version.
10
 *
554.1.6 by Matthew Fuller
Collapse away redundant license texts in most .h files. These are all
11
 * Copyright 1992 Claude Lecommandeur.
12
 */
1 by Claude Lecommandeur
CTWM version 1.1
13
484 by Matthew Fuller
Consistently rename all the include guards so they match the filename,
14
#ifndef _CTWM_ICONS_H
15
#define _CTWM_ICONS_H
1 by Claude Lecommandeur
CTWM version 1.1
16
518.1.13 by Matthew Fuller
Tpyo.
17
/* Where did the Image for the Icon come from? */
302.1.16 by Olaf 'Rhialto' Seibert
Unify duplicate code; remember that an icon was matched from _NET_WM_ICON.
18
typedef enum {
302.1.31 by Olaf 'Rhialto' Seibert
Code re-indented.
19
	match_none,
20
	match_list,                 /* shared Image: iconslist and Scr->ImageCache */
21
	match_icon_pixmap_hint,     /* Pixmap copied from IconPixmapHint */
22
	match_net_wm_icon,          /* Pixmap created from NET_WM_ICON */
23
	match_unknown_default,      /* shared Image: Scr->UnknownImage */
302.1.16 by Olaf 'Rhialto' Seibert
Unify duplicate code; remember that an icon was matched from _NET_WM_ICON.
24
} Matchtype;
14 by Claude Lecommandeur
CTWM version 3.4
25
304.1.2 by Matthew Fuller
Run 'make indent' to reindent the world.
26
struct Icon {
27
	Matchtype   match;
28
	Window      w;              /* the icon window */
29
	OtpWinList *otp;            /* OnTopPriority info for the icon */
30
	Window      bm_w;           /* the icon bitmap window */
31
	Image       *image;         /* image icon structure */
32
	int         x;              /* icon text x coordinate */
33
	int         y;              /* icon text y coordiante */
34
	int         w_x;            /* x coor of the icon window !!untested!! */
35
	int         w_y;            /* y coor of the icon window !!untested!! */
36
	int         w_width;        /* width of the icon window */
37
	int         w_height;       /* height of the icon window */
38
	int         width;          /* width of the icon bitmap */
39
	int         height;         /* height of the icon bitmap */
40
	Pixel       border;         /* border color */
41
	ColorPair   iconc;
42
	int         border_width;
43
	struct IconRegion   *ir;
492.2.83 by Matthew Fuller
bool-ify these boolean params in icons.h.
44
	bool        has_title, title_shrunk;
45
	bool        w_not_ours;     /* Icon.w comes from IconWindowHint */
304.1.2 by Matthew Fuller
Run 'make indent' to reindent the world.
46
};
47
48
struct IconRegion {
49
	struct IconRegion   *next;
50
	int                 x, y, w, h;
513.1.8 by Matthew Fuller
Swap to the new enum for these gravity values, and retire the old
51
	RegGravity          grav1, grav2;
492.2.90 by Matthew Fuller
Switch to double-slash end line comments here and collapse some
52
	int                 stepx, stepy;       // allocation granularity
496.1.16 by Matthew Fuller
Convert TitleJustification elements to their own enum type, and fixup
53
	TitleJust           TitleJustification;
496.1.17 by Matthew Fuller
Convert IconRegion Justification to its own enum type too. This is
54
	IRJust              Justification;
496.1.14 by Matthew Fuller
Create an enum for the IconRegion Alignement (misspelling preserved
55
	IRAlignement        Alignement;
304.1.2 by Matthew Fuller
Run 'make indent' to reindent the world.
56
	name_list           *clientlist;
57
	struct IconEntry    *entries;
58
};
59
60
struct IconEntry {
61
	struct IconEntry    *next;
62
	int                 x, y, w, h;
63
	TwmWindow           *twm_win;
492.2.81 by Matthew Fuller
short->bool these 'used' elements.
64
	bool                used;
304.1.2 by Matthew Fuller
Run 'make indent' to reindent the world.
65
};
66
518.1.21 by Matthew Fuller
Reorder and sectionalize the prototypes in the .h to match the .c.
67
68
/* Placement and IconsRegion handling */
518.1.11 by Matthew Fuller
const-ify AddIconRegion()
69
name_list **AddIconRegion(const char *geom, RegGravity grav1, RegGravity grav2,
70
                          int stepx, int stepy, const char *ijust,
71
                          const char *just, const char *align);
518.1.21 by Matthew Fuller
Reorder and sectionalize the prototypes in the .h to match the .c.
72
73
/* Icon [window] creation/destruction */
492.2.28 by Matthew Fuller
extern is implicit and the only linkage specifier that's meaningful
74
void CreateIconWindow(TwmWindow *tmp_win, int def_x, int def_y);
518.1.21 by Matthew Fuller
Reorder and sectionalize the prototypes in the .h to match the .c.
75
void DeleteIconsList(TwmWindow *tmp_win);
76
void DeleteIcon(Icon *icon);
518.1.16 by Matthew Fuller
Rename ReleaseImage since it's actually about IconImages.
77
void ReleaseIconImage(Icon *icon);
518.1.21 by Matthew Fuller
Reorder and sectionalize the prototypes in the .h to match the .c.
78
79
/* Handling for bringing them up or down */
80
void IconUp(TwmWindow *tmp_win);
81
void IconDown(TwmWindow *tmp_win);
82
83
/* Drawing */
84
void PaintIcon(TwmWindow *tmp_win);
492.2.28 by Matthew Fuller
extern is implicit and the only linkage specifier that's meaningful
85
void ShrinkIconTitle(TwmWindow *tmp_win);
86
void ExpandIconTitle(TwmWindow *tmp_win);
87
int GetIconOffset(Icon *icon);
518.1.10 by Matthew Fuller
Move RedoIcon*() into icons.c.
88
void RedoIcon(TwmWindow *win);
89
void RedoIconName(TwmWindow *win);
9 by Claude Lecommandeur
CTWM version 3.1
90
484 by Matthew Fuller
Consistently rename all the include guards so they match the filename,
91
#endif /* _CTWM_ICONS_H */