From 628ece887d6fc306e3613df007d8a26ea9aa4e5c Mon Sep 17 00:00:00 2001 From: nakai Date: Wed, 1 Dec 1999 07:58:13 +0000 Subject: Add Brian Scott's apm patch. Submitted by: Brian Scott --- x11-wm/icewm/files/patch-ai | 18 +++++++++-- x11-wm/icewm/files/patch-ak | 73 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 3 deletions(-) create mode 100644 x11-wm/icewm/files/patch-ak (limited to 'x11-wm/icewm') diff --git a/x11-wm/icewm/files/patch-ai b/x11-wm/icewm/files/patch-ai index aace03d5b209..f2a895e61cfe 100644 --- a/x11-wm/icewm/files/patch-ai +++ b/x11-wm/icewm/files/patch-ai @@ -1,6 +1,6 @@ ---- src/wmtaskbar.cc.orig Sun May 23 00:57:11 1999 -+++ src/wmtaskbar.cc Sun May 23 00:57:25 1999 -@@ -331,9 +331,9 @@ +--- src/wmtaskbar.cc.orig Wed Dec 1 16:46:05 1999 ++++ src/wmtaskbar.cc Wed Dec 1 16:46:15 1999 +@@ -72,9 +72,9 @@ /** Use Linux 2.0 Penguin as start button */ #ifndef START_PIXMAP @@ -12,3 +12,15 @@ //#define START_PIXMAP "start.xpm" //#define START_PIXMAP "xfree86os2.xpm" #endif +@@ -253,7 +253,11 @@ + } else + fClock = 0; + #ifdef CONFIG_APM ++#ifdef __FreeBSD__ ++ if (taskBarShowApm && access("/dev/apm", 0) == 0) { ++#else + if (taskBarShowApm && access("/proc/apm", 0) == 0) { ++#endif + fApm = new YApm(this); + if (fApm->height() + ADD1 > ht) ht = fApm->height() + ADD1; + } else diff --git a/x11-wm/icewm/files/patch-ak b/x11-wm/icewm/files/patch-ak new file mode 100644 index 000000000000..e134d02129f0 --- /dev/null +++ b/x11-wm/icewm/files/patch-ak @@ -0,0 +1,73 @@ +--- src/aapm.cc.orig Mon Nov 8 20:45:52 1999 ++++ src/aapm.cc Wed Dec 1 16:42:31 1999 +@@ -20,15 +20,32 @@ + #include + #include + ++#ifdef __FreeBSD__ ++#include ++#include ++#include ++#include ++#endif ++ + #ifdef CONFIG_APM + + YColor *YApm::apmBg = 0; + YColor *YApm::apmFg = 0; + YFont *YApm::apmFont = 0; + ++#ifdef __FreeBSD__ ++#define APMDEV "/dev/apm" ++#else ++#define APMDEV "/proc/apm" ++#endif ++ + void ApmStr(char *s, bool Tool) { ++#ifdef __FreeBSD__ ++ struct apm_info ai; ++#else + char buf[45]; +- int len, i, fd = open("/proc/apm", O_RDONLY); ++#endif ++ int len, i, fd = open(APMDEV, O_RDONLY); + char driver[16]; + char apmver[16]; + int apmflags; +@@ -40,9 +57,27 @@ + char units[16]; + + if (fd == -1) { ++ static int error = 0; ++ if (!error) ++ perror("Can't open the apm device"); ++ error = 1; + return ; + } +- ++#ifdef __FreeBSD__ ++ if (ioctl(fd,APMIO_GETINFO, &ai) == -1) ++ { ++ static int error = 0; ++ if (!error) ++ perror("Can't ioctl the apm device"); ++ error = 1; ++ close(fd); ++ return; ++ } ++ close(fd); ++ BATlife = ai.ai_batt_life; ++ ACstatus = ai.ai_acline ; ++ BATflag = ai.ai_batt_stat == 3 ? 8 : 0; ++#else + len = read(fd, buf, sizeof(buf) - 1); + close(fd); + +@@ -60,6 +95,7 @@ + } + return ; + } ++#endif + if (BATlife == -1) + BATlife = 0; + -- cgit