-
Notifications
You must be signed in to change notification settings - Fork 2
/
oneko.h
124 lines (96 loc) · 3.2 KB
/
oneko.h
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/*
* oneko - Neko runs Over the windows.
*
* $Id: oneko.h,v 1.26 1992/03/17 14:08:41 kato Exp kato $
*/
/*
* Define constant
*/
#define MAX_TICK 9999 /* Odd Only! */
#define NEKO_EVENT_MASK (KeyPressMask | \
KeyReleaseMask | \
ButtonPressMask | \
ButtonReleaseMask | \
VisibilityChangeMask)
#define TOY_EVENT_MASK (ExposureMask | \
KeyPressMask | \
KeyReleaseMask | \
ButtonPressMask | \
ButtonReleaseMask | \
VisibilityChangeMask)
#define ALL_EVENT_MASK (NEKO_EVENT_MASK | TOY_EVENT_MASK)
#define Post Toys[0]
#define Kotatsu Toys[1]
#define NTOYS 2
/*
* Toy structure
*/
typedef struct {
Cursor cursor;
Window window;
GC gc;
Pixmap save;
Pixmap mask;
XColor fg_color, bg_color;
char *foreground, *background;
char *bitmap, *bitmask;
int state;
int x, y;
int hot_x, hot_y;
unsigned int width, height;
} Toy;
/*
* Toy status const.
*/
#define TOY_NO 0 /* Toy not visible on window */
#define TOY_APPEAR 1 /* Toy appears on window */
#define TOY_YES 2 /* Toy visible on window */
#define TOY_DISAPPEAR 3 /* Toy disappears on window */
/*
* common variables
*/
extern char *ProgramName; /* program name */
extern char *ResourceName; /* resource name */
extern Display *theDisplay; /* Pointer to Display structure */
extern Window theRoot; /* Window ID of Root Window */
extern Window theNeko; /* Window ID of Cat */
extern unsigned int theRootWidth; /* Width of Root Window */
extern unsigned int theRootHeight; /* Height of Root Window */
extern char *Foreground; /* foreground */
extern char *Background; /* background */
extern char *CursorForeground; /* cursor foreground */
extern char *CursorBackground; /* cursor background */
extern long IntervalTime; /* time */
extern int NekoSpeed; /* speed */
extern int IdleSpace; /* idle */
extern char *BitmapDir; /* bitmapdir */
extern char *CursorBitmap; /* cursor bitmap */
extern char *CursorBitmask; /* cursor bitmask */
extern Cursor theCursor; /* mouse cursor id */
extern Bool NoShape; /* noshape */
extern Bool NoMouse; /* nomouse */
extern Bool SaveUnder; /* saveunder */
extern Bool BackingStore; /* backingstore */
extern long UpdateTime; /* check mail box interval (sec) */
extern Bool CheckMail; /* checking mail */
extern char *MailFile; /* mail file name */
extern Bool AutoRaise; /* auto raise */
extern char *Geometry; /* post geometry */
extern Toy Toys[]; /* 0 := Post, 1 := Kotatsu */
extern Pixmap NekoSave; /* copy neko pixmap */
extern GC SaveGC; /* copy GC id */
extern Bool MailArrive; /* mail arrived */
/*
* Functions
*/
void SetToyState();
void ToyAppear();
void ToyDisappear();
void SetMail();
void MailCheck();
char *MakeFileName();
void RestoreCursor();
void Error();
void Warning();
void InitScreen();
void GetResources();