diff options
author | rathnor <rathnor> | 2002-12-01 13:42:15 (GMT) |
---|---|---|
committer | rathnor <rathnor> | 2002-12-01 13:42:15 (GMT) |
commit | 28b5c604490094e187494dcc566bd3d7a05a2c25 (patch) | |
tree | 8f78f5714a5cd055c10b067a2656fe7b2338e71a /src/Rootmenu.cc | |
parent | b9134162f9633784d9097df18769a699a62650fe (diff) | |
download | fluxbox_pavel-28b5c604490094e187494dcc566bd3d7a05a2c25.zip fluxbox_pavel-28b5c604490094e187494dcc566bd3d7a05a2c25.tar.bz2 |
Indenting from tabs to emacs 4-space
Diffstat (limited to 'src/Rootmenu.cc')
-rw-r--r-- | src/Rootmenu.cc | 152 |
1 files changed, 76 insertions, 76 deletions
diff --git a/src/Rootmenu.cc b/src/Rootmenu.cc index 12099fa..bb290cd 100644 --- a/src/Rootmenu.cc +++ b/src/Rootmenu.cc | |||
@@ -53,8 +53,8 @@ | |||
53 | 53 | ||
54 | 54 | ||
55 | Rootmenu::Rootmenu(BScreen *scrn) | 55 | Rootmenu::Rootmenu(BScreen *scrn) |
56 | : Basemenu(scrn), | 56 | : Basemenu(scrn), |
57 | auto_group_window(0) | 57 | auto_group_window(0) |
58 | { | 58 | { |
59 | 59 | ||
60 | } | 60 | } |
@@ -62,97 +62,97 @@ Rootmenu::Rootmenu(BScreen *scrn) | |||
62 | 62 | ||
63 | void Rootmenu::itemSelected(int button, unsigned int index) { | 63 | void Rootmenu::itemSelected(int button, unsigned int index) { |
64 | 64 | ||
65 | Fluxbox *fluxbox = Fluxbox::instance(); | 65 | Fluxbox *fluxbox = Fluxbox::instance(); |
66 | 66 | ||
67 | if (button == 1) { | 67 | if (button == 1) { |
68 | BasemenuItem *item = find(index); | 68 | BasemenuItem *item = find(index); |
69 | 69 | ||
70 | if (item->function()) { | 70 | if (item->function()) { |
71 | switch (item->function()) { | 71 | switch (item->function()) { |
72 | case BScreen::EXECUTE: | 72 | case BScreen::EXECUTE: |
73 | if (item->exec().size()) { | 73 | if (item->exec().size()) { |
74 | #ifndef __EMX__ | 74 | #ifndef __EMX__ |
75 | char displaystring[MAXPATHLEN]; | 75 | char displaystring[MAXPATHLEN]; |
76 | sprintf(displaystring, "DISPLAY=%s", | 76 | sprintf(displaystring, "DISPLAY=%s", |
77 | DisplayString(screen()->getBaseDisplay()->getXDisplay())); | 77 | DisplayString(screen()->getBaseDisplay()->getXDisplay())); |
78 | sprintf(displaystring + strlen(displaystring) - 1, "%d", | 78 | sprintf(displaystring + strlen(displaystring) - 1, "%d", |
79 | screen()->getScreenNumber()); | 79 | screen()->getScreenNumber()); |
80 | 80 | ||
81 | screen()->setAutoGroupWindow(useAutoGroupWindow()); | 81 | screen()->setAutoGroupWindow(useAutoGroupWindow()); |
82 | 82 | ||
83 | bexec(item->exec().c_str(), displaystring); | 83 | bexec(item->exec().c_str(), displaystring); |
84 | #else // __EMX__ | 84 | #else // __EMX__ |
85 | spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", item->exec().c_str(), NULL); | 85 | spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", item->exec().c_str(), NULL); |
86 | #endif // !__EMX__ | 86 | #endif // !__EMX__ |
87 | } | 87 | } |
88 | break; | 88 | break; |
89 | 89 | ||
90 | case BScreen::RESTART: | 90 | case BScreen::RESTART: |
91 | fluxbox->restart(); | 91 | fluxbox->restart(); |
92 | break; | 92 | break; |
93 | 93 | ||
94 | case BScreen::RESTARTOTHER: | 94 | case BScreen::RESTARTOTHER: |
95 | if (item->exec().size()) | 95 | if (item->exec().size()) |
96 | fluxbox->restart(item->exec().c_str()); | 96 | fluxbox->restart(item->exec().c_str()); |
97 | break; | 97 | break; |
98 | 98 | ||
99 | case BScreen::EXIT: | 99 | case BScreen::EXIT: |
100 | fluxbox->shutdown(); | 100 | fluxbox->shutdown(); |
101 | break; | 101 | break; |
102 | 102 | ||
103 | case BScreen::SETSTYLE: | 103 | case BScreen::SETSTYLE: |
104 | if (item->exec().size()) { | 104 | if (item->exec().size()) { |
105 | fluxbox->saveStyleFilename(item->exec().c_str()); | 105 | fluxbox->saveStyleFilename(item->exec().c_str()); |
106 | fluxbox->reconfigureTabs(); | 106 | fluxbox->reconfigureTabs(); |
107 | } | 107 | } |
108 | fluxbox->reconfigure(); | 108 | fluxbox->reconfigure(); |
109 | fluxbox->save_rc(); | 109 | fluxbox->save_rc(); |
110 | break; | 110 | break; |
111 | case BScreen::RECONFIGURE: | 111 | case BScreen::RECONFIGURE: |
112 | fluxbox->reconfigure(); | 112 | fluxbox->reconfigure(); |
113 | return; | 113 | return; |
114 | } | 114 | } |
115 | if (! (screen()->getRootmenu()->isTorn() || isTorn()) && | 115 | if (! (screen()->getRootmenu()->isTorn() || isTorn()) && |
116 | item->function() != BScreen::RECONFIGURE && | 116 | item->function() != BScreen::RECONFIGURE && |
117 | item->function() != BScreen::SETSTYLE) | 117 | item->function() != BScreen::SETSTYLE) |
118 | hide(); | 118 | hide(); |
119 | } | 119 | } |
120 | } | 120 | } |
121 | } | 121 | } |
122 | 122 | ||
123 | void Rootmenu::setAutoGroupWindow(Window window) { | 123 | void Rootmenu::setAutoGroupWindow(Window window) { |
124 | auto_group_window = window; | 124 | auto_group_window = window; |
125 | } | 125 | } |
126 | 126 | ||
127 | void Rootmenu::show() { | 127 | void Rootmenu::show() { |
128 | Basemenu::show(); | 128 | Basemenu::show(); |
129 | // make sure it's full visible | 129 | // make sure it's full visible |
130 | 130 | ||
131 | int newx = x(), newy = y(); | 131 | int newx = x(), newy = y(); |
132 | if (x() < 0) | 132 | if (x() < 0) |
133 | newx = 0; | 133 | newx = 0; |
134 | else if (x() + width() > screen()->getWidth()) | 134 | else if (x() + width() > screen()->getWidth()) |
135 | newx = screen()->getWidth() - width(); | 135 | newx = screen()->getWidth() - width(); |
136 | if (y() < 0) | 136 | if (y() < 0) |
137 | newy = 0; | 137 | newy = 0; |
138 | else if (y() + height() > screen()->getHeight()) | 138 | else if (y() + height() > screen()->getHeight()) |
139 | newy = screen()->getHeight() - height(); | 139 | newy = screen()->getHeight() - height(); |
140 | 140 | ||
141 | move(newx, newy); | 141 | move(newx, newy); |
142 | } | 142 | } |
143 | 143 | ||
144 | Window Rootmenu::useAutoGroupWindow() { | 144 | Window Rootmenu::useAutoGroupWindow() { |
145 | // Return and clear the auto-grouping state. | 145 | // Return and clear the auto-grouping state. |
146 | Window w = auto_group_window; | 146 | Window w = auto_group_window; |
147 | if (w) | 147 | if (w) |
148 | auto_group_window = 0; // clear it immediately | 148 | auto_group_window = 0; // clear it immediately |
149 | // If not set check the parent and the parent's parent, ... | 149 | // If not set check the parent and the parent's parent, ... |
150 | else if (parent()) { | 150 | else if (parent()) { |
151 | // TODO: dynamic_cast throws std::bad_cast! | 151 | // TODO: dynamic_cast throws std::bad_cast! |
152 | Rootmenu *p = dynamic_cast<Rootmenu*>(parent()); | 152 | Rootmenu *p = dynamic_cast<Rootmenu*>(parent()); |
153 | w = p->useAutoGroupWindow(); | 153 | w = p->useAutoGroupWindow(); |
154 | } | 154 | } |
155 | return w; | 155 | return w; |
156 | } | 156 | } |
157 | 157 | ||
158 | 158 | ||