aboutsummaryrefslogtreecommitdiff
path: root/util/fbrun
diff options
context:
space:
mode:
Diffstat (limited to 'util/fbrun')
-rw-r--r--util/fbrun/FbRun.cc8
-rw-r--r--util/fbrun/main.cc24
2 files changed, 20 insertions, 12 deletions
diff --git a/util/fbrun/FbRun.cc b/util/fbrun/FbRun.cc
index c175e67..7797f76 100644
--- a/util/fbrun/FbRun.cc
+++ b/util/fbrun/FbRun.cc
@@ -49,7 +49,13 @@
49#include <fstream> 49#include <fstream>
50#include <algorithm> 50#include <algorithm>
51 51
52using namespace std; 52using std::cerr;
53using std::endl;
54using std::string;
55using std::fstream;
56using std::ifstream;
57using std::ofstream;
58using std::ios;
53 59
54FbRun::FbRun(int x, int y, size_t width): 60FbRun::FbRun(int x, int y, size_t width):
55 FbTk::TextBox(DefaultScreen(FbTk::App::instance()->display()), 61 FbTk::TextBox(DefaultScreen(FbTk::App::instance()->display()),
diff --git a/util/fbrun/main.cc b/util/fbrun/main.cc
index 878b5eb..e5d3e2f 100644
--- a/util/fbrun/main.cc
+++ b/util/fbrun/main.cc
@@ -35,7 +35,9 @@ extern "C" {
35#include <string> 35#include <string>
36#include <iostream> 36#include <iostream>
37 37
38using namespace std; 38using std::cerr;
39using std::endl;
40using std::string;
39 41
40void showUsage(const char *progname) { 42void showUsage(const char *progname) {
41 cerr<<"fbrun 1.5 : (c) 2002-2004 Henrik Kinnunen"<<endl; 43 cerr<<"fbrun 1.5 : (c) 2002-2004 Henrik Kinnunen"<<endl;
@@ -81,7 +83,7 @@ int main(int argc, char **argv) {
81 } else if (strcmp(argv[i], "-text") == 0 && i+1 < argc) { 83 } else if (strcmp(argv[i], "-text") == 0 && i+1 < argc) {
82 text = argv[++i]; 84 text = argv[++i];
83 } else if (strcmp(argv[i], "-w") == 0 && i+1 < argc) { 85 } else if (strcmp(argv[i], "-w") == 0 && i+1 < argc) {
84 width = atoi(argv[++i]); 86 width = atoi(argv[++i]);
85 set_width = true; 87 set_width = true;
86 } else if (strcmp(argv[i], "-h") == 0 && i+1 < argc) { 88 } else if (strcmp(argv[i], "-h") == 0 && i+1 < argc) {
87 height = atoi(argv[++i]); 89 height = atoi(argv[++i]);
@@ -115,7 +117,7 @@ int main(int argc, char **argv) {
115 } 117 }
116 118
117 try { 119 try {
118 120
119 FbTk::App application(display_name.c_str()); 121 FbTk::App application(display_name.c_str());
120 FbRun fbrun; 122 FbRun fbrun;
121 123
@@ -131,7 +133,7 @@ int main(int argc, char **argv) {
131 // get color 133 // get color
132 FbTk::Color fg_color(foreground.c_str(), 0); 134 FbTk::Color fg_color(foreground.c_str(), 0);
133 FbTk::Color bg_color(background.c_str(), 0); 135 FbTk::Color bg_color(background.c_str(), 0);
134 136
135 fbrun.setForegroundColor(fg_color); 137 fbrun.setForegroundColor(fg_color);
136 fbrun.setBackgroundColor(bg_color); 138 fbrun.setBackgroundColor(bg_color);
137 139
@@ -148,17 +150,17 @@ int main(int argc, char **argv) {
148 150
149 fbrun.setTitle(title); 151 fbrun.setTitle(title);
150 fbrun.setText(text); 152 fbrun.setText(text);
151 153
152 if (near_mouse) { 154 if (near_mouse) {
153 155
154 int wx, wy; 156 int wx, wy;
155 unsigned int mask; 157 unsigned int mask;
156 Window ret_win; 158 Window ret_win;
157 Window child_win; 159 Window child_win;
158 160
159 Display* dpy = FbTk::App::instance()->display(); 161 Display* dpy = FbTk::App::instance()->display();
160 162
161 if (XQueryPointer(dpy, DefaultRootWindow(dpy), 163 if (XQueryPointer(dpy, DefaultRootWindow(dpy),
162 &ret_win, &child_win, 164 &ret_win, &child_win,
163 &x, &y, &wx, &wy, &mask)) { 165 &x, &y, &wx, &wy, &mask)) {
164 166
@@ -202,12 +204,12 @@ int main(int argc, char **argv) {
202 y = root_y + root_h - fbrun.height(); 204 y = root_y + root_h - fbrun.height();
203 } 205 }
204 } 206 }
205 207
206 if (set_pos) 208 if (set_pos)
207 fbrun.move(x, y); 209 fbrun.move(x, y);
208 210
209 fbrun.lockPosition(set_pos); 211 fbrun.lockPosition(set_pos);
210 212
211 fbrun.show(); 213 fbrun.show();
212 214
213 application.eventLoop(); 215 application.eventLoop();