initial import
[bbkeys.git] / resource.hh
blob5654aacadbcc53cec800094c0f7658899eba942c
1 // resource.hh for bbkeys - a pager tool for Blackbox
2 //
3 // Copyright (c) 1998-1999 John Kennis, jkennis@chello.nl
4 //
5 // this program is free software; you can redistribute it and/or modify
6 // it under the terms of the gnu general public license as published by
7 // the free software foundation; either version 2 of the license, or
8 // (at your option) any later version.
9 //
10 // this program is distributed in the hope that it will be useful,
11 // but without any warranty; without even the implied warranty of
12 // merchantability or fitness for a particular purpose. see the
13 // gnu general public license for more details.
15 // you should have received a copy of the gnu general public license
16 // along with this program; if not, write to the free software
17 // foundation, inc., 675 mass ave, cambridge, ma 02139, usa.
19 // (see the included file copying / gpl-2.0)
23 #ifndef __RESOURCE_HH
24 #define __RESOURCE_HH
26 #include "bbkeys.hh"
27 #include "Baseresource.hh"
29 class BaseResource;
31 enum {none=0, border=1, texture=2};
32 enum WHICH_BUTTON { LEFT_BUTTON = 1, MIDDLE_BUTTON, RIGHT_BUTTON,
33 FOURTH_BUTTON, FIFTH_BUTTON};
35 struct FRAME {
36 int width;
37 int height;
38 BTexture texture;
39 int bevelWidth;
40 XFontStruct *font;
43 struct POSITION {
44 int x;
45 int y;
46 int mask;
47 bool vertical;
48 bool horizontal;
51 struct LABEL {
52 int width;
53 int width0, width1, width2, width3;
54 int height;
55 bool transparent;
56 BTexture texture;
57 XFontStruct *font;
58 BColor textColor;
61 struct SHOW {
62 bool newmail_counter;
63 bool totalmail_counter;
64 bool label;
65 bool envelope;
66 bool onlyAtNewMail;
69 struct SIZE {
70 unsigned int width;
71 unsigned int height;
74 struct REPORT {
75 bool auto_raise;
78 struct BBPAGERWIN {
79 BTexture texture;
80 BTexture focusedTexture;
81 BColor activeColor;
82 BColor inactiveColor;
85 struct BUTTON {
86 BTexture texture;
87 BTexture texture_pressed;
90 class Resource : public BaseResource {
92 public:
93 Resource(ToolWindow *);
94 ~Resource(void);
96 struct FRAME frame;
97 struct LABEL label;
98 struct SHOW show;
99 struct BUTTON button;
100 struct POSITION position;
101 struct SIZE desktopSize;
102 struct REPORT report;
103 struct BBPAGERWIN pagerwin;
104 struct BBPAGERWIN desktopwin;
105 int columns;
106 int rows;
107 int getFocusStyle(void) { return focus_style; }
108 int getDesktopFocusStyle(void) { return desktop_focus_style; }
109 WHICH_BUTTON getWindowMoveButton(void) { return window_move_button; }
110 WHICH_BUTTON getDesktopChangeButton(void) { return desktop_change_button; }
111 WHICH_BUTTON getWindowRaiseButton(void) { return window_raise_button; }
112 WHICH_BUTTON getWindowFocusButton(void) { return window_focus_button; }
115 protected:
116 virtual void LoadBBToolResource(void);
118 private:
119 void Frame(void);
120 void SizeAndPosition(void);
121 void PagerWin(void);
122 int focus_style;
123 int desktop_focus_style;
124 void Label(void);
125 void Show(void);
126 void Button(void);
127 WHICH_BUTTON window_move_button;
128 WHICH_BUTTON desktop_change_button;
129 WHICH_BUTTON window_raise_button;
130 WHICH_BUTTON window_focus_button;
131 void Clean(void);
133 #endif /* __RESOURCE_HH */