aboutsummaryrefslogtreecommitdiff
path: root/util/fbsetroot.cc
diff options
context:
space:
mode:
authormathias <mathias>2006-10-30 19:31:15 (GMT)
committermathias <mathias>2006-10-30 19:31:15 (GMT)
commite5e76e7761f52ba7c0deca75bcecae4fbd3e2ff5 (patch)
treec84838a84802805e9b1463045e86200b7cef917f /util/fbsetroot.cc
parent426c12c25c2ef095a882619ad7424684b88465b8 (diff)
downloadfluxbox_pavel-e5e76e7761f52ba7c0deca75bcecae4fbd3e2ff5.zip
fluxbox_pavel-e5e76e7761f52ba7c0deca75bcecae4fbd3e2ff5.tar.bz2
Cosmetic patch from Slava Semushin
Diffstat (limited to 'util/fbsetroot.cc')
-rw-r--r--util/fbsetroot.cc25
1 files changed, 14 insertions, 11 deletions
diff --git a/util/fbsetroot.cc b/util/fbsetroot.cc
index 54f5adb..9d2cf73 100644
--- a/util/fbsetroot.cc
+++ b/util/fbsetroot.cc
@@ -50,7 +50,10 @@
50#endif 50#endif
51#include <iostream> 51#include <iostream>
52 52
53using namespace std; 53using std::cout;
54using std::cerr;
55using std::endl;
56using std::string;
54 57
55fbsetroot::fbsetroot(int argc, char **argv, char *dpy_name) 58fbsetroot::fbsetroot(int argc, char **argv, char *dpy_name)
56 : FbTk::App(dpy_name), m_app_name(argv[0]) { 59 : FbTk::App(dpy_name), m_app_name(argv[0]) {
@@ -118,7 +121,7 @@ fbsetroot::fbsetroot(int argc, char **argv, char *dpy_name)
118 121
119 if ((mod + sol + grd) != true) { 122 if ((mod + sol + grd) != true) {
120 _FB_USES_NLS; 123 _FB_USES_NLS;
121 cerr << _FB_CONSOLETEXT(fbsetroot, MustSpecify, 124 cerr << _FB_CONSOLETEXT(fbsetroot, MustSpecify,
122 "Error: must specify one of: -solid, -mod, -gradient\n", 125 "Error: must specify one of: -solid, -mod, -gradient\n",
123 "user didn't give one of the required options") << endl; 126 "user didn't give one of the required options") << endl;
124 127
@@ -172,10 +175,10 @@ void fbsetroot::setRootAtoms(Pixmap pixmap, int screen) {
172 if (type == XA_PIXMAP) { 175 if (type == XA_PIXMAP) {
173 root.property(atom_eroot, 0L, 1L, False, AnyPropertyType, 176 root.property(atom_eroot, 0L, 1L, False, AnyPropertyType,
174 &type, &format, &length, &after, &data_eroot); 177 &type, &format, &length, &after, &data_eroot);
175 178
176 if (data_root && data_eroot && type == XA_PIXMAP && 179 if (data_root && data_eroot && type == XA_PIXMAP &&
177 *((Pixmap *) data_root) == *((Pixmap *) data_eroot)) { 180 *((Pixmap *) data_root) == *((Pixmap *) data_eroot)) {
178 181
179 XKillClient(display(), *((Pixmap *) data_root)); 182 XKillClient(display(), *((Pixmap *) data_root));
180 } 183 }
181 } 184 }
@@ -197,7 +200,7 @@ void fbsetroot::setRootAtoms(Pixmap pixmap, int screen) {
197} 200}
198 201
199/** 202/**
200 Draws pixmaps with a single color 203 Draws pixmaps with a single color
201*/ 204*/
202void fbsetroot::solid() { 205void fbsetroot::solid() {
203 FbTk::Color c(fore, screen); 206 FbTk::Color c(fore, screen);
@@ -209,7 +212,7 @@ void fbsetroot::solid() {
209 FbTk::GContext gc(root); 212 FbTk::GContext gc(root);
210 gc.setForeground(c); 213 gc.setForeground(c);
211 214
212 pixmap = new Pixmap(XCreatePixmap(display(), 215 pixmap = new Pixmap(XCreatePixmap(display(),
213 root.window(), 216 root.window(),
214 root.width(), root.height(), 217 root.width(), root.height(),
215 root.depth())); 218 root.depth()));
@@ -282,7 +285,7 @@ void fbsetroot::modula(int x, int y) {
282 gc.setTile(r_bitmap); 285 gc.setTile(r_bitmap);
283 gc.setFillStyle(FillTiled); 286 gc.setFillStyle(FillTiled);
284 287
285 pixmap = new Pixmap(XCreatePixmap(display(), 288 pixmap = new Pixmap(XCreatePixmap(display(),
286 root.window(), 289 root.window(),
287 root.width(), root.height(), 290 root.width(), root.height(),
288 root.depth())); 291 root.depth()));
@@ -328,7 +331,7 @@ void fbsetroot::gradient() {
328 331
329 tmp = img_ctrl->renderImage(root.width(), root.height(), texture); 332 tmp = img_ctrl->renderImage(root.width(), root.height(), texture);
330 333
331 pixmap = new Pixmap(XCreatePixmap(display(), 334 pixmap = new Pixmap(XCreatePixmap(display(),
332 root.window(), 335 root.window(),
333 root.width(), root.height(), 336 root.width(), root.height(),
334 root.depth())); 337 root.depth()));
@@ -376,9 +379,9 @@ void fbsetroot::usage(int exit_code) {
376int main(int argc, char **argv) { 379int main(int argc, char **argv) {
377 char *display_name = (char *) 0; 380 char *display_name = (char *) 0;
378 int i = 1; 381 int i = 1;
379 382
380 FbTk::NLSInit("fluxbox.cat"); 383 FbTk::NLSInit("fluxbox.cat");
381 384
382 for (; i < argc; i++) { 385 for (; i < argc; i++) {
383 if (! strcmp(argv[i], "-display")) { 386 if (! strcmp(argv[i], "-display")) {
384 // check for -display option 387 // check for -display option
@@ -398,7 +401,7 @@ int main(int argc, char **argv) {
398 401
399 try { 402 try {
400 fbsetroot app(argc, argv, display_name); 403 fbsetroot app(argc, argv, display_name);
401 } catch (std::string error_str) { 404 } catch (string error_str) {
402 _FB_USES_NLS; 405 _FB_USES_NLS;
403 cerr<<_FB_CONSOLETEXT(Common, Error, "Error", "Error message header")<<": "<<error_str<<endl; 406 cerr<<_FB_CONSOLETEXT(Common, Error, "Error", "Error message header")<<": "<<error_str<<endl;
404 } 407 }