aboutsummaryrefslogtreecommitdiff
path: root/src/Tab.hh
diff options
context:
space:
mode:
authorrathnor <rathnor>2002-12-01 13:42:15 (GMT)
committerrathnor <rathnor>2002-12-01 13:42:15 (GMT)
commit28b5c604490094e187494dcc566bd3d7a05a2c25 (patch)
tree8f78f5714a5cd055c10b067a2656fe7b2338e71a /src/Tab.hh
parentb9134162f9633784d9097df18769a699a62650fe (diff)
downloadfluxbox_pavel-28b5c604490094e187494dcc566bd3d7a05a2c25.zip
fluxbox_pavel-28b5c604490094e187494dcc566bd3d7a05a2c25.tar.bz2
Indenting from tabs to emacs 4-space
Diffstat (limited to 'src/Tab.hh')
-rw-r--r--src/Tab.hh190
1 files changed, 95 insertions, 95 deletions
diff --git a/src/Tab.hh b/src/Tab.hh
index c586f22..ab50882 100644
--- a/src/Tab.hh
+++ b/src/Tab.hh
@@ -19,7 +19,7 @@
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.16 2002/11/30 20:56:21 fluxgen Exp $ 22// $Id: Tab.hh,v 1.17 2002/12/01 13:42:00 rathnor Exp $
23 23
24#ifndef TAB_HH 24#ifndef TAB_HH
25#define TAB_HH 25#define TAB_HH
@@ -33,118 +33,118 @@ Note: Tab is a friend of FluxboxWindow
33*/ 33*/
34class Tab { 34class Tab {
35public: 35public:
36 enum Placement{ PTOP = 0, PBOTTOM = 5, PLEFT = 10, PRIGHT = 15, PNONE = 20}; 36 enum Placement{ PTOP = 0, PBOTTOM = 5, PLEFT = 10, PRIGHT = 15, PNONE = 20};
37 enum Alignment{ ALEFT = 0, ACENTER, ARIGHT, ARELATIVE, ANONE }; 37 enum Alignment{ ALEFT = 0, ACENTER, ARIGHT, ARELATIVE, ANONE };
38 38
39 Tab(FluxboxWindow *win, Tab *prev=0, Tab *next=0); 39 Tab(FluxboxWindow *win, Tab *prev=0, Tab *next=0);
40 ~Tab(); 40 ~Tab();
41 41
42 void setConfigured(bool value) { m_configured = value; } 42 void setConfigured(bool value) { m_configured = value; }
43 Tab *next() { return m_next; } 43 Tab *next() { return m_next; }
44 Tab *prev() { return m_prev; } 44 Tab *prev() { return m_prev; }
45 Tab *last() { return getLast(this); } 45 Tab *last() { return getLast(this); }
46 Tab *first() { return getFirst(this); } 46 Tab *first() { return getFirst(this); }
47 FluxboxWindow *getWindow() { return m_win; } 47 FluxboxWindow *getWindow() { return m_win; }
48 48
49 void focus(); 49 void focus();
50 void decorate(); 50 void decorate();
51 void deiconify(); 51 void deiconify();
52 void iconify(); 52 void iconify();
53 void raise(); 53 void raise();
54 void lower(); 54 void lower();
55 void withdraw(); 55 void withdraw();
56 void stick(); 56 void stick();
57 void resize(); 57 void resize();
58 void shade(); 58 void shade();
59 void setPosition(); //position tab to follow (FluxboxWindow *) m_win 59 void setPosition(); //position tab to follow (FluxboxWindow *) m_win
60 void moveNext(); 60 void moveNext();
61 void movePrev(); 61 void movePrev();
62 void insert(Tab *next); 62 void insert(Tab *next);
63 63
64 //event handlers 64 //event handlers
65 void buttonReleaseEvent(XButtonEvent *be); 65 void buttonReleaseEvent(XButtonEvent *be);
66 void buttonPressEvent(XButtonEvent *be); 66 void buttonPressEvent(XButtonEvent *be);
67 void exposeEvent(XExposeEvent *ee); 67 void exposeEvent(XExposeEvent *ee);
68 void motionNotifyEvent(XMotionEvent *me); 68 void motionNotifyEvent(XMotionEvent *me);
69 69
70 void disconnect(); 70 void disconnect();
71 71
72 //accessors 72 //accessors
73 73
74 static const char *getTabPlacementString(Tab::Placement placement); 74 static const char *getTabPlacementString(Tab::Placement placement);
75 static Tab::Placement getTabPlacementNum(const char *string); 75 static Tab::Placement getTabPlacementNum(const char *string);
76 static const char *getTabAlignmentString(Tab::Alignment alignment); 76 static const char *getTabAlignmentString(Tab::Alignment alignment);
77 static Tab::Alignment getTabAlignmentNum(const char *string); 77 static Tab::Alignment getTabAlignmentNum(const char *string);
78 78
79 const Tab *next() const { return m_next; } 79 const Tab *next() const { return m_next; }
80 const Tab *prev() const { return m_prev; } 80 const Tab *prev() const { return m_prev; }
81 const Tab *last() const { return getLast(const_cast<Tab *>(this)); } 81 const Tab *last() const { return getLast(const_cast<Tab *>(this)); }
82 const Tab *first() const { return getFirst(const_cast<Tab *>(this)); } 82 const Tab *first() const { return getFirst(const_cast<Tab *>(this)); }
83 83
84 const FluxboxWindow *getWindow() const { return m_win; } 84 const FluxboxWindow *getWindow() const { return m_win; }
85 Window getTabWindow() const { return m_tabwin; } 85 Window getTabWindow() const { return m_tabwin; }
86 unsigned int getTabWidth() const { return m_size_w; } 86 unsigned int getTabWidth() const { return m_size_w; }
87 unsigned int getTabHeight() const { return m_size_h; } 87 unsigned int getTabHeight() const { return m_size_h; }
88 88
89 void resizeGroup(); // used when (un)shading windows 89 void resizeGroup(); // used when (un)shading windows
90 void calcIncrease(); 90 void calcIncrease();
91 bool configured() const { return m_configured; } 91 bool configured() const { return m_configured; }
92 void draw(bool pressed) const; 92 void draw(bool pressed) const;
93 93
94 bool addWindowToGroup(FluxboxWindow *window); 94 bool addWindowToGroup(FluxboxWindow *window);
95 95
96 static Tab *getFirst(Tab *current); 96 static Tab *getFirst(Tab *current);
97 static Tab *getLast(Tab *current); 97 static Tab *getLast(Tab *current);
98 98
99private: 99private:
100 100
101 bool m_configured; 101 bool m_configured;
102 102
103 103
104 //The size of the tab 104 //The size of the tab
105 unsigned int m_size_w; 105 unsigned int m_size_w;
106 unsigned int m_size_h; 106 unsigned int m_size_h;
107 //Increasements 107 //Increasements
108 int m_inc_x; 108 int m_inc_x;
109 int m_inc_y; 109 int m_inc_y;
110 static const int m_max_tabs; 110 static const int m_max_tabs;
111 bool m_focus, m_moving; // moving and focus 111 bool m_focus, m_moving; // moving and focus
112 void createTabWindow(); // creates the X win of tab 112 void createTabWindow(); // creates the X win of tab
113 void loadTheme(); // loads the textures with right width and height 113 void loadTheme(); // loads the textures with right width and height
114 int setPositionShadingHelper(bool shaded); 114 int setPositionShadingHelper(bool shaded);
115 int setPositionTBAlignHelper(Alignment align); 115 int setPositionTBAlignHelper(Alignment align);
116 int setPositionLRAlignHelper(Alignment align); 116 int setPositionLRAlignHelper(Alignment align);
117 void setTabWidth(unsigned int w); 117 void setTabWidth(unsigned int w);
118 void setTabHeight(unsigned int h); 118 void setTabHeight(unsigned int h);
119 unsigned int numObjects(); 119 unsigned int numObjects();
120 unsigned int calcRelativeWidth(); 120 unsigned int calcRelativeWidth();
121 unsigned int calcRelativeHeight(); 121 unsigned int calcRelativeHeight();
122 unsigned int calcCenterXPos(); 122 unsigned int calcCenterXPos();
123 unsigned int calcCenterYPos(); 123 unsigned int calcCenterYPos();
124 int m_move_x, m_move_y; // Move coordinates, holds moving coordinates when draging 124 int m_move_x, m_move_y; // Move coordinates, holds moving coordinates when draging
125 Tab *m_prev; 125 Tab *m_prev;
126 Tab *m_next; 126 Tab *m_next;
127 FluxboxWindow *m_win; 127 FluxboxWindow *m_win;
128 Window m_tabwin; 128 Window m_tabwin;
129 Display *m_display; 129 Display *m_display;
130 Pixmap m_focus_pm, m_unfocus_pm; 130 Pixmap m_focus_pm, m_unfocus_pm;
131 unsigned long m_focus_pixel, m_unfocus_pixel; 131 unsigned long m_focus_pixel, m_unfocus_pixel;
132 static bool m_stoptabs; //used to "freeze" the tabs functions 132 static bool m_stoptabs; //used to "freeze" the tabs functions
133 133
134 struct t_tabplacementlist{ 134 struct t_tabplacementlist{
135 int tp; 135 int tp;
136 const char *string; 136 const char *string;
137 inline bool operator == (int p) { 137 inline bool operator == (int p) {
138 return (tp==p); 138 return (tp==p);
139 } 139 }
140 inline bool operator == (const char *str) { 140 inline bool operator == (const char *str) {
141 if (strcasecmp(string, str) == 0) 141 if (strcasecmp(string, str) == 0)
142 return true; 142 return true;
143 return false; 143 return false;
144 } 144 }
145 }; 145 };
146 static t_tabplacementlist m_tabplacementlist[]; 146 static t_tabplacementlist m_tabplacementlist[];
147 static t_tabplacementlist m_tabalignmentlist[]; 147 static t_tabplacementlist m_tabalignmentlist[];
148 148
149}; 149};
150 150