imprted new tools from bb-cvs
re-change bsetroot to work preperly regarding the root window atoms
This commit is contained in:
parent
20063c2246
commit
3531afa1cc
5 changed files with 149 additions and 139 deletions
|
@ -1,18 +1,21 @@
|
||||||
# util/Makefile.am for Openbox
|
# util/Makefile.am for Blackbox - an X11 Window manager
|
||||||
|
|
||||||
CPPFLAGS= @CPPFLAGS@ @DEBUG@ @NLS@ @TIMEDCACHE@ @NEWWMSPEC@ @INTERLACE@ \
|
CPPFLAGS= @CPPFLAGS@ @DEBUG@ @NLS@ @TIMEDCACHE@ @ORDEREDPSEUDO@
|
||||||
@ORDEREDPSEUDO@ @CLOBBER@
|
|
||||||
|
|
||||||
bin_SCRIPTS = bsetbg
|
bin_SCRIPTS = bsetbg
|
||||||
bin_PROGRAMS = bsetroot
|
bin_PROGRAMS = bsetroot
|
||||||
|
|
||||||
bsetroot_SOURCES = bsetroot.cc
|
bsetroot_SOURCES = bsetroot.cc
|
||||||
bsetroot_LDADD = ../src/BaseDisplay.o ../src/Timer.o ../src/Image.o ../src/i18n.o ../src/Geometry.o
|
bsetroot_LDADD = ../src/BaseDisplay.o ../src/Color.o ../src/GCCache.o ../src/Texture.o ../src/Timer.o ../src/Image.o ../src/ImageControl.o ../src/i18n.o ../src/Util.o
|
||||||
|
|
||||||
MAINTAINERCLEANFILES = Makefile.in
|
MAINTAINERCLEANFILES = Makefile.in
|
||||||
|
|
||||||
distclean-local:
|
distclean-local:
|
||||||
rm -f *\~
|
rm -f *\~
|
||||||
|
|
||||||
bsetroot.o: bsetroot.cc ../config.h bsetroot.h ../src/BaseDisplay.h \
|
# local dependencies
|
||||||
../src/Timer.h ../src/Image.h ../src/Geometry.h
|
|
||||||
|
bsetroot.o: bsetroot.cc ../config.h ../src/i18n.hh \
|
||||||
|
../src/../nls/blackbox-nls.hh ../src/GCCache.hh ../src/BaseDisplay.hh \
|
||||||
|
../src/Timer.hh ../src/Color.hh ../src/Texture.hh ../src/Util.hh \
|
||||||
|
bsetroot.hh ../src/Image.hh
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
PATH=$PATH:/usr/bin:/usr/local/bin:/usr/X11R6/bin
|
PATH=$PATH:/usr/bin:/usr/local/bin:/usr/X11R6/bin
|
||||||
|
|
||||||
img_apps="qiv xli xv wmsetbg Esetroot display xsetbg"
|
img_apps="display xli xsetbg Esetroot qiv wmsetbg xv"
|
||||||
|
|
||||||
display_full_cmd="display -geometry 800x600 -window root"
|
display_full_cmd="display -geometry 800x600 -window root"
|
||||||
display_tile_cmd="display -window root"
|
display_tile_cmd="display -window root"
|
||||||
|
@ -54,7 +54,7 @@ xli_tile_cmd="xli -onroot -quiet"
|
||||||
xli_center_cmd="xli -center -onroot quiet"
|
xli_center_cmd="xli -center -onroot quiet"
|
||||||
xli_default_cmd="$xli_center_cmd"
|
xli_default_cmd="$xli_center_cmd"
|
||||||
|
|
||||||
xsetbg_full_cmd="xsetbg -fillscreen"
|
xsetbg_full_cmd="xsetbg -fullscreen"
|
||||||
xsetbg_tile_cmd="xsetbg"
|
xsetbg_tile_cmd="xsetbg"
|
||||||
xsetbg_center_cmd="xsetbg -center"
|
xsetbg_center_cmd="xsetbg -center"
|
||||||
xsetbg_default_cmd="$xsetbg_center_cmd"
|
xsetbg_default_cmd="$xsetbg_center_cmd"
|
||||||
|
@ -76,8 +76,7 @@ quit()
|
||||||
exit ${rc:-0}
|
exit ${rc:-0}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool()
|
bool() {
|
||||||
{
|
|
||||||
case $1 in
|
case $1 in
|
||||||
[yY][eE][sS]|1|[yY]|[tT][rR][uU][eE]|[oO][nN]) : ;;
|
[yY][eE][sS]|1|[yY]|[tT][rR][uU][eE]|[oO][nN]) : ;;
|
||||||
*) return 1 ;;
|
*) return 1 ;;
|
||||||
|
|
173
util/bsetroot.cc
173
util/bsetroot.cc
|
@ -1,5 +1,5 @@
|
||||||
// bsetroot.cc for Openbox
|
// -*- mode++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
|
||||||
// Copyright (c) 2002 - 2002 Ben Janens (ben@orodu.net)
|
// Window.cc for Blackbox - an X11 Window manager
|
||||||
// Copyright (c) 2001 - 2002 Sean 'Shaleh' Perry <shaleh at debian.org>
|
// Copyright (c) 2001 - 2002 Sean 'Shaleh' Perry <shaleh at debian.org>
|
||||||
// Copyright (c) 1997 - 2000, 2002 Brad Hughes <bhughes at trolltech.com>
|
// Copyright (c) 1997 - 2000, 2002 Brad Hughes <bhughes at trolltech.com>
|
||||||
//
|
//
|
||||||
|
@ -25,33 +25,35 @@
|
||||||
# include "../config.h"
|
# include "../config.h"
|
||||||
#endif // HAVE_CONFIG_H
|
#endif // HAVE_CONFIG_H
|
||||||
|
|
||||||
#ifdef HAVE_STRING_H
|
extern "C" {
|
||||||
# include <string.h>
|
#ifdef HAVE_STDLIB_H
|
||||||
#endif // HAVE_STRING_H
|
|
||||||
|
|
||||||
#ifdef HAVE_STDLIB_H
|
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
#endif // HAVE_STDLIB_H
|
#endif // HAVE_STDLIB_H
|
||||||
|
|
||||||
|
#ifdef HAVE_STRING_H
|
||||||
|
# include <string.h>
|
||||||
|
#endif // HAVE_STRING_H
|
||||||
|
|
||||||
#ifdef HAVE_STDIO_H
|
#ifdef HAVE_STDIO_H
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
#endif // HAVE_STDIO_H
|
#endif // HAVE_STDIO_H
|
||||||
|
}
|
||||||
|
|
||||||
#include "../src/i18n.h"
|
#include "../src/i18n.hh"
|
||||||
#include "../src/BaseDisplay.h"
|
#include "../src/GCCache.hh"
|
||||||
#include "../src/Image.h"
|
#include "../src/Texture.hh"
|
||||||
#include "bsetroot.h"
|
#include "../src/Util.hh"
|
||||||
|
#include "bsetroot.hh"
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
I18n i18n("openbox.cat");
|
I18n i18n;
|
||||||
|
|
||||||
bsetroot::bsetroot(int argc, char **argv, char *dpy_name)
|
bsetroot::bsetroot(int argc, char **argv, char *dpy_name)
|
||||||
: BaseDisplay(argv[0], dpy_name)
|
: BaseDisplay(argv[0], dpy_name)
|
||||||
{
|
{
|
||||||
grad = fore = back = (char *) 0;
|
grad = fore = back = (char *) 0;
|
||||||
|
|
||||||
Bool mod = False, sol = False, grd = False;
|
bool mod = False, sol = False, grd = False;
|
||||||
int mod_x = 0, mod_y = 0;
|
int mod_x = 0, mod_y = 0;
|
||||||
|
|
||||||
for (int i = 1; i < argc; i++) {
|
for (int i = 1; i < argc; i++) {
|
||||||
|
@ -101,16 +103,16 @@ bsetroot::bsetroot(int argc, char **argv, char *dpy_name)
|
||||||
|
|
||||||
if ((mod + sol + grd) != True) {
|
if ((mod + sol + grd) != True) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
i18n(bsetrootSet, bsetrootMustSpecify,
|
i18n(bsetrootSet, bsetrootMustSpecify,
|
||||||
"%s: error: must specify one of: -solid, -mod, -gradient\n"),
|
"%s: error: must specify one of: -solid, -mod, -gradient\n"),
|
||||||
getApplicationName());
|
getApplicationName());
|
||||||
|
|
||||||
usage(2);
|
usage(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
img_ctrl = new BImageControl*[numberOfScreens()];
|
img_ctrl = new BImageControl*[getNumberOfScreens()];
|
||||||
for (unsigned int s = 0, n = numberOfScreens(); s < n; ++s)
|
for (unsigned int s = 0; s < getNumberOfScreens(); ++s)
|
||||||
img_ctrl[s] = new BImageControl(*this, *getScreenInfo(s), true);
|
img_ctrl[s] = new BImageControl(this, getScreenInfo(s), True);
|
||||||
|
|
||||||
if (sol && fore) solid();
|
if (sol && fore) solid();
|
||||||
else if (mod && mod_x && mod_y && fore && back) modula(mod_x, mod_y);
|
else if (mod && mod_x && mod_y && fore && back) modula(mod_x, mod_y);
|
||||||
|
@ -124,7 +126,7 @@ bsetroot::~bsetroot(void) {
|
||||||
|
|
||||||
XKillClient(getXDisplay(), AllTemporary);
|
XKillClient(getXDisplay(), AllTemporary);
|
||||||
|
|
||||||
std::for_each(img_ctrl, img_ctrl + numberOfScreens(), PointerAssassin());
|
std::for_each(img_ctrl, img_ctrl + getNumberOfScreens(), PointerAssassin());
|
||||||
|
|
||||||
delete [] img_ctrl;
|
delete [] img_ctrl;
|
||||||
}
|
}
|
||||||
|
@ -146,7 +148,7 @@ void bsetroot::setPixmapProperty(int screen, Pixmap pixmap) {
|
||||||
|
|
||||||
XGrabServer(getXDisplay());
|
XGrabServer(getXDisplay());
|
||||||
|
|
||||||
// Clear out the old pixmap
|
/* Clear out the old pixmap */
|
||||||
XGetWindowProperty(getXDisplay(), screen_info->getRootWindow(),
|
XGetWindowProperty(getXDisplay(), screen_info->getRootWindow(),
|
||||||
rootpmap_id, 0L, 1L, False, XA_PIXMAP,
|
rootpmap_id, 0L, 1L, False, XA_PIXMAP,
|
||||||
&type, &format, &length, &after, &data);
|
&type, &format, &length, &after, &data);
|
||||||
|
@ -158,16 +160,16 @@ void bsetroot::setPixmapProperty(int screen, Pixmap pixmap) {
|
||||||
|
|
||||||
if (pixmap) {
|
if (pixmap) {
|
||||||
XChangeProperty(getXDisplay(), screen_info->getRootWindow(),
|
XChangeProperty(getXDisplay(), screen_info->getRootWindow(),
|
||||||
rootpmap_id, XA_PIXMAP, 32, PropModeReplace,
|
rootpmap_id, XA_PIXMAP, 32, PropModeReplace,
|
||||||
(unsigned char *) &pixmap, 1);
|
(unsigned char *) &pixmap, 1);
|
||||||
XChangeProperty(getXDisplay(), screen_info->getRootWindow(),
|
XChangeProperty(getXDisplay(), screen_info->getRootWindow(),
|
||||||
esetroot_id, XA_PIXMAP, 32, PropModeReplace,
|
esetroot_id, XA_PIXMAP, 32, PropModeReplace,
|
||||||
(unsigned char *) &pixmap, 1);
|
(unsigned char *) &pixmap, 1);
|
||||||
} else {
|
} else {
|
||||||
XDeleteProperty(getXDisplay(), screen_info->getRootWindow(),
|
XDeleteProperty(getXDisplay(), screen_info->getRootWindow(),
|
||||||
rootpmap_id);
|
rootpmap_id);
|
||||||
XDeleteProperty(getXDisplay(), screen_info->getRootWindow(),
|
XDeleteProperty(getXDisplay(), screen_info->getRootWindow(),
|
||||||
esetroot_id);
|
esetroot_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
XUngrabServer(getXDisplay());
|
XUngrabServer(getXDisplay());
|
||||||
|
@ -177,15 +179,15 @@ void bsetroot::setPixmapProperty(int screen, Pixmap pixmap) {
|
||||||
|
|
||||||
// adapted from wmsetbg
|
// adapted from wmsetbg
|
||||||
Pixmap bsetroot::duplicatePixmap(int screen, Pixmap pixmap,
|
Pixmap bsetroot::duplicatePixmap(int screen, Pixmap pixmap,
|
||||||
int width, int height) {
|
int width, int height) {
|
||||||
XSync(getXDisplay(), False);
|
XSync(getXDisplay(), False);
|
||||||
|
|
||||||
Pixmap copyP = XCreatePixmap(getXDisplay(),
|
Pixmap copyP = XCreatePixmap(getXDisplay(),
|
||||||
getScreenInfo(screen)->getRootWindow(),
|
getScreenInfo(screen)->getRootWindow(),
|
||||||
width, height,
|
width, height,
|
||||||
DefaultDepth(getXDisplay(), screen));
|
DefaultDepth(getXDisplay(), screen));
|
||||||
XCopyArea(getXDisplay(), pixmap, copyP, DefaultGC(getXDisplay(), screen),
|
XCopyArea(getXDisplay(), pixmap, copyP, DefaultGC(getXDisplay(), screen),
|
||||||
0, 0, width, height, 0, 0);
|
0, 0, width, height, 0, 0);
|
||||||
XSync(getXDisplay(), False);
|
XSync(getXDisplay(), False);
|
||||||
|
|
||||||
return copyP;
|
return copyP;
|
||||||
|
@ -193,26 +195,19 @@ Pixmap bsetroot::duplicatePixmap(int screen, Pixmap pixmap,
|
||||||
|
|
||||||
|
|
||||||
void bsetroot::solid(void) {
|
void bsetroot::solid(void) {
|
||||||
for (unsigned int screen = 0, n = numberOfScreens(); screen < n; screen++) {
|
for (unsigned int screen = 0; screen < getNumberOfScreens(); screen++) {
|
||||||
BColor c;
|
BColor c(fore, this, screen);
|
||||||
|
|
||||||
img_ctrl[screen]->parseColor(&c, fore);
|
|
||||||
if (! c.isAllocated()) c.setPixel(BlackPixel(getXDisplay(), screen));
|
|
||||||
|
|
||||||
const ScreenInfo *screen_info = getScreenInfo(screen);
|
const ScreenInfo *screen_info = getScreenInfo(screen);
|
||||||
|
|
||||||
XSetWindowBackground(getXDisplay(), screen_info->getRootWindow(),
|
XSetWindowBackground(getXDisplay(), screen_info->getRootWindow(),
|
||||||
c.getPixel());
|
c.pixel());
|
||||||
XClearWindow(getXDisplay(), screen_info->getRootWindow());
|
XClearWindow(getXDisplay(), screen_info->getRootWindow());
|
||||||
|
|
||||||
Pixmap pixmap = XCreatePixmap(getXDisplay(),
|
Pixmap pixmap = XCreatePixmap(getXDisplay(),
|
||||||
screen_info->getRootWindow(),
|
screen_info->getRootWindow(),
|
||||||
8, 8, DefaultDepth(getXDisplay(), screen));
|
8, 8, DefaultDepth(getXDisplay(), screen));
|
||||||
|
BPen pen(c);
|
||||||
XSetForeground(getXDisplay(), DefaultGC(getXDisplay(), screen),
|
XFillRectangle(getXDisplay(), pixmap, pen.gc(), 0, 0, 8, 8);
|
||||||
c.getPixel());
|
|
||||||
XFillRectangle(getXDisplay(), pixmap, DefaultGC(getXDisplay(), screen),
|
|
||||||
0, 0, 8, 8);
|
|
||||||
|
|
||||||
setPixmapProperty(screen, duplicatePixmap(screen, pixmap, 8, 8));
|
setPixmapProperty(screen, duplicatePixmap(screen, pixmap, 8, 8));
|
||||||
|
|
||||||
|
@ -226,9 +221,8 @@ void bsetroot::modula(int x, int y) {
|
||||||
long pattern;
|
long pattern;
|
||||||
|
|
||||||
unsigned int screen, i;
|
unsigned int screen, i;
|
||||||
unsigned int n = numberOfScreens();
|
|
||||||
|
|
||||||
for (pattern = 0, screen = 0; screen < n; screen++) {
|
for (pattern = 0, screen = 0; screen < getNumberOfScreens(); screen++) {
|
||||||
for (i = 0; i < 16; i++) {
|
for (i = 0; i < 16; i++) {
|
||||||
pattern <<= 1;
|
pattern <<= 1;
|
||||||
if ((i % x) == 0)
|
if ((i % x) == 0)
|
||||||
|
@ -237,18 +231,17 @@ void bsetroot::modula(int x, int y) {
|
||||||
|
|
||||||
for (i = 0; i < 16; i++) {
|
for (i = 0; i < 16; i++) {
|
||||||
if ((i % y) == 0) {
|
if ((i % y) == 0) {
|
||||||
data[(i * 2)] = (char) 0xff;
|
data[(i * 2)] = static_cast<char>(0xff);
|
||||||
data[(i * 2) + 1] = (char) 0xff;
|
data[(i * 2) + 1] = static_cast<char>(0xff);
|
||||||
} else {
|
} else {
|
||||||
data[(i * 2)] = pattern & 0xff;
|
data[(i * 2)] = pattern & 0xff;
|
||||||
data[(i * 2) + 1] = (pattern >> 8) & 0xff;
|
data[(i * 2) + 1] = (pattern >> 8) & 0xff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BColor f, b;
|
BColor f(fore, this, screen), b(back, this, screen);
|
||||||
GC gc;
|
GC gc;
|
||||||
Pixmap bitmap;
|
Pixmap bitmap;
|
||||||
|
|
||||||
const ScreenInfo *screen_info = getScreenInfo(screen);
|
const ScreenInfo *screen_info = getScreenInfo(screen);
|
||||||
|
|
||||||
bitmap =
|
bitmap =
|
||||||
|
@ -256,22 +249,16 @@ void bsetroot::modula(int x, int y) {
|
||||||
screen_info->getRootWindow(), data,
|
screen_info->getRootWindow(), data,
|
||||||
16, 16);
|
16, 16);
|
||||||
|
|
||||||
img_ctrl[screen]->parseColor(&f, fore);
|
|
||||||
img_ctrl[screen]->parseColor(&b, back);
|
|
||||||
|
|
||||||
if (! f.isAllocated()) f.setPixel(WhitePixel(getXDisplay(), screen));
|
|
||||||
if (! b.isAllocated()) b.setPixel(BlackPixel(getXDisplay(), screen));
|
|
||||||
|
|
||||||
XGCValues gcv;
|
XGCValues gcv;
|
||||||
gcv.foreground = f.getPixel();
|
gcv.foreground = f.pixel();
|
||||||
gcv.background = b.getPixel();
|
gcv.background = b.pixel();
|
||||||
|
|
||||||
gc = XCreateGC(getXDisplay(), screen_info->getRootWindow(),
|
gc = XCreateGC(getXDisplay(), screen_info->getRootWindow(),
|
||||||
GCForeground | GCBackground, &gcv);
|
GCForeground | GCBackground, &gcv);
|
||||||
|
|
||||||
Pixmap pixmap = XCreatePixmap(getXDisplay(),
|
Pixmap pixmap = XCreatePixmap(getXDisplay(),
|
||||||
screen_info->getRootWindow(),
|
screen_info->getRootWindow(),
|
||||||
16, 16, screen_info->getDepth());
|
16, 16, screen_info->getDepth());
|
||||||
|
|
||||||
XCopyPlane(getXDisplay(), bitmap, pixmap, gc,
|
XCopyPlane(getXDisplay(), bitmap, pixmap, gc,
|
||||||
0, 0, 16, 16, 0, 0, 1l);
|
0, 0, 16, 16, 0, 0, 1l);
|
||||||
|
@ -281,7 +268,7 @@ void bsetroot::modula(int x, int y) {
|
||||||
XClearWindow(getXDisplay(), screen_info->getRootWindow());
|
XClearWindow(getXDisplay(), screen_info->getRootWindow());
|
||||||
|
|
||||||
setPixmapProperty(screen,
|
setPixmapProperty(screen,
|
||||||
duplicatePixmap(screen, pixmap, 16, 16));
|
duplicatePixmap(screen, pixmap, 16, 16));
|
||||||
|
|
||||||
XFreeGC(getXDisplay(), gc);
|
XFreeGC(getXDisplay(), gc);
|
||||||
XFreePixmap(getXDisplay(), bitmap);
|
XFreePixmap(getXDisplay(), bitmap);
|
||||||
|
@ -293,22 +280,17 @@ void bsetroot::modula(int x, int y) {
|
||||||
|
|
||||||
|
|
||||||
void bsetroot::gradient(void) {
|
void bsetroot::gradient(void) {
|
||||||
for (unsigned int screen = 0, n = numberOfScreens(); screen < n; screen++) {
|
for (unsigned int screen = 0; screen < getNumberOfScreens(); screen++) {
|
||||||
BTexture texture;
|
BTexture texture(grad, this, screen, img_ctrl[screen]);
|
||||||
img_ctrl[screen]->parseTexture(&texture, grad);
|
|
||||||
img_ctrl[screen]->parseColor(texture.getColor(), fore);
|
|
||||||
img_ctrl[screen]->parseColor(texture.getColorTo(), back);
|
|
||||||
const ScreenInfo *screen_info = getScreenInfo(screen);
|
const ScreenInfo *screen_info = getScreenInfo(screen);
|
||||||
|
|
||||||
if (! texture.getColor()->isAllocated())
|
texture.setColor(BColor(fore, this, screen));
|
||||||
texture.getColor()->setPixel(WhitePixel(getXDisplay(), screen));
|
texture.setColorTo(BColor(back, this, screen));
|
||||||
if (! texture.getColorTo()->isAllocated())
|
|
||||||
texture.getColorTo()->setPixel(BlackPixel(getXDisplay(), screen));
|
|
||||||
|
|
||||||
Pixmap pixmap =
|
Pixmap pixmap =
|
||||||
img_ctrl[screen]->renderImage(screen_info->size().w(),
|
img_ctrl[screen]->renderImage(screen_info->getWidth(),
|
||||||
screen_info->size().h(),
|
screen_info->getHeight(),
|
||||||
&texture);
|
texture);
|
||||||
|
|
||||||
XSetWindowBackgroundPixmap(getXDisplay(),
|
XSetWindowBackgroundPixmap(getXDisplay(),
|
||||||
screen_info->getRootWindow(),
|
screen_info->getRootWindow(),
|
||||||
|
@ -316,9 +298,9 @@ void bsetroot::gradient(void) {
|
||||||
XClearWindow(getXDisplay(), screen_info->getRootWindow());
|
XClearWindow(getXDisplay(), screen_info->getRootWindow());
|
||||||
|
|
||||||
setPixmapProperty(screen,
|
setPixmapProperty(screen,
|
||||||
duplicatePixmap(screen, pixmap,
|
duplicatePixmap(screen, pixmap,
|
||||||
screen_info->size().w(),
|
screen_info->getWidth(),
|
||||||
screen_info->size().h()));
|
screen_info->getHeight()));
|
||||||
|
|
||||||
if (! (screen_info->getVisual()->c_class & 1)) {
|
if (! (screen_info->getVisual()->c_class & 1)) {
|
||||||
img_ctrl[screen]->removeImage(pixmap);
|
img_ctrl[screen]->removeImage(pixmap);
|
||||||
|
@ -329,20 +311,20 @@ void bsetroot::gradient(void) {
|
||||||
|
|
||||||
void bsetroot::usage(int exit_code) {
|
void bsetroot::usage(int exit_code) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
i18n(bsetrootSet, bsetrootUsage,
|
i18n(bsetrootSet, bsetrootUsage,
|
||||||
"%s 2.0\n\n"
|
"%s 2.0\n\n"
|
||||||
"Copyright (c) 1997-2000, 2002 Bradley T Hughes\n"
|
"Copyright (c) 1997-2000, 2002 Bradley T Hughes\n"
|
||||||
"Copyright (c) 2001-2002 Sean 'Shaleh' Perry\n\n"
|
"Copyright (c) 2001-2002 Sean 'Shaleh' Perry\n\n"
|
||||||
" -display <string> display connection\n"
|
" -display <string> display connection\n"
|
||||||
" -mod <x> <y> modula pattern\n"
|
" -mod <x> <y> modula pattern\n"
|
||||||
" -foreground, -fg <color> modula foreground color\n"
|
" -foreground, -fg <color> modula foreground color\n"
|
||||||
" -background, -bg <color> modula background color\n\n"
|
" -background, -bg <color> modula background color\n\n"
|
||||||
" -gradient <texture> gradient texture\n"
|
" -gradient <texture> gradient texture\n"
|
||||||
" -from <color> gradient start color\n"
|
" -from <color> gradient start color\n"
|
||||||
" -to <color> gradient end color\n\n"
|
" -to <color> gradient end color\n\n"
|
||||||
" -solid <color> solid color\n\n"
|
" -solid <color> solid color\n\n"
|
||||||
" -help print this help text and exit\n"),
|
" -help print this help text and exit\n"),
|
||||||
getApplicationName());
|
getApplicationName());
|
||||||
|
|
||||||
exit(exit_code);
|
exit(exit_code);
|
||||||
}
|
}
|
||||||
|
@ -350,13 +332,15 @@ void bsetroot::usage(int exit_code) {
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
char *display_name = (char *) 0;
|
char *display_name = (char *) 0;
|
||||||
|
|
||||||
|
i18n.openCatalog("blackbox.cat");
|
||||||
|
|
||||||
for (int i = 1; i < argc; i++) {
|
for (int i = 1; i < argc; i++) {
|
||||||
if (! strcmp(argv[i], "-display")) {
|
if (! strcmp(argv[i], "-display")) {
|
||||||
// check for -display option
|
// check for -display option
|
||||||
|
|
||||||
if ((++i) >= argc) {
|
if ((++i) >= argc) {
|
||||||
fprintf(stderr, i18n(mainSet, mainDISPLAYRequiresArg,
|
fprintf(stderr, i18n(mainSet, mainDISPLAYRequiresArg,
|
||||||
"error: '-display' requires an argument\n"));
|
"error: '-display' requires an argument\n"));
|
||||||
|
|
||||||
::exit(1);
|
::exit(1);
|
||||||
}
|
}
|
||||||
|
@ -369,4 +353,3 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
#ifndef __bsetroot2_hh
|
|
||||||
#define __bsetroot2_hh
|
|
||||||
|
|
||||||
#include "../src/BaseDisplay.h"
|
|
||||||
#include "../src/Image.h"
|
|
||||||
|
|
||||||
class bsetroot : public BaseDisplay {
|
|
||||||
private:
|
|
||||||
BImageControl **img_ctrl;
|
|
||||||
|
|
||||||
char *fore, *back, *grad;
|
|
||||||
|
|
||||||
// no copying!!
|
|
||||||
bsetroot(const bsetroot &);
|
|
||||||
bsetroot& operator=(const bsetroot&);
|
|
||||||
|
|
||||||
inline virtual void process_event(XEvent * /*unused*/) { }
|
|
||||||
|
|
||||||
public:
|
|
||||||
bsetroot(int argc, char **argv, char *dpy_name = 0);
|
|
||||||
~bsetroot(void);
|
|
||||||
|
|
||||||
inline virtual Bool handleSignal(int /*unused*/) { return False; }
|
|
||||||
|
|
||||||
void setPixmapProperty(int screen, Pixmap pixmap);
|
|
||||||
Pixmap duplicatePixmap(int screen, Pixmap pixmap, int width, int height);
|
|
||||||
|
|
||||||
void gradient(void);
|
|
||||||
void modula(int x, int y);
|
|
||||||
void solid(void);
|
|
||||||
void usage(int exit_code = 0);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // __bsetroot2_hh
|
|
59
util/bsetroot.hh
Normal file
59
util/bsetroot.hh
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
|
||||||
|
// Window.cc for Blackbox - an X11 Window manager
|
||||||
|
// Copyright (c) 2001 - 2002 Sean 'Shaleh' Perry <shaleh at debian.org>
|
||||||
|
// Copyright (c) 1997 - 2000, 2002 Brad Hughes <bhughes at trolltech.com>
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
// copy of this software and associated documentation files (the "Software"),
|
||||||
|
// to deal in the Software without restriction, including without limitation
|
||||||
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
// and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
// Software is furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included in
|
||||||
|
// all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
#ifndef __bsetroot2_hh
|
||||||
|
#define __bsetroot2_hh
|
||||||
|
|
||||||
|
#include "../src/BaseDisplay.hh"
|
||||||
|
#include "../src/Image.hh"
|
||||||
|
|
||||||
|
|
||||||
|
class bsetroot : public BaseDisplay {
|
||||||
|
private:
|
||||||
|
BImageControl **img_ctrl;
|
||||||
|
|
||||||
|
char *fore, *back, *grad;
|
||||||
|
|
||||||
|
// no copying!!
|
||||||
|
bsetroot(const bsetroot &);
|
||||||
|
bsetroot& operator=(const bsetroot&);
|
||||||
|
|
||||||
|
inline virtual void process_event(XEvent * /*unused*/) { }
|
||||||
|
|
||||||
|
public:
|
||||||
|
bsetroot(int argc, char **argv, char *dpy_name = 0);
|
||||||
|
~bsetroot(void);
|
||||||
|
|
||||||
|
inline virtual bool handleSignal(int /*unused*/) { return False; }
|
||||||
|
|
||||||
|
void setPixmapProperty(int screen, Pixmap pixmap);
|
||||||
|
Pixmap duplicatePixmap(int screen, Pixmap pixmap, int width, int height);
|
||||||
|
|
||||||
|
void gradient(void);
|
||||||
|
void modula(int x, int y);
|
||||||
|
void solid(void);
|
||||||
|
void usage(int exit_code = 0);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // __bsetroot2_hh
|
Loading…
Reference in a new issue