summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Tab.hh62
1 files changed, 36 insertions, 26 deletions
diff --git a/src/Tab.hh b/src/Tab.hh
index 22d0980..e3abf51 100644
--- a/src/Tab.hh
+++ b/src/Tab.hh
@@ -19,18 +19,14 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: Tab.hh,v 1.12 2002/05/02 07:08:24 fluxgen Exp $ 22// $Id: Tab.hh,v 1.13 2002/05/19 15:35:39 fluxgen Exp $
23 23
24#ifndef TAB_HH 24#ifndef TAB_HH
25#define TAB_HH 25#define TAB_HH
26 26
27#ifndef _IMAGE_HH_
28#include "Image.hh" 27#include "Image.hh"
29#endif
30
31#ifndef _WINDOW_HH_
32#include "Window.hh" 28#include "Window.hh"
33#endif 29
34 30
35//Note: Tab is a friend of FluxboxWindow 31//Note: Tab is a friend of FluxboxWindow
36 32
@@ -42,15 +38,14 @@ public:
42 38
43 Tab(FluxboxWindow *win, Tab *prev=0, Tab *next=0); 39 Tab(FluxboxWindow *win, Tab *prev=0, Tab *next=0);
44 ~Tab(); 40 ~Tab();
45 void draw(bool pressed); 41
46 inline Tab *next() const { return m_next; } 42 void setConfigured(bool value) { m_configured = value; }
47 inline Tab *prev() const { return m_prev; } 43 Tab *next() { return m_next; }
48 inline Tab *last() { return getLast(this); } 44 Tab *prev() { return m_prev; }
49 inline Tab *first() { return getFirst(this); } 45 Tab *last() { return getLast(this); }
50 46 Tab *first() { return getFirst(this); }
51 inline FluxboxWindow *getWindow() const { return m_win; } 47 FluxboxWindow *getWindow() { return m_win; }
52 inline unsigned int getTabWidth() const { return m_size_w; } 48
53 inline unsigned int getTabHeight() const { return m_size_h; }
54 void focus(); 49 void focus();
55 void decorate(); 50 void decorate();
56 void deiconify(); 51 void deiconify();
@@ -60,30 +55,45 @@ public:
60 void withdraw(); 55 void withdraw();
61 void stick(); 56 void stick();
62 void resize(); 57 void resize();
63 void shade(); 58 void shade();
64 //position tab to follow (FluxboxWindow *) m_win 59 void setPosition(); //position tab to follow (FluxboxWindow *) m_win
65 void setPosition();
66 void moveNext(); 60 void moveNext();
67 void movePrev(); 61 void movePrev();
62
68 //event handlers 63 //event handlers
69 void buttonReleaseEvent(XButtonEvent *be); 64 void buttonReleaseEvent(XButtonEvent *be);
70 void buttonPressEvent(XButtonEvent *be); 65 void buttonPressEvent(XButtonEvent *be);
71 void exposeEvent(XExposeEvent *ee); 66 void exposeEvent(XExposeEvent *ee);
72 void motionNotifyEvent(XMotionEvent *me); 67 void motionNotifyEvent(XMotionEvent *me);
73 static Tab *getFirst(Tab *current); 68
74 static Tab *getLast(Tab *current);
75 void disconnect(); 69 void disconnect();
76 70
71 //accessors
72
77 static const char *getTabPlacementString(Tab::Placement placement); 73 static const char *getTabPlacementString(Tab::Placement placement);
78 static Tab::Placement getTabPlacementNum(const char *string); 74 static Tab::Placement getTabPlacementNum(const char *string);
79 static const char *getTabAlignmentString(Tab::Alignment alignment); 75 static const char *getTabAlignmentString(Tab::Alignment alignment);
80 static Tab::Alignment getTabAlignmentNum(const char *string); 76 static Tab::Alignment getTabAlignmentNum(const char *string);
81 77
78 const Tab *next() const { return m_next; }
79 const Tab *prev() const { return m_prev; }
80 const Tab *last() const { return getLast(const_cast<Tab *>(this)); }
81 const Tab *first() const { return getFirst(const_cast<Tab *>(this)); }
82
83 const FluxboxWindow *getWindow() const { return m_win; }
84 unsigned int getTabWidth() const { return m_size_w; }
85 unsigned int getTabHeight() const { return m_size_h; }
86
82 void resizeGroup(void); // used when (un)shading windows 87 void resizeGroup(void); // used when (un)shading windows
83 void calcIncrease(void); 88 void calcIncrease(void);
84 inline bool configured() { return m_configured; } 89 bool configured() const { return m_configured; }
85 inline void setConfigured(bool value) { m_configured = value; } 90 void draw(bool pressed) const;
91
92 static Tab *getFirst(Tab *current);
93 static Tab *getLast(Tab *current);
94
86private: 95private:
96
87 bool m_configured; 97 bool m_configured;
88 98
89 void insert(Tab *next); 99 void insert(Tab *next);
@@ -124,7 +134,7 @@ private:
124 return (tp==p); 134 return (tp==p);
125 } 135 }
126 inline bool operator == (const char *str) { 136 inline bool operator == (const char *str) {
127 if (strcasecmp(string, str)==0) 137 if (strcasecmp(string, str) == 0)
128 return true; 138 return true;
129 return false; 139 return false;
130 } 140 }
@@ -134,4 +144,4 @@ private:
134 144
135}; 145};
136 146
137#endif //_TAB_HH_ 147#endif //TAB_HH