diff options
author | jlam <jlam@pkgsrc.org> | 2000-03-07 03:35:43 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2000-03-07 03:35:43 +0000 |
commit | f3a209d07d143a523f9932b1290de3a4e18ec94d (patch) | |
tree | 89dedf150df91654bb9771ad98c335102a704113 /x11/icewm/patches | |
parent | fa389980f57c779050c5fa0c146669c6bc6e52dd (diff) | |
download | pkgsrc-f3a209d07d143a523f9932b1290de3a4e18ec94d.tar.gz |
Add NetBSD APM support. TaskBarShowAPMStatus=1 now works.
Diffstat (limited to 'x11/icewm/patches')
-rw-r--r-- | x11/icewm/patches/patch-aa | 10 | ||||
-rw-r--r-- | x11/icewm/patches/patch-ab | 68 | ||||
-rw-r--r-- | x11/icewm/patches/patch-ac | 15 | ||||
-rw-r--r-- | x11/icewm/patches/patch-ad | 12 | ||||
-rw-r--r-- | x11/icewm/patches/patch-ae | 16 |
5 files changed, 117 insertions, 4 deletions
diff --git a/x11/icewm/patches/patch-aa b/x11/icewm/patches/patch-aa index 94c45da1160..035f33f1746 100644 --- a/x11/icewm/patches/patch-aa +++ b/x11/icewm/patches/patch-aa @@ -1,10 +1,12 @@ -$NetBSD: patch-aa,v 1.1 2000/03/03 15:55:40 jlam Exp $ +$NetBSD: patch-aa,v 1.2 2000/03/07 03:35:44 jlam Exp $ --- sysdep.in.orig Mon Nov 8 06:45:52 1999 -+++ sysdep.in Fri Mar 3 02:21:51 2000 -@@ -2,5 +2,5 @@ ++++ sysdep.in Mon Mar 6 22:20:48 2000 +@@ -1,6 +1,6 @@ + CXX = @CXX@ LD = @CXX_LINK@ - SYS_CFLAGS = @CXXFLAGS@ @DEFS@ +-SYS_CFLAGS = @CXXFLAGS@ @DEFS@ ++SYS_CFLAGS = @CXXFLAGS@ @CPPFLAGS@ @DEFS@ SYS_INCDIRS = -SYS_LIBDIRS = +SYS_LIBDIRS = @LDFLAGS@ diff --git a/x11/icewm/patches/patch-ab b/x11/icewm/patches/patch-ab new file mode 100644 index 00000000000..e35766a7b1d --- /dev/null +++ b/x11/icewm/patches/patch-ab @@ -0,0 +1,68 @@ +$NetBSD: patch-ab,v 1.1 2000/03/07 03:35:45 jlam Exp $ + +--- src/aapm.cc.orig Sun Feb 13 10:28:36 2000 ++++ src/aapm.cc Mon Mar 6 22:22:36 2000 +@@ -22,11 +22,18 @@ + + #ifdef CONFIG_APM + ++#if defined(__NetBSD__) ++#include <sys/ioctl.h> ++#include <machine/apmvar.h> ++#include <fcntl.h> ++#endif ++ + YColor *YApm::apmBg = 0; + YColor *YApm::apmFg = 0; + YFont *YApm::apmFont = 0; + + void ApmStr(char *s, bool Tool) { ++#ifdef __linux__ + char buf[45]; + int len, i, fd = open("/proc/apm", O_RDONLY); + char driver[16]; +@@ -97,6 +104,44 @@ + strcat(s," - Charging"); + else + strcat(s,"M"); ++#elif defined(__NetBSD__) ++ struct apm_power_info aip; ++ int fd = open(APMDEV, O_RDONLY); ++ ++ if (fd == -1) { ++ return; ++ } ++ ++ if (ioctl(fd, APM_IOC_GETPOWER, &aip) == -1) { ++ fprintf(stderr, "ioctl failed on APMDEV"); ++ return; ++ } ++ ++ if (!Tool) { ++ if (taskBarShowApmTime) { ++ if (aip.minutes_left == 0) { ++ sprintf(s, "%02d", aip.battery_life); ++ } else ++ sprintf(s, "%d:%02d", aip.minutes_left/60, aip.minutes_left%60); ++ } else ++ sprintf(s, "%02d", aip.battery_life); ++ } else { ++ sprintf(s, "%d%%", aip.battery_life); ++ } ++ ++ if (aip.ac_state == APM_AC_ON) ++ if (Tool) ++ strcat(s," - Power"); ++ else ++ strcat(s,"P"); ++ if (aip.battery_state == APM_BATT_CHARGING) ++ if (Tool) ++ strcat(s," - Charging"); ++ else ++ strcat(s,"M"); ++ ++ close(fd); ++#endif + } + + YApm::YApm(YWindow *aParent): YWindow(aParent) { diff --git a/x11/icewm/patches/patch-ac b/x11/icewm/patches/patch-ac new file mode 100644 index 00000000000..abc6f49e4ff --- /dev/null +++ b/x11/icewm/patches/patch-ac @@ -0,0 +1,15 @@ +$NetBSD: patch-ac,v 1.1 2000/03/07 03:35:45 jlam Exp $ + +--- src/aapm.h.orig Sun Dec 5 11:47:02 1999 ++++ src/aapm.h Mon Mar 6 22:20:48 2000 +@@ -3,6 +3,10 @@ + #include "ytimer.h" + + #ifdef CONFIG_APM ++#if defined(__NetBSD__) ++#define APMDEV "/dev/apm" ++#endif ++ + class YApm: public YWindow, public YTimerListener { + public: + YApm(YWindow *aParent = 0); diff --git a/x11/icewm/patches/patch-ad b/x11/icewm/patches/patch-ad new file mode 100644 index 00000000000..7b3840c5f7f --- /dev/null +++ b/x11/icewm/patches/patch-ad @@ -0,0 +1,12 @@ +$NetBSD: patch-ad,v 1.1 2000/03/07 03:35:45 jlam Exp $ + +--- src/config.h.orig Mon Nov 8 06:45:52 1999 ++++ src/config.h Mon Mar 6 22:20:48 2000 +@@ -31,6 +31,6 @@ + #define CONFIG_NET_STATUS + + /* apm status */ +-#define CONFIG_APM ++/* #define CONFIG_APM */ + + #endif diff --git a/x11/icewm/patches/patch-ae b/x11/icewm/patches/patch-ae new file mode 100644 index 00000000000..86cfa70c25e --- /dev/null +++ b/x11/icewm/patches/patch-ae @@ -0,0 +1,16 @@ +$NetBSD: patch-ae,v 1.1 2000/03/07 03:35:45 jlam Exp $ + +--- src/wmtaskbar.cc.orig Sun Feb 6 11:15:45 2000 ++++ src/wmtaskbar.cc Mon Mar 6 22:20:48 2000 +@@ -253,7 +253,11 @@ + } else + fClock = 0; + #ifdef CONFIG_APM ++#ifdef __linux__ + if (taskBarShowApm && access("/proc/apm", 0) == 0) { ++#elif defined(__NetBSD__) ++ if (taskBarShowApm && access(APMDEV, 0) == 0) { ++#endif + fApm = new YApm(this); + if (fApm->height() + ADD1 > ht) ht = fApm->height() + ADD1; + } else |