From 612921ae43e518969b26a872ad1ff4cbe1570cb7 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Sun, 5 Oct 2014 10:29:59 -0500 Subject: [PATCH] Remove trailing whitespace. --- AlsaMixer.app/AMixer/AChannel.cc | 2 +- AlsaMixer.app/AMixer/AItem.h | 2 +- AlsaMixer.app/AMixer/AMixer.cc | 6 +- AlsaMixer.app/Main.cc | 8 +- AlsaMixer.app/Mixer.cc | 40 ++--- AlsaMixer.app/Mixer.h | 8 +- AlsaMixer.app/README | 22 +-- AlsaMixer.app/Xpm.cc | 16 +- AlsaMixer.app/Xpm.h | 8 +- AlsaMixer.app/olddoc/ChangeLog.Mixer.app | 26 ++-- AlsaMixer.app/olddoc/README.Mixer.app | 24 +-- Temperature.app/ChangeLog | 2 +- Temperature.app/INSTALL | 6 +- Temperature.app/Main.cc | 8 +- Temperature.app/README | 14 +- Temperature.app/Temperature.cc | 30 ++-- Temperature.app/Temperature.h | 12 +- Temperature.app/Xpm.cc | 22 +-- Temperature.app/Xpm.h | 8 +- wmCalClock/CHANGES | 4 +- wmCalClock/HINTS | 10 +- wmCalClock/INSTALL | 4 +- wmCalClock/README | 6 +- wmCalClock/Src/Makefile | 4 +- wmCalClock/Src/Makefile.sgi | 4 +- wmCalClock/Src/Makefile.solaris | 4 +- wmCalClock/Src/wmCalClock.1 | 16 +- wmCalClock/Src/wmCalClock.c | 104 ++++++------- wmCalClock/Src/wmcalclock.patch | 32 ++-- wmCalClock/Src/xutils.c | 48 +++--- wmCalClock/Src/xutils.h | 4 +- wmCalClock/TODO | 8 +- wmMatrix/COPYING.BSD | 2 +- wmMatrix/Makefile | 8 +- wmMatrix/config.h | 26 ++-- wmMatrix/images/matrix.xbm | 72 ++++----- wmMatrix/matrix.c | 6 +- wmMatrix/wmMatrix.1 | 2 +- wmMatrix/xutils.c | 24 +-- wmMatrix/xutils.h | 2 +- wmMatrix/yarandom.h | 2 +- wmSMPmon/Changelog | 4 +- wmSMPmon/wmSMPmon/Makefile | 4 +- wmSMPmon/wmSMPmon/general.c | 20 +-- wmSMPmon/wmSMPmon/standards.h | 20 +-- wmSMPmon/wmgeneral/wmgeneral.c | 12 +- wmWeather/CHANGES | 18 +-- wmWeather/HINTS | 2 +- wmWeather/INSTALL | 4 +- wmWeather/Src/GrabWeather | 4 +- wmWeather/Src/Makefile | 4 +- wmWeather/Src/wmWeather.1 | 8 +- wmWeather/Src/wmWeather.c | 100 ++++++------- wmWeather/Src/xutils.c | 48 +++--- wmWeather/Src/xutils.h | 4 +- wmacpi/AUTHORS | 2 +- wmacpi/ChangeLog | 102 ++++++------- wmacpi/INSTALL | 2 +- wmacpi/Makefile | 6 +- wmacpi/TODO | 4 +- wmacpi/libacpi.c | 124 ++++++++-------- wmacpi/libacpi.h | 14 +- wmacpi/wmacpi-cli.c | 10 +- wmacpi/wmacpi.1 | 12 +- wmacpi/wmacpi.c | 104 ++++++------- wmacpiload/AUTHORS | 2 +- wmacpiload/doc/wmacpiload.1 | 8 +- wmacpiload/src/main.c | 8 +- wmauda/Makefile | 2 +- wmauda/wmauda.1 | 2 +- wmauda/wmauda.c | 48 +++--- wmbatteries/AUTHORS | 16 +- wmbatteries/README | 2 +- wmbatteries/THANKS | 12 +- wmbatteries/doc/wmbatteries.1 | 14 +- wmbatteries/src/main.c | 90 ++++++------ wmbattery/ChangeLog | 4 +- wmbattery/README | 2 +- wmbattery/TODO | 2 +- wmbattery/acpi.c | 28 ++-- wmbattery/acpi.h | 2 +- wmbattery/apm.h | 2 +- wmbattery/autoconf/install-sh | 16 +- wmbattery/simplehal.c | 12 +- wmbattery/sonypi.c | 10 +- wmbattery/wmbattery.1x | 4 +- wmbattery/wmbattery.c | 46 +++--- wmbiff/AUTHORS | 8 +- wmbiff/FAQ | 40 ++--- wmbiff/Makefile.am | 6 +- wmbiff/NEWS | 100 ++++++------- wmbiff/README | 48 +++--- wmbiff/TODO | 18 +-- wmbiff/autoconf/Makefile.am | 2 +- wmbiff/configure.ac | 16 +- wmbiff/scripts/security.debian.rb | 40 ++--- wmbiff/wmbiff/Client.h | 2 +- wmbiff/wmbiff/Imap4Client.c | 12 +- wmbiff/wmbiff/Makefile.am | 12 +- wmbiff/wmbiff/Pop3Client.c | 12 +- wmbiff/wmbiff/ShellClient.c | 12 +- wmbiff/wmbiff/charutil.c | 2 +- wmbiff/wmbiff/charutil.h | 2 +- wmbiff/wmbiff/gnutls-common.c | 32 ++-- wmbiff/wmbiff/maildirClient.c | 2 +- wmbiff/wmbiff/mboxClient.c | 4 +- wmbiff/wmbiff/passwordMgr.c | 10 +- wmbiff/wmbiff/sample.wmbiffrc | 8 +- wmbiff/wmbiff/socket.c | 6 +- wmbiff/wmbiff/test_wmbiff.c | 12 +- wmbiff/wmbiff/tlsComm.c | 4 +- wmbiff/wmbiff/tlsComm.h | 8 +- wmbiff/wmbiff/wmbiff.1 | 6 +- wmbiff/wmbiff/wmbiff.c | 2 +- wmbiff/wmbiff/wmbiffrc.5.in | 40 ++--- wmbiff/wmgeneral/Makefile.am | 2 +- wmbiff/wmgeneral/misc.c | 6 +- wmbiff/wmgeneral/wmgeneral.c | 6 +- wmbutton/Makefile | 2 +- wmbutton/README | 50 +++---- wmbutton/mask.xbm | 8 +- wmbutton/sample.wmbutton | 2 +- wmcalendar/CHANGES | 8 +- wmcalendar/HINTS | 4 +- wmcalendar/INSTALL | 8 +- wmcalendar/README | 4 +- wmcalendar/Src/Makefile | 10 +- wmcalendar/Src/calendar.c | 84 +++++------ wmcalendar/Src/calendar.h | 2 +- wmcalendar/Src/calendarfunc.c | 46 +++--- wmcalendar/Src/calendarfunc.h | 10 +- wmcalendar/Src/settings.c | 48 +++--- wmcalendar/Src/wmCalendar.1 | 116 +++++++-------- wmcalendar/Src/wmCalendar.c | 92 ++++++------ wmcalendar/Src/wmCalendar.h | 8 +- wmcalendar/TODO | 2 +- wmckgmail/INSTALL | 12 +- wmckgmail/README | 32 ++-- wmckgmail/wmckgmail/wmckgmail.1 | 10 +- wmckgmail/wmckgmail/wmckgmail.c | 48 +++--- wmckgmail/wmgeneral/list.c | 12 +- wmckgmail/wmgeneral/list.h | 2 +- wmckgmail/wmgeneral/misc.c | 24 +-- wmckgmail/wmgeneral/wmgeneral.c | 26 ++-- wmcpuload/ChangeLog | 2 +- wmcpuload/doc/wmcpuload.1 | 2 +- wmcpuload/src/cpu_linux.c | 2 +- wmcpuload/src/cpu_netbsd.c | 2 +- wmfemon/makefile | 2 +- wmfemon/wmfemon.c | 30 ++-- wmfu/Makefile | 2 +- wmfu/extra/Makefile | 2 +- wmfu/list.h | 10 +- wmifinfo/Changelog | 3 +- wmifinfo/Makefile | 8 +- wmifinfo/README | 7 +- wmifinfo/nwn.c | 18 +-- wmifinfo/wmifinfo.c | 162 ++++++++++----------- wmifinfo/xutils.c | 48 +++--- wmifinfo/xutils.h | 4 +- wmitime/BUGS | 2 +- wmitime/CHANGES | 2 +- wmitime/README | 4 +- wmitime/wmgeneral/list.c | 12 +- wmitime/wmgeneral/list.h | 2 +- wmitime/wmgeneral/misc.c | 24 +-- wmitime/wmgeneral/wmgeneral.c | 26 ++-- wmitime/wmitime/wmitime.c | 60 ++++---- wmix/NEWS | 2 +- wmix/README | 6 +- wmix/ui_x.c | 18 +-- wmix/wmix.c | 4 +- wmkeys/wmgeneral/list.c | 12 +- wmkeys/wmgeneral/list.h | 2 +- wmkeys/wmgeneral/misc.c | 24 +-- wmkeys/wmgeneral/wmgeneral.c | 20 +-- wmkeys/wmkeys.c | 8 +- wmmemload/doc/wmmemload.1 | 2 +- wmmemload/src/main.c | 28 ++-- wmmemload/src/mem_openbsd.c | 2 +- wmmixer/CHANGES | 2 +- wmmixer/debian/changelog | 4 +- wmmixer/debian/patches/01_debian_paths.patch | 4 +- .../debian/patches/02_Makefile_optimization.patch | 6 +- wmmixer/exception.h | 2 +- wmmixer/mixctl.cc | 4 +- wmmixer/mixctl.h | 4 +- wmmixer/wmmixer.1 | 6 +- wmmixer/wmmixer.cc | 52 +++---- wmmixer/xhandler.cc | 92 ++++++------ wmmixer/xhandler.h | 6 +- wmmon/CHANGES | 12 +- wmmon/HINTS | 8 +- wmmon/README | 22 +-- wmmon/TODO | 2 +- wmmon/wmgeneral/list.c | 12 +- wmmon/wmgeneral/list.h | 2 +- wmmon/wmgeneral/misc.c | 24 +-- wmmon/wmgeneral/wmgeneral.c | 20 +-- wmmon/wmmon/Makefile | 2 +- wmmon/wmmon/wmmon-mask.xbm | 8 +- wmmon/wmmon/wmmon.1 | 2 +- wmmon/wmmon/wmmon.c | 60 ++++---- wmmoonclock/changelog | 6 +- wmmoonclock/src/CalcEphem.c | 22 +-- wmmoonclock/src/Makefile | 2 +- wmmoonclock/src/Moon.c | 46 +++--- wmmoonclock/src/MoonRise.c | 2 +- wmmoonclock/src/wmMoonClock.1 | 20 +-- wmmoonclock/src/wmMoonClock.c | 126 ++++++++-------- wmmoonclock/src/xutils.c | 48 +++--- wmmoonclock/src/xutils.h | 4 +- wmnet/Changelog | 20 +-- wmnet/Imakefile | 6 +- wmnet/README | 24 +-- wmnet/config.h | 12 +- wmnet/drivers.c | 92 ++++++------ wmnet/wmnet.c | 140 +++++++++--------- wmnet/wmnet.h | 22 +-- wmnet/wmnet.man | 16 +- wmnotify/README | 2 +- wmnotify/doc/wmnotify.man | 2 +- wmnotify/src/Makefile.am | 2 +- wmnotify/src/configfile.c | 42 +++--- wmnotify/src/dockapp.c | 56 +++---- wmnotify/src/imap.c | 28 ++-- wmnotify/src/network.c | 26 ++-- wmnotify/src/options.c | 2 +- wmnotify/src/pop3.c | 20 +-- wmnotify/src/sound.c | 54 +++---- wmnotify/src/wmnotify.c | 32 ++-- wmnotify/src/xevents.c | 8 +- wmpager/README | 32 ++-- wmpager/man/wmpager.1x | 22 +-- wmpager/src/wmpager.c | 42 +++--- wmpager/themes/Makefile.am | 2 +- wmpower/ChangeLog | 10 +- wmpower/LEGGIMI | 8 +- wmpower/README | 2 +- wmpower/configure.in | 2 +- wmpower/src/open_syslog_on_stderr.c | 6 +- wmpower/src/power_management/acpi/libacpi.c | 18 +-- wmpower/src/power_management/apm/libapm.c | 2 +- wmpower/src/power_management/apm/libapm.h | 4 +- wmpower/src/power_management/compal/compal_lib.c | 4 +- wmpower/src/power_management/compal/compal_lib.h | 2 +- wmpower/src/power_management/cpufreq/cpufreq.c | 10 +- wmpower/src/power_management/dell/dell_lib.c | 2 +- wmpower/src/power_management/power_management.c | 2 +- wmpower/src/power_management/toshiba/hci.c | 14 +- wmpower/src/power_management/toshiba/hci.h | 10 +- wmpower/src/power_management/toshiba/sci.c | 10 +- wmpower/src/power_management/toshiba/sci.h | 14 +- wmpower/src/power_management/toshiba/toshiba_lib.c | 6 +- wmpower/src/power_management/toshiba/toshiba_lib.h | 2 +- wmpower/src/wmpower.c | 2 +- wmpower/wmpower.spec | 2 +- wmsm.app/CHANGELOG | 4 +- wmsm.app/INSTALL | 2 +- wmsm.app/wmgeneral/list.c | 12 +- wmsm.app/wmgeneral/list.h | 2 +- wmsm.app/wmgeneral/misc.c | 24 +-- wmsm.app/wmgeneral/wmgeneral.c | 26 ++-- wmsm.app/wmsm/wmsm.c | 8 +- wmsmixer/Imakefile | 2 +- wmsmixer/README | 2 +- wmsmixer/home.wmsmixer | 2 +- wmsmixer/wmsmixer.cc | 12 +- wmstickynotes/wmstickynotes.c | 6 +- wmsupermon/README | 4 +- wmsupermon/TODO | 2 +- wmsupermon/dockapp.c | 28 ++-- wmsupermon/dockapp.h | 20 +-- wmsupermon/panes.c | 2 +- wmsupermon/panes.h | 2 +- wmsupermon/stat_dev.c | 2 +- wmsupermon/wmsupermon.c | 4 +- wmtime/HINTS | 6 +- wmtime/INSTALL | 10 +- wmtime/Imakefile | 2 +- wmtime/wmgeneral/list.c | 12 +- wmtime/wmgeneral/list.h | 2 +- wmtime/wmgeneral/misc.c | 24 +-- wmtime/wmgeneral/wmgeneral.c | 20 +-- wmtime/wmtime/wmtime.1 | 2 +- wmtime/wmtime/wmtime.c | 58 ++++---- wmtv/CHANGES | 14 +- wmtv/README | 56 +++---- wmtv/src/channels.h | 10 +- wmtv/src/wmgeneral/list.c | 12 +- wmtv/src/wmgeneral/list.h | 2 +- wmtv/src/wmgeneral/misc.c | 24 +-- wmtv/src/wmgeneral/wmgeneral.c | 22 +-- wmtv/src/wmtv.c | 114 +++++++-------- wmtz/BUGS | 4 +- wmtz/CHANGES | 24 +-- wmtz/INSTALL | 10 +- wmtz/README | 18 +-- wmtz/wmgeneral/list.c | 12 +- wmtz/wmgeneral/list.h | 2 +- wmtz/wmgeneral/misc.c | 24 +-- wmtz/wmgeneral/wmgeneral.c | 26 ++-- wmtz/wmtz/Makefile | 2 +- wmtz/wmtz/wmtz.1 | 22 +-- wmtz/wmtz/wmtz.c | 124 ++++++++-------- wmtz/wmtz/wmtzrc | 32 ++-- wmweather+/HINTS | 2 +- wmweather+/animation.c | 2 +- wmweather+/avn.c | 6 +- wmweather+/b0rken/memcmp.c | 2 +- wmweather+/convert.c | 16 +- wmweather+/diff.c | 2 +- wmweather+/dock.c | 6 +- wmweather+/eta.c | 6 +- wmweather+/forecast.c | 10 +- wmweather+/m4/xpm.m4 | 8 +- wmweather+/metar.c | 12 +- wmweather+/moon.c | 6 +- wmweather+/mrf.c | 8 +- wmweather+/radar.c | 10 +- wmweather+/subst.c | 4 +- wmweather+/warnings.c | 4 +- wmweather+/wmgeneral/xpm_trans.c | 2 +- wmweather+/wmweather+.1.in | 8 +- wmweather+/wmweather+.c | 4 +- wmwifi/ChangeLog | 12 +- wmwifi/README | 78 +++++----- wmwifi/debian/README.Debian | 4 +- wmwifi/debian/changelog | 8 +- wmwifi/debian/copyright | 2 +- wmwifi/debian/rules | 6 +- wmwifi/src/Makefile.am | 4 +- wmwifi/src/wireless.c | 4 +- wmwifi/src/wmwifi.h | 2 +- wmwifi/wmwifi.1 | 20 +-- wmwlmon/wl.c | 16 +- wmwlmon/wl.h | 2 +- wmwlmon/wmwlmon.c | 16 +- wmwlmon/xutils.c | 12 +- 339 files changed, 2980 insertions(+), 2982 deletions(-) diff --git a/AlsaMixer.app/AMixer/AChannel.cc b/AlsaMixer.app/AMixer/AChannel.cc index b0e55bb..81df656 100644 --- a/AlsaMixer.app/AMixer/AChannel.cc +++ b/AlsaMixer.app/AMixer/AChannel.cc @@ -34,7 +34,7 @@ void AChannel::setVolume(long value) { bool AChannel::isMuted() { int val; - + snd_mixer_selem_get_playback_switch(aItem->aElem, (SNDCHID_T) id, &val); return (! (bool) val); diff --git a/AlsaMixer.app/AMixer/AItem.h b/AlsaMixer.app/AMixer/AItem.h index 0f4f71a..93e5aa0 100644 --- a/AlsaMixer.app/AMixer/AItem.h +++ b/AlsaMixer.app/AMixer/AItem.h @@ -16,7 +16,7 @@ class AMixer; class AItem { private: AMixer *mixer; // parent mixer - std::vector pbChannels; // item channels + std::vector pbChannels; // item channels long minPVolume, maxPVolume; // min/max playback volume bool hPVolume; // has Playback volume diff --git a/AlsaMixer.app/AMixer/AMixer.cc b/AlsaMixer.app/AMixer/AMixer.cc index dbf9002..dbe45c2 100644 --- a/AlsaMixer.app/AMixer/AMixer.cc +++ b/AlsaMixer.app/AMixer/AMixer.cc @@ -115,7 +115,7 @@ bool AMixer::itemOK(unsigned int itemNumber) { int AMixer::itemGetVolume(unsigned int itemNumber) { if (itemNumber >= MIXER_ITEMS || !mixerItems[itemNumber]) return (-1); - + return ((int) mixerItems[itemNumber]->getVolumePerc()); } @@ -129,7 +129,7 @@ void AMixer::itemSetVolume(unsigned int itemNumber, unsigned int volume) { int AMixer::itemIsMuted(unsigned int itemNumber) { if (itemNumber >= MIXER_ITEMS || !mixerItems[itemNumber]) return (-1); - + return ((bool) mixerItems[itemNumber]->isMuted()); } @@ -193,7 +193,7 @@ int itemCallback(snd_mixer_elem_t *elem, unsigned int mask) { char* AMixer::convertIDToCard(const char* cardId) { static char card[32] = ""; int i = snd_card_get_index(cardId); - + if (i >= 0 && i < 32) std::snprintf(card, 32, "hw:%i", i); else diff --git a/AlsaMixer.app/Main.cc b/AlsaMixer.app/Main.cc index 449311b..4f467de 100644 --- a/AlsaMixer.app/Main.cc +++ b/AlsaMixer.app/Main.cc @@ -1,8 +1,8 @@ // // Mixer.app -// +// // Copyright (c) 1998-2002 Per Liden -// +// // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or @@ -15,7 +15,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, // USA. // @@ -23,7 +23,7 @@ Mixer* app; -int main(int argc, char** argv) +int main(int argc, char** argv) { app = new Mixer(argc, argv); app->run(); diff --git a/AlsaMixer.app/Mixer.cc b/AlsaMixer.app/Mixer.cc index b4a5242..b982413 100644 --- a/AlsaMixer.app/Mixer.cc +++ b/AlsaMixer.app/Mixer.cc @@ -1,8 +1,8 @@ // // Mixer.app -// +// // Copyright (c) 1998-2002 Per Liden -// +// // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or @@ -15,7 +15,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, // USA. // @@ -44,7 +44,7 @@ static const char* MixerSources[] = { "Master", "PCM", "CD" }; extern Mixer* app; -void catchBrokenPipe(int sig) +void catchBrokenPipe(int sig) { app->saveVolumeSettings(); exit(0); @@ -58,7 +58,7 @@ int percentToPosition(int percent) { return ROUND_POS(BUTTON_MIN - (percent * (BUTTON_MIN - BUTTON_MAX)) / 100.0); } -Mixer::Mixer(int argc, char** argv) +Mixer::Mixer(int argc, char** argv) { XClassHint classHint; XSizeHints sizeHints; @@ -221,7 +221,7 @@ Mixer::Mixer(int argc, char** argv) cerr << APPNAME << ": could not open display " << displayName << endl; exit(0); } - + // Get root window mRoot = RootWindow(mDisplay, DefaultScreen(mDisplay)); @@ -311,7 +311,7 @@ void Mixer::tryHelp(char* appname) cerr << "Try `" << appname << " --help' for more information" << endl; } -void Mixer::showHelp() +void Mixer::showHelp() { cerr << APPNAME << " Copyright (c) 1998-2002 by Per Liden (per@fukt.bth.se), Petr Hlavka (xhlavk00@stud.fit.vutbr.cz)" << endl << endl << "options:" << endl @@ -341,7 +341,7 @@ void Mixer::checkArgument(char** argv, int argc, int index) } } -void Mixer::showErrorLed() +void Mixer::showErrorLed() { Window led; Xpm* image; @@ -395,7 +395,7 @@ void Mixer::saveVolumeSettings() ofstream file(mSettingsFile); if (file) { // Files in ~/GNUstep/Defaults/ should follow the property list format - file << "{" << endl + file << "{" << endl << " Volume1 = " << mVolumePos[0] << ";" << endl << " Volume2 = " << mVolumePos[1] << ";" << endl << " Volume3 = " << mVolumePos[2] << ";" << endl @@ -407,7 +407,7 @@ void Mixer::saveVolumeSettings() } } -void Mixer::getVolume() +void Mixer::getVolume() { static int lastVolume[3] = {-1, -1, -1}; static int lastVolumeMute[3] = {-1, -1, -1}; @@ -449,7 +449,7 @@ void Mixer::getVolume() } } -void Mixer::setVolume(int button, int volume) +void Mixer::setVolume(int button, int volume) { if (mError) { return; @@ -469,7 +469,7 @@ void Mixer::toggleMute(int button) setButtonType(button); } -void Mixer::setButtonType(int button) +void Mixer::setButtonType(int button) { Xpm* image; @@ -500,10 +500,10 @@ void Mixer::setButtonPosition(int button, int position) { mVolumePos[button] = position; } -void Mixer::setButtonPositionRelative(int button, int relativePosition) +void Mixer::setButtonPositionRelative(int button, int relativePosition) { int y; - + // Calc new button position y = mVolumePos[button] + relativePosition; @@ -512,17 +512,17 @@ void Mixer::setButtonPositionRelative(int button, int relativePosition) } else if (y < BUTTON_MAX) { y = BUTTON_MAX; } - + // Set button position and volume XMoveWindow(mDisplay, mButton[button], ButtonX[button], y); mVolumePos[button] = y; - + // set volume setVolume(button, positionToPercent(y)); } -void Mixer::run() +void Mixer::run() { XEvent event; int buttonDown = 0; @@ -532,7 +532,7 @@ void Mixer::run() while(1) { while(XPending(mDisplay) || buttonDown) { XNextEvent(mDisplay, &event); - + switch(event.type) { case ButtonPress: if (event.xbutton.button == Button4 || event.xbutton.button == Button5) { @@ -562,13 +562,13 @@ void Mixer::run() loadVolumeSettings(); } break; - + case ButtonRelease: if (event.xbutton.button == Button1) { buttonDown = 0; } break; - + case MotionNotify: if (buttonDown) { // Find button diff --git a/AlsaMixer.app/Mixer.h b/AlsaMixer.app/Mixer.h index 87b389a..187a7fb 100644 --- a/AlsaMixer.app/Mixer.h +++ b/AlsaMixer.app/Mixer.h @@ -1,8 +1,8 @@ // // Mixer.app -// +// // Copyright (c) 1998-2002 Per Liden -// +// // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or @@ -15,7 +15,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, // USA. // @@ -42,7 +42,7 @@ #define BUTTON_MIN 45 #define BUTTON_MAX 6 -class Mixer +class Mixer { public: Mixer(int argc, char** argv); diff --git a/AlsaMixer.app/README b/AlsaMixer.app/README index 477649e..7ca7c10 100644 --- a/AlsaMixer.app/README +++ b/AlsaMixer.app/README @@ -12,8 +12,8 @@ for URL's), only connection to ALSA driver was added. Hints -------------------------------------------------------------- Error led: - If the led on Mixer.app is red an error message has - been printed to stderr and something is not working + If the led on Mixer.app is red an error message has + been printed to stderr and something is not working correctly. If the led is green everything is working ok. (Error led doesn't work in AlsaMixer.app, TODO) @@ -21,14 +21,14 @@ Mute: Right click on a volume controller to mute the sound source. The button will then have a red led in one corner. Right click again to restore the volume. If a muted sound - source is modified by another application Mixer.app will + source is modified by another application Mixer.app will automaticaly release its muted state. Wheel mouse: - If you have a wheel mouse (where the wheel is configured as + If you have a wheel mouse (where the wheel is configured as Button4 and Button5) you can control the volume by just moving - the mouse over Mixer.app and roll the wheel up and down. Use - the command line option -w to specify which slider that should + the mouse over Mixer.app and roll the wheel up and down. Use + the command line option -w to specify which slider that should react to the wheel movement. Label: @@ -39,8 +39,8 @@ Label: the mixer. Save volume settings: - Use the option -S (and -f ) if you want the volume - settings to be saved when AlsaMixer.app exits, and then + Use the option -S (and -f ) if you want the volume + settings to be saved when AlsaMixer.app exits, and then -L to be loaded again when AlsaMixer.app is started the next time. When not using -f the settings are saved in/loaded from ~/GNUstep/Defaults/AlsaMixer. Use the -f option @@ -57,7 +57,7 @@ Configurable middle click: Bugs -------------------------------------------------------------- -If you discover any bugs in this software, please send a +If you discover any bugs in this software, please send a bugreport to xhlavk00@stud.fit.vutbr.cz and describe the problem. @@ -72,8 +72,8 @@ Alban Hertroys Copyright -------------------------------------------------------------- AlsaMixer.app, 2004, Petr Hlavka -Mixer.app is copyright (c) 1998-2002 by Per Liden and is -licensed through the GNU General Public License. Read the +Mixer.app is copyright (c) 1998-2002 by Per Liden and is +licensed through the GNU General Public License. Read the COPYING file for the complete license. Minor parts of this code were taken from asmixer by Rob Malda diff --git a/AlsaMixer.app/Xpm.cc b/AlsaMixer.app/Xpm.cc index 2226165..86be063 100644 --- a/AlsaMixer.app/Xpm.cc +++ b/AlsaMixer.app/Xpm.cc @@ -1,8 +1,8 @@ // // Mixer.app -// +// // Copyright (c) 1998-2002 Per Liden -// +// // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or @@ -15,7 +15,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, // USA. // @@ -30,7 +30,7 @@ using namespace std; -Xpm::Xpm(Display* display, Window root, char** data) +Xpm::Xpm(Display* display, Window root, char** data) { int error; @@ -67,7 +67,7 @@ Xpm::Xpm(Display* display, Window root, char** data) } } -Xpm::~Xpm() +Xpm::~Xpm() { if (mImage) { XFreePixmap(mDisplay, mImage); @@ -78,20 +78,20 @@ Xpm::~Xpm() } } -void Xpm::setWindowPixmap(Window win) +void Xpm::setWindowPixmap(Window win) { XResizeWindow(mDisplay, win, mAttributes.width, mAttributes.height); XSetWindowBackgroundPixmap(mDisplay, win, mImage); } -void Xpm::setWindowPixmapShaped(Window win) +void Xpm::setWindowPixmapShaped(Window win) { XResizeWindow(mDisplay, win, mAttributes.width, mAttributes.height); XSetWindowBackgroundPixmap(mDisplay, win, mImage); XShapeCombineMask(mDisplay, win, ShapeBounding, 0, 0, mMask, ShapeSet); } -void Xpm::drawString(int x, int y, char* text) +void Xpm::drawString(int x, int y, char* text) { Font font; GC gc; diff --git a/AlsaMixer.app/Xpm.h b/AlsaMixer.app/Xpm.h index df76c2f..4e658db 100644 --- a/AlsaMixer.app/Xpm.h +++ b/AlsaMixer.app/Xpm.h @@ -1,8 +1,8 @@ // // Mixer.app -// +// // Copyright (c) 1998-2002 Per Liden -// +// // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or @@ -15,7 +15,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, // USA. // @@ -25,7 +25,7 @@ #include #include -class Xpm +class Xpm { public: Xpm(Display* display, Window root, char** data); diff --git a/AlsaMixer.app/olddoc/ChangeLog.Mixer.app b/AlsaMixer.app/olddoc/ChangeLog.Mixer.app index b2ae9f1..741863f 100644 --- a/AlsaMixer.app/olddoc/ChangeLog.Mixer.app +++ b/AlsaMixer.app/olddoc/ChangeLog.Mixer.app @@ -17,7 +17,7 @@ Version Description - New Makefile. 1.5.0 - Released 2000-02-21. - - Added command line options -s and -S , which cause + - Added command line options -s and -S , which cause Mixer.app to load/save volume settings when starting/exiting. When the option -s is used, settings are loaded from/saved in ~/GNUstep/Defaults/Mixer. Use -S if you want Mixer.app @@ -25,19 +25,19 @@ Version Description - Fixed potential bug in command line parsing. 1.4.1 - Released 1999-05-28. - - Added command line option -l that can be used to + - Added command line option -l that can be used to add a text label in the corner of the mixer. 1.4.0 - Released 1999-05-09. - - Added support for wheel mice. One of the sliders (use -w to - specify which one) will react on wheel movement. + - Added support for wheel mice. One of the sliders (use -w to + specify which one) will react on wheel movement. - Misc. code clean up. 1.3.3 - Released 1999-05-02. - Fixed problem that caused Mixer.app to die. 1.3.2 - Released 1999-04-18. - - Fixed exit bug. Mixer.app will now exit properly when + - Fixed exit bug. Mixer.app will now exit properly when the windowmanager terminates. 1.3.1 - Released 1999-02-09. @@ -48,25 +48,25 @@ Version Description 1.3.0 - Released 1999-02-04. - New design. - I didn't find the mute function very usefull so I removed it. - - Doing 'make install' will now install it in + - Doing 'make install' will now install it in /usr/local/GNUstep/Apps/Mixer.app/. 1.2.0 - Released 1998-12-01. - - Moved back to old design. The design of version 1.1.1 made - Mixer.app (and Window Maker) unstable due to some strange - race condition at startup. It worked on some machines and + - Moved back to old design. The design of version 1.1.1 made + Mixer.app (and Window Maker) unstable due to some strange + race condition at startup. It worked on some machines and some not, so I desided to go back to the old design. - Increased idle interval to reduce CPU usage. 1.1.1 - Released 1998-11-14. - - Fixed XGetImage errors, (slow machines may still have this + - Fixed XGetImage errors, (slow machines may still have this problem, please report any errors). - Added command line option -m to set mixer device. - Added command line option -n to set instance name. - Compiling under FreeBSD now works fine. - + 1.1.0 - Released 1998-11-14. - - Alarm singals are no longer used so now the "Alarm Clock" + - Alarm singals are no longer used so now the "Alarm Clock" problem is solved for sure! - Mute function. - New design. @@ -84,7 +84,7 @@ Version Description - Minor changes to eventhandling code. 1.0.2 - Released 1998-02-23. - - If the red led goes on (an error has occured) the control + - If the red led goes on (an error has occured) the control buttons are set to volume 0. 1.0.1 - Released 1998-02-23. diff --git a/AlsaMixer.app/olddoc/README.Mixer.app b/AlsaMixer.app/olddoc/README.Mixer.app index 2fa41db..bd2086e 100644 --- a/AlsaMixer.app/olddoc/README.Mixer.app +++ b/AlsaMixer.app/olddoc/README.Mixer.app @@ -19,22 +19,22 @@ support. Hints -------------------------------------------------------------- Error led: - If the led on Mixer.app is red an error message has - been printed to stderr and something is not working + If the led on Mixer.app is red an error message has + been printed to stderr and something is not working correctly. If the led is green everything is working ok. Mute: Right click on a volume controller to mute the sound source. The button will then have a red led in one corner. Right click again to restore the volume. If a muted sound - source is modified by another application Mixer.app will + source is modified by another application Mixer.app will automaticaly release its muted state. Wheel mouse: - If you have a wheel mouse (where the wheel is configured as + If you have a wheel mouse (where the wheel is configured as Button4 and Button5) you can control the volume by just moving - the mouse over Mixer.app and roll the wheel up and down. Use - the command line option -w to specify which slider that should + the mouse over Mixer.app and roll the wheel up and down. Use + the command line option -w to specify which slider that should react to the wheel movement. Label: @@ -45,16 +45,16 @@ Label: the mixer. Save volume settings: - Use the option -s or -S if you want the volume - settings to be saved when Mixer.app exits, and then + Use the option -s or -S if you want the volume + settings to be saved when Mixer.app exits, and then loaded again when Mixer.app is started the next time. When using -s the settings are saved in/loaded from ~/GNUstep/Defaults/Mixer. Use the -S option - if you want to use a different file. + if you want to use a different file. Bugs -------------------------------------------------------------- -If you discover any bugs in this software, please send a +If you discover any bugs in this software, please send a bugreport to per@fukt.bth.se and describe the problem. @@ -67,8 +67,8 @@ Alban Hertroys Copyright -------------------------------------------------------------- -Mixer.app is copyright (c) 1998-2002 by Per Liden and is -licensed through the GNU General Public License. Read the +Mixer.app is copyright (c) 1998-2002 by Per Liden and is +licensed through the GNU General Public License. Read the COPYING file for the complete license. Minor parts of this code were taken from asmixer by Rob Malda diff --git a/Temperature.app/ChangeLog b/Temperature.app/ChangeLog index a49bb34..3d9ca1a 100644 --- a/Temperature.app/ChangeLog +++ b/Temperature.app/ChangeLog @@ -13,7 +13,7 @@ Version 1.3 - Jul 2, 2001 Version 1.2 - Jun 29, 2001 - Temporary files are now unique to the process, so that multiple instances can run at once. - + Version 1.1 - Jun 25, 2001 - Fixed some compilation problems. - Fixed potential race condition. diff --git a/Temperature.app/INSTALL b/Temperature.app/INSTALL index 7355196..26dcc91 100644 --- a/Temperature.app/INSTALL +++ b/Temperature.app/INSTALL @@ -10,12 +10,12 @@ Requirements - ICAO Location Indicator You must find the ICAO Location Indicator (a 4-character string) - of a weather station near you. You can search for a station - on this site: http://www.nws.noaa.gov/oso/siteloc.shtml + of a weather station near you. You can search for a station + on this site: http://www.nws.noaa.gov/oso/siteloc.shtml - X11, libxpm, C++ development environment Most (Linux) systems have these things installed by default. - If you don't have it look for packages that fit your + If you don't have it look for packages that fit your distribution/vendor. diff --git a/Temperature.app/Main.cc b/Temperature.app/Main.cc index 7f68de6..ba0b214 100644 --- a/Temperature.app/Main.cc +++ b/Temperature.app/Main.cc @@ -1,8 +1,8 @@ // // Temperature.app -// +// // Copyright (c) 2000 Per Liden -// +// // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or @@ -15,13 +15,13 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, // USA. // #include "Temperature.h" -int main(int argc, char** argv) +int main(int argc, char** argv) { Temperature app(argc, argv); app.run(); diff --git a/Temperature.app/README b/Temperature.app/README index db14fd9..d566075 100644 --- a/Temperature.app/README +++ b/Temperature.app/README @@ -11,14 +11,14 @@ Description -------------------------------------------------------------- Temperature.app is a Window Maker dock application which -fetches local temperature information every 15 minutes from +fetches local temperature information every 15 minutes from ftp://weather.noaa.gov and displays it (in Celsius or Fahrenheit). Hints -------------------------------------------------------------- The led: - If the led is blinking (green/red), then that means + If the led is blinking (green/red), then that means Temperature.app is trying to fetch weather information. If successful the led will stop blinking and go green. If unsuccessful the led will stop blinking and go red. @@ -30,20 +30,20 @@ The led: Bugs -------------------------------------------------------------- -If you discover any bugs in this software, please send a +If you discover any bugs in this software, please send a bugreport to per@fukt.bth.se and describe the problem. Special thanks to -------------------------------------------------------------- -Mike Henderson (mghenderson@lanl.gov) - Author of wmWeather -(I didn't know about the weather.noaa.gov ftp-site before I +Mike Henderson (mghenderson@lanl.gov) - Author of wmWeather +(I didn't know about the weather.noaa.gov ftp-site before I caught sight of his program). Copyright -------------------------------------------------------------- -Temperature.app is copyright (c) 2000-2002 by Per Liden and is -licensed through the GNU General Public License. Read the +Temperature.app is copyright (c) 2000-2002 by Per Liden and is +licensed through the GNU General Public License. Read the COPYING file for the complete license. diff --git a/Temperature.app/Temperature.cc b/Temperature.app/Temperature.cc index 1b9d405..e19492c 100644 --- a/Temperature.app/Temperature.cc +++ b/Temperature.app/Temperature.cc @@ -1,8 +1,8 @@ // // Temperature.app -// +// // Copyright (c) 2000-2002 Per Liden -// +// // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or @@ -15,7 +15,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, // USA. // @@ -40,12 +40,12 @@ volatile static ChildStatus childStatus; -static void catchBrokenPipe(int sig) +static void catchBrokenPipe(int sig) { exit(0); } -static void catchChildExit(int sig) +static void catchChildExit(int sig) { int status; waitpid(-1, &status, 0); @@ -65,7 +65,7 @@ static void catchChildExit(int sig) } } -Temperature::Temperature(int argc, char** argv) +Temperature::Temperature(int argc, char** argv) { XClassHint classHint; XSizeHints sizeHints; @@ -163,14 +163,14 @@ Temperature::Temperature(int argc, char** argv) std::cerr << APPNAME << ": could not open display " << displayName << std::endl; exit(0); } - + // Get root window mRoot = RootWindow(mDisplay, DefaultScreen(mDisplay)); // Create windows mAppWin = XCreateSimpleWindow(mDisplay, mRoot, 1, 1, 64, 64, 0, 0, 0); mIconWin = XCreateSimpleWindow(mDisplay, mAppWin, 0, 0, 64, 64, 0, 0, 0); - + // Set classhint classHint.res_name = mInstanceName; classHint.res_class = CLASSNAME; @@ -230,7 +230,7 @@ void Temperature::tryHelp(char* appname) std::cerr << std::endl << "Try `" << appname << " --help' for more information" << std::endl; } -void Temperature::showHelp() +void Temperature::showHelp() { std::cerr << APPNAME << " Copyright (c) 2000-2002 by Per Liden (per@fukt.bth.se)" << std::endl << std::endl << "options:" << std::endl @@ -241,7 +241,7 @@ void Temperature::showHelp() << " -n set client instance name" << std::endl << " -d set display" << std::endl << " -v print version and exit" << std::endl - << " -h, --help display this help text and exit" << std::endl + << " -h, --help display this help text and exit" << std::endl << std::endl << "You must supply the ICAO Location Indicator (a 4-character string)" << std::endl << "of a weather station near you. You can search for a station on" << std::endl @@ -294,7 +294,7 @@ void Temperature::setTime(char* utcTime) { char unit[3]; int hour = 0; - int min = 0; + int min = 0; strncpy(unit, &utcTime[0], 2); hour = atoi(unit); @@ -319,7 +319,7 @@ void Temperature::setTime(char* utcTime) if (mTime12HourFormat) { if (hour >= 0 && hour <= 11) { - mTimeAMPM = "AM"; + mTimeAMPM = "AM"; } else { mTimeAMPM = "PM"; } @@ -350,7 +350,7 @@ bool Temperature::updateTemperture(ifstream& file) strncpy(time, start - 5, 4); setTime(time); } - + // Find temperature while (!file.eof()) { file >> buffer; @@ -365,7 +365,7 @@ bool Temperature::updateTemperture(ifstream& file) sprintf(mTemperature, "%d", (int)rint((atoi(buffer) - 32) / 1.8)); unit = " °C"; } - + Xpm* image = new Xpm(mDisplay, mRoot, main_xpm); if (mShowTime) { if (mTime12HourFormat) { @@ -389,7 +389,7 @@ bool Temperature::updateTemperture(ifstream& file) return false; } -void Temperature::run() +void Temperature::run() { if (mShowTime) { calcTimeDiff(); diff --git a/Temperature.app/Temperature.h b/Temperature.app/Temperature.h index 85e21c5..8810bc9 100644 --- a/Temperature.app/Temperature.h +++ b/Temperature.app/Temperature.h @@ -1,8 +1,8 @@ // // Temperature.app -// +// // Copyright (c) 2000-2002 Per Liden -// +// // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or @@ -15,7 +15,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, // USA. // @@ -47,9 +47,9 @@ using namespace std; enum ChildStatus { - ChildRunning, - ChildDone, - ChildError + ChildRunning, + ChildDone, + ChildError }; class Temperature diff --git a/Temperature.app/Xpm.cc b/Temperature.app/Xpm.cc index 94403df..734556a 100644 --- a/Temperature.app/Xpm.cc +++ b/Temperature.app/Xpm.cc @@ -1,8 +1,8 @@ // // Temperature.app -// +// // Copyright (c) 2000-2002 Per Liden -// +// // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or @@ -15,7 +15,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, // USA. // @@ -28,7 +28,7 @@ #include "Temperature.h" #include "Xpm.h" -Xpm::Xpm(Display* display, Window root, char** data) +Xpm::Xpm(Display* display, Window root, char** data) { int error; @@ -65,7 +65,7 @@ Xpm::Xpm(Display* display, Window root, char** data) } } -Xpm::~Xpm() +Xpm::~Xpm() { if (mImage) { XFreePixmap(mDisplay, mImage); @@ -76,14 +76,14 @@ Xpm::~Xpm() } } -void Xpm::setWindowPixmap(Window win) +void Xpm::setWindowPixmap(Window win) { XResizeWindow(mDisplay, win, mAttributes.width, mAttributes.height); XSetWindowBackgroundPixmap(mDisplay, win, mImage); XClearWindow(mDisplay, win); } -void Xpm::setWindowPixmapShaped(Window win) +void Xpm::setWindowPixmapShaped(Window win) { XResizeWindow(mDisplay, win, mAttributes.width, mAttributes.height); XSetWindowBackgroundPixmap(mDisplay, win, mImage); @@ -101,13 +101,13 @@ void Xpm::drawString(int pos, char* font, char* str) cerr << APPNAME << ": could not load font '" << font << "'" << endl; exit(0); } - + gcv.foreground = WhitePixel(mDisplay, DefaultScreen(mDisplay)); gc = XCreateGC(mDisplay, mImage, GCForeground, &gcv); int strLength = strlen(str); int strWidth = XTextWidth(fontStruct, str, strLength); - + int x = (64 / 2) - (strWidth / 2); XSetFont(mDisplay, gc, fontStruct->fid); XDrawString(mDisplay, mImage, gc, x, pos, str, strLength); @@ -132,7 +132,7 @@ void Xpm::drawComposedString(int pos, char* font1, char* str1, char* font2, char cerr << APPNAME << ": could not load font '" << font2 << "'" << endl; exit(0); } - + gcv.foreground = WhitePixel(mDisplay, DefaultScreen(mDisplay)); gc = XCreateGC(mDisplay, mImage, GCForeground, &gcv); @@ -140,7 +140,7 @@ void Xpm::drawComposedString(int pos, char* font1, char* str1, char* font2, char int str1Width = XTextWidth(fontStruct1, str1, str1Length); int str2Length = strlen(str2); int str2Width = XTextWidth(fontStruct2, str2, str2Length); - + int x = (64 / 2) - ((str1Width + str2Width) / 2); XSetFont(mDisplay, gc, fontStruct1->fid); XDrawString(mDisplay, mImage, gc, x, pos, str1, str1Length); diff --git a/Temperature.app/Xpm.h b/Temperature.app/Xpm.h index 21e5a75..6316fdf 100644 --- a/Temperature.app/Xpm.h +++ b/Temperature.app/Xpm.h @@ -1,8 +1,8 @@ // // Temperature.app -// +// // Copyright (c) 2000-2002 Per Liden -// +// // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or @@ -15,7 +15,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, // USA. // @@ -25,7 +25,7 @@ #include #include -class Xpm +class Xpm { public: Xpm(Display* display, Window root, char** data); diff --git a/wmCalClock/CHANGES b/wmCalClock/CHANGES index a225d43..47731d7 100644 --- a/wmCalClock/CHANGES +++ b/wmCalClock/CHANGES @@ -32,10 +32,10 @@ Version 1.23 - released March 20, 1999. Version 1.22 - released February 24, 1999. Added double click detection and -e command-line option. - + Version 1.21 - released February 4, 1999. cosmetic for AfterStep users. removed spurious black line at RHS edge an mask. - + Version 1.2 - released January 14, 1999. Changed support for LowColor Pixmap. Now, check for Depth automatically. If its <= 8, then use LowColor. diff --git a/wmCalClock/HINTS b/wmCalClock/HINTS index 9dc1386..d3fb265 100644 --- a/wmCalClock/HINTS +++ b/wmCalClock/HINTS @@ -21,14 +21,14 @@ usage: wmCalClock [-b ] [-tc ] [-bc ] [-e "Command"] [-S] -S Do not show seconds. -24 Show 24-hour time. Default is 12 hour AM/PM Time. -g Show Greenwich time. - -s Show Greenwich Mean Sidereal Time (GMST) in 24-hour format. - -L Show Local Sidereal Time (LST) in 24-hour format. + -s Show Greenwich Mean Sidereal Time (GMST) in 24-hour format. + -L Show Local Sidereal Time (LST) in 24-hour format. Longitude is in degrees (- for West + for East). -l Use a low-color pixmap to conserve colors. On 8-bit displays the low color pixmap will always be used. -h Display help screen. -Example: wmCalClock -b 100 -tc #001100 -bc #7e9e69 +Example: wmCalClock -b 100 -tc #001100 -bc #7e9e69 WindowMaker. @@ -38,12 +38,12 @@ In WindowMaker simply drag and drop the wmCalClock App on the WindowMaker Dock o Afterstep. --------- -Afterstep users put the following in their .steprc "Wharf wmCalClock - MaxSwallow +Afterstep users put the following in their .steprc "Wharf wmCalClock - MaxSwallow "wmCalClock" wmCalClock &". Dont use Afterstep so I have no idea if it works... Note: AfterStep's Wharf supposedly has a problem with pixmaps that are larger than 60x60 pixels. Please tell the AfterStep authors to fix this, this is not -our fault, but a Wharf problem! +our fault, but a Wharf problem! Other window managers. ---------------------- diff --git a/wmCalClock/INSTALL b/wmCalClock/INSTALL index 8cf3bf6..c8b03e4 100644 --- a/wmCalClock/INSTALL +++ b/wmCalClock/INSTALL @@ -10,8 +10,8 @@ Installation 1) gunzip wmCalClock-x.xx.tar.gz 1) tar -xvf wmCalClock-x.xx.tar 2) cd wmCalClock-x.xx/Src/ -3) make -4) make install (must be root) +3) make +4) make install (must be root) 5) wmCalClock & (or 'wmCalClock -h' for help, or 'man wmCalClock' for the man page) diff --git a/wmCalClock/README b/wmCalClock/README index f1e6757..123ca61 100644 --- a/wmCalClock/README +++ b/wmCalClock/README @@ -1,8 +1,8 @@ wmCalClock-1.24 release ----------------------- Author....: Michael G. Henderson - - + + Description ----------- wmCalClock is a simple Calendar Clock that uses anti-aliased characters and @@ -18,7 +18,7 @@ BUGS Bug reports CHANGES Change history. COPYING GNU General Public License Version 2. TODO Wish list. - + Bugs ----- diff --git a/wmCalClock/Src/Makefile b/wmCalClock/Src/Makefile index fecc1f9..d0e6b22 100644 --- a/wmCalClock/Src/Makefile +++ b/wmCalClock/Src/Makefile @@ -21,7 +21,7 @@ OBJS = wmCalClock.o \ all: wmCalClock.o wmCalClock wmCalClock.o: wmCalClock_master.xpm wmCalClock_mask.xbm -wmCalClock: $(OBJS) +wmCalClock: $(OBJS) $(CC) $(COPTS) $(SYSTEM) -o wmCalClock $^ $(INCDIR) $(LIBDIR) $(LIBS) clean: @@ -32,5 +32,5 @@ clean: install:: wmCalClock install -c -s -m 0755 wmCalClock $(DESTDIR)/bin - install -c -m 0644 wmCalClock.1 $(DESTDIR)/man/man1 + install -c -m 0644 wmCalClock.1 $(DESTDIR)/man/man1 diff --git a/wmCalClock/Src/Makefile.sgi b/wmCalClock/Src/Makefile.sgi index bc742cd..436dc5a 100644 --- a/wmCalClock/Src/Makefile.sgi +++ b/wmCalClock/Src/Makefile.sgi @@ -21,7 +21,7 @@ OBJS = wmCalClock.o \ all: wmCalClock.o wmCalClock wmCalClock.o: wmCalClock_master.xpm wmCalClock_mask.xbm -wmCalClock: $(OBJS) +wmCalClock: $(OBJS) $(CC) $(COPTS) $(SYSTEM) -o wmCalClock $(OBJS) $(INCDIR) $(LIBDIR) $(LIBS) clean: @@ -32,5 +32,5 @@ clean: install:: wmCalClock install -s -m 0755 wmCalClock $(DESTDIR)/bin - install -c -m 0644 wmCalClock.1 $(DESTDIR)/man/man1 + install -c -m 0644 wmCalClock.1 $(DESTDIR)/man/man1 diff --git a/wmCalClock/Src/Makefile.solaris b/wmCalClock/Src/Makefile.solaris index 87219e9..4385c29 100644 --- a/wmCalClock/Src/Makefile.solaris +++ b/wmCalClock/Src/Makefile.solaris @@ -21,7 +21,7 @@ OBJS = wmCalClock.o \ all: wmCalClock.o wmCalClock wmCalClock.o: wmCalClock_master.xpm wmCalClock_mask.xbm -wmCalClock: $(OBJS) +wmCalClock: $(OBJS) $(CC) $(COPTS) $(SYSTEM) -o wmCalClock $^ $(INCDIR) $(LIBDIR) $(LIBS) clean: @@ -32,5 +32,5 @@ clean: install:: wmCalClock install -s -m 0755 wmCalClock $(DESTDIR)/bin - install -c -m 0644 wmCalClock.1 $(DESTDIR)/man/man1 + install -c -m 0644 wmCalClock.1 $(DESTDIR)/man/man1 diff --git a/wmCalClock/Src/wmCalClock.1 b/wmCalClock/Src/wmCalClock.1 index a45b476..0e46213 100644 --- a/wmCalClock/Src/wmCalClock.1 +++ b/wmCalClock/Src/wmCalClock.1 @@ -1,4 +1,4 @@ -.TH WMCALCLOCK 1 "16 December 1998" +.TH WMCALCLOCK 1 "16 December 1998" .SH NAME WMCALCLOCK \- Dockable Calendar Clock .SH SYNOPSIS @@ -6,7 +6,7 @@ WMCALCLOCK \- Dockable Calendar Clock [-h] [-display ] [-b ] [-e ] [-24] [-s] [-S] [-L ] [-l] [-tc ] [-bc ] [-tekton] [-comicsans] [-arial] [-luggerbug] [-jazz] .SH DESCRIPTION .PP -wmCalClock is a simple Calendar Clock with anti-aliased text and drop-shadows. +wmCalClock is a simple Calendar Clock with anti-aliased text and drop-shadows. .SH OPTIONS .TP .B \-h @@ -19,31 +19,31 @@ Use an alternate X Display. Beep on the hour with specified volume (between -100 and 100). .TP .B \-e -Command to execute via double click of mouse button 1. (Use quotes if your command +Command to execute via double click of mouse button 1. (Use quotes if your command has white space in it). .TP .B \-24 Show time in 24-hour format instead of default 12-hour AM/PM format. .TP .B \-s -Show Greenwich Mean Sidereal Time (GMST) in 24-hour format. +Show Greenwich Mean Sidereal Time (GMST) in 24-hour format. .TP .B \-S Dont show seconds. .TP .B \-L -Show Local Sidereal Time (LST) in 24-hour format. Longitude is in degrees +Show Local Sidereal Time (LST) in 24-hour format. Longitude is in degrees (- for West + for East). .TP -.B \-l +.B \-l Force use of lower color pixmap to conserve colors. On displays with <= 8 bits, the low color Pixmap will always be used. .TP .B \-tc -Change color of time-field digits. +Change color of time-field digits. .TP .B \-bc -Change color of time-field background. +Change color of time-field background. .TP .B \-tekton Use the Tekton font for time field. diff --git a/wmCalClock/Src/wmCalClock.c b/wmCalClock/Src/wmCalClock.c index da4f1c3..c473b13 100644 --- a/wmCalClock/Src/wmCalClock.c +++ b/wmCalClock/Src/wmCalClock.c @@ -1,11 +1,11 @@ /* * * wmCalClock-1.25 (C) 1998, 1999 Mike Henderson (mghenderson@lanl.gov) - * + * * - Its a Calendar Clock.... - * - * - * + * + * + * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program (see the file COPYING); if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA * * @@ -31,10 +31,10 @@ * * Version 1.24 - released March 27, 1999. * Added support for additional fonts for time field; - * + * * -tekton for Tekton * -arial for Arial (Helvetica) (this is the same font as usual) - * -luggerbug for LuggerBug + * -luggerbug for LuggerBug * -comicsans for ComicSans * -jazz for JazzPoster * @@ -66,7 +66,7 @@ * * Version 1.10 - released January 7, 1999. * Added support for LowColor Pixmap. (21 colors may still be a - * bit high, but the poor saps with 8-bit displays can at least run + * bit high, but the poor saps with 8-bit displays can at least run * it now.) * * Version 1.02 - released January 7, 1999. @@ -84,8 +84,8 @@ -/* - * Includes +/* + * Includes */ #include #include @@ -101,8 +101,8 @@ -/* - * Delay between refreshes (in microseconds) +/* + * Delay between refreshes (in microseconds) */ #define DELAY 10000L #define WMCALCLOCK_VERSION "1.25" @@ -121,13 +121,13 @@ void print_usage(); int xsMonth[12] = { 150, 170, 190, 212, 233, 256, 276, 294, 317, 337, 357, 380 }; int xeMonth[12] = { 168, 188, 210, 231, 254, 275, 292, 314, 335, 355, 377, 398 }; int xdMonth[12]; -int yMonth = 80; +int yMonth = 80; int ydMonth = 13; int xsDayOfWeek[7] = { 293, 150, 177, 201, 228, 253, 271 }; int xeDayOfWeek[7] = { 314, 175, 199, 226, 250, 269, 290 }; int xdDayOfWeek[7]; -int yDayOfWeek = 95; +int yDayOfWeek = 95; int ydDayOfWeek = 13; /* @@ -163,7 +163,7 @@ int ydDayOfMonth = 23; -/* +/* * Luggerbug Font Narrow - 13 pixels high. */ int xsDigits_Luggerbug13n[11] = { 75, 84, 92, 101, 110, 119, 127, 136, 143, 151, 159 }; @@ -172,7 +172,7 @@ int xdDigits_Luggerbug13n[11]; int yDigits_Luggerbug13n = 150; int ydDigits_Luggerbug13n = 13; -/* +/* * Luggerbug Font - 13 pixels high. */ int xsDigits_Luggerbug13[11] = { 75, 89, 103, 117, 131, 146, 159, 172, 184, 197, 208 }; @@ -181,7 +181,7 @@ int xdDigits_Luggerbug13[11]; int yDigits_Luggerbug13 = 136; int ydDigits_Luggerbug13 = 13; -/* +/* * ComicSans Font - 12 pixels high. */ int xsDigits_ComicSans12n[11] = { 338, 349, 359, 370, 380, 390, 401, 411, 422, 432, 444 }; @@ -190,7 +190,7 @@ int xdDigits_ComicSans12n[11]; int yDigits_ComicSans12n = 123; int ydDigits_ComicSans12n = 12; -/* +/* * ComicSans Font - 11 pixels high. */ int xsDigits_ComicSans11[11] = { 338, 353, 366, 380, 392, 407, 420, 434, 448, 461, 471 }; @@ -199,7 +199,7 @@ int xdDigits_ComicSans11[11]; int yDigits_ComicSans11 = 111; int ydDigits_ComicSans11 = 11; -/* +/* * JazzPoster Font Narrow - 12 pixels high. */ int xsDigits_JazzPoster12n[11] = { 211, 220, 226, 233, 241, 249, 256, 263, 271, 278, 286 }; @@ -208,7 +208,7 @@ int xdDigits_JazzPoster12n[11]; int yDigits_JazzPoster12n = 122; int ydDigits_JazzPoster12n = 12; -/* +/* * JazzPoster Font - 12 pixels high. */ int xsDigits_JazzPoster12[11] = { 211, 225, 234, 246, 258, 271, 282, 293, 305, 317, 328 }; @@ -218,7 +218,7 @@ int yDigits_JazzPoster12 = 109; int ydDigits_JazzPoster12 = 12; -/* +/* * Tekton Font - 12 pixels high Narrow (13 pixels high actually). */ int xsDigits_Tekton12n[11] = { 75, 84, 90, 97, 105, 114, 122, 131, 138, 147, 156 }; @@ -227,7 +227,7 @@ int xdDigits_Tekton12n[11]; int yDigits_Tekton12n = 122; int ydDigits_Tekton12n = 13; -/* +/* * Tekton Font - 12 pixels high. */ int xsDigits_Tekton12[11] = { 75, 89, 98, 111, 124, 137, 150, 164, 176, 191, 205 }; @@ -288,8 +288,8 @@ char BackgroundColor[30] = "#181818"; -/* - * main +/* + * main */ int main(int argc, char *argv[]) { @@ -422,12 +422,12 @@ int main(int argc, char *argv[]) { - - - - + + + + initXwindow(argc, argv); if (DisplayDepth <= 8) UseLowColorPixmap = 1; @@ -440,7 +440,7 @@ int main(int argc, char *argv[]) { - + /* * Loop until we die */ @@ -451,7 +451,7 @@ int main(int argc, char *argv[]) { /* - * Only process every 10th cycle of this loop. We run it faster + * Only process every 10th cycle of this loop. We run it faster * to catch expose events, etc... * */ @@ -522,7 +522,7 @@ int main(int argc, char *argv[]) { Flag = (Hours >= 12) ? 1 : 0; if (Hours == 0) Hours = 12; - else + else Hours = (Hours > 12) ? Hours-12 : Hours; } @@ -552,10 +552,10 @@ int main(int argc, char *argv[]) { copyXPMArea(5, 110, 54, 15, 5, 5); - /* + /* * Draw Hours */ - + /* dont show leading zeros */ if (D[0] > -1){ digit = D[0]; @@ -567,14 +567,14 @@ int main(int argc, char *argv[]) { copyXPMArea(xsDigits[digit], yDigits, xdDigits[digit], ydDigits, xoff+extradx, 7+extrady); xoff += (xdDigits[digit]+1); - /* + /* * Draw Colon */ digit = 10; copyXPMArea(xsDigits[digit], yDigits, xdDigits[digit], ydDigits, xoff+extradx, 7+extrady); xoff += (xdDigits[digit]+1); - /* + /* * Draw Minutes */ digit = D[3]; @@ -587,14 +587,14 @@ int main(int argc, char *argv[]) { if (ShowSeconds){ - /* + /* * Draw Colon */ digit = 10; copyXPMArea(xsDigits[digit], yDigits, xdDigits[digit], ydDigits, xoff+extradx, 7+extrady); xoff += (xdDigits[digit]+1); - /* + /* * Draw Seconds */ digit = D[6]; @@ -625,7 +625,7 @@ int main(int argc, char *argv[]) { if (Beep){ if ((Mins == 0)&&(Secs == 0)&&(OldSecs != Secs)) XBell(display, Volume); OldSecs = Secs; - + } @@ -642,18 +642,18 @@ int main(int argc, char *argv[]) { copyXPMArea(5, 70, 54, 35, 5, 24); - /* + /* * Draw Day of Week and Month */ wid = xdDayOfWeek[DayOfWeek] + xdMonth[Month] + 1; - copyXPMArea(xsDayOfWeek[DayOfWeek], yDayOfWeek, xdDayOfWeek[DayOfWeek], + copyXPMArea(xsDayOfWeek[DayOfWeek], yDayOfWeek, xdDayOfWeek[DayOfWeek], ydMonth, 33-wid/2, 64-24-4-12); - copyXPMArea(xsMonth[Month], yMonth, xdMonth[Month], + copyXPMArea(xsMonth[Month], yMonth, xdMonth[Month], ydMonth, 33-wid/2+xdDayOfWeek[DayOfWeek]+1, 64-24-4-12); - /* + /* * Draw Day of Month */ copyXPMArea(xsDayOfMonth[DayOfMonth], yDayOfMonth[DayOfMonth], xdDayOfMonth[DayOfMonth], ydDayOfMonth, 32-xdDayOfMonth2[DayOfMonth]/2, 36); @@ -670,7 +670,7 @@ int main(int argc, char *argv[]) { } else { /* - * Update the counter. + * Update the counter. */ ++n; @@ -700,7 +700,7 @@ int main(int argc, char *argv[]) { - /* + /* * Process any pending X events. */ while(XPending(display)){ @@ -721,9 +721,9 @@ int main(int argc, char *argv[]) { - - /* - * Redraw and wait for next update + + /* + * Redraw and wait for next update */ RedrawWindow(); if( HasExecute == 1) { @@ -748,13 +748,13 @@ int main(int argc, char *argv[]) { -/* - * ParseCMDLine() +/* + * ParseCMDLine() */ void ParseCMDLine(int argc, char *argv[]) { int i; - + for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "-display")){ @@ -857,8 +857,8 @@ int i; } } - - if (!ShowSeconds && !UseArial && !UseJazzPoster + + if (!ShowSeconds && !UseArial && !UseJazzPoster && !UseComicSans && !UseLuggerbug) UseTekton = 1; diff --git a/wmCalClock/Src/wmcalclock.patch b/wmCalClock/Src/wmcalclock.patch index 31db48e..63058e5 100644 --- a/wmCalClock/Src/wmcalclock.patch +++ b/wmCalClock/Src/wmcalclock.patch @@ -7,8 +7,8 @@ int DblClkDelay; - int HasExecute = 0; /* controls perf optimization */ char ExecuteCommand[1024]; - - + + --- 272,277 ---- *************** *** 451,457 **** @@ -16,20 +16,20 @@ * */ ! if ( HasExecute == 0 || n>10){ - + n = 0; - + --- 450,456 ---- * to catch expose events, etc... * */ ! if (n>10){ - + n = 0; - + *************** *** 722,734 **** - * Redraw and wait for next update + * Redraw and wait for next update */ RedrawWindow(); ! if( HasExecute == 1) { @@ -39,16 +39,16 @@ ! } else { ! usleep( 500000L); ! } - - + + } --- 721,727 ---- - * Redraw and wait for next update + * Redraw and wait for next update */ RedrawWindow(); ! usleep(DELAY); - - + + } *************** *** 817,823 **** @@ -56,15 +56,15 @@ } strcpy(ExecuteCommand, argv[++i]); - HasExecute = 1; - + } else if (!strcmp(argv[i], "-g")){ - + --- 810,815 ---- *************** *** 975,981 **** char Command[512]; - - + + - if( HasExecute == 0) return; /* no command specified. Ignore clicks. */ DblClkDelay = 0; if ((xev->button == Button1) && (xev->type == ButtonPress)){ diff --git a/wmCalClock/Src/xutils.c b/wmCalClock/Src/xutils.c index 63a5798..5426d4f 100644 --- a/wmCalClock/Src/xutils.c +++ b/wmCalClock/Src/xutils.c @@ -1,10 +1,10 @@ /* * xutils.c - A collection of X-windows utilties for creating WindowMAker - * DockApps. + * DockApps. * * This file contains alot of the lower-level X windows routines. Origins with wmppp * (by Martijn Pieterse (pieterse@xs4all.nl)), but its been hacked up quite a bit - * and passed on from one new DockApp to the next. + * and passed on from one new DockApp to the next. * * * @@ -27,7 +27,7 @@ * * * - */ + */ #include #include #include @@ -42,7 +42,7 @@ /* - * X11 Variables + * X11 Variables */ int x_fd; XSizeHints mysizehints; @@ -93,7 +93,7 @@ static int flush_expose(Window w) { * RedrawWindowXY */ void RedrawWindow(void) { - + flush_expose(iconwin); XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, 0,0, wmgen.attributes.width, wmgen.attributes.height, 0, 0); @@ -103,7 +103,7 @@ void RedrawWindow(void) { } 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); @@ -167,7 +167,7 @@ void initXwindow(int argc, char *argv[]){ /* * openXwindow */ -void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, +void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, int pixmask_width, int pixmask_height) { unsigned int borderwidth = 1; @@ -189,9 +189,9 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit {"Color9", NULL, 0}}; - - /* + + /* * Create Pixmap */ cols[0].pixel = getColor(BackgroundColor, 1.0000, &red, &grn, &blu); @@ -209,9 +209,9 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit wmgen.attributes.colorsymbols = cols; wmgen.attributes.exactColors = False; wmgen.attributes.closeness = 40000; - wmgen.attributes.valuemask = XpmReturnPixels | XpmReturnExtensions | XpmColorSymbols + wmgen.attributes.valuemask = XpmReturnPixels | XpmReturnExtensions | XpmColorSymbols | XpmExactColors | XpmCloseness | XpmSize; - if (XpmCreatePixmapFromData(display, Root, pixmap_bytes, + if (XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen.pixmap), &(wmgen.mask), &(wmgen.attributes)) != XpmSuccess){ fprintf(stderr, "Not enough free colorcells.\n"); exit(1); @@ -220,8 +220,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit - /* - * Create a window + /* + * Create a window */ mysizehints.flags = USSize | USPosition; mysizehints.x = 0; @@ -235,19 +235,19 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit 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); - /* - * Activate hints + /* + * Activate hints */ XSetWMNormalHints(display, win, &mysizehints); classHint.res_name = wname; @@ -262,11 +262,11 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit * effect. I.e. for some you will need to Grab the focus and then return * it after you are done... */ - XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask - | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask + XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask + | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask | KeyPressMask | KeyReleaseMask); - XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask - | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask + XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask + | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask | KeyPressMask | KeyReleaseMask); @@ -278,8 +278,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit XSetWMName(display, win, &name); - /* - * Create Graphics Context (GC) for drawing + /* + * Create Graphics Context (GC) for drawing */ gcm = GCForeground | GCBackground | GCGraphicsExposures; gcv.foreground = fore_pix; @@ -325,7 +325,7 @@ unsigned long getColor(char *ColorName, float fac, int *red, int *grn, int *blu) Color.flags = DoRed | DoGreen | DoBlue; XAllocColor(display, Attributes.colormap, &Color); - + *red = Color.red; *grn = Color.green; *blu = Color.blue; diff --git a/wmCalClock/Src/xutils.h b/wmCalClock/Src/xutils.h index 565a134..4ed615f 100644 --- a/wmCalClock/Src/xutils.h +++ b/wmCalClock/Src/xutils.h @@ -4,7 +4,7 @@ /* - * Typedefs + * Typedefs */ typedef struct { Pixmap pixmap; @@ -21,7 +21,7 @@ typedef struct { Display *display; Window Root; Window iconwin, win; -int screen; +int screen; int DisplayDepth; diff --git a/wmCalClock/TODO b/wmCalClock/TODO index 6adf8db..349e897 100644 --- a/wmCalClock/TODO +++ b/wmCalClock/TODO @@ -1,7 +1,7 @@ TODO List --------- - - Add in a few more fonts... Graphite would be nice! Or EagleFeather + - Add in a few more fonts... Graphite would be nice! Or EagleFeather (its a Frank Lloyd Wright inspired font)? - Allow fonts to be added externally via some sort of config file... @@ -9,17 +9,17 @@ TODO List - Add alarm clock mode? - graphical Moon-Phase Icon in Calendar section. - + - Day numbers in Calendar section. This is something that I would really like myself! - Allow Changing of fonts/colors for the main Calendar section. - Foreign language support... - + - Add indicators for Greenwich, sidereal, local sideareal time displays (right now you dont really know what it is displaying just by looking at it)... - + diff --git a/wmMatrix/COPYING.BSD b/wmMatrix/COPYING.BSD index 8d64054..4130606 100644 --- a/wmMatrix/COPYING.BSD +++ b/wmMatrix/COPYING.BSD @@ -5,5 +5,5 @@ documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. No representations are made about the suitability of this -software for any purpose. It is provided "as is" without express or +software for any purpose. It is provided "as is" without express or implied warranty. diff --git a/wmMatrix/Makefile b/wmMatrix/Makefile index 0d90559..b149d85 100644 --- a/wmMatrix/Makefile +++ b/wmMatrix/Makefile @@ -1,8 +1,8 @@ CC = gcc -CFLAGS = -O2 -Wall -INCDIR = +CFLAGS = -O2 -Wall +INCDIR = DESTDIR= /usr -LIBDIR = +LIBDIR = LIBS = -lXpm -lX11 -lXext OBJS = wmMatrix.o matrix.o xutils.o yarandom.o @@ -14,7 +14,7 @@ all: wmMatrix wmMatrix.o: wmMatrix_master.xpm wmMatrix_mask.xbm -wmMatrix: $(OBJS) +wmMatrix: $(OBJS) $(CC) $(LDFLAGS) -o wmMatrix $^ $(LIBDIR) $(LIBS) clean: diff --git a/wmMatrix/config.h b/wmMatrix/config.h index cc6070c..21ce16d 100644 --- a/wmMatrix/config.h +++ b/wmMatrix/config.h @@ -2,7 +2,7 @@ /* config.h.in --- xscreensaver, Copyright (c) 1998 Jamie Zawinski. * * The best way to set these parameters is by running the included `configure' - * script. That examines your system, and generates `config.h' from + * script. That examines your system, and generates `config.h' from * `config.h.in'. * * If something goes very wrong, you can edit `config.h' directly, but beware @@ -29,13 +29,13 @@ /* #undef HAVE_XHPDISABLERESET */ /* First, some background: there are three distinct server extensions which - * are useful to a screen saver program: they are XIDLE, MIT-SCREEN-SAVER, + * are useful to a screen saver program: they are XIDLE, MIT-SCREEN-SAVER, * and SCREEN_SAVER. * * The XIDLE extension resides in .../contrib/extensions/xidle/ on the X11R5 - * contrib tape. This extension lets the client get accurate idle-time + * contrib tape. This extension lets the client get accurate idle-time * information from the X server in a potentially more reliable way than by - * simply watching for keyboard and mouse activity. However, the XIDLE + * simply watching for keyboard and mouse activity. However, the XIDLE * extension has apparently not been ported to X11R6. * * The SCREEN_SAVER extension is found (as far as I know) only in the SGI @@ -68,7 +68,7 @@ /* Define this if you have the XIDLE extension installed. If you have the * XIDLE extension, this is recommended. (You have this extension if the * file /usr/include/X11/extensions/xidle.h exists.) Turning on this flag - * lets XScreenSaver work better with servers which support this extension; + * lets XScreenSaver work better with servers which support this extension; * but it will still work with servers which do not suport it, so it's a good * idea to compile in support for it if you can. */ @@ -147,7 +147,7 @@ */ #define HAVE_GL 1 -/* Define this if you have OpenGL, but it's the MesaGL variant. (The +/* Define this if you have OpenGL, but it's the MesaGL variant. (The libraries have different names.) (HAVE_GL should be defined too.) */ /* #undef HAVE_MESA_GL */ @@ -190,13 +190,13 @@ /* #undef NO_LOCKING */ /* Define this if you want to use Kerberos authentication to lock/unlock the - * screen instead of your local password. This currently uses Kerberos V4, + * screen instead of your local password. This currently uses Kerberos V4, * but a V5 server with V4 compatibility will work. WARNING: DO NOT USE AFS - * string-to-key passwords with this option. This option currently *only* + * string-to-key passwords with this option. This option currently *only* * works with standard Kerberos des_string_to_key. If your password is an - * AFS password and not a kerberos password, it will not authenticate + * AFS password and not a kerberos password, it will not authenticate * properly. See the comments in driver/kpasswd.c for more information if you - * need it. + * need it. */ /* #undef HAVE_KERBEROS */ @@ -226,8 +226,8 @@ #define HAVE_SHADOW_PASSWD 1 /* Define this if your system is Digital or SCO Unix with so-called ``Enhanced - Security'', that is, the passwords live in /tcb/files/auth// - instead of in /etc/passwd, and one reads them with getprpwnam() instead + Security'', that is, the passwords live in /tcb/files/auth// + instead of in /etc/passwd, and one reads them with getprpwnam() instead of getpwnam(). */ /* #undef HAVE_ENHANCED_PASSWD */ @@ -238,7 +238,7 @@ */ /* #undef HAVE_ADJUNCT_PASSWD */ -/* Define this if you are running HPUX with so-called ``Secure Passwords'' +/* Define this if you are running HPUX with so-called ``Secure Passwords'' (if you have /usr/include/hpsecurity.h, you probably have this.) I haven't tested this one, let me know if it works. */ diff --git a/wmMatrix/images/matrix.xbm b/wmMatrix/images/matrix.xbm index 9400b47..f3d7c48 100644 --- a/wmMatrix/images/matrix.xbm +++ b/wmMatrix/images/matrix.xbm @@ -1,40 +1,40 @@ #define matrix_width 14 #define matrix_height 216 static char matrix_bits[] = { - 0xff, 0x3f, 0xff, 0x3d, 0xeb, 0x30, 0xfd, 0x34, 0xeb, 0x2c, 0xef, 0x35, - 0xeb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3b, 0xfb, 0x3b, 0xf7, 0x39, - 0xfb, 0x3b, 0xf7, 0x39, 0xfb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x35, - 0xeb, 0x38, 0xfb, 0x3d, 0xfb, 0x3b, 0xff, 0x31, 0xeb, 0x32, 0xff, 0x3f, - 0xff, 0x3f, 0xff, 0x31, 0xfb, 0x38, 0xfb, 0x3d, 0xfb, 0x38, 0xff, 0x34, - 0xeb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d, 0xfb, 0x3b, 0xf7, 0x31, - 0xeb, 0x20, 0xff, 0x39, 0xff, 0x3b, 0xff, 0x3f, 0xff, 0x3b, 0xf7, 0x31, - 0xeb, 0x3b, 0xf7, 0x31, 0xfb, 0x3c, 0xff, 0x35, 0xfb, 0x3b, 0xff, 0x3f, - 0xff, 0x3b, 0xff, 0x33, 0xeb, 0x33, 0xe7, 0x31, 0xeb, 0x2e, 0xff, 0x35, - 0xff, 0x3b, 0xff, 0x3f, 0xef, 0x3b, 0xfb, 0x31, 0xfb, 0x3b, 0xf7, 0x3b, - 0xef, 0x3b, 0xff, 0x37, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x35, - 0xeb, 0x20, 0xe7, 0x31, 0xeb, 0x28, 0xff, 0x35, 0xeb, 0x3b, 0xff, 0x3f, - 0xff, 0x3f, 0xff, 0x35, 0xeb, 0x28, 0xfb, 0x35, 0xeb, 0x28, 0xff, 0x39, - 0xef, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xef, 0x3b, 0xff, 0x37, - 0xeb, 0x2e, 0xcd, 0x24, 0xef, 0x2a, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d, - 0xfb, 0x3b, 0xff, 0x37, 0xef, 0x2b, 0xff, 0x39, 0xfb, 0x3b, 0xff, 0x3f, - 0xff, 0x3f, 0xff, 0x3d, 0xeb, 0x22, 0xfd, 0x36, 0xee, 0x2e, 0xdf, 0x2d, - 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x38, 0xfb, 0x3a, 0x77, 0x31, - 0xfb, 0x3b, 0xff, 0x39, 0xfb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d, - 0xfb, 0x3b, 0xff, 0x39, 0xff, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, - 0xff, 0x3f, 0xff, 0x35, 0xeb, 0x28, 0xd7, 0x21, 0xeb, 0x20, 0xff, 0x35, - 0xfb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xeb, 0x32, 0xf7, 0x31, - 0xeb, 0x2b, 0xff, 0x3f, 0xff, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d, - 0xeb, 0x3a, 0xf3, 0x30, 0xea, 0x28, 0xff, 0x35, 0xeb, 0x2f, 0xff, 0x3f, - 0xff, 0x3f, 0xff, 0x3d, 0xeb, 0x3a, 0xf5, 0x30, 0xeb, 0x28, 0xff, 0x39, - 0xff, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x37, 0xef, 0x33, 0xf7, 0x33, - 0xef, 0x2b, 0xef, 0x31, 0xfb, 0x2a, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d, - 0xeb, 0x28, 0xf5, 0x30, 0xef, 0x3a, 0xff, 0x35, 0xfb, 0x3f, 0xff, 0x3f, - 0xff, 0x3f, 0xff, 0x3f, 0xeb, 0x2a, 0xff, 0x36, 0xef, 0x2a, 0xfd, 0x34, - 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xfd, 0x34, 0xeb, 0x2a, 0xf7, 0x33, - 0xef, 0x3b, 0xff, 0x37, 0xff, 0x3f, 0xff, 0x3f, 0xef, 0x2b, 0xff, 0x31, - 0xeb, 0x22, 0xf7, 0x31, 0xef, 0x2b, 0xff, 0x31, 0xff, 0x3b, 0xff, 0x3f, - 0xfe, 0x3e, 0xff, 0x20, 0xeb, 0x2a, 0xff, 0x3d, 0xff, 0x2a, 0xff, 0x23, - 0xef, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x2d, 0xeb, 0x2b, 0xf7, 0x33, - 0xeb, 0x28, 0xff, 0x3d, 0xff, 0x3f, 0xff, 0x3f, 0xfe, 0x3e, 0xfd, 0x3c, - 0xfb, 0x2c, 0xff, 0x35, 0xfb, 0x3b, 0xff, 0x37, 0xff, 0x2f, 0xff, 0x3f, + 0xff, 0x3f, 0xff, 0x3d, 0xeb, 0x30, 0xfd, 0x34, 0xeb, 0x2c, 0xef, 0x35, + 0xeb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3b, 0xfb, 0x3b, 0xf7, 0x39, + 0xfb, 0x3b, 0xf7, 0x39, 0xfb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x35, + 0xeb, 0x38, 0xfb, 0x3d, 0xfb, 0x3b, 0xff, 0x31, 0xeb, 0x32, 0xff, 0x3f, + 0xff, 0x3f, 0xff, 0x31, 0xfb, 0x38, 0xfb, 0x3d, 0xfb, 0x38, 0xff, 0x34, + 0xeb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d, 0xfb, 0x3b, 0xf7, 0x31, + 0xeb, 0x20, 0xff, 0x39, 0xff, 0x3b, 0xff, 0x3f, 0xff, 0x3b, 0xf7, 0x31, + 0xeb, 0x3b, 0xf7, 0x31, 0xfb, 0x3c, 0xff, 0x35, 0xfb, 0x3b, 0xff, 0x3f, + 0xff, 0x3b, 0xff, 0x33, 0xeb, 0x33, 0xe7, 0x31, 0xeb, 0x2e, 0xff, 0x35, + 0xff, 0x3b, 0xff, 0x3f, 0xef, 0x3b, 0xfb, 0x31, 0xfb, 0x3b, 0xf7, 0x3b, + 0xef, 0x3b, 0xff, 0x37, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x35, + 0xeb, 0x20, 0xe7, 0x31, 0xeb, 0x28, 0xff, 0x35, 0xeb, 0x3b, 0xff, 0x3f, + 0xff, 0x3f, 0xff, 0x35, 0xeb, 0x28, 0xfb, 0x35, 0xeb, 0x28, 0xff, 0x39, + 0xef, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xef, 0x3b, 0xff, 0x37, + 0xeb, 0x2e, 0xcd, 0x24, 0xef, 0x2a, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d, + 0xfb, 0x3b, 0xff, 0x37, 0xef, 0x2b, 0xff, 0x39, 0xfb, 0x3b, 0xff, 0x3f, + 0xff, 0x3f, 0xff, 0x3d, 0xeb, 0x22, 0xfd, 0x36, 0xee, 0x2e, 0xdf, 0x2d, + 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x38, 0xfb, 0x3a, 0x77, 0x31, + 0xfb, 0x3b, 0xff, 0x39, 0xfb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d, + 0xfb, 0x3b, 0xff, 0x39, 0xff, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, + 0xff, 0x3f, 0xff, 0x35, 0xeb, 0x28, 0xd7, 0x21, 0xeb, 0x20, 0xff, 0x35, + 0xfb, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xeb, 0x32, 0xf7, 0x31, + 0xeb, 0x2b, 0xff, 0x3f, 0xff, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d, + 0xeb, 0x3a, 0xf3, 0x30, 0xea, 0x28, 0xff, 0x35, 0xeb, 0x2f, 0xff, 0x3f, + 0xff, 0x3f, 0xff, 0x3d, 0xeb, 0x3a, 0xf5, 0x30, 0xeb, 0x28, 0xff, 0x39, + 0xff, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x37, 0xef, 0x33, 0xf7, 0x33, + 0xef, 0x2b, 0xef, 0x31, 0xfb, 0x2a, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3d, + 0xeb, 0x28, 0xf5, 0x30, 0xef, 0x3a, 0xff, 0x35, 0xfb, 0x3f, 0xff, 0x3f, + 0xff, 0x3f, 0xff, 0x3f, 0xeb, 0x2a, 0xff, 0x36, 0xef, 0x2a, 0xfd, 0x34, + 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xfd, 0x34, 0xeb, 0x2a, 0xf7, 0x33, + 0xef, 0x3b, 0xff, 0x37, 0xff, 0x3f, 0xff, 0x3f, 0xef, 0x2b, 0xff, 0x31, + 0xeb, 0x22, 0xf7, 0x31, 0xef, 0x2b, 0xff, 0x31, 0xff, 0x3b, 0xff, 0x3f, + 0xfe, 0x3e, 0xff, 0x20, 0xeb, 0x2a, 0xff, 0x3d, 0xff, 0x2a, 0xff, 0x23, + 0xef, 0x3b, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x2d, 0xeb, 0x2b, 0xf7, 0x33, + 0xeb, 0x28, 0xff, 0x3d, 0xff, 0x3f, 0xff, 0x3f, 0xfe, 0x3e, 0xfd, 0x3c, + 0xfb, 0x2c, 0xff, 0x35, 0xfb, 0x3b, 0xff, 0x37, 0xff, 0x2f, 0xff, 0x3f, }; diff --git a/wmMatrix/matrix.c b/wmMatrix/matrix.c index 90f2d75..82d8278 100644 --- a/wmMatrix/matrix.c +++ b/wmMatrix/matrix.c @@ -5,7 +5,7 @@ * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation. No representations are made about the suitability of this - * software for any purpose. It is provided "as is" without express or + * software for any purpose. It is provided "as is" without express or * implied warranty. * * Matrix -- simulate the text scrolls from the movie "The Matrix". @@ -169,8 +169,8 @@ static void feed_matrix(m_state * state) int x; - /* - * Update according to current feeders. + /* + * Update according to current feeders. */ for (x = 0; x < state->grid_width; x++) { diff --git a/wmMatrix/wmMatrix.1 b/wmMatrix/wmMatrix.1 index bb9b778..d993d4e 100644 --- a/wmMatrix/wmMatrix.1 +++ b/wmMatrix/wmMatrix.1 @@ -1,4 +1,4 @@ -.TH WMMATRIX 1 "September 1999" +.TH WMMATRIX 1 "September 1999" .SH NAME wmMatrix \- Dockable Matrix Display .SH SYNOPSIS diff --git a/wmMatrix/xutils.c b/wmMatrix/xutils.c index c43a98a..5af32d7 100644 --- a/wmMatrix/xutils.c +++ b/wmMatrix/xutils.c @@ -1,10 +1,10 @@ /* * xutils.c - A collection of X-windows utilties for creating WindowMAker - * DockApps. + * DockApps. * * This file contains alot of the lower-level X windows routines. Origins with wmppp * (by Martijn Pieterse (pieterse@xs4all.nl)), but its been hacked up quite a bit - * and passed on from one new DockApp to the next. + * and passed on from one new DockApp to the next. * * * @@ -42,7 +42,7 @@ #include "xutils.h" /* - * X11 Variables + * X11 Variables */ int x_fd; XSizeHints mysizehints; @@ -168,7 +168,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit {"Color9", NULL, 0} }; - /* + /* * Create Pixmap */ cols[0].pixel = getColor(BackgroundColor, 1.0000, &red, &grn, &blu); @@ -192,8 +192,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit exit(1); } - /* - * Create a window + /* + * Create a window */ mysizehints.flags = USSize | USPosition; mysizehints.x = 0; @@ -214,8 +214,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y, mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix); - /* - * Activate hints + /* + * Activate hints */ XSetWMNormalHints(display, win, &mysizehints); classHint.res_name = wname; @@ -240,8 +240,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit XSetWMName(display, win, &name); - /* - * Create Graphics Context (GC) for drawing + /* + * Create Graphics Context (GC) for drawing */ gcm = GCForeground | GCBackground | GCGraphicsExposures; gcv.foreground = fore_pix; @@ -249,8 +249,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit gcv.graphics_exposures = 0; NormalGC = XCreateGC(display, Root, gcm, &gcv); - /* - * Create Graphics Context (GC) for erasing + /* + * Create Graphics Context (GC) for erasing */ gcm = GCForeground | GCBackground | GCGraphicsExposures; gcv.foreground = back_pix; diff --git a/wmMatrix/xutils.h b/wmMatrix/xutils.h index 8f4da0b..0411783 100644 --- a/wmMatrix/xutils.h +++ b/wmMatrix/xutils.h @@ -2,7 +2,7 @@ #define WMGENERAL_H_INCLUDED /* - * Typedefs + * Typedefs */ typedef struct { Pixmap pixmap; diff --git a/wmMatrix/yarandom.h b/wmMatrix/yarandom.h index b36da43..fcdaa92 100644 --- a/wmMatrix/yarandom.h +++ b/wmMatrix/yarandom.h @@ -5,7 +5,7 @@ * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation. No representations are made about the suitability of this - * software for any purpose. It is provided "as is" without express or + * software for any purpose. It is provided "as is" without express or * implied warranty. */ diff --git a/wmSMPmon/Changelog b/wmSMPmon/Changelog index 99801da..2e77313 100644 --- a/wmSMPmon/Changelog +++ b/wmSMPmon/Changelog @@ -15,7 +15,7 @@ - Improved processing of command line options - unknown options and missing parameters are now dealt with -- wmSMPmon now properly supports single CPU machines! On a single CPU +- wmSMPmon now properly supports single CPU machines! On a single CPU machine, the CPU load bar is drawn wider and only one graph style is supported. - man page improved and edited Makefile so man page will get installed as well @@ -29,4 +29,4 @@ 2.9.1 - Adapted wmSMPmon to kernel 2.6, using code from top and - procps. kernels 2.2, 2.4 and 2.6 are now supported. + procps. kernels 2.2, 2.4 and 2.6 are now supported. diff --git a/wmSMPmon/wmSMPmon/Makefile b/wmSMPmon/wmSMPmon/Makefile index 1253b7f..c45e415 100644 --- a/wmSMPmon/wmSMPmon/Makefile +++ b/wmSMPmon/wmSMPmon/Makefile @@ -1,4 +1,4 @@ -#(c)1999-2003 redseb +#(c)1999-2003 redseb # Adapted for wmSMPmon 2.9.x and higher: Thomas Ribbrock # Change the following two to determine installation location @@ -33,7 +33,7 @@ $(OBJ): %.o : %.c $(CC) $(CFLAGS) -c -o $@ $< clean: - rm -rf $(EXE) + rm -rf $(EXE) rm -rf *.o rm -rf ../wmgeneral/*.o diff --git a/wmSMPmon/wmSMPmon/general.c b/wmSMPmon/wmSMPmon/general.c index 7ac8686..ece43f6 100644 --- a/wmSMPmon/wmSMPmon/general.c +++ b/wmSMPmon/wmSMPmon/general.c @@ -1,16 +1,16 @@ -/*###################################################################### - # # - # This file contains some general utility functions for wmSMPmon. # - # # - # All of them were taken from the program 'top' from the procps # - # suite. # - # With thanks to the author of top: # - # James C. Warner # - # # +/*###################################################################### + # # + # This file contains some general utility functions for wmSMPmon. # + # # + # All of them were taken from the program 'top' from the procps # + # suite. # + # With thanks to the author of top: # + # James C. Warner # + # # # This file is placed under the conditions of the GNU Library # # General Public License, version 2, or any later version. # # See file COPYING for information on distribution conditions. # - # # + # # ######################################################################*/ #include "standards.h" diff --git a/wmSMPmon/wmSMPmon/standards.h b/wmSMPmon/wmSMPmon/standards.h index c1609d6..aca61ea 100644 --- a/wmSMPmon/wmSMPmon/standards.h +++ b/wmSMPmon/wmSMPmon/standards.h @@ -1,16 +1,16 @@ -/*###################################################################### - # # - # This file contains the definitions of the functions that wmSMPmon # - # uses to determine CPU load, memory and swap information. # - # All functions should be implemented by any OS dependent module # - # that is added to wmSMPmon. See sysinfo-linux.c as an example. # - # # - # (c) 2004 Thomas Ribbrock # - # # +/*###################################################################### + # # + # This file contains the definitions of the functions that wmSMPmon # + # uses to determine CPU load, memory and swap information. # + # All functions should be implemented by any OS dependent module # + # that is added to wmSMPmon. See sysinfo-linux.c as an example. # + # # + # (c) 2004 Thomas Ribbrock # + # # # This file is placed under the conditions of the GNU Library # # General Public License, version 2, or any later version. # # See file COPYING for information on distribution conditions. # - # # + # # ######################################################################*/ #ifndef WMSMP_STANDARDS_H diff --git a/wmSMPmon/wmgeneral/wmgeneral.c b/wmSMPmon/wmgeneral/wmgeneral.c index 13caa7b..ae99424 100644 --- a/wmSMPmon/wmgeneral/wmgeneral.c +++ b/wmSMPmon/wmgeneral/wmgeneral.c @@ -17,7 +17,7 @@ * Now supports >256 colors 11/09/1998 (Martijn Pieterse, pieterse@xs4all.nl) * Removed a bug from parse_rcfile. You could - not use "start" in a command if a label was + not use "start" in a command if a label was also start. * Changed the needed geometry string. We don't use window size, and don't support @@ -177,7 +177,7 @@ static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) { err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap), &(wmgen->mask), &(wmgen->attributes)); - + if (err != XpmSuccess) { fprintf(stderr, "Not enough free colorcells.\n"); exit(1); @@ -224,9 +224,9 @@ static int flush_expose(Window w) { \***************************************************************************/ void RedrawWindow(void) { - + flush_expose(iconwin); - XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, + 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, @@ -238,9 +238,9 @@ void RedrawWindow(void) { \***************************************************************************/ void RedrawWindowXY(int x, int y) { - + flush_expose(iconwin); - XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, + 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, diff --git a/wmWeather/CHANGES b/wmWeather/CHANGES index 45e94c7..0ef2f78 100644 --- a/wmWeather/CHANGES +++ b/wmWeather/CHANGES @@ -18,7 +18,7 @@ Version Description -tc Added code to properly decode wind speed when in MPS. - + Fixed bug in beaufort wind speed calcs. @@ -39,18 +39,18 @@ Version Description -wgc for setting the Wind Gust color. Also cleaned up the pixmap to minimize the number of colors used. - + Changed metric toggle to work with a key press (any key). - + Added double click support. Now double clicking does the following: - + Double Mouse Left: pops up the fully decoded METAR file in xmessage. - + Double Mouse Middle: Currently undefined. - + Double Mouse Right: Forces a new update (i.e. download.) - + @@ -64,7 +64,7 @@ Version Description Also added -mps option to display wind speed in units of meters/second (when in -metric mode). - + 1.27 - released March 8, 1999. fixed bug in speed calculation when wind is gusting. @@ -98,7 +98,7 @@ Version Description when Celsius is set. (Really should change the flag to -metric). 1.1 - Released Jan. 25, 1999. - Bug fixes. + Bug fixes. Added Degrees F/C support... Added a bit more info on where to find info on METAR/TAF system... diff --git a/wmWeather/HINTS b/wmWeather/HINTS index 6a739d8..0e93656 100644 --- a/wmWeather/HINTS +++ b/wmWeather/HINTS @@ -16,7 +16,7 @@ Afterstep users put the following in their .steprc Note: AfterStep's Wharf has a problem with pixmaps that are larger than 60x60 pixels. Please tell the AfterStep authors to fix this, this is not our fault, but a Wharf problem! - + Other window managers. ---------------------- diff --git a/wmWeather/INSTALL b/wmWeather/INSTALL index 8aeaf3b..c0bb693 100644 --- a/wmWeather/INSTALL +++ b/wmWeather/INSTALL @@ -17,8 +17,8 @@ Installation 1) tar -xvf wmWeather-1.29.tar 2) cd wmWeather-1.29/Src/ 3) make clean -4) make -5) make install (must be root) +4) make +5) make install (must be root) 6) wmWeather & (or 'wmWeather -h' for help, or 'man wmWeather' for the man page) 7) You need to set the location of perl correctly in GrabWeather if your perl is located in a place other than /usr/bin/ diff --git a/wmWeather/Src/GrabWeather b/wmWeather/Src/GrabWeather index 86dde9c..243c1b4 100755 --- a/wmWeather/Src/GrabWeather +++ b/wmWeather/Src/GrabWeather @@ -56,7 +56,7 @@ # - # Parse HTML File. + # Parse HTML File. # $Temp = -999.0; $Chill = -999.0; @@ -82,7 +82,7 @@ - + # # Isolate the Wind groups out of the coded METAR report. # There may be two groups - the normal one and a variability set. diff --git a/wmWeather/Src/Makefile b/wmWeather/Src/Makefile index e89bd8c..f09ac46 100644 --- a/wmWeather/Src/Makefile +++ b/wmWeather/Src/Makefile @@ -18,7 +18,7 @@ OBJS = wmWeather.o \ all: wmWeather.o wmWeather wmWeather.o: wmWeather_master.xpm wmWeather_mask.xbm -wmWeather: $(OBJS) +wmWeather: $(OBJS) $(CC) $(CFLAGS) $(SYSTEM) -o wmWeather $^ $(INCDIR) $(LIBDIR) $(LIBS) clean: @@ -30,5 +30,5 @@ clean: install:: wmWeather install -c -s -m 0755 wmWeather $(DESTDIR)/bin install -c -m 0755 GrabWeather $(DESTDIR)/bin - install -c -m 0644 wmWeather.1 $(DESTDIR)/man/man1 + install -c -m 0644 wmWeather.1 $(DESTDIR)/man/man1 diff --git a/wmWeather/Src/wmWeather.1 b/wmWeather/Src/wmWeather.1 index 401efe2..56ed778 100644 --- a/wmWeather/Src/wmWeather.1 +++ b/wmWeather/Src/wmWeather.1 @@ -1,4 +1,4 @@ -.TH WMWEATHER 1.1 "19 January 1999" +.TH WMWEATHER 1.1 "19 January 1999" .SH NAME WMWEATHER \- Dockable Weather Monitor .SH SYNOPSIS @@ -74,7 +74,7 @@ Set the color of the labels. (E.g. -lc red or -lc salmon or -lc #4523ff). Set the background color. (#8e8e69 is LCD-ish). .TP .B \-dc -Set the color of the data entries. +Set the color of the data entries. .TP .B \-tc Set the color of the station ID/update time header. @@ -86,9 +86,9 @@ average speed). Similarly, the wind direction indicator with change to this color when the wind direction is variable. (The value shown in this case is the average direction). .SH BUGS -Let me know if/when you find any. +Let me know if/when you find any. .SH NOTES -Requires that a (fairly recent) version of wget be installed on your machine. +Requires that a (fairly recent) version of wget be installed on your machine. You can download wget from "http://sunsite.auc.dk/wget/". .SH AUTHOR Michael G. Henderson diff --git a/wmWeather/Src/wmWeather.c b/wmWeather/Src/wmWeather.c index 390c6c2..5733de6 100644 --- a/wmWeather/Src/wmWeather.c +++ b/wmWeather/Src/wmWeather.c @@ -1,11 +1,11 @@ /* * * wmWeather-1.31 (C) 1999 Mike Henderson (mghenderson@lanl.gov) - * + * * - Shows Local Weather conditions - * - * - * + * + * + * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program (see the file COPYING); if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA * * @@ -29,7 +29,7 @@ * * - Add a GTK popup window to display data in a nicer way. Currently just use * xmessage... - * + * * - Add "current conditions" graphic (as background?). I.e. one of those little * cartoons that show clouds or sun with rain or snow, etc. on it... * @@ -47,7 +47,7 @@ * Fixed a bug whereby the App would crash when trying to gain input * focus under non-WindowMaker WMs (focus is now grabbed by * `PointerRoot' not `iconwin'). - * + * * Added StationID and `time-of-last-update' labels. To do this I needed * to shrink the fonts down and scrunch them together a bit more. * @@ -75,11 +75,11 @@ * -wgc for setting the Wind Gust color. * * Also cleaned up the pixmap to minimize the number of colors used. - * - * Changed metric toggle to work with a key press (any key). - * + * + * Changed metric toggle to work with a key press (any key). + * * Added double click support. Now double clicking does the following: - * + * * Double Mouse Left: pops up the fully decoded METAR file * in xmessage. * @@ -96,14 +96,14 @@ * Since Windchill is not always available, we only show it if its * available. If its not, we paste up DewPoint as default. * - * Also added -mps option to display wind speed in units of + * Also added -mps option to display wind speed in units of * meters/second (when in -metric mode). * * Version 1.27 - released March 8, 1999. * fixed bug in speed calculation when wind is gusting. * * Version 1.26 - released February 24, 1999. - * Added -delay option. + * Added -delay option. * * Version 1.25 - released February 16, 1999. * Added Wind speeds on the 'Beaufort scale' @@ -145,8 +145,8 @@ -/* - * Includes +/* + * Includes */ #include #include @@ -162,8 +162,8 @@ -/* - * Delay between refreshes (in microseconds) +/* + * Delay between refreshes (in microseconds) */ #define DELAY 10000L #define WMWEATHER_VERSION "1.31" @@ -203,7 +203,7 @@ int DblClkDelay; * We convert to digits in the sequence `NWSE' so we dont have to put all these * combinations into the pixmap. */ -static char *CompassDirection[] = { "0", "003", "03", "303", "3", "323", "23", "223", +static char *CompassDirection[] = { "0", "003", "03", "303", "3", "323", "23", "223", "2", "221", "21", "121", "1", "101", "01", "001"}; @@ -216,8 +216,8 @@ char StationTimeColor[30] = "#c5a6ff"; -/* - * main +/* + * main */ int main(int argc, char *argv[]) { @@ -249,14 +249,14 @@ FILE *fp; - + /* * Parse any command line arguments. */ ParseCMDLine(argc, argv); - - + + /* * Do the window opening in 2 stages. After the initXwindow() call, * we know what the Depth of the Display is. We can then pick an appropriate @@ -264,12 +264,12 @@ FILE *fp; * better on a low-color 8-bit display. */ initXwindow(argc, argv); - openXwindow(argc, argv, wmWeather_master, wmWeather_mask_bits, wmWeather_mask_width, + openXwindow(argc, argv, wmWeather_master, wmWeather_mask_bits, wmWeather_mask_width, wmWeather_mask_height, BackColor, LabelColor, WindGustColor, DataColor, StationTimeColor); - + /* * Loop until we die */ @@ -290,19 +290,19 @@ FILE *fp; * Keep track of # of seconds */ if (m > 100){ - + m = 0; ++dt1; ++dt2; ++dt3; - + } else { - + /* * Increment counter */ ++m; - + } @@ -338,7 +338,7 @@ FILE *fp; - /* + /* * Process any pending X events. */ while(XPending(display)){ @@ -369,7 +369,7 @@ FILE *fp; - + /* @@ -380,7 +380,7 @@ FILE *fp; * may be Up-To-Date! */ if ((dt2 > 5)||(ForceUpdate)){ - + dt2 = 0; /* @@ -410,7 +410,7 @@ FILE *fp; DT = UT - LT; if (DT > 24.0) DT -= 24.0; if (DT < 0.00) DT += 24.0; - + /* @@ -477,7 +477,7 @@ FILE *fp; - } + } @@ -492,7 +492,7 @@ FILE *fp; dt3 = 0; - + /* @@ -512,7 +512,7 @@ FILE *fp; chr = (int)StationID[3] - 65; copyXPMArea(chr*5+2, 128, 5, 6, 7+q, 6); q+= 5; if (UpdateLTHour != 99){ - q = 0; + q = 0; Tens = (int)(UpdateLTHour); copyXPMArea(Tens/10*5+2, 135, 5, 6, 36+q, 6); q+= 5; copyXPMArea(Tens%10*5+2, 135, 5, 6, 36+q, 6); q+= 5; @@ -575,7 +575,7 @@ FILE *fp; val = DewPoint; copyXPMArea(5, 87, 17, 8, 5, 24); } - + if ((val > -999.0)&&(val < 1000.0)){ sgn = (val < 0.0) ? -1.0 : 1.0; val *= sgn; @@ -722,7 +722,7 @@ FILE *fp; q += 2; } else if (Direction > 0.0){ - /* + /* * In this case, the wind direction is variable with speed < 6 Knots. * A numerical direction is not given in these cases. Just write out 'VRB'. */ @@ -735,7 +735,7 @@ FILE *fp; if (Metric && Beaufort) { int beau = 0; int spd; - + sgn = (Speed < 0.0) ? -1.0 : 1.0; spd = (int)(sgn * (int)Speed); if (spd > 1) { beau = 1; } @@ -828,8 +828,8 @@ UpToDate = 0; - /* - * Wait for next update + /* + * Wait for next update */ usleep(DELAY); @@ -849,7 +849,7 @@ void ParseCMDLine(int argc, char *argv[]) { int i; void print_usage(); - + StationID[0] = '\0'; PressureUnits = 0; MetersPerSecond = 0; @@ -907,15 +907,15 @@ void ParseCMDLine(int argc, char *argv[]) { strcpy(DataColor, argv[++i]); } else if (!strcmp(argv[i], "-beaufort")){ - + Beaufort = 1; } else if (!strcmp(argv[i], "-mps")){ - + MetersPerSecond = 1; } else if (!strcmp(argv[i], "-W")){ - + ShowWindChill = 1; } else if ((!strcmp(argv[i], "-metric"))||(!strcmp(argv[i], "-m"))){ @@ -936,7 +936,7 @@ void ParseCMDLine(int argc, char *argv[]) { PressureUnits = 3; PressureConv = 25.4; - + } else if ((!strcmp(argv[i], "-station"))||(!strcmp(argv[i], "-s"))){ if ((i+1 >= argc)||(argv[i+1][0] == '-')) { @@ -960,13 +960,13 @@ void ParseCMDLine(int argc, char *argv[]) { print_usage(); exit(-1); - } + } /* * Convert Time to seconds */ UpdateDelay *= 60; ++i; - + } else { print_usage(); @@ -1089,7 +1089,7 @@ double UT; /* - * This routine handles button presses. + * This routine handles button presses. * * - Left Mouse single click toggles Deg F/C for temperatures. * - Some other click event should display the full METAR report -- lots of @@ -1110,7 +1110,7 @@ void ButtonPressEvent(XButtonEvent *xev){ if (GotFirstClick1) GotDoubleClick1 = 1; else GotFirstClick1 = 1; - } else if ((xev->button == Button2) && (xev->type == ButtonPress)){ + } else if ((xev->button == Button2) && (xev->type == ButtonPress)){ if (GotFirstClick2) GotDoubleClick2 = 1; else GotFirstClick2 = 1; diff --git a/wmWeather/Src/xutils.c b/wmWeather/Src/xutils.c index 1f0df15..0a643b3 100644 --- a/wmWeather/Src/xutils.c +++ b/wmWeather/Src/xutils.c @@ -1,10 +1,10 @@ /* * xutils.c - A collection of X-windows utilties for creating WindowMAker - * DockApps. + * DockApps. * * This file contains alot of the lower-level X windows routines. Origins with wmppp * (by Martijn Pieterse (pieterse@xs4all.nl)), but its been hacked up quite a bit - * and passed on from one new DockApp to the next. + * and passed on from one new DockApp to the next. * * * @@ -27,7 +27,7 @@ * * * - */ + */ #include #include #include @@ -42,7 +42,7 @@ /* - * X11 Variables + * X11 Variables */ int x_fd; XSizeHints mysizehints; @@ -85,7 +85,7 @@ static int flush_expose(Window w) { * RedrawWindowXY */ void RedrawWindow(void) { - + flush_expose(iconwin); XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, 0,0, wmgen.attributes.width, wmgen.attributes.height, 0, 0); @@ -95,7 +95,7 @@ void RedrawWindow(void) { } 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); @@ -159,8 +159,8 @@ void initXwindow(int argc, char *argv[]){ /* * openXwindow */ -void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, - int pixmask_width, int pixmask_height, char *BackColor, char *LabelColor, +void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, + int pixmask_width, int pixmask_height, char *BackColor, char *LabelColor, char *WindGustColor, char *DataColor, char *StationTimeColor) { unsigned int borderwidth = 1; @@ -177,9 +177,9 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit {"StationTimeColor", NULL, 0} }; - - /* + + /* * Create Pixmap */ cols[0].pixel = getColor(BackColor, 1.0); @@ -191,9 +191,9 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit wmgen.attributes.colorsymbols = cols; wmgen.attributes.exactColors = False; wmgen.attributes.closeness = 40000; - wmgen.attributes.valuemask = XpmReturnPixels | XpmReturnExtensions | XpmColorSymbols + wmgen.attributes.valuemask = XpmReturnPixels | XpmReturnExtensions | XpmColorSymbols | XpmExactColors | XpmCloseness | XpmSize; - if (XpmCreatePixmapFromData(display, Root, pixmap_bytes, + if (XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen.pixmap), &(wmgen.mask), &(wmgen.attributes)) != XpmSuccess){ fprintf(stderr, "Not enough free colorcells.\n"); exit(1); @@ -202,8 +202,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit - /* - * Create a window + /* + * Create a window */ mysizehints.flags = USSize | USPosition; mysizehints.x = 0; @@ -217,19 +217,19 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit 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); - /* - * Activate hints + /* + * Activate hints */ XSetWMNormalHints(display, win, &mysizehints); classHint.res_name = wname; @@ -244,11 +244,11 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit * effect. I.e. for some you will need to Grab the focus and then return * it after you are done... */ - XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask - | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask + XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask + | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask | KeyPressMask | KeyReleaseMask); - XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask - | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask + XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask + | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask | KeyPressMask | KeyReleaseMask); @@ -260,8 +260,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit XSetWMName(display, win, &name); - /* - * Create Graphics Context (GC) for drawing + /* + * Create Graphics Context (GC) for drawing */ gcm = GCForeground | GCBackground | GCGraphicsExposures; gcv.foreground = fore_pix; diff --git a/wmWeather/Src/xutils.h b/wmWeather/Src/xutils.h index 5b6231f..fcd25f6 100644 --- a/wmWeather/Src/xutils.h +++ b/wmWeather/Src/xutils.h @@ -4,7 +4,7 @@ /* - * Typedefs + * Typedefs */ typedef struct { Pixmap pixmap; @@ -21,7 +21,7 @@ typedef struct { Display *display; Window Root; Window iconwin, win; -int screen; +int screen; int DisplayDepth; diff --git a/wmacpi/AUTHORS b/wmacpi/AUTHORS index df14ee7..6121538 100644 --- a/wmacpi/AUTHORS +++ b/wmacpi/AUTHORS @@ -1,5 +1,5 @@ Simon Fowler - Complete rewriting of the code from wmacpi-1.34. + Complete rewriting of the code from wmacpi-1.34. timecop timecop@japan.co.jp diff --git a/wmacpi/ChangeLog b/wmacpi/ChangeLog index e6be39e..d3793e2 100644 --- a/wmacpi/ChangeLog +++ b/wmacpi/ChangeLog @@ -51,8 +51,8 @@ Thanks, JB. - - + + 2008 March 18 2.2rc3 Some fixes for the sysfs interface support, supplied by jblache@debian.org: @@ -70,7 +70,7 @@ JB. - + 2008 March 14 2.2rc2 Support for the sysfs interface that became mandatory with kernel 2.6.24 (patch supplied by jblache@debian.org). @@ -78,7 +78,7 @@ A number of graphics fixes also from jblache@debian.org. Removed support for hardware reported critical battery status. - + 2007 July 14 2.2rc1 Major changes to command line handling and to the way we use libdockapp, courtesy of Patrice Dumas. This should hopefully fix @@ -89,7 +89,7 @@ /proc/acpi/info - thanks to Samuel Ortiz. Fixed a longstanding issue with redrawing - thanks to Vito - Caputo. + Caputo. This version changes a number of command line options (little used ones, but they're still incompatible changes) due to the @@ -98,7 +98,7 @@ (thanks to libdockapp grabbing -h, -v and -w for itself). Also, long options are now supported for everything in wmacpi (but not acpi, since it doesn't use libdockapp for command line parsing). - + 2007 January 10 2.2a1 Added a patch from Patrice Dumas to support newer versions of libdockapp. @@ -107,20 +107,20 @@ 2005 February 2 2.1 Finalised libdockapp-0.5.0 port - no changes from 2.1rc1. - + 2005 Jan 5 2.1rc1 Typo fix in the manpage. Ported to libdockapp-0.5.0 - all this needed was changing the type of the dockapp width and height to unsigned short. - + 2004 October 24 2.0 Upped version number to 2.0. Small typo fixes. wmacpi 2.0 goes gold . . . - + 2004 September 28 2.0rc1 Added support for switching to capacity mode automatically, on detecting dodgy reports from the battery. @@ -131,7 +131,7 @@ Various cleanups. Hopefully last release before the final 2.0. - + 2004 August 18 1.99r7 Implemented the libdockapp port - this seems to close Debian bug #227819, but it hasn't received sufficient testing. @@ -141,17 +141,17 @@ remaining capacity of the battery and notes the time at which it was sampled, and uses a history of samples to estimate the rate of drain on the battery. From there it calculates a value for time - remaining. + remaining. - Also, various cleanups have gone in: + Also, various cleanups have gone in: * a reworking of the scrolling code - + * generic battery number support (rather than just using two pixmaps, one for b1 and one for b2) * stopped the battery glyph from blinking when running on AC - + 2004 July 19 1.99r6 Fix for Debian bug #250792 - the parser for the acpi files was too stupid to deal with error conditions. I've now added some @@ -184,7 +184,7 @@ libdockapp is waiting, but I think that's the only change left without more bug repots . . . - + 2004 April 15 1.99r4 Collected fixes for various small issues. @@ -202,17 +202,17 @@ I've left the big changes that are needed (like using libdockapp, in the hope that it'll solve the docking problems) until later, so that I can get these smaller fixes out. Hopefully soon . . . - + 2004 January 12 1.99r3 . . . and a fix for a fix that didn't fix it . . . - + 2004 January 12 1.99r2 Some cleanups and bugfixes found by the wonderful Debian users. It's finally in testing! - + 2003 November 23 1.99 - Finally claimed the wmacpi name as my own . . . + Finally claimed the wmacpi name as my own . . . Renamed wmacpi-ng and acpi-ng, renamed the header files, fixed up the makefile. @@ -226,7 +226,7 @@ This is wmacpi 1.99, so that I can have a release packaged and in Debian before going to 2.0, so that any bugs that are left can be found by all the extra users. - + 2003 September 26 0.99 Fix the last of the old wmacpi code oddities (specifically, the APMInfo struct, which was a completely inappropriate name given we @@ -237,21 +237,21 @@ more feedback and the like, so I'm going to make this version 0.99, preliminary to either wmacpi-ng 1.0 or wmacpi 2.0 (depending which direction I go with that). - + 2003 September 23 0.92 Fix a few more bugs, and include an option to allow the user to specify how often to sample the ACPI data - some BIOSes disable all interrupts while reading from the battery, which apparently causes some interactivity issues. I have no idea why reading once every three seconds (which is our default), but there've been some - complaints. + complaints. Also fixed acpi-ng to properly handle the -a option. - + 2003 August 6 0.91 Fix a problem I'm seeing with docking the app - if the window name is set to "acpi" rather than "apm" it doesn't dock . . . - + 2003 July 16 0.90 Make the time display show '--:--' instead of '00:00' when the time remaining is 0 - I think this is reasonable, since it'll only @@ -262,7 +262,7 @@ don't lose anything. We also get to handle the (sadly, very common) case where the ACPI subsystem doesn't report sane values for the things we depend on. - + 2003 July 11 0.50a2 Make the time display show nothing (as opposed to 00:00) when the time remaining is unknown, as requested by Emma Jane Hogbin. @@ -283,7 +283,7 @@ annoying about. Also, added an acpi-ng manpage. - + 2003 July 11 0.50a1 Properly fix the AC adapter issue - it's not much use adding the infrastructure and then forgetting to fix the code that uses it. @@ -291,14 +291,14 @@ Fix the time disiplay so that it doesn't try to display values greater than 99:59, since the display area won't fit anything beyond that. - + 2003 July 10 0.50a Bugfixes, to handle two problems: the case where something like the present rate or some such is "unknown" (reported initially by Emma Jane Hogbin, and where the AC adapter is called something other than "AC" (reported by Sebastian Henschel). This an 'a' - release because I can't test these myself . . . - + release because I can't test these myself . . . + 2003 July 6 0.50 Finally got rid of that annoying button - that space now contains a 'B 1' or 'B 2' (only those two at present, since I'm too lazy to @@ -307,69 +307,69 @@ batteries . . .) A few more code cleanups. - + 2003 July 1 0.19 libacpi cleanups and reworking - we now handle the charging - battery case properly, it seems. + battery case properly, it seems. Also, some attempts to make error printing a bit cleaner; still a long way to go on that, though . . . - + 2003 June 24 0.15 Removed process_plugin_timer(), since it was doing nothing useful at all . . . - + 2003 June 23 0.14 Removed libapm.c - wmacpi-ng is specifically for ACPI, with no APM - support. - + support. + 2003 June 23 0.13 Some more code cleanups, designed to move libacpi to more of a library than something built into wmacpi-ng. This is useful with the seperate programs, though at present it's not used much. - + 2003 June 21 0.12 Added a command line tool, acpi-ng to query battery status from the command line. - + 2003 May 30 0.11 Implemented multiple battery support, and averaging of the samples in an attempt to even out the jumpiness of the timer. - + 2003 May 30 0.10 More major code cleanups: in particular the handling of the power panel and the message has been cleaned up so that it's actually - sane and clean. + sane and clean. Next step from here is to actually implement handling of multiple batteries, so that if there's a fully charge second battery available it reports the correct time remaining (based on the present rate of power consumption and the sum of the two battery's remaining capacities). - + 2003 May 29 0.3 Some major reworking of the internals, to help fix the handling of - multiple batteries and such things. - + multiple batteries and such things. + 2003 May 26 0.2a Code cleanups to fix various problems with corner cases. - + 2003 May 26 0.2 Added support for multiple batteries: I took the simple route of displaying only one battery per instance - to do more I'd need to hack with the display code, and I'm not ready for that yet. - + Added a -m option to specify the battery number to monitor. - + 2003 May 26 0.1 Changed package completely, to support the new ACPI code as of - 2.4.21-rc2. + 2.4.21-rc2. Since this code hasn't been touched in more than a year, I figure I might as well have a go at hacking on it . . . -- Simon Fowler, - + 2002 Feb 17 1.34 Updated ACPI statistics gathering code for the latest ACPI patch from Intel. Now uses/checks for subsystem version 20020214+. Redone the version @@ -439,13 +439,13 @@ Added support for fucked APM bioses that display stuff wrong. (See README to learn how to enable it. Obviously, it's disabled by default) - + Reorganized apminfo structure and got rid of redundancy. - + Reorganized acquire_apm_info. All APM data is processed there. - + Fixed display_state to do the Right Thing. - + Fixed red blinking button to actually blink on critical battery, and to stop when it isn't critical anymore. I don't think it ever worked right in 1.0. diff --git a/wmacpi/INSTALL b/wmacpi/INSTALL index df0c51c..674da8f 100644 --- a/wmacpi/INSTALL +++ b/wmacpi/INSTALL @@ -4,7 +4,7 @@ You can change the default install prefix (/usr/local) by specifying it in the make install command, eg: make install PREFIX=/usr To build the command line tool, either uncomment the BUILD_CLI=1 line -in the Makefile, or specify BUILD_CLI=1 on the make command line. ie, +in the Makefile, or specify BUILD_CLI=1 on the make command line. ie, make BUILD_CLI=1 make install BUILD_CLI=1 diff --git a/wmacpi/Makefile b/wmacpi/Makefile index cd840a6..8b90efd 100644 --- a/wmacpi/Makefile +++ b/wmacpi/Makefile @@ -1,7 +1,7 @@ # set options. pick one, acpi or apm. comment out the other one. don't # uncomment both, bad things will happen :) -OPT := -O2 +OPT := -O2 # uncomment this to build the command line acpi tool BUILD_CLI = 1 @@ -40,7 +40,7 @@ wmacpi: $(WMOBJ) $(CC) -o $@ $^ $(LDFLAGS) # for the Debian package, we want to make building the command line tools -# optional. So, we hide all the necessary stuff here . . . +# optional. So, we hide all the necessary stuff here . . . ifdef BUILD_CLI CLSRC := wmacpi-cli.c libacpi.c CLOBJ := $(patsubst %.c,%.o,$(filter %.c,$(CLSRC))) @@ -56,7 +56,7 @@ endif gcc -MM $(CFLAGS) $< > $@ clean: - rm -f TAGS *.o *~ trace *.out *.bb *.bbg + rm -f TAGS *.o *~ trace *.out *.bb *.bbg clean-all: clean rm -f *.d $(targets) diff --git a/wmacpi/TODO b/wmacpi/TODO index d016ac7..44feb86 100644 --- a/wmacpi/TODO +++ b/wmacpi/TODO @@ -7,7 +7,7 @@ 2003 November 23 1.99 * Expand libacpi to handle everything else under - /proc/acpi. Basically, make it into a full ACPI reporting library. + /proc/acpi. Basically, make it into a full ACPI reporting library. * Make the command line tool a complete replacement for Grahame Bowland's acpi tool, so that wmacpi won't conflict with it. @@ -20,7 +20,7 @@ 2003 June 24 0.14 * Still more code cleanups - there's a considerable amount of dumb - stuff in there still . . . + stuff in there still . . . * Display time left for battery charging. But first make sure that this will actually work with other systems. diff --git a/wmacpi/libacpi.c b/wmacpi/libacpi.c index 2d3a528..fb77015 100644 --- a/wmacpi/libacpi.c +++ b/wmacpi/libacpi.c @@ -46,7 +46,7 @@ static int read_sysfs_file(char *node, char *prop, char *buf, size_t buflen) perr("Could not read %s/%s\n", node, prop); return -3; } - + buf[ret] = '\0'; return 0; @@ -61,7 +61,7 @@ static int sysfs_init_batteries(global_t *globals) char *names[MAXBATT]; char ps_type[16]; int i, j; - + /* now enumerate batteries */ globals->battery_count = 0; battdir = opendir("/sys/class/power_supply"); @@ -72,12 +72,12 @@ static int sysfs_init_batteries(global_t *globals) while ((batt = readdir(battdir))) { /* there's a serious problem with this code when there's * more than one battery: the readdir won't return the - * entries in sorted order, so battery one won't + * entries in sorted order, so battery one won't * necessarily be the first one returned. So, we need - * to sort them ourselves before adding them to the + * to sort them ourselves before adding them to the * batteries array. */ name = batt->d_name; - + /* skip ., .. and dotfiles */ if (name[0] == '.') continue; @@ -96,7 +96,7 @@ static int sysfs_init_batteries(global_t *globals) /* A nice quick insertion sort, ala CLR. */ { char *tmp1, *tmp2; - + for (i = 1; i < globals->battery_count; i++) { tmp1 = names[i]; j = i - 1; @@ -107,7 +107,7 @@ static int sysfs_init_batteries(global_t *globals) } } } - + for (i = 0; i < globals->battery_count; i++) { snprintf(batteries[i].name, MAX_NAME, "%s", names[i]); pdebug("battery detected at /sys/class/power_supply/%s\n", batteries[i].name); @@ -141,7 +141,7 @@ static int procfs_init_batteries(global_t *globals) char *name; char *names[MAXBATT]; int i, j; - + /* now enumerate batteries */ globals->battery_count = 0; battdir = opendir("/proc/acpi/battery"); @@ -152,12 +152,12 @@ static int procfs_init_batteries(global_t *globals) while ((batt = readdir(battdir))) { /* there's a serious problem with this code when there's * more than one battery: the readdir won't return the - * entries in sorted order, so battery one won't + * entries in sorted order, so battery one won't * necessarily be the first one returned. So, we need - * to sort them ourselves before adding them to the + * to sort them ourselves before adding them to the * batteries array. */ name = batt->d_name; - + /* skip . and .. */ if (!strncmp(".", name, 1) || !strncmp("..", name, 2)) continue; @@ -170,7 +170,7 @@ static int procfs_init_batteries(global_t *globals) /* A nice quick insertion sort, ala CLR. */ { char *tmp1, *tmp2; - + for (i = 1; i < globals->battery_count; i++) { tmp1 = names[i]; j = i - 1; @@ -181,12 +181,12 @@ static int procfs_init_batteries(global_t *globals) } } } - + for (i = 0; i < globals->battery_count; i++) { snprintf(batteries[i].name, MAX_NAME, "%s", names[i]); - snprintf(batteries[i].info_file, MAX_NAME, + snprintf(batteries[i].info_file, MAX_NAME, "/proc/acpi/battery/%s/info", names[i]); - snprintf(batteries[i].state_file, MAX_NAME, + snprintf(batteries[i].state_file, MAX_NAME, "/proc/acpi/battery/%s/state", names[i]); pdebug("battery detected at %s\n", batteries[i].info_file); pinfo("found battery %s\n", names[i]); @@ -196,7 +196,7 @@ static int procfs_init_batteries(global_t *globals) pdebug("%d batteries detected\n", globals->battery_count); pinfo("libacpi: found %d batter%s\n", globals->battery_count, (globals->battery_count == 1) ? "y" : "ies"); - + return 0; } @@ -263,7 +263,7 @@ static int sysfs_init_ac_adapters(global_t *globals) /* we'll just use the first adapter we find ... */ ap->name = strdup(name); pinfo("libacpi: found ac adapter %s\n", ap->name); - + return 0; } @@ -298,7 +298,7 @@ static int procfs_init_ac_adapters(global_t *globals) snprintf(ap->state_file, MAX_NAME, "/proc/acpi/ac_adapter/%s/state", ap->name); pinfo("libacpi: found ac adapter %s\n", ap->name); - + return 0; } @@ -374,7 +374,7 @@ int power_reinit(global_t *globals) return 1; } } - + if (!(retval = reinit_batteries(globals))) retval = reinit_ac_adapters(globals); @@ -424,7 +424,7 @@ static power_state_t procfs_get_power_status(global_t *globals) char buf[1024]; char *val; adapter_t *ap = &globals->adapter; - + if ((file = fopen(ap->state_file, "r")) == NULL) { snprintf(buf, 1024, "Could not open state file %s", ap->state_file); perror(buf); @@ -531,7 +531,7 @@ static int sysfs_get_battery_info(global_t *globals, int batt_no) info->charge_state = FULL; /* DISCHARGE ? as per old comment ... */ } - /* get current rate of burn + /* get current rate of burn * note that if it's on AC, this will report 0 */ if (read_sysfs_file(info->name, "current_now", buf, sizeof(buf)) < 0) info->present_rate = -1; @@ -590,7 +590,7 @@ static int procfs_get_battery_info(global_t *globals, int batt_no) perror(NULL); return 0; } - + /* grab the contents of the file */ buflen = fread(buf, sizeof(buf), 1, file); fclose(file); @@ -612,13 +612,13 @@ static int procfs_get_battery_info(global_t *globals, int batt_no) info->present = 0; return 0; } - + /* get design capacity * note that all these integer values can also contain the * string 'unknown', so we need to check for this. */ entry = strstr(buf, "design capacity:"); val = get_value(entry); - if (val[0] == 'u') + if (val[0] == 'u') info->design_cap = -1; else info->design_cap = strtoul(val, NULL, 10); @@ -639,13 +639,13 @@ static int procfs_get_battery_info(global_t *globals, int batt_no) else info->design_voltage = strtoul(val, NULL, 10); - + if ((file = fopen(info->state_file, "r")) == NULL) { perr("Could not open %s:", info->state_file ); perror(NULL); return 0; } - + /* grab the file contents */ memset(buf, 0, sizeof(buf)); buflen = fread(buf, sizeof(buf), 1, file); @@ -671,7 +671,7 @@ static int procfs_get_battery_info(global_t *globals, int batt_no) /* get charging state */ entry = strstr(buf, "charging state:"); val = get_value(entry); - if (val[0] == 'u') + if (val[0] == 'u') info->charge_state = CH_ERR; else if ((strncmp(val, "discharging", 10)) == 0) info->charge_state = DISCHARGE; @@ -684,7 +684,7 @@ static int procfs_get_battery_info(global_t *globals, int batt_no) else info->charge_state = CHARGE; - /* get current rate of burn + /* get current rate of burn * note that if it's on AC, this will report 0 */ entry = strstr(buf, "present rate:"); val = get_value(entry); @@ -728,12 +728,12 @@ int get_battery_info(global_t *globals, int batt_no) * 2003-7-1. * In order to make this code more convenient for things other than * just plain old wmacpi-ng I'm breaking the basic functionality - * up into several chunks: collecting and collating info for a - * single battery, calculating the global info (such as rtime), and + * up into several chunks: collecting and collating info for a + * single battery, calculating the global info (such as rtime), and * some stuff to provide a similar interface to now. */ -/* calculate the percentage remaining, using the values of +/* calculate the percentage remaining, using the values of * remaining capacity and last full capacity, as outlined in * the ACPI spec v2.0a, section 3.9.3. */ static int calc_remaining_percentage(int batt) @@ -741,7 +741,7 @@ static int calc_remaining_percentage(int batt) float rcap, lfcap; battery_t *binfo; int retval; - + binfo = &batteries[batt]; rcap = (float)binfo->remaining_cap; @@ -796,8 +796,8 @@ static enum rtime_mode check_rt_mode(global_t *globals) } /* calculate remaining time until the battery is charged. - * when charging, the battery state file reports the - * current being used to charge the battery. We can use + * when charging, the battery state file reports the + * current being used to charge the battery. We can use * this and the remaining capacity to work out how long * until it reaches the last full capacity of the battery. * XXX: make sure this is actually portable . . . */ @@ -816,7 +816,7 @@ static int calc_charge_time_rate(int batt) } else { lfcap = (float)binfo->last_full_cap; rcap = (float)binfo->remaining_cap; - + charge_time = (int)(((lfcap - rcap)/binfo->present_rate) * 60.0); } } else @@ -826,7 +826,7 @@ static int calc_charge_time_rate(int batt) } /* we need to calculate the present rate the same way we do in rt_cap - * mode, and then use that to estimate charge time. This will + * mode, and then use that to estimate charge time. This will * necessarily be even less accurate than it is for remaining time, but * it's just as neessary . . . */ static int calc_charge_time_cap(int batt) @@ -841,7 +841,7 @@ static int calc_charge_time_cap(int batt) float cdiff; float current_rate; battery_t *binfo = &batteries[batt]; - + cap_samples[current] = (float) binfo->remaining_cap; time_samples[current] = time(NULL); @@ -863,7 +863,7 @@ static int calc_charge_time_cap(int batt) tdiff = time_samples[current] - time_samples[old]; current_rate = cdiff/(float)tdiff; } - if (current_rate == 0) + if (current_rate == 0) rtime = 0; else { float cap_left = (float)(binfo->last_full_cap - binfo->remaining_cap); @@ -900,11 +900,11 @@ void acquire_batt_info(global_t *globals, int batt) { battery_t *binfo; adapter_t *ap = &globals->adapter; - + get_battery_info(globals, batt); - + binfo = &batteries[batt]; - + if (!binfo->present) { binfo->percentage = 0; binfo->valid = 0; @@ -915,21 +915,21 @@ void acquire_batt_info(global_t *globals, int batt) binfo->percentage = calc_remaining_percentage(batt); - /* set the battery's capacity state, based (at present) on some + /* set the battery's capacity state, based (at present) on some * guesstimated values: more than 75% == HIGH, 25% to 75% MED, and * less than 25% is LOW. Less than globals->crit_level is CRIT. */ if (binfo->percentage == -1) binfo->state = BS_ERR; if (binfo->percentage < globals->crit_level) binfo->state = CRIT; - else if (binfo->percentage > 75) + else if (binfo->percentage > 75) binfo->state = HIGH; else if (binfo->percentage > 25) binfo->state = MED; - else + else binfo->state = LOW; - /* we need to /know/ that we've got a valid state for the + /* we need to /know/ that we've got a valid state for the * globals->power value . . . .*/ ap->power = get_power_status(globals); @@ -939,11 +939,11 @@ void acquire_batt_info(global_t *globals, int batt) * that it's now valid . . .*/ binfo->valid = 1; } - + void acquire_all_batt_info(global_t *globals) { int i; - + for(i = 0; i < globals->battery_count; i++) acquire_batt_info(globals, i); } @@ -961,7 +961,7 @@ void acquire_all_batt_info(global_t *globals) * So, what we need to do is provide a way to use a different method * to calculate the time remaining. What seems most sensible is to * split out the code to calculate it into a seperate function, and - * then provide multiple implementations . . . + * then provide multiple implementations . . . */ /* @@ -980,12 +980,12 @@ int calc_time_remaining_rate(global_t *globals) static int j = 0; static int n = 0; - /* calculate the time remaining, using the battery's remaining - * capacity and the reported burn rate (3.9.3). - * For added accuracy, we average the value over the last + /* calculate the time remaining, using the battery's remaining + * capacity and the reported burn rate (3.9.3). + * For added accuracy, we average the value over the last * SAMPLES number of calls, or for anything less than this we * simply report the raw number. */ - /* XXX: this needs to correctly handle the case where + /* XXX: this needs to correctly handle the case where * any of the values used is unknown (which we flag using * -1). */ for (i = 0; i < globals->battery_count; i++) { @@ -999,16 +999,16 @@ int calc_time_remaining_rate(global_t *globals) j++, sample_count++; if (j >= SAMPLES) j = 0; - + /* for the first SAMPLES number of calls we calculate the * average based on sample_count, then we use SAMPLES to * calculate the rolling average. */ - + /* when this fails, n should be equal to SAMPLES. */ if (sample_count < SAMPLES) n++; for (i = 0, rate = 0; i < n; i++) { - /* if any of our samples are invalid, we drop + /* if any of our samples are invalid, we drop * straight out, and flag our unknown values. */ if (rate_samples[i] < 0) { rate = -1; @@ -1018,16 +1018,16 @@ int calc_time_remaining_rate(global_t *globals) rate += rate_samples[i]; } rate = rate/(float)n; - + if ((rcap < 1) || (rate < 1)) { rtime = 0; goto out; } - if (rate <= 0) + if (rate <= 0) rate = 1; /* time remaining in minutes */ rtime = (int)((rcap/rate) * 60.0); - if(rtime <= 0) + if(rtime <= 0) rtime = 0; out: pdebug("discharge time rem: %d\n", rtime); @@ -1044,11 +1044,11 @@ int calc_time_remaining_rate(global_t *globals) * precision instruments - mine only report with about 70mAH * resolution, so they don't report any changes until the difference * is 70mAH. This means that calculating the current rate from the - * remaining capacity is very choppy . . . + * remaining capacity is very choppy . . . * * To fix this, we should calculate an average over some number of * samples at the old end of the set - this would smooth out the - * transitions. + * transitions. */ int calc_time_remaining_cap(global_t *globals) { @@ -1091,7 +1091,7 @@ int calc_time_remaining_cap(global_t *globals) tdiff = time_samples[current] - time_samples[old]; current_rate = cdiff/tdiff; } - if (current_rate == 0) + if (current_rate == 0) rtime = 0; else rtime = (int)(cap_samples[current]/(current_rate * 60.0)); @@ -1104,7 +1104,7 @@ int calc_time_remaining_cap(global_t *globals) pdebug("cap discharge time rem: %d\n", rtime); return rtime; -} +} void acquire_global_info(global_t *globals) { diff --git a/wmacpi/libacpi.h b/wmacpi/libacpi.h index 07e5b9a..afb38c0 100644 --- a/wmacpi/libacpi.h +++ b/wmacpi/libacpi.h @@ -20,7 +20,7 @@ typedef enum { BATT, PS_ERR, } power_state_t; - + typedef enum { HIGH, MED, @@ -52,7 +52,7 @@ typedef struct { char state_file[MAX_NAME]; /* sysfs capacity mode */ sysfs_capa_t sysfs_capa_mode; - int present; + int present; int design_cap; /* assuming mAh */ int last_full_cap; int design_voltage; /* in mV */ @@ -68,9 +68,9 @@ typedef struct { /* and a flag to indicate that this is valid . . . */ int valid; /* number of times we've gotten bad info on this battery's present rate */ - int bad_count; + int bad_count; } battery_t; - + typedef struct { char *name; char state_file[MAX_NAME]; @@ -96,11 +96,11 @@ typedef struct { /* * Moving percentage to the battery is right, but I think we need a global - * remaining capacity somewhere, too . . . + * remaining capacity somewhere, too . . . */ /* - * To provide a convenient debugging function . . . + * To provide a convenient debugging function . . . * * It's a macro because I'm too lazy to deal with varargs. */ @@ -125,7 +125,7 @@ typedef struct { #define pfatal(fmt, arg...) \ fprintf(stderr, fmt, ##arg) \ - + /* Since these /are/ needed here . . . */ battery_t batteries[MAXBATT]; diff --git a/wmacpi/wmacpi-cli.c b/wmacpi/wmacpi-cli.c index 274f287..7446856 100644 --- a/wmacpi/wmacpi-cli.c +++ b/wmacpi/wmacpi-cli.c @@ -4,7 +4,7 @@ * Written by Simon Fowler , 2003-06-20. * Copyright 2003-06-20 Dreamcraft Pty Ltd. * - * This file is distributed under the GNU General Public License, + * This file is distributed under the GNU General Public License, * version 2. Please see the COPYING file for details. */ @@ -95,7 +95,7 @@ int main(int argc, char *argv[]) acquire_global_info(globals); usleep(sleep_time); } - + ap = &globals->adapter; if(ap->power == AC) { printf("On AC Power"); @@ -104,8 +104,8 @@ int main(int argc, char *argv[]) if(binfo->present && (binfo->charge_state == CHARGE)) { printf("; Battery %s charging", binfo->name); printf(", currently at %2d%%", binfo->percentage); - if(binfo->charge_time >= 0) - printf(", %2d:%02d remaining", + if(binfo->charge_time >= 0) + printf(", %2d:%02d remaining", binfo->charge_time/60, binfo->charge_time%60); } @@ -120,7 +120,7 @@ int main(int argc, char *argv[]) binfo->percentage); } if(globals->rtime >= 0) - printf("; %d:%02d remaining", globals->rtime/60, + printf("; %d:%02d remaining", globals->rtime/60, globals->rtime%60); printf("\n"); } diff --git a/wmacpi/wmacpi.1 b/wmacpi/wmacpi.1 index 26c18ed..aaeeca8 100644 --- a/wmacpi/wmacpi.1 +++ b/wmacpi/wmacpi.1 @@ -99,7 +99,7 @@ Set the rate at which to sample the ACPI data, in number of times per minute. Minimum is 1, ie once a minute, default is 20, maximum is 600. .TP .B \-n, --no-blink -Disable blinking power glyph when charging. Note that it still blinks when +Disable blinking power glyph when charging. Note that it still blinks when the battery reports its capacity state as critical. .TP .B \-f, --force-capacity-mode @@ -114,7 +114,7 @@ works around certain buggy ACPI BIOSes that fail to report the current rate. .TP .B \-x, --cmdline -Run wmacpi in command line mode - this operates identically to +Run wmacpi in command line mode - this operates identically to .B wmacpi-cli\&. .TP .B \-a, --samples=samples @@ -122,8 +122,8 @@ Average the time remaining over num samples. This greatly improves the accuracy of the reported time remaining. .TP .B \-V, --verbosity=num -Increase the verbosity of the program. Setting this to 1 will print extra -error information; 2 will produce informational output; 3 will produce +Increase the verbosity of the program. Setting this to 1 will print extra +error information; 2 will produce informational output; 3 will produce copious debugging output. .TP .B \-v, --version @@ -143,7 +143,7 @@ accuracy of the reported time remaining. .TP .B \-V Increase the verbosity of the program. If repeated, the result is the -same as setting +same as setting .B \--verbosity for .B wmacpi @@ -161,6 +161,6 @@ completely rewritten after 1.34 by Simon Fowler . .PP This manual page was originally written by Simon Richter for the Debian GNU/Linux system, and then updated by -Simon Fowler. +Simon Fowler. .br Last modification by Simon Fowler , 2007-07-13. diff --git a/wmacpi/wmacpi.c b/wmacpi/wmacpi.c index 99002cd..e8833ac 100644 --- a/wmacpi/wmacpi.c +++ b/wmacpi/wmacpi.c @@ -80,11 +80,11 @@ struct dockapp *dockapp; int scroll_reset = DEFAULT_SCROLL_RESET; /* copy a chunk of pixmap around the app */ -static void copy_xpm_area(int x, int y, int w, int h, int dx, int dy) -{ - XCopyArea(DADisplay, dockapp->pixmap, dockapp->pixmap, - DAGC, x, y, w, h, dx, dy); - dockapp->update = 1; +static void copy_xpm_area(int x, int y, int w, int h, int dx, int dy) +{ + XCopyArea(DADisplay, dockapp->pixmap, dockapp->pixmap, + DAGC, x, y, w, h, dx, dy); + dockapp->update = 1; } /* display AC power symbol */ @@ -156,7 +156,7 @@ static void new_window(char *display, char *name, int argc, char **argv) StructureNotifyMask); /* create the main pixmap . . . */ - DAMakePixmapFromData(master_xpm, &dockapp->pixmap, &dockapp->mask, + DAMakePixmapFromData(master_xpm, &dockapp->pixmap, &dockapp->mask, &dockapp->width, &dockapp->height); DASetPixmap(dockapp->pixmap); DASetShape(dockapp->mask); @@ -181,7 +181,7 @@ static void new_window(char *display, char *name, int argc, char **argv) hints->max_height = 64; XSetWMNormalHints(dockapp->display, dockapp->win, hints); XFree(hints); - } + } DAShow(); } @@ -208,10 +208,10 @@ static void scroll_text(void) int tw = dockapp->tw; /* width of the rendered text */ int sx, dx, w; - if (!dockapp->scroll) + if (!dockapp->scroll) return; - /* + /* * Conceptually this is viewing the text through a scrolling * window - the window starts out with the end immediately before * the text, and stops when the start of the window is immediately @@ -224,9 +224,9 @@ static void scroll_text(void) * text is being copied, until a full window is being copied. * * As the end of the window moves out past the end of the text, we - * want to keep the destination at the beginning of the text area, + * want to keep the destination at the beginning of the text area, * but copy a smaller and smaller chunk of the text. Eventually the - * start of the window will scroll past the end of the text, at + * start of the window will scroll past the end of the text, at * which point we stop doing any work and wait to be reset. */ @@ -246,7 +246,7 @@ static void scroll_text(void) w = end; else if (end > tw) w = 52 - (end - tw); - + dx = x + 52 - w; if (end > tw) dx = x; @@ -368,7 +368,7 @@ static void display_time(int minutes) hour = minutes / 60; /* our display area only fits %2d:%2d, so we need to make sure * what we're displaying will fit in those constraints. I don't - * think we're likely to see any batteries that do more than + * think we're likely to see any batteries that do more than * 100 hours any time soon, so it's fairly safe. */ if (hour >= 100) { hour = 99; @@ -392,7 +392,7 @@ static void display_time(int minutes) omin = min; } -/* +/* * The reworked state handling stuff. */ @@ -407,9 +407,9 @@ static void really_blink_power_glyph(void) { static int counter = 0; - if (counter == 10) + if (counter == 10) display_power_glyph(); - else if (counter == 20) + else if (counter == 20) kill_power_glyph(); else if (counter > 30) counter = 0; @@ -435,7 +435,7 @@ static void really_blink_battery_glyph(void) counter = 0; counter += dockapp->period_length; -} +} static void blink_battery_glyph(void) { @@ -484,7 +484,7 @@ void reset_scroll_speed(void) { scroll_reset = DEFAULT_SCROLL_RESET; } -/* +/* * The message that needs to be displayed needs to be decided * according to a heirarchy: a message like not present needs to take * precedence over a global thing like the current power status, and @@ -492,11 +492,11 @@ void reset_scroll_speed(void) { * the "on battery" message. Likewise, a battery charging message * needs to take precedence over the on ac power message. The other * question is how much of a precedence local messages should take - * over global ones . . . + * over global ones . . . * * So, there are three possible sets of messages: not present, on-line * and off-line messages. We need to decide which of those sets is - * appropriate right now, and then decide within them. + * appropriate right now, and then decide within them. */ enum messages { M_NB, /* no batteries */ @@ -515,7 +515,7 @@ static void set_message(global_t *globals) static enum messages state = M_NULL; battery_t *binfo = globals->binfo; adapter_t *ap = &globals->adapter; - + if (globals->battery_count == 0) { if (state != M_NB) { state = M_NB; @@ -525,7 +525,7 @@ static void set_message(global_t *globals) return; } - + /* battery not present case */ if (!binfo->present) { if (state != M_NP) { @@ -567,7 +567,7 @@ static void set_message(global_t *globals) render_text("on battery"); } } - } + } } void set_time_display(global_t *globals) @@ -598,7 +598,7 @@ void set_batt_id_area(int bno) int dy = 32; /* y coord of the target area */ int sx = (bno + 1) * 7; /* source x coord */ int sy = 76; /* source y coord */ - + copy_xpm_area(sx, sy, w, h, dx, dy); } @@ -609,7 +609,7 @@ void cli_wmacpi(global_t *globals, int samples) int i, j, sleep_time = 0; battery_t *binfo; adapter_t *ap; - + pdebug("samples: %d\n", samples); if(samples > 1) sleep_time = 1000000/samples; @@ -621,7 +621,7 @@ void cli_wmacpi(global_t *globals, int samples) acquire_global_info(globals); usleep(sleep_time); } - + ap = &globals->adapter; if(ap->power == AC) { printf("On AC Power"); @@ -630,8 +630,8 @@ void cli_wmacpi(global_t *globals, int samples) if(binfo->present && (binfo->charge_state == CHARGE)) { printf("; Battery %s charging", binfo->name); printf(", currently at %2d%%", binfo->percentage); - if(binfo->charge_time >= 0) - printf(", %2d:%02d remaining", + if(binfo->charge_time >= 0) + printf(", %2d:%02d remaining", binfo->charge_time/60, binfo->charge_time%60); } @@ -646,7 +646,7 @@ void cli_wmacpi(global_t *globals, int samples) binfo->percentage); } if(globals->rtime >= 0) - printf("; %d:%02d remaining", globals->rtime/60, + printf("; %d:%02d remaining", globals->rtime/60, globals->rtime%60); printf("\n"); } @@ -686,14 +686,14 @@ int main(int argc, char **argv) DAProgramOption options[] = { {"-r", "--no-scroll", "disable scrolling message", DONone, False, {NULL}}, {"-n", "--no-blink", "disable blinking of various UI elements", DONone, False, {NULL}}, - {"-x", "--cmdline", "run in command line mode", DONone, False, {NULL}}, + {"-x", "--cmdline", "run in command line mode", DONone, False, {NULL}}, {"-f", "--force-capacity-mode", "force the use of capacity mode for calculating time remaining", DONone, False, {NULL}}, {"-d", "--display", "display or remote display", DOString, False, {&display}}, {"-c", "--critical", "set critical low alarm at percent\n (default: 10 percent)", DONatural, False, {&critical}}, {"-m", "--battery", "battery number to monitor", DONatural, False, {&battery_no}}, {"-s", "--sample-rate", "number of times per minute to sample battery information\n default 20 (once every three seconds)", DONatural, False, {&samplerate}}, {"-V", "--verbosity", "Set verbosity", DONatural, False, {&verbosity}}, - {"-a", "--samples", "number of samples to average over (cli mode only)", DONatural, False, {&samples}}, + {"-a", "--samples", "number of samples to average over (cli mode only)", DONatural, False, {&samples}}, }; dockapp = calloc(1, sizeof(struct dockapp)); @@ -706,8 +706,8 @@ int main(int argc, char **argv) globals->crit_level = 10; battery_no = 1; - /* after this many samples, we reinit the battery and AC adapter - * information. + /* after this many samples, we reinit the battery and AC adapter + * information. * XXX: make these configurable . . . */ batt_reinit = 100; ac_reinit = 1000; @@ -716,10 +716,10 @@ int main(int argc, char **argv) * are available /before/ we can decide if the battery we want to * monitor is available. */ /* parse command-line options */ - DAParseArguments(argc, argv, options, 10, - "A battery monitor dockapp for ACPI based systems", + DAParseArguments(argc, argv, options, 10, + "A battery monitor dockapp for ACPI based systems", VERSION); - + if (options[0].used) dockapp->scroll = 0; if (options[1].used) @@ -730,7 +730,7 @@ int main(int argc, char **argv) rt_mode = RT_CAP; rt_forced = 1; } - + if (samplerate == 0) samplerate = 1; if (samplerate > 600) samplerate = 600; @@ -801,7 +801,7 @@ int main(int argc, char **argv) battery_no--; /* make new dockapp window */ - /* Don't even /think/ of asking me why, but if I set the window name to + /* Don't even /think/ of asking me why, but if I set the window name to * "acpi", the app refuses to dock properly - it's just plain /weird/. * So, wmacpi it is . . . */ new_window(display, "wmacpi", argc, argv); @@ -854,9 +854,9 @@ int main(int argc, char **argv) /* what /is/ this crap? * Turns out that libdockapp adds the WM_DELETE_WINDOW atom to * the WM_PROTOCOLS property for the window, which means that - * rather than get a simple DestroyNotify message, we get a + * rather than get a simple DestroyNotify message, we get a * nice little message from the WM saying "hey, can you delete - * yourself, pretty please?". So, when running as a window + * yourself, pretty please?". So, when running as a window * rather than an icon, we're impossible to kill in a friendly * manner, because we're expecting to die from a DestroyNotify * and thus blithely ignoring the WM knocking on our window @@ -877,10 +877,10 @@ int main(int argc, char **argv) /* XXX: some laptops have problems with sampling the battery * regularly - apparently, the BIOS disables interrupts while - * reading from the battery, which is generally on a slow bus + * reading from the battery, which is generally on a slow bus * and is a slow device, so you get significant periods without - * interrupts. This causes interactivity to suffer . . . - * + * interrupts. This causes interactivity to suffer . . . + * * So, the workaround/fix for this is to sample at a much * lower rate than we may update/refresh/expose/whatever. The * user specifies how many times they want us to sample per @@ -913,7 +913,7 @@ int main(int argc, char **argv) if (globals->battery_count > 0) { if (battery_no > globals->battery_count) battery_no = 0; - + binfo = switch_battery(globals, battery_no); } } @@ -924,13 +924,13 @@ int main(int argc, char **argv) * they change - you can hotplug batteries on most laptops these days * and who knows what kind of shit will be happening soon . . . */ if (batt_count++ >= batt_reinit) { - if(reinit_batteries(globals)) + if(reinit_batteries(globals)) pfatal("Oh my god, the batteries are gone!\n"); batt_count = 0; } if (ac_count++ >= ac_reinit) { - if(reinit_ac_adapters(globals)) + if(reinit_ac_adapters(globals)) pfatal("What happened to our AC adapters?!?\n"); ac_count = 0; } @@ -942,15 +942,15 @@ int main(int argc, char **argv) scroll_count = 0; } - /* The old code had some kind of weird crap with timers and the like. + /* The old code had some kind of weird crap with timers and the like. * As far as I can tell, it's meaningless - the time we want to display - * is the time calculated from the remaining capacity, as per the + * is the time calculated from the remaining capacity, as per the * ACPI spec. The only thing I'd change is the handling of a charging - * state: my best guess, based on the behaviour I'm seeing with my + * state: my best guess, based on the behaviour I'm seeing with my * Lifebook, is that the present rate value when charging is the rate * at which the batteries are being charged, which would mean I'd just - * need to reverse the rtime calculation to be able to work out how - * much time remained until the batteries were fully charged . . . + * need to reverse the rtime calculation to be able to work out how + * much time remained until the batteries were fully charged . . . * That would be rather useful, though given it would vary rather a lot * it seems likely that it'd be little more than a rough guesstimate. */ set_time_display(globals); @@ -960,7 +960,7 @@ int main(int argc, char **argv) if (globals->battery_count == 0) { clear_percentage(); clear_batt_id_area(); - } else + } else display_percentage(binfo->percentage); scroll_text(); diff --git a/wmacpiload/AUTHORS b/wmacpiload/AUTHORS index 41a7e66..7787d22 100644 --- a/wmacpiload/AUTHORS +++ b/wmacpiload/AUTHORS @@ -1,4 +1,4 @@ -Main Hacker: +Main Hacker: Anthony Peacock Main Author: diff --git a/wmacpiload/doc/wmacpiload.1 b/wmacpiload/doc/wmacpiload.1 index 3bcca67..0d757ed 100644 --- a/wmacpiload/doc/wmacpiload.1 +++ b/wmacpiload/doc/wmacpiload.1 @@ -25,9 +25,9 @@ This manual page documents briefly the command. .PP .\" TeX users may be more comfortable with the \fB\fP and -.\" \fI\fP escape sequences to invode bold face and italics, +.\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. -\fBWMacpiLoad\fP is a program to monitor battery and cpu temp. It is a dockapp +\fBWMacpiLoad\fP is a program to monitor battery and cpu temp. It is a dockapp that is supported by X window managers such as Window Maker, AfterStep, BlackBox, and Enlightenment. @@ -90,6 +90,6 @@ set command for acpi standby .SH AUTHOR WMACPILoad was assembled by Anthony Peacock It is massively based on code by -Thomas Nemeth . It is largely based on WMMemMon and WMCPULoad by Seiichi -SATO , WMMemLoad by Mark Staggs and wmapm by Chris D. +Thomas Nemeth . It is largely based on WMMemMon and WMCPULoad by Seiichi +SATO , WMMemLoad by Mark Staggs and wmapm by Chris D. Faulhaber Michael G. Henderson . diff --git a/wmacpiload/src/main.c b/wmacpiload/src/main.c index f1fafa3..320c079 100644 --- a/wmacpiload/src/main.c +++ b/wmacpiload/src/main.c @@ -173,7 +173,7 @@ int main(int argc, char **argv) { pixmap = dockapp_XCreatePixmap(SIZE, SIZE); /* Initialize pixmap */ - if (backlight == LIGHTON) + if (backlight == LIGHTON) dockapp_copyarea(backdrop_on, pixmap, 0, 0, SIZE, SIZE, 0, 0); else dockapp_copyarea(backdrop_off, pixmap, 0, 0, SIZE, SIZE, 0, 0); @@ -261,9 +261,9 @@ static void update() { } /* all clear */ - if (backlight == LIGHTON) + if (backlight == LIGHTON) dockapp_copyarea(backdrop_on, pixmap, 0, 0, 58, 58, 0, 0); - else + else dockapp_copyarea(backdrop_off, pixmap, 0, 0, 58, 58, 0, 0); /* draw digit */ @@ -547,7 +547,7 @@ int acpi_read(AcpiInfos *i) { fclose(fd); if(( ptr = strstr(buf,"charging state:"))) { stat = *(ptr + 25); - switch (stat) + switch (stat) { case 'd': i->battery_status=1; diff --git a/wmauda/Makefile b/wmauda/Makefile index fdac125..15d3eff 100644 --- a/wmauda/Makefile +++ b/wmauda/Makefile @@ -19,7 +19,7 @@ wmauda: $(OBJS) $(HEADERS) all: wmauda -clean: +clean: rm -f *.o wmauda install: all diff --git a/wmauda/wmauda.1 b/wmauda/wmauda.1 index 0d4553d..b694c3e 100644 --- a/wmauda/wmauda.1 +++ b/wmauda/wmauda.1 @@ -18,7 +18,7 @@ Show summary of options. .B \-c, \-\-command Command to start Audacious (Default: audacious). .TP -.B \-i, \-\-icon +.B \-i, \-\-icon Icon to show instead of the default one when Audacious is not running. The icon must be in XPM format. .TP diff --git a/wmauda/wmauda.c b/wmauda/wmauda.c index aaf762d..2d3e708 100644 --- a/wmauda/wmauda.c +++ b/wmauda/wmauda.c @@ -1,7 +1,7 @@ /* wmauda - Dockapp for controlling Audacious - * + * * Copyright (C) 2006 Michael Stewart - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -74,15 +74,15 @@ typedef struct { unsigned char ascii; gint x, y; } Charentry; - + Charentry chartable[] = { { '-', 60, 73}, /* put here coordinates of characters */ { '.', 72, 73}, /* in xmms-dock-master.xpm */ - { ',', 78, 73}, + { ',', 78, 73}, { '\\', 84, 73}, - { '/', 90, 73}, - { '(', 96, 73}, + { '/', 90, 73}, + { '(', 96, 73}, { ')', 102, 73}, { '%', 108, 73}, { 'Ä', 114, 73}, @@ -98,10 +98,10 @@ Charentry chartable[] = { ' ', 66, 73}, }; #define NUM_CHARS 19 - -#define VOLSLIDER_X 8 + +#define VOLSLIDER_X 8 #define VOLSLIDER_Y 17 -#define VOLSLIDER_WIDTH 7 +#define VOLSLIDER_WIDTH 7 #define VOLSLIDER_HEIGHT 40 @@ -116,7 +116,7 @@ Charentry chartable[] = #define SCROLLTEXT_X 5 #define SCROLLTEXT_Y 6 #define SCROLLTEXT_WIDTH 40 -#define SCROLLTEXT_HEIGHT 9 +#define SCROLLTEXT_HEIGHT 9 #define SCROLLTEXT_CHARS 9 gboolean volslider_dragging = FALSE; @@ -141,7 +141,7 @@ gboolean has_geometry = FALSE, single_click = FALSE, song_title = FALSE; char *icon_name = NULL; int win_x, win_y; -DBusGProxy *dbus_proxy = NULL; +DBusGProxy *dbus_proxy = NULL; static DBusGConnection *connection = NULL; GtkTargetEntry drop_types[] = @@ -267,9 +267,9 @@ void real_draw_scrolltext(GdkWindow * w) char *title = audacious_remote_get_playlist_title(dbus_proxy, pl_pos); if (title) { - /* render text */ + /* render text */ gint i = 0, c = 0, pos = 0, dest = 0; - + for (i=0; iwindow, NULL, NULL); gdk_window_reparent(icon_win->window, leader, 0, 0); gdk_window_show(leader); - + hints.initial_state = WithdrawnState; hints.flags = StateHint | IconWindowHint | IconPositionHint | WindowGroupHint; hints.icon_window = GDK_WINDOW_XWINDOW(icon_win->window); hints.icon_x = 0; hints.icon_y = 0; hints.window_group = GDK_WINDOW_XWINDOW(leader); - + XSetWMHints(GDK_DISPLAY(), GDK_WINDOW_XWINDOW(leader), &hints); - + gtk_widget_show(icon_win); timeout_tag = gtk_timeout_add(100, timeout_func, NULL); @@ -865,7 +865,7 @@ int main(int argc, char **argv) } if (!dbus_init()) return 1; - + init(); gtk_main(); return 0; diff --git a/wmbatteries/AUTHORS b/wmbatteries/AUTHORS index da2f26d..2e31dda 100644 --- a/wmbatteries/AUTHORS +++ b/wmbatteries/AUTHORS @@ -1,14 +1,14 @@ Main Author: Florian Krohs -Based largely on work on wmacpiload WMMemMon, wmacpiload, WMCPULoad and -WMMemLoad done by: +Based largely on work on wmacpiload WMMemMon, wmacpiload, WMCPULoad and +WMMemLoad done by: -Anthony Peacock -Thomas Nemeth -Seiichi SATO -Mark Staggs +Anthony Peacock +Thomas Nemeth +Seiichi SATO +Mark Staggs And also on wmapm by : -Chris D. Faulhaber -Michael G. Henderson +Chris D. Faulhaber +Michael G. Henderson and maybe others diff --git a/wmbatteries/README b/wmbatteries/README index f06c898..ddc6214 100644 --- a/wmbatteries/README +++ b/wmbatteries/README @@ -1,7 +1,7 @@ this software comes with no warranty. use it on your own risk. -if you have problems or any syggestions, feel free to contact me +if you have problems or any syggestions, feel free to contact me Florian Krohs diff --git a/wmbatteries/THANKS b/wmbatteries/THANKS index cb68c7b..2a57f41 100644 --- a/wmbatteries/THANKS +++ b/wmbatteries/THANKS @@ -1,7 +1,7 @@ Thanks to those who made the dockapps on which this program is based: -Anthony Peacock -Thomas Nemeth -Seiichi SATO -Mark Staggs -Chris D. Faulhaber -Michael G. Henderson +Anthony Peacock +Thomas Nemeth +Seiichi SATO +Mark Staggs +Chris D. Faulhaber +Michael G. Henderson diff --git a/wmbatteries/doc/wmbatteries.1 b/wmbatteries/doc/wmbatteries.1 index 3156d50..0ed7fe0 100644 --- a/wmbatteries/doc/wmbatteries.1 +++ b/wmbatteries/doc/wmbatteries.1 @@ -23,10 +23,10 @@ This manual page documents briefly the command. .PP .\" TeX users may be more comfortable with the \fB\fP and -.\" \fI\fP escape sequences to invode bold face and italics, +.\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. \fBwmbatteries\fP is a program to monitor status of two batteries and cpu temp using -ACPI (http://acpi.sf.net). It is a dockapp +ACPI (http://acpi.sf.net). It is a dockapp that is supported by X window managers such as Window Maker, AfterStep, BlackBox, Fluxbox and Enlightenment. @@ -36,22 +36,22 @@ is displayed, until the currently charging battery is complete charged. When on AC and the batteries are not charging, 00:00 is displayed. Below, current capacity of availible batteries is displayed in percent and in form of bars. -In the bottom half, there are 4 indicators: The left is shown when on AC. +In the bottom half, there are 4 indicators: The left is shown when on AC. The two battery symbols in the middle are shown when the corresponding battery is discharging, and animated if it is charging. The animation speed may be set with the -s option. On the right there is an indicator which is displayed when the remaining capacity -of all batteries is less than a certain (default:20) percentage of the +of all batteries is less than a certain (default:20) percentage of the maximum capacity of all batteries. The last line may be used to display either CPU temperature or the current power consumption. -The mode of the last line may be set with the -m option. when -m s is given, the display +The mode of the last line may be set with the -m option. when -m s is given, the display switches between cpu temperature and power consumption in a certain time (option -ts). That line may also be switched manually by rightclicking in the dockapp. The back-light may be turned on/off by clicking the mouse button 1 (left) over the application. If battery status is below a critical level, an -alarm-mode will alert you by turning on and off back-light. +alarm-mode will alert you by turning on and off back-light. wmbatteries makes use of a config file which may be given via command line option ,$HOME/.wmbatteriesrc or /etc/wmbatteries, whichever comes first. @@ -105,7 +105,7 @@ set command for acpi suspend set command for acpi standby .TP .B \-m, \-\-mode [t|r|s] -set mode for the lower row , +set mode for the lower row , t=temperature,r=current rate,s=toggle .TP .B \-ts, \-\-togglespeed diff --git a/wmbatteries/src/main.c b/wmbatteries/src/main.c index ea8180b..6d9820b 100644 --- a/wmbatteries/src/main.c +++ b/wmbatteries/src/main.c @@ -101,7 +101,7 @@ typedef struct AcpiInfos { typedef struct RateListElem { long rate[2]; - struct RateListElem *next; + struct RateListElem *next; } RateListElem; typedef enum { LIGHTOFF, LIGHTON } light; @@ -179,7 +179,7 @@ static void debug(char *debug_string){ } int main(int argc, char **argv) { - + XEvent event; XpmColorSymbol colors[2] = { {"Back0", NULL, 0}, {"Back1", NULL, 0} }; int ncolor = 0; @@ -258,7 +258,7 @@ int main(int argc, char **argv) { pixmap = dockapp_XCreatePixmap(SIZE, SIZE); /* Initialize pixmap */ - if (backlight == LIGHTON) + if (backlight == LIGHTON) dockapp_copyarea(backdrop_on, pixmap, 0, 0, SIZE, SIZE, 0, 0); else dockapp_copyarea(backdrop_off, pixmap, 0, 0, SIZE, SIZE, 0, 0); @@ -274,13 +274,13 @@ int main(int argc, char **argv) { while (1) { if (cur_acpi_infos.battery_status[0]==CHARGING || cur_acpi_infos.battery_status[1]==CHARGING) charging = 1; - else + else charging = 0; timeout = update_timeout; if( charging && animation_timeoutcurrcap[bat]); } - } + } if ((fd = fopen(state_files[bat], "r"))) { fread(buf,512,1,fd); fclose(fd); @@ -436,7 +436,7 @@ int init_stats(AcpiInfos *k) { (*(rateElements+hist)).rate[i] = k->rate[i]; } (*(rateElements+history_size-1)).next = rateElements; - (*(rateElements+history_size-1)).rate[i] = k->rate[i]; + (*(rateElements+history_size-1)).rate[i] = k->rate[i]; } free(buf); k->ac_line_status = 0; @@ -519,7 +519,7 @@ static void parse_config_file(char *config){ DEBUGSTRING("config file found\n"); } else { DEBUGSTRING("config file in $HOME dir nonexistant\n"); - DEBUGSTRING("trying global one in /etc\n"); + DEBUGSTRING("trying global one in /etc\n"); if((fd = fopen("/etc/wmbatteries", "r"))){ DEBUGSTRING("config file found\n"); } @@ -533,7 +533,7 @@ static void parse_config_file(char *config){ DEBUGSTRING("begin parsing\n"); while( fgets( line, 255, fd ) != NULL ) { - + item = strtok( line, "\t =\n\r" ) ; if( item != NULL && item[0] != '#' ) { @@ -547,7 +547,7 @@ static void parse_config_file(char *config){ } else { backlight = LIGHTOFF; } - } + } } if(!strcmp(item,"lightcolor")){ @@ -610,7 +610,7 @@ static void parse_config_file(char *config){ tmp=atoi(value); if(tmp<100) { printf("animationspeed variable is out of range in line %i,must be >= 100\n",linenr); - } else { + } else { animationspeed=tmp; } } @@ -619,7 +619,7 @@ static void parse_config_file(char *config){ tmp=atoi(value); if(tmp<1 || tmp>1000) { printf("historysize variable is out of range in line %i,must be >=1 and <=1000\n",linenr); - } else { + } else { history_size=tmp; } } @@ -627,7 +627,7 @@ static void parse_config_file(char *config){ if(!strcmp(item,"mode")){ if(strcmp(value,"rate") && strcmp(value,"toggle") && strcmp(value,"toggle")) { printf("mode must be one of rate,temp,toggle in line %i\n",linenr); - } else { + } else { if(strcmp(value,"rate")) mode=RATE; if(strcmp(value,"temp")) mode=TEMP; if(strcmp(value,"toggle")) togglemode=1; @@ -650,9 +650,9 @@ static void draw_all(){ long allremain=0; long allcapacity=0; /* all clear */ - if (backlight == LIGHTON) + if (backlight == LIGHTON) dockapp_copyarea(backdrop_on, pixmap, 0, 0, 58, 58, 0, 0); - else + else dockapp_copyarea(backdrop_off, pixmap, 0, 0, 58, 58, 0, 0); /* draw digit */ draw_remaining_time(cur_acpi_infos); @@ -662,7 +662,7 @@ static void draw_all(){ draw_pcgraph(cur_acpi_infos); if(cur_acpi_infos.low) draw_low(); - + draw_batt(cur_acpi_infos); } @@ -701,7 +701,7 @@ static void draw_batt(AcpiInfos infos){ int i=0; if (backlight == LIGHTON) y = 28; for(i=0;i 9){ //don't display leading 0 dockapp_copyarea(parts, pixmap, 4*((infos.battery_percentage[bat]%100)/10), 126+light_offset, 3, 5, 42, 26+6*bat); } - dockapp_copyarea(parts, pixmap, 4*(infos.battery_percentage[bat]%10), 126+light_offset, 3, 5, 46, 26+6*bat); + dockapp_copyarea(parts, pixmap, 4*(infos.battery_percentage[bat]%10), 126+light_offset, 3, 5, 46, 26+6*bat); } } @@ -885,8 +885,8 @@ static void parse_arguments(int argc, char **argv) { if ( integer < 1) fprintf(stderr, "%s: argument %s must be positive integer\n", argv[0], argv[i],update_interval), exit(1); - togglespeed=integer; - i++; + togglespeed=integer; + i++; } else if (!strcmp(argv[i], "--animationspeed") || !strcmp(argv[i], "-as")) { if (argc == i + 1) fprintf(stderr, "%s: error parsing argument for option %s\n", @@ -897,8 +897,8 @@ static void parse_arguments(int argc, char **argv) { if (integer < 100) fprintf(stderr, "%s: argument %s must be >=100\n", argv[0], argv[i]), exit(1); - animationspeed=integer; - i++; + animationspeed=integer; + i++; } else if (!strcmp(argv[i], "--historysize") || !strcmp(argv[i], "-hs")) { if (argc == i + 1) fprintf(stderr, "%s: error parsing argument for option %s\n", @@ -910,7 +910,7 @@ static void parse_arguments(int argc, char **argv) { fprintf(stderr, "%s: argument %s must be >=1 && <=1000\n", argv[0], argv[i]), exit(1); history_size=integer; - i++; + i++; } else if (!strcmp(argv[i], "--mode") || !strcmp(argv[i], "-m")) { if (argc == i + 1) fprintf(stderr, "%s: error parsing argument for option %s\n", @@ -923,7 +923,7 @@ static void parse_arguments(int argc, char **argv) { argv[0], argv[i]), exit(1); if(character=='s') togglemode=1; else if(character=='t') mode=TEMP; - else if(character=='r') mode=RATE; + else if(character=='r') mode=RATE; i++; } else if (!strcmp(argv[i], "--standby") || !strcmp(argv[i], "-S")) { standby_cmd = argv[i + 1]; @@ -956,10 +956,10 @@ static void print_help(char *prog) " -S, --standby set command for acpi standby\n" " -m, --mode [t|r|s] set mode for the lower row , \n" " t=temperature,r=current rate,s=toggle\n" - " -ts --togglespeed set toggle speed in seconds\n" - " -as --animationspeed set speed for charging animation in msec\n" + " -ts --togglespeed set toggle speed in seconds\n" + " -as --animationspeed set speed for charging animation in msec\n" " -hs --historysize set size of history for calculating\n" - " average power consumption rate\n", + " average power consumption rate\n", prog, prog); /* OPTIONS SUPP : * ? -f, --file : configuration file @@ -1035,8 +1035,8 @@ int acpi_read(AcpiInfos *i) { long allremain=0; rate = 0; - - + + DEBUGSTRING("acpi_read()\n") /* get acpi thermal cpu info */ @@ -1052,14 +1052,14 @@ int acpi_read(AcpiInfos *i) { if(strstr(buf, "off-line") != NULL) i->ac_line_status=0; } for(bat=0;batbattery_status[bat]=1; @@ -1081,7 +1081,7 @@ int acpi_read(AcpiInfos *i) { sscanf(ptr,"%d",&((*firstRateElem).rate[bat])); } } - + i->battery_percentage[bat] = (((float)(i->remain[bat])*100)/cur_acpi_infos.currcap[bat]); @@ -1096,7 +1096,7 @@ int acpi_read(AcpiInfos *i) { } } else { rate=0; - i->rate[bat]=0; + i->rate[bat]=0; } @@ -1109,11 +1109,11 @@ int acpi_read(AcpiInfos *i) { if((i->battery_status[0]==1 || i->battery_status[1]==1) && (i->rate[0]+i->rate[1])>0){ time = (float)(i->remain[0]+i->remain[1])/(float)(i->rate[0]+i->rate[1]); i->hours_left=(int)time; - i->minutes_left=(int)((time-(int)time)*60); + i->minutes_left=(int)((time-(int)time)*60); } if(i->battery_status[0]==0 && i->battery_status[1]==0){ i->hours_left=0; - i->minutes_left=0; + i->minutes_left=0; } if((i->battery_status[0]==3||i->battery_status[1]==3) && (i->rate[0]>0 || i->rate[1]>0)){ time = (float)(cur_acpi_infos.currcap[0] - i->remain[0] + cur_acpi_infos.currcap[1] - i->remain[1])/(float)(i->rate[0]+i->rate[1]); @@ -1127,13 +1127,13 @@ int acpi_read(AcpiInfos *i) { cur_acpi_infos.low=0; if(allcapacity>0){ - if(((double)allremain/(double)allcapacity)*100 Thu, 6 Apr 2000 13:16:52 -0700 diff --git a/wmbattery/README b/wmbattery/README index 60c54bc..8f8987c 100644 --- a/wmbattery/README +++ b/wmbattery/README @@ -29,7 +29,7 @@ Conversely, here are some reasons to stick with wmapm: - You like its look. - It has a neat rainbow-colored progress bar. - It has buttons to suspend the laptop and stuff. - - It may be more actively and/or better maintained. Or not. + - It may be more actively and/or better maintained. Or not. Decide for yourself. Still, forking is evil, and if I was doing this all over again, I suppose diff --git a/wmbattery/TODO b/wmbattery/TODO index 7b41755..18f6166 100644 --- a/wmbattery/TODO +++ b/wmbattery/TODO @@ -7,5 +7,5 @@ programs use it). * Make -b 0 display an overall average of the status of all batteries, much like apm does on multi-battery laptops. -* The simplehal interface is not very good. It polls once per second, +* The simplehal interface is not very good. It polls once per second, it would be much better if it let HAL notify it about changes instead. diff --git a/wmbattery/acpi.c b/wmbattery/acpi.c index 96950e6..39b662e 100644 --- a/wmbattery/acpi.c +++ b/wmbattery/acpi.c @@ -1,4 +1,4 @@ -/* +/* * A not-yet-general-purpose ACPI library, by Joey Hess */ @@ -134,7 +134,7 @@ inline char *scan_acpi_value (const char *buf, const char *key) { } /* Read an ACPI proc file, pull out the requested piece of information, and - * return it (statically allocated string). Returns NULL on error, This is + * return it (statically allocated string). Returns NULL on error, This is * the slow, dumb way, fine for initialization or if only one value is needed * from a file, slow if called many times. */ char *get_acpi_value (const char *file, const char *key) { @@ -173,7 +173,7 @@ int find_items (char *itemname, char infoarray[ACPI_MAXITEM][128], int num_devices=0; int i; char **devices = malloc(ACPI_MAXITEM * sizeof(char *)); - + char pathname[128]; sprintf(pathname, SYSFS_PATH); @@ -185,7 +185,7 @@ int find_items (char *itemname, char infoarray[ACPI_MAXITEM][128], char filename[128]; char buf[1024]; - if (!strcmp(".", ent->d_name) || + if (!strcmp(".", ent->d_name) || !strcmp("..", ent->d_name)) continue; @@ -270,10 +270,10 @@ int acpi_supported (void) { return 0; } closedir(dir); - + /* If kernel is 2.6.21 or newer, version is in /sys/module/acpi/parameters/acpica_version */ - + version = get_acpi_file("/sys/module/acpi/parameters/acpica_version"); if (version == NULL) { return 0; @@ -284,13 +284,13 @@ int acpi_supported (void) { version, ACPI_VERSION); return 0; } - + find_batteries(); find_ac_adapters(); #if ACPI_THERMAL find_thermal(); #endif - + return 1; } @@ -299,7 +299,7 @@ int acpi_supported (void) { * apm_info struct. */ int acpi_read (int battery, apm_info *info) { char *buf, *state; - + if (acpi_batt_count == 0) { info->battery_percentage = 0; info->battery_time = 0; @@ -309,10 +309,10 @@ int acpi_read (int battery, apm_info *info) { info->ac_line_status = 1; return 0; } - + /* Internally it's zero indexed. */ battery--; - + buf = get_acpi_file(acpi_batt_info[battery]); if (buf == NULL) { fprintf(stderr, "unable to read %s\n", acpi_batt_info[battery]); @@ -323,7 +323,7 @@ int acpi_read (int battery, apm_info *info) { info->ac_line_status = 0; info->battery_flags = 0; info->using_minutes = 1; - + /* Work out if the battery is present, and what percentage of full * it is and how much time is left. */ if (strcmp(scan_acpi_value(buf, acpi_labels[label_present]), "1") == 0) { @@ -340,7 +340,7 @@ int acpi_read (int battery, apm_info *info) { info->battery_time = 0; } else { - /* a zero or unknown in the file; time + /* a zero or unknown in the file; time * unknown so use a negative one to * indicate this */ info->battery_time = -1; @@ -439,7 +439,7 @@ int acpi_read (int battery, apm_info *info) { info->ac_line_status = on_ac_power(); } } - + return 0; } #endif diff --git a/wmbattery/acpi.h b/wmbattery/acpi.h index f82cba7..44e5ed6 100644 --- a/wmbattery/acpi.h +++ b/wmbattery/acpi.h @@ -1,4 +1,4 @@ -/* +/* * A not-yet-general-purpose ACPI library, by Joey Hess */ diff --git a/wmbattery/apm.h b/wmbattery/apm.h index a5aec22..4fd8671 100644 --- a/wmbattery/apm.h +++ b/wmbattery/apm.h @@ -19,7 +19,7 @@ #define BATTERY_FLAGS_CRITICAL (0x4) #define BATTERY_FLAGS_CHARGING (0x8) #define BATTERY_FLAGS_ABSENT (0x80) - + #define BATTERY_PERCENTAGE_UNKNOWN (-1) #define BATTERY_TIME_UNKNOWN (-1) diff --git a/wmbattery/autoconf/install-sh b/wmbattery/autoconf/install-sh index ebc6691..058b26c 100755 --- a/wmbattery/autoconf/install-sh +++ b/wmbattery/autoconf/install-sh @@ -115,7 +115,7 @@ fi if [ x"$dir_arg" != x ]; then dst=$src src="" - + if [ -d $dst ]; then instcmd=: else @@ -124,7 +124,7 @@ if [ x"$dir_arg" != x ]; then else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad +# might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] @@ -134,7 +134,7 @@ else echo "install: $src does not exist" exit 1 fi - + if [ x"$dst" = x ] then echo "install: no destination specified" @@ -162,7 +162,7 @@ dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then -defaultIFS=' +defaultIFS=' ' IFS="${IFS-${defaultIFS}}" @@ -201,17 +201,17 @@ else # If we're going to rename the final executable, determine the name now. - if [ x"$transformarg" = x ] + if [ x"$transformarg" = x ] then dstfile=`basename $dst` else - dstfile=`basename $dst $transformbasename | + dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename - if [ x"$dstfile" = x ] + if [ x"$dstfile" = x ] then dstfile=`basename $dst` else @@ -242,7 +242,7 @@ else # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile + $doit $mvcmd $dsttmp $dstdir/$dstfile fi && diff --git a/wmbattery/simplehal.c b/wmbattery/simplehal.c index f6379cd..b107a37 100644 --- a/wmbattery/simplehal.c +++ b/wmbattery/simplehal.c @@ -51,7 +51,7 @@ int connect_hal (void) { return 1; } - + int hal_ready (void) { if (hal_ctx && dbus_connection_get_is_connected(dbus_ctx)) { return 1; @@ -83,7 +83,7 @@ signed int get_hal_int (const char *udi, const char *key, int optional) { dbus_error_init(&error); ret = libhal_device_get_property_int (hal_ctx, udi, key, &error); - + if (! dbus_error_is_set (&error)) { return ret; } @@ -100,15 +100,15 @@ signed int get_hal_int (const char *udi, const char *key, int optional) { signed int get_hal_bool (const char *udi, const char *key, int optional) { int ret; DBusError error; - + if (! hal_ready()) { return -1; } - + dbus_error_init(&error); ret = libhal_device_get_property_bool (hal_ctx, udi, key, &error); - + if (! dbus_error_is_set (&error)) { return ret; } @@ -190,7 +190,7 @@ int simplehal_read (int battery, apm_info *info) { info->battery_status = BATTERY_STATUS_ABSENT; return 0; } - + /* remaining_time and charge_level.percentage are not a mandatory * keys, so if not present, -1 will be returned */ info->battery_time = get_hal_int(device, "battery.remaining_time", 1); diff --git a/wmbattery/sonypi.c b/wmbattery/sonypi.c index 71ff9b1..ab9922f 100644 --- a/wmbattery/sonypi.c +++ b/wmbattery/sonypi.c @@ -29,9 +29,9 @@ int sonypi_read (apm_info *info) { __u8 batflags; __u16 cap, rem; int havebatt = 0; - + info->using_minutes = info->battery_flags = 0; - + if (! sonypi_ioctl(SONYPI_IOCGBATFLAGS, &batflags)) { return 1; } @@ -57,7 +57,7 @@ int sonypi_read (apm_info *info) { info->battery_percentage = 0; info->battery_status = BATTERY_STATUS_ABSENT; } - + if (havebatt) { info->battery_percentage = 100 * rem / cap; /* Guess at whether the battery is charging. */ @@ -66,9 +66,9 @@ int sonypi_read (apm_info *info) { info->battery_status = BATTERY_STATUS_CHARGING; } } - + /* Sadly, there is no way to estimate this. */ info->battery_time = 0; - + return 0; } diff --git a/wmbattery/wmbattery.1x b/wmbattery/wmbattery.1x index 614376a..75a66fc 100644 --- a/wmbattery/wmbattery.1x +++ b/wmbattery/wmbattery.1x @@ -7,7 +7,7 @@ wmbattery \- dockable battery monitor .SH DESCRIPTION .PP .B wmbattery -is a battery monitor. It is used to visually display the system's battery +is a battery monitor. It is used to visually display the system's battery status. .PP .B wmbattery @@ -93,7 +93,7 @@ switch. .B \-e wmbattery contains code for estimating the time remaining before discharge, and until full charge, and this code is used if no other source of this -informaton is available. This switch makes wmbattery use its time +informaton is available. This switch makes wmbattery use its time estimation code even if some other estimate is available. .TP .B \-s granularity diff --git a/wmbattery/wmbattery.c b/wmbattery/wmbattery.c index fe219b6..cecb90e 100644 --- a/wmbattery/wmbattery.c +++ b/wmbattery/wmbattery.c @@ -59,7 +59,7 @@ signed int critical_pct = -1; void error(const char *fmt, ...) { va_list arglist; - + va_start(arglist, fmt); fprintf(stderr, "Error: "); vfprintf(stderr, fmt, arglist); @@ -213,7 +213,7 @@ char *parse_commandline(int argc, char *argv[]) { char *ret=NULL; char *s; extern char *optarg; - + while (c != -1) { c=getopt(argc, argv, "hd:g:if:b:w:c:l:es:a:"); switch (c) { @@ -323,17 +323,17 @@ void make_window(char *display_name, int argc, char *argv[]) { classhint.res_name = wname; classhint.res_class = wname; XSetClassHint(display, win, &classhint); - + if (! XStringListToTextProperty(&wname, 1, &name)) error("Can't allocate window name."); XSetWMName(display, win, &name); - + /* Create GC for drawing */ gcv.foreground = fore_pix; gcv.background = back_pix; gcv.graphics_exposures = 0; - NormalGC = XCreateGC(display, root, + NormalGC = XCreateGC(display, root, GCForeground | GCBackground | GCGraphicsExposures, &gcv); @@ -343,15 +343,15 @@ void make_window(char *display_name, int argc, char *argv[]) { pixmask, ShapeSet); XShapeCombineMask(display, iconwin, ShapeBounding, 0, 0, pixmask, ShapeSet); - + wmhints.initial_state = initial_state; wmhints.icon_window = iconwin; wmhints.icon_x = sizehints.x; wmhints.icon_y = sizehints.y; wmhints.window_group = win; - wmhints.flags = StateHint | IconWindowHint | + wmhints.flags = StateHint | IconWindowHint | IconPositionHint | WindowGroupHint; - + XSetWMHints(display, win, &wmhints); XSetCommand(display, win, argv, argc); @@ -363,7 +363,7 @@ void make_window(char *display_name, int argc, char *argv[]) { void flush_expose(Window w) { XEvent dummy; - + while (XCheckTypedWindowEvent(display, w, Expose, &dummy)); } @@ -371,7 +371,7 @@ void redraw_window() { XCopyArea(display, images[FACE], iconwin, NormalGC, 0, 0, image_info[FACE].width, image_info[FACE].height, 0,0); flush_expose(iconwin); - XCopyArea(display, images[FACE], win, NormalGC, 0, 0, + XCopyArea(display, images[FACE], win, NormalGC, 0, 0, image_info[FACE].width, image_info[FACE].height, 0,0); flush_expose(win); } @@ -388,8 +388,8 @@ void copy_image(int image, int xoffset, int yoffset, /* * Display a letter in one of two fonts, at the specified x position. - * Note that 10 is passed for special characters `:' or `1' at the - * end of the font. + * Note that 10 is passed for special characters `:' or `1' at the + * end of the font. */ void draw_letter(int letter, int font, int x) { copy_image(font, image_info[font].charwidth * letter, 0, @@ -399,7 +399,7 @@ void draw_letter(int letter, int font, int x) { /* Display an image at its normal location. */ void draw_image(int image) { - copy_image(image, 0, 0, + copy_image(image, 0, 0, image_info[image].width, image_info[image].height, image_info[image].x, image_info[image].y); } @@ -407,7 +407,7 @@ void draw_image(int image) { void recalc_window(apm_info cur_info) { int time_left, hour_left, min_left, digit, x; static int blinked = 0; - + /* Display if it's plugged in. */ switch (cur_info.ac_line_status) { case AC_LINE_STATUS_ON: @@ -416,7 +416,7 @@ void recalc_window(apm_info cur_info) { default: draw_image(UNPLUGGED); } - + /* Display the appropriate color battery. */ switch (cur_info.battery_status) { case BATTERY_STATUS_HIGH: @@ -447,7 +447,7 @@ void recalc_window(apm_info cur_info) { /* * Display the percent left dial. This has the side effect of - * clearing the time left field. + * clearing the time left field. */ x=DIAL_MULTIPLIER * cur_info.battery_percentage; if (x >= 0) { @@ -463,7 +463,7 @@ void recalc_window(apm_info cur_info) { image_info[DIAL_DIM].height, image_info[DIAL_DIM].x + x, image_info[DIAL_DIM].y); - + /* Show percent remaining */ if (cur_info.battery_percentage >= 0) { digit = cur_info.battery_percentage / 10; @@ -494,7 +494,7 @@ void recalc_window(apm_info cur_info) { if (cur_info.using_minutes) time_left = cur_info.battery_time; else - time_left = cur_info.battery_time / 60; + time_left = cur_info.battery_time / 60; hour_left = time_left / 60; min_left = time_left % 60; digit = hour_left / 10; @@ -505,7 +505,7 @@ void recalc_window(apm_info cur_info) { draw_letter(digit,BIGFONT,MINUTES_TENS_OFFSET); digit = min_left % 10; draw_letter(digit,BIGFONT,MINUTES_ONES_OFFSET); - + redraw_window(); } @@ -562,9 +562,9 @@ void alarmhandler(int sig) { * cannot determine time. */ if (always_estimate_remaining || cur_info.battery_time < 0) estimate_timeleft(&cur_info); - + /* Override the battery status? */ - if ((low_pct > -1 || critical_pct > -1) && + if ((low_pct > -1 || critical_pct > -1) && cur_info.ac_line_status != AC_LINE_STATUS_ON) { if (cur_info.battery_percentage <= critical_pct) cur_info.battery_status = BATTERY_STATUS_CRITICAL; @@ -573,7 +573,7 @@ void alarmhandler(int sig) { else cur_info.battery_status = BATTERY_STATUS_HIGH; } - + /* If APM data changes redraw and wait for next update */ /* Always redraw if the status is critical, to make it blink. */ if (!apm_change(&cur_info) || cur_info.battery_status == BATTERY_STATUS_CRITICAL) @@ -638,7 +638,7 @@ int main(int argc, char *argv[]) { else { error("No APM, ACPI, UPOWER, HAL or SPIC support detected."); } - + load_images(); load_audio(); diff --git a/wmbiff/AUTHORS b/wmbiff/AUTHORS index da65634..a4c8412 100644 --- a/wmbiff/AUTHORS +++ b/wmbiff/AUTHORS @@ -1,23 +1,23 @@ Copyrights This program was written by Gennady Belyakov [8]gb@ccat.elect.ru - + Exterior appearance was heavily derived from wminet, written by Dave Clark (clarkd@skynet.ca), Antoine Nulle (warp@xs4all.nl), Martijn Pieterse (pieterse@xs4all.nl) - + Some code (around mailbox checking, with some modifications) was taken from xled, written by Jan Schoenepauck (schoenep@uni-wuppertal.de) and Joachim Gassen (joachim@fb4-1112.uni-muenster.de) - + POP3 checking code was taken from wmpop3 by Scott Holden (scotth@thezone.net) Additional code was taken from xlassie, written by Trent Piepho - + Many thanks for: Angus Mackay (amackay@gusnet.cx) Jordi Mallach Pérez (jordi@sindominio.net) diff --git a/wmbiff/FAQ b/wmbiff/FAQ index 288cc70..a8b9da6 100644 --- a/wmbiff/FAQ +++ b/wmbiff/FAQ @@ -29,7 +29,7 @@ tracker #706995). * WMBiff doesn't work. How do I submit a bug? See the Troubleshooting section of the wmbiffrc man -page. +page. If that doesn't work, run 'wmbiff -debug > wmbiff.log' and remove any passwords left in wmbiff.log. Submit this log @@ -48,25 +48,25 @@ Some previously requested features can't be done: - Count IMAP deleted messages separately (the protocol doesn't support it without locking the mailbox). - Reset the count of new messages to zero when spawning - a mailer (it would just jump back again the next time + a mailer (it would just jump back again the next time wmbiff looked). Previously suggested features that are really hard: - Support dock sizes other than 64x64 - Inverse video on new mail (or do more visually to grab attention) -* I'm about to start writing a patch. How do I make sure it will +* I'm about to start writing a patch. How do I make sure it will get incorporated in WMBiff? Start a conversation on wmbiff-devel, and you'll probably -get some help. - -Tidbits: - Avoid creating new Clients. - - If you want an existing client to do something differently, - find a way to parameterize its behavior. +get some help. + +Tidbits: + Avoid creating new Clients. + - If you want an existing client to do something differently, + find a way to parameterize its behavior. - If you want to use a shell command to get some - information, make a recipe for ShellClient (open wmbiff.c + information, make a recipe for ShellClient (open wmbiff.c and search for 'gicu'). If you must create a new client, Avoid Duplicating Code. Document your patch. Add entries as appropriate to: @@ -76,11 +76,11 @@ Tidbits: * How do I get the very latest WMBiff from SourceForge CVS? -See http://sourceforge.net/cvs/?group_id=26389, or +See http://sourceforge.net/cvs/?group_id=26389, or http://sourceforge.net/projects/wmbiff then click on CVS. - -cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/wmbiff login -cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/wmbiff co wmbiff + +cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/wmbiff login +cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/wmbiff co wmbiff * I added a feature to WMBiff. How do I submit a patch? ** If you've modified code from a .tar.gz @@ -88,7 +88,7 @@ cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/wmbiff co wmbiff (in the wmbiff-x.x.x/wmbiff directory) make indent cd .. - make distclean + make distclean cd .. mv wmbiff-x.x.x wmbiff-changed tar xvfz wmbiff-x.x.x.tar.gz @@ -98,24 +98,24 @@ cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/wmbiff co wmbiff make indent cd .. [ optionally 'make distcheck' ] - make maintainer-clean + make maintainer-clean cvs update -d [ resolve any conflicts ] cvs diff -u | less [ make sure the differences are roughly correct ] cd .. mv wmbiff wmbiff-changed - [ now checkout a new copy of wmbiff ] + [ now checkout a new copy of wmbiff ] diff --unified --recursive --new-file --exclude CVS wmbiff wmbiff-changed > my-patch - + ** Sending the patch Submit my-patch as an attachment to mail sent to wmbiff-devel. Don't forget to subscribe to the mailing list so that we can discuss your patch. This is roughly the same procedure you'll use to submit patches to any code, although others may not have the 'make indent' step. - -* This FAQ is wrong. + +* This FAQ is wrong. Send mail to wmbiff-devel@lists.sourceforge.net. diff --git a/wmbiff/Makefile.am b/wmbiff/Makefile.am index 8bd4dce..1b6e215 100644 --- a/wmbiff/Makefile.am +++ b/wmbiff/Makefile.am @@ -25,11 +25,11 @@ dist-hook-local: ChangeLog chmod -R g-s . indent: - cd wmbiff && make indent - cd wmgeneral && make indent + cd wmbiff && make indent + cd wmgeneral && make indent # manually increment version in configure.ac, which should be enough. -ChangeLog: Makefile configure.ac +ChangeLog: Makefile configure.ac @if test "x$(CVS2CL)" != "x" && test -e maint/changelog.sed; then \ echo "Running $(CVS2CL)..."; \ $(CVS2CL) --stdout --utc --day-of-week -I TODO -I NEWS -I .cvsignore | \ diff --git a/wmbiff/NEWS b/wmbiff/NEWS index 939dc83..c9b3fde 100644 --- a/wmbiff/NEWS +++ b/wmbiff/NEWS @@ -20,7 +20,7 @@ Release 0.4.24 - June 22, 2004 unstable package libgnutls10-dev. Release 0.4.23 - April 27, 2004 - * Allow server hostnames in IMAP to be IP addresses + * Allow server hostnames in IMAP to be IP addresses (start with a number). Release 0.4.22 - March 27, 2004 @@ -31,7 +31,7 @@ Release 0.4.21 - February 21, 2004 * Fix a bug where fetch times out to some IMAP servers. Release 0.4.20 - January 1, 2004 - * Add --disable-crypto for source-based distributions + * Add --disable-crypto for source-based distributions while libgcrypt is unstable. * Sam Izzo's patch for changing the mouse click action depending on whether a box has new mail. @@ -49,37 +49,37 @@ Release 0.4.18 - November 8, 2003 * Bugfix to OS X keychain use for panther. Release 0.4.17 - August 31, 2003 - * On Mac, ask the keychain for passwords if + * On Mac, ask the keychain for passwords if askpass = internal:apple:keychain - * Bugfix to an infinite loop found in the + * Bugfix to an infinite loop found in the TLS interface. - + Release 0.4.16 - July 7, 2003 - * Checks TLS certificates. See wmbiffrc(5) for + * Checks TLS certificates. See wmbiffrc(5) for details on the certfile option. Designed to work with mutt. * Show a busy mouse cursor while talking to remote - servers, to show that wmbiff won't be responsive + servers, to show that wmbiff won't be responsive to mouse clicks for a little bit. - * New buttontwo (middle click) action to complement + * New buttontwo (middle click) action to complement action (left mouse click) and fetchcmd (right mouse). - * #'s are now only comments in .wmbiffrc at the - beginning of lines or following whitespace, + * #'s are now only comments in .wmbiffrc at the + beginning of lines or following whitespace, allowing #'s in (most) passwords. - * AppleScript examples for driving Apple's Mail + * AppleScript examples for driving Apple's Mail application in sample.wmbiffrc - * Special mailbox action 'msglst' brings up a + * Special mailbox action 'msglst' brings up a transient window showing message headers from IMAP - and program output for shell methods. This is - intended to be faster than starting up a new + and program output for shell methods. This is + intended to be faster than starting up a new mail program or re-executing a script. * Avoid repetitive error messages when disconnected. * Use conventional -geometry option handling. * Fix bug in 0.4.15 to re-enable *'s in IMAP passwords. Release 0.4.15 - Mar 30, 2003 - * Frobnicate internally stored passwords, partially - obfuscating them in memory. Not actually more + * Frobnicate internally stored passwords, partially + obfuscating them in memory. Not actually more secure, but harder to casually discover a password. * Tighten configuration file lines to more quickly detect misconfiguration. Add the -relax option if @@ -89,13 +89,13 @@ Release 0.4.15 - Mar 30, 2003 Release 0.4.14 - Jan 24, 2003 * Handle building on systems with both posix and gnu - regex in different but conflicting files. - * Restart wmbiff on SIGUSR1. You may need to use + regex in different but conflicting files. + * Restart wmbiff on SIGUSR1. You may need to use 'killall -USR1 wmbiff' if it gets stuck. * Restart wmbiff on ctrl-shift mouse 1. Release 0.4.13 - Jan 20, 2003 - * Fix a file descriptor leak when using + * Fix a file descriptor leak when using both Shell and IMAP clients. * Portability to Mac OS X, Solaris, and probably BSD restored (thanks sourceforge compile farm!) with a @@ -107,14 +107,14 @@ Release 0.4.12 - Jan 3, 2003 -geometry handling. (Debian #173813) Release 0.4.11 - Dec 28, 2002 - * security.debian.rb script to check for updates on + * security.debian.rb script to check for updates on security.debian.org, installed in $prefix/lib/wmbiff/ - add: path.x=/usr/lib/wmbiff/security.debian.rb to + add: path.x=/usr/lib/wmbiff/security.debian.rb to your .wmbiffrc (and install ruby if you haven't already). * Internal cleanups to allow long askpass commands. Release 0.4.10 - Dec 12, 2002 - * Peter McAlpine's globalnotify feature - elect to play a + * Peter McAlpine's globalnotify feature - elect to play a sound on new mail in *any* mailbox without a chorus of sounds from every mailbox. * -skip-certificate-check option for when your imaps server @@ -123,17 +123,17 @@ Release 0.4.10 - Dec 12, 2002 Release 0.4.9 - Dec 1, 2002 * GNUTLS v0.5.9 or higher required * Check TLS certificate hostname against the hostname we're - connecting to. This raises the bar, but does not make - wmbiff's TLS implementation secure against man in the + connecting to. This raises the bar, but does not make + wmbiff's TLS implementation secure against man in the middle attacks. * WMBiff scales to the number of mailboxes you're using. For openbox, this means less wasted space in the slit and the possibility of up to 40 mailboxes. For WindowMaker, this means more pretty chrome and less dark LED if you have only a couple boxes. If you prefer the empty - cells at the end, place "path.4=" in your + cells at the end, place "path.4=" in your .wmbiffrc. - + Release 0.4.8 - Sept 18, 2002 * GNUTLS v0.5.1-0.5.6, gcrypt v1.1.8 required. * Allow spaces in IMAP mailbox paths. The new syntax is: @@ -151,7 +151,7 @@ Release 0.4.6 - July 19, 2002 * GNUTLS v0.4.3, gcrypt v1.17 expected Release 0.4.4 - June 27, 2002 - * GNUTLS version 0.4.3 required. The API has changed, and + * GNUTLS version 0.4.3 required. The API has changed, and wmbiff is no longer compatible with GNUTLS versions prior to 0.4.3. Certificate checking may be slightly more strict. * GCRYPT version 1.1.7 is expected as well. @@ -167,7 +167,7 @@ Release 0.4.3 - June 8, 2002 will not be completely erased when new mail arrives. * Mouse handling fix. * Cleanup of internals: handling of default configuration when - .wmbiffrc does not exist, vertical position of rows, variable + .wmbiffrc does not exist, vertical position of rows, variable names, etc. * GNUTLS version 0.3.5 is expected; earlier and later versions may be incompatible. @@ -189,23 +189,23 @@ Release 0.4.0 - May 3, 2002 * GNUTLS version 0.3.5 is expected; earlier and later versions may be incompatible. * askpass: Passwords can be left empty for IMAP: ssh-askpass - will be used to prompt the user. See sample.wmbiffrc + will be used to prompt the user. See sample.wmbiffrc and wmbiffrc(5). * skinfile: Background pixmaps can be specified in .wmbiffrc. This has the effect of "skins." See wmbiffrc(5). - Add "skinfile=wmbiff-master-contrast.xpm" to .wmbiffrc + Add "skinfile=wmbiff-master-contrast.xpm" to .wmbiffrc for a more readable wmbiff. * finger: Finger client added - finger a user's mailbox to get its status. Requires perl and finger commands. See wmbiffrc(5). Thanks to Andelko Horvat. - * shell: Improvements to ShellClient - now allows three character + * shell: Improvements to ShellClient - now allows three character text to be printed as status. If "new" is on the output line, the text will be in yellow. Thanks to Andelko Horvat. - * mbox: Paths can be specified including shell expressions - in `'s. If requested, this feature can be expanded to other + * mbox: Paths can be specified including shell expressions + in `'s. If requested, this feature can be expanded to other clients. Nested expressions are not supported. * Permissions on .wmbiffrc are checked to protect security. - Only a warning is printed now. This will degenerate in + Only a warning is printed now. This will degenerate in later releases for .wmbiffrc's that store passwords. * Migrated to automake / autoconf to detect defaults for ssh-askpass and prepare for future changes. @@ -312,26 +312,26 @@ Release 0.2q1 - Fri, 13 Apr 2001 02:47:10 -0400 * Drop all of the ":" after the pop3 and delimit all values with spaces. This works well, as passwords/user-id's all agree that the space is a non-legit value. - + Example: assume my password is: myEmailhasa@init - + Old way: path.3=pop3:debian4tux:myEmailhasa@init@mail.telocity.com New way: path.3=pop3:debian4tux myEmailhasa@init mail.telcoity.com - + Ahh...before you say it. "Backward compatibility?" You will also find in the patch, a NEW function. So that the OLD and NEW way is easily compatible with all ".wmbiffrc" files. - + Dev. Comments: This was not the cleanest way to implement it, but I had to suffice with a clean/quick implementation. I originally wrote one function to handle past and new parsing. However, I thought it would be beneficial to leave them separated, so we could eventually drop the old method? - + Related Changes: The man page will need to be updated (not provided in patch). We can weed the "old" style out of the example script as well. @@ -357,7 +357,7 @@ Release 0.2q1 - Fri, 13 Apr 2001 02:47:10 -0400 * wmbiff/wmbiff.c: - for (index = 0; index < 4; index++) + for (index = 0; index < 5; index++) - + BUG! Last postion #4 was not correctly being checked. Now correctly checks each position. @@ -366,7 +366,7 @@ Release 0.2q - Tue, 20 Mar 2001 05:32:35 +0100 * This release is by Jorge García . * wmbiff/{*.[ch]}: removed unnecesary includes. - * wmbiff/wmbiff.c: some cleanups and optimizations. + * wmbiff/wmbiff.c: some cleanups and optimizations. + init_biff: * show error if user config file does not exists * use of userconfig "interval" (wasn't correctly parsed) @@ -374,12 +374,12 @@ Release 0.2q - Tue, 20 Mar 2001 05:32:35 +0100 and Blink_Mode local + parse_cmd: some changes to make uconfig_file local + {BlinkOn, BlinkOff, BlinkToogle}: Removed (merged by do_biff) - + {ReadConfigString, ReadConfigInt}: Removed + + {ReadConfigString, ReadConfigInt}: Removed + countmail: removed init in header (wasn't used) + ReadLine: Created (new parsing code, extracts pairs of setting and value) + Read_Config_File: now there is only ONE parse not 36! - * wmbiff/{IMap4Client.c, Pop3Client.c}: check for correct format line to + * wmbiff/{IMap4Client.c, Pop3Client.c}: check for correct format line to avoid "segmentation fault" while parsing. @@ -398,7 +398,7 @@ Release 0.2p - Mon, 12 Mar 2001 00:00:00 -0600 * All your base are belong to us. * I'm not maintaining wmBiff; I just submitted a big patch. Send your complaints (or complements) to Yong-iL Joh. - + Release 0.2o - Mon, 12 Mar 2001 00:00:00 +0900 @@ -429,7 +429,7 @@ Release 0.2o - Mon, 12 Mar 2001 00:00:00 +0900 Release 0.2n - Tue, 20 Feb 2001 0:00:00 +0900 - + * This release is by Yong-iL Joh . * Nick Clarey sent me a patch. that enhances the following: @@ -445,7 +445,7 @@ Release 0.2m - Mon, 5 Feb 2001 00:00:00 +0900 Release 0.2l - Thu, 11 Jan 2001 00:00:00 +0900 - + * This release is by Yong-iL Joh . * Imap4Client.c had a bug when trying to connect to an imap4 server. Fixed it. @@ -465,10 +465,10 @@ Release 0.2-licq - Sat, 1 Jan 2000 00:00:00 +0000 * The actual date of this release is unknown, so I picked New Year's Day, Y2K. (Dwayne C. Litzenberger) * I found it from http://www.licq.org/download.html. - -Release 0.2 - Fri, 26 Nov 1999 00:00:00 +0000 - + +Release 0.2 - Fri, 26 Nov 1999 00:00:00 +0000 + * This release is by Gennady Belyakov . * We don't actually know the time zone of Gennady's changelog entries (Dwayne C. Litzenberger). @@ -480,7 +480,7 @@ Release 0.2 - Fri, 26 Nov 1999 00:00:00 +0000 Release 0.1a - Thu, 18 Nov 1999 00:00:00 +0000 - + * This release is by Gennady Belyakov . * Some fixes with intialization diff --git a/wmbiff/README b/wmbiff/README index 07a9d43..872c9ec 100644 --- a/wmbiff/README +++ b/wmbiff/README @@ -1,6 +1,6 @@ Introducing - + WMBiff is an WindowMaker docking utility, that displays number of total messages count or unread mail messages count in differrent mailboxes. @@ -10,26 +10,26 @@ Green ( cyan? :) ) digits display total number of messages, if there are no unread messages in it. - + Yellow digits display number of unread messages, with blinking on new mail arrival, if any. - + At this moment unix-style (mbox), maildir, POP3, APOP and IMAP mailboxes are supported. WMBiff also understands Licq's history files. WMBiff supports up to 5 mailboxes (but you can start 2 or more wmbiff's with differrent configs). - + Pressing on a 1st (left) mouse button will execute appropriate mail reader (if defined in config file). Right-clicking will exec mail fetching program (if any). - + It is also possible to execute user-defined command line on new mail arrival (for example, play .WAV file). - + _________________________________________________________________ - + Compiling and Installation - + Extract the archive: tar -xvzf wmbiff-0.x.tar.gz @@ -62,12 +62,12 @@ and specify differrent name of config file. (from environment variable MAIL), labeled with word SPOOL, at first position. All other positions will be empty. _________________________________________________________________ - + See AUTHORS to see who has contributed to WMBiff. _________________________________________________________________ - + Any suggestions/bug reports please send to our mailing list, - + wmbiff-devel@lists.sourceforge.net Please include the output of 'wmbiff -debug'. @@ -81,32 +81,32 @@ wmbiff-devel list: Hello, I just found evidence of what I had believed for a long time. - + http://www.monkey.org/openbsd/archive/ports/0101/msg00311.html - + Gennady Belyakov passed away right after releasing 0.2 and when he stopped answering mail :| - + I guess we need to update the docs. - + Jordi Here is the message, if that URL becomes unavailable: - To: ports@openbsd.org - Subject: Re: mail/wmbiff update - From: Vladimir Popov - Date: Sat, 27 Jan 2001 09:34:15 +0500 - + To: ports@openbsd.org + Subject: Re: mail/wmbiff update + From: Vladimir Popov + Date: Sat, 27 Jan 2001 09:34:15 +0500 + On Fri, Jan 26, 2001 at 01:02:59PM +0000, Christian Weisgerber wrote: - > + > > The major issue I have with this port is that the master site/home > page is unreachable. - > - + > + Well, wmbiff's author Gennady Belyakov passed away in late November 1999. That's why that url isn't any longer valid. - + -- Vladimir diff --git a/wmbiff/TODO b/wmbiff/TODO index 726f49f..0a8d318 100644 --- a/wmbiff/TODO +++ b/wmbiff/TODO @@ -6,7 +6,7 @@ these todo items are welcome. ** # comments make #'s unsuitable for passwords. ** : and @ delimiters make such characters unsuitable for passwords. -** the hierarchical configuration is not exported cleanly, +** the hierarchical configuration is not exported cleanly, setting a default and then propagating or overriding it requires an odd syntax. ** elements with spaces are problematic @@ -14,8 +14,8 @@ these todo items are welcome. methods) are cumbersome. ** continuation lines would allow richer shell actions without external shell scripts. -* GNUTLS 0.5.9 -** adds gnutls_set_default_priority, which could clean up +* GNUTLS 0.5.9 +** adds gnutls_set_default_priority, which could clean up a lot of the code to set priorities for ciphers that don't really matter to wmbiff. * Font support @@ -33,7 +33,7 @@ these todo items are welcome. Sometimes my IMAP server is slow... well, it's my fault that I keep a few thousand messages on it. The current timeout code will cause it to fail prematurely. -* Generic constructors for mboxes. +* Generic constructors for mboxes. There's some common code across different Clients; this is one piece that could use refactoring. * Add more shell "recipes" besides gicu. @@ -52,7 +52,7 @@ these todo items are welcome. but extra complicated, and has a useless default install that requires root. xbuffy's led program seems quite good, but depending on another biff program seems odd. -* Add a failure-expect case in tlsComm. +* Add a failure-expect case in tlsComm. For example, an IMAP status query has a good response (* STATUS) and a bad response (a003 NO STATUS). As soon as one of them is received, we're done. @@ -71,10 +71,10 @@ these todo items are welcome. * Unlikely to get done, unless someone volunteers: * KDE/Gnome users: Test with KDE or gnome-panel Does Debian bug #108529 apply to wmbiff? Can wmbiff - be swallowed by gnome-panel? It seems possible. It + be swallowed by gnome-panel? It seems possible. It appears to be swallowed by FVWM correctly. * Autoconf / Automake Wizards: fix FromCVS.sh - How best to deal with libgnutls's macros? All + How best to deal with libgnutls's macros? All I can do is hack. * Paranoid Pop People: Support POP over TLS. tlsComm.c should make it easy to provide TLS support @@ -86,9 +86,9 @@ these todo items are welcome. could be integrated. * Recursive maildir support Aggregation in general is an oft-desired feature. -* G-Mail support +* G-Mail support Though the business model of free mail forces screen scrubbing, - having someone else write and maintain the interface seems + having someone else write and maintain the interface seems like it would significantly improve the utility of gmail. $Id: TODO,v 1.21 2004/10/31 22:08:42 bluehal Exp $ diff --git a/wmbiff/autoconf/Makefile.am b/wmbiff/autoconf/Makefile.am index fba51d9..4c8ef12 100644 --- a/wmbiff/autoconf/Makefile.am +++ b/wmbiff/autoconf/Makefile.am @@ -1,2 +1,2 @@ -EXTRA_DIST = +EXTRA_DIST = diff --git a/wmbiff/configure.ac b/wmbiff/configure.ac index 941e704..c8a5943 100644 --- a/wmbiff/configure.ac +++ b/wmbiff/configure.ac @@ -46,7 +46,7 @@ dnl AC_CHECK_FUNC(asprintf, , VASPRINTF="vasprintf.c") dnl replacing the old USE_POLL define AC_CHECK_FUNCS(poll) -dnl for gnutls-common.h, which defines this if missing. +dnl for gnutls-common.h, which defines this if missing. AC_CHECK_FUNCS(inet_ntop) dnl declare RETSIGTYPE @@ -68,12 +68,12 @@ dnl Parameter is minimum version dnl TODO: fix so that GCRYPT is tested only if GNUTLS fails; the dependence dnl between them makes this turn redundant -AC_ARG_ENABLE(crypto, AC_HELP_STRING([ --disable-crypto ], [ disable gnutls/gcrypt ]), - [ if test $enableval != yes; then +AC_ARG_ENABLE(crypto, AC_HELP_STRING([ --disable-crypto ], [ disable gnutls/gcrypt ]), + [ if test $enableval != yes; then gnutls="disabled" gcrypt="disabled" fi ]) - + GNUTLS_MAN_STATUS="This copy of WMBiff was not compiled with GNUTLS." if test "$gnutls" = "ok"; then @@ -96,7 +96,7 @@ if test "$gcrypt" = "ok"; then AC_CHECK_HEADERS(gcrypt.h) ], [ echo libgcrypt can be found at ftp://ftp.gnupg.org/pub/gcrypt/alpha/libgcrypt/ ] ) else - AC_MSG_RESULT(GCRYPT disabled.) + AC_MSG_RESULT(GCRYPT disabled.) fi; @@ -106,7 +106,7 @@ AC_SUBST(GCRYPT_MAN_STATUS) AC_SUBST(GNUTLS_COMMON_O) dnl regex stuff. -AC_CHECK_HEADERS(regex.h) dnl gnuregex.h +AC_CHECK_HEADERS(regex.h) dnl gnuregex.h dnl no longer needed AC_CHECK_LIB(gnuregex, re_search) dnl BSD. dnl X11 stuff. @@ -136,7 +136,7 @@ dnl AC_SUBST(GNOME_LIBS) dnl AC_SUBST(GNOME_CFLAGS) -dnl see if __attribute__ is supported. modified from AC_C_INLINE +dnl see if __attribute__ is supported. modified from AC_C_INLINE dnl in the autoconf distribution. AC_DEFUN([WM_C_ATTRIBUTE], [AC_CACHE_CHECK([for __attribute__ support], wm_cv_c_attribute, @@ -152,7 +152,7 @@ foo_t foo () {return 0; } ]) case $wm_cv_c_attribute in yes)AC_DEFINE(HAVE___ATTRIBUTE__, , - [Define if '__attribute__' is supported by the compiler]) + [Define if '__attribute__' is supported by the compiler]) ;; esac ])# WM_C_ATTRIBUTE diff --git a/wmbiff/scripts/security.debian.rb b/wmbiff/scripts/security.debian.rb index e3ec366..11d2362 100755 --- a/wmbiff/scripts/security.debian.rb +++ b/wmbiff/scripts/security.debian.rb @@ -1,6 +1,6 @@ #! /usr/bin/ruby -# Copyright 2002 Neil Spring +# Copyright 2002 Neil Spring # GPL # report bugs to wmbiff-devel@lists.sourceforge.net # or (preferred) use the debian BTS via 'reportbug' @@ -26,7 +26,7 @@ Refetch_Interval_Sec = 6 * 60 * 60 Cachedir = ENV['HOME'] + '/.wmbiff-sdr' # look for updates from this server. This script is designed around -# (and simplified greatly by) using just a single server. +# (and simplified greatly by) using just a single server. Server = 'security.debian.org' # extend the Array class with a max method. @@ -55,7 +55,7 @@ end def version_a_gt_b(a, b) cmd = "/usr/bin/dpkg --compare-versions %s le %s" % [ a, b ] # $stderr.puts cmd - return (!Kernel.system(cmd)) + return (!Kernel.system(cmd)) end # figure out which lists to check @@ -67,10 +67,10 @@ end # file, the url, the system's cache of the file, and a # per-user cache of the file. packagelists = Dir.glob("/var/lib/apt/lists/#{Server}*Packages").map { |pkgfile| - [ pkgfile.gsub(/.*#{Server}/, '').tr('_','/'), # the url path + [ pkgfile.gsub(/.*#{Server}/, '').tr('_','/'), # the url path pkgfile, # the system cache of the packages file. probably up-to-date. # and finally, a user's cache of the page, if needed. - "%s/%s" % [ Cachedir, pkgfile.gsub(/.*#{Server}_/,'') ] + "%s/%s" % [ Cachedir, pkgfile.gsub(/.*#{Server}_/,'') ] ] } @@ -80,41 +80,41 @@ session = nil # update the user's cache if necessary. packagelists.each { |urlpath, sc, uc| sctime = File.stat(sc).mtime - cached_time = + cached_time = if(test(?e, uc)) then - uctime = File.stat(uc).mtime + uctime = File.stat(uc).mtime if ( uctime < sctime ) then # we have a user cache, but it is older than the system cache File.unlink(uc) # delete the obsolete user cache. - sctime + sctime else uctime end - else + else # the user cache doesn't exist, but we might have # talked to the server recently. if(test(?e, uc + '.stamp')) then - File.stat(uc + '.stamp').mtime + File.stat(uc + '.stamp').mtime else sctime end - end + end if(Time.now > cached_time + Refetch_Interval_Sec) then - debugmsg "fetching #{urlpath} %s > %s + %d" % [Time.now, cached_time, Refetch_Interval_Sec] + debugmsg "fetching #{urlpath} %s > %s + %d" % [Time.now, cached_time, Refetch_Interval_Sec] begin if(session == nil) then session = Net::HTTP.new(Server) - # session.set_pipe($stderr); + # session.set_pipe($stderr); end - begin - # the warning with ruby1.8 on the following line + begin + # the warning with ruby1.8 on the following line # has to do with the resp, data bit, which should - # eventually be replaced with (copied from the + # eventually be replaced with (copied from the # docs with the 1.8 net/http.rb) # response = http.get('/index.html') # puts response.body - resp, data = session.get(urlpath, - { 'If-Modified-Since' => + resp, data = session.get(urlpath, + { 'If-Modified-Since' => cached_time.strftime( "%a, %d %b %Y %H:%M:%S GMT" ) }) rescue SocketError => e # if the net is down, we'll get this error; avoid printing a stack trace. @@ -189,9 +189,9 @@ updated = Array.new # we're done. output a count in the format expected by wmbiff. if(updatedcount > 0) then - puts "%d new" % [ updatedcount ] + puts "%d new" % [ updatedcount ] else - puts "%d old" % [ installed.length ] + puts "%d old" % [ installed.length ] end puts updated.join("\n") diff --git a/wmbiff/wmbiff/Client.h b/wmbiff/wmbiff/Client.h index 607ba76..578f168 100644 --- a/wmbiff/wmbiff/Client.h +++ b/wmbiff/wmbiff/Client.h @@ -52,7 +52,7 @@ typedef struct _mbox_t { int UnreadMsgs; /* New (unread) messages in mailbox */ int OldMsgs; int OldUnreadMsgs; - char TextStatus[10]; /* if set to a string, toupper() and blit + char TextStatus[10]; /* if set to a string, toupper() and blit * that string. instead of a message count */ int blink_stat; /* blink digits flag-counter */ int debug; /* debugging status */ diff --git a/wmbiff/wmbiff/Imap4Client.c b/wmbiff/wmbiff/Imap4Client.c index c4115e7..0555f86 100644 --- a/wmbiff/wmbiff/Imap4Client.c +++ b/wmbiff/wmbiff/Imap4Client.c @@ -158,7 +158,7 @@ struct connection_state *unbind( /*@null@*/ FILE *imap_open(Pop3 pc) { - static int complained_already; /* we have to succeed once before + static int complained_already; /* we have to succeed once before complaining again about failure */ struct connection_state *scs; struct imap_authentication_method *a; @@ -173,7 +173,7 @@ FILE *imap_open(Pop3 pc) return NULL; } - /* got this far; we're going to create a connection_state + /* got this far; we're going to create a connection_state structure, although it might be a blacklist entry */ connection_name = malloc(strlen(PCU.serverName) + 20); sprintf(connection_name, "%s:%d", PCU.serverName, PCU.serverPort); @@ -234,7 +234,7 @@ FILE *imap_open(Pop3 pc) } /* we don't need the unencrypted state anymore */ - /* note that communication_failure will close the + /* note that communication_failure will close the socket and free via tls_close() */ free(scs); /* fall through will scs = initialize_gnutls(sd); */ } @@ -253,8 +253,8 @@ FILE *imap_open(Pop3 pc) /* authenticate; first find out how */ /* note that capabilities may have changed since last - time we may have asked, if we called STARTTLS, my - server will allow plain password login within an + time we may have asked, if we called STARTTLS, my + server will allow plain password login within an encrypted session. */ tlscomm_printf(scs, "a000 CAPABILITY\r\n"); if (tlscomm_expect(scs, "* CAPABILITY", capabilities, BUF_SIZE) == 0) { @@ -584,7 +584,7 @@ static int authenticate_plaintext( /*@notnull@ */ Pop3 pc, { char buf[BUF_SIZE]; /* is login prohibited? */ - /* "An IMAP client which complies with [rfc2525, section 3.2] + /* "An IMAP client which complies with [rfc2525, section 3.2] * MUST NOT issue the LOGIN command if this capability is present. */ if (strstr(capabilities, "LOGINDISABLED")) { diff --git a/wmbiff/wmbiff/Makefile.am b/wmbiff/wmbiff/Makefile.am index 86b90bc..c69c546 100644 --- a/wmbiff/wmbiff/Makefile.am +++ b/wmbiff/wmbiff/Makefile.am @@ -5,16 +5,16 @@ wmbiff_SOURCES = wmbiff.c socket.c Pop3Client.c mboxClient.c \ maildirClient.c Imap4Client.c tlsComm.c tlsComm.h ShellClient.c \ passwordMgr.c passwordMgr.h charutil.c charutil.h Client.h \ regulo.c regulo.h MessageList.c MessageList.h -EXTRA_wmbiff_SOURCES = gnutls-common.c gnutls-common.h +EXTRA_wmbiff_SOURCES = gnutls-common.c gnutls-common.h wmbiff_LDADD = -L../wmgeneral -lwmgeneral @LIBGCRYPT_LIBS@ @GNUTLS_COMMON_O@ wmbiff_DEPENDENCIES = ../wmgeneral/libwmgeneral.a Makefile @GNUTLS_COMMON_O@ test_wmbiff_SOURCES = ShellClient.c charutil.c charutil.h Client.h \ test_wmbiff.c passwordMgr.c Imap4Client.c regulo.c Pop3Client.c \ - tlsComm.c tlsComm.h socket.c + tlsComm.c tlsComm.h socket.c test_tlscomm_SOURCES = test_tlscomm.c \ - tlsComm.c tlsComm.h -EXTRA_test_wmbiff_SOURCES = gnutls-common.c gnutls-common.h -test_wmbiff_LDADD = @LIBGCRYPT_LIBS@ + tlsComm.c tlsComm.h +EXTRA_test_wmbiff_SOURCES = gnutls-common.c gnutls-common.h +test_wmbiff_LDADD = @LIBGCRYPT_LIBS@ man_MANS = wmbiff.1 wmbiffrc.5 skindir = $(datadir)/wmbiff/skins skin_DATA = wmbiff-master-led.xpm wmbiff-master-contrast.xpm \ @@ -54,7 +54,7 @@ distclean-local: wmbiff-classic-master-contrast.xpm # remove colors, then substitute old colors, then repalletize -# for some reason $< doesn't always work. +# for some reason $< doesn't always work. wmbiff-master-contrast.xpm: wmbiff-master-led.xpm Makefile egrep -v '^"[:%][[:space:]]c #' < wmbiff-master-led.xpm | \ sed -e 's/:/./g' -e 's/%/$$/g' -e 's/ 15 / 13 /' | \ diff --git a/wmbiff/wmbiff/Pop3Client.c b/wmbiff/wmbiff/Pop3Client.c index 6792c42..e928d6d 100644 --- a/wmbiff/wmbiff/Pop3Client.c +++ b/wmbiff/wmbiff/Pop3Client.c @@ -4,7 +4,7 @@ Modified : Jorge García ( Jorge.Garcia@uv.es ) Modified ; Mark Hurley ( debian4tux@telocity.com ) Modified : Neil Spring ( nspring@cs.washington.edu ) - * + * * Pop3 Email checker. * * Last Updated : Tue Nov 13 13:45:23 PST 2001 @@ -52,7 +52,7 @@ extern struct connection_state *state_for_pcu(Pop3 pc); static struct authentication_method { const char *name; - /* callback returns the connection state pointer if successful, + /* callback returns the connection state pointer if successful, NULL if failed */ struct connection_state *(*auth_callback) (Pop3 pc, struct connection_state * scs, char *apop_str); } auth_methods[] = { @@ -169,7 +169,7 @@ int pop3CheckMail( /*@notnull@ */ Pop3 pc) /* it is not an error to receive this according to RFC 1725 */ /* no error should be returned */ pc->UnreadMsgs = pc->TotalMsgs; - // there's also a LIST command... not sure how to make use of it. */ + // there's also a LIST command... not sure how to make use of it. */ } else { sscanf(buf, "+OK %d", &read); pc->UnreadMsgs = pc->TotalMsgs - read; @@ -201,9 +201,9 @@ int pop3Create(Pop3 pc, const char *str) int i; int matchedchars; /* ([^: ]+) user - ([^@]+) or ([^ ]+) password - ([^: ]+) server - ([: ][0-9]+)? optional port + ([^@]+) or ([^ ]+) password + ([^: ]+) server + ([: ][0-9]+)? optional port ' *' gobbles trailing whitespace before authentication types. use separate regexes for old and new types to permit use of '@' in passwords diff --git a/wmbiff/wmbiff/ShellClient.c b/wmbiff/wmbiff/ShellClient.c index 5543832..8c66471 100644 --- a/wmbiff/wmbiff/ShellClient.c +++ b/wmbiff/wmbiff/ShellClient.c @@ -1,7 +1,7 @@ /* Author: Benoît Rouits ( brouits@free.fr ) thanks to Neil Spring. - from LicqClient by Yong-iL Joh ( tolkien@mizi.com ) + from LicqClient by Yong-iL Joh ( tolkien@mizi.com ) and Jorge García ( Jorge.Garcia@uv.es ) - * + * * generic Shell command support * * Last Updated : Tue Mar 5 15:23:35 CET 2002 @@ -55,8 +55,8 @@ FILE *kind_popen(const char *command, const char *type) } /* kind_pclose checks the return value from pclose and prints - some nice error messages about it. ordinarily, this would be - a good idea, but wmbiff has a sigchld handler that reaps + some nice error messages about it. ordinarily, this would be + a good idea, but wmbiff has a sigchld handler that reaps children immediately (needed when spawning other child processes), so no error checking can be done here until that's disabled */ @@ -74,7 +74,7 @@ static int kind_pclose( /*@only@ */ FILE * F, if (exit_status != 0) { if (exit_status == -1) { - /* wmbiff has a sigchld handler already, so wait is likely + /* wmbiff has a sigchld handler already, so wait is likely to fail */ SH_DM(pc, DEBUG_ERROR, "pclose '%s' failed: %s\n", command, strerror(errno)); @@ -174,7 +174,7 @@ int shellCmdCheck(Pop3 pc) } SH_DM(pc, DEBUG_INFO, "'%s' returned '%s'\n", pc->path, commandOutput); - /* see if it's numeric; the numeric check is somewhat + /* see if it's numeric; the numeric check is somewhat useful, as wmbiff renders 4-digit numbers, but not 4-character strings. */ if (sscanf(commandOutput, "%d", &(count_status)) == 1) { diff --git a/wmbiff/wmbiff/charutil.c b/wmbiff/wmbiff/charutil.c index 9b8108b..0f513ba 100644 --- a/wmbiff/wmbiff/charutil.c +++ b/wmbiff/wmbiff/charutil.c @@ -248,7 +248,7 @@ void StripComment(char *buf) { char *p; - /* Strip comments at beginning of line, or after whitespace. + /* Strip comments at beginning of line, or after whitespace. a kludgy way of avoiding problems with #'s in passwords. */ if (buf[0] == '#') buf[0] = '\0'; diff --git a/wmbiff/wmbiff/charutil.h b/wmbiff/wmbiff/charutil.h index cbd687e..50d3435 100644 --- a/wmbiff/wmbiff/charutil.h +++ b/wmbiff/wmbiff/charutil.h @@ -1,7 +1,7 @@ /* $Id: charutil.h,v 1.12 2004/04/20 04:55:55 bluehal Exp $ */ /* Author: Mark Hurley (debian4tux@telocity.com) * - * Character / string manipulation utilities. + * Character / string manipulation utilities. * */ diff --git a/wmbiff/wmbiff/gnutls-common.c b/wmbiff/wmbiff/gnutls-common.c index 5f2bf76..4f3cc7a 100644 --- a/wmbiff/wmbiff/gnutls-common.c +++ b/wmbiff/wmbiff/gnutls-common.c @@ -81,9 +81,9 @@ void print_x509_info(gnutls_session session, const char* hostname) if (print_cert) { size_t size; - + size = sizeof(buffer); - + ret = gnutls_x509_crt_export( crt, GNUTLS_X509_FMT_PEM, buffer, &size); if (ret < 0) { fprintf(stderr, "Encoding error: %s\n", gnutls_strerror(ret)); @@ -93,7 +93,7 @@ void print_x509_info(gnutls_session session, const char* hostname) fputs( buffer, stdout); fputs( "\n", stdout); } - + if (j==0 && hostname != NULL) { /* Check the hostname of the first certificate * if it matches the name of the host we * connected to. @@ -118,7 +118,7 @@ void print_x509_info(gnutls_session session, const char* hostname) str); return; } - + printf("%s", xml_data.data); gnutls_free( xml_data.data); #endif @@ -162,7 +162,7 @@ void print_x509_info(gnutls_session session, const char* hostname) printf(" # fingerprint: %s\n", printable); } - /* Print the version of the X.509 + /* Print the version of the X.509 * certificate. */ printf(" # version: #%d\n", @@ -184,7 +184,7 @@ void print_x509_info(gnutls_session session, const char* hostname) ret = gnutls_x509_crt_get_dn(crt, dn, &dn_size); if (ret >= 0) printf(" # Subject's DN: %s\n", dn); - + dn_size = sizeof(dn); ret = gnutls_x509_crt_get_issuer_dn(crt, dn, &dn_size); if (ret >= 0) @@ -192,7 +192,7 @@ void print_x509_info(gnutls_session session, const char* hostname) } gnutls_x509_crt_deinit(crt); - + printf("\n"); } @@ -217,7 +217,7 @@ void print_openpgp_info(gnutls_session session, const char* hostname) unsigned int cert_list_size = 0; time_t expiret; time_t activet; - + cert_list = gnutls_certificate_get_peers(session, &cert_list_size); if (cert_list_size > 0) { @@ -235,7 +235,7 @@ void print_openpgp_info(gnutls_session session, const char* hostname) if (print_cert) { size_t size; - + size = sizeof(buffer); ret = gnutls_openpgp_key_export( crt, GNUTLS_OPENPGP_FMT_BASE64, buffer, &size); @@ -270,7 +270,7 @@ void print_openpgp_info(gnutls_session session, const char* hostname) str); return; } - + printf("%s", xml_data.data); gnutls_free( xml_data.data); @@ -287,7 +287,7 @@ void print_openpgp_info(gnutls_session session, const char* hostname) else printf("Never\n"); - if (gnutls_openpgp_key_get_fingerprint(crt, digest, &digest_size) >= 0) + if (gnutls_openpgp_key_get_fingerprint(crt, digest, &digest_size) >= 0) { print = printable; for (i = 0; i < digest_size; i++) { @@ -325,7 +325,7 @@ void print_openpgp_info(gnutls_session session, const char* hostname) } } - + gnutls_openpgp_key_deinit( crt); } @@ -419,7 +419,7 @@ int print_info(gnutls_session session, const char* hostname) print_cert_info(session, hostname); print_cert_vrfy(session); - + /* Check if we have been using ephemeral Diffie Hellman. */ if (kx == GNUTLS_KX_DHE_RSA || kx == GNUTLS_KX_DHE_DSS) { @@ -660,17 +660,17 @@ void parse_comp(char **comp, int ncomp, int *comp_priority) #endif const char *inet_ntop(int af __attribute__((unused)), const void *src, - char *dst, size_t cnt) + char *dst, size_t cnt) { char* ret; ret = inet_ntoa( *((struct in_addr*)src)); - + if (strlen(ret) > cnt) { return NULL; } strcpy( dst, ret); - + return dst; } #endif diff --git a/wmbiff/wmbiff/maildirClient.c b/wmbiff/wmbiff/maildirClient.c index f2e5349..5858e46 100644 --- a/wmbiff/wmbiff/maildirClient.c +++ b/wmbiff/wmbiff/maildirClient.c @@ -2,7 +2,7 @@ /* Author : Yong-iL Joh ( tolkien@mizi.com ) Modified : Jorge García ( Jorge.Garcia@uv.es ) Modified : Dwayne C. Litzenberger ( dlitz@dlitz.net ) - * + * * Maildir checker. * * Last Updated : $Date: 2004/03/28 00:28:58 $ diff --git a/wmbiff/wmbiff/mboxClient.c b/wmbiff/wmbiff/mboxClient.c index e5e85f3..f88a52b 100644 --- a/wmbiff/wmbiff/mboxClient.c +++ b/wmbiff/wmbiff/mboxClient.c @@ -3,7 +3,7 @@ Modified: Jorge García Rob Funk Neil Spring - * + * * MBOX checker. * * Last Updated : $Date: 2004/03/28 00:28:58 $ @@ -99,7 +99,7 @@ static void countMessages(Pop3 pc, const char *mbox_filename) fclose(F); } -/* check file status; hold on to file information used +/* check file status; hold on to file information used to restore access time */ int fileHasChanged(const char *mbox_filename, time_t * atime, diff --git a/wmbiff/wmbiff/passwordMgr.c b/wmbiff/wmbiff/passwordMgr.c index 131b558..28b6e30 100644 --- a/wmbiff/wmbiff/passwordMgr.c +++ b/wmbiff/wmbiff/passwordMgr.c @@ -1,5 +1,5 @@ -/* passwordMgr.c - * Author: Neil Spring +/* passwordMgr.c + * Author: Neil Spring */ /* this module implements a password cache: the goal is to allow multiple wmbiff mailboxes that are otherwise @@ -56,9 +56,9 @@ typedef struct password_binding_struct { static password_binding pass_list = NULL; -/* verifies that askpass_fname, if it has no spaces, exists as - a file, is owned by the user or by root, and is not world - writeable. This is just a sanity check, and is not intended +/* verifies that askpass_fname, if it has no spaces, exists as + a file, is owned by the user or by root, and is not world + writeable. This is just a sanity check, and is not intended to ensure the integrity of the password-asking program. */ /* would be static, but used in test_wmbiff */ int permissions_ok(Pop3 pc, const char *askpass_fname) diff --git a/wmbiff/wmbiff/sample.wmbiffrc b/wmbiff/wmbiff/sample.wmbiffrc index e0a4f58..6c19b8d 100644 --- a/wmbiff/wmbiff/sample.wmbiffrc +++ b/wmbiff/wmbiff/sample.wmbiffrc @@ -6,11 +6,11 @@ interval=60 # Global askpass -- choose a password acting program -# that behaves like ssh-askpass. The default is +# that behaves like ssh-askpass. The default is # askpass = /usr/bin/ssh-askpass. # askpass is invoked on IMAP entries that have no password # below. -# the commented version below is likely to work on RedHat +# the commented version below is likely to work on RedHat # systems; wmbiff's default is likely to work on Debian # systems with ssh-askpass installed. #askpass = /usr/libexec/openssh/x11-ssh-askpass @@ -39,7 +39,7 @@ askpass = /usr/bin/ssh-askpass -fg cyan -bg black -xrm '*Dialog.title: WMBiff Pa #skinfile=wmbiff-master-led.xpm # higher contrast for lower-color displays #skinfile=wmbiff-master-contrast.xpm -# make your own derivative and submit it +# make your own derivative and submit it # to us at wmbiff-devel@lists.sourceforge.net ### First string ### @@ -62,7 +62,7 @@ globalnotify=my_play /home/gb/sounds/new_mail_has_arrived.wav # Don't want any global notification for this mailbox notify.0=true -# Command, which executed on left mouse click on label +# Command, which executed on left mouse click on label action.0=rxvt -name mutt -e mutt # Rescan interval; default to global interval diff --git a/wmbiff/wmbiff/socket.c b/wmbiff/wmbiff/socket.c index 5ff9589..ff2c819 100644 --- a/wmbiff/wmbiff/socket.c +++ b/wmbiff/wmbiff/socket.c @@ -77,7 +77,7 @@ static int ipv4_sock_connect(struct in_addr *address, short port) /* nspring/blueHal, 10 Apr 2002; added some extra error printing, in line with the debug-messages-to-stdout philosophy of the rest of the wmbiff code */ -/* 1 June 2002; incorporated IPv6 support by +/* 1 June 2002; incorporated IPv6 support by Jun-ichiro itojun Hagino , thanks! */ int sock_connect(const char *hostname, int port) @@ -109,7 +109,7 @@ int sock_connect(const char *hostname, int port) if (error) { static int last_error; if (last_error != error) { - /* only report a problem if it's new. this is an + /* only report a problem if it's new. this is an approximation that minimizes kept state. */ printf("%s: %s\n", hostname, gai_strerror(error)); last_error = error; @@ -135,7 +135,7 @@ int sock_connect(const char *hostname, int port) if (errno != last_connecterr) { /* only report a problem if it's new. EHOSTUNREACH is common when the net is down, - for example; again, this is an approximation + for example; again, this is an approximation to minimize kept state. */ last_connecterr = errno; fprintf(stderr, "Error connecting to %s:%d: %s\n", diff --git a/wmbiff/wmbiff/test_wmbiff.c b/wmbiff/wmbiff/test_wmbiff.c index 5add324..8e090cc 100644 --- a/wmbiff/wmbiff/test_wmbiff.c +++ b/wmbiff/wmbiff/test_wmbiff.c @@ -406,14 +406,14 @@ int exists(UNUSED(const char *filename)) } -// void initialize_blacklist(void) { } +// void initialize_blacklist(void) { } // void tlscomm_printf(UNUSED(int x), UNUSED(const char *f), ...) { } -// void tlscomm_expect(void) { } -// void tlscomm_close() { } -// int tlscomm_is_blacklisted(UNUSED(const char *x)) { return 1; } -// void initialize_gnutls(void) { } +// void tlscomm_expect(void) { } +// void tlscomm_close() { } +// int tlscomm_is_blacklisted(UNUSED(const char *x)) { return 1; } +// void initialize_gnutls(void) { } // int sock_connect(UNUSED(const char *n), UNUSED(int p)) { return 1; } /* stdout */ -// void initialize_unencrypted(void) { } +// void initialize_unencrypted(void) { } int main(UNUSED(int argc), UNUSED(char *argv[])) { diff --git a/wmbiff/wmbiff/tlsComm.c b/wmbiff/wmbiff/tlsComm.c index 90fbc68..6f0bcd4 100644 --- a/wmbiff/wmbiff/tlsComm.c +++ b/wmbiff/wmbiff/tlsComm.c @@ -137,7 +137,7 @@ static int wait_for_it(int sd, int timeoutseconds) // DMA(DEBUG_INFO, // "select %d/%d returned %d descriptor, %d\n", // sd, timeoutseconds, ready_descriptors, FD_ISSET(sd, &readfds)); - + } while(tv.tv_sec > 0 && (!FD_ISSET(sd, &readfds) || (errno == EINTR && ready_descriptors == -1))); FD_ZERO(&readfds); @@ -423,7 +423,7 @@ static int tls_compare_certificates(const gnutls_datum * peercert) static void tls_check_certificate(struct connection_state *scs, - const char *remote_hostname) + const char *remote_hostname) { int ret; unsigned int certstat; diff --git a/wmbiff/wmbiff/tlsComm.h b/wmbiff/wmbiff/tlsComm.h index 38911dd..26fa43c 100644 --- a/wmbiff/wmbiff/tlsComm.h +++ b/wmbiff/wmbiff/tlsComm.h @@ -1,6 +1,6 @@ /* tlsComm.h - interface for the thin layer that looks sort of like fgets and fprintf, but might read or write - to a socket or a TLS association + to a socket or a TLS association Neil Spring (nspring@cs.washington.edu) @@ -11,7 +11,7 @@ /* used to drill through per-mailbox debug keys */ #include "Client.h" -/* opaque reference to the state associated with a +/* opaque reference to the state associated with a connection: may be just a file handle, or may include encryption state */ struct connection_state; @@ -28,9 +28,9 @@ struct connection_state *initialize_gnutls(int sd, /*@only@ */ char *name, struct connection_state *initialize_unencrypted(int sd, /*@only@ */ char *name, Pop3 pc); -/* store a binding when connect() times out. these should be +/* store a binding when connect() times out. these should be skipped when trying to check mail so that other mailboxes - are checked responsively. I believe linux defaults to + are checked responsively. I believe linux defaults to around 90 seconds for a failed connect() attempt */ /* TODO: engineer an eventual retry scheme */ /*@only@*/ diff --git a/wmbiff/wmbiff/wmbiff.1 b/wmbiff/wmbiff/wmbiff.1 index ae89efc..a7c5f78 100644 --- a/wmbiff/wmbiff/wmbiff.1 +++ b/wmbiff/wmbiff/wmbiff.1 @@ -33,7 +33,7 @@ and also optionally, a command can be executed on mail arrival (for example, opening your mail reader or playing a sound file). Pressing mouse button 1 will execute a command, defined in the user's config -file. Mouse button 3 will execute a command to fetch mail, if defined. +file. Mouse button 3 will execute a command to fetch mail, if defined. To restart wmbiff, press mouse button 1 while holding control and shift keys, or send it SIGUSR1. @@ -56,7 +56,7 @@ Initial window position. .B \-c Use specified configuration file instead of ~/.wmbiffrc. .TP -.B \-debug +.B \-debug Print verbose log of progress. .TP .B \-fg @@ -93,7 +93,7 @@ new mail messages, if any, or the total number of messages. This option also enables the special keyword "beep" (disabled by default). .TP -.B \+w +.B \+w Do not use the "withdrawn" state: the wmbiff window will not be captured as an icon and placed in the dock, but will instead have its own window. This option starts with a '+' diff --git a/wmbiff/wmbiff/wmbiff.c b/wmbiff/wmbiff/wmbiff.c index 8ed6429..ddc7f3f 100644 --- a/wmbiff/wmbiff/wmbiff.c +++ b/wmbiff/wmbiff/wmbiff.c @@ -245,7 +245,7 @@ static int Read_Config_File(char *filename, int *loopinterval) return 0; } while (!feof(fp)) { - /* skanky: -1 can represent an unparsed line + /* skanky: -1 can represent an unparsed line or an error */ if (ReadLine(fp, setting, value, &mbox_index) == -1) continue; diff --git a/wmbiff/wmbiff/wmbiffrc.5.in b/wmbiff/wmbiff/wmbiffrc.5.in index 66924e3..1800c80 100644 --- a/wmbiff/wmbiff/wmbiffrc.5.in +++ b/wmbiff/wmbiff/wmbiffrc.5.in @@ -3,7 +3,7 @@ .\" .\" @configure_input@ .\" -.\" wmbiff.1 and wmbiffrc.5 are copyright 1999-2002 by +.\" wmbiff.1 and wmbiffrc.5 are copyright 1999-2002 by .\" Jordi Mallach .\" .\" This is free documentation, see the latest version of the GNU @@ -85,11 +85,11 @@ See \fBhttp://gnutls.org/manual/gnutls.html#Priority-Strings\fR for more details \fBinterval\fP Global interval between mailbox checking. Value is the number of seconds, 5 is the default. -.TP +.TP \fBaskpass\fP Program run to ask for IMAP passwords, if left empty in the configuration file. The default is @DEFAULT_ASKPASS@. Can be specified on a per-mailbox basis. -.TP +.TP \fBskinfile\fP XPM pixmap file to load for the background. If not a full path, wmbiff will search @SKINDIR@, /usr/share/wmbiff, @@ -112,7 +112,7 @@ are supported: .TP .I mbox This is a local mbox mailbox. After the prefix, you only need to put the -path to the mailbox wmbiff needs to read. +path to the mailbox wmbiff needs to read. Local mboxes may be specified using shell commands enclosed in back-ticks. (`s.) .\"This is also the default. @@ -127,7 +127,7 @@ mbox:/path/to/mail/debian-devel .\" .RS .TP .I maildir -This works just like \fImbox\fP above. +This works just like \fImbox\fP above. .RS maildir:[:\fIflags\fP:]/path/to/mail/bugtraq/ .TP @@ -135,8 +135,8 @@ maildir:[:\fIflags\fP:]/path/to/mail/bugtraq/ .TP .I F Flush directory caches by creating (then deleting) a temporary file -in each maildir prior to checking. This hack speeds up checking -network-mounted maildirs in cases where directory caching can cause +in each maildir prior to checking. This hack speeds up checking +network-mounted maildirs in cases where directory caching can cause unwanted delays (eg. SFS-mounted maildirs). .RE .TP @@ -144,18 +144,18 @@ unwanted delays (eg. SFS-mounted maildirs). Using this type, WMBiff will check for mail on a pop3 server using the specified username, password, host and an optional port number (defaulting to 110). If your password contains a special character, eg. '@' or ':', -use the second path format. See Authentication below for a description of -the auth field. +use the second path format. See Authentication below for a description of +the auth field. .RS pop3:user:passwd@server[:port] [auth] .RE .RS -pop3:user passwd server[ port] [auth] +pop3:user passwd server[ port] [auth] .RE .TP .I pop3s Exactly like pop3, only uses TLS (SSL) when built with gnutls and defaults -to port 995. @GNUTLS_MAN_STATUS@ +to port 995. @GNUTLS_MAN_STATUS@ .TP .I imap These are IMAP4 boxes. As with pop3, WMBiff will report the @@ -164,11 +164,11 @@ accepts user, optional password, host and optional path to mailbox and port number. See Authentication below for a description of the auth field. The password may be left empty: see askpass above for information on password -prompting. If your password includes a @, use the +prompting. If your password includes a @, use the space delimited form. If it contains a space or #, use the -askpass option instead. The mailbox field may be quoted, -e.g., server/"Mail/Eggs and Spam". Mailboxes in subfolders -may be described as /INBOX.subfolder by some servers and +askpass option instead. The mailbox field may be quoted, +e.g., server/"Mail/Eggs and Spam". Mailboxes in subfolders +may be described as /INBOX.subfolder by some servers and /Mail/subfolder by others. .RS imap:user:passwd@server[/mailbox][:port] [auth] @@ -221,15 +221,15 @@ Command to be executed on new mail arrival in the given mailbox. Accepts the special keyword "beep" to use the pc speaker. .TP \fBaction.n\fP -Command to be executed on left mouse click on a mailbox label. +Command to be executed on left mouse click on a mailbox label. Accepts -the special keyword "msglst" to pop up a window of recent message headers +the special keyword "msglst" to pop up a window of recent message headers from IMAP or POP3 mailboxes when the left mouse button is held. .TP \fBbuttontwo.n\fP Command to be executed on middle mouse click on a mailbox level. Accepts -the special keyword "msglst" to pop up a window of +the special keyword "msglst" to pop up a window of recent message headers from IMAP or POP3 mailboxes when the middle mouse button is held. .TP \fBinterval.n\fP @@ -245,11 +245,11 @@ in seconds. Command to be executed to fetch mail. If not specified, fetching through wmbiff is disabled completely. Accepts -the special keyword "msglst" to pop up a window of recent message headers +the special keyword "msglst" to pop up a window of recent message headers from IMAP and POP3 mailboxes when the right mouse button is held down, though not when fetchinterval is nonzero. .TP -\fBdebug.n\fP +\fBdebug.n\fP Show debugging messages from this mailbox. Currently supported values are "all" and "none". The \-debug option to wmbiff overrides this setting. Since IMAP uses a single diff --git a/wmbiff/wmgeneral/Makefile.am b/wmbiff/wmgeneral/Makefile.am index ed65c43..0b3bc5d 100644 --- a/wmbiff/wmgeneral/Makefile.am +++ b/wmbiff/wmgeneral/Makefile.am @@ -1,7 +1,7 @@ noinst_LIBRARIES = libwmgeneral.a libwmgeneral_a_SOURCES = misc.c misc.h wmgeneral.c wmgeneral.h -MAINTAINERCLEANFILES = Makefile.in +MAINTAINERCLEANFILES = Makefile.in indent: diff --git a/wmbiff/wmgeneral/misc.c b/wmbiff/wmgeneral/misc.c index 0b56b4b..3733aa1 100644 --- a/wmbiff/wmgeneral/misc.c +++ b/wmbiff/wmgeneral/misc.c @@ -1,9 +1,9 @@ /* dock.c- built-in Dock module for WindowMaker - * + * * WindowMaker window manager - * + * * Copyright (c) 1997 Alfredo K. Kojima - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/wmbiff/wmgeneral/wmgeneral.c b/wmbiff/wmgeneral/wmgeneral.c index dc06cb6..ddae0d7 100644 --- a/wmbiff/wmgeneral/wmgeneral.c +++ b/wmbiff/wmgeneral/wmgeneral.c @@ -17,7 +17,7 @@ * Now supports >256 colors 11/09/1998 (Martijn Pieterse, pieterse@xs4all.nl) * Removed a bug from parse_rcfile. You could - not use "start" in a command if a label was + not use "start" in a command if a label was also start. * Changed the needed geometry string. We don't use window size, and don't support @@ -189,7 +189,7 @@ static void GetXPM(XpmIcon * wmgen_local, const char *pixmap_bytes[]) /* For the colormap */ XGetWindowAttributes(display, Root, &attributes); - /* despite the comment, I still don't understand... + /* despite the comment, I still don't understand... attributes is subsequently unused in this function -ns 11/2002 */ wmgen_local->attributes.valuemask |= @@ -598,7 +598,7 @@ void openXwindow(int argc, const char *argv[], if( specified & YNegative ) { y = DisplayHeight(display, DefaultScreen(display)) - y - pixmask_height; } - if( specified & XValue || specified & YValue ) { + if( specified & XValue || specified & YValue ) { XMoveWindow(display, win, x, y); } */ diff --git a/wmbutton/Makefile b/wmbutton/Makefile index 1ac7298..7738730 100644 --- a/wmbutton/Makefile +++ b/wmbutton/Makefile @@ -21,7 +21,7 @@ ${TARGET}: ${OBJECTS} gcc -o ${TARGET} ${OBJECTS} ${LDFLAGS} ${LIBINC} ${LIBS} clean:: - for i in ${OBJECTS}; do if [ -e $$i ] ; then rm $$i; fi; done + for i in ${OBJECTS}; do if [ -e $$i ] ; then rm $$i; fi; done if [ -e ${TARGET} ] ; then rm ${TARGET}; fi if [ -e tags ]; then rm tags; fi if [ -e core ]; then rm core; fi diff --git a/wmbutton/README b/wmbutton/README index fe0cb79..790f44d 100644 --- a/wmbutton/README +++ b/wmbutton/README @@ -25,7 +25,7 @@ CONTRIBUTORS: Ralf Horstmann Added ability to load pixmaps at startup, without having to re-compile - Michael Cohrs + Michael Cohrs Added Tool Tips, and updated graphics Bruno Essmann ) Creator of wmpager @@ -33,28 +33,28 @@ CONTRIBUTORS: original author of wmcp (et al.) Thomas Nemeth contributor to wmcp - Casey Harkins + Casey Harkins Bug fix reading config file path - 3/6/99 Added button-presses, and other - denoted by *charkins* Michael Henderson Application ideas, suggestions - Ryan ?? + Ryan ?? Modified wmbutton to asbutton. - Note: asbutton is a seperate program, not associated + Note: asbutton is a seperate program, not associated with wmbutton (just as wmbutton is not associated with wmcp) Jon Bruno Web Page Development -The contributors listed above are not necessarily involved with the -development of wmbutton. I'm listing them here partially as thanks for +The contributors listed above are not necessarily involved with the +development of wmbutton. I'm listing them here partially as thanks for helping out, catching bugs in the code, etc. INSTALLATION: ------------- - Untar the file: + Untar the file: tar xvzf wmbutton-0.6.1.tar.gz - CD to source directory: + CD to source directory: cd wmbutton-0.6.1 Edit background xpm, and buttons.xpm to your preferences @@ -68,21 +68,21 @@ INSTALLATION: Put the executable somewhere in your path: mv wmbutton /usr/local/bin (or anyhere in your path) - + Run it: wmbutton & - Grab the appicon and move it to the dock. + Grab the appicon and move it to the dock. Change the settings to start with Windowmaker Afterstep Wharf 1.6.??: *Wharf wmbutton -Swallow "wmbutton" wmbutton & - ***Note***: - The appicon has only a two pixel border where you can grab + ***Note***: + The appicon has only a two pixel border where you can grab and move it. - If make doesn't work, you may need to fiddle with the settings in + If make doesn't work, you may need to fiddle with the settings in the Makefile. Tested on: (Well, it runs, I don't know if 'Tested' is quite right...) @@ -94,7 +94,7 @@ INSTALLATION: USAGE: ------ -wmbutton [-g geom] [-d dpy] [-f cfgfile] [-b btnfile] [-F ] +wmbutton [-g geom] [-d dpy] [-f cfgfile] [-b btnfile] [-F ] [-v] [-s] [-n] wmbutton Ver 0 Rel 6.1 @@ -121,19 +121,19 @@ Right mouse button: NOTES: ------ -This is a simple application launching tool for use in WindowMaker, and -possibly Afterstep. (Who knows, it should run for other window managers too, +This is a simple application launching tool for use in WindowMaker, and +possibly Afterstep. (Who knows, it should run for other window managers too, by why bother?? It is taken from wmcp, by Ben Cohen, and modified just -enough to run applications rather than send ALT-[1..9] key sequences to +enough to run applications rather than send ALT-[1..9] key sequences to WindowMaker. It has also taken some ideas from asbuttons, and included them back into the original. There may still be some code -left over from wmcp that is no longer needed, but... +left over from wmcp that is no longer needed, but... -The mini-icons must be combined into a single graphic, buttons.xpm. The +The mini-icons must be combined into a single graphic, buttons.xpm. The background border is defined in backdrop.xpm. Both must be edited in your favorite graphics editor (GIMP??), and then recompiled. wmbuttons uses a configuration file (usually ~/.wmbutton) for which applications to launch. -There is no need to restart wmbuttons when simply changing the configuration, +There is no need to restart wmbuttons when simply changing the configuration, as wmbutton searches the file whenever a button is pressed. As of release 0.5, you can also pass in your own pixmap file for the @@ -160,8 +160,8 @@ CHANGE LOG: General Code clean-up, including export must functions to seperate C file, to reduce clutter. -0.4 Added Modifications submitted by Casey Harkins. - Start application on mouse button release, +0.4 Added Modifications submitted by Casey Harkins. + Start application on mouse button release, Only start app if cursor is still on application button Added 3-D button press look Added new .wmbutton configuration file @@ -170,7 +170,7 @@ CHANGE LOG: Removed Middle/Right mouse click on button to turn off buttons after it. Added Middle and Right mouse buttons to run more Applications - (Yes, you can now really run 27 different Apps from a single + (Yes, you can now really run 27 different Apps from a single instance of wmbuttons, if you would want too...) Fixed bug for finding config file .wmbutton. It used to not look in the home directory, but in the @@ -181,7 +181,7 @@ CHANGE LOG: 0.2 Added single configuration file, user selectable. 0.1 Origional version. - Shamelessly taken from wmcp 1.2.5, + Shamelessly taken from wmcp 1.2.5, by Ben Cohen TODO: @@ -191,7 +191,7 @@ Add ability (via config file) to use discrete 16x16 pixel icons for Make changing icons and/or background graphics easier. Allow for less than 9 icons, 4 would be nicer on the mini-icon size. -BUGS: +BUGS: ----- Remember, they're just undocumented FEATURES!!! diff --git a/wmbutton/mask.xbm b/wmbutton/mask.xbm index 0efa91f..bfee922 100644 --- a/wmbutton/mask.xbm +++ b/wmbutton/mask.xbm @@ -11,10 +11,10 @@ static char mask_bits[] = { 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, - 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, - 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, - 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, - 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, + 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, + 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, + 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, + 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, diff --git a/wmbutton/sample.wmbutton b/wmbutton/sample.wmbutton index 35e0fc8..d7088db 100644 --- a/wmbutton/sample.wmbutton +++ b/wmbutton/sample.wmbutton @@ -1,7 +1,7 @@ # .wmbutton - Configuration file for wmbutton # Last Modified 03/21/04 -# Buttons are numbered as follows +# Buttons are numbered as follows # Left 1 2 3 Middle 11 12 13 Right 21 22 23 # button 4 5 6 button 14 15 16 button 24 25 26 # 7 8 9 17 18 19 27 28 29 diff --git a/wmcalendar/CHANGES b/wmcalendar/CHANGES index e94b331..1dc36dd 100644 --- a/wmcalendar/CHANGES +++ b/wmcalendar/CHANGES @@ -9,7 +9,7 @@ Version 0.5.0 - Memory leak fixed - new design of popup window Version 0.4.4 - added islamic calendar - mark day with leftclick -Version 0.4.3 - bugfix: compile error +Version 0.4.3 - bugfix: compile error Version 0.4.2 - added free start of week - added proper handling of reoccurencies of events - fixed Makefile to compile properly with libical 0.24 @@ -17,7 +17,7 @@ Version 0.4.2 - added free start of week Version 0.4.1 - changed applaunch to doubleclick(requested by Sebastian Ley) - direct startup when rcfile is created (requested by Sebastian Ley) - some Makefile cleanup (taken from Alexey Dokuchaev's bsd port) -Version 0.4.0 - added settings menu (for appicon, applaunch-command, +Version 0.4.0 - added settings menu (for appicon, applaunch-command, language and *.ics file) - bugfix: other calendarfiles(like mozilla) work now - lots of code cleanup @@ -28,9 +28,9 @@ Version 0.3.6 - persian calendar added - file access to *.ics changed to reload only when modified Version 0.3.5 - moonphase added (error +-1day due simple algorithm...) Version 0.3.4 - manpage added -Version 0.3.3 - bugfix: days between months don't show details anymore +Version 0.3.3 - bugfix: days between months don't show details anymore - changed dockapp to gdk with dockapp.c - added farsi (but still in gregorian calendar) -Version 0.3.2 - added box in bottom right corner for movement and access to settings +Version 0.3.2 - added box in bottom right corner for movement and access to settings Version 0.3.1 - memory leak fixed, code cleanup, switch to sourceforge email Version 0.3.0 - first public alpha release March 19, 2003. diff --git a/wmcalendar/HINTS b/wmcalendar/HINTS index bdf6dab..b7af88b 100644 --- a/wmcalendar/HINTS +++ b/wmcalendar/HINTS @@ -14,12 +14,12 @@ In WindowMaker simply drag and drop the wmCalendar App on the WindowMaker Dock o Afterstep. --------- -Afterstep users put the following in their .steprc "Wharf wmCalendar - MaxSwallow +Afterstep users put the following in their .steprc "Wharf wmCalendar - MaxSwallow "wmCalendar" wmCalendar &". Dont use Afterstep so I have no idea if it works... Note: AfterStep's Wharf supposedly has a problem with pixmaps that are larger than 60x60 pixels. Please tell the AfterStep authors to fix this, this is not -our fault, but a Wharf problem! +our fault, but a Wharf problem! Other window managers. ---------------------- diff --git a/wmcalendar/INSTALL b/wmcalendar/INSTALL index da4dc0f..74573ca 100644 --- a/wmcalendar/INSTALL +++ b/wmcalendar/INSTALL @@ -2,19 +2,19 @@ Installation instructions for wmCalendar Requirements -------------------------------------------------------------- -wmCalendar requires the Xpm and libical library +wmCalendar requires the Xpm and libical library Installation -------------------------------------------------------------- 1) gunzip wmcalendar-x.x.x.tar.gz 1) tar -xvf wmwmcalendar-x.x.x.tar 2) cd wmcalendar-x.x.x/Src/ -3) make -4) make install (must be root) +3) make +4) make install (must be root) 5) wmCalendar & (or 'wmCalendar -h' for help, or 'man wmCalendar' for the man page) Notes: you need libical to install. -you can get it from http://sourceforge.net/projects/freeassociation/ +you can get it from http://sourceforge.net/projects/freeassociation/ the debian package 0.23 has some bugs concerning the reoccurence of events diff --git a/wmcalendar/README b/wmcalendar/README index 9452ea1..c532111 100644 --- a/wmcalendar/README +++ b/wmcalendar/README @@ -5,8 +5,8 @@ Packaging.: Sebastian Ley(debian) for copyrights of conversions between calendar formats see: calendarfunc.h - - + + Description ----------- wmCalendar is a Calendar with a monthly view diff --git a/wmcalendar/Src/Makefile b/wmcalendar/Src/Makefile index 175a844..b05ca8e 100755 --- a/wmcalendar/Src/Makefile +++ b/wmcalendar/Src/Makefile @@ -1,9 +1,9 @@ CC = gcc -INCLUDES = `pkg-config --cflags gtk+-2.0` -I. +INCLUDES = `pkg-config --cflags gtk+-2.0` -I. LFLAGS = `pkg-config --libs gtk+-2.0` # for BSD -#INCLUDES = `gtk12-config --cflags` -I. +#INCLUDES = `gtk12-config --cflags` -I. #LFLAGS = `gtk12-config --libs` X11BASE = /usr/X11R6 CFLAGS = $(INCLUDES) -DICON_TYPE=$(ICON_TYPE) @@ -27,9 +27,9 @@ OBJECTS = wmCalendar.o \ $(CC) $(CFLAGS) -D`uname -s` -DHAVE_SYS_TIME_H -c $< -o $*.o $(INCDIR) -all: wmCalendar.o wmCalendar +all: wmCalendar.o wmCalendar -wmCalendar: $(OBJECTS) +wmCalendar: $(OBJECTS) $(CC) $(COPTS) $(SYSTEM) $(LFLAGS) -o $@ $(OBJECTS) -o wmCalendar $(INCDIR)$(LIBDIR) $(LIBS) wmCalendar.o: wmCalendar_master.xpm wmCalendar_master2.xpm @@ -41,5 +41,5 @@ clean: install:: wmCalendar install -c -s -m 0755 wmCalendar $(DESTDIR)/bin/ - install -c -m 0644 wmCalendar.1 $(DESTDIR)/man/man1 + install -c -m 0644 wmCalendar.1 $(DESTDIR)/man/man1 diff --git a/wmcalendar/Src/calendar.c b/wmcalendar/Src/calendar.c index 8addc09..fb16395 100644 --- a/wmcalendar/Src/calendar.c +++ b/wmcalendar/Src/calendar.c @@ -19,11 +19,11 @@ void checkicalversion() GTK_RESPONSE_NONE, NULL); label = gtk_label_new (msg); - g_signal_connect_swapped (GTK_OBJECT (dialog), - "response", + g_signal_connect_swapped (GTK_OBJECT (dialog), + "response", G_CALLBACK (gtk_widget_destroy), GTK_OBJECT (dialog)); - gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), label); + gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), label); gtk_signal_connect (GTK_OBJECT (dialog), "destroy", GTK_SIGNAL_FUNC(gtk_main_quit ), NULL); @@ -57,7 +57,7 @@ void kill (GtkWidget * widget) /*------------------------------------------------------ - * calendar + * calendar -----------------------------------------------------*/ void calendar(){ int value; @@ -67,10 +67,10 @@ void calendar(){ struct stat filestat; icalproperty *prop, *reocc; icalparser *parser; - icalcomponent *c, *d; + icalcomponent *c, *d; FILE *stream; struct icaltimetype t1, t2; - if(get_debug())printf("check for new calendar data\n"); + if(get_debug())printf("check for new calendar data\n"); stream = fopen((const char*)get_icsfile(),"r"); if(stream == 0) return; @@ -79,7 +79,7 @@ void calendar(){ fclose(stream); return; } - if(get_debug())printf("read calendar data\n"); + if(get_debug())printf("read calendar data\n"); deleteCalObjs(); modtime = filestat.st_mtime; parser = icalparser_new(); @@ -91,7 +91,7 @@ void calendar(){ free(line); if(c != 0){ for(d = icalcomponent_get_first_component(c, ICAL_ANY_COMPONENT);d != 0; - d = icalcomponent_get_next_component(c, ICAL_ANY_COMPONENT)){ + d = icalcomponent_get_next_component(c, ICAL_ANY_COMPONENT)){ /* get date */ t1 = icalcomponent_get_dtstart(d); @@ -102,9 +102,9 @@ void calendar(){ } /* get transparency */ - prop = icalcomponent_get_first_property(d, ICAL_TRANSP_PROPERTY ); - reocc = icalcomponent_get_first_property(d, ICAL_RRULE_PROPERTY); - if(prop) + prop = icalcomponent_get_first_property(d, ICAL_TRANSP_PROPERTY ); + reocc = icalcomponent_get_first_property(d, ICAL_RRULE_PROPERTY); + if(prop) transp = icalproperty_get_value_as_string(prop); if(!strcmp(transp, "OPAQUE")) value = 1; @@ -115,7 +115,7 @@ void calendar(){ /* get desciption */ - prop = icalcomponent_get_first_property(d, ICAL_SUMMARY_PROPERTY); + prop = icalcomponent_get_first_property(d, ICAL_SUMMARY_PROPERTY); if(prop) { text = icalproperty_get_value_as_string(prop); addCalObj(t1, t2, value, text, d); @@ -125,7 +125,7 @@ void calendar(){ icalcomponent_free(d); } icalcomponent_free(c); - } + } } while(line != 0); icalparser_free(parser); fclose(stream); @@ -134,7 +134,7 @@ void calendar(){ /*------------------------------------------------------ - * showDay + * showDay -----------------------------------------------------*/ void showDay(struct icaltimetype dt){ static GtkWidget *dayView; @@ -148,9 +148,9 @@ void showDay(struct icaltimetype dt){ time_t tt = icaltime_as_timet(dt); timptr = gmtime(&tt); event_box = gtk_event_box_new (); - gtk_widget_show (event_box); + gtk_widget_show (event_box); event_box2 = gtk_event_box_new (); - gtk_widget_show (event_box2); + gtk_widget_show (event_box2); /* create titlebartext */ strftime(buf, 26, "%A, %x", timptr); @@ -170,20 +170,20 @@ void showDay(struct icaltimetype dt){ gtk_table_attach_defaults (GTK_TABLE(table), event_box, 0, 3, 1, 2); gtk_table_attach_defaults (GTK_TABLE(table), event_box2, 3, 4, 1, 2); - + label1 = gtk_label_new (NULL); - gtk_label_set_markup ((GtkLabel*)label1, buf2); + gtk_label_set_markup ((GtkLabel*)label1, buf2); gtk_container_add (GTK_CONTAINER (event_box), label1); - + gtk_table_set_row_spacing ((GtkTable*)table,0, 1); gtk_table_set_row_spacing ((GtkTable*)table,1, 1); gtk_widget_show (label1); label1 = gtk_label_new (" X "); gtk_container_add (GTK_CONTAINER (event_box2), label1); gtk_widget_show (label1); - + /* fill table with events and draw window if there are any events */ - if(dayevents(dt, table)){ + if(dayevents(dt, table)){ gtk_widget_show (dayView); gtk_widget_show (table); @@ -204,7 +204,7 @@ void showDay(struct icaltimetype dt){ /*------------------------------------------------------ - * dayevents + * dayevents -----------------------------------------------------*/ int dayevents(struct icaltimetype dt, GtkWidget *table){ static GtkWidget *label1; @@ -217,7 +217,7 @@ int dayevents(struct icaltimetype dt, GtkWidget *table){ char buf[1024]; struct tm *timptr = NULL; time_t tt; - + GtkWidget *separator; j = 2; it = calRoot; @@ -233,17 +233,17 @@ int dayevents(struct icaltimetype dt, GtkWidget *table){ /* create time entry */ tt = icaltime_as_timet(t1); timptr = gmtime(&tt); - strftime(buftime1, 26, "%X", timptr); + strftime(buftime1, 26, "%X", timptr); tt = icaltime_as_timet(t2); timptr = gmtime(&tt); - strftime(buftime2, 26, "%X", timptr); + strftime(buftime2, 26, "%X", timptr); sprintf(buf,"%s - %s",buftime1, buftime2); label1 = gtk_label_new (NULL); - gtk_label_set_markup ((GtkLabel*)label1, buf); + gtk_label_set_markup ((GtkLabel*)label1, buf); gtk_table_attach_defaults (GTK_TABLE(table), label1, 1, 2, j, j+1); gtk_widget_show (label1); - - + + /* create description entry */ label1 = gtk_label_new (it->text); gtk_table_attach_defaults (GTK_TABLE(table), label1, 2, 3, j, j+1); @@ -272,19 +272,19 @@ int dayevents(struct icaltimetype dt, GtkWidget *table){ /* create description with start and enddate */ tt = icaltime_as_timet(t1); timptr = gmtime(&tt); - strftime(buftime1, 26, "%a, %x", timptr); + strftime(buftime1, 26, "%a, %x", timptr); tt = icaltime_as_timet(t2); timptr = gmtime(&tt); - strftime(buftime2, 26, "%a, %x", timptr); + strftime(buftime2, 26, "%a, %x", timptr); sprintf(buf, "%s - %s", buftime1, buftime2); } label1 = gtk_label_new (NULL); - gtk_label_set_markup ((GtkLabel*)label1, buf); - + gtk_label_set_markup ((GtkLabel*)label1, buf); + gtk_table_attach_defaults (GTK_TABLE(table), label1, 1, 2, j, j+1); gtk_widget_show (label1); - - prop = icalcomponent_get_first_property(it->comp, ICAL_LOCATION_PROPERTY); + + prop = icalcomponent_get_first_property(it->comp, ICAL_LOCATION_PROPERTY); if(prop) sprintf(buf, "%s\n%s", it->text, icalproperty_get_location(prop)); else @@ -296,7 +296,7 @@ int dayevents(struct icaltimetype dt, GtkWidget *table){ j++; } } - it = it->next; + it = it->next; } label1 = gtk_label_new (NULL); gtk_table_attach_defaults (GTK_TABLE(table), label1, 2, 3, j+1, j+2); @@ -330,7 +330,7 @@ void deleteCalObjs(){ /*------------------------------------------------------ * addCalObj -----------------------------------------------------*/ -void addCalObj(struct icaltimetype start, struct icaltimetype end, +void addCalObj(struct icaltimetype start, struct icaltimetype end, int type, const char *text, icalcomponent * d){ struct calobj *newobj; icalcomponent *newcomp = malloc(sizeof(struct calobj)); @@ -368,15 +368,15 @@ int getDayType(struct icaltimetype dt){ -----------------------------------------------------*/ int isExluded(icalcomponent *comp, struct icaltimetype dt){ icalproperty *prop; - prop = icalcomponent_get_first_property(comp, ICAL_EXDATE_PROPERTY); + prop = icalcomponent_get_first_property(comp, ICAL_EXDATE_PROPERTY); while(prop){ - if(daysEqual(icalproperty_get_exdate(prop), dt)) + if(daysEqual(icalproperty_get_exdate(prop), dt)) return 1; - prop = icalcomponent_get_next_property(comp, ICAL_EXDATE_PROPERTY); + prop = icalcomponent_get_next_property(comp, ICAL_EXDATE_PROPERTY); } return 0; } - + /*------------------------------------------------------ @@ -391,11 +391,11 @@ int eventOnDay(struct icaltimetype dt, struct calobj* it) || (daysEqual(dt, it->start) && daysEqual(dt, it->end))) return 1; rrule = icalcomponent_get_first_property((icalcomponent*)it->comp, ICAL_RRULE_PROPERTY); - + if(rrule){ if(daysEarlierEqual(dt, it->start)){ ritr = icalrecur_iterator_new( icalproperty_get_rrule(rrule), it->start); - if(ritr) + if(ritr) next = icalrecur_iterator_next(ritr); while(daysEarlierEqual(dt, next) && !icaltime_is_null_time(next)){ if(daysEqual(dt, next) && !isExluded((icalcomponent*)it->comp, dt)) diff --git a/wmcalendar/Src/calendar.h b/wmcalendar/Src/calendar.h index f37fc57..c022fb4 100644 --- a/wmcalendar/Src/calendar.h +++ b/wmcalendar/Src/calendar.h @@ -8,7 +8,7 @@ time_t modtime; /* modified time of icalendar file */ struct calobj* calRoot; /* 1st element in list of calendar obj*/ int xr, yr; /*evil hack for moving dayview window*/ -int datetype[32][2]; /* hashtable for coloring days.[jdn%32][0] stores color of day jdn, +int datetype[32][2]; /* hashtable for coloring days.[jdn%32][0] stores color of day jdn, [jdn%32][1] stores jdn. */ struct calobj{ struct icaltimetype start; diff --git a/wmcalendar/Src/calendarfunc.c b/wmcalendar/Src/calendarfunc.c index bf596a0..95fd73d 100644 --- a/wmcalendar/Src/calendarfunc.c +++ b/wmcalendar/Src/calendarfunc.c @@ -1,4 +1,4 @@ -/* persian calendar functions original code is by Kees Couprie +/* persian calendar functions original code is by Kees Couprie http://www.geocities.com/couprie/calmath/ */ /* islamic conversion and moonphase calculation is taken from @@ -7,9 +7,9 @@ * * Copyright (c) 1992 by Waleed A. Muhanna * - * Permission for nonprofit use and redistribution of this software and - * its documentation is hereby granted without fee, provided that the - * above copyright notice appear in all copies and that both that copyright + * Permission for nonprofit use and redistribution of this software and + * its documentation is hereby granted without fee, provided that the + * above copyright notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting documentation. * * No representation is made about the suitability of this software for any @@ -53,17 +53,17 @@ double tmoonphase( long n, int nph) jd = 2415020.75933 + 29.53058868*k - 1.178e-4 * t2 - 1.55e-7 * t3 + 3.3e-4 * sin (RPD * (166.56 +132.87*t -0.009173*t2)); - + /* Sun's mean anomaly */ sa = RPD * (359.2242 + 29.10535608*k - 3.33e-5 * t2 - 3.47e-6 * t3); - + /* Moon's mean anomaly */ ma = RPD * (306.0253 + 385.81691806*k + 0.0107306*t2 +1.236e-5 *t3); - + /* Moon's argument of latitude */ tf = RPD * 2.0 * (21.2964 + 390.67050646*k -0.0016528*t2 -2.39e-6 * t3); - + /* should reduce to interval 0-1.0 before calculating further */ if (nph==0 || nph==2) /* Corrections for New and Full Moon */ @@ -99,14 +99,14 @@ double tmoonphase( long n, int nph) return (jd); } - + double visible(long n,double * rjd) { double jd; float tf; long d; - jd = tmoonphase(n,0); + jd = tmoonphase(n,0); *rjd = jd; d = jd; tf = (jd - d); @@ -128,22 +128,22 @@ struct icaltimetype jdn_islamic(long jdn) /* obtain first approx. of how many new moons since the beginning of the year 1900 */ h = jdn_civil(jdn); - k = 0.6 + (h.year + ((int) (h.month - 0.5)) / 12.0 + h.day + k = 0.6 + (h.year + ((int) (h.month - 0.5)) / 12.0 + h.day / 365.0 - 1900) * 12.3685; do{ mjd = visible(k--, &rjd); - } while (mjd > jdn); + } while (mjd > jdn); k++; /*first of the month is the following day*/ hm = k - 1048; h.year = 1405 + (hm / 12); - + h.month = (hm % 12) +1; if (hm != 0 && h.month <= 0) { - h.month += 12; + h.month += 12; h.year--; } - if (h.year<=0) + if (h.year<=0) h.year--; h.day = jdn - mjd + 1; @@ -155,7 +155,7 @@ long islamic_jdn(struct icaltimetype dt) { double jd, rjd; long k; - + k = dt.month + dt.year * 12 - NMONTHS; /* # of m since 1/1/1405 */ jd = visible(k + 1048L, &rjd) + dt.day; return jd; @@ -202,7 +202,7 @@ struct icaltimetype jdn_persian(long jdn) ret.day = iDay; ret.month = iMonth; ret.year = iYear; - ret.is_date = 1; + ret.is_date = 1; return ret; } @@ -248,9 +248,9 @@ struct icaltimetype jdn_civil(long jdn) ret.day = iday; ret.month = imonth; ret.year = iyear; - ret.hour = 0; - ret.minute = 0; - ret.second = 0; + ret.hour = 0; + ret.minute = 0; + ret.second = 0; return ret; } @@ -279,7 +279,7 @@ struct icaltimetype islamic_civil(struct icaltimetype dt) { return(jdn_civil(islamic_jdn(dt))); } - + struct icaltimetype get_civil(struct icaltimetype dt, int calendar){ if(calendar == 0) return dt; @@ -351,7 +351,7 @@ int days_in_islamic_month(int month, int year) dt.day = 1; dt = jdn_islamic(islamic_jdn(dt) - 1); return dt.day; - + } int days_in_gregorian_month(int month, int year) @@ -388,7 +388,7 @@ int moon(struct icaltimetype h) k = 1 + (h.year + ((int) (h.month - 0.5)) / 12.0 + h.day / 365.0 - 1900) * 12.3685; do { mjd = tmoonphase(k--, 0); - } while (mjd > jd); + } while (mjd > jd); k--; diff --git a/wmcalendar/Src/calendarfunc.h b/wmcalendar/Src/calendarfunc.h index abd0ba5..9ec86bd 100644 --- a/wmcalendar/Src/calendarfunc.h +++ b/wmcalendar/Src/calendarfunc.h @@ -1,4 +1,4 @@ -/* persian calendar functions original code is by Kees Couprie +/* persian calendar functions original code is by Kees Couprie http://www.geocities.com/couprie/calmath/ */ /* islamic conversion and moonphase calculation is taken from @@ -7,9 +7,9 @@ * * Copyright (c) 1992 by Waleed A. Muhanna * - * Permission for nonprofit use and redistribution of this software and - * its documentation is hereby granted without fee, provided that the - * above copyright notice appear in all copies and that both that copyright + * Permission for nonprofit use and redistribution of this software and + * its documentation is hereby granted without fee, provided that the + * above copyright notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting documentation. * * No representation is made about the suitability of this software for any @@ -70,5 +70,5 @@ int daysEarlierEqual(struct icaltimetype d1, struct icaltimetype d2); int Ceil(float number); -int datemoon[200][2]; /* hashtable for moonphase.[jdn%32][0] stores moonphase of day jdn, +int datemoon[200][2]; /* hashtable for moonphase.[jdn%32][0] stores moonphase of day jdn, [jdn%32][1] stores jdn. */ diff --git a/wmcalendar/Src/settings.c b/wmcalendar/Src/settings.c index 5b63461..580dce1 100644 --- a/wmcalendar/Src/settings.c +++ b/wmcalendar/Src/settings.c @@ -1,7 +1,7 @@ #include "settings.h" void set_lang(int language){lang = language;} void setAppicon(int app){appicon = app;} -void enter_callback( GtkWidget *widget, GtkWidget *entry ){ +void enter_callback( GtkWidget *widget, GtkWidget *entry ){ strcpy(application, gtk_entry_get_text(GTK_ENTRY(entry)));} int getAppicon(){return appicon;} int get_start_of_week(){return start_of_week;} @@ -13,7 +13,7 @@ const char* get_application(){return application;} const char* get_icsfile(){return icsfile;} /*------------------------------------------------------ - * destroy + * destroy -----------------------------------------------------*/ void destroy (GtkWidget * widget, gpointer data){ gtk_main_quit (); @@ -22,7 +22,7 @@ void destroy (GtkWidget * widget, gpointer data){ /*------------------------------------------------------ - * getSettings + * getSettings -----------------------------------------------------*/ void getSettings(){ char buf[15]; @@ -40,14 +40,14 @@ void getSettings(){ for(i = 1; i < 8; i++){ timptr->tm_wday = (8-i)%7; - strftime(buf, 15, "%A", timptr); + strftime(buf, 15, "%A", timptr); daystr[i]=malloc(15); strcpy(daystr[i], buf); } free(timptr); if(stream == 0){ /* no rcfile */ writeSettings(); - printf("created %s with default settings:\nICON:evolution\nLANG:default\nAPP:%s\nICS:%s\n\n", + printf("created %s with default settings:\nICON:evolution\nLANG:default\nAPP:%s\nICS:%s\n\n", rcfile, application, icsfile ); return; } @@ -65,18 +65,18 @@ void getSettings(){ strcpy(icsfile, pch); next = 0; break; - + case 2: strcpy(application, pch); next = 0; break; - + case 3: if(!strcmp(pch, "farsi")) lang = 1; next = 0; break; - + case 4: if(!strcmp(pch, "mozilla")) appicon = 1; @@ -86,13 +86,13 @@ void getSettings(){ appicon = 2; next = 0; break; - + case 5: if(!strcmp(pch,WMCALENDAR_VERSION)) version = 1; next = 0; break; - + case 6: start_of_week = atoi(pch); next = 0; @@ -111,7 +111,7 @@ void getSettings(){ next = 5; else if(!strcmp(pch, "STARTOFWEEK")) next = 6; - else + else next = 0; } pch = strtok (NULL, "=\n"); @@ -124,14 +124,14 @@ void getSettings(){ printf("Old rcfile detected!\nCreated new %s with default settings:", rcfile); printf("\nICON:evolution\nLANG:default\nAPP:%s\nICS:%s\n\n", application, icsfile ); } - if(get_debug())printf("settings:\nICON:%d\nLANG:%d\nAPP:%s\nRC:%s\nICS:%s\n\n", + if(get_debug())printf("settings:\nICON:%d\nLANG:%d\nAPP:%s\nRC:%s\nICS:%s\n\n", getAppicon(), lang, application, rcfile, icsfile ); } /*------------------------------------------------------ - * writeSettings + * writeSettings -----------------------------------------------------*/ void writeSettings(){ char *set = malloc(1024); @@ -162,7 +162,7 @@ void writeSettings(){ strcat(set,"\nVERSION="); strcat(set,WMCALENDAR_VERSION); strcat(set,"\nSTARTOFWEEK="); - sprintf(bufint, "%d",start_of_week); + sprintf(bufint, "%d",start_of_week); strcat(set, bufint); strcat(set,"\n"); fwrite(set, 1, strlen(set), stream); @@ -201,7 +201,7 @@ void SettingsLabel(GtkWidget *box1, char* str){ /*------------------------------------------------------ - * openSettings + * openSettings -----------------------------------------------------*/ void openSettings(){ GtkWidget *window; @@ -236,7 +236,7 @@ void openSettings(){ gtk_container_set_border_width (GTK_CONTAINER (box2), 0); gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 3); gtk_widget_show (box2); - + /* create appicon boxes*/ button = gtk_radio_button_new_with_label (NULL, "Evolution"); gtk_signal_connect_object (GTK_OBJECT (button), "clicked", @@ -272,7 +272,7 @@ void openSettings(){ /* -------------- Applaunch command -----------------------*/ SettingsLabel(box1, "Applaunch command"); - + entry = gtk_entry_new_with_max_length (100); gtk_signal_connect(GTK_OBJECT(entry), "changed", GTK_SIGNAL_FUNC(enter_callback), @@ -323,7 +323,7 @@ void openSettings(){ gtk_menu_append(menu, menuitem); } gtk_menu_set_active(GTK_MENU (menu), 7 - start_of_week); - gtk_option_menu_set_menu(GTK_OPTION_MENU(optionmenu),menu); + gtk_option_menu_set_menu(GTK_OPTION_MENU(optionmenu),menu); gtk_box_pack_start (GTK_BOX (box1), optionmenu, TRUE, TRUE, 5); gtk_widget_show (optionmenu); @@ -337,7 +337,7 @@ void openSettings(){ NULL); gtk_box_pack_start (GTK_BOX (box1), button, TRUE, TRUE, 2); gtk_widget_show (button); - + button = gtk_button_new_with_label ("save"); gtk_signal_connect (GTK_OBJECT (button), "clicked", (GtkSignalFunc) setFirstDay, @@ -360,14 +360,14 @@ void openSettings(){ /*------------------------------------------------------ * setFirstDay -----------------------------------------------------*/ -void setFirstDay(GtkWidget *widget, GtkWidget *optionmenu ){ +void setFirstDay(GtkWidget *widget, GtkWidget *optionmenu ){ gchar *daystring; int ii; gtk_label_get (GTK_LABEL (GTK_BIN (optionmenu)->child), &daystring); for(ii = 1; ii < 8; ii++) if(!strcmp(daystring, daystr[ii])) start_of_week = ii; - + writeSettings(); } @@ -380,8 +380,8 @@ void changeFilename(){ static GtkWidget *settings; settings = gtk_file_selection_new("iCalendar file"); - - gtk_file_selection_set_filename (GTK_FILE_SELECTION(settings), + + gtk_file_selection_set_filename (GTK_FILE_SELECTION(settings), icsfile); /* Connect the ok_button to file_ok_sel function */ gtk_signal_connect(GTK_OBJECT (GTK_FILE_SELECTION (settings)->ok_button), @@ -405,6 +405,6 @@ static void file_ok_sel( GtkWidget *w, GtkFileSelection *fs ) { strcpy(icsfile, gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs))); - gtk_widget_destroy((GtkWidget*)fs); + gtk_widget_destroy((GtkWidget*)fs); writeSettings(); } diff --git a/wmcalendar/Src/wmCalendar.1 b/wmcalendar/Src/wmCalendar.1 index 8bc96e6..6264de0 100644 --- a/wmcalendar/Src/wmCalendar.1 +++ b/wmcalendar/Src/wmCalendar.1 @@ -51,61 +51,61 @@ .ds f2\" .ds f3\" .ds f4\" -'\" t -.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n -.TH "WMCALENDAR" "1" -.SH "NAME" -wmCalendar \(em a calendar dockapp -.SH "SYNOPSIS" -.PP -\fBwmCalendar\fP -.SH "DESCRIPTION" -.PP -This manual page documents briefly the -\fBwmCalendar\fP commands. -.PP -\fBwmCalendar\fP is a calendar dockapp for Windowmaker -and other windowmanagers that support dockapps. It has a monthly view and -an interface to iCalendar files(like Ximian Evolution, Mozilla Calendar or KOrganizer). - -You can change the month by clicking on the red arrows on top or with mousewheel. -With a middle mouseclick you get back to the current month. -With right mouse click on a hightlighted day you get a popup with all events for this day. -With left mouseclick on a day you mark this day (to easily convert a date to a different -calendar system). -.PP -With the blue arrow at the bottom right you can show and hide some special buttons. -From left to right they are: - -Application launch (custumizable icon and command) starts application by doubleclick. - -Calendar switch - switches between G(regorian), P(ersian) and I(slamic) - -Moonphase - shows/hides the moonphases. - -Settings (screwdriver) - opens the settings menu (to change language, application-icon, -application launch command, start of week and ics-file location). -.SH "OPTIONS" -.PP -These programs follow the usual GNU command line syntax, -with long options starting with two dashes (`-'). A summary of -options is included below. For a complete description, see the -\fBInfo\fP files. -.IP "\fB-h\fP \fB--help\fP " 10 -Show summary of options. -.IP "\fB-v\fP \fB--version\fP " 10 -Show version of program. -.IP "\fB-f\fP \fB--farsi\fP " 10 -Show calendar in farsi. -.IP "\fB-d\fP \fB--debug\fP " 10 -enables debug mode. -.SH "AUTHOR" -.PP -This manual page was written by Matthias Laabs mattlaabs@users.sourceforge.net for -the \fBDebian\fP system (but may be used by others). Permission is -granted to copy, distribute and/or modify this document under -the terms of the GNU Free Documentation -License, Version 1.1 or any later version published by the Free -Software Foundation; with no Invariant Sections, no Front-Cover -Texts and no Back-Cover Texts. -...\" created by instant / docbook-to-man, Tue 15 Jul 2003, 14:53 +'\" t +.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n +.TH "WMCALENDAR" "1" +.SH "NAME" +wmCalendar \(em a calendar dockapp +.SH "SYNOPSIS" +.PP +\fBwmCalendar\fP +.SH "DESCRIPTION" +.PP +This manual page documents briefly the +\fBwmCalendar\fP commands. +.PP +\fBwmCalendar\fP is a calendar dockapp for Windowmaker +and other windowmanagers that support dockapps. It has a monthly view and +an interface to iCalendar files(like Ximian Evolution, Mozilla Calendar or KOrganizer). + +You can change the month by clicking on the red arrows on top or with mousewheel. +With a middle mouseclick you get back to the current month. +With right mouse click on a hightlighted day you get a popup with all events for this day. +With left mouseclick on a day you mark this day (to easily convert a date to a different +calendar system). +.PP +With the blue arrow at the bottom right you can show and hide some special buttons. +From left to right they are: + +Application launch (custumizable icon and command) starts application by doubleclick. + +Calendar switch - switches between G(regorian), P(ersian) and I(slamic) + +Moonphase - shows/hides the moonphases. + +Settings (screwdriver) - opens the settings menu (to change language, application-icon, +application launch command, start of week and ics-file location). +.SH "OPTIONS" +.PP +These programs follow the usual GNU command line syntax, +with long options starting with two dashes (`-'). A summary of +options is included below. For a complete description, see the +\fBInfo\fP files. +.IP "\fB-h\fP \fB--help\fP " 10 +Show summary of options. +.IP "\fB-v\fP \fB--version\fP " 10 +Show version of program. +.IP "\fB-f\fP \fB--farsi\fP " 10 +Show calendar in farsi. +.IP "\fB-d\fP \fB--debug\fP " 10 +enables debug mode. +.SH "AUTHOR" +.PP +This manual page was written by Matthias Laabs mattlaabs@users.sourceforge.net for +the \fBDebian\fP system (but may be used by others). Permission is +granted to copy, distribute and/or modify this document under +the terms of the GNU Free Documentation +License, Version 1.1 or any later version published by the Free +Software Foundation; with no Invariant Sections, no Front-Cover +Texts and no Back-Cover Texts. +...\" created by instant / docbook-to-man, Tue 15 Jul 2003, 14:53 diff --git a/wmcalendar/Src/wmCalendar.c b/wmcalendar/Src/wmCalendar.c index bf5640b..39496a9 100644 --- a/wmcalendar/Src/wmCalendar.c +++ b/wmcalendar/Src/wmCalendar.c @@ -1,16 +1,16 @@ /*------------------------------------------------------ * - * wmCalendar (c)2003 Matthias Laabs + * wmCalendar (c)2003 Matthias Laabs * * mattlaabs@users.sourceforge.net - * + * * a calendar dockapp -----------------------------------------------------*/ #include "wmCalendar.h" - + /*------------------------------------------------------ - * main + * main -----------------------------------------------------*/ int main(int argc, char *argv[]) { @@ -48,10 +48,10 @@ int main(int argc, char *argv[]) -----------------------------------------------------*/ void draw() { - + blankScreen(); drawButtons(); - drawDays(); + drawDays(); drawMonthYear(); } @@ -68,13 +68,13 @@ void initValues(){ class_hints.res_name="wmCalendar"; class_hints.res_class="wmCalendar"; /* Compute widths of months and digits */ - for(i = 0; i < 12; ++i) + for(i = 0; i < 12; ++i) for( j = 0; j < 6; ++j) xdMonth[j][i] = xeMonth[j][i] - xsMonth[j][i] + 1; - for(i = 0; i < 12; ++i) + for(i = 0; i < 12; ++i) for( j = 0; j < 2; ++j) xdYear[j][i] = xeYear[j][i] - xsYear[j][i] + 1; - for(i = 0; i < MAXBUTTON; ++i) + for(i = 0; i < MAXBUTTON; ++i) xdButton[i] = xeButton[i] - xsButton[i] + 1; dockapp_set_eventmask(); @@ -82,8 +82,8 @@ void initValues(){ dockapp_xpm2pixmap( wmCalendar_master_xpm, &bg[0], &mask, colors, 0); pixmap = dockapp_XCreatePixmap(64, 64); dockapp_setshape(mask, 0, 0); - if(mask) - XFreePixmap(display, mask); + if(mask) + XFreePixmap(display, mask); dockapp_set_background(pixmap); dockapp_show(); } @@ -136,7 +136,7 @@ int getClickedButton(int bx, int by) if(bx < 46 && bx > 37 && by > 55) /* toggle gregorian/persian/... */ return BT_MOON ; else if(bx < 52 && bx > 46 && by > 55) /* open settings dialog */ - return BT_SETTINGS; + return BT_SETTINGS; else if(bx < 37 && bx > 28 && by > 55) /* toggle moonphase on/off */ return BT_CALTYPE; else if(bx < 28 && bx > 19 && by > 55) /* start calendar application */ @@ -148,7 +148,7 @@ int getClickedButton(int bx, int by) /*------------------------------------------------------ - * ButtonPressEvent + * ButtonPressEvent -----------------------------------------------------*/ void buttonPress(int btype, int bx, int by, long etime){ char* applaunch; @@ -160,7 +160,7 @@ void buttonPress(int btype, int bx, int by, long etime){ case BT_BACK: /* arrow left : month back*/ monthOffset--; break; - + case BT_FORWARD: /* arrow right : month forward*/ monthOffset++; break; @@ -178,7 +178,7 @@ void buttonPress(int btype, int bx, int by, long etime){ break; case BT_SETTINGS: /* open settings dialog */ - openSettings(); + openSettings(); break; case BT_APP: /* start calendar application */ @@ -223,27 +223,27 @@ void buttonPress(int btype, int bx, int by, long etime){ showDay(tgr); break; } - + told.month = 0; /* invalid month -> forces clearScreen at next draw*/ } - + /*------------------------------------------------------ - * ParseCMDLine + * ParseCMDLine -----------------------------------------------------*/ void ParseCMDLine(int argc, char *argv[]){ int i; - + for (i = 1; i < argc; i++){ if (!strcmp(argv[i], "--version") || !strcmp(argv[i], "-v")){ printf("wmCalendar %s\n", getVersion()); exit(1); - } + } else if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "-h")){ print_usage(); exit(1); - } + } else if (!strcmp(argv[i], "--farsi") || !strcmp(argv[i], "-f")) set_lang(1); else if (!strcmp(argv[i], "--persian") || !strcmp(argv[i], "-p")) @@ -260,7 +260,7 @@ void ParseCMDLine(int argc, char *argv[]){ /*------------------------------------------------------ - * print_usage + * print_usage -----------------------------------------------------*/ void print_usage() { @@ -283,7 +283,7 @@ void print_usage() /*------------------------------------------------------ - * getTime + * getTime -----------------------------------------------------*/ void getTime(){ struct tm *Time; @@ -317,7 +317,7 @@ void getTime(){ /*------------------------------------------------------ - * drawMonthYear + * drawMonthYear -----------------------------------------------------*/ void drawMonthYear(){ int xoff, yoff; @@ -332,12 +332,12 @@ void drawMonthYear(){ Year1 = (t.year - Year4 - 10 * Year3 - 100 * Year2) / 1000; xoff = 30 - (xdMonth[monthset][t.month-1] + xdYear[get_lang()][Year3] + xdYear[get_lang()][Year4]) / 2; - + /* draw Month */ - dockapp_copyarea(bg[1], pixmap, xsMonth[monthset][t.month - 1], yMonth[monthset], + dockapp_copyarea(bg[1], pixmap, xsMonth[monthset][t.month - 1], yMonth[monthset], xdMonth[monthset][t.month - 1], ydMonth, xoff, yoff); xoff += xdMonth[monthset][t.month - 1] + 3; - + /* draw Year 3rd and 4th digit */ dockapp_copyarea(bg[1], pixmap,xsYear[get_lang()][Year3], yYear, xdYear[get_lang()][Year3], ydYear, xoff, yoff); xoff += xdYear[get_lang()][Year3]; @@ -363,7 +363,7 @@ void drawButtons(){ } else drawButton(ARROW_OPEN, xoff, yoff); - + dockapp_copy2window(pixmap); } @@ -382,7 +382,7 @@ int drawButton(int btype, int xoff, int yoff){ /*------------------------------------------------------ - * drawDays + * drawDays -----------------------------------------------------*/ void drawDays() { @@ -390,10 +390,10 @@ void drawDays() int amount, startday; int moonphase = 0; int yoff = 20; - + tgr = t; tgr.day = 1; - + tgr = get_civil(tgr, calendartype); amount = days_in_month(t.month, t.year, calendartype); startday = (day_of_week(tgr) + get_start_of_week()) % 7; @@ -401,49 +401,49 @@ void drawDays() dayOfWeek = (startday + i) % 7; if((dayOfWeek == 0) && (i != 1)) yoff += 7; /* increase y-offset on Monday except it is day #1*/ - + tgr = t; tgr.day = i; tgr = get_civil(tgr, calendartype); - + if(showmoon) moonphase = moon(tgr); - + if(daysEqual(tgr, mark)) drawNumber(i, yoff, dayOfWeek, 3, 0); else if(moonphase == 0 || !showmoon) /* draw number */ drawNumber(i, yoff, dayOfWeek, getDayType(tgr), daysEqual(tgr, today)); else /* draw moonphase */ - dockapp_copyarea(bg[0], pixmap, xsMoon[moonphase - 1], yMoon, xdMoon, ydMoon, + dockapp_copyarea(bg[0], pixmap, xsMoon[moonphase - 1], yMoon, xdMoon, ydMoon, dayOfWeek * 9, yoff); } - + dockapp_copy2window(pixmap); } /*------------------------------------------------------ - * drawNumber + * drawNumber -----------------------------------------------------*/ void drawNumber(int number,int yoff, int dayOfWeek, int type, int today){ int digit1, digit2; int offset; offset = yNumbers + 20 * type + 10 * today; - if(number < 10){ /* draw single digit numbers*/ - dockapp_copyarea(bg[0], pixmap, xeNumbers[get_lang()][1] - 5, offset, 2, ydNumbers, + if(number < 10){ /* draw single digit numbers*/ + dockapp_copyarea(bg[0], pixmap, xeNumbers[get_lang()][1] - 5, offset, 2, ydNumbers, dayOfWeek * 9, yoff); - dockapp_copyarea(bg[0], pixmap, xeNumbers[get_lang()][1] - 5, offset, 2, ydNumbers, + dockapp_copyarea(bg[0], pixmap, xeNumbers[get_lang()][1] - 5, offset, 2, ydNumbers, dayOfWeek * 9 + 7, yoff); - dockapp_copyarea(bg[0], pixmap, xeNumbers[get_lang()][number], offset, xdNumbers, ydNumbers, + dockapp_copyarea(bg[0], pixmap, xeNumbers[get_lang()][number], offset, xdNumbers, ydNumbers, dayOfWeek * 9 + 2, yoff); } else{ /* draw double digit numbers*/ digit2 = number % 10; digit1 = (number - digit2) / 10; - dockapp_copyarea(bg[0], pixmap, xeNumbers[get_lang()][digit1], offset, xdNumbers, ydNumbers, + dockapp_copyarea(bg[0], pixmap, xeNumbers[get_lang()][digit1], offset, xdNumbers, ydNumbers, dayOfWeek * 9, yoff); - dockapp_copyarea(bg[0], pixmap, xeNumbers[get_lang()][digit2], offset, xdNumbers, ydNumbers, + dockapp_copyarea(bg[0], pixmap, xeNumbers[get_lang()][digit2], offset, xdNumbers, ydNumbers, dayOfWeek * 9 + 4, yoff); } } @@ -451,7 +451,7 @@ void drawNumber(int number,int yoff, int dayOfWeek, int type, int today){ /*------------------------------------------------------ - * processXEvents + * processXEvents -----------------------------------------------------*/ int processXEvents() { @@ -470,10 +470,10 @@ int processXEvents() /*------------------------------------------------------ - * blankScreen + * blankScreen -----------------------------------------------------*/ void blankScreen() -{ +{ if(daysEqual(t, told)) return; /* only neccessary if day has changed*/ diff --git a/wmcalendar/Src/wmCalendar.h b/wmcalendar/Src/wmCalendar.h index 81069a2..0c15c3b 100644 --- a/wmcalendar/Src/wmCalendar.h +++ b/wmcalendar/Src/wmCalendar.h @@ -1,14 +1,14 @@ /* * * wmCalendar (c)2003 Matthias Laabs mattlaabs@users.sourceforge.net - * + * * A Dockapp Calendar - * + * * * * This code is based on: * wmCalClock-1.25 (C) 1998, 1999 Mike Henderson (mghenderson@lanl.gov) - * + * * * * This program is free software; you can redistribute it and/or modify @@ -23,7 +23,7 @@ * * You should have received a copy of the GNU General Public License * along with this program (see the file COPYING); if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA * * diff --git a/wmcalendar/TODO b/wmcalendar/TODO index 4c9bd96..dad3efe 100644 --- a/wmcalendar/TODO +++ b/wmcalendar/TODO @@ -7,6 +7,6 @@ custom colors - + diff --git a/wmckgmail/INSTALL b/wmckgmail/INSTALL index d0da3dc..38579d6 100644 --- a/wmckgmail/INSTALL +++ b/wmckgmail/INSTALL @@ -19,25 +19,25 @@ To install the man pages (in /usr/local/man/man1), run : "make install-man" *** CONFIGURATION *** ********************* -The wmckgmail program is independent for each user. To be able to use it, you +The wmckgmail program is independent for each user. To be able to use it, you need to create a folder in the user home directory ($HOME/.wmckgmail). In this folder, you need to create the configuration file ($HOME/.wmckgmail/config). -This configuration file works in " " pairs. There is two mandatory +This configuration file works in " " pairs. There is two mandatory entries that needs to be defined : uname pass -There is also an optional parameter used to define the interval (in seconds) -between each new emails verification. If you don't define this value, a default +There is also an optional parameter used to define the interval (in seconds) +between each new emails verification. If you don't define this value, a default of 300 seconds (5 minutes) will be used. pollinterval --- WARNING --- -It is strongly recommended to set the permissions on the configuration file to -something like "600" or "400" as your gmail account password is clearly written +It is strongly recommended to set the permissions on the configuration file to +something like "600" or "400" as your gmail account password is clearly written into it. diff --git a/wmckgmail/README b/wmckgmail/README index d14f351..357a5c3 100644 --- a/wmckgmail/README +++ b/wmckgmail/README @@ -6,17 +6,17 @@ release date : September 09, 2006 *** DESCRIPTION *** ******************* -wmckgmail is a very simple program used to monitor the number of unread mails -in a gmail inbox. It uses the wget command to get the gmail atom feed and reads -the number of new mails from this feed. It is a dockapp that is supported by X -window managers such as Window Maker, AfterStep, BlackBox, Fluxbox and +wmckgmail is a very simple program used to monitor the number of unread mails +in a gmail inbox. It uses the wget command to get the gmail atom feed and reads +the number of new mails from this feed. It is a dockapp that is supported by X +window managers such as Window Maker, AfterStep, BlackBox, Fluxbox and Enlightenment. -This dockapp is quite simple. It contains the gmail M icon and a small counter. -When the program is unable to access gmail, the counter shows the "ERR" string -and the M icon is greyed. When gmail is accessible and your configuration file -contains a valid username/password combo, the counter indicate the number of -new mails in the gmail inbox. If there is no unread mails in the gmail inbox, +This dockapp is quite simple. It contains the gmail M icon and a small counter. +When the program is unable to access gmail, the counter shows the "ERR" string +and the M icon is greyed. When gmail is accessible and your configuration file +contains a valid username/password combo, the counter indicate the number of +new mails in the gmail inbox. If there is no unread mails in the gmail inbox, the M icon stays greyed. If there is unread mails in the gmail inbox, the M iconthen takes its real colors and the counter indicates the number of unread mails. *************** @@ -33,8 +33,8 @@ This program needs a configuration file to work. This file must be found as: $HOME/.wmckgmail/config -This configuration file contains " " parameters. There is some -mandatory parameters that requires to be defined in this file in order to make +This configuration file contains " " parameters. There is some +mandatory parameters that requires to be defined in this file in order to make the program work: uname @@ -43,14 +43,14 @@ the program work: pass Set the password of the gmail mailbox to monitor -There is also optional parameters: +There is also optional parameters: pollinterval - Used to define the interval between each verification of new incoming mails. If you do + Used to define the interval between each verification of new incoming mails. If you do not define this parameter, it will be set to a default value of 300 seconds (5 minutes). browsercmd1 - Used to define the command to launch when clicking on the 'big M'. + Used to define the command to launch when clicking on the 'big M'. Example configuration line: 'browsercmd1 mozilla -remote "openURL(http://www.gmail.com)"' browsercmd2 @@ -60,7 +60,7 @@ There is also optional parameters: -- WARNINGS -- -- It is very recommended to set the configuration file permissions to "600" or +- It is very recommended to set the configuration file permissions to "600" or "400" as your mailbox password is clearly written in this file. - When defining 'browsercmd1' or 'browsercmd2', verify if the command you launch returns immediately @@ -71,7 +71,7 @@ to launch the command in background like in the 'browsercmd2' example configurat *** THANKS *** ************** -Thanks to the author of the wmgeneral code, it has been a really good starting +Thanks to the author of the wmgeneral code, it has been a really good starting base to develop this little application. ************** diff --git a/wmckgmail/wmckgmail/wmckgmail.1 b/wmckgmail/wmckgmail/wmckgmail.1 index b52d81d..8850c5d 100644 --- a/wmckgmail/wmckgmail/wmckgmail.1 +++ b/wmckgmail/wmckgmail/wmckgmail.1 @@ -23,14 +23,14 @@ This manual page documents briefly the command. .PP .\" TeX users may be more comfortable with the \fB\fP and -.\" \fI\fP escape sequences to invode bold face and italics, +.\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. -\fBwmckgmail\fP is a very simple program used to monitor the number of unread mails -in a gmail inbox. It uses the +\fBwmckgmail\fP is a very simple program used to monitor the number of unread mails +in a gmail inbox. It uses the .B wget command to get the gmail .B atom -feed and reads the number of new mails from this feed. It is a dockapp +feed and reads the number of new mails from this feed. It is a dockapp that is supported by X window managers such as Window Maker, AfterStep, BlackBox, Fluxbox and Enlightenment. @@ -87,5 +87,5 @@ Thanks to the author of the code, it has been a really good starting base to develop this little application. .SH AUTHOR -.B wmckgmail +.B wmckgmail has been written by Sylvain Tremblay diff --git a/wmckgmail/wmckgmail/wmckgmail.c b/wmckgmail/wmckgmail/wmckgmail.c index a98c8b7..66b7381 100644 --- a/wmckgmail/wmckgmail/wmckgmail.c +++ b/wmckgmail/wmckgmail/wmckgmail.c @@ -43,12 +43,12 @@ void trace(char *sMsg); int getNewMailsCount(char *sAtomFilePath); void getAtomFile(void); void initialize(void); - + /* -------------------- */ /* Global variables */ /* -------------------- */ char wmckgmail_mask_bits[64*64]; /* matrix for the XPM */ -int wmckgmail_mask_width = 64; +int wmckgmail_mask_width = 64; int wmckgmail_mask_height = 64; char sWorkDir[1024]; /* to store the directory where wmckgmail works */ char sHomeDir[1024]; /* to store the home directory of the user */ @@ -79,7 +79,7 @@ int main(int argc, char **argv){ createXBMfromXPM(wmckgmail_mask_bits, wmckgmail, wmckgmail_mask_width, wmckgmail_mask_height); openXwindow(argc, argv, wmckgmail, wmckgmail_mask_bits, wmckgmail_mask_width, wmckgmail_mask_height); - + /* Define the mouse regions */ AddMouseRegion(BIG_M_, 16, 9, 46, 31); @@ -96,7 +96,7 @@ int main(int argc, char **argv){ while(1){ RedrawWindow(); - + /* Update every iPollInterval seconds */ if((time(NULL) - lastPoll) >= (time_t) iPollInterval){ getAtomFile(); @@ -114,7 +114,7 @@ int main(int argc, char **argv){ case DestroyNotify: XCloseDisplay(display); - exit(0); + exit(0); case ButtonPress: i = CheckMouseRegion(Event.xbutton.x, Event.xbutton.y); @@ -125,7 +125,7 @@ int main(int argc, char **argv){ case ButtonRelease: i = CheckMouseRegion(Event.xbutton.x, Event.xbutton.y); if(but_stat == i && but_stat >= 0){ - + sprintf(sMsg, "button released! region index is: %i\n", i); trace(sMsg); switch(but_stat){ @@ -142,7 +142,7 @@ int main(int argc, char **argv){ system(sBrowserCmd2); } } else { - trace("Command succed (returned 0)\n"); + trace("Command succed (returned 0)\n"); } } else { trace("No browsercmd1 nor browsercmd2 defined, nothing to do.\n"); @@ -236,7 +236,7 @@ void writeChar(char cTheChar, int iWhichWindow, int iPos){ if(iLetterIdx < 0 || iLetterIdx > 25){ return; } - + /* Let's write this letter at the right place! */ copyXPMArea((iSrcX + (iLetterIdx * iWidth)), iSrcY, iWidth, iHeight, (iDestX + (iPos * iWidth)), iDestY); } @@ -292,7 +292,7 @@ void writeNum(char cTheNum, int iWhichWindow, int iPos){ if(iNumberIdx < 0 || iNumberIdx > 9){ return; } - + /* Let's write this letter at the right place! */ copyXPMArea((iSrcX + (iNumberIdx * iWidth)), iSrcY, iWidth, iHeight, (iDestX + (iPos * iWidth)), iDestY); } @@ -361,7 +361,7 @@ int getNewMailsCount(char *sAtomFilePath){ strncpy(sNewMails, sAtomBufferPtr1 + 11, iLength); sNewMails[iLength] = '\0'; sprintf(sMsg, "New mails count : %s\n", sNewMails); trace(sMsg); - + /* for the return value... not really used but who knows the future... :P */ iNewMails = atoi(sNewMails); @@ -417,7 +417,7 @@ void getAtomFile(void){ iRcFileExists = 1; trace("The .wgetrc file exists, move it temporarily\n"); sprintf(sBuff, "%s/.wgetrc", sWorkDir); - rename(sWgetRcFile, sBuff); + rename(sWgetRcFile, sBuff); } else { trace("No .wgetrc file found, good thing! :P\n"); } @@ -435,15 +435,15 @@ void getAtomFile(void){ /* prepare the WGET call (supress output when not in debugging mode) */ if(DEBUG){ - sprintf(sBuff, + sprintf(sBuff, "wget --no-check-certificate https://mail.google.com/mail/feed/atom -O %s/atom", sWorkDir); } else { - sprintf(sBuff, - "wget -q --no-check-certificate https://mail.google.com/mail/feed/atom -O %s/atom", + sprintf(sBuff, + "wget -q --no-check-certificate https://mail.google.com/mail/feed/atom -O %s/atom", sWorkDir); } - + /* call wget */ iWgetRC = system(sBuff); @@ -508,7 +508,7 @@ void initialize(void){ if(fCfgFile == NULL){ /* config file not found, abort the program */ sprintf(sMsg, "** ERROR ** Cannot open config file : \"%s\"\n Program aborted.", sConfigFile); - printf("\n%s\n\n", sMsg); + printf("\n%s\n\n", sMsg); exit(1); } else { @@ -522,8 +522,8 @@ void initialize(void){ sprintf(sMsg, " Attribute : %s\n Value : %s\n", sAttr, sVal); trace(sMsg); if(!strcmp(sAttr, "uname")){ - strcpy(sUname, sVal); - trace(" * Got username!\n"); + strcpy(sUname, sVal); + trace(" * Got username!\n"); } else if(!strcmp(sAttr, "pass")){ strcpy(sPass, sVal); trace(" * Got password!\n"); @@ -531,7 +531,7 @@ void initialize(void){ trace(" * Got poll interval!\n"); iPollInterval = atoi(sVal); if(iPollInterval < 1 || iPollInterval > 6000) { - trace(" - Warning - Value not understood, setting to 60 seconds\n"); + trace(" - Warning - Value not understood, setting to 60 seconds\n"); iPollInterval = 300; } else { strcpy(sPollInterval, sVal); @@ -549,10 +549,10 @@ void initialize(void){ if((ptr + 1)[0] == '@'){ /*system("mozilla -remote \"openURL(http://www.gmail.com)\"");*/ trace(" Found '@' ! let's replace it by http://www.gmail.com\n"); - strncpy(sBrowserCmd1, (sBuff + (strlen(sAttr) + 1)), + strncpy(sBrowserCmd1, (sBuff + (strlen(sAttr) + 1)), ((ptr - 1) - (sBuff + strlen(sAttr)))); sBrowserCmd1[ptr - sBuff] = '\0'; - sprintf(sBrowserCmd1, "%s%s%s", sBrowserCmd1, "http://www.gmail.com", + sprintf(sBrowserCmd1, "%s%s%s", sBrowserCmd1, "http://www.gmail.com", sBuff + strlen(sBrowserCmd1) + strlen(sAttr) + 3); } else { strcpy(sBrowserCmd1, ptr); @@ -575,10 +575,10 @@ void initialize(void){ if((ptr + 1)[0] == '@'){ /*system("mozilla -remote \"openURL(http://www.gmail.com)\"");*/ trace(" Found '@' ! let's replace it by http://www.gmail.com\n"); - strncpy(sBrowserCmd2, (sBuff + (strlen(sAttr) + 1)), + strncpy(sBrowserCmd2, (sBuff + (strlen(sAttr) + 1)), ((ptr - 1) - (sBuff + strlen(sAttr)))); sBrowserCmd2[ptr - sBuff] = '\0'; - sprintf(sBrowserCmd2, "%s%s%s", sBrowserCmd2, "http://www.gmail.com", + sprintf(sBrowserCmd2, "%s%s%s", sBrowserCmd2, "http://www.gmail.com", sBuff + strlen(sBrowserCmd2) + strlen(sAttr) + 3); } else { strcpy(sBrowserCmd2, ptr); @@ -593,7 +593,7 @@ void initialize(void){ } iGetLineRes = getline(&sBuff, &len, fCfgFile); - } + } trace("\n"); /* Verify that we got all the required parameters from the config file */ diff --git a/wmckgmail/wmgeneral/list.c b/wmckgmail/wmgeneral/list.c index be7464f..a63562f 100644 --- a/wmckgmail/wmgeneral/list.c +++ b/wmckgmail/wmgeneral/list.c @@ -1,11 +1,11 @@ -/* Generic single linked list to keep various information +/* Generic single linked list to keep various information Copyright (C) 1993, 1994 Free Software Foundation, Inc. Author: Kresten Krab Thorup Many modifications by Alfredo K. Kojima - + This file is part of GNU CC. @@ -38,7 +38,7 @@ Boston, MA 02110-1301 USA. */ /* Return a cons cell produced from (head . tail) */ -INLINE LinkedList* +INLINE LinkedList* list_cons(void* head, LinkedList* tail) { LinkedList* cell; @@ -63,7 +63,7 @@ list_length(LinkedList* list) return i; } -/* Return the Nth element of LIST, where N count from zero. If N +/* Return the Nth element of LIST, where N count from zero. If N larger than the list length, NULL is returned */ INLINE void* @@ -84,7 +84,7 @@ list_nth(int index, LinkedList* list) INLINE void list_remove_head(LinkedList** list) { - if (!*list) return; + if (!*list) return; if ((*list)->tail) { LinkedList* tail = (*list)->tail; /* fetch next */ @@ -116,7 +116,7 @@ INLINE LinkedList * list_remove_elem(LinkedList* list, void* elem) { LinkedList *tmp; - + if (list) { if (list->head == elem) { tmp = list->tail; diff --git a/wmckgmail/wmgeneral/list.h b/wmckgmail/wmgeneral/list.h index 4b6b86f..92c3454 100644 --- a/wmckgmail/wmgeneral/list.h +++ b/wmckgmail/wmgeneral/list.h @@ -1,4 +1,4 @@ -/* Generic single linked list to keep various information +/* Generic single linked list to keep various information Copyright (C) 1993, 1994 Free Software Foundation, Inc. Author: Kresten Krab Thorup diff --git a/wmckgmail/wmgeneral/misc.c b/wmckgmail/wmgeneral/misc.c index f86481e..1f3bb2e 100644 --- a/wmckgmail/wmgeneral/misc.c +++ b/wmckgmail/wmgeneral/misc.c @@ -1,9 +1,9 @@ /* dock.c- built-in Dock module for WindowMaker - * + * * WindowMaker window manager - * + * * Copyright (c) 1997 Alfredo K. Kojima - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -28,7 +28,7 @@ *---------------------------------------------------------------------- * parse_command-- * Divides a command line into a argv/argc pair. - *---------------------------------------------------------------------- + *---------------------------------------------------------------------- */ #define PRC_ALPHA 0 #define PRC_BLANK 1 @@ -64,11 +64,11 @@ next_token(char *word, char **next) t = ret = malloc(strlen(word)+1); ptr = word; - + state = 0; *t = 0; while (1) { - if (*ptr==0) + if (*ptr==0) ctype = PRC_EOS; else if (*ptr=='\\') ctype = PRC_ESCAPE; @@ -98,12 +98,12 @@ next_token(char *word, char **next) t = strdup(ret); free(ret); - + if (ctype==PRC_EOS) *next = NULL; else *next = ptr; - + return t; } @@ -118,7 +118,7 @@ parse_command(char *command, char ***argv, int *argc) line = command; do { token = next_token(line, &line); - if (token) { + if (token) { list = list_cons(token, list); } } while (token!=NULL && line!=NULL); @@ -141,15 +141,15 @@ execCommand(char *command) int argc; parse_command(command, &argv, &argc); - + if (argv==NULL) { return 0; } - + if ((pid=fork())==0) { char **args; int i; - + args = malloc(sizeof(char*)*(argc+1)); if (!args) exit(10); diff --git a/wmckgmail/wmgeneral/wmgeneral.c b/wmckgmail/wmgeneral/wmgeneral.c index 56b7bd6..c064b39 100644 --- a/wmckgmail/wmgeneral/wmgeneral.c +++ b/wmckgmail/wmgeneral/wmgeneral.c @@ -17,7 +17,7 @@ * Now supports >256 colors 11/09/1998 (Martijn Pieterse, pieterse@xs4all.nl) * Removed a bug from parse_rcfile. You could - not use "start" in a command if a label was + not use "start" in a command if a label was also start. * Changed the needed geometry string. We don't use window size, and don't support @@ -177,7 +177,7 @@ static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) { err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap), &(wmgen->mask), &(wmgen->attributes)); - + if (err != XpmSuccess) { fprintf(stderr, "Not enough free colorcells.\n"); exit(1); @@ -224,9 +224,9 @@ static int flush_expose(Window w) { \*******************************************************************************/ void RedrawWindow(void) { - + flush_expose(iconwin); - XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, + 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, @@ -238,9 +238,9 @@ void RedrawWindow(void) { \*******************************************************************************/ void RedrawWindowXY(int x, int y) { - + flush_expose(iconwin); - XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, + 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, @@ -296,7 +296,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) { unsigned char bwrite; int bcount; int curpixel; - + sscanf(*xpm, "%d %d %d %d", &width, &height, &numcol, &depth); @@ -305,7 +305,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) { zero <<=8; zero |= xpm[1][k]; } - + for (i=numcol+1; i < numcol+sy+1; i++) { bcount = 0; bwrite = 0; @@ -318,7 +318,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) { curpixel <<=8; curpixel |= xpm[i][j+k]; } - + if ( curpixel != zero ) { bwrite += 128; } @@ -394,7 +394,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit } if (!(display = XOpenDisplay(display_name))) { - fprintf(stderr, "%s: can't open display %s\n", + fprintf(stderr, "%s: can't open display %s\n", wname, XDisplayName(display_name)); exit(1); } @@ -419,10 +419,10 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit 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); @@ -443,7 +443,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit XSetWMName(display, win, &name); /* Create GC for drawing */ - + gcm = GCForeground | GCBackground | GCGraphicsExposures; gcv.foreground = fore_pix; gcv.background = back_pix; diff --git a/wmcpuload/ChangeLog b/wmcpuload/ChangeLog index 33c212c..58a3b48 100644 --- a/wmcpuload/ChangeLog +++ b/wmcpuload/ChangeLog @@ -165,7 +165,7 @@ 2001 July 23 * version 0.5.6 released - * changed to get rid of compiler warning messages with gcc + * changed to get rid of compiler warning messages with gcc on Linux and FreeBSD. * added OpenBSD support (it's testing!!) (john katagawa ) diff --git a/wmcpuload/doc/wmcpuload.1 b/wmcpuload/doc/wmcpuload.1 index 4405f4b..41e1b2e 100644 --- a/wmcpuload/doc/wmcpuload.1 +++ b/wmcpuload/doc/wmcpuload.1 @@ -26,7 +26,7 @@ command. This manual page was written for the Debian GNU/Linux distribution. .PP .\" TeX users may be more comfortable with the \fB\fP and -.\" \fI\fP escape sequences to invode bold face and italics, +.\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. \fBWMCPULoad\fP is a dockapp that is supported by X window managers such as Window Maker, AfterStep, BlackBox, and Enlightenment. It displays the current diff --git a/wmcpuload/src/cpu_linux.c b/wmcpuload/src/cpu_linux.c index c0ec523..879996c 100644 --- a/wmcpuload/src/cpu_linux.c +++ b/wmcpuload/src/cpu_linux.c @@ -64,7 +64,7 @@ cpu_get_usage(cpu_options *opts) fprintf (stderr, "MAX CPU number that can be running in SMP is %d\n", NR_CPUS - 1); exit(1); } - + for (i = 0; i <= opts->cpu_number; i++) { fscanf(fp, "%s %d %d %d %d", cpu_name, &cpu, &nice, &system, &idle); if (strncmp(cpu_name, "cpu", 3)){ diff --git a/wmcpuload/src/cpu_netbsd.c b/wmcpuload/src/cpu_netbsd.c index 04dc157..ca339f2 100644 --- a/wmcpuload/src/cpu_netbsd.c +++ b/wmcpuload/src/cpu_netbsd.c @@ -1,5 +1,5 @@ /* - * cpu_netbsd - module to get cpu usage, for NetBSD + * cpu_netbsd - module to get cpu usage, for NetBSD * * This code is based on cpu_openbsd.c * diff --git a/wmfemon/makefile b/wmfemon/makefile index 080b40a..0a26dff 100644 --- a/wmfemon/makefile +++ b/wmfemon/makefile @@ -1,6 +1,6 @@ CC = gcc #OPT = -pg -g -DPRO -OPT = -O3 -fomit-frame-pointer +OPT = -O3 -fomit-frame-pointer CFLAGS = $(OPT) -Wall -I/usr/X11R6/include LDFLAGS = $(OPT) -L/usr/X11R6/lib -lX11 -lXpm -lXext diff --git a/wmfemon/wmfemon.c b/wmfemon/wmfemon.c index 421af98..1c0ada5 100644 --- a/wmfemon/wmfemon.c +++ b/wmfemon/wmfemon.c @@ -16,7 +16,7 @@ #include #include - #include + #include #include #include @@ -58,7 +58,7 @@ XWindowAttributes xwattr; char a[250]; XTextItem xti; int freq; - + ioctl(fefd, FE_READ_STATUS, &status); ioctl(fefd, FE_READ_SIGNAL_STRENGTH, &signal); ioctl(fefd, FE_READ_SNR, &snr); @@ -121,7 +121,7 @@ XWindowAttributes xwattr; char a[250]; XTextItem xti; int freq; - + ioctl(fefd, FE_READ_STATUS, &status); ioctl(fefd, FE_READ_SIGNAL_STRENGTH, &signal); ioctl(fefd, FE_READ_SNR, &snr); @@ -214,13 +214,13 @@ if (!XD) { fprintf(stderr, "Default Display acilamadi.\n"); return 1; } W1 = XCreateSimpleWindow(XD, DefaultRootWindow(XD),0, 0, 64, 64, 1, 50, getcolor("yellow")); Wicon = XCreateSimpleWindow(XD, W1, 0, 0, 60, 60, 1, 50, getcolor("darkgreen")); -wmhints.initial_state = WithdrawnState; -wmhints.icon_window = Wicon; -wmhints.icon_x = 64; -wmhints.icon_y = 64; -wmhints.window_group = W1; +wmhints.initial_state = WithdrawnState; +wmhints.icon_window = Wicon; +wmhints.icon_x = 64; +wmhints.icon_y = 64; +wmhints.window_group = W1; wmhints.flags = StateHint | IconWindowHint | IconPositionHint | WindowGroupHint; -XSetWMHints(XD, W1, &wmhints); +XSetWMHints(XD, W1, &wmhints); XMapWindow(XD, W1); @@ -254,7 +254,7 @@ if (z < 0) { perror("ERR ioctl FE_GET_INFO:"); close(fefd); return 0;} while (XPending(XD)) { XNextEvent(XD, &event); - switch (event.type) + switch (event.type) { case Expose: /* update */ @@ -272,14 +272,14 @@ if (z < 0) { perror("ERR ioctl FE_GET_INFO:"); close(fefd); return 0;} #endif break; case UnmapNotify: - fprintf(stderr,"UnmapNotify geldi.\n"); + fprintf(stderr,"UnmapNotify geldi.\n"); break; case DestroyNotify: fprintf(stderr,"DestroyNotify geldi.\n"); XCloseDisplay(XD); exit(0); break; - case ClientMessage: + case ClientMessage: //Kapat tusu icin amma yarak isler lazim ulan. wmclockmon dockapp.c'den alinti. //printf("ClientMessage\n");fflush(stdout); if (event.xclient.data.l[0] == delete_win) { @@ -306,17 +306,17 @@ if (z < 0) { perror("ERR ioctl FE_GET_INFO:"); close(fefd); return 0;} } break; } - } + } if (bekle == 0) xmon(fefd); bekle++; bekle %= 10; // 10 modulu. W1 1000 ms. - if (W2) + if (W2) { if (bekle2 == 0) xmon_W2(fefd); bekle2++; bekle2 %= 3; // 3 modulu. W2 biraz daha hizli gostersin. 300 ms. } usleep(100000L); - } //while + } //while return 0; } diff --git a/wmfu/Makefile b/wmfu/Makefile index ddab39f..04efff2 100644 --- a/wmfu/Makefile +++ b/wmfu/Makefile @@ -27,7 +27,7 @@ LD = gcc LDFLAGS = -L/usr/X11R6/lib LDFLAGS += -s -LDLIBS = -lXpm -lXext -lX11 +LDLIBS = -lXpm -lXext -lX11 SOURCES = \ dockapp.c \ diff --git a/wmfu/extra/Makefile b/wmfu/extra/Makefile index 5423d5a..c04ccd4 100644 --- a/wmfu/extra/Makefile +++ b/wmfu/extra/Makefile @@ -25,7 +25,7 @@ LD = gcc LDFLAGS = -L/usr/X11R6/lib LDFLAGS += -s -LDLIBS = -lXpm -lXext -lX11 +LDLIBS = -lXpm -lXext -lX11 SOURCES = \ xhookey.c \ diff --git a/wmfu/list.h b/wmfu/list.h index 4a19b7a..c1296d3 100644 --- a/wmfu/list.h +++ b/wmfu/list.h @@ -108,19 +108,19 @@ do { \ /** * Test whether element is at end of the list. - * + * * \param list list. * \param elem element. - * + * * \return non-zero if element is at end of list, or zero otherwise. */ #define list_at_end(list, elem) ((elem) == (list)) /** * Test if a list is empty. - * + * * \param list list. - * + * * \return non-zero if list empty, or zero otherwise. */ #define list_is_empty(list) ((list)->next == (list)) @@ -142,7 +142,7 @@ do { \ * * Same as #foreach but lets you unlink the current value during a list * traversal. Useful for freeing a list, element by element. - * + * * \param ptr pointer to the current element. * \param t temporary pointer. * \param list list. diff --git a/wmifinfo/Changelog b/wmifinfo/Changelog index 8ee71b1..0184cf3 100644 --- a/wmifinfo/Changelog +++ b/wmifinfo/Changelog @@ -31,7 +31,7 @@ handling were fixed 0.06 Added openBSD support - + - Peter Stromberg supplied a patch for OpenBSD support. I have not tried this myself since I don't have access to this OS. I will probably split the code into several @@ -54,4 +54,3 @@ - the '-i' flag (initial interface) was broken. Thanks to Rod van Meter. - \ No newline at end of file diff --git a/wmifinfo/Makefile b/wmifinfo/Makefile index acd90b7..bb935a8 100644 --- a/wmifinfo/Makefile +++ b/wmifinfo/Makefile @@ -18,7 +18,7 @@ LDOPTS = -lX11 -L/usr/X11R6/lib -lXpm -lXext BINDIR = /usr/local/bin BIN = wmifinfo -FILES = wmifinfo.o xutils.o +FILES = wmifinfo.o xutils.o ifeq ("$(ENABLE_NWN_SUPPORT)", "y") FILES += nwn.o @@ -27,8 +27,8 @@ endif all: $(BIN) -.c.o: - $(CC) $(COPTS) -c $< +.c.o: + $(CC) $(COPTS) -c $< $(BIN): $(FILES) $(LD) -o $@ $(FILES) $(LDOPTS) @@ -43,4 +43,4 @@ dist: clean rm -rf /tmp/wmifinfo-$(VERSION) cd .. && cp -a wmifinfo /tmp/wmifinfo-$(VERSION) cd /tmp && tar --exclude CVS -zcvf wmifinfo-$(VERSION).tgz wmifinfo-$(VERSION)/ - + diff --git a/wmifinfo/README b/wmifinfo/README index 121a14c..7ddee6f 100644 --- a/wmifinfo/README +++ b/wmifinfo/README @@ -10,15 +10,15 @@ DESCRIPTION wmifinfo is a simple applet showing basic network info for all available interfaces. It shows IP address, netmask, gateway and MAC address. A bit - like ifconfig. + like ifconfig. Runs on Linux and OpenBSD (for now) Left-button click moves to the next interface, right-button click calls - ifup/ifdown scripts. These can be set with the -u and -d options. The + ifup/ifdown scripts. These can be set with the -u and -d options. The '%s' variable is replaced with the interface name. - example : + example : $ wmifinfo -i ppp0 -u "/sbin/ifup %s" -d "/sbin/ifdown %s" @@ -93,4 +93,3 @@ COPYRIGHT 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - \ No newline at end of file diff --git a/wmifinfo/nwn.c b/wmifinfo/nwn.c index 6c23c64..0602b27 100644 --- a/wmifinfo/nwn.c +++ b/wmifinfo/nwn.c @@ -28,22 +28,22 @@ int nwn_get_link(char *ifname) sprintf(buf, POLDHUPATH, ifname); f = fopen(buf, "r"); - + if(f == NULL) { sprintf(buf, SWALLOWPATH, ifname); f = fopen(buf, "r"); } - + if(f == NULL) { return(0); } - + while(fgets(buf, sizeof(buf), f)) { p = strchr(buf, '\n'); if(p) *p=0; p = strchr(buf, ':'); - + if(p) { *p=0; key = buf; @@ -53,16 +53,16 @@ int nwn_get_link(char *ifname) *p=0; p--; } - + if(strcmp(key, "Current BSSID") == 0) { strcpy(bssid, val); } - + if((strcmp(key, "BSSID") == 0) && (strcmp(val, bssid) == 0)) { inbssid = 1; } - + if((inbssid == 1) && (strcmp(key, "Quality") == 0)) { sscanf(val, "%X", &link); @@ -71,9 +71,9 @@ int nwn_get_link(char *ifname) } } } - + fclose(f); - + return(link); } diff --git a/wmifinfo/wmifinfo.c b/wmifinfo/wmifinfo.c index 0022bd9..c8d7871 100644 --- a/wmifinfo/wmifinfo.c +++ b/wmifinfo/wmifinfo.c @@ -1,7 +1,7 @@ /* * $Id: wmifinfo.c,v 1.4 2004/07/11 12:00:46 ico Exp $ */ - + #include #include #ifdef linux @@ -107,28 +107,28 @@ void getifnames(void); int getifinfo(char *ifname, struct ifinfo_t *info); - + void drawtext(char *str, struct font_t *font, int x, int y) { int i = 0; int ix, iy; char *p; - + while(str[i]) { p = strchr(font->chars, str[i]); ix = (p) ? (p - font->chars) : 0; - + iy = (ix / font->charspline); ix = (ix % font->charspline); - - copyXPMArea( font->sx + ix * font->dx, + + copyXPMArea( font->sx + ix * font->dx, font->sy + iy * font->dy, - font->dx, + font->dx, font->dy, - x + font->dx * i, + x + font->dx * i, y); - + i++; } } @@ -139,7 +139,7 @@ void drawipaddr(uint32_t a, int linenum) char buf[4]; int i; uint32_t addr = ntohl(a); - + for(i=0; i<4; i++) { snprintf(buf, 4, "%3d", (addr >> ((3-i)*8)) & 255); drawtext(buf, &font1, 5 + i*14, 19 + linenum*9); @@ -150,7 +150,7 @@ void drawhwaddr(unsigned char *addr) { char buf[4]; int i; - + for(i=0; i<6; i++) { snprintf(buf, 4, "%02X", addr[i]); drawtext(buf, &font1, 6 + i*9, 46); @@ -172,7 +172,7 @@ int main(int argc, char *argv[]) exec_up = exec_dflt; exec_down = exec_dflt; - + parse_cmdline(argc, argv); initXwindow(argc, argv); @@ -194,10 +194,10 @@ int main(int argc, char *argv[]) ifc.ifc_buf = malloc(ifc.ifc_len); while(1) { - + while (XPending(display)) { XNextEvent(display, &event); - + switch (event.type) { case Expose: RedrawWindow(); @@ -212,33 +212,33 @@ int main(int argc, char *argv[]) } if ((d++ == 3) || (ifno != pifno) || (exec_busy != prev_exec_busy)) { - + d=0; - + copyXPMArea(64, 0, 64, 64, 0, 0); getifnames(); if(ifaces>0) { ifno = ifno % ifaces; - + getifinfo(ifname[ifno], &ifinfo); - + if(ifno != pifno) lastbytes = ifinfo.bytes; - - sprintf(buf, "%-7s", ifinfo.id); + + sprintf(buf, "%-7s", ifinfo.id); strupper(buf); drawtext(buf, &font2, 6, 4); if(memcmp(ifinfo.hw, "\x00\x00\x00\x00\x00\x00", 6) != 0) { drawhwaddr(ifinfo.hw); } - + if(ifinfo.ip) drawipaddr(ifinfo.ip, 0); if(ifinfo.nm) drawipaddr(ifinfo.nm, 1); if(ifinfo.gw) drawipaddr(ifinfo.gw, 2); // WLAN signal level - + #ifdef linux x = ifinfo.sl/4; #elif defined(__OpenBSD__) @@ -246,11 +246,11 @@ int main(int argc, char *argv[]) #endif if(x>13) x=13; copyXPMArea(4, 82, x*4, 4, 6, 53); - + // LED - + x=0; - if(exec_busy) { + if(exec_busy) { x=0; } else { if(ifinfo.state) x += 8; @@ -258,7 +258,7 @@ int main(int argc, char *argv[]) } copyXPMArea(64 + x, 81, 8, 8, 50, 4); lastbytes = ifinfo.bytes; - + } RedrawWindow(); @@ -269,10 +269,10 @@ int main(int argc, char *argv[]) #ifdef linux tv.tv_sec = 0; tv.tv_usec = DELAY; - + FD_ZERO(&fds); FD_SET(ConnectionNumber(display), &fds); - + select(ConnectionNumber(display)+1, &fds, NULL, NULL, &tv); #elif defined(__OpenBSD__) usleep(DELAY); @@ -299,7 +299,7 @@ void print_usage() void print_version() { printf("%s version %s, compile-time options: ", NAME, VERSION); - + #ifdef ENABLE_NWN_SUPPORT printf("ENABLE NWN SUPPORT "); #endif @@ -310,7 +310,7 @@ void print_version() void parse_cmdline(int argc, char *argv[]) { int c; - + while((c = getopt(argc, argv, "d:i:lhu:v")) != EOF) { switch(c) { case 'd' : @@ -345,7 +345,7 @@ void sigchldhandler(int a) void exec_cmd(char *cmd) { int pid; - + signal(SIGCHLD, sigchldhandler); if(exec_busy) return; @@ -355,23 +355,23 @@ void exec_cmd(char *cmd) if(pid == 0) { system(cmd); exit(0); - } - + } + return; } void ButtonPressEvent(XButtonEvent * xev) { char buf[256]; - + if (xev->type != ButtonPress) return; switch (xev->button) { case Button1: - + ifno++; break; - + case Button2: case Button3: @@ -380,9 +380,9 @@ void ButtonPressEvent(XButtonEvent * xev) } else { sprintf(buf, exec_down, ifinfo.id); } - + exec_cmd(buf); - + break; } } @@ -416,7 +416,7 @@ int getifinfo(char *ifname, struct ifinfo_t *info) struct ifconf ifc; struct ifreq *ifrp, *ifend; #endif - + char parent[16]; char buf[1024]; char *p; @@ -429,14 +429,14 @@ int getifinfo(char *ifname, struct ifinfo_t *info) if(fdev == NULL) fdev = fopen("/proc/net/dev", "r"); #endif - + strcpy(parent, ifname); p=strchr(parent, ':'); if(p) *p=0; strcpy(info->id, ifname); - - strcpy(ifr.ifr_name, ifname); + + strcpy(ifr.ifr_name, ifname); // Get status (UP/DOWN) @@ -446,9 +446,9 @@ int getifinfo(char *ifname, struct ifinfo_t *info) } else { info->state = 0; } - + // Get mac address - + #ifdef linux if(ioctl(fd, SIOCGIFHWADDR, &ifr) != -1) { memcpy(info->hw, ifr.ifr_hwaddr.sa_data, 6); @@ -481,40 +481,40 @@ int getifinfo(char *ifname, struct ifinfo_t *info) } } #endif - - // Get IP address - + + // Get IP address + if(ioctl(fd, SIOCGIFADDR, &ifr) != -1) { sa = (struct sockaddr_in *)&(ifr.ifr_addr); info->ip = sa->sin_addr.s_addr; } else { info->ip = 0; } - + // Get netmask - + if(ioctl(fd, SIOCGIFNETMASK, &ifr) != -1) { sa = (struct sockaddr_in *)&(ifr.ifr_addr); info->nm = sa->sin_addr.s_addr; } else { info->nm = 0; } - + // Get default gateway if on this interface - - info->gw = 0; + + info->gw = 0; #ifdef linux if(froute != NULL) { fseek(froute, 0, 0); - + while(fgets(buf, sizeof(buf), froute)) { r = sscanf(buf, "%s %x %x", a, &b, &c); - + if((strcmp(a, info->id) == 0) && (b == 0)) { info->gw = c; } } - + } #elif defined(__OpenBSD__) { @@ -566,12 +566,12 @@ int getifinfo(char *ifname, struct ifinfo_t *info) #endif // Get wireless link status if wireless - + info->sl = 0; #ifdef linux if(fwireless != NULL) { fseek(fwireless, 0, 0); - + while(fgets(buf, sizeof(buf), fwireless)) { r = sscanf(buf, "%s %d %d ", a, &b, &c); if(strchr(a, ':')) *(strchr(a, ':')) = 0; @@ -580,7 +580,7 @@ int getifinfo(char *ifname, struct ifinfo_t *info) } } } - + #ifdef ENABLE_NWN_SUPPORT if (info->sl == 0) { info->sl = nwn_get_link(parent); @@ -601,13 +601,13 @@ int getifinfo(char *ifname, struct ifinfo_t *info) info->sl = letoh16(wreq.wi_val[0]); } #endif - - // Get Total tx/rx bytes + + // Get Total tx/rx bytes #ifdef linux if(fdev != NULL) { fseek(fdev, 0, 0); - + while(fgets(buf, sizeof(buf), fdev)) { r = sscanf(buf, "%s %d %d %d %d %d %d %d %d %d", a, &b, &d,&d,&d,&d,&d,&d,&d, &c); if(strchr(a, ':')) *(strchr(a, ':')) = 0; @@ -617,7 +617,7 @@ int getifinfo(char *ifname, struct ifinfo_t *info) } } #endif - + return(0); } @@ -628,35 +628,35 @@ void addifname(char *name) if(strcmp(name, "lo") == 0) return; if(strncmp(name, "vlan", 4) == 0) return; - + for(i=0; i #include #include @@ -43,7 +43,7 @@ /* - * X11 Variables + * X11 Variables */ int x_fd; XSizeHints mysizehints; @@ -86,7 +86,7 @@ static int flush_expose(Window w) { * RedrawWindowXY */ void RedrawWindow(void) { - + flush_expose(iconwin); XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, 0,0, wmgen.attributes.width, wmgen.attributes.height, 0, 0); @@ -96,7 +96,7 @@ void RedrawWindow(void) { } 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); @@ -160,8 +160,8 @@ void initXwindow(int argc, char *argv[]){ /* * openXwindow */ -void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, - int pixmask_width, int pixmask_height, char *BackColor, char *LabelColor, +void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, + int pixmask_width, int pixmask_height, char *BackColor, char *LabelColor, char *WindGustColor, char *DataColor, char *StationTimeColor) { unsigned int borderwidth = 1; @@ -178,9 +178,9 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit {"StationTimeColor", NULL, 0} }; - - /* + + /* * Create Pixmap */ cols[0].pixel = getColor(BackColor, 1.0); @@ -192,9 +192,9 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit wmgen.attributes.colorsymbols = cols; wmgen.attributes.exactColors = False; wmgen.attributes.closeness = 40000; - wmgen.attributes.valuemask = XpmReturnPixels | XpmReturnExtensions | XpmColorSymbols + wmgen.attributes.valuemask = XpmReturnPixels | XpmReturnExtensions | XpmColorSymbols | XpmExactColors | XpmCloseness | XpmSize; - if (XpmCreatePixmapFromData(display, Root, pixmap_bytes, + if (XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen.pixmap), &(wmgen.mask), &(wmgen.attributes)) != XpmSuccess){ fprintf(stderr, "Not enough free colorcells.\n"); exit(1); @@ -203,8 +203,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit - /* - * Create a window + /* + * Create a window */ mysizehints.flags = USSize | USPosition; mysizehints.x = 0; @@ -218,19 +218,19 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit 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); - /* - * Activate hints + /* + * Activate hints */ XSetWMNormalHints(display, win, &mysizehints); classHint.res_name = wname; @@ -245,11 +245,11 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit * effect. I.e. for some you will need to Grab the focus and then return * it after you are done... */ - XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask - | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask + XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask + | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask | KeyPressMask | KeyReleaseMask); - XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask - | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask + XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask + | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask | KeyPressMask | KeyReleaseMask); @@ -261,8 +261,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit XSetWMName(display, win, &name); - /* - * Create Graphics Context (GC) for drawing + /* + * Create Graphics Context (GC) for drawing */ gcm = GCForeground | GCBackground | GCGraphicsExposures; gcv.foreground = fore_pix; diff --git a/wmifinfo/xutils.h b/wmifinfo/xutils.h index 5b6231f..fcd25f6 100644 --- a/wmifinfo/xutils.h +++ b/wmifinfo/xutils.h @@ -4,7 +4,7 @@ /* - * Typedefs + * Typedefs */ typedef struct { Pixmap pixmap; @@ -21,7 +21,7 @@ typedef struct { Display *display; Window Root; Window iconwin, win; -int screen; +int screen; int DisplayDepth; diff --git a/wmitime/BUGS b/wmitime/BUGS index c7ff910..27ed6e1 100644 --- a/wmitime/BUGS +++ b/wmitime/BUGS @@ -4,6 +4,6 @@ wmitime 0.2 ------------------------------------------------------------- * analog clock still quirky, but whaddya gonna do... -wmitime 0.1 +wmitime 0.1 ------------------------------------------------------------- * First initial BETA release, analog clock little quirky. diff --git a/wmitime/CHANGES b/wmitime/CHANGES index b856079..dd7749a 100644 --- a/wmitime/CHANGES +++ b/wmitime/CHANGES @@ -13,5 +13,5 @@ Version Description * Fixed potentially fatal (but rare) /0 bug... wheee :) -0.1 +0.1 * First initial public release. diff --git a/wmitime/README b/wmitime/README index ea9922a..1b8caf2 100644 --- a/wmitime/README +++ b/wmitime/README @@ -37,11 +37,11 @@ README This file. BUGS Things you don't want to know ;-) CHANGES Description of changes. COPYING GNU General Public License Version 2. - + Bugs -------------------------------------------------------------- -If you discover any bugs in this software, please send a +If you discover any bugs in this software, please send a bugreport to clarkd@skynet.ca and describe the problem as detailed! as you can. diff --git a/wmitime/wmgeneral/list.c b/wmitime/wmgeneral/list.c index be7464f..a63562f 100644 --- a/wmitime/wmgeneral/list.c +++ b/wmitime/wmgeneral/list.c @@ -1,11 +1,11 @@ -/* Generic single linked list to keep various information +/* Generic single linked list to keep various information Copyright (C) 1993, 1994 Free Software Foundation, Inc. Author: Kresten Krab Thorup Many modifications by Alfredo K. Kojima - + This file is part of GNU CC. @@ -38,7 +38,7 @@ Boston, MA 02110-1301 USA. */ /* Return a cons cell produced from (head . tail) */ -INLINE LinkedList* +INLINE LinkedList* list_cons(void* head, LinkedList* tail) { LinkedList* cell; @@ -63,7 +63,7 @@ list_length(LinkedList* list) return i; } -/* Return the Nth element of LIST, where N count from zero. If N +/* Return the Nth element of LIST, where N count from zero. If N larger than the list length, NULL is returned */ INLINE void* @@ -84,7 +84,7 @@ list_nth(int index, LinkedList* list) INLINE void list_remove_head(LinkedList** list) { - if (!*list) return; + if (!*list) return; if ((*list)->tail) { LinkedList* tail = (*list)->tail; /* fetch next */ @@ -116,7 +116,7 @@ INLINE LinkedList * list_remove_elem(LinkedList* list, void* elem) { LinkedList *tmp; - + if (list) { if (list->head == elem) { tmp = list->tail; diff --git a/wmitime/wmgeneral/list.h b/wmitime/wmgeneral/list.h index 4b6b86f..92c3454 100644 --- a/wmitime/wmgeneral/list.h +++ b/wmitime/wmgeneral/list.h @@ -1,4 +1,4 @@ -/* Generic single linked list to keep various information +/* Generic single linked list to keep various information Copyright (C) 1993, 1994 Free Software Foundation, Inc. Author: Kresten Krab Thorup diff --git a/wmitime/wmgeneral/misc.c b/wmitime/wmgeneral/misc.c index f86481e..1f3bb2e 100644 --- a/wmitime/wmgeneral/misc.c +++ b/wmitime/wmgeneral/misc.c @@ -1,9 +1,9 @@ /* dock.c- built-in Dock module for WindowMaker - * + * * WindowMaker window manager - * + * * Copyright (c) 1997 Alfredo K. Kojima - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -28,7 +28,7 @@ *---------------------------------------------------------------------- * parse_command-- * Divides a command line into a argv/argc pair. - *---------------------------------------------------------------------- + *---------------------------------------------------------------------- */ #define PRC_ALPHA 0 #define PRC_BLANK 1 @@ -64,11 +64,11 @@ next_token(char *word, char **next) t = ret = malloc(strlen(word)+1); ptr = word; - + state = 0; *t = 0; while (1) { - if (*ptr==0) + if (*ptr==0) ctype = PRC_EOS; else if (*ptr=='\\') ctype = PRC_ESCAPE; @@ -98,12 +98,12 @@ next_token(char *word, char **next) t = strdup(ret); free(ret); - + if (ctype==PRC_EOS) *next = NULL; else *next = ptr; - + return t; } @@ -118,7 +118,7 @@ parse_command(char *command, char ***argv, int *argc) line = command; do { token = next_token(line, &line); - if (token) { + if (token) { list = list_cons(token, list); } } while (token!=NULL && line!=NULL); @@ -141,15 +141,15 @@ execCommand(char *command) int argc; parse_command(command, &argv, &argc); - + if (argv==NULL) { return 0; } - + if ((pid=fork())==0) { char **args; int i; - + args = malloc(sizeof(char*)*(argc+1)); if (!args) exit(10); diff --git a/wmitime/wmgeneral/wmgeneral.c b/wmitime/wmgeneral/wmgeneral.c index 56b7bd6..c064b39 100644 --- a/wmitime/wmgeneral/wmgeneral.c +++ b/wmitime/wmgeneral/wmgeneral.c @@ -17,7 +17,7 @@ * Now supports >256 colors 11/09/1998 (Martijn Pieterse, pieterse@xs4all.nl) * Removed a bug from parse_rcfile. You could - not use "start" in a command if a label was + not use "start" in a command if a label was also start. * Changed the needed geometry string. We don't use window size, and don't support @@ -177,7 +177,7 @@ static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) { err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap), &(wmgen->mask), &(wmgen->attributes)); - + if (err != XpmSuccess) { fprintf(stderr, "Not enough free colorcells.\n"); exit(1); @@ -224,9 +224,9 @@ static int flush_expose(Window w) { \*******************************************************************************/ void RedrawWindow(void) { - + flush_expose(iconwin); - XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, + 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, @@ -238,9 +238,9 @@ void RedrawWindow(void) { \*******************************************************************************/ void RedrawWindowXY(int x, int y) { - + flush_expose(iconwin); - XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, + 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, @@ -296,7 +296,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) { unsigned char bwrite; int bcount; int curpixel; - + sscanf(*xpm, "%d %d %d %d", &width, &height, &numcol, &depth); @@ -305,7 +305,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) { zero <<=8; zero |= xpm[1][k]; } - + for (i=numcol+1; i < numcol+sy+1; i++) { bcount = 0; bwrite = 0; @@ -318,7 +318,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) { curpixel <<=8; curpixel |= xpm[i][j+k]; } - + if ( curpixel != zero ) { bwrite += 128; } @@ -394,7 +394,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit } if (!(display = XOpenDisplay(display_name))) { - fprintf(stderr, "%s: can't open display %s\n", + fprintf(stderr, "%s: can't open display %s\n", wname, XDisplayName(display_name)); exit(1); } @@ -419,10 +419,10 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit 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); @@ -443,7 +443,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit XSetWMName(display, win, &name); /* Create GC for drawing */ - + gcm = GCForeground | GCBackground | GCGraphicsExposures; gcv.foreground = fore_pix; gcv.background = back_pix; diff --git a/wmitime/wmitime/wmitime.c b/wmitime/wmitime/wmitime.c index c280547..c4b87f3 100644 --- a/wmitime/wmitime/wmitime.c +++ b/wmitime/wmitime/wmitime.c @@ -95,13 +95,13 @@ int main(int argc, char *argv[]) { int i; uconfig_file[0] = 0; - + /* Parse Command Line */ ProgName = argv[0]; if (strlen(ProgName) >= 5) ProgName += (strlen(ProgName) - 5); - + for (i=1; i prevtime) { prevtime = curtime; @@ -223,7 +223,7 @@ void wmitime_routine(int argc, char **argv) RedrawWindow(); } - + // X Events while (XPending(display)) { @@ -322,11 +322,11 @@ void DrawStdTime(void) { sprintf(blitstr, "%02i:%02i:%02i", i, clk->tm_min, clk->tm_sec); } - + len = strlen(blitstr); - + // Set starting co-ordinates... xoff = 6; yoff = 6; @@ -344,7 +344,7 @@ void DrawStdTime(void) j = blitstr[i] - '0'; srcx = 68; srcy = 23; - + while (j) { j--; @@ -372,7 +372,7 @@ void DrawDate(void) #ifdef fr - // French date model + // French date model sprintf(BlitStr, "%s", monthnames[clk->tm_mon]); BlitString( BlitStr, 40, 50); @@ -419,7 +419,7 @@ void DrawInetWheel(void) xoff=67; xoff+=19; - + while(i) { xoff +=19; @@ -427,7 +427,7 @@ void DrawInetWheel(void) } copyXPMArea(xoff, yoff, 19, 19, 39, 29); - + } @@ -467,7 +467,7 @@ void DrawStdWheel(void) prevhoury=dy; DrawLine(cx, cy, dx, dy, sx, sy); - + // Minute Hand... DrawLine(cx, cy, prevminx, prevminy, 66, 9); // erase old line @@ -489,7 +489,7 @@ void DrawStdWheel(void) prevminx = dx; prevminy = dy; - + DrawLine(cx, cy, dx, dy, sx, sy); } @@ -501,7 +501,7 @@ void DrawLine(int x1, int y1, int x2, int y2, int sourcex, int sourcey) float xd=0, yd=0; float xi, yi; - + x = x1; y = y1; @@ -568,7 +568,7 @@ void BlitString(char *name, int x, int y) for (i=0; name[i]; i++) { - c = toupper(name[i]); + c = toupper(name[i]); if (c >= 'A' && c <= 'Z') { // its a letter c -= 'A'; @@ -594,7 +594,7 @@ void BlitNum(int num, int x, int y) BlitString(buf, newx, y); } - + // ReadConfigSetting int ReadConfigString(FILE *fp, char *setting, char *value) @@ -614,15 +614,15 @@ int ReadConfigString(FILE *fp, char *setting, char *value) sprintf(str, "%s=", setting); slen = strlen(str); - + fseek(fp, 0, SEEK_SET); while ( !feof(fp) ) { - + if (!fgets(buf, 512, fp)) break; - + len = strlen(buf); // strip linefeed @@ -638,7 +638,7 @@ int ReadConfigString(FILE *fp, char *setting, char *value) if ( strncmp(buf, str, strlen(str)) == 0) { // found our setting - + for(i=0; i!=slen; i++) { if ( buf[i] == '=' ) @@ -648,10 +648,10 @@ int ReadConfigString(FILE *fp, char *setting, char *value) return 1; } } - + } } - + return 0; } @@ -675,7 +675,7 @@ int Read_Config_File( char *filename ) fp = fopen(filename, "r"); if (fp) { - + fclose(fp); return 1; } @@ -688,9 +688,9 @@ int Read_Config_File( char *filename ) } - - - + + + diff --git a/wmix/NEWS b/wmix/NEWS index 427423d..5d9a307 100644 --- a/wmix/NEWS +++ b/wmix/NEWS @@ -55,7 +55,7 @@ I will add 2 more signal handlers to switch the current "channel" back and forth. 2.02 NEWS: -Version 2.02 adds mouse wheel support to adjust volume, thanks to the +Version 2.02 adds mouse wheel support to adjust volume, thanks to the patch from Gilles QUERRET . Now instead of dragging the knob, you can use your mouse wheel to adjust the current channel volume. Position the cursor anywhere on the dockapp, and move the wheel. diff --git a/wmix/README b/wmix/README index ca8c295..0465b46 100644 --- a/wmix/README +++ b/wmix/README @@ -1,4 +1,4 @@ - _ _____ ___ + _ _____ ___ __ ___ __ ___ (_)_ __ |___ / /__ \ timecop@japan.co.jp \ \ /\ / / '_ ` _ \| \ \/ / |_ \ _| | skunk@mit.edu \ V V /| | | | | | |> < ___) | / _/ @@ -40,7 +40,7 @@ How to use it: 4) Clicking MUTE will mute the current channel. Old volume settings are remembered, so clicking it again will un-mute. Also see the knob section because there is more than one way to do it :) - + 5) Clicking <- will switch to previous channel 6) Clicking -> will switch to next channel @@ -53,7 +53,7 @@ How to use it: right to set balance. Click on the slider, and drag the mouse left or right to adjust. Double-clicking on the slider will center the balance. If you are on a mono channel, the slider doesn't move or do anything. - + 9) Ah, yes, the knob. One of the biggest visual differences since version 2.x of WMix is that the knob now rendered in real-time opposed to switching pixmaps with various knob angles. Bow down to Daniel Richard G. for coming diff --git a/wmix/ui_x.c b/wmix/ui_x.c index 1425f5c..2ab337e 100644 --- a/wmix/ui_x.c +++ b/wmix/ui_x.c @@ -324,7 +324,7 @@ void new_window(char *name, int width, int height) norm_cursor = XCreateFontCursor(display, XC_left_ptr); bar_cursor = XCreateFontCursor(display, XC_sb_up_arrow); null_cursor = create_null_cursor(display); - + XMapWindow(display, win); } @@ -370,20 +370,20 @@ void new_osd(int width, int height) gcval.graphics_exposures = 0; /* - * -sony-fixed-medium-r-normal--24-170-100-100-c-120-iso8859-1 + * -sony-fixed-medium-r-normal--24-170-100-100-c-120-iso8859-1 * -misc-fixed-medium-r-normal--36-*-75-75-c-*-iso8859-* */ /* try our cool scaled 36pt fixed font */ fs = XLoadQueryFont(display, "-misc-fixed-medium-r-normal--36-*-75-75-c-*-iso8859-*"); - + if (fs == NULL) { /* they don't have it! */ /* try our next preferred font (100dpi sony) */ fprintf(stderr, "Trying alternate font\n"); fs = XLoadQueryFont(display, "-sony-fixed-medium-r-normal--24-*-100-100-c-*-iso8859-*"); - + /* they don't have the sony font either */ if (fs == NULL) { fprintf(stderr, "Trying \"fixed\" font\n"); @@ -397,7 +397,7 @@ void new_osd(int width, int height) } } } - + gc = XCreateGC(display, osd, GCForeground | GCBackground | GCGraphicsExposures, @@ -515,7 +515,7 @@ static void draw_percent(void) int volume = (int)(mixer_get_volume() * 100); copy_xpm_area(0, 87, 18, 9, 41, 22); /* clear percentage */ - + if (volume < 100) { if (volume >= 10) copy_xpm_area((volume / 10) * 6, 67, 6, 9, 47, 22); @@ -537,7 +537,7 @@ static void draw_knob(float volume) led_x = KNOB_CENTER_X + LED_POS_RADIUS * cos(bearing); led_y = KNOB_CENTER_Y - LED_POS_RADIUS * sin(bearing); - + led_topleft_x = (int)(led_x - (LED_WIDTH / 2.0) + 0.5); led_topleft_y = (int)(led_y - (LED_HEIGHT / 2.0) + 0.5); @@ -569,7 +569,7 @@ static Cursor create_null_cursor(Display *x_display) GC gc; XColor dummy_color; Cursor cursor; - + cursor_mask = XCreatePixmap(x_display, DefaultRootWindow(x_display), 1, 1, 1); gcval.function = GXclear; gc = XCreateGC(x_display, cursor_mask, GCFunction, &gcval); @@ -581,7 +581,7 @@ static Cursor create_null_cursor(Display *x_display) &dummy_color, &dummy_color, 0, 0); XFreePixmap(x_display, cursor_mask); XFreeGC(x_display, gc); - + return cursor; } diff --git a/wmix/wmix.c b/wmix/wmix.c index 9289f55..b2ff99f 100644 --- a/wmix/wmix.c +++ b/wmix/wmix.c @@ -325,7 +325,7 @@ static void button_release_event(XButtonEvent *event) if (region == 1) set_cursor(HAND_CURSOR); - + button_pressed = false; slider_pressed = false; } @@ -372,7 +372,7 @@ static void motion_event(XMotionEvent *event) mouse_drag_home_x, mouse_drag_home_y); return; } - + if (region == 1) set_cursor(HAND_CURSOR); else if (region == 2) diff --git a/wmkeys/wmgeneral/list.c b/wmkeys/wmgeneral/list.c index be7464f..a63562f 100644 --- a/wmkeys/wmgeneral/list.c +++ b/wmkeys/wmgeneral/list.c @@ -1,11 +1,11 @@ -/* Generic single linked list to keep various information +/* Generic single linked list to keep various information Copyright (C) 1993, 1994 Free Software Foundation, Inc. Author: Kresten Krab Thorup Many modifications by Alfredo K. Kojima - + This file is part of GNU CC. @@ -38,7 +38,7 @@ Boston, MA 02110-1301 USA. */ /* Return a cons cell produced from (head . tail) */ -INLINE LinkedList* +INLINE LinkedList* list_cons(void* head, LinkedList* tail) { LinkedList* cell; @@ -63,7 +63,7 @@ list_length(LinkedList* list) return i; } -/* Return the Nth element of LIST, where N count from zero. If N +/* Return the Nth element of LIST, where N count from zero. If N larger than the list length, NULL is returned */ INLINE void* @@ -84,7 +84,7 @@ list_nth(int index, LinkedList* list) INLINE void list_remove_head(LinkedList** list) { - if (!*list) return; + if (!*list) return; if ((*list)->tail) { LinkedList* tail = (*list)->tail; /* fetch next */ @@ -116,7 +116,7 @@ INLINE LinkedList * list_remove_elem(LinkedList* list, void* elem) { LinkedList *tmp; - + if (list) { if (list->head == elem) { tmp = list->tail; diff --git a/wmkeys/wmgeneral/list.h b/wmkeys/wmgeneral/list.h index 4b6b86f..92c3454 100644 --- a/wmkeys/wmgeneral/list.h +++ b/wmkeys/wmgeneral/list.h @@ -1,4 +1,4 @@ -/* Generic single linked list to keep various information +/* Generic single linked list to keep various information Copyright (C) 1993, 1994 Free Software Foundation, Inc. Author: Kresten Krab Thorup diff --git a/wmkeys/wmgeneral/misc.c b/wmkeys/wmgeneral/misc.c index f86481e..1f3bb2e 100644 --- a/wmkeys/wmgeneral/misc.c +++ b/wmkeys/wmgeneral/misc.c @@ -1,9 +1,9 @@ /* dock.c- built-in Dock module for WindowMaker - * + * * WindowMaker window manager - * + * * Copyright (c) 1997 Alfredo K. Kojima - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -28,7 +28,7 @@ *---------------------------------------------------------------------- * parse_command-- * Divides a command line into a argv/argc pair. - *---------------------------------------------------------------------- + *---------------------------------------------------------------------- */ #define PRC_ALPHA 0 #define PRC_BLANK 1 @@ -64,11 +64,11 @@ next_token(char *word, char **next) t = ret = malloc(strlen(word)+1); ptr = word; - + state = 0; *t = 0; while (1) { - if (*ptr==0) + if (*ptr==0) ctype = PRC_EOS; else if (*ptr=='\\') ctype = PRC_ESCAPE; @@ -98,12 +98,12 @@ next_token(char *word, char **next) t = strdup(ret); free(ret); - + if (ctype==PRC_EOS) *next = NULL; else *next = ptr; - + return t; } @@ -118,7 +118,7 @@ parse_command(char *command, char ***argv, int *argc) line = command; do { token = next_token(line, &line); - if (token) { + if (token) { list = list_cons(token, list); } } while (token!=NULL && line!=NULL); @@ -141,15 +141,15 @@ execCommand(char *command) int argc; parse_command(command, &argv, &argc); - + if (argv==NULL) { return 0; } - + if ((pid=fork())==0) { char **args; int i; - + args = malloc(sizeof(char*)*(argc+1)); if (!args) exit(10); diff --git a/wmkeys/wmgeneral/wmgeneral.c b/wmkeys/wmgeneral/wmgeneral.c index a4f13c1..645321c 100644 --- a/wmkeys/wmgeneral/wmgeneral.c +++ b/wmkeys/wmgeneral/wmgeneral.c @@ -124,7 +124,7 @@ static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) { err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap), &(wmgen->mask), &(wmgen->attributes)); - + if (err != XpmSuccess) { fprintf(stderr, "Not enough free colorcells.\n"); exit(1); @@ -171,9 +171,9 @@ static int flush_expose(Window w) { \*******************************************************************************/ void RedrawWindow(void) { - + flush_expose(iconwin); - XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, + 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, @@ -185,9 +185,9 @@ void RedrawWindow(void) { \*******************************************************************************/ void RedrawWindowXY(int x, int y) { - + flush_expose(iconwin); - XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, + 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, @@ -281,12 +281,12 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit int i; for (i=1; argv[i]; i++) { - if (!strcmp(argv[i], "-display")) + if (!strcmp(argv[i], "-display")) display_name = argv[i+1]; } if (!(display = XOpenDisplay(display_name))) { - fprintf(stderr, "%s: can't open display %s\n", + fprintf(stderr, "%s: can't open display %s\n", wname, XDisplayName(display_name)); exit(1); } @@ -311,10 +311,10 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit 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); @@ -335,7 +335,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit XSetWMName(display, win, &name); /* Create GC for drawing */ - + gcm = GCForeground | GCBackground | GCGraphicsExposures; gcv.foreground = fore_pix; gcv.background = back_pix; diff --git a/wmkeys/wmkeys.c b/wmkeys/wmkeys.c index 2d4859b..718ccd5 100644 --- a/wmkeys/wmkeys.c +++ b/wmkeys/wmkeys.c @@ -102,7 +102,7 @@ void main(int argc, char *argv[]) ProgName = argv[0]; if (strlen(ProgName) >= 6) ProgName += (strlen(ProgName) - 6); - + read_config(); wmkeys_routine(argc, argv); } @@ -122,11 +122,11 @@ void wmkeys_routine(int argc, char **argv) /* add mouse region */ AddMouseRegion(0, 5, 5, 58, 122); - + while (1) { waitpid(0, NULL, WNOHANG); RedrawWindow(); - + while (XPending(display)) { XNextEvent(display, &Event); switch (Event.type) { @@ -155,7 +155,7 @@ void wmkeys_routine(int argc, char **argv) break; } } - + /* Sleep 0.3 seconds */ usleep(300000L); } diff --git a/wmmemload/doc/wmmemload.1 b/wmmemload/doc/wmmemload.1 index cef0b97..ef74687 100644 --- a/wmmemload/doc/wmmemload.1 +++ b/wmmemload/doc/wmmemload.1 @@ -25,7 +25,7 @@ This manual page documents briefly the command. .PP .\" TeX users may be more comfortable with the \fB\fP and -.\" \fI\fP escape sequences to invode bold face and italics, +.\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. \fBWMMemLoad\fP is a program to monitor memory/swap usages. It is a dockapp that is supported by X window managers such as Window Maker, AfterStep, BlackBox, and Enlightenment. diff --git a/wmmemload/src/main.c b/wmmemload/src/main.c index 845b86a..4d196ad 100644 --- a/wmmemload/src/main.c +++ b/wmmemload/src/main.c @@ -51,7 +51,7 @@ static light backlight = LIGHTOFF; static struct mem_options mem_opts; static unsigned mem_usage = 0; static unsigned swap_usage = 0; -static unsigned alarm_mem = 101; +static unsigned alarm_mem = 101; static unsigned alarm_swap = 101; /* prototypes */ @@ -114,7 +114,7 @@ int main(int argc, char **argv) pixmap = dockapp_XCreatePixmap(SIZE, SIZE); /* Initialize pixmap */ - if(backlight == LIGHTON) + if(backlight == LIGHTON) dockapp_copyarea(backdrop_on, pixmap, 0, 0, SIZE, SIZE, 0, 0); else dockapp_copyarea(backdrop_off, pixmap, 0, 0, SIZE, SIZE, 0, 0); @@ -157,7 +157,7 @@ static void update(void) mem_getusage(&mem_usage, &swap_usage, &mem_opts); /* alarm mode */ - if(mem_usage >= alarm_mem || swap_usage >= alarm_swap) + if(mem_usage >= alarm_mem || swap_usage >= alarm_swap) { if(!in_alarm_mode) { @@ -169,13 +169,13 @@ static void update(void) switch_light(); return; } - } + } else { if(in_alarm_mode) { in_alarm_mode = False; - if (backlight != pre_backlight) + if (backlight != pre_backlight) { switch_light(); return; @@ -184,9 +184,9 @@ static void update(void) } /* all clear */ - if (backlight == LIGHTON) + if (backlight == LIGHTON) dockapp_copyarea(backdrop_on, pixmap, 0, 0, 58, 58, 0, 0); - else + else dockapp_copyarea(backdrop_off, pixmap, 0, 0, 58, 58, 0, 0); /* draw digit */ @@ -276,18 +276,18 @@ static void parse_arguments(int argc, char **argv) { int i; int integer; - for (i = 1; i < argc; i++) + for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "-h")) print_help(argv[0]), exit(0); else if (!strcmp(argv[i], "--version") || !strcmp(argv[i], "-v")) printf("%s version %s\n", PACKAGE, VERSION), exit(0); - else if (!strcmp(argv[i], "--display") || !strcmp(argv[i], "-d")) + else if (!strcmp(argv[i], "--display") || !strcmp(argv[i], "-d")) { display_name = argv[i + 1]; i++; } - else if (!strcmp(argv[i], "--alarm-mem") || !strcmp(argv[i], "-am")) + else if (!strcmp(argv[i], "--alarm-mem") || !strcmp(argv[i], "-am")) { if (argc == i + 1) alarm_mem = 90; @@ -299,7 +299,7 @@ static void parse_arguments(int argc, char **argv) else alarm_mem = integer, i++; } - else if (!strcmp(argv[i], "--alarm-swap") || !strcmp(argv[i], "-as")) + else if (!strcmp(argv[i], "--alarm-swap") || !strcmp(argv[i], "-as")) { if (argc == i + 1) alarm_swap = 50; @@ -313,12 +313,12 @@ static void parse_arguments(int argc, char **argv) } else if (!strcmp(argv[i], "--backlight") || !strcmp(argv[i], "-bl")) backlight = LIGHTON; - else if (!strcmp(argv[i], "--light-color") || !strcmp(argv[i], "-lc")) + else if (!strcmp(argv[i], "--light-color") || !strcmp(argv[i], "-lc")) { light_color = argv[i + 1]; i++; } - else if (!strcmp(argv[i], "--interval") || !strcmp(argv[i], "-i")) + else if (!strcmp(argv[i], "--interval") || !strcmp(argv[i], "-i")) { if (argc == i + 1) fprintf(stderr, "%s: error parsing argument for option %s\n", @@ -355,7 +355,7 @@ static void parse_arguments(int argc, char **argv) } } if (alarm_mem != 101 && alarm_swap != 101) - { + { fprintf(stderr, "%s: select either '-am, --alarm-mem' or '-as, --alarm-swap'\n", argv[0]); diff --git a/wmmemload/src/mem_openbsd.c b/wmmemload/src/mem_openbsd.c index f563498..00a5b09 100644 --- a/wmmemload/src/mem_openbsd.c +++ b/wmmemload/src/mem_openbsd.c @@ -40,7 +40,7 @@ get_swap_usage(void) if ((num_swap = swapctl(SWAP_NSWAP, 0, 0)) == 0) return 0; - if ((swap_dev = malloc(num_swap * sizeof(*swap_dev))) == NULL) + if ((swap_dev = malloc(num_swap * sizeof(*swap_dev))) == NULL) return 0; if (swapctl(SWAP_STATS, swap_dev, num_swap) == -1) diff --git a/wmmixer/CHANGES b/wmmixer/CHANGES index d0cc90c..dc0e15b 100644 --- a/wmmixer/CHANGES +++ b/wmmixer/CHANGES @@ -67,7 +67,7 @@ Release 1.2 25 May 2002 Merge Debian patches Release 1.3 26 May 2002 Change the whole thing to actual C++ code. - It is not yet pretty code, but it is a lot + It is not yet pretty code, but it is a lot better. Still, much work to do. Release 1.4 08 Jun 2002 Display only one bar for mono channels diff --git a/wmmixer/debian/changelog b/wmmixer/debian/changelog index e869521..2069fbb 100644 --- a/wmmixer/debian/changelog +++ b/wmmixer/debian/changelog @@ -110,7 +110,7 @@ wmmixer (1.5-7) unstable; urgency=low wmmixer (1.5-6.1) unstable; urgency=low * Porter NMU. - * Added support for GNU/kFreeBSD (Closes: #332992). + * Added support for GNU/kFreeBSD (Closes: #332992). -- Aurelien Jarno Sun, 10 Dec 2006 21:45:54 +0100 @@ -201,7 +201,7 @@ wmmixer (1.1-3) unstable; urgency=low wmmixer (1.1-2) unstable; urgency=low - * Correct Makefile to use C++ compiler instead of C compiler + * Correct Makefile to use C++ compiler instead of C compiler (Closes: #141696) -- Gordon Fraser Mon, 8 Apr 2002 09:00:48 +0200 diff --git a/wmmixer/debian/patches/01_debian_paths.patch b/wmmixer/debian/patches/01_debian_paths.patch index f89d000..826a6a2 100644 --- a/wmmixer/debian/patches/01_debian_paths.patch +++ b/wmmixer/debian/patches/01_debian_paths.patch @@ -5,13 +5,13 @@ Last-Update: 2007-10-08 +++ b/Makefile @@ -1,12 +1,10 @@ # $Id: Makefile,v 1.5 2002/06/25 22:13:09 gordon Exp $ - + -prefix = /usr/local +prefix = /usr exec_prefix = ${prefix} bindir = ${exec_prefix}/bin mandir = ${prefix}/share/man - + -DESTDIR = - CXX = g++ diff --git a/wmmixer/debian/patches/02_Makefile_optimization.patch b/wmmixer/debian/patches/02_Makefile_optimization.patch index 260b175..d992010 100644 --- a/wmmixer/debian/patches/02_Makefile_optimization.patch +++ b/wmmixer/debian/patches/02_Makefile_optimization.patch @@ -5,7 +5,7 @@ Last-Update: 2007-10-08 +++ b/Makefile @@ -6,7 +6,14 @@ mandir = ${prefix}/share/man - + CXX = g++ -CXXFLAGS = -O -Wall +CXXFLAGS = -Wall -g @@ -17,5 +17,5 @@ Last-Update: 2007-10-08 +endif + EXTRA_LIBS = -L/usr/X11R6/lib -lX11 -lXpm -lXext - - + + diff --git a/wmmixer/exception.h b/wmmixer/exception.h index 4c8a138..eee481e 100644 --- a/wmmixer/exception.h +++ b/wmmixer/exception.h @@ -20,7 +20,7 @@ class Exception { protected: char* error_message_; - + public: Exception(); Exception(const Exception&); diff --git a/wmmixer/mixctl.cc b/wmmixer/mixctl.cc index 10a40b3..ffea52c 100644 --- a/wmmixer/mixctl.cc +++ b/wmmixer/mixctl.cc @@ -245,12 +245,12 @@ bool MixCtl::hasChanged() { struct mixer_info mixer_info1; ioctl(mixfd, SOUND_MIXER_INFO, &mixer_info1); - + if (mixer_info1.modify_counter == modify_counter) { return false; } - else + else { modify_counter = mixer_info1.modify_counter; return true; diff --git a/wmmixer/mixctl.h b/wmmixer/mixctl.h index 1783dc4..44d8251 100644 --- a/wmmixer/mixctl.h +++ b/wmmixer/mixctl.h @@ -47,7 +47,7 @@ struct _MixerDevice_{ int mask; int muted; }; - + typedef struct _MixerDevice_ MixerDevice; //---------------------------------------------------------------------- @@ -69,7 +69,7 @@ class MixCtl MixerDevice* mixer_devices_; void doStatus(); - + public: MixCtl(char *dname) throw(MixerDeviceException); virtual ~MixCtl(); diff --git a/wmmixer/wmmixer.1 b/wmmixer/wmmixer.1 index 4d26c51..fc4c90e 100644 --- a/wmmixer/wmmixer.1 +++ b/wmmixer/wmmixer.1 @@ -1,7 +1,7 @@ -.TH wmmixer 1 "April 02, 2002" Debian "Windowmaker Mixer Application" +.TH wmmixer 1 "April 02, 2002" Debian "Windowmaker Mixer Application" .SH NAME -wmmixer \- A mixer application designed for WindowMaker +wmmixer \- A mixer application designed for WindowMaker .SH DESCRIPTION \fBwmmixer\fP is a mixer application designed for WindowMaker, although there is nothing in the program that makes it require WindowMaker, except @@ -11,7 +11,7 @@ properly docks. It can be used with other window managers without problems. .B wmmixer [options] .SH OPTIONS This program follows the usual GNU command line syntax, with long options -starting with two dashes ('\-\-'). A summary of options is included below. +starting with two dashes ('\-\-'). A summary of options is included below. .TP .B \-d, \-\-display <\fIstring\fP> Attempt to open a window on the named X display. In the absence of this diff --git a/wmmixer/wmmixer.cc b/wmmixer/wmmixer.cc index 7804aea..15bef43 100644 --- a/wmmixer/wmmixer.cc +++ b/wmmixer/wmmixer.cc @@ -45,14 +45,14 @@ WMMixer::~WMMixer() void WMMixer::loop() { XEvent xev; - + bool done=false; while(!done) { - while(XPending(xhandler_->getDisplay())) + while(XPending(xhandler_->getDisplay())) { XNextEvent(xhandler_->getDisplay(), &xev); - switch(xev.type) + switch(xev.type) { case Expose: xhandler_->repaint(); @@ -72,7 +72,7 @@ void WMMixer::loop() break; } } - + // keep a button pressed causes scrolling throught the channels if(xhandler_->getButtonState() & (BTNPREV | BTNNEXT)) { @@ -97,11 +97,11 @@ void WMMixer::loop() repeat_timer_ = 0; } } - else + else { checkVol(false); } - + XFlush(xhandler_->getDisplay()); usleep(100000); } @@ -115,7 +115,7 @@ void WMMixer::init(int argc, char **argv) initMixer(); - readConfigurationFile(); + readConfigurationFile(); xhandler_->init(argc, argv, mixctl_->getNrDevices()); @@ -144,7 +144,7 @@ void WMMixer::initMixer() } channel_list_ = new unsigned[mixctl_->getNrDevices()]; - + for(unsigned count=0; countgetNrDevices(); count++) { if(mixctl_->getSupport(count)){ @@ -214,7 +214,7 @@ void WMMixer::checkVol(bool forced = true) xhandler_->drawBtns(BTNREC, current_show_recording_); } updateDisplay(); - } + } } } @@ -245,17 +245,17 @@ void WMMixer::parseArgs(int argc, char **argv) snprintf(config_file_, CONFIGFILELEN -1, "%s/.wmmixer", getenv("HOME")); // For backward compatibility - for(i=1; isetRec(current, (strncmp(buf+strlen("setrecsrc "), "true", strlen("true"))==0)); } } - } + } while(done==0); fclose(rcfile); mixctl_->writeRec(); @@ -441,7 +441,7 @@ void WMMixer::displayVersion() //-------------------------------------------------------------------- -void WMMixer::pressEvent(XButtonEvent *xev) +void WMMixer::pressEvent(XButtonEvent *xev) { bool forced_update = true; int x = xev->x-(xhandler_->getWindowSize()/2-32); @@ -475,19 +475,19 @@ void WMMixer::pressEvent(XButtonEvent *xev) { int vl = 0, vr = 0; - if(xev->button < 4) + if(xev->button < 4) { vl = ((60-y)*100)/(2*25); vr = vl; dragging_ = true; - } - else if(xev->button == 4) + } + else if(xev->button == 4) { vr = mixctl_->readRight(channel_list_[current_channel_]) + wheel_scroll_; vl = mixctl_->readLeft(channel_list_[current_channel_]) + wheel_scroll_; - - } - else if(xev->button == 5) + + } + else if(xev->button == 5) { vr = mixctl_->readRight(channel_list_[current_channel_]) - wheel_scroll_; vl = mixctl_->readLeft(channel_list_[current_channel_]) - wheel_scroll_; @@ -503,7 +503,7 @@ void WMMixer::pressEvent(XButtonEvent *xev) if(x >= 45) mixctl_->setRight(channel_list_[current_channel_], vr); mixctl_->writeVol(channel_list_[current_channel_]); - + forced_update = false; } @@ -568,7 +568,7 @@ void WMMixer::motionEvent(XMotionEvent *xev) void WMMixer::updateDisplay() { xhandler_->update(channel_list_[current_channel_]); - if(mixctl_->getStereo(channel_list_[current_channel_])) + if(mixctl_->getStereo(channel_list_[current_channel_])) { xhandler_->drawLeft(current_channel_left_); xhandler_->drawRight(current_channel_right_); diff --git a/wmmixer/xhandler.cc b/wmmixer/xhandler.cc index 506bf18..95d76a2 100644 --- a/wmmixer/xhandler.cc +++ b/wmmixer/xhandler.cc @@ -45,24 +45,24 @@ XHandler::~XHandler() XDestroyWindow(display_default_, window_icon_); XCloseDisplay(display_default_); - + delete[] icon_list_; } //-------------------------------------------------------------------- void XHandler::init(int argc, char** argv, int num_channels) -{ +{ int display_depth; window_size_=is_astep_ ? ASTEPSIZE : NORMSIZE; - - if((display_default_ = XOpenDisplay(display_name_))==NULL) + + if((display_default_ = XOpenDisplay(display_name_))==NULL) { std::cerr << NAME << " : Unable to open X display '" << XDisplayName(display_name_) << "'." << std::endl; exit(1); } - + initWindow(argc, argv); initColors(); @@ -146,30 +146,30 @@ unsigned long XHandler::mixColor(char *colorname1, int prop1, char *colorname2, } //-------------------------------------------------------------------- -void XHandler::repaint() +void XHandler::repaint() { flush_expose(window_icon_); XCopyArea(display_default_, pixmap_disp, window_icon_, graphics_context_, 0, 0, 64, 64, window_size_/2-32, window_size_/2-32); flush_expose(window_main_); XCopyArea(display_default_, pixmap_disp, window_main_, graphics_context_, 0, 0, 64, 64, window_size_/2-32, window_size_/2-32); - + XEvent xev; while(XCheckTypedEvent(display_default_, Expose, &xev)); } //-------------------------------------------------------------------- -void XHandler::update(unsigned channel) +void XHandler::update(unsigned channel) { - if(is_wmaker_ || is_ushape_ || is_astep_) + if(is_wmaker_ || is_ushape_ || is_astep_) { XShapeCombineMask(display_default_, window_icon_, ShapeBounding, window_size_/2-32, window_size_/2-32, pixmap_mask, ShapeSet); XShapeCombineMask(display_default_, window_main_, ShapeBounding, window_size_/2-32, window_size_/2-32, pixmap_mask, ShapeSet); - } - else + } + else { XCopyArea(display_default_, pixmap_tile, pixmap_disp, graphics_context_, 0, 0, 64, 64, 0, 0); } - + XSetClipMask(display_default_, graphics_context_, pixmap_mask); XCopyArea(display_default_, pixmap_main, pixmap_disp, graphics_context_, 0, 0, 64, 64, 0, 0); XSetClipMask(display_default_, graphics_context_, None); @@ -177,7 +177,7 @@ void XHandler::update(unsigned channel) } //-------------------------------------------------------------------- -void XHandler::drawLeft(unsigned curleft) +void XHandler::drawLeft(unsigned curleft) { XSetForeground(display_default_, graphics_context_, shade_colors_[(curleft*25)/100]); for(unsigned i=0;i<25;i++) @@ -195,7 +195,7 @@ void XHandler::drawLeft(unsigned curleft) } //-------------------------------------------------------------------- -void XHandler::drawRight(unsigned curright) +void XHandler::drawRight(unsigned curright) { for(unsigned i=0;i<25;i++) { @@ -232,7 +232,7 @@ void XHandler::drawMono(unsigned curright) //-------------------------------------------------------------------- -void XHandler::drawBtns(int buttons, bool curshowrec) +void XHandler::drawBtns(int buttons, bool curshowrec) { if(buttons & BTNPREV) drawButton(BTN_LEFT_X, BTN_LEFT_Y, BTN_WIDTH, BTN_HEIGHT, (button_state_ & BTNPREV)); @@ -245,7 +245,7 @@ void XHandler::drawBtns(int buttons, bool curshowrec) if(buttons & BTNREC){ drawButton(BTN_REC_X, BTN_REC_Y, BTN_WIDTH, BTN_HEIGHT, (button_state_ & BTNREC)); - + if(!curshowrec) XCopyArea(display_default_, pixmap_nrec, pixmap_disp, graphics_context_, 0, 0, 9, 8, 6, 47); else @@ -254,7 +254,7 @@ void XHandler::drawBtns(int buttons, bool curshowrec) } //-------------------------------------------------------------------- -void XHandler::drawButton(int x, int y, int w, int h, bool down) +void XHandler::drawButton(int x, int y, int w, int h, bool down) { if(!down) XCopyArea(display_default_, pixmap_main, pixmap_disp, graphics_context_, x, y, w, h, x, y); @@ -267,14 +267,14 @@ void XHandler::drawButton(int x, int y, int w, int h, bool down) } //-------------------------------------------------------------------- -int XHandler::flush_expose(Window w) +int XHandler::flush_expose(Window w) { XEvent dummy; int i=0; - + while (XCheckTypedWindowEvent(display_default_, w, Expose, &dummy)) i++; - + return i; } @@ -367,13 +367,13 @@ Atom XHandler::getDeleteWin() //-------------------------------------------------------------------- -void XHandler::initIcons(int num) +void XHandler::initIcons(int num) { if(icon_list_) delete[] icon_list_; - + icon_list_ = new unsigned[num]; - + icon_list_[0] = 0; icon_list_[1] = 7; icon_list_[2] = 8; @@ -397,7 +397,7 @@ void XHandler::initGraphicsContext() gcv.graphics_exposures = 0; gcv.foreground = fore_pix; gcv.background = back_pix; - graphics_context_ = XCreateGC(display_default_, window_root_, gcm, &gcv); + graphics_context_ = XCreateGC(display_default_, window_root_, gcm, &gcv); } //-------------------------------------------------------------------- @@ -414,7 +414,7 @@ void XHandler::initPixmaps(int display_depth) xpmattr.exactColors = false; xpmattr.closeness = 40000; xpmattr.valuemask = XpmColorSymbols | XpmExactColors | XpmCloseness; - + XpmCreatePixmapFromData(display_default_, window_root_, (char **)wmmixer_xpm, &pixmap_main, &pixmap_mask, &xpmattr); XpmCreatePixmapFromData(display_default_, window_root_, (char **)tile_xpm, &pixmap_tile, NULL, &xpmattr); XpmCreatePixmapFromData(display_default_, window_root_, (char **)icons_xpm, &pixmap_icon, NULL, &xpmattr); @@ -443,7 +443,7 @@ void XHandler::initWindow(int argc, char** argv) shints.y = 0; // shints.flags = USSize; shints.flags = 0; // Gordon - + bool pos = (XWMGeometry(display_default_, DefaultScreen(display_default_), position_name_, NULL, 0, &shints, &shints.x, &shints.y, &shints.width, &shints.height, &dummy) @@ -466,16 +466,16 @@ void XHandler::initWindow(int argc, char** argv) window_main_ = XCreateSimpleWindow(display_default_, window_root_, shints.x, shints.y, shints.width, shints.height, 0, fore_pix, back_pix); - + window_icon_ = XCreateSimpleWindow(display_default_, window_root_, shints.x, shints.y, shints.width, shints.height, 0, fore_pix, back_pix); - + XSetWMNormalHints(display_default_, window_main_, &shints); - - + + wmhints.icon_x = shints.x; wmhints.icon_y = shints.y; - + if(is_wmaker_ || is_astep_ || pos) shints.flags |= USPosition; @@ -484,30 +484,30 @@ void XHandler::initWindow(int argc, char** argv) wmhints.initial_state = WithdrawnState; wmhints.flags = StateHint | IconWindowHint | IconPositionHint | WindowGroupHint; wmhints.icon_window = window_icon_; - + wmhints.icon_x = shints.x; wmhints.icon_y = shints.y; wmhints.window_group = window_main_; - } - else + } + else { wmhints.initial_state = NormalState; wmhints.flags = WindowGroupHint | StateHint; } - + classHint.res_name=(char *)NAME; classHint.res_class = window_class_; - + XSetClassHint(display_default_, window_main_, &classHint); XSetClassHint(display_default_, window_icon_, &classHint); - - + + if (XStringListToTextProperty(&wname, 1, &name) == 0) { std::cerr << wname << ": can't allocate window name" << std::endl; exit(1); } - + XSetWMName(display_default_, window_main_, &name); XSetWMHints(display_default_, window_main_, &wmhints); XSetCommand(display_default_, window_main_, argv, argc); @@ -518,7 +518,7 @@ void XHandler::initWindow(int argc, char** argv) //-------------------------------------------------------------------- // Initialize main colors and shaded color-array for bars void XHandler::initColors() -{ +{ colors_[0] = mixColor(ledcolor_name_, 0, backcolor_name_, 100); colors_[1] = mixColor(ledcolor_name_, 100, backcolor_name_, 0); colors_[2] = mixColor(ledcolor_name_, 60, backcolor_name_, 40); @@ -533,23 +533,23 @@ void XHandler::initColors() //-------------------------------------------------------------------- void XHandler::initMask() -{ +{ XSetClipMask(display_default_, graphics_context_, pixmap_mask); XCopyArea( display_default_, pixmap_main, pixmap_disp, graphics_context_, 0, 0, 64, 64, 0, 0); XSetClipMask(display_default_, graphics_context_, None); XStoreName( display_default_, window_main_, NAME); - XSetIconName(display_default_, window_main_, NAME); + XSetIconName(display_default_, window_main_, NAME); - if(is_wmaker_ || is_ushape_ || is_astep_) + if(is_wmaker_ || is_ushape_ || is_astep_) { XShapeCombineMask(display_default_, window_icon_, ShapeBounding, window_size_/2-32, window_size_/2-32, pixmap_mask, ShapeSet); XShapeCombineMask(display_default_, window_main_, ShapeBounding, window_size_/2-32, window_size_/2-32, pixmap_mask, ShapeSet); - } - else + } + else { XCopyArea(display_default_, pixmap_tile, pixmap_disp, graphics_context_, 0, 0, 64, 64, 0, 0); } - + XSelectInput(display_default_, window_main_, ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask); XSelectInput(display_default_, window_icon_, ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask); XMapWindow(display_default_, window_main_); diff --git a/wmmixer/xhandler.h b/wmmixer/xhandler.h index 8dcebf8..e6c9fc4 100644 --- a/wmmixer/xhandler.h +++ b/wmmixer/xhandler.h @@ -95,7 +95,7 @@ class XHandler Pixmap pixmap_tile; Pixmap pixmap_disp; Pixmap pixmap_mask; - + // Pixmaps - custom Pixmap pixmap_icon; Pixmap pixmap_nrec; @@ -103,7 +103,7 @@ class XHandler // X-Windows basics - standard Atom _XA_GNUSTEP_WM_FUNC; Atom deleteWin; - + unsigned long getColor(char*); unsigned long mixColor(char*, int, char*, int); @@ -128,7 +128,7 @@ class XHandler void drawRight(unsigned); void drawBtns(int, bool); void drawMono(unsigned); - + bool isLeftButton(int, int); bool isRightButton(int, int); bool isMuteButton(int, int); diff --git a/wmmon/CHANGES b/wmmon/CHANGES index 4eaedd3..5b4ce11 100644 --- a/wmmon/CHANGES +++ b/wmmon/CHANGES @@ -3,24 +3,24 @@ WMMon changes. Version Description -------------------------------------------------------------- 1.2b1 - Released 20120325 - - I/O monitor - updated to use /proc/diskstats instead - of obsolete /proc/stat interface, which is no longer + - I/O monitor - updated to use /proc/diskstats instead + of obsolete /proc/stat interface, which is no longer present in post 2.6 kernels. TODO: The non-/proc based solutions used in the various BSD ports trees should be incorporated into mainline version. - I/O monitor - Fixed scaling issues with graph caused - by improper use of static data. The graph would + by improper use of static data. The graph would continually scale up, making smaller values invisible. Eventually the system would appear to be idle, only graphing the biggest spikes. A similar issue affecting - the upper-right meter is also fixed. Meter scaling is + the upper-right meter is also fixed. Meter scaling is recalibrated every couple of minutes to avoid losing meter funtionality after anomalously large peaks. - I/O Monitor - Fixed rounding errors caused by use of integer types, which were causing relatively small values not to appear on graph or meter. Added code to round very low values up, so they will appear on meter - and graph. + and graph. - ONGOING: Style edits to improve readability and maintainability (removing hardcoded values, adding newlines to "if" conditions, etc). @@ -36,7 +36,7 @@ Version Description & cached mem are no longer being displayed; - Added -i & -s parameters to select startupmode, based on diff by Brendan Knox (knoxy@origob.demon.co.uk); - + 1.0b1 - Released 980513 - First initial stable public BETA release. diff --git a/wmmon/HINTS b/wmmon/HINTS index cbf50e4..583a0f3 100644 --- a/wmmon/HINTS +++ b/wmmon/HINTS @@ -4,7 +4,7 @@ Generic -------------------------------------------------------------- WMMon supports 5 commandline options: - -h (help); + -h (help); -v (prints); -d (display); -i (startup in DiskI/O mode); @@ -20,11 +20,11 @@ right: mycommand-3 & If wmmon detects a ~/.wmmonrc file, it will launch your defined command(s) when you click in the average load display area. -WMMon can cycle in realtime between CPU, Disk I/O and the +WMMon can cycle in realtime between CPU, Disk I/O and the SysInfo displays by simply left clicking on the upperleft gadget (which displays CPU info by default). -Be sure to drag WMMon on it's outer edges, WMMon is a bit picky +Be sure to drag WMMon on it's outer edges, WMMon is a bit picky due to the large gfx pixmap it keeps ;-) @@ -43,7 +43,7 @@ Afterstep users put the following in their .steprc Note: AfterStep's Wharf has a problem with pixmaps that are larger than 60x60 pixels. Please tell the AfterStep authors to fix this, this is not our fault, but a Wharf problem! - + Other WindowManagers -------------------------------------------------------------- diff --git a/wmmon/README b/wmmon/README index ba5cc9e..6fcc7a0 100644 --- a/wmmon/README +++ b/wmmon/README @@ -2,23 +2,23 @@ WMMon-1.0b2 - Public BETA release -------------------------------------------------------------- Authors...: Martijn Pieterse (pieterse@xs4all.nl) Antoine Nulle (warp@xs4all.nl) - + Note......: WMMon has it's own mailbox, as our pop3 accounts are already way too crowded :) Please mail bugreports, comments, suggestions, requests and flames to: dockapps@windowmaker.mezaway.org - + The official WMMon support website address: - + http://windowmaker.mezaway.org - + Credits...: Bobby Mezaway (bobby@mezaway.org) for generously - hosting our website! + hosting our website! Dave Harden (dharden@wisewire.com) for the major - speedup diffs! - + speedup diffs! + Description -------------------------------------------------------------- @@ -43,7 +43,7 @@ WMMon currently provides: There are some 'known' unfinished parts, be sure to read the TODO file, but we decided to release it early because of the high demand and many requests we got for this one ;) - + WMMon is being developped on DEC Alpha machines running Linux/RedHat-5.0, but, WMMon has been intensively tested on x86 and 68K Linux machines too ;-) @@ -59,11 +59,11 @@ BUGS Things you don't want to know ;-) CHANGES Description of changes. COPYING GNU General Public License Version 2. TODO Stuff we've planned for future WMMon releases. - + Bugs -------------------------------------------------------------- -If you discover any bugs in this software, please send a +If you discover any bugs in this software, please send a bugreport to dockapps@windowmaker.mezaway.org and describe the problem as detailed as you can. @@ -71,7 +71,7 @@ the problem as detailed as you can. Copyright -------------------------------------------------------------- WMMon.app is copyright (c) 1997, 1998 by Martijn Pieterse and -Antoine Nulle and licensed through the GNU General Public License. +Antoine Nulle and licensed through the GNU General Public License. Read the COPYING file for the complete GNU license. diff --git a/wmmon/TODO b/wmmon/TODO index af01ebb..e0d9cd2 100644 --- a/wmmon/TODO +++ b/wmmon/TODO @@ -7,7 +7,7 @@ This is a list of things we've already planned for WMMon-1.0: * Lower CPU usage (only in SysInfo mode) CPU and I/O mode are very low in CPU usage now ;-); * Multiple CPU support; - * GUI mode for simultanious CPU/IO/MEM&SWAP realtime + * GUI mode for simultanious CPU/IO/MEM&SWAP realtime loadbars (like Matt suggested ;-) ); Your feedback! If you have nice suggestions, ideas, whatever, diff --git a/wmmon/wmgeneral/list.c b/wmmon/wmgeneral/list.c index be7464f..a63562f 100644 --- a/wmmon/wmgeneral/list.c +++ b/wmmon/wmgeneral/list.c @@ -1,11 +1,11 @@ -/* Generic single linked list to keep various information +/* Generic single linked list to keep various information Copyright (C) 1993, 1994 Free Software Foundation, Inc. Author: Kresten Krab Thorup Many modifications by Alfredo K. Kojima - + This file is part of GNU CC. @@ -38,7 +38,7 @@ Boston, MA 02110-1301 USA. */ /* Return a cons cell produced from (head . tail) */ -INLINE LinkedList* +INLINE LinkedList* list_cons(void* head, LinkedList* tail) { LinkedList* cell; @@ -63,7 +63,7 @@ list_length(LinkedList* list) return i; } -/* Return the Nth element of LIST, where N count from zero. If N +/* Return the Nth element of LIST, where N count from zero. If N larger than the list length, NULL is returned */ INLINE void* @@ -84,7 +84,7 @@ list_nth(int index, LinkedList* list) INLINE void list_remove_head(LinkedList** list) { - if (!*list) return; + if (!*list) return; if ((*list)->tail) { LinkedList* tail = (*list)->tail; /* fetch next */ @@ -116,7 +116,7 @@ INLINE LinkedList * list_remove_elem(LinkedList* list, void* elem) { LinkedList *tmp; - + if (list) { if (list->head == elem) { tmp = list->tail; diff --git a/wmmon/wmgeneral/list.h b/wmmon/wmgeneral/list.h index 4b6b86f..92c3454 100644 --- a/wmmon/wmgeneral/list.h +++ b/wmmon/wmgeneral/list.h @@ -1,4 +1,4 @@ -/* Generic single linked list to keep various information +/* Generic single linked list to keep various information Copyright (C) 1993, 1994 Free Software Foundation, Inc. Author: Kresten Krab Thorup diff --git a/wmmon/wmgeneral/misc.c b/wmmon/wmgeneral/misc.c index f86481e..1f3bb2e 100644 --- a/wmmon/wmgeneral/misc.c +++ b/wmmon/wmgeneral/misc.c @@ -1,9 +1,9 @@ /* dock.c- built-in Dock module for WindowMaker - * + * * WindowMaker window manager - * + * * Copyright (c) 1997 Alfredo K. Kojima - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -28,7 +28,7 @@ *---------------------------------------------------------------------- * parse_command-- * Divides a command line into a argv/argc pair. - *---------------------------------------------------------------------- + *---------------------------------------------------------------------- */ #define PRC_ALPHA 0 #define PRC_BLANK 1 @@ -64,11 +64,11 @@ next_token(char *word, char **next) t = ret = malloc(strlen(word)+1); ptr = word; - + state = 0; *t = 0; while (1) { - if (*ptr==0) + if (*ptr==0) ctype = PRC_EOS; else if (*ptr=='\\') ctype = PRC_ESCAPE; @@ -98,12 +98,12 @@ next_token(char *word, char **next) t = strdup(ret); free(ret); - + if (ctype==PRC_EOS) *next = NULL; else *next = ptr; - + return t; } @@ -118,7 +118,7 @@ parse_command(char *command, char ***argv, int *argc) line = command; do { token = next_token(line, &line); - if (token) { + if (token) { list = list_cons(token, list); } } while (token!=NULL && line!=NULL); @@ -141,15 +141,15 @@ execCommand(char *command) int argc; parse_command(command, &argv, &argc); - + if (argv==NULL) { return 0; } - + if ((pid=fork())==0) { char **args; int i; - + args = malloc(sizeof(char*)*(argc+1)); if (!args) exit(10); diff --git a/wmmon/wmgeneral/wmgeneral.c b/wmmon/wmgeneral/wmgeneral.c index 34b4e05..b4865bc 100644 --- a/wmmon/wmgeneral/wmgeneral.c +++ b/wmmon/wmgeneral/wmgeneral.c @@ -128,7 +128,7 @@ static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) { err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap), &(wmgen->mask), &(wmgen->attributes)); - + if (err != XpmSuccess) { fprintf(stderr, "Not enough free colorcells.\n"); exit(1); @@ -175,9 +175,9 @@ static int flush_expose(Window w) { \*******************************************************************************/ void RedrawWindow(void) { - + flush_expose(iconwin); - XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, + 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, @@ -189,9 +189,9 @@ void RedrawWindow(void) { \*******************************************************************************/ void RedrawWindowXY(int x, int y) { - + flush_expose(iconwin); - XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, + 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, @@ -286,14 +286,14 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit int i; for (i=1; argv[i]; i++) { - if (!strcmp(argv[i], "-display")) + if (!strcmp(argv[i], "-display")) display_name = argv[++i]; else if (!strcmp(argv[i], "-geometry")) geometry = argv[++i]; } if (!(display = XOpenDisplay(display_name))) { - fprintf(stderr, "%s: can't open display %s\n", + fprintf(stderr, "%s: can't open display %s\n", wname, XDisplayName(display_name)); exit(1); } @@ -322,10 +322,10 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit 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); @@ -346,7 +346,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit XSetWMName(display, win, &name); /* Create GC for drawing */ - + gcm = GCForeground | GCBackground | GCGraphicsExposures; gcv.foreground = fore_pix; gcv.background = back_pix; diff --git a/wmmon/wmmon/Makefile b/wmmon/wmmon/Makefile index c49b0d3..a767ba0 100755 --- a/wmmon/wmmon/Makefile +++ b/wmmon/wmmon/Makefile @@ -15,7 +15,7 @@ CC = cc wmmon: $(OBJS) $(CC) $(LDFLAGS) -o wmmon $^ $(LIBDIR) $(LIBS) -debug: CFLAGS = -g3 +debug: CFLAGS = -g3 debug: wmmon clean:: diff --git a/wmmon/wmmon/wmmon-mask.xbm b/wmmon/wmmon/wmmon-mask.xbm index 3289657..43b85a4 100644 --- a/wmmon/wmmon/wmmon-mask.xbm +++ b/wmmon/wmmon/wmmon-mask.xbm @@ -1,10 +1,10 @@ #define wmmon_mask_width 128 #define wmmon_mask_height 64 static char wmmon_mask_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, 0x0f, diff --git a/wmmon/wmmon/wmmon.1 b/wmmon/wmmon/wmmon.1 index 9326f1f..ab8f22e 100644 --- a/wmmon/wmmon/wmmon.1 +++ b/wmmon/wmmon/wmmon.1 @@ -158,7 +158,7 @@ middle: xload .PP right: xcalc .PP -.PD +.PD .RE If diff --git a/wmmon/wmmon/wmmon.c b/wmmon/wmmon/wmmon.c index 48f1041..b1f5303 100644 --- a/wmmon/wmmon/wmmon.c +++ b/wmmon/wmmon/wmmon.c @@ -15,7 +15,7 @@ How do I create a not so solid window? How do I open a window? How do I use pixmaps? - + ------------------------------------------------------------ Authors: Martijn Pieterse (pieterse@xs4all.nl) @@ -58,8 +58,8 @@ 18/05/1998 (Antoine Nulle, warp@xs4all.nl) * MEM/SWAP/UPTIME only updated when visible * Using global file descriptors to reduce file - system overhead, both updates are based on a diff - supplied by Dave Harden (dharden@wisewire.com) + system overhead, both updates are based on a diff + supplied by Dave Harden (dharden@wisewire.com) 15/05/1998 (Antoine Nulle, warp@xs4all.nl) * Fixed memory overflow in the MEM gaugebar * MEM gauge displays now real used mem @@ -68,7 +68,7 @@ * Added -i & -s kludge for selecting startupmode, tijno, don't hate me for this :) 12/05/1998 (Antoine Nulle, warp@xs4all.nl) - * Finetuned master-xpm, tijno don't worry, no + * Finetuned master-xpm, tijno don't worry, no reprogramming needed this time ;-) 07/05/1998 (Martijn Pieterse, pieterse@xs4all.nl) * Added disk i/o @@ -214,7 +214,7 @@ typedef struct { stat_dev stat_device[MAX_STAT_DEVICES]; -char *left_action, *right_action, *middle_action; +char *left_action, *right_action, *middle_action; int nb_cpu, cpu_max; int getNbCPU(void); @@ -280,11 +280,11 @@ void wmmon_routine(int argc, char **argv) /* wbk - I don't fully understand this. Probably just a means of providing * test cases. ifdef'ing to clear compiler warnings. TODO: remove. */ #ifdef LEFT_ACTION - if (LEFT_ACTION) + if (LEFT_ACTION) left_action = strdup(LEFT_ACTION); #endif #ifdef RIGHT_ACTION - if (RIGHT_ACTION) + if (RIGHT_ACTION) right_action = strdup(RIGHT_ACTION); #endif #ifdef MIDDLE_ACTION @@ -330,7 +330,7 @@ void wmmon_routine(int argc, char **argv) exit(1); } - openXwindow(argc, argv, wmmon_master_xpm, wmmon_mask_bits, + openXwindow(argc, argv, wmmon_master_xpm, wmmon_mask_bits, wmmon_mask_width, wmmon_mask_height); /* add mouse region */ @@ -370,10 +370,10 @@ void wmmon_routine(int argc, char **argv) /* Draw statistics */ if (stat_current == 0) { - DrawStats(stat_device[stat_current].his, + DrawStats(stat_device[stat_current].his, HISTORY_ENTRIES-1, 40, 5, 58); } else if (stat_current == 1) { - DrawStats_io(stat_device[stat_current].his, + DrawStats_io(stat_device[stat_current].his, HISTORY_ENTRIES, 40, 5, 58); } @@ -393,7 +393,7 @@ void wmmon_routine(int argc, char **argv) if (stat_current < 2) { i = stat_current; - + /* Load ding is 45 pixels hoog */ copyXPMArea(0, 64, 32, 12, 28, 4); @@ -403,16 +403,16 @@ void wmmon_routine(int argc, char **argv) j = getWidth(stat_device[i].rt_stat, stat_device[i].rt_idle); copyXPMArea(32, 64, j, 6, 28, 4); /* Show max CPU */ - j = getWidth(stat_device[i].cpu_stat[cpu_max], + j = getWidth(stat_device[i].cpu_stat[cpu_max], stat_device[i].idle_stat[cpu_max]); copyXPMArea(32, 70, j, 6, 28, 10); } else { int cpu; for (cpu = 0; cpu < nb_cpu; cpu++) { - j = getWidth(stat_device[i].cpu_stat[cpu], + j = getWidth(stat_device[i].cpu_stat[cpu], stat_device[i].idle_stat[cpu]); - copyXPMArea(32, 65, j, - MAX_CPU / nb_cpu, 28, + copyXPMArea(32, 65, j, + MAX_CPU / nb_cpu, 28, 5 + (MAX_CPU / nb_cpu) * cpu); } } @@ -495,18 +495,18 @@ void wmmon_routine(int argc, char **argv) sd->his[j-1] = sd->his[j]; if (i == stat_current) { - if (i == 0) + if (i == 0) DrawStats(sd->his, HISTORY_ENTRIES - 1, 40, 5, 58); - else if (i == 1) + else if (i == 1) DrawStats_io(sd->his, HISTORY_ENTRIES - 1, 40, 5, 58); } sd->his[HISTORY_ENTRIES-1] = 0; sd->hisaddcnt = 0; - + } } RedrawWindowXY(xpm_X, xpm_Y); - + while (XPending(display)) { XNextEvent(display, &Event); switch (Event.type) { @@ -784,23 +784,23 @@ void get_statistics(char *devname, long *is, long *ds, long *idle, long *ds2, lo perror("get_statistics() seek failed\n"); /* wbk 20120308 These are no longer in /proc/stat. /proc/diskstats - * seems to be the closest replacement. Under modern BSD's, /proc is + * seems to be the closest replacement. Under modern BSD's, /proc is * now deprecated, so iostat() might be the answer. * http://www.gossamer-threads.com/lists/linux/kernel/314618 * has good info on this being removed from kernel. Also see * kernel sources Documentation/iostats.txt * - * TODO: We will end up with doubled values. We are adding the - * aggregate to the individual partition, due to device selection - * logic. Either grab devices' stats with numbers, or without (sda - * OR sda[1..10]. Could use strstr() return plus offset, but would - * have to be careful with bounds checking since we're in a - * limited buffer. Or just divide by 2 (inefficient). Shouldn't + * TODO: We will end up with doubled values. We are adding the + * aggregate to the individual partition, due to device selection + * logic. Either grab devices' stats with numbers, or without (sda + * OR sda[1..10]. Could use strstr() return plus offset, but would + * have to be careful with bounds checking since we're in a + * limited buffer. Or just divide by 2 (inefficient). Shouldn't * matter for graphing (we care about proportions, not numbers). */ while ((getline(&line, &line_size, fp_diskstats)) > 0) { if (strstr(line, "sd") || strstr(line, "sr")) { p = strtok(line, tokens); - /* skip 3 tokens, then use fields from + /* skip 3 tokens, then use fields from `* linux/Documentation/iostats.txt */ for (i = 1; i <= 6; i++) p = strtok(NULL, tokens); @@ -835,7 +835,7 @@ unsigned long getWidth(long actif, long idle) if (actif > 0 && j < 2) j = 2; - if (j > 32) + if (j > 32) j = 32; r = (unsigned long) j; @@ -951,8 +951,8 @@ void DrawStats_io(int *his, int num, int size, int x_left, int y_bottom) /* wbk - this should not be static. No need to track the scale, since * we always calculate it on the fly anyway. This static variable did - * not get re-initialized when we entered this function, so the scale - * would always grow and never shrink. + * not get re-initialized when we entered this function, so the scale + * would always grow and never shrink. */ /*static int global_io_scale = 1;*/ int io_scale = 1; diff --git a/wmmoonclock/changelog b/wmmoonclock/changelog index 24e5e8a..28853d4 100644 --- a/wmmoonclock/changelog +++ b/wmmoonclock/changelog @@ -53,7 +53,7 @@ * Now auto-detects 8-bit display and forces the LowColor pixmap to * be used. The -low option still works if you need to conserve colors * even on high-color displays. - * + * * Added 3 command line options + code to change colors of the data * entries: * @@ -85,9 +85,9 @@ * conversion of AGE....). * + Horizon Coords. Altitude is measured up from horizon to * Moon in degrees. Azimuth is in degrees from due south. - * + * * Also shuffled things around a bit... - * + * * * * Version 1.1 - released December 24, 1998. diff --git a/wmmoonclock/src/CalcEphem.c b/wmmoonclock/src/CalcEphem.c index 97d9ca9..fc4aefc 100644 --- a/wmmoonclock/src/CalcEphem.c +++ b/wmmoonclock/src/CalcEphem.c @@ -38,7 +38,7 @@ CTrans *c; /* structure containing all the relevent coord trans info */ - /* + /* * Compute Greenwich Mean Sidereal Time (gmst) * The TU here is number of Julian centuries * since 2000 January 1.5 @@ -47,14 +47,14 @@ CTrans *c; /* structure containing all the relevent coord trans info */ TU = (jd(year, month, day, 0.0) - 2451545.0)/36525.0; TU2 = TU*TU; TU3 = TU2*TU; - T0 = (6.0 + 41.0/60.0 + 50.54841/3600.0) + 8640184.812866/3600.0*TU + T0 = (6.0 + 41.0/60.0 + 50.54841/3600.0) + 8640184.812866/3600.0*TU + 0.093104/3600.0*TU2 - 6.2e-6/3600.0*TU3; T0 = hour24(T0); c->gmst = hour24(T0 + UT*1.002737909); /* convert to radians for ease later on */ - gmst = c->gmst*15.0*M_PI/180.0; + gmst = c->gmst*15.0*M_PI/180.0; lmst = 24.0*frac( (c->gmst - c->Glon/15.0) / 24.0 ); @@ -67,7 +67,7 @@ CTrans *c; /* structure containing all the relevent coord trans info */ * * Construct Transformation Matrix from GEI to GSE systems * - * + * * First compute: * mean ecliptic longitude of sun at epoch TU (varep) * elciptic longitude of perigee at epoch TU (varpi) @@ -91,7 +91,7 @@ CTrans *c; /* structure containing all the relevent coord trans info */ * centuries since epoch 2000 January 1.5 */ TU = (jd(year, month, day, TDT) - jd(2000, 1, 1, 12.0))/36525.0; - epsilon = (23.43929167 - 0.013004166*TU - 1.6666667e-7*TU*TU + epsilon = (23.43929167 - 0.013004166*TU - 1.6666667e-7*TU*TU - 5.0277777778e-7*TU*TU*TU)*RadPerDeg; c->epsilon = epsilon; @@ -102,8 +102,8 @@ CTrans *c; /* structure containing all the relevent coord trans info */ * The Mean Anomaly (M) * The True Anomaly (nu) * The Eccentric Anomaly via Keplers equation (E) - * - * + * + * */ days = jd(year, month, day, TDT) - jd(year, month, day, TDT); M = angle2pi(2.0*M_PI/365.242191*days + varep - varpi); @@ -112,14 +112,14 @@ CTrans *c; /* structure containing all the relevent coord trans info */ lambnew = angle2pi(nu + varpi); c->lambda_sun = lambnew; - + /* * Compute distance from earth to the sun */ r0 = 1.495985e8; /* in km */ earth_sun_distance = r0*(1-eccen*eccen)/(1.0 + eccen*cos(nu))/6371.2; c->earth_sun_dist = earth_sun_distance; - + @@ -181,12 +181,12 @@ CTrans *c; /* structure containing all the relevent coord trans info */ c->MoonAge = (TU - NewMoon(Ta, Tb, Tc))*36525.0; - + /* * Compute Earth-Moon distance */ c->EarthMoonDistance = R; - + } diff --git a/wmmoonclock/src/Makefile b/wmmoonclock/src/Makefile index b31bdfc..da08654 100644 --- a/wmmoonclock/src/Makefile +++ b/wmmoonclock/src/Makefile @@ -21,7 +21,7 @@ OBJS = wmMoonClock.o CalcEphem.o Moon.o MoonRise.o \ all: wmMoonClock.o wmMoonClock wmMoonClock.o: wmMoonClock_master.xpm wmMoonClock_mask.xbm CalcEphem.h -wmMoonClock: $(OBJS) +wmMoonClock: $(OBJS) $(CC) $(CFLAGS) $(SYSTEM) -o wmMoonClock $^ $(INCDIR) $(LIBDIR) $(LIBS) clean: diff --git a/wmmoonclock/src/Moon.c b/wmmoonclock/src/Moon.c index f7e001d..6cc4e21 100644 --- a/wmmoonclock/src/Moon.c +++ b/wmmoonclock/src/Moon.c @@ -31,7 +31,7 @@ double DL0, DL, DD, DGAM, DLS, DF; double L0, L, LS, F, D; double ARG = 0.0, FAC = 0.0; int MAX = 0, i, j; -double S; +double S; T2 = T*T; @@ -66,20 +66,20 @@ double S; for (i=1; i<=4; ++i){ switch (i){ - case 1: + case 1: ARG = L, MAX = 4, FAC = 1.000002208; break; - case 2: + case 2: ARG = LS, MAX = 3, FAC = 0.997504612 - 0.002495388*T; break; - case 3: + case 3: ARG = F, MAX = 4, FAC = 1.000002708 + 139.978*DGAM; break; - case 4: + case 4: ARG = D, MAX = 6, FAC = 1.0; break; } - + CO[6+0][i] = 1.0, CO[6+1][i] = cos(ARG)*FAC; SI[6+0][i] = 0.0, SI[6+1][i] = sin(ARG)*FAC; for (j=2; j<=MAX; ++j) addthe(CO[6+j-1][i], SI[6+j-1][i], CO[6+1][i], SI[6+1][i], &CO[6+j][i], &SI[6+j][i]); @@ -183,7 +183,7 @@ double S; addsol( 9.366, 0.71, 0.0 , -0.0112,1, 0,-2,-2); addsol( 0.202, 0.02, 0.0 , 0.0 ,1, 0,-2,-4); - /* + /* * Solar3 */ addsol( 0.415, 0.10, 0.0 , 0.0013,0, 1, 2, 0); @@ -378,11 +378,11 @@ double NewMoon(double ax, double bx, double cx){ /* - * MINI_MOON: low precision lunar coordinates (approx. 5'/1') - * T : time in Julian centuries since J2000 - * ( T=(JD-2451545)/36525 ) - * RA : right ascension (in h; equinox of date) - * DEC: declination (in deg; equinox of date) + * MINI_MOON: low precision lunar coordinates (approx. 5'/1') + * T : time in Julian centuries since J2000 + * ( T=(JD-2451545)/36525 ) + * RA : right ascension (in h; equinox of date) + * DEC: declination (in deg; equinox of date) * */ void MiniMoon(double T, double *RA, double *DEC){ @@ -390,7 +390,7 @@ void MiniMoon(double T, double *RA, double *DEC){ double L0,L,LS,F,D,H,S,N,DL,CB,L_MOON,B_MOON,V,W,X,Y,Z,RHO; double frac(), cosEPS, sinEPS, P2, ARC; - + cosEPS = 0.91748; sinEPS = 0.39778; P2 = 6.283185307; @@ -400,32 +400,32 @@ void MiniMoon(double T, double *RA, double *DEC){ /* * mean elements of lunar orbit */ - L0 = frac(0.606433+1336.855225*T); /* mean longitude Moon (in rev) */ + L0 = frac(0.606433+1336.855225*T); /* mean longitude Moon (in rev) */ L = P2*frac(0.374897+1325.552410*T); /* mean anomaly of the Moon */ LS = P2*frac(0.993133+ 99.997361*T); /* mean anomaly of the Sun */ D = P2*frac(0.827361+1236.853086*T); /* diff. longitude Moon-Sun */ F = P2*frac(0.259086+1342.227825*T); /* mean argument of latitude */ - DL = +22640.0*sin(L) - 4586.0*sin(L-2.0*D) + 2370.0*sin(2.0*D) + 769.0*sin(2.0*L) + DL = +22640.0*sin(L) - 4586.0*sin(L-2.0*D) + 2370.0*sin(2.0*D) + 769.0*sin(2.0*L) -668.0*sin(LS)- 412.0*sin(2.0*F) - 212.0*sin(2.0*L-2.0*D) - 206.0*sin(L+LS-2.0*D) +192.0*sin(L+2.0*D) - 165.0*sin(LS-2.0*D) - 125.0*sin(D) - 110.0*sin(L+LS) +148.0*sin(L-LS) - 55.0*sin(2.0*F-2.0*D); - S = F + (DL+412.0*sin(2.0*F)+541.0*sin(LS)) / ARC; + S = F + (DL+412.0*sin(2.0*F)+541.0*sin(LS)) / ARC; H = F-2.0*D; - N = -526.0*sin(H) + 44.0*sin(L+H) - 31.0*sin(-L+H) - 23.0*sin(LS+H) + N = -526.0*sin(H) + 44.0*sin(L+H) - 31.0*sin(-L+H) - 23.0*sin(LS+H) + 11.0*sin(-LS+H) -25.0*sin(-2.0*L+F) + 21.0*sin(-L+F); L_MOON = P2 * frac ( L0 + DL/1296e3 ); /* in rad */ B_MOON = ( 18520.0*sin(S) + N ) / ARC; /* in rad */ /* equatorial coordinates */ CB = cos(B_MOON); - X = CB*cos(L_MOON); - V = CB*sin(L_MOON); + X = CB*cos(L_MOON); + V = CB*sin(L_MOON); W = sin(B_MOON); - Y = cosEPS*V-sinEPS*W; - Z = sinEPS*V+cosEPS*W; + Y = cosEPS*V-sinEPS*W; + Z = sinEPS*V+cosEPS*W; RHO = sqrt(1.0-Z*Z); - *DEC = (360.0/P2)*atan2(Z, RHO); - *RA = ( 48.0/P2)*atan2(Y, X+RHO); + *DEC = (360.0/P2)*atan2(Z, RHO); + *RA = ( 48.0/P2)*atan2(Y, X+RHO); if (*RA<0.0) *RA += 24.0; diff --git a/wmmoonclock/src/MoonRise.c b/wmmoonclock/src/MoonRise.c index 2ecc105..9fcb541 100644 --- a/wmmoonclock/src/MoonRise.c +++ b/wmmoonclock/src/MoonRise.c @@ -159,7 +159,7 @@ double SinH(int year, int month, int day, double UT){ * Compute Greenwich Mean Sidereal Time (gmst) */ UT = 24.0*frac( UT/24.0 ); - /* this is for the ephemeris meridian??? + /* this is for the ephemeris meridian??? gmst = 6.697374558 + 1.0027379093*UT + (8640184.812866+(0.093104-6.2e-6*TU)*TU)*TU/3600.0; */ gmst = UT + 6.697374558 + (8640184.812866+(0.093104-6.2e-6*TU)*TU)*TU/3600.0; diff --git a/wmmoonclock/src/wmMoonClock.1 b/wmmoonclock/src/wmMoonClock.1 index cd6bdf8..db6c05f 100644 --- a/wmmoonclock/src/wmMoonClock.1 +++ b/wmmoonclock/src/wmMoonClock.1 @@ -1,4 +1,4 @@ -.TH WMMOONCLOCK 1 "21 December 1998" +.TH WMMOONCLOCK 1 "21 December 1998" .SH NAME WMMOONCLOCK \- Dockable Moon Phase Clock .SH SYNOPSIS @@ -15,11 +15,11 @@ are; Shows the Moon phase image. .TP .B Second Page -Shows the current Local Time (LT) and Universal Time (UT), the Moon's Age -(number of days since last new moon), the geometric (as opposed to temporal) -fraction of the way through the current lunar cyle (e.g. 50\% for full moon), the -fraction of the Moon's disc that is illuminated (ratio of area illuminated to -total area of disc) and whether the Moon is (locally) visible of not (i.e. is +Shows the current Local Time (LT) and Universal Time (UT), the Moon's Age +(number of days since last new moon), the geometric (as opposed to temporal) +fraction of the way through the current lunar cyle (e.g. 50\% for full moon), the +fraction of the Moon's disc that is illuminated (ratio of area illuminated to +total area of disc) and whether the Moon is (locally) visible of not (i.e. is it above the horizon?). .TP .B Third Page @@ -27,21 +27,21 @@ Shows the Rise and Set times for yesterday (first line), today (middle line), an tommorrow (last line). If the Moon does not rise or set on a given day a `null time' is shown (\-\-:\-\-). Note that these times should still be good for high latitude observers. Also note that there will always be at least one (\-\-:\-\-) -showing up per month. This is because once per month the Moon will rise (set) on +showing up per month. This is because once per month the Moon will rise (set) on a given day but will set (rise) in the very early portion of the next day. .TP .B Fourth Page Shows the Moon's horizon coordinates (i.e. the Altitude/Azimuth system). Azimuth is -measured in degrees CCW from due south, and altitude is measured in degrees from +measured in degrees CCW from due south, and altitude is measured in degrees from the horizon up to the Moon. Distance (Dist) is measured in units on Earth radii (1 Re is about 6370km). Note that this is a local coordinate system and will not be correct if the observer's latitude and longitude are not set correctly. .TP .B Fifth Page -Shows the Moon's ecliptic coordinates. (i.e. the Right Ascention/Declination system). +Shows the Moon's ecliptic coordinates. (i.e. the Right Ascention/Declination system). Useful for astronomers? .PP -Many of the quantities shown will not be correct unless LT and UT are correct, and the user +Many of the quantities shown will not be correct unless LT and UT are correct, and the user specifies the proper latitude and longitude. .SH OPTIONS .TP diff --git a/wmmoonclock/src/wmMoonClock.c b/wmmoonclock/src/wmMoonClock.c index 2c46973..af9bdbb 100644 --- a/wmmoonclock/src/wmMoonClock.c +++ b/wmmoonclock/src/wmMoonClock.c @@ -1,12 +1,12 @@ /* * * wmMoonClock-1.26 (C) 1998, 1999 Mike Henderson (mghenderson@lanl.gov) - * + * * - Shows Moon Phase.... - * - * - * - * + * + * + * + * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,11 +20,11 @@ * * You should have received a copy of the GNU General Public License * along with this program (see the file COPYING); if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA * * Things TODO: - * - clean up code! + * - clean up code! * - more detailed documentation. * - reduce size of pixmap! Dont need it in one pixmap. * Aslo, does the hi-color pixmap really need all those colors? @@ -34,8 +34,8 @@ * as costly as the Moon calcs.) Sun posiiton is calculated but not used yet... * - Next new moons, next full moons, next quarters, etc... * - Moon names. I.e. Harvest, Blue, etc... - * - * + * + * * * Changes: * Version 1.27 - released June 7, 1999. @@ -47,44 +47,44 @@ * Now auto-detects 8-bit display and forces the LowColor pixmap to * be used. The -low option still works if you need to conserve colors * even on high-color displays. - * + * * Added 3 command line options + code to change colors of the data * entries: - * - * -bc to change background color. - * -lc to change color of labels and headers. + * + * -bc to change background color. + * -lc to change color of labels and headers. * -dc to change color of data values. - * + * * Version 1.24 - released February 9, 1999. * Added low color support via the -low command line option. - * + * * Version 1.23 - released February 4, 1999. * cosmetic for AfterStep users. removed spurious black line at RHS edge an mask. * - * Version 1.22 - released January 8, 1999. + * Version 1.22 - released January 8, 1999. * * + Changed PI2 to TwoPi in Moon.c -- Linux Pyth. had probs because * PI2 was defined in . * - * Version 1.21 - released January 7, 1999. - * + * Version 1.21 - released January 7, 1999. + * * + minor bug fixes in Makefile and manpage. * - * Version 1.2 - released January 3, 1999. + * Version 1.2 - released January 3, 1999. * Added: * * + Local Time/ Universal Time display. * + Visible: Yes/No to indicate if Moon is up or not. * + Frac (percent through orbit -- this is NOT a simple * conversion of AGE....). - * + Horizon Coords. Altitude is measured up from horizon to + * + Horizon Coords. Altitude is measured up from horizon to * Moon in degrees. Azimuth is in degrees from due south. - * + * * Also shuffled things around a bit... - * * * - * Version 1.1 - released December 24, 1998. + * + * Version 1.1 - released December 24, 1998. * Fixed bug in AGE calculation. It now should be highly accurate. * Note that AGE is not the same as Phase*29.530589 ... * I have checked with the Astronomical Almanac and it agrees very @@ -101,8 +101,8 @@ -/* - * Includes +/* + * Includes */ #include #include @@ -120,8 +120,8 @@ -/* - * Delay between refreshes (in microseconds) +/* + * Delay between refreshes (in microseconds) */ #define DELAY 1000000L #define WMMOONCLOCK_VERSION "1.27" @@ -137,7 +137,7 @@ void print_usage(); int ToggleWindow = 0; int nMAX = 1; -int Flag = 1; +int Flag = 1; double Glat, Glon, SinGlat, CosGlat, TimeZone; int UseLowColorPixmap = 0; char LabelColor[30] = "#a171ff"; @@ -149,8 +149,8 @@ char BackColor[30] = "#010101"; -/* - * main +/* + * main */ int main(int argc, char *argv[]) { @@ -172,7 +172,7 @@ int main(int argc, char *argv[]) { - + /* * Parse any command line arguments. */ @@ -180,9 +180,9 @@ int main(int argc, char *argv[]) { ParseCMDLine(argc, argv); c.Glat = Glat, c.Glon = Glon; Glat *= RadPerDeg; SinGlat = sin( Glat ); CosGlat = cos( Glat ); - - + + initXwindow(argc, argv); if ((DisplayDepth <= 8)||UseLowColorPixmap) openXwindow(argc, argv, wmMoonClock_masterLow, wmMoonClock_mask_bits, wmMoonClock_mask_width, wmMoonClock_mask_height, BackColor, LabelColor, DataColor); @@ -192,7 +192,7 @@ int main(int argc, char *argv[]) { - + /* * Loop until we die */ @@ -218,7 +218,7 @@ int main(int argc, char *argv[]) { n = 0; - CurrentGMTTime = time(CurrentTime); GMTTime = gmtime(&CurrentGMTTime); + CurrentGMTTime = time(CurrentTime); GMTTime = gmtime(&CurrentGMTTime); UT = GMTTime->tm_hour + GMTTime->tm_min/60.0 + GMTTime->tm_sec/3600.0; Year = GMTTime->tm_year+1900; Month = GMTTime->tm_mon+1; @@ -267,7 +267,7 @@ int main(int argc, char *argv[]) { /* - * Paste up LT and UT. + * Paste up LT and UT. */ val = LocalHour; H = (int)val; val = (val - H)*60.0; @@ -294,7 +294,7 @@ int main(int argc, char *argv[]) { /* - * Paste up AGE. + * Paste up AGE. */ val = c.MoonAge; q = (val < 10.0) ? 5 : 0; @@ -312,7 +312,7 @@ int main(int argc, char *argv[]) { /* - * Paste up Phase (Percent Illuminated). + * Paste up Phase (Percent Illuminated). */ val = 0.5*( 1.0 - cos(c.MoonPhase*6.2831853) ); val *= 100.0; @@ -335,7 +335,7 @@ int main(int argc, char *argv[]) { /* - * Paste up Frac (Percent of way through current lunar cycle). + * Paste up Frac (Percent of way through current lunar cycle). */ val = c.MoonPhase*100.0; A = (int)(val+0.5); @@ -355,7 +355,7 @@ int main(int argc, char *argv[]) { /* - * Paste up Visible Status. + * Paste up Visible Status. */ if (c.Visible) copyXPMArea(6, 327, 13, 6, 46, 51); @@ -383,8 +383,8 @@ int main(int argc, char *argv[]) { /* * Do Yesterday's first */ - MoonRise(Year, Month, DayOfMonth-1, LocalHour, &UTRise, &UTSet); - UTTohhmm(UTRise, &H, &M); + MoonRise(Year, Month, DayOfMonth-1, LocalHour, &UTRise, &UTSet); + UTTohhmm(UTRise, &H, &M); if (H >= 0){ digit = H/10; copyXPMArea(67+digit*5, 353, 5, 7, 7, 19); digit = H%10; copyXPMArea(67+digit*5, 353, 5, 7, 7+5, 19); @@ -396,7 +396,7 @@ int main(int argc, char *argv[]) { copyXPMArea(117, 354, 1, 4, 7+10, 20); copyXPMArea(57, 355, 5, 1, 7+12, 22); copyXPMArea(57, 355, 5, 1, 7+17, 22); } - UTTohhmm(UTSet, &H, &M); + UTTohhmm(UTSet, &H, &M); if (H >= 0){ digit = H/10; copyXPMArea(67+digit*5, 353, 5, 7, 35, 19); digit = H%10; copyXPMArea(67+digit*5, 353, 5, 7, 35+5, 19); @@ -414,7 +414,7 @@ int main(int argc, char *argv[]) { * Plot up todays Rise/Set times. */ MoonRise(Year, Month, DayOfMonth, LocalHour, &UTRise, &UTSet); - UTTohhmm(UTRise, &H, &M); + UTTohhmm(UTRise, &H, &M); if (H >= 0){ digit = H/10; copyXPMArea(67+digit*5, 353, 5, 7, 7, 29); digit = H%10; copyXPMArea(67+digit*5, 353, 5, 7, 7+5, 29); @@ -426,7 +426,7 @@ int main(int argc, char *argv[]) { copyXPMArea(117, 354, 1, 4, 7+10, 30); copyXPMArea(57, 355, 5, 1, 7+12, 32); copyXPMArea(57, 355, 5, 1, 7+17, 32); } - UTTohhmm(UTSet, &H, &M); + UTTohhmm(UTSet, &H, &M); if (H >= 0){ digit = H/10; copyXPMArea(67+digit*5, 353, 5, 7, 35, 29); digit = H%10; copyXPMArea(67+digit*5, 353, 5, 7, 35+5, 29); @@ -445,7 +445,7 @@ int main(int argc, char *argv[]) { * Plot up tomorrow's Rise/Set times. */ MoonRise(Year, Month, DayOfMonth+1, LocalHour, &UTRise, &UTSet); - UTTohhmm(UTRise, &H, &M); + UTTohhmm(UTRise, &H, &M); if (H >= 0){ digit = H/10; copyXPMArea(67+digit*5, 353, 5, 7, 7, 39); digit = H%10; copyXPMArea(67+digit*5, 353, 5, 7, 7+5, 39); @@ -457,7 +457,7 @@ int main(int argc, char *argv[]) { copyXPMArea(117, 354, 1, 4, 7+10, 40); copyXPMArea(57, 355, 5, 1, 7+12, 42); copyXPMArea(57, 355, 5, 1, 7+17, 42); } - UTTohhmm(UTSet, &H, &M); + UTTohhmm(UTSet, &H, &M); if (H >= 0){ digit = H/10; copyXPMArea(67+digit*5, 353, 5, 7, 35, 39); digit = H%10; copyXPMArea(67+digit*5, 353, 5, 7, 35+5, 39); @@ -497,7 +497,7 @@ int main(int argc, char *argv[]) { D = (int)val; val = (val-(double)D)*100.0; M = (int)val; - + if (sgn < 0) copyXPMArea(120, 357, 2, 1, 19, 27); /* degrees 100's */ @@ -534,7 +534,7 @@ int main(int argc, char *argv[]) { D = (int)val; val = (val-(double)D)*100.0; M = (int)val; - + if (sgn < 0) copyXPMArea(120, 357, 2, 1, 19, 39); /* degrees 10's */ @@ -559,7 +559,7 @@ int main(int argc, char *argv[]) { /* - * Paste up Earth-Moon Distance (in units of Earth radii). + * Paste up Earth-Moon Distance (in units of Earth radii). */ val = c.EarthMoonDistance; A = (int)val; @@ -598,7 +598,7 @@ int main(int argc, char *argv[]) { RA = (RA-(double)H)*60.0; M = (int)RA; RA = (RA-(double)M)*60.0; S = (int)(RA+0.5); - + /* hours 10's */ digit = H/10; copyXPMArea(67+digit*5, 353, 5, 7, 17, 25); @@ -640,7 +640,7 @@ int main(int argc, char *argv[]) { M = (int)DEC; DEC = (DEC-(double)M)*60.0; S = (int)(DEC+0.5); - + if (sgn < 0) copyXPMArea(120, 357, 2, 1, 14, 39); @@ -675,7 +675,7 @@ int main(int argc, char *argv[]) { /* - * Paste up Earth-Moon Distance (in units of Earth radii). + * Paste up Earth-Moon Distance (in units of Earth radii). */ val = c.EarthMoonDistance; A = (int)val; @@ -689,14 +689,14 @@ int main(int argc, char *argv[]) { - } + } } else { /* - * Update the counter. + * Update the counter. */ ++n; @@ -714,7 +714,7 @@ int main(int argc, char *argv[]) { - /* + /* * Process any pending X events. */ while(XPending(display)){ @@ -735,9 +735,9 @@ int main(int argc, char *argv[]) { - - /* - * Redraw and wait for next update + + /* + * Redraw and wait for next update */ RedrawWindow(); timeout.tv_sec = DELAY / 1000000L; @@ -758,14 +758,14 @@ int main(int argc, char *argv[]) { -/* - * ParseCMDLine() +/* + * ParseCMDLine() */ void ParseCMDLine(int argc, char *argv[]) { int i; char *eptr; - + for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "-display")){ @@ -836,7 +836,7 @@ void ParseCMDLine(int argc, char *argv[]) { } } else { - + print_usage(); exit(1); } diff --git a/wmmoonclock/src/xutils.c b/wmmoonclock/src/xutils.c index 40ecec0..25d2e1f 100644 --- a/wmmoonclock/src/xutils.c +++ b/wmmoonclock/src/xutils.c @@ -1,10 +1,10 @@ /* * xutils.c - A collection of X-windows utilties for creating WindowMAker - * DockApps. + * DockApps. * * This file contains alot of the lower-level X windows routines. Origins with wmppp * (by Martijn Pieterse (pieterse@xs4all.nl)), but its been hacked up quite a bit - * and passed on from one new DockApp to the next. + * and passed on from one new DockApp to the next. * * * @@ -27,7 +27,7 @@ * * * - */ + */ #include #include #include @@ -42,7 +42,7 @@ /* - * X11 Variables + * X11 Variables */ int x_fd; XSizeHints mysizehints; @@ -85,7 +85,7 @@ static int flush_expose(Window w) { * RedrawWindowXY */ void RedrawWindow(void) { - + flush_expose(iconwin); XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, 0,0, wmgen.attributes.width, wmgen.attributes.height, 0, 0); @@ -95,7 +95,7 @@ void RedrawWindow(void) { } 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); @@ -159,8 +159,8 @@ void initXwindow(int argc, char *argv[]){ /* * openXwindow */ -void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, - int pixmask_width, int pixmask_height, char *BackColor, char *LabelColor, +void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, + int pixmask_width, int pixmask_height, char *BackColor, char *LabelColor, char *DataColor) { unsigned int borderwidth = 1; @@ -175,9 +175,9 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit {"DataColor", NULL, 0}}; - - /* + + /* * Create Pixmap */ cols[0].pixel = getColor(BackColor, 1.0); @@ -187,9 +187,9 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit wmgen.attributes.colorsymbols = cols; wmgen.attributes.exactColors = False; wmgen.attributes.closeness = 40000; - wmgen.attributes.valuemask = XpmReturnPixels | XpmReturnExtensions | XpmColorSymbols + wmgen.attributes.valuemask = XpmReturnPixels | XpmReturnExtensions | XpmColorSymbols | XpmExactColors | XpmCloseness | XpmSize; - if (XpmCreatePixmapFromData(display, Root, pixmap_bytes, + if (XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen.pixmap), &(wmgen.mask), &(wmgen.attributes)) != XpmSuccess){ fprintf(stderr, "Not enough free colorcells.\n"); exit(1); @@ -198,8 +198,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit - /* - * Create a window + /* + * Create a window */ mysizehints.flags = USSize | USPosition; mysizehints.x = 0; @@ -213,19 +213,19 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit 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); - /* - * Activate hints + /* + * Activate hints */ XSetWMNormalHints(display, win, &mysizehints); classHint.res_name = wname; @@ -240,11 +240,11 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit * effect. I.e. for some you will need to Grab the focus and then return * it after you are done... */ - XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask - | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask + XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask + | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask | KeyPressMask | KeyReleaseMask); - XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask - | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask + XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask + | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask | KeyPressMask | KeyReleaseMask); @@ -256,8 +256,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit XSetWMName(display, win, &name); - /* - * Create Graphics Context (GC) for drawing + /* + * Create Graphics Context (GC) for drawing */ gcm = GCForeground | GCBackground | GCGraphicsExposures; gcv.foreground = fore_pix; diff --git a/wmmoonclock/src/xutils.h b/wmmoonclock/src/xutils.h index aa8a795..586942b 100644 --- a/wmmoonclock/src/xutils.h +++ b/wmmoonclock/src/xutils.h @@ -4,7 +4,7 @@ /* - * Typedefs + * Typedefs */ typedef struct { Pixmap pixmap; @@ -21,7 +21,7 @@ typedef struct { Display *display; Window Root; Window iconwin, win; -int screen; +int screen; int DisplayDepth; diff --git a/wmnet/Changelog b/wmnet/Changelog index de568d1..36e0c59 100644 --- a/wmnet/Changelog +++ b/wmnet/Changelog @@ -1,26 +1,26 @@ - 3/24/1998 -- First release, wrote this yesterday, so it may have + 3/24/1998 -- First release, wrote this yesterday, so it may have some bugs. - 3/25/1998 -- added logarithmic scaling. - some touch ups on the updateSpeedometer() to be a + 3/25/1998 -- added logarithmic scaling. + some touch ups on the updateSpeedometer() to be a little more helpful added a little more width to the speedometer display from a report that the text sometimes was drawn off the scale (couldnt confirm, is it fixed?) - fixed prob for speeds > 9.9 megabytes per second (I - think... I can't go that fast myself - Made default maxspeed 6000 which I assume is better + fixed prob for speeds > 9.9 megabytes per second (I + think... I can't go that fast myself + Made default maxspeed 6000 which I assume is better for modems. - 5/11/1998 -- I witnessed the little problem with the speedometer + 5/11/1998 -- I witnessed the little problem with the speedometer going off into the main window so I set a clipmask - Still don't understand how it could go off..I'm + Still don't understand how it could go off..I'm using a fixed size font... 5/13/1998 -- Modified the way it gets its stats from /proc/net/ip_acct You now have to give it explicit accounting rule numbers through the -T and -R options or else it defaults to the fist two in tx, rx order, best just to make sure you set the -T and -R options. - 5/15/1998 -- Completed interface rewrite, definitely have more graphing + 5/15/1998 -- Completed interface rewrite, definitely have more graphing space, but I dont know if I like it yet. - 5/16/1998 -- Added shaded graphs, xload style. Its a lot prettier! + 5/16/1998 -- Added shaded graphs, xload style. Its a lot prettier! 8/6/1998 -- Put in the stat driver interface and some drivers 5/4/2000 -- Added support for OpenBSD, thanks to Vladimir Popov diff --git a/wmnet/Imakefile b/wmnet/Imakefile index bd6b114..460c298 100644 --- a/wmnet/Imakefile +++ b/wmnet/Imakefile @@ -1,4 +1,4 @@ -DEPLIBS = $(DEPXLIB) +DEPLIBS = $(DEPXLIB) CC = gcc -Wall #ifdef LinuxArchitecture @@ -7,12 +7,12 @@ DEFINES = -Dlinux_libc5 #if LinuxCLibMajorVersion > 5 DEFINES = -Dlinux_libc6 #endif -LOCAL_LIBRARIES = $(XLIB) -lm +LOCAL_LIBRARIES = $(XLIB) -lm #endif #if defined (FreeBSDArchitecture) || defined (OpenBSDArchitecture) LOCAL_LIBRARIES = $(XLIB) -lm -lkvm -INSTPGMFLAGS = -s -g kmem -m 2755 +INSTPGMFLAGS = -s -g kmem -m 2755 #endif LINTLIBS = $(LINTXLIB) diff --git a/wmnet/README b/wmnet/README index a5975da..b46a310 100644 --- a/wmnet/README +++ b/wmnet/README @@ -24,19 +24,19 @@ session to downloadeding something from across the hall at 600 kb/sec. I tried to keep this is as small and efficient as possible CPU time on my K5 PR100 with the default poll time of 25000 microseconds (1 microsecond -== 1 millionth of a second.) is less than 20 seconds per 24 hours +== 1 millionth of a second.) is less than 20 seconds per 24 hours Which is less than even wmmixer uses for me. wmnet now uses drivers to get stats. The existing stat driver from previous -versions has been moved to the ipfwadm driver. To get some generic IP +versions has been moved to the ipfwadm driver. To get some generic IP accounting rules using ipfwadm: -ipfwadm -A in -i -S 0.0.0.0/0 +ipfwadm -A in -i -S 0.0.0.0/0 ipfwadm -A out -i -D 0.0.0.0/0 I have also included a couple drivers for Linux 2.1. You can either use -ipchains or general device stats received from /proc/net/dev. If you don't +ipchains or general device stats received from /proc/net/dev. If you don't want to fool around with IP chains, use the devstats driver and specify the interface to monitor useing the --device option. To get a generic set of ip chains rules for the ipchains driver: @@ -58,14 +58,14 @@ traffic bandwidth. However, using this option as a normal user requires wmnet to be suid root, which is something many people dispise so it is not suid by default. To make wmnet suid, as root: -chmod u+s /usr/X11R6/bin/wmnet +chmod u+s /usr/X11R6/bin/wmnet Please only do this if you need to. I did write this program with it possibly being suid in mind so I am fairly confident that this can be suid without any security concerns. But then again, thats what they all say. Read the code then judge for yourself if need be, I WONT have it done automatically for you. Really the only 'if' is the GNU libc -getopt_long() function. +getopt_long() function. For those afterstep users out there using wmnet, you may have noticed that when wmnet is swallowed, the whole thing is not visible. This is due to @@ -83,12 +83,12 @@ http://www.digitalkaos.net/linux/wmnet/ -TO INSTALL from tar.gz: -tar xfzv wmnet-1.06.tar.gz -cd wmnet-1.06 -xmkmf -make -strip wmnet +TO INSTALL from tar.gz: +tar xfzv wmnet-1.06.tar.gz +cd wmnet-1.06 +xmkmf +make +strip wmnet make install make install.man diff --git a/wmnet/config.h b/wmnet/config.h index fe50fab..ec3d04b 100644 --- a/wmnet/config.h +++ b/wmnet/config.h @@ -1,12 +1,12 @@ #if defined (__FreeBSD__) || defined (__OpenBSD__) -/* Our only FreeBSD driver, this goes straight into kernel memory +/* Our only FreeBSD driver, this goes straight into kernel memory * and reads the raw structures from right underneath the kernel using the - * kvm library. This made the code a require a little more thought, but - * the end result is a statistics driver thats faster than the linux ones + * kvm library. This made the code a require a little more thought, but + * the end result is a statistics driver thats faster than the linux ones * (with the possible exception of the LINUX_PPP driver). However, none * of them really vary by any appreciable amount. You can monitor whole - * interfaces only with this driver. + * interfaces only with this driver. */ # define USE_KVM @@ -19,7 +19,7 @@ /* this driver uses a socket ioctl() to get stats from a ppp type interface * Define this if you will be using wmnet mostly to watch your ppp stats. * The advantage to this driver is that you don't need to mess around with - * IP accounting rules. + * IP accounting rules. */ #define USE_LINUX_PPP @@ -28,7 +28,7 @@ -/* This driver uses the 2.0 kernel's IP accounting rules to gather data +/* This driver uses the 2.0 kernel's IP accounting rules to gather data * You set two rules up using the ipfwadm command and wmnet will watch * them. You DO need a 2.0 kernel and IP accounting enabled in your kernel */ diff --git a/wmnet/drivers.c b/wmnet/drivers.c index 2064bf6..d74f32e 100644 --- a/wmnet/drivers.c +++ b/wmnet/drivers.c @@ -2,11 +2,11 @@ * Copyright 1998 Jesse B. Off * * $Id: drivers.c,v 1.1 1998/10/07 03:42:21 joff Exp joff $ - * + * * This software is released under the GNU Public License agreement. * No warranties, whatever.... you know the usuals.... this is free * software. if you use it, great... if you wanna make a change to it, - * great, but please send me the diff. + * great, but please send me the diff. */ #include @@ -125,9 +125,9 @@ char* available_drivers(void) { ind++; } *(--string) = '\0'; - return ptr; -} - + return ptr; +} + parser_func find_driver(void) { @@ -145,7 +145,7 @@ parser_func find_driver(void) { parser_func setup_driver(char * parser_name) { int ind = 0; - if (parser_name == NULL) return find_driver(); + if (parser_name == NULL) return find_driver(); while(drivers[ind].name != NULL) { if(!strcmp(parser_name, drivers[ind].name)) { if (drivers[ind].test()) return drivers[ind].function; @@ -157,15 +157,15 @@ parser_func setup_driver(char * parser_name) { fprintf(stderr, "wmnet: no driver %s\n", parser_name); exit(18); } - + #ifdef linux -/* All the data gathering is done in here. +/* All the data gathering is done in here. * Return True if no change to tx/rx. * Return False if display will need to be updated. - */ + */ #ifdef USE_IPFWADM int ipfwadm_test(void) { if(open("/proc/net/ip_acct", O_RDONLY) == -1) return False; @@ -195,37 +195,37 @@ int updateStats_ipfwadm(void) { /* accounting in */ flag |= ACCOUNT_IN_FOUND; while(buffer[offset++] != ' '); - offset += 18; - totalpackets_in = strtoul(&buffer[offset], &ptr, 10); + offset += 18; + totalpackets_in = strtoul(&buffer[offset], &ptr, 10); if (totalpackets_in == lastpackets_in) break; totalbytes_in = strtoul(ptr, NULL, 10); diffpackets_in += totalpackets_in - lastpackets_in; diffbytes_in += totalbytes_in - lastbytes_in; lastpackets_in = totalpackets_in; lastbytes_in = totalbytes_in; - rx = True; + rx = True; break; case ACCOUNT_OUT_FOUND: /* accounting out */ flag |= ACCOUNT_OUT_FOUND; while(buffer[offset++] != ' '); - offset += 18; - totalpackets_out = strtoul(&buffer[offset], &ptr, 10); + offset += 18; + totalpackets_out = strtoul(&buffer[offset], &ptr, 10); if (totalpackets_out == lastpackets_out) break; totalbytes_out = strtoul(ptr, NULL, 10); diffpackets_out += totalpackets_out - lastpackets_out; diffbytes_out += totalbytes_out - lastbytes_out; lastpackets_out = totalpackets_out; lastbytes_out = totalbytes_out; - tx = True; + tx = True; break; } lineno++; offset = 37; } - + if(flag != (ACCOUNT_IN_FOUND|ACCOUNT_OUT_FOUND)) { - fprintf(stderr,"wmnet: couldn't find %s accounting rule to monitor in /proc/net/ip_acct\n", + fprintf(stderr,"wmnet: couldn't find %s accounting rule to monitor in /proc/net/ip_acct\n", (flag == ACCOUNT_IN_FOUND) ? "the TX" : ((flag == ACCOUNT_OUT_FOUND) ? "the RX" : "a single")); exit(4); } @@ -233,7 +233,7 @@ int updateStats_ipfwadm(void) { /* return True if no change to tx/rx * return False if display will need to be updated - */ + */ return((rx == current_rx) && (tx == current_tx)); } @@ -271,37 +271,37 @@ int updateStats_ipchains(void) { sscanf(buffer, "%30s %*s - %*d %*d %*d %*d %lu %*d %lu", name, &pack, &bytes); - + if(strcmp(name, in_rule_string) == 0) { flag |= ACCOUNT_IN_FOUND; - totalpackets_in = pack; + totalpackets_in = pack; if (totalpackets_in != lastpackets_in) { totalbytes_in = bytes; diffpackets_in += totalpackets_in - lastpackets_in; diffbytes_in += totalbytes_in - lastbytes_in; lastpackets_in = totalpackets_in; lastbytes_in = totalbytes_in; - rx = True; + rx = True; } - + } else if (strcmp(name, out_rule_string) == 0) { flag |= ACCOUNT_OUT_FOUND; - - totalpackets_out = pack; + + totalpackets_out = pack; if (totalpackets_out != lastpackets_out) { totalbytes_out = bytes; diffpackets_out += totalpackets_out - lastpackets_out; diffbytes_out += totalbytes_out - lastbytes_out; lastpackets_out = totalpackets_out; lastbytes_out = totalbytes_out; - tx = True; + tx = True; } } } - + if(flag != (ACCOUNT_IN_FOUND|ACCOUNT_OUT_FOUND)) { - fprintf(stderr,"I couldn't find %s IP chain to monitor in /proc/net/ip_fwchains.\n", + fprintf(stderr,"I couldn't find %s IP chain to monitor in /proc/net/ip_fwchains.\n", (flag == ACCOUNT_IN_FOUND) ? "the TX" : ((flag == ACCOUNT_OUT_FOUND) ? "the RX" : "a single")); exit(4); } @@ -309,7 +309,7 @@ int updateStats_ipchains(void) { /* return True if no change to tx/rx * return False if display will need to be updated - */ + */ return((rx == current_rx) && (tx == current_tx)); } @@ -345,37 +345,37 @@ int updateStats_dev(void) { *ptr = '\0'; if (!strcmp(name, device)) { - + flag = (ACCOUNT_IN_FOUND|ACCOUNT_OUT_FOUND); - totalpackets_in = strtoul(&buffer[15], NULL, 10); + totalpackets_in = strtoul(&buffer[15], NULL, 10); if (totalpackets_in != lastpackets_in) { totalbytes_in = strtoul(&buffer[7], NULL, 10); diffpackets_in += totalpackets_in - lastpackets_in; diffbytes_in += totalbytes_in - lastbytes_in; lastpackets_in = totalpackets_in; lastbytes_in = totalbytes_in; - rx = True; + rx = True; } - - - totalpackets_out = strtoul(&buffer[74], NULL, 10); + + + totalpackets_out = strtoul(&buffer[74], NULL, 10); if (totalpackets_out != lastpackets_out) { totalbytes_out = strtoul(&buffer[66], NULL, 10); diffpackets_out += totalpackets_out - lastpackets_out; diffbytes_out += totalbytes_out - lastbytes_out; lastpackets_out = totalpackets_out; lastbytes_out = totalbytes_out; - tx = True; + tx = True; } } } - + fclose(dev); /* return True if no change to tx/rx * return False if display will need to be updated - */ + */ return((rx == current_rx) && (tx == current_tx)); } @@ -388,7 +388,7 @@ int dev_test(void) { fprintf(stderr, "wmnet: using devstats driver to monitor %s\n", device); return True; } - + #endif /* USE_2_1_DEV */ #ifdef USE_LINUX_PPP @@ -398,8 +398,8 @@ int ppp_test(void) { strncpy(ppp_stats_req.ifr__name, device, 15); ppp_stats_req.stats_ptr =(caddr_t) &ppp_stats_req.stats; fprintf(stderr, "wmnet: using pppstats driver to monitor %s\n", device); - return True; - + return True; + } int updateStats_ppp(void) { @@ -429,11 +429,11 @@ int updateStats_ppp(void) { /* return True if no change to tx/rx * return False if display will need to be updated - */ + */ return((rx == current_rx) && (tx == current_tx)); } - + #endif /* USE_LINUX_PPP */ @@ -497,13 +497,13 @@ int kvm_updateStats(void) { /* return True if no change to tx/rx * return False if display will need to be updated - */ + */ return((rx == current_rx) && (tx == current_tx)); } #endif - - - + + + diff --git a/wmnet/wmnet.c b/wmnet/wmnet.c index e154833..79cc9e7 100644 --- a/wmnet/wmnet.c +++ b/wmnet/wmnet.c @@ -3,51 +3,51 @@ * Copyright 2000 Katharine Osborne * * $Id: wmnet.c,v 1.28 1998/10/07 03:42:28 joff Exp joff $ - * + * * This software is released under the GNU Public License agreement. * No warranties, whatever.... you know the usuals.... this is free * software. if you use it, great... if you wanna make a change to it, * great, but please send me the diff. * * CHANGELOG: - * 3/24/1998 -- First release, wrote this yesterday, so it may have + * 3/24/1998 -- First release, wrote this yesterday, so it may have * some bugs. - * 3/25/1998 -- added logarithmic scaling. - * some touch ups on the updateSpeedometer() to be a + * 3/25/1998 -- added logarithmic scaling. + * some touch ups on the updateSpeedometer() to be a * little more helpful * added a little more width to the speedometer display * from a report that the text sometimes was drawn off * the scale (couldnt confirm, is it fixed?) - * fixed prob for speeds > 9.9 megabytes per second (I - * think... I can't go that fast myself - * Made default maxspeed 6000 which I assume is better + * fixed prob for speeds > 9.9 megabytes per second (I + * think... I can't go that fast myself + * Made default maxspeed 6000 which I assume is better * for modems. - * 5/11/1998 -- I witnessed the little problem with the speedometer + * 5/11/1998 -- I witnessed the little problem with the speedometer * going off into the main window so I set a clipmask - * Still don't understand how it could go off..I'm + * Still don't understand how it could go off..I'm * using a fixed size font... * 5/13/1998 -- Modified the way it gets its stats from /proc/net/ip_acct * You now have to give it explicit accounting rule numbers * through the -T and -R options or else it defaults to the * fist two in tx, rx order, best just to make sure * you set the -T and -R options. - * 5/15/1998 -- Completed interface rewrite, definitely have more graphing + * 5/15/1998 -- Completed interface rewrite, definitely have more graphing * space, but I dont know if I like it yet. * 5/16/1998 -- Added shaded graphs, xload style. Its a lot prettier! - * 5/20/1998 -- Fixed afterstep wharfability problem... should also atleast + * 5/20/1998 -- Fixed afterstep wharfability problem... should also atleast * display in other WM's * 6/16/1998 -- Fixed handling of WM_DELETE_WINDOW, strtol() to strtoul(), * and now uses getopt_long. * 6/16/1998 -- Put in --withdrawn and --normalstate options to explicitly - * set the type. Still tries to auto-detect wmaker though. - * 6/16/1998 -- Put in --execute and --promisc options. + * set the type. Still tries to auto-detect wmaker though. + * 6/16/1998 -- Put in --execute and --promisc options. * 6/17/1998 -- Some code clean-ups. * 6/18/1998 -- Implemented a labeling mechanism. * 6/18/1998 -- Slowed down the speedometer display... it was getting annoying. * 6/23/1998 -- Split up to wmnet.c and wmnet.h * 8/5/1998 -- New options --device and --driver * 5/4/2000 -- Support added for OpenBSD - */ + */ #include #include @@ -110,16 +110,16 @@ void setup_wmnet(int argc, char **argv) { {"labelbg", required_argument, NULL, 'B'}, {"logscale", no_argument, NULL, 'l'}, {"help", no_argument, NULL, 'h'}, - {"execute", required_argument, NULL, 'e'}, + {"execute", required_argument, NULL, 'e'}, #ifdef linux - {"txrule", required_argument, NULL, 'T'}, - {"rxrule", required_argument, NULL, 'R'}, + {"txrule", required_argument, NULL, 'T'}, + {"rxrule", required_argument, NULL, 'R'}, #endif - {"txcolor", required_argument, NULL, 't'}, - {"rxcolor", required_argument, NULL, 'r'}, - {"maxrate", required_argument, NULL, 'x'}, - {"withdrawn", no_argument, NULL, 'w'}, - {"normalstate", no_argument, NULL, 'n'}, + {"txcolor", required_argument, NULL, 't'}, + {"rxcolor", required_argument, NULL, 'r'}, + {"maxrate", required_argument, NULL, 'x'}, + {"withdrawn", no_argument, NULL, 'w'}, + {"normalstate", no_argument, NULL, 'n'}, {"promisc", required_argument, NULL, 'p'}, {"unpromisc", required_argument, NULL, 'u'}, {"driver", required_argument, NULL, 'D'}, @@ -159,7 +159,7 @@ void setup_wmnet(int argc, char **argv) { break; #endif case 'L': - graphbox_height = 35; + graphbox_height = 35; if (label == NULL) { label = strdup(optarg); } else { @@ -216,7 +216,7 @@ void setup_wmnet(int argc, char **argv) { break; case 'e': if (click_command == NULL) { - click_command = strdup(optarg); + click_command = strdup(optarg); } else { fprintf(stderr, "wmnet: duplicate --execute\n"); exit(17); @@ -298,18 +298,18 @@ void setup_wmnet(int argc, char **argv) { " -x, --maxrate=BYTES max transfer rate for graph scale (default 6000)\n" " -p, --promisc=DEVICE put DEVICE into promiscuous mode to apply\n" " accounting rules to all network packets\n" - " -u, --unpromisc=DEVICE turn off promiscuous mode on DEVICE\n" - " -D, --driver=DRIVER use DRIVER to get statistics\n" + " -u, --unpromisc=DEVICE turn off promiscuous mode on DEVICE\n" + " -D, --driver=DRIVER use DRIVER to get statistics\n" " -l, --logscale use a logarithmic scale (great for ethernet\n" " connections with -x 10000000)\n" - " -d DELAY delay time for polling statistics\n" + " -d DELAY delay time for polling statistics\n" " in microseconds (default 25000)\n" "\n"); printf("Compiled in drivers: [%s]\n\n", available_drivers()); printf("Report bugs to joff@iastate.edu\n"); exit(3); } - } + } /* Relinquish suid privileges if there */ seteuid(getuid()); @@ -352,7 +352,7 @@ void setup_wmnet(int argc, char **argv) { exit(8); } - + /* Setup initial foreground color */ if(rxcolorString) { if(!XParseColor(dpy, DefaultColormap(dpy, screen), rxcolorString, &thecolor)) { @@ -360,7 +360,7 @@ void setup_wmnet(int argc, char **argv) { exit(12); } shadesOf(&thecolor, rx_pixel); - } + } if(txcolorString) { if(!XParseColor(dpy, DefaultColormap(dpy, screen), txcolorString, &thecolor)) { fprintf(stderr, "wmnet: what the heck is %s for a color?\n", txcolorString); @@ -387,20 +387,20 @@ void setup_wmnet(int argc, char **argv) { /* usleep() in between polls to /proc/net/ip_acct */ if (delayTime <= 0) delayTime = 25000; - + /* Setup the X windows, GC's, initial states, etc */ setupX(); XSetCommand(dpy, main_window, argv, argc); /* Get the initial stats for startup */ stat_gather(); - + /* Rock n Roll */ XMapWindow(dpy, main_window); } - + /* Called from setup_wmnet() to initialize the X windows stuff */ void setupX(void) { @@ -408,7 +408,7 @@ void setupX(void) { XSizeHints shints; XGCValues gcv; XColor color; - XRectangle bound = { 0, 0, 56, 56 }; + XRectangle bound = { 0, 0, 56, 56 }; screen = DefaultScreen(dpy); @@ -425,7 +425,7 @@ void setupX(void) { } root_window = DefaultRootWindow(dpy); - createWin(&main_window); + createWin(&main_window); color.red = color.green = color.blue = 12000; XAllocColor(dpy, DefaultColormap(dpy, screen), &color); @@ -441,7 +441,7 @@ void setupX(void) { exit(11); } gcv.graphics_exposures = False; - gcv.foreground = tx_pixel[HIGH_INTENSITY]; + gcv.foreground = tx_pixel[HIGH_INTENSITY]; gcv.background = darkgrey_pixel; gcv.font = XLoadFont(dpy, "5x8"); graphics_context = XCreateGC(dpy, root_window, (GCFont|GCGraphicsExposures|GCForeground|GCBackground), &gcv); @@ -451,7 +451,7 @@ void setupX(void) { hints.window_group = main_window; hints.initial_state = specified_state; if (specified_state == WithdrawnState) { - createWin(&icon_window); + createWin(&icon_window); visible_window = &icon_window; hints.icon_window = icon_window; } else { @@ -461,7 +461,7 @@ void setupX(void) { hints.flags = WindowGroupHint | StateHint | IconWindowHint; XSetWMHints(dpy,main_window,&hints); XSetWMProtocols(dpy, main_window, &delete_atom, 1); - + shints.min_width = 64; shints.min_height = 64; shints.max_width = 64; @@ -469,9 +469,9 @@ void setupX(void) { shints.flags = PMinSize | PMaxSize; XSetWMNormalHints(dpy, main_window, &shints); - - XStoreName(dpy, main_window, "wmnet"); - XShapeCombineRectangles(dpy, *visible_window, ShapeBounding, 4, 4, &bound, 1, ShapeBounding, 0); + + XStoreName(dpy, main_window, "wmnet"); + XShapeCombineRectangles(dpy, *visible_window, ShapeBounding, 4, 4, &bound, 1, ShapeBounding, 0); XSelectInput(dpy, *visible_window, (ExposureMask|ButtonPressMask)); XMapSubwindows(dpy, *visible_window); @@ -496,7 +496,7 @@ void redraw(XExposeEvent *ee) { static XRectangle cliprect = { 4, 51, 56, 9 }; XSetForeground(dpy, graphics_context, darkgrey_pixel); /* if (wmaker_present == False) XFillRectangle(dpy, *visible_window, graphics_context, 0, 0, 64, 64); */ - XFillRectangle(dpy, *visible_window, graphics_context, GRAPHBOX_X, GRAPHBOX_Y, GRAPHBOX_WIDTH, GRAPHBOX_HEIGHT); + XFillRectangle(dpy, *visible_window, graphics_context, GRAPHBOX_X, GRAPHBOX_Y, GRAPHBOX_WIDTH, GRAPHBOX_HEIGHT); XSetForeground(dpy, graphics_context, black_pixel); @@ -508,13 +508,13 @@ void redraw(XExposeEvent *ee) { XFillRectangle(dpy, *visible_window, graphics_context, LABEL_X, LABEL_Y, LABEL_WIDTH, LABEL_HEIGHT); XSetClipRectangles(dpy, graphics_context, 0, 0, &cliprect, 1, Unsorted); XSetForeground(dpy, graphics_context, labelfg_pixel); - XDrawString(dpy, *visible_window, graphics_context, 5, 58, label, strlen(label)); + XDrawString(dpy, *visible_window, graphics_context, 5, 58, label, strlen(label)); XSetClipMask(dpy, graphics_context, None); } XSetForeground(dpy, graphics_context, white_pixel); - XDrawLine(dpy, *visible_window, graphics_context, GRAPHBOX_X_RIGHT, GRAPHBOX_Y_BOTTOM, GRAPHBOX_X_RIGHT, (GRAPHBOX_Y_TOP + 1)); + XDrawLine(dpy, *visible_window, graphics_context, GRAPHBOX_X_RIGHT, GRAPHBOX_Y_BOTTOM, GRAPHBOX_X_RIGHT, (GRAPHBOX_Y_TOP + 1)); XDrawLine(dpy, *visible_window, graphics_context, GRAPHBOX_X_LEFT, GRAPHBOX_Y_BOTTOM, GRAPHBOX_X_RIGHT, GRAPHBOX_Y_BOTTOM); @@ -523,13 +523,13 @@ void redraw(XExposeEvent *ee) { XCopyPlane(dpy, arrow, *visible_window, graphics_context, 7, 0, 7, 9, 53, 5, 1); XCopyPlane(dpy, arrow, *visible_window, graphics_context, 0, 0, 7, 9, 46, 5, 1); } - - -/* Main loop that is called every delaytime. This calls stat_gather() and updateSpeedometer() when needed + + +/* Main loop that is called every delaytime. This calls stat_gather() and updateSpeedometer() when needed * and takes care of the displaying and scrolling the graph */ void tock(void) { unsigned long since; - int y, yy; + int y, yy; unsigned long rate_rx, rate_tx; double percent_tx, percent_rx; /* static array containing the last 8 samples... for use in averaging and smoothing the graph a little */ @@ -541,7 +541,7 @@ void tock(void) { perror("wmnet: gettimeofday()"); exit(10); } - since = (timenow.tv_sec * 1000000L + timenow.tv_usec) - (timelast.tv_sec * 1000000L + timelast.tv_usec); + since = (timenow.tv_sec * 1000000L + timenow.tv_usec) - (timelast.tv_sec * 1000000L + timelast.tv_usec); if (since > displayDelay) { lifo_in[t] = diffbytes_in * (1000000L / since); lifo_out[t] = diffbytes_out * (1000000L / since); @@ -553,20 +553,20 @@ void tock(void) { rate_rx = (lifo_in[0] + lifo_in[1] + lifo_in[2] + lifo_in[3] + lifo_in[4] + lifo_in[5] + lifo_in[6] + lifo_in[7]) / (unsigned long)8; if(logscale) percent_rx = (log10( ((rate_rx * 10000/ maxRate) < 1) ? 1 : ((double)rate_rx / (double)maxRate) * 10000.) / 4.); else percent_rx = (double)(rate_rx) / maxRate; - y = GRAPH_Y_BOTTOM - (GRAPH_HEIGHT * percent_rx) ; - y = y < GRAPH_Y_UPPER ? GRAPH_Y_UPPER : y; + y = GRAPH_Y_BOTTOM - (GRAPH_HEIGHT * percent_rx) ; + y = y < GRAPH_Y_UPPER ? GRAPH_Y_UPPER : y; /* out */ rate_tx = (lifo_out[0] + lifo_out[1] + lifo_out[2] + lifo_out[3] + lifo_out[4] + lifo_out[5] + lifo_out[6] + lifo_out[7]) / (unsigned long)8; if(logscale) percent_tx = (log10( ((rate_tx * 10000 / maxRate ) < 1) ? 1 : ((double)rate_tx / (double)maxRate * 10000.)) / 4.); else percent_tx = (double)(rate_tx) / maxRate; - yy = GRAPH_Y_UPPER + (GRAPH_HEIGHT * percent_tx) ; - yy = yy > GRAPH_Y_BOTTOM ? GRAPH_Y_BOTTOM : yy; + yy = GRAPH_Y_UPPER + (GRAPH_HEIGHT * percent_tx) ; + yy = yy > GRAPH_Y_BOTTOM ? GRAPH_Y_BOTTOM : yy; /* only update the speedometer every 7th displayDelay */ if (t == 7) updateSpeedometer(rate_rx, rate_tx); - + /* blank var is just for stopping executing the X* funcs when the disp is all black */ if ((y == GRAPH_Y_BOTTOM && yy == GRAPH_Y_UPPER) && (diffbytes_in + diffbytes_out) == 0) blank++; else blank = 0; if (blank < (GRAPH_WIDTH + 1) ) { @@ -575,20 +575,20 @@ void tock(void) { XSetForeground(dpy, graphics_context, darkgrey_pixel); XDrawLine(dpy, *visible_window, graphics_context, GRAPH_X_RIGHT, y, GRAPH_X_RIGHT, yy); if (( (yy == GRAPH_Y_UPPER && diffbytes_out > 0 && rate_rx > rate_tx) || (rate_rx >= rate_tx && yy != GRAPH_Y_UPPER)) ) { - drawColoredLine(GRAPH_Y_UPPER, yy, tx_pixel); + drawColoredLine(GRAPH_Y_UPPER, yy, tx_pixel); } if ( y != GRAPH_Y_BOTTOM || diffbytes_in > 0) { drawColoredLine(GRAPH_Y_BOTTOM, y, rx_pixel); } if (( (yy == GRAPH_Y_UPPER && diffbytes_out > 0) || (rate_rx < rate_tx && yy != GRAPH_Y_UPPER)) ) { - drawColoredLine(GRAPH_Y_UPPER, yy, tx_pixel); + drawColoredLine(GRAPH_Y_UPPER, yy, tx_pixel); } } diffbytes_in = diffbytes_out = 0; timelast = timenow; - } + } if (!stat_gather()) { /* Anything change? */ current_rx = rx; @@ -612,8 +612,8 @@ void tock(void) { XSetForeground(dpy, graphics_context, grey_pixel); XCopyPlane(dpy, arrow, *visible_window, graphics_context, 0, 0, 7, 9, 46, 5, 1); } - } - + } + } /* paints the speedometer area with whichever is greater, rxRate or txRate */ @@ -621,17 +621,17 @@ int updateSpeedometer(int rxRate, int txRate) { double rate; char astring[10]; unsigned long color; - static XRectangle cliprect = { 4, 5, 37, 8 }; + static XRectangle cliprect = { 4, 5, 37, 8 }; static int rxRate_last = 0 , txRate_last = 0; static Bool clear = True, collectandreturn = True; - + /* This is ugly, I don't like this, but it slows the speedometer down a touch */ if (collectandreturn == True) { txRate_last = txRate; rxRate_last = rxRate; collectandreturn = False; return 1; - } + } collectandreturn = True; @@ -654,7 +654,7 @@ int updateSpeedometer(int rxRate, int txRate) { return(1); } else if (rate < 1.) { snprintf(astring, 10, "%db/s", (unsigned int)(rate * 1000.)); - } else if (rate >= 1. && rate < 10.) + } else if (rate >= 1. && rate < 10.) snprintf(astring, 10, "%1.2fk/s", rate); else if (rate >= 10. && rate < 100.) snprintf(astring, 10, "%2.1fk/s", rate); @@ -668,7 +668,7 @@ int updateSpeedometer(int rxRate, int txRate) { XSetForeground(dpy, graphics_context, color); XSetClipRectangles(dpy, graphics_context, 0, 0, &cliprect, 1, Unsorted); - XDrawString(dpy, *visible_window, graphics_context, 4, 13, astring, strlen(astring)); + XDrawString(dpy, *visible_window, graphics_context, 4, 13, astring, strlen(astring)); XSetClipMask(dpy, graphics_context, None); clear = False; return(0); @@ -684,7 +684,7 @@ void drawColoredLine(int y1, int y2, unsigned long *shadecolor) { for(i = 0; i < 3; i++) { if (y1 > y2) subline[i+1] = y1 - (((y1 - y2) * linebreaks[i]) / 100); else subline[i+1] = y1 + (((y2 - y1) * linebreaks[i]) / 100); - XSetForeground(dpy, graphics_context, shadecolor[i]); + XSetForeground(dpy, graphics_context, shadecolor[i]); XDrawLine(dpy, *visible_window, graphics_context, GRAPH_X_RIGHT, subline[i], GRAPH_X_RIGHT, subline[i+1]); } } @@ -709,18 +709,18 @@ void shadesOf(XColor *shade, unsigned long *returnarray) { XAllocColor(dpy, DefaultColormap(dpy, screen), shade); returnarray[LOW_INTENSITY] = shade->pixel; } - + /* Here is main, clear at the bottom. Handles the event loop and calls tock() every delayTime milliseconds */ int main(int argc, char ** argv) { unsigned int done = False; XEvent event; - + setup_wmnet(argc, argv); - + while(!done) { while(XPending(dpy)) { - XNextEvent(dpy, &event); + XNextEvent(dpy, &event); switch(event.type) { case Expose: redraw((XExposeEvent *)&event); @@ -738,7 +738,7 @@ int main(int argc, char ** argv) { } } break; - } + } } /* Wait for a bit, updating is done in tock() */ diff --git a/wmnet/wmnet.h b/wmnet/wmnet.h index eeeff0f..ce3dfc7 100644 --- a/wmnet/wmnet.h +++ b/wmnet/wmnet.h @@ -1,9 +1,9 @@ /* wmnet -- X IP accounting monitor * Copyright 1998, 2000 Jesse B. Off, Katharine Osborne - * + * * * $Id: wmnet.h,v 1.2 1998/10/06 00:06:12 joff Exp $ - * + * * This software is released under the GNU Public License agreement. * No warranties, whatever.... you know the usuals.... this is free * software. if you use it, great... if you wanna make a change to it, @@ -15,12 +15,12 @@ #define TOPBOX_X 4 #define TOPBOX_Y 4 -#define TOPBOX_WIDTH 56 -#define TOPBOX_HEIGHT 11 +#define TOPBOX_WIDTH 56 +#define TOPBOX_HEIGHT 11 /* Graphing area extents */ #define GRAPHBOX_X 4 -#define GRAPHBOX_Y 15 +#define GRAPHBOX_Y 15 #define GRAPHBOX_WIDTH 56 #define GRAPHBOX_HEIGHT graphbox_height @@ -37,7 +37,7 @@ #define GRAPH_X_LEFT (GRAPH_X) #define GRAPH_X_RIGHT (GRAPH_X + GRAPH_WIDTH - 1) -#define GRAPH_Y_UPPER (GRAPH_Y) +#define GRAPH_Y_UPPER (GRAPH_Y) #define GRAPH_Y_BOTTOM (GRAPH_Y + GRAPH_HEIGHT - 1) @@ -83,19 +83,19 @@ unsigned int out_rule = 2, in_rule = 1, graphbox_height = 44; /* number of rule char *in_rule_string = NULL, *out_rule_string = NULL, *device=NULL; Bool current_tx = False, current_rx = False, rx, tx, logscale = False; parser_func stat_gather; - + void exit_func(void); -void got_signal(int x); +void got_signal(int x); void setup_wmnet(int argc, char **argv); void setupX(void); void createWin(Window *win); -int updateStats(void); -void redraw(XExposeEvent *ee); +int updateStats(void); +void redraw(XExposeEvent *ee); void tock(void); int updateSpeedometer(int rxRate, int txRate); -void drawColoredLine(int y1, int y2, unsigned long *shadecolor); +void drawColoredLine(int y1, int y2, unsigned long *shadecolor); void shadesOf(XColor *shade, unsigned long *returnarray); extern parser_func setup_driver(char *parser); diff --git a/wmnet/wmnet.man b/wmnet/wmnet.man index 3cc1772..3a04649 100644 --- a/wmnet/wmnet.man +++ b/wmnet/wmnet.man @@ -67,14 +67,14 @@ of his dorms ethernet based connection to the internet. .TP .B \-l,--logscale -sets logarithmic scale, which is good for fast connections. This will +sets logarithmic scale, which is good for fast connections. This will allow, for example, the graph still being informative at extremely low speeds (telnet), and extremely fast speeds (local FTP) simultaneously without the scale constantly being blank or solid at those respective extremes. .TP .B -L,--label=\fILABEL -prints a given text label on the bottom of the window +prints a given text label on the bottom of the window .TP .B -F,--labelfg=\fICOLOR specifies the color for the text of the label @@ -82,7 +82,7 @@ specifies the color for the text of the label .B -B,--labelbg=\fICOLOR specifies the color for the background of the label text .TP -.B --withdrawn +.B --withdrawn .TP .B --normalstate sets the initial state of wmnet. WMnet tries to automatically determine which @@ -99,7 +99,7 @@ executes \fICOMMAND \fPon a single click from button 1 (left mouse button). put \fIDEVICE \fPin promiscuous mode to start applying accounting rules to all network packets on your network segment. You either need to be root or have the wmnet binary suid root to use this feature. This option may be -given more than once on the command line to specify more than one device. +given more than once on the command line to specify more than one device. .TP .B \-d \fIDELAY delay time for polling /proc/net/ip_account (in @@ -107,12 +107,12 @@ microseconds). Defaults to 25000, that is 0.025 seconds, or 40 Hz .TP .B -D,--driver=\fIDRIVER use \fIDRIVER \fP to get the stats we monitor. Compiled in drivers can be listed -with the -h switch. +with the -h switch. .TP .B -W,--device=\fIDEVICE watch statistics for \fIDEVICE \fP. This option is only used for certain stat drivers, namely: kmem, devstats, and pppstats. The ipchains and ipfwadm -stat drivers do not use this parameter. +stat drivers do not use this parameter. .SH STAT DRIVERS wmnet uses different stat drivers to get the stats it needs to monitor your network. Exactly what drivers are available is determined at compile time. The @@ -122,7 +122,7 @@ by the --driver option. The available drivers are \fIpppstats, devstats, ipfwad ipchains\fP and \fIkmem\fP. .TP .B pppstats -this driver works on Linux 2.0 or Linux 2.1 for ONLY ppp type devices. +this driver works on Linux 2.0 or Linux 2.1 for ONLY ppp type devices. Specify the \fI--device\fP option for the interface to monitor. By default it uses interface ppp0. Please note, that if the ppp device is not available or active, wmnet will continue to try in the hopes that it is only temporarily offline. @@ -140,7 +140,7 @@ the first two rules it finds. .B ipchains this driver will only work in Linux 2.1 kernels with IP chains compiled in. You'll want to also specify the \fI--txrule\fP and \fI--rxrule\fP options and specify the chain names. By default it -uses the chains "acctin" and "acctout" +uses the chains "acctin" and "acctout" There must be at least one rule on the named ipchain, if there is more than one rule in the specified chain, it uses the first. The chain must not immediately return to the parent chain, it has to pass through a rule first. diff --git a/wmnotify/README b/wmnotify/README index 90776dc..1e64c45 100644 --- a/wmnotify/README +++ b/wmnotify/README @@ -27,7 +27,7 @@ This program was tested on the following systems: "Linux From Scratch 4.0" For recent project news, see the "NEWS" file. - + Building wmnotify: ------------------ diff --git a/wmnotify/doc/wmnotify.man b/wmnotify/doc/wmnotify.man index a4a20b6..79bd4e0 100644 --- a/wmnotify/doc/wmnotify.man +++ b/wmnotify/doc/wmnotify.man @@ -16,7 +16,7 @@ and an optional sound (or beep) is produced. \fBwmnotify\fR now supports SSL encryption. The interface is kept very simple. To manually check for new messages, -single-click on the mailbox image. To start your favorite email program, +single-click on the mailbox image. To start your favorite email program, double-click on the mailbox image. When you double-click on the mailbox image to start your email program, diff --git a/wmnotify/src/Makefile.am b/wmnotify/src/Makefile.am index a21af49..067e08f 100644 --- a/wmnotify/src/Makefile.am +++ b/wmnotify/src/Makefile.am @@ -12,4 +12,4 @@ DISTCLEANFILES = .deps/*.P MAINTAINERCLEANFILES = Makefile.in # we want these in the dist tarball -EXTRA_DIST = +EXTRA_DIST = diff --git a/wmnotify/src/configfile.c b/wmnotify/src/configfile.c index 58134e8..1600f24 100644 --- a/wmnotify/src/configfile.c +++ b/wmnotify/src/configfile.c @@ -54,7 +54,7 @@ CreateDefaultConfigurationFile( char *file ) { int status; FILE *fp; - + fp = fopen( file, "w" ); if( fp == NULL ) { fprintf( stderr, "%s: Can't create file \"%s\"\n", PACKAGE, file ); @@ -103,7 +103,7 @@ CreateDefaultConfigurationFile( char *file ) fprintf( stderr, "%s: A default configuration file has been created in your " "home directory: \"%s\"\n", PACKAGE, file ); fprintf( stderr, "You must edit it before running %s.\n", PACKAGE ); - + status = fclose( fp ); if( status != EXIT_SUCCESS ) { fprintf( stderr, "%s: Error closing file \"%s\"\n", PACKAGE, file ); @@ -133,7 +133,7 @@ ParseCommand( char *line, /*@out@*/ char *argv[] ) exit( EXIT_FAILURE ); } } - + *argv = NULL; /* mark the end of argument list */ } @@ -152,13 +152,13 @@ GetArguments( char *parameter, bool single_argument ) character '\n'. */ token = strtok( NULL, delimiter_multiple_arg ); } - + if( token == NULL ) { fprintf( stderr, "%s: Missing argument for \"%s\" parameter in " "configuration file.\n", PACKAGE, parameter ); exit( EXIT_FAILURE ); } - + return token; } @@ -167,13 +167,13 @@ static int GetNumber( char *token, char *parameter ) { char temp[32]; /* Check size ??? */ - + if( sscanf( token, "%[0123456789]", temp ) == 0 ) { fprintf( stderr, "%s: Invalid argument for \"%s\" parameter in " "configuration file.\n", PACKAGE, parameter ); exit( EXIT_FAILURE ); } - + return atoi( temp ); } @@ -206,11 +206,11 @@ ParseConfigurationFile( FILE *file ) the buffer. */ while( fgets( line, LINE_BUFFER_LEN, file ) != NULL ) { token = strtok( line, delimiter_single_arg ); - + if( ( token == NULL ) || ( token[0] == '#' ) ) { continue; /* Next iteration of the while() loop (next line). */ } - + if( STREQ( token, "protocol" ) ) { token = GetArguments( "protocol", true ); if( STREQ( token, "POP3" ) == true ) { @@ -263,7 +263,7 @@ ParseConfigurationFile( FILE *file ) token = GetArguments( "port", true ); wmnotify_infos.port = (u_int16_t) GetNumber( token, "port" ); } - + else if( STREQ( token, "username" ) ) { token = GetArguments( "username", true ); strncpy( wmnotify_infos.username, token, MAX_STR_LEN ); @@ -276,7 +276,7 @@ ParseConfigurationFile( FILE *file ) } else if( STREQ( token, "mailcheckdelay" ) ) { int delay; /* delay in minutes. */ - + token = GetArguments( "mailcheckdelay", true ); /* GetNumber() will exit if a negative number is entered. */ delay = GetNumber( token, "mailcheckdelay" ); @@ -324,7 +324,7 @@ ParseConfigurationFile( FILE *file ) token ); exit( EXIT_FAILURE ); } - + token = strtok( NULL, delimiter_single_arg ); if( ( token != NULL ) && ( token[0] != '#' ) ) { fprintf( stderr, "%s: Garbage at end of line in configuration file: %s\n", PACKAGE, @@ -348,7 +348,7 @@ ParseConfigurationFile( FILE *file ) else { return; /* success */ } - + /* Failure. */ fprintf( stderr, "%s: Mandatory parameter \"%s\" missing from configuration " "file.\n", PACKAGE, err_string ); @@ -365,7 +365,7 @@ ConfigurationFileInit( void ) FILE *fp; int status; size_t len; - + /* Check if an optional configuration file was specified on the command line. */ if( wmnotify_infos.optional_config_file != NULL ) { @@ -381,12 +381,12 @@ ConfigurationFileInit( void ) /* Using the default configuration file. */ char *home_dir; char *default_config_file; - + home_dir = getenv("HOME"); if( home_dir == NULL ) { /* We're trying to expand ~/, but HOME isn't set. */ struct passwd *pw = getpwuid( getuid() ); - + if( pw != NULL ) { home_dir = pw->pw_dir; } @@ -396,14 +396,14 @@ ConfigurationFileInit( void ) exit( EXIT_FAILURE ); } } - + /* We add 1 to the length for the terminating character '\0'. */ len = strlen( home_dir ) + strlen( "/" ) + strlen( default_config_filename ) + 1; default_config_file = xmalloc( len, __FILE__, __LINE__ ); - + sprintf( default_config_file, "%s/%s", home_dir, default_config_filename ); - + fp = fopen( default_config_file, "r" ); if( fp == NULL ) { /* If we cannot open the default configuration file, it probably means @@ -412,12 +412,12 @@ ConfigurationFileInit( void ) free( default_config_file ); exit( EXIT_FAILURE ); } - + free( default_config_file ); } ParseConfigurationFile( fp ); - + status = fclose( fp ); if( status != EXIT_SUCCESS ) { fprintf( stderr, "%s: Error closing configuration file.\n", PACKAGE ); diff --git a/wmnotify/src/dockapp.c b/wmnotify/src/dockapp.c index 5cdbefa..c80bf1c 100644 --- a/wmnotify/src/dockapp.c +++ b/wmnotify/src/dockapp.c @@ -53,7 +53,7 @@ CreateIconFromXpmData( char *pixmap_data[] ) dockapp.xpm_icon.attributes.valuemask |= ( XpmReturnPixels | XpmReturnExtensions ); - + /* Using the XPM library to read XPM data from the array in the included XPM file. The 'shapemask' Pixmap variable is set to an additional 1-bit deep pixmap that can then be used as a shape mask for the XShapeCombineMask() @@ -94,14 +94,14 @@ GetColor( char *name ) ErrorLocation( __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } - + res = (bool) XAllocColor( dockapp.display, attributes.colormap, &color ); if( res == false ) { fprintf( stderr, "%s: Can't allocate %s.\n", PACKAGE, name ); ErrorLocation( __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } - + return color.pixel; } @@ -122,13 +122,13 @@ void RedrawWindow( void ) { flush_expose( dockapp.iconwin ); - + (void) XCopyArea( dockapp.display, dockapp.xpm_icon.image, dockapp.iconwin, dockapp.NormalGC, 0, 0, dockapp.xpm_icon.attributes.width, dockapp.xpm_icon.attributes.height, 0, 0 ); - + flush_expose( dockapp.win ); - + (void) XCopyArea( dockapp.display, dockapp.xpm_icon.image, dockapp.win, dockapp.NormalGC, 0, 0, dockapp.xpm_icon.attributes.width, dockapp.xpm_icon.attributes.height, 0, 0 ); @@ -157,7 +157,7 @@ InitDockAppWindow( int argc, char *argv[], char *pixmap_data[], int status; int gravity = 0; /* Used to store the gravity value returned by XWMGeometry, but not used. */ - + /* Opening a connection to the X server. */ dockapp.display = XOpenDisplay( display_arg ); if( dockapp.display == NULL ) { @@ -166,54 +166,54 @@ InitDockAppWindow( int argc, char *argv[], char *pixmap_data[], ErrorLocation( __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } - + dockapp.screen = DefaultScreen( dockapp.display ); dockapp.root_win = RootWindow( dockapp.display, dockapp.screen ); dockapp.d_depth = DefaultDepth( dockapp.display, dockapp.screen ); - + /* Create a window to hold the stuff */ size_hints.flags = USSize | USPosition; size_hints.x = 0; size_hints.y = 0; - + /* Constructing window's geometry information. */ /* XWMGeometry() returns an 'int', but Xlib documentation doesn't explain it's meaning. */ XWMGeometry( dockapp.display, dockapp.screen, geometry_arg, NULL, BWIDTH, &size_hints, &size_hints.x, &size_hints.y, &size_hints.width, &size_hints.height, &gravity ); - + size_hints.width = ICON_SIZE; size_hints.height = ICON_SIZE; dockapp.back_pix = GetColor("white"); dockapp.fore_pix = GetColor("black"); - + dockapp.win = XCreateSimpleWindow( dockapp.display, dockapp.root_win, size_hints.x, size_hints.y, (unsigned int) size_hints.width, (unsigned int) size_hints.height, BWIDTH, dockapp.fore_pix, dockapp.back_pix ); - + dockapp.iconwin = XCreateSimpleWindow( dockapp.display, dockapp.win, size_hints.x, size_hints.y, (unsigned int) size_hints.width, (unsigned int) size_hints.height, BWIDTH, dockapp.fore_pix, dockapp.back_pix ); - + /* Configuring Client to Window Manager Communications. */ - + /* WM_NORMAL_HINTS property: size hints for a window in it's normal state. */ /* Replaces the size hints for the WM_NORMAL_HINTS property on the specified window. */ XSetWMNormalHints( dockapp.display, dockapp.win, &size_hints ); - + /* Setting the WM_CLASS property. */ { char *app_name = argv[0]; XClassHint wm_class; - + /* The res_name member contains the application name. The res_class member contains the application class. */ /* The name set in this property may differ from the name set as WM_NAME. @@ -227,23 +227,23 @@ InitDockAppWindow( int argc, char *argv[], char *pixmap_data[], wm_class.res_class = app_name; (void) XSetClassHint( dockapp.display, dockapp.win, &wm_class ); } - + /* Setting the WM_NAME property. This specifies what should be displayed in the title bar (usually the application name). */ { XTextProperty text_prop; - + char *app_name = argv[0]; const int string_count = 1; - + status = XStringListToTextProperty( &app_name, string_count, &text_prop ); if( status == 0 ) { fprintf( stderr, "%s: XStringListToTextProperty() failed\n", PACKAGE ); ErrorLocation( __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } - + XSetWMName( dockapp.display, dockapp.win, &text_prop ); /* Freing the storage for the value field. */ @@ -264,20 +264,20 @@ InitDockAppWindow( int argc, char *argv[], char *pixmap_data[], wm_hints.icon_y = size_hints.y; wm_hints.window_group = dockapp.win; (void) XSetWMHints( dockapp.display, dockapp.win, &wm_hints ); - + /* Sets the WM_COMMAND property. This sets the command and arguments used to invoke the application. */ (void) XSetCommand( dockapp.display, dockapp.win, argv, argc ); - + /* ... */ (void) XSelectInput( dockapp.display, dockapp.win, ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask ); - + (void) XSelectInput( dockapp.display, dockapp.iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask ); - + /* Create GC for drawing */ gcv.foreground = dockapp.fore_pix; gcv.background = dockapp.back_pix; @@ -285,16 +285,16 @@ InitDockAppWindow( int argc, char *argv[], char *pixmap_data[], dockapp.NormalGC = XCreateGC( dockapp.display, dockapp.root_win, GCForeground | GCBackground | GCGraphicsExposures, &gcv ); - + /* Convert XPM data to XImage */ CreateIconFromXpmData( pixmap_data ); XShapeCombineMask( dockapp.display, dockapp.win, ShapeBounding, 0, 0, dockapp.xpm_icon.shapemask, ShapeSet ); - + XShapeCombineMask( dockapp.display, dockapp.iconwin, ShapeBounding, 0, 0, dockapp.xpm_icon.shapemask, ShapeSet ); - + /* Making the new window visible. */ (void) XMapWindow( dockapp.display, dockapp.win ); } diff --git a/wmnotify/src/imap.c b/wmnotify/src/imap.c index da11e47..8651d35 100644 --- a/wmnotify/src/imap.c +++ b/wmnotify/src/imap.c @@ -76,12 +76,12 @@ IMAP4_ReceiveResponse( void ) int len; char *token; char *stringp; - + /* All interactions transmitted by client and server are in the form of lines, that is, strings that end with a CRLF. The protocol receiver of an IMAP4rev1 client or server is either reading a line, or is reading a sequence of octets with a known count followed by a line. */ - + get_packet: len = WmnotifyGetResponse( rx_buffer, WMNOTIFY_BUFSIZE ); if( len < 0 ) { @@ -118,16 +118,16 @@ IMAP4_ReceiveResponse( void ) printf( "%s", rx_buffer ); printf( "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n" ); } - + /* Converting the last CRLF into a LF followed by a NULL termination character. */ rx_buffer[ len - 2 ] = '\n'; rx_buffer[ len - 1 ] = '\0'; - + /* Check the Server Completion Response returned by the IMAP4 server. There are currently * three Server Completion Responses codes: success ("OK"), failure ("NO") and protocol error * ("BAD"). */ stringp = rx_buffer; - + while( ( token = strsep( &stringp, "\n" ) ) != NULL ) { /* In case no delimiter was found, the token is taken to @@ -145,14 +145,14 @@ IMAP4_ReceiveResponse( void ) goto error; } } - + if( token == NULL ) { /* This should never happen. */ ErrorLocation( __FILE__, __LINE__ ); fprintf( stderr, " NULL token returned by strsep().\n" ); goto error; } - + if( token[0] == '*' ) { /* Untagged response. If there is a space after the SEARCH response, it means * at least 1 message is unseen. */ @@ -188,14 +188,14 @@ IMAP4_ReceiveResponse( void ) } } } /* while( token ) */ - + /* Get next part of IMAP4 response. */ goto get_packet; - + end: /* No error. */ return len; - + error: return -1; } @@ -206,7 +206,7 @@ IMAP4_SendCommand( int argc, char *argv[] ) { int len; int i; - + /* Adding Transaction Label. */ tlabel++; tx_buffer[0] = 'A'; @@ -233,7 +233,7 @@ IMAP4_SendCommand( int argc, char *argv[] ) if( len < 0 ) { return EXIT_FAILURE; } - + len = IMAP4_ReceiveResponse(); if( len < 0 ) { return EXIT_FAILURE; @@ -287,7 +287,7 @@ IMAP4_CheckForNewMail( void ) new_messages = -1; goto imap4_logout; } - + if( unseen_string_found == true ) { new_messages = 1; } @@ -303,7 +303,7 @@ IMAP4_CheckForNewMail( void ) if( status != EXIT_SUCCESS ) { new_messages = -1; } - + end: return new_messages; } diff --git a/wmnotify/src/network.c b/wmnotify/src/network.c index e264205..9e5c05f 100644 --- a/wmnotify/src/network.c +++ b/wmnotify/src/network.c @@ -59,7 +59,7 @@ SocketOpen( char *server_name, int port ) int sock_fd = -1; struct hostent *hostinfo; struct sockaddr_in serv_addr; - + hostinfo = gethostbyname(server_name); if( hostinfo == NULL ) { herror( PACKAGE ); @@ -74,7 +74,7 @@ SocketOpen( char *server_name, int port ) ErrorLocation( __FILE__, __LINE__ ); goto error; } - + /*---Initialize server address/port struct---*/ serv_addr.sin_family = AF_INET; serv_addr.sin_port = htons(port); @@ -85,7 +85,7 @@ SocketOpen( char *server_name, int port ) printf( " Server IP = %s\n", inet_ntoa( serv_addr.sin_addr ) ); printf( " Server port = %d\n", ntohs(serv_addr.sin_port) ); } - + /* Establishing connection. */ status = connect( sock_fd, (struct sockaddr *) &(serv_addr), sizeof(serv_addr) ); if( status < 0 ) { @@ -93,7 +93,7 @@ SocketOpen( char *server_name, int port ) ErrorLocation( __FILE__, __LINE__ ); goto error; } - + end: return sock_fd; @@ -105,7 +105,7 @@ SocketOpen( char *server_name, int port ) ErrorLocation( __FILE__, __LINE__ ); } } - + sock_fd = -1; goto end; } @@ -130,7 +130,7 @@ ConnectionEstablish( char *server_name, int port ) goto error; } } -#endif +#endif /* Testing connection. */ len = WmnotifyGetResponse( rx_buffer, 1024 ); @@ -142,7 +142,7 @@ ConnectionEstablish( char *server_name, int port ) rx_buffer[len] = 0; printf(" Connect response:\n%s\n", rx_buffer ); } - + return EXIT_SUCCESS; error: @@ -166,7 +166,7 @@ ConnectionTerminate( void ) SSL_CTX_free( ssl_infos.ctx ); /* release context */ } #endif - + return EXIT_SUCCESS; } @@ -183,7 +183,7 @@ WmnotifySendData( char *buffer, int size ) SSL_get_error( ssl_infos.ssl, len ); len = -1; } - + return len; } #endif /* HAVE_SSL */ @@ -194,12 +194,12 @@ WmnotifySendData( char *buffer, int size ) len = send( wmnotify_infos.sock_fd, buffer, size, SEND_FLAGS ); } while( ( len < 0 ) && ( errno == EINTR ) ); - + if( len < 0 ) { perror( PACKAGE ); ErrorLocation( __FILE__, __LINE__ ); } - + return len; } @@ -243,11 +243,11 @@ WmnotifyGetResponse( char *buffer, int max_size ) len = recv( wmnotify_infos.sock_fd, buffer, max_size, RECV_FLAGS ); } while( ( len < 0 ) && ( errno == EINTR ) ); - + if( len < 0 ) { perror( PACKAGE ); ErrorLocation( __FILE__, __LINE__ ); } - + return len; } diff --git a/wmnotify/src/options.c b/wmnotify/src/options.c index d56f2ba..1b6dc2f 100644 --- a/wmnotify/src/options.c +++ b/wmnotify/src/options.c @@ -97,7 +97,7 @@ ParseCommandLineOptions( int argc, char *argv[] ) /* Default values. */ wmnotify_infos.debug = false; - + for( i = 1; i < argc; i++ ) { token = argv[i]; switch( token[0] ) { diff --git a/wmnotify/src/pop3.c b/wmnotify/src/pop3.c index 373897d..bf498f9 100644 --- a/wmnotify/src/pop3.c +++ b/wmnotify/src/pop3.c @@ -49,7 +49,7 @@ static int POP3_ReceiveResponse( void ) { int len; - + len = WmnotifyGetResponse( rx_buffer, WMNOTIFY_BUFSIZE ); if( len < 0 ) { perror( PACKAGE ); @@ -62,7 +62,7 @@ POP3_ReceiveResponse( void ) if( wmnotify_infos.debug ) { printf( "Response: \"%s\"\n", rx_buffer ); } - + /* No error in recv at this point. Now we parse response from POP3 server. */ /* Check the status indicator returned by the POP3 server. @@ -72,7 +72,7 @@ POP3_ReceiveResponse( void ) fprintf( stderr, "%s: Error, POP3 server responded:\n \"%s\"\n", PACKAGE, rx_buffer ); len = -1; } - + return len; } @@ -95,7 +95,7 @@ POP3_SendCommand( int argc, char *argv[] ) tx_buffer[len] = '\0'; printf( "Command: \"%s\"\n", tx_buffer ); } - + /* Adding termination characters. */ len += sprintf( tx_buffer + len, POP3_ENDL ); @@ -103,12 +103,12 @@ POP3_SendCommand( int argc, char *argv[] ) if( len < 0 ) { return EXIT_FAILURE; } - + len = POP3_ReceiveResponse(); if( len < 0 ) { return EXIT_FAILURE; } - + return EXIT_SUCCESS; } @@ -122,7 +122,7 @@ POP3_ParseStatCommand( void ) /* STAT command: * The positive response consists of "+OK" followed by a single space, the number of messages - * in the maildrop, a single space, and the size of the maildrop in octets. */ + * in the maildrop, a single space, and the size of the maildrop in octets. */ token = strtok( rx_buffer, " " ); token = strtok( NULL, " " ); if( token != NULL ) { @@ -133,7 +133,7 @@ POP3_ParseStatCommand( void ) fprintf( stderr, "%s: Error parsing \"STAT\" response", PACKAGE ); new_messages = -1; } - + return new_messages; } @@ -178,7 +178,7 @@ POP3_CheckForNewMail( void ) if( new_messages < 0 ) { goto pop3_close_connection; } - + /* Sending QUIT command. */ argv[0] = POP3_CMD_QUIT; status = POP3_SendCommand( 1, argv ); @@ -186,7 +186,7 @@ POP3_CheckForNewMail( void ) new_messages = -1; goto pop3_close_connection; } - + pop3_close_connection: status = ConnectionTerminate(); if( status != EXIT_SUCCESS ) { diff --git a/wmnotify/src/sound.c b/wmnotify/src/sound.c index ff0f05b..10dc8e4 100644 --- a/wmnotify/src/sound.c +++ b/wmnotify/src/sound.c @@ -61,14 +61,14 @@ OpenDspDevice( int channels, int srate ) audio_info_t audio_info; const char audio_device[] = "/dev/audio"; #endif - + #if defined (__linux__) fd = open( audio_device, O_WRONLY, 0 ); #elif( defined(sun) && defined(unix) ) /* Open the audio device - write only, non-blocking */ fd = open( audio_device, O_WRONLY | O_NONBLOCK ); #endif - + if( fd < 0 ) { fprintf( stderr, "%s: open() failed trying to open device '%s':\n", PACKAGE, audio_device ); @@ -78,7 +78,7 @@ OpenDspDevice( int channels, int srate ) ErrorLocation( __FILE__, __LINE__ ); return -1; } - + #if defined (__linux__) stereo = 0; status = ioctl( fd, SNDCTL_DSP_STEREO, &stereo ); @@ -87,14 +87,14 @@ OpenDspDevice( int channels, int srate ) ErrorLocation( __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } - + status = ioctl( fd, SNDCTL_DSP_RESET, 0 ); if( status > 0 ) { fprintf( stderr, "%s: ioctl() failed: %s\n", PACKAGE, strerror( errno ) ); ErrorLocation( __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } - + temp = 16; status = ioctl( fd, SOUND_PCM_WRITE_BITS, &temp ); if( status != 0 ) { @@ -102,39 +102,39 @@ OpenDspDevice( int channels, int srate ) ErrorLocation( __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } - + status = ioctl( fd, SOUND_PCM_WRITE_CHANNELS, &channels ); if( status != 0 ) { fprintf( stderr, "%s: ioctl() failed: %s\n", PACKAGE, strerror( errno ) ); ErrorLocation( __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } - + status = ioctl( fd, SOUND_PCM_WRITE_RATE, &srate ); if( status != 0 ) { fprintf( stderr, "%s: ioctl() failed: %s\n", PACKAGE, strerror( errno ) ); ErrorLocation( __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } - + status = ioctl( fd, SNDCTL_DSP_SYNC, 0 ); if( status != 0 ) { fprintf( stderr, "%s: ioctl() failed: %s\n", PACKAGE, strerror( errno ) ); ErrorLocation( __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } - + #elif( defined(sun) && defined(unix) ) /* Retrieve standard values. */ AUDIO_INITINFO( &audio_info ); - + audio_info.play.sample_rate = sfinfo.samplerate; audio_info.play.channels = sfinfo.channels; audio_info.play.precision = 16; audio_info.play.encoding = AUDIO_ENCODING_LINEAR; audio_info.play.gain = AUDIO_MAX_GAIN; audio_info.play.balance = AUDIO_MID_BALANCE; - + status = ioctl( audio_fd, AUDIO_SETINFO, &audio_info ); if( status > 0 ) { fprintf( stderr, "%s: ioctl() failed: %s\n", PACKAGE, strerror( errno ) ); @@ -142,7 +142,7 @@ OpenDspDevice( int channels, int srate ) exit( EXIT_FAILURE ); } #endif - + return fd; } @@ -174,9 +174,9 @@ PlayAudioFile( char *filename, int volume ) ErrorLocation( __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } - + sndfile = sf_open( filename, SFM_READ, &sfinfo ); - + if( sndfile == NULL ) { fprintf( stderr, "%s: sf_open() failed trying to open '%s':\n", PACKAGE, filename ); fprintf( stderr, " %s\n", sf_strerror(NULL) ); @@ -184,14 +184,14 @@ PlayAudioFile( char *filename, int volume ) ErrorLocation( __FILE__, __LINE__ ); return; } - + if( sfinfo.channels < 1 || sfinfo.channels > 2 ) { fprintf( stderr, "%s: Audio file has %d channel(s), but ", PACKAGE, sfinfo.channels ); fprintf( stderr, "we support only 1 or 2 channels.\n" ); ErrorLocation( __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } - + audio_fd = OpenDspDevice( sfinfo.channels, sfinfo.samplerate ); if( audio_fd < 0 ) { goto play_audio_file_close_file; @@ -203,11 +203,11 @@ PlayAudioFile( char *filename, int volume ) #endif subformat = sfinfo.format & SF_FORMAT_SUBMASK; - + if( subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE ) { static float flt_buffer[BUFFER_LEN]; double scale; - + status = sf_command( sndfile, SFC_CALC_SIGNAL_MAX, &scale, (int) sizeof(scale) ); if( status == 0 ) { fprintf( stderr, "%s: Warning, sf_command() failed.\n", PACKAGE ); @@ -237,12 +237,12 @@ PlayAudioFile( char *filename, int volume ) ErrorLocation( __FILE__, __LINE__ ); goto play_audio_file_close_audio; } - + /* Solaris -- FLOAT samples */ #elif( defined(sun) && defined(unix) ) start_count = 0; output_count = read_count * sizeof(short); - + while( output_count > 0 ) { /* Write as much data as possible */ for( m = 0 ; m < readcount ; m++ ) { @@ -251,7 +251,7 @@ PlayAudioFile( char *filename, int volume ) /* Changing volume */ buffer[m] = buffer[m] * volume / 100; } - + write_count = write( audio_fd, &(buffer[start_count]), output_count ); if( write_count > 0 ) { output_count -= write_count; @@ -273,27 +273,27 @@ PlayAudioFile( char *filename, int volume ) for( m = 0 ; m < readcount ; m++ ) { buffer[m] = ( buffer[m] * volume ) / 100; } - + status = (int) write( audio_fd, buffer, readcount * sizeof(short) ); if( status == -1 ) { perror( PACKAGE ); ErrorLocation( __FILE__, __LINE__ ); goto play_audio_file_close_audio; } - + /* Solaris -- INTEGER samples */ #elif( defined(sun) && defined(unix) ) start_count = 0; output_count = read_count * sizeof(short); - + while( output_count > 0 ) { /* Write as much data as possible */ - + /* Changing volume. */ for( m = 0 ; m < read_count ; m++ ) { buffer[m] = ( buffer[m] * volume ) / 100; } - + write_count = write( audio_fd, &(buffer[start_count]), output_count ); if( write_count > 0 ) { output_count -= write_count; @@ -325,7 +325,7 @@ PlayAudioFile( char *filename, int volume ) ErrorLocation( __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } - + if( wmnotify_infos.debug ) { printf( "%s: PlayAudioFile() Exit\n", PACKAGE ); } diff --git a/wmnotify/src/wmnotify.c b/wmnotify/src/wmnotify.c index b2c7b27..4c55f64 100644 --- a/wmnotify/src/wmnotify.c +++ b/wmnotify/src/wmnotify.c @@ -85,7 +85,7 @@ xmalloc( size_t size, const char *filename, int line_number ) void *value; value = malloc( size ); - + if( value == NULL ) { perror( PACKAGE ); ErrorLocation( filename, line_number ); @@ -150,7 +150,7 @@ ExecuteCommand( char *argv[] ) } pid = fork(); /* fork a child process. */ - + if( pid < 0) { perror( PACKAGE ); ErrorLocation( __FILE__, __LINE__ ); @@ -160,7 +160,7 @@ ExecuteCommand( char *argv[] ) /* When execvp() is successful, it doesn't return; otherwise, it returns -1 and sets errno. */ (void) execvp( argv[0], argv ); - + msg = strerror( errno ); fprintf( stderr, "%s: The external mail program couldn't be started.\n", PACKAGE); @@ -205,7 +205,7 @@ DoubleClick( void ) if( wmnotify_infos.mail_client_argv[0] != NULL ) { /* Starting external mail client. */ ExecuteCommand( wmnotify_infos.mail_client_argv ); - + double_click_notif = true; /* Sending a signal to awake the TimerThread() thread. This was previously @@ -247,7 +247,7 @@ CatchChildTerminationSignal( int signal ) /* Wait for Mail Client child process termination. Child enters zombie state: process is dead and most resources are released, but process descriptor remains until parent reaps exit status via wait. */ - + /* The WNOHANG option prevents the call to waitpid from suspending execution of the caller. */ (void) waitpid( 0, NULL, WNOHANG ); @@ -324,7 +324,7 @@ CheckForNewMail( bool manual_check ) if( ( manual_check == true ) && ( new_messages > 0 ) ) { animation_image = MAILBOX_FULL; } - + return new_messages; } @@ -339,7 +339,7 @@ TimerThread( /*@unused@*/ void *arg ) /* For catching the signal SIGUSR1. This signal is sent by the main program thread when the * user is issuing a single-click to manually check for new mails. */ (void) signal( SIGUSR1, CatchTimerSignal ); - + /* For catching the signal SIGUSR2. This signal is sent by the main program thread when the * user is issuing a double-click to start ther external mail client. */ (void) signal( SIGUSR2, CatchTimerSignal ); @@ -351,11 +351,11 @@ TimerThread( /*@unused@*/ void *arg ) if( ( manual_check == true ) || ( counter == 0 ) ) { new_messages = CheckForNewMail( manual_check ); manual_check = false; - + if( wmnotify_infos.debug ) { printf( "%s: new messages = %d.\n", PACKAGE, new_messages ); } - + if( new_messages > 0 ) { /* Checking if audio notification was already produced. */ if( animation_running == false ) { @@ -370,7 +370,7 @@ TimerThread( /*@unused@*/ void *arg ) AudibleBeep(); } } - + animation_running = true; } /* Number of times to execute timer loop before checking again for new mails when the @@ -381,7 +381,7 @@ TimerThread( /*@unused@*/ void *arg ) counter = 30 * 1000000 / NEW_MAIL_ANIMATION_DURATION; } } - + if( ( animation_stop == true ) || ( new_messages <= 0 ) ) { if( wmnotify_infos.debug ) { if( animation_stop != false ) { @@ -400,7 +400,7 @@ TimerThread( /*@unused@*/ void *arg ) * 0. If sleep() returns because of premature arousal due to delivery of a signal, the * return value will be the "unslept" amount (the requested time minus the time actually * slept) in seconds. */ - + if( animation_running == false ) { (void) sleep( wmnotify_infos.mail_check_interval ); counter = 0; @@ -415,7 +415,7 @@ TimerThread( /*@unused@*/ void *arg ) printf( "%s: counter = %d\n", PACKAGE, counter ); } } /* end while */ - + if( wmnotify_infos.debug ) { printf( "%s: Error, TimerThread() exited abnormally\n", PACKAGE ); } @@ -432,7 +432,7 @@ int main( int argc, char *argv[] ) { int status; - + /* Initialization */ ParseCommandLineOptions( argc, argv ); @@ -442,7 +442,7 @@ main( int argc, char *argv[] ) /* For catching the termination signal SIGCHLD when the external mail client program is terminated, thus permitting removing zombi processes... */ (void) signal( SIGCHLD, CatchChildTerminationSignal ); - + /* Initialize callback function pointers. */ ProcessXlibEventsInit( SingleClick, DoubleClick ); @@ -463,6 +463,6 @@ main( int argc, char *argv[] ) /* This code is never reached for now. */ fprintf( stderr, "%s: Program exit\n", PACKAGE ); - + exit( EXIT_SUCCESS ); } diff --git a/wmnotify/src/xevents.c b/wmnotify/src/xevents.c index 976aaad..f6c43c7 100644 --- a/wmnotify/src/xevents.c +++ b/wmnotify/src/xevents.c @@ -65,7 +65,7 @@ ProcessXlibEventsInit( void (*single_click_callback)( void ), void (*double_click_callback)( void ) ) { int status; - + /* This must be called before any other XLib functions. */ status = XInitThreads(); if( status == 0 ) { @@ -73,7 +73,7 @@ ProcessXlibEventsInit( void (*single_click_callback)( void ), ErrorLocation( __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } - + SingleClickCallback = single_click_callback; DoubleClickCallback = double_click_callback; } @@ -87,7 +87,7 @@ ProcessXlibEvents( void ) bool button1_pressed = false; bool check_for_double_click = false; XEvent Event; - + while( quit == false ) { if( ( check_for_double_click != false ) && ( XPending( dockapp.display ) == 0 ) ) { @@ -96,7 +96,7 @@ ProcessXlibEvents( void ) if( SingleClickCallback != NULL ) { (*SingleClickCallback)(); } - + check_for_double_click = false; } /* XNextEvent is a blocking call: it will return only when an event is diff --git a/wmpager/README b/wmpager/README index 1fa78d8..d571b91 100644 --- a/wmpager/README +++ b/wmpager/README @@ -83,12 +83,12 @@ have set the environment variable WMPAGER to the installation location of the wmpager themes, then you may also skip the path to the theme. Predefined themes: Well, I'm not much of an artist therefore I've only -included some themes to give you an idea of how a real nice theme +included some themes to give you an idea of how a real nice theme might be done. Naturally, I use the built-in theme and theme support is only there because I have been asked to include it... Creating your own themes: If you want to create your own theme simply -take one of the included XPM theme files and modify it to your needs. +take one of the included XPM theme files and modify it to your needs. If you really want to know, the format of the file is described below. If you create a theme yourself please send it to me and I'll include it @@ -100,12 +100,12 @@ The list of predefined themes in this release includes: - gray - steel -XPM file format: The XPM file has to be at least 102 by 71 pixels in -size. The area 0,0 to 50,50 describes the background for the selected -workspace, the area 51,0 to 101,50 for unselected work spaces. The -area has to include a one-pixel border that is used for all workspace -buttons. From 0,51 to 89,60 are the digits used for the selected -workspace (each 10x10 pixels, 1-9 from left to right) and from 0,61 to +XPM file format: The XPM file has to be at least 102 by 71 pixels in +size. The area 0,0 to 50,50 describes the background for the selected +workspace, the area 51,0 to 101,50 for unselected work spaces. The +area has to include a one-pixel border that is used for all workspace +buttons. From 0,51 to 89,60 are the digits used for the selected +workspace (each 10x10 pixels, 1-9 from left to right) and from 0,61 to 89,70 are the digits for unselected workspaces. The digits may have a transparent background. @@ -139,10 +139,10 @@ also supports themes. Check out options '--theme' and '--installdir'. Release 1.2 -As of release 1.2 the wmpager is hosted at sourceforge. Its new +As of release 1.2 the wmpager is hosted at sourceforge. Its new homepage is located at 'http://wmpager.sourceforge.net/'. -To report a bug please use the sourceforge bugtracker for the wmpager +To report a bug please use the sourceforge bugtracker for the wmpager located at 'http://sourceforge.net/projects/wmpager/'. Thanks! In addition to the new location the only thing that has changed is @@ -164,16 +164,16 @@ LICENSE INFORMATION Copyright (c) 2001-2002 Bruno Essmann All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: -1. Redistributions of source code must retain the above copyright +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided +2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote diff --git a/wmpager/man/wmpager.1x b/wmpager/man/wmpager.1x index 6750986..a251a27 100644 --- a/wmpager/man/wmpager.1x +++ b/wmpager/man/wmpager.1x @@ -35,11 +35,11 @@ Enable verbose message output. The display to use (defaults to the 'DISPLAY' environment variable). .TP .B \-s \-\-size \fIx\fP -The number of buttons to display. The default depends on the number of +The number of buttons to display. The default depends on the number of workspaces you have, i.e. 2x2 for 4 workspaces, 2x3 for 6, maximum is 3x3. .TP .B \-w \-\-workspaces \fI\fP -The number of workspace buttons to display. The default is the number of +The number of workspace buttons to display. The default is the number of workspaces you have up to a maximum is 9. .TP .B \-t \-\-theme \fI\fP @@ -67,7 +67,7 @@ have set the environment variable WMPAGER to the installation location of the wmpager themes, then you may also skip the path to the theme. Predefined themes: Well, I'm not much of an artist therefore I've only -included some themes to give you an idea of how a real nice theme +included some themes to give you an idea of how a real nice theme might be done. Naturally, I use the built\-in theme and theme support is only there because I have been asked to include it... @@ -87,15 +87,15 @@ steel .RE 2 Creating your own themes: If you want to create your own theme simply -take one of the included XPM theme files and modify it to your needs. +take one of the included XPM theme files and modify it to your needs. If you really want to know, the format of the file is described below. -XPM file format: The XPM file has to be at least 102 by 71 pixels in -size. The area 0,0 to 50,50 describes the background for the selected -workspace, the area 51,0 to 101,50 for unselected work spaces. The -area has to include a one\-pixel border that is used for all workspace -buttons. From 0,51 to 89,60 are the digits used for the selected -workspace (each 10x10 pixels, 1\-9 from left to right) and from 0,61 to +XPM file format: The XPM file has to be at least 102 by 71 pixels in +size. The area 0,0 to 50,50 describes the background for the selected +workspace, the area 51,0 to 101,50 for unselected work spaces. The +area has to include a one\-pixel border that is used for all workspace +buttons. From 0,51 to 89,60 are the digits used for the selected +workspace (each 10x10 pixels, 1\-9 from left to right) and from 0,61 to 89,70 are the digits for unselected workspaces. The digits may have a transparent background. .PD @@ -123,7 +123,7 @@ Bruno Essmann .PD .SH ACKNOWLEDGEMENTS .PD 0 -Thanks to all at Ergon Informatik AG who are using wmpager and helped +Thanks to all at Ergon Informatik AG who are using wmpager and helped improve it! .LP \fIhttp://www.ergon.ch/\fP diff --git a/wmpager/src/wmpager.c b/wmpager/src/wmpager.c index 3ff788b..c2c94a7 100644 --- a/wmpager/src/wmpager.c +++ b/wmpager/src/wmpager.c @@ -101,7 +101,7 @@ int main (int nArgc, char** szArgv) { int nSizeX= -1, nSizeY= -1; int i; initApplicationName(szArgv[0]); - /* we no longer use the WMPAGER environment variable + /* we no longer use the WMPAGER environment variable * szInstallDir= (char*) getenv(WMPAGER_ENV); * instead we simply use a default installation directory */ @@ -305,7 +305,7 @@ void initDisplay (char* szDisplay) { _display= XOpenDisplay(szDisplay); if (_display == NULL) { fprintf( - stderr, + stderr, "%s: couldn't open display '%s'.\n", getApplicationName(), (szDisplay == NULL) ? ((char*) getenv("DISPLAY")) : szDisplay @@ -371,7 +371,7 @@ void initWindow (int nArgc, char** szArgv) { XWMHints* xwmhints; XClassHint* xclasshint; XTextProperty xtApplication; - + if (isVerbose()) { fprintf(stdout, "[%8ld] initializing application window\n", currentTimeMillis()); } @@ -381,33 +381,33 @@ void initWindow (int nArgc, char** szArgv) { _wRoot= RootWindow(display, _nDefaultScreen); XSelectInput(display, _wRoot, PropertyChangeMask); - + _pWhite= WhitePixel(display, _nDefaultScreen); _pBlack= BlackPixel(display, _nDefaultScreen); xsizehints= XAllocSizeHints(); xsizehints->flags= USSize | USPosition; xsizehints->width= xsizehints->height= 64; - + _wMain= XCreateSimpleWindow(display, _wRoot, 0, 0, 64, 64, 5, _pWhite, _pBlack); if (_wMain == 0) { fprintf(stderr, "Cannot create main window.\n"); exit(-1); } - + _wIcon= XCreateSimpleWindow(display, _wMain, 0, 0, 64, 64, 5, _pWhite, _pBlack); if (_wIcon == 0) { fprintf(stderr, "Cannot create icon window.\n"); exit(-1); } - + xwmhints= XAllocWMHints(); - xwmhints->flags= WindowGroupHint | IconWindowHint | StateHint; + xwmhints->flags= WindowGroupHint | IconWindowHint | StateHint; xwmhints->icon_window= _wIcon; xwmhints->window_group= _wMain; xwmhints->initial_state= WithdrawnState; XSetWMHints(display, _wMain, xwmhints); - + xclasshint= XAllocClassHint(); xclasshint->res_name= APPLICATION; xclasshint->res_class= APPLICATION; @@ -425,7 +425,7 @@ void initWindow (int nArgc, char** szArgv) { } XSetWMName(display, _wMain, &xtApplication); XFree(xtApplication.value); - + _gcMain= XCreateGC(display, _wMain, 0L, NULL); if (_gcMain == NULL) { fprintf(stderr, "Cannot create graphics context.\n"); @@ -434,9 +434,9 @@ void initWindow (int nArgc, char** szArgv) { XSelectInput(display, _wMain, ExposureMask | ButtonPressMask | PointerMotionMask | StructureNotifyMask | LeaveWindowMask); XSelectInput(display, _wIcon, ExposureMask | ButtonPressMask | PointerMotionMask | StructureNotifyMask | LeaveWindowMask); - + XSetCommand(display, _wMain, szArgv, nArgc); - + XMapWindow(display, _wMain); } @@ -493,7 +493,7 @@ void initWindowMask (char* szInstallDir, char* szButtonTheme) { getButtonLocation(i, &nButtonX, &nButtonY); XCopyArea(display, pOpaque, pMask, gc, nButtonX, nButtonY, getButtonWidth(), getButtonHeight(), nButtonX, nButtonY); } - + free(mask); XFreePixmap(display, pOpaque); XFreePixmap(display, pTransparent); @@ -503,7 +503,7 @@ void initWindowMask (char* szInstallDir, char* szButtonTheme) { XShapeCombineMask(display, wIcon, ShapeBounding, 0, 0, pMask, ShapeSet); if (isVerbose()) { - fprintf(stdout, "[%8ld] initializing button theme '%s'\n", currentTimeMillis(), + fprintf(stdout, "[%8ld] initializing button theme '%s'\n", currentTimeMillis(), szButtonTheme == NULL ? "" : szButtonTheme); } @@ -739,7 +739,7 @@ void loop () { if (strcmp(XA_NET_CURRENT_DESKTOP, atom_name) == 0) { setCurrentScreen(-1); if (isVerbose()) { - fprintf(stdout, "[%8ld] new current workspace (%d= %s)\n", + fprintf(stdout, "[%8ld] new current workspace (%d= %s)\n", currentTimeMillis(), getCurrentScreen(), getScreenName(getCurrentScreen())); } redrawWindow(); @@ -869,7 +869,7 @@ void initButtons (int nButtons, int nColumns, int nRows) { fprintf(stdout, "[%8ld] - %d workspace buttons\n", currentTimeMillis(), _nButtons); fprintf(stdout, "[%8ld] - button layout %dx%d\n", currentTimeMillis(), _nButtonColumns, _nButtonRows); } - + if (_nButtonColumns == 1) { _nButtonWidth= 51; } else if (_nButtonColumns == 2) { @@ -962,7 +962,7 @@ void setCurrentScreen (int nCurrentScreen) { int nFormat; unsigned long nItems, nBytesAfter; unsigned char* data; - + XGetWindowProperty( getDisplay(), getRootWindow(), _xaNetCurrentDesktop, 0, 8192, False, XA_CARDINAL, &xaType, &nFormat, &nItems, &nBytesAfter, &data @@ -983,7 +983,7 @@ void initScreens () { int nFormat; unsigned long nItems, nBytesAfter; unsigned char* data; - + if (isVerbose()) { fprintf(stdout, "[%8ld] initializing window maker communication\n", currentTimeMillis()); } @@ -1008,9 +1008,9 @@ void initScreens () { setCurrentScreen(-1); if (_nLastScreen == -1) { fprintf( - stderr, + stderr, "%s: couldn't determine current workspace.\n" \ - "Make sure your WindowMaker has EWMH support enabled!\n", + "Make sure your WindowMaker has EWMH support enabled!\n", getApplicationName() ); setCurrentScreen(0); @@ -1021,7 +1021,7 @@ void initScreens () { for (i= 0; i < getScreenCount(); i++) { fprintf(stdout, "[%8ld] - workspace %d: %s\n", currentTimeMillis(), i, getScreenName(i)); } - fprintf(stdout, "[%8ld] - current workspace is %d (%s)\n", currentTimeMillis(), + fprintf(stdout, "[%8ld] - current workspace is %d (%s)\n", currentTimeMillis(), getCurrentScreen(), getScreenName(getCurrentScreen())); } } diff --git a/wmpager/themes/Makefile.am b/wmpager/themes/Makefile.am index ffeb4a7..6e8d23c 100644 --- a/wmpager/themes/Makefile.am +++ b/wmpager/themes/Makefile.am @@ -1,3 +1,3 @@ -pkgdata_DATA = fire.xpm gray.xpm steel.xpm +pkgdata_DATA = fire.xpm gray.xpm steel.xpm EXTRA_DIST = $(pkgdata_DATA) diff --git a/wmpower/ChangeLog b/wmpower/ChangeLog index 3b48e57..888c003 100644 --- a/wmpower/ChangeLog +++ b/wmpower/ChangeLog @@ -22,16 +22,16 @@ * src/power_management/toshiba/toshiba_lib.c (acpi_set_lcd_brightness), (hardware_set_lcd_brightness), - * src/power_management/compal/compal_lib.c (compal_set_lcd_brightness), + * src/power_management/compal/compal_lib.c (compal_set_lcd_brightness), * src/power_management/power_management.h, - * src/wmpower.c (main, ParseCMDLine, message): + * src/wmpower.c (main, ParseCMDLine, message): Added new command line arguments to be able to force wmpower to use our values for minimum and maximum brightness. * src/power_management/compal/compal_lib.c (compal_get_battery_time): Check wether battery is present instead of segfaulting when we think it is while, in face, it is not. - (compal_set_lcd_brightness): + (compal_set_lcd_brightness): Fixed lcd brightness handling. 2005-07-19 Noberasco Michele @@ -86,7 +86,7 @@ (cpufreq_get_governor_2_6), * src/wmpower.c (message, ParseCMDLine), * src/power_management/power_management.c (internal_set_pm_features) - (pm_support): + (pm_support): Allow user to choose his own CPUFreq governors when online and offline... 2005-02-04 Noberasco Michele @@ -123,7 +123,7 @@ * configure.in, * src/power_management/Makefile.am (AM_CFLAGS), - * src/power_management/toshiba/toshiba_lib.c: + * src/power_management/toshiba/toshiba_lib.c: Added fix to make it compile on non x86 hardware... Problem reported by Benjamin Rich diff --git a/wmpower/LEGGIMI b/wmpower/LEGGIMI index 919d70a..ae58917 100644 --- a/wmpower/LEGGIMI +++ b/wmpower/LEGGIMI @@ -21,7 +21,7 @@ Punti di forza: una maggiore autonomia; se avete un portatile Toshiba, può anche regolare la luminosità del display; - Modalità carica rapida della batteria: potete mantenere le - impostazioni del punto precedente finché la batteria non + impostazioni del punto precedente finché la batteria non sarà nuovamente al 100%: questo la farà ricaricare molto più velocemente (e senza bisogno di spegnere il computer); - Optione no-meddling: con questa impostazione, il programma @@ -40,7 +40,7 @@ Digitate 'wmpower -h' per vedere tutti i parametri disponibili. Ovviamente necessita di un server X-Windows attivo per funzionare. ---------------------------------------------------------------------- - + Problemi conosciuti: Nessuno... questo non significa che non ce ne siano; se incontrate un problema, o se vorreste qualche nuuova funzionalità, mandatemi @@ -52,7 +52,7 @@ Da fare: - Dividere il programma in due parti: un demone per gestire il risparmio energetico e l'interfaccia per mostrare informazioni. - Aggiungere il supporto per file di configurazione... non vogliamo - mica digitare tutte quelle opzioni ogni volta, no? + mica digitare tutte quelle opzioni ogni volta, no? ---------------------------------------------------------------------- @@ -60,5 +60,5 @@ Ringraziamenti: - Filippo Panessa per il suo 'wmab'... è da qui che ho cominciato. - Costantino Pistagna per il suo 'wmacpimon'... da qui ho preso inizialmente il supporto ACPI. -- Jonathan A. Buzzard pre le sue Toshiba(tm) Linux Utilities... +- Jonathan A. Buzzard pre le sue Toshiba(tm) Linux Utilities... indovinate un po' che cosa ne ho ricavato ;-) diff --git a/wmpower/README b/wmpower/README index 309a01b..ee9b2bd 100644 --- a/wmpower/README +++ b/wmpower/README @@ -1,5 +1,5 @@ WMPOWER - + wmpower is a Window Maker dock application allowing the user to graphically see (and set) the power management status of his laptop. diff --git a/wmpower/configure.in b/wmpower/configure.in index 59e4448..2312e97 100644 --- a/wmpower/configure.in +++ b/wmpower/configure.in @@ -105,7 +105,7 @@ AC_PROG_RANLIB AC_CHECK_LIB(pthread, pthread_create, , , ) # end threads check -AC_CONFIG_FILES([Makefile +AC_CONFIG_FILES([Makefile src/Makefile src/dockapp/Makefile src/power_management/Makefile diff --git a/wmpower/src/open_syslog_on_stderr.c b/wmpower/src/open_syslog_on_stderr.c index 733f984..8e4b440 100644 --- a/wmpower/src/open_syslog_on_stderr.c +++ b/wmpower/src/open_syslog_on_stderr.c @@ -83,7 +83,7 @@ void open_syslog_on_stderr(void) int fd; filename = (char*) malloc(19*sizeof(char)); - + if (!filename) { fprintf(stderr, "wmpower: fatal error: failed allocating memory!\n"); @@ -103,7 +103,7 @@ void open_syslog_on_stderr(void) if (chmod(filename, S_IRUSR|S_IWUSR)) { fprintf(stderr, "wmpower: fatal error: cannot chmod() file!\n"); - abort(); + abort(); } if (!freopen(filename, "w", stderr)) @@ -114,7 +114,7 @@ void open_syslog_on_stderr(void) /* close the file descriptor as we have no need for it */ close(fd); - + /* spawn our syslog_writer baby */ if (pthread_create(&thread, NULL, (void*)(&syslog_writer), filename)) { diff --git a/wmpower/src/power_management/acpi/libacpi.c b/wmpower/src/power_management/acpi/libacpi.c index 8291e0b..f0ab8ab 100644 --- a/wmpower/src/power_management/acpi/libacpi.c +++ b/wmpower/src/power_management/acpi/libacpi.c @@ -121,7 +121,7 @@ char *find_acad_proc_file(void) char *basedir = "/proc/acpi/ac_adapter/"; struct dirent *entry; - dir= opendir(basedir); + dir= opendir(basedir); if (!dir) return NULL; while ((entry= readdir(dir))) @@ -129,11 +129,11 @@ char *find_acad_proc_file(void) char *result = NULL; char *temp1, *temp2, *temp3; if (!strcmp(entry->d_name, "." )) continue; - if (!strcmp(entry->d_name, "..")) continue; + if (!strcmp(entry->d_name, "..")) continue; temp1 = StrApp((char**)NULL, basedir, entry->d_name, "/state", (char*)NULL); temp2 = StrApp((char**)NULL, basedir, entry->d_name, "/status", (char*)NULL); temp3 = StrApp((char**)NULL, basedir, entry->d_name, "/stats", (char*)NULL); - + if (!access(temp1, R_OK)) {result = temp1; free(temp2); free(temp3);} else if (!access(temp2, R_OK)) {result = temp2; free(temp1); free(temp3);} else if (!access(temp3, R_OK)) {result = temp3; free(temp1); free(temp2);} @@ -153,7 +153,7 @@ char *find_acad_proc_file(void) void read_acad_state (ACADstate *acadstate) { static int searched = 0; - static char *file = NULL; + static char *file = NULL; static char *where = NULL; FILE *fp; @@ -174,9 +174,9 @@ void read_acad_state (ACADstate *acadstate) if (!strncmp(buf, "Status:", 7)) where = buf + 26; } if (!where) return; - + if (where[0] == 'n') acadstate->state = 1; - if (where[0] == 'f') acadstate->state = 0; + if (where[0] == 'f') acadstate->state = 0; } @@ -370,14 +370,14 @@ char *find_temperature_proc_file(void) char *basedir = "/proc/acpi/thermal_zone/"; struct dirent *entry; - dir= opendir(basedir); + dir= opendir(basedir); if (!dir) return NULL; while ((entry= readdir(dir))) { char *temp; if (!strcmp(entry->d_name, "." )) continue; - if (!strcmp(entry->d_name, "..")) continue; + if (!strcmp(entry->d_name, "..")) continue; temp = StrApp((char**)NULL, basedir, entry->d_name, "/temperature", (char*)NULL); if (!access(temp, R_OK)) { @@ -436,7 +436,7 @@ int get_fan_info(void) { char *temp; if (!strcmp(entry->d_name, "." )) continue; - if (!strcmp(entry->d_name, "..")) continue; + if (!strcmp(entry->d_name, "..")) continue; temp = StrApp((char**)NULL, basedir, "/", entry->d_name, "/state", (char*)NULL); if (!access(temp, R_OK)) { diff --git a/wmpower/src/power_management/apm/libapm.c b/wmpower/src/power_management/apm/libapm.c index efe38a1..c037e4c 100644 --- a/wmpower/src/power_management/apm/libapm.c +++ b/wmpower/src/power_management/apm/libapm.c @@ -24,7 +24,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * * ***************************************************************************/ - + /*************************************************************************** Originally written by Filippo Panessa for his 'wmab' program ***************************************************************************/ diff --git a/wmpower/src/power_management/apm/libapm.h b/wmpower/src/power_management/apm/libapm.h index cc09416..7797b6a 100644 --- a/wmpower/src/power_management/apm/libapm.h +++ b/wmpower/src/power_management/apm/libapm.h @@ -24,14 +24,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * * ***************************************************************************/ - + /*************************************************************************** Originally written by Filippo Panessa for his 'wmab' program ***************************************************************************/ #define APMDEV "/proc/apm" -typedef struct +typedef struct { const char driver_version[10]; int apm_version_major; diff --git a/wmpower/src/power_management/compal/compal_lib.c b/wmpower/src/power_management/compal/compal_lib.c index 7eabd44..6c2d495 100644 --- a/wmpower/src/power_management/compal/compal_lib.c +++ b/wmpower/src/power_management/compal/compal_lib.c @@ -24,7 +24,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * * ***************************************************************************/ - + /*************************************************************************** Many thanks to Soós Péter and the omke project team I could never have done this otherwise @@ -97,7 +97,7 @@ int compal_get_fan_status (void) { FILE *fp = fopen (COMPAL_PROC_FILE_FAN, "r"); char fan_status[3]; - + if (!fp) return PM_Error; if (fscanf (fp, "%*s%*s%2s", fan_status) != 1) diff --git a/wmpower/src/power_management/compal/compal_lib.h b/wmpower/src/power_management/compal/compal_lib.h index 1ed4658..c96d847 100644 --- a/wmpower/src/power_management/compal/compal_lib.h +++ b/wmpower/src/power_management/compal/compal_lib.h @@ -24,7 +24,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * * ***************************************************************************/ - + /*************************************************************************** Many thanks to Soós Péter and the omke project team I could never have done this otherwise diff --git a/wmpower/src/power_management/cpufreq/cpufreq.c b/wmpower/src/power_management/cpufreq/cpufreq.c index e51c90e..0ecef6b 100644 --- a/wmpower/src/power_management/cpufreq/cpufreq.c +++ b/wmpower/src/power_management/cpufreq/cpufreq.c @@ -97,7 +97,7 @@ int check_cpufreq_2_6(void) if (!strcmp(entry->d_name, "." )) continue; if (!strcmp(entry->d_name, "..")) continue; if (strncmp(entry->d_name, "cpu", 3)) continue; - + /* let's see wether this particular CPU has CPUfreq support... */ filename = StrApp((char**)NULL, SYSFS_CPU_BASE_DIR, "/", entry->d_name, "/cpufreq/", SYSFS_CPUFREQ_TEST, (char*)NULL); fp = fopen(filename, "r"); @@ -133,7 +133,7 @@ int check_cpufreq_2_6(void) free(line); } closedir(dir); - + /* did we get results? */ if (available_cpus) return 1; @@ -258,7 +258,7 @@ int set_cpufreq_governor_2_6(char *governor) free(filename); fclose(fp); retval = 0; - continue; + continue; } fclose(fp); @@ -323,14 +323,14 @@ int set_cpufreq_governor_2_6(char *governor) size_t len = 0; char *line = NULL; char *test; - + if (getline(&line, &len, fp) == -1) { fprintf(stderr, "could not read from file %s!\n", filename); free(filename); fclose(fp); retval = 0; - continue; + continue; } fclose(fp); test = (char *) calloc(strlen(line)+1,sizeof(char)); diff --git a/wmpower/src/power_management/dell/dell_lib.c b/wmpower/src/power_management/dell/dell_lib.c index f63248e..3b77e5a 100644 --- a/wmpower/src/power_management/dell/dell_lib.c +++ b/wmpower/src/power_management/dell/dell_lib.c @@ -41,7 +41,7 @@ int dell_get_fan_status(void) int dell_get_temperature(void) { FILE *fp = fopen(PROC_FILE, "r"); - int result; + int result; if (!fp) return PM_Error; diff --git a/wmpower/src/power_management/power_management.c b/wmpower/src/power_management/power_management.c index 72ce0b7..bbec8dd 100644 --- a/wmpower/src/power_management/power_management.c +++ b/wmpower/src/power_management/power_management.c @@ -522,7 +522,7 @@ int calculate_battery_time(int battery_percentage, int ac_on_line) } else { /* We calculate time left until battery is fully recharged */ - + /* How much battery was gained in this time? */ int gained_battery = battery_percentage - first_percentage; diff --git a/wmpower/src/power_management/toshiba/hci.c b/wmpower/src/power_management/toshiba/hci.c index 68b9bf6..ed98b93 100644 --- a/wmpower/src/power_management/toshiba/hci.c +++ b/wmpower/src/power_management/toshiba/hci.c @@ -1,7 +1,7 @@ /* hci.c -- Hardware Configuration Interface * * Copyright (c) 1998-2000 Jonathan A. Buzzard (jonathan@buzzard.org.uk) - * + * * $Log: hci.c,v $ * Revision 1.2 2003/11/06 12:48:08 noberasco * Added a new machine id... @@ -33,16 +33,16 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * + * */ static const char rcsid[]="$Id: hci.c,v 1.2 2003/11/06 12:48:08 noberasco Exp $"; @@ -148,8 +148,8 @@ int HciGetLCDPanelType(int *resolution, int *type) regs.ebx = HCI_FLAT_PANEL; HciFunction(®s); - *resolution = (regs.ecx & 0xff00)>>8; - *type = regs.ecx & 0xff; + *resolution = (regs.ecx & 0xff00)>>8; + *type = regs.ecx & 0xff; return HCI_SUCCESS; } diff --git a/wmpower/src/power_management/toshiba/hci.h b/wmpower/src/power_management/toshiba/hci.h index beae33d..c6af9a0 100644 --- a/wmpower/src/power_management/toshiba/hci.h +++ b/wmpower/src/power_management/toshiba/hci.h @@ -30,14 +30,14 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * */ @@ -52,7 +52,7 @@ extern "C" { #ifndef LINUX_TOSHIBA_H #define LINUX_TOSHIBA_H #include -#endif +#endif enum { @@ -106,7 +106,7 @@ enum { HCI_9BIT_TFT = 0x02, HCI_12BIT_TFT = 0x03, HCI_18BIT_TFT = 0x04, - HCI_24BIT_TFT = 0x05 + HCI_24BIT_TFT = 0x05 }; enum { diff --git a/wmpower/src/power_management/toshiba/sci.c b/wmpower/src/power_management/toshiba/sci.c index b8a2a50..ee8c7da 100644 --- a/wmpower/src/power_management/toshiba/sci.c +++ b/wmpower/src/power_management/toshiba/sci.c @@ -1,7 +1,7 @@ /* sci.c -- System Configuration Interface * * Copyright (c) 1998-2000 Jonathan A. Buzzard (jonathan@buzzard.org.uk) - * + * * $Log: sci.c,v $ * Revision 1.1 2003/09/18 16:38:27 noberasco * overhaul III @@ -60,16 +60,16 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * + * */ static const char rcsid[]="$Id: sci.c,v 1.1 2003/09/18 16:38:27 noberasco Exp $"; diff --git a/wmpower/src/power_management/toshiba/sci.h b/wmpower/src/power_management/toshiba/sci.h index 6f51e6e..a4b52a6 100644 --- a/wmpower/src/power_management/toshiba/sci.h +++ b/wmpower/src/power_management/toshiba/sci.h @@ -62,14 +62,14 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * */ @@ -84,7 +84,7 @@ extern "C" { #ifndef LINUX_TOSHIBA_H #define LINUX_TOSHIBA_H #include -#endif +#endif /* @@ -134,7 +134,7 @@ enum { * the different states the various modes can be set to */ -enum { +enum { SCI_BOOT = 0x0000, SCI_RESUME = 0x0001, SCI_HIBERNATE = 0x0002, @@ -189,7 +189,7 @@ enum { SCI_TIME_55 = 0x4000, SCI_TIME_60 = 0x8000 }; - + enum { SCI_FD_HD = 0x0000, SCI_HD_FD = 0x0001 @@ -274,7 +274,7 @@ enum { * macro's to manipulate the time and date data types */ #define SCI_TIME(h,m) ((m & 0x3f)<<1) | ((h & 0x1f)<<7) -#define SCI_HOUR(t) (t & 0x7fc0)>>7 +#define SCI_HOUR(t) (t & 0x7fc0)>>7 #define SCI_MINUTE(t) (t & 0x7e)>>1 #define SCI_TIME_ON(t) (t & 0x01) #define SCI_DATE(m,d) ((m & 0xf)<<6) | ((d & 0x1f)<<1) diff --git a/wmpower/src/power_management/toshiba/toshiba_lib.c b/wmpower/src/power_management/toshiba/toshiba_lib.c index 7b01cef..7a5f3d4 100644 --- a/wmpower/src/power_management/toshiba/toshiba_lib.c +++ b/wmpower/src/power_management/toshiba/toshiba_lib.c @@ -64,7 +64,7 @@ int Get_Fan_Status(void); int toshiba_get_fan_status(int use_toshiba_hardware) -{ +{ if (use_toshiba_hardware != 2) { FILE *fp = fopen("/proc/acpi/toshiba/fan", "r"); @@ -80,7 +80,7 @@ int toshiba_get_fan_status(int use_toshiba_hardware) } if (!use_toshiba_hardware) return PM_Error; } - + if (Get_Fan_Status()<0x00) { fprintf(stderr, "direct access to toshiba hardware failed:\n"); @@ -187,7 +187,7 @@ int acpi_set_lcd_brightness(int brightness) fprintf(fp, "brightness:%d\n", brightness); fclose(fp); fp = fopen("/proc/acpi/toshiba/lcd", "r"); - fscanf(fp, "%*s%d", ¤t_brightness); + fscanf(fp, "%*s%d", ¤t_brightness); fclose(fp); if (brightness == current_brightness) fprintf(stderr, "toshiba_lib: set LCD brightness to %d\n", brightness); diff --git a/wmpower/src/power_management/toshiba/toshiba_lib.h b/wmpower/src/power_management/toshiba/toshiba_lib.h index 28bfcb3..7200dfd 100644 --- a/wmpower/src/power_management/toshiba/toshiba_lib.h +++ b/wmpower/src/power_management/toshiba/toshiba_lib.h @@ -24,7 +24,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * * ***************************************************************************/ - + /*************************************************************************** Many thanks to Jonathan A. Buzzard for his Toshiba(tm) Linux Utilities I could never have done this otherwise diff --git a/wmpower/src/wmpower.c b/wmpower/src/wmpower.c index 25fc73d..568528e 100644 --- a/wmpower/src/wmpower.c +++ b/wmpower/src/wmpower.c @@ -92,7 +92,7 @@ int main (int argc, char *argv[]) struct timespec delay; /* pause between interface updates */ char Command[CMDLINELEN+3]; int warned = 0; - + delay.tv_sec = 0; delay.tv_nsec = 500000000; diff --git a/wmpower/wmpower.spec b/wmpower/wmpower.spec index 4dd8ebf..7b20b43 100644 --- a/wmpower/wmpower.spec +++ b/wmpower/wmpower.spec @@ -21,7 +21,7 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release} %description wmpower is a Window Maker dock application allowing the user to graphically see (and set) the power management status of his laptop. - + %prep %setup -q diff --git a/wmsm.app/CHANGELOG b/wmsm.app/CHANGELOG index 32e7fd2..53a521e 100644 --- a/wmsm.app/CHANGELOG +++ b/wmsm.app/CHANGELOG @@ -1,5 +1,5 @@ 0.2.0 -> 0.2.1 -added -d option to select the device that should observe, e.g. hda or sda +added -d option to select the device that should observe, e.g. hda or sda (thanks to Carles Garrigues and krakov) added small point befor IOR and IOW only if the change of IOR or IOW was to small to display with the scale. Result: .IOR or .IOW @@ -13,4 +13,4 @@ fixed division by zero bug, if no swapfile available (thanks Jo 0.1.0 -> 0.1.1 added mem correction option (-m) // used=total-free-cached-buffers -patched width calc at r_io and w_io +patched width calc at r_io and w_io diff --git a/wmsm.app/INSTALL b/wmsm.app/INSTALL index 11a3970..c0754e2 100644 --- a/wmsm.app/INSTALL +++ b/wmsm.app/INSTALL @@ -1,3 +1,3 @@ cd wmsm -make +make make install (root) diff --git a/wmsm.app/wmgeneral/list.c b/wmsm.app/wmgeneral/list.c index be7464f..a63562f 100644 --- a/wmsm.app/wmgeneral/list.c +++ b/wmsm.app/wmgeneral/list.c @@ -1,11 +1,11 @@ -/* Generic single linked list to keep various information +/* Generic single linked list to keep various information Copyright (C) 1993, 1994 Free Software Foundation, Inc. Author: Kresten Krab Thorup Many modifications by Alfredo K. Kojima - + This file is part of GNU CC. @@ -38,7 +38,7 @@ Boston, MA 02110-1301 USA. */ /* Return a cons cell produced from (head . tail) */ -INLINE LinkedList* +INLINE LinkedList* list_cons(void* head, LinkedList* tail) { LinkedList* cell; @@ -63,7 +63,7 @@ list_length(LinkedList* list) return i; } -/* Return the Nth element of LIST, where N count from zero. If N +/* Return the Nth element of LIST, where N count from zero. If N larger than the list length, NULL is returned */ INLINE void* @@ -84,7 +84,7 @@ list_nth(int index, LinkedList* list) INLINE void list_remove_head(LinkedList** list) { - if (!*list) return; + if (!*list) return; if ((*list)->tail) { LinkedList* tail = (*list)->tail; /* fetch next */ @@ -116,7 +116,7 @@ INLINE LinkedList * list_remove_elem(LinkedList* list, void* elem) { LinkedList *tmp; - + if (list) { if (list->head == elem) { tmp = list->tail; diff --git a/wmsm.app/wmgeneral/list.h b/wmsm.app/wmgeneral/list.h index 4b6b86f..92c3454 100644 --- a/wmsm.app/wmgeneral/list.h +++ b/wmsm.app/wmgeneral/list.h @@ -1,4 +1,4 @@ -/* Generic single linked list to keep various information +/* Generic single linked list to keep various information Copyright (C) 1993, 1994 Free Software Foundation, Inc. Author: Kresten Krab Thorup diff --git a/wmsm.app/wmgeneral/misc.c b/wmsm.app/wmgeneral/misc.c index f86481e..1f3bb2e 100644 --- a/wmsm.app/wmgeneral/misc.c +++ b/wmsm.app/wmgeneral/misc.c @@ -1,9 +1,9 @@ /* dock.c- built-in Dock module for WindowMaker - * + * * WindowMaker window manager - * + * * Copyright (c) 1997 Alfredo K. Kojima - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -28,7 +28,7 @@ *---------------------------------------------------------------------- * parse_command-- * Divides a command line into a argv/argc pair. - *---------------------------------------------------------------------- + *---------------------------------------------------------------------- */ #define PRC_ALPHA 0 #define PRC_BLANK 1 @@ -64,11 +64,11 @@ next_token(char *word, char **next) t = ret = malloc(strlen(word)+1); ptr = word; - + state = 0; *t = 0; while (1) { - if (*ptr==0) + if (*ptr==0) ctype = PRC_EOS; else if (*ptr=='\\') ctype = PRC_ESCAPE; @@ -98,12 +98,12 @@ next_token(char *word, char **next) t = strdup(ret); free(ret); - + if (ctype==PRC_EOS) *next = NULL; else *next = ptr; - + return t; } @@ -118,7 +118,7 @@ parse_command(char *command, char ***argv, int *argc) line = command; do { token = next_token(line, &line); - if (token) { + if (token) { list = list_cons(token, list); } } while (token!=NULL && line!=NULL); @@ -141,15 +141,15 @@ execCommand(char *command) int argc; parse_command(command, &argv, &argc); - + if (argv==NULL) { return 0; } - + if ((pid=fork())==0) { char **args; int i; - + args = malloc(sizeof(char*)*(argc+1)); if (!args) exit(10); diff --git a/wmsm.app/wmgeneral/wmgeneral.c b/wmsm.app/wmgeneral/wmgeneral.c index 2a858d6..be2ecee 100644 --- a/wmsm.app/wmgeneral/wmgeneral.c +++ b/wmsm.app/wmgeneral/wmgeneral.c @@ -17,7 +17,7 @@ * Now supports >256 colors 11/09/1998 (Martijn Pieterse, pieterse@xs4all.nl) * Removed a bug from parse_rcfile. You could - not use "start" in a command if a label was + not use "start" in a command if a label was also start. * Changed the needed geometry string. We don't use window size, and don't support @@ -177,7 +177,7 @@ static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) { err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap), &(wmgen->mask), &(wmgen->attributes)); - + if (err != XpmSuccess) { fprintf(stderr, "Not enough free colorcells.\n"); exit(1); @@ -224,9 +224,9 @@ static int flush_expose(Window w) { \*******************************************************************************/ void RedrawWindow(void) { - + flush_expose(iconwin); - XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, + 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, @@ -238,9 +238,9 @@ void RedrawWindow(void) { \*******************************************************************************/ void RedrawWindowXY(int x, int y) { - + flush_expose(iconwin); - XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, + 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, @@ -296,7 +296,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) { unsigned char bwrite; int bcount; int curpixel; - + sscanf(*xpm, "%d %d %d %d", &width, &height, &numcol, &depth); @@ -305,7 +305,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) { zero <<=8; zero |= xpm[2][k]; } - + for (i=numcol+1; i < numcol+sy+1; i++) { bcount = 0; bwrite = 0; @@ -318,7 +318,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) { curpixel <<=8; curpixel |= xpm[i][j+k]; } - + if ( curpixel != zero ) { bwrite += 128; } @@ -394,7 +394,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit } if (!(display = XOpenDisplay(display_name))) { - fprintf(stderr, "%s: can't open display %s\n", + fprintf(stderr, "%s: can't open display %s\n", wname, XDisplayName(display_name)); exit(1); } @@ -419,10 +419,10 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit 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); @@ -443,7 +443,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit XSetWMName(display, win, &name); /* Create GC for drawing */ - + gcm = GCForeground | GCBackground | GCGraphicsExposures; gcv.foreground = fore_pix; gcv.background = back_pix; diff --git a/wmsm.app/wmsm/wmsm.c b/wmsm.app/wmsm/wmsm.c index 9c298a3..062b37a 100644 --- a/wmsm.app/wmsm/wmsm.c +++ b/wmsm.app/wmsm/wmsm.c @@ -138,7 +138,7 @@ static void draw_uptime(int day,int hour,int min,int sec) } } } - } + } } static void draw_enable_point(int dx,int dy) @@ -306,7 +306,7 @@ static void get_values(int init,int kernelVersion) } else { draw_disable_point(point_read_x,point_read_y); } - + /* w_io */ diff=w_io-last.w_io; if(diff>last.w_diff_max) { @@ -320,7 +320,7 @@ static void get_values(int init,int kernelVersion) } else { draw_disable_point(point_write_x,point_write_y); } - + /* mem */ if(!mem_total) { width=0; @@ -332,7 +332,7 @@ static void get_values(int init,int kernelVersion) } } draw_scale(width,mem_s_x,mem_s_y); - + /* swap */ if(!swap_total) { width=0; diff --git a/wmsmixer/Imakefile b/wmsmixer/Imakefile index 7da10f6..01035d4 100644 --- a/wmsmixer/Imakefile +++ b/wmsmixer/Imakefile @@ -4,7 +4,7 @@ OSSAUDIO = -lossaudio OSSAUDIO = #endif -DEPLIBS = $(DEPXLIB) +DEPLIBS = $(DEPXLIB) LOCAL_LIBRARIES = $(XPMLIB) $(XLIB) $(OSSAUDIO) CC = c++ -m32 LD = c++ -m32 -nostdlib diff --git a/wmsmixer/README b/wmsmixer/README index 04e57c8..a96a0eb 100644 --- a/wmsmixer/README +++ b/wmsmixer/README @@ -39,7 +39,7 @@ The main changes between this and wmmixer are: 4 and 5, using it will increase/decrease the volume of the current channel. -* Removed all the recsrc code. +* Removed all the recsrc code. * Changed the display arrangement slightly, and replaced the recsrc button with a numeric/text display. diff --git a/wmsmixer/home.wmsmixer b/wmsmixer/home.wmsmixer index 7588829..099eaca 100644 --- a/wmsmixer/home.wmsmixer +++ b/wmsmixer/home.wmsmixer @@ -99,7 +99,7 @@ addchannel 8 setmono 90 # RECLEVEL -addchannel 11 +addchannel 11 setmono 0 # OGAIN diff --git a/wmsmixer/wmsmixer.cc b/wmsmixer/wmsmixer.cc index 147f66d..5f97512 100644 --- a/wmsmixer/wmsmixer.cc +++ b/wmsmixer/wmsmixer.cc @@ -96,7 +96,7 @@ unsigned long color[4]; int text_counter = 0; -// Misc custom global variables +// Misc custom global variables // ---------------------------- // Current state information @@ -270,7 +270,7 @@ int main(int argc, char **argv) } else checkVol(false); - + if(text_counter) { text_counter--; if(!text_counter) { @@ -591,7 +591,7 @@ void pressEvent(XButtonEvent *xev) mixctl->readVol(channel[curchannel], false); mixctl->setLeft(channel[curchannel], CLAMP(mixctl->readLeft(channel[curchannel]) + inc, 0, 100)); - mixctl->setRight(channel[curchannel], + mixctl->setRight(channel[curchannel], CLAMP(mixctl->readRight(channel[curchannel]) + inc, 0, 100)); mixctl->writeVol(channel[curchannel]); checkVol(false); @@ -691,10 +691,10 @@ void drawText(char *text) for(int i=0; i<4; i++, p++) { p2 = toupper(*p); - if(p2 >= 'A' && p2 <= 'Z') { + if(p2 >= 'A' && p2 <= 'Z') { XCopyArea(d_display, pm_chars, pm_disp, gc_gc, 6*((int)p2-65), 0, 6, 9, 5+(i*6), 5); } - else if(p2 >= '0' && p2 <= '9') { + else if(p2 >= '0' && p2 <= '9') { XCopyArea(d_display, pm_digits, pm_disp, gc_gc, 6*((int)p2-48), 0, 6, 9, 5+(i*6), 5); } else { @@ -711,7 +711,7 @@ void drawVolLevel() { int digits[4]; - int vol = (mixctl->readLeft(channel[curchannel]) + + int vol = (mixctl->readLeft(channel[curchannel]) + mixctl->readRight(channel[curchannel])) / 2; digits[0] = (vol/100) ? 1 : 10; diff --git a/wmstickynotes/wmstickynotes.c b/wmstickynotes/wmstickynotes.c index eb6d02c..de87b95 100644 --- a/wmstickynotes/wmstickynotes.c +++ b/wmstickynotes/wmstickynotes.c @@ -171,8 +171,8 @@ int main(int argc, char *argv[]) mywmhints.initial_state = WithdrawnState; mywmhints.icon_window = GDK_WINDOW_XWINDOW(box->window); - mywmhints.icon_x = 0; - mywmhints.icon_y = 0; + mywmhints.icon_x = 0; + mywmhints.icon_y = 0; mywmhints.window_group = GDK_WINDOW_XWINDOW(window->window); mywmhints.flags = StateHint | IconWindowHint | IconPositionHint | WindowGroupHint; @@ -276,7 +276,7 @@ void create_note(Note *old_note, ColorScheme *scheme) GtkTextBuffer *text_buffer; Note *note; - + note = old_note ? old_note : malloc(sizeof(Note)); if(!old_note) { diff --git a/wmsupermon/README b/wmsupermon/README index 6c3c930..fd2e57a 100644 --- a/wmsupermon/README +++ b/wmsupermon/README @@ -8,7 +8,7 @@ Universal Monitoring Dockapp. Can be used to monitor 1. CPU usage - 2. disk i/o + 2. disk i/o 3. memory 4. swap 5. filesystems - space utilization @@ -130,7 +130,7 @@ Besides sources, config file defines windows and panes. Every window definiftion starts from [[name]], where "name" is the window title. Wmsupermon may open many windows, with different layouts and values to monitor. - + Window definition consists of widgets, which are placed on panes. A pane has four rows, and a widget can take up to all the four, depending on the type and options, see below. A pane is thus defined diff --git a/wmsupermon/TODO b/wmsupermon/TODO index f797ea6..507ca90 100644 --- a/wmsupermon/TODO +++ b/wmsupermon/TODO @@ -6,7 +6,7 @@ - how to configure http request header ? - POST ? - or arbirtary expect-like script for network communications ? - + * real value of an indicator in tooltips * "text" indicator (to show a string, not a number) diff --git a/wmsupermon/dockapp.c b/wmsupermon/dockapp.c index bb3d34f..805ab28 100644 --- a/wmsupermon/dockapp.c +++ b/wmsupermon/dockapp.c @@ -1,12 +1,12 @@ /* * 2006 - changes by Sergei Golubchik * + set window title, better wm hints - * + multi-window support + * + multi-window support */ /* * Copyright (c) 1999 Alfredo K. Kojima - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights @@ -23,7 +23,7 @@ * AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * */ #include "dockapp.h" @@ -104,7 +104,7 @@ iswmaker(Display *dpy) XFree(data); - win = (Window*)PropGetCheckProperty(dpy, DefaultRootWindow(dpy), + win = (Window*)PropGetCheckProperty(dpy, DefaultRootWindow(dpy), noticeboard, XA_WINDOW, 32, -1, &count); @@ -142,13 +142,13 @@ DAInitialize(char *display, char *name, unsigned width, unsigned height, d_width = width; d_height = height; - + progName = argv[0]; if (!DADisplay) DADisplay = XOpenDisplay(display); if (!DADisplay) { - printf("%s: could not open display %s!\n", progName, + printf("%s: could not open display %s!\n", progName, XDisplayName(display)); exit(1); @@ -251,7 +251,7 @@ DAMakePixmapFromData(Window *window, char **data, Pixmap *pixmap, Pixmap *mask, xpmat.valuemask = XpmCloseness; xpmat.closeness = 40000; - if (XpmCreatePixmapFromData(DADisplay, *window, data, pixmap, mask, + if (XpmCreatePixmapFromData(DADisplay, *window, data, pixmap, mask, &xpmat)!=0) { return False; } @@ -320,7 +320,7 @@ DAProcessEvent(Window *window, XEvent *event) case MotionNotify: if (d_callbacks.motion) { - (*d_callbacks.motion)(window[0], event->xbutton.x, event->xbutton.y); + (*d_callbacks.motion)(window[0], event->xbutton.x, event->xbutton.y); } break; @@ -366,9 +366,9 @@ DAEventLoop(Window *window) static DAProgramOption defaultOptions[]= { - {"-h", "--help", "shows this help text and exit", DONone, False, + {"-h", "--help", "shows this help text and exit", DONone, False, {NULL}}, - {"-v", "--version", "shows program version and exit", DONone, False, + {"-v", "--version", "shows program version and exit", DONone, False, {NULL}} }; @@ -436,7 +436,7 @@ DAParseArguments(int argc, char **argv, DAProgramOption *options, for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-h")==0 || strcmp(argv[i], "--help")==0) { - + printHelp(argv[0], programDescription, options, count); exit(0); @@ -520,7 +520,7 @@ DAGetColor(char *colorName) { XColor color; - if (!XParseColor(DADisplay, + if (!XParseColor(DADisplay, DefaultColormap(DADisplay, DefaultScreen(DADisplay)), colorName, &color)) { printf("%s: could not parse color %s\n", progName, colorName); @@ -537,7 +537,7 @@ DAGetColor(char *colorName) } -void +void DASetTimeout(int milliseconds) { d_timeout = milliseconds; @@ -563,7 +563,7 @@ DANextEventOrTimeout(XEvent *event, unsigned long millisec) FD_ZERO(&rset); FD_SET(ConnectionNumber(DADisplay), &rset); - if (select(ConnectionNumber(DADisplay)+1, &rset, NULL, NULL, + if (select(ConnectionNumber(DADisplay)+1, &rset, NULL, NULL, &timeout) > 0) { XNextEvent(DADisplay, event); return True; diff --git a/wmsupermon/dockapp.h b/wmsupermon/dockapp.h index 93fe210..5bf1142 100644 --- a/wmsupermon/dockapp.h +++ b/wmsupermon/dockapp.h @@ -1,7 +1,7 @@ /* - * + * * Copyright (c) 1999 Alfredo K. Kojima - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights @@ -18,14 +18,14 @@ * AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * */ #ifndef _DOCKAPP_H_ #define _DOCKAPP_H_ /* - * This is a simple (trivial) library for writing Window Maker dock + * This is a simple (trivial) library for writing Window Maker dock * applications, or dockapps (those that only show up in the dock), easily. */ @@ -70,7 +70,7 @@ typedef struct { short type; /* type of argument */ - Bool used; /* if the argument was passed in the + Bool used; /* if the argument was passed in the cmd line */ /* the following are only set if the "used" field is True */ union { /* a ptr for the value that was passed @@ -90,7 +90,7 @@ typedef struct { * * -h, --help and --version are automatically handled (causing the program * to exit) - * + * */ void DAParseArguments(int argc, char **argv, DAProgramOption *options, int count, char *programDescription, @@ -111,7 +111,7 @@ void DAParseArguments(int argc, char **argv, DAProgramOption *options, * default value * name - the name of your dockapp, used as the class name for * the WM_CLASS hint. Like WMYAClock - * width, height - the size of the dockapp window. 48x48 is the + * width, height - the size of the dockapp window. 48x48 is the * preferred size * argc, argv - the program arguments. argv[0] will be used as the * instance name for the WM_CLASS hint. @@ -121,7 +121,7 @@ DAInitialize(char *display, char *name, unsigned width, unsigned height, int argc, char **argv, Window *out); /* - * DASetShape- + * DASetShape- * Sets the shape mask of the dockapp to the specified one. This is * optional. If you pass None as shapeMask, the dockapp will become * non-shaped. @@ -165,7 +165,7 @@ void DAShow(Window *window); /* * DASetCallbacks- * Register a set of callbacks for events like mouse clicks. - * + * * Only needed if you want to receive some event. */ void DASetCallbacks(Window *window, DACallbacks *callbacks); @@ -189,7 +189,7 @@ Bool DANextEventOrTimeout(XEvent *event, unsigned long millisec); * DAProcessEvent- * Processes an event. Returns True if the event was handled and * False otherwise. - * + * * Must be called from your event loop, unless you use DAEventLoop() */ Bool DAProcessEvent(Window *window, XEvent *event); diff --git a/wmsupermon/panes.c b/wmsupermon/panes.c index ad6faca..c5db311 100644 --- a/wmsupermon/panes.c +++ b/wmsupermon/panes.c @@ -205,7 +205,7 @@ int read_config_file(pane_desc panes[], int *pane_num, const int max_pane, (*x)->max=1; } } - + cur_part++; } } else if (!s) continue; diff --git a/wmsupermon/panes.h b/wmsupermon/panes.h index 7716dea..07cb3db 100644 --- a/wmsupermon/panes.h +++ b/wmsupermon/panes.h @@ -57,7 +57,7 @@ typedef struct { char name[WNAME_LEN+1]; pane_desc *panes; - int num_panes, cur_pane; + int num_panes, cur_pane; Window w[2]; /* normal and iconic */ Pixmap pixmap, mask; } diff --git a/wmsupermon/stat_dev.c b/wmsupermon/stat_dev.c index 44e8ec5..83c9e96 100644 --- a/wmsupermon/stat_dev.c +++ b/wmsupermon/stat_dev.c @@ -110,7 +110,7 @@ void update_stat(stat_dev *st) f= (st->source[0] == '!') ? popen(st->source+1, "r") : fopen(st->source, "r"); - + if (!f) { stat_perror(st, "open"); return; diff --git a/wmsupermon/wmsupermon.c b/wmsupermon/wmsupermon.c index 3b6d300..82b194b 100644 --- a/wmsupermon/wmsupermon.c +++ b/wmsupermon/wmsupermon.c @@ -165,7 +165,7 @@ int main (int argc, char *argv[]) for (i=0; i digital, simply left click in either the DAY or DATE gadget ;-) -Be sure to drag WMTime on it's outer edges, WMTime is a bit picky +Be sure to drag WMTime on it's outer edges, WMTime is a bit picky due to the large gfx pixmap it keeps ;-) @@ -41,7 +41,7 @@ Afterstep users put the following in their .steprc Note: AfterStep's Wharf has a problem with pixmaps that are larger than 60x60 pixels. Please tell the AfterStep authors to fix this, this is not our fault, but a Wharf problem! - + Other WindowManagers -------------------------------------------------------------- diff --git a/wmtime/INSTALL b/wmtime/INSTALL index 04f3fbb..a5616cb 100644 --- a/wmtime/INSTALL +++ b/wmtime/INSTALL @@ -9,11 +9,11 @@ Installation -------------------------------------------------------------- 1) % tar -zxvf wmtime-1.1.tar.gz 2) % cd wmtime/wmtime -3)* xmkmf -a (for *BSD systems needed only!). +3)* xmkmf -a (for *BSD systems needed only!). 4) % make 5) % make install (as root) -6)* WMTime uses month and weekday abbreviations from the +6)* WMTime uses month and weekday abbreviations from the currently set locale. If these abbreviations do not use Latin alphabet characters, then WMTime defaults to US/English. @@ -22,12 +22,12 @@ Installation environment variable, e.g., % LANG=es_MX.UTF-8 wmtime - + 7)* This Imakefile was kindly donated by Pascal Hofstede but untested by the authors because we don't have a *BSD box - to test and try it out... we're working on generic + to test and try it out... we're working on generic Imakefiles though ;-) - + Be sure to read the HINTS and TODO files too! diff --git a/wmtime/Imakefile b/wmtime/Imakefile index 2f7f180..93c8775 100644 --- a/wmtime/Imakefile +++ b/wmtime/Imakefile @@ -1,6 +1,6 @@ XPMLIB = -lXpm -lm DEPLIBS = $(DEPXLIB) - + LOCAL_LIBRARIES = $(XPMLIB) $(XLIB) SRCS = wmtime.c \ diff --git a/wmtime/wmgeneral/list.c b/wmtime/wmgeneral/list.c index a091c86..8c4d6d2 100644 --- a/wmtime/wmgeneral/list.c +++ b/wmtime/wmgeneral/list.c @@ -1,11 +1,11 @@ -/* Generic single linked list to keep various information +/* Generic single linked list to keep various information Copyright (C) 1993, 1994 Free Software Foundation, Inc. Author: Kresten Krab Thorup Many modifications by Alfredo K. Kojima - + This file is part of GNU CC. @@ -38,7 +38,7 @@ Boston, MA 02110-1301, USA. */ /* Return a cons cell produced from (head . tail) */ -INLINE LinkedList* +INLINE LinkedList* list_cons(void* head, LinkedList* tail) { LinkedList* cell; @@ -63,7 +63,7 @@ list_length(LinkedList* list) return i; } -/* Return the Nth element of LIST, where N count from zero. If N +/* Return the Nth element of LIST, where N count from zero. If N larger than the list length, NULL is returned */ INLINE void* @@ -84,7 +84,7 @@ list_nth(int index, LinkedList* list) INLINE void list_remove_head(LinkedList** list) { - if (!*list) return; + if (!*list) return; if ((*list)->tail) { LinkedList* tail = (*list)->tail; /* fetch next */ @@ -116,7 +116,7 @@ INLINE LinkedList * list_remove_elem(LinkedList* list, void* elem) { LinkedList *tmp; - + if (list) { if (list->head == elem) { tmp = list->tail; diff --git a/wmtime/wmgeneral/list.h b/wmtime/wmgeneral/list.h index 24826c5..95fc718 100644 --- a/wmtime/wmgeneral/list.h +++ b/wmtime/wmgeneral/list.h @@ -1,4 +1,4 @@ -/* Generic single linked list to keep various information +/* Generic single linked list to keep various information Copyright (C) 1993, 1994 Free Software Foundation, Inc. Author: Kresten Krab Thorup diff --git a/wmtime/wmgeneral/misc.c b/wmtime/wmgeneral/misc.c index 34281e2..c36cdb4 100644 --- a/wmtime/wmgeneral/misc.c +++ b/wmtime/wmgeneral/misc.c @@ -1,9 +1,9 @@ /* dock.c- built-in Dock module for WindowMaker - * + * * WindowMaker window manager - * + * * Copyright (c) 1997 Alfredo K. Kojima - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -28,7 +28,7 @@ *---------------------------------------------------------------------- * parse_command-- * Divides a command line into a argv/argc pair. - *---------------------------------------------------------------------- + *---------------------------------------------------------------------- */ #define PRC_ALPHA 0 #define PRC_BLANK 1 @@ -64,11 +64,11 @@ next_token(char *word, char **next) t = ret = malloc(strlen(word)+1); ptr = word; - + state = 0; *t = 0; while (1) { - if (*ptr==0) + if (*ptr==0) ctype = PRC_EOS; else if (*ptr=='\\') ctype = PRC_ESCAPE; @@ -98,12 +98,12 @@ next_token(char *word, char **next) t = strdup(ret); free(ret); - + if (ctype==PRC_EOS) *next = NULL; else *next = ptr; - + return t; } @@ -118,7 +118,7 @@ parse_command(char *command, char ***argv, int *argc) line = command; do { token = next_token(line, &line); - if (token) { + if (token) { list = list_cons(token, list); } } while (token!=NULL && line!=NULL); @@ -141,15 +141,15 @@ execCommand(char *command) int argc; parse_command(command, &argv, &argc); - + if (argv==NULL) { return 0; } - + if ((pid=fork())==0) { char **args; int i; - + args = malloc(sizeof(char*)*(argc+1)); if (!args) exit(10); diff --git a/wmtime/wmgeneral/wmgeneral.c b/wmtime/wmgeneral/wmgeneral.c index d5fdcb6..7e3b508 100644 --- a/wmtime/wmgeneral/wmgeneral.c +++ b/wmtime/wmgeneral/wmgeneral.c @@ -133,7 +133,7 @@ static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) { err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap), &(wmgen->mask), &(wmgen->attributes)); - + if (err != XpmSuccess) { fprintf(stderr, "Not enough free colorcells.\n"); exit(1); @@ -180,9 +180,9 @@ static int flush_expose(Window w) { \*******************************************************************************/ void RedrawWindow(void) { - + flush_expose(iconwin); - XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, + 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, @@ -194,9 +194,9 @@ void RedrawWindow(void) { \*******************************************************************************/ void RedrawWindowXY(int x, int y) { - + flush_expose(iconwin); - XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, + 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, @@ -291,14 +291,14 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit int i; for (i=1; argv[i]; i++) { - if (!strcmp(argv[i], "-display")) + if (!strcmp(argv[i], "-display")) display_name = argv[++i]; else if (!strcmp(argv[i], "-geometry")) geometry = argv[++i]; } if (!(display = XOpenDisplay(display_name))) { - fprintf(stderr, "%s: can't open display %s\n", + fprintf(stderr, "%s: can't open display %s\n", wname, XDisplayName(display_name)); exit(1); } @@ -328,10 +328,10 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit /* Override width/height anyway */ uint_width = 64; uint_height = 64; - + win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y, uint_width, uint_height, borderwidth, fore_pix, back_pix); - + iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y, uint_width, uint_height, borderwidth, fore_pix, back_pix); @@ -352,7 +352,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit XSetWMName(display, win, &name); /* Create GC for drawing */ - + gcm = GCForeground | GCBackground | GCGraphicsExposures; gcv.foreground = fore_pix; gcv.background = back_pix; diff --git a/wmtime/wmtime/wmtime.1 b/wmtime/wmtime/wmtime.1 index 07f2c61..8b51e57 100644 --- a/wmtime/wmtime/wmtime.1 +++ b/wmtime/wmtime/wmtime.1 @@ -139,7 +139,7 @@ middle: xload .PP right: xcalc .PP -.PD +.PD .RE If diff --git a/wmtime/wmtime/wmtime.c b/wmtime/wmtime/wmtime.c index 7425d83..2c4f6e8 100644 --- a/wmtime/wmtime/wmtime.c +++ b/wmtime/wmtime/wmtime.c @@ -15,7 +15,7 @@ How do I create a not so solid window? How do I open a window? How do I use pixmaps? - + ------------------------------------------------------------ Author: Martijn Pieterse (pieterse@xs4all.nl) @@ -37,7 +37,7 @@ * Updated version number and some other minor stuff 16/05/1998 (Antoine Nulle, warp@xs4all.nl) * Added Locale support, based on original diff supplied - by Alen Salamun (snowman@hal9000.medinet.si) + by Alen Salamun (snowman@hal9000.medinet.si) 04/05/1998 (Martijn Pieterse, pieterse@xs4all.nl) * Moved the hands one pixel down. * Removed the RedrawWindow out of the main loop @@ -53,7 +53,7 @@ 21/04/1998 (Martijn Pieterse, pieterse@xs4all.nl) * Added digital/analog switching support 18/04/1998 (Martijn Pieterse, pieterse@xs4all.nl) - * Started this project. + * Started this project. * Copied the source from wmmon. */ @@ -279,7 +279,7 @@ void wmtime_routine(int argc, char **argv) { curtime = time(0); waitpid(0, NULL, WNOHANG); - + time_struct = localtime(&curtime); @@ -299,7 +299,7 @@ void wmtime_routine(int argc, char **argv) { } RedrawWindow(); } - + while (XPending(display)) { XNextEvent(display, &Event); @@ -326,7 +326,7 @@ void wmtime_routine(int argc, char **argv) { DrawTime(time_struct->tm_hour, time_struct->tm_min, time_struct->tm_sec); DrawDate(time_struct->tm_wday, time_struct->tm_mday, time_struct->tm_mon); } else { - copyXPMArea(0, 98, 64, 64, 0, 0); + copyXPMArea(0, 98, 64, 64, 0, 0); DrawWijzer(time_struct->tm_hour, time_struct->tm_min, time_struct->tm_sec); DrawDate(time_struct->tm_wday, time_struct->tm_mday, time_struct->tm_mon); } @@ -411,7 +411,7 @@ void DrawDate(int wkday, int dom, int month) { k = 5; for (i=0; i<2; i++) { - if (*p < 'A') + if (*p < 'A') copyXPMArea((*p-'0')*6, 64, 6, 9, k, 49); else copyXPMArea((*p-'A')*6, 74, 6, 9, k, 49); @@ -427,7 +427,7 @@ void DrawDate(int wkday, int dom, int month) { copyXPMArea(61, 64, 4, 9, k, 49); k += 4; for (i=0; i<3; i++) { - if (*p < 'A') + if (*p < 'A') copyXPMArea((*p-'0')*6, 64, 6, 9, k, 49); else copyXPMArea((*p-'A')*6, 74, 6, 9, k, 49); @@ -450,7 +450,7 @@ void DrawWijzer(int hr, int min, int sec) { int k; int i; - + hr %= 12; copyXPMArea(5+64, 5, 54, 40, 5, 5); @@ -464,7 +464,7 @@ void DrawWijzer(int hr, int min, int sec) { // dx, dy is het punt waar we naar toe moeten. // Zoek alle punten die ECHT op de lijn liggen: - + ddx = 1; ddy = 1; if (dx < 0) ddx = -1; @@ -474,9 +474,9 @@ void DrawWijzer(int hr, int min, int sec) { y = 0; if (abs(dx) > abs(dy)) { - if (dy != 0) + if (dy != 0) adder = abs(dx) / 2; - else + else adder = 0; for (i=0; i abs(dy)) { - if (dy != 0) + if (dy != 0) adder = abs(dx) / 2; - else + else adder = 0; for (i=0; i abs(dy)) { - if (dy != 0) + if (dy != 0) adder = abs(dx) / 2; - else + else adder = 0; for (i=0; i ] [ 0 ] - + <1> <2> <3> - + Tips: There are 3 modes of operation on this applications. You can cycle through the 3 modes by clicking on the right most button <3> repeatedly. @@ -54,37 +54,37 @@ The 3 modes are described below: On mode --------- - Clicking on the rightmost button <3> for the first time (after the start of WMTV) would turn TV on. During this mode, the left <1> and right <2> buttons are used to change preset channels which has been defined in your config file. Left button to move down 1 channel and Right button to move up one + Clicking on the rightmost button <3> for the first time (after the start of WMTV) would turn TV on. During this mode, the left <1> and right <2> buttons are used to change preset channels which has been defined in your config file. Left button to move down 1 channel and Right button to move up one channel. Tune mode --------- - Clicking again on button <3> after On mode would bring WMTV into tune mode. During this mode, the left <1> and right <2> buttons have two purposes - individually. Left clicking on the left <1> or right <2> buttons would - perform scans of channels. Scanning will stop when there is a strong signal strength. Right clicking on the left <1> or right <2> button would fine + Clicking again on button <3> after On mode would bring WMTV into tune mode. During this mode, the left <1> and right <2> buttons have two purposes + individually. Left clicking on the left <1> or right <2> buttons would + perform scans of channels. Scanning will stop when there is a strong signal strength. Right clicking on the left <1> or right <2> button would fine tune the current frequency. After tuning, clicking on button <3> would set the fine tuned offset into your config file and bring you back into "On mode". Off mode -------- - Holding down button <3> for about 3 seconds from any of the two modes - described above, would turn the TV off. + Holding down button <3> for about 3 seconds from any of the two modes + described above, would turn the TV off. Right clicking once on the TV Screen would mute/unmute the audio. Double clicking LEFT mouse button on the TV Screen would launch your favorite TV application when specified with --exe option in the command line. -If the external application is not set, It'll automatically switch to the build in full screen mode. -Double clicking the MIDDLE mouse button on the TV Screen would bring you into the built in full screen mode. +If the external application is not set, It'll automatically switch to the build in full screen mode. +Double clicking the MIDDLE mouse button on the TV Screen would bring you into the built in full screen mode. To launch an external application: foo@bar > wmtv --exe /usr/X11R6/bin/xawtv # example. or -foo@bar > wmtv -e /usr/X11R6/bin/xawtv +foo@bar > wmtv -e /usr/X11R6/bin/xawtv -If you do not specify any program to be launched during startup of WMTV, +If you do not specify any program to be launched during startup of WMTV, double clicking on the TV Screen would launch the inbuilt full screen feature. -Make sure you have a 640x480 Modeline defined in your XF86Config file. - +Make sure you have a 640x480 Modeline defined in your XF86Config file. + Full Screen Mode: Single click on any mouse button will return to initial screen. @@ -96,15 +96,15 @@ Full Screen Mode: Left - Volume down. Escape - Return to initial screen. m - mute/unmute audio. - + Configuration file ================== This section describes on how to configure WMTV's configuration file. -Your configuration file is located in your home directory as ".wmtvrc". +Your configuration file is located in your home directory as ".wmtvrc". Excerpt from a sample config file: /*----------------------- - + source = Television freqnorm = pal-australia maxpreset = 7 @@ -137,7 +137,7 @@ fullscreen = {widthxheight} [channel] choose a total of from the below channels. separate it with a new line as in the sample config file above. -{ +{ E2|E3|E4| S01|S02|S03| R1|R2|R3|R4|R5| @@ -157,21 +157,21 @@ for example: SE11 (-10) # channel SE11 minus 10 - + TODO ==== - Image Capture - On Screen Display (OSD) -- Other controls -- Advance image clippings +- Other controls +- Advance image clippings - Video Capture - Other misc features BUGS ==== -Ask flik. Bug me if you've found any. +Ask flik. Bug me if you've found any. NOTE diff --git a/wmtv/src/channels.h b/wmtv/src/channels.h index 72af0fd..3f9d0bc 100644 --- a/wmtv/src/channels.h +++ b/wmtv/src/channels.h @@ -4,7 +4,7 @@ * Nathan Laredo (laredo@broked.net) * Minor additions by Wee Liang (wliang@tartarus.uwa.edu.au) * - * Frequencies are given in kHz + * Frequencies are given in kHz */ #define NTSC_AUDIO_CARRIER 4500 #define PAL_AUDIO_CARRIER_I 6000 @@ -17,7 +17,7 @@ containing 8 bits frame sync, 5 bits control, 11 bits additional data, and 704 bits audio data. The bit rate is reduced by transmitting only 10 bits plus parity of each 14 bit sample, the largest sample in a frame determines - which 10 bits are transmitted. The parity bits for audio samples also + which 10 bits are transmitted. The parity bits for audio samples also specify the scaling factor used for that channel during that frame. The companeded audio data is interleaved to reduce the influence of dropouts and the whole frame except for sync bits is scrambled for spectrum shaping. @@ -196,7 +196,7 @@ struct freqlist tvtuner[] = { {"18", {495250, 145250, 144000, 0, 139250, 0, 0, 0, 0, 0, 0}}, {"19", {501250, 151250, 150000, 0, 145250, 0, 0, 0, 0, 0, 0}}, {"20", {507250, 157250, 156000, 0, 151250, 0, 0, 0, 0, 0, 0}}, - + {"21", {513250, 163250, 162000, 0, 157250, 471250, 471250, 0, 0, 0, 471250}}, {"22", {519250, 169250, 168000, 0, 165250, 479250, 479250, 0, 0, 0, 479250}}, {"23", {525250, 217250, 216000, 0, 223250, 487250, 487250, 0, 0, 0, 487250}}, @@ -246,7 +246,7 @@ struct freqlist tvtuner[] = { {"67", {789250, 481250, 480000, 0, 0, 839250, 839250, 0, 0, 800250, 839250}}, {"68", {795250, 487250, 486000, 0, 0, 847250, 847250, 0, 0, 807250, 847250}}, {"69", {801250, 493250, 492000, 0, 0, 855250, 855250, 0, 0, 814250, 855250}}, - + {"70", {807250, 499250, 498000, 0, 0, 0, 0, 0, 0, 0, 0}}, {"71", {813250, 505250, 504000, 0, 0, 0, 0, 0, 0, 0, 0}}, {"72", {819250, 511250, 510000, 0, 0, 0, 0, 0, 0, 0, 0}}, @@ -303,7 +303,7 @@ struct freqlist tvtuner[] = { {"123", { 0, 787250, 786000, 0, 0, 0, 0, 0, 0, 0, 0}}, {"124", { 0, 793250, 792000, 0, 0, 0, 0, 0, 0, 0, 0}}, {"125", { 0, 799250, 798000, 0, 0, 0, 0, 0, 0, 0, 0}}, - + {"T7", { 0, 8250, 7000, 0, 0, 0, 0, 0, 0, 0, 0}}, {"T8", { 0, 14250, 13000, 0, 0, 0, 0, 0, 0, 0, 0}}, {"T9", { 0, 20250, 19000, 0, 0, 0, 0, 0, 0, 0, 0}}, diff --git a/wmtv/src/wmgeneral/list.c b/wmtv/src/wmgeneral/list.c index be7464f..a63562f 100644 --- a/wmtv/src/wmgeneral/list.c +++ b/wmtv/src/wmgeneral/list.c @@ -1,11 +1,11 @@ -/* Generic single linked list to keep various information +/* Generic single linked list to keep various information Copyright (C) 1993, 1994 Free Software Foundation, Inc. Author: Kresten Krab Thorup Many modifications by Alfredo K. Kojima - + This file is part of GNU CC. @@ -38,7 +38,7 @@ Boston, MA 02110-1301 USA. */ /* Return a cons cell produced from (head . tail) */ -INLINE LinkedList* +INLINE LinkedList* list_cons(void* head, LinkedList* tail) { LinkedList* cell; @@ -63,7 +63,7 @@ list_length(LinkedList* list) return i; } -/* Return the Nth element of LIST, where N count from zero. If N +/* Return the Nth element of LIST, where N count from zero. If N larger than the list length, NULL is returned */ INLINE void* @@ -84,7 +84,7 @@ list_nth(int index, LinkedList* list) INLINE void list_remove_head(LinkedList** list) { - if (!*list) return; + if (!*list) return; if ((*list)->tail) { LinkedList* tail = (*list)->tail; /* fetch next */ @@ -116,7 +116,7 @@ INLINE LinkedList * list_remove_elem(LinkedList* list, void* elem) { LinkedList *tmp; - + if (list) { if (list->head == elem) { tmp = list->tail; diff --git a/wmtv/src/wmgeneral/list.h b/wmtv/src/wmgeneral/list.h index 4b6b86f..92c3454 100644 --- a/wmtv/src/wmgeneral/list.h +++ b/wmtv/src/wmgeneral/list.h @@ -1,4 +1,4 @@ -/* Generic single linked list to keep various information +/* Generic single linked list to keep various information Copyright (C) 1993, 1994 Free Software Foundation, Inc. Author: Kresten Krab Thorup diff --git a/wmtv/src/wmgeneral/misc.c b/wmtv/src/wmgeneral/misc.c index f86481e..1f3bb2e 100644 --- a/wmtv/src/wmgeneral/misc.c +++ b/wmtv/src/wmgeneral/misc.c @@ -1,9 +1,9 @@ /* dock.c- built-in Dock module for WindowMaker - * + * * WindowMaker window manager - * + * * Copyright (c) 1997 Alfredo K. Kojima - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -28,7 +28,7 @@ *---------------------------------------------------------------------- * parse_command-- * Divides a command line into a argv/argc pair. - *---------------------------------------------------------------------- + *---------------------------------------------------------------------- */ #define PRC_ALPHA 0 #define PRC_BLANK 1 @@ -64,11 +64,11 @@ next_token(char *word, char **next) t = ret = malloc(strlen(word)+1); ptr = word; - + state = 0; *t = 0; while (1) { - if (*ptr==0) + if (*ptr==0) ctype = PRC_EOS; else if (*ptr=='\\') ctype = PRC_ESCAPE; @@ -98,12 +98,12 @@ next_token(char *word, char **next) t = strdup(ret); free(ret); - + if (ctype==PRC_EOS) *next = NULL; else *next = ptr; - + return t; } @@ -118,7 +118,7 @@ parse_command(char *command, char ***argv, int *argc) line = command; do { token = next_token(line, &line); - if (token) { + if (token) { list = list_cons(token, list); } } while (token!=NULL && line!=NULL); @@ -141,15 +141,15 @@ execCommand(char *command) int argc; parse_command(command, &argv, &argc); - + if (argv==NULL) { return 0; } - + if ((pid=fork())==0) { char **args; int i; - + args = malloc(sizeof(char*)*(argc+1)); if (!args) exit(10); diff --git a/wmtv/src/wmgeneral/wmgeneral.c b/wmtv/src/wmgeneral/wmgeneral.c index 4877acd..fbb5d16 100644 --- a/wmtv/src/wmgeneral/wmgeneral.c +++ b/wmtv/src/wmgeneral/wmgeneral.c @@ -21,7 +21,7 @@ file support. 11/09/1998 (Martijn Pieterse, pieterse@xs4all.nl) * Removed a bug from parse_rcfile. You could - not use "start" in a command if a label was + not use "start" in a command if a label was also start. * Changed the needed geometry string. We don't use window size, and don't support @@ -117,7 +117,7 @@ static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) { err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap), &(wmgen->mask), &(wmgen->attributes)); - + if (err != XpmSuccess) { fprintf(stderr, "Not enough free colorcells.\n"); exit(1); @@ -164,9 +164,9 @@ static int flush_expose(Window w) { \*******************************************************************************/ void RedrawWindow(void) { - + flush_expose(iconwin); - XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, + 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, @@ -178,9 +178,9 @@ void RedrawWindow(void) { \*******************************************************************************/ void RedrawWindowXYWH(int x, int y, int w, int h) { - + flush_expose(iconwin); - XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, + XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, x,y, w, h, 0,0); flush_expose(win); XCopyArea(display, wmgen.pixmap, win, NormalGC, @@ -235,7 +235,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) { char zero; unsigned char bwrite; int bcount; - + sscanf(*xpm, "%d %d %d", &width, &height, &numcol); @@ -328,7 +328,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit */ if (!(display = XOpenDisplay(display_name))) { - fprintf(stderr, "%s: can't open display %s\n", + fprintf(stderr, "%s: can't open display %s\n", wname, XDisplayName(display_name)); exit(1); } @@ -354,10 +354,10 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit 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); @@ -378,7 +378,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit XSetWMName(display, win, &name); /* Create GC for drawing */ - + gcm = GCForeground | GCBackground | GCGraphicsExposures; gcv.foreground = fore_pix; gcv.background = back_pix; diff --git a/wmtv/src/wmtv.c b/wmtv/src/wmtv.c index 9860461..086e40b 100644 --- a/wmtv/src/wmtv.c +++ b/wmtv/src/wmtv.c @@ -7,7 +7,7 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -232,7 +232,7 @@ main(int argc, char *argv[]) if (c == -1) break; - switch(c) + switch(c) { case 0: /* @@ -268,10 +268,10 @@ main(int argc, char *argv[]) } /* creat windows */ - createXBMfromXPM (wmtv_mask_bits, wmtv_master_xpm, + createXBMfromXPM (wmtv_mask_bits, wmtv_master_xpm, wmtv_mask_width, wmtv_mask_height); openXwindow (argc, argv, wmtv_master_xpm, wmtv_mask_bits, - wmtv_mask_width, wmtv_mask_height); + wmtv_mask_width, wmtv_mask_height); AddMouseRegion (NTFB, 47, 48, 59, 59); /* On/SetTune/Off Button */ AddMouseRegion (SCANLB, 23, 48, 35, 59); /* Left Preset/Scan Button */ @@ -279,7 +279,7 @@ main(int argc, char *argv[]) AddMouseRegion (FULLSB, 5, 5, 59, 44); /* Toggle FullScreen */ /* wmtv main loop */ - while (1) + while (1) { while (XPending(display)) { @@ -306,7 +306,7 @@ main(int argc, char *argv[]) i = CheckMouseRegion (Event.xbutton.x, Event.xbutton.y); switch (i) { case NTFB: - ButtonDown(NTFB); + ButtonDown(NTFB); t_lc = Event.xbutton.time; but_pressed = TRUE; break; @@ -314,7 +314,7 @@ main(int argc, char *argv[]) ButtonDown(SCANLB); if (ntfb_status == SETUNE) { switch (Event.xbutton.button) { - case 1: + case 1: timebutton = 1; while (timebutton == 1) if (isource == TELEVISION) @@ -326,10 +326,10 @@ main(int argc, char *argv[]) break; } } - else + else ChanDown(); break; - case SCANRB: + case SCANRB: ButtonDown(SCANRB); if (ntfb_status == SETUNE) { switch (Event.xbutton.button) { @@ -345,7 +345,7 @@ main(int argc, char *argv[]) break; } } - else + else ChanUp(); break; case FULLSB: @@ -374,7 +374,7 @@ main(int argc, char *argv[]) case ButtonRelease: i = CheckMouseRegion (Event.xbutton.x, Event.xbutton.y); switch (i) { - case NTFB: + case NTFB: ButtonUp(NTFB); if (but_pressed) { if (Event.xbutton.time - t_lc >= 900) { @@ -390,7 +390,7 @@ main(int argc, char *argv[]) else if (ntfb_status == SETON) { if (!btime) { ntfb_status = SETUNE; - copyXPMArea(96, 79, 11, 7, 6, 50); + copyXPMArea(96, 79, 11, 7, 6, 50); RedrawWindowXYWH(6, 50, 11, 7); } else if (btime) { @@ -404,7 +404,7 @@ main(int argc, char *argv[]) if (!btime) { offset = (rfreq - ccrfreq); // fprintf(stderr, "wmtv: finetune offset = %ld\n", offset); - WriteRCFile(cfile); + WriteRCFile(cfile); ntfb_status = SETON; DrawPresetChan(cchannel); } @@ -569,13 +569,13 @@ main(int argc, char *argv[]) } default: break; - } + } XFlush(display); - } + } usleep(50000L); - } + } return(0); -} +} /* ButtonDown function */ @@ -669,7 +669,7 @@ TVOn(void) vclip[1].height = 39; vwin.clips = vclip; - vwin.clipcount = 2; + vwin.clipcount = 2; vchn.channel = tvsource; vaud.audio = tvsource; @@ -691,9 +691,9 @@ TVOn(void) if (!cnotune) { if (ioctl(tfd, VIDIOCGTUNER, &vtun) < 0) perror("ioctl VIDIOCGTUNER"); - if (vtun.flags & VIDEO_TUNER_LOW) + if (vtun.flags & VIDEO_TUNER_LOW) st = 16000; - else + else st = 16; } @@ -743,7 +743,7 @@ TVOn(void) if (ioctl(tfd, VIDIOCSWIN, &vwin) < 0) perror("ioctl VIDIOCSWIN"); - + if (ioctl(tfd, VIDIOCCAPTURE, &ccapt) < 0) perror("ioctl VIDIOCCAPTURE"); } @@ -755,7 +755,7 @@ TVOff(void) { ccapt = 0; - if (ioctl(tfd, VIDIOCCAPTURE, &ccapt) < 0) + if (ioctl(tfd, VIDIOCCAPTURE, &ccapt) < 0) perror("ioctl VIDIOCCAPTURE"); vaud.audio = tvsource; @@ -763,7 +763,7 @@ TVOff(void) vaud.flags |= VIDEO_AUDIO_MUTE; if (vchn.flags & VIDEO_VC_AUDIO) { - if (ioctl(tfd, VIDIOCSAUDIO, &vaud) < 0) + if (ioctl(tfd, VIDIOCSAUDIO, &vaud) < 0) perror("ioctl VIDIOCSAUDIO"); } @@ -785,7 +785,7 @@ VolumeUp(void) perror("ioctl VIDIOCSAUDIO"); } } - + } /* VoumeDown function */ @@ -833,7 +833,7 @@ UnMuteAudio(void) /* ScanUp function */ -void +void ScanUp(void) { rfreq += 2; @@ -849,7 +849,7 @@ ScanUp(void) if (vtun.signal == 0xFFFF) { timebutton = 0; } - + } @@ -907,7 +907,7 @@ ChanUp(void) rfreq = ((tvtuner[i].freq[freqnorm] / 1000) * st) + ftune[cchannel]; ccrfreq = rfreq - ftune[cchannel]; break; - } + } } DrawPresetChan(cchannel); @@ -917,12 +917,12 @@ ChanUp(void) /* ChanDown function */ -void +void ChanDown(void) { int i; - if (cchannel != 0) - --cchannel; + if (cchannel != 0) + --cchannel; for (i=0; i < CHAN_ENTRIES; i++) { if (!strcmp(cname[cchannel], tvtuner[i].name)) { rfreq = ((tvtuner[i].freq[freqnorm] / 1000) * st) + ftune[cchannel]; @@ -977,8 +977,8 @@ DrawPresetChan(int cchannel) /* ParseRCFile function */ -void -ParseRCFile(const char *filename, rckeys *keys) +void +ParseRCFile(const char *filename, rckeys *keys) { char *p,*q; char temp[128]; @@ -1004,17 +1004,17 @@ ParseRCFile(const char *filename, rckeys *keys) *keys[key].var = strdup(p); key = -1; } else key++; - } + } } free(q); - } + } fclose(fp); } /* ParseRCFile2 function */ void -ParseRCFile2(const char *filename) +ParseRCFile2(const char *filename) { int menu = FALSE; char temp[128]; @@ -1057,7 +1057,7 @@ ParseRCFile2(const char *filename) } wcname[i] = (char *)malloc(sizeof(cname[i])+sizeof(p)); wcname[i] = strdup(cname[i]); - sprintf(tp, " (%d) ", ftune[i]); + sprintf(tp, " (%d) ", ftune[i]); strcat(wcname[i], tp); i++; tpst = i; @@ -1160,7 +1160,7 @@ InitConfig(void) strcpy(temp, "/etc/wmtvrc"); ParseRCFile(temp, wmtv_keys); ParseRCFile2(temp); - + strncpy(temp, (char *)getenv("HOME"), (sizeof(char)*128)); strcat(temp, "/.wmtvrc"); ParseRCFile(temp, wmtv_keys); @@ -1202,7 +1202,7 @@ InitConfig(void) } if (!(vcap.type & VID_TYPE_SCALES)) { - fprintf(stderr, "%s: video device does not support scalling\n", progname); + fprintf(stderr, "%s: video device does not support scalling\n", progname); exit(1); } if (!(vcap.type & VID_TYPE_CLIPPING)) { @@ -1229,7 +1229,7 @@ InitConfig(void) cnotune = 0; else cnotune = 1; - + vsource = 1; tvsource = vchn.channel; @@ -1274,7 +1274,7 @@ InitConfig(void) } } } - + for (i=0; i < vcap.audios; i++) { vaud.audio = i; if (ioctl(tfd, VIDIOCGAUDIO, &vaud) < 0) { @@ -1313,7 +1313,7 @@ GetFrameBuffer(void) if (XF86DGAQueryExtension(display, &evbr, &erbr)) { XF86DGAQueryDirectVideo(display, XDefaultScreen(display), &flr); if (flr & XF86DGADirectPresent) { - XF86DGAGetVideoLL(display, XDefaultScreen(display), + XF86DGAGetVideoLL(display, XDefaultScreen(display), (int *) &baseaddr, &bytesperline, &bankr, &memr); } } @@ -1390,11 +1390,11 @@ DoFullScreen(void) back_pix = WhitePixel(display, DefaultScreen(display)); fore_pix = BlackPixel(display, DefaultScreen(display)); - fmwin = XCreateWindow(display, DefaultRootWindow(display), fmsizehints.x, - fmsizehints.y, fmsizehints.width, fmsizehints.height, - borderwidth, CopyFromParent, InputOutput, + fmwin = XCreateWindow(display, DefaultRootWindow(display), fmsizehints.x, + fmsizehints.y, fmsizehints.width, fmsizehints.height, + borderwidth, CopyFromParent, InputOutput, CopyFromParent, valuemask, &fmWinattr); - + XSetWMNormalHints(display, fmwin, &fmsizehints); @@ -1405,9 +1405,9 @@ DoFullScreen(void) fmGC = XCreateGC(display, DefaultRootWindow(display), gcm, &gcv); - XSelectInput(display, fmwin, ButtonPressMask | ExposureMask | - ButtonReleaseMask | PointerMotionMask | - StructureNotifyMask | VisibilityChangeMask | KeyPressMask ); + XSelectInput(display, fmwin, ButtonPressMask | ExposureMask | + ButtonReleaseMask | PointerMotionMask | + StructureNotifyMask | VisibilityChangeMask | KeyPressMask ); fmxwmhints.flags = StateHint; fmxwmhints.initial_state = NormalState; @@ -1432,9 +1432,9 @@ DoFullScreen(void) } usleep(50000L); - if (!XTranslateCoordinates(display, fmwin, DefaultRootWindow(display), - -fmwinattr.border_width, - -fmwinattr.border_width, + if (!XTranslateCoordinates(display, fmwin, DefaultRootWindow(display), + -fmwinattr.border_width, + -fmwinattr.border_width, &rx, &ry, &junkwin)) { fprintf(stderr, "wmtv: error translating coordinates for fmwin"); } @@ -1448,7 +1448,7 @@ DoFullScreen(void) if (ioctl(tfd, VIDIOCSWIN, &vswin) < 0) { perror("ioctl VIDIOCSWIN"); } - + ccapt = 1; if (ioctl(tfd, VIDIOCCAPTURE, &ccapt) < 0) { perror("ioctl VIDIOCCAPTURE"); @@ -1460,7 +1460,7 @@ DoFullScreen(void) XF86VidModeGetAllModeLines(display, XDefaultScreen(display), &tml, &modelines); for (i=0; i < tml; i++) { - if ((modelines[i]->hdisplay == fswidth) && + if ((modelines[i]->hdisplay == fswidth) && (modelines[i]->vdisplay == fsheight)) { fullscreenmode = modelines[i]; mode_present = TRUE; @@ -1475,9 +1475,9 @@ DoFullScreen(void) XRaiseWindow(display, fmwin); if (mode_present) { - XF86VidModeSwitchToMode(display, XDefaultScreen(display), fullscreenmode); + XF86VidModeSwitchToMode(display, XDefaultScreen(display), fullscreenmode); XF86VidModeSetViewPort(display, XDefaultScreen(display), vswin.x, vswin.y); - XGrabPointer(display, fmwin, True, 0, GrabModeAsync, GrabModeAsync, + XGrabPointer(display, fmwin, True, 0, GrabModeAsync, GrabModeAsync, fmwin, None, CurrentTime); } } @@ -1498,7 +1498,7 @@ RetScreen() if (mode_present) { for (i = 0; i < tml; i++) { - if ((modelines[i]->hdisplay == Winattr.width) && + if ((modelines[i]->hdisplay == Winattr.width) && (modelines[i]->vdisplay==Winattr.height)) scm = modelines[i]; } @@ -1517,7 +1517,7 @@ RetScreen() scm->privsize = scmode.privsize; scm->private = scmode.private; */ - + XClearWindow(display, fmwin); XFreeGC(display, fmGC); XMapRaised(display, fmwin); diff --git a/wmtz/BUGS b/wmtz/BUGS index 363f2ac..f85db1d 100644 --- a/wmtz/BUGS +++ b/wmtz/BUGS @@ -1,4 +1,4 @@ -Bugs? Lots of them, probably. - +Bugs? Lots of them, probably. + Mail me, or fix them yourself and mail me your solution. diff --git a/wmtz/CHANGES b/wmtz/CHANGES index e9d3581..849548e 100644 --- a/wmtz/CHANGES +++ b/wmtz/CHANGES @@ -1,44 +1,44 @@ Program derived from WMiNET. See README file for credits. -v0.2: Added configuration option xxx for empty "time slot" +v0.2: Added configuration option xxx for empty "time slot" on suggestion from "jason". -v0.3: Added configuration option BEATS giving Swatch beats. Patch for this +v0.3: Added configuration option BEATS giving Swatch beats. Patch for this came from Joris van Gasteren . Added configuration option Y2K giving number of days to 2000.0. - + v0.4 Added configuration options DATE for local date and option WDAY for - local weekday. Patch for this came from Felipe Gustavo de Almeida - . + local weekday. Patch for this came from Felipe Gustavo de Almeida + . v0.5 Added configuration options LOCAL for local date and timezone label and @ for Swatch beats in float format. Fixed a "glitch" in WDAY option and a BUG in DATE (month). Changed sprintf's to snprintf's and some code clean-ups. Patch for this version came from Felipe Gustavo de Almeida - . + . v0.6 * Added configuration options LMST for local sidereal time and GMST - for sidereal time at Greenwich. You have to enter your longitude in the + for sidereal time at Greenwich. You have to enter your longitude in the config file with "longitude=" for LMST to work correctly. - * Added a configuration/restart/quit menu. Click once on wmtz to make it - appear. The default editor to edit the config file is xedit. This can be + * Added a configuration/restart/quit menu. Click once on wmtz to make it + appear. The default editor to edit the config file is xedit. This can be changed by setting the environment variable XEDITOR to your favourite X editor or by using the new "-e " command line option. "Restart" rereads the configuration file and "Quit" exits wmtz. "Wmtz" takes you back to the time table. * Added the "-jd" command line option, which allows conversion between Julian day numbers and Gregorian dates via CLI interface. - * Removed options BEATS and Y2K since the former is the same as @ without + * Removed options BEATS and Y2K since the former is the same as @ without decimals and the latter is history. * Added a man-page. NOTE: Format of config file have changed and some options have disappeared which makes it a good idea to replace old config files with new ones. -v0.7 * Added option TZONE for time zone time with automatic compensation for +v0.7 * Added option TZONE for time zone time with automatic compensation for daylight savings time. You have to give a correct TZ environment string in order for this to work (see: 'man tzset' for a description of the TZ environment variable). * Added a monochrome bitmap. Activate it with the -m command line option. - + diff --git a/wmtz/INSTALL b/wmtz/INSTALL index 198fdea..c95db1d 100644 --- a/wmtz/INSTALL +++ b/wmtz/INSTALL @@ -1,11 +1,11 @@ -Installation instructions for wmtz: +Installation instructions for wmtz: Requirements ------------------------------------------------------------- - root access - To be able to complete the installation as described + To be able to complete the installation as described here, you'll need root privileges... @@ -13,7 +13,7 @@ Installation -------------------------------------------------------------- 1) % tar -zxvf wmtz-0.7.tar.gz 2) % cd wmtz-0.7/wmtz -3) % make +3) % make 4) % su root 5) # make install 6) # ^D @@ -24,7 +24,7 @@ Installation *) Adjust ~/.wmtzrc to your preferences... Instructions are included in the file. You may want to edit /etc/wmtzrc as well (as root). - + Uninstallation (Requires root access) -------------------------------------------------------------- @@ -35,5 +35,5 @@ Uninstallation (Requires root access) General Notes -------------------------------------------------------------- -You may have to edit the Makefile in order to compile and +You may have to edit the Makefile in order to compile and install the program on your particular system. diff --git a/wmtz/README b/wmtz/README index c09ac5e..4fe726d 100644 --- a/wmtz/README +++ b/wmtz/README @@ -6,7 +6,7 @@ Note......: Since I'm a very lazy programmer, I ripped most of the code from the excellent WMiNET program. See credits below... -Credits...: +Credits...: Patch for local date, local time, weekday and @, and some code clean-ups: Felipe Gustavo de Almeida @@ -23,20 +23,20 @@ Credits...: Mike Kershaw (dragorn@melchior.nerv-un.ml.org), Andy Roger (roger@roger.samond.ru) & Ulrik Kjems (uk@imm.dtu.dk) - + Description -------------------------------------------------------------- wmtz is a Window Maker dock app derived from the WMiNET dock app. It displays the local time from different time zones defined in the configuration file. It can also display the -current Julian Day Number as well as Swatch beats and -sidereal time at Greenwich and local sidereal time and +current Julian Day Number as well as Swatch beats and +sidereal time at Greenwich and local sidereal time and local time, date and weekday. -This app can be useful (?) for people who have to communicate -in realtime with people from different time zones. It allows -you to avoid making a fool of yourself by calling someone +This app can be useful (?) for people who have to communicate +in realtime with people from different time zones. It allows +you to avoid making a fool of yourself by calling someone when they are asleep... Files @@ -46,11 +46,11 @@ INSTALL Installation instructions. BUGS Small evil things that live in your computer. CHANGES Description of changes. COPYING GNU General Public License Version 2. - + Bugs -------------------------------------------------------------- -If you discover any bugs in this software, please send a +If you discover any bugs in this software, please send a bugreport to jlin@algonet.se and describe the problem as detailed as you can. Or fix it yourself. diff --git a/wmtz/wmgeneral/list.c b/wmtz/wmgeneral/list.c index be7464f..a63562f 100644 --- a/wmtz/wmgeneral/list.c +++ b/wmtz/wmgeneral/list.c @@ -1,11 +1,11 @@ -/* Generic single linked list to keep various information +/* Generic single linked list to keep various information Copyright (C) 1993, 1994 Free Software Foundation, Inc. Author: Kresten Krab Thorup Many modifications by Alfredo K. Kojima - + This file is part of GNU CC. @@ -38,7 +38,7 @@ Boston, MA 02110-1301 USA. */ /* Return a cons cell produced from (head . tail) */ -INLINE LinkedList* +INLINE LinkedList* list_cons(void* head, LinkedList* tail) { LinkedList* cell; @@ -63,7 +63,7 @@ list_length(LinkedList* list) return i; } -/* Return the Nth element of LIST, where N count from zero. If N +/* Return the Nth element of LIST, where N count from zero. If N larger than the list length, NULL is returned */ INLINE void* @@ -84,7 +84,7 @@ list_nth(int index, LinkedList* list) INLINE void list_remove_head(LinkedList** list) { - if (!*list) return; + if (!*list) return; if ((*list)->tail) { LinkedList* tail = (*list)->tail; /* fetch next */ @@ -116,7 +116,7 @@ INLINE LinkedList * list_remove_elem(LinkedList* list, void* elem) { LinkedList *tmp; - + if (list) { if (list->head == elem) { tmp = list->tail; diff --git a/wmtz/wmgeneral/list.h b/wmtz/wmgeneral/list.h index 4b6b86f..92c3454 100644 --- a/wmtz/wmgeneral/list.h +++ b/wmtz/wmgeneral/list.h @@ -1,4 +1,4 @@ -/* Generic single linked list to keep various information +/* Generic single linked list to keep various information Copyright (C) 1993, 1994 Free Software Foundation, Inc. Author: Kresten Krab Thorup diff --git a/wmtz/wmgeneral/misc.c b/wmtz/wmgeneral/misc.c index f86481e..1f3bb2e 100644 --- a/wmtz/wmgeneral/misc.c +++ b/wmtz/wmgeneral/misc.c @@ -1,9 +1,9 @@ /* dock.c- built-in Dock module for WindowMaker - * + * * WindowMaker window manager - * + * * Copyright (c) 1997 Alfredo K. Kojima - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -28,7 +28,7 @@ *---------------------------------------------------------------------- * parse_command-- * Divides a command line into a argv/argc pair. - *---------------------------------------------------------------------- + *---------------------------------------------------------------------- */ #define PRC_ALPHA 0 #define PRC_BLANK 1 @@ -64,11 +64,11 @@ next_token(char *word, char **next) t = ret = malloc(strlen(word)+1); ptr = word; - + state = 0; *t = 0; while (1) { - if (*ptr==0) + if (*ptr==0) ctype = PRC_EOS; else if (*ptr=='\\') ctype = PRC_ESCAPE; @@ -98,12 +98,12 @@ next_token(char *word, char **next) t = strdup(ret); free(ret); - + if (ctype==PRC_EOS) *next = NULL; else *next = ptr; - + return t; } @@ -118,7 +118,7 @@ parse_command(char *command, char ***argv, int *argc) line = command; do { token = next_token(line, &line); - if (token) { + if (token) { list = list_cons(token, list); } } while (token!=NULL && line!=NULL); @@ -141,15 +141,15 @@ execCommand(char *command) int argc; parse_command(command, &argv, &argc); - + if (argv==NULL) { return 0; } - + if ((pid=fork())==0) { char **args; int i; - + args = malloc(sizeof(char*)*(argc+1)); if (!args) exit(10); diff --git a/wmtz/wmgeneral/wmgeneral.c b/wmtz/wmgeneral/wmgeneral.c index 56b7bd6..c064b39 100644 --- a/wmtz/wmgeneral/wmgeneral.c +++ b/wmtz/wmgeneral/wmgeneral.c @@ -17,7 +17,7 @@ * Now supports >256 colors 11/09/1998 (Martijn Pieterse, pieterse@xs4all.nl) * Removed a bug from parse_rcfile. You could - not use "start" in a command if a label was + not use "start" in a command if a label was also start. * Changed the needed geometry string. We don't use window size, and don't support @@ -177,7 +177,7 @@ static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) { err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap), &(wmgen->mask), &(wmgen->attributes)); - + if (err != XpmSuccess) { fprintf(stderr, "Not enough free colorcells.\n"); exit(1); @@ -224,9 +224,9 @@ static int flush_expose(Window w) { \*******************************************************************************/ void RedrawWindow(void) { - + flush_expose(iconwin); - XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, + 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, @@ -238,9 +238,9 @@ void RedrawWindow(void) { \*******************************************************************************/ void RedrawWindowXY(int x, int y) { - + flush_expose(iconwin); - XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, + 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, @@ -296,7 +296,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) { unsigned char bwrite; int bcount; int curpixel; - + sscanf(*xpm, "%d %d %d %d", &width, &height, &numcol, &depth); @@ -305,7 +305,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) { zero <<=8; zero |= xpm[1][k]; } - + for (i=numcol+1; i < numcol+sy+1; i++) { bcount = 0; bwrite = 0; @@ -318,7 +318,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) { curpixel <<=8; curpixel |= xpm[i][j+k]; } - + if ( curpixel != zero ) { bwrite += 128; } @@ -394,7 +394,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit } if (!(display = XOpenDisplay(display_name))) { - fprintf(stderr, "%s: can't open display %s\n", + fprintf(stderr, "%s: can't open display %s\n", wname, XDisplayName(display_name)); exit(1); } @@ -419,10 +419,10 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit 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); @@ -443,7 +443,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit XSetWMName(display, win, &name); /* Create GC for drawing */ - + gcm = GCForeground | GCBackground | GCGraphicsExposures; gcv.foreground = fore_pix; gcv.background = back_pix; diff --git a/wmtz/wmtz/Makefile b/wmtz/wmtz/Makefile index b914e6b..b710553 100644 --- a/wmtz/wmtz/Makefile +++ b/wmtz/wmtz/Makefile @@ -38,7 +38,7 @@ install:: wmtz chown root:root /etc/wmtzrc @echo "wmtz: Installation finished..." -uninstall:: +uninstall:: rm -i /usr/local/bin/wmtz rm -i /etc/wmtzrc chmod 666 $(HOME)/.wmtzrc diff --git a/wmtz/wmtz/wmtz.1 b/wmtz/wmtz/wmtz.1 index 043134e..e4ee5a3 100644 --- a/wmtz/wmtz/wmtz.1 +++ b/wmtz/wmtz/wmtz.1 @@ -1,4 +1,4 @@ -.TH wmtz 1 "16 April 2001" +.TH wmtz 1 "16 April 2001" .SH NAME WMTZ \- Window Make Time Zone dockapp .SH SYNOPSIS @@ -40,23 +40,23 @@ Print version number. .SH CONFIGURATION wmtz is configured with a configuration file, usually ~/.wmtzrc. In this file several values must be given in order for wmtz to function properly. -It is recommended to use the configuration file that follows with the -distribution and modify it according to your needs. wmtz has five "timeslots" +It is recommended to use the configuration file that follows with the +distribution and modify it according to your needs. wmtz has five "timeslots" that can show different times. .br -What must be present in the file is the "time*=" token for every -timeslot (1 to 5), followed by the "utdiff*=" for every timeslot -(1 to 5) even if it is to be ignored. "longitude=" token for every +timeslot (1 to 5), followed by the "utdiff*=" for every timeslot +(1 to 5) even if it is to be ignored. "longitude=" must also be given in the config file. .br The options available for "time*=" are the following: .TP .B *** Three (or less) letter designation of timezone. utdiff for this timeslot is -subtracted from UT to give time in that timezone. +subtracted from UT to give time in that timezone. .TP .B TZONE -Gives time in timezone described by TZ environment variable string in utdiff. See man page for tzset for a description of the TZ string. +Gives time in timezone described by TZ environment variable string in utdiff. See man page for tzset for a description of the TZ string. .TP .B JDN Gives Julian Day Number. The value for utdiff for the timeslot is subtracted @@ -71,7 +71,7 @@ Gives swatch beats. utdiff for this timeslot is ignored. .B DATE Gives local date. utdiff for this timeslot is ignored. .TP -.B WDAY +.B WDAY Gives local weekday. utdiff for this timeslot is ignored. .TP .B LOCAL @@ -79,12 +79,12 @@ Gives local time, automatically corrected for summer/winter time. utdiff for this timeslot is ignored. .SH ENVIRONMENT .TP -.B XEDITOR +.B XEDITOR Can be used to specify which editor to use when clicking on "Config" in the wmtz menu. See also the "-e " option above. .TP .B HOME -Must be set for wmtz to find the users config file. +Must be set for wmtz to find the users config file. .PP The config file is searched for in the following order: diff --git a/wmtz/wmtz/wmtz.c b/wmtz/wmtz/wmtz.c index ecffb77..928f845 100644 --- a/wmtz/wmtz/wmtz.c +++ b/wmtz/wmtz/wmtz.c @@ -70,7 +70,7 @@ typedef struct /* * Global variables */ -timezone_t zone[6]; +timezone_t zone[6]; double longitude = 0.0; double latitude = 0.0; static struct tm *clk; @@ -99,7 +99,7 @@ int ReadConfigString(FILE *fp, char *setting, char *value); int Read_Config_File(char *filename); void range(double *val, double ran); void siderealTime(double jde, int *result, int mode); -double julianDay(int year, int month, double day, double hour, +double julianDay(int year, int month, double day, double hour, double minute, double second, int julian); int calendarDate(double jd, int *year, int *month, double *day); int handleJD(void); @@ -113,7 +113,7 @@ double jdn(time_t curtime); \*****************************************************************************/ int main(int argc, char *argv[]) { - int i; + int i; char *envbuf; /* Store away the executable name for error messages */ @@ -130,14 +130,14 @@ int main(int argc, char *argv[]) { } else { - // Set originalTZ to TZ erase TZ env. + // Set originalTZ to TZ erase TZ env. (void) sprintf(originalTZ, "TZ"); } - + /* Parse Command Line */ for (i=1; itm_year>99) clk->tm_year-=100; snprintf(blitstr, STRSIZE,"%s %02d.%02d", month[clk->tm_mon],clk->tm_mday,clk->tm_year); - BlitString(blitstr, 5, (11*(j-1)) + 5); + BlitString(blitstr, 5, (11*(j-1)) + 5); } /* Display local weekday */ @@ -333,7 +333,7 @@ void wmtz_routine(int argc, char **argv) { clk = localtime(&curtime); snprintf(blitstr, STRSIZE,"%s",week_day[clk->tm_wday]); - BlitString(blitstr, 4, (11*(j-1)) + 5); + BlitString(blitstr, 4, (11*(j-1)) + 5); } /* Display more precise internet time */ @@ -359,7 +359,7 @@ void wmtz_routine(int argc, char **argv) else if (strncmp( zone[j].label, "LMST", 3) == 0 ) { clk = gmtime(&curtime); - jd = jdn(curtime); + jd = jdn(curtime); siderealTime( jd, sid, LMST ); snprintf(blitstr, STRSIZE, "%s%02i.%02i","LST:", sid[0], sid[1]); BlitString(blitstr, 5, (11*(j-1)) + 5); @@ -369,7 +369,7 @@ void wmtz_routine(int argc, char **argv) else if (strncmp( zone[j].label, "GMST", 3) == 0 ) { clk = gmtime(&curtime); - jd = jdn(curtime); + jd = jdn(curtime); siderealTime( jd, sid, GMST ); snprintf(blitstr, STRSIZE, "%s%02i.%02i","GST:", sid[0], sid[1]); BlitString(blitstr, 5, (11*(j-1)) + 5); @@ -380,7 +380,7 @@ void wmtz_routine(int argc, char **argv) { clk = localtime(&curtime); strncpy(buf, tzname[0], 3); - + for (k=0; k<3; k++) if (buf[k] == 0) buf[k] = ' '; @@ -402,7 +402,7 @@ void wmtz_routine(int argc, char **argv) clk = localtime(&curtime); strncpy(buf, tzname[0], 3); - + for (k=0; k<3; k++) if (buf[k] == 0) buf[k] = ' '; @@ -410,7 +410,7 @@ void wmtz_routine(int argc, char **argv) buf[3] = ':'; buf[4] = 0; - snprintf(blitstr, STRSIZE, "%s%02i.%02i", buf, + snprintf(blitstr, STRSIZE, "%s%02i.%02i", buf, clk->tm_hour, clk->tm_min); BlitString(blitstr, 5, (11*(j-1)) + 5); @@ -419,11 +419,11 @@ void wmtz_routine(int argc, char **argv) } /* Display time in specified time zone without TZ env. var. */ - else + else { clk = gmtime(&curtime); strncpy(buf, zone[j].label, 3); - + for (k=0; k<3; k++) if (buf[k] == 0) buf[k] = ' '; @@ -432,16 +432,16 @@ void wmtz_routine(int argc, char **argv) buf[4] = 0; hour = clk->tm_hour - zone[j].diff; - if (hour > 23 ) + if (hour > 23 ) hour -= 24; - else if (hour < 0 ) + else if (hour < 0 ) hour += 24; /* Print Label */ snprintf(blitstr, STRSIZE, "%s%02i.%02i",buf,hour,clk->tm_min); BlitString(blitstr, 5, (11*(j-1)) + 5); } - } + } } RedrawWindow(); @@ -480,10 +480,10 @@ void wmtz_routine(int argc, char **argv) break; default: } - } + } usleep(10000); - } + } } @@ -498,7 +498,7 @@ void handleTheMenu(int but_stat) switch( but_stat ) { case 0: - execCommand(ABOUT); + execCommand(ABOUT); break; case 1: break; @@ -506,8 +506,8 @@ void handleTheMenu(int but_stat) /* Figure out what editor to use */ if ( defedit == NULL ) { - ed = getenv("XEDITOR"); - if ( ed == NULL ) + ed = getenv("XEDITOR"); + if ( ed == NULL ) ed = "xedit"; } else @@ -553,15 +553,15 @@ int ReadConfigString(FILE *fp, char *setting, char *value) snprintf(str,1024, "%s=", setting); slen = strlen(str); - + fseek(fp, 0, SEEK_SET); while ( !feof(fp) ) { - + if (!fgets(buf, 512, fp)) break; - + len = strlen(buf); /* strip linefeed */ @@ -573,7 +573,7 @@ int ReadConfigString(FILE *fp, char *setting, char *value) if ( strncmp(buf, str, strlen(str)) == 0) { /* found our setting */ - + for(i=0; i!=slen; i++) if ( buf[i] == '=' ) { @@ -582,7 +582,7 @@ int ReadConfigString(FILE *fp, char *setting, char *value) return 1; } } - } + } return 0; } @@ -686,7 +686,7 @@ void BlitString(char *name, int x, int y) for (i=0; name[i]; i++) { - c = toupper(name[i]); + c = toupper(name[i]); if (c >= 'A' && c <= 'Z') { /* its a letter */ c -= 'A'; @@ -694,7 +694,7 @@ void BlitString(char *name, int x, int y) k += CHAR_WIDTH; } else if ( c >= '0' && c <= ':') - { + { c -= '0'; copyXPMArea(c * CHAR_WIDTH, 64, CHAR_WIDTH, 8, k, y); k += CHAR_WIDTH; @@ -705,7 +705,7 @@ void BlitString(char *name, int x, int y) k += 4; } else if (c=='.') - { + { copyXPMArea(115, 64, 4, 8, k, y); k += 4; } @@ -715,7 +715,7 @@ void BlitString(char *name, int x, int y) k += CHAR_WIDTH; } else /* print a ' ' */ - { + { copyXPMArea(120, 64, CHAR_WIDTH, 8, k, y); k += CHAR_WIDTH; } @@ -732,7 +732,7 @@ void usage(void) fprintf(stderr, "See ~/.wmtzrc or /etc/wmtzrc for configuration.\n\n"); fprintf(stderr, "Usage:\n"); fprintf(stderr, " -display \n"); - fprintf(stderr, " -e use specified editor\n"); + fprintf(stderr, " -e use specified editor\n"); fprintf(stderr, " -geometry +XPOS+YPOS initial window position\n"); fprintf(stderr, " -jd Julian<->Date conversion\n"); fprintf(stderr, " -c use specified config file\n"); @@ -758,8 +758,8 @@ void printversion(void) void range (double *val, double ran) { *val -= ran*floor(*val/ran); - - if (*val < 0) + + if (*val < 0) *val += ran; } @@ -787,7 +787,7 @@ void siderealTime( double jde, int *result, int mode ) ts = 280.46061837 + 360.98564736629 * ( jde - 2451545.0 ) + 0.000387933 * t2 - t3/38710000.0; - range( &ts, 360.0 ); + range( &ts, 360.0 ); ts /= 15.0; /* If local time add one hour for every 15 degree in longitude */ @@ -805,7 +805,7 @@ void siderealTime( double jde, int *result, int mode ) /*****************************************************************************\ |* julianDay - Gives JD from date. *| \*****************************************************************************/ -double julianDay( int year, int month, double day, double hour, +double julianDay( int year, int month, double day, double hour, double minute, double second, int julian ) { int a, b, c, d; @@ -846,17 +846,17 @@ int calendarDate( double jd, int *year, int *month, double *day ) if ( jd < 0 ) return 0; - + jd += 0.5; ij = floor(jd); frac = jd - ij; - if ( ij < 2299161 ) + if ( ij < 2299161 ) { a = ij; } - else - { + else + { alfa = floor((ij - 1867216.25)/36524.25); beta = floor(alfa/4); a = ij + 1 + alfa - beta; @@ -874,7 +874,7 @@ int calendarDate( double jd, int *year, int *month, double *day ) *month = e - 1; else if (e == 14 || e == 15) *month = e - 13; - else + else return 0; if (*month > 2) @@ -883,7 +883,7 @@ int calendarDate( double jd, int *year, int *month, double *day ) *year = c - 4715; else return 0; - + return 1; } @@ -904,7 +904,7 @@ int handleJD( void ) { printf("Enter UT date with time (YYYY,MM,DD,hh:mm:ss): "); scanf("%d,%d,%d,%d:%d:%d", &y, &m, &d, &h, &min, &sec); - printf("\nJulian Day: %f\n", julianDay( y, m, d, h, min, sec, 0 ) ); + printf("\nJulian Day: %f\n", julianDay( y, m, d, h, min, sec, 0 ) ); } else if (conv == 2) { @@ -915,7 +915,7 @@ int handleJD( void ) printf("Conversion error! Negative JD not allowed.\n"); return 0; } - + printf("\nGregorian date: %d-%2.2d-%2.4f\n", y, m, day); } else @@ -939,15 +939,15 @@ void errH(int printErrno, int exitCode, const char *msg, ...) buf[0] = 0; strcat(buf, pname); strcat(buf, ": "); - + va_start(arg, msg); vsprintf(buf+strlen(buf), msg, arg); if (printErrno) sprintf(buf+strlen(buf), ": %s", strerror(error)); strcat(buf, "\n"); - fflush(stdout); + fflush(stdout); fputs(buf, stderr); - fflush(NULL); + fflush(NULL); va_end(arg); if ( exitCode ) diff --git a/wmtz/wmtz/wmtzrc b/wmtz/wmtz/wmtzrc index 7b726e0..2722f4b 100644 --- a/wmtz/wmtz/wmtzrc +++ b/wmtz/wmtz/wmtzrc @@ -1,6 +1,6 @@ # wmtz configuration file. Comments begin with # -#Three (or less) letter designation of timezone. +#Three (or less) letter designation of timezone. # time*=JDN gives Julian Day Number. # time*=GMST gives sidereal time at Greenwich. # time*=LMST gives local sidereal time. longitude must be set. @@ -10,11 +10,11 @@ # time*=WDAY gives local weekday. utdiff is ignored. # time*=LOCAL gives local time (usefull to deal with DST). utdiff is ignored. # time*=TZONE gives the time as specified in TZ string. -time1=JDN -time2=JDN +time1=JDN +time2=JDN time3=GMST -time4=JST -time5=TZONE +time4=JST +time5=TZONE #Difference in hours from UT (Greenwich Civil Time) for the time zones above. #Negative values are required for timezones to the east of Greenwich. @@ -23,22 +23,22 @@ time5=TZONE # Automatic correction of daylight saving time changes is supported #only by TZONE, WDAY, DATE and LOCAL. # -#If TZONE was specified for a time position, you must give the TZ environment -#variable for the desired time zone in the corresponding utdiff*. See +#If TZONE was specified for a time position, you must give the TZ environment +#variable for the desired time zone in the corresponding utdiff*. See # "man tzset" for at description of the TZ environment variable string. -# -#If JDN was specified for a time position, this value is subtracted from the -#Julian day number, giving days from another epoch. This enables you to see +# +#If JDN was specified for a time position, this value is subtracted from the +#Julian day number, giving days from another epoch. This enables you to see #more decimals of the JD if you want to... # #Time differences in minutes is supported only for the TZONE option. -# -utdiff1=0 +# +utdiff1=0 #This gives days from 2000-01-01 00:00 UT: -utdiff2=2451544.5 -utdiff3=0 -utdiff4=-9 -utdiff5=XST-10XDT1,M10.5,0,M3.5.0 +utdiff2=2451544.5 +utdiff3=0 +utdiff4=-9 +utdiff5=XST-10XDT1,M10.5,0,M3.5.0 #Give the longitude of your location in decimal degrees, positive east. longitude=13.5 diff --git a/wmweather+/HINTS b/wmweather+/HINTS index b3f55b3..d85f992 100644 --- a/wmweather+/HINTS +++ b/wmweather+/HINTS @@ -15,7 +15,7 @@ the WindowMaker Dock (preferred) or the Clip. Now press the rightmouse button on wmweather+'s outer edges and select "Settings..." from the popup menu that appears. -Enable the 'Start when WindowMaker is started' option, then +Enable the 'Start when WindowMaker is started' option, then click on the 'OK' button in the Docked Applications Panel. Afterstep diff --git a/wmweather+/animation.c b/wmweather+/animation.c index 9a831e4..5838718 100644 --- a/wmweather+/animation.c +++ b/wmweather+/animation.c @@ -71,7 +71,7 @@ void SetAnimation(struct animation *a, int x, int y, int sky, int obs, int vis, void DoAnimation(struct animation *a){ int i; int top, h; - + /* Turned off? */ if(!a->active) return; diff --git a/wmweather+/avn.c b/wmweather+/avn.c index c8b1d80..32a04e4 100644 --- a/wmweather+/avn.c +++ b/wmweather+/avn.c @@ -50,7 +50,7 @@ static int parse_avn(char *file); static void reset_avn(void){ int i; - + for(i=0; itm_hour=hm/100; tm->tm_min=hm%100; @@ -260,7 +260,7 @@ int utc2local(int hm, int *month, int *day, int *year, int *wday){ int local2utc(int hm, int *month, int *day, int *year, int *wday){ time_t t=time(NULL); struct tm *tm; - + tm=localtime(&t); tm->tm_hour=hm/100; tm->tm_min=hm%100; @@ -281,7 +281,7 @@ int local2utc(int hm, int *month, int *day, int *year, int *wday){ void fix_date(int *month, int *day, int *year, int *wday){ time_t t=time(NULL); struct tm *tm; - + tm=gmtime(&t); if(month!=NULL && *month!=-1) tm->tm_mon=*month-1; if(day!=NULL && *day!=-1) tm->tm_mday=*day; @@ -378,7 +378,7 @@ static double parse_dd_or_dms(char *s, char **e){ if(!isdigit(*s) && *s!='.') return NAN; return strtod(s, e); } - + if(!isdigit(*s)) return NAN; deg=strtol(s, e, 10); if(*e==s || *e==NULL || **e!='\'') return deg; diff --git a/wmweather+/diff.c b/wmweather+/diff.c index 4d1c09b..5f5b1a4 100644 --- a/wmweather+/diff.c +++ b/wmweather+/diff.c @@ -53,7 +53,7 @@ int diff(char *file1, char *file2){ len2=fread(s2, sizeof(char), len, fp2); if(len1!=len2 || memcmp(s1, s2, len1)){ fclose(fp1); fclose(fp2); return 1; - } + } } ret=(!feof(fp1) || !feof(fp2)); fclose(fp1); diff --git a/wmweather+/dock.c b/wmweather+/dock.c index e550dc8..289a21e 100644 --- a/wmweather+/dock.c +++ b/wmweather+/dock.c @@ -324,7 +324,7 @@ void update_dock(){ break; } break; - + case 4: copyPixmapArea(123, 96, 6, 7, 65, 17); break; @@ -424,7 +424,7 @@ void DrawDisplay(int force){ if(current_warnings) font=1; if(force || last_font!=font) last_time=-1; last_font=font; - + switch(current_mode){ case 0: if(last_time==current.last_update) break; @@ -592,7 +592,7 @@ void DrawDisplay(int force){ } x=GetStringWidth(bigbuf); DrawString(60+(64-x)/2, 18, bigbuf, font); - + x=GetStringWidth(f->station); DrawString(118-x, 28, f->station, font+1); diff --git a/wmweather+/eta.c b/wmweather+/eta.c index 8cd2fbe..e59c31b 100644 --- a/wmweather+/eta.c +++ b/wmweather+/eta.c @@ -50,7 +50,7 @@ static int parse_eta(char *file); static void reset_eta(void){ int i; - + for(i=0; ihour<0)?86399:3599; return t>now; @@ -253,7 +253,7 @@ static void locate_current(void){ long curdiff=0; long tmpdiff; char target_ID[4]; - + now=time(NULL); if(!changed && current!=NULL && is_forecast_current(current, now)) return; @@ -262,7 +262,7 @@ static void locate_current(void){ target_hour=current_hour; memcpy(target_ID, current_ID, 4); set_current(-1); - + for(i=0; it) return; @@ -210,7 +210,7 @@ static int parse_metar(char *file){ bigbuf[len++]=' '; bigbuf[len]='\0'; } - + /* Look for something like a METAR coded report */ ovalue=pcre_exec(station_time, NULL, bigbuf, len, 0, 0, ovector, ovecsize); if(ovalue<=0) return 0; @@ -354,7 +354,7 @@ wind_done: i=(c[1]=='\0'); pcre_free_substring(c); if(i) continue; - + get_substr(1, in); get_substr(2, de); @@ -405,7 +405,7 @@ wind_done: pcre_free_substring(ot); }} if(current.obs==99) current.obs=0; - + pcre_free_substring(s); /* Done parsing! Just a few final calculations... */ current.heatindex=heatindex_C(current.temp, current.rh); @@ -425,7 +425,7 @@ wind_done: day=current.date; time2=current.time; current.time=utc2local((int)current.time, ¤t.month, ¤t.date, &y, NULL); - + if(latitude!=999 && calcSolarZenith(latitude, longitude, year, mon, day, hm2min(time2))>90) current.moon=calc_moon(current.month, current.date, y, current.time); } diff --git a/wmweather+/moon.c b/wmweather+/moon.c index 295adda..f6a589b 100644 --- a/wmweather+/moon.c +++ b/wmweather+/moon.c @@ -51,7 +51,7 @@ double calc_moon(int month, int day, int year, int hm){ time_t t=time(NULL); struct tm *tm; double p; - + tm=gmtime(&t); tm->tm_hour=hm/100; tm->tm_min=hm%100; @@ -60,7 +60,7 @@ double calc_moon(int month, int day, int year, int hm){ tm->tm_mday=day; tm->tm_year=year; t=mkgmtime(tm); - + /* This next line is the algorithm. */ p=fpart(((t/86400.0-11323.0)*850.0+5130.5769)/25101.0); if(p>.5) return -.5+cos(2*PI*p)/2; @@ -138,7 +138,7 @@ void copySunMoon(int x, int y, double percent){ } } } - + XPutImage(display, wmgen.pixmap, NormalGC, pix, 0, 0, 0, 0, pix->width, pix->height); XDestroyImage(pix); diff --git a/wmweather+/mrf.c b/wmweather+/mrf.c index f33b79f..9b9d5d5 100644 --- a/wmweather+/mrf.c +++ b/wmweather+/mrf.c @@ -49,7 +49,7 @@ static int parse_mrf(char *file); static void reset_mrf(void){ int i; - + for(i=0; iwidth>52 || r->height>40 || (r->width!=52 && r->height!=40)){ w=r->width/52; h=r->height/40; @@ -239,7 +239,7 @@ static int parse_radar(char *file){ return 0; } } - + if(!RConvertImage(rc, r, &radar)){ RReleaseImage(r); warn("parse_radar convert: %s", RMessageForError(RErrorCode)); diff --git a/wmweather+/subst.c b/wmweather+/subst.c index 1bbf139..242b110 100644 --- a/wmweather+/subst.c +++ b/wmweather+/subst.c @@ -130,13 +130,13 @@ char *subst(const char *s, struct subst_val *substitutes){ case INT: PRINT(*(signed int *)substitutes[m].val); break; - + case UINT: case OCTAL: case HEX: PRINT(*(unsigned int *)substitutes[m].val); break; - + case FLOAT_E: case FLOAT_F: case FLOAT_G: diff --git a/wmweather+/warnings.c b/wmweather+/warnings.c index f134344..f0b1451 100644 --- a/wmweather+/warnings.c +++ b/wmweather+/warnings.c @@ -85,7 +85,7 @@ void init_warnings(void){ { 'f', STRING, &bigbuf }, { 0, 0, 0 } }; - + /* Count zones, and find length of longest */ for(i=0; warning_zones[i]!=NULL; i++){ j=strlen(warning_zones[i]); @@ -100,7 +100,7 @@ void init_warnings(void){ } zone_current_warnings=calloc(i, sizeof(*zone_current_warnings)); if(zone_current_warnings==NULL) die("init_warnings malloc"); - + /* Allocate filename base */ e=get_pid_filename(""); i=strlen(e); diff --git a/wmweather+/wmgeneral/xpm_trans.c b/wmweather+/wmgeneral/xpm_trans.c index 14a1de6..d02e1ec 100644 --- a/wmweather+/wmgeneral/xpm_trans.c +++ b/wmweather+/wmgeneral/xpm_trans.c @@ -13,7 +13,7 @@ CHANGES: --- 16/08/2001 (Brad Jorsch, anomie@users.sourceforge.net) - * Wrote these routines. + * Wrote these routines. */ diff --git a/wmweather+/wmweather+.1.in b/wmweather+/wmweather+.1.in index b58d725..985c218 100644 --- a/wmweather+/wmweather+.1.in +++ b/wmweather+/wmweather+.1.in @@ -61,7 +61,7 @@ button as described below. The default is on. .SS Station Options .TP .BI "-s\fR,\fP\ -station " -Station ID for all stations. Equivalent to +Station ID for all stations. Equivalent to .RI "'-metar-station " " -avn-station " .RI " -eta-station " " -mrf-station " '. .TP @@ -127,12 +127,12 @@ information. .RE .TP .BI "-radar-crop " -How to crop the radar image. +How to crop the radar image. .IR X x Y + W + H format. See \fBRadar Map\fP for more information. .TP .BI "-radar-cross " -Where to draw radar crosshairs. +Where to draw radar crosshairs. .IR X x Y format. See \fBRadar Map\fP for more information. @@ -293,7 +293,7 @@ Be kind, since the display is so small pick the smallest version of the image to download. .Sh "Weather Warnings" Various weather warnings, watches, and statements for the specified zone are -downloaded from +downloaded from .UR http://weather.noaa.gov/pub/data/watches_warnings/ http://weather.noaa.gov/pub/data/watches_warnings/ .UE diff --git a/wmweather+/wmweather+.c b/wmweather+/wmweather+.c index 6dcf09e..476f33f 100644 --- a/wmweather+/wmweather+.c +++ b/wmweather+/wmweather+.c @@ -562,7 +562,7 @@ int readconf(char *file){ char *c, *d; int i, l, flag=1; FILE *fp; - + if(file==NULL){ flag=0; file=get_filename("conf"); @@ -643,7 +643,7 @@ void sigint(int i){ int main(int argc, char **argv){ int i, j; char *c; - + ProgName = argv[0]; if((c=strrchr(ProgName, '/'))!=NULL && *(c+1)!='\0'){ ProgName=c+1; diff --git a/wmwifi/ChangeLog b/wmwifi/ChangeLog index eb03012..998c445 100644 --- a/wmwifi/ChangeLog +++ b/wmwifi/ChangeLog @@ -1,12 +1,12 @@ 2006-03-07 Jess Mahan * Version 0.6 * Strip trailing colon from interface name in wfi->ifname - Jeroen Nijhof + Jeroen Nijhof * Added ability to switch between scrolling and non scrolling interfaces. Thanks to Jeroen Nijhof for ideas. * Mouse1 now switches between scrolling / non-scrolling modes - * Added custom color support + * Added custom color support * Added preset color schemes -tc -tn -ts * Updated Man page to reflect changes. * Updated --help contents @@ -31,7 +31,7 @@ * wmwifi will not exit if a card is removed, instead it displays an error - + 2003-16-12 Jess Mahan * Added "get_max_qual" to get the maximum quality directly from @@ -39,9 +39,9 @@ would always be 92, which isn't the case. This means that quality reporting is now accurate. - + 2003-22-24 Jess Mahan - + * Changes the "look" of the display. * wmwifi now exits if it cannot open the wireless extensions. * Displays link in percentage now, rather than actuall amount. @@ -54,4 +54,4 @@ * Created initial (0.1-1) Release (see README) * Created initial (0.1-1) Debian Package - + diff --git a/wmwifi/README b/wmwifi/README index 4e9e214..070bc48 100644 --- a/wmwifi/README +++ b/wmwifi/README @@ -5,37 +5,37 @@ Copyright (c) 2006 Jess Mahan WmWiFi 0.6 ----------------- - It's been a long time since the last release. I know, I know, you've been - jonesin' for the next iteration, but over the last year or so, we've had very - little complaints and even fewer bug reports, so "if it aint broke don't + It's been a long time since the last release. I know, I know, you've been + jonesin' for the next iteration, but over the last year or so, we've had very + little complaints and even fewer bug reports, so "if it aint broke don't fix it!". - If your reading this, then you are probably running Window Maker, and have a + If your reading this, then you are probably running Window Maker, and have a Wifi (wireless) card installed on your Linux box. !!!! BE AWARE !!!! This is my first attempt at writing a Window Maker dockapp, so if this thing - destroys your computer, kills your dog, or burns down your house, don't + destroys your computer, kills your dog, or burns down your house, don't blame me for it. This is very experimental at the moment. - This dockapp displays the signal strength, link level, noise level, and - bitrate to your current access point. It also displays the current access + This dockapp displays the signal strength, link level, noise level, and + bitrate to your current access point. It also displays the current access point's name. I sincerely apologize for any inconveniences or problems with the this - version, or previous versions of WmWiFi. - - Many thanks to the people that actually e-mailed me with bug reports, those - bug reports have made this version possible. WmWiFi now works + version, or previous versions of WmWiFi. + + Many thanks to the people that actually e-mailed me with bug reports, those + bug reports have made this version possible. WmWiFi now works properly (i hope). ----------------- Getting Help ----------------- - If you need help, there is a mailing list at wmwifi@lists.digitalssg.net. - - Simply subscribe to it by sending a blank e-mail to + If you need help, there is a mailing list at wmwifi@lists.digitalssg.net. + + Simply subscribe to it by sending a blank e-mail to wmwifi-subscribe@lists.digitalssg.net. When asking a question, please be sure to include the nature of your problem, @@ -44,7 +44,7 @@ Getting Help "cat /proc/net/wireless" "iwconfig" "head -10 /usr/include/linux/wireless.h | grep Version" - + ----------------- Requirements ----------------- @@ -52,14 +52,14 @@ Requirements libXpm http://freshmeat.net/projects/libxpm libdockapp ftp://truffula.com/pub/libdockapp-0.4.tgz - To compile this, you'll need libdockapp, libxpm, and all the X development - libs. Chances are, if you have installed other dockapps, then you will have + To compile this, you'll need libdockapp, libxpm, and all the X development + libs. Chances are, if you have installed other dockapps, then you will have no problems compiling this. Linux Wireless Extensions. This program relys on the Wireless Extensions being enabled (and working) in - the 2.4.X and 2.6.X kernel series. If you can "cat /proc/net/wireless", then - this thing will probably work for you. If "cat /proc/net/wireless" returns + the 2.4.X and 2.6.X kernel series. If you can "cat /proc/net/wireless", then + this thing will probably work for you. If "cat /proc/net/wireless" returns nothing, then this dockapp wont work. @@ -78,10 +78,10 @@ What's New 0.6 - Many thanks to Jeroen Nijhof for his contribution - of a patch for WmWifi. + of a patch for WmWifi. - I decided to only use a couple of lines of code from Jeroen's patch, and - implement the rest myself, so that it could better integrate with the + I decided to only use a couple of lines of code from Jeroen's patch, and + implement the rest myself, so that it could better integrate with the "classic" wmwifi. I also wanted to make WmWifi a bit more flexible, whereas Jeroen's version was locked in to a specific look, and foreced the scrolling. @@ -91,7 +91,7 @@ What's New left mouse button (to retain our classic look and feel). The Backlight turns on when Signal Strength goes below 1% - + ----------------- The "Look" ----------------- @@ -100,11 +100,11 @@ The "Look" We've got a new look, actually a few of them. You will most likely notice the differences from the old version and the new becuase the font's have changed and now the interface name and essid - scroll across the top (which can be disabled). - - Many thanks to Jeroen Nijhof for his contribution of - a new theme and the scrolling interface and essid. I decided not to use - all of his changes, but did use his fonts.xpm (becuase they are waaay nicer), + scroll across the top (which can be disabled). + + Many thanks to Jeroen Nijhof for his contribution of + a new theme and the scrolling interface and essid. I decided not to use + all of his changes, but did use his fonts.xpm (becuase they are waaay nicer), and a couple lines of code. # wmwifi -tc # classic theme (Default) @@ -119,21 +119,21 @@ The "Look" is an RGB color. for instance: # wmwifi -bg rgb:00/00/00 -fg rgb:ff/ff/ff -hi rgb:c1/c1/c1 -mt rgb:ff/00/00 - will give you a black background, white foreground/text, grey highlights, + will give you a black background, white foreground/text, grey highlights, and red midtones. - If you don't know what an RGB color is, it's basically the same thing as an + If you don't know what an RGB color is, it's basically the same thing as an HTML color, just ditch the '#', and add a '/' every two characters. This version allows you to customize the colors to create your own themes, checkout wmwifi --help for more information. - - 0.5 - + + 0.5 - This version (0.5) of wmwifi still uses the look introduced by version 0.2. For now, you cannot change the look, and to be honest, there has been no complaints, so if you want a new look or have a kewl design, e-mail me. - There were bug reports of the percentages not being displayed correctly, + There were bug reports of the percentages not being displayed correctly, this is my fault, since I assumed that the maximum link quality would always be 92. I had reports of varying link qualities, so in this version it should be fixed (if it's not, you know where to e-mail me). We not @@ -144,10 +144,10 @@ The "Look" ----------------- -Stuff it does do +Stuff it does do ----------------- - + WmWiFi now monitors all of you wireless interfaces. So if you have more than one, WmWiFi can now handle it! @@ -159,7 +159,7 @@ Stuff it does do - Preset Themes. - Scrolling Interface Name and ESSID - Turn's backlight on when link quality goes below 1% - + To disable interface and essid scrolling, simply left click (mouse 1). To switch to the next wireless interface, simply middle click (mouse 2). To switch to the next screen, simply right click (mouse 3). @@ -168,19 +168,19 @@ Stuff it does do Stuff if doesn't do or can't do ----------------- - WmWifi cannot properly report the stats from drivers like the prism54 or + WmWifi cannot properly report the stats from drivers like the prism54 or ndiswrapper drivers. Believe me, I have tried to get these to work, but the stats don't even report correctly from iwconfig, so I am assuming it's not my fault. If you post to the mailing list complaining about wrong stats, and you are - using one of those drivers, I'm going to slap you silly, because you didn't + using one of those drivers, I'm going to slap you silly, because you didn't read this! I did try and put some code in this version to "auto-learn" your link quality if the maximum cannot be read from the driver, but it's not guaranteed. ------------------ +----------------- Rants / Raves ----------------- diff --git a/wmwifi/debian/README.Debian b/wmwifi/debian/README.Debian index 35239b6..9cc1dea 100644 --- a/wmwifi/debian/README.Debian +++ b/wmwifi/debian/README.Debian @@ -6,12 +6,12 @@ wmwifi-0.6 for Debian wmwifi-0.5 for Debian --------------------- - This release of wmwifi has been tested using the linux-wlan-ng drivers, the standard + This release of wmwifi has been tested using the linux-wlan-ng drivers, the standard orinoco_cs shipped with the kernel, ndiswrapper, and the prism54 drivers. The ndiswrapper and prism54 drivers do not report thier stat's correctly to the wireless extensions in the kernel, so wmwifi cannot reply them correctly. - + This program was tested with kernel 2.4.18,2.4.22,2.4.23, 2.6.3, 2.6.7, and 2.6.8.1 but should work with any 2.4.X or 2.6.X kernel, or backport wich supports Wireless Extentions. diff --git a/wmwifi/debian/changelog b/wmwifi/debian/changelog index 4942b21..d9e279a 100644 --- a/wmwifi/debian/changelog +++ b/wmwifi/debian/changelog @@ -2,12 +2,12 @@ wmwifi (0.6-1) unstable; urgency=low * Version 0.6 * Strip trailing colon from interface name in wfi->ifname - Jeroen Nijhof + Jeroen Nijhof * Added ability to switch between scrolling and non scrolling interfaces. Thanks to Jeroen Nijhof for ideas. * Mouse1 now switches between scrolling / non-scrolling modes - * Added custom color support + * Added custom color support * Added preset color schemes -tc -tn -ts * Updated Man page to reflect changes. * Updated --help contents @@ -28,7 +28,7 @@ wmwifi (0.5-1) unstable; urgency=low view of Link/Level/Noise/Bitrate. -- Jess Mahan Fri, 24 Sep 2004 12:45:00 -0800 - + wmwifi (0.4-1) unstable; urgency=low * New release @@ -37,7 +37,7 @@ wmwifi (0.4-1) unstable; urgency=low wmwifi (0.2-2) unstable; urgency=low - * New release + * New release -- Jess Mahan Mon, 24 Nov 2003 16:29:19 -0800 diff --git a/wmwifi/debian/copyright b/wmwifi/debian/copyright index aa80e1b..1e574ed 100644 --- a/wmwifi/debian/copyright +++ b/wmwifi/debian/copyright @@ -1,7 +1,7 @@ This package was debianized by Jess Mahan on Wed, 12 Nov 2003 18:15:34 -0800. -It was downloaded from http://digitalssg.net/debian/wmwifi-0.4.tar.gz +It was downloaded from http://digitalssg.net/debian/wmwifi-0.4.tar.gz Upstream Author: Jess Mahan diff --git a/wmwifi/debian/rules b/wmwifi/debian/rules index 4c2dc96..c7ac0f7 100755 --- a/wmwifi/debian/rules +++ b/wmwifi/debian/rules @@ -41,7 +41,7 @@ build-stamp: config.status clean: dh_testdir dh_testroot - rm -f build-stamp + rm -f build-stamp # Add here commands to clean up after the build process. -$(MAKE) distclean @@ -76,7 +76,7 @@ binary-arch: build install dh_installmenu dh_installman wmwifi.1 dh_installinfo - dh_installchangelogs + dh_installchangelogs dh_link dh_strip dh_compress @@ -88,4 +88,4 @@ binary-arch: build install dh_builddeb binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install +.PHONY: build clean binary-indep binary-arch binary install diff --git a/wmwifi/src/Makefile.am b/wmwifi/src/Makefile.am index 9a0d4f7..70349c9 100644 --- a/wmwifi/src/Makefile.am +++ b/wmwifi/src/Makefile.am @@ -1,6 +1,6 @@ OBJECTS = `find ./* -name '*.o'` -bin_PROGRAMS = wmwifi +bin_PROGRAMS = wmwifi wmwifi_SOURCES = \ wmwifi.c \ @@ -9,6 +9,6 @@ wmwifi_SOURCES = \ dockapp.h \ backdrop_off.xpm \ backdrop_on.xpm -#wmwifi_LDADD = -L/usr/X11R6/lib -L/usr/local/lib -lX11 -lXext -lXpm +#wmwifi_LDADD = -L/usr/X11R6/lib -L/usr/local/lib -lX11 -lXext -lXpm #wmupmon_LDADD = @LIBRARY_SEARCH_PATH@ @XLIBS@ wmwifi_LDFLAGS = -I/usr/include diff --git a/wmwifi/src/wireless.c b/wmwifi/src/wireless.c index 411a608..bc9753b 100644 --- a/wmwifi/src/wireless.c +++ b/wmwifi/src/wireless.c @@ -14,7 +14,7 @@ /* * This is my quick and dirty way of accessing the Linux Wireless Extensions * from the /proc/net/wireless interface. - * Open the file, and get the Interface name, link, level, and noise. + * Open the file, and get the Interface name, link, level, and noise. * - Jess */ @@ -109,7 +109,7 @@ int get_wifi_info(struct wifi *wfi) fprintf(stdout, "wfi->bitrate -> %d\n", wfi->bitrate.value); fprintf(stdout, "wfi->max_link -> %.f\n", wfi->max_link); */ - + close(skfd); diff --git a/wmwifi/src/wmwifi.h b/wmwifi/src/wmwifi.h index 20f8651..d2f89d9 100644 --- a/wmwifi/src/wmwifi.h +++ b/wmwifi/src/wmwifi.h @@ -23,7 +23,7 @@ extern Bool wmwifi_learn; struct wifi { char ifname[255]; char essid[IW_ESSID_MAX_SIZE + 1]; - int ifnum; + int ifnum; float link; int level; unsigned int noise; diff --git a/wmwifi/wmwifi.1 b/wmwifi/wmwifi.1 index d9157c5..5947d18 100644 --- a/wmwifi/wmwifi.1 +++ b/wmwifi/wmwifi.1 @@ -26,25 +26,25 @@ command. This manual page was written for the Debian GNU/Linux distribution. .PP .\" TeX users may be more comfortable with the \fB\fP and -.\" \fI\fP escape sequences to invode bold face and italics, +.\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. \fBWMWiFi\fP is a dockapp that is supported by X window managers such as Window Maker, AfterStep, BlackBox, and Enlightenment. It monitors all -wireless network interfaces on your machine. +wireless network interfaces on your machine. -The main screen displays the link (signal) strength between the currently -selected card and your wireless access point as a percentage, and has an -LCD look-alike user interface. +The main screen displays the link (signal) strength between the currently +selected card and your wireless access point as a percentage, and has an +LCD look-alike user interface. The second screen diplays extended stats, which are: -the current rate/speed in megabits, the noise (in dBm), the level (in dBm), +the current rate/speed in megabits, the noise (in dBm), the level (in dBm), and the actual link amount. Both screens toggle the interface name and the current associated access -point at the top every 5 seconds. +point at the top every 5 seconds. The back-light may be turned on/off by clicking the mouse -button over the application. +button over the application. Mouse1 activates/deactivates the scrolling of the Wireless Interface Name / ESSID. @@ -105,8 +105,8 @@ run the application in windowed mode activate broken window manager fix .TP .B \-l, \-\-learn -attempt max signal quality autodetection/learning for broken wireless drivers -(ndiswrapper, prism54). +attempt max signal quality autodetection/learning for broken wireless drivers +(ndiswrapper, prism54). *Note* this may break the max signal quality. .TP .B \\+s, \-\-scroll-on diff --git a/wmwlmon/wl.c b/wmwlmon/wl.c index 706e9a5..23d124e 100644 --- a/wmwlmon/wl.c +++ b/wmwlmon/wl.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - + /* Ported to FreeBSD by Nathan Lay 4/30/06 */ #include @@ -174,7 +174,7 @@ get_channel(const char *interface) } #endif close(s); - + if (ichan == 0) { #ifdef __OpenBSD__ if (channel.i_channel < 1000) @@ -198,7 +198,7 @@ get_channel(const char *interface) int get_signal(const char *interface, const char *network) { - + #ifdef __OpenBSD__ int i = 0, s, len; struct ieee80211_nodereq_all na; @@ -270,7 +270,7 @@ get_signal(const char *interface, const char *network) break; } while (len >= sizeof(struct ieee80211req_scan_result)); #endif - + return (0); } @@ -360,7 +360,7 @@ get_speed(const char *interface) IFM_SUBTYPE(desc->ifmt_word) == IFM_SUBTYPE(mword)) return (translate_speed(desc->ifmt_string)); } - + return (NULL); } @@ -409,7 +409,7 @@ get_status(const char *interface) sizeof(status)); return (status); } - + } return (NULL); @@ -439,7 +439,7 @@ get_nwid(const char *interface) #ifdef __FreeBSD__ struct ieee80211req nwid; #endif - + if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1) return (NULL); @@ -557,7 +557,7 @@ check_nic(const char *interface) * translate_speed() * translate the result of media speed to human readable string * Return: - * = success, NULL = no data / error + * = success, NULL = no data / error */ char * translate_speed(const char *mode) diff --git a/wmwlmon/wl.h b/wmwlmon/wl.h index 7b634f8..646f6b9 100644 --- a/wmwlmon/wl.h +++ b/wmwlmon/wl.h @@ -16,7 +16,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef __OpenBSD__ +#ifndef __OpenBSD__ #define IFM_TYPE_MATCH(dt, t) (IFM_TYPE((dt)) == 0 || \ IFM_TYPE((dt)) == IFM_TYPE((t))) #endif diff --git a/wmwlmon/wmwlmon.c b/wmwlmon/wmwlmon.c index d1c32ee..795e72a 100644 --- a/wmwlmon/wmwlmon.c +++ b/wmwlmon/wmwlmon.c @@ -334,7 +334,7 @@ main(int argc, char *argv[]) /* scan for interface */ opt_interface = get_first_wnic(); if (opt_interface == NULL) { - fprintf(stderr, "No wireless interface found\n"); + fprintf(stderr, "No wireless interface found\n"); exit(1); } } else { @@ -417,11 +417,11 @@ main(int argc, char *argv[]) if (speed != NULL) { copyXPMArea(28, 67, 23, 8, 29, 36); if (strlen(speed) == 1) - draw_string(speed, 18, 36); + draw_string(speed, 18, 36); if (strlen(speed) == 2) - draw_string(speed, 12, 36); + draw_string(speed, 12, 36); if (strlen(speed) == 3) - draw_string(speed, 6, 36); + draw_string(speed, 6, 36); } /* signal strength */ @@ -456,7 +456,7 @@ main(int argc, char *argv[]) draw_string(chn, 6, 44); } - /* wep */ + /* wep */ r = get_wep(opt_interface); if (r > 0) copyXPMArea(54, 67, 4, 6, 48, 44); @@ -464,7 +464,7 @@ main(int argc, char *argv[]) if (nwid != NULL && i % 2 == 0 && nic_status) { /* reset nwid area */ - copyXPMArea(70, 50, 54, 9, 5, 50); + copyXPMArea(70, 50, 54, 9, 5, 50); draw_nwid(nwid, opt_scroll); } @@ -619,7 +619,7 @@ draw_signal(const int speed, const int signal) loop = bars; else loop = floor(have); - + for (i = 0, offset = 6; i < loop; i++, offset += 2) copyXPMArea(10, 67, 1, 6, offset, 21); } @@ -654,7 +654,7 @@ scroll_lcd(const int src_x, const int src_y, const int dst_x, /* copy scroll frame to destination */ frame = len - pos; - if (frame >= NWIDLENP) + if (frame >= NWIDLENP) copyXPMArea(pos, src_y, NWIDLENP, 8, dst_x, dst_y); else { copyXPMArea(pos, src_y, frame, 8, dst_x, dst_y); diff --git a/wmwlmon/xutils.c b/wmwlmon/xutils.c index 8e8bed6..a2d4625 100644 --- a/wmwlmon/xutils.c +++ b/wmwlmon/xutils.c @@ -147,7 +147,7 @@ openXwindow(int argc, char *argv[], char *pixmap_bytes[], { "Color9", NULL, 0 } }; - /* + /* * create pixmap */ cols[0].pixel = getColor(BackgroundColor, 1.0000, &red, &grn, &blu); @@ -197,8 +197,8 @@ openXwindow(int argc, char *argv[], char *pixmap_bytes[], mysizehints.y, mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix); - /* - * activate hints + /* + * activate hints */ XSetWMNormalHints(display, win, &mysizehints); classHint.res_name = wname; @@ -220,8 +220,8 @@ openXwindow(int argc, char *argv[], char *pixmap_bytes[], XSetWMName(display, win, &name); - /* - * create graphics context (gc) for drawing + /* + * create graphics context (gc) for drawing */ gcm = GCForeground | GCBackground | GCGraphicsExposures; gcv.foreground = fore_pix; @@ -268,7 +268,7 @@ getColor(char *ColorName, float fac, int *red, int *grn, int *blu) Color.green = (unsigned short)(fac*(Color.green-24) + 24); Color.flags = DoRed | DoGreen | DoBlue; XAllocColor(display, Attributes.colormap, &Color); - + *red = Color.red; *grn = Color.green; *blu = Color.blue; -- 2.11.4.GIT