File: resource.hh

package info (click to toggle)
bbmail 0.8.3-7
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 784 kB
  • sloc: cpp: 7,307; sh: 3,506; makefile: 83; perl: 26
file content (183 lines) | stat: -rw-r--r-- 3,437 bytes parent folder | download | duplicates (5)
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
// resource.hh for bbmail - an tool to display new mail in X11.
//
//  this program is free software; you can redistribute it and/or modify
//  it under the terms of the gnu general public license as published by
//  the free software foundation; either version 2 of the license, or
//  (at your option) any later version.
//
//  this program is distributed in the hope that it will be useful,
//  but without any warranty; without even the implied warranty of
//  merchantability or fitness for a particular purpose.  see the
//  gnu general public license for more details.
//
//  you should have received a copy of the gnu general public license
//  along with this program; if not, write to the free software
//  foundation, inc., 675 mass ave, cambridge, ma 02139, usa.
//
// (see the included file copying / gpl-2.0)
//


#ifndef __RESOURCE_HH
#define __RESOURCE_HH

#include "bbmail.hh"
#include "spoollist.hh"
#include "Baseresource.hh"

class SpoolList;
class BaseResource;

struct FRAME
{
	int width;
	int height;
	BTexture texture;
	int bevelWidth;
	XFontStruct *font;
};

struct POSITION
{
	int x;
	int y;
	int mask;
};

struct LABEL
{
	int width;
	int width0, width1, width2, width3;
	int height;
	bool transparent;
	BTexture texture;
	XFontStruct *font;
	BColor newmail_textColor;
	BColor totalmail_textColor;
	BColor seperator_textColor;
	BColor newmail_boring_textColor;
	BColor totalmail_boring_textColor;
	BColor seperator_boring_textColor;
};

struct MENU
{
	BTexture texture;
	BColor textColor;
	BColor highlightColor;
	BColor hitextColor;
	int justify;
	XFontStruct *font;
	int bullet_style;
	int bullet_pos;
};

struct ENVELOPE
{
	int width;
	int height;
	BTexture texture;
	BTexture texture_pressed;
	BColor textColor;
	BColor error_textColor;
	int bevelWidth;
	int bevelHeight;
};

struct SHOW
{
	bool newmail_counter;
	bool totalmail_counter;
	bool label;
	bool envelope;
	bool onlyAtNewMail;
};

struct REPORT
{
	bool auto_raise;
	unsigned int check_delay;
	unsigned int force_check_delay;
	bool force_check;
	int number_of_spoolfiles;
	int number_of_digits;
	char *runCommand;
};


class Resource : public BaseResource
{

public:
	Resource(ToolWindow *);
	~Resource(void);

	struct FRAME frame;
	struct LABEL label;
	struct POSITION position;
	struct ENVELOPE envelope;
	struct SHOW show;
	struct REPORT report;
	struct MENU menu;
	SpoolList *spoolfile;

	/* menu */
	const int getJustification(void) const
	{
		return LeftJustify;
	}
	int getMenuJustification(void)
	{
		return menu.justify;
	}
	XFontStruct *getTitleFont(void)
	{
		return menu.font;
	}
	XFontStruct *getMenuFont(void)
	{
		return menu.font;
	}
	unsigned int getBevelWidth(void)
	{
		return frame.bevelWidth;
	}
	BColor *getBorderColor(void)
	{
		return frame.texture.getColor();
	}
	unsigned int getBorderWidth(void)
	{
		return 0;
	}
	int getBulletStyle(void)
	{
		return menu.bullet_style;
	}
	int getBulletPosition(void)
	{
		return menu.bullet_pos;
	}


	enum { AlignDontCare = 1, AlignTop, AlignBottom };
	enum { Right = 1, Left };
	enum { Empty = 0, Round, Square, Triangle, Diamond };
	enum { LeftJustify = 1, RightJustify, CenterJustify };

protected:
	virtual void  LoadBBToolResource(void);

private:
	void Frame(void);
	void SizeAndPosition(void);
	void MailCheckSettings(void);
	void Label(void);
	void Show(void);
	void Envelope(void);
	void MailboxDep(void);
	void Menu(void);

	void Clean(void);
};
#endif /* __RESOURCE_HH */