diff options
Diffstat (limited to 'x11/gnome-applets/files')
-rw-r--r-- | x11/gnome-applets/files/patch-aa | 84 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-battstat-acpi | 576 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-battstat_acpi-freebsd.c | 152 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-battstat_acpi-freebsd.h | 78 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-battstat_battstat.schemas.in | 11 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-battstat_battstat_applet.c | 21 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-battstat_power-management.c | 123 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-cpufreq-freebsd | 344 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-cpufreq-selector-freebsd | 162 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-drivemount_drive-button.c | 48 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-gswitchit_gswitchit-applet.c | 61 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-gweather_weather.c | 12 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-mixer_applet.c | 11 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-modemlights_modem-applet.c | 22 | ||||
-rw-r--r-- | x11/gnome-applets/files/patch-stickynotes_stickynotes_applet_callbacks.c | 18 |
15 files changed, 808 insertions, 915 deletions
diff --git a/x11/gnome-applets/files/patch-aa b/x11/gnome-applets/files/patch-aa index 9e8038833e85..48b84e4569f6 100644 --- a/x11/gnome-applets/files/patch-aa +++ b/x11/gnome-applets/files/patch-aa @@ -1,15 +1,6 @@ ---- configure.orig Tue Mar 1 12:35:29 2005 -+++ configure Tue Mar 1 12:36:09 2005 -@@ -463,7 +463,7 @@ - # include <unistd.h> - #endif" - --ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT INTLTOOL_DESKTOP_RULE INTLTOOL_DIRECTORY_RULE INTLTOOL_KEYS_RULE INTLTOOL_PROP_RULE INTLTOOL_OAF_RULE INTLTOOL_PONG_RULE INTLTOOL_SERVER_RULE INTLTOOL_SHEET_RULE INTLTOOL_SOUNDLIST_RULE INTLTOOL_UI_RULE INTLTOOL_XAM_RULE INTLTOOL_KBD_RULE INTLTOOL_XML_RULE INTLTOOL_XML_NOMERGE_RULE INTLTOOL_CAVES_RULE INTLTOOL_SCHEMAS_RULE INTLTOOL_THEME_RULE INTLTOOL_EXTRACT INTLTOOL_MERGE INTLTOOL_UPDATE INTLTOOL_PERL INTLTOOL_ICONV INTLTOOL_MSGFMT INTLTOOL_MSGMERGE INTLTOOL_XGETTEXT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP build build_cpu build_vendor build_os host host_cpu host_vendor host_os LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL PATH_TO_XRDB X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS WARN_CFLAGS PKG_CONFIG GAILUTIL_CFLAGS GAILUTIL_LIBS GNOME_APPLETS_CFLAGS GNOME_APPLETS_LIBS GNOME_LIBS2_CFLAGS GNOME_LIBS2_LIBS GNOME_VFS_APPLETS_CFLAGS GNOME_VFS_APPLETS_LIBS BUILD_GNOME_VFS_APPLETS_TRUE BUILD_GNOME_VFS_APPLETS_FALSE LIBGLADE_CFLAGS LIBGLADE_LIBS GDK_PIXBUF_CSOURCE GCONFTOOL GCONF_SCHEMA_CONFIG_SOURCE GCONF_SCHEMA_FILE_DIR GCONF_SCHEMAS_INSTALL_TRUE GCONF_SCHEMAS_INSTALL_FALSE XSLTPROC GTOP_APPLETS_CFLAGS GTOP_APPLETS_LIBS BUILD_GTOP_APPLETS_TRUE BUILD_GTOP_APPLETS_FALSE LIBXKLAVIER_CFLAGS LIBXKLAVIER_LIBS ENABLE_FLAGS_TRUE ENABLE_FLAGS_FALSE LIBWNCK_CFLAGS LIBWNCK_LIBS INCLUDE_GSWITCHIT_DEVEL_TRUE INCLUDE_GSWITCHIT_DEVEL_FALSE GETTEXT_PACKAGE GNOMELOCALEDIR USE_NLS MSGFMT GMSGFMT XGETTEXT CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLLIBS PO_IN_DATADIR_TRUE PO_IN_DATADIR_FALSE POFILES POSUB MKINSTALLDIRS gnomelocaledir SCROLLKEEPER_CONFIG SCROLLKEEPER_REQUIRED JW HAVE_JW_TRUE HAVE_JW_FALSE HAVE_JW GKB_SUN_TRUE GKB_SUN_FALSE HAVE_LIBAPM NEED_LIBAPM HAVE_LIBAPM_TRUE HAVE_LIBAPM_FALSE NEED_LIBAPM_TRUE NEED_LIBAPM_FALSE BUILD_BATTSTAT_APPLET_TRUE BUILD_BATTSTAT_APPLET_FALSE MIXER_CFLAGS MIXER_LIBS APPLET_MIXER_TRUE APPLET_MIXER_FALSE GUCHARMAP_CFLAGS GUCHARMAP_LIBS APPLET_ACCESSX_TRUE APPLET_ACCESSX_FALSE APPLET_GSWITCHIT_TRUE APPLET_GSWITCHIT_FALSE SU_TOOL STB_SCRIPTS_DIR APPLET_MODEMLIGHTS_TRUE APPLET_MODEMLIGHTS_FALSE MODEMLIGHTS_LIBS CPUFREQ_SELECTOR_CFLAGS CPUFREQ_SELECTOR_LIBS BUILD_CPUFREQ_APPLET_TRUE BUILD_CPUFREQ_APPLET_FALSE BUILD_CPUFREQ_SELECTOR_TRUE BUILD_CPUFREQ_SELECTOR_FALSE CPUFREQ_SELECTOR_SUID_TRUE CPUFREQ_SELECTOR_SUID_FALSE ACLOCAL_AMFLAGS iconsdir pixmapsdir pkgdatadir gladedir GNOME_ICONDIR GNOME_PIXMAPSDIR GNOME_GLADEDIR DATADIR SYSCONFDIR LIBDIR PREFIX LIBOBJS LTLIBOBJS' -+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT INTLTOOL_DESKTOP_RULE INTLTOOL_DIRECTORY_RULE INTLTOOL_KEYS_RULE INTLTOOL_PROP_RULE INTLTOOL_OAF_RULE INTLTOOL_PONG_RULE INTLTOOL_SERVER_RULE INTLTOOL_SHEET_RULE INTLTOOL_SOUNDLIST_RULE INTLTOOL_UI_RULE INTLTOOL_XAM_RULE INTLTOOL_KBD_RULE INTLTOOL_XML_RULE INTLTOOL_XML_NOMERGE_RULE INTLTOOL_CAVES_RULE INTLTOOL_SCHEMAS_RULE INTLTOOL_THEME_RULE INTLTOOL_EXTRACT INTLTOOL_MERGE INTLTOOL_UPDATE INTLTOOL_PERL INTLTOOL_ICONV INTLTOOL_MSGFMT INTLTOOL_MSGMERGE INTLTOOL_XGETTEXT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP build build_cpu build_vendor build_os host host_cpu host_vendor host_os LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL PATH_TO_XRDB X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS WARN_CFLAGS PKG_CONFIG GAILUTIL_CFLAGS GAILUTIL_LIBS GNOME_APPLETS_CFLAGS GNOME_APPLETS_LIBS GNOME_LIBS2_CFLAGS GNOME_LIBS2_LIBS GNOME_VFS_APPLETS_CFLAGS GNOME_VFS_APPLETS_LIBS BUILD_GNOME_VFS_APPLETS_TRUE BUILD_GNOME_VFS_APPLETS_FALSE LIBGLADE_CFLAGS LIBGLADE_LIBS GDK_PIXBUF_CSOURCE GCONFTOOL GCONF_SCHEMA_CONFIG_SOURCE GCONF_SCHEMA_FILE_DIR GCONF_SCHEMAS_INSTALL_TRUE GCONF_SCHEMAS_INSTALL_FALSE XSLTPROC GTOP_APPLETS_CFLAGS GTOP_APPLETS_LIBS BUILD_GTOP_APPLETS_TRUE BUILD_GTOP_APPLETS_FALSE LIBXKLAVIER_CFLAGS LIBXKLAVIER_LIBS ENABLE_FLAGS_TRUE ENABLE_FLAGS_FALSE LIBWNCK_CFLAGS LIBWNCK_LIBS INCLUDE_GSWITCHIT_DEVEL_TRUE INCLUDE_GSWITCHIT_DEVEL_FALSE GETTEXT_PACKAGE GNOMELOCALEDIR USE_NLS MSGFMT GMSGFMT XGETTEXT CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLLIBS PO_IN_DATADIR_TRUE PO_IN_DATADIR_FALSE POFILES POSUB MKINSTALLDIRS gnomelocaledir SCROLLKEEPER_CONFIG SCROLLKEEPER_REQUIRED JW HAVE_JW_TRUE HAVE_JW_FALSE HAVE_JW GKB_SUN_TRUE GKB_SUN_FALSE ACPIINC HAVE_LIBAPM NEED_LIBAPM HAVE_LIBAPM_TRUE HAVE_LIBAPM_FALSE NEED_LIBAPM_TRUE NEED_LIBAPM_FALSE BUILD_BATTSTAT_APPLET_TRUE BUILD_BATTSTAT_APPLET_FALSE MIXER_CFLAGS MIXER_LIBS APPLET_MIXER_TRUE APPLET_MIXER_FALSE GUCHARMAP_CFLAGS GUCHARMAP_LIBS APPLET_ACCESSX_TRUE APPLET_ACCESSX_FALSE APPLET_GSWITCHIT_TRUE APPLET_GSWITCHIT_FALSE SU_TOOL STB_SCRIPTS_DIR APPLET_MODEMLIGHTS_TRUE APPLET_MODEMLIGHTS_FALSE MODEMLIGHTS_LIBS CPUFREQ_SELECTOR_CFLAGS CPUFREQ_SELECTOR_LIBS BUILD_CPUFREQ_APPLET_TRUE BUILD_CPUFREQ_APPLET_FALSE BUILD_CPUFREQ_SELECTOR_TRUE BUILD_CPUFREQ_SELECTOR_FALSE CPUFREQ_SELECTOR_SUID_TRUE CPUFREQ_SELECTOR_SUID_FALSE ACLOCAL_AMFLAGS iconsdir pixmapsdir pkgdatadir gladedir GNOME_ICONDIR GNOME_PIXMAPSDIR GNOME_GLADEDIR DATADIR SYSCONFDIR LIBDIR PREFIX LIBOBJS LTLIBOBJS' - ac_subst_files='' - - # Initialize some variables set by options. -@@ -23136,8 +23136,7 @@ +--- configure.orig Sat Jul 16 12:55:48 2005 ++++ configure Sat Jul 16 13:04:33 2005 +@@ -23272,8 +23272,7 @@ test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' @@ -19,30 +10,35 @@ GNOMELOCALEDIR="$ac_define_dir" -@@ -24838,6 +24837,7 @@ - - HAVE_LIBAPM=no - NEED_LIBAPM=no -+ACPIINC= - build_battstat_applet=no - - if test x$disable_battstat = xno; then -@@ -24989,7 +24989,12 @@ +@@ -25126,7 +25125,7 @@ ;; # list of supported OS cores that do not use libapm -- *-*-freebsd*|*-*-netbsd*|*-*-openbsd*) +- i386-*-freebsd*|*-*-netbsd*|*-*-openbsd*) + i386-*-freebsd*|amd64-*-freebsd*|*-*-netbsd*|*-*-openbsd*) -+ if [ -n "${FREEBSD_SYS}" ]; then -+ ACPIINC="-I${FREEBSD_SYS}" -+ else -+ ACPIINC="-I/usr/src/sys" -+ fi - ;; - *) - echo "warning: ${host} is not supported by battstat_applet, not building" >&2 -@@ -25795,6 +25800,9 @@ - *linux*) + if -n "${OS_SYS}" ; then + ACPIINC="-I${OS_SYS}" + else +@@ -25406,7 +25405,7 @@ + APPLET_MIXER_FALSE= + fi + +-if test x"$P_MIXER" == x"mixer"; then ++if test x"$P_MIXER" = x"mixer"; then + echo "$as_me:$LINENO: result: yes" >&5 + echo "${ECHO_T}yes" >&6 + else +@@ -25983,7 +25982,7 @@ + fi + + +-if test "x$SU_TOOL" == "x" -o "x$HAVE_LIBUTIL" != "xtrue" -o "x$P_MODEMLIGHTS" != "xmodemlights"; then ++if test "x$SU_TOOL" = "x" -o "x$HAVE_LIBUTIL" != "xtrue" -o "x$P_MODEMLIGHTS" != "xmodemlights"; then + { echo "$as_me:$LINENO: WARNING: *** \`modemlights' applet will not be built ***" >&5 + echo "$as_me: WARNING: *** \`modemlights' applet will not be built ***" >&2;} + else +@@ -26119,6 +26118,9 @@ + echo "${ECHO_T}yes" >&6 build_cpufreq_applet=yes ;; + i386-*-freebsd*|amd64-*-freebsd*) @@ -51,7 +47,7 @@ *) echo "warning: ${host} is not supported by cpufreq applet, not building" >&2 build_cpufreq_applet=no -@@ -26085,7 +26093,7 @@ +@@ -26409,7 +26411,7 @@ ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}" @@ -60,7 +56,7 @@ pixmapsdir="${datadir}/pixmaps" -@@ -26099,8 +26107,7 @@ +@@ -26423,8 +26425,7 @@ test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' @@ -70,7 +66,7 @@ GNOME_ICONDIR="$ac_define_dir" -@@ -26112,8 +26119,7 @@ +@@ -26436,8 +26437,7 @@ test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' @@ -80,7 +76,7 @@ GNOME_PIXMAPSDIR="$ac_define_dir" -@@ -26125,8 +26131,7 @@ +@@ -26449,8 +26449,7 @@ test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' @@ -90,7 +86,7 @@ GNOME_GLADEDIR="$ac_define_dir" -@@ -26138,8 +26143,7 @@ +@@ -26462,8 +26461,7 @@ test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' @@ -100,7 +96,7 @@ DATADIR="$ac_define_dir" -@@ -26151,8 +26155,7 @@ +@@ -26475,8 +26473,7 @@ test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' @@ -110,7 +106,7 @@ SYSCONFDIR="$ac_define_dir" -@@ -26164,8 +26167,7 @@ +@@ -26488,8 +26485,7 @@ test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' @@ -120,7 +116,7 @@ LIBDIR="$ac_define_dir" -@@ -26177,8 +26179,7 @@ +@@ -26501,8 +26497,7 @@ test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' @@ -130,11 +126,3 @@ PREFIX="$ac_define_dir" -@@ -27311,6 +27312,7 @@ - s,@GKB_SUN_FALSE@,$GKB_SUN_FALSE,;t t - s,@HAVE_LIBAPM@,$HAVE_LIBAPM,;t t - s,@NEED_LIBAPM@,$NEED_LIBAPM,;t t -+s,@ACPIINC@,$ACPIINC,;t t - s,@HAVE_LIBAPM_TRUE@,$HAVE_LIBAPM_TRUE,;t t - s,@HAVE_LIBAPM_FALSE@,$HAVE_LIBAPM_FALSE,;t t - s,@NEED_LIBAPM_TRUE@,$NEED_LIBAPM_TRUE,;t t diff --git a/x11/gnome-applets/files/patch-battstat-acpi b/x11/gnome-applets/files/patch-battstat-acpi deleted file mode 100644 index 903e8b951d11..000000000000 --- a/x11/gnome-applets/files/patch-battstat-acpi +++ /dev/null @@ -1,576 +0,0 @@ ---- battstat/Makefile.in.orig Mon Jan 24 20:20:49 2005 -+++ battstat/Makefile.in Mon Jan 24 20:22:02 2005 -@@ -55,9 +55,10 @@ - PROGRAMS = $(libexec_PROGRAMS) - am_battstat_applet_2_OBJECTS = properties.$(OBJEXT) \ - battstat_applet.$(OBJEXT) power-management.$(OBJEXT) \ -- acpi-linux.$(OBJEXT) -+ acpi-freebsd.$(OBJEXT) acpi-linux.$(OBJEXT) - battstat_applet_2_OBJECTS = $(am_battstat_applet_2_OBJECTS) - am__DEPENDENCIES_1 = -+ACPIINC = @ACPIINC@ - @HAVE_LIBAPM_FALSE@@NEED_LIBAPM_TRUE@am__DEPENDENCIES_2 = \ - @HAVE_LIBAPM_FALSE@@NEED_LIBAPM_TRUE@ apmlib/libapm.a - battstat_applet_2_DEPENDENCIES = $(am__DEPENDENCIES_1) \ -@@ -66,6 +67,7 @@ - depcomp = $(SHELL) $(top_srcdir)/depcomp - am__depfiles_maybe = depfiles - @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/acpi-linux.Po \ -+@AMDEP_TRUE@ ./$(DEPDIR)/acpi-freebsd.Po \ - @AMDEP_TRUE@ ./$(DEPDIR)/battstat_applet.Po \ - @AMDEP_TRUE@ ./$(DEPDIR)/power-management.Po \ - @AMDEP_TRUE@ ./$(DEPDIR)/properties.Po -@@ -336,6 +338,7 @@ - $(GNOME_APPLETS_CFLAGS) \ - $(LIBGLADE_CFLAGS) \ - $(APMINC) \ -+ $(ACPIINC) \ - -DG_LOG_DOMAIN=\"battstat_applet\" - - battstat_applet_2_SOURCES = \ -@@ -345,7 +348,9 @@ - battstat_applet.c \ - power-management.c \ - acpi-linux.c \ -- acpi-linux.h -+ acpi-linux.h \ -+ acpi-freebsd.c \ -+ acpi-freebsd.h - - battstat_applet_2_LDADD = \ - $(GNOME_APPLETS_LIBS) \ -@@ -439,6 +444,7 @@ - -rm -f *.tab.c - - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acpi-linux.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acpi-freebsd.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/battstat_applet.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/power-management.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/properties.Po@am__quote@ ---- battstat/battstat_applet.c.orig Mon Jan 24 12:51:51 2005 -+++ battstat/battstat_applet.c Mon Jan 24 20:20:50 2005 -@@ -953,6 +953,7 @@ - "Seth Nickell <snickell@stanford.edu> (GNOME2 port)", - "Davyd Madeley <davyd@madeley.id.au>", - "Ryan Lortie <desrt@desrt.ca>", -+ "Joe Marcus Clarke <marcus@FreeBSD.org> (FreeBSD ACPI support)", - NULL - }; - ---- battstat/properties.c.orig Fri Jan 14 23:38:18 2005 -+++ battstat/properties.c Mon Mar 14 19:49:26 2005 -@@ -27,7 +27,7 @@ - - #include <stdio.h> - --#ifdef __FreeBSD__ -+#if defined(__FreeBSD__) && defined(__i386__) - #include <machine/apm_bios.h> - #elif defined(__NetBSD__) || defined(__OpenBSD__) - #include <sys/param.h> -@@ -61,6 +61,9 @@ - #include <panel-applet-gconf.h> - /*#include <status-docklet.h>*/ - -+#if defined(__FreeBSD__) && !defined(__i386__) -+#include "acpi-freebsd.h" -+#endif - #include "battstat.h" - - #ifndef gettext_noop ---- battstat/acpi-freebsd.c.orig Sun Jul 3 16:00:01 2005 -+++ battstat/acpi-freebsd.c Sun Jul 3 16:23:26 2005 -@@ -0,0 +1,280 @@ -+/* battstat A GNOME battery meter for laptops. -+ * Copyright (C) 2000 by Jörgen Pehrson <jp@spektr.eu.org> -+ * -+ * 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 -+ * (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 -+ * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. -+ * -+ $Id: patch-battstat-acpi,v 1.13 2005/02/28 08:02:03 marcus Exp $ -+ */ -+ -+/* -+ * ACPI battery functions for FreeBSD >= 5.2. -+ * September 2004 by Joe Marcus Clarke <marcus@FreeBSD.org> -+ */ -+ -+#ifdef HAVE_CONFIG_H -+#include <config.h> -+#endif -+ -+#ifdef __FreeBSD__ -+ -+#include <stdio.h> -+#include <sys/types.h> -+#include <sys/socket.h> -+#include <sys/sysctl.h> -+#include <sys/un.h> -+#include <sys/ioctl.h> -+#if defined(__i386__) -+#include <machine/apm_bios.h> -+#endif -+#include <stdlib.h> -+#include <errno.h> -+#include <unistd.h> -+#include <fcntl.h> -+#include <glib.h> -+ -+#include <dev/acpica/acpiio.h> -+ -+#include "acpi-freebsd.h" -+ -+static gboolean -+update_ac_info(struct acpi_info * acpiinfo) -+{ -+ int acline; -+ size_t len = sizeof(acline); -+ -+ acpiinfo->ac_online = FALSE; -+ -+ if (sysctlbyname(ACPI_ACLINE, &acline, &len, NULL, 0) == -1) { -+ return FALSE; -+ } -+ -+ acpiinfo->ac_online = acline ? TRUE : FALSE; -+ -+ return TRUE; -+} -+ -+static gboolean -+update_battery_info(struct acpi_info * acpiinfo) -+{ -+ union acpi_battery_ioctl_arg battio; -+ int i; -+ -+ /* We really don't have to do this here. All of the relevant battery -+ * info can be obtained through sysctl. However, one day, the rate -+ * may be useful to get time left to full charge. -+ */ -+ -+ for(i = BATT_MIN; i < BATT_MAX; i++) { -+ battio.unit = i; -+ if (ioctl(acpiinfo->acpifd, ACPIIO_CMBAT_GET_BIF, &battio) == -1) { -+ continue; -+ } -+ -+ acpiinfo->max_capacity += battio.bif.lfcap; -+ acpiinfo->low_capacity += battio.bif.wcap; -+ acpiinfo->critical_capacity += battio.bif.lcap; -+ } -+ -+ return TRUE; -+} -+ -+gboolean -+acpi_freebsd_init(struct acpi_info * acpiinfo) -+{ -+ int acpi_fd; -+ int event_fd; -+ -+ g_assert(acpiinfo); -+ -+ if (acpiinfo->acpifd == -1) { -+ acpi_fd = open(ACPIDEV, O_RDONLY); -+ if (acpi_fd >= 0) { -+ acpiinfo->acpifd = acpi_fd; -+ } -+ else { -+ acpiinfo->acpifd = -1; -+ return FALSE; -+ } -+ } -+ -+ event_fd = socket(PF_UNIX, SOCK_STREAM, 0); -+ if (event_fd >= 0) { -+ struct sockaddr_un addr; -+ addr.sun_family = AF_UNIX; -+ strcpy(addr.sun_path, "/var/run/devd.pipe"); -+ if (connect(event_fd, (struct sockaddr *) &addr, sizeof(addr)) == 0) { -+ acpiinfo->event_fd = event_fd; -+ acpiinfo->event_inited = TRUE; -+ acpiinfo->channel = g_io_channel_unix_new(event_fd); -+ } -+ else { -+ close(event_fd); -+ acpiinfo->event_fd = -1; -+ acpiinfo->event_inited = FALSE; -+ } -+ } -+ -+ update_battery_info(acpiinfo); -+ update_ac_info(acpiinfo); -+ -+ return TRUE; -+} -+ -+#define ACPI_EVENT_IGNORE 0 -+#define ACPI_EVENT_AC 1 -+#define ACPI_EVENT_BATTERY_INFO 2 -+ -+static int parse_acpi_event(GString *buffer) -+{ -+ if (strstr(buffer->str, "system=ACPI")) { -+ if (strstr(buffer->str, "subsystem=ACAD")) -+ return ACPI_EVENT_AC; -+ if (strstr(buffer->str, "subsystem=CMBAT")) -+ return ACPI_EVENT_BATTERY_INFO; -+ } -+ -+ return ACPI_EVENT_IGNORE; -+} -+ -+void acpi_freebsd_update(struct acpi_info *acpiinfo) -+{ -+ /* XXX This is needed for systems where devd does not have permissions -+ * to allow for event-driven updates. -+ */ -+ update_ac_info(acpiinfo); -+ update_battery_info(acpiinfo); -+} -+ -+gboolean acpi_process_event(struct acpi_info *acpiinfo, gboolean *read_error) -+{ -+ gsize i; -+ int evt; -+ gboolean result = FALSE; -+ GString *buffer; -+ GIOStatus stat; -+ buffer = g_string_new(NULL); -+ -+ *read_error = FALSE; -+ stat = g_io_channel_read_line_string(acpiinfo->channel, buffer, &i, NULL); -+ -+ if (stat == G_IO_STATUS_ERROR || stat == G_IO_STATUS_EOF) { -+ *read_error = TRUE; -+ g_string_free(buffer, TRUE); -+ return FALSE; -+ } -+ -+ evt = parse_acpi_event(buffer); -+ switch (evt) { -+ case ACPI_EVENT_AC: -+ update_ac_info(acpiinfo); -+ result = TRUE; -+ break; -+ case ACPI_EVENT_BATTERY_INFO: -+ update_battery_info(acpiinfo); -+ result = TRUE; -+ break; -+ } -+ -+ g_string_free(buffer, TRUE); -+ return result; -+} -+ -+void -+acpi_freebsd_cleanup(struct acpi_info * acpiinfo) -+{ -+ g_assert(acpiinfo); -+ -+ if (acpiinfo->acpifd >= 0) { -+ close(acpiinfo->acpifd); -+ acpiinfo->acpifd = -1; -+ } -+ -+ if (acpiinfo->event_fd >= 0) { -+ g_io_channel_unref(acpiinfo->channel); -+ close(acpiinfo->event_fd); -+ acpiinfo->event_fd = -1; -+ } -+} -+ -+gboolean -+acpi_freebsd_read(struct apm_info *apminfo, struct acpi_info * acpiinfo) -+{ -+ int time; -+ int life; -+ int acline; -+ int state; -+ size_t len; -+ int rate; -+ int remain; -+ union acpi_battery_ioctl_arg battio; -+ gboolean charging; -+ int i; -+ -+ g_assert(acpiinfo); -+ -+ charging = FALSE; -+ -+ for(i = BATT_MIN; i < BATT_MAX; i++) { -+ battio.unit = i; -+ if (ioctl(acpiinfo->acpifd, ACPIIO_CMBAT_GET_BST, &battio) == -1) { -+ continue; -+ } -+ -+ remain += battio.bst.cap; -+ rate += battio.bst.rate; -+ } -+ -+ len = sizeof(time); -+ if (sysctlbyname(ACPI_TIME, &time, &len, NULL, 0) == -1) { -+ return FALSE; -+ } -+ -+ len = sizeof(life); -+ if (sysctlbyname(ACPI_LIFE, &life, &len, NULL, 0) == -1) { -+ return FALSE; -+ } -+ -+ len = sizeof(state); -+ if (sysctlbyname(ACPI_STATE, &state, &len, NULL, 0) == -1) { -+ return FALSE; -+ } -+ -+ apminfo->ai_acline = acpiinfo->ac_online ? 1 : 0; -+ if (state & ACPI_BATT_STAT_CHARGING) { -+ apminfo->ai_batt_stat = 3; -+ charging = TRUE; -+ } -+ else if (state & ACPI_BATT_STAT_CRITICAL) { -+ /* Add a special check here since FreeBSD's ACPI interface will tell us -+ * when the battery is critical. -+ */ -+ apminfo->ai_batt_stat = 2; -+ } -+ else { -+ apminfo->ai_batt_stat = remain < acpiinfo->low_capacity ? 1 : remain < acpiinfo->critical_capacity ? 2 : 0; -+ } -+ apminfo->ai_batt_life = life; -+ if (!charging) { -+ apminfo->ai_batt_time = time; -+ } -+ else if (charging && rate > 0) { -+ apminfo->ai_batt_time = (int) ((acpiinfo->max_capacity-remain)/(float)rate); -+ } -+ else -+ apminfo->ai_batt_time = -1; -+ -+ return TRUE; -+} -+#endif ---- battstat/acpi-freebsd.h.orig Sun Jul 3 16:00:01 2005 -+++ battstat/acpi-freebsd.h Sun Jul 3 16:23:56 2005 -@@ -0,0 +1,60 @@ -+/* -+ * Copyright (C) 2004 by Joe Marcus Clarke <marcus@FreeBSD.org> -+ * -+ * 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 -+ * (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 -+ * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. -+ */ -+ -+#ifndef __ACPI_FREEBSD_H__ -+#define __ACPI_FREEBSD_H__ -+ -+#define ACPIDEV "/dev/acpi" -+ -+#define BATT_MIN 0 -+#define BATT_MAX 64 -+ -+#define ACPI_ACLINE "hw.acpi.acline" -+#define ACPI_TIME "hw.acpi.battery.time" -+#define ACPI_LIFE "hw.acpi.battery.life" -+#define ACPI_STATE "hw.acpi.battery.state" -+ -+/* XXX: AMD64 does not have machine/apm_bios.h. */ -+#if !defined(__i386__) -+struct apm_info { -+ guint ai_acline; -+ guint ai_batt_stat; -+ guint ai_batt_life; -+ int ai_batt_time; -+ guint ai_status; -+}; -+#endif -+ -+struct acpi_info { -+ gboolean ac_online; -+ gboolean event_inited; -+ int acpifd; -+ int event_fd; -+ int max_capacity; -+ int low_capacity; -+ int critical_capacity; -+ GIOChannel * channel; -+}; -+ -+gboolean acpi_freebsd_read(struct apm_info *apminfo, struct acpi_info * acpiinfo); -+void acpi_freebsd_update(struct acpi_info * acpiinfo); -+gboolean acpi_process_event(struct acpi_info * acpiinfo, gboolean *read_error); -+gboolean acpi_freebsd_init(struct acpi_info * acpiinfo); -+void acpi_freebsd_cleanup(struct acpi_info * acpiinfo); -+ -+#endif /* __ACPI_FREEBSD_H__ */ ---- battstat/power-management.c.orig Sun Mar 20 05:20:55 2005 -+++ battstat/power-management.c Sun Jul 3 16:21:42 2005 -@@ -73,12 +73,42 @@ static int pm_initialised; - * the problem might be. This error message is not to be freed. - */ - --#ifdef __FreeBSD__ -- -+#if defined(__FreeBSD__) -+#if defined(__i386__) - #include <machine/apm_bios.h> -+#endif -+#include "acpi-freebsd.h" -+ -+static struct acpi_info acpiinfo; -+static gboolean using_acpi; -+static int acpi_count; -+static int acpiwatch; -+static struct apm_info apminfo; -+ -+gboolean acpi_freebsd_read(struct apm_info *apminfo, struct acpi_info *acpiinfo); - - #define APMDEVICE "/dev/apm" - -+static gboolean acpi_callback (GIOChannel * chan, GIOCondition cond, gpointer data) -+{ -+ gboolean read_error; -+ -+ if (cond & (G_IO_ERR | G_IO_HUP)) { -+ acpi_freebsd_cleanup(&acpiinfo); -+ return FALSE; -+ } -+ -+ if (acpi_process_event(&acpiinfo, &read_error)) { -+ acpi_freebsd_read(&apminfo, &acpiinfo); -+ } -+ else if (read_error) { -+ acpi_freebsd_cleanup(&acpiinfo); -+ return FALSE; -+ } -+ -+ return TRUE; -+} -+ - static const char * - apm_readinfo (BatteryStatus *status) - { -@@ -86,32 +116,56 @@ apm_readinfo (BatteryStatus *status) - FreeBSD. Each time this functions is called (once every second) - the APM device is opened, read from and then closed. - */ -- struct apm_info apminfo; - int fd; - - if (DEBUG) g_print("apm_readinfo() (FreeBSD)\n"); - -- fd = open(APMDEVICE, O_RDONLY); -- if (fd == -1) -- { -- pm_initialised = 0; -- return ERR_OPEN_APMDEV; -+ if (using_acpi && (!acpiinfo.event_inited || acpiinfo.event_fd >= 0)) { -+ if (acpi_count <= 0) { -+ acpi_count = 30; -+ if (!acpiinfo.event_inited) { -+ acpi_freebsd_update(&acpiinfo); -+ } -+ acpi_freebsd_read(&apminfo, &acpiinfo); -+ } -+ acpi_count--; -+ } -+ else if (using_acpi && acpiinfo.event_inited) { -+ if (acpi_freebsd_init(&acpiinfo)) { -+ acpiwatch = g_io_add_watch (acpiinfo.channel, -+ G_IO_IN | G_IO_ERR | G_IO_HUP, -+ acpi_callback, NULL); -+ acpi_freebsd_read(&apminfo, &acpiinfo); -+ } - } -+ else { -+#if defined(__i386__) -+ fd = open(APMDEVICE, O_RDONLY); -+ if (fd == -1) { -+ return ERR_OPEN_APMDEV; -+ } - -- if (ioctl(fd, APMIO_GETINFO, &apminfo) == -1) -- err(1, "ioctl(APMIO_GETINFO)"); -+ if (ioctl(fd, APMIO_GETINFO, &apminfo) == -1) -+ err(1, "ioctl(APMIO_GETINFO)"); - -- close(fd); -+ close(fd); - -- if(apminfo.ai_status == 0) -- return ERR_APM_E; -+ if(apminfo.ai_status == 0) -+ return ERR_APM_E; -+#else -+ return ERR_OPEN_APMDEV; -+#endif -+ } - - status->present = TRUE; - status->on_ac_power = apminfo.ai_acline ? 1 : 0; - status->state = apminfo.ai_batt_stat; - status->percent = apminfo.ai_batt_life; - status->charging = (status->state == 3) ? TRUE : FALSE; -- status->minutes = apminfo.ai_batt_time; -+ if (using_acpi) -+ status->minutes = apminfo.ai_batt_time; -+ else -+ status->minutes = (int) (apminfo.ai_batt_time/60.0); - - return NULL; - } -@@ -339,6 +393,19 @@ power_management_initialise( void ) - G_IO_IN | G_IO_ERR | G_IO_HUP, - acpi_callback, NULL); - } -+#elif defined(__FreeBSD__) -+ if (acpi_freebsd_init(&acpiinfo)) { -+ using_acpi = TRUE; -+ acpi_count = 0; -+ } -+ else -+ using_acpi = FALSE; -+ -+ if (using_acpi && acpiinfo.event_fd >= 0) { -+ acpiwatch = g_io_add_watch (acpiinfo.channel, -+ G_IO_IN | G_IO_ERR | G_IO_HUP, -+ acpi_callback, NULL); -+ } - #endif - pm_initialised = 1; - -@@ -360,6 +427,13 @@ power_management_cleanup( void ) - g_source_remove(acpiwatch); - acpiwatch = 0; - acpi_linux_cleanup(&acpiinfo); -+ } -+#elif defined(__FreeBSD__) -+ if (using_acpi) { -+ if (acpiwatch != 0) -+ g_source_remove(acpiwatch); -+ acpiwatch = 0; -+ acpi_freebsd_cleanup(&acpiinfo); - } - #endif - diff --git a/x11/gnome-applets/files/patch-battstat_acpi-freebsd.c b/x11/gnome-applets/files/patch-battstat_acpi-freebsd.c new file mode 100644 index 000000000000..48746fa03bbd --- /dev/null +++ b/x11/gnome-applets/files/patch-battstat_acpi-freebsd.c @@ -0,0 +1,152 @@ +--- battstat/acpi-freebsd.c.orig Sun Jul 3 16:41:26 2005 ++++ battstat/acpi-freebsd.c Sun Jul 3 16:49:55 2005 +@@ -31,9 +31,13 @@ + + #include <stdio.h> + #include <sys/types.h> ++#include <sys/socket.h> + #include <sys/sysctl.h> ++#include <sys/un.h> + #include <sys/ioctl.h> ++#if defined(__i386__) + #include <machine/apm_bios.h> ++#endif + #include <stdlib.h> + #include <errno.h> + #include <unistd.h> +@@ -92,16 +96,36 @@ gboolean + acpi_freebsd_init(struct acpi_info * acpiinfo) + { + int acpi_fd; ++ int event_fd; + + g_assert(acpiinfo); + +- acpi_fd = open(ACPIDEV, O_RDONLY); +- if (acpi_fd >= 0) { +- acpiinfo->acpifd = acpi_fd; ++ if (acpiinfo->acpifd == -1) { ++ acpi_fd = open(ACPIDEV, O_RDONLY); ++ if (acpi_fd >= 0) { ++ acpiinfo->acpifd = acpi_fd; ++ } ++ else { ++ acpiinfo->acpifd = -1; ++ return FALSE; ++ } + } +- else { +- acpiinfo->acpifd = -1; +- return FALSE; ++ ++ event_fd = socket(PF_UNIX, SOCK_STREAM, 0); ++ if (event_fd >= 0) { ++ struct sockaddr_un addr; ++ addr.sun_family = AF_UNIX; ++ strcpy(addr.sun_path, "/var/run/devd.pipe"); ++ if (connect(event_fd, (struct sockaddr *) &addr, sizeof(addr)) == 0) { ++ acpiinfo->event_fd = event_fd; ++ acpiinfo->event_inited = TRUE; ++ acpiinfo->channel = g_io_channel_unix_new(event_fd); ++ } ++ else { ++ close(event_fd); ++ acpiinfo->event_fd = -1; ++ acpiinfo->event_inited = FALSE; ++ } + } + + update_battery_info(acpiinfo); +@@ -110,6 +134,65 @@ acpi_freebsd_init(struct acpi_info * acp + return TRUE; + } + ++#define ACPI_EVENT_IGNORE 0 ++#define ACPI_EVENT_AC 1 ++#define ACPI_EVENT_BATTERY_INFO 2 ++ ++static int parse_acpi_event(GString *buffer) ++{ ++ if (strstr(buffer->str, "system=ACPI")) { ++ if (strstr(buffer->str, "subsystem=ACAD")) ++ return ACPI_EVENT_AC; ++ if (strstr(buffer->str, "subsystem=CMBAT")) ++ return ACPI_EVENT_BATTERY_INFO; ++ } ++ ++ return ACPI_EVENT_IGNORE; ++} ++ ++void acpi_freebsd_update(struct acpi_info *acpiinfo) ++{ ++ /* XXX This is needed for systems where devd does not have permissions ++ * to allow for event-driven updates. ++ */ ++ update_ac_info(acpiinfo); ++ update_battery_info(acpiinfo); ++} ++ ++gboolean acpi_process_event(struct acpi_info *acpiinfo, gboolean *read_error) ++{ ++ gsize i; ++ int evt; ++ gboolean result = FALSE; ++ GString *buffer; ++ GIOStatus stat; ++ buffer = g_string_new(NULL); ++ ++ *read_error = FALSE; ++ stat = g_io_channel_read_line_string(acpiinfo->channel, buffer, &i, NULL); ++ ++ if (stat == G_IO_STATUS_ERROR || stat == G_IO_STATUS_EOF) { ++ *read_error = TRUE; ++ g_string_free(buffer, TRUE); ++ return FALSE; ++ } ++ ++ evt = parse_acpi_event(buffer); ++ switch (evt) { ++ case ACPI_EVENT_AC: ++ update_ac_info(acpiinfo); ++ result = TRUE; ++ break; ++ case ACPI_EVENT_BATTERY_INFO: ++ update_battery_info(acpiinfo); ++ result = TRUE; ++ break; ++ } ++ ++ g_string_free(buffer, TRUE); ++ return result; ++} ++ + void + acpi_freebsd_cleanup(struct acpi_info * acpiinfo) + { +@@ -119,21 +202,12 @@ acpi_freebsd_cleanup(struct acpi_info * + close(acpiinfo->acpifd); + acpiinfo->acpifd = -1; + } +-} + +-/* XXX This is a hack since user-land applications can't get ACPI events yet. +- * Devd provides this (or supposedly provides this), but you need to be +- * root to access devd. +- */ +-gboolean +-acpi_process_event(struct acpi_info * acpiinfo) +-{ +- g_assert(acpiinfo); +- +- update_ac_info(acpiinfo); +- update_battery_info(acpiinfo); +- +- return TRUE; ++ if (acpiinfo->event_fd >= 0) { ++ g_io_channel_unref(acpiinfo->channel); ++ close(acpiinfo->event_fd); ++ acpiinfo->event_fd = -1; ++ } + } + + gboolean diff --git a/x11/gnome-applets/files/patch-battstat_acpi-freebsd.h b/x11/gnome-applets/files/patch-battstat_acpi-freebsd.h new file mode 100644 index 000000000000..918cd59eb241 --- /dev/null +++ b/x11/gnome-applets/files/patch-battstat_acpi-freebsd.h @@ -0,0 +1,78 @@ +--- battstat/acpi-freebsd.h.orig Sun Jul 3 16:50:22 2005 ++++ battstat/acpi-freebsd.h Sun Jul 3 16:54:14 2005 +@@ -29,61 +29,31 @@ + #define ACPI_LIFE "hw.acpi.battery.life" + #define ACPI_STATE "hw.acpi.battery.state" + +-struct acpi_info { +- gboolean ac_online; +- int acpifd; +- int max_capacity; +- int low_capacity; +- int critical_capacity; ++/* XXX: AMD64 does not have machine/apm_bios.h. */ ++#if !defined(__i386__) ++struct apm_info { ++ guint ai_acline; ++ guint ai_batt_stat; ++ guint ai_batt_life; ++ int ai_batt_time; ++ guint ai_status; + }; +- +-gboolean acpi_freebsd_read(struct apm_info *apminfo, struct acpi_info * acpiinfo); +-gboolean acpi_process_event(struct acpi_info * acpiinfo); +-gboolean acpi_freebsd_init(struct acpi_info * acpiinfo); +-void acpi_freebsd_cleanup(struct acpi_info * acpiinfo); +- +-#endif /* __ACPI_FREEBSD_H__ */ +-/* +- * Copyright (C) 2004 by Joe Marcus Clarke <marcus@FreeBSD.org> +- * +- * 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 +- * (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 +- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. +- */ +- +-#ifndef __ACPI_FREEBSD_H__ +-#define __ACPI_FREEBSD_H__ +- +-#define ACPIDEV "/dev/acpi" +- +-#define BATT_MIN 0 +-#define BATT_MAX 64 +- +-#define ACPI_ACLINE "hw.acpi.acline" +-#define ACPI_TIME "hw.acpi.battery.time" +-#define ACPI_LIFE "hw.acpi.battery.life" +-#define ACPI_STATE "hw.acpi.battery.state" ++#endif + + struct acpi_info { + gboolean ac_online; ++ gboolean event_inited; + int acpifd; ++ int event_fd; + int max_capacity; + int low_capacity; + int critical_capacity; ++ GIOChannel * channel; + }; + + gboolean acpi_freebsd_read(struct apm_info *apminfo, struct acpi_info * acpiinfo); +-gboolean acpi_process_event(struct acpi_info * acpiinfo); ++void acpi_freebsd_update(struct acpi_info * acpiinfo); ++gboolean acpi_process_event(struct acpi_info * acpiinfo, gboolean *read_error); + gboolean acpi_freebsd_init(struct acpi_info * acpiinfo); + void acpi_freebsd_cleanup(struct acpi_info * acpiinfo); + diff --git a/x11/gnome-applets/files/patch-battstat_battstat.schemas.in b/x11/gnome-applets/files/patch-battstat_battstat.schemas.in deleted file mode 100644 index a6bed2361540..000000000000 --- a/x11/gnome-applets/files/patch-battstat_battstat.schemas.in +++ /dev/null @@ -1,11 +0,0 @@ ---- battstat/battstat.schemas.in.orig Fri Oct 1 16:22:39 2004 -+++ battstat/battstat.schemas.in Fri Oct 1 16:22:46 2004 -@@ -115,7 +115,7 @@ - <key>/schemas/apps/battstat-applet/prefs/suspend_command</key> - <owner>battstat-applet</owner> - <type>string</type> -- <default>/usr/bin/apm -s</default> -+ <default>/usr/sbin/zzz</default> - <locale name="C"> - <short>Suspend Command</short> - <long>Command to send to suspend the computer</long> diff --git a/x11/gnome-applets/files/patch-battstat_battstat_applet.c b/x11/gnome-applets/files/patch-battstat_battstat_applet.c new file mode 100644 index 000000000000..a95b7b569a09 --- /dev/null +++ b/x11/gnome-applets/files/patch-battstat_battstat_applet.c @@ -0,0 +1,21 @@ +--- battstat/battstat_applet.c.orig Fri Aug 19 22:13:49 2005 ++++ battstat/battstat_applet.c Tue Aug 23 20:37:13 2005 +@@ -430,14 +430,14 @@ battery_full_notify (GtkWidget *applet) + static void + battery_full_dialog (GtkWidget *applet) + { +- /* first attempt to use libnotify */ +- if (battery_full_notify (applet)) +- return; +- + GtkWidget *dialog, *hbox, *image, *label; + GdkPixbuf *pixbuf; + + gchar *new_label; ++ /* first attempt to use libnotify */ ++ if (battery_full_notify (applet)) ++ return; ++ + dialog = gtk_dialog_new_with_buttons ( + _("Battery Notice"), + NULL, diff --git a/x11/gnome-applets/files/patch-battstat_power-management.c b/x11/gnome-applets/files/patch-battstat_power-management.c new file mode 100644 index 000000000000..9cea2d65b8fb --- /dev/null +++ b/x11/gnome-applets/files/patch-battstat_power-management.c @@ -0,0 +1,123 @@ +--- battstat/power-management.c.orig Thu Aug 25 23:45:47 2005 ++++ battstat/power-management.c Tue Aug 30 01:28:40 2005 +@@ -61,9 +61,7 @@ + + static const char *apm_readinfo (BatteryStatus *status); + static int pm_initialised; +-#ifdef HAVE_HAL +-static int using_hal; +-#endif ++static int using_hal = FALSE; + + /* + * What follows is a series of platform-specific apm_readinfo functions +@@ -173,16 +171,40 @@ apm_readinfo (BatteryStatus *status) + + #elif __FreeBSD__ + ++#if defined(__i386__) + #include <machine/apm_bios.h> ++#endif + #include "acpi-freebsd.h" + + static struct acpi_info acpiinfo; + static gboolean using_acpi; + static int acpi_count; ++static int acpiwatch; + static struct apm_info apminfo; + ++gboolean acpi_freebsd_read(struct apm_info *apminfo, struct acpi_info *acpiinfo); ++ + #define APMDEVICE "/dev/apm" + ++static gboolean acpi_callback (GIOChannel * chan, GIOCondition cond, gpointer data) ++{ ++ gboolean read_error; ++ if (cond & (G_IO_ERR | G_IO_HUP)) { ++ acpi_freebsd_cleanup(&acpiinfo); ++ return FALSE; ++ } ++ ++ if (acpi_process_event(&acpiinfo, &read_error)) { ++ acpi_freebsd_read(&apminfo, &acpiinfo); ++ } ++ else if (read_error) { ++ acpi_freebsd_cleanup(&acpiinfo); ++ return FALSE; ++ } ++ ++ return TRUE; ++} ++ + static const char * + apm_readinfo (BatteryStatus *status) + { +@@ -190,21 +212,27 @@ apm_readinfo (BatteryStatus *status) + + if (DEBUG) g_print("apm_readinfo() (FreeBSD)\n"); + +- if (using_acpi) { ++ if (using_acpi && (!acpiinfo.event_inited || acpiinfo.event_fd >= 0)) { + if (acpi_count <= 0) { + acpi_count = 30; +- acpi_process_event(&acpiinfo); ++ if (!acpiinfo.event_inited) { ++ acpi_freebsd_update(&acpiinfo); ++ } + if (acpi_freebsd_read(&apminfo, &acpiinfo) == FALSE) + return ERR_FREEBSD_ACPI; + } + acpi_count--; + } +- else +- { +- /* This is how I read the information from the APM subsystem under +- FreeBSD. Each time this functions is called (once every second) +- the APM device is opened, read from and then closed. +- */ ++ else if (using_acpi && acpiinfo.event_inited) { ++ if (acpi_freebsd_init(&acpiinfo)) { ++ acpiwatch = g_io_add_watch (acpiinfo.channel, ++ G_IO_IN | G_IO_ERR | G_IO_HUP, ++ acpi_callback, NULL); ++ acpi_freebsd_read(&apminfo, &acpiinfo); ++ } ++ } ++ else { ++#if defined(__i386__) + fd = open(APMDEVICE, O_RDONLY); + if (fd == -1) { + return ERR_OPEN_APMDEV; +@@ -217,6 +245,9 @@ apm_readinfo (BatteryStatus *status) + + if(apminfo.ai_status == 0) + return ERR_APM_E; ++#else ++ return ERR_OPEN_APMDEV; ++#endif + } + + status->present = TRUE; +@@ -480,6 +511,12 @@ power_management_initialise( int no_hal + } + else + using_acpi = FALSE; ++ ++ if (using_acpi && acpiinfo.event_fd >= 0) { ++ acpiwatch = g_io_add_watch (acpiinfo.channel, ++ G_IO_IN | G_IO_ERR | G_IO_HUP, ++ acpi_callback, NULL); ++ } + #endif + pm_initialised = 1; + +@@ -513,6 +550,9 @@ power_management_cleanup( void ) + } + #elif defined(__FreeBSD__) + if (using_acpi) { ++ if (acpiwatch != 0) ++ g_source_remove(acpiwatch); ++ acpiwatch = 0; + acpi_freebsd_cleanup(&acpiinfo); + } + #endif diff --git a/x11/gnome-applets/files/patch-cpufreq-freebsd b/x11/gnome-applets/files/patch-cpufreq-freebsd index 48f2ebb6c5b1..4bed0298db89 100644 --- a/x11/gnome-applets/files/patch-cpufreq-freebsd +++ b/x11/gnome-applets/files/patch-cpufreq-freebsd @@ -1,37 +1,3 @@ ---- cpufreq/src/Makefile.in.orig Sun Feb 13 01:00:35 2005 -+++ cpufreq/src/Makefile.in Sun Feb 13 01:01:31 2005 -@@ -55,6 +55,7 @@ - cpufreq-prefs.$(OBJEXT) cpufreq-popup.$(OBJEXT) \ - cpufreq-monitor.$(OBJEXT) cpufreq-monitor-factory.$(OBJEXT) \ - cpufreq-monitor-procfs.$(OBJEXT) \ -+ cpufreq-monitor-sysctl.$(OBJEXT) \ - cpufreq-monitor-sysfs.$(OBJEXT) \ - cpufreq-monitor-cpuinfo.$(OBJEXT) - cpufreq_applet_OBJECTS = $(am_cpufreq_applet_OBJECTS) -@@ -68,6 +69,7 @@ - @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-monitor-cpuinfo.Po \ - @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-monitor-factory.Po \ - @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-monitor-procfs.Po \ -+@AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-monitor-sysctl.Po \ - @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-monitor-sysfs.Po \ - @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-monitor.Po \ - @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-popup.Po \ -@@ -336,6 +338,7 @@ - cpufreq-monitor-protected.h \ - cpufreq-monitor-factory.c cpufreq-monitor-factory.h \ - cpufreq-monitor-procfs.c cpufreq-monitor-procfs.h \ -+ cpufreq-monitor-sysctl.c cpufreq-monitor-sysctl.h \ - cpufreq-monitor-sysfs.c cpufreq-monitor-sysfs.h \ - cpufreq-monitor-cpuinfo.c cpufreq-monitor-cpuinfo.h - -@@ -419,6 +422,7 @@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-monitor-cpuinfo.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-monitor-factory.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-monitor-procfs.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-monitor-sysctl.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-monitor-sysfs.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-monitor.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-popup.Po@am__quote@ --- cpufreq/src/cpufreq-monitor-sysctl.h.orig Sun Feb 13 01:00:25 2005 +++ cpufreq/src/cpufreq-monitor-sysctl.h Sat Feb 12 20:25:21 2005 @@ -0,0 +1,48 @@ @@ -83,111 +49,6 @@ +CPUFreqMonitor *cpufreq_monitor_sysctl_new (guint cpu); + +#endif /* __CPUFREQ_MONITOR_SYSCTL_H__ */ ---- cpufreq/src/cpufreq-monitor-cpuinfo.c.orig Fri Dec 31 14:39:04 2004 -+++ cpufreq/src/cpufreq-monitor-cpuinfo.c Sun Feb 13 23:58:38 2005 -@@ -22,6 +22,10 @@ - #include <glib/gi18n.h> - #include <libgnomevfs/gnome-vfs.h> - -+#ifdef __FreeBSD__ -+#include <sys/types.h> -+#include <sys/sysctl.h> -+#endif /* __FreeBSD__ */ - #include <string.h> - - #include "cpufreq-monitor-cpuinfo.h" -@@ -102,6 +106,7 @@ - static gboolean - cpufreq_monitor_cpuinfo_get (gpointer gdata) - { -+#ifndef __FreeBSD__ - GnomeVFSHandle *handle; - GnomeVFSFileSize bytes_read; - GnomeVFSResult result; -@@ -109,6 +114,9 @@ - gchar **lines; - gchar buffer[256]; - gchar *p; -+#else -+ size_t len; -+#endif /* __FreeBSD__ */ - gchar *freq, *perc, *unit, *governor; - gint cpu, i; - CPUFreqMonitorCPUInfo *monitor; -@@ -118,6 +126,7 @@ - - private = CPUFREQ_MONITOR_GET_PROTECTED (CPUFREQ_MONITOR (monitor)); - -+#ifndef __FreeBSD__ - uri = gnome_vfs_get_uri_from_local_path ("/proc/cpuinfo"); - - result = gnome_vfs_open (&handle, uri, GNOME_VFS_OPEN_READ); -@@ -178,6 +187,12 @@ - - g_strfreev (lines); - g_free (file); -+#else -+ len = sizeof (cpu); -+ -+ if (sysctlbyname ("hw.clockrate", &cpu, &len, NULL, 0) == -1) -+ return FALSE; -+#endif /* __FreeBSD__ */ - - governor = g_strdup (_("Frequency Scaling Unsupported")); - freq = parent_class->get_human_readable_freq (cpu * 1000); /* kHz are expected*/ ---- cpufreq/src/cpufreq-monitor-factory.c.orig Mon Dec 27 12:53:46 2004 -+++ cpufreq/src/cpufreq-monitor-factory.c Sun Feb 13 23:58:44 2005 -@@ -16,13 +16,21 @@ - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Authors : Carlos García Campos <carlosgc@gnome.org> -+ * Joe Marcus Clarke <marcus@FreeBSD.org> - */ - - #include <glib.h> -+#ifdef __FreeBSD__ -+#include <sys/types.h> -+#include <sys/sysctl.h> -+#endif /* __FreeBSD__ */ - - #include "cpufreq-applet.h" - #include "cpufreq-monitor-sysfs.h" - #include "cpufreq-monitor-procfs.h" -+#ifdef __FreeBSD__ -+#include "cpufreq-monitor-sysctl.h" -+#endif /* __FreeBSD__ */ - #include "cpufreq-monitor-cpuinfo.h" - #include "cpufreq-monitor-factory.h" - -@@ -30,6 +38,7 @@ - cpufreq_monitor_factory_create_monitor (guint cpu) - { - CPUFreqMonitor *monitor = NULL; -+#ifndef __FreeBSD__ - - if (g_file_test ("/sys/devices/system/cpu/cpu0/cpufreq", G_FILE_TEST_EXISTS)) { /* 2.6 kernel */ - monitor = cpufreq_monitor_sysfs_new (cpu); -@@ -48,6 +57,20 @@ - - monitor = cpufreq_monitor_cpuinfo_new (cpu); - } -+#else -+ size_t len; -+ -+ if (sysctlbyname ("dev.cpu.0.freq", NULL, &len, NULL, 0) == 0) { -+ monitor = cpufreq_monitor_sysctl_new (cpu); -+ } else { -+ cpufreq_applet_display_error (_("CPU frequency scaling unsupported"), -+ _("You will not be able to modify the frequency of your machine. " -+ "Your machine may be misconfigured or not have hardware support " -+ "for CPU frequency scaling.")); -+ -+ monitor = cpufreq_monitor_cpuinfo_new (cpu); -+ } -+#endif /* __FreeBSD__ */ - - return monitor; - } --- cpufreq/src/cpufreq-monitor-sysctl.c.orig Sun Feb 13 03:52:42 2005 +++ cpufreq/src/cpufreq-monitor-sysctl.c Mon Feb 14 00:42:07 2005 @@ -0,0 +1,269 @@ @@ -460,9 +321,114 @@ + return private->available_freqs; +} +#endif /* __FreeBSD__ */ ---- cpufreq/src/cpufreq-applet.c.orig Fri Jan 14 23:38:20 2005 -+++ cpufreq/src/cpufreq-applet.c Mon Feb 14 00:47:36 2005 -@@ -16,6 +16,7 @@ +--- cpufreq/src/cpufreq-monitor-factory.c.orig Thu Apr 14 12:11:06 2005 ++++ cpufreq/src/cpufreq-monitor-factory.c Sun Jul 3 17:09:15 2005 +@@ -17,13 +17,21 @@ + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Authors : Carlos García Campos <carlosgc@gnome.org> ++ * Joe Marcus Clarke <marcus@FreeBSD.org> + */ + + #include <glib.h> ++#ifdef __FreeBSD__ ++#include <sys/types.h> ++#include <sys/sysctl.h> ++#endif /* __FreeBSD__ */ + + #include "cpufreq-applet.h" + #include "cpufreq-monitor-sysfs.h" + #include "cpufreq-monitor-procfs.h" ++#ifdef __FreeBSD__ ++#include "cpufreq-monitor-sysctl.h" ++#endif /* __FreeBSD__ */ + #include "cpufreq-monitor-cpuinfo.h" + #include "cpufreq-monitor-factory.h" + +@@ -31,6 +39,7 @@ CPUFreqMonitor * + cpufreq_monitor_factory_create_monitor (guint cpu) + { + CPUFreqMonitor *monitor = NULL; ++#ifndef __FreeBSD__ + + if (g_file_test ("/sys/devices/system/cpu/cpu0/cpufreq", G_FILE_TEST_EXISTS)) { /* 2.6 kernel */ + monitor = cpufreq_monitor_sysfs_new (cpu); +@@ -49,6 +58,20 @@ cpufreq_monitor_factory_create_monitor ( + + monitor = cpufreq_monitor_cpuinfo_new (cpu); + } ++#else ++ size_t len; ++ ++ if (sysctlbyname ("dev.cpu.0.freq", NULL, &len, NULL, 0) == 0) { ++ monitor = cpufreq_monitor_sysctl_new (cpu); ++ } else { ++ cpufreq_applet_display_error (_("CPU frequency scaling unsupported"), ++ _("You will not be able to modify the frequency of your machine. " ++ "Your machine may be misconfigured or not have hardware support " ++ "for CPU frequency scaling.")); ++ ++ monitor = cpufreq_monitor_cpuinfo_new (cpu); ++ } ++#endif /* __FreeBSD__ */ + + return monitor; + } +--- cpufreq/src/cpufreq-monitor-cpuinfo.c.orig Thu Apr 14 12:11:06 2005 ++++ cpufreq/src/cpufreq-monitor-cpuinfo.c Sun Jul 3 17:07:16 2005 +@@ -23,6 +23,10 @@ + #include <glib/gi18n.h> + #include <libgnomevfs/gnome-vfs.h> + ++#ifdef __FreeBSD__ ++#include <sys/types.h> ++#include <sys/sysctl.h> ++#endif /* __FreeBSD__ */ + #include <string.h> + #include <stdio.h> + +@@ -104,6 +108,7 @@ cpufreq_monitor_cpuinfo_new (guint cpu) + static gboolean + cpufreq_monitor_cpuinfo_get (gpointer gdata) + { ++#ifndef __FreeBSD__ + GnomeVFSHandle *handle; + GnomeVFSFileSize bytes_read; + GnomeVFSResult result; +@@ -111,6 +116,9 @@ cpufreq_monitor_cpuinfo_get (gpointer gd + gchar **lines; + gchar buffer[256]; + gchar *p; ++#else ++ size_t len; ++#endif /* __FreeBSD__ */ + gchar *freq, *perc, *unit, *governor; + gint cpu, i; + CPUFreqMonitorCPUInfo *monitor; +@@ -120,6 +128,7 @@ cpufreq_monitor_cpuinfo_get (gpointer gd + + private = CPUFREQ_MONITOR_GET_PROTECTED (CPUFREQ_MONITOR (monitor)); + ++#ifndef __FreeBSD__ + uri = gnome_vfs_get_uri_from_local_path ("/proc/cpuinfo"); + + result = gnome_vfs_open (&handle, uri, GNOME_VFS_OPEN_READ); +@@ -180,6 +189,12 @@ cpufreq_monitor_cpuinfo_get (gpointer gd + + g_strfreev (lines); + g_free (file); ++#else ++ len = sizeof (cpu); ++ ++ if (sysctlbyname ("hw.clockrate", &cpu, &len, NULL, 0) == -1) ++ return FALSE; ++#endif /* __FreeBSD__ */ + + governor = g_strdup (_("Frequency Scaling Unsupported")); + freq = parent_class->get_human_readable_freq (cpu * 1000); /* kHz are expected*/ +--- cpufreq/src/cpufreq-applet.c.orig Thu Apr 14 12:11:06 2005 ++++ cpufreq/src/cpufreq-applet.c Sun Jul 3 17:28:43 2005 +@@ -17,6 +17,7 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Authors : Carlos García Campos <carlosgc@gnome.org> @@ -470,7 +436,7 @@ */ #include <config.h> -@@ -25,6 +26,10 @@ +@@ -26,6 +27,10 @@ #include <panel-applet-gconf.h> #include <glade/glade.h> #include <glib/gi18n.h> @@ -481,34 +447,82 @@ #include <string.h> #include "cpufreq-applet.h" -@@ -192,6 +197,7 @@ +@@ -193,6 +198,7 @@ cpufreq_applet_about_cb (BonoboUICompone { - static const gchar *authors[] = { - "Carlos Garcia Campos <carlosgc@gnome.org>", -+ "Joe Marcus Clarke <marcus@FreeBSD.org> (FreeBSD support)", - NULL - }; - static const gchar *documenters[] = { -@@ -231,6 +237,7 @@ - cpufreq_applet_get_max_cpu () + static const gchar *authors[] = { + "Carlos Garcia Campos <carlosgc@gnome.org>", ++ "Joe Marcus Clarke <marcus@FreeBSD.org> (FreeBSD support)", + NULL + }; + static const gchar *documenters[] = { +@@ -233,6 +239,7 @@ static gint + cpufreq_applet_get_max_cpu (void) { - gint mcpu = -1; + gint mcpu = -1; +#ifndef __FreeBSD__ - gchar *file = NULL; + gchar *file = NULL; - do { -@@ -253,6 +260,14 @@ - } while (g_file_test (file, G_FILE_TEST_EXISTS)); - g_free (file); - mcpu --; + do { +@@ -242,11 +249,20 @@ cpufreq_applet_get_max_cpu (void) + } while (g_file_test (file, G_FILE_TEST_EXISTS)); + g_free (file); + mcpu --; +#else -+ size_t len; ++ size_t len; + -+ len = sizeof (mcpu); ++ len = sizeof (mcpu); + -+ sysctlbyname ("hw.ncpu", &mcpu, &len, NULL, 0); -+ mcpu --; ++ sysctlbyname ("hw.ncpu", &mcpu, &len, NULL, 0); ++ mcpu --; +#endif /* __FreeBSD__ */ - if (mcpu >= 0) - return mcpu; + if (mcpu >= 0) + return mcpu; + + mcpu = -1; ++#ifndef __FreeBSD__ + file = NULL; + do { + if (file) g_free (file); +@@ -255,6 +271,7 @@ cpufreq_applet_get_max_cpu (void) + } while (g_file_test (file, G_FILE_TEST_EXISTS)); + g_free (file); + mcpu --; ++#endif + + if (mcpu >= 0) + return mcpu; +--- cpufreq/src/Makefile.in.orig Tue Oct 4 00:11:26 2005 ++++ cpufreq/src/Makefile.in Tue Oct 4 00:20:37 2005 +@@ -57,6 +57,7 @@ + cpufreq-prefs.$(OBJEXT) cpufreq-popup.$(OBJEXT) \ + cpufreq-monitor.$(OBJEXT) cpufreq-monitor-factory.$(OBJEXT) \ + cpufreq-monitor-procfs.$(OBJEXT) \ ++ cpufreq-monitor-sysctl.$(OBJEXT) \ + cpufreq-monitor-sysfs.$(OBJEXT) \ + cpufreq-monitor-cpuinfo.$(OBJEXT) + cpufreq_applet_OBJECTS = $(am_cpufreq_applet_OBJECTS) +@@ -71,6 +72,7 @@ + @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-monitor-factory.Po \ + @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-monitor-procfs.Po \ + @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-monitor-sysfs.Po \ ++@AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-monitor-sysctl.Po \ + @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-monitor.Po \ + @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-popup.Po \ + @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-prefs.Po +@@ -358,6 +360,7 @@ + cpufreq-monitor-protected.h \ + cpufreq-monitor-factory.c cpufreq-monitor-factory.h \ + cpufreq-monitor-procfs.c cpufreq-monitor-procfs.h \ ++ cpufreq-monitor-sysctl.c cpufreq-monitor-sysctl.h \ + cpufreq-monitor-sysfs.c cpufreq-monitor-sysfs.h \ + cpufreq-monitor-cpuinfo.c cpufreq-monitor-cpuinfo.h + +@@ -441,6 +444,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-monitor-cpuinfo.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-monitor-factory.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-monitor-procfs.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-monitor-sysctl.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-monitor-sysfs.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-monitor.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-popup.Po@am__quote@ diff --git a/x11/gnome-applets/files/patch-cpufreq-selector-freebsd b/x11/gnome-applets/files/patch-cpufreq-selector-freebsd index f577a0fed39b..d25df35e2b5d 100644 --- a/x11/gnome-applets/files/patch-cpufreq-selector-freebsd +++ b/x11/gnome-applets/files/patch-cpufreq-selector-freebsd @@ -1,38 +1,3 @@ ---- cpufreq/src/cpufreq-selector/Makefile.in.orig Mon Feb 14 00:26:10 2005 -+++ cpufreq/src/cpufreq-selector/Makefile.in Mon Feb 14 00:26:58 2005 -@@ -53,7 +53,7 @@ - PROGRAMS = $(bin_PROGRAMS) - am_cpufreq_selector_OBJECTS = cpufreq.$(OBJEXT) \ - cpufreq-sysfs.$(OBJEXT) cpufreq-procfs.$(OBJEXT) \ -- main.$(OBJEXT) -+ cpufreq-sysctl.$(OBJEXT) main.$(OBJEXT) - cpufreq_selector_OBJECTS = $(am_cpufreq_selector_OBJECTS) - am__DEPENDENCIES_1 = - cpufreq_selector_DEPENDENCIES = $(am__DEPENDENCIES_1) -@@ -61,6 +61,7 @@ - depcomp = $(SHELL) $(top_srcdir)/depcomp - am__depfiles_maybe = depfiles - @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cpufreq-procfs.Po \ -+@AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-sysctl.Po \ - @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-sysfs.Po \ - @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq.Po ./$(DEPDIR)/main.Po - COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ -@@ -310,6 +311,7 @@ - cpufreq.c cpufreq.h \ - cpufreq-sysfs.c cpufreq-sysfs.h \ - cpufreq-procfs.c cpufreq-procfs.h \ -+ cpufreq-sysctl.c cpufreq-sysctl.h \ - main.c - - cpufreq_selector_LDADD = $(CPUFREQ_SELECTOR_LIBS) -lpopt -@@ -385,6 +387,7 @@ - -rm -f *.tab.c - - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-procfs.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-sysctl.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-sysfs.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ --- cpufreq/src/cpufreq-selector/cpufreq-sysctl.h.orig Mon Feb 14 00:38:57 2005 +++ cpufreq/src/cpufreq-selector/cpufreq-sysctl.h Mon Feb 14 00:21:39 2005 @@ -0,0 +1,51 @@ @@ -87,52 +52,6 @@ +CPUFreqSysctl *cpufreq_sysctl_new (); + +#endif /* __CPUFREQ_SYSCTL_H__ */ ---- cpufreq/src/cpufreq-selector/main.c.orig Mon Feb 14 00:22:12 2005 -+++ cpufreq/src/cpufreq-selector/main.c Mon Feb 14 00:26:04 2005 -@@ -16,6 +16,7 @@ - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Authors : Carlos García Campos <carlosgc@gnome.org> -+ * Joe Marcus Clarke <marcus@FreeBSD.org> - */ - - #include <glib-object.h> -@@ -26,6 +27,9 @@ - #include "cpufreq.h" - #include "cpufreq-sysfs.h" - #include "cpufreq-procfs.h" -+#ifdef __FreeBSD__ -+#include "cpufreq-sysctl.h" -+#endif /* __FreeBSD__ */ - - gint - main (gint argc, gchar **argv) -@@ -35,6 +39,9 @@ - gulong frequency = 0; - poptContext ctx; - gint nextopt; -+#ifdef __FreeBSD__ -+ size_t len; -+#endif /* __FreeBSD__ */ - CPUFreq *cfq; - - struct poptOption options[] = { -@@ -76,10 +83,15 @@ - - poptFreeContext(ctx); - -+#ifndef __FreeBSD__ - if (g_file_test ("/sys/devices/system/cpu/cpu0/cpufreq", G_FILE_TEST_EXISTS)) { /* 2.6 kernel */ - cfq = CPUFREQ (cpufreq_sysfs_new ()); - } else if (g_file_test ("/proc/cpufreq", G_FILE_TEST_EXISTS)) { /* 2.4 kernel */ - cfq = CPUFREQ (cpufreq_procfs_new ()); -+#else -+ if (sysctlbyname ("dev.cpu.0.freq", NULL, &len, NULL, 0) == 0) { -+ cfq = CPUFREQ (cpufreq_sysctl_new ()); -+#endif /* __FreeBSD __ */ - } else { - g_print ("No cpufreq support\n"); - return 1; --- cpufreq/src/cpufreq-selector/cpufreq-sysctl.c.orig Mon Feb 14 00:38:52 2005 +++ cpufreq/src/cpufreq-selector/cpufreq-sysctl.c Mon Feb 14 00:44:43 2005 @@ -0,0 +1,235 @@ @@ -371,3 +290,84 @@ + + g_free (governor); +} +--- cpufreq/src/cpufreq-selector/main.c.orig Sun Apr 3 12:03:13 2005 ++++ cpufreq/src/cpufreq-selector/main.c Sun Jul 3 17:16:19 2005 +@@ -17,6 +17,7 @@ + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Authors : Carlos García Campos <carlosgc@gnome.org> ++ * Joe Marcus Clarke <marcus@FreeBSD.org> + */ + + #include <glib-object.h> +@@ -26,6 +27,9 @@ + #include "cpufreq.h" + #include "cpufreq-sysfs.h" + #include "cpufreq-procfs.h" ++#ifdef __FreeBSD__ ++#include "cpufreq-sysctl.h" ++#endif /* __FreeBSD__ */ + + gint + main (gint argc, gchar **argv) +@@ -34,6 +38,9 @@ main (gint argc, gchar **argv) + static gint cpu = 0; + static gchar *governor = NULL; + static gulong frequency = 0; ++#ifdef __FreeBSD__ ++ size_t len; ++#endif /* __FreeBSD__ */ + GError *error = NULL; + CPUFreq *cfq; + +@@ -71,10 +78,15 @@ main (gint argc, gchar **argv) + + g_option_context_free (context); + ++#ifndef __FreeBSD__ + if (g_file_test ("/sys/devices/system/cpu/cpu0/cpufreq", G_FILE_TEST_EXISTS)) { /* 2.6 kernel */ + cfq = CPUFREQ (cpufreq_sysfs_new ()); + } else if (g_file_test ("/proc/cpufreq", G_FILE_TEST_EXISTS)) { /* 2.4 kernel */ + cfq = CPUFREQ (cpufreq_procfs_new ()); ++#else ++ if (sysctlbyname ("dev.cpu.0.freq", NULL, &len, NULL, 0) == 0) { ++ cfq = CPUFREQ (cpufreq_sysctl_new ()); ++#endif /* __FreeBSD__ */ + } else { + g_print ("No cpufreq support\n"); + return 1; +--- cpufreq/src/cpufreq-selector/Makefile.in.orig Tue Oct 4 00:21:25 2005 ++++ cpufreq/src/cpufreq-selector/Makefile.in Tue Oct 4 00:27:54 2005 +@@ -55,7 +55,7 @@ + PROGRAMS = $(bin_PROGRAMS) + am_cpufreq_selector_OBJECTS = cpufreq.$(OBJEXT) \ + cpufreq-sysfs.$(OBJEXT) cpufreq-procfs.$(OBJEXT) \ +- main.$(OBJEXT) ++ cpufreq-sysctl.$(OBJEXT) main.$(OBJEXT) + cpufreq_selector_OBJECTS = $(am_cpufreq_selector_OBJECTS) + am__DEPENDENCIES_1 = + cpufreq_selector_DEPENDENCIES = $(am__DEPENDENCIES_1) +@@ -64,6 +64,7 @@ + am__depfiles_maybe = depfiles + @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cpufreq-procfs.Po \ + @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-sysfs.Po \ ++@AMDEP_TRUE@ ./$(DEPDIR)/cpufreq-sysctl.Po \ + @AMDEP_TRUE@ ./$(DEPDIR)/cpufreq.Po ./$(DEPDIR)/main.Po + COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +@@ -332,6 +333,7 @@ + cpufreq.c cpufreq.h \ + cpufreq-sysfs.c cpufreq-sysfs.h \ + cpufreq-procfs.c cpufreq-procfs.h \ ++ cpufreq-sysctl.c cpufreq-sysctl.h \ + main.c + + cpufreq_selector_LDADD = $(CPUFREQ_SELECTOR_LIBS) -lpopt +@@ -407,6 +409,7 @@ + -rm -f *.tab.c + + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-procfs.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-sysctl.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq-sysfs.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpufreq.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ diff --git a/x11/gnome-applets/files/patch-drivemount_drive-button.c b/x11/gnome-applets/files/patch-drivemount_drive-button.c new file mode 100644 index 000000000000..f26e3121ee4b --- /dev/null +++ b/x11/gnome-applets/files/patch-drivemount_drive-button.c @@ -0,0 +1,48 @@ +--- drivemount/drive-button.c.orig Tue Aug 23 05:16:27 2005 ++++ drivemount/drive-button.c Tue Aug 23 20:37:43 2005 +@@ -24,6 +24,7 @@ + # include <config.h> + #endif + ++#include <string.h> + #include "drive-button.h" + #include <glib/gi18n.h> + #include <gdk/gdkkeysyms.h> +@@ -710,11 +711,13 @@ run_command (DriveButton *self, const ch + + GList *volumes; + GnomeVFSVolume *volume; ++ char *uri; ++ char *mount_path; + + volumes = gnome_vfs_drive_get_mounted_volumes (self->drive); + volume = GNOME_VFS_VOLUME (volumes->data); +- char *uri = gnome_vfs_volume_get_activation_uri (volume); +- char *mount_path = gnome_vfs_get_local_path_from_uri (uri); ++ uri = gnome_vfs_volume_get_activation_uri (volume); ++ mount_path = gnome_vfs_get_local_path_from_uri (uri); + g_free (uri); + + gnome_vfs_drive_get_display_name (self->drive); +@@ -794,6 +797,11 @@ drive_button_ensure_popup (DriveButton * + char *display_name, *tmp, *label; + int action; + GtkWidget *item; ++ GList *volumes; ++ GnomeVFSVolume *volume = NULL; ++ GnomeVFSDeviceType volume_type; ++ GCallback callback; ++ const char *action_icon = GTK_STOCK_OPEN; + + if (self->popup_menu) return; + +@@ -869,8 +877,7 @@ drive_button_ensure_popup (DriveButton * + g_free (display_name); + display_name = tmp; + +- GCallback callback = G_CALLBACK (open_drive); +- const char *action_icon = GTK_STOCK_OPEN; ++ callback = G_CALLBACK (open_drive); + + switch (device_type) { + case GNOME_VFS_DEVICE_TYPE_VIDEO_DVD: diff --git a/x11/gnome-applets/files/patch-gswitchit_gswitchit-applet.c b/x11/gnome-applets/files/patch-gswitchit_gswitchit-applet.c new file mode 100644 index 000000000000..5abf18032f00 --- /dev/null +++ b/x11/gnome-applets/files/patch-gswitchit_gswitchit-applet.c @@ -0,0 +1,61 @@ +--- gswitchit/gswitchit-applet.c.orig Sun Aug 7 18:07:33 2005 ++++ gswitchit/gswitchit-applet.c Sun Aug 7 18:10:07 2005 +@@ -331,6 +331,10 @@ GSwitchItAppletPrepareDrawing (GSwitchIt + XklConfigItem configItem; + GtkWidget *align, *label; + static GHashTable *shortDescrs = NULL; ++ gpointer pcounter = NULL; ++ char *prevLayoutName = NULL; ++ char *labelTitle = NULL; ++ int counter = 0; + if (group == 0) + shortDescrs = g_hash_table_new_full (g_str_hash, g_str_equal, + g_free, NULL); +@@ -363,10 +367,6 @@ GSwitchItAppletPrepareDrawing (GSwitchIt + if (layoutName == NULL) + layoutName = g_strdup ("?"); + +- gpointer pcounter = NULL; +- char *prevLayoutName = NULL; +- char *labelTitle = NULL; +- int counter = 0; + if (g_hash_table_lookup_extended (shortDescrs, layoutName, + (gpointer*)&prevLayoutName, &pcounter)) + { +@@ -599,6 +599,13 @@ GSwitchItAppletCmdPreview (BonoboUICompo + groupsLevels, groupsLevels + 1, groupsLevels + 2, groupsLevels + 3 }; + XklState *xklState = XklGetCurrentState (); + gpointer p = g_hash_table_lookup (globals.previewDialogs, GINT_TO_POINTER (xklState->group)); ++#ifdef HAVE_XKB ++ GladeXML *gladeData; ++ GtkWidget *dialog; ++ GtkWidget *kbdraw; ++ XkbComponentNamesRec componentNames; ++ XklConfigRec xklData; ++#endif + if (p != NULL) + { + /* existing window */ +@@ -606,11 +613,10 @@ GSwitchItAppletCmdPreview (BonoboUICompo + return; + } + #ifdef HAVE_XKB +- GladeXML *gladeData = glade_xml_new (GNOME_GLADEDIR "/gswitchit.glade", "gswitchit_layout_view", NULL); +- GtkWidget *dialog = ++ gladeData = glade_xml_new (GNOME_GLADEDIR "/gswitchit.glade", "gswitchit_layout_view", NULL); ++ dialog = + glade_xml_get_widget (gladeData, "gswitchit_layout_view"); +- GtkWidget *kbdraw = keyboard_drawing_new (); +- XkbComponentNamesRec componentNames; ++ kbdraw = keyboard_drawing_new (); + + if (xklState->group >= 0 && + xklState->group < g_slist_length (globals.groupNames)) +@@ -624,7 +630,6 @@ GSwitchItAppletCmdPreview (BonoboUICompo + + keyboard_drawing_set_groups_levels (KEYBOARD_DRAWING (kbdraw), pGroupsLevels); + +- XklConfigRec xklData; + XklConfigRecInit (&xklData); + if (XklConfigGetFromServer (&xklData)) + { diff --git a/x11/gnome-applets/files/patch-gweather_weather.c b/x11/gnome-applets/files/patch-gweather_weather.c deleted file mode 100644 index cdc1921ab4c7..000000000000 --- a/x11/gnome-applets/files/patch-gweather_weather.c +++ /dev/null @@ -1,12 +0,0 @@ ---- gweather/weather.c.orig Tue Mar 1 04:34:33 2005 -+++ gweather/weather.c Tue Mar 1 12:36:54 2005 -@@ -20,7 +20,9 @@ - #include <string.h> - #include <ctype.h> - #include <math.h> -+#ifndef __FreeBSD__ - #include <values.h> -+#endif - - #ifdef __FreeBSD__ - #include <sys/types.h> diff --git a/x11/gnome-applets/files/patch-mixer_applet.c b/x11/gnome-applets/files/patch-mixer_applet.c new file mode 100644 index 000000000000..178c7d5a31a1 --- /dev/null +++ b/x11/gnome-applets/files/patch-mixer_applet.c @@ -0,0 +1,11 @@ +--- mixer/applet.c.orig Tue Oct 4 00:15:40 2005 ++++ mixer/applet.c Tue Oct 4 00:16:09 2005 +@@ -953,7 +953,7 @@ gnome_volume_applet_adjust_volume (GstMi + + volumes = g_new (gint, track->num_channels); + for (n = 0; n < track->num_channels; n++) +- volumes[n] = lrintf (volume); ++ volumes[n] = (int)rint (volume); + gst_mixer_set_volume (mixer, track, volumes); + g_free (volumes); + } diff --git a/x11/gnome-applets/files/patch-modemlights_modem-applet.c b/x11/gnome-applets/files/patch-modemlights_modem-applet.c deleted file mode 100644 index f4fb13717732..000000000000 --- a/x11/gnome-applets/files/patch-modemlights_modem-applet.c +++ /dev/null @@ -1,22 +0,0 @@ ---- modemlights/modem-applet.c.orig Fri Jan 14 00:06:52 2005 -+++ modemlights/modem-applet.c Fri Jan 14 00:08:28 2005 -@@ -24,12 +24,19 @@ - - #include <panel-applet.h> - #include <fcntl.h> -+#ifndef __FreeBSD__ - #include <pty.h> -+#endif - #include <sys/poll.h> - #include <sys/types.h> - #include <sys/wait.h> - #include <libxml/tree.h> - #include <glade/glade.h> -+#ifdef __FreeBSD__ -+#include <sys/ioctl.h> -+#include <termios.h> -+#include <libutil.h> -+#endif - - #include "modem-applet.h" - diff --git a/x11/gnome-applets/files/patch-stickynotes_stickynotes_applet_callbacks.c b/x11/gnome-applets/files/patch-stickynotes_stickynotes_applet_callbacks.c new file mode 100644 index 000000000000..718f52a0dd67 --- /dev/null +++ b/x11/gnome-applets/files/patch-stickynotes_stickynotes_applet_callbacks.c @@ -0,0 +1,18 @@ +--- stickynotes/stickynotes_applet_callbacks.c.orig Wed Jul 13 18:57:03 2005 ++++ stickynotes/stickynotes_applet_callbacks.c Wed Jul 13 18:57:13 2005 +@@ -153,6 +153,7 @@ gboolean applet_check_click_on_desktop_c + { + static Window desktop_window = 0; + static Display *dpy; ++ XEvent event; + + if (desktop_window == 0) { + desktop_window = get_desktop_window (); +@@ -162,7 +163,6 @@ gboolean applet_check_click_on_desktop_c + * at every click on the desktop */ + XSelectInput(dpy, desktop_window, PropertyChangeMask); + } +- XEvent event; + + if (XCheckWindowEvent(dpy, desktop_window, PropertyChangeMask, &event) == True) { + stickynote_show_notes (FALSE); |