summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--src/FbAtoms.cc5
-rw-r--r--src/FbTk/App.cc5
-rw-r--r--src/FocusControl.cc2
-rw-r--r--src/Keys.cc5
-rw-r--r--src/Slit.cc5
-rw-r--r--util/fbrun/FbRun.cc62
7 files changed, 34 insertions, 53 deletions
diff --git a/ChangeLog b/ChangeLog
index 13e866e..3306f27 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
1(Format: Year/Month/Day) 1(Format: Year/Month/Day)
2Changes for 0.9.16: 2Changes for 0.9.16:
3*06/04/25: 3*06/04/25:
4 * Cleanup unneeded headers (thanks Slava Semushin)
5 FbAtoms.cc Slit.cc Keys.cc FocusControl.cc FbTk/App.cc
6 util/fbrun/FbRun.cc
4 * Fix occasional highlighting of menu nops+separators, sf.net patch 7 * Fix occasional highlighting of menu nops+separators, sf.net patch
5 #1475268 (thanks Scott Kuhl; skuhl AT cs utah edu) 8 #1475268 (thanks Scott Kuhl; skuhl AT cs utah edu)
6 FbTk/MenuSeparator.hh/cc FbTk/Menu.cc MenuCreator.cc 9 FbTk/MenuSeparator.hh/cc FbTk/Menu.cc MenuCreator.cc
diff --git a/src/FbAtoms.cc b/src/FbAtoms.cc
index 6a67cdf..5314538 100644
--- a/src/FbAtoms.cc
+++ b/src/FbAtoms.cc
@@ -25,11 +25,6 @@
25#include "App.hh" 25#include "App.hh"
26 26
27#include <string> 27#include <string>
28#ifdef HAVE_CASSERT
29 #include <cassert>
30#else
31 #include <assert.h>
32#endif
33 28
34using namespace std; 29using namespace std;
35 30
diff --git a/src/FbTk/App.cc b/src/FbTk/App.cc
index 1ef5aed..11bea9b 100644
--- a/src/FbTk/App.cc
+++ b/src/FbTk/App.cc
@@ -25,11 +25,6 @@
25 25
26#include "EventManager.hh" 26#include "EventManager.hh"
27 27
28#ifdef HAVE_CASSERT
29 #include <cassert>
30#else
31 #include <assert.h>
32#endif
33#include <string> 28#include <string>
34 29
35namespace FbTk { 30namespace FbTk {
diff --git a/src/FocusControl.cc b/src/FocusControl.cc
index f7ed962..e92eced 100644
--- a/src/FocusControl.cc
+++ b/src/FocusControl.cc
@@ -31,8 +31,8 @@
31#include "FbWinFrameTheme.hh" 31#include "FbWinFrameTheme.hh"
32 32
33#include <string> 33#include <string>
34#include <cassert>
35#include <iostream> 34#include <iostream>
35
36using std::cerr; 36using std::cerr;
37using std::endl; 37using std::endl;
38using std::string; 38using std::string;
diff --git a/src/Keys.cc b/src/Keys.cc
index 78ad912..c6276c5 100644
--- a/src/Keys.cc
+++ b/src/Keys.cc
@@ -87,11 +87,6 @@
87#include <fstream> 87#include <fstream>
88#include <vector> 88#include <vector>
89#include <map> 89#include <map>
90#ifdef HAVE_CASSERT
91 #include <cassert>
92#else
93 #include <assert.h>
94#endif
95#include <memory> 90#include <memory>
96 91
97using namespace std; 92using namespace std;
diff --git a/src/Slit.cc b/src/Slit.cc
index db2deae..15b171f 100644
--- a/src/Slit.cc
+++ b/src/Slit.cc
@@ -67,11 +67,6 @@
67 67
68#include <algorithm> 68#include <algorithm>
69#include <iostream> 69#include <iostream>
70#ifdef HAVE_CASSERT
71 #include <cassert>
72#else
73 #include <assert.h>
74#endif
75 70
76#ifdef HAVE_SYS_STAT_H 71#ifdef HAVE_SYS_STAT_H
77#include <sys/types.h> 72#include <sys/types.h>
diff --git a/util/fbrun/FbRun.cc b/util/fbrun/FbRun.cc
index 7392083..c175e67 100644
--- a/util/fbrun/FbRun.cc
+++ b/util/fbrun/FbRun.cc
@@ -48,13 +48,9 @@
48#include <iterator> 48#include <iterator>
49#include <fstream> 49#include <fstream>
50#include <algorithm> 50#include <algorithm>
51#ifdef HAVE_CASSERT
52 #include <cassert>
53#else
54 #include <assert.h>
55#endif
56 51
57using namespace std; 52using namespace std;
53
58FbRun::FbRun(int x, int y, size_t width): 54FbRun::FbRun(int x, int y, size_t width):
59 FbTk::TextBox(DefaultScreen(FbTk::App::instance()->display()), 55 FbTk::TextBox(DefaultScreen(FbTk::App::instance()->display()),
60 m_font, ""), 56 m_font, ""),
@@ -67,7 +63,7 @@ FbRun::FbRun(int x, int y, size_t width):
67 m_last_completion_prefix(""), 63 m_last_completion_prefix(""),
68 m_current_apps_item(0), 64 m_current_apps_item(0),
69 m_cursor(XCreateFontCursor(FbTk::App::instance()->display(), XC_xterm)) { 65 m_cursor(XCreateFontCursor(FbTk::App::instance()->display(), XC_xterm)) {
70 66
71 setGC(m_gc.gc()); 67 setGC(m_gc.gc());
72 setCursor(m_cursor); 68 setCursor(m_cursor);
73 // setting nomaximize in local resize 69 // setting nomaximize in local resize
@@ -78,9 +74,9 @@ FbRun::FbRun(int x, int y, size_t width):
78 if (class_hint == 0) 74 if (class_hint == 0)
79 throw string("Out of memory"); 75 throw string("Out of memory");
80 class_hint->res_name = "fbrun"; 76 class_hint->res_name = "fbrun";
81 class_hint->res_class = "FbRun"; 77 class_hint->res_class = "FbRun";
82 XSetClassHint(m_display, window(), class_hint); 78 XSetClassHint(m_display, window(), class_hint);
83 79
84 XFree(class_hint); 80 XFree(class_hint);
85#ifdef HAVE_XPM 81#ifdef HAVE_XPM
86 Pixmap mask = 0; 82 Pixmap mask = 0;
@@ -123,7 +119,7 @@ void FbRun::run(const std::string &command) {
123 } 119 }
124 120
125 hide(); // hide gui 121 hide(); // hide gui
126 122
127 // save command history to file 123 // save command history to file
128 if (text().size() != 0) { // no need to save empty command 124 if (text().size() != 0) { // no need to save empty command
129 125
@@ -134,7 +130,7 @@ void FbRun::run(const std::string &command) {
134 // m_current_history_item is the duplicate 130 // m_current_history_item is the duplicate
135 } else { 131 } else {
136 m_current_history_item = 0; 132 m_current_history_item = 0;
137 for (; m_current_history_item < m_history.size(); 133 for (; m_current_history_item < m_history.size();
138 ++m_current_history_item) { 134 ++m_current_history_item) {
139 if (m_history[m_current_history_item] == text()) 135 if (m_history[m_current_history_item] == text())
140 break; 136 break;
@@ -154,7 +150,7 @@ void FbRun::run(const std::string &command) {
154 // write the history items that come after current 150 // write the history items that come after current
155 for (i++; i < m_history.size(); i++) 151 for (i++; i < m_history.size(); i++)
156 inoutfile<<m_history[i]<<endl; 152 inoutfile<<m_history[i]<<endl;
157 153
158 } else { 154 } else {
159 // set put-pointer at end of file 155 // set put-pointer at end of file
160 inoutfile.seekp(0, ios::end); 156 inoutfile.seekp(0, ios::end);
@@ -215,7 +211,7 @@ void FbRun::setTitle(const string &title) {
215} 211}
216 212
217void FbRun::resize(unsigned int width, unsigned int height) { 213void FbRun::resize(unsigned int width, unsigned int height) {
218 FbTk::TextBox::resize(width, height); 214 FbTk::TextBox::resize(width, height);
219} 215}
220 216
221void FbRun::redrawLabel() { 217void FbRun::redrawLabel() {
@@ -233,7 +229,7 @@ void FbRun::keyPressEvent(XKeyEvent &ke) {
233 char keychar[1]; 229 char keychar[1];
234 XLookupString(&ke, keychar, 1, &ks, 0); 230 XLookupString(&ke, keychar, 1, &ks, 0);
235 // a modifier key by itself doesn't do anything 231 // a modifier key by itself doesn't do anything
236 if (IsModifierKey(ks)) 232 if (IsModifierKey(ks))
237 return; 233 return;
238 234
239 if (FbTk::KeyUtil::instance().isolateModifierMask(ke.state)) { // a modifier key is down 235 if (FbTk::KeyUtil::instance().isolateModifierMask(ke.state)) { // a modifier key is down
@@ -374,7 +370,7 @@ void FbRun::tabCompleteHistory() {
374} 370}
375 371
376void FbRun::tabCompleteApps() { 372void FbRun::tabCompleteApps() {
377 373
378 static bool first_run= true; 374 static bool first_run= true;
379 if (m_last_completion_prefix.empty()) 375 if (m_last_completion_prefix.empty())
380 m_last_completion_prefix = text().substr(0, textStartPos() + cursorPosition()); 376 m_last_completion_prefix = text().substr(0, textStartPos() + cursorPosition());
@@ -387,19 +383,21 @@ void FbRun::tabCompleteApps() {
387 // (re)build m_apps-container 383 // (re)build m_apps-container
388 if (first_run || m_last_completion_prefix != prefix) { 384 if (first_run || m_last_completion_prefix != prefix) {
389 first_run= false; 385 first_run= false;
390 386
391 string path; 387 string path;
392 388
393 if(!prefix.empty() && 389 if(!prefix.empty() &&
394 string("/.~").find_first_of(prefix[0]) != string::npos) { 390 string("/.~").find_first_of(prefix[0]) != string::npos) {
395 size_t rseparator= prefix.find_last_of("/"); 391 size_t rseparator= prefix.find_last_of("/");
396 path= prefix.substr(0, rseparator + 1) + ":"; 392 path= prefix.substr(0, rseparator + 1) + ":";
397 add_dirs= true; 393 add_dirs= true;
398 } else 394 } else {
399 path= getenv("PATH"); 395 char* tmp_path = getenv("PATH");
400 396 if (tmp_path)
397 path = tmp_path;
398 }
401 m_apps.clear(); 399 m_apps.clear();
402 400
403 unsigned int l; 401 unsigned int l;
404 unsigned int r; 402 unsigned int r;
405 403
@@ -412,27 +410,27 @@ void FbRun::tabCompleteApps() {
412 if (n >= 0) { 410 if (n >= 0) {
413 while(n--) { 411 while(n--) {
414 filename= dir.readFilename(); 412 filename= dir.readFilename();
415 fncomplete= dir.name() + 413 fncomplete= dir.name() +
416 (*dir.name().rbegin() != '/' ? "/" : "") + 414 (*dir.name().rbegin() != '/' ? "/" : "") +
417 filename; 415 filename;
418 416
419 // directories in dirmode ? 417 // directories in dirmode ?
420 if (add_dirs && FbTk::FileUtil::isDirectory(fncomplete.c_str()) && 418 if (add_dirs && FbTk::FileUtil::isDirectory(fncomplete.c_str()) &&
421 filename != ".." && filename != ".") { 419 filename != ".." && filename != ".") {
422 m_apps.push_back(fncomplete); 420 m_apps.push_back(fncomplete);
423 // executables in dirmode ? 421 // executables in dirmode ?
424 } else if (add_dirs && FbTk::FileUtil::isRegularFile(fncomplete.c_str()) && 422 } else if (add_dirs && FbTk::FileUtil::isRegularFile(fncomplete.c_str()) &&
425 FbTk::FileUtil::isExecutable(fncomplete.c_str()) && 423 FbTk::FileUtil::isExecutable(fncomplete.c_str()) &&
426 (prefix == "" || 424 (prefix == "" ||
427 fncomplete.substr(0, prefix.size()) == prefix)) { 425 fncomplete.substr(0, prefix.size()) == prefix)) {
428 m_apps.push_back(fncomplete); 426 m_apps.push_back(fncomplete);
429 // executables in $PATH ? 427 // executables in $PATH ?
430 } else if (FbTk::FileUtil::isRegularFile(fncomplete.c_str()) && 428 } else if (FbTk::FileUtil::isRegularFile(fncomplete.c_str()) &&
431 FbTk::FileUtil::isExecutable(fncomplete.c_str()) && 429 FbTk::FileUtil::isExecutable(fncomplete.c_str()) &&
432 (prefix == "" || 430 (prefix == "" ||
433 filename.substr(0, prefix.size()) == prefix)) { 431 filename.substr(0, prefix.size()) == prefix)) {
434 m_apps.push_back(filename); 432 m_apps.push_back(filename);
435 } 433 }
436 } 434 }
437 } 435 }
438 l= r + 1; 436 l= r + 1;
@@ -473,7 +471,7 @@ void FbRun::tabCompleteApps() {
473 } 471 }
474 apps_item++; 472 apps_item++;
475 } 473 }
476 if (!changed_prefix && apps_item == m_current_apps_item) 474 if (!changed_prefix && apps_item == m_current_apps_item)
477 XBell(m_display, 0); 475 XBell(m_display, 0);
478 } 476 }
479} 477}