From e9386776e8884478cc98f685db735dec1565465c Mon Sep 17 00:00:00 2001 From: "Fredrick W. Warren" Date: Sun, 8 Sep 2024 16:50:24 -0600 Subject: [PATCH] Initial commit of 1.21 from Soureforge --- .gitignore | 162 +++++++ PKG-INFO | 11 + README.txt | 28 ++ examples/README | 97 ++++ examples/pywmdatetime.py | 293 ++++++++++++ examples/pywmgeneric.py | 679 +++++++++++++++++++++++++++ examples/pywmhdmon.py | 541 ++++++++++++++++++++++ examples/pywmnop.py | 35 ++ examples/pywmoonop.py | 16 + examples/pywmphoto.py | 42 ++ examples/pywmradio.py | 304 +++++++++++++ examples/pywmseti.py | 502 ++++++++++++++++++++ examples/pywmsysmon.py | 397 ++++++++++++++++ examples/pywmwet.py | 262 +++++++++++ examples/sample.pyradiorc | 18 + examples/sample.pywmdatetimerc | 42 ++ examples/sample.pywmgenericrc | 69 +++ examples/sample.pywmhdmonrc | 50 ++ examples/sample.pywmsetirc | 12 + setup.py | 37 ++ wmdocklib/3x5.xpm | 37 ++ wmdocklib/4x6.xpm | 32 ++ wmdocklib/4x7.xpm | 35 ++ wmdocklib/5x7-aa.xpm | 35 ++ wmdocklib/5x7.xpm | 50 ++ wmdocklib/5x8-utf-8.xpm | 95 ++++ wmdocklib/5x8.xpm | 96 ++++ wmdocklib/5x9.xpm | 49 ++ wmdocklib/6(3)x8-7seg.xpm | 32 ++ wmdocklib/6x11-utf-8.xpm | 148 ++++++ wmdocklib/6x12.xpm | 44 ++ wmdocklib/6x8-7seg.xpm | 32 ++ wmdocklib/6x8.xpm | 93 ++++ wmdocklib/6x8orig.xpm | 33 ++ wmdocklib/6x8slant.xpm | 34 ++ wmdocklib/7x12-41c.xpm | 83 ++++ wmdocklib/7x14-utf-8.xpm | 159 +++++++ wmdocklib/7x8zx.xpm | 33 ++ wmdocklib/8x12-41c.xpm | 81 ++++ wmdocklib/8x13-utf-8.xpm | 148 ++++++ wmdocklib/8x8-cholo.xpm | 32 ++ wmdocklib/8x8.xpm | 57 +++ wmdocklib/8x8zx.xpm | 57 +++ wmdocklib/9x18-utf-8.xpm | 203 +++++++++ wmdocklib/README | 15 + wmdocklib/__init__.py | 12 + wmdocklib/pywmgeneral.c | 809 +++++++++++++++++++++++++++++++++ wmdocklib/pywmgeneral.h | 66 +++ wmdocklib/pywmhelpers.py | 458 +++++++++++++++++++ wmdocklib/wmoo.py | 133 ++++++ 50 files changed, 6788 insertions(+) create mode 100644 .gitignore create mode 100644 PKG-INFO create mode 100644 README.txt create mode 100644 examples/README create mode 100755 examples/pywmdatetime.py create mode 100644 examples/pywmgeneric.py create mode 100755 examples/pywmhdmon.py create mode 100644 examples/pywmnop.py create mode 100755 examples/pywmoonop.py create mode 100644 examples/pywmphoto.py create mode 100755 examples/pywmradio.py create mode 100755 examples/pywmseti.py create mode 100755 examples/pywmsysmon.py create mode 100644 examples/pywmwet.py create mode 100644 examples/sample.pyradiorc create mode 100644 examples/sample.pywmdatetimerc create mode 100644 examples/sample.pywmgenericrc create mode 100644 examples/sample.pywmhdmonrc create mode 100644 examples/sample.pywmsetirc create mode 100644 setup.py create mode 100644 wmdocklib/3x5.xpm create mode 100644 wmdocklib/4x6.xpm create mode 100644 wmdocklib/4x7.xpm create mode 100644 wmdocklib/5x7-aa.xpm create mode 100644 wmdocklib/5x7.xpm create mode 100644 wmdocklib/5x8-utf-8.xpm create mode 100644 wmdocklib/5x8.xpm create mode 100644 wmdocklib/5x9.xpm create mode 100644 wmdocklib/6(3)x8-7seg.xpm create mode 100644 wmdocklib/6x11-utf-8.xpm create mode 100644 wmdocklib/6x12.xpm create mode 100644 wmdocklib/6x8-7seg.xpm create mode 100644 wmdocklib/6x8.xpm create mode 100644 wmdocklib/6x8orig.xpm create mode 100644 wmdocklib/6x8slant.xpm create mode 100644 wmdocklib/7x12-41c.xpm create mode 100644 wmdocklib/7x14-utf-8.xpm create mode 100644 wmdocklib/7x8zx.xpm create mode 100644 wmdocklib/8x12-41c.xpm create mode 100644 wmdocklib/8x13-utf-8.xpm create mode 100644 wmdocklib/8x8-cholo.xpm create mode 100644 wmdocklib/8x8.xpm create mode 100644 wmdocklib/8x8zx.xpm create mode 100644 wmdocklib/9x18-utf-8.xpm create mode 100644 wmdocklib/README create mode 100644 wmdocklib/__init__.py create mode 100644 wmdocklib/pywmgeneral.c create mode 100644 wmdocklib/pywmgeneral.h create mode 100644 wmdocklib/pywmhelpers.py create mode 100644 wmdocklib/wmoo.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..82f9275 --- /dev/null +++ b/.gitignore @@ -0,0 +1,162 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/latest/usage/project/#working-with-version-control +.pdm.toml +.pdm-python +.pdm-build/ + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ diff --git a/PKG-INFO b/PKG-INFO new file mode 100644 index 0000000..9abe7d8 --- /dev/null +++ b/PKG-INFO @@ -0,0 +1,11 @@ +Metadata-Version: 1.0 +Name: pywmdockapps +Version: 1.21 +Summary: + read the whole story at http://pywmdockapps.sourceforge.net/ +Home-page: http://pywmdockapps.sourceforge.net +Author: Kristoffer Erlandsson & al. +Author-email: mfrasca@zonnet.nl +License: (L)GPL +Description: UNKNOWN +Platform: UNKNOWN diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..bedb901 --- /dev/null +++ b/README.txt @@ -0,0 +1,28 @@ +[WHAT] +pywmdockapps is the name of an GPL'd project containing one python package +(wmdocklib) and a few python scripts. wmdocklib will help you develop +WindowMaker dockapps in python. it is mostly a wrapper around the popular +wmgeneral.c, but some new functions have been added too. + +wmdocklib is divided in two parts: a thin wrapper around the popular +wmgeneral.c and a thicker pywmhelpers.py module providing more pythonic +interface to the wmdocklib and a few additional functions (e.g.: handling +simple configuration files). all functions provided by these modules are +imported in the namespace of wmdocklib so you won't need explicit importing +of either modules: just import wmdocklib. It is adviced to only use those +functions provided by pywmhelpers and not touch the pywmgeneral module +directly at all. For information about how to use the module, see the +documentation in pywmhelpers.py. It is also possible to import it in the +interactive interpreter and issue 'help(pywmhelpers)'. + +the sample scripts are described in the examples/README +a small set of samples are provided. all of them make use of the module +pywmgeneral. + +[INSTALLATION] +python ./setup install + +[CONTACT] +Anything related to this piece of software can be e-mailed to me, Mario +Frasca . + diff --git a/examples/README b/examples/README new file mode 100644 index 0000000..efc5acd --- /dev/null +++ b/examples/README @@ -0,0 +1,97 @@ +[Pywmdatetime] +Pywmdatetime is a WindowMaker dockapp for displaying time, date and +some other information. The colors and formats are easy to configure +through the configuration file or as command line arguments. Invoke +the program with --help or see the sample rc-file for more information. + +[Pywmgeneric] +Pywmgeneric is a dockapp with five entrys that display the first line of +output from an external program, the returned string from an python +method or an static string. Three mouse actions can be associated with +each displayed entry. + +[Pywmgeneric -- DETAILED] +Five different entries can be defined in pywmgeneric. Every entry can +have an action, an update_delay and up to three mouse actions associated +with it. Some additional options are also available. + +The associated action of an entry is executed with update_delay time +between executions. The output from the action is stored. If no special +display options are defined, the application will display the first line +of output from the action. If it does not fit in the window, it will +slowly scroll in the window. Clicking with the mouse on the text invokes +one of the mouse actions, depending on which button was pressed. The +action can be to execute an external program, to run a python method or +to update the text through performing the action associated with the +entry. The mouse actions can retreive the text genererated by the timed +action. + +Python methods that should be executed as actions should be defined in +the class UserMethods. Look in pywmgeneric.py, near the top, for this +class and the documentation of how these methods should be defined. +Note that the methods allready there only are samples and will probably +not work on your system. + +Other options in the configuration file include: +scroll = yes|no - en-/disable scrolling of the text when it doesn't fit +display = - display a static string instead of the first line of + the action-generated output. + +See the sample configuration file for examples and more information. +Note that this file is only for reference, it is the one I use. Things +will probably not work on your system if you do not change it. + +[Pywmgeneric -- USES] +This program is very generic (hence the name ;) ), the uses are many +since it is highly configurable. + +I use it for displaying my cpu and system temperatures. I just defined +methods for reading two files in the /proc filesystem on my system. + +I also use it for fetching headlines from a newspaper, displaying the +first headline fetched. If I click with my left button, all headlines +will appear in an xmessage. If I rightclick the headlines along with +summaries are displayed, and if I click with my middle button mozilla +will fire up showing the newspaper's website. + +I have an external program which displays what's currently on tv, +ideal for use with this program I thought! I modified it a bit so +it printed a summary line at the top, and voila I have all +currently running tv programs scrolling by in an dockapp. And clicking +on it shows me the details. + +You could use it as an application launcher, just display the name of +the applications and associate mouse actions to lauch them. The +xterm-entry in the sample shows this. + +You could probably come up with much more than this! + +[pywmhdmon] +pywmhdmon is a WindowMaker dockapp that displays the available space on +up to four of your filesystems. It also contains a bar showing the +current HD activity. It currently only works on system which has a +/proc/stat like file. The application is easy to configure, invoke it +with --help or see the sample rc-file for more information. + +[pywmhdmon -- BUGS] +The activity bar does not work with the proc filesystem that comes with +the 2.6 kernels. It is just a matter of rewriting the app to parse the +new format, but I'm low on time personally. + +[Pywmseti] +Pywmseti is an WindowMaker dockapp for monitoring your seti@home progress. +The application displays how many workunits you have done and the progress +on the current one. You start/stop the seti@home process by simply clicking +anywhere in the application. It also displays the time spent on the workunit +(or since you started the program if you restart it in the middle of a +workunit). Invoke the program with --help or see the sample rc-file for +more information about customization. + +[pywmsysmon] +pywmsysmon is a WindowMaker dockapp that displays your cpu and memory +usages. The upper graph shows your cpu usage history and the lower +"progress bar" shows your current memory usage excluding cached and +buffered data. This program currently only works on systems which got +the /proc/stat and /proc/meminfo files available. Invoke the program +with --help for information about customization. + diff --git a/examples/pywmdatetime.py b/examples/pywmdatetime.py new file mode 100755 index 0000000..5d4dc42 --- /dev/null +++ b/examples/pywmdatetime.py @@ -0,0 +1,293 @@ +#!/usr/bin/env python + +"""pywmdatetime.py + +WindowMaker dockapp that displays time, date, weekday and week number. + +Copyright (C) 2003 Kristoffer Erlandsson + +Licensed under the GNU General Public License. + + +Changes: +2003-09-01 Kristoffer Erlandsson +Fixed a bug where the week didn't update if we used %q style week numbering. + +2003-06-28 Kristoffer Erlandsson +Fixed a bug where a mouse click caused an infinite loop + +2003-06-26 Kristoffer Erlandsson +Fixed bug when longer strings didn't get cleared when shorter ones where +painted. Now only repaint the strings when they have changed. + +2003-06-24 Kristoffer Erlandsson +Added event handling for graceful shutdown + +2003-06-16 Kristoffer Erlandsson +First workingish version +""" +usage = """pywmdatetime.py [options] +Available options are: +-h, --help print this help +-f, --foreground set the foreground color +-b, --background set the background color +-F, --font set the font name +-t, --timeformat set the time format +-d, --dateformat set the date format +-y, --weekdayformat set the weekday format +-e, --weekformat set the week format +-r, --rgbfile set the rgb file to get color codes from +-c, --configfile set the config file to use +--debug shows the pixmap + +The formats are the same as Python's strftime() accept. See the sample +rc-file for more information about this. +""" + +import sys +import time +import getopt +import os + +import wmdocklib + +width = 64 +height = 64 + +xOffset = 4 +yOffset = 4 + +timeDefaultFormat = '%H:%M:%S' +dateDefaultFormat = '%d-%m-%y' +dayDefaultFormat = '%A' +weekDefaultFormat = 'wk %q' # %q added by Kristoffer for different week calculation. + +defaultConfigFile = '~/.pywmdatetimerc' +maxCharsPerLine = None + +def addString(s, x, y): + try: + wmdocklib.addString(s, x, y, xOffset, yOffset, + width, height) + except ValueError, e: + sys.stderr.write('Error when painting string:\n' + str(e) + '\n') + sys.stderr.write('test %s' % ((s, x, y, xOffset, yOffset, + width, height),)) + raise + sys.exit(3) + +def addTimeString(s, x, y): + for c in s: + charW = 7 + charX = (ord(c) - ord('0')) * 7 + charY = 64 + if not c.isdigit(): + charX = 70 + charW = 3 + wmdocklib.copyXPMArea(charX, charY, charW, 10, x+xOffset+1, y+yOffset) + x += charW + +def clearLine(y): + '''Clear a line of text at position y.''' + wmdocklib.copyXPMArea(73, yOffset, width - 2 * xOffset, char_height, + xOffset, y + yOffset) + +def getCenterStartPos(s): + return wmdocklib.getCenterStartPos(s, width, xOffset) + +def getVertSpacing(numLines, margin): + return wmdocklib.getVertSpacing(numLines, margin-1, height, yOffset) + 1 + +def calculateWeek(localTime): + """Calculate the week number as we do, for example in Sweden. + + That is, add one to the %W format if the year didn't start on a monday.""" + day = int(time.strftime('%j', localTime)) + weekDay = int(time.strftime('%w')) - 1 + if weekDay == -1: + weekDay = 6 + lastMonday = day - weekDay + if lastMonday % 7 == 0: + return int(time.strftime('%W')) + return int(time.strftime('%W')) + 1 + +def parseCommandLine(argv): + """Parse the commandline. Return a dictionary with options and values.""" + shorts = 'hf:b:t:d:e:y:r:c:F:a' + longs = ['antialiased', 'help', 'foreground=', 'background=', + 'timeformat=', 'dateformat=', 'debug', + 'weekdayformat=', 'weekformat=', 'rgbfile=', 'configfile=', 'font='] + try: + opts, nonOptArgs = getopt.getopt(argv[1:], shorts, longs) + except getopt.GetoptError, e: + sys.stderr.write('Error when parsing commandline: ' + str(e) + '\n') + sys.stderr.write(usage) + sys.exit(2) + d = {} + + for o, a in opts: + if o in ('-h', '--help'): + sys.stdout.write(usage) + sys.exit(0) + if o in ('-a', '--antialiased'): + d['antialiased'] = True + if o in ('-f', '--foreground'): + d['foreground'] = a + if o in ('-F', '--font'): + d['font'] = a + if o in ('-b', '--background'): + d['background'] = a + if o in ('-t', '--timeformat'): + d['timeformat'] = a + if o in ('-d', '--dateformat'): + d['dateformat'] = a + if o in ('-y', '--weekdayformat'): + d['weekdayformat'] = a + if o in ('-e', '--weekformat'): + d['weekformat'] = a + if o in ('-r', '--rgbfile'): + d['rgbfile'] = a + if o in ('-c', '--configfile'): + d['configfile'] = a + if o in ('--debug'): + d['debug'] = True + return d + +def checkForEvents(): + event = wmdocklib.getEvent() + while not event is None: + if event['type'] == 'destroynotify': + sys.exit(0) + event = wmdocklib.getEvent() + +def mainLoop(timeFmt, dateFmt, dayFmt, weekFmt): + recalcWeek = weekFmt.find('%q') + 1 # True if we found %q. + newWeekFmt = weekFmt + counter = -1 + lastStrs = [''] * 4 + while 1: + counter += 1 + checkForEvents() + lt = time.localtime() + timeStr = time.strftime(timeFmt, lt)[:maxCharsPerLine] + timeX = 3 + if antialiased: + margin = 6 + spacing = getVertSpacing(4, margin) + if lastStrs[0] != timeStr: + addTimeString(timeStr, timeX, margin-4) + margin += 3 + else: + margin = 4 + spacing = getVertSpacing(4, margin) + if lastStrs[0] != timeStr: + addString(timeStr, timeX, margin) + lastStrs[0] = timeStr + if counter % 100 == 0: + # We only perform the date/week checks/updates once every 100th + # iteration. We will maybe lag behind a couple of seconds when + # switching, but switching occurs seldom and it will be alot of + # unnecessary checks :). + dateStr = time.strftime(dateFmt, lt)[:maxCharsPerLine] + if recalcWeek: + week = calculateWeek(lt) + newWeekFmt = weekFmt.replace('%q', str(week)) + weekStr = time.strftime(newWeekFmt, lt)[:maxCharsPerLine] + dayStr = time.strftime(dayFmt, lt)[:maxCharsPerLine] + dateX = getCenterStartPos(dateStr) + weekX = getCenterStartPos(weekStr) + dayX = getCenterStartPos(dayStr) + if lastStrs[1] != dateStr: + clearLine(margin + spacing + char_width) + addString(dateStr, dateX, margin + spacing + char_width) + lastStrs[1] = dateStr + if lastStrs[2] != dayStr: + clearLine(margin + 2 * (spacing + char_width)) + addString(dayStr, dayX, margin + 2 * (spacing + char_width)) + lastStrs[2] = dayStr + if lastStrs[3] != weekStr: + clearLine(margin + 3 * (spacing + char_width)) + addString(weekStr, weekX, margin + 3 * (spacing + char_width)) + lastStrs[3] = weekStr + if counter == 999999: + counter = -1 + wmdocklib.redraw() + time.sleep(0.1) + +patterns = [ +".+@@+.....#@...#@@#...#@@#....$@%...@@@@+..+=@%..+@@@@@..%@@+...&@@#.....", +"$@==@$...+@@..&@--@&.*@--@&...#@%..*@-%%*.$==-@&.*%%%@=.#@-=@*.*@=-@&....", +"&@**@&..#@@@..&@$.@%.&-..@%..*@@%..+@+....+@*.%*....+@*.%@.+@+.%@$.-%.*+.", +"%@..@%..#+%@.....$@%....+@#..--@%..&@=@#..%@$+$.....--..&@&%@$.%@..%@.%@.", +"%@..@%....%@.....%@*...%@-..*@$@%..%@%=@*.%@=@@*...*@&...=@@#..&@%&@@.*+.", +"%@..@%....%@....+@%....&-@+.=#.@%...*.$@%.%@%&@-...#@...#@&%@*..=@@@@....", +"%@..@%....%@...+@=$......-@.@-%@=&.....@%.%@..%@...=-...@%..@%...+*%@.&%.", +"&@**@&....%@..$@=$...&-..-@.@@@@@%.--.*@#.+@$.-@...@%...@-.$@%.$#*.=%.%@.", +"$@==@$....%@..#@-%%&.+@--@#....@%..%@-=@$.$@=-@#..+@+...#@-=@*.$@=-@+....", +".+@@+.....%@..@@@@@%..#@@#.....@%..$-@=+...+=@%$..+@+...$#@@&...+@@#.....", +] +palette = { + ".":"#181818", + "+":"#6E6E0F", + "@":"#FFFF00", + "#":"#A0A009", + "$":"#3B3B14", + "%":"#B9B907", + "&":"#87870C", + "*":"#545411", + "=":"#E6E602", + "-":"#CFCF04", + } + +def main(): + clConfig = parseCommandLine(sys.argv) + configFile = clConfig.get('configfile', defaultConfigFile) + configFile = os.path.expanduser(configFile) + fileConfig = wmdocklib.readConfigFile(configFile, sys.stderr) + # Merge the two configs, let the commandline options overwrite those in the + # configuration file. + config = fileConfig + for i in clConfig.iteritems(): + config[i[0]] = i[1] + + timeFmt = config.get('timeformat', timeDefaultFormat) + dateFmt = config.get('dateformat', dateDefaultFormat) + dayFmt = config.get('weekdayformat', dayDefaultFormat) + weekFmt = config.get('weekformat', weekDefaultFormat) + # openXwindow sets the window title to the program name. If we get the + # program name with a path, split it so we only name the window with the + # filename. + try: + programName = sys.argv[0].split(os.sep)[-1] + except IndexError: # Should only happen when using the interpreter. + programName = '' + sys.argv[0] = programName + + palette[0] = clConfig.get('background', 'black') + palette[2] = clConfig.get('foreground', 'cyan3') + + font = clConfig.get('font', '6x8orig') + + if clConfig.get('antialiased'): + background = [((6,3),(57,19)), + ((3,22),(60,60))] + else: + background = [((3,3),(59,60))] + + debug = clConfig.get('debug') + + global char_width, char_height, maxCharsPerLine, antialiased + char_width, char_height = wmdocklib.initPixmap(patterns=patterns, + font_name=font, + bg=0, fg=2, palette=palette, + background=background, + debug=debug) + maxCharsPerLine = (width-2*xOffset) / char_width + antialiased = clConfig.get('antialiased', False) + + wmdocklib.openXwindow(sys.argv, width, height) + mainLoop(timeFmt, dateFmt, dayFmt, weekFmt) + +if __name__ == '__main__': + main() + diff --git a/examples/pywmgeneric.py b/examples/pywmgeneric.py new file mode 100644 index 0000000..f2e9897 --- /dev/null +++ b/examples/pywmgeneric.py @@ -0,0 +1,679 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +"""pywmgeneric.py + +WindowMaker dockapp to display the output from an external program, or the +string returned from a python function. Mouse actions can be associated with +the displayed text. + +Copyright (C) 2003 Kristoffer Erlandsson + +Licensed under the GNU General Public License. + + +Changes +2003-07-02 Kristoffer Erlandsson +Added support for up to 10 mouse buttons. +The char translation now handles both upper and lower case. + +2003-06-29 Kristoffer Erlandsson +Additional error checking around string interpolations from cfg file. + +2003-06-27 Kristoffer Erlandsson +First working version +""" + +usage = """pywmgeneric.py [options] +Available options are: + -h, --help print this help + -t, --text set the text color + -b, --background set the background color + -F, --font set the font name + -r, --rgbfile set the rgb file to get color codes from + -c, --configfile set the config file to use +""" + +import sys +import os +import time +import string +import ConfigParser +import getopt +import popen2 + +import wmdocklib + +prevStat = {'user':0, + 'nice':0, + 'sys':0, + 'idle':0, + 'total':0, + } +import re +cpuinfo = re.compile(r'^cpu[^ ]* +(?P[0-9]+) +(?P[0-9]+)' + r'+(?P[0-9]+) +(?P[0-9]+)') + +class UserMethods: + """Put methods that should be called when the action is method=... here. + + The action methods should return a function, which in turn returns + the string to be displayed (if no 'display =' exists) and stored + for later retreival. + + The mouse action methods gets the entry instance as an argument. Return + value doesn't matter. + + An instance of this class is created at initialization and passed to all + entries, so keep in mind that they share the same object. + + THE METHODS ALREADY HERE ARE JUST SAMPLES AND WILL PROBABLY NOT WORK + WITH YOUR SYSTEM. + """ + + userTicks = sysTicks = niceTicks = idleTicks = 0 + + def getCpuTemp(self): + def result(): + global prevStat + try: + f = file('/proc/stat', 'r') + except IOError: + return 'error' + + currStat = dict( + [(k, int(v)) + for (k,v) in cpuinfo.match(f.readline()).groupdict().items()] + ) + f.close() + + total = 0 + for k,v in currStat.items(): + total += v + currStat['total'] = total + totalTicks = (currStat['total'] - prevStat['total']) + + result = {} + if (totalTicks <= 0): + return '00/00/00' + + for k in prevStat: + result[k] = (100. * (currStat[k] - prevStat[k])) / totalTicks + prevStat = currStat + + return '%(user)02.f/%(sys)02.f/%(idle)02.f' % result + return result + + def getSysTemp(self): + try: + f = file('/proc/sys/dev/sensors/w83697hf-isa-0290/temp1', 'r') + except IOError: + return lambda: 'error' + temp = f.readline().split()[2] + f.close() + return lambda: 'sys: %s' % temp + + def ls(self): + return lambda: 'boh' + + def showDnWithoutDescs(self, entry): + """Strip descriptions from some text where the descs are indented. + + Display it in an xmessage. + """ + text = entry.getAllText() + s = '\n'.join([x for x in text.split('\n') if not x.startswith(' ')]) + os.system('xmessage "' + s.replace('"', r'\"') + '" &') + + def showTvWithoutDescs(self, entry): + """Strip descriptions from some text where the descs are indented. + + Display it in an xmessage. + """ + text = entry.getAllText() + s='\n'.join([x for x in + text.split('\n')[1:] if not x.startswith(' ')]) + s = s.replace('\n\n', '\n') + os.system('xmessage "' + s.replace('"', r'\"') + '" &') + +width = 64 +height = 64 + +xOffset = 4 +yOffset = 4 + +maxChars = 13 + +defaultConfigFile = '~/.pywmgenericrc' +defaultRGBFiles = ('/usr/share/X11/rgb.txt', '/usr/X11R6/lib/X11/rgb.txt') + +err = sys.stderr.write + +def addString(s, x, y): + """Convenience function around pwymhelpers.addString.""" + try: + wmdocklib.addString(s, x, y, xOffset, yOffset, + width, height) + except ValueError, e: + sys.stderr.write('Error when painting string:\n' + str(e) + '\n') + sys.exit(3) + +def clearLine(y): + """Clear a line of text at position y.""" + wmdocklib.copyXPMArea(0, 64+yOffset, + width - 2 * xOffset, char_height, + xOffset, y + yOffset) + +def getXY(line): + """Return the x and y positions to be used at line line.""" + return 0, line * (char_height + 3) + 1 + +def isTrue(s): + """Return true if the string s can be interpreted as a true value. + + Raises ValueError if we get a string we don't like. + """ + trueThings = ['on', 'yes', '1', 'true'] + falseThings = ['off', 'no', '0', 'false'] + if s in trueThings: + return 1 + elif s in falseThings: + return 0 + raise ValueError + + +class Entry: + def __init__(self, line, updateDelay, action, mouseActions, + userMethods, display=None, scrollText=1): + self._updateDelay = updateDelay + self._line = line + self._action = self._parseAction(action) + self._mouseActions = [self._parseAction(a) for a in mouseActions] + self._userMethods = userMethods + self._display = display + self._scrollText = scrollText + + self._glue = ' ... ' + self._scrollPos = 0 + self._tickCount = 0L + + self._runningProcs = [] + self._actionProc = None + self._getTextMethod = None + self._allText = '' + self._displayLine = '' + # Do one action when we start, so we are sure that one gets done even + # if we do not want any other updates. + self._doAction() + self._lastActionAt = time.time() + + def _parseAction(self, action): + """Parse an action string, return (, ). + + Or none if we get an empty action.""" + if action: + whatToDo = action.split()[0] + argStr = action[len(whatToDo):].lstrip() + return (whatToDo, argStr) + return None + + def _execExternal(self, command): + """Exec an external command in the background. + + Return the running process as created by Popen3().""" + proc = popen2.Popen3(command) + self._runningProcs.append(proc) + return proc + + def _doMouseAction(self, button): + """Perform the mouse action associated with a button.""" + if len(self._mouseActions) < button: + return # Just for safety, shouldn't happen. + item = self._mouseActions[button - 1] + if item: + # We have an action associated with the button. + action, arg = item + else: + # No action associated with the button. + return + if action == 'exec': + self._execExternal(self._expandStr(arg)) + elif action == 'method': + try: + method = getattr(self._userMethods, arg) + except AttributeError: + method = None + if method: + method(self) + else: + err("Warning: Method %s does not exist." % arg) + elif action == 'update': + self._doAction() + else: + err("Warning: Unknown mouse action: %s, ignoring.\n" % action) + + def _doAction(self): + """Perform the action associated with this entry.""" + if self._action is None: + return + action, arg = self._action + if action == 'exec': + if self._actionProc is None : + self._actionProc = self._execExternal(arg) + else: + if not self._actionProc in self._runningProcs: + # The action process since the last time is finished, we + # can start another one without risking that we get + # flooded by processes. + self._actionProc = self._execExternal(arg) + self._getTextMethod = self._readFromActionProc + elif action == 'method': + try: + method = getattr(self._userMethods, arg) + except AttributeError: + method = None + if method: + self._getTextMethod = method() + else: + err('Warning: method %s does not exist. Ignoring.\n' % arg) + else: + err("Warning: Unknown action: %s, ignoring.\n" % action) + + def _readFromActionProc(self): + """If our action process is ready, return the output. Otherwise None. + """ + if self._actionProc.poll() == -1: + # Wait until the process is ready before we really read the text. + return None + # fromchild.read() will return '' if we allready have read the output + # so there will be no harm in calling this method more times. + return self._actionProc.fromchild.read() + + def _reapZombies(self): + """Poll all running childs. This will reap all zombies.""" + i = 0 + for p in self._runningProcs: + val = p.poll() + if val != -1: + self._runningProcs.pop(i) + i += 1 + + def _updateText(self): + """Get the text, update the display if it has changed. + """ + text = '' + if self._getTextMethod: + text = self._getTextMethod() + # Only change the text if we get anything from the getTextMethod() + if text: + self._allText = text + if self._display is None: + # We have no display = in the config file, we want to + # display the first line of the output of the action. + if text: + displayLine = text.split(os.linesep)[0] + else: + displayLine = self._displayLine + else: + displayLine = self._display + if displayLine != self._displayLine: + # Line to display has changed, display the new one. + self._displayLine = displayLine + self._scrollPos = 0 + self.displayText(displayLine) + elif len(self._displayLine) > maxChars and self._scrollText: + # Line is the same and is longer than the display and we + # want to scroll it. + if self._tickCount % 2 == 0: + # Only scroll every third tick. + self._scrollAndDisplay() + + def _scrollAndDisplay(self): + """Scroll the text one step to the left and redisplay it. + + When reaching the end, paint number of spaces before scrolling in the + same line again from the right. + """ + + # increase the amount of scrolled chars by one, modulo the lenght. + # take the line, append to it some glue and a copy of the line + # again, drop as many characters as the updated scrollPos, display + # the resulting text. + self._scrollPos += 1 + self._scrollPos %= len(self._displayLine) + len(self._glue) + disp = self._displayLine + self._glue + self._displayLine + disp = disp[self._scrollPos:] + self.displayText(disp) + + def tick1(self): + """Do things that should be done often. + """ + self._tickCount += 1 + self._reapZombies() + self._updateText() + currTime = time.time() + if not self._updateDelay is None and \ + currTime - self._lastActionAt > self._updateDelay: + # We want to do this last in the tick so the command gets the time + # to finish before the next tick (if it's a fast one). + self._lastActionAt = currTime + self._doAction() + + def tick2(self): + """Do things that should be done a bit less often. + """ + pass + + def translateText(self, text): + """Translate chars that can't be painted in the app to something nicer. + + Or nothing if we can't come up with something good. Could be nice to + extend this function with chars more fitting for your language. + """ + fromChars = u'ñźńśćżłáéíóúàèìòùâêîôûäëïöüãẽĩõũ' + toChars = u'nznsczlaeiouaeiouaeiouaeiouaeiou' + for frm, to in zip(fromChars, toChars): + text = text.replace(frm, to) + text = text.replace(frm.upper(), to.upper()) + text = ''.join([i for i in text if 32 <= ord(i) < 128]) + return text + + def getAllText(self): + return self._allText + + def getDisplayedLine(self): + return self._displayLine + + def _expandStr(self, s): + """Expand s, which now should be a line from an on_mouseX field. + """ + try: + res = s % {'allText' : self._allText, + 'displayedLine' : self._displayLine, + 'allTextEscaped' : self._allText.replace('"', r'\"'), + 'allTextButFirstLine' : + '\n'.join(self._allText.split('\n')[1:]), + 'allTextButFirstLineEscaped' : + '\n'.join(self._allText.replace('"', '\"'). + split('\n')[1:])} + except (KeyError, TypeError, ValueError): + err( + "Warning: %s doesn't expand correctly. Ignoring interpolations.\n" + % s) + res = s + return res + + def displayText(self, text): + """Display text on the entry's line. + + Remove or translate characters that aren't supported. Truncate the text + to fit in the app. + """ + x, y = getXY(self._line) + clearLine(y) + addString(self.translateText(text)[:maxChars], x, y) + + def mouseClicked(self, button): + """A mouse button has been clicked, do things.""" + if 0 < button < 11: + self._doMouseAction(button) + +class PywmGeneric: + def __init__(self, config): + self._entrys = [] + line = 0 + um = UserMethods() + for c in config: + # Create our 5 entrys. + if not c: + self._entrys.append(None) + line += 1 + continue + delay = c.get('update_delay') + if not delay is None: + try: + delay = self.parseTimeStr(delay) + except ValueError: + err("Malformed update_delay in section %s. " + % str(i)) + err("Ignoring this section.\n") + self._entrys.append(None) + line += 1 + continue + action = c.get('action') + display = c.get('display') + if action is None and display is None: + err( + "Warning: No action or display in section %d, ignoring it.\n" + % i) + self._entrys.append(None) + else: + scroll = isTrue(c.get('scroll', '1')) + # Get the mouse actions. + mouseActions = [] + for i in range(10): + but = str(i + 1) + opt = 'on_mouse' + but + mouseActions.append(c.get(opt)) + self._entrys.append(Entry(line, delay, action, + mouseActions, um, display, scroll)) + line += 1 + self._setupMouseRegions() + + def _setupMouseRegions(self): + for i in range(5): + x, y = getXY(i) + if not self._entrys[i] is None: + wmdocklib.addMouseRegion(i, x + xOffset, y + yOffset, + width - 2 * xOffset, y + yOffset + char_height) + + def parseTimeStr(self, timeStr): + """Take a string on a form like 10h and return the number of seconds. + + Raise ValueError if timeStr is on a bad format. + """ + multipliers = {'s' : 1, 'm' : 60, 'h' : 3600} + timeStr = timeStr.strip() + if timeStr: + timeLetter = timeStr[-1] + multiplier = multipliers.get(timeLetter) + if not multiplier is None: + timeNum = float(timeStr[:-1].strip()) + numSecs = timeNum * multiplier + return numSecs + raise ValueError, 'Invalid literal' + + def _checkForEvents(self): + event = wmdocklib.getEvent() + while not event is None: + if event['type'] == 'destroynotify': + sys.exit(0) + elif event['type'] == 'buttonrelease': + region = wmdocklib.checkMouseRegion(event['x'], event['y']) + button = event['button'] + if region != -1: + if not self._entrys[region] is None: + self._entrys[region].mouseClicked(button) + event = wmdocklib.getEvent() + + def mainLoop(self): + counter = -1 + while 1: + counter += 1 + self._checkForEvents() + if counter % 2 == 0: + [e.tick1() for e in self._entrys if not e is None] + if counter % 20 == 0: + [e.tick2() for e in self._entrys if not e is None] + + if counter == 999999: + counter = -1 + wmdocklib.redraw() + time.sleep(0.5) + +def parseCommandLine(argv): + """Parse the commandline. Return a dictionary with options and values.""" + shorts = 'ht:b:r:c:F:' + longs = ['help', 'text=', 'background=', 'rgbfile=', 'configfile=', + 'font=', 'debug'] + try: + opts, nonOptArgs = getopt.getopt(argv[1:], shorts, longs) + except getopt.GetoptError, e: + err('Error when parsing commandline: ' + str(e) + '\n') + err(usage) + sys.exit(2) + d = {} + for o, a in opts: + if o in ('-h', '--help'): + sys.stdout.write(usage) + sys.exit(0) + if o in ('-t', '--text'): + d['text'] = a + if o in ('-b', '--background'): + d['background'] = a + if o in ('-F', '--font'): + d['font'] = a + if o in ('-r', '--rgbfile'): + d['rgbfile'] = a + if o in ('-c', '--configfile'): + d['configfile'] = a + if o in ('--debug'): + d['debug'] = True + return d + +def readConfigFile(fileName): + """Read the config file. + + Return a list with dictionaries with the options and values in sections + [0]-[4]. + """ + fileName = os.path.expanduser(fileName) + if not os.access(fileName, os.R_OK): + err("Can't read the configuration file %s.\n" % fileName) + # We can't do much without a configuration file + sys.exit(3) + cp = ConfigParser.ConfigParser() + try: + cp.read(fileName) + except ConfigParser.Error, e: + err("Error when reading configuration file:\n%s\n" % str(e)) + sys.exit(3) + l = [{}, {}, {}, {}, {}] + for i in range(5): + strI = str(i) + if cp.has_section(strI): + for o in cp.options(strI): + l[i][o] = cp.get(strI, o, raw=1) + return l + +background = \ +[ + ' ...............................................................................................', + ' .///..___..ooo..___..___.......................................................................', + ' .///..___..ooo..___..___.......................................................................', + ' .///..___..ooo..___..___.......................................................................', + ' .///.._________________________________________________________________________________________', + ' .///.._________________________________________________________________________________________', + ' .///.._________________________________________________________________________________________', + ' .///.._________________________________________________________________________________________', + ' .///.._________________________________________________________________________________________', + ' .///.._________________________________________________________________________________________', + ' .///.._________________________________________________________________________________________', + ' .///.._________________________________________________________________________________________', + ' .///..___..___..___..___.......................................................................', + ' .///..___..___..___..ooo.......................................................................', + ' .///..___..___..___..ooo.......................................................................', + ' .///..___..___..___..ooo.......................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...-------------------------------------------------------------------------------------...', + ' .///...-------------------------------------------------------------------------------------...', + ' .///...-------------------------------------------------------------------------------------...', + ' .///...-------------------------------------------------------------------------------------...', + ' .///...........................................................................................', + ' .///////////////////////////////////////////////////////////////////////////////////////////...', + ' .///////////////////////////////////////////////////////////////////////////////////////////...', + ' .///////////////////////////////////////////////////////////////////////////////////////////...', + ' .///////////////////////////////////////////////////////////////////////////////////////////...', + ' ...............................................................................................', + ' ...............................................................................................', + ] + +def main(): + clConfig = parseCommandLine(sys.argv) + + palette = { + '.': '#0000FF', + 'o': '#C7C3C7', + 'O': '#86828E', + '+': '#EFF3EF', + '@': '#616161', + '#': '#9EA29E', + '$': '#414141', + } + + palette['o'] = clConfig.get('indicator', '#20b2aa') + palette['/'] = clConfig.get('graph', '#20b2aa') + palette['-'] = clConfig.get('graphbg', '#707070') + palette['_'] = clConfig.get('background', '#FFFFFF') + palette['%'] = clConfig.get('text', '#20B2AE') + + font = clConfig.get('font', '6x8') + + configFile = clConfig.get('configfile', defaultConfigFile) + if not configFile.count(os.sep): + configFile = os.sep.join(sys.argv[0].split(os.sep)[:-1]) + os.sep + configFile + configFile = os.path.expanduser(configFile) + config = readConfigFile(configFile) + try: + programName = sys.argv[0].split(os.sep)[-1] + except IndexError: + programName = '' + sys.argv[0] = programName + + global char_width, char_height + char_width, char_height = wmdocklib.initPixmap(#patterns=background, + font_name=font, + bg='_', fg='%', + palette=palette) + + wmdocklib.openXwindow(sys.argv, width, height) + pywmgeneric = PywmGeneric(config) + pywmgeneric.mainLoop() + +if __name__ == '__main__': + main() diff --git a/examples/pywmhdmon.py b/examples/pywmhdmon.py new file mode 100755 index 0000000..4df2383 --- /dev/null +++ b/examples/pywmhdmon.py @@ -0,0 +1,541 @@ +#!/usr/bin/env python + +"""pywmhdmon.py + +WindowMaker dockapp to monitor the free space on your partitions and +the disk activity. + +Copyright (C) 2003 Kristoffer Erlandsson + +Licensed under the GNU General Public License. + + +Changes + +2005-09-02 Mario Frasca + added -s option for skipping an amount of configuration items. + changed some single quotes to double quotes for use in emacs. + updated the rc sample file + +2004-07-16 Mario Frasca + recognizes unmounted partitions. + configurable mouse actions. + 'used' information for read-only media. + recognizes #-started numerical-coded colors. + +2003-09-01 Kristoffer Erlandsson +Fixed a bug where the numbers wouldn't show if they were between 1000 and 1024. + +2003-06-25 Kristoffer Erlandsson +Fixed a bug where a mouse click caused the app to enter an infinite loop + +2003-06-24 Kristoffer Erlandsson +Additional fine tuning + +2003-06-23 Kristoffer Erlandsson +First working version + +""" + +usage = """pywmhdmon.py [options] +Available options are: +-h, --help print this help +-t, --textcolor set the text color +-f, --barfgcolor set the foregroundcolor of the act. bar +-g, --barbgcolor set the background color of the act. bar +-b, --background set the background color +-F, --font set the font name +-r, --rgbfile set the rgb file to get color codes from +-c, --configfile set the config file to use +-p, --procstat set the location of /proc/stat +-s, --skipconf determines how many configuration items to skip +""" + +import sys +import time +import getopt +import os + +import wmdocklib + +width = 64 +height = 64 + +xOffset = 4 +yOffset = 5 + +graphStartX = 7 +graphStartY = 53 +graphHeight = 4 + +graphBgStartX = 72-64 +graphBgStartY = 53+64 + +graphLineStartX = 2 +graphLineStartY = 58+64 + +defaultConfigFile = os.environ['HOME']+'/.pywmhdmonrc' +defaultProcStat = '/proc/stat' +displayModes = ('bar', 'percent', 'free', 'used') +defaultMode = 'bar' + +hdmon = None + +class NotMounted(OSError): + pass + +class PywmHDMon: + def __init__(self, pathsToMonitor, procStat='/proc/stat', actMonEnabled=1, skipping=0): + self._pathsToMonitor = pathsToMonitor + self._actMonEnabled = actMonEnabled + self._skipping = skipping + self._lineCount = (height - yOffset*2 - 2) / (char_height+1) + + self._statFile = procStat + self._maxIODiff = 0 + self._lastIO = -1 + for i in range(max(self._lineCount, len(pathsToMonitor)-skipping)): + wmdocklib.addMouseRegion(i+1, 8, self.getY(i+1)+yOffset, + 58, self.getY(i+1)+char_height+yOffset) + + + def addString(self, s, x, y): + try: + wmdocklib.addString(s, x, y, xOffset, yOffset, width, height) + except ValueError, e: + sys.stderr.write('Error when painting string:\n' + str(e) + '\n') + sys.exit(3) + + def getHdInfo(self, path): + """Get the free and total space of the filesystem which path is on. + + Return a tuple with (, ) in bytes. Raise + OSError if we can't stat the path. Raise NotMounted if not mounted. + These operations are quite costly, not adviced to perform these checks + more than once every 10 seconds. + """ + + # check if is mounted <- st_dev(/mount/point) == st_dev(/mount) + if path is not '/': + statOwn = os.stat(path) + + # the following is a bit ugly: it removes the trailing + # dirname from the mount point. split by '/', leave the + # last string, join back, check for empty string. + statCnt = os.stat('/'.join(path.split('/')[:-1]) or '/') + if statOwn[2] == statCnt[2]: + raise NotMounted + stat = os.statvfs(path) + blockSize = stat.f_bsize + availableBlocks = stat.f_bavail + totalBlocks = stat.f_blocks + free = blockSize * availableBlocks + total = blockSize * totalBlocks + return (total, free) + + def paintGraph(self, percentFilled, x, y, w, thin=None): + """Paint a graph with percentFilled percent filled. + + Paint at position x, y and with width w. + if thin == 1, make it a thin line instead of a block. + """ + paintWidth = int(round(percentFilled/100.0 * w)) + if paintWidth > 0: + wmdocklib.copyXPMArea( + graphLineStartX, graphLineStartY, paintWidth, thin or graphHeight, + x + xOffset, y + yOffset) + if w - paintWidth > 0: + wmdocklib.copyXPMArea( + graphBgStartX, graphBgStartY, w - paintWidth, thin or graphHeight, + x + paintWidth + xOffset, y + yOffset) + + def getY(self, line): + "returns the y coordinate of the top line for the box" + interlinea = (height - yOffset*2 - 2 - self._lineCount * char_height) / (self._lineCount-1) + interlinea += char_height + lastBaseline = yOffset + self._lineCount * interlinea + from math import ceil + extraYOffset = int(ceil((height - yOffset - lastBaseline) / 2.0)) + return extraYOffset + (line - 1) * interlinea + + def paintLabel(self, line, label): + self.addString(label, 1, self.getY(line)) + + def paintHdData(self, line, data, mode): + total, free = data + xStart = (width*2)/5 + if total==0: + self.addString(' ', width-yOffset*2-5*char_width-1, self.getY(line)) + self.paintGraph(0, xStart, self.getY(line) + 4, + width - xOffset*2 - xStart - 2, + thin=1) + pass + elif mode == 'percent': + percent = (float(free) / float(total)) * 100.0 + percentStr = (str(int(round(percent))) + '%').rjust(5) + self.addString(percentStr, xStart, self.getY(line)) + elif mode == 'used': + totalStr = bytesToStr(total).rjust(5) + self.addString(totalStr, width-yOffset*2-5*char_width-1, self.getY(line)) + elif mode == 'free': + freeStr = bytesToStr(free).rjust(5) + self.addString(freeStr, width-yOffset*2-5*char_width, self.getY(line)) + elif mode == 'bar': + percentUsed = (float(total - free) / float(total)) * 100.0 + self.paintGraph(percentUsed, xStart, self.getY(line) + 2, + width - xOffset*2 - xStart - 2) + else: + sys.stderr.write('Unknown display mode: %s, ignoring data.\n' + % mode) + def getHdActivity(self): + """Return the current hd activity in percent. + + Return how many percent of the max achieved activity during the + program's lifetime the current activity is. However, every time + this method is called we decrease the max achieved activity a + little bit to get a bit less affected by spikes. I think the + interesting thing is to see if the hard drive is active, not + really exactly how active. + """ + + statFile = file(self._statFile, 'r') + diskIoStartTag = 'disk_io: ' + ioLine = None + for line in statFile: + if line.startswith(diskIoStartTag): + ioLine = line + statFile.close() + if ioLine is None: + # Can't get HD activity + sys.stderr.write("Can't get hd activity from %s\n" % + self._statFile) + return 0.0 + ioLine = ioLine[len(diskIoStartTag):] + disks = ioLine.split() + currIO = 0 + for disk in disks: + dataPart = disk.split(':')[1].strip(')(') + infos = dataPart.split(',') + blocksRead = long(infos[2]) + blocksWritten = long(infos[4]) + currIO += blocksRead + blocksWritten + if self._lastIO == -1: + self._lastIO = currIO + currDiff = currIO - self._lastIO + self._lastIO = currIO + if currDiff > self._maxIODiff: + self._maxIODiff = currDiff + if self._maxIODiff <= 0: + self._maxIODiff = 0 + return 0.0 + currAct = (float(currDiff) / float(self._maxIODiff)) * 100.0 + self._maxIODiff -= 1 # So spikes won't affect us too much. + return currAct + + def updateHdActivity(self): + currentAct = self.getHdActivity() + self.paintGraph(currentAct, 3, height - yOffset*2 - 3 - graphHeight, + width - 2 * xOffset - 6) + + def _checkEvents(self): + event = wmdocklib.getEvent() + while event is not None: + if event['type'] == 'destroynotify': + sys.exit(0) + elif event['type'] == 'buttonrelease': + area = wmdocklib.checkMouseRegion(event['x'],event['y']) + if area is not -1: + self.toggleMount(area-1+self._skipping) + event = wmdocklib.getEvent() + + def toggleMount(self, line): + label, path, mode, action = self._pathsToMonitor[line] + if action is None: + return + try: + self.getHdInfo(path) + mounted = True + except NotMounted: + mounted = False + except OSError, e: + return + if mounted: + if action == 'mount': + os.spawnvp(os.P_NOWAIT, 'umount', ['umount', path]) + elif action == 'eject': + os.spawnvp(os.P_WAIT, 'umount', ['umount', path]) + os.spawnvp(os.P_NOWAIT, 'eject', ['eject', path]) + else: + os.spawnvp(os.P_NOWAIT, 'mount', ['mount', path]) + + def updateMonitoredPaths(self): + index = 0 + pageoffset = self._skipping + for i in self._pathsToMonitor: + index += 1 + if index < pageoffset+1: + continue + if i is not None: + label, path, mode, action = i + self.paintLabel(index-pageoffset, label) + try: + hdData = self.getHdInfo(path) + except NotMounted: + hdData = (0, 0) + except OSError, e: + sys.stderr.write( + "Can't get hd data from %s: %s\n" % (path, str(e))) + hdData = (0, 0) + self.paintHdData(index-pageoffset, hdData, mode) + if index - pageoffset == self._lineCount: + break + + def mainLoop(self): + self.updateMonitoredPaths() + while 1: + self._checkEvents() + if self._actMonEnabled: + self.updateHdActivity() + wmdocklib.redraw() + time.sleep(0.1) + + +import signal +def handler(num, frame): + hdmon.updateMonitoredPaths() + signal.alarm(10) + +def parseCommandLine(argv): + """Parse the commandline. Return a dictionary with options and values.""" + shorts = 'ht:f:g:b:r:c:p:s:F:' + longs = ['help', 'textcolor=', 'background=', 'barfgcolor=', + 'rgbfile=', 'configfile=', 'barbgcolor=', 'procstat=', + 'skipconf=','font=', 'debug'] + try: + opts, nonOptArgs = getopt.getopt(argv[1:], shorts, longs) + except getopt.GetoptError, e: + sys.stderr.write('Error when parsing commandline: ' + str(e) + '\n') + sys.stderr.write(usage) + sys.exit(2) + d = {} + for o, a in opts: + if o in ('-h', '--help'): + sys.stdout.write(usage) + sys.exit(0) + if o in ('-t', '--textcolor'): + d['textcolor'] = a + if o in ('-b', '--background'): + d['background'] = a + if o in ('-r', '--rgbfile'): + d['rgbfile'] = a + if o in ('-c', '--configfile'): + d['configfile'] = a + if o in ('-g', '--barbgcolor'): + d['barbgcolor'] = a + if o in ('-F', '--font'): + d['font'] = a + if o in ('-f', '--barfgcolor'): + d['barfgcolor'] = a + if o in ('-p', '--procstat'): + d['procstat'] = a + if o in ('-s', '--skipconf'): + d['skipconf'] = a + if o in ('--debug'): + d['debug'] = True + return d + +def makeNumDigits(num, numDigits): + """Make a floating point number a certain number of digits, including + decimal. Return a string containing it. + """ + lenOfIntPart = len(str(int(num))) + if lenOfIntPart > numDigits: + # Can't convert a number to less digits then it's integer part... + return '' + decimalsNeeded = numDigits - lenOfIntPart + s = '%' + str(lenOfIntPart) + '.' + str(decimalsNeeded) + 'f' + s = s % round(num, decimalsNeeded) + return s + +def bytesToStr(bytes): + """Convert a number of bytes to a nice printable string. + + May raise ValueError if bytes can't be seen as an float. + """ + bytes = float(bytes) + kb = 1024 + mb = 1024 * 1024 + gb = 1024 * mb + tb = 1024 * gb + pb = 1024 * tb + if bytes < kb: + size = bytes + letter = 'B' + #return makeNumDigits(bytes, numDigits) + 'B' + elif bytes < mb: + size = bytes / kb + letter = 'k' + #return makeNumDigits(bytes/kb, numDigits) + 'k' + elif bytes < gb: + size = bytes / mb + letter = 'M' + #return makeNumDigits(bytes/mb, numDigits) + 'M' + elif bytes < tb: + size = bytes / gb + letter = 'G' + #return makeNumDigits(bytes/gb, numDigits) + 'G' + elif bytes < pb: + size = bytes / tb + letter = 'T' + #return makeNumDigits(bytes/tb, numDigits) + 'T' + else: + size = bytes / pb + letter = 'p' + #return makeNumDigits(bytes/pb, numDigits) + 'P' + if size >= 1000: + res = makeNumDigits(size, 4) + else: + res = makeNumDigits(size, 3) + res += letter + return res + + +def main(): + clConfig = parseCommandLine(sys.argv) + configFile = clConfig.get('configfile', defaultConfigFile) + configFile = os.path.expanduser(configFile) + fileConfig = wmdocklib.readConfigFile(configFile, sys.stderr) + config = fileConfig + for i in clConfig.iteritems(): + config[i[0]] = i[1] + + palette = {} + palette[0] = clConfig.get('background', 'black') + palette[2] = clConfig.get('textcolor', 'cyan3') + palette[9] = clConfig.get('barfgcolor', 'cyan') + palette[8] = clConfig.get('barbgcolor', 'cyan4') + palette[5] = clConfig.get('activitycolor', 'cyan2') + + font = clConfig.get('font', '6x8') + debug = clConfig.get('debug') + + global char_width, char_height + char_width, char_height = wmdocklib.initPixmap(patterns=patterns, + font_name=font, + palette=palette, + margin=3, + bg=0, fg=2, debug=debug) + + pathsToMonitor = [] + for i in range(1,1000): + labelStr = str(i) + '.label' + pathStr = str(i) + '.path' + modeStr = str(i) + '.displaymode' + actionStr = str(i) + '.action' + label = config.get(labelStr) + if not label: break + path = config.get(pathStr) + action = config.get(actionStr, 'fixed').lower().strip() + if action not in ['mount', 'eject']: + action = None + displayMode = config.get(modeStr, defaultMode) + if not displayMode in displayModes: + sys.stderr.write( + 'Unknown display mode: %s, using default.\n' % displayMode) + displayMode = defaultMode + takeChars = 3 + if char_width <= 5: + takeChars = 4 + pathsToMonitor.append((label[:takeChars], path, displayMode, action)) + procStat = config.get('procstat', defaultProcStat) + skipping = int(config.get('skipconf', 0)) + actMonEnabled = int(config.get('monitoring',0)) + if not os.access(procStat, os.R_OK): + sys.stderr.write( + "Can't read your procstat file, try setting it with -p. ") + sys.stderr.write("Disabling the HD activity bar.\n") + actMonEnabled = 0 + try: + programName = sys.argv[0].split(os.sep)[-1] + except IndexError: + programName = '' + sys.argv[0] = programName + wmdocklib.openXwindow(sys.argv, width, height) + + signal.signal(signal.SIGCHLD, handler) + signal.signal(signal.SIGALRM, handler) + signal.alarm(10) + + global hdmon + hdmon = PywmHDMon(pathsToMonitor, procStat, actMonEnabled, skipping) + hdmon.mainLoop() + +patterns = \ +['0000000000000000000000000000000000000000000000000000000000000000', + '0000000000000000000000000000000000000000000000000000000000000000', + '0099900555002220055500555000000000000000000000000000000000000000', + '0099900555002220055500555000000000000000000000000000000000000000', + '0099900555002220055500555000000000000000000000000000000000000000', + '0099900555005550055500555000000000000000000000000000000000000000', + '0099900555005550055500555000000000000000000000000000000000000000', + '0099900555005550055500555000000000000000000000000000000000000000', + '0099900555005550022200555000000000000000000000000000000000000000', + '0099900555005550022200555000000000000000000000000000000000000000', + '0099900555005550022200555000000000000000000000000000000000000000', + '0099900555005550055500555000000000000000000000000000000000000000', + '0099900555005550055500555000000000000000000000000000000000000000', + '0099900555005550055500555000000000000000000000000000000000000000', + '0099900555005550055500222000000000000000000000000000000000000000', + '0099900555005550055500222000000000000000000000000000000000000000', + '0099900555005550055500222000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099900088888888888888888888888888888888888888888888888888888888', + '0099900088888888888888888888888888888888888888888888888888888888', + '0099900088888888888888888888888888888888888888888888888888888888', + '0099900088888888888888888888888888888888888888888888888888888888', + '0099900000000000000000000000000000000000000000000000000000000000', + '0099999999999999999999999999999999999999999999999999999999999999', + '0099999999999999999999999999999999999999999999999999999999999999', + '0099999999999999999999999999999999999999999999999999999999999999', + '0099999999999999999999999999999999999999999999999999999999999999', + '0000000000000000000000000000000000000000000000000000000000000000', + '0000000000000000000000000000000000000000000000000000000000000000', + ] + +if __name__ == '__main__': + main() diff --git a/examples/pywmnop.py b/examples/pywmnop.py new file mode 100644 index 0000000..469e523 --- /dev/null +++ b/examples/pywmnop.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python + +"""pywmnop.py + +WindowMaker dockapp doing nothing + +Copyright (C) 2006 Mario Frasca + +Licensed under the GNU General Public License. +""" + +import sys, time +import wmdocklib + +def checkForEvents(): + event = wmdocklib.getEvent() + while not event is None: + if event['type'] == 'destroynotify': + sys.exit(0) + event = wmdocklib.getEvent() + +def mainLoop(): + while 1: + checkForEvents() + wmdocklib.redraw() + time.sleep(0.5) + +def main(): + wmdocklib.initPixmap() + wmdocklib.openXwindow(sys.argv, 64, 64) + + mainLoop() + +if __name__ == '__main__': + main() diff --git a/examples/pywmoonop.py b/examples/pywmoonop.py new file mode 100755 index 0000000..a69adf6 --- /dev/null +++ b/examples/pywmoonop.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python + +"""pywmoonop.py + +object oriented WindowMaker dockapp doing nothing + +Copyright (C) 2007 Mario Frasca + +Licensed under the GNU General Public License. +""" + +from wmdocklib import wmoo +thisapp = wmoo.Application() + +if __name__ == '__main__': + thisapp.run() diff --git a/examples/pywmphoto.py b/examples/pywmphoto.py new file mode 100644 index 0000000..c14687a --- /dev/null +++ b/examples/pywmphoto.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python + +"""pywmphoto.py + +WindowMaker dockapp that displays a static xpm + +Copyright (C) 2006-2007 Mario Frasca + +Licensed under the GNU General Public License. + + +Changes: +2006-10-27 Mario Frasca +First workingish version + +2007-05-19 Mario Frasca +more compact form, based on wmdocklib.wmoo and optparse. +""" + +from wmdocklib import wmoo + +def main(): + + from optparse import OptionParser + + parser = OptionParser() + parser.add_option("-f", "--file", dest="filename", + help="read background from file", metavar="FILE") + parser.add_option("-d", "--debug", dest="debug", + action="store_true", default=False, + help="print the pixmap") + + (options, args) = parser.parse_args() + + app = wmoo.Application(background = options.filename, + margin = 3, + debug = options.debug) + + app.run() + +if __name__ == '__main__': + main() diff --git a/examples/pywmradio.py b/examples/pywmradio.py new file mode 100755 index 0000000..4bf263b --- /dev/null +++ b/examples/pywmradio.py @@ -0,0 +1,304 @@ +#!/usr/bin/env python + +"""pywmnop.py + +WindowMaker dockapp doing nothing + +Copyright (C) 2006 Mario Frasca + +Licensed under the GNU General Public License. +""" + +import sys, time +from wmdocklib import wmoo +devnull = file('/dev/null') + +class Application(wmoo.Application): + + def reset(self): + self._cacheLevel = -50 + self.child = None + self._paused = None + self._buffering = 0 + self._flash = 0 + self._muting = 0 + self.showCacheLevel() + + def __init__(self, *args, **kwargs): + wmoo.Application.__init__(self, *args, **kwargs) + self.radioList = [] + self.currentRadio = 0 + self._count = 0 + self._expectdying = 0 + + self.reset() + + self._buffered = '' + import re + self._feedback = re.compile(r'.+A:.*?% ([0-9\.]+)%') + + import fileinput, os + configfile = os.sep.join([os.environ['HOME'], '.pyradiorc']) + + import codecs + f = codecs.open(configfile, 'r', 'utf-8') + t = f.read() + f.close() + for i in t.split(u'\n'): + radiodef = i.split('\t') + radioname = radiodef[0].lower() + if len(radiodef) != 3 or i[0] == '#': + continue + if radioname == '': + globals()[radiodef[1]] = radiodef[2] + pass + else: + self.radioList.append( (radioname, radiodef[1], radiodef[2]) ) + + + def handler(self, num, frame): + if self._expectdying: + print self._expectdying + self._expectdying -= 1 + else: + self.reset() + self._flash = 4 + self._colour = 1 + + def startPlayer(self): + import os, subprocess, signal + commandline = [mplayer, + '-cache', self.radioList[self.currentRadio][2], + self.radioList[self.currentRadio][1] + ] + self.child = subprocess.Popen(commandline, + stdin =subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=devnull) + signal.signal(signal.SIGCHLD, self.handler) + self._flash = 0 + self._paused = False + self._buffered = '' + self._buffering = 1 + self._cacheLevel = 0 + import fcntl + flags = fcntl.fcntl(self.child.stdout, fcntl.F_GETFL) + fcntl.fcntl(self.child.stdout, fcntl.F_SETFL, flags | os.O_NONBLOCK) + flags = fcntl.fcntl(self.child.stdin, fcntl.F_GETFL) + fcntl.fcntl(self.child.stdin, fcntl.F_SETFL, flags | os.O_NONBLOCK) + + def stopPlayer(self): + if self.child: + print self._expectdying + self.child.stdin.write('q') + self._expectdying += 1 + self.child = None + + def muteStream(self, event): + if self.child and self._buffering == 0: + self.child.stdin.write('m') + self.putPattern(9*self._muting, 0, 9, 11, 30, 29) + self._muting = 1 - self._muting + + def printevent(self, event): + print event + + def previousRadio(self, event): + if self.currentRadio == 0: self.currentRadio = len(self.radioList) + self.currentRadio -= 1 + self.setLabelText('name', self.radioList[self.currentRadio][0]) + if self.child: + self.stopPlayer() + self.startPlayer() + + def nextRadio(self, event): + self.currentRadio += 1 + if self.currentRadio == len(self.radioList): self.currentRadio = 0 + self.setLabelText('name', self.radioList[self.currentRadio][0]) + if self.child: + self.stopPlayer() + self.startPlayer() + + def playStream(self, event): + self.startPlayer() + + def stopStream(self, event): + self.stopPlayer() + self.reset() + + def pauseStream(self, event): + if self.child and not self._buffering: + self.child.stdin.write(' ') + self._paused = not self._paused + if self._paused: + self._colour = 1 + return True + return False + + def showCacheLevel(self): + if self._buffering: + self._cacheLevel += 1 + if self._cacheLevel >= 25: + self._cacheLevel -= 25 + for i in range(-1, 25): + if abs(i - self._cacheLevel) <= 1: + self.putPattern(54, self._buffering, 3, 1, 52, 54-i) + else: + self.putPattern(54, 0, 3, 1, 52, 54-i) + else: + if self._paused or self._flash: + colour = self._colour = 3 - self._colour + self._flash = max(0, self._flash - 1) + else: + colour = 2 + for i in range(-1, 25): + if (i*4 < self._cacheLevel) or self._flash: + self.putPattern(54, colour, 3, 1, 52, 54-i) + else: + self.putPattern(54, 0, 3, 1, 52, 54-i) + + def update(self): + wmoo.Application.update(self) + self._count += 1 + if self._count <= 3: + return + self._count = 0 + if self.child: + import select + [i, o, e] = select.select([self.child.stdout], [], [], 0) + if i: + line = self.child.stdout.read(102400) + self._buffered += line + npos = self._buffered.rfind('\n')+1 + rpos = self._buffered.rfind('\r')+1 + if npos != 0: + self._buffered = self._buffered[npos:] + if rpos != 0: + if self._buffered.startswith('Cache fill:'): + self._buffering = 2 + else: + match = self._feedback.match(self._buffered[rpos-90:rpos]) + if match: + self._buffering = 0 + self._cacheLevel = float(match.group(1)) + + self._buffered = self._buffered[rpos:] + if self.child or self._flash: + self.showCacheLevel() + +palette = { + '-': "#000000", + ".": "#868682", + "X": "#AEAEAA", + "o": "#F7F7F3", + "r": "#F73020", + "i": "#00F700", + } + +background = [ + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "----------------------------------------------------------------", + "----------------------------------------------------------------", + "----------------------------------------------------------------", + "----------------------------------------------------------------", + "----------------------------------------------------------------", + "----------------------------------------------------------------", + "----------------------------------------------------------------", + "----------------------------------------------------------------", + "----------------------------------------------------------------", + "----------------------------------------------------------------", + "----------------------------------------------------------------", + "----------------------------------------------------------------", + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + " ", + " ", + " ", + " ", + " XXXX. ", + " XXXXXXXX. XXXXXXXX. XXXXXXXX. X--- ", + " X-------- X-------- X-------- X--- ", + " X-------- X-------- X-----o-- X--- ", + " X--o--o-- X--o--o-- X----oo-- X--- ", + " X--o-oo-- X--oo-o-- X-ooooo-- X--- ", + " X--oooo-- X--oooo-- X-ooooo-- X--- ", + " X--o-oo-- X--oo-o-- X----oo-- X--- ", + " X--o--o-- X--o--o-- X-----o-- X--- ", + " X-------- X-------- X-------- X--- ", + " X-------- X-------- X-------- X--- ", + " .-------- .-------- .-------- X--- ", + " X--- ", + " X--- ", + " X.---.. ", + " XXXXXXXX. XXXXXXXX. XXXXXXXX. X--- ", + " X-------- X-------- X-------- X--- ", + " X-------- X-------- X-------- X--- ", + " X--o----- X-oo-oo-- X-ooooo-- X--- ", + " X--oo---- X-oo-oo-- X-ooooo-- X--- ", + " X--ooo--- X-oo-oo-- X-ooooo-- X--- ", + " X--oo---- X-oo-oo-- X-ooooo-- X--- ", + " X--o----- X-oo-oo-- X-ooooo-- X--- ", + " X-------- X-------- X-------- X--- ", + " X-------- X-------- X-------- X--- ", + " .-------- .-------- .-------- X--- ", + " X--- ", + " .--- ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + ] + +patterns = [ + "XXXXXXXX.XXXXXXXX.XXXXXXXX.XXXXXXXX.XXXXXXXX.XXXXXXXX.--- ", + "X--------X--------X--------X--------X--------X--------rrr ", + "X-----rr-X-----o--X-----o--X--------X--------X--------iii ", + "X----rr--X----oo--X----oo--X-oo-oo--X--o-----X--r----- ", + "X-oorro--X-ooooo--X-ooooo--X-oo-oo--X--oo----X--rr---- ", + "X-ooroo--X-ooooo--X-ooooo--X-oo-oo--X--ooo---X--rrr--- ", + "X--rroo--X----oo--X----oo--X-oo-oo--X--oo----X--rr---- ", + "X-rr--o--X-----o--X-----o--X-oo-oo--X--o-----X--r----- ", + "X- ------X--------X--------X--------X--------X-------- ", + "X--------X--------X--------X--------X--------X-------- ", + ".--------.--------.--------.--------.--------.-------- ", + ] + + +def main(): + + global char_width, char_height, maxCharsPerLine, antialiased + app = Application(font_name='5x8', + margin = 3, + bg=0, fg=2, palette = palette, + background = background, + patterns = patterns) + # maxCharsPerLine = (width-2*xOffset) / char width + app.addLabel('name', (3, 13), (58, 10), app.radioList[app.currentRadio][0]) + + # app.addCallback(printevent) + + app.addCallback(app.previousRadio, 'buttonrelease', area=( 6,29,15,38)) + app.addCallback(app.nextRadio, 'buttonrelease', area=(18,29,27,38)) + app.addCallback(app.muteStream, 'buttonrelease', area=(30,29,39,38)) + + app.addCallback(app.playStream, 'buttonrelease', area=( 6,43,15,52)) + app.addCallback(app.pauseStream, 'buttonrelease', area=(18,43,27,52)) + app.addCallback(app.stopStream, 'buttonrelease', area=(30,43,39,52)) + + app.run() + +if __name__ == '__main__': + main() diff --git a/examples/pywmseti.py b/examples/pywmseti.py new file mode 100755 index 0000000..a490baf --- /dev/null +++ b/examples/pywmseti.py @@ -0,0 +1,502 @@ +#!/usr/bin/env python + +"""pywmseti.py + +WindowMaker dockapp to monitor the progress of your seti@home. + +Copyright (C) 2003 Kristoffer Erlandsson + +Licensed under the GNU General Public License. + + +Changes + +2003-06-24 Kristoffer Erlandsson +Added event handling for graceful shutdown + +2003-06-17 Kristoffer Erlandsson +First workingish version + +""" +usage = """pywmseti.py [options] +Available options are: +-h, --help print this help +-t, --textcolor set the text color +-p, --progressbarcolor set the color of the progress bar +-g, --barbgcolor set the background color of the progress bar +-i, --indicatorcolor set the color of the running indicator +-b, --background set the background color +-d, --setidir set the directory where seti@home resides +-n, --nice set the nice value to run seti@home with +-r, --rgbfile set the rgb file to get color codes from +-c, --configfile set the config file to use +""" + +import sys +import time +import getopt +import os + +import wmdocklib + +width = 64 +height = 64 + +xOffset = 4 +yOffset = 4 + +graphStartX = 7 +graphStartY = 53 +graphLength = 50 +graphHeight = 4 + +graphBgStartX = 72 +graphBgStartY = 53 + +graphLineStartX = 66 +graphLineStartY = 58 + +runningIndX = 71 +runningIndY = 1 +runningIndWidth = 3 +runningIndHeight = 15 +numRunningInds = 4 + +defaultConfigFile = '~/.pywmsetirc' +defaultRGBFiles = ['/usr/lib/X11/rgb.txt', '/usr/X11R6/lib/X11/rgb.txt'] + +stateFileName = 'state.sah' +uinfoFileName = 'user_info.sah' +pidFileName = 'pid.sah' +execFileName = 'setiathome' + +class PywmSeti: + def __init__(self, statePath, uinfoPath, pidPath, execCmd): + self._statePath = statePath + self._uinfoPath = uinfoPath + self._pidPath = pidPath + self._execCmd = execCmd + self._currentRunningInd = 0 + self._lastTime = time.time() + self._lastNumResults = -1 + self._progress = 0 + + def addString(self, s, x, y): + try: + wmdocklib.addString(s, x, y, digits, + xOffset, yOffset, width, height) + except ValueError, e: + sys.stderr.write('Error when painting string:\n' + str(e) + '\n') + sys.exit(3) + + def getCenterStartPos(self, s): + return wmdocklib.getCenterStartPos(s, width, xOffset) + + def getVertSpacing(self, numLines, margin): + return wmdocklib.getVertSpacing(numLines, margin, height, yOffset) + + def getProgress(self, lines): + """Return the progess of the current workunit. + + Supply the lines of the statefile as argument. + """ + for line in lines: + if line.startswith('prog='): + try: + progress = float(line.split('=')[-1]) + except ValueError: + progress = 0 + return progress + return 0 + + def getNumResults(self, lines): + """Return the number of results produced. + + Supply the lines in the user info file as argument. + """ + for line in lines: + if line.startswith('nresults='): + try: + results = int(line.split('=')[-1]) + except ValueError: + pass + else: + return results + sys.stderr.write( + "Error when reading uinfo file! Can't get number of results.\n") + return -1 + + def pidIsRunning(self, pid): + """Determine if the process with PID pid is running. + + Return 1 if it is running. + Return 0 if it is not running. + Return -1 if we do not have permission to signal the process + This could be slightly non-portal, but I can not find any better + way to do it. + """ + try: + os.kill(pid, 0) + except OSError, e: + if e.errno == 1: + return -1 + return 0 + return 1 + + def openFileRead(self, fileName): + try: + f = file(fileName, 'r') + except IOError, e: + sys.stderr.write('Error when opening %s: %s\n' % (fileName, str(e))) + return None + return f + + + def paintCurrentRunningIndicator(self): + """Paint the running indicator. + """ + indX = runningIndX + self._currentRunningInd * \ + (runningIndWidth + 2) + indY = runningIndY + w = runningIndWidth + h = runningIndHeight + targX = width - xOffset - w - 5 + targY = yOffset + 5 + wmdocklib.copyXPMArea(indX, indY, w, h, targX, targY) + + def updateRunning(self): + """Update the information regarding if we got seti@home running or not. + + Return a tuple with (running, startStopenabled). + startStopEnabled is 1 if we own the process and got the permissions + to start and stop it, or if there is no process running. + """ + pidFile = self.openFileRead(self._pidPath) + if pidFile is None: + sys.stderr.write("Can't read pid file") + self._running = 0 + self._startStopEnabled = 0 + return + try: + self._pid = int(pidFile.read().strip()) + except ValueError: + sys.stderr.write("Can't get pid from %s.\n" % self._pidPath) + self._running = 0 + self._startStopEnabled = 0 + return + pidFile.close() + self._running = self.pidIsRunning(self._pid) + if self._running == -1 and self._startStopEnabled: + sys.stderr.write( + "An other seti@home process which you don't own is running.\n") + sys.stderr.write( + "Starting and stopping of the process is disabled.\n") + self._startStopenabled = 0 + if self._running == -1: + self._running = 1 + else: + # If no process is running (we could have stopped the one + # running from an other process), enable starting and stopping. + self._startStopEnabled = 1 + if self._running: + self._currentRunningInd = (self._currentRunningInd - 1) \ + % numRunningInds + else: + self._currentRunningInd = 0 + self.paintCurrentRunningIndicator() + + def updateProgress(self): + """Update the progress on the current workunit.""" + stateFile = self.openFileRead(self._statePath) + if stateFile is None: + # Can't open file, probably in progress of gettin a new workunit. + progress = 0 + else: + progress = self.getProgress(stateFile.readlines()) + stateFile.close() + self._progress = progress + percent = int(progress * 100.0) + graphSize = int(round(progress * graphLength)) + wmdocklib.copyXPMArea( + graphLineStartX, graphLineStartY, graphSize, graphHeight, + graphStartX, graphStartY) + wmdocklib.copyXPMArea( + graphBgStartX, graphBgStartY, graphLength - graphSize, graphHeight, + graphStartX + graphSize, graphStartY) + self.addString((str(percent) + '%').ljust(4), 4, 32) + + def updateNumResults(self): + """Update the number of workunits done.""" + uinfoFile = self.openFileRead(self._uinfoPath) + numResults = self.getNumResults(uinfoFile.readlines()) + if self._lastNumResults == -1: + self._lastNumResults = numResults + if numResults != self._lastNumResults and self._progress < 0.03: + # If we just got a new number of results and the progress of the + # current workunit is under 3%, assume we started working on a new + # workunit. The times this could be missleading is if we have an + # other seti@home process running on an other computer, but this is + # accurate enough I think. + self.nextWorkUnitStarted() + self._lastNumResults = numResults + uinfoFile.close() + self.addString(str(numResults)[:7], 4, 4) + + def updateTime(self): + """Update the time line. + + We display the time that we have been on the current work unit, since + either the last one was done or since we started the program. + """ + timeSpent = time.time() - self._lastTime + hours = int(timeSpent / 3600) + mins = int((timeSpent - hours * 3600) / 60) + hours = str(hours)[:3] + mins = str(mins).zfill(2) + s = (hours + ':' + mins).ljust(6) + self.addString(s, 4, 18) + + def nextWorkUnitStarted(self): + self._lastTime = time.time() + + def handleMouseClick(self, region): + if region == 0: + if self._startStopEnabled: + if self._running: + try: + os.kill(self._pid, 15) + except OSError, e: + sys.stderr.write( + "Error when ending process: "+str(e)+'\n') + else: + os.system(self._execCmd) # Use fork instead? + + def _checkForEvents(self): + """Check for, and handle, X events.""" + event = wmdocklib.getEvent() + while not event is None: + if event['type'] == 'buttonrelease': + region = wmdocklib.checkMouseRegion(event['x'], + event['y']) + self.handleMouseClick(region) + elif event['type'] == 'destroynotify': + sys.exit(0) + event = wmdocklib.getEvent() + + def mainLoop(self): + counter = -1 + self._startStopEnabled = 1 + while 1: + counter += 1 + self._checkForEvents() + if counter % 10 == 0: + self.updateRunning() + if counter % 100 == 0: + self.updateProgress() + self.updateNumResults() + self.updateTime() + if counter == 999999: + counter = -1 + wmdocklib.redraw() + time.sleep(0.1) + + +def parseCommandLine(argv): + """Parse the commandline. Return a dictionary with options and values.""" + shorts = 'ht:b:n:d:r:c:p:g:i:' + longs = ['help', 'textcolor=', 'background=', 'setidir=', 'nice=', + 'rgbfile=', 'configfile=', 'progressbarcolor=', 'barbgcolor=', + 'indicatorcolor='] + try: + opts, nonOptArgs = getopt.getopt(argv[1:], shorts, longs) + except getopt.GetoptError, e: + sys.stderr.write('Error when parsing commandline: ' + str(e) + '\n') + sys.stderr.write(usage) + sys.exit(2) + d = {} + for o, a in opts: + if o in ('-h', '--help'): + sys.stdout.write(usage) + sys.exit(0) + if o in ('-t', '--textcolor'): + d['textcolor'] = a + if o in ('-b', '--background'): + d['background'] = a + if o in ('-d', '--setidir'): + d['setidir'] = a + if o in ('-n', '--nice'): + d['nice'] = a + if o in ('-r', '--rgbfile'): + d['rgbfile'] = a + if o in ('-c', '--configfile'): + d['configfile'] = a + if o in ('-p', '--progressbarcolor'): + d['progressbarcolor'] = a + if o in ('-g', '--barbgcolor'): + d['barbgcolor'] = a + if o in ('-i', '--indicatorcolor'): + d['indicatorcolor'] = a + return d + +def parseColors(defaultRGBFileNames, config, xpm): + rgbFileName = '' + for fn in defaultRGBFileNames: + if os.access(fn, os.R_OK): + rgbFileName = fn + break + rgbFileName = config.get('rgbfile', rgbFileName) + useColors = 1 + if not os.access(rgbFileName, os.R_OK): + sys.stderr.write( + "Can't read the RGB file, try setting it differently using -r,\n") + sys.stderr.write( + "Ignoring your color settings, using the defaults.\n") + useColors = 0 + if useColors: + # Colors is a list with (, ) pairs. + colors = (('indicatorcolor', 'indicator'), + ('progressbarcolor', 'graph'), + ('barbgcolor', 'graphbg'), + ('textcolor', 'text'), + ('background', 'background')) + for key, value in colors: + col = config.get(key) + if not col is None: + code = wmdocklib.getColorCode(col, rgbFileName) + if code is None: + sys.stderr.write('Bad colorcode for %s, ignoring.\n' % key) + else: + wmdocklib.setColor(xpm, value, code) + +palette = { + ' ': '#208120812081', + '.': '#00000000FFFF', + 'o': '#C71BC30BC71B', + 'O': '#861782078E38', + '+': '#EFBEF3CEEFBE', + '@': '#618561856185', + '#': '#9E79A2899E79', + '$': '#410341034103', + 'o': '#2020b2b2aaaa', + '/': '#2020b2b2aaaa', + '-': '#707070707070', + '_': '#000000000000', + '%': '#2081B2CAAEBA', +} + +background = \ +[' ...............................................................................................', + ' .///..___..ooo..___..___.......................................................................', + ' .///..___..ooo..___..___.......................................................................', + ' .///..___..ooo..___..___.......................................................................', + ' .///..___..___..___..___.......................................................................', + ' .///..___..___..___..___.......................................................................', + ' .///..___..___..___..___.......................................................................', + ' .///..___..___..ooo..___.......................................................................', + ' .///..___..___..ooo..___.......................................................................', + ' .///..___..___..ooo..___.......................................................................', + ' .///..___..___..___..___.......................................................................', + ' .///..___..___..___..___.......................................................................', + ' .///..___..___..___..___.......................................................................', + ' .///..___..___..___..ooo.......................................................................', + ' .///..___..___..___..ooo.......................................................................', + ' .///..___..___..___..ooo.......................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...........................................................................................', + ' .///...-------------------------------------------------------------------------------------...', + ' .///...-------------------------------------------------------------------------------------...', + ' .///...-------------------------------------------------------------------------------------...', + ' .///...-------------------------------------------------------------------------------------...', + ' .///...........................................................................................', + ' .///////////////////////////////////////////////////////////////////////////////////////////...', + ' .///////////////////////////////////////////////////////////////////////////////////////////...', + ' .///////////////////////////////////////////////////////////////////////////////////////////...', + ' .///////////////////////////////////////////////////////////////////////////////////////////...', + ' ...............................................................................................', + ' ...............................................................................................', + ] + +def main(): + clConfig = parseCommandLine(sys.argv) + configFile = clConfig.get('configfile', defaultConfigFile) + configFile = os.path.expanduser(configFile) + fileConfig = wmdocklib.readConfigFile(configFile, sys.stderr) + # Merge the two configs, let the commandline options overwrite those in the + # configuration file. + config = fileConfig + for i in clConfig.iteritems(): + config[i[0]] = i[1] + # Get the configurations + setiDir = config.get('setidir') + if setiDir is None: + sys.stderr.write( + 'You have to supply a directory where seti@home resides. Either in\n') + sys.stderr.write( + 'the configuration file or with -d/--setidir.\n') + sys.exit(3) + setiDir = os.path.expanduser(setiDir) + try: + os.chdir(setiDir) + except OSError, e: + sys.stderr.write('Error when accessing seti directory: %s\n' % str(e)) + sys.exit(4) + statePath = os.path.join(setiDir, stateFileName) + uinfoPath = os.path.join(setiDir, uinfoFileName) + pidPath = os.path.join(setiDir, pidFileName) + execPath = os.path.join(setiDir, execFileName) + niceVal = config.get('nice') + if niceVal is None: + execCmd = execPath + else: + execCmd = execPath + ' -nice %s' % niceVal + '&' + try: + programName = sys.argv[0].split(os.sep)[-1] + except IndexError: + programName = '' + sys.argv[0] = programName + wmdocklib.initPixmap(background, + palette=palette) + wmdocklib.openXwindow(sys.argv, width, height) + wmdocklib.addMouseRegion(0, xOffset, yOffset, width - 2 * xOffset, + height - 2 * yOffset) + pwms = PywmSeti(statePath, uinfoPath, pidPath, execCmd) + pwms.mainLoop() + + +if __name__ == '__main__': + main() diff --git a/examples/pywmsysmon.py b/examples/pywmsysmon.py new file mode 100755 index 0000000..8a83531 --- /dev/null +++ b/examples/pywmsysmon.py @@ -0,0 +1,397 @@ +#! /usr/bin/env python + +"""pywmsysmon.py + +WindowMaker system monitor dockapp written in Python. It displays your CPU +usage and your available/used memory. + +Copyright (C) 2003 Kristoffer Erlandsson + +Licensed under the GNU General Public License. + +Changes +2003-06-28 Kristoffer Erlandsson +Fixed a bug which caused infinite loop if the mouse was clicked + +2003-06-24 Kristoffer Erlandsson +First working version +""" +usage="""pywmsysmon.py [options] +Available options are: +-h, --help print this help +-f, --barfgcolor set the foreground color of the memory bar +-g, --barbgcolor set the background color of the memory bar +-b, --background set the background color +-p, --graphforeground set the cpu graph foreground color +-a, --graphbackground set the cpu graph background color +-r, --rgbfile set the rgb file to get color codes from +-s, --procstat set the location of /proc/stat +-m, --procmeminfo set the location of /proc/meminfo +-i, --ignorenice ignore nice valued cpu usage +-u, --updatedelay delay (in seconds) between cpu graph updates +""" + +import sys +import time +import getopt +import os + +import wmdocklib + +width = 64 +height = 64 + +xOffset = 4 +yOffset = 4 + +hGraphStartX = 7 +hGraphStartY = 53 +hGraphHeight = 4 +hGraphWidth = width - xOffset * 2 - 6 + +hGraphBgStartX = 72 +hGraphBgStartY = 53 + +hGraphLineStartX = 66 +hGraphLineStartY = 58 + +vGraphStartX = 7 +vGraphStartY = 7 +vGraphHeight = 43 +vGraphWidth = 50 + +vGraphLineStartX = 95 +vGraphLineStartY = 1 + +vGraphBgStartX = 97 +vGraphBgStartY = 1 + +defaultConfigFile = '~/.pywmhdmonrc' +defaultRGBFiles = ('/usr/lib/X11/rgb.txt', '/usr/X11R6/lib/X11/rgb.txt') +defaultProcStat = '/proc/stat' +defaultProcMeminfo = '/proc/meminfo' + +class PywmSysMon: + def __init__(self, procMeminfo, procStat, ignoreNice=0, updateDelay=10): + self._procStat = procStat + self._procMeminfo = procMeminfo + self._ignoreNice = ignoreNice + + self._lastUsed = 0 + self._lastTotal = 0 + + self._usageHistory = [0.0] * vGraphWidth + + self._cpuUpdateDelay = updateDelay + self._memUpdateDelay = 30 + + def addUsageToHist(self, cpuUsage): + self._usageHistory = self._usageHistory[1:] + self._usageHistory.append(cpuUsage) + + def getMemInfo(self): + """Get memory information. + + Return a tuple with (total_mem, used_mem, buffered_mem, cached_mem). + """ + try: + meminfoFile = file(self._procMeminfo, 'r') + except IOError, e: + sys.stderr.write("Can't open meminfo file: %s.\n" % str(e)) + sys.exit(2) + total = used = free = shared = buffers = cached = theLine = None + for line in meminfoFile: + if line.startswith('Mem:'): + theLine = line + break + if line.startswith('MemTotal:'): + total = long(line.split()[1]) + if line.startswith('MemFree:'): + free = long(line.split()[1]) + if line.startswith('Buffers:'): + buffers = long(line.split()[1]) + if line.startswith('Cached:'): + cached = long(line.split()[1]) + if free and total: + used = total - free + if theLine is not None: + parts = [long(x) for x in theLine.split()[1]] + total, used, free, shared, buffers, cached = parts[:6] + if None in [total, used, buffers, cached]: + sys.stderr.write("Can't find memory information in %s.\n" % + self._procMeminfo) + sys.exit(4) + return (total, used, buffers, cached) + + def freeMem(self, memData): + """Take a tuple as returned from getMemInfo and return the free mem. + """ + total, used, buffers, cached = memData + reallyUsed = used - buffers - cached + free = total - reallyUsed + return free + + def getCPUUsage(self): + """Get the current CPU usage. + + Only works for systems where this can be found in a /proc/stat like + file. Return the usage in percent. + """ + try: + statFile = file(self._procStat, 'r') + except IOError, e: + sys.stderr.write("Can't open statfile: %s.\n" % str(e)) + sys.exit(2) + line = statFile.readline() + statFile.close() + cpu, nice, system, idle = [long(x) for x in line.split()[1:]][:4] + used = cpu + system + if not self._ignoreNice: + used += nice + total = cpu + nice + system + idle + if total - self._lastTotal <= 0 or self._lastTotal == 0: + cpuUsage = 0.0 + else: + cpuUsage = 100.0 * (float(used - self._lastUsed) / float(total - + self._lastTotal)) + self._lastUsed = used + self._lastTotal = total + return cpuUsage + + def addString(self, s, x, y): + try: + wmdocklib.addString(s, x, y, digits, xOffset, yOffset, width, height) + except ValueError, e: + sys.stderr.write('Error when painting string:\n' + str(e) + '\n') + sys.exit(3) + + def paintGraph(self, percentFilled, x, y, w): + """Paint a graph with percentFilled percent filled. + + Paint at position x, y and with width w. + """ + paintWidth = int(round(percentFilled/100.0 * w)) + if paintWidth > 0: + wmdocklib.copyXPMArea( + hGraphLineStartX, hGraphLineStartY, paintWidth, hGraphHeight, + x, y) + if w - paintWidth > 0: + wmdocklib.copyXPMArea( + hGraphBgStartX, hGraphBgStartY, w - paintWidth, hGraphHeight, + x + paintWidth, y) + + def drawVertLine(self, sourceX, sourceY, targX, targY, length): + """Draw a vertical line. + """ + if length > 0: + wmdocklib.copyXPMArea(sourceX, sourceY, 1, length, targX, targY) + + def drawCPUUsageHistory(self): + """Draw the complete CPU usage graph according to what's in the history. + """ + count = 0 + for histItem in self._usageHistory: + lengthFilled = int(round(vGraphHeight * (histItem/100.0))) + lengthNotFilled = vGraphHeight - lengthFilled + self.drawVertLine(vGraphBgStartX, vGraphBgStartY, + vGraphStartX + count, vGraphStartY, + lengthNotFilled) + self.drawVertLine(vGraphLineStartX, vGraphLineStartY, + vGraphStartX + count, + vGraphStartY + lengthNotFilled, lengthFilled) + count += 1 + + def updateCPUInfo(self): + """Update the current cpu usage graph.""" + currentUsage = self.getCPUUsage() + self.addUsageToHist(currentUsage) + self.drawCPUUsageHistory() + + def updateMemInfo(self): + """Update the current memory usage graph.""" + memInfo = self.getMemInfo() + total = memInfo[0] + free = self.freeMem(memInfo) + percentUsed = 100.0 * (float(total - free) / float(total)) + self.paintGraph(percentUsed, hGraphStartX, hGraphStartY, hGraphWidth) + + def _checkForEvents(self): + event = wmdocklib.getEvent() + while not event is None: + if event['type'] == 'destroynotify': + sys.exit(0) + event = wmdocklib.getEvent() + + def mainLoop(self): + counter = -1 + while 1: + counter += 1 + self._checkForEvents() + if counter % self._cpuUpdateDelay == 0: + self.updateCPUInfo() + if counter % self._memUpdateDelay == 0: + self.updateMemInfo() + if counter == 999999: + counter = -1 + wmdocklib.redraw() + time.sleep(0.1) + +def parseCommandLine(argv): + """Parse the commandline. Return a dictionary with options and values.""" + shorts = 'hf:g:b:p:a:r:s:m:iu:' + longs = ['help=', 'barbgcolor=', 'barfgcolor=', 'background=', + 'graphforeground=', 'graphbackground=', 'rgbfile=', 'procstat=', + 'procmeminfo=', 'ignorenice', 'updatedelay='] + try: + opts, nonOptArgs = getopt.getopt(argv[1:], shorts, longs) + except getopt.GetoptError, e: + sys.stderr.write('Error when parsing commandline: ' + str(e) + '\n') + sys.stderr.write(usage) + sys.exit(2) + d = {} + for o, a in opts: + if o in ('-h', '--help'): + sys.stdout.write(usage) + sys.exit(0) + if o in ('-b', '--background'): + d['background'] = a + if o in ('-r', '--rgbfile'): + d['rgbfile'] = a + if o in ('-g', '--barbgcolor'): + d['barbgcolor'] = a + if o in ('-f', '--barfgcolor'): + d['barfgcolor'] = a + if o in ('-s', '--procstat'): + d['procstat'] = a + if o in ('-p', '--graphforeground'): + d['graphforeground'] = a + if o in ('-a', '--graphbackground'): + d['graphbackground'] = a + if o in ('-m', '--procmeminfo'): + d['procmeminfo'] = a + if o in ('-i', '--ignorenice'): + d['ignorenice'] = 1 + if o in ('-u', '--updatedelay'): + try: + d['updatedelay'] = int(a) * 10 + except ValueError: + sys.stderr.write( + "Value for updatedelay has to be an integer.\n") + sys.exit(2) + return d + +background = \ +[' ...............................................................................................', + ' .///..___..ooo..___..___......|.I..............................................................', + ' .///..___..ooo..___..___......|.I..............................................................', + ' .///..___..ooo..___..___......|.I..............................................................', + ' .///..___..___..___..___......|.I..............................................................', + ' .///..___..___..___..___......|.I..............................................................', + ' .///..___..___..___..___......|.I..............................................................', + ' .///..___..___..ooo..___......|.I..............................................................', + ' .///..___..___..ooo..___......|.I..............................................................', + ' .///..___..___..ooo..___......|.I..............................................................', + ' .///..___..___..___..___......|.I..............................................................', + ' .///..___..___..___..___......|.I..............................................................', + ' .///..___..___..___..___......|.I..............................................................', + ' .///..___..___..___..ooo......|.I..............................................................', + ' .///..___..___..___..ooo......|.I..............................................................', + ' .///..___..___..___..ooo......|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///..........................|.I..............................................................', + ' .///...........................................................................................', + ' .///...-------------------------------------------------------------------------------------...', + ' .///...-------------------------------------------------------------------------------------...', + ' .///...-------------------------------------------------------------------------------------...', + ' .///...-------------------------------------------------------------------------------------...', + ' .///...........................................................................................', + ' .///////////////////////////////////////////////////////////////////////////////////////////...', + ' .///////////////////////////////////////////////////////////////////////////////////////////...', + ' .///////////////////////////////////////////////////////////////////////////////////////////...', + ' .///////////////////////////////////////////////////////////////////////////////////////////...', + ' ...............................................................................................', + ' ...............................................................................................', + ] + +def main(): + config = parseCommandLine(sys.argv) + procStat = config.get('procstat', defaultProcStat) + if not os.access(procStat, os.R_OK): + sys.stderr.write( + "Can't read your procstat file, try setting it with -s.\n") + sys.exit(4) + procMeminfo = config.get('procmeminfo', defaultProcMeminfo) + if not os.access(procMeminfo, os.R_OK): + sys.stderr.write( + "Can't read your procmeminfo file, try setting it with -m.\n") + sys.exit(4) + ignoreNice = config.get('ignorenice', 0) + updateDelay = config.get('updatedelay', 30) + try: + programName = sys.argv[0].split(os.sep)[-1] + except IndexError: + programName = '' + sys.argv[0] = programName + + palette = { + ' ': '#208120812081', + '.': '#00000000FFFF', + 'o': '#C71BC30BC71B', + 'O': '#861782078E38', + '+': '#EFBEF3CEEFBE', + '@': '#618561856185', + '#': '#9E79A2899E79', + '$': '#410341034103', + 'o': '#2020b2b2aaaa', + } + #palette['o'] = config.get('indicator', '#2020b2b2aaaa') + palette['/'] = config.get('barfgcolor', '#2020b2b2aaaa') + palette['-'] = config.get('barbgcolor', '#707070707070') + palette['|'] = config.get('graphforeground', '#2020b2b2aaaa') + palette['I'] = config.get('graphbackground', '#707070707070') + palette['_'] = config.get('background', '#000000000000') + palette['%'] = config.get('foreground', '#2081B2CAAEBA') + + wmdocklib.initPixmap(background, palette=palette) + wmdocklib.openXwindow(sys.argv, width, height) + pywmsysmon = PywmSysMon(procMeminfo, procStat, ignoreNice, updateDelay) + pywmsysmon.mainLoop() + + + +if __name__ == '__main__': + main() diff --git a/examples/pywmwet.py b/examples/pywmwet.py new file mode 100644 index 0000000..b5a2da0 --- /dev/null +++ b/examples/pywmwet.py @@ -0,0 +1,262 @@ +#!/usr/bin/env python +"""pywmwet.py +WindowMaker dockapp that tracks a Wolf:ET server and displays following info: +->Map Name +-># of Allies +-># of Axis +-># of Spectators (if server using 'P' cvar + +Copyright (C) 2007 Nathan Lundquist +Licensed under the GNU General Public License. +Changes: +2007-01-16 Nate Lundquist +First attempt +""" + +import sys, getopt, os +import socket +import wmdocklib +import time, datetime + +DEFAULT_PORT = 27960 +DEFAULT_INTERVAL = 60 #seconds +WIDTH = 64 +HEIGHT = 64 +XOFFSET = 4 +YOFFSET = 4 +MARGIN = 1 +LINE_SPACING = 4 + +usage = '''\ +pywmwet.py [options] +Available options are: +-h, --help Print this help text +-s, --server Server to track +-p, --port Server port [default: 27960] +-u, --update-interval Delay between updates [default: 60 sec] +''' + + +def parse_command_line(argv): + shorts = 'hs:p:u:' + longs = ['help', 'server=', 'port=', 'update-interval='] + + try: + opts, nonOptArgs = getopt.getopt(argv[1:], shorts, longs) + except getopt.GetoptError, e: + print 'Error parsing commandline: ' + str(e) + print usage + sys.exit(2) + d = {} + for o, a in opts: + if o in ('-h', '--help'): + print usage + sys.exit(0) + if o in ('-s', '--server'): + d['server'] = a + if o in ('-p', '--port'): + d['port'] = int(a) + else: + d['port'] = DEFAULT_PORT + if o in ('-u', '--update-interval'): + d['update-interval'] = int(a) + else: + d['update-interval'] = DEFAULT_INTERVAL + return d + +def query_server(server, port): + try: + query = '\xFF\xFF\xFF\xFF\x02getstatus\x0a\x00' + addr = (server, port) + sockobj = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + sockobj.settimeout(4.0) + sockobj.connect(addr) + sockobj.send(query) + data = sockobj.recv(4096) + data = data[18:] + sockobj.shutdown(0) + sockobj.close() + #print 'query success' + #print data + return data + except socket.error: + #print 'query failure' + return False + +def get_map(data): + data = data.split('\\') + i = data.index('mapname') + return ' '.join(data[i+1].split('_')).title() + +def get_num_allies(data): + data = data.split('\\') + try: #servers using older cvar + i = data.index('Players_Allies') + allies = data[i+1] + return len(allies.split()) + except ValueError: #possibly newer server using 'P' cvar + try: + #3 - Spectator, 2 - Allies, 1 - Axis + i = data.index('P') + slots = data[i+1] + allies = 0 + for slot in slots: + if slot == '2': + allies += 1 + return allies + except ValueError: #no players connected? + return 0 + +def get_num_axis(data): + data = data.split('\\') + try: #server using old cvar + i = data.index('Players_Axis') + axis = data[i+1] + return len(axis.split()) + except ValueError: #possible new cvar + try: + #3 - Spectator, 2 - Allies, 1 - Axis + i = data.index('P') + slots = data[i+1] + axis = 0 + for slot in slots: + if slot == '1': + axis += 1 + return axis + except ValueError: #no players + return 0 + +def get_num_spectators(data): + #This will only work with servers that use the newer 'P' cvar + data = data.split('\\') + try: + #3 - Spectator, 2 - Allies, 1 - Axis + i = data.index('P') + slots = data[i+1] + spec = 0 + for slot in slots: + if slot == '3': + spec += 1 + return spec + except ValueError: #check if old cvars in use + if 'Players_Axis' in data or 'Players_Allies' in data: + #old cvars in use, so we don't know how many spectators there are + return '??' + else: #no players + return 0 + +def get_players(data): + players = [] + player_data = data.strip().split('\n')[1:] + for player_line in player_data: + player = strip_name(player_line.split('"')[1]) + players.append(player) + return players + +def scroll_players(players): + pass + +def strip_name(name): + stripped_name = '' + skip_next = False + for x in range(len(name)): + if name[x] != '^' and skip_next != True: + stripped_name += name[x] + elif name[x] == '^': + skip_next = True + continue + skip_next = False + return stripped_name + + +def scroll_text(s, y, speed): + #not sure if this is the best way to do this... + cen_pos = get_center(s) + end_pos = (cen_pos *2) - (MARGIN * 2) - 64 + for x in range(WIDTH, end_pos, -1): + add_string(s, x, y) + wmdocklib.redraw() + time.sleep(speed) + +def get_center(s): + return wmdocklib.getCenterStartPos(s, WIDTH, XOFFSET) + +def add_string(s, x, y): + return wmdocklib.addString(s, x, y, XOFFSET, YOFFSET, WIDTH, HEIGHT) + +def get_spacing(line_no): + if line_no == 1: + return MARGIN + else: + # 1 + (4) + 4 + return MARGIN + (char_height * (line_no - 1)) + LINE_SPACING * (line_no - 1) + +def check_for_events(): + event = wmdocklib.getEvent() + while not event is None: + if event['type'] == 'destroynotify': + sys.exit(0) + event = wmdocklib.getEvent() + +def main_loop(server, port, update_interval): + dif = datetime.timedelta(seconds=update_interval) + last_updated = datetime.datetime.now() + just_started = True + while 1: + check_for_events() + now = datetime.datetime.now() + if now > (last_updated + dif) or just_started == True: + data = query_server(server, port) + if not data: + add_string('Server', get_center('Server'), get_spacing(1)) + add_string('Not', get_center('Not'), get_spacing(2)) + add_string('Found', get_center('Found'), get_spacing(3)) + just_started = False + else: + mapname = get_map(data) + num_allies = get_num_allies(data) + num_axis = get_num_axis(data) + num_specs = get_num_spectators(data) + last_updated = datetime.datetime.now() + just_started = False + + if data: + add_string(('Allies:%s' % str(num_allies)), MARGIN, get_spacing(2) + 5) + add_string(('Axis:%s' % str(num_axis)), MARGIN, get_spacing(3) + 5) + add_string(('Spec:%s' % str(num_specs)), MARGIN, get_spacing(4) + 5) + + #mapname last in case it has to scroll + if get_center(mapname) < MARGIN: + scroll_text(mapname, get_spacing(1), 0.04) + else: + add_string(mapname, get_center(mapname), get_spacing(1)) + + wmdocklib.redraw() + time.sleep(0.1) + +def main(): + clConfig = parse_command_line(sys.argv) + try: + program_name = sys.argv[0].split(os.sep)[-1] + except IndexError: + program_name = '' + + if not clConfig.has_key('server'): + print '\nYou must supply a server using the -s/--server option.\n' + print 'Use -h flag to see more options.' + sys.exit(2) + + global char_width, char_height + char_width, char_height = wmdocklib.initPixmap(font_name='5x7', fg=3) + wmdocklib.openXwindow(sys.argv, 64, 64) + + try: + main_loop(clConfig['server'], clConfig['port'], clConfig['update-interval']) + except KeyboardInterrupt: + print 'Goodbye.' + sys.exit(0) + +if __name__ == '__main__': + main() + + diff --git a/examples/sample.pyradiorc b/examples/sample.pyradiorc new file mode 100644 index 0000000..2b0a06a --- /dev/null +++ b/examples/sample.pyradiorc @@ -0,0 +1,18 @@ + mplayer /usr/bin/mplayer + dumpdir /home/mario +rai1 rtsp://live.media.rai.it/broadcast/radiouno.rm 48 +rai2 rtsp://live.media.rai.it/broadcast/radiodue.rm 48 +rai3tre rtsp://live.media.rai.it/broadcast/radiotre.rm 96 +nos1 http://livemedia.omroep.nl/radio1-breed 128 +nos4 http://livemedia.omroep.nl/radio4-breed 128 +rne1 mms://a729.l830022151.c8300.e.lm.akamaistream.net/D/729/8300/v0001/reflector:22151 128 +rne3 mms://a1830.l830120550.c8301.e.lm.akamaistream.net/D/1830/8301/v0001/reflector:20550 128 +rzeszów http://live.radio.rzeszow.pl:8000/hi 128 +gdańsk http://www.radio.gdansk.pl/audio/radio_gdansk_low.asx 128 +kielce http://gra.radio.kielce.com.pl:8000/listen.pls 128 +kraków http://emiter.radio-krakow.pl:8080/ramgen/encoder/krakow.rm 48 +bialystok rtsp://194.187.119.2/encoder/radio.rm 48 +bbcws rtsp://rmlive.bbc.co.uk/bbc-rbs/rmlive/ev7/live24/worldservice/liveinfent.ra 256 +bbc3 rtsp://rmlive.bbc.co.uk/bbc-rbs/rmlive/ev7/live24/radio3/live/r3_dsat_g2.ra 256 +bbc4 rtsp://rmlive.bbc.co.uk/bbc-rbs/rmlive/ev7/live24/radio4/live/r4_dsat_g2.ra 256 + diff --git a/examples/sample.pywmdatetimerc b/examples/sample.pywmdatetimerc new file mode 100644 index 0000000..98e55bc --- /dev/null +++ b/examples/sample.pywmdatetimerc @@ -0,0 +1,42 @@ +[DEFAULT] +# The formats are the same as Python's strftime accept, but one format is +# added. %q now means the week-number with monday as the start of the week and +# the first day of the year is allways in week 1. We calculate like that for +# example here in Sweden. +# +# Taken from the Python manual: +# %a Locale's abbreviated weekday name. +# %A Locale's full weekday name. +# %b Locale's abbreviated month name. +# %B Locale's full month name. +# %c Locale's appropriate date and time representation. +# %d Day of the month as a decimal number [01,31]. +# %H Hour (24-hour clock) as a decimal number [00,23]. +# %I Hour (12-hour clock) as a decimal number [01,12]. +# %j Day of the year as a decimal number [001,366]. +# %m Month as a decimal number [01,12]. +# %M Minute as a decimal number [00,59]. +# %p Locale's equivalent of either AM or PM. +# %S Second as a decimal number [00,61]. +# %U Week number of the year (Sunday as the first day of the week) as a +# decimal number [00,53]. All days in a new year preceding the first +# Sunday are considered to be in week 0. +# %w Weekday as a decimal number [0(Sunday),6]. +# %W Week number of the year (Monday as the first day of the week) as a +# decimal number [00,53]. All days in a new year preceding the first +# Monday are considered to be in week 0. +# %x Locale's appropriate date representation. +# %X Locale's appropriate time representation. +# %y Year without century as a decimal number [00,99]. +# %Y Year with century as a decimal number. +# %Z Time zone name (or by no characters if no time zone exists). +# %% A literal "%" character. + +background=black +foreground=light sea green +timeformat=%H:%M:%S +dateformat=%d-%m-%y +weekdayformat=%A +weekformat=wk %q +#rgbfile=/usr/lib/X11/rgb.txt + diff --git a/examples/sample.pywmgenericrc b/examples/sample.pywmgenericrc new file mode 100644 index 0000000..8116077 --- /dev/null +++ b/examples/sample.pywmgenericrc @@ -0,0 +1,69 @@ +# Sample configuration file for pywmgeneric.py. +# +# THIS IS ONLY A SAMPLE. IT WILL MOST CERTAIN NOT WORK ON YOUR SYSTEM SINCE +# CUSTOM PROGRAMS ARE USED IN HERE. ONLY USE THIS AS AN REFERENCE. +# +# Available actions are: +# * method - Call a method defined in the class UserMethods. See the +# source file for more information +# * exec - Execute an external command +# +# Available mouse actions are: +# * method - Same as above, see the source file for more information. +# * exec - Same as above +# * update - Update the data through running the action. +# +# Other options: +# * scroll = yes|no - en-/disable scrolling of the text if it doens't fit. +# * display = - display a static string instead of the first line of +# the action-generated output. +# * update_delay = - the time to elapse between performing the +# action +# +# %(allText)s expands to all the text collected by the action. +# %(displayedLine)s expands to the line currently displayed in the app. This +# may show more than actually displayed since it gets the +# entire line, which may be truncated before display. +# %(allTextEscaped)s expands to the same as %(allText)s but with all ":s +# escaped to \". Great to use when passing the text as a +# command line argument to something. +# %(allTextButFirstLine)s expands to all text but leaves out the first line. +# Useful if your program for example prints a summary +# first. +# %(allTextButFirstLineEscaped)s is a combination of the two above. +# + +[0] +action = method getCpuTemp +update_delay = 10s +on_mouse1 = exec sensors | xmessage -file - +on_mouse3 = update +scroll = no + +[1] +action = method getSysTemp +update_delay = 10s +on_mouse1 = exec sensors | xmessage -file - +on_mouse3 = update +scroll = no + +[2] +action = exec tvcatcher.py -s -d +on_mouse1 = method showTvWithoutDescs +on_mouse2 = exec mozilla http://tvprogram.nu +on_mouse3 = exec xmessage "%(allTextButFirstLineEscaped)s" +update_delay = 5m +scroll = yes + +[3] +display = xterm +on_mouse1 = exec xterm + +[4] +action = exec dnheadlinecatcher.py -d +on_mouse1 = method showDnWithoutDescs +on_mouse2 = exec mozilla http://www.dn.se +on_mouse3 = exec xmessage "%(allTextEscaped)s" +update_delay = 0.5h +scroll = yes + diff --git a/examples/sample.pywmhdmonrc b/examples/sample.pywmhdmonrc new file mode 100644 index 0000000..a21246d --- /dev/null +++ b/examples/sample.pywmhdmonrc @@ -0,0 +1,50 @@ +[DEFAULT] + +# Displaymodes are used, free, percent or bar, displays the used size, +# free size, free percent and a bar representing space, respectively. + +1.label=/ +1.path=/ +#1.displaymode=free + +2.label=usr +2.path=/usr +#2.displaymode=free + +3.label=home +3.path=/home +#3.displaymode=free + +4.label=cd +4.path=/mnt/cd +4.displaymode=used +4.action=eject + +5.label=jr +5.path=/mnt/jr +5.displaymode=used +5.action=eject + +6.label=sm +6.path=/mnt/sm +6.displaymode=free +6.action=mount + +7.label=cf +7.path=/mnt/cf +7.displaymode=free +7.action=mount + +8.label=flo +8.path=/mnt/flo +8.displaymode=free +8.action=mount + +textcolor=light sea green +background=black +barfgcolor=light sea green +barbgcolor=grey45 +monitoring=0 + +#rgbfile=/usr/lib/X11/rgb.txt + diff --git a/examples/sample.pywmsetirc b/examples/sample.pywmsetirc new file mode 100644 index 0000000..da86ee4 --- /dev/null +++ b/examples/sample.pywmsetirc @@ -0,0 +1,12 @@ +[DEFAULT] +setidir=/home/erl/setiathome +# Nice value to start the seti@home process with on click. +nice=19 +textcolor=light sea green +progressbarcolor=light sea green +barbgcolor=grey45 +indicatorcolor=light sea green +background=black + +#rgbfile=/usr/lib/X11/rgb.txt + diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..a3dab11 --- /dev/null +++ b/setup.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Set these so they match your system. +XLibDir = '/usr/X11R6/lib' +XIncludes = '/usr/X11R6/include' + +from distutils.core import setup, Extension + +module1 = Extension('wmdocklib.pywmgeneral', + libraries = ['Xpm', 'Xext', 'X11'], + library_dirs = [XLibDir], + include_dirs = [XIncludes], + sources = ['wmdocklib/pywmgeneral.c']) + +setup(name="pywmdockapps", + version = "$Revision: 1.21 $"[11:-2], + + description=''' + read the whole story at http://pywmdockapps.sourceforge.net/''', + + author="Kristoffer Erlandsson & al.", + author_email="mfrasca@zonnet.nl", + url="http://pywmdockapps.sourceforge.net", + license="(L)GPL", + packages=['wmdocklib', + ], + scripts=['examples/pywmdatetime.py', + 'examples/pywmhdmon.py', + 'examples/pywmseti.py', + 'examples/pywmsysmon.py', + 'examples/pywmphoto.py', + 'examples/pywmwet.py', + 'examples/pywmradio.py', + 'examples/pywmgeneric.py'], + package_data={'wmdocklib': ['*.xpm']}, + ext_modules = [module1]) diff --git a/wmdocklib/3x5.xpm b/wmdocklib/3x5.xpm new file mode 100644 index 0000000..e0fd483 --- /dev/null +++ b/wmdocklib/3x5.xpm @@ -0,0 +1,37 @@ +/* XPM */ +static char *_x_[] = { +/* columns rows colors chars-per-pixel */ +"96 15 16 1", +", c #F2F0F4", +". c #E4E2E4", +"X c #D6D5D7", +"o c #C7C6C8", +"O c #BFBDC0", +"+ c #ABA9AC", +"@ c #9D9B9E", +"# c #8C8A8D", +"$ c #7A787B", +"% c #6E6C6F", +"& c #58565A", +"* c #4A484B", +"= c #3A383B", +"- c #262428", +"; c #171518", +": c #020003", +/* pixels */ +"::::O:OO::@@:O:@#:++::O::&**&:=o=:::::::::::::;$$X$:OXo@:=O+:*X:X+$o;O.-+O@#o$:::::::::::::::-O+", +"::::o:--:OXX@,%@X*#-::-::+:;+:$,$:+:::::::::::$;O%o::O:O::O#:#o:X#XO$:+:#X#o:o:#::#:-$+OO+@#-:=@", +"::::#::::..+$.**o@o++::::o::O:-@-o,@::::O+:::;$:O:O::O%-:::o*+,-:Oo:o=$:o:o%Oo::::::o#;oO@;#o:o:", +"::::#::::@#:#.+:+++X+::::+::O:::::O::@:::::#:%;:$X$:+,,+:&o#::O%o$$o$#-:#o#+o&:#::+::-#:::#-::@:", +":::::::::::::o:::::::::::&**&::::::::@::::::::::::::::::::::::::::::::::::::::::::@:::::::::::::", +"=O$;,;XO+%X;Xo%XO&Xo*%X&o:oO,-:#Xo&$o::.&..=o%X%XO#%X$Xo#@O*O,+O:OO:,%:+@=@O;OooX:X&$;:&X:&@&:::", +"O+X*+&Xo@O::o:oXo=Xo=O::XOX:O:::OXo:O::oooo#OO:oo:oO:oO:oO%;:O:O:O#*@++@-,-*X*:+*:O:;$::O:::::::", +"OOo#+#o:Oo::O:oO::O::O*Oo:o:o:::OX+-o::o+OO#oo:OXo%O:OXX$:&+:o:o:O&+&X+$-,-:X:%$::o::$;:o:::::::", +"++O+:OXo#$o;Xo%XO&O::&X+O:OO,;*o@o-@X+*o:oO=.%X%o::$X#o;o+o@:O:#O#;,;X%%@=@:o:,o+:O::;$:O:::::::", +"=O#:::::::::::::::::::::::::::::::::::::::::::::::::;*::::::::::::::::::::::::::::o&:::&o::::OOO", +"-%::::O:::::::o::::O-:::O:::#::::o::$X:::::::::::::::::::::::@::::::::::::::::::::+$:O:$+:::::::", +":::*O@XO#$o=#OX$O$O,;#OXXO:%X:%X:O@=:o:XoOXO:$o$XO##OX:XO.+:O,-OO:+;+@:@$@#+&%O,-:o::o::O:::::::", +":::#OXo:oo::o:oXoO:o:o:oOO::o::O:X+::O:oOOOO:o:Oo:oo:o:o:%$::O:oO:&@&#O#:,;@O:&%:O@::O::+;Oo@:::", +":::+OXXO#$o=#OX$O%:O:#OXOo:o,@:o:o%&:@+OoOOo:$o$XO##OX:O:+O::O;+X:;,;##@#%#=+:,o;:o::o::O:::::::", +":::::::::::::::::::::-@@::::::++::::::::::::::::o::::O:::::::::::::::::::::O*:::::#$:O:$#:::::::" +}; diff --git a/wmdocklib/4x6.xpm b/wmdocklib/4x6.xpm new file mode 100644 index 0000000..fd0ce76 --- /dev/null +++ b/wmdocklib/4x6.xpm @@ -0,0 +1,32 @@ +/* XPM */ +static char *_x_[] = { +/* columns rows colors chars-per-pixel */ +"128 18 8 1", +" c #e8e7e9", +". c #d5d3d6", +"X c #b9b8ba", +"o c #99979a", +"O c #7a787b", +"+ c #575659", +"@ c #353337", +"# c #020003", +/* pixels */ +"#####.###..##oo##.##oo###XX##.###+O##O+#+.+###################o#O.O##X #.Xo#OXX##+ # XO#+.X#X..#XXX#o.O#####################+XX#", +"#####.###@@#. #o o#oX++# @##@###X####X#o o##X###############++# O.###.##@X##Xo#@O.#..+#.XO##OO#O.o#.#.##o###o##@oo#XXX#oO@##@X#", +"#####o###### ..#o +#+ .O.@X.#####.####.#@X@#X X######Xo######o##.#.###.#@X@###.#OX +##.#.# ##.##.#.#OX #########XO@#X.X#@O.##.##", +"#####o######Xo##o X##oXoO..o#####.####X######.###X#######o##O@##O.O##X o XX#O.o###.#X.O#OXo#+O##o.o#X.+##o###X###@O#####O@###X##", +"#################.###############+O##O+##########o###########################################################X##################", +"################################################################################################################################", +"@XXO# O# XX#+.X# .O# Xo# Xo#+.o#.#.#X X##X #.@X##.## O # @.#O.O# .o#O.O# Xo#oXo#X .#.#.#X@o@o@#.o+X@.#.#X. ## O#++##O ##+oo#####", +"XXX.@oX# .o# ###.#.# XO# XO#.### X ##.####.# .@##.##.X # O.#.#.#.#.#.#.# #.#XO###.## #.#O+.#OooX#.O#O.O##o+##.###o###.##########", +". # OX.#.#.#.###.#.#.###.###.O.#.# ##.####.# o+## ##.X.#.o.#.#.# .O#.#.# O##+.##.##.#.#@oX#+.oo# o## ##Oo###.###++##.##########", +"XXX.X#o+ .o#+..# .O# Xo#.###+.X#.#.#X o#O.o# #.## XO.#.#.@ #O.O#.###O O#.#.#X.o##.##oXo## O#@XoOo@X@#.## XX##.####o##.##########", +"@oXO##################################################################+######################################.O#####O.##########", +"############################################################################################################################XXXX", +"#o######.#########.######Xo#####.####o######.###o ###############################o###########################Xo##.##oX##########", +"####OXo# Xo#O.O#oX #O.O#X o#oX # XX#o ###o #.oO##.## ..# XX#O.O# Xo#oX ## XOXX+#X o#.#.#o@X@X#@O+o.#.#.#X..##.###.###.##########", +"####o. # #.#.###.# # X.##.##.# #.#.##.####.# .###.##...#.#.#.#.# #.# # ##.##OoO##.##.#.#@oX#oXo@#.O#oX+#@X@#XX###.###X.#XX.#####", +"####XX # Xo#O.O#oX #OXX##.##oX #.#.#. X###.#.@X##o.#...#.# #O.O# Xo#oX ##.##oXX##.O#Xo ## O#Oo #OO.#@ ## Xo##.###.###.##########", +"############################+oo##########.X#####################.#####.#############################oO#######oo##.##oo##########", +"################################################################################################################################" +}; diff --git a/wmdocklib/4x7.xpm b/wmdocklib/4x7.xpm new file mode 100644 index 0000000..8275baa --- /dev/null +++ b/wmdocklib/4x7.xpm @@ -0,0 +1,35 @@ +/* XPM */ +static char *_x_[] = { +/* columns rows colors chars-per-pixel */ +"128 21 8 1", +" c #edebee", +". c #d1cfd2", +"X c #bfbdc0", +"o c #99979a", +"O c #7a787b", +"+ c #535154", +"@ c #333134", +"# c #030104", +/* pixels */ +"######X##XX##O@o#O oOXO##oX###X##@O##O@##@X@##################@O+..@#o.##XXO#X.O#+.#.Xo#@.X#XX #oXo#OX.+#####################o.O", +"######X##XX#o.oX#X.#oXO+@X####X##O@###o##O O#X################o#X##X##X####X###X#OX#..+#XXX+##O#X#.#X##X##o###o###Oo####oO#####X", +"######X#####@OO@#+ @#@O@OO+o#####X####X##@X@#X################o#XO#.##X###++#X +o#.###X#.@#X#O@#+ X#+.o.########Xo@#XXXX#@oX##++", +"######X#####.. X##XX@+OX @@O#####X####X#####X XX#####Xo######O@#X@#X##X##+O####XXo +##X#.##X#o##X##X##@X########@Oo+.XXX+oo@##X#", +"######o#####o@o##o O##oX .XO#####o@##@o######X####X#######o##o##@..+#o O# Xo+X.O##X#o.O#+..+@O##O..OXXX@##o###X####+####+#####o#", +"##################X###############O##O@##########@O#########O@###############################################@O#################", +"################################################################################################################################", +"#oX+#Oo#.XO#@.X@.XX@#.XX@.XX+.X#X##X#X o@X.#X#O+#X##.++. +#X+..+#.XO+..+..O#O.o@X XXX#X#o##Xo##oO+@o@O#O@XX #.O#O@###O.##oo#####", +"oXXX#oo#.#.#X###X##X#X###X##X@##X##X##X###X#XO+##X##XOOXXX#XX##X#X#XX##XX#X#X####X##X#X#O+#oo+oo#oo@#o+o##@O#X###o####.#++@O####", +"XX#.@oO+..X@X###.##X#.XX@ XXX#O..X..##X###X#..@##X##XOOXX++XX##X#..+X##X..+#@oo+#X##X#X##o++oOOo#Oo##@.@##o##X###O@###X#########", +".X#.OoooX##XX###X#@X#.###X##X##XX##X##X###.#X#X##X##X##XX#XXX##X#X##X##X.#o####.#X##X#X##oo#OoOo#XO@##X##O@##X###@O###X#########", +"oXXXX##X X.O@.X@.XX@#.XX@X##@.XoX##X#X XX.O#X#+o#.oo ##XX#+ +..+#X##+. @X#o+oXXO#X##o.o##Oo#+o+Oo@#X##X## XX#X####o###X#########", +"#oX###################################################################++#####################################X####@O##X#########", +"#############################################################################################################.O######oX#####XXXX", +"#O@######X########X#######oX#####X####o###o##X##X.###############################X############################O.##X##oo#########", +"####oX+##.XO#+.XoX.#+XX+#X XOX.##.Xo#o.##X.##.#o#X##.XX##XXo+..+#.XOOX.##.oX#oXoX X##X#XO@#oo##O+O@O#o#O@XX.##X###X###X#########", +"####+X.##.#X#X##X#.#XXXX##X#X#.##.#X##X###X##..##X##XXX##.#XX##X#.#XX#.##.###X+##X###X#X@O++o+Oo#OX##o#o##O+##X###X###X#XXXX####", +"####.#.##.#X#.##X#.#.#####X#X#.##X#X##X###X##.+O#X##XXX##X#X.##X#.#XX#.##.####@X#X###X#.#oo#OoOo#oo##+X+#++##XO###X###O.@#######", +"####oX.##.XO#+.XoX.#+ X###X#OX.##X#X#X X##X##X#o@O.#.XX##X#X+..+#.XOOX.##X###o.o#oo##oO.#OX#@oOO++@o##X## XX##.###X###.#########", +"############################oXO##########Xo######################X####X##############################oO#######X###X###X#########", +"##############################################################################################################OX##X##XO#########" +}; diff --git a/wmdocklib/5x7-aa.xpm b/wmdocklib/5x7-aa.xpm new file mode 100644 index 0000000..962fbdb --- /dev/null +++ b/wmdocklib/5x7-aa.xpm @@ -0,0 +1,35 @@ +/* XPM */ +static char *_x__aa[] = { +/* columns rows colors chars-per-pixel */ +"160 21 8 1", +" c #e9e7ea", +". c #cccacd", +"X c #bdbbbe", +"o c #969497", +"O c #777578", +"+ c #545255", +"@ c #323033", +"# c #030004", +/* pixels */ +"#######X###XX####OO##O X#oXO###o.O###X###@O###o###@#.@########################X#+..@##o.###XX.O@X.O###+.# XX@#@.X###XX. O..O#O.X+###########################X.O#", +"#######X###XX###oXXo#X.##OXO+@#X#####X###o@###@o###O o###X###################++#X#@X###X######X###X##@OX#.XX@#XXX+####+OX##X#X##o###o####o####Oo######oO######X#", +"#######X########+++##+ o@#@O@#OOO@o######X#####X##@@X@###X###################X##.O#X###.#####O@#X +##o#.###@X#.@#X####.#+ +#+.Xo###########Xo@##XXX.##@oX###O@#", +"#######X#######X ..###X#.@+OXO.+#oO######X#####X#######X. X#######XX########++##X@#X###X###@o@####X#@Xo +###.#X@#X###OO#X##X###@o###########@oo+#X.XX#+oo@###X##", +"#######o########OO###o .O##oXo+..Xo######o@###@o#########.####X#########o###X###@..+##o o## .XXOX.O####X#o..+#+..+###.##O..O#XXX@###o####X#####+######+######o##", +"######################.###################o###o##############@O############O+###########################################################@O######################", +"################################################################################################################################################################", +"#OXX@#+ ### XXO@XX.# XX@## X.+# XX+@XXo#X##X##. X##@..#X#+o##X###.++.# +#X#+..+## XXO+..+#.X.O#O.X+#X. .#X##X#o@#O+X##@o+O#o@+O#O+#XX. ## o#++####o.###O.@######", +"oXXX.#oO+##X##XX@###X##X##X####X###X@###X##X###.#####.#X+o###X###.OO.#XX#X#X##X##X##.X##X#.##.#X######X##X##X#+O#X#X@.@O#oOO##o@X####o+##X###X#####.##+O#o@#####", +"X.#@.#X#X## X +X####.##X## X.+# XX@X#oX# XX ###X#####X# .+###X###XOOX#X++X#.##X## X.+.##X#.X +#@oo+###X##X##X##X#o#oOXO+#+ ###@ ####O+###X###++####X############", +"X.#@.+.o ##X##XX@###X#@X##X####X###X##X#X##X###X#####.#X#X@##X###X##X#X#XX#X##X##X###X##X#.#@o####.###.##.##X##oO+#OX@.@#X@o###X###+O####.####X####X############", +"OXXXXX@#+O# XXO@XXX@.XX@## X.+#X###@..o#X##X##. .#@..O#X##.##.ooOX##.#X#+ #+..+##X###+. @#X##o@XX.O###X##O..O##+ ##@X# #o+#o+##.### X.X##X####++###X############", +"#OXX###################################################################################++################################################X#####X###X############", +"#########################################################################################################################################Xo#######oX#######XXXX#", +"#++########X###########X########oX#######X#####o#####o##X####X ######################################X###################################oX@##X###Xo############", +"#####oXX+##.X.+#+.X#+.X.#+XX+##. X#+.X.##.o.O#X.####..##X@o@##X##.XXXo#.o.O+..+##.X.++.X.##.oX@#o.o#. X###X##XO+#o@X###o@o#X#@o#+O#XX ###X####X####X############", +"#####+XX.##.##X#.###.##.#XX.X###.##X##.##.##.##.#####X##..@###X##.#.#X#.##..##.##.##.X##.##.@###o+###.####X##X#o#X#o@X++#+.@##o@o###O+###X####X####X##XXXX######", +"#####.#@.## ##X#.###.##.#.######X##.##.##.##X##X#####X##.+o###X##X#X#.#.##X.##X## ##X.##.##X#####@X##X####X##.#oO+#Oooo@#OX@##@Xo##+O###XO####X####O.@##########", +"#####O.o.##.X.+#+.X#+.X.#+..o###X##+.X.##.##X#X .X###.##X#OO##O.@X#X#X#.##X+..+##.X.++.X.##X####XXo##oo###OoO.#+ ##@.@.#+O#X###X@## XX###.####X####.############", +"###################################oX.+############o.O###########################X######X#####################################oO#########X####X####X############", +"#########################################################################################################################################OX@##X###XO############" +}; diff --git a/wmdocklib/5x7.xpm b/wmdocklib/5x7.xpm new file mode 100644 index 0000000..8f2c380 --- /dev/null +++ b/wmdocklib/5x7.xpm @@ -0,0 +1,50 @@ +/* XPM */ +static char *_x_[] = { +/* columns rows colors chars-per-pixel */ +"80 42 2 1", +" c black", +"% c gray100", +/* pixels */ +" % % % % % % % ", +" % % % % % %%% % % % % % % % % % % ", +" % % % %%%%%% % % % % % % % % % % ", +" % % % %%% % % % % %%% %%%%% %%%% % ", +" %%%%% % %% % % % % % % % %% %% % ", +" % % % %%% % % % % % % % % % %% ", +" % ", +" % % %% %%%% % %%%% %% %%%% %% %% % ", +" % % %% % % % %% % % % % % % % %% %% % % % % ", +" % % % % %% % % %%% %%% % %% % % %% %% % %%%% % % ", +" % % % % % %%%% % % % % % % %%% % % % ", +" % % % % % % % % % % % % % % % %% %% % %%%% % ", +" % %%% %%%% %% % %% %% % %% %% %% % % % % ", +" % ", +" %% %% %%% %% %%% %%%% %%%% %% % % %%% % % % % % % % % %% ", +"% % % % % % % % % % % % % % % % % % % % % %%%% %% % % % ", +"% %% % % %%% % % % %%% %%% % %%%% % % %% % %%%% %% % % % ", +"% %% %%%% % % % % % % % % %% % % % % %% % % % % %% % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % %% % % ", +" %% % % %%% %% %%% %%%% % %%% % % %%% %% % % %%%% % % % % %% ", +" ", +"%%% %% %%% %% %%% % % % % % % % % % % %%%% %%% %%% % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % %% % % % % % % ", +"%%% % % %%% % % % % % % %%%% %% % % % % % ", +"% %% % % % % % % % % %% %%%% % % % % % % % ", +"% %% % % %% % %% %% % % % % % %%%% %%% %%% %%%% ", +" % ", +" % % % % % % % % %% ", +" % % % % % % % % ", +" %%% %%% %% %%% %% % %%% %%% %% % % % % % % %%% %% ", +" % % % % % % % % %% %%% % % % % % % %% % %%%% % % % % ", +" % %% % % % % % %% % %% % % % % % % % % % % % % % ", +" % % %%% %% %%% %% % % % % %%% % % % % %%% % % % % %% ", +" %%% % ", +" % % % % % % ", +" % % % % % % % % %", +"%%% %%% %%% %%% %%% % % % % % % % % % % %%%% %% % %% ", +"% % % % % % %% % % % % % % % %% % % % % % % % %", +"% % % % % %% % % % % % %%%% %% % % % % % % ", +"%%% %%% % %%% %% %%% % %%%% % % % %%%% % % % % % %", +"% % % " +}; diff --git a/wmdocklib/5x8-utf-8.xpm b/wmdocklib/5x8-utf-8.xpm new file mode 100644 index 0000000..f469ce8 --- /dev/null +++ b/wmdocklib/5x8-utf-8.xpm @@ -0,0 +1,95 @@ +/* XPM */ +static char * 5x8_xpm[] = { +/* columns rows colors chars-per-pixel */ +"160 88 2 1", +" c black", +"% c gray100", +/* pixels */ +" % % % % ", +" % % % % % %%% % % % % % % % % % %% %%%% % %%%% %% %%%% %% %% % % % ", +" % % % %%%%%% % % % % % % % % % % % % % % %% % % % %% % % % % % % % %% %% % % % % ", +" % % % % % %%% % % % % % %% % % % % % % %% % % %%% %%% % %% % % %% %% % %%%% % % ", +" % %%%%% % % % % % % % % %%%% %%%%% %%%% % % % % %% % %%%% % % % % % % %%% % % % ", +" % % %%% % % % % % %% % %% % % % % % % % % % % % % % % % % % %% %% % %%%% % ", +" % % % % % % % % % % % % %%% % % %%% %%%% %% % %% %% % %% %% %% % % % % ", +" % % % ", +" %% ", +" % % %% %%% %% %%% %%%% %%%% %% % % %%% %%% % % % % % % % %% %%% %% %%% %% %%% % % % % % % % % % %%%%% %%% % %%% % ", +"% %%% % % % % % % % % % % % % % % % % % % %%%% %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % %% % %%% % % % %%% %%% % %%%% % % %% % %%%% %%%% % % % % % % % % % % % % % % % % %% % % % % % % ", +"% % %%%%% % % % % % % % % %% % % % % % % % % % % %% % % %%% %% % %%% % % % % % % %%%% %% % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % %% % % % % % % % %% %%%% % % % % % % % ", +" % % % %%% %% %%% %%%% % %% % % %%% % % % %%%% % % % % %% % %% % % %% % %% %% % % % % % %%%% %%% % %%% ", +" %% % %%%% ", +" %% %% ", +" % % % % % % % % %% % % % % % % ", +" % % % % % % % % % % % % % % ", +" %%% %%% %% %%% %% % %% %%% %% % % % % %% % %%% %% %%% %%% % % %% %%% % % % % % %% % % % %%%% %% % %% ", +" % % % % % % % % %% %%% % % % % % % %%% % % % %% % % % % % % % %% % %% % % % % % % % % %% % % % % % % ", +" % % % % % % % %% % %%% % % % % % % % % % %% % % % %%% %%% % % % % % % % % % % % %% %%% % % % % ", +" %%% %%% %% %%% %% % % % % %%% % % % % %%% % % %% % %% % % % %% % %%% % % % % % % % %%%% %% % %% ", +" %% % % % %% ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" % %%% %% % %% % % % % % ", +" % % % % % % % % %%% % % %%% %%% % % % % % %%%% %% % % % % % % ", +" % % % % % % % % %%% % % % %% %%% % % % % % %% % %%% % % % % % % % ", +" % %%% %%% %%% %%%%% % % %% % % % %% %% % %%% % % % % %%% % % % % % % %% % %% % ", +" % % % % % % % % %%% %% % %%% % % %%% %%% %%% % % %%% %% % % %% % % %%% %%% % % %% % % % % ", +" % % % % % %%% %%%%% % % % % % % % % %% %% % % % % % % %%%% % %%%% % % ", +" % %%% % % % % % % %%% %%% % %%% %%% %%% % % % % %%% % % ", +" % % % ", +" % % %% % % % % %% % % %% % % % % % % % % % % % %% % % % % % % %% % % % ", +" % % % % % % % % %%% %% % % % % % % % % %%% % % % % % % % % %%% % % % % % % %% ", +" %% %% %% %% %% %% % % % % %%%% %%%% %%%% %%%% %%% %%% %%% %%% % %% % %% %% %% %% %% % %% % % % % % % % % % %%%% % % ", +"% % % % % % % % % % % % % % % % % % % % % % % %%% %%% % % % % % % % % % % % % %% % % % % % % % % % % % % % % ", +"%%%% %%%% %%%% %%%% %%%% %%%% %%%% % %%% %%% %%% %%% % % % % % %% %% % % % % % % % % % % % % %% % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % %% % % % % % % % % % % %%% % % ", +"% % % % % % % % % % % % % %% %% %%%% %%%% %%%% %%%% %%% %%% %%% %%% %%% % % %% %% %% %% %% % % %%% %% %% %% %% % % % % ", +" % ", +" % % % % % %% % % %% % % % % % % % % % %% % % % % %% % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" %% % % % % ", +" %%% %%% %%% %%% %%% %%% %%%% %% %% %% %% %% %% %% %% %% % %%% %% %% %% %% %% %%% % % % % % % % % % % %%% % % ", +"% % % % % % % % % % % % %% % % % %% % %% % %% % %% % % % % %%% % % % % % % % % % % % % %%% % %% % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % %% % %% %% %% %% % % % % % % % % % % % % % % % % % % %% % % % % % % % % % %%% %%% %%% ", +" %%% %%% %%% %%% %%% %%% %%%% %% %% %% %% %% %%% %%% %%% %%% %% % % %% %% %% %% %% % %%% %%% %%% %%% %%% % % % % % ", +" % %% % %% ", +"%%%% % % % % % % %% %% % % % % % % % % % %%%% % % % % %% % % % % %% %% % % % % ", +" %%%% %% %% %% % % % % % % % %% %% %% % % %%% % %%%% %% %% %% %%%% %% %% % % % % %% %% ", +" %% %% % % %% %% %% %% %%% % % % %%% %%%% %%%% %%%% % %%%% %%% %%% ", +"% % %%% % % %%% % % %%% % % %% % % %% % % %% % % %% % % %%% %%% % % % %% % %% % %% %%% %% % %% % %% % %% ", +"%%%% % % %%%% % % %%%% % % % % % % % % % % % % % % % % %% %%% % %% %%% % %% %%% % %% % % %% %%% % %% % %% % % % %% % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % %% % %% % %% % %% % %% % % %%% % % %%% ", +"% % %%% % % %%% % % %%% %% %% %% %% %% %% %% %% %%% %%% %%% %% %%%% %% %%%% %% %%%% %% %%%% %% %%%% %% %% % %% % ", +" %% % % % %% %% ", +" %% %% %% %% % % % % %%% % % % % % % % % % % % % % ", +" %% %% % % % % % % % % % % % % %%% %% %% %%% % % %% % % % % % % % % % % % % %% % % % ", +" %%% % % % %%%%%%%%% %%% %%% %%% % %%% % % %%% % % % % %% % % % %% % ", +"% %% % %% % % %%% % % % % %% % %% % %% % %% % %% % % % % % % %% % % % % % % % % % % % % ", +"% %% % % % %% % % %%%% % % %%% %%% % % % % % % % % % % % % % % % % % % %%% %% % % % % % % % ", +"% % %%% % % %%% % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % % % % % ", +" %% % %% % % % % % % % % %%%% %%% %%% %%% %%% %%% %%% %%% %%% %%% % % % % % % % % % % % % % %%%% %%% %%%% %%% %%%% %%% %%%% ", +" %% % %% % % % % % % % % ", +" % % % % % % %% %%%% % % % % % % % % % % % % % % % % %% % ", +"%% % %% % % % % %% %% % % % %%%% %% %% % % % % %%% % % %%% %% %% % % % % % % %% ", +" % %% % % % %% % % % % %% % %% %% %% % % %%% % % %%% %%% %%% % % ", +" % % %% %% %% % %%% %%%% %%% %% % %%% %% %%%% %%% % % %% % % %% % % %% % %% %%% % % % % % % % % % % % % % %% % %% % %% ", +" % % %% % %% % % % %% % % % %% % % % %% %% % % % % % % % % % % % % % %% % % % %%%% %% % %%% %% %%%% %% % %% %% %% %% % %% ", +" % % % % % % % % %% % % % % % % % %% %% % % % % % % % % % % % % % %% % % %% % % % % % % % % % % % % % % % % ", +"%%% %%%% %%% % % % % % % % % % % % % % %% % % % %% %% %% %% %% %% %%% %%%%% % % % % % % % % %%% %% %%% %% %% %% ", +" % % % % % % % % ", +"% % % % % % % % % % % % % %%%% % % % % % % % % % % %% % % %% % % % % %% % % % % ", +" %% % %%% % % % %%% %%% % % % % %%%% %% %% % % % % % % % % % % % % % % % % % % %% %% %% % ", +" %%% % % %%% % % % % % % % % % % % % %%%%% %%%% %%%% % % ", +"% %% % %%% % %%% %%% %%% % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % % %%%% % %%%% % %%%% % ", +" %% %% % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % %%%% % % % % % % % % % % % % % % %% ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % %%%% % % % % %%% % % % % % % % % ", +"%%% %% % % % % % % %% %%% %% %%% %% %%% %% %%% %% %%% %% %%% % % % % % % % % %%%% %%%% %%%% %%%% %%%% %%%% % ", +" % % % % %% "}; diff --git a/wmdocklib/5x8.xpm b/wmdocklib/5x8.xpm new file mode 100644 index 0000000..5c28590 --- /dev/null +++ b/wmdocklib/5x8.xpm @@ -0,0 +1,96 @@ +/* XPM */ +static char *square_[] = { +/* columns rows colors chars-per-pixel */ +"160 88 2 1", +" c black", +"% c gray100", +/* pixels */ +" % % % % % % % % %% % % % %% % %% %% % %%%% %% %%%% %% %% % % %% ", +" % % % % % %%% % % % % % % % % % % % % % %% % % % % %% % % % % % % % % % % % % % ", +" % % % %%%% % % %% % % % %% % % % % % % % % % %%% % % % % % % % % % %%%% % % ", +" % %% %% % % % % %%%% %%%%% %%%% % % % % % % % % % %%% % %% %%% % % % ", +" %%%% % % % % % % %% % % % % % % % %%%% % % % % % % % % %%%% % % ", +" % % %%% % % % % % % % % % % %% % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % %%% % % % %% % %% %%% %%%% %% % %% %% % %% %% % % % % ", +" % % ", +" %% %% %%% %% %% %%%% %%%% %% % % %%% % % % % % % % % %% %%% %% %%% %% %%%%%% % % % % % % % % % %%%% %%% %%% % ", +"% % % % % % % % % % % % % % % % % % % % % %%%% %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% %% % % % % % % % % % % % % % % %% % % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"%% % %%%% %%% % % % %%% %%% % %% %%%% % % % % % % % %% % % %%% % % %%% %% % % % % % % % %% % % % % % % ", +"% %% % % % % % % % % % % % % % % % %% % % % % %% % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % %%%% % % % % % % % ", +" %% % % %%% %% %% %%%% % %% % % %%% % % % %%%% % % % % %% % % % % %% % %% % % % % % % %%%% %%% % %%% ", +" %%%%%", +"% % % % % % % % %% %% % %% ", +" % % % % % % % % % % % ", +" % %% % %%% % %% % %%% % %% %% % % % % % %%% %% %%% %%% %%% %%% %%%% % % % % % % % % % % %%%% % % % ", +" % %%% % %%% % % %%% % % %%% % % % % % %%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" %%% % % % % % %%%% % % % % % % % %% % % % % % % % % % % % % %% % % % % % % % %% % % % % % % %%% ", +" % % % % % % % % % %%% % % % % % % % % % % % % % %%% %%% % % % % % % % %%%% % % %%% % % % % ", +" %%% %%% %%% %%% %% % % % % %%% % % % %%% % % % % %% % % % %%% %% %%% % % % % % % %%%% %% % %% ", +" %%% %% % % %% % ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" % %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% ", +" ", +" %% %% %% %% %% %% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"%%%% %%%% %%%% %%%% %%%% %%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% ", +" ", +" % % % % % % % %%% %%%% % % % % % % % % % % %%%% %%%% % % % % % % % %%%% %%%% % % % % % % %%%% % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" %% %% %% %% %% %% % % %%% %% %% %% %% %% %% %% %% % % % % %% %% %% %% %% % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" %%% %%% %%% %%% %%% %%% % % % %%%% %%%% %%%% %%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % %%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%% % % %%% ", +" %%% %%% %%% %%% %%% %%% %%%% % %% %% %% %% %%% %%% %%% %%% %%%% %%%% %% %% %% %% %% %%%% %%%% %%% %%% %%% %%% % %%%% % ", +" % %% %% ", +" %% %%%% %% % % %% %% % %% % %% % %% % % %% % %% %% % %%%% %%%% %%%% % % %%%% % %%%% %%%% % % %% % %% % % ", +"% % % % %% % % % % % % % % % % % % % % % % % % % % %%% % % %% % % % % % % % % % % %% ", +"% % %% % % %% % % %% % %%% % %%% % %%% % %%% % % % % % % % %% % %% % %% % %% % %% % %%% % %%% ", +"%%%% % %%%% % %%%% % % % % % % % % % % % %%% %% % %%% %%% % % %%% % % %%% % % %%% % % %%% % % % %% % % % %% % % ", +"% % %%% % % %%% % % %%% % % % % % % % % % % % % % % % % % %%%% % %%%% % %%%% % %%%% % %%%% % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%% % % %%% ", +"% % %%% % % %%% % % %%% %% %%% %% %%% %% %%% %% %%% %% %%% %% %%% %%%% %% %%%% %% %%%% %% %%%% %% %%%% %% %% % %% % ", +" %% %% %%% %%% ", +" %% % %% % % % % % % % % %%% % % %%% %%% %%% % % %%% % % % % % %%%% %%%% %%%% %%%% %%%% % %% % %% % %% % ", +"% % % % % % % %% % %%%% %%% % % % % % %% % %%% % % % % % % % % % % % % % % % % % % % ", +"% %%% % %%% % % % % % % % %% % %% % %% % %% % %% % % %% % % % % % % % % % % % % % % % % % % ", +"% %% % % % %% % % %%%% %%% %%%% %%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % %%% % % %%% % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % % % % ", +" %% % %% % % % % % % % % % %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %% % %%%% %%%% %%%% %%%% %%%% %%%% %%% %%%% %%% %%%% %%% %%%% ", +" %%% %%% %% %% %% % % ", +" %% % %% % % % % % % % % % % % % %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %% % %% % %% %%%% ", +" % % % %% % % %% % %% % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % %% %% % %%% %% % %%% %% % %%% %%% %% % %%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%% % %%% % %%% % % ", +" % %% %% % %% % % % %% % % % %% % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % %% % %% % % % ", +" % % % % %% % % % %% % % % %% % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % %% % %% % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" %%% %%%% %%% % % % % %% % %% % % % % % % % % % % % %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %% %%% %% %%% %% %%% %%%% ", +" % % %% %% % % ", +" %% % % %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% % %%%% % %%%% % % %%%% ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% %%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%%% % %%%% % %%%% % % ", +" %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" %% %%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% ", +" ", +}; diff --git a/wmdocklib/5x9.xpm b/wmdocklib/5x9.xpm new file mode 100644 index 0000000..463d3b0 --- /dev/null +++ b/wmdocklib/5x9.xpm @@ -0,0 +1,49 @@ +/* XPM */ +static char *_x_[] = { +/* columns rows colors chars-per-pixel */ +"160 27 16 1", +", c #F1EFF2", +". c #E5E3E6", +"X c #D8D7D9", +"o c #C6C4C7", +"O c #BAB8BB", +"+ c #ABA9AC", +"@ c #9A999B", +"# c #8B8A8C", +"$ c #7B797C", +"% c #6A686B", +"& c #585659", +"* c #484649", +"= c #363437", +"- c #262427", +"; c #181619", +": c #020003", +/* pixels */ +":::::::X:::X:X::;O;O:::X:::::::%oO:::X:::::+:::+::;:X:;:::::::::::::::::::::::%%=oo=::o,:::Ooo*:@oo&::&,::.oo*;+oO::oOo,&Xo&:*XO=:::::::::::::::::::::::::::*OX%", +":::::::X:::X:X::&$*#:&o,+%o%:::X:::::X::::%%:::%%:=$,$=:::::::::::::::::::::::o:+==+::;X:::-:;X:::;X::@X::X:::@*::::::=@X:;X:X-:&:::::::::::::::::::::::::::;::X", +":::::::X:::-:-:+XOXO:X;X-X;X:::o*::::-::::O;:::;O:=$,$=::X:::::::::::::::::::%%:X::X:::X::::::X:::;o:&&X::.oO;X#o=::::@*O;;O:X::*:::X::::X::::;%O:::::O%;::::;O$", +":::::::X::::::::X:o::+#.:%o+#&;Oo:::::::::X:::::X:;:X:;::X:::::::::::::::::::o::X:$X:::X:::::@&::O,*:O:X::;:*O.&-o::::X:=..=:o=:@:::-::::-::&++&:oOooO;&++&::O%:", +":::::::::::::::o,o,o::=,@*#+o%O*%%o:::::::X:::::X::::::oo,oo:::::::oO-::::::&$::X::X:::X::::%#::::;o%&:X:::::X.;:X:::*@:o;;o:-oo%:::::::::::o+*:::::::::*+O::o::", +":::::::::::::::$&%%::;:XX::X:XX*:#$:::::::O;:::;O::::::::X::::O:::::::::-:::o;::+-=+:::X:::&+:::::;X#OO,#:::=o+*;o:::@*:X;;X::::*:::-::::O:::;$o@oOooO@o$-::::::", +":::::::+:::::::+-@-::+O,$::#o$*Xo+@:::::::%%:::%%::::::::X::::o:::::::::X::&$:::=oX-::O,OO:,oo+;ooo&:::X::OoX==XX*::;X::&oo&:Oo@;:::X::::o::::::=:::::=::::::+::", +":::::::::::::::::::::::X:::::::::::::::::::+:::+:::::::::::::=$:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::=$::::::::::::::::::::::", +"::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::", +":%Oo=:;,&::.oo&:;+oo;.oO;:.oo+:.oO+;+o+::X::X:o,Oo:%o.::X::O*X:::,$:$,:,&:X=oo=::.OX*=Xo=::,OX&:*oo+oo,Oo:X::X@*::XX:::@@@:-oO=:=O:Ooo,::.O:&$::::O.:::*o#::::::", +"&+:=o:*@@::X:;X:#&:::X:*@:X::::X:::@*:;::X::X::X:::::X::X:+&:X:::X+:+X:X@:X+=-+::X:;o+--+::X:;X:X;:;::X:::X::X&$:=+o:::+;o;+==+:+=:::&#::X:::o;::::X::=#:&$:::::", +"O;%O.:@=o::X:;o:X::::X::X:X::::X:::X:::::X::X::X:::::X::X#$::X:::X@-@X:X@;XX::X::X::XX::X::X:;o:o=::::X:::X::X;o:$%+-.=o:=o@::+%+::::o;::X:::&$::::X::::::::::::", +"X:X;.-o:@-:.o.*:X::::X::X:.oo+:.oo%X:+o::.oo.::X:::::X::,X#::X:::X*O*X:X&&XX::X::X:=oX::X::.o,=:=OX*::X:::X::X:o:+-#&O%o::,&::-,-:::$%:::X::::o::::X::::::::::::", +"X:X;.%.OX$:X:;o:X::::X::X:X::::X:::X::X::X::X::X:::::X::X:o=:X:::X:,;X:X:@XX::X::,oo=X::X::X:&#:::;X::X:::X::X:#*o:%@&@+:$$o:::X:::;o::::X::::%%:::X::::::::::::", +"O-%OoO&:;O:X::X:#&:::X:*@:X::::X:::@*:X::X::X::X::-:;X::X:=o:X:::X:::X:X:@XO--+::X:::+--+::X::o;-:;X::X:::o;:X:*+@:*,;O#;o:#%::X:::#*::::X:::::o:::X::::::::::::", +"*O;:::-::X;.oX%:;Ooo;.oO;:,Oo+:X:::;Oo@::X::X:o,oO#oX&::X::+%,OOO.:::X:X:&,-Xo=::X:::=X.-::X::$%Ooo&::X:::&oo&::,&:;.:@%+&::X;:X:::,oOo::X:::::%%::X::::::::::::", +":&OO;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::%&::::::::::::::::::::::::::::::::::::::::::::::::oO:::::::Oo::::::::::::", +":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::ooOo:", +":$&::::::::X:::::::::::X::::::::$oo::::::X:::::@:::::+::X:::-o.:::::::::::::::::::::::::::::::::::::::=::::::::::::::::::::::::::::::::::#o;::X:::O@::::::::::::", +"::+;:::::::X:::::::::::X::::::::X::::::::X::::::::::::::X:::::X:::::::::::::::::::::::::::::::::::::::X::::::::::::::::::::::::::::::::::X::::X::::X::::::::::::", +":::::Ooo&::X+X*:-ooO&X+.:=oX*::O,oo*X+X::X@X$:o.:::=o.::X:$$::X::.OOo@:X+X$:*Xo*:XOX*:*X+X:X@o%:$oO*:o,oo:X::X%%:;Oo:::@&O:%$-+::o;Ooo,::X::::X::::X::::::::::::", +":::::;::X::,;;o:O=::X;;,:o-;O:::X::o-;,::,-:X::X:::::X::X$$:::X::.:.:X:,;:X:o;-o:,;;o:o;;,:,=:::X;::::X:::X::X;O:$&+;::O:%@+::O;=@:::@%::X::::X::::X::%o$:&:::::", +":::::&oo.::X::X:X:::X::X:.Ooo:::X::X::.::X::X::X:::::X::,O$:::X::X:X:X:X::X:X::X:X::X:.::.:X::::*+O&::X:::X::X:O;O;%*X-O::,*::%%#*::$#::o$::::X::::$.;&:&o%:::::", +":::::X:;,::,;-o:o=::X;;,:o;:::::X::o;;,::X::X::X:::::X::X:O=::X::X:X:X:X::X:o;-o:,-;o:o;;,:X::::::;X::X:::X:;.:&#+:=@$@#:@%o;:;Oo::%@::::X::::X::::X::::::::::::", +":::::#o+X::.+X*:-ooO&XOX:=ooO:::X::*X+X::X::X:o,oo:::X::X:;X::%XO,:X:X:X::X:&XX*:X+X*:*X+X:X::::OOo%::#O+:$+#.:;,&::,;O**@:*@::+#::,ooo::X::::X::::X::::::::::::", +":::::::::::::::::::::::::::::::::::::;X::::::::::::::X:::::::::::::::::::::::::::X:::::::X:::::::::::::::::::::::::::::::::::::+-::::::::X::::X::::X::::::::::::", +":::::::::::::::::::::::::::::::::::;OX&::::::::::::Oo%:::::::::::::::::::::::::::X:::::::X::::::::::::::::::::::::::::::::::::O@:::::::::$o;::X:::O$::::::::::::" +}; diff --git a/wmdocklib/6(3)x8-7seg.xpm b/wmdocklib/6(3)x8-7seg.xpm new file mode 100644 index 0000000..a78f970 --- /dev/null +++ b/wmdocklib/6(3)x8-7seg.xpm @@ -0,0 +1,32 @@ +/* XPM */ +static char * wmtz_master_xpm[] = { +"192 24 4 1", +"$ c #FFFFFF", +"& c #9e9e9e", +". c #5b5b5b", +" c #000000", +" ... .$. ... ... &$$$& &$..& &$$. .$$ $$. ... ... ... ...& $$$ ...& &$$$& &$$$& &...& &$$$& &$$$& &$$$& &$$$& &$$$& ... ... ... &$$$& ", +". . . $ . . $ $ . $ $ $ & . $& $ $ . $ .$ . . $. & $ & . $ . . . . . . $ $ $ . $ . $ . $ $ $ $ . $ . . $ $ $ $ $ $ $ . . . . . . $ $ ", +". . . $ . . $ $ . $ $ $ $ . . $. $ $ . $ $ . . $ $ $ $ . $ . . . . . . $ $ $ . $ . $ . $ $ $ $ . $ . . $ $ $ $ $ & & . . . . . . . $ ", +" ... .&. ... $$$& &$$$& .$. &$&$ &... ...& $$$ &$$$& &$$$& .$. &...& ...& &$$$& $$$& &$$$& &$$$& &$$$& ...& .$$$. &$$$& .$. &$$$& .$. .&$& ", +". . . $ . . . . $ $ . & $ .$ . $ $ . . $ . . $ $ $ $ . $ . . . . .$ . $ $ . $ $ . . $ . $ . $ $ $ . $ $ $ . $ $ $ .$ . . . . $. . $ . ", +". . . . . . . $ $ . $ $ $ &$ $ $ . . .$ . . $. & $ & . $ . $ . . $ $ . $ $ . $ $ . . $ . $ . $ $ $ . $ $ $ . $ & & $ . . . . $ . . ", +" ... .$. ... $$$& &$$$& &...& &$$$& .$$ $$. ... ... & ... & &... $$$ ...$ &$$$& &$$$& ...& &$$$& &$$$& ...& &$$$& &$$$& $ &$$$& &$$$& &$$$& .$. ", +" $ ", +"&$$$& .$$$. &$$$ &$$$& &$$$ &$$$& &$$$& &$$$& &...& ...& ...& &...& &... $...$ &$$$ &$$$& &$$$& &$$$& &$$$& &$$$& &$$$& &...& &...& &...& &...& &...& &$$$& &$$$ &... $$$& &$$$& ... ", +"$ $ $ $ $ $ $ . $ $ $ . $ . $ . $ $ . $ . $ $ $ $ . $$ $$ $ $ $ $ $ $ $ $ $ $ $ . . $ . $ $ $ $ $ $ $ $ $ $ . $ $ . $ . . $ $ $ . . ", +"$ $ $ $ $ $ $ $ . $ $ $ . $ . $ . $ $ . $ . $ $ $. $ . $ $ $ $ $ $ $ $ $ $ $ $ $ $ . . $ . $ $ $ $ $ $ .$ $. $ $ . $. $ . .$ . . $ $ $ . . ", +"&.&$& &$$$& &$$$ &... &...& &$$$ &$$$ &.$$& &$$$& ...& ...& &$$. &... &...& &...& &...& &$$$& &$..& &$$$ &$$$& .&. &...& &...& &...& .$. &$$$& .$. &... .$. ...& &...& ... ", +"$ . $ $ $ $ $ . $ $ $ . $ . $ $ $ $ . $ . $ $ $. $ . $ $ $ $ $ $ $ . $ $ $ $ $ . $ . $ . $ $ $ $ $ $ $ .$ $. . $ .$ . $ . . $. . $ . . . . ", +"$ . $ $ $ $ $ . $ $ $ . $ . $ $ $ $ . $ . $ $ $ $ . $ $ $ $ $ $ $ . $ $$ $ $ . $ . $ . $ $ $ $ $$ $$ $ $ . $ $ . $ . . $ . $ . . . . ", +"&$$$& &...& $$$$ &$$$& $$$$ &$$$& $... &$$$& &...& ...$ &$$$& &...& &$$$. &...& $...$ &$$$& &... &$$$& &...& &$$$& .&. .$$$$ $$$ $...$ &...$&&$$$& &$$$& &$$$ ...& $$$& ... &$$$& ", +" ", +"&... .$$$. &$$$ &$$$& &$$$ &$$$& &$$$& &$$$& &...& ...& ...& &...& &... $...$ &$$$ &$$$& &$$$& &$$$& &$$$& &$$$& &$$$& &...& &...& &...& &...& &...& &$$$& .&$& .&. &$&. ... ... ", +".$ . $ $ $ $ $ . $ $ $ . $ . $ . $ $ . $ . $ $ $ $ . $$ $$ $ $ $ $ $ $ $ $ $ $ $ . . $ . $ $ $ $ $ $ $ $ $ $ . $ . $ . . $ . . $ . . . . . ", +". $ . $ $ $ $ $ . $ $ $ . $ . $ . $ $ . $ . $ $ $. $ . $ $ $ $ $ $ $ $ $ $ $ $ $ $ . . $ . $ $ $ $ $ $ .$ $. $ $ . $. . $ . . $ . . $ . .$ . . . ", +" ... &$$$& &$$$ &... &...& &$$$ &$$$ &.$$& &$$$& ...& ...& &$$. &... &...& &...& &...& &$$$& &$..& &$$$ &$$$& .&. &...& &...& &...& .$. &$$$& .$. &$.. .&. .&$& $.$.$ ... ", +". . $ $ $ $ $ . $ $ $ . $ . $ $ $ $ . $ . $ $ $. $ . $ $ $ $ $ $ $ . $ $ $ $ $ . $ . $ . $ $ $ $ $ $ $ .$ $. . $ .$ . . $ . . $ . . $ . . $. . . ", +". . $ $ $ $ $ . $ $ $ . $ . $ $ $ $ . $ . $ $ $ $ . $ $ $ $ $ $ $ . $ $$ $ $ . $ . $ . $ $ $ $ $$ $$ $ $ . $ $ . . $ . . $ . . $ . . . . . ", +" ... &...& $$$$ &$$$& $$$$ &$$$& $... &$$$& &...& ...$ &$$$& &...& &$$$. &...& $...$ &$$$& &... &$$$& &...& &$$$& .&. .$$$$ $$$ $...$ &...$&&$$$& &$$$& .&$& .&. &$&. ... ... ", +" ", +}; diff --git a/wmdocklib/6x11-utf-8.xpm b/wmdocklib/6x11-utf-8.xpm new file mode 100644 index 0000000..30222eb --- /dev/null +++ b/wmdocklib/6x11-utf-8.xpm @@ -0,0 +1,148 @@ +/* XPM */ +static char * 6x11_xpm[] = { +"192 143 2 1", +" c black", +"% c gray100", +" ", +" % % ", +" % % % % % % % % % % % % % %%% %%%%% % %%%%% %%% %%%%% %%% %%% % % %%% ", +" % % % % % %%%% % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % %%% % % % % % % % % % %% % % % % % % % % % % % % % ", +" % %%%%% % % % % % % % % % % % % % % % % % % % % %% % % % % % % %%% %%% % %%%%% % % ", +" % % % %%% % % % % % %%%%% %%%%% % % % % % %%% % % %% % %%%% % %%% %%%% % % % % % ", +" % %%%%% % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % %% % % % % % % % % % %%%%% % % % % % % % % %%%%% % % ", +" % % %%%% % % % % % % % %% % % % % % % % % % % % % % % % % % % % %% % % ", +" % % % % %% % % % % %%% % % %%%%% %%%%% %%% % %%% %%% % %%% %%% %%% % % % % ", +" % % % % % % ", +" ", +" ", +" %%% %%% ", +" %%% % %%%% %%% %%%% %%%%% %%%%% %%% % % %%% %%% % % % % % % % %%% %%%% %%% %%%% %%% %%%%% % % % % % % % % % % %%%%% % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % %% %% %% % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % %%% % % % %%%% %%%% % %%%%% % % %% % % % % % % % % % %%%% % % %%%% %%% % % % % % % % % % % % % % % ", +"% % % %%%%% % % % % % % % % %% % % % % % % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % ", +"% %% % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" %%%% % % %%%% %%% %%%% %%%%% % %%% % % %%% %% % % %%%%% % % % % %%% % %%% % % %%% % %%% % % % % % % %%%%% % % % ", +" % %%% %%% %%%%% ", +" ", +" ", +" % %% %% ", +" % % % %% % % %% % % % % % ", +" % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % ", +" %%% %%%% %%% %%%% %%% % %%% % %% %% %% % % % %% % % %% %%% %%%% %%%% % %% %%% %%%% % % % % % % % % % % %%%%% % % % ", +" % % % % % % % % % %%%% % % %% % % % % % % % % % %% % % % % % % % %% % % % % % % % % % % % % % % % %% % %% ", +" %%%% % % % % % %%%%% % % % % % % % %% % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % ", +" % %% % % % % % % % % % %%%% % % % % % % % % % % % % % % %%%% %%%% % % % % % % %% % % % % % % % %% % % % % % ", +" %% % %%%% %%% %%%% %%% % % % % %%% % % % % %%% % % % % %%% % % % %%% %% %% % % % % % % % %%%%% % % % ", +" % % % % % % % % %% %% ", +" %%% %% % % %%% ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" %% % % %%% %%% % % % % % % % ", +" % % %% % % % % % % % % % %%% % % %%%%% %% % % % % % %%%% %% %%% %% %% % % % ", +" %%% % % % % % % % % % % %%% % % % % % % %%% % % % % % % % ", +" % % % % % % % % % % %% %% %% %%%% % % %% %% % % % % % %%% % % % % % % % % % % ", +" % % % % %%% % % % % % %% % % % % % %% %% %% %%%%% %%% %% % % %%% % %%% % % % % %%% %%% % % % ", +" % % % %%% % % %%%%% % % %% %% %%%% % % %%%%% %%% %%% % % % % %%% % %% %%% % % % % % % % ", +" % % % % % % % % % %% % % % % % % %% %% % % % %% % % % %% % % %% % ", +" % %%% % %%% %%%%% % % % % %%%%% % % % % % % % % % %%%%% % % % % % % % % % ", +" % % % % % % % % % % %%% % % %%% %%%%% % %% % % % % %%% % %%% % % ", +" % % %% % % %% %%% % % % % %%% % %%% ", +" % % ", +" % % ", +" ", +" % % %% % % % % % % % %% % % % % %% % % % % % % %% % % % % % % % %% % % % ", +" % % % % % % % % % % % %% %%% % % % % % % % % % % % % %%%% % % % % % % % % % % %%% % % % % % % % % %% ", +" % % % % % % % % %% %%%% % % ", +" % % % % % % % % % %%%%% %%%%% %%%%% %%%%% %%% %%% %%% %%% % % % % %%% %%% %%% %%% %%% % %% % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % %% % % % % % % % % % %%% % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % %%% % %%%% %%%% %%%% %%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%%% % % ", +"%%%%% %%%%% %%%%% %%%%% %%%%% %%%%% % % % % % % % % % % % % % % %% % % % % % % % % % % % % %% % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % %%% %%% %%%%% %%%%% %%%%% %%%%% %%% %%% %%% %%% %%%% % % %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% % % % %% ", +" % % ", +" % ", +" ", +" %% % % ", +" % % %% % % % % % % % % %% % % % % %% % % % % % % % %% % % % % % % %% % % % % % ", +" % % % % % % % % %% % % % % % % % % % % % % %% % % % % % % % % % % % % % % % % % % % % % ", +" % % % % ", +" %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %% %% %% %% %%% % %% %%% %%% %%% %%% %%% %%% % % % % % % % % % % % %% % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % %%%%% % %% % % % % % % % % % % %% % % % ", +" %%%% %%%% %%%% %%%% %%%% %%%% %%% % %%%%% %%%%% %%%%% %%%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % %% ", +"% %% % %% % %% % %% % %% % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % %% % %% % %% % %% %% % %% % %% % ", +" %% % %% % %% % %% % %% % %% % % % %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% % % %%% %%% %%% %%% %%% %%% %% % %% % %% % %% % % % %% % ", +" % % % % % % % ", +" % %%% % %%% ", +" % % ", +"%%%%% % % % %% % % % % % %% %%%%% % % % % % %% % % ", +" %%% % % % % % % % %% % % %% % % %% %%%% % %%% % % % % %%%%% %% % % % % %% %%% % % ", +" % %%%%% %%% % % % % % % %% % % % %%%%%%%% %%%%% %%% % % %% % % %%% ", +" % % % % % %%% %%% %%% %%% %%%% % % % % % %%%%% %%%%% % %%%%% %%% %%% ", +"% % %%% % % %%% % % %%% % % %%% % % %%% % % %%% % % %%% % % %%%% % % %%%% % %%% % %%% % %%% % %%% % %%% % % %%% % % %%% ", +"% % % % % % % % % % % % % % % % % % % % % % % % % %%% % % % %%%% % % % % % % % % %%%% % % % % % % % % % % % ", +"%%%%% %%%% % % %%%% %%%%% %%%% % % % % % % % % % % % % % % % % % %%%%% %%%% %%%%% %%%% %%%%% % %%%%% %%%% %%%%% % % % % % % ", +"% % % % %%%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % %% % % ", +"% % % %% % % % %% % % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%%% % % %%%% ", +"% % %% % % % %% % % % %% % %%% %%% %%% %%% %%% %%% %%% %%% %%%% %%%% %%%% %%%% %%%%% %%% %%%%% %%% %%%%% %%% %%%%% %%% %%%%% %%% %%% % %%% % ", +" % % % % % % % % ", +" % % % % %%% %%% ", +" % % % ", +" % % %% %% % % %%%%% % % % %% % % % % %% ", +" % % %%% % % % % % % % % % % % % %%% % % %%% % %% %%% % % %% % % % % % %% %% % ", +" % % % %% % % %%%% % % %%% %%%%% %%% % % % % % % % % % % % %% % % %% % ", +" %%% % % % % %%%%% % %%% % %%% % %%% % % %%% % % % % % % % % % % ", +"% % %%% % %%% % % % % % % %% % %% % %% % %% % %% % %% % % %% %% % %% % % % % % % % % % % % % % % ", +"% % % % % % % % % %% %%%%% %% % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % ", +"% % % % %% % % %%%%% %% % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % ", +"% %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%% % % % % % % % ", +"% % %%%% % % %%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" %%% % %%% % % % % % % % % % %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %% % %%% % %% % % % % % % % % %%%%% %%% %%%%% %%% %%%% %%% %%%%% ", +" % % % % % % % % % % % % % % % ", +" %%% % %%% % % %% %% % % % % ", +" ", +" % % % %% %%%%% % % % % % % % % %% ", +" %% % %% % % % % %% % % % % % %%% % % % % % % %%%% % % %%%% %% % % % % % % %% %%% ", +" % % % % %% % %% % %% % %%% %%%%% %%% % % % % % % % %% % % % % % ", +" % %% %% % % %% % % % %% % % % %%% %%% % % %%%% % % %%%% %%% %%% % ", +" % % % % %% % % %% % % % % %% %% % % %% % %% % % % % %% % % %%% % % %%% % % %%% % % % % % % % %% % % % %% % % % %% % % %%% % % %%% % %%% ", +" % % %% %% %% % %% % % % % %% % %% % %% % %% % % % % %% % % % % % % % % % % % % % % %% % % % % % %% % %%%% %% % % % %% % % % % % % % %%% % % ", +" % % % % % % % % % %% % % % % % % % % % % %% % % % % % % % % % % % % % % % % % %%% %%%% % % % % %%%% % %%% %% %%% %% % %% ", +" % % % % %% % % % %% % % % %% % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % %% % % % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" %%% %%%% %%% % % % % % % % % % % % % % % % % % % %%% %%% %%% %%% %%% %%% %%%% % % % % % % % % % % % %%% %%% %%% %%% %%% %%% ", +" % % % % % % % % % % ", +" % % % % % % % % ", +" % ", +" % % % % % % % % %%%%% % % % % % % % %% %% % % % % % % ", +" %% % % %%%%% %% %% %%%%% % % % % %%% % % % % % % % % % % % % % %% % % %% % % % % % % %% % % %% ", +" %% % % % % % % % % %%%%% %%% % % % % % % % % % % % %% % % ", +" %%% % % %%%%% % % % % % % % % % % % % % % % % % % % % % %%%%% %%%%% %%%%% % ", +"% % %%% % %%%% % %%%% %%% %%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%%%% % %%%%% % %%%%% % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% ", +" %%% %% % % % % % %%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % ", +"% % % % % % % % % % % % % % % % %% % % % %% % % % %% % % % %% % % % %% % % % %% %% %% % % % % %% % % % % % % % % % ", +" %%% %%% % %% % %% % %% %%% %% % %%% %% % %%% %% % %%% %% % %%% %% % %%% %% % % % % % % % % %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% % ", +" % % % % % % ", +" % % % % %%% "}; diff --git a/wmdocklib/6x12.xpm b/wmdocklib/6x12.xpm new file mode 100644 index 0000000..93d269a --- /dev/null +++ b/wmdocklib/6x12.xpm @@ -0,0 +1,44 @@ +/* XPM */ +static char *_x__[] = { +/* columns rows colors chars-per-pixel */ +"192 36 2 1", +" c black", +"% c gray100", +/* pixels */ +" % % ", +" % % % % % % % % % % % % % %%% %%%%% % %%%%% %%% %%%%% %%% %%% % % %%% ", +" % % % % % %%%% % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % %%% % % % % % % % % % %% % % % % % % % % % % % % % ", +" % %%%%% % % % % % % % % % % % % % % % % % % % % %% % % % % % % %%% %%% % %%%%% % % ", +" % % % %%% % % % % % %%%%% %%%%% % % % % % %%% % % %% % %%%% % %%% %%%% % % % % % ", +" % %%%%% % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % %% % % % % % % % % % %%%%% % % % % % % % % %%%%% % % ", +" % % %%%% % % % % % % % %% % % % % % % % % % % % % % % % % % % % %% % % ", +" % % % % %% % % % % %%% % % %%%%% %%%%% %%% % %%% %%% % %%% %%% %%% % % % % ", +" % % % % % % ", +" ", +" %%% %%% ", +" %%% % %%%% %%% %%%% %%%%% %%%%% %%% % % %%% %%% % % % % % % % %%% %%%% %%% %%%% %%% %%%%% % % % % % % % % % % %%%%% % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % %% %% %% % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % %%% % % % %%%% %%%% % %%%%% % % %% % % % % % % % % % %%%% % % %%%% %%% % % % % % % % % % % % % % % ", +"% % % %%%%% % % % % % % % % %% % % % % % % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % ", +"% %% % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" %%%% % % %%%% %%% %%%% %%%%% % %%% % % %%% %% % % %%%%% % % % % %%% % %%% % % %%% % %%% % % % % % % %%%%% % % % ", +" % %%% %%% %%%%% ", +" ", +" % %% %% ", +" % % % %% % % %% % % % % % % % % ", +" % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % ", +" %%% %%%% %%% %%%% %%% % %%% % %% %% %% % % % %% % % %% %%% %%%% %%%% % %% %%% %%%% % % % % % % % % % % %%%%% % % % ", +" % % % % % % % % % %%%% % % %% % % % % % % % % % %% % % % % % % % %% % % % % % % % % % % % % % % % %% % %% % % ", +" %%%% % % % % % %%%%% % % % % % % % %% % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % ", +" % %% % % % % % % % % % %%%% % % % % % % % % % % % % % % %%%% %%%% % % % % % % %% % % % % % % % %% % % % % % ", +" %% % %%%% %%% %%%% %%% % % % % %%% % % % % %%% % % % % %%% % % % %%% %% %% % % % % % % % %%%%% % % % % % % ", +" % % % % % % % % %% %% ", +" %%% %% % % %%% ", +}; diff --git a/wmdocklib/6x8-7seg.xpm b/wmdocklib/6x8-7seg.xpm new file mode 100644 index 0000000..41775ce --- /dev/null +++ b/wmdocklib/6x8-7seg.xpm @@ -0,0 +1,32 @@ +/* XPM */ +static char * wmtz_master_xpm[] = { +"192 24 4 1", +"$ c #FFFFFF", +"& c #9e9e9e", +". c #5b5b5b", +" c #000000", +" ... .$. ... ... &$$$& &$..& &$&. .&. .$$ $$. ... ... ... ... ... ...& $$$ ...& &$$$& &$$$& &...& &$$$& &$$$& &$$$& &$$$& &$$$& ... ... ... ... ... &$$$& ", +". . . $ . . $ $ . $ $ $ & . $& $ $ . . $ . .$ . . $. $ $ $ . $ . . . . . . . . $ $ $ . $ . $ . $ $ $ $ . $ . . $ $ $ $ $ . $ . $ . . . . . . $ $ ", +". . . $ . . $ $ . $ $ $ $ . . $. $ $ . . $ . $ . . $ & $ & . $ . . . . . . . . $ $ $ . $ . $ . $ $ $ $ . $ . . $ $ $ $ $ . & . & . . . . . . . $ ", +" ... .&. ... $$$& &$$$& .$. &$&$ ... &... ...& $$$ &$$$& ... &$$$& ... .$. &...& ...& &$$$& $$$& &$$$& &$$$& &$$$& ...& .$$$. &$$$& ... ... .$. &$$$& .$. .&$& ", +". . . $ . . . . $ $ . & $ .$ . $ $ . . . $ . . $ & $ & . $ . . $ . . . $ .$ . $ $ . $ $ . . $ . $ . $ $ $ . $ $ $ . $ . $ . $ .$ . . . . $. . $ . ", +". . . . . . . $ $ . $ $ $ &$ $ $ . . . .$ . . $. $ $ $ . $ . . & . . . & $ . $ $ . $ $ . . $ . $ . $ $ $ . $ $ $ . $ . & . & $ . . . . $ . . ", +" ... .$. ... $$$& &$$$& &...& &$$$& ... .$$ $$. ... ... ..$ ... ... &... $$$ ...$ &$$$& &$$$& ...& &$$$& &$$$& ...& &$$$& &$$$& ... ..$ &$$$& &$$$& &$$$& .$. ", +" ", +"&$$$& .$$$. &$$$ &$$$& &$$$ &$$$& &$$$& &$$$& &...& ...& ...& &...& &... $...$ &$$$ &$$$& &$$$& &$$$& &$$$& &$$$& &$$$& &...& &...& &...& &...& &...& &$$$& &$$$ &... $$$& &$$$& ... ", +"$ $ $ $ $ $ $ . $ $ $ . $ . $ . $ $ . $ . $ $ $ $ . $$ $$ $ $ $ $ $ $ $ $ $ $ $ . . $ . $ $ $ $ $ $ $ $ $ $ . $ $ . $ . . $ $ $ . . ", +"$ $ $ $ $ $ $ $ . $ $ $ . $ . $ . $ $ . $ . $ $ $. $ . $ $ $ $ $ $ $ $ $ $ $ $ $ $ . . $ . $ $ $ $ $ $ .$ $. $ $ . $. $ . .$ . . $ $ $ . . ", +"&.&$& &$$$& &$$$ &... &...& &$$$ &$$$ &.$$& &$$$& ...& ...& &$$. &... &...& &...& &...& &$$$& &$..& &$$$ &$$$& .&. &...& &...& &...& .$. &$$$& .$. &... .$. ...& &...& ... ", +"$ . $ $ $ $ $ . $ $ $ . $ . $ $ $ $ . $ . $ $ $. $ . $ $ $ $ $ $ $ . $ $ $ $ $ . $ . $ . $ $ $ $ $ $ $ .$ $. . $ .$ . $ . . $. . $ . . . . ", +"$ . $ $ $ $ $ . $ $ $ . $ . $ $ $ $ . $ . $ $ $ $ . $ $ $ $ $ $ $ . $ $$ $ $ . $ . $ . $ $ $ $ $$ $$ $ $ . $ $ . $ . . $ . $ . . . . ", +"&$$$& &...& $$$$ &$$$& $$$$ &$$$& $... &$$$& &...& ...$ &$$$& &...& &$$$. &...& $...$ &$$$& &... &$$$& &...& &$$$& .&. .$$$$ $$$ $...$ &...$&&$$$& &$$$& &$$$ ...& $$$& ... &$$$& ", +" ", +"&... .$$$. &$$$ &$$$& &$$$ &$$$& &$$$& &$$$& &...& ...& ...& &...& &... $...$ &$$$ &$$$& &$$$& &$$$& &$$$& &$$$& &$$$& &...& &...& &...& &...& &...& &$$$& .&$& .&. &$&. ... ... ", +".$ . $ $ $ $ $ . $ $ $ . $ . $ . $ $ . $ . $ $ $ $ . $$ $$ $ $ $ $ $ $ $ $ $ $ $ . . $ . $ $ $ $ $ $ $ $ $ $ . $ . $ . . $ . . $ . . . . . ", +". $ . $ $ $ $ $ . $ $ $ . $ . $ . $ $ . $ . $ $ $. $ . $ $ $ $ $ $ $ $ $ $ $ $ $ $ . . $ . $ $ $ $ $ $ .$ $. $ $ . $. . $ . . $ . . $ . .$ . . . ", +" ... &$$$& &$$$ &... &...& &$$$ &$$$ &.$$& &$$$& ...& ...& &$$. &... &...& &...& &...& &$$$& &$..& &$$$ &$$$& .&. &...& &...& &...& .$. &$$$& .$. &$.. .&. .&$& $.$.$ ... ", +". . $ $ $ $ $ . $ $ $ . $ . $ $ $ $ . $ . $ $ $. $ . $ $ $ $ $ $ $ . $ $ $ $ $ . $ . $ . $ $ $ $ $ $ $ .$ $. . $ .$ . . $ . . $ . . $ . . $. . . ", +". . $ $ $ $ $ . $ $ $ . $ . $ $ $ $ . $ . $ $ $ $ . $ $ $ $ $ $ $ . $ $$ $ $ . $ . $ . $ $ $ $ $$ $$ $ $ . $ $ . . $ . . $ . . $ . . . . . ", +" ... &...& $$$$ &$$$& $$$$ &$$$& $... &$$$& &...& ...$ &$$$& &...& &$$$. &...& $...$ &$$$& &... &$$$& &...& &$$$& .&. .$$$$ $$$ $...$ &...$&&$$$& &$$$& .&$& .&. &$&. ... ... ", +" ", +}; diff --git a/wmdocklib/6x8.xpm b/wmdocklib/6x8.xpm new file mode 100644 index 0000000..6990698 --- /dev/null +++ b/wmdocklib/6x8.xpm @@ -0,0 +1,93 @@ +/* XPM */ +static char * 6x8_xpm[] = { +"192 88 2 1", +" c #000000", +"+ c #FFFFFF", +" + + + + + + + + ++ + + + +++ + +++ +++ + +++++ +++ +++++ +++ +++ ++ ++ +++ ", +" + + + + + ++++ + + + + + + + + + + + + ++ + + + + ++ + + + + + + + + + + + + + ", +" + + + +++++ + + ++ + + + + + + + + ++ + + + + + ++++ + + + + + + + + + +++++ + + ", +" + + + +++ + + + + +++++ +++++ +++++ + + + + + ++ ++ + + + ++++ + +++ ++++ + + + ", +" +++++ + + + + + + + + + + + ++ + + + + +++++ + + + + + + + + +++++ + + ", +" + + ++++ + + + + + + + + + + ++ + + + + + + + + + + + + + + + + + + + + + ", +" + + + + + + ++ + + + + ++ + +++ +++ +++++ +++ + +++ +++ + +++ +++ + ++ ++ + ", +" + + ", +" +++ + ++++ +++ +++ +++++ +++++ +++ + + +++ +++ + + + + + + + +++ ++++ +++ ++++ +++ +++++ + + + + + + + + + + +++++ +++ +++ + ", +"+ + + + + + + + + + + + + + + + + + + + + ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + ", +"+ +++ + + + + + + + + + + + + + + + + + + + + ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + ", +"+ + + +++++ ++++ + + + ++++ +++ + ++ +++++ + + ++ + + + + + + + + ++++ + + ++++ +++ + + + + + + + + + + + + + + ", +"+ +++ + + + + + + + + + + + + + + + + + + + + + ++ + + + + + + + + + + + + + + + + + + + + + + + ", +"+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +++ + + + + + + + + + ++ ++ + + + + + + + ", +" +++ + + ++++ +++ +++ +++++ + +++ + + +++ ++ + + +++++ + + + + +++ + ++ + + +++ + +++ + + + + + + +++++ +++ + +++ ", +" +++++ ", +"+ + + ++ + + + ++ +++ + +++ ", +" + + + + + + + + + + + ", +" + +++ + ++++ + +++ + ++++ + ++ ++ + + ++ + ++++ +++ ++++ ++++ ++++ ++++ +++++ + + + + + + + + + + +++++ + + + ", +" + ++++ + ++++ + + ++++ + + ++++ + + + ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ++ + ", +" ++++ + + + + + +++++ + + + + + + + ++ + + + + + + + + + + + + + +++ + + + + + + + + + + + + + + + + ++ ", +" + + + + + + + + + ++++ + + + + + + + + + + + + + + ++++ ++++ + + + + + + + + + + + + ++++ + + + + ", +" ++++ ++++ ++++ ++++ +++ + + + + +++ + + ++ +++ + + + + + +++ + + + ++++ ++ ++++ + + + + + + +++++ +++ + +++ ", +" ++++ +++ + + +++ ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" + + + + + + + + + + + + + + +++ + + ++ +++++ ++ ++ +++ + + + + + + + + + + + ++ + + +++ + ", +" + + + + + + + + + + + + ++ + + + + + ", +" + + + + + + + + + + ++ +++ + + + + +++ + + + + + + + + + + + + + + + + + + + + + ", +" + + + + + + + + + + +++++ +++++ + +++ ++ +++++ +++ ++ ++ +++ ++ + + + ++ ++ + + ", +" + + + + + + + + + + ++ ++ + + + + + +++ + + + + + ++ + + + + + + + + ", +" + + + + + + + +++++ + + + + + + +++++ + + +++ + +++ + + ", +" + + + + + + + + + + + + + + +++ +++ + + +++ +++++ + + + + + + + + + + + + +++ + +++ ", +" ", +" + + + + + + +++ +++ +++++ +++++ +++++ +++++ +++ +++ +++ +++ +++ + + +++ +++ +++ +++ +++ +++ ++ + + ++ + + + + + + ++ + +++ ", +" + + + + + + + + + + + + ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ++ ++ + + + + + + ++++ + + ", +"+ + + + + + + + + + + + + + + + + + + + + + + + + ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ++ ", +"+++++ +++++ +++++ +++++ +++++ +++++ +++++ + ++++ ++++ ++++ ++++ + + + + ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ", +"+ + + + + + + + + + + + + + + + + + + + + + + + + + + ++ + + + + + + + + + + + + + + + + + + + + + + + + ++++ + + ", +"+ + + + + + + + + + + + + + +++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ++ ", +"+ + + + + + + + + + + + + +++ + +++++ +++++ +++++ +++++ +++ +++ +++ +++ +++ + + +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ + + + ", +" + ", +" + + + + + + + +++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ", +" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ", +" +++ +++ +++ +++ +++ +++ ++ + ++++ +++ +++ +++ +++ ++ ++ ++ ++ + + ++++ +++ +++ +++ +++ +++ +++ + + + + + + + + + + + ++ + + ", +" + + + + + + + + + + + + + + + + + + + + + +++ + + + + + + + + + + + + +++++ + ++ + + + + + + + + + + ++ + + + ", +" ++++ ++++ ++++ ++++ ++++ ++++ ++++ + +++++ +++++ +++++ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ", +"+ + + + + + + + + + + + + + ++++ + + + + + + + + + + + + + + + + + + + + + + + ++ + + + + + + + + + ++++ ++ + ++++ ", +" ++++ ++++ ++++ ++++ ++++ ++++ +++++ + +++ +++ +++ +++ +++ +++ +++ +++ +++ + + +++ +++ +++ +++ +++ +++ ++++ ++++ ++++ ++++ + + ++ + ", +" + + +++ + +++ ", +" + +++ + + + + +++ + +++ + +++ + +++ + + +++ + ++ +++ + +++++ +++ +++++ + + +++++ + +++++ +++++ + + +++ + +++ + + ", +" + + + + ++ + + + + + + + + + + + + + + + + + + + + +++ + + ++ + + + + + + + + + + ++ ", +"+ + +++ + + +++ + + +++ + ++++ + ++++ + ++++ + ++++ + + + + + + + +++ + +++ + +++ + +++ + +++ + ++++ + ++++ ", +"+++++ + +++++ + +++++ + + + + + + + + + + + ++++ ++ + ++++ ++++ + + ++++ + + ++++ + + ++++ + + ++++ + + + ++ + + + ++ + + ", +"+ + ++++ + + ++++ + + ++++ + + + + + + + + + + + + + + + + + +++++ + +++++ + +++++ + +++++ + +++++ + + + + + + + + ", +"+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ++++ + + ++++ ", +"+ + ++++ + + ++++ + + ++++ +++ ++++ +++ ++++ +++ ++++ +++ ++++ +++ ++++ +++ ++++ +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++ + +++ + ", +" ++ ++ ++++ ++++ ", +" +++ + +++ + + + + + + + + + +++ + + +++ ++++ +++ + + +++ + + + + + + + + + + + + + + + + + + + ++ + ++ ++ + ++ + ", +"+ + + + + ++ ++ ++ + +++++ +++ + + + + + ++ + +++ + + + + + + + + + + ", +"+ ++++ + ++++ + + + + + + + ++ + ++ + ++ + ++ + ++ + + + + + + + + + + + + + + + + + + + + + + ", +"+ ++ + + + ++ + + +++++ ++++ +++++ ++++ + + + + + + + + + + + + + + + + + + + + + + + ", +"+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ++ + + + + + + + ", +"+ + ++++ + + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ", +" +++ + +++ + + + + + + + + + +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ + + + + + + + + + + + + + + + +++++ +++ +++++ +++ +++++ +++ +++++ ", +" ++++ + ++++ ++ ++ +++ + + ", +" ++ + ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ++++ + + + + + + + + + + + + + + + + + + +++ + +++ + +++ ", +" + + + + + + + + + + + + + + + + + + + + + + + + ", +" + + + ++ ++ + ++++ ++ + ++++ ++ + ++++ ++++ ++ + ++++ + + + + + + + + + + + + + + +++ + + + + + + + + + + + + + ++++ + ++++ + ++++ ", +" + + ++ ++ + + + + + + + + + + + + + + + + + + + + + + + +++ + + + +++ + +++ + +++ + ", +" + + + + ++ + + + ++ + + + ++ + + + + + ++ + + + + + + + + + + + + + + + + + +++ + + + + + + + + + + + + + +++ + +++ + +++ ", +" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ", +" +++ +++++ +++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ++++ ++++ + + + + + + + + + + + + + + + + + + +++ ++++ +++ ++++ +++ ++++ ", +" + + ++ ++ + + ", +" +++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +++++ + +++++ + +++++ + + + + + ", +"+ + + + + + + + ", +"+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +++++ + +++++ + +++++ + + ", +" +++ + + + + + + + ", +" + +++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ", +"+ + + + + + + + + ", +" +++ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +++++ +++++ +++++ +++++ +++++ +++++ + + + ", +" "}; diff --git a/wmdocklib/6x8orig.xpm b/wmdocklib/6x8orig.xpm new file mode 100644 index 0000000..f143f6a --- /dev/null +++ b/wmdocklib/6x8orig.xpm @@ -0,0 +1,33 @@ +/* XPM */ +static char *square_[] = { +/* columns rows colors chars-per-pixel */ +"192 24 2 1", +" c black", +"% c gray100", +/* pixels */ +" % % % % % % % % %%%%% % %%%%% %%%%% % % %%%%% %%%%% %%%%% %%%%% %%%%% ", +" % % % % % % % % % %% % % % % % % % % % % % %% %% ", +" % % % %%%%% %% %% % % % % % % % % % % % % % % %% %% %%%%% ", +" % % % % %%%%% % % % % %%%%% %%%% %%%%% %%%%% %%%%% % %%%%% %%%%% ", +" %%%%% %% %% %% % % % % % % % % % % % % % %% %%%%% ", +" % % % %% %% % % % % % % % % % % % % % % %% %% ", +" % % % % % % %% % %%%%% %%% %%%%% %%%%% % %%%%% %%%%% % %%%%% %%%%% %% % ", +" % % ", +" %%% %%%% %%%% %%%% %%%% %%%%% %%%%% % % % % % % % % % %%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% % % % % % % % % % % %%%%% %%% % %%% % ", +" % % % % % % % % % % % % % % % % % %% %% % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % %%% ", +" %%%%% %%%% % % % %%%% %%%% % %%% %%%%% % % %%% % % % % % % % %%%%% %% % %%%% %%%%% % % % % % % % % %%%%% % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % %% %% % % % % % % % ", +" % % %%%% %%%% %%%% %%%% % %%%%% % % % %%% % % %%%% % % % % %%%%% % %%%%% % % %%%%% % %%%% %%% % % % % %%%%% %%%%% %%% % %%% ", +" %%%%%%", +" %%% %%%% %%%% %%%% %%%% %%%%% %%%%% % % % % % % % % % %%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% % % % % % % % % % % %%%%% %% % %% ", +" % % % % % % % % % % % % % % % % % %% %% % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" %%%%% %%%% % % % %%%% %%%% % %%% %%%%% % % %%% % % % % % % % %%%%% %% % %%%% %%%%% % % % % % % % % %%%%% % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % %% %% % % % % % % % ", +" % % %%%% %%%% %%%% %%%% % %%%%% % % % %%% % % %%%% % % % % %%%%% % %%%%% % % %%%%% % %%%% %%% % % % % %%%%% %%%%% %% % %% ", +" ", + +}; diff --git a/wmdocklib/6x8slant.xpm b/wmdocklib/6x8slant.xpm new file mode 100644 index 0000000..f93c944 --- /dev/null +++ b/wmdocklib/6x8slant.xpm @@ -0,0 +1,34 @@ +/* XPM */ +static char *square_[] = { +/* columns rows colors chars-per-pixel */ +"192 24 2 1", +" c black", +"% c gray100", +/* pixels */ +" % % % % %% % % % % % % %%%%% % %%%%% %%%%% % % %%%%% %%%%% %%%%% %%%%% %%%%% %% %% %%% ", +" % % % % % %%%%% %% %%% % % % % % % % % % % % %% % % % % % % % % % % % % % % % % % % % ", +" % % % %%%%% % %% % % % % % %%% % % % %% % % % % % %%%%% % % % % % % % % % %%%%% % % ", +" % % % %%%%% %% % % % % %%%%% %%%%% % % % % % % %%% % % % %%%%% %%% %%%%% %%%%% % % % ", +" %%%%% % %% % % % % % %%% % % %% % % % % %%%%% % % % % % % % % %%%%% % % ", +" % % %%%%% %% %%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % %% %% % % % % % % %%%%% %%% %%%%% %%%%% % %%%%% %%%%% % %%%%% %%%%% % %% %% % ", +" % % ", +"%%%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% % % %%% %%% % % % %%%% %%%% %%%% %%%% %%%% %%%% %%%%% %%%%% % % % % % % % % % % %%%%% %%%% %%%% ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%%%% % % % % % % % % ", +"% %%% % % %%%%% % % % %%%%% %%%%% % %% %%%%% % % %%%% % % % % % % % % %%%%% % % %%%% %%%%% % % % % % % % % % %%%%% % % % % % % ", +"% % %%%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%%%% % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% %% % % % % % % % ", +"%%%%% % % %%%%% %%%%% %%%%% %%%%% % %%%%% % % %%% %%%% % % %%%%% % % % % %%%%% % %%% % % % %%%%% % %%%%% %% % % % % % %%%%% %%%% %%%% %%%%%%", +" ", +" % % % %% % % %% % %%% % %% %%%%%% ", +" % % % % % % % % % % % % % % % % ", +" % %% % % %% % % % % % %% % %%%% % % % % % % % ", +" % % %%% % % % % %%% % % % % %%%% %%%% %%% %%%% %%%% %%%% % %%% % % %% % % % % %% % %% % % % % % ", +" %%%% %%%% % %%%% %%%% %%%% % %% %%%% %% %% %%% % % % % % % % % % % % % % %%% % % % % % % % % % % % %% %% % % % % % % % ", +" % % % % % % % % % % %% % % % % % % % % % % % % % % % %%%%% %%%% % % % % % % % %% %% % % %% % % % % % % % % ", +" %%%%% %%%%% %%%%% %%%%% %%%% % % % % %% % % % %% % % % % % %%%% % % % %%% %% %%%% % % % % % % %%%%% %% % %%% %%%%%% ", +" %% %%%% % % %%%% % ", + + +}; diff --git a/wmdocklib/7x12-41c.xpm b/wmdocklib/7x12-41c.xpm new file mode 100644 index 0000000..223821d --- /dev/null +++ b/wmdocklib/7x12-41c.xpm @@ -0,0 +1,83 @@ +/* XPM */ +static char *_test[] = { + "106 72 7 1", + " c black", + ". c grey5", + ": c grey20", + "- c grey35", + "o c grey65", + "= c grey80", + "x c grey100", + " .... .-.. .-..- .-..- oxxxx- -.... -xxxx- .... .... .... .... .... .... .... .... .... ", + ". . .. . x .. . x .x . x .x x x .. x . x. =:. x. . x .. . . x. x . .. =:x x. . x .. . . .. . . .. . . .. . . x. ", + "... .. ..x .. ..x .x ..x .x x.x .. xx. x. -o. x. . x .. . .-o. -o. .. -ox-o. . x .. . . .. . . .. . . .. . .-o. ", + ".... . ..x. . ..x. x ..x. x x.x. . xx.x . .x.x . ..x. . ...o-. .x.. . .=xo-. ..x. . .... . .... . .... . ...o-. ", + ". .. . . x. . . x. x . x. x x x. . xoox . .o-x . ..x. . ...x . .o-. . .ox= . ..x. . .... . .... . .... . ...x . ", + " .... .o.. .-..- -xoxxo oxoxxo oxoxxo .o.. .-.. .-.. .-.. -xoxx- -x-xx- .... -x-xx- .... .... ", + ".... . ..x. . .... . ..x. x ..x. x .-ox x .oox x .... . ...x . .o-. . .ox= . ..x. . .... . .... . .... . .o-. . ", + ".... . ..x. . .... . ..x. x ..x. x .o-o-x .x.o-x .... . ...o-. .x.. . .=xo-. ..x. . .... . .... . .... . .x.. . ", + ". . .. . x .. . . .. . x .x . x .x -o.-ox -o.-ox . . .. . .-o. -o. .. -ox-o. . x .. . : .. . . .. . : .. -o. .. ", + ". . .. . x .. . . .. . x .x . x .x x . ox x . ox . . .. . . x. x . .. =:x x. . x .. .:x:.. . . .. .:x:.. =:. .. ", + " .... .-.. .... -xxxxo -xxxxo ....- -xxxxo .... .... .... .... .... o=.. .... .:.. .... ", + " ", + "-xxxx- ....- -xxxx- -xxxx- -....- -xxxx- -xxxx- -xxxx- -xxxx- -xxxx- .:.. .:.. .... .... .... -xxxx- ", + "x . ox . . .x . . .x . . .x x . .x =:. .. x . .. . . .x x . .x x . .x .:x:.. .:x:.. . . x. . . .. =:. .. x . .x ", + "x..-ox ... .x ... .x ... .x x.. .x -o. .. x.. .. ... .x x.. .x x.. .x ..: .. ..: .. ...-o. ... .. -o. .. x.. .x ", + "x..o-x .... x .... x .... x x... x .x.. . x... . .... x x... x x... x .... . .... . ...o-. .... . .x.. . x... x ", + "x .x x . .. x . .. x . .. x x .. x .o-. . x .. . . .. x x .. x x .. x . .. . . .. . . .x . . .. . .o-. . x .. x ", + "o.-..o ....o ox-xxo x-xxo ox-xxo .-xxo ox-xxo ....o ox-xxo ox-xxo .... .... .-.. -x-xx- .-.. .-xx- ", + "xo-. x .... x x... . .... x .... x .... x x... x .... x x... x .... x .... . .... . .o-. . .... . ...x . ..x. . ", + "xx.. x .... x x... . .... x .... x .... x x... x .... x x... x .... x .... . .... . .x.. . .... . ...o-. ..x. . ", + "xo. .x . . .x x . .. . . .x . . .x . . .x x . .x . . .x x . .x . . .x . : .. . : .. -o. .. . . .. . .-o. . x .. ", + "x . .x . . .x x . .. . . .x . . .x . . .x x . .x . . .x x . .x . . .x .:x:.. .:x:.. x . .. . . .. . . x. . x .. ", + "-xxxx- ....- -xxxx- -xxxx- ....- -xxxx- -xxxx- ....- -xxxx- -xxxx- .:.. o=.. -xxxx- -xxxx- -xxxx- .... ", + " ", + "-xxxx- -xxxx- -xxxx- -xxxx- -xxxx- -xxxx- -xxxx- -xxxx- -....- -xxxx- ....- -.... -.... -....- -....- -xxxx- ", + "x x .x x . .x . x .x x . .. . x .x x . .. x . .. x . .. x . .x . x .. . . .x x . x. x . .. x . ox x . .x x . .x ", + "x.x .x x.. .x ..x .x x.. .. ..x .x x.. .. x.. .. x.. .. x.. .x ..x .. ... .x x..-o. x.. .. xo.-ox xo. .x x.. .x ", + "x.x. x x... x ..x. x x... . ..x. x x... . x... . x... . x... x ..x. . .... x x..o-. x... . xx.o-x xx.. x x... x ", + "x x. x x .. x . x. x x .. . . x. x x .. . x .. . x .. . x .. x . x. . . .. x x .x . x .. . xoox x xo-. x x .. x ", + "o.-xxo ox-xxo .-xxo o.... .-..o ox-xx- ox-xx- o..xxo ox-xxo .-.. ....o oxo.. o.... o....o o.-..o o....o ", + "x... . x... x ..x. x x... . ..x. x x... . x... . x... x x... x ..x. . x... x x..x . x... . x... x x..x x x... x ", + "x... . x... x ..x. x x... . ..x. x x... . x... . x... x x... x ..x. . x... x x..o-. x... . x... x x..o-x x... x ", + "x . .. x . .x . x .x x . .. . x .x x . .. x . .. x . .x x . .x . x .. x . .x x .-o. x . .. x . .x x .-ox x . .x ", + "x . .. x . .x . x .x x . .. . x .x x . .. x . .. x . .x x . .x . x .. x . .x x . x. x . .. x . .x x . ox x . .x ", + "-xxxx- -....- -xxxx- -xxxx- -xxxx- -xxxx- -.... -xxxx- -....- -xxxx- -xxxx- -.... -xxxx- -....- -....- -xxxx- ", + " ", + "-xxxx- -xxxx- -xxxx- -xxxx- -xxxx- -....- -.... -....- .... .... -xxxx- -xxxx- .... -xxxx- -xxxx- .... ", + "x . .x x . .x x . .x x . .. . x .. x . .x x . x. x . .x =:. x. =:. x. . . x. x . .. =:. .. . . .x . . ox . . .. ", + "x.. .x x.. .x x.. .x x.. .. ..x .. x.. .x x.. x. x.. .x -o.-o. -o.-o. ...-o. x.. .. -o. .. ... .x ...-ox ... .. ", + "x... x x... x x... x x... . ..x. . x... x x..x . x... x .x.o-. .x.o-. ...o-. x... . .x.. . .... x ...o-x .... . ", + "x .. x x .. x x .. x x .. . . x. . x .. x x .x . x .. x .o-x . .o-x . . .x . x .. . .o-. . . .. x . .x x . .. . ", + "ox-xxo o....o ox-xxo ox-xxo .-.. o....o o.-.. o....o .o.. .o.. .-.. o.... .-.. ....o .-..- .... ", + "x... . x..x x x..x . .... x ..x. . x... x xx.. . xx.x x .o-x . ..x. . .o-. . x... . ...x . .... x .o-. . .... . ", + "x... . x..o-x x..o-. .... x ..x. . x... x xx.. . xx.o-x .x.o-. ..x. . .x.. . x... . ...o-. .... x .x.. . .... . ", + "x . .. x .-ox x .-o. . . .x . x .. x . .x xo. .. xo.-ox -o.-o. . x .. -o. .. x . .. . .-o. . . .x -o. .. . . .. ", + "x . .. x . ox x . x. . . .x . x .. x . .x x . .. x . ox =:. x. . x .. x . .. x . .. . . x. . . .x =:. .. . . .. ", + "-.... -xxxx- -.... -xxxx- .... -xxxx- -.... -....- .... .... -xxxx- -xxxx- .... -xxxx- .... -xxxx- ", + " ", + " .... -xxxx- -xxxx- -xxxx- -xxxx- -xxxx- -xxxx- -xxxx- -....- -xxxx- ....- -.... -.... -....- -....- -xxxx- ", + "=:. .. x . .x . x .x x . .. . x .x x . .. x . .. x . .. x . .x . x .. . . .x x . x. x . .. x . ox x . .x x . .x ", + "-o. .. x.. .x ..x .x x.. .. ..x .x x.. .. x.. .. x.. .. x.. .x ..x .. ... .x x.. x. x.. .. xo. xx xo. .x x.. .x ", + ".x.. . x... x ..x. x x... . ..x. x x... . x... . x... . x... x ..x. . .... x x..x . x... . xx.x x xx.. x x... x ", + ".o-. . x .. x . x. x x .. . . x. x x .. . x .. . x .. . x .. x . x. . . .. x x .x . x .. . xoox x xo-. x x .. x ", + " .... ox-xxo .-xxo o.... .-..o ox-xx- ox-xx- o..xxo ox-xxo .-.. ....o oxo.. o.... o....o o.-..o o....o ", + ".... . x... x ..x. x x... . ..x. x x... . x... . x... x x... x ..x. . x... x x..x . x... . x... x x..x x x... x ", + ".... . x... x ..x. x x... . ..x. x x... . x... . x... x x... x ..x. . x... x x..x . x... . x... x x..x x x... x ", + ". . .. x . .x . x .x x . .. . x .x x . .. x . .. x . .x x . .x . x .. x . .x x . x. x . .. x . .x x . xx x . .x ", + ". . .. x . .x . x .x x . .. . x .x x . .. x . .. x . .x x . .x . x .. x . .x x . x. x . .. x . .x x . ox x . .x ", + " .... -....- -xxxx- -xxxx- -xxxx- -xxxx- -.... -xxxx- -....- -xxxx- -xxxx- -.... -xxxx- -....- -....- -xxxx- ", + " ", + "-xxxx- -xxxx- -xxxx- -xxxx- -xxxx- -....- -.... -....- .... .... -xxxx- .... .... .... o.... -xxxx- ", + "x . .x x . .x x . .x x . .. . x .. x . .x x . x. x . .x =:. x. =:. x. . . x. . x .. . x .. . x .. x . x. x:x ox ", + "x.. .x x.. .x x.. .x x.. .. ..x .. x.. .x x..-o. x.. .x -o.-o. -o.-o. ...-o. . x .. . x .. . x .. x-.-o. xox-ox ", + "x... x x... x x... x x... . ..x. . x... x x..o-. x... x .x.o-. .x.o-. ...o-. ..x. . ..x. . ..x. . xx.o-. xxxo-x ", + "x .. x x .. x x .. x x .. . . x. . x .. x x .x . x .. x .o-x . .o-x . . .x . ..x. . ..x. . ..x. . xo-x . x-xo x ", + "ox-xxo o....o ox-xxo ox-xxo .-.. o....o o.-.. o....o .o.. .o.. .-.. -x-.. .-.. .-xx- -.... oxoxxo ", + "x... . x..x x x..x . .... x ..x. . x... x xo-. . xx.x x .o-x . ..x. . .o-. . ..x. . ..x. . ..x. . .... . x-xo x ", + "x... . x..o-x x..o-. .... x ..x. . x... x xx.. . xx.o-x .x.o-. ..x. . .x.. . ..x. . ..x. . ..x. . .... . xxxo-x ", + "x . .. x .-ox x .-o. . . .x . x .. x . .x x:. .. x .-ox -o.-o. . x .. -o. .. . x .. . x .. . x .. . . .. xox-ox ", + "x . .. x . ox x . x. . . .x . x .. x . .x x . .. x . ox =:. x. . x .. x . .. . x .. . x .. . x .. . . .. x:x ox ", + "-.... -xxxx- -.... -xxxx- .... -xxxx- -.... -....- .... .... -xxxx- .... .... .... .... -xxxx- ", + " ", +}; diff --git a/wmdocklib/7x14-utf-8.xpm b/wmdocklib/7x14-utf-8.xpm new file mode 100644 index 0000000..1272079 --- /dev/null +++ b/wmdocklib/7x14-utf-8.xpm @@ -0,0 +1,159 @@ +/* XPM */ +static char * 7x14_xpm[] = { +"224 154 2 1", +" c black", +"% c gray100", +" % % % % % % ", +" % % % % % % %% % %% % % % % %% % %%%% %%%%%% % %%%%%% %%% %%%%%% %%%% %%%% %%%% ", +" % % % % % %%%% % % % % % % % % % % % %% % % % %% % % % % % % % % % % % ", +" % % % % % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % %%%%% % % % %%% % % % % % % % % % % % % % % % % %%%%% % % % % % % %%% %% % %%%%%% % % ", +" % % % % % % %% % % %%% % % % % % % %%% % % % % % %%% % %% % %% % %% % % % ", +" % % % %%% % %% % % % % %%%%% %%%%% % % % % % % % % % %% % % % % %%% % % % % ", +" % %%%%% % % %%% % % % % % %%% % % % % % % % % % % % % % % % % % %%%%%% % % ", +" % % % % % %% % % % % % % % % % % % % % % % % %%%%%% % % % % % % % % % % %% % % ", +" % % % % % % % % % % %% % % % % %% % % % % % % % % % % % % % % % % % % %%% % % % % ", +" % % % %%%% % %% %% % % % % %%% % %% %%%%% %%%%%% %%%% % %%%% %%%% % %%%% %%% % % % % % ", +" % % % % % % % ", +" % % % % ", +" ", +" %%%% % %%%% %% ", +" %%% %% %%%% %%%% %%%% %%%%%% %%%%%% %%%% % % %%%%% %%% % % % % % % % %%%% %%%%% %%%% %%%%% %%%% %%%%%%%% % % % % % % % % % %%%%%% % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % %% %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% %%% % % % % % % % % % % % % % % % % % % % %% %% %% % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % %% % %% % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % %%%% % % % %%%% %%%% % %%%%%% % % %% % % %% % % % % % % % % % % % % %% % % % % % % % %% % % % % % % ", +"% % % %%%%%% % % % % % % % % %%% % % % % % % % % % % % % % % %%%%% % % %%%%% %% % % % % % % % %% % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % %% % % % %%% % % % % % % % % % % % % % % % % % % % ", +"% %%% % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % %% % % % % % % % % % % ", +" % % % % % % % % % % % % %% % % % % % % % % % % % % % % % % %% % % % % % % % %% % % % % % % % % % % ", +" %%%% % % %%%% %%%% %%%% %%%%%% % %%% % % % %%%%% %%% % % %%%%%% % % % % %%%% % %%%% % % %%%% % %%%% %% % % % % % %%%%%% % % % ", +" % % % % ", +" % %%%% % %%%% %%%%%% ", +" ", +" % %% % %% % ", +" % % % %% % % % % %% % % % % % % % ", +" % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % ", +" %%%% % %%% %%%% %%% % %%%% % %%% % % %%% %% %% % % % %% % % %%% %%%% % %%% %%% % % %%% %%%% %%%%% % % % % % % % % % % %%%%%% % % % ", +" % % %% % % % % %% % % %%%%% % % %% % % % % % % % % % %% % % % %% % % %% %% % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" %%%%% % % % % % %%%%%% % % % % % % % %%% % % % % % % % % % % % % % %% % % % % % % % % %% % % % % % % ", +" % % % % % % % % % %%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % ", +" % % %% % % % % %% % % % % % % % % % % % % % % % % % % %% % % %% % % % % % % %% % % % % % % %%% % % % % % ", +" %%%%% % %%% %%%% %%% % %%%% % % %%% % % %%%%% % % % % %%%%% % % % % %%%% % %%% %%% % % %%%% %% %%% % % % % % % % %%%%%% % % % ", +" % % % % % % % % % % % ", +" %%%% %%% % % %%%% %% % %% ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" %%%% % % %%%% %%% %%%% %% %% %% % % ", +" % % % % % % % % % % % % % % %%%%% % % % % % % % %%%% %% %% % % %% % ", +" % %% % % % % % %% % %%%% %%%% % % % % % % % % % % % % %% % %% % % % % ", +" % % % % % % % % %% %% %% % % %% %% %% % %% % % % % % % % % % % % % % ", +" % %%%% % %%%% % % % % %% % % %% % % %% %% % % % % % % %% % % % % % % %% ", +" % % % % % % % %%%%% % % %% % %% % % % %%%% % % % % % % % % % % % % % % % % % % %% % % ", +" % % % %%%% % % % % % %% % % % %%%% %% %% % %%%% %% % % %% % %%% %%%% % % % % % % % % % ", +" % % % % %%%% %%%%% % %% %% %% %%%%% % % %%%%% %% %% %%%%% % % % % % % % %% %% % % %% % ", +" % % % % % % % % % % %% % % % % %% %% % % % % % % % % % % % % % % % % ", +" % % % % %%%% % % % % % % % % % % % % %% %% % % % % % %%% % % % %%% % ", +" % %%%% % % % % %%%% %%%% % % % %%%% %%%%% % % % % % % % % % % % %%% % % % ", +" % % % % % % % ", +" % %%% % %%%% ", +" % % %% %% % % % %% % % % %% % % % %% %% % % % % %% % ", +" % % % % % %% % % %% % % % % % % % % % % % % % %% % % % % % %% % % % % % % % % % % ", +" % % %%%% %%%% %%%% %%%% % %% ", +" %% %% %% %% %% %% % % % % %%%%%% %%%%%% %%%%%% %%%%%% %%%%% %%%%% %%%%% %%%%% % % %% % %%%% %%%% %%%% %%%% %%%% % %% % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % %%% % % % % % % % % % % % % % % % % % % % % % % % % %%%%% % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % %%%%%% % % % % % % % % % %%%% %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%% ", +"%%%%%% %%%%%% %%%%%% %%%%%% %%%%%% %%%%%% % % % %%%%% %%%%% %%%%% %%%%% % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % %%%%% % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % %% % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % %%% %%%% %%%%%% %%%%%% %%%%%% %%%%%% %%%%% %%%%% %%%%% %%%%% %%%% % %% %%%% %%%% %%%% %%%% %%%% % % %%%% %%%% %%%% %%%% %%%% % % %%%%% ", +" % % ", +" % % ", +" ", +" %% % % ", +" % % %% %% % % % % % %% % % %% % %% % % % %% %% % % % %% % % ", +" % % % % % %% % % %% % % % % % % % % % % % % % % % %% % % % % % %% % % % % % % % % % % % % % ", +" % % % ", +" %%%% %%%% %%%% %%%% %%%% %%%% %%%%% %%%% %%%% %%%% %%%% %%%% %% %% %% %% %%%% % %%% %%%% %%%% %%%% %%%% %%%% %%%% % % % % % % % % % % % %%% % % ", +"% % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % % %% % % % ", +" %%% %%% %%% %%% %%% %%% %% %% % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % % % ", +" %% % %% % %% % %% % %% % %% % % %%%%% %%%%%% %%%%%% %%%%%% %%%%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%%%%% % % % % % % % % % % % % % % % % % ", +"% %% % %% % %% % %% % %% % %% % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % %% % %% % %% % %% %%% %% % %%% ", +" %%% % %%% % %%% % %%% % %%% % %%% % %%%%% %%%% %%%% %%%% %%%% %%%% %%%%% %%%%% %%%%% %%%%% %%% % % %%%% %%%% %%%% %%%% %%%% %% %%%% %%% % %%% % %%% % %%% % % % %%% % ", +" % % % % % % % ", +" % % %% % %% ", +" % % % %% % % % % % % % % %% % % ", +" %%%% %%%% % % % %% %% %% % % %%%% %%%% %% %% % % %%% ", +" % % %% % %% % % %% %%%% % % % %%%%%% % % %% % % ", +" %% %%%% %% %%%% % % %%%% % %%%% % % %%%% %% %%%% %% %%%% % % % %%%%%%%%%%% %%%% %%%%%% %%%% %%%%%% %% % %%%%%% %% %%%% % % %%%% %%% ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % %%%% % % %%%% % % %%%% % % %%%% % % %%%% % % %%%% % % %%%% % % %%% % % % %%% % % %%%% % %%%% % %%%% % %%%% % %%%% % %%% % % %%% % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % %% %%% %% %% % % % % % % % % % %%%% % % % % % % % % % % % ", +"% % %%% % % %%% %%%%%% %%% % % % % % % % % % % % % % %% % %%%% % % %%%% % % %%%% % % % % % %%%% % % % %%% % % % %%% % % ", +"%%%%%% %% % %%%%%% %% % % % %% % % % % % % % % % % % % % % %% % % %%%%%% % %%%%%% % %%%%%% % %%%%%% % %%%%%% % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % %%% % % %%% ", +"% % % %% % % % %% % % % %% % % % % % % % % % % % % % % % % % % % %% % % % %% % % % % % % % % % % % % % % % % %% % % %% % ", +"% % %%% % % % %%% % % % %%% % %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%% % %%%% %%% % %%%%%% %%%% %%%%%% %%%% %%%%%% %%%% %%%%%% %%%% %%%%%% %%%% %%% % % %%% %%% % % %%% ", +" % % % % % % % % ", +" %% %% % % %%%% %%%% ", +" %% %% %% % % % % %% % % % % ", +" %% % % % % % % %% %%%%% %%% % % % %% % % % % %% ", +" % % % % % %% % % % %%%%% % % %%%% % % % % % % %% % % ", +" %%%% % %%%% %% % % % % % %%%%% %%%%% % %% %%%%% %%%%% %%%%% %%% % % %%%%% % % % % %%% % % % % %% % % %% % ", +"% % % % % % % %%%%%%% % % % % % % % % % %% % % % % % % % % % % ", +"% %%% % % %%% % % % % % % % %%% % %% % %% % %% % %% % %% % % % %% % % % % % % % % % % % % % % % ", +"% % % % % % % % % %%% %%%%% %% % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % ", +"% %%% % % % %%% % % %%%%%% %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%% %%% % % % % % % % ", +"% % %%% % % %%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% %% % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" %%% % % %%% %%% % % %%% % % % % % % % %%%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% % %% % % % %%% % % % % % % % % %%%%%% %%%%% %%%%%% %%%%% %%%%%% %%%%% %%%%%% ", +" % % % % % % % % % % % % % % % ", +" %%%% %% %%%% % % %% %%% % % % % ", +" % % % % % % % % % % % %% ", +" % %% %% %%%% %%%% % % % %% % % % ", +" %% % %% % % % % % % % % % % % % % % %%%%% % %%%%% % % % %% %%%% ", +" % % % % % % % % % % %% % % % %%%% %%%% %%%% %%%% %%%% % % % % %%%%% % % % %%%%% %% %%%% % %%%% % % % % ", +" % % % %% % %% % %% % %% % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % %% % % %%% %% % % %%% %% % % %%% % %%% %% % % %%% % % %%%% % % %%%% % % %%%% % % %%%% % % % %%% % % % %%% % % % %%% % %%%% % %%%% % %%%% ", +" % %% %% % % % %% % % % % %% % % % % %% % %% % % % % %% % % % % % % % % % % % % % % %%% % % % % % %% % % % %% % % % %% % % % % % % % %% % % ", +" % % %% %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%%%% % % %%%%% % % %%%%% % % %%%% % %%%% % %% % ", +" % % % % % % %% % % % %% % % % %% % % % % % %% % % % % % % % % % % % % % % % % % %%% % % % % % % % % % % %% % %% % %% ", +" % % % % %% % % % %% % % % %% % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" %%%%% %%%%% %%%%% % % % % % % % % % % % % % % % % % % %%%% %%%% %%%% %%%% %%%% %%%% %%%%% %%%%% % % % % % % % % % %%%% %%%% %%%% %%%% %%%% %%%% ", +" % % % % % % % % ", +" % % %% %% % % % % ", +" % % % % % % %% % % % %% % % %% % % % % % % ", +" %% %% %% % %% %%%% %%%% % % %% % % % % % % % % % %% %% ", +" % % %%%%%%% % %%%%%%% % %% % % % %% % % % % % % % %% % % % %% ", +" %%%% %% % % %%%%%%% % % % % % % %% % % %%%% % % %%%% % % %% % % % % % % % % % % % % % % % % %%%%%% % %%%%%% %% %%%%%% %% % % ", +"% % % % % % % %%%%% % % % % % % % % % % % % % % % % % % % % % % ", +"% % %%%% % %%%%% % %%%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%%%%% % %%%%%% % %%%%%% % ", +" %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%% ", +" %% % % % % % %%% %%% % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % ", +" % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% %% % % % % % %% % % % % % % % % ", +"% % % % % % % % % % % % % % % % %% % % % %% % % % %% % % % %% % % % %% % % % %% %% %% % % % % %%% % % % % % % % % % ", +" %%%% %%%% % %% % %% % %% %%%% %%% % %%%% %%% % %%%% %%% % %%%% %%% % %%%% %%% % %%%% %%% % % % % % % % % %%%%%% %%%%%% %%%%%% %%%%%% %%%%%% %%%%%% % ", +" % % % % % % ", +" % % % % %%%% ", +" %%%%%%% "}; diff --git a/wmdocklib/7x8zx.xpm b/wmdocklib/7x8zx.xpm new file mode 100644 index 0000000..4750f1b --- /dev/null +++ b/wmdocklib/7x8zx.xpm @@ -0,0 +1,33 @@ +/* XPM */ +static char *_x_zx[] = { +/* columns rows colors chars-per-pixel */ +"224 24 2 1", +" c black", +"% c gray100", +/* pixels */ +" ", +" % % % %%% % %% % % % % % %%%% %% %%%% %%%% % %%%%%% %%%% %%%%%% %%%% %%%% %%%% ", +" % % % % % %%%%% %% % % % % % % % % % % % %% % % % % % % %% % % % % % % % % % % % % ", +" % %%%% % % % % % % % % % % % % % % %% % % %%%%% %%%%% % %%%% % % % % %%%%% % % ", +" % % %%%%% % % % % % % %%%%% %%%%% %%%%% % % % % % %%%% % % % % % % % % % %%%%% % % % ", +" % % % % %% % % % % % % % %% % %% % % % % % %%%%%% % % % % % % % % % % %%%%% % ", +" % %%%%%% %%%%% % %% %%% % % % % % % % %% % %%%% %%%%% %%%%%% %%%% % %%%% %%%% % %%%% %%%% % % % % % ", +" % % % ", +" ", +" %%%% %%%% %%%%% %%%% %%%% %%%%%% %%%%%% %%%% % % %%%%% % % % % % % % % %%%% %%%%% %%%% %%%%% %%%% %%%%%%%% % % % % % % % % %%%%%%% %%% %%% % ", +"% % % % % % % % % % % % % % % % % % % % % % %% %% %% % % % % % % % % % % % % % % % % % % % % % % % % % %%% ", +"% % %% % % %%%%% % % % %%%%% %%%%% % %%%%%% % % %%% % % %% % % % % % % % % % % % % %%%% % % % % % % % %% % % % % % % % % % ", +"% %%%% %%%%%% % % % % % % % % %%% % % % % % % % % % % % % % % % %%%%% % % % %%%%% % % % % % % % % %% % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % % %% % % % % % % % % % ", +" %%%% % % %%%%% %%%% %%%% %%%%%% % %%%% % % %%%%% %%%% % % %%%%%% % % % % %%%% % %%%% % % %%%% % %%%% %% % % % % % %%%%%% %%% % %%% % ", +" %%%%%%%", +" ", +" % % % %% % % % % % % %%% % %%% % % ", +" % %%% % %%% % %%% % %%%%% % % % % %% % %%%% %%% %%%% %%%% %%% %%% %%% % % % % % % % % % % %%%%% % % % % % ", +" % %%%% % %%%% % % %% % % %%%% %% % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % %% ", +" %%%% % % % % % %%%% % % % % % % % %% % % % % % % % % % % % % % %%% % % % % % % % % % % % % % % % ", +" % % % % % % % % % %%%%% % % % % % % % % % % % % % % %%%% %%%% % % % % % % % % % % % % %%%% % % % % ", +" %%%% %%%% %%% %%%% %%%% % % % % %%% % % % % %% % % % % % %%% % % % %%%% %% %%% % % % % % % %%%%% %%% % %%% ", +" %%%% %% % %% %%% ", +" ", +}; diff --git a/wmdocklib/8x12-41c.xpm b/wmdocklib/8x12-41c.xpm new file mode 100644 index 0000000..e4304f5 --- /dev/null +++ b/wmdocklib/8x12-41c.xpm @@ -0,0 +1,81 @@ +/* XPM */ +static char *_test[] = { + "128 72 5 1", + " c black", + ". c grey5", + "- c grey35", + "o c grey55", + "x c grey100", + " ..... ..-.. ..-..- ..-..- -xxxxx- -..... -xxxxx- ..... ..... ..... ..... ..... ..... ..... ..... ..... ", + ".. . .. .. x .. .. x .x .. x .x x. x .. xo . x. .x . x. .. x .. .. . x. .x . .. .x x x. .. x .. .. . .. .. . .. .. . .. .. . x. ", + ".. . .. .. x .. .. x .x .. x .x x. x .. xx . x. .x . x. .. x .. .. . x. .x . .. .x x x. .. x .. .. . .. .. . .. .. . .. .. . x. ", + ". ... . . .x. . . .x. x . .x. x x .x. . x x.x . . x.x . . .x. . . ..x . . x.. . .--x--. . .x. . . ... . . ... . . ... . . ..x . ", + ". ... . . .x. . . .x. x . .x. x x .x. . x x.x . . x.x . . .x. . . ..x . . x.. . . oxo . . .x. . . ... . . ... . . ... . . ..x . ", + " ..... ..o.. ..-..- -xxoxxo oxxoxxo oxxoxxo ..o.. ..-.. ..-.. ..-.. -xxoxx- -xx-xx- ..... -xx-xx- ..... ..... ", + ". ... . . .x. . . ... . . .x. x . .x. x . x.x x . x.x x . ... . . ..x . . x.. . . oxo . . .x. . . ... . . ... . . ... . . x.. . ", + ". ... . . .x. . . ... . . .x. x . .x. x . x.x x . x.x x . ... . . ..x . . x.. . .--x--. . .x. . . ... . . ... . . ... . . x.. . ", + ".. . .. .. x .. .. . .. .. x .x .. x .x .x . xx .x . xx .. . .. .. . x. .x . .. .x x x. .. x .. .. . .. .. . .. .. . .. .x . .. ", + ".. . .. .. x .. .. . .. .. x .x .. x .x .x . ox .x . ox .. . .. .. . x. .x . .. .x x x. .. x .. .. x .. .. . .. .. x .. .x . .. ", + " ..... ..-.. ..... -xxxxxo -xxxxx- .....- -xxxxx- ..... ..... ..... ..... ..... .-o.. ..... ..... ..... ", + " ", + "-xxxxx- .....- -xxxxx- -xxxxx- -.....- -xxxxx- -xxxxx- -xxxxx- -xxxxx- -xxxxx- ..... ..... ..... ..... ..... -xxxxx- ", + "x. . ox .. . .x .. . .x .. . .x x. . .x .x . .. x. . .. .. . .x x. . .x x. . .x .. . .. .. . .. .. . x. .. . .. .x . .. x. . .x ", + "x. . xx .. . .x .. . .x .. . .x x. . .x .x . .. x. . .. .. . .x x. . .x x. . .x .. . .. .. . .. .. . x. .. . .. .x . .. x. . .x ", + "x ..x x . ... x . ... x . ... x x ... x . x.. . x ... . . ... x x ... x x ... x . ... . . ... . . ..x . . ... . . x.. . x ... x ", + "x ..x x . ... x . ... x . ... x x ... x . x.. . x ... . . ... x x ... x x ... x . ... . . ... . . ..x . . ... . . x.. . x ... x ", + "o..-..o .....o oxx-xxo xx-xxo oxx-xxo ..-xxo oxx-xxo .....o oxx-xxo oxx-xxo ..x.. ..x.. ..-.. -xx-xx- ..-.. ..-xx- ", + "x x.. x . ... x x ... . . ... x . ... x . ... x x ... x . ... x x ... x . ... x . ... . . ... . . x.. . . ... . . ..x . . .x. . ", + "x x.. x . ... x x ... . . ... x . ... x . ... x x ... x . ... x x ... x . ... x . ... . . ... . . x.. . . ... . . ..x . . .x. . ", + "xx . .x .. . .x x. . .. .. . .x .. . .x .. . .x x. . .x .. . .x x. . .x .. . .x .. . .. .. . .. .x . .. .. . .. .. . x. .. x .. ", + "xo . .x .. . .x x. . .. .. . .x .. . .x .. . .x x. . .x .. . .x x. . .x .. . .x .. x .. .. x .. .x . .. .. . .. .. . x. .. x .. ", + "-xxxxx- .....- -xxxxx- -xxxxx- .....- -xxxxx- -xxxxx- .....- -xxxxx- -xxxxx- ..... .-o.. -xxxxx- -xxxxx- -xxxxx- ..... ", + " ", + "-xxxxx- -xxxxx- -xxxxx- -xxxxx- -xxxxx- -xxxxx- -xxxxx- -xxxxx- -.....- -xxxxx- .....- -..... -..... -.....- -.....- -xxxxx- ", + "x. x .x x. . .x .. x .x x. . .. .. x .x x. . .. x. . .. x. . .. x. . .x .. x .. .. . .x x. . x. x. . .. xo . ox xo . .x x. . .x ", + "x. x .x x. . .x .. x .x x. . .. .. x .x x. . .. x. . .. x. . .. x. . .x .. x .. .. . .x x. . x. x. . .. xx . xx xx . .x x. . .x ", + "x .x. x x ... x . .x. x x ... . . .x. x x ... . x ... . x ... . x ... x . .x. . . ... x x ..x . x ... . x x.x x x x.. x x ... x ", + "x .x. x x ... x . .x. x x ... . . .x. x x ... . x ... . x ... . x ... x . .x. . . ... x x ..x . x ... . x x.x x x x.. x x ... x ", + "o..-xxo oxx-xxo ..-xxo o..... ..-..o oxx-xx- oxx-xx- o...xxo oxx-xxo ..-.. .....o oxxo.. o..... o.....o o..-..o o.....o ", + "x ... . x ... x . .x. x x ... . . .x. x x ... . x ... . x ... x x ... x . .x. . x ... x x ..x . x ... . x ... x x ..x x x ... x ", + "x ... . x ... x . .x. x x ... . . .x. x x ... . x ... . x ... x x ... x . .x. . x ... x x ..x . x ... . x ... x x ..x x x ... x ", + "x. . .. x. . .x .. x .x x. . .. .. x .x x. . .. x. . .. x. . .x x. . .x .. x .. x. . .x x. . x. x. . .. x. . .x x. . xx x. . .x ", + "x. . .. x. . .x .. x .x x. . .. .. x .x x. . .. x. . .. x. . .x x. . .x .. x .. x. . .x x. . x. x. . .. x. . .x x. . ox x. . .x ", + "-xxxxx- -.....- -xxxxx- -xxxxx- -xxxxx- -xxxxx- -..... -xxxxx- -.....- -xxxxx- -xxxxx- -..... -xxxxx- -.....- -.....- -xxxxx- ", + " ", + "-xxxxx- -xxxxx- -xxxxx- -xxxxx- -xxxxx- -.....- -..... -.....- ..... ..... -xxxxx- -xxxxx- ..... -xxxxx- -xxxxx- ..... ", + "x. . .x x. . .x x. . .x x. . .. .. x .. x. . .x x. . x. x. . .x .x . x. .x . x. .. . x. x. . .. .x . .. .. . .x .. . ox .. . .. ", + "x. . .x x. . .x x. . .x x. . .. .. x .. x. . .x x. . x. x. . .x .x . x. .x . x. .. . x. x. . .. .x . .. .. . .x .. . xx .. . .. ", + "x ... x x ... x x ... x x ... . . .x. . x ... x x ..x . x ... x . x.x . . x.x . . ..x . x ... . . x.. . . ... x . ..x x . ... . ", + "x ... x x ... x x ... x x ... . . .x. . x ... x x ..x . x ... x . x.x . . x.x . . ..x . x ... . . x.. . . ... x . ..x x . ... . ", + "oxx-xxo o.....o oxx-xxo oxx-xxo ..-.. o.....o o..-.. o.....o ..o.. ..o.. ..-.. o..... ..-.. .....o ..-..- ..... ", + "x ... . x ..x x x ..x . . ... x . .x. . x ... x x x.. . x x.x x . x.x . . .x. . . x.. . x ... . . ..x . . ... x . x.. . . ... . ", + "x ... . x ..x x x ..x . . ... x . .x. . x ... x x x.. . x x.x x . x.x . . .x. . . x.. . x ... . . ..x . . ... x . x.. . . ... . ", + "x. . .. x. . xx x. . x. .. . .x .. x .. x. . .x xx . .. xx . xx .x . x. .. x .. .x . .. x. . .. .. . x. .. . .x .x . .. .. . .. ", + "x. . .. x. . ox x. . x. .. . .x .. x .. x. . .x xo . .. xo . ox .x . x. .. x .. .x . .. x. . .. .. . x. .. . .x .x . .. .. . .. ", + "-..... -xxxxx- -..... -xxxxx- ..... -xxxxx- -..... -.....- ..... ..... -xxxxx- -xxxxx- ..... -xxxxx- ..... -xxxxx- ", + " ", + " ..... -xxxxx- -xxxxx- -xxxxx- -xxxxx- -xxxxx- -xxxxx- -xxxxx- -.....- -xxxxx- .....- -..... -..... -.....- -.....- -xxxxx- ", + ".x . .. x. . .x .. x .x x. . .. .. x .x x. . .. x. . .. x. . .. x. . .x .. x .. .. . .x x. . x. x. . .. xo . ox xo . .x x. . .x ", + ".x . .. x. . .x .. x .x x. . .. .. x .x x. . .. x. . .. x. . .. x. . .x .. x .. .. . .x x. . x. x. . .. xx . xx xx . .x x. . .x ", + ". x.. . x ... x . .x. x x ... . . .x. x x ... . x ... . x ... . x ... x . .x. . . ... x x ..x . x ... . x x.x x x x.. x x ... x ", + ". x.. . x ... x . .x. x x ... . . .x. x x ... . x ... . x ... . x ... x . .x. . . ... x x ..x . x ... . x x.x x x x.. x x ... x ", + " ..... oxx-xxo ..-xxo o..... ..-..o oxx-xx- oxx-xx- o...xxo oxx-xxo ..-.. .....o oxxo.. o..... o.....o o..-..o o.....o ", + ". ... . x ... x . .x. x x ... . . .x. x x ... . x ... . x ... x x ... x . .x. . x ... x x ..x . x ... . x ... x x ..x x x ... x ", + ". ... . x ... x . .x. x x ... . . .x. x x ... . x ... . x ... x x ... x . .x. . x ... x x ..x . x ... . x ... x x ..x x x ... x ", + ".. . .. x. . .x .. x .x x. . .. .. x .x x. . .. x. . .. x. . .x x. . .x .. x .. x. . .x x. . x. x. . .. x. . .x x. . xx x. . .x ", + ".. . .. x. . .x .. x .x x. . .. .. x .x x. . .. x. . .. x. . .x x. . .x .. x .. x. . .x x. . x. x. . .. x. . .x x. . ox x. . .x ", + " ..... -.....- -xxxxx- -xxxxx- -xxxxx- -xxxxx- -..... -xxxxx- -.....- -xxxxx- -xxxxx- -..... -xxxxx- -.....- -.....- -xxxxx- ", + " ", + "-xxxxx- -xxxxx- -xxxxx- -xxxxx- -xxxxx- -.....- -..... -.....- ..... ..... -xxxxx- ..... ..... ..... o..... -xxxxx- ", + "x. . .x x. . .x x. . .x x. . .. .. x .. x. . .x x. . x. x. . .x .x . x. .x . x. .. . x. .. x .. .. x .. .. x .. xo . x. xo x ox ", + "x. . .x x. . .x x. . .x x. . .. .. x .. x. . .x x. . x. x. . .x .x . x. .x . x. .. . x. .. x .. .. x .. .. x .. xx . x. xx x xx ", + "x ... x x ... x x ... x x ... . . .x. . x ... x x ..x . x ... x . x.x . . x.x . . ..x . . .x. . . .x. . . .x. . x x.x . x xxx x ", + "x ... x x ... x x ... x x ... . . .x. . x ... x x ..x . x ... x . x.x . . x.x . . ..x . . .x. . . .x. . . .x. . x x.x . x oxo x ", + "oxx-xxo o.....o oxx-xxo oxx-xxo ..-.. o.....o o..-.. o.....o ..o.. ..o.. ..-.. -xx-.. ..-.. ..-xx- -..... oxxoxxo ", + "x ... . x ..x x x ..x . . ... x . .x. . x ... x x x.. . x x.x x . x.x . . .x. . . x.. . . .x. . . .x. . . .x. . . ... . x oxo x ", + "x ... . x ..x x x ..x . . ... x . .x. . x ... x x x.. . x x.x x . x.x . . .x. . . x.. . . .x. . . .x. . . .x. . . ... . x xxx x ", + "x. . .. x. . xx x. . x. .. . .x .. x .. x. . .x xx . .. xx . xx .x . x. .. x .. .x . .. .. x .. .. x .. .. x .. .. . .. xx x xx ", + "x. . .. x. . ox x. . x. .. . .x .. x .. x. . .x xo . .. xo . ox .x . x. .. x .. .x . .. .. x .. .. x .. .. x .. .. . .. xo x ox ", + "-..... -xxxxx- -..... -xxxxx- ..... -xxxxx- -..... -.....- ..... ..... -xxxxx- ..... ..... ..... ..... -xxxxx- ", + " ", +}; diff --git a/wmdocklib/8x13-utf-8.xpm b/wmdocklib/8x13-utf-8.xpm new file mode 100644 index 0000000..63de295 --- /dev/null +++ b/wmdocklib/8x13-utf-8.xpm @@ -0,0 +1,148 @@ +/* XPM */ +static char * 8x13_xpm[] = { +"256 143 2 1", +" c black", +"% c gray100", +" ", +" % % % % % % % % % % % % %% % %%%% %%%%%% % %%%%%% %%% %%%%%% %%%% %%%% % % %%%% ", +" % % % % % %%%% % % % % % % %% % % % %% % % % %% % % % % % % % % % % % ", +" % % % % % % % % % %% % % % %%%%%% % % % % % % % % % % % % % % % % % % % % % % % % ", +" % %%%%%% % % % % % % % %% % % % % % % % % % % %%% % % % % % %% %%% %%% % %%%%%% % % ", +" % % % %%% % % % % % % % %%%%% %%%%% % % % % % %%% % % %% % % %%% % %%%% %%% % % % % % % ", +" % %%%%%% % % % %% % % % % % % % %% % % % % %% % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % %%%%%% % % % % % % % % %%%%%% % % ", +" % % %%%% % % % % % % % %%% % % % % % % % % % % % % % % % % % % %%% % % ", +" % % % % %%% % % % %% %%% % %% %%%%% %%%%%% %%%% % %%%% %%%% % %%%% %%% %%% %% % % % ", +" % % % % ", +" ", +" ", +" ", +" %%%% %% %%%% %%%% %%%% %%%%%% %%%%%% %%%% % % %%%%% %%%%% % % % % % % % %%%% %%%%% %%%% %%%%% %%%% %%%%%%% % % % % % % % % % % %%%%%% %%%% % %%%% % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % %% %% %% % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% %%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % %%%% % % % %%%% %%%% % %%%%%% % % %% % % % % % % % % % %%%%% % % %%%%% %%%% % % % % % % % % % % % % % % ", +"% % %% %%%%%% % % % % % % % % %%% % % % % % % % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" %%%% % % %%%% %%%% %%%% %%%%%% % %%% % % % %%%%% %%% % % %%%%%% % % % % %%%% % %%%% % % %%%% % %%%% % % % % % % %%%%%% %%%% % %%%% ", +" % %%%%%%% ", +" ", +" ", +" % ", +" % % % %%% % % %% %%% % %%% % % ", +" % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % ", +" %%%% % %%% %%%% %%% % %%%% % %%% % % %%% %% %% % % % %%% %% % %%% %%%% % %%% %%% % % %%% %%%% %%%%% % % % % % % % % % % %%%%%% % % % ", +" % %% % % % % %% % % %%%%% % % %% % % % % % % % % % %% % % % %% % % %% % % % % % % % % % % % % % % % % %% % %% ", +" %%%%% % % % % % %%%%%% % % % % % % % %%% % % % % % % % % % % % % % %% % % % % % % % % %% % % % % % % ", +" % % % % % % % % % %%% % % % % % % % % % % % % % % %% % % %% % %% % % % % % % % % %% % %% % % % % ", +" % %% %% % % % % %% % % % % % % % % % % % % % % % % % % % %%% %%% % % % % % % % % % % % % % % % % %%% % % % % % ", +" %%% % % %%% %%%% %%% % %%%% % %%%% % % %%%%% % % % % %%%%% % % % % %%%% % % % %%%% %%% %%% % % % % % % % %%%%%% %%% % %%% ", +" % % % % % % % % ", +" %%%% %%% % % %%%% ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" %% % % %%% %%% %% %% % % % % %% ", +" % % %%% % % % % % % % % % %%% % % %%%%%% %% % % % % % %%%%% %% %% %% %% % % % ", +" %%% % % % % % % % % % % % % % % % % % % % % %%% % % % % % % % % % ", +" % % % % % % % % % % %% % % % % %%%% % % % % % % % % % %% % %%% % % % % % % % % % % ", +" % % % %%% %%%% % % % % % % % % % % % % % % % % %% %%%%% % % % % % %%% % % %% % % % % % %% % % % % ", +" % % % % % % %%%%% % % % % % % %%%% % % %%%%%% %%%% % %% % % %%%% %% % % %% % %% %%% % % %%% %% %%%% % %% %% % ", +" % % % % % % % % % %% % % % % % % % % % % % % % % % %%%% % % % % % % % % ", +" % %%% % %%%% %%%%% % % % % %%%%% % % % % % % % % % % % % % %% % % % % ", +" % % %% % % % % % % % %%% % % % %%% %%%%% %% %% % % % % %% % % %% % % % ", +" % %% %%% % % %% % %% % % % %% %%%% %% %%%% ", +" % % ", +" %% ", +" ", +" % % %% %% % % % %% % % %% % % % % %% % % %% % % % %% %% % % % % % % %% % % % ", +" % % % % % %% % % % % %% %%% %%%% % % % % % % % % % % % % %%%% % %% % % % % % %% % % %%%% % % % % % % % % %%% ", +" %% % % % % % % % %% %%%%% % % ", +" %% %% %% %% %% %% % % % %%%%%% %%%%%% %%%%%% %%%%%% %%%%% %%%%% %%%%% %%%%% % % % % %%%%% %%%%% %%%%% %%%%% %%%%% % % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % %%% % % % % % % % % % %%% % % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % %%%% % %%%% %%%% %%%% %%%% % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % %%%%% % %% ", +"%%%%%% %%%%%% %%%%%% %%%%%% %%%%%% %%%%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % %% % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % %%%% %%%% %%%%%% %%%%%% %%%%%% %%%%%% %%%%% %%%%% %%%%% %%%%% %%%% % % %%%%% %%%%% %%%%% %%%%% %%%%% %%%% %%%% %%%% %%%% %%%% % % % %%% ", +" % % ", +" % ", +" ", +" %% % % ", +" % % %% %% % % % % % % % %% % % % % %% % % %% %% % % % %% %% % % % % % %% % % % % % ", +" % % % % % %% % % %% % % % % % % % % % % % % % % % %% % % % % % %% % % % % % % % % % % % % % ", +" % % % % ", +" %%%% %%%% %%%% %%%% %%%% %%%% %% %% %%%% %%%% %%%% %%%% %%%% %% %% %% %% %%%% % %%% %%%% %%%% %%%% %%%% %%%% %%%% % % % % % % % % % % % %%% % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % %%%%% % %% % % % % % % % % % % %% % % % ", +" %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% % %%%%%% %%%%%% %%%%%% %%%%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % %% ", +"% %% % %% % %% % %% % %% % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % %%% % %% % %%% % ", +" %%% % %%% % %%% % %%% % %%% % %%% % %% %% %%%% %%%% %%%% %%%% %%%% %%%%% %%%%% %%%%% %%%%% %%%% % % %%%% %%%% %%%% %%%% %%%% %%%% %%% % %%% % %%% % %%% % % % %%% % ", +" % % % % % % % ", +" % %%%% % %%%% ", +" ", +"%%%%%% % % % %% %% % % % % % % %%%%%% % % %% % % %% % % ", +" %%%% % % %% % % % % %% %% % % %% %% %%%% % %%%% % % %%%%%% %% % % % % %% %%%% % % ", +" %% %%%%%% %%%% % % % % % %%%% %% %% % % % %%%% %%%%%% %%%%%% %%%% %%%%%% %% % %% % % %%%% ", +" % % %% % % %%%% %%%% % % %%%% %%%% % % % % % %%%%%% % % %%%%%% %%%% %%%% ", +"% % %%%% % % %%%% % % %%%% % % %%%% % % %%%% % %%%% % % %%%% % % %%% % % % %%% % % %%%% % %%%% % %%%% % %%%% % %%%% % % %%% % % % %%% % ", +"% % % % % % % % % % % % % % % % % % % % % % % % %% %%%% % % %% %%%% % % % % % %%%% % % %%%% % % % % % % % % % % % ", +"%%%%%% %%%%% % % %%%%% %%%%%% %%%%% % % % % % % % % % % % % % % % % % %%%%%% %%%% %%%%%% % %%%%%% % %%%%%% %%%% %%%%%% % %%% % % % %%% % % ", +"% % % % %%%%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%% % % %%% ", +"% % % %% % % % %% % % % %% % % % % % % % % % % % % % % % % % % % %% % % % %% % % % % % % % % % % % % % % % % %% % % %% % ", +"% % %%% % % % %%% % % % %%% % %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%%% %%% % %%%% %%% % %%%%%% %%%% %%%%%% %%%% %%%%%% %%%% %%%%%% %%%% %%%%%% %%%% %%% % %%%% %%% % %%%% ", +" % % % % % % % % ", +" %% %% %%% %%% %%%% %%%% ", +" % % % % % ", +" %% % %% %% %% % %%%%% % % % %% % % %% %% ", +" %%%% % % % % % % % % % %% %% % %%% % % %%%%% %%% %%% % % %% % % % % % %% % ", +" %%%% %% % % %% % % % %%%%% % %% %%%%% %%%%% %%% % %% %%%%% % % % % % % % % % % %% % % % %% % ", +"% % % % % % %%%%%%%% % %%%%% % %%%%% % % % % %%%% % % % % % % % % % % ", +"% %%% % % %%% % % % % % % % %%% % %% % %% % %% % %% % %% % % %% %% % %% % % % % % % % % % % % % % % ", +"% % % % % % % % % %%% %%%%%% %% % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % ", +"% %%% % % % %%% % % %%%%%% %% % % % % % % % % % % % % % % % % % % % % % % % %%% %%%% % % % % % % % ", +"% % %%% % % %%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"% %% % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" %%% % %%%% %%% % %%%% % % % % % % % % %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%% %% %%%% % %%% % % % % % % % % %%%%%% %%%%% %%%%%% %%%%% %%%%%% %%%%% %%%%%% ", +" % % % % % % % % % % % % % % % ", +" %%%% % %%%% %% %% %% %%% %% %% % % ", +" ", +" % % % %% % % % % % % % % %% ", +" %% % %% % % % % %% % % % % % %%%%% %%% % % % % % % %%%%%% % % %%%%% %% % % % % % % %% %%%% ", +" % % % % % % % % % % %% % % % %%%%%% %%%% % % % % % % % %% % % % % % ", +" % % % % % %% % % % %% % %%%%% %%%%% %%%%% % % %%%%% % % %%%%% %%%% %%%% % ", +" % % %% %% %% % % %%% % % % % %%% %% % % %%% % %%% % % % % %%% % % %%%% % % %%%% % % %%%% % % %% %% % % % %%% % % % %%% % % % %%% % % %%%% % % %%%% % %%%% ", +" % % %% %% % % % %% % % % % %% % % % % %% % %% % % % % %% % % % % % % % % % % % % % % %%% % % % % % % % %%%%% % % % % % % % % % % % % %%%% % % ", +" % % % % % % % % % %% % % % % % % % % % % %% % % % % % % % % % % % % % % % % % %%% %%%%% % % % % %%%%% % %%%% %% %%%% %% % %% ", +" % % % % %% % % % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % %% % %% ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +"%%%%% %%%%%% %%%%% % % % % % % % % % % % % % % % % % % %%%%% %%%% %%%%% %%%% %%%%% %%%% %%%%%% %% %% % % % % % % % % % %%%% %%%% %%%% %%%% %%%% %%%% ", +" % % % % % % % % ", +" % % %% %% % % % % ", +" ", +" % % % % % % %% % %%%%%% % % %% %% % % % %% % % % %% % % ", +" %% % % %%%%%%% % %% %%%%%%% % %% %% % %%%% % % % % % % % % % % % % % % % % % %% % % % % %% % % %% ", +" %% % % % % % %% % % %%%%% %%% %% %% % % % % % % % % % %%%%%% %% %% % % ", +" %%%% % % %%%%%%% % % %%%%% % % % % % % % % % % % % % % % % % % %%%%%% % %%%%%% % ", +"% % %%%% % %%%%% % % %%%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%%%%% % %%%%%% % %%%%%% % ", +"% % % % % % %%%%% % %%%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% ", +" %%%% %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%% % % % % % % % % % ", +" %%%% %%%% % %%% % %%% % %%% %%%% %%% % %%%% %%% % %%%% %%% % %%%% %%% % %%%% %%% % %%%% %%% % % % % % % % % %%%%%% %%%%%% %%%%%% %%%%%% %%%%%% %%%%%% % ", +" % % % % % % ", +" % % %% %% %%%% ", +" %%%%%%%% "}; diff --git a/wmdocklib/8x8-cholo.xpm b/wmdocklib/8x8-cholo.xpm new file mode 100644 index 0000000..dac97e9 --- /dev/null +++ b/wmdocklib/8x8-cholo.xpm @@ -0,0 +1,32 @@ +/* XPM */ +static char *_8x8cholo_[] = { +/* columns rows colors chars-per-pixel */ +"256 24 2 1", +". c gray100", +" c black", +/* pixels */ +" ... . . . ... ... . . . . .... . ..... ...... .. ...... . ...... .... ..... .. .. .... ", +" . . . . . . ....... . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . ", +" . . . . ...... . . ... . . . . . . ... . . . . . . . . . . . . . . . . . . . . ...... . . . ", +" . . . ..... . ... . . . ..... ...... . . . . . .... ... . . .... ..... . .... ..... . . . . . . .. ", +" . . . . . . . . . . . ... . . . . . . . ...... . . . . . . . . . ...... . . . ", +" ...... ....... . ... . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . .... . . . . . .. .... ...... ...... ..... . ..... ..... . ...... . . . .. .. . ", +" ... . . ", +" .. .. .... ... .... ...... ...... ... . . ..... ..... . . . . . . . .. ..... .. ..... .... ..... . . . . . . . . . . ...... .... .... . ", +" . . . . . . . . . . . . . . . . . . . . .. .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . ... ", +" . ... . . . . . . . . . . . . . . . . . . .. . .. . . . . . .. . . . . . . . . . . . . . . . . . . . . . . ", +" . . . ...... ..... . . . .... .... . ... ...... . . .... . . . . . . . . ..... . . . ..... .. . . . . . . . .. . . . . . . ", +" . ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" .. . . ..... ... .... ...... . .... . .. ..... .... . . ...... . .. . . .. . .. . . . .... . .... .. .. .. . . .. ...... .... .... ... ", +" ........", +" . .. .. .. . . . .. .. . ...... .... .. ........", +" . . . . . . . . . ....... .. .. . . . . . .", +" . . ... ..... ... ..... .... . ..... . . ... . . . ..... .... .. .... .... .... ..... ..... . . . . . . . . . . ..... . . . . . .. . . . . .", +" . . . . . . . . . . ..... . . .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. .. .. .. .", +" . . .... . . . . . ...... . . . . . . . ... . . . . . . . . . . . . . .... . . . . . . . . . . . . . . . .. .. .. .. .", +". . . . . . . . . . . ..... . . . . . . . . . . . . . .... .... . . . . . . . . . . . . .... . . . . . . . .. . . . . .", +"....... ...... ..... .... ..... ..... . . . . .. . . . .. . . . . .. . . . ...... .. .... . ...... . . . ..... . . .. .. . . . . . .", +" .... .. . .. .... . ...... .... .. ........" +}; diff --git a/wmdocklib/8x8.xpm b/wmdocklib/8x8.xpm new file mode 100644 index 0000000..80551c9 --- /dev/null +++ b/wmdocklib/8x8.xpm @@ -0,0 +1,57 @@ +/* XPM */ +static char *c___low[] = { +/* columns rows colors chars-per-pixel */ +"128 48 2 1", +" c black", +"% c gray100", +/* pixels */ +" %% %% %% %% %% %% %% % %%%% %% %% %% ", +" %% %% %% %% %% %%%%% %% %% %% %% %% %% %% %% %% %% %%", +" %% %% %% %%%%%%%% %% %% %%%% %% %% %% %%%% %% %% ", +" %% %% %% %%%% %% %%% %% %% %%%%%%%% %%%%%% %%%%%% %% ", +" %%%%%%%% %% %% %% %%% %% %% %%%% %% %% ", +" %% %% %%%%% %% %% %% %% %% %% %% %% %% %% %% %% ", +" %% %% %% %% % %% %%%%%% %% %% %% %% %% ", +" %% ", +" %%%% %% %%%% %%%% %% %%%%%% %%%% %%%%%% %%%% %%%% %%% %%% %%%% ", +" %% %% %% %% %% %% %% %%% %% %% %% %% %% %% %% %% %% %% %% %% %% ", +" %% %%% %%% %% %% %%%% %%%%% %% %% %% %% %% %% %% %% %% %%%%%% %% %% ", +" %%% %% %% %% %%% %% %% %% %%%%% %% %%%% %%%%% %% %% %% ", +" %% %% %% %% %% %%%%%%% %% %% %% %% %% %% %% %% %%%%%% %% %% ", +" %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% ", +" %%%% %%%%%% %%%%%% %%%% %% %%%% %%%% %% %%%% %%%% %% %%% %%% %% ", +" %% ", +" %%%% %% %%%%% %%%% %%%% %%%%%% %%%%%% %%%% %% %% %%%% %%%% %% %% %% %% %% %% %% %%%% ", +" %% %% %%%% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %%% %%% %%% %% %% %% ", +" %% %%% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %%%% %% %%%%%%% %%%%%% %% %% ", +" %% %%% %%%%%% %%%%% %% %% %% %%%% %%%% %% %%% %%%%%% %% %% %%% %% %% % %% %%%%%% %% %% ", +" %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %%%% %% %% %% %% %%% %% %% ", +" %% % %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% ", +" %%%% %% %% %%%%% %%%% %%%% %%%%%% %% %%%% %% %% %%%% %%% %% %% %%%%%% %% %% %% %% %%%% ", +" ", +" %%%%% %%%% %%%%% %%%% %%%%%% %% %% %% %% %% %% %% %% %% %% %%%%%% %%%% %%%% ", +" %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% %% ", +" %% %% %% %% %% %% %% %% %% %% %% %% %% %% %%%% %% %% %% %% %% %% %%%% ", +" %%%%% %% %% %%%%% %%%% %% %% %% %% %% %% % %% %% %%%% %% %% %% %% %% %% ", +" %% %% %% %%%% %% %% %% %% %% %% %%%%%%% %%%% %% %% %% %% %% ", +" %% %%%% %% %% %% %% %% %% %% %%%% %%% %%% %% %% %% %% %% %% %% ", +" %% %%% %% %% %%%% %% %%%% %% %% %% %% %% %% %%%%%% %%%% %% %%%% %%%%%%%%", +" ", +" %% ", +" %% %% %% %%% %% %% %% %% %%% ", +" %% %%%% %% %%%% %% %%%% %% %%%%% %% %% %% %% %% %%%%% %%%% ", +" %% %%%%% %% %%%%% %% %% %%%%% %% %% %%%%% %%% %% %% %% %% %%%%%%% %% %% %% %% ", +" %%%%% %% %% %% %% %% %%%%%% %% %% %% %% %% %% %% %%%% %% %%%%%%% %% %% %% %% ", +" %% %% %% %% %% %% %% %% %% %%%%% %% %% %% %% %% %% %% %% % %% %% %% %% %% ", +" %%%%% %%%%% %%%% %%%%% %%%% %% %% %% %% %%%% %% %% %% %%%% %% %% %% %% %%%% ", +" %%%%% %%%% ", +" %%% %%% ", +" %% %% %% %% %% %% ", +" %%%%% %%%%% %%%%% %%%%% %%%%%% %% %% %% %% %% %% %% %% %% %% %%%%%% %% %% %% ", +" %% %% %% %% %% %% %% %% %% %% %% %% %% % %% %%%% %% %% %% %% %% %% %%% %% %% %% ", +" %% %% %% %% %% %%%% %% %% %% %% %% %%%%%%% %% %% %% %% %% %% %% %% %%% %% %% ", +" %%%%% %%%%% %% %% %% %% %% %%%% %%%%% %%%% %%%%% %% %% %% %% %% %% ", +" %% %% %% %%%%% %%% %%%%% %% %% %% %% %% %% %%%%%% %%% %% %%% %% ", +" %% %% %%%% %%%% ", + +}; diff --git a/wmdocklib/8x8zx.xpm b/wmdocklib/8x8zx.xpm new file mode 100644 index 0000000..319bc57 --- /dev/null +++ b/wmdocklib/8x8zx.xpm @@ -0,0 +1,57 @@ +/* XPM */ +static char *_x_zx[] = { +/* columns rows colors chars-per-pixel */ +"128 48 2 1", +" c black", +"% c gray100", +/* pixels */ +" ", +" % % % %%% % %% % % % % % ", +" % % % % % %%%%% %% % % % % % % % % % % ", +" % %%%% % % % % % % % % % ", +" % % %%%%% % % % % % % %%%%% %%%%% %%%%% % ", +" % % % % %% % % % % % % % %% % ", +" % %%%%%% %%%%% % %% %%% % % % % % % % %% % ", +" % % ", +" ", +" %%%% %% %%%% %%%% % %%%%%% %%%% %%%%%% %%%% %%%% %%%% ", +"% %% % % % % % % %% % % % % % % % % % % % % ", +"% % % % % %% % % %%%%% %%%%% % %%%% % % % % %%%%% % % ", +"% % % % %%%% % % % % % % % % % %%%%% % % % ", +"%% % % % % % %%%%%% % % % % % % % % % % %%%%% % ", +" %%%% %%%%% %%%%%% %%%% % %%%% %%%% % %%%% %%%% % % % % % ", +" % ", +" ", +" %%%% %%%% %%%%% %%%% %%%% %%%%%% %%%%%% %%%% % % %%%%% % % % % % % % % %%%% ", +"% % % % % % % % % % % % % % % % % % % % % % %% %% %% % % % ", +"% % %% % % %%%%% % % % %%%%% %%%%% % %%%%%% % % %%% % % %% % % % % % % ", +"% %%%% %%%%%% % % % % % % % % %%% % % % % % % % % % % % % % % % ", +"% % % % % % % % % % % % % % % % % % % % % % % % %% % % ", +" %%%% % % %%%%% %%%% %%%% %%%%%% % %%%% % % %%%%% %%%% % % %%%%%% % % % % %%%% ", +" ", +" ", +"%%%%% %%%% %%%%% %%%% %%%%%%% % % % % % % % % % % %%%%%% %%% %%% % ", +"% % % % % % % % % % % % % % % % % % % % % % %%% ", +"% % % % % % %%%% % % % % % % % %% % % % % % % % % % ", +"%%%%% % % % %%%%% % % % % % % % % %% % % % % % % ", +"% % % % % % % % % % % % % % %% % % % % % % % % % ", +"% %%%% % % %%%% % %%%% %% % % % % % %%%%%% %%% % %%% % ", +" %%%%%%%%", +" ", +" % % % %% % % % % % ", +" % %%% % %%% % %%% % %%%%% % % % % %% % %%%% %%% ", +" % %%%% % %%%% % % %% % % %%%% %% % %% % % % % % % % % ", +" %%%% % % % % % %%%% % % % % % % % %% % % % % % % % % ", +" % % % % % % % % % %%%%% % % % % % % % % % % % % % % ", +" %%%% %%%% %%% %%%% %%%% % % % % %%% % % % % %% % % % % % %%% ", +" %%%% %% ", +" ", +" % %%% % %%% % % ", +"%%%% %%%% %%% %%% %%% % % % % % % % % % % %%%%% % % % % % ", +"% % % % % % % % % % % % % % % % % % % %% % %% ", +"% % % % % %%% % % % % % % % % % % % % % % % ", +"%%%% %%%% % % % % % % % % % % % % %%%% % % % % ", +"% % % %%%% %% %%% % % % % % % %%%%% %%% % %%% ", +"% %% %%% ", +" ", +}; diff --git a/wmdocklib/9x18-utf-8.xpm b/wmdocklib/9x18-utf-8.xpm new file mode 100644 index 0000000..178499b --- /dev/null +++ b/wmdocklib/9x18-utf-8.xpm @@ -0,0 +1,203 @@ +/* XPM */ +static char * 9x18_xpm[] = { +"288 198 2 1", +" c black", +"% c gray100", +" ", +" ", +" % % % % % % ", +" % % % % % % % % %% % % % % % %%% % %%% %%%%%%% % %%%%%%% %%%% %%%%%%% %%% %%% %%% ", +" % % % % % %%%%% % % % % % % % % % % % % % % %% % % % %% % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % %%%%%%%% % % % % % % % % %%% % % % % % % % % % % % % % % % % % %% %% % % % ", +" % % % % % % %% % % % % % % % % % % % %% % % %%%%% % %%% % %%% % %% %% %% % %%%%%%% % % ", +" % % % %%% % %% % % % % % % %%%%%%% %%%%%%% % % % % % % % % % %% % % % % %%% % % % % ", +" %%%%%%%% % % % % % % % % % % % % % % % % % %%%%%%% % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % %%%%%%% % % ", +" % % % % % % % % % % % % % % % %% %% % % % % % % % % % % % % % % % % %% %% % % ", +" % % % %%%%% % % %% % % % %% %% % %%% %%%%%%% %%%%%%% %%%% % %%%% %%% % %%% %%%% %% %% % % % ", +" % % % % % ", +" % % ", +" ", +" ", +" ", +" ", +" ", +" %%%% %%%% ", +" %%% % %%%%% %%%% %%%%% %%%%%%% %%%%%%% %%% % % %%%%% %%%%% % % % % % % % %%%%% %%%%% %%% %%%%% %%%%% %%%%%%% % % % % % % % % % % %%%%%%% % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % %% % % % % % % % % % % % % % % % % % % % %% %% %% % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % %%%%% % % % %%%%% %%%%% % %%%%%%% % % % % % % % % % % % % % % % % % % % %%%%% % % % % % % % % % % % % % % ", +" % % % % %%%%% % % % % % % % % %%% % % % % %% % % % % % % % % % %%%%% % % %%%%% % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % ", +" % %%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" %%%% % % %%%%% %%%% %%%%% %%%%%%% % %%% % % %%%%% %%% % % %%%%%%% % % % % %%%%% % %%% % % % %%%%% % %%% % % % % % % %%%%%%% % % % ", +" % %%%% %%%% %%%%%%%% ", +" ", +" ", +" ", +" ", +" % ", +" % ", +" % %%% % %%% ", +" % % %%% % %% %% % %%% % % % %% % ", +" % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % %% ", +" %%%%% % %%%% %%%%% %%%% % %%%%% % %%%% % % %%%% %%% %%% % % % %%% %% % %%%% %%%%% % %%% %%% % % %%% %%%%% %%%%%% % % % % % % % % % % %%%%%%% % % % ", +" % %% % % % % %% % % % % % %% % % % % % % % % % %% % % % %% % % %% %% % % % % % % % % % % % % % % % %% % %% ", +" % % % % % % % % %%%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" %%%%%% % % % % % %%%%%%% % % % % % % % % %% % % % % % % % % % % % % % %%%%% % % % % % % % % % % % % % % % ", +" % % % % % % % % % %%%% % % % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % %% %% % % % % %% % % % % % % % % % % % % % % % % % % %% % % %% % % % % % % %% % % % % % % % % %% % % % % ", +" %%%% % % %%%% %%%%% %%%% % %%%%% % %%%%% % % %%%%% % % % %%%%% % % % % %%%%% % %%% %%% % % %%%%% %%% %%%% % % % % % % %% %%%%%%% %%% % %%% ", +" % % % % % % % % ", +" % % % % % % % % ", +" %%%%% %%% % % %% ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" % % % ", +" % % % ", +" % % ", +" % %%% % % % %% %%%% %% %%%% %%%%%% %% % %% %% %%%%%% % %%% % % %% % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % %% %% % % ", +" % % %%%%% % % % % % %% % %%% % % % %%% % % % % % % % % % % % % % % % % % % ", +" % %%%% % % % % % % %% % % % % % % % % % % % % %% %%%%%%% %% % % % % % % % %%% % % % % % % ", +" % % % % %%%%% % % %%%%% % % % % % % %%%% % % %%%%%% % %%%% % % % % % % % %%%% % %% % % % % % % %% % % % % ", +" % % % % %%%%% % % % % % % % % % % %%%%% % % % % % %%%% %% % % % % %% %%% %%%%% % % %%% %% %%%% % %% %% % ", +" % % % % % % %%%%% % % % % %% % %%%%% % % % % % % % % % % % % % % % % % % % % ", +" % % % % %% % % %% % % % % % % % % % % % % % % % %% % % % % ", +" % %%%% % % % % % % %%%% % % %%%% %%%%%%% %% %% % % % % %% % % %% % % % ", +" % % % %%% % % % % % %%% % % % %% %%%% %% %%%%% ", +" % %% % % ", +" % % % ", +" %% ", +" ", +" % % % % % % % % % % % % % % % % % ", +" % % % % %% % % % % % % % % % % % % % % % % % %% % % % % % %% % % % % % % % % % % ", +" % % % % % %% % % % % % % % % % % % % % % % % % %% % % % % % %% % % % % % % % % % ", +" % % ", +" % % % % % % %%%% %%%% %%%%%%% %%%%%%% %%%%%%% %%%%%%% %%%%% %%%%% %%%%% %%%%% %%%% % % %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% % % % % % % % % % % % %%% ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % %%%%%% % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % %%% % %%%%% %%%%% %%%%% %%%%% % % % % %%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % ", +" %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % % %%%%%% % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % %%% %%%% %%%%%%% %%%%%%% %%%%%%% %%%%%%% %%%%% %%%%% %%%%% %%%%% %%%% % % %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%% %%% %%% %%% % % % %% ", +" % % ", +" % % ", +" %% ", +" ", +" ", +" ", +" % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % %% % % % % % % % % % % % % % % % % % %% %% % % % % % %% % % % % % % % % % % % % ", +" % % % % % %% % % % % % % % % % % % % %% % % % % % %% % % % % % % % % % % % % % ", +" % %%% % % ", +" %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %% %% %%%%% %%%%% %%%%% %%%%% %%%%% %%% %%% %%% %%% %%%% % %%%% %%%%% %%%%% %%%%% %%%%% %%%%% % %%%%% % % % % % % % % % % % %%% % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % % % % % % % % % % % % % %% % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%%%%%% % % % % % % % % % % % % % % % % % ", +" %%%%%% %%%%%% %%%%%% %%%%%% %%%%%% %%%%%% %%%%%% % %%%%%%% %%%%%%% %%%%%%% %%%%%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % %% % %% % %% % %% % %% % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%% % % % % %% % %% % %% % %% %% %% % %% ", +" %%%% % %%%% % %%%% % %%%% % %%%% % %%%% % %% %% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%% % % %%%%% %%%%% %%%%% %%%%% %%%%% % %%%%% %%%% % %%%% % %%%% % %%%% % %% % %%% %% ", +" % % % % % ", +" % % % % % % % ", +" %% %% %% ", +" ", +" % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % ", +" %%%%% %%% % % % % % % % % %%%%% %%% % % % % %%% ", +" % % % % % % % % ", +" % % % % % %%%% % %%%% % % %%%% % %%%% % % %%%%% % %%%%% % %%%%%%% %%%%%%% % % %%%%%%% % %%%%%%% %%%%%%% % % %%% % % %%% % % ", +" % % %%%%% % % %%% % % % % % % % % % % % % % % % % % % % % %%%%% % %%%%% % %%% % % % % % % % % % % % %%% ", +" % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % %%%%% % % %%%%% % % %%%%% % %%%%% % %%%%% % %%%%% % %%%%% % % %%%% % % % %%%% % % %%%%% % %%%%% % %%%%% % %%%%% % %%%%% % %%%% % % %%%% % ", +" % % % % % % % % % % % % % % % % % % % % % % % % %% %%%% % % %% %%%%% % % %%%%% % % %%%%% % % %%%%% % % %%%%% % % % % % % % % ", +" %%%%% % %%%%% % %%%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%% % % % %%% % % ", +" % % %%%%%% % % %%%%%% % % %%%%%% % % % % % % % % % % % % % % % % % %%%%%%% % %%%%%%% % %%%%%%% % %%%%%%% % %%%%%%% % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%%% % % %%%% ", +" % % % %% % % % %% % % % %% % % % % % % % % % % % % % % % % % % % %% % % % %% % % % % % % % % % % % % % % % % % % % % % ", +" % % %%%% % % % %%%% % % % %%%% % %%%% %%%%% %%%% %%%%% %%%% %%%%% %%%% %%%%% %%%%% %%%% % %%%%% %%%% % %%%%%%% %%%%% %%%%%%% %%%%% %%%%%%% %%%%% %%%%%%% %%%%% %%%%%%% %%%%% %%% %%%%% %%% %%%%% ", +" % % % % % % % % ", +" % % % % % % % % ", +" %% %%% %%% %%% %%%%% %%%%% ", +" ", +" % % % % % % % % % ", +" % % % % % %% % % % % % % % % % % % % ", +" % % % % % % %% %%%%% %%% % % % % % % % % ", +" % % % ", +" %%% % %%% % % % % % % % %%%%% %% % %%%%% %%%%% % % %%%%% %%%%% %%% %%% %%%%% % % % % % % %%% % %%% % %%% % ", +" % % % % % %% % % % % % %%%%% % % %% % %%%%% % %%% % %% % % % %% %% % % % % % % % % % % % ", +" % % % % % % % %%%%%%%%% % % % % % % % % % % % % % % % % % % % ", +" % %%%% % % %%%% % % % % %%%% % % % %%%% % %%% % %%% % %%% % %%% % %%% % % %%% %%% % %% % % % % % % % % % % % % % ", +" % % % % % % %%%%%%% %% % %%%%%%% %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% ", +" % %%% % % % %%% % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% %%% % % % % % % % ", +" % % %%%% % % %%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % %% % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" %%% %%%%% %%% %%%%% % % % % % % % % %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%% %% %%%%% % %%% % % % % % % % %%%%%%% %%%%% %%%%%%% %%%%% %%%%%%% %%%%% %%%%%%% ", +" % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % ", +" %%%%% %% %%%%% %% %% %%% %%% %% %% %% %% ", +" ", +" % % % % % % % % % % ", +" % % % % % % % % % % % % % ", +" % % %%%%% %%% % % % % % % % ", +" % % % %% % % % % % % % ", +" %%% % %%% % % % % % % % % % % % % %%%%% %%%%% % % %%%%% % % %%%%%% %%%%% % %%%%% %%%%% % % %%%%% % %%%%% % % %%%%% ", +" % % % % % % % % % % % % % % % % %%%%% % % %%% % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % %% % %% % %% % %% % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % %%%% % % % % %%%% % % % % %%%% % %%% % % % % %%%% % % %%%%% % % %%%%% % % %%%%% % % %% %% % % % %%% % % % %%% % % % %%% % %%%%% % %%%%% % %%%%% ", +" % %% %% %% % % % %% % % % % %% % % % % %% % %% % % % % %% % % % % % % % % % % % % % % %%% % % % % % %% % % % %% % % % %% % %%%%% % % %%%%% % % %%%%% % % ", +" % %% %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%%%% % % %%%%% % % %%%%% % % % % % % % % ", +" % % % % % % %% % % % %% % % % %% % % % % % %% % % % % % % % % % % % % % % % % % %%%% % % % % % % % % % % %%%%% % %%%%% % %%%%% ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" %%%%% %%%%%% %%%%% % % % % % % % % % % % % % % % % % % %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%%% %% %% % % % % % % % % % %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% ", +" % % % % % % % % ", +" % % % % % % % % % % % % % % % % ", +" %% %% %%% %%% %% %% %% %% ", +" ", +" % % % % % % % % % % % % ", +" % % % % % % %% % % % % % % % % % % % % % % % % % ", +" % % % % % %% %%%%% %%% % % % % % % % % % % % % % ", +" % % % % % % % % % % % % ", +" %%%%% % % %%%%%%% %%%%%%% %%%%%%% % % %% % % % % % % % % % % % % % % % % % % % % % % % % % % % %%%%%%% % %%%%%%% % %%%%%%% % % %% ", +" % % % % % % % % % % % % %% % % %%%%% % % %%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % %%%%% % %%%%%% % %%%%%% %%%%% %%%%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %%%%%%% % %%%%%%% % %%%%%%% % ", +" %%%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % % %%%%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% ", +" % %%%%% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % ", +" % % % % % % % % % % % % % % % % %% % % % %% % % % %% % % % %% % % % %% % % % %% % % % % % % % % % %% % % % % % % % % ", +" %%%%% %%%%% % %%% % %%% % %%% %%% %%%% % %%% %%%% % %%% %%%% % %%% %%%% % %%% %%%% % %%% %%%% % % % % % % %% % %%%%%%% %%%%%%% %%%%%%% %%%%%%% %%%%%%% %%%%%%% % ", +" % % % % % ", +" % % % % % % % % ", +" %% %% %%% %%% %% ", +" ", +" %%%%%%%%% "}; diff --git a/wmdocklib/README b/wmdocklib/README new file mode 100644 index 0000000..c4375c1 --- /dev/null +++ b/wmdocklib/README @@ -0,0 +1,15 @@ +[wmdocklib.WHAT] +wmdocklib is a python module that will help you develop WindowMaker dockapps +in python. It is mostly a wrapper around the functions from the popular +wmgeneral.c, but some new functions are added too. + +It also contains the Python written module pywmhelpers.py which contains +functions to aid the development of wm dockapps. This module contains python +functions that wrap up the functions which the extension module provides. +They ease up argument passing and give nicer return values. Some additional +functions, like help for handling a simple configuration file is also +available. This module is better documented than the pywmgeneral. It is +adviced to only use pywmhelpers and not touch the pywmgeneral module +directly at all. For information about how to use the module, see the +documentation in pywmhelpers.py. It is also possible to import it in the +interactive interpreter and issue 'help(wmdocklib)'. diff --git a/wmdocklib/__init__.py b/wmdocklib/__init__.py new file mode 100644 index 0000000..4102204 --- /dev/null +++ b/wmdocklib/__init__.py @@ -0,0 +1,12 @@ +"""\ +wmdocklib is a python module that will help you develop WindowMaker dockapps +in python. It is mostly a wrapper around the functions from the popular +wmgeneral.c, but some new functions are added too. + +to get help about a contained package, try: +help(wmdocklib.) +""" +from pywmgeneral import * +from pywmhelpers import * + +__all__ = ['wmoo'] diff --git a/wmdocklib/pywmgeneral.c b/wmdocklib/pywmgeneral.c new file mode 100644 index 0000000..457dd42 --- /dev/null +++ b/wmdocklib/pywmgeneral.c @@ -0,0 +1,809 @@ +/* pywmgeneral.c + * + * Python bindings to some of the most important functions in the widely used + * wmgeneral.c. Also some added functions. The rc file parser is removed since + * Python provide better facilities for this. + * + * Copyright (C) 2003 Kristoffer Erlandsson + * + * Licensed under the GNU General Public License. + * + * History: + * + * 2003-06-24 Kristoffer Erlandsson + * Added some additional event handling. + * + * 2003-06-16 Kristoffer Erlandsson + * Added checkForMouseClick to make catching of mouse clicks available from + * Python. + * + * 2003-06-14 Kristoffer Erlandsson + * Finished support for "everything" included in wmgeneral by default. + * + * 2003-06-13 Kristoffer Erlandsson + * File created made most of the pure wrapper functions and xpm inclusion. + * + * + * + * Thanks to Martijn Pieterse for createing the original wmgeneral.c + * +*/ + +#include +#include "structmember.h" +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "pywmgeneral.h" + + /*****************/ + /* X11 Variables */ +/*****************/ + +Window Root; +int screen; +int x_fd; +int d_depth; +XSizeHints mysizehints; +XWMHints mywmhints; +Pixel back_pix, fore_pix; +char *Geometry = ""; +Window iconwin, win; +GC NormalGC; +XpmIcon wmgen; +Pixmap pixmask; +Atom deleteAtom; /* Added 2003-06-24 for graceful shutdown. */ + +/*****************************************************************************/ +/* The Python stuff */ +/*****************************************************************************/ +static char **pixmap; /* Global pixmap, we only support one of these */ +static char *maskBits; /* Global maskbits, also only 1 supported */ + +char **pyListToStrs(PyObject *l) { + /* Convert a python list of strings to a char **. */ + int size, i; + char **target; + PyObject *s; + if (!PyList_Check(l)) { + PyErr_SetString(PyExc_TypeError, "List expected."); + return NULL; + } + size = PyList_Size(l); + target = (char **)malloc(size * sizeof(char *)); + for (i = 0; i < size; i++) { + s = PySequence_GetItem(l, i); + if (s == NULL) + return NULL; /* Shouldn't happen. */ + if (!PyString_Check(s)) { + PyErr_SetString(PyExc_TypeError, "String expected."); + return NULL; + } + target[i] = PyString_AsString(s); + } + return target; +} + + +static PyObject * +pywmgeneral_includePixmap(PyObject *self, PyObject *args) { + /* Set the global pixmap. */ + PyObject *arg; + if (!PyArg_ParseTuple(args, "O", &arg)) + return NULL; + if(!(pixmap = pyListToStrs(arg))) + return NULL; + Py_INCREF(Py_None); + return Py_None; +} + + +static PyObject * +pywmgeneral_openXwindow(PyObject *self, PyObject *args) { + /* This function now uses the global variable pixmap as xpm and creates the + * xbm mask of the given height and width from this one. IOW no other xbm + * masks are supported at the moment. This shouldn't be needed except in + * special cases (I think...) + */ + int argc, width, height; + PyObject *argvTmp; + char **argv; + if (!PyArg_ParseTuple(args, "iOii", &argc, &argvTmp, &width, &height)) + return NULL; + if (!(argv = pyListToStrs(argvTmp))) + return NULL; + maskBits = (char *)malloc(width * height * sizeof(char)); + createXBMfromXPM(maskBits, pixmap, width, height); + openXwindow(argc, argv, pixmap, maskBits, width, height); + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject * +pywmgeneral_redrawWindow(PyObject *self, PyObject *args) { + if (!PyArg_ParseTuple(args, "")) + return NULL; + RedrawWindow(); + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject * +pywmgeneral_redrawWindowXY(PyObject *self, PyObject *args) { + int x, y; + if (!PyArg_ParseTuple(args, "ii", &x, &y)) + return NULL; + RedrawWindowXY(x, y); + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject * +pywmgeneral_addMouseRegion(PyObject *self, PyObject *args) { + int index, left, top, right, bottom; + if (!PyArg_ParseTuple(args, "iiiii", &index, &left, &top, &right, &bottom)) + return NULL; + AddMouseRegion(index, left, top, right, bottom); + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject * +pywmgeneral_checkMouseRegion(PyObject *self, PyObject *args) { + int x, y; + if (!PyArg_ParseTuple(args, "ii", &x, &y)) + return NULL; + return Py_BuildValue("i", CheckMouseRegion(x, y)); +} + +static PyObject * +pywmgeneral_copyXPMArea(PyObject *self, PyObject *args) { + /* sx - source x, sy - source y + * sw - width, sw - height + * dx - destination x, dy - destination y + * + * in the original wmgeneral.c variables are named differently. + */ + int sx, sy, sw, sh, dx, dy; + if (!PyArg_ParseTuple(args, "iiiiii", &sx, &sy, &sw, &sh, &dx, &dy)) + return NULL; + copyXPMArea(sx, sy, sw, sh, dx, dy); + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject * +pywmgeneral_checkForEvents(PyObject *self, PyObject *args) { + /* If we find an event we handle, return a dicitionary containing some + * information about it. Return None if there are no events we handle. + * Ignore events we don't handle. Also we provide a handler for when the + * window is exposed, redraw it. + */ + XEvent event; + if (!PyArg_ParseTuple(args, "")) + return NULL; + while (XPending(display)) { + XNextEvent(display, &event); + switch(event.type) { + + case Expose: + RedrawWindow(); + break; + + case EnterNotify: + case LeaveNotify: + /* needed by KeyPress/release, otherwise events go to parent. */ + XSetInputFocus(display, PointerRoot, RevertToParent, CurrentTime); + break; + + case KeyPress: + return Py_BuildValue("{s:s,s:i,s:i}", + "type", "keypress", + "state", event.xkey.state, + "keycode", event.xkey.keycode); + + case ButtonPress: + case ButtonRelease: + return Py_BuildValue("{s:s,s:i,s:i,s:i}", + "type", event.type==ButtonPress?"buttonpress":"buttonrelease", + "button", event.xbutton.button, + "x", event.xbutton.x, "y", event.xbutton.y); + + case ClientMessage: + if((Atom)event.xclient.data.l[0] == deleteAtom) { + XCloseDisplay(display); + return Py_BuildValue("{s:s}", "type", "destroynotify"); + } + break; + + case DestroyNotify: + /* This seems to never happen, why? */ + XCloseDisplay(display); + return Py_BuildValue("{s:s}", "type", "destroynotify"); + + } + } + Py_INCREF(Py_None); + return Py_None; +} + +static PyMethodDef PyWmgeneralMethods[] = { + {"openXwindow", pywmgeneral_openXwindow, METH_VARARGS, + "Open the X window containing everything."}, + {"includePixmap", pywmgeneral_includePixmap, METH_VARARGS, + "Set the global pixmap that will be used as a mask and for everything else."}, + {"redrawWindow", pywmgeneral_redrawWindow, METH_VARARGS, + "Redraw the window."}, + {"redrawWindowXY", pywmgeneral_redrawWindowXY, METH_VARARGS, + "Redraw a give region of the window."}, + {"addMouseRegion", pywmgeneral_addMouseRegion, METH_VARARGS, + "Add a mouse region with a given index."}, + {"checkMouseRegion", pywmgeneral_checkMouseRegion, METH_VARARGS, + "Check if the given coordinates are in any mouse region."}, + {"copyXPMArea", pywmgeneral_copyXPMArea, METH_VARARGS, + "Copy an area of the global XPM."}, + {"checkForEvents", pywmgeneral_checkForEvents, METH_VARARGS, + "Check for some Xevents"}, + {NULL, NULL, 0, NULL} +}; + +typedef struct { + PyObject_HEAD + /* Type-specific fields go here. */ + int has_drawable; + Pixmap drawable; + int width, height; +} drawable_DrawableObject; + +static PyObject * +Drawable_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + drawable_DrawableObject *self; + + self = (drawable_DrawableObject *)type->tp_alloc(type, 0); + if (self != NULL) { + self->has_drawable = 0; + self->width = 0; + self->height = 0; + } + + return (PyObject *)self; +} + +static int +Drawable_init(drawable_DrawableObject *self, PyObject *args, PyObject *kwds) +{ + unsigned int w, h; + if (! PyArg_ParseTuple(args, "ii", &w, &h)) + return -1; + if (!wmgen.attributes.depth) { + PyErr_SetString(PyExc_RuntimeError, "X client must be initialized first."); + return -1; + } + + if (self->has_drawable) + XFreePixmap(display, self->drawable); + self->has_drawable = 1; + self->width = w; + self->height = h; + self->drawable = XCreatePixmap(display, wmgen.pixmap, + w, h, wmgen.attributes.depth); + + return 0; +} + +static void +Drawable_dealloc(drawable_DrawableObject *self) +{ + if (self->has_drawable) + XFreePixmap(display, self->drawable); +} + +static PyObject * +Drawable_xCopyAreaToWindow(drawable_DrawableObject *self, PyObject *args, PyObject *kwds) +{ + unsigned int src_x, src_y, width, height, dst_x, dst_y; + if (! PyArg_ParseTuple(args, "iiiiii", &src_x, &src_y, &width, &height, &dst_x, &dst_y)) + return NULL; + + XCopyArea(display, self->drawable, wmgen.pixmap, NormalGC, + src_x, src_y, width, height, dst_x, dst_y); + + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject * +Drawable_xClear(drawable_DrawableObject *self, PyObject *args, PyObject *kwds) +{ + XFillRectangle(display, self->drawable, NormalGC, + 0, 0, self->width, self->height); + + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject * +Drawable_xCopyAreaFromWindow(drawable_DrawableObject *self, PyObject *args, PyObject *kwds) +{ + unsigned int src_x, src_y, width, height, dst_x, dst_y; + if (! PyArg_ParseTuple(args, "iiiiii", &src_x, &src_y, &width, &height, &dst_x, &dst_y)) + return NULL; + + XCopyArea(display, wmgen.pixmap, self->drawable, NormalGC, + src_x, src_y, width, height, dst_x, dst_y); + + Py_INCREF(Py_None); + return Py_None; +} + +static PyMemberDef Drawable_members[] = { + {NULL} /* Sentinel */ +}; + +static PyMethodDef Drawable_methods[] = { + {"xCopyAreaFromWindow", (PyCFunction)Drawable_xCopyAreaFromWindow, METH_VARARGS, + "copy from the drawable to the global pixmap" + }, + {"xCopyAreaToWindow", (PyCFunction)Drawable_xCopyAreaToWindow, METH_VARARGS, + "copy from the global pixmap into the drawable" + }, + {"xClear", (PyCFunction)Drawable_xClear, METH_NOARGS, + "clears the pixmap" + }, + {NULL} /* Sentinel */ +}; + +static PyTypeObject drawable_DrawableType = { + PyObject_HEAD_INIT(NULL) + 0, /*ob_size*/ + "pyywmgeneral.Drawable", /*tp_name*/ + sizeof(drawable_DrawableObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor)Drawable_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash */ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + "Drawable objects", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + Drawable_methods, /* tp_methods */ + Drawable_members, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)Drawable_init, /* tp_init */ + 0, /* tp_alloc */ + Drawable_new, /* tp_new */ +}; + +/*****************************************************************************/ +/* Original C sources (With some modifications) */ +/*****************************************************************************/ + + /*****************/ + /* Mouse Regions */ +/*****************/ + +typedef struct { + int enable; + int top; + int bottom; + int left; + int right; +} MOUSE_REGION; + +MOUSE_REGION mouse_region[MAX_MOUSE_REGION]; + + /***********************/ + /* Function Prototypes */ +/***********************/ + +static void GetXPM(XpmIcon *, char **); +static Pixel GetColor(char *); +void RedrawWindow(void); +void AddMouseRegion(int, int, int, int, int); +int CheckMouseRegion(int, int); + +/*******************************************************************************\ +|* GetXPM *| +\*******************************************************************************/ + +static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) { + + XWindowAttributes attributes; + int err; + + /* For the colormap */ + XGetWindowAttributes(display, Root, &attributes); + + wmgen->attributes.valuemask |= (XpmReturnPixels | XpmReturnExtensions); + wmgen->attributes.depth = attributes.depth; + + err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap), + &(wmgen->mask), &(wmgen->attributes)); + + if (err != XpmSuccess) { + fprintf(stderr, "Not enough free colorcells. %d\n", err); + exit(1); + } +} + +/*******************************************************************************\ +|* GetColor *| +\*******************************************************************************/ + +static Pixel GetColor(char *name) { + + XColor color; + XWindowAttributes attributes; + + XGetWindowAttributes(display, Root, &attributes); + + color.pixel = 0; + if (!XParseColor(display, attributes.colormap, name, &color)) { + fprintf(stderr, "wm.app: can't parse %s.\n", name); + } else if (!XAllocColor(display, attributes.colormap, &color)) { + fprintf(stderr, "wm.app: can't allocate %s.\n", name); + } + return color.pixel; +} + +/*******************************************************************************\ +|* flush_expose *| +\*******************************************************************************/ + +static int flush_expose(Window w) { + + XEvent dummy; + int i=0; + + while (XCheckTypedWindowEvent(display, w, Expose, &dummy)) + i++; + + return i; +} + +/*******************************************************************************\ +|* RedrawWindow *| +\*******************************************************************************/ + +void RedrawWindow(void) { + + flush_expose(iconwin); + XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, + 0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0); + flush_expose(win); + XCopyArea(display, wmgen.pixmap, win, NormalGC, + 0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0); +} + +/*******************************************************************************\ +|* RedrawWindowXY *| +\*******************************************************************************/ + +void RedrawWindowXY(int x, int y) { + + flush_expose(iconwin); + XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, + x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0); + flush_expose(win); + XCopyArea(display, wmgen.pixmap, win, NormalGC, + x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0); +} + +/*******************************************************************************\ +|* AddMouseRegion *| +\*******************************************************************************/ + +void AddMouseRegion(int index, int left, int top, int right, int bottom) { + + if (index < MAX_MOUSE_REGION) { + mouse_region[index].enable = 1; + mouse_region[index].top = top; + mouse_region[index].left = left; + mouse_region[index].bottom = bottom; + mouse_region[index].right = right; + } +} + +/*******************************************************************************\ +|* CheckMouseRegion *| +\*******************************************************************************/ + +int CheckMouseRegion(int x, int y) { + + int i; + int found; + + found = 0; + + for (i=0; i= mouse_region[i].left && + y <= mouse_region[i].bottom && + y >= mouse_region[i].top) + found = 1; + } + if (!found) return -1; + return (i-1); +} + +/*******************************************************************************\ +|* createXBMfromXPM *| +\*******************************************************************************/ +void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) { + + int i,j,k; + int width, height, numcol, depth; + int zero=0; + unsigned char bwrite; + int bcount; + int curpixel; + + sscanf(*xpm, "%d %d %d %d", &width, &height, &numcol, &depth); + + + for (k=0; k!=depth; k++) + { + zero <<=8; + zero |= xpm[1][k]; + } + + for (i=numcol+1; i < numcol+sy+1; i++) { + bcount = 0; + bwrite = 0; + for (j=0; j>= 1; + + curpixel=0; + for (k=0; k!=depth; k++) + { + curpixel <<=8; + curpixel |= xpm[i][j+k]; + } + + if ( curpixel != zero ) { + bwrite += 128; + } + bcount++; + if (bcount == 8) { + *xbm = bwrite; + xbm++; + bcount = 0; + bwrite = 0; + } + } + } +} + +/*******************************************************************************\ +|* copyXPMArea *| +\*******************************************************************************/ + +void copyXPMArea(int x, int y, int sx, int sy, int dx, int dy) { + /* in pywmgeneral_copyXPMArea variables are named differently. + */ + + XCopyArea(display, wmgen.pixmap, wmgen.pixmap, NormalGC, x, y, sx, sy, dx, dy); + +} + +/*******************************************************************************\ +|* copyXBMArea *| +\*******************************************************************************/ + +void copyXBMArea(int x, int y, int sx, int sy, int dx, int dy) { + + XCopyArea(display, wmgen.mask, wmgen.pixmap, NormalGC, x, y, sx, sy, dx, dy); +} + + +/*******************************************************************************\ +|* setMaskXY *| +\*******************************************************************************/ + +void setMaskXY(int x, int y) { + + XShapeCombineMask(display, win, ShapeBounding, x, y, pixmask, ShapeSet); + XShapeCombineMask(display, iconwin, ShapeBounding, x, y, pixmask, ShapeSet); +} + +/*******************************************************************************\ +|* openXwindow *| +\*******************************************************************************/ +void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, int pixmask_width, int pixmask_height) { + + unsigned int borderwidth = 1; + XClassHint classHint; + char *display_name = NULL; + char *wname = argv[0]; + XTextProperty name; + + XGCValues gcv; + unsigned long gcm; + + char *geometry = NULL; + + int dummy=0; + int i, wx, wy; + + /* Changed to work better with Python. Changed check in for loop to control + * argc instead of argv. + */ + for (i=1; i < argc; i++) { + if (!strcmp(argv[i], "-display")) { + display_name = argv[i+1]; + i++; + } + if (!strcmp(argv[i], "-geometry")) { + geometry = argv[i+1]; + i++; + } + } + + if (!(display = XOpenDisplay(display_name))) { + fprintf(stderr, "%s: can't open display %s\n", + wname, XDisplayName(display_name)); + exit(1); + } + screen = DefaultScreen(display); + Root = RootWindow(display, screen); + d_depth = DefaultDepth(display, screen); + x_fd = XConnectionNumber(display); + + /* Convert XPM to XImage */ + GetXPM(&wmgen, pixmap_bytes); + + /* Create a window to hold the stuff */ + mysizehints.flags = USSize | USPosition; + mysizehints.x = 0; + mysizehints.y = 0; + + back_pix = GetColor("white"); + fore_pix = GetColor("black"); + + XWMGeometry(display, screen, Geometry, NULL, borderwidth, &mysizehints, + &mysizehints.x, &mysizehints.y,&mysizehints.width,&mysizehints.height, &dummy); + + mysizehints.width = 64; + mysizehints.height = 64; + + win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y, + mysizehints.width, mysizehints.height, borderwidth, + fore_pix, back_pix); + + iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y, + mysizehints.width, mysizehints.height, borderwidth, + fore_pix, back_pix); + + + /* Added 2003-06-24 for graceful shutdown. */ + deleteAtom = XInternAtom(display, "WM_DELETE_WINDOW", 0); + XSetWMProtocols(display, win, &deleteAtom, 1); + + + /* Activate hints */ + XSetWMNormalHints(display, win, &mysizehints); + classHint.res_name = wname; + classHint.res_class = wname; + XSetClassHint(display, win, &classHint); + + XSelectInput(display, win, + ExposureMask | + ButtonPressMask | + ButtonReleaseMask | /* added ButtonReleaseMask *charkins*/ + KeyPressMask | /* Try this to get keyboard working */ + PointerMotionMask | + FocusChangeMask | + LeaveWindowMask | + StructureNotifyMask | + EnterWindowMask ); + XSelectInput(display, iconwin, + ExposureMask | + ButtonPressMask | + ButtonReleaseMask | /* added ButtonReleaseMask *charkins*/ + KeyPressMask | /* Try this to get keyboard working */ + PointerMotionMask | + FocusChangeMask | + LeaveWindowMask | + StructureNotifyMask | + EnterWindowMask ); + //ButtonPressMask | ButtonReleaseMask | KeyPressMask | KeyReleaseMask | + //ExposureMask | + //FocusChangeMask | EnterWindowMask | + //PointerMotionMask | StructureNotifyMask); + + if (XStringListToTextProperty(&wname, 1, &name) == 0) { + fprintf(stderr, "%s: can't allocate window name\n", wname); + exit(1); + } + + XSetWMName(display, win, &name); + + /* Create GC for drawing */ + + gcm = GCForeground | GCBackground | GCGraphicsExposures; + gcv.foreground = fore_pix; + gcv.background = back_pix; + gcv.graphics_exposures = 0; + NormalGC = XCreateGC(display, Root, gcm, &gcv); + + /* ONLYSHAPE ON */ + + pixmask = XCreateBitmapFromData(display, win, pixmask_bits, pixmask_width, pixmask_height); + + XShapeCombineMask(display, win, ShapeBounding, 0, 0, pixmask, ShapeSet); + XShapeCombineMask(display, iconwin, ShapeBounding, 0, 0, pixmask, ShapeSet); + + /* ONLYSHAPE OFF */ + + mywmhints.initial_state = WithdrawnState; + mywmhints.icon_window = iconwin; + mywmhints.icon_x = mysizehints.x; + mywmhints.icon_y = mysizehints.y; + mywmhints.window_group = win; + mywmhints.flags = StateHint | IconWindowHint | IconPositionHint | WindowGroupHint; + + XSetWMHints(display, win, &mywmhints); + + XSetCommand(display, win, argv, argc); + XMapWindow(display, win); + + if (geometry) { + if (sscanf(geometry, "+%d+%d", &wx, &wy) != 2) { + fprintf(stderr, "Bad geometry string.\n"); + exit(1); + } + XMoveWindow(display, win, wx, wy); + } +} + +#ifndef PyMODINIT_FUNC /* declarations for DLL import/export */ +#define PyMODINIT_FUNC void +#endif + +PyMODINIT_FUNC +initpywmgeneral(void) { + PyObject* m; + + drawable_DrawableType.tp_new = PyType_GenericNew; + if (PyType_Ready(&drawable_DrawableType) < 0) + return; + + m = Py_InitModule3("pywmgeneral", PyWmgeneralMethods, + "base C module for wmdocklib"); + if (m == NULL) + return; + + Py_INCREF(&drawable_DrawableType); + PyModule_AddObject(m, "Drawable", (PyObject *)&drawable_DrawableType); +} diff --git a/wmdocklib/pywmgeneral.h b/wmdocklib/pywmgeneral.h new file mode 100644 index 0000000..f532437 --- /dev/null +++ b/wmdocklib/pywmgeneral.h @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2003 Kristoffer Erlandsson + * + * Licensed under the GNU General Public License. + * Copyright (C) 2003 Kristoffer Erlandsson + * + * Licensed under the GNU General Public License. + */ + +#ifndef WMGENERAL_H_INCLUDED +#define WMGENERAL_H_INCLUDED + + /***********/ + /* Defines */ +/***********/ + +#define MAX_MOUSE_REGION (16) + + /************/ + /* Typedefs */ +/************/ + +typedef struct _rckeys rckeys; + +struct _rckeys { + const char *label; + char **var; +}; + +typedef struct _rckeys2 rckeys2; + +struct _rckeys2 { + const char *family; + const char *label; + char **var; +}; + +typedef struct { + Pixmap pixmap; + Pixmap mask; + XpmAttributes attributes; +} XpmIcon; + + /*******************/ + /* Global variable */ +/*******************/ + +Display *display; + + /***********************/ + /* Function Prototypes */ +/***********************/ + +void AddMouseRegion(int index, int left, int top, int right, int bottom); +int CheckMouseRegion(int x, int y); + +void openXwindow(int argc, char *argv[], char **, char *, int, int); +void RedrawWindow(void); +void RedrawWindowXY(int x, int y); + +void createXBMfromXPM(char *, char **, int, int); +void copyXPMArea(int, int, int, int, int, int); +void copyXBMArea(int, int, int, int, int, int); +void setMaskXY(int, int); + +#endif diff --git a/wmdocklib/pywmhelpers.py b/wmdocklib/pywmhelpers.py new file mode 100644 index 0000000..1ea50d5 --- /dev/null +++ b/wmdocklib/pywmhelpers.py @@ -0,0 +1,458 @@ +"""pywmhelpers.py + +Various helper functions when writing wm dockapps in Python. This module +is way better commented than the pywmgeneral one. This is the one +intented for use in applications. Many functions are just wrappers +around the ones in pywmgeneral but with nicer interfaces and better +documentation. + +Copyright (C) 2003 Kristoffer Erlandsson + +Licensed under the GNU General Public License + + +Changes: + +2006-10-10 Mario Frasca +redesigned xpm initialization + +2003-06-25 Kristoffer Erlandsson +Updated documentation + +2003-06-24 Kristoffer Erlandsson +Some changes to handle the additional event handling in pywmgeneral + +2003-06-16 Kristoffer Erlandsson +First workingish version +""" + +import os, re, types +import ConfigParser + +charset_start = None +charset_width = None +pattern_start = None + +import pywmgeneral +defaultRGBFileList = [ + '/etc/X11/rgb.txt', + '/usr/lib/X11/rgb.txt', + '/usr/share/X11/rgb.txt', + '/usr/X11R6/lib/X11/rgb.txt', + '/usr/lib/X11/rgb.txt', + ] + +def readConfigFile(fileName, errOut): + """Read the config file fileName. + + Return a dictionary with the options and values in the DEFAULT + section. Ignore everything else. The configuration file should not + get so complicated so that sections are needed. errOut is the + file-like object to which error messages will be printed. + """ + if not os.access(fileName, os.R_OK): + if errOut: + errOut.write( + 'Configuration file is not readable. Using defaults.\n') + return {} + cp = ConfigParser.ConfigParser() + try: + cp.read(fileName) + except ConfigParser.Error, e: + if errOut: + errOut.write('Error in configuration file:\n') + errOut.write(str(e) + '\nUsing defaults.') + return {} + defaults = cp.defaults() + if defaults == {}: + if errOut: + errOut.write( + 'Missing or empty DEFAULT section in the config file.\n') + errOut.write('Using defaults.\n') + return defaults + +def getCenterStartPos(s, areaWidth, offset): + """Get the x starting position if we want to paint s centred.""" + w = len(s) * char_width + textArea = areaWidth - offset * 2 - 1 + return (textArea - w) / 2 + +def addChar(ch, x, y, xOffset, yOffset, width, height, drawable=None): + """Paint the character ch at position x, y in the window. + + Return the (width, height) of the character painted. (will be useful if + we implement proportional char sets) + + the library only supports lower ascii: 32-127. any other will cause a + ValueError exception. + + if the character being painted falls partly out of the boundary, it will + be clipped without causing an exception. this works even if the + character starts out of the boundary. + """ + + if not (32 <= ord(ch) <= 127): + #print ord(ch) + #raise ValueError, "Unsupported Char: '%s'(%d)" % (ch, ord(ch)) + pass + + # linelength is the amount of bits the character set uses on each row. + linelength = charset_width - (charset_width % char_width) + # pos is the horizontal index of the box containing ch. + pos = (ord(ch)-32) * char_width + # translate pos into chX, chY, rolling back and down each linelength + # bits. character definition start at row 64, column 0. + chY = (pos / linelength) * char_height + charset_start + chX = pos % linelength + targX = x + xOffset + targY = y + yOffset + chW = char_width + if ch in "',.:;": + chW = char_twidth + if drawable is None: + pywmgeneral.copyXPMArea(chX, chY, chW, char_height, targX, targY) + else: + drawable.xCopyAreaFromWindow(chX, chY, chW, char_height, targX, targY) + return (chW, char_height) + +def addString(s, x, y, xOffset=0, yOffset=0, width=None, height=None, drawable=None): + """Add a string at the given x and y positions. + + Call addChar repeatedely, so the same exception rules apply.""" + lastW = 0 + for letter in s: + w, h = addChar(letter, x + lastW, y, + xOffset, yOffset, width, height, + drawable) + lastW += w + +def getVertSpacing(numLines, margin, height, yOffset): + """Return the optimal spacing between a number of lines. + + margin is the space we want between the first line and the top.""" + h = height - (numLines * char_height + 1) - yOffset * 2 - margin + return h / (numLines - 1) + + +def readXPM(fileName): + """Read the xpm in filename. + + Return the pair (palette, pixels). + + palette is a dictionary char->color (no translation attempted). + pixels is a list of strings. + + Raise IOError if we run into trouble when trying to read the file. This + function has not been tested extensively. do not try to use more than + """ + f = file(fileName, 'r') + lines = [l.rstrip('\n') for l in f.readlines()] + s = ''.join(lines) + res = [] + while 1: + nextStrStart = s.find('"') + if nextStrStart != -1: + nextStrEnd = s.find('"', nextStrStart + 1) + if nextStrEnd != -1: + res.append(s[nextStrStart+1:nextStrEnd]) + s = s[nextStrEnd+1:] + continue + break + + palette = {} + colorCount = int(res[0].split(' ')[2]) + charsPerColor = int(res[0].split(' ')[3]) + assert(charsPerColor == 1) + for i in range(colorCount): + colorChar = res[i+1][0] + colorName = res[i+1][1:].split()[1] + palette[colorChar] = colorName + res = res[1 + int(res[0].split(' ')[2]):] + return palette, res + +def initPixmap(background=None, + patterns=None, + style='3d', + width=64, height=64, + margin=3, + font_name='6x8', + bg=0, fg=7, + palette=None, debug = 0): + """builds and sets the pixmap of the program. + + the (width)x(height) upper left area is the work area in which we put + what we want to be displayed. + + the remaining upper right area contains patterns that can be used for + blanking/resetting portions of the displayed area. + + the remaining lower area defines the character set. this is initialized + using the corresponding named character set. a file with this name must + be found somewhere in the path. + + palette is a dictionary + 1: of integers <- [0..15] to colors. + 2: of single chars to colors. + + a default palette is provided, and can be silently overwritten with the + one passed as parameter. + + The XBM mask is created out of the XPM. + """ + + # initially all characters 32-126 are available... + available = dict([(chr(ch), True) for ch in range(32,127)]) + + # a palette is a dictionary from one single letter to an hexadecimal + # color. per default we offer a 16 colors palette including what I + # consider the basic colors: + basic_colors = ['black', 'blue3', 'green3', 'cyan3', + 'red3', 'magenta3', 'yellow3', 'gray', + 'gray41', 'blue1', 'green1', 'cyan1', + 'red1', 'magenta1', 'yellow1', 'white'] + + if isinstance(patterns, str): + palette, patterns = readXPM(patterns) + if isinstance(background, str): + palette, background = readXPM(background) + + alter_palette, palette = palette, {} + for name, index in zip(basic_colors, range(16)): + palette['%x'%index] = getColorCode(name) + available['%x'%index] = False + palette[' '] = 'None' + available[' '] = False + + # palette = {' ': None, '0':..., '1':..., ..., 'f':...} + + if alter_palette is not None: + # alter_palette contains 0..15/chr -> 'name'/'#hex' + # interpret that as chr -> '#hex' + for k,v in alter_palette.items(): + if isinstance(k, int): + k = '%x' % k + k = k[0] + if not v.startswith('#'): + v = getColorCode(v) + palette[k] = v + available[k] = False + + if isinstance(bg, int): + bg = '%x' % bg + if isinstance(fg, int): + fg = '%x' % fg + + if patterns is None: + patterns = [bg*width]*height + + if style == '3d': ex = '7' + else: ex = bg + + if background is None: + background = [ + ' '*width + for item in range(margin) + ] + [ + ' '*margin + bg*(width-2*margin-1) + ex + ' '*(margin) + for item in range(margin,height-margin-1) + ] + [ + ' '*margin + ex*(width-2*margin) + ' '*(margin) + ] + [ + ' '*width for item in range(margin) + ] + elif isinstance(background, types.ListType) and not isinstance(background[0], types.StringTypes): + nbackground = [[' ']*width for i in range(height)] + for ((left, top),(right, bottom)) in background: + for x in range(left, right+1): + for y in range(top, bottom): + if x < right: + nbackground[y][x] = bg + else: + nbackground[y][x] = ex + nbackground[bottom][x] = ex + background = [ ''.join(item) for item in nbackground ] + + global tile_width, tile_height + tile_width = width + tile_height = height + + global pattern_start + pattern_start = height + + def readFont(font_name): + # read xpm, return cell_size, definition and palette. + font_palette, fontdef = readXPM(__file__[:__file__.rfind(os.sep) + 1] + font_name + '.xpm') + + import re + m = re.match(r'.*?(?P[0-9]+)(?:\((?P[0-9]+)\))?x(?P[0-9]+).*', font_name) + if not m: + raise ValueError("can't infer font size from name (does not contain wxh)") + width = int(m.groupdict().get('w')) + height = int(m.groupdict().get('h')) + thinwidth = int(m.groupdict().get('t') or width) + + replace = [] + for code, value in font_palette.items(): + if available[code]: + continue + if palette[code] != font_palette[code]: + newcode = [k for k in available if available[k] and not k in font_palette][0] + available[newcode] = False + replace.append((code, newcode)) + for code, newcode in replace: + for row, i in zip(fontdef,range(len(fontdef))): + fontdef[i] = row.replace(code, newcode) + font_palette[newcode] = font_palette[code] + del font_palette[code] + return width, height, thinwidth, fontdef, font_palette + + def calibrateFontPalette(font_palette, fg, bg): + """computes modified font_palette + + takes into account only intensity of original value. + + fg, bg must be of the form #xxxxxx + + the corresponding calibrated color lies at a specific percentage of + the vector going from background to foreground.""" + + bg_point = [int(bg[i*2+1:i*2+3],16) for i in range(3)] + fg_point = [int(fg[i*2+1:i*2+3],16) for i in range(3)] + + fg_vec = [f-b for (f,b) in zip(fg_point,bg_point)] + + new_font_palette = {} + for k, colorName in font_palette.items(): + if colorName == 'None': + continue + origColor = getColorCode(colorName)[1:] + origRgb = [int(origColor[i*2:i*2+2],16)/256. for i in range(3)] + intensity = sum(origRgb) / 3 + newRgb = [i * intensity + base for i,base in zip(fg_vec, bg_point)] + new_font_palette[k] = '#'+''.join(["%02x"%i for i in newRgb]) + + return new_font_palette + + global char_width, char_height, char_twidth + char_width, char_height, char_twidth, fontdef, font_palette = readFont(font_name) + font_palette = calibrateFontPalette(font_palette, palette[fg], palette[bg]) + + palette.update(font_palette) + + global charset_start, charset_width + charset_start = height + len(patterns) + charset_width = len(fontdef[0]) + + xpmwidth = max(len(background[0]), len(patterns[0]), len(fontdef[0])) + xpmheight = len(background)+len(patterns)+len(fontdef) + + xpm = [ + '%s %s %d 1' % (xpmwidth, xpmheight, len(palette)), + ] + [ + '%s\tc %s' % (k,v) + for k,v in palette.items() + if v == 'None' + ] + [ + '%s\tc %s' % (k,v) + for k,v in palette.items() + if v != 'None' + ] + [ + item+' '*(xpmwidth-len(item)) + for item in background + patterns + ] + [ + line + ' '*(xpmwidth-len(line)) + for line in fontdef + ] + if debug: + print '/* XPM */\nstatic char *_x_[] = {' + for item in xpm: + print '"%s",' % item + print '};' + pywmgeneral.includePixmap(xpm) + return char_width, char_height + +def openXwindow(argv, w, h): + """Open the X window of given width and height. + + The XBM mask is here created from the upper left rectangle of the + XPM using the given width and height.""" + pywmgeneral.openXwindow(len(argv), argv, w, h) + +def redraw(): + """Redraw the window.""" + pywmgeneral.redrawWindow() + +def redrawXY(x, y): + """Redraw a given region of the window.""" + pywmgeneral.redrawWindowXY(x, y) + +def copyXPMArea(sourceX, sourceY, width, height, targetX, targetY): + """Copy an area of the global XPM.""" + if width > 0 or height > 0: + pywmgeneral.copyXPMArea(sourceX, sourceY, width, height, + targetX, targetY) + +def addMouseRegion(index, left, top, right=None, bottom=None, width=None, height=None): + """Add a mouse region in the window.""" + if right is bottom is None: + right = left + width + bottom = top + height + pywmgeneral.addMouseRegion(index, left, top, right, bottom) + +def checkMouseRegion(x, y): + """Check if x,y is in any mouse region. Return that region, otherwise -1. + """ + return pywmgeneral.checkMouseRegion(x, y) + +def getEvent(): + """Check for XEvents and return one if found. + + Return None if we find no events. There may be events pending still + after this function is called. If an event which we handle is found, + return a dictionary with information about it. All dictionaries + contain a 'type' field identifying the event. Now existing events + with dictionary keys are: + 'buttonrelease': + x, y, button + 'destroynotify': + """ + return pywmgeneral.checkForEvents() + +def getColorCode(colorName, rgbFileName=None): + """Convert a color to rgb code usable in an xpm. + + We use the file rgbFileName for looking up the colors. Return None + if we find no match. The rgbFileName should be like the one found in + /usr/lib/X11R6/rgb.txt on most sytems. + """ + if colorName.startswith('#'): + return colorName + + if rgbFileName is None: + for fn in defaultRGBFileList: + if os.access(fn, os.R_OK): + rgbFileName = fn + break + if rgbFileName is None: + raise ValueError('cannot find rgb file') + + f = file(rgbFileName, 'r') + lines = f.readlines() + f.close() + for l in lines: + if l[0] != '!': + words = l.split() + if len(words) > 3: + name = ' '.join(words[3:]) + if colorName.lower() == name.lower(): + # Found the right color, get it's code + try: + r = int(words[0]) + g = int(words[1]) + b = int(words[2]) + except ValueError: + continue + rgbstr = '#%02x%02x%02x' % (r,g,b) + return rgbstr + return None + diff --git a/wmdocklib/wmoo.py b/wmdocklib/wmoo.py new file mode 100644 index 0000000..13a96bd --- /dev/null +++ b/wmdocklib/wmoo.py @@ -0,0 +1,133 @@ +import sys, time +import pywmhelpers + +debug = 0 + +class Application: + def __init__(self, *args, **kwargs): + """initializes the object + + _events is a list of tuples (type, key, area, callback) + 'type' <- ['buttonpress', 'buttonrelease', 'keypress'], + 'callback': the function to which the event should be passed. + 'key': the utf-8 character or the mouse button number, + 'area': if the pointer is here, the event is considered, + + """ + self._elements = {} + self._events = [] + self._sleep = 0.1 + self._cycle = 0 + self._offset_x = self._offset_y = 3 + + self._char_width, self._char_height = pywmhelpers.initPixmap(*args, **kwargs) + pywmhelpers.openXwindow(sys.argv, 64, 64) + pass + + def putString(self, x, y, string): + pywmhelpers.addString(string, x, y, + self._offset_x, self._offset_y, + self._char_width, self._char_height) + + def putPattern(self, sourceX, sourceY, width, height, targetX, targetY): + pywmhelpers.copyXPMArea(sourceX, sourceY+64, width, height, + targetX, targetY) + + def addLabel(self, labelId, orig, size=None, text=None): + """a label is a tuple with a + text: string; mutable + viewport: (orig: int, int, size: int, int); inmutable + pixmap: drawable; not user mutable, large enough to contain the text + + if size is not given, it is inferred from text. + """ + if size is None: + size = (self._char_width * len(text), self._char_height) + pixmapwidth = self._char_width * len(text) + import pywmgeneral + labelPixmap = pywmgeneral.Drawable(pixmapwidth, self._char_height) + self._elements[labelId] = [orig, size, pixmapwidth, 0, labelPixmap] + self.setLabelText(labelId, text) + + def setLabelText(self, labelId, text): + """updates the drawable associated with labelId + """ + (orig_x,orig_y), (size_x, size_y), width, offset, pixmap = self._elements[labelId] + newwidth = self._char_width * len(text) + if newwidth > width: + import pywmgeneral + pixmap = pywmgeneral.Drawable(newwidth, self._char_height) + self._elements[labelId][4] = pixmap + self._elements[labelId][2] = newwidth + self._elements[labelId][3] = 0 + pixmap.xClear() + pywmhelpers.addString(text, 0, 0, drawable=pixmap) + pixmap.xCopyAreaToWindow(0, 0, size_x, size_y, orig_x, orig_y) + + def update(self): + for labelId in self._elements: + (orig_x,orig_y), (size_x, size_y), width, offset, pixmap = self._elements[labelId] + if size_x < width: + pixmap.xCopyAreaToWindow(offset, 0, size_x, size_y, orig_x, orig_y) + if offset == width: + offset = -size_x + else: + offset += 1 + self._elements[labelId][3] = offset + + pass + + def redraw(self): + self.update() + pywmhelpers.redraw() + + def addHandler(self): + """adds a signal handler. + + if the application receives the signal, the handler is called. + + notice that the operating system does not know 'permanent' handlers, + handlers are called once and that is it. the addHandler function + takes care that the call is repeated each time the signal is + received (repeated signals received during the handling of the + previous signal will be lost, though). + """ + pass + + def addCallback(self, callback, type=None, key=None, area=None ): + """the callback will be called during the eventLoop if the event + matches the requirements on the type of the event, the key and the + area where the event took place. remind that events are mostly + mouse or keyboard event. all fields may be left to their 'None' + default value, in which case the callback is activated on any event. + """ + if area is not None and len(area) is not 4: + area = None + self._events.append( (type, key, area, callback,) ) + pass + + def run(self): + """this contains the eventLoop. events are examined and if a + callback has been registered, it is called, passing it the event as + argument. + """ + while 1: + event = pywmhelpers.getEvent() + while not event is None: + if event['type'] == 'destroynotify': + sys.exit(0) + + for evtype, key, area, callback in self._events: + if evtype is not None and evtype != event['type']: continue + if key is not None and key != event['button']: continue + if area is not None: + if not area[0] <= event['x'] <= area[2]: continue + if not area[1] <= event['y'] <= area[3]: continue + + callback(event) + + event = pywmhelpers.getEvent() + self.redraw() + time.sleep(self._sleep) + + pass