From 0afb43164484dcac4773ad778c032687da6b01aa Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 14 Jan 2003 00:13:20 +0000 Subject: [PATCH] rm the util directory --- configure.ac | 2 - util/.cvsignore | 6 - util/Makefile.am | 21 - util/bsetbg | 506 ----------- util/bsetroot.cc | 383 --------- util/bsetroot.hh | 60 -- util/epist/.cvsignore | 6 - util/epist/ChangeLog | 45 - util/epist/DESIGN | 57 -- util/epist/Makefile.am | 59 -- util/epist/TODO | 4 - util/epist/actions.cc | 52 -- util/epist/actions.hh | 122 --- util/epist/config.cc | 170 ---- util/epist/config.hh | 89 -- util/epist/epist.1.in | 26 - util/epist/epist.cc | 199 ----- util/epist/epist.hh | 93 -- util/epist/epist.l | 53 -- util/epist/epist.y | 111 --- util/epist/epistrc | 50 -- util/epist/epistrc.5.in | 193 ----- util/epist/keytree.cc | 256 ------ util/epist/keytree.hh | 80 -- util/epist/lex.yy.c | 1716 ------------------------------------- util/epist/main.cc | 102 --- util/epist/parser.cc | 221 ----- util/epist/parser.hh | 77 -- util/epist/screen.cc | 849 ------------------ util/epist/screen.hh | 110 --- util/epist/window.cc | 477 ----------- util/epist/window.hh | 135 --- util/epist/yacc_parser.cc | 1030 ---------------------- util/epist/yacc_parser.hh | 17 - util/xftlsfonts.cc | 153 ---- 35 files changed, 7530 deletions(-) delete mode 100644 util/.cvsignore delete mode 100644 util/Makefile.am delete mode 100644 util/bsetbg delete mode 100644 util/bsetroot.cc delete mode 100644 util/bsetroot.hh delete mode 100644 util/epist/.cvsignore delete mode 100644 util/epist/ChangeLog delete mode 100644 util/epist/DESIGN delete mode 100644 util/epist/Makefile.am delete mode 100644 util/epist/TODO delete mode 100644 util/epist/actions.cc delete mode 100644 util/epist/actions.hh delete mode 100644 util/epist/config.cc delete mode 100644 util/epist/config.hh delete mode 100644 util/epist/epist.1.in delete mode 100644 util/epist/epist.cc delete mode 100644 util/epist/epist.hh delete mode 100644 util/epist/epist.l delete mode 100644 util/epist/epist.y delete mode 100644 util/epist/epistrc delete mode 100644 util/epist/epistrc.5.in delete mode 100644 util/epist/keytree.cc delete mode 100644 util/epist/keytree.hh delete mode 100644 util/epist/lex.yy.c delete mode 100644 util/epist/main.cc delete mode 100644 util/epist/parser.cc delete mode 100644 util/epist/parser.hh delete mode 100644 util/epist/screen.cc delete mode 100644 util/epist/screen.hh delete mode 100644 util/epist/window.cc delete mode 100644 util/epist/window.hh delete mode 100644 util/epist/yacc_parser.cc delete mode 100644 util/epist/yacc_parser.hh delete mode 100644 util/xftlsfonts.cc diff --git a/configure.ac b/configure.ac index 6b439cd9..fbe17ae8 100644 --- a/configure.ac +++ b/configure.ac @@ -48,8 +48,6 @@ AC_CONFIG_FILES([Makefile po/Makefile.in otk/Makefile src/Makefile scripts/Makefile - util/Makefile - util/epist/Makefile doc/Makefile doc/doxygen/Makefile data/Makefile diff --git a/util/.cvsignore b/util/.cvsignore deleted file mode 100644 index 19f71dcc..00000000 --- a/util/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -Makefile -Makefile.in -bsetroot -xftlsfonts -.deps -.libs diff --git a/util/Makefile.am b/util/Makefile.am deleted file mode 100644 index 7bcc85d8..00000000 --- a/util/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -CPPFLAGS= @CPPFLAGS@ - -#SUBDIRS = epist -bin_SCRIPTS = bsetbg -bin_PROGRAMS = bsetroot xftlsfonts - -bsetroot_SOURCES = bsetroot.cc -bsetroot_LDADD = ../src/basedisplay.o ../otk/color.o ../otk/gccache.o \ - ../otk/texture.o ../src/timer.o ../otk/image.o \ - ../otk/imagecontrol.o ../src/util.o ../src/screeninfo.o - -xftlsfonts_SOURCES = xftlsfonts.cc - -INCLUDES= -I../src -I../otk - -MAINTAINERCLEANFILES = Makefile.in - -distclean-local: - rm -f *\~ .\#* - -# local dependencies diff --git a/util/bsetbg b/util/bsetbg deleted file mode 100644 index e1d18824..00000000 --- a/util/bsetbg +++ /dev/null @@ -1,506 +0,0 @@ -#!/bin/sh - -# Copyright (c) 2000-2002 Timothy M. King (tmk@lordzork.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. - -PATH=$PATH:/usr/bin:/usr/local/bin:/usr/X11R6/bin - -img_apps="display xli xsetbg Esetroot qiv wmsetbg xv" - -display_full_cmd="display -geometry 800x600 -window root" -display_tile_cmd="display -window root" -display_center_cmd="display -backdrop -window root" -display_default_cmd="$display_center_cmd" - -Esetroot_full_cmd="Esetroot -scale" -Esetroot_tile_cmd="Esetroot" -Esetroot_center_cmd="Esetroot -c" -Esetroot_default_cmd="$Esetroot_center_cmd" - -wmsetbg_full_cmd="wmsetbg -s -S" -wmsetbg_tile_cmd="wmsetbg -t" -wmsetbg_center_cmd="wmsetbg -e" -wmsetbg_default_cmd="$wmsetbg_center_cmd" - -qiv_full_cmd="qiv --root_s" -qiv_tile_cmd="qiv --root_t" -qiv_center_cmd="qiv --root" -qiv_default_cmd="$qiv_center_cmd" - -xv_full_cmd="xv -max -smooth -root -quit" -xv_tile_cmd="xv -root -quit" -xv_center_cmd="xv -rmode 5 -root -quit" -xv_default_cmd="$xv_center_cmd" - -xli_full_cmd="xli -fullscreen -onroot -quiet" -xli_tile_cmd="xli -onroot -quiet" -xli_center_cmd="xli -center -onroot quiet" -xli_default_cmd="$xli_center_cmd" - -xsetbg_full_cmd="xsetbg -fullscreen" -xsetbg_tile_cmd="xsetbg" -xsetbg_center_cmd="xsetbg -center" -xsetbg_default_cmd="$xsetbg_center_cmd" - -################################## - -me=${0##*/} -version=2.2 -copyright="(c) 2000-$(date +%Y) by Timothy M. King (http://lordzork.com/)" -config=$HOME/.bsetbgrc -last_cmd_file=$HOME/.bsetbg_last_cmd -refresh_cmd=xrefresh -p=$me: -#debug=echo - -quit() -{ - [ "$1" ] && rc=$1 && shift 1 - [ "$*" ] && echo -e $* - exit ${rc:-0} -} - -bool() { - case $1 in - [yY][eE][sS]|1|[yY]|[tT][rR][uU][eE]|[oO][nN]) : ;; - *) return 1 ;; - esac -} - -check_exe_in_path() -{ - if [ -z "$1" ]; then - return 1 - elif [ -x "$(which $1 2>/dev/null)" ]; then - return 0 - elif [ -x "$(type $1 2>/dev/null)" ]; then - return 0 - else - return 1 - fi -} - -help_msg() -{ - cat < center an image on the desktop - -tile tile an image on the desktop - -full stretch an image to fill the desktop - -exec specify an external command to execute - - -app specify the image application to use - -post arguments to be passed to the post-command - -debug prints commands without executing them - - -display use display connection - -mod modula pattern - -foreground, -fg modula foreground color - -background, -bg modula background color - - -gradient gradient texture - -from gradient start color - -to gradient end color - - -solid solid color - - -generate generate a config file - -help this message - -version output version information -EOF - quit ${1:-0} -} - -get_apps() -{ - for a in $img_apps; do - if check_exe_in_path $a; then - eval center_cmd=\$$a\_center_cmd - eval full_cmd=\$$a\_full_cmd - eval tile_cmd=\$$a\_tile_cmd - eval default_cmd=\$$a\_default_cmd - return 0 - else - if [ "$not_found" ]; then - not_found="$not_found $a" - else - not_found=$a - fi - fi - done - return 1 -} - -do_generate() -{ - echo -e "# created by $me $version on $(date)\n#" - echo -e "# seting NO_EXEC to a boolean value (eg true/false) will cause $me" - echo -e "# to never modify the root window\n#" - echo -e "#NO_EXEC=\n#" - echo -e "# POST_COMMAND can be set to a command that will be run run every time" - echo -e "# $me sets the root image\n#" - echo -e "#POST_COMMAND=\n#" - echo -e "# if LOG_LAST_CMD is set (boolean), bsetbg will keep a log of the last" - echo -e "# two successful commands.\n#" - echo -e "#LOG_LAST_CMD=\n#" - echo -e "# the LOGFILE specifies the file that bsetbg uses when LOG_LAST_CMD" - echo -e "# is defined. this defaults to ~/.bsetbg_last_cmd .\n#" - echo -e "#LOGFILE=\n#" - echo -e "# the following are default configuration values for the most popular image" - echo -e "# programs. See the man page of the respective application for more info.\n" - - [ "$*" ] && img_apps="$*" - - for a in $img_apps; do - if check_exe_in_path $a; then - if ! bool $have_match; then - q='\"' - [ "$(eval echo \$$a\_center_cmd)" ] && - eval echo CENTER=$q\$$a\_center_cmd$q && - - [ "$(eval echo \$$a\_full_cmd)" ] && - eval echo FULL=$q\$$a\_full_cmd$q && - - [ "$(eval echo \$$a\_tile_cmd)" ] && - eval echo TILE=$q\$$a\_tile_cmd$q && - - [ "$(eval echo \$$a\_default_cmd)" ] && - eval echo -e DEFAULT=$q\$$a\_default_cmd$q \\\\n && - - have_match=1 - else - [ "$(eval echo \$$a\_center_cmd)" ] && - eval echo \\#CENTER=$q\$$a\_center_cmd$q - - [ "$(eval echo \$$a\_full_cmd)" ] && - eval echo \\#FULL=$q\$$a\_full_cmd$q - - [ "$(eval echo \$$a\_tile_cmd)" ] && - eval echo \\#TILE=$q\$$a\_tile_cmd$q - - [ "$(eval echo \$$a\_default_cmd)" ] && - eval echo -e \\#DEFAULT=$q\$$a\_default_cmd$q \\\\n - fi - fi - done - quit 0 -} - -do_bsetroot() -{ - if check_exe_in_path bsetroot; then - read_config - - $debug bsetroot $* 2>/dev/null; rc=$? - - if [ "$rc" -gt 0 ]; then - help_msg $rc - else - log_cmd bsetroot $*; $refresh_cmd 2>/dev/null - fi - else - quit 1 "couldn't find bsetroot in $PATH" - fi -} - -do_standard() -{ - [ -z "$1" ] && help_msg 1 - - bool $noconfig || read_config - - get_img_command $1 - check_img_command $do_this - - case $# in - 1) file="$1" ;; - *) file="$2" - esac - - if [ -f "$file" ]; then - exec_img_command $do_this $file - else - quit 1 "$file does not exist" - fi -} - -do_exec() -{ - [ "$#" -lt 3 ] && help_msg 3 - - bool $noconfig || read_config - - # check to see if -*c, -*f, or -*t were spcified, if so - # assume the last argument is a filename - b_arg=$(eval echo \$$(( $# - 1 )) ) - app=$1 - - case $b_arg in - -c|*-center|c|-t|*-tile*|t|-f|*-full|f) - eval file=\$$# - f_args="$b_arg $file" - esac - - # put the rest of the arguments into the varialbe $e_args - while [ "$*" ]; do - for a in "$*"; do - case $1 in - $b_arg|$file) : ;; - *) e_args="$e_args "$1"" - esac - shift 1 - done - done - - # with $f_args defined, check for image and do things normally - if [ "$f_args" ]; then - [ ! -f "$file" ] && quit 1 "$file does not exist" - - if check_img_command $e_args; then - do_this="$e_args" - else - read_config - get_img_command $f_args - check_img_command $do_this - echo "$p couldn't find '$app' in path, using $type command instead" - fi - # without $f_args, run the command blindly if it's in $PATH - elif check_exe_in_path $e_args; then - do_this="$e_args" - else - quit 1 "$p unable to run the following command: $e_args" - fi - - exec_img_command $do_this $file -} - -get_img_command() -{ - case $1 in - *-full|-f|f) type=full; do_this="$full_cmd" ;; - *-tile|-t|t) type=tile; do_this="$tile_cmd" ;; - *-center|-c|c) type=center; do_this="$center_cmd" ;; - *) type=default; do_this="$default_cmd" - esac -} - -check_img_command() -{ - if check_exe_in_path $1; then - do_this="$*" - rc=0 - elif get_apps; then - get_img_command $* - rc=1 - else - quit 1 "$p couldn't find a suitable image program. tried the following:\\n - $(for a in $not_found; do echo " $a\\n"; done)" - fi - - if [ "$rc" -gt 0 -a -z "$e_args" ] && bool $read_config; then - echo "$p couldn't find a suitable $type command in $config" - fi - - return $rc -} - -exec_img_command() -{ - unset rc - command=$* - - if [ "$debug" ]; then - $debug $command - else - $command >/dev/null 2>&1; rc=$? - fi - - if [ "$rc" -gt 0 ]; then - echo "$p '$command' exited with status $rc" - get_apps - noconfig=1 - parse_args ${f_args:-$my_args} - echo "$p using '$command' as $type" - $debug $command >/dev/null 2>&1; rc=$? - [ "$rc" = 0 ] && log_cmd $do_this $file && $refresh_cmd 2>/dev/null - else - log_cmd $do_this $file; xrefresh 2>/dev/null - fi - return $rc -} - -log_cmd() -{ - bool $LOG_LAST_CMD || return 1 - [ "$debug" ] && return 1 - echo -e "$prev_cmd\n$*" >$last_cmd_file - return $? -} - -read_config() -{ - [ -f $config ] || return 1 - - if bool $read_config; then - unset read_config - else - read_config=1 - fi - - . $HOME/.bsetbgrc 2>/dev/null - check_no_exec - - full_cmd=$FULL - center_cmd=$CENTER - tile_cmd=$TILE - default_cmd=$CENTER - last_cmd_file=${LOGFILE:-$last_cmd_file} - - bool $LOG_LAST_CMD && prev_cmd=$(tail -n 1 $last_cmd_file 2>/dev/null) -} - -check_no_exec() -{ - bool $NO_EXEC && - quit 0 "$p no_exec mode. the root window will not be modified." -} - -post_command() -{ - bool $noconfig || read_config - - if [ -n "$POST_COMMAND" -a "$1" = 0 ]; then - if [ -n "$debug" ]; then - $debug "running post_command: $POST_COMMAND $post_args" - else - post_command_output=$($POST_COMMAND $post_args 2>&1); erc=$? - if [ "$erc" -gt 0 ]; then - echo "$p post-command '$POST_COMMAND $post_args' exited with status $erc" - [ -n "$post_command_output" ] && - echo "$POST_COMMAND $post_args: $post_command_output" - fi - fi - fi -} - -add_arg() -{ - [ "$1" ] || return 1 - if [ "$args" ]; then - args="$args $1" - else - args=$1 - fi -} - -add_post_arg() -{ - [ -z "$1" ] && return 1 - if [ "$post_args" ]; then - post_args="$post_args $1" - else - post_args=$1 - fi -} - -check_cmd() -{ - if [ -z "$command" ]; then - command=${2:-$1}; eval ${3:-${2:-$1}}=1 - elif bool $do_post; then - add_post_arg ${1} - elif [ "$command" = do_exec ]; then - do_exec=1 - elif [ "$command" != do_bsetroot ]; then - finished=1 - fi -} - -parse_args() -{ - case $1 in - -d|*-debug|d) - unset refresh_cmd; debug=echo\ $me\_debug: ;; - - -p|*-post|p) - unset finished do_standard do_exec; do_post=1 ;; - - -c|*-center|c|-t|*-tile*|t|-f|*-full|f) - case $command in - do_standard|do_generate|do_bsetroot) - finished=1 ;; - do_exec) - if ! bool $got_fcmd; then - add_arg $1 args; got_fcmd=1 - else - finished=1 - fi ;; - *) - add_arg $1; do_standard=1; command=do_standard - esac ;; - - -a|*-app|a|-e|*-exec|e) - command=do_exec; check_cmd ;; - - -mod|-gradient|-solid|-display) - check_cmd "do_bsetroot" && add_arg $1 ;; - - -g|*-generate*|g) - check_cmd $1 "do_generate" ;; - - -v|*-version|v) - [ -z "$command" ] && quit 0 $me $version $copyright ;; - - -h|*-help|h) - [ -z "$command" ] && help_msg ;; - - *) - bool $finished && return 1 - - case $1 in -*) - bool $do_exec || bool $do_bsetroot || bool $do_post || help_msg 1 - esac - - if bool $do_standard || bool $do_exec || bool $do_bsetroot || bool $do_generate; then - add_arg $1 - elif bool $do_post; then - add_post_arg $1 - else - add_arg $1; command=do_standard; finished=1 - fi - esac -} - -[ -z "$*" ] && help_msg 1 - -my_args=$* - -for arg in "$@"; do - parse_args "$arg" - shift 1 -done - -[ "$debug" ] && echo - -$debug $command $args -post_command ${rc:-0} - -quit $rc diff --git a/util/bsetroot.cc b/util/bsetroot.cc deleted file mode 100644 index e578cfa0..00000000 --- a/util/bsetroot.cc +++ /dev/null @@ -1,383 +0,0 @@ -// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- -// bsetroot.cc for Blackbox - an X11 Window manager -// Copyright (c) 2001 - 2002 Sean 'Shaleh' Perry -// Copyright (c) 1997 - 2000, 2002 Brad Hughes -// -// 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. - -#ifdef HAVE_CONFIG_H -# include "../config.h" -#endif // HAVE_CONFIG_H - -extern "C" { -#ifdef HAVE_STDLIB_H -# include -#endif // HAVE_STDLIB_H - -#ifdef HAVE_STRING_H -# include -#endif // HAVE_STRING_H - -#ifdef HAVE_STDIO_H -# include -#endif // HAVE_STDIO_H - -#ifdef HAVE_CTYPE_H -# include -#endif // HAVE_CTYPE_H -} - -#include "gccache.hh" -#include "texture.hh" -#include "util.hh" -#include "bsetroot.hh" - -bsetroot::bsetroot(int argc, char **argv, char *dpy_name) - : BaseDisplay(argv[0], dpy_name) { - - bool mod = False, sol = False, grd = False; - int mod_x = 0, mod_y = 0; - - for (int i = 1; i < argc; i++) { - if (! strcmp("-help", argv[i])) { - usage(); - } else if ((! strcmp("-fg", argv[i])) || - (! strcmp("-foreground", argv[i])) || - (! strcmp("-from", argv[i]))) { - if ((++i) >= argc) usage(1); - - fore = argv[i]; - } else if ((! strcmp("-bg", argv[i])) || - (! strcmp("-background", argv[i])) || - (! strcmp("-to", argv[i]))) { - if ((++i) >= argc) usage(1); - - back = argv[i]; - } else if (! strcmp("-solid", argv[i])) { - if ((++i) >= argc) usage(1); - - fore = argv[i]; - sol = True; - } else if (! strcmp("-mod", argv[i])) { - if ((++i) >= argc) usage(); - - mod_x = atoi(argv[i]); - - if ((++i) >= argc) usage(); - - mod_y = atoi(argv[i]); - - if (mod_x < 1) mod_x = 1; - if (mod_y < 1) mod_y = 1; - - mod = True; - } else if (! strcmp("-gradient", argv[i])) { - if ((++i) >= argc) usage(); - - grad = argv[i]; - grd = True; - } else if (! strcmp("-display", argv[i])) { - // -display passed through tests ealier... we just skip it now - i++; - } else { - usage(); - } - } - - if ((mod + sol + grd) != True) { - fprintf(stderr, - "%s: error: must specify one of: -solid, -mod, -gradient\n", - getApplicationName()); - - usage(2); - } - - img_ctrl = new BImageControl*[getNumberOfScreens()]; - for (unsigned int s = 0; s < getNumberOfScreens(); ++s) - img_ctrl[s] = new BImageControl(this, getScreenInfo(s), True); - - if (sol && ! fore.empty()) - solid(); - else if (mod && mod_x && mod_y && ! (fore.empty() || back.empty())) - modula(mod_x, mod_y); - else if (grd && ! (grad.empty() || fore.empty() || back.empty())) - gradient(); - else usage(); -} - - -bsetroot::~bsetroot(void) { - XSetCloseDownMode(getXDisplay(), RetainPermanent); - - XKillClient(getXDisplay(), AllTemporary); - - std::for_each(img_ctrl, img_ctrl + getNumberOfScreens(), PointerAssassin()); - - delete [] img_ctrl; -} - - -// adapted from wmsetbg -void bsetroot::setPixmapProperty(int screen, Pixmap pixmap) { - static Atom rootpmap_id = None, esetroot_id = None; - Atom type; - int format; - unsigned long length, after; - unsigned char *data; - const ScreenInfo *screen_info = getScreenInfo(screen); - - if (rootpmap_id == None) { - rootpmap_id = XInternAtom(getXDisplay(), "_XROOTPMAP_ID", False); - esetroot_id = XInternAtom(getXDisplay(), "ESETROOT_PMAP_ID", False); - } - - XGrabServer(getXDisplay()); - - /* Clear out the old pixmap */ - XGetWindowProperty(getXDisplay(), screen_info->getRootWindow(), - rootpmap_id, 0L, 1L, False, AnyPropertyType, - &type, &format, &length, &after, &data); - - if ((type == XA_PIXMAP) && (format == 32) && (length == 1)) { - unsigned char* data_esetroot = 0; - XGetWindowProperty(getXDisplay(), screen_info->getRootWindow(), - esetroot_id, 0L, 1L, False, AnyPropertyType, - &type, &format, &length, &after, &data_esetroot); - if (data && data_esetroot && *((Pixmap *) data)) { - XKillClient(getXDisplay(), *((Pixmap *) data)); - XSync(getXDisplay(), False); - XFree(data_esetroot); - } - XFree(data); - } - - if (pixmap) { - XChangeProperty(getXDisplay(), screen_info->getRootWindow(), - rootpmap_id, XA_PIXMAP, 32, PropModeReplace, - (unsigned char *) &pixmap, 1); - XChangeProperty(getXDisplay(), screen_info->getRootWindow(), - esetroot_id, XA_PIXMAP, 32, PropModeReplace, - (unsigned char *) &pixmap, 1); - } else { - XDeleteProperty(getXDisplay(), screen_info->getRootWindow(), - rootpmap_id); - XDeleteProperty(getXDisplay(), screen_info->getRootWindow(), - esetroot_id); - } - - XUngrabServer(getXDisplay()); - XFlush(getXDisplay()); -} - - -// adapted from wmsetbg -Pixmap bsetroot::duplicatePixmap(int screen, Pixmap pixmap, - int width, int height) { - XSync(getXDisplay(), False); - - Pixmap copyP = XCreatePixmap(getXDisplay(), - getScreenInfo(screen)->getRootWindow(), - width, height, - DefaultDepth(getXDisplay(), screen)); - XCopyArea(getXDisplay(), pixmap, copyP, DefaultGC(getXDisplay(), screen), - 0, 0, width, height, 0, 0); - XSync(getXDisplay(), False); - - return copyP; -} - - -void bsetroot::solid(void) { - for (unsigned int screen = 0; screen < getNumberOfScreens(); screen++) { - BColor c(fore, this, screen); - const ScreenInfo *screen_info = getScreenInfo(screen); - - XSetWindowBackground(getXDisplay(), screen_info->getRootWindow(), - c.pixel()); - XClearWindow(getXDisplay(), screen_info->getRootWindow()); - - Pixmap pixmap = XCreatePixmap(getXDisplay(), - screen_info->getRootWindow(), - 8, 8, DefaultDepth(getXDisplay(), screen)); - BPen pen(c); - XFillRectangle(getXDisplay(), pixmap, pen.gc(), 0, 0, 8, 8); - - setPixmapProperty(screen, duplicatePixmap(screen, pixmap, 8, 8)); - - XFreePixmap(getXDisplay(), pixmap); - } -} - - -void bsetroot::modula(int x, int y) { - char data[32]; - long pattern; - - unsigned int screen, i; - - for (pattern = 0, screen = 0; screen < getNumberOfScreens(); screen++) { - for (i = 0; i < 16; i++) { - pattern <<= 1; - if ((i % x) == 0) - pattern |= 0x0001; - } - - for (i = 0; i < 16; i++) { - if ((i % y) == 0) { - data[(i * 2)] = static_cast(0xff); - data[(i * 2) + 1] = static_cast(0xff); - } else { - data[(i * 2)] = pattern & 0xff; - data[(i * 2) + 1] = (pattern >> 8) & 0xff; - } - } - - BColor f(fore, this, screen), b(back, this, screen); - GC gc; - Pixmap bitmap; - const ScreenInfo *screen_info = getScreenInfo(screen); - - bitmap = - XCreateBitmapFromData(getXDisplay(), - screen_info->getRootWindow(), data, - 16, 16); - - XGCValues gcv; - gcv.foreground = f.pixel(); - gcv.background = b.pixel(); - - gc = XCreateGC(getXDisplay(), screen_info->getRootWindow(), - GCForeground | GCBackground, &gcv); - - Pixmap pixmap = XCreatePixmap(getXDisplay(), - screen_info->getRootWindow(), - 16, 16, screen_info->getDepth()); - - XCopyPlane(getXDisplay(), bitmap, pixmap, gc, - 0, 0, 16, 16, 0, 0, 1l); - XSetWindowBackgroundPixmap(getXDisplay(), - screen_info->getRootWindow(), - pixmap); - XClearWindow(getXDisplay(), screen_info->getRootWindow()); - - setPixmapProperty(screen, - duplicatePixmap(screen, pixmap, 16, 16)); - - XFreeGC(getXDisplay(), gc); - XFreePixmap(getXDisplay(), bitmap); - - if (! (screen_info->getVisual()->c_class & 1)) - XFreePixmap(getXDisplay(), pixmap); - } -} - - -void bsetroot::gradient(void) { - /* - we have to be sure that neither raised nor sunken is specified otherwise - odd looking borders appear. So we convert to lowercase then look for - 'raised' or 'sunken' in the description and erase them. To be paranoid - the search is done in a loop. - */ - std::string descr; - descr.reserve(grad.size()); - - std::string::const_iterator it = grad.begin(), end = grad.end(); - for (; it != end; ++it) - descr += tolower(*it); - - std::string::size_type pos; - while ((pos = descr.find("raised")) != std::string::npos) - descr.erase(pos, 6); // 6 is strlen raised - - while ((pos = descr.find("sunken")) != std::string::npos) - descr.erase(pos, 6); - - // now add on 'flat' to prevent the bevels from being added - descr += "flat"; - - for (unsigned int screen = 0; screen < getNumberOfScreens(); screen++) { - BTexture texture(descr, this, screen, img_ctrl[screen]); - const ScreenInfo *screen_info = getScreenInfo(screen); - - texture.setColor(BColor(fore, this, screen)); - texture.setColorTo(BColor(back, this, screen)); - - Pixmap pixmap = - img_ctrl[screen]->renderImage(screen_info->getWidth(), - screen_info->getHeight(), - texture); - - XSetWindowBackgroundPixmap(getXDisplay(), - screen_info->getRootWindow(), - pixmap); - XClearWindow(getXDisplay(), screen_info->getRootWindow()); - - setPixmapProperty(screen, - duplicatePixmap(screen, pixmap, - screen_info->getWidth(), - screen_info->getHeight())); - - if (! (screen_info->getVisual()->c_class & 1)) { - img_ctrl[screen]->removeImage(pixmap); - } - } -} - - -void bsetroot::usage(int exit_code) { - fprintf(stderr, - "%s 2.0\n\n" - "Copyright (c) 1997-2000, 2002 Bradley T Hughes\n" - "Copyright (c) 2001-2002 Sean 'Shaleh' Perry\n\n" - " -display use display connection\n" - " -mod modula pattern\n" - " -foreground, -fg modula foreground color\n" - " -background, -bg modula background color\n\n" - " -gradient gradient texture\n" - " -from gradient start color\n" - " -to gradient end color\n\n" - " -solid solid color\n\n" - " -help print this help text and exit\n", - getApplicationName()); - - exit(exit_code); -} - -int main(int argc, char **argv) { - char *display_name = (char *) 0; - - for (int i = 1; i < argc; i++) { - if (! strcmp(argv[i], "-display")) { - // check for -display option - - if ((++i) >= argc) { - fprintf(stderr, "error: '-display' requires an argument\n"); - - ::exit(1); - } - - display_name = argv[i]; - } - } - - bsetroot app(argc, argv, display_name); - - return 0; -} diff --git a/util/bsetroot.hh b/util/bsetroot.hh deleted file mode 100644 index 912aa81b..00000000 --- a/util/bsetroot.hh +++ /dev/null @@ -1,60 +0,0 @@ -// -*- 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 -// Copyright (c) 1997 - 2000, 2002 Brad Hughes -// -// 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 "basedisplay.hh" -#include "image.hh" - -#include - -class bsetroot : public BaseDisplay { -private: - BImageControl **img_ctrl; - - std::string 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 diff --git a/util/epist/.cvsignore b/util/epist/.cvsignore deleted file mode 100644 index 6e4aeb80..00000000 --- a/util/epist/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -epist -Makefile.in -Makefile -.deps -epist.1 -epistrc.5 diff --git a/util/epist/ChangeLog b/util/epist/ChangeLog deleted file mode 100644 index 39b0e003..00000000 --- a/util/epist/ChangeLog +++ /dev/null @@ -1,45 +0,0 @@ - * Fixed (hopefully) the ugly bugly that would cause (Marius) - epist to hog the keyboard on invalid keys. - - * Added stackedCyclingRaise option, to allow windows (Marius) - to raise on focus when stacked is on. - - * Small fixes, better sanity checks, much better (Marius) - error reporting on bad keys and modifiers. - -2.1.0 - - * Improved parser: much better error reporting for - malformed files, most tokens are now case - insensitive. (Marius) - - * Added configuration code and options {} block in - the config file (Marius) - - * Added chain timeout; (time after which a started - chain is automatically cancelled) enabled with the - chainTimeout option. (Marius) - - * 2d matrix workspace navigation code. Enabled with - the workspaceRows option, uses the - {prev,next}Workspace{Row,Column} actions. (Scott, Marius) - - * Added stacked window cycling. Enable with the - stackedCycling option. (Marius, Ben) - - * New actions: showRootMenu, showWorkspaceMenu, - toggleDecorations (Ben) - - * Fixed some internal inconsistencies in action names (Marius) - - * Added cancelChain action - users can cancel chains - explicitly (Marius) - - * Added toggleGrabs action - can be bound to a key (Marius) - to temporarily disable epist bindings. - - * Added/improved command line parameter handling (Ben) - - * Added code to handle windows which don't specify - the input focus. (Ben) - diff --git a/util/epist/DESIGN b/util/epist/DESIGN deleted file mode 100644 index a02a7bbd..00000000 --- a/util/epist/DESIGN +++ /dev/null @@ -1,57 +0,0 @@ -Epist design notes, by woodblock --------------------------------- - -- Chained keybindings like emacs, and I suppose vi if you're wierd like that. -- most actions can take extra parameters. probably only numbers, - or strings, maybe both. -- no interactive string inputs -- A config file that doesn't suck - - -- exec -- iconify -- raise -- lower -- close -- move to desktop -- send to desktop -- toggle shade -- sticky -- move window -- resize window -- next/prev window (special orders like stacking, grouping, etc?) -- maximize/minimize -- no stupid window -- toggle keybindings -- menus? - -class Action { - enum type; - char *string; - int param; - Action next; -} - -option ; - -action [name] ; - -chain [name] { - , - , - ... - } - -eg: - action emacs C-e exec emacs; - action C-a exec aterm -fn smoothansi; - action xmms C-x exec xmms; - -chain M-q { - emacs, - xmms - } - -Would produce M-q C-e -> emacs, M-q C-x -> xmms, C-a -> aterm. - - diff --git a/util/epist/Makefile.am b/util/epist/Makefile.am deleted file mode 100644 index 359eaa0f..00000000 --- a/util/epist/Makefile.am +++ /dev/null @@ -1,59 +0,0 @@ -DEFAULT_RC=$(pkgdatadir)/epistrc - -CLEANFILES = epist.1 epistrc.5 - -CPPFLAGS= @CPPFLAGS@ -DDEFAULTRC=\"$(DEFAULT_RC)\" - -#EXTRA_PROGRAMS = epist -bin_PROGRAMS = epist - -man_MANS = epist.1 epistrc.5 - -epist_SOURCES = epist.cc window.cc screen.cc main.cc actions.cc \ - yacc_parser.cc parser.cc keytree.cc lex.yy.c config.cc - -epist_LDADD = ../../src/xatom.o ../../src/basedisplay.o \ - ../../src/util.o ../../src/timer.o - -MAINTAINERCLEANFILES = Makefile.in - -distclean-local: - rm -f *\~ .\#* - -epist.1: epist.1.in - @regex_cmd@ -e "s,@pkgdatadir@,$(pkgdatadir)," \ - epist.1.in > epist.1 - -epistrc.5: epistrc.5.in - @regex_cmd@ -e "s,@pkgdatadir@,$(pkgdatadir)," \ - epistrc.5.in > epistrc.5 - -install-data-local: epistrc - test -f $(DESTDIR)$(pkgdatadir)/epistrc || \ - $(INSTALL_DATA) epistrc $(DESTDIR)$(pkgdatadir) - -uninstall-am: - rm -f $(DESTDIR)$(pkgdatadir)/epistrc - -# local dependencies -actions.o: actions.cc actions.hh -config.o: config.cc config.hh -epist.o: epist.cc actions.hh epist.hh window.hh ../../src/util.hh \ - keytree.hh ../../src/timer.hh screen.hh config.hh \ - ../../src/basedisplay.hh parser.hh ../../src/xatom.hh -keytree.o: keytree.cc keytree.hh ../../src/timer.hh actions.hh \ - screen.hh window.hh ../../src/util.hh config.hh epist.hh \ - ../../src/basedisplay.hh -main.o: main.cc ../../version.h epist.hh actions.hh window.hh \ - ../../src/util.hh keytree.hh ../../src/timer.hh screen.hh config.hh \ - ../../src/basedisplay.hh -parser.o: parser.cc parser.hh actions.hh keytree.hh ../../src/timer.hh \ - screen.hh window.hh ../../src/util.hh config.hh -screen.o: screen.cc ../../src/basedisplay.hh ../../src/timer.hh \ - ../../src/util.hh ../../src/xatom.hh screen.hh window.hh config.hh \ - epist.hh actions.hh keytree.hh -window.o: window.cc epist.hh actions.hh window.hh ../../src/util.hh \ - keytree.hh ../../src/timer.hh screen.hh config.hh \ - ../../src/basedisplay.hh ../../src/xatom.hh -yacc_parser.o: yacc_parser.cc parser.hh actions.hh keytree.hh \ - ../../src/timer.hh screen.hh window.hh ../../src/util.hh config.hh diff --git a/util/epist/TODO b/util/epist/TODO deleted file mode 100644 index 187eae78..00000000 --- a/util/epist/TODO +++ /dev/null @@ -1,4 +0,0 @@ -- Make sure the parser doesn't puke on invalid actions (doesn't grab - keys or stop parsing) - -- Implement the workspace grid using the new netwm spec diff --git a/util/epist/actions.cc b/util/epist/actions.cc deleted file mode 100644 index e37ff247..00000000 --- a/util/epist/actions.cc +++ /dev/null @@ -1,52 +0,0 @@ -// -*- mode: C++; indent-tabs-mode: nil; -*- -// actions.cc for Epistrophy - a key handler for NETWM/EWMH window managers. -// Copyright (c) 2002 - 2002 Ben Jansens -// -// 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. - -#include "actions.hh" - -Action::Action(enum ActionType type, KeyCode keycode, unsigned int modifierMask, - const std::string &str) - : _type(type), _keycode(keycode), _modifierMask(modifierMask) -{ - // These are the action types that take string arguments. This - // should probably be moved to a static member - ActionType str_types[] = { - execute, - nextWindowOfClass, - prevWindowOfClass, - nextWindowOfClassOnAllWorkspaces, - prevWindowOfClassOnAllWorkspaces, - noaction - }; - - for (int i = 0; str_types[i] != noaction; ++i) { - if (type == str_types[i]) { - _stringParam = str; - return; - } - } - - _numberParam = atoi( str.c_str() ); - - // workspace 1 to the user is workspace 0 to us - if (type == changeWorkspace || type == sendToWorkspace) - _numberParam--; -} diff --git a/util/epist/actions.hh b/util/epist/actions.hh deleted file mode 100644 index ac6d62b5..00000000 --- a/util/epist/actions.hh +++ /dev/null @@ -1,122 +0,0 @@ -// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- -// actions.hh for Epistrophy - a key handler for NETWM/EWMH window managers. -// Copyright (c) 2002 - 2002 Ben Jansens -// -// 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 __actions_hh -#define __actions_hh - -extern "C" { -#include -} - -#include -#include - -class Action { -public: - enum ActionType { - noaction = 0, - execute, //done - iconify, //done - raise, //done - lower, //done - close, //done - toggleShade, //done - toggleOmnipresent, //done - moveWindowUp, //done - moveWindowDown, //done - moveWindowLeft, //done - moveWindowRight, //done - resizeWindowWidth, //done - resizeWindowHeight, //done - - toggleMaximizeFull, //done - toggleMaximizeVertical, //done - toggleMaximizeHorizontal, //done - - sendToWorkspace, //done - - nextWindow, //done for now - prevWindow, //done for now - nextWindowOnAllWorkspaces, //done for now - prevWindowOnAllWorkspaces, //done for now - - nextWindowOnAllScreens, //done for now - prevWindowOnAllScreens, //done for now - - nextWindowOfClass, //done for now - prevWindowOfClass, //done for now - nextWindowOfClassOnAllWorkspaces, //done for now - prevWindowOfClassOnAllWorkspaces, //done for now - - upWindow, - downWindow, - leftWindow, - rightWindow, - - changeWorkspace, //done - nextWorkspace, //done - prevWorkspace, //done - - upWorkspace, //all done - downWorkspace, - leftWorkspace, - rightWorkspace, - - nextScreen, //done for now - prevScreen, //done for now - - // these are openbox extensions - showRootMenu, - showWorkspaceMenu, - toggleDecorations, - - toggleGrabs, - stringChain, - keyChain, - numberChain, - - cancelChain, //done - - NUM_ACTIONS - }; - -private: - enum ActionType _type; - const KeyCode _keycode; - const unsigned int _modifierMask; - - int _numberParam; - std::string _stringParam; -public: - inline enum ActionType type() const { return _type;} - inline const KeyCode keycode() const { return _keycode; } - inline const unsigned int modifierMask() const { return _modifierMask; } - inline const int number() const { return _numberParam; } - inline const std::string &string() const { return _stringParam; } - - Action(enum ActionType type, KeyCode keycode, unsigned int modifierMask, - const std::string &str = ""); -}; - -typedef std::list ActionList; - -#endif diff --git a/util/epist/config.cc b/util/epist/config.cc deleted file mode 100644 index 461778e5..00000000 --- a/util/epist/config.cc +++ /dev/null @@ -1,170 +0,0 @@ -// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- -// config.cc for Epistrophy - a key handler for NETWM/EWMH window managers. -// Copyright (c) 2002 - 2002 Ben Jansens -// -// 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. - -#ifdef HAVE_CONFIG_H -# include "../../config.h" -#endif // HAVE_CONFIG_H - -#include "config.hh" - -using std::string; - -Config::Config() {} - -Config::~Config() -{ - // deallocate memory for the 3 lists - BoolItemList::const_iterator b_it, b_end = bool_items.end(); - for (b_it = bool_items.begin(); b_it != b_end; ++b_it) - delete *b_it; - bool_items.clear(); - - NumberItemList::const_iterator n_it, n_end = number_items.end(); - for (n_it = number_items.begin(); n_it != n_end; ++n_it) - delete *n_it; - number_items.clear(); - - StringItemList::const_iterator s_it, s_end = string_items.end(); - for (s_it = string_items.begin(); s_it != s_end; ++s_it) - delete *s_it; - string_items.clear(); -} - - -bool Config::getValue(Config::StringType type, string &ret) const -{ - StringItemList::const_iterator it = string_items.begin(), end = string_items.end(); - for (; it != end; ++it) { - if ((*it)->type == type) { - ret = (*it)->value; - return true; - } - } - return false; -} - - -bool Config::getValue(Config::NumberType type, int &ret) const -{ - NumberItemList::const_iterator it = number_items.begin(), end = number_items.end(); - for (; it != end; ++it) { - if ((*it)->type == type) { - ret = (*it)->value; - return true; - } - } - return false; -} - - -bool Config::getValue(Config::BoolType type, bool &ret) const -{ - BoolItemList::const_iterator it = bool_items.begin(), end = bool_items.end(); - for (; it != end; ++it) { - if ((*it)->type == type) { - ret = (*it)->value; - return true; - } - } - return false; -} - - -void Config::addOption(const std::string &name, const std::string &value) -{ - const struct { - const char *name; - Config::BoolType type; - } - bool_options[] = { - { "stackedcycling", Config::stackedCycling }, - { "stackedcyclingraise", Config::stackedCyclingRaise }, - { "", NUM_BOOL_TYPES } - }; - - const struct { - const char *name; - Config::StringType type; - } - string_options[] = { - { "", NUM_STRING_TYPES } - }; - - const struct { - const char *name; - Config::NumberType type; - } - number_options[] = { - { "chaintimeout", chainTimeout }, - { "workspacecolumns", workspaceColumns }, - { "", NUM_NUMBER_TYPES } - }; - - // if it's bool option, add it to the bool_items list - size_t i = 0; - while (bool_options[i].type != NUM_BOOL_TYPES) { - if (strcasecmp(name.c_str(), bool_options[i].name) == 0) { - BoolItem *item = new BoolItem; - const char *tmp = value.c_str(); - - item->type = bool_options[i].type; - - if (strcasecmp(tmp, "true") == 0 || strcasecmp(tmp, "1") == 0 || - strcasecmp(tmp, "on") == 0) - item->value = true; - else - item->value = false; - - bool_items.push_back(item); - return; - } - i++; - } - - // if it's a string, add it to the string_items list - i = 0; - while (string_options[i].type != NUM_STRING_TYPES) { - if (strcasecmp(name.c_str(), string_options[i].name) == 0) { - StringItem *item = new StringItem; - item->type = string_options[i].type; - item->value = value; - - string_items.push_back(item); - return; - } - i++; - } - - // if it's a number, add it to the number_items list - i = 0; - while (number_options[i].type != NUM_NUMBER_TYPES) { - if (strcasecmp(name.c_str(), number_options[i].name) == 0) { - NumberItem *item = new NumberItem; - item->type = number_options[i].type; - item->value = atoi( value.c_str() ); - - number_items.push_back(item); - return; - } - i++; - } -} diff --git a/util/epist/config.hh b/util/epist/config.hh deleted file mode 100644 index 8749009d..00000000 --- a/util/epist/config.hh +++ /dev/null @@ -1,89 +0,0 @@ -// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- -// config.hh for Epistrophy - a key handler for NETWM/EWMH window managers. -// Copyright (c) 2002 - 2002 Ben Jansens -// -// 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 __config_hh -#define __config_hh - -#include -#include - -// forward declarations -struct BoolItem; -struct StringItem; -struct NumberItem; - -class Config { -public: - enum BoolType { - NO_BOOL_TYPE, - stackedCycling, - stackedCyclingRaise, - NUM_BOOL_TYPES - }; - - enum StringType { - NO_STRING_TYPE, - NUM_STRING_TYPES - }; - - enum NumberType { - NO_NUMBER_TYPE, - chainTimeout, - workspaceColumns, - NUM_NUMBER_TYPES - }; - -private: - typedef std::list BoolItemList; - typedef std::list StringItemList; - typedef std::list NumberItemList; - BoolItemList bool_items; - StringItemList string_items; - NumberItemList number_items; - -public: - Config(); - ~Config(); - - bool getValue(BoolType, bool &) const; - bool getValue(StringType, std::string &) const; - bool getValue(NumberType, int &) const; - - void addOption(const std::string &, const std::string &); -}; - -struct BoolItem { - Config::BoolType type; - bool value; -}; - -struct StringItem { - Config::StringType type; - std::string value; -}; - -struct NumberItem { - Config::NumberType type; - int value; -}; - -#endif // __config_hh diff --git a/util/epist/epist.1.in b/util/epist/epist.1.in deleted file mode 100644 index 5e9175b2..00000000 --- a/util/epist/epist.1.in +++ /dev/null @@ -1,26 +0,0 @@ -.TH epist 1 "August 16 2002" "epist" "v1.0" -.SH NAME -epist - NetWM keybindings grabber -.SH SYNOPSIS -\fBepist\fR [options] -.SH DESCRIPTION -\fBepist\fR is intended to provide keygrabbing for the OpenBox window manager -for the X Window System. This allows you to control things with keypresses -rather than the mouse. -.SH OPTIONS -.TP -\fB\-display\fR \fIXdisplay\fR -\fIX display\fR is connected to by epist instead of $DISPLAY. -.TP -\fB\-rc\fR \fIrcfile\fR -\fIrcfile\fR is used as the keybindings configuration. -.TP -.SH CONFIGURATION -\fBepist\fR will read its configuration from \fI~/.openbox/epistrc\fR otherwise -a default configuration, installed in \fI@pkgdatadir@/epistrc\fR -will be used. See \fIepistrc\fR(5) for more details on the format of the file. -.SH AUTHOR -The authors of epist are Scott Moynes , -Marius Nita , and Ben Jansens . -.SH SEE ALSO -\fIopenbox\fR(1) \fIepistrc\fR(5) diff --git a/util/epist/epist.cc b/util/epist/epist.cc deleted file mode 100644 index 74a11d1a..00000000 --- a/util/epist/epist.cc +++ /dev/null @@ -1,199 +0,0 @@ -// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- -// epist.cc for Epistrophy - a key handler for NETWM/EWMH window managers. -// Copyright (c) 2002 - 2002 Ben Jansens -// -// 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. - -#ifdef HAVE_CONFIG_H -# include "../../config.h" -#endif // HAVE_CONFIG_H - -extern "C" { -#ifdef HAVE_UNISTD_H -# include -# include -#endif // HAVE_UNISTD_H - -#ifdef HAVE_STDLIB_H -# include -#endif // HAVE_STDLIB_H - -#ifdef HAVE_SIGNAL_H -# include -#endif // HAVE_SIGNAL_H - -#ifdef HAVE_LIBGEN_H -# include -#endif // HAVE_LIBGEN_H - -#ifdef HAVE_UNISTD_H -# include -# include -#endif // HAVE_UNISTD_H - -#ifdef HAVE_SYS_STAT_H -# include -# include -#endif // HAVE_SYS_STAT_H -} - -#include -#include - -using std::cout; -using std::endl; -using std::string; - -#include "actions.hh" -#include "epist.hh" -#include "screen.hh" -#include "window.hh" -#include "parser.hh" -#include "../../src/xatom.hh" - - -epist::epist(char **argv, char *dpy_name, char *rc_file) - : BaseDisplay(argv[0], dpy_name) { - - _argv = argv; - - if (rc_file) - _rc_file = rc_file; - else - _rc_file = expandTilde("~/.openbox/epistrc"); - - struct stat buf; - if (0 != stat(_rc_file.c_str(), &buf) || - !S_ISREG(buf.st_mode)) - _rc_file = DEFAULTRC; - - _xatom = new XAtom(getXDisplay()); - _active = _clients.end(); - - _config = new Config; - _ktree = new keytree(getXDisplay(), this); - - // set up the key tree - parser p(_ktree, _config); - p.parse(_rc_file); - - for (unsigned int i = 0; i < getNumberOfScreens(); ++i) { - screen *s = new screen(this, i); - if (s->managed()) { - _screens.push_back(s); - s->updateEverything(); - } - } - if (_screens.empty()) { - cout << "No compatible window manager found on any screens. Aborting.\n"; - ::exit(1); - } - - activateGrabs(); -} - - -epist::~epist() { - delete _xatom; -} - -void epist::activateGrabs() { - - ScreenList::const_iterator scrit, scrend = _screens.end(); - - for (scrit = _screens.begin(); scrit != scrend; ++scrit) - _ktree->grabDefaults(*scrit); -} - - -bool epist::handleSignal(int sig) { - switch (sig) { - case SIGHUP: { - cout << "epist: Restarting on request.\n"; - - execvp(_argv[0], _argv); - - string base(basename(_argv[0])); - execvp(base.c_str(), _argv); - - return false; // this should be unreachable - } - - case SIGTERM: - case SIGINT: - case SIGPIPE: - shutdown(); - return true; - } - - return false; -} - - -void epist::process_event(XEvent *e) { - ScreenList::const_iterator it, end = _screens.end(); - for (it = _screens.begin(); it != end; ++it) { - if ((*it)->rootWindow() == e->xany.window) { - (*it)->processEvent(*e); - return; - } - } - - // wasnt a root window, try for client windows - XWindow *w = findWindow(e->xany.window); - if (w) w->processEvent(*e); -} - - -void epist::addWindow(XWindow *window) { - _windows.insert(WindowLookupPair(window->window(), window)); -} - - -void epist::removeWindow(XWindow *window) { - _windows.erase(window->window()); -} - - -XWindow *epist::findWindow(Window window) const { - WindowLookup::const_iterator it = _windows.find(window); - if (it != _windows.end()) - return it->second; - - return 0; -} - - -void epist::cycleScreen(int current, bool forward) const { - unsigned int i; - for (i = 0; i < _screens.size(); ++i) - if (_screens[i]->number() == current) { - current = i; - break; - } - assert(i < _screens.size()); // current is for an unmanaged screen - - int dest = current + (forward ? 1 : -1); - - if (dest < 0) dest = (signed)_screens.size() - 1; - else if (dest >= (signed)_screens.size()) dest = 0; - - const XWindow *target = _screens[dest]->lastActiveWindow(); - if (target) target->focus(); -} diff --git a/util/epist/epist.hh b/util/epist/epist.hh deleted file mode 100644 index 64970e57..00000000 --- a/util/epist/epist.hh +++ /dev/null @@ -1,93 +0,0 @@ -// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- -// epist.hh for Epistrophy - a key handler for NETWM/EWMH window managers. -// Copyright (c) 2002 - 2002 Ben Jansens -// -// 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 __epist_hh -#define __epist_hh - -extern "C" { -#include -} - -#include -#include - -#include "actions.hh" -#include "window.hh" -#include "keytree.hh" -#include "config.hh" - -#include "../../src/basedisplay.hh" - -class XAtom; -class screen; - -class epist : public BaseDisplay { -private: - std::string _rc_file; - XAtom *_xatom; - char **_argv; - keytree *_ktree; - Config *_config; - - typedef std::vector ScreenList; - ScreenList _screens; - - typedef std::map WindowLookup; - typedef WindowLookup::value_type WindowLookupPair; - WindowLookup _windows; - - WindowList _clients; - WindowList::iterator _active; - - ActionList _actions; - - virtual void process_event(XEvent *e); - virtual bool handleSignal(int sig); - - void activateGrabs(); - -public: - epist(char **argv, char *display_name, char *rc_file); - virtual ~epist(); - - inline XAtom *xatom() { return _xatom; } - - void addWindow(XWindow *window); - void removeWindow(XWindow *window); - XWindow *findWindow(Window window) const; - - void cycleScreen(int current, bool forward) const; - - void getLockModifiers(int &numlockMask, int &scrolllockMask) const { - numlockMask = NumLockMask; - scrolllockMask = ScrollLockMask; - } - - const ActionList &actions(void) { return _actions; } - keytree &getKeyTree(void) { return *_ktree; } - inline const Config *getConfig(void) { return _config; } - - WindowList& clientsList() { return _clients; } - WindowList::iterator& activeWindow() { return _active; } -}; - -#endif // __epist_hh diff --git a/util/epist/epist.l b/util/epist/epist.l deleted file mode 100644 index 6c7e08a5..00000000 --- a/util/epist/epist.l +++ /dev/null @@ -1,53 +0,0 @@ -%{ -#ifdef HAVE_CONFIG_H -# include "../../config.h" -#endif // HAVE_CONFIG_H - -#include -#include -#include "yacc_parser.hh" - -extern YYSTYPE yylval; - -%} - -%option yylineno - -%% - -\{ return OBRACE; -\} return EBRACE; -; return SEMICOLON; -- return DASH; -Options | -options return OPTIONS; -Mod1 | -mod1 | -Mod2 | -mod2 | -Mod3 | -mod3 | -Mod4 | -mod4 | -Mod5 | -mod5 | -Control | -control | -shift | -Shift yylval = (int) strdup(yytext); return BINDING; -on | -On | -true | -True yylval = (int) strdup(yytext); return TRUE; -Off | -off | -false | -False yylval = (int) strdup(yytext); return FALSE; -[0-9]+ yylval = (int) strdup(yytext); return NUMBER; -\".+\" yylval = (int) strdup(yytext); return QUOTES; -[a-zA-Z_0-9]+ yylval = (int) strdup(yytext); return WORD; -#.+\n /* ignore */ -\n /* ignore */ -[ \t]+ /* */ -%% - diff --git a/util/epist/epist.y b/util/epist/epist.y deleted file mode 100644 index 243e4168..00000000 --- a/util/epist/epist.y +++ /dev/null @@ -1,111 +0,0 @@ -%{ -#ifdef HAVE_CONFIG_H -# include "../../config.h" -#endif // HAVE_CONFIG_H - -#include -#include -#include "parser.hh" - -#define YYPARSE_PARAM parser_obj -#define YYSTYPE char* - -extern int yylineno; -extern char *yytext; - -extern "C" { - int yylex(); - int yywrap() { - return 1; - } -} - -void yyerror(const char *c) -{ - printf("ERROR: %s, on line %d, near %s\n", c, yylineno, yytext); -} - -%} - -%token OBRACE EBRACE SEMICOLON DASH NUMBER QUOTES WORD BINDING OPTIONS TRUE FALSE -%expect 1 - -%% - -commands: - | commands command - | commands options_block - ; - -command: - action_command | chain_command - ; - -action_command: - binding WORD parameter SEMICOLON - { - ((parser*)parser_obj)->setAction($2); - ((parser*)parser_obj)->endAction(); - } - - ; - -chain_command: - binding obrace commands ebrace - { - ((parser*)parser_obj)->endChain(); - } - ; - -options_block: - options_keyword OBRACE options EBRACE - ; - -binding: - binding_w_modifier bind_key - ; - -obrace: - OBRACE { ((parser*)parser_obj)->startChain(); } - ; - -ebrace: - EBRACE { /* ((parser*)parser_obj)->endChain(); */ } - ; - -binding_w_modifier: - | BINDING DASH binding_w_modifier { ((parser*)parser_obj)->addModifier($1); } - ; - -bind_key: - OBRACE { ((parser*)parser_obj)->setKey($1); } - | EBRACE { ((parser*)parser_obj)->setKey($1); } - | DASH { ((parser*)parser_obj)->setKey($1); } - | SEMICOLON { ((parser*)parser_obj)->setKey($1); } - | NUMBER { ((parser*)parser_obj)->setKey($1); } - | WORD { ((parser*)parser_obj)->setKey($1); } - ; - -parameter: - | NUMBER { ((parser*)parser_obj)->setArgumentNum($1); } - | DASH NUMBER { ((parser*)parser_obj)->setArgumentNegNum($2); } - | QUOTES { ((parser*)parser_obj)->setArgumentStr($1); } - | TRUE { ((parser*)parser_obj)->setArgumentTrue($1); } - | FALSE { ((parser*)parser_obj)->setArgumentFalse($1); } - ; - -options_keyword: - OPTIONS - ; - -options: - | options option - ; - -option: - WORD parameter SEMICOLON - { ((parser*)parser_obj)->setOption($1); } - ; - -%% - diff --git a/util/epist/epistrc b/util/epist/epistrc deleted file mode 100644 index 8d9250d3..00000000 --- a/util/epist/epistrc +++ /dev/null @@ -1,50 +0,0 @@ -# Default epistrophy rc file - -options { - # default option values - - stackedCycling false; - chainTimeout 4000; - workspaceColumns 0; -} - -Mod1-F1 changeWorkspace 1; -Mod1-F2 changeWorkspace 2; -Mod1-F3 changeWorkspace 3; -Mod1-F4 changeWorkspace 4; -Mod1-F5 changeWorkspace 5; -Mod1-F6 changeWorkspace 6; -Mod1-F7 changeWorkspace 7; - - -Control-F1 execute "xterm"; - -Control-Mod1-Right nextWindow; -Control-Mod1-Shift-Right nextwindowonallworkspaces; -Control-Mod1-Left prevWindow; -Control-Mod1-Shift-Left prevwindowonallworkspaces; -Control-Mod1-Up nextWorkspace; -Control-Mod1-Down prevWorkspace; - -# These default to 5 pixels. -Mod1-Up moveWindowUp; -Mod1-Down moveWindowDown; -Mod1-Left moveWindowLeft; -Mod1-Right moveWindowRight; - -Control-Mod1-Shift-x { - i iconify; - r raise; - l lower; - k close; - s toggleShade; - o toggleOmnipresent; - - 1 sendToWorkspace 1; - 2 sendToWorkspace 2; - 3 sendToWorkspace 3; - 4 sendToWorkspace 4; - 5 sendToWorkspace 5; - 6 sendToWorkspace 6; -} - diff --git a/util/epist/epistrc.5.in b/util/epist/epistrc.5.in deleted file mode 100644 index 06615768..00000000 --- a/util/epist/epistrc.5.in +++ /dev/null @@ -1,193 +0,0 @@ -.TH epistrc 5 "August 24, 2002" -.SH NAME -epistrc \- Configuration file for Epist -.SH SYNOPSIS -.B $HOME/.openbox/epistrc -.br -.B @pkgdatadir@/epistrc -.SH DESCRIPTION -\fIepist\fR(1) grabs its configuration and bindings from the epistrc file. All -options shown will work with any window manager that supports the NetWM/EWMH -specification, with the exception of those marked with the -.B [Openbox specific] -tag. -.SH SYNTAX -The epistrc file contains 2 sections: -.SS Options -All of the options for epist are contained inside a clause such as this: -.PP -options { -.br -