x11-xkb-utils: Changes to 'debian-unstable'
debian/changelog | 10
debian/compat | 2
debian/control | 3
debian/rules | 96
debian/x11-xkb-utils.install | 2
xkbutils/ChangeLog | 203 +
xkbutils/LED.c | 329 +-
xkbutils/LED.h | 6
xkbutils/LEDP.h | 39
xkbutils/Makefile.am | 16
xkbutils/Makefile.in | 426 +-
xkbutils/aclocal.m4 | 1143 ++++++-
xkbutils/compile | 173 +
xkbutils/config.guess | 233 -
xkbutils/config.h.in | 3
xkbutils/config.sub | 134
xkbutils/configure | 6275 +++++++++++++++++++++++++++++++++++++++++--
xkbutils/configure.ac | 23
xkbutils/depcomp | 74
xkbutils/install-sh | 29
xkbutils/man/Makefile.am | 12
xkbutils/man/Makefile.in | 427 ++
xkbutils/man/xkbbell.man | 84
xkbutils/man/xkbvleds.man | 83
xkbutils/man/xkbwatch.man | 36
xkbutils/utils.c | 294 --
xkbutils/utils.h | 240 -
xkbutils/xkbbell.c | 353 +-
xkbutils/xkbbell.man | 75
xkbutils/xkbvleds.c | 537 +--
xkbutils/xkbvleds.man | 77
xkbutils/xkbwatch.c | 368 +-
xkbutils/xkbwatch.man | 26
33 files changed, 9543 insertions(+), 2288 deletions(-)
New commits:
commit 2f2ae2939164844a1f4d17a6160acd1148f75189
Author: Julien Cristau <jcristau@debian.org>
Date: Wed Dec 25 16:13:45 2013 +0100
Upload to unstable
diff --git a/debian/changelog b/debian/changelog
index 57cd991..caeb12a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-x11-xkb-utils (7.7+1) UNRELEASED; urgency=medium
+x11-xkb-utils (7.7+1) unstable; urgency=medium
* xkbutils 1.0.4.
* Switch to dh, use the autotools-dev addon; should give us new enough
@@ -6,7 +6,7 @@ x11-xkb-utils (7.7+1) UNRELEASED; urgency=medium
* Disable silent build rules.
* Install xkbcomp.pc, in case anything ever needs it.
- -- Julien Cristau <jcristau@debian.org> Wed, 25 Dec 2013 13:04:17 +0100
+ -- Julien Cristau <jcristau@debian.org> Wed, 25 Dec 2013 16:13:32 +0100
x11-xkb-utils (7.7~1) unstable; urgency=low
commit 1f79400f35650062f6f0fa5a2e97c9511f677ae2
Author: Julien Cristau <jcristau@debian.org>
Date: Wed Dec 25 16:12:43 2013 +0100
Install xkbcomp.pc, in case anything ever needs it.
Also restore xkbevd-example.cf's filename.
diff --git a/debian/changelog b/debian/changelog
index 334cfdc..57cd991 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,7 @@ x11-xkb-utils (7.7+1) UNRELEASED; urgency=medium
* Switch to dh, use the autotools-dev addon; should give us new enough
config.{guess,sub} for arm64 (closes: #717841).
* Disable silent build rules.
+ * Install xkbcomp.pc, in case anything ever needs it.
-- Julien Cristau <jcristau@debian.org> Wed, 25 Dec 2013 13:04:17 +0100
diff --git a/debian/rules b/debian/rules
index b93ee27..f02d106 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,9 +7,6 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
-# set this to the name of the main shlib's binary package
-PACKAGE = x11-xkb-utils
-
STAMP_DIR = stampdir
# This package contains multiple modules as shipped by upstream. Each module is
@@ -43,6 +40,11 @@ override_dh_auto_install:
cd "$$FILE"-build && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install ; \
cd ..; \
done
+ install -d debian/tmp/usr/share/doc/x11-xkb-utils
+ install -m 644 xkbevd/example.cf debian/tmp/usr/share/doc/x11-xkb-utils/xkbevd-example.cf
+
+override_dh_install:
+ dh_install --fail-missing
override_dh_auto_clean: $(addprefix clean-, $(SUBDIRS))
rm -rf $(STAMP_DIR)
diff --git a/debian/x11-xkb-utils.docs b/debian/x11-xkb-utils.docs
deleted file mode 100644
index 82ead1e..0000000
--- a/debian/x11-xkb-utils.docs
+++ /dev/null
@@ -1 +0,0 @@
-xkbevd/example.cf
diff --git a/debian/x11-xkb-utils.install b/debian/x11-xkb-utils.install
index 68671de..308034e 100644
--- a/debian/x11-xkb-utils.install
+++ b/debian/x11-xkb-utils.install
@@ -1,2 +1,4 @@
usr/bin/*
usr/share/man/man1/*
+usr/share/doc/x11-xkb-utils
+usr/lib/pkgconfig
commit 07cf735d5803a4e4f01a74972a0813bd82826a9c
Author: Julien Cristau <jcristau@debian.org>
Date: Wed Dec 25 13:29:02 2013 +0100
Disable silent build rules.
diff --git a/debian/changelog b/debian/changelog
index d88f354..334cfdc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ x11-xkb-utils (7.7+1) UNRELEASED; urgency=medium
* xkbutils 1.0.4.
* Switch to dh, use the autotools-dev addon; should give us new enough
config.{guess,sub} for arm64 (closes: #717841).
+ * Disable silent build rules.
-- Julien Cristau <jcristau@debian.org> Wed, 25 Dec 2013 13:04:17 +0100
diff --git a/debian/rules b/debian/rules
index a959392..b93ee27 100755
--- a/debian/rules
+++ b/debian/rules
@@ -27,7 +27,8 @@ override_dh_auto_configure: $(CONFIG_STAMPS)
$(STAMP_DIR)/configure-%:
mkdir -p $(STAMP_DIR)
- dh_auto_configure -D$* -B$*-build
+ dh_auto_configure -D$* -B$*-build -- \
+ --disable-silent-rules
>$@
override_dh_auto_build: $(BUILD_STAMPS)
commit 3882b967481038c069c38b6609d6537de946aa6f
Author: Julien Cristau <jcristau@debian.org>
Date: Wed Dec 25 13:26:57 2013 +0100
Switch to dh, use the autotools-dev addon
Should give us new enough config.{guess,sub} for arm64 (closes: #717841).
diff --git a/debian/changelog b/debian/changelog
index d3457a7..d88f354 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
x11-xkb-utils (7.7+1) UNRELEASED; urgency=medium
* xkbutils 1.0.4.
+ * Switch to dh, use the autotools-dev addon; should give us new enough
+ config.{guess,sub} for arm64 (closes: #717841).
-- Julien Cristau <jcristau@debian.org> Wed, 25 Dec 2013 13:04:17 +0100
diff --git a/debian/compat b/debian/compat
index 7ed6ff8..7f8f011 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-5
+7
diff --git a/debian/control b/debian/control
index 736f882..3a2fcd2 100644
--- a/debian/control
+++ b/debian/control
@@ -4,8 +4,9 @@ Priority: optional
Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
Uploaders: Cyril Brulebois <kibi@debian.org>
Build-Depends:
- debhelper (>= 5.0.0),
+ debhelper (>= 7.0.50),
pkg-config,
+ autotools-dev,
libx11-dev (>= 2:1.3.3-2),
libxaw7-dev (>= 1:1.0.1),
libxkbfile-dev (>= 1:1.0.6-2),
diff --git a/debian/rules b/debian/rules
index dc630bb..a959392 100755
--- a/debian/rules
+++ b/debian/rules
@@ -10,99 +10,44 @@
# set this to the name of the main shlib's binary package
PACKAGE = x11-xkb-utils
-include debian/xsfbs/xsfbs.mk
+STAMP_DIR = stampdir
# This package contains multiple modules as shipped by upstream. Each module is
# contained in a subdirectory in the root dir of the package. You must list each
# subdirectory explicitly so that the build system knows what to build
XKB_SUBDIRS=setxkbmap xkbcomp xkbevd xkbprint xkbutils
SUBDIRS=$(XKB_SUBDIRS)
+CONFIG_STAMPS = $(addprefix $(STAMP_DIR)/configure-,$(SUBDIRS))
BUILD_STAMPS = $(addprefix $(STAMP_DIR)/build-,$(SUBDIRS))
-CFLAGS = -Wall -g
-ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
- CFLAGS += -O0
-else
- CFLAGS += -O2
-endif
-ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
- NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
- MAKEFLAGS += -j$(NUMJOBS)
-endif
+%:
+ dh $@ --with autotools-dev,quilt --parallel
-DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
-DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
- confflags += --build=$(DEB_HOST_GNU_TYPE)
-else
- confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
-endif
+override_dh_auto_configure: $(CONFIG_STAMPS)
-
-build: build-stamp
-build-stamp: $(BUILD_STAMPS)
+$(STAMP_DIR)/configure-%:
+ mkdir -p $(STAMP_DIR)
+ dh_auto_configure -D$* -B$*-build
>$@
-$(STAMP_DIR)/build-%: $(STAMP_DIR)/genscripts $(STAMP_DIR)/patch
- dh_testdir
+override_dh_auto_build: $(BUILD_STAMPS)
- mkdir -p $*-build
- cd $*-build && \
- ../$*/configure --prefix=/usr --mandir=\$${prefix}/share/man \
- --infodir=\$${prefix}/share/info $(confflags) \
- CFLAGS="$(CFLAGS)"
- cd $*-build && $(MAKE)
+$(STAMP_DIR)/build-%:
+ mkdir -p $(STAMP_DIR)
+ dh_auto_build -D$* -B$*-build
>$@
-clean: xsfclean
- dh_testdir
- rm -f build-stamp
- rm -f config.cache config.log config.status
- rm -f */config.cache */config.log */config.status
- rm -f conftest* */conftest*
- rm -rf autom4te.cache */autom4te.cache
- rm -rf *-build
- dh_clean
-
-install: build
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_installdirs
-
+override_dh_auto_install:
for FILE in $(SUBDIRS); do \
cd "$$FILE"-build && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install ; \
cd ..; \
done
-# Build architecture-dependent files here.
-binary-arch: build install
- dh_testdir
- dh_testroot
-
- dh_installdocs
- dh_install --sourcedir=debian/tmp --fail-missing -Xxkbcomp.pc
- install -m 644 xkbevd/example.cf \
- debian/x11-xkb-utils/usr/share/doc/x11-xkb-utils/xkbevd-example.cf
- dh_installchangelogs
- dh_link
- dh_strip
- dh_compress
- dh_fixperms
- dh_makeshlibs
- dh_shlibdeps
- dh_installdeb
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-# Build architecture-independent files here.
-binary-indep: build install
-# Nothing to do
+override_dh_auto_clean: $(addprefix clean-, $(SUBDIRS))
+ rm -rf $(STAMP_DIR)
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
+clean-%:
+ dh_auto_clean -D$* -B$*-build
.PHONY: get-tarballs
get-tarballs: $(addprefix get-tarball-,$(SUBDIRS))
diff --git a/debian/x11-xkb-utils.docs b/debian/x11-xkb-utils.docs
new file mode 100644
index 0000000..82ead1e
--- /dev/null
+++ b/debian/x11-xkb-utils.docs
@@ -0,0 +1 @@
+xkbevd/example.cf
commit cb21262000156e277bb64abb1c3af53dee79669a
Author: Julien Cristau <jcristau@debian.org>
Date: Wed Dec 25 13:04:29 2013 +0100
xkbutils 1.0.4.
diff --git a/debian/changelog b/debian/changelog
index 722750f..d3457a7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+x11-xkb-utils (7.7+1) UNRELEASED; urgency=medium
+
+ * xkbutils 1.0.4.
+
+ -- Julien Cristau <jcristau@debian.org> Wed, 25 Dec 2013 13:04:17 +0100
+
x11-xkb-utils (7.7~1) unstable; urgency=low
* setxkbmap 1.3 0
diff --git a/xkbutils/ChangeLog b/xkbutils/ChangeLog
index 058b94a..1e392e4 100644
--- a/xkbutils/ChangeLog
+++ b/xkbutils/ChangeLog
@@ -1,3 +1,206 @@
+commit 34efe0c4ec0d0e93e044448baabbdaa6d46e7415
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sun Feb 10 15:46:54 2013 -0800
+
+ xkbutils 1.0.4
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit ff8ee7eeee694476140fe51fc0a47f9c694c5541
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Jan 12 22:06:03 2013 -0800
+
+ Declare bit to shift as unsigned to clear compiler warning
+
+ "xkbvleds.c", line 343: warning: integer overflow detected: op "<<"
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 10105c373b973ef73b8ab19ee62fc152b7230da2
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Jan 12 22:00:30 2013 -0800
+
+ Add -version flags to all three commands
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 5a4bb361aa2247c552f807f162a9fd0e60305ec4
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Jan 12 21:33:23 2013 -0800
+
+ Combine usage message strings/calls
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 7a588b73582cb178acdb6c6b578d87f98cebfec9
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Jan 12 21:11:08 2013 -0800
+
+ Delete more unused macros from utils.h
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 9fbe47e349fb261a3845c3c74f8832dbadfdbe8d
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Jan 12 21:02:39 2013 -0800
+
+ Remove unused u*alloc functions from utils.c
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit c968ddd21a83f64c5bbe26b1b3adbfcfd3d04ff7
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Jan 12 20:45:14 2013 -0800
+
+ Remove unused uStringDup function
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit eeb4cc1251c01fe9d8097224a780c18a3b35b5d0
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Jan 12 20:41:30 2013 -0800
+
+ Make configure actually check for strcasecmp
+
+ utils.h & utils.c had #ifdefs to check for it, and only define their
+ fallback if HAVE_STRCASECMP was not defined, but we never defined it.
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 2c4d682b6afcfbddb70690efd7536afb98f9a97e
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Jan 12 19:42:23 2013 -0800
+
+ Remove unused debug & function tracing infrastructure from utils.c
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 4c516e1b0ad66586e3f770d988de775481482e1a
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Jan 12 19:36:43 2013 -0800
+
+ Mark uFatalError as _X_NORETURN
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit b33ad85fe9190d2ddbddb3422cc06a5a36c0cde6
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Jan 12 19:33:36 2013 -0800
+
+ Add printf attributes to utils.c printing functions
+
+ Doesn't find any problems, but clears -Wmissing-format-attribute warnings
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit b93888eb689485d9899cbf7c224b20d68968e857
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Jan 12 19:28:11 2013 -0800
+
+ Declare utils.c functions as taking const char * arguments
+
+ Clears dozens of const string warnings from gcc.
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 0ba7294e8e5ca61b03ef7c76da7d381e93eaf937
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Jan 12 19:13:28 2013 -0800
+
+ config: Add missing AC_CONFIG_SRCDIR
+
+ Regroup AC statements under the Autoconf initialization section.
+ Regroup AM statements under the Automake initialization section.
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 50a779c50b1303baa6bcea91d00da176a77431f5
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Jan 12 19:11:25 2013 -0800
+
+ unifdef CRAY
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 1c18ce20a45f5cf66ace8d0ade1fa76c032c0f9f
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Jan 12 19:06:49 2013 -0800
+
+ Remove unused streq() macro
+
+ LED.c:37:9: warning: macro is not used [-Wunused-macros]
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 4b3f2f1b71188344fe2e313de6a53a702ab37bb1
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Jan 12 18:56:20 2013 -0800
+
+ Remove unused #ifdef notyet typedef
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 8d68ee228a0031f367cd3edef9d6f9dace984cc6
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Jan 12 18:55:16 2013 -0800
+
+ Remove CVS version tags
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit fdbff6587f29048c85772f21d3647797f96d527f
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Jan 12 18:53:47 2013 -0800
+
+ Convert to X.Org standard coding style
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit e3092ad9d9742630aa34044c7a37802ccfc6ee61
+Author: Jeremy Huddleston <jeremyhu@apple.com>
+Date: Sat May 7 21:41:13 2011 -0700
+
+ Fix typo in SetValues which could fail to detect a change if only width/height changed
+
+ LED.c:249:25: warning: Both operands to '!=' always have the same value
+ || curlw->core.height != curlw->core.height) {
+ ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~
+ LED.c:248:24: warning: Both operands to '!=' always have the same value
+ || curlw->core.width != curlw->core.width
+ ~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~
+
+ Found-by: clang static analyzer
+ Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
+
+commit 01ee88f0c5e66bde5fed99c520e3bdc679740b96
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Wed Jan 19 10:06:56 2011 -0500
+
+ config: move man pages into their own directory
+
+ Use services provided by XORG_MANPAGE_SECTIONS.
+ Use standard Makefile for man pages.
+
+ Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 3e4ab9da78e921bcad36ca2e96cffaafa0866472
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Thu Jan 13 11:15:47 2011 -0500
+
+ man: remove trailing spaces and tabs
+
+ Using s/[ \t]*$//
+
+ Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit a178a34f95c5ce7986a129df48a698f5545c6d01
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Wed Jan 12 16:28:02 2011 -0500
+
+ config: replace deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADERS
+
+ This silences an Autoconf warning
+
commit 820d9be7cf4e501c931c4e31b38ddd2d55209ce2
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Oct 30 10:14:38 2010 -0700
diff --git a/xkbutils/LED.c b/xkbutils/LED.c
index b463074..0f5b8fa 100644
--- a/xkbutils/LED.c
+++ b/xkbutils/LED.c
@@ -1,4 +1,3 @@
-/* $Xorg: LED.c,v 1.3 2000/08/17 19:54:51 cpqbld Exp $ */
/************************************************************
Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc.
@@ -24,7 +23,6 @@
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
-/* $XFree86: xc/programs/xkbutils/LED.c,v 1.4 2001/01/17 23:46:13 dawes Exp $ */
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
@@ -33,15 +31,8 @@
#include "LEDP.h"
#include <stdio.h>
#include <ctype.h>
-/* needed for abs() */
#include <stdlib.h>
-#define streq(a,b) (strcmp( (a), (b) ) == 0)
-
-#ifdef CRAY
-#define WORD64
-#endif
-
/****************************************************************
*
* Full class record constant
@@ -53,139 +44,148 @@
#define offset(field) XtOffsetOf(LEDRec, field)
static XtResource resources[] = {
{XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
- offset(led.foreground), XtRString, XtDefaultForeground},
+ offset(led.foreground), XtRString, XtDefaultForeground},
{XtNon, XtCOn, XtRBoolean, sizeof(Boolean),
- offset(led.on), XtRImmediate, (XtPointer)False},
+ offset(led.on), XtRImmediate, (XtPointer) False},
{XtNtopColor, XtCTopColor, XtRPixel, sizeof(Pixel),
- offset(led.top_color), XtRString, "black"},
+ offset(led.top_color), XtRString, "black"},
{XtNbottomColor, XtCBottomColor, XtRPixel, sizeof(Pixel),
- offset(led.bottom_color), XtRString, "white"},
+ offset(led.bottom_color), XtRString, "white"},
{XtNonColor, XtCOnColor, XtRPixel, sizeof(Pixel),
- offset(led.on_color), XtRString, "green"},
+ offset(led.on_color), XtRString, "green"},
{XtNoffColor, XtCOffColor, XtRPixel, sizeof(Pixel),
- offset(led.off_color), XtRString, "#005000"},
+ offset(led.off_color), XtRString, "#005000"},
{XtNbevel, XtCBevel, XtRDimension, sizeof(Dimension),
- offset(led.bevel), XtRImmediate, (XtPointer)1},
+ offset(led.bevel), XtRImmediate, (XtPointer) 1},
{XtNledWidth, XtCLedWidth, XtRDimension, sizeof(Dimension),
- offset(led.led_width), XtRImmediate, (XtPointer)6},
+ offset(led.led_width), XtRImmediate, (XtPointer) 6},
{XtNledHeight, XtCLedHeight, XtRDimension, sizeof(Dimension),
- offset(led.led_height), XtRImmediate, (XtPointer)12}
+ offset(led.led_height), XtRImmediate, (XtPointer) 12}
};
#undef offset
-static void ClassInitialize ( void );
-static void Initialize ( Widget request, Widget new, ArgList args,
- Cardinal *num_args );
-static void Realize ( Widget w, Mask * mask, XSetWindowAttributes * xswa );
-static void Resize ( Widget w );
-static Boolean SetValues ( Widget current, Widget request, Widget new,
- ArgList args, Cardinal *num_args );
-static void Destroy ( Widget w );
-static XtGeometryResult QueryGeometry ( Widget w, XtWidgetGeometry *intended,
- XtWidgetGeometry *preferred );
+static void ClassInitialize(void);
+static void Initialize(Widget request, Widget new, ArgList args,
+ Cardinal *num_args);
+static void Realize(Widget w, Mask *mask, XSetWindowAttributes *xswa);
+static void Resize(Widget w);
+static Boolean SetValues(Widget current, Widget request, Widget new,
+ ArgList args, Cardinal *num_args);
+static void Destroy(Widget w);
+static XtGeometryResult QueryGeometry(Widget w, XtWidgetGeometry *intended,
+ XtWidgetGeometry *preferred);
LEDClassRec ledClassRec = {
- {
-/* core_class fields */
- /* superclass */ (WidgetClass) &simpleClassRec,
- /* class_name */ "LED",
- /* widget_size */ sizeof(LEDRec),
- /* class_initialize */ ClassInitialize,
- /* class_part_initialize */ NULL,
- /* class_inited */ FALSE,
- /* initialize */ Initialize,
- /* initialize_hook */ NULL,
- /* realize */ Realize,
- /* actions */ NULL,
- /* num_actions */ 0,
- /* resources */ resources,
- /* num_resources */ XtNumber(resources),
- /* xrm_class */ NULLQUARK,
- /* compress_motion */ TRUE,
- /* compress_exposure */ TRUE,
- /* compress_enterleave */ TRUE,
- /* visible_interest */ FALSE,
- /* destroy */ Destroy,
- /* resize */ Resize,
- /* expose */ XtInheritExpose,
- /* set_values */ SetValues,
- /* set_values_hook */ NULL,
- /* set_values_almost */ XtInheritSetValuesAlmost,
- /* get_values_hook */ NULL,
- /* accept_focus */ NULL,
- /* version */ XtVersion,
- /* callback_private */ NULL,
- /* tm_table */ NULL,
- /* query_geometry */ QueryGeometry,
- /* display_accelerator */ XtInheritDisplayAccelerator,
- /* extension */ NULL
- },
+ {
+/* core_class fields */
+ /* superclass */ (WidgetClass) & simpleClassRec,
+ /* class_name */ "LED",
+ /* widget_size */ sizeof(LEDRec),
+ /* class_initialize */ ClassInitialize,
+ /* class_part_initialize */ NULL,
+ /* class_inited */ FALSE,
+ /* initialize */ Initialize,
+ /* initialize_hook */ NULL,
+ /* realize */ Realize,
+ /* actions */ NULL,
+ /* num_actions */ 0,
+ /* resources */ resources,
+ /* num_resources */ XtNumber(resources),
+ /* xrm_class */ NULLQUARK,
+ /* compress_motion */ TRUE,
+ /* compress_exposure */ TRUE,
+ /* compress_enterleave */ TRUE,
+ /* visible_interest */ FALSE,
+ /* destroy */ Destroy,
+ /* resize */ Resize,
+ /* expose */ XtInheritExpose,
+ /* set_values */ SetValues,
+ /* set_values_hook */ NULL,
+ /* set_values_almost */ XtInheritSetValuesAlmost,
+ /* get_values_hook */ NULL,
+ /* accept_focus */ NULL,
+ /* version */ XtVersion,
+ /* callback_private */ NULL,
+ /* tm_table */ NULL,
+ /* query_geometry */ QueryGeometry,
+ /* display_accelerator */ XtInheritDisplayAccelerator,
+ /* extension */ NULL
+ },
/* Simple class fields initialization */
- {
- /* change_sensitive */ XtInheritChangeSensitive
- },
+ {
+ /* change_sensitive */ XtInheritChangeSensitive
+ },
/* LED class fields initialization */
- {
- /* ignore */ 0
- }
+ {
+ /* ignore */ 0
+ }
};
-WidgetClass ledWidgetClass = (WidgetClass)&ledClassRec;
+WidgetClass ledWidgetClass = (WidgetClass) &ledClassRec;
+
/****************************************************************
*
* Private Procedures
*
****************************************************************/
-static void
+static void
ClassInitialize(void)
{
XawInitializeWidgetSet();
}
-static void
+static void
GetPixmaps(LEDWidget lw)
{
- XGCValues values;
- GC gc;
- Display * dpy;
- Window root;
- Pixmap pix,on_pixmap,off_pixmap;
- Dimension bevel,width,height;
+ XGCValues values;
+ GC gc;
+ Display *dpy;
+ Window root;
+ Pixmap pix, on_pixmap, off_pixmap;
+ Dimension bevel, width, height;
- dpy= XtDisplay((Widget)lw);
- root= RootWindowOfScreen(XtScreen((Widget)lw));
- if (lw->led.on_pixmap!=None) {
- XFreePixmap(dpy,lw->led.on_pixmap);
- lw->led.on_pixmap= None;
+ dpy = XtDisplay((Widget) lw);
+ root = RootWindowOfScreen(XtScreen((Widget) lw));
+ if (lw->led.on_pixmap != None) {
+ XFreePixmap(dpy, lw->led.on_pixmap);
+ lw->led.on_pixmap = None;
}
- if (lw->led.off_pixmap!=None) {
- XFreePixmap(dpy,lw->led.off_pixmap);
- lw->led.off_pixmap= None;
+ if (lw->led.off_pixmap != None) {
+ XFreePixmap(dpy, lw->led.off_pixmap);
+ lw->led.off_pixmap = None;
}
- lw->led.on_pixmap= on_pixmap= XCreatePixmap(dpy,root,
- lw->core.width,lw->core.height,lw->core.depth);
- lw->led.off_pixmap= off_pixmap= XCreatePixmap(dpy,root,
- lw->core.width,lw->core.height,lw->core.depth);
+ lw->led.on_pixmap = on_pixmap =
+ XCreatePixmap(dpy, root, lw->core.width, lw->core.height,
+ lw->core.depth);
+ lw->led.off_pixmap = off_pixmap =
+ XCreatePixmap(dpy, root, lw->core.width, lw->core.height,
+ lw->core.depth);
- values.foreground = lw->led.top_color;
- gc= XCreateGC(dpy,lw->led.on_pixmap,(unsigned)GCForeground,&values);
- bevel= lw->led.bevel;
- width= lw->core.width;
- height= lw->core.height;
- XFillRectangle(dpy,on_pixmap,gc,0,0,width,height);
- XFillRectangle(dpy,off_pixmap,gc,0,0,width,height);
- XSetForeground(dpy,gc,lw->led.bottom_color);
- XFillRectangle(dpy,on_pixmap,gc,bevel,bevel,width-bevel,height-bevel);
- XFillRectangle(dpy,off_pixmap,gc,bevel,bevel,width-bevel,height-bevel);
- XSetForeground(dpy,gc,lw->led.on_color);
- XFillRectangle(dpy,on_pixmap,gc,bevel,bevel,width-2*bevel,height-2*bevel);
- XSetForeground(dpy,gc,lw->led.off_color);
- XFillRectangle(dpy,off_pixmap,gc,bevel,bevel,width-2*bevel,height-2*bevel);
- XFreeGC(dpy,gc);
- if (lw->led.on) pix= on_pixmap;
- else pix= off_pixmap;
- if (XtWindow((Widget)lw)!=None)
- XSetWindowBackgroundPixmap(dpy,XtWindow((Widget)lw),pix);
+ values.foreground = lw->led.top_color;
+ gc = XCreateGC(dpy, lw->led.on_pixmap, (unsigned) GCForeground, &values);
+ bevel = lw->led.bevel;
+ width = lw->core.width;
+ height = lw->core.height;
+ XFillRectangle(dpy, on_pixmap, gc, 0, 0, width, height);
+ XFillRectangle(dpy, off_pixmap, gc, 0, 0, width, height);
+ XSetForeground(dpy, gc, lw->led.bottom_color);
+ XFillRectangle(dpy, on_pixmap, gc, bevel, bevel, width - bevel,
+ height - bevel);
+ XFillRectangle(dpy, off_pixmap, gc, bevel, bevel, width - bevel,
+ height - bevel);
+ XSetForeground(dpy, gc, lw->led.on_color);
+ XFillRectangle(dpy, on_pixmap, gc, bevel, bevel, width - 2 * bevel,
+ height - 2 * bevel);
+ XSetForeground(dpy, gc, lw->led.off_color);
+ XFillRectangle(dpy, off_pixmap, gc, bevel, bevel, width - 2 * bevel,
+ height - 2 * bevel);
+ XFreeGC(dpy, gc);
+ if (lw->led.on)
+ pix = on_pixmap;
+ else
+ pix = off_pixmap;
+ if (XtWindow((Widget) lw) != None)
+ XSetWindowBackgroundPixmap(dpy, XtWindow((Widget) lw), pix);
return;
}
@@ -199,32 +199,34 @@ Initialize(Widget request, Widget new, ArgList args, Cardinal *num_args)
lw->core.height = lw->led.led_height;
if (lw->core.width == 0)
lw->core.width = lw->led.led_width;
- lw->core.border_width= 0;
- if (lw->led.bevel==0)
- lw->led.bevel= 1;
- lw->led.on_pixmap= lw->led.off_pixmap= None;
- (*XtClass(new)->core_class.resize) ((Widget)lw);
+ lw->core.border_width = 0;
+ if (lw->led.bevel == 0)
+ lw->led.bevel = 1;
+ lw->led.on_pixmap = lw->led.off_pixmap = None;
+ (*XtClass(new)->core_class.resize) ((Widget) lw);
GetPixmaps(lw);
-} /* Initialize */
+} /* Initialize */
static void
Realize(Widget w, Mask *mask, XSetWindowAttributes *xswa)
{
- LEDWidget lw = (LEDWidget)w;
+ LEDWidget lw = (LEDWidget) w;
WidgetClass super = simpleWidgetClass;
- Pixmap pix;
+ Pixmap pix;
- (*super->core_class.realize)(w,mask,xswa);
- if (lw->led.on) pix= lw->led.on_pixmap;
- else pix= lw->led.off_pixmap;
- XSetWindowBackgroundPixmap(XtDisplay(w),XtWindow(w),pix);
+ (*super->core_class.realize) (w, mask, xswa);
+ if (lw->led.on)
+ pix = lw->led.on_pixmap;
+ else
+ pix = lw->led.off_pixmap;
+ XSetWindowBackgroundPixmap(XtDisplay(w), XtWindow(w), pix);
return;
}
-static void
+static void
Resize(Widget w)
{
- GetPixmaps((LEDWidget)w);
+ GetPixmaps((LEDWidget) w);
return;
}
@@ -232,71 +234,72 @@ Resize(Widget w)
* Set specified arguments into widget
*/
-static Boolean
-SetValues(Widget current, Widget request, Widget new,
- ArgList args, Cardinal *num_args)
+static Boolean
+SetValues(Widget current, Widget request, Widget new,
+ ArgList args, Cardinal *num_args)
{
LEDWidget curlw = (LEDWidget) current;
LEDWidget newlw = (LEDWidget) new;
Boolean changed;
- changed= FALSE;
- if (curlw->led.foreground != newlw->led.foreground
- || curlw->core.background_pixel != newlw->core.background_pixel
- || curlw->led.on_color != newlw->led.on_color
- || curlw->led.off_color != newlw->led.off_color
- || curlw->core.width != curlw->core.width
- || curlw->core.height != curlw->core.height) {
- GetPixmaps(newlw);
- changed= TRUE;
+ changed = FALSE;
+ if (curlw->led.foreground != newlw->led.foreground
+ || curlw->core.background_pixel != newlw->core.background_pixel
+ || curlw->led.on_color != newlw->led.on_color
+ || curlw->led.off_color != newlw->led.off_color
+ || curlw->core.width != newlw->core.width
+ || curlw->core.height != newlw->core.height) {
+ GetPixmaps(newlw);
+ changed = TRUE;
}
- if (curlw->led.on!=newlw->led.on) {
- Pixmap pix;
+ if (curlw->led.on != newlw->led.on) {
+ Pixmap pix;
- if (newlw->led.on) pix= newlw->led.on_pixmap;
- else pix= newlw->led.off_pixmap;
+ if (newlw->led.on)
+ pix = newlw->led.on_pixmap;
+ else
+ pix = newlw->led.off_pixmap;
- if (XtWindow(newlw)!=None)
- XSetWindowBackgroundPixmap(XtDisplay(newlw),XtWindow(newlw),pix);
- changed= TRUE;
+ if (XtWindow(newlw) != None)
+ XSetWindowBackgroundPixmap(XtDisplay(newlw), XtWindow(newlw), pix);
+ changed = TRUE;
}
return changed;
}
-static void
+static void
Destroy(Widget w)
{
- LEDWidget lw = (LEDWidget)w;
+ LEDWidget lw = (LEDWidget) w;
- if (lw->led.on_pixmap!=None) {
- XFreePixmap(XtDisplay(w),lw->led.on_pixmap);
- lw->led.on_pixmap= None;
+ if (lw->led.on_pixmap != None) {
+ XFreePixmap(XtDisplay(w), lw->led.on_pixmap);
+ lw->led.on_pixmap = None;
}
- if (lw->led.off_pixmap!=None) {
- XFreePixmap(XtDisplay(w),lw->led.off_pixmap);
- lw->led.off_pixmap= None;
+ if (lw->led.off_pixmap != None) {
+ XFreePixmap(XtDisplay(w), lw->led.off_pixmap);
+ lw->led.off_pixmap = None;
}
return;
}
-
-static XtGeometryResult
-QueryGeometry(Widget w, XtWidgetGeometry *intended,
- XtWidgetGeometry *preferred)
+static XtGeometryResult
+QueryGeometry(Widget w, XtWidgetGeometry *intended,
+ XtWidgetGeometry *preferred)
{
- LEDWidget lw = (LEDWidget)w;
+ LEDWidget lw = (LEDWidget) w;
preferred->request_mode = CWWidth | CWHeight;
preferred->width = lw->led.led_height;
preferred->height = lw->led.led_width;
- if ( ((intended->request_mode & (CWWidth | CWHeight))
- == (CWWidth | CWHeight)) &&
- intended->width == preferred->width &&
- intended->height == preferred->height)
- return XtGeometryYes;
+ if (((intended->request_mode & (CWWidth | CWHeight))
+ == (CWWidth | CWHeight)) &&
+ intended->width == preferred->width &&
+ intended->height == preferred->height)
+ return XtGeometryYes;
else if (preferred->width == w->core.width &&
- preferred->height == w->core.height)
- return XtGeometryNo;
+ preferred->height == w->core.height)
Reply to: