File: myicon.h

package info (click to toggle)
afterstep 2.2.12-19
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 33,168 kB
  • sloc: ansic: 201,695; sh: 5,894; xml: 3,721; makefile: 2,095; perl: 1,558; cpp: 811
file content (68 lines) | stat: -rw-r--r-- 1,766 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef AS_MYICON_H_HEADER_INCLUDED
#define AS_MYICON_H_HEADER_INCLUDED

#ifdef __cplusplus
extern "C" {
#endif

struct ASImage;
struct ASImageManager;
struct ASVisual;

typedef struct icon_t
  {
	struct ASImage *image;		/* ASImage of pix, to reduce XGetImage() calls */
	Pixmap pix;			/* icon pixmap */
	Pixmap mask;		/* icon mask */
	Pixmap alpha;		/* icon 8-bit alpha channel pixmap */
	int width;			/* icon width */
	int height;			/* icon height */
	Atom im_name ;
  }
icon_t;

typedef icon_t MyIcon;

typedef enum {
	ASB_State_Up = 0,
	ASB_State_Down,
	ASB_StateCount
}ASButtonStates ;

typedef struct ASButton
{
	ASButtonStates     state;
	char              *shapes[ASB_StateCount];    /* icons to draw when button is any of the states */
}ASButton;

typedef struct button_t
{
	MyIcon unpressed;		/* icon to draw when button is not pressed */
	MyIcon pressed;		    /* icon to draw when button is pressed */
/*    Bool is_pressed;         is the button pressed? */
	unsigned int width, height ;
	int context ;
}button_t;

typedef button_t MyButton ;

void asimage2icon( struct ASImage *im, icon_t *icon );
void make_icon_pixmaps (icon_t * icon, Bool ignore_alpha);
void icon_from_pixmaps( MyIcon *icon, Pixmap pix, Pixmap mask, Pixmap alpha );


Bool load_icon (icon_t *icon, const char *filename, struct ASImageManager *imman );
void free_icon_resources( icon_t *icon );
void destroy_icon(icon_t **picon);

void destroy_asbutton( ASButton *btn, Bool reusable );
Bool load_button( button_t *button, char **filenames, struct ASImageManager *imman );
Bool scale_button( button_t *button, int width, int height, struct ASVisual *asv );
void free_button_resources( button_t *button );

#ifdef __cplusplus
}
#endif


#endif /* #define AS_MYICON_H_HEADER_INCLUDED */