SHA256
1
0
forked from pool/libXaw3d

Accepting request 205145 from home:WernerFink:branches:home:jengelh:dev

Make the work Jan Engelhardt fit into the ELF scheme, see SR #179028

OBS-URL: https://build.opensuse.org/request/show/205145
OBS-URL: https://build.opensuse.org/package/show/X11:Utilities/libXaw3d?expand=0&rev=1
This commit is contained in:
Dr. Werner Fink 2013-10-29 16:27:41 +00:00 committed by Git OBS Bridge
commit de3d5d4a6e
14 changed files with 2908 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

25
README.SuSE Normal file
View File

@ -0,0 +1,25 @@
Note:
This /usr/lib/Xaw3d/libXaw8.so.8.0 is a real
libXaw3d.so.8.0 linked with `-soname libXaw8.so.8'.
Therfore do _NOT_ replace /usr/lib/libXaw8.so.8.0.0
by /usr/lib/Xaw3d/libXaw.so.8.0
On any problem starting X11 programs please remove the
package xaw3dd.
Achtung:
Die Bibliothek /usr/lib/Xaw3d/libXaw8.so.8.0 ist
in Wirklichkeit eine libXaw3d.so.8.0, die mit der
Option `-soname libXaw8.so.8' gelinkt wurde.
Darum ersetzten Sie auf KEINEN Fall /usr/lib/libXaw8.so.8.0.0
durch /usr/lib/Xaw3d/libXaw8.so.8.0.
Falls Sie irgendwelche Probleme mit X11-Programmen haben,
deinstallieren Sie das Paket xaw3dd.
Werner Fink <feedback@suse.de>

8
baselibs.conf Normal file
View File

@ -0,0 +1,8 @@
libXaw3d6
libXaw3d7
libXaw3d8
libXaw3d-devel
requires -libXaw3d-<targettype>
requires "libXaw3d6-<targettype> = <version>"
requires "libXaw3d7-<targettype> = <version>"
requires "libXaw3d8-<targettype> = <version>"

3
libXaw3d-1.6.2.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b74f11681061c1492c03cbbe6e318f9635b3877af0761fc0e67e1467c3a6972b
size 551851

280
libXaw3d.changes Normal file
View File

@ -0,0 +1,280 @@
-------------------------------------------------------------------
Tue Oct 29 16:11:10 UTC 2013 - werner@suse.de
- Make the libraries ELF compatible that is that each library has
its own soname as otherwise the runtime linker may show warnings
- Enable the configure options for internationalization,
multiplane-bitmaps, gray-stipples, and arrow-scrollbars
-------------------------------------------------------------------
Fri Jun 14 23:31:46 UTC 2013 - jengelh@inai.de
- Rename xaw3d to libXaw3d. Use libXaw.spec and xaw3d.changes as base.
- Kill unused Conflicts: axe
- Update to new upstream release 1.6.2 (update from prior 1.5E
released on 2003-04-17)
* Nuke unused source code, resolve many compile warnings,
switch to autotools
- Drop Xaw3d-1.5E-compat.patch, Xaw3d-1.5E-gvI18N.patch,
Xaw3d-1.5E-null.patch, Xaw3d-1.5E-close-destroy-crash.patch
(merged upstream).
- Drop Xaw3d-1.5E-cast.patch (resolved differently upstream).
- Rebased and renamed remaining patches from Xaw3d-1.5E-* to xaw3d-*
-------------------------------------------------------------------
Tue Aug 9 14:42:06 UTC 2011 - werner@suse.de
- Correct path of latest change as .conf is required
-------------------------------------------------------------------
Mon Jul 4 09:51:40 UTC 2011 - aj@suse.de
- Add /etc/ld.so.conf.d/xaw3dd for ldconfig (bnc#671725).
-------------------------------------------------------------------
Tue Aug 10 17:10:18 CEST 2010 - werner@suse.de
- Add missing Xaw.so.7 version of Xaw3d (bnc#627314)
-------------------------------------------------------------------
Thu Dec 17 16:27:17 CET 2009 - jengelh@medozas.de
- add baselbis.conf as a source
- enable parallel building
-------------------------------------------------------------------
Wed Aug 26 12:53:54 CEST 2009 - mls@suse.de
- make patch0 usage consistent
-------------------------------------------------------------------
Fri Apr 17 20:18:00 CEST 2009 - crrodriguez@suse.de
- remove static libraries
-------------------------------------------------------------------
Wed Jan 7 12:34:56 CET 2009 - olh@suse.de
- obsolete old -XXbit packages (bnc#437293)
-------------------------------------------------------------------
Mon Nov 3 16:17:24 CET 2008 - schwab@suse.de
- Fix broken cast.
-------------------------------------------------------------------
Thu Apr 10 12:54:45 CEST 2008 - ro@suse.de
- added baselibs.conf file to build xxbit packages
for multilib support
-------------------------------------------------------------------
Wed Jun 20 11:46:25 CEST 2007 - dmueller@suse.de
- fix crash on exit due access to free'ed memory
-------------------------------------------------------------------
Tue May 29 15:25:45 CEST 2007 - werner@suse.de
- Branch off xaw3d-devel to make RPMlint happy
-------------------------------------------------------------------
Thu Mar 29 15:37:23 CEST 2007 - coolo@suse.de
- BuildRequire bison and flex
-------------------------------------------------------------------
Wed Sep 13 13:42:13 CEST 2006 - werner@suse.de
- Add compatibility libs for binary only programs (bug #205169)
-------------------------------------------------------------------
Tue Sep 12 19:10:16 CEST 2006 - schwab@suse.de
- Fix soname of overriding libraries [#205169].
-------------------------------------------------------------------
Wed Aug 16 18:05:20 CEST 2006 - aj@suse.de
- Remove unneeded BuildRequires on xorg-x11.
-------------------------------------------------------------------
Fri Jul 28 17:15:37 CEST 2006 - werner@suse.de
- Make it build with X11R7
-------------------------------------------------------------------
Mon Feb 27 17:49:10 CET 2006 - schwab@suse.de
- Run ldconfig also in xaw3dd package.
-------------------------------------------------------------------
Wed Jan 25 21:31:06 CET 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
-------------------------------------------------------------------
Tue Nov 29 16:08:29 CET 2005 - werner@suse.de
- Avoid array overflow (bug #135587)
- Fix long standing bug: redraw shadows arounbd thumb if needed.
-------------------------------------------------------------------
Fri Jun 10 11:43:37 CEST 2005 - meissner@suse.de
- use RPM_OPT_FLAGS.
-------------------------------------------------------------------
Wed Feb 2 12:42:14 CET 2005 - meissner@suse.de
- use NULL at the end of XSetIC* XGetIC* calls to remove
warnings in gcc 4. (same way that Xaw in Xlib uses already).
-------------------------------------------------------------------
Tue Sep 21 15:50:09 CEST 2004 - werner@suse.de
- Abort on missing fontset during initialization (bug #44037)
-------------------------------------------------------------------
Tue Sep 7 12:46:31 CEST 2004 - werner@suse.de
- Add some check to abort if the Xt lib does not find fonts or
fontsets (bug #44037)
-------------------------------------------------------------------
Sat Sep 4 23:39:22 CEST 2004 - ro@suse.de
- official major version changed from 7 to 8
-------------------------------------------------------------------
Thu Aug 26 16:48:10 CEST 2004 - werner@suse.de
- Be sure that scrollbars occurs and remain if needed
- More compatibility to Xaw
- Do not forget fontset check
-------------------------------------------------------------------
Fri Apr 30 14:55:33 CEST 2004 - werner@suse.de
- Add patch to avoid crash within resource handling (mainly for gv)
-------------------------------------------------------------------
Mon Apr 26 15:24:21 CEST 2004 - werner@suse.de
- Avoid compiler warnings.
-------------------------------------------------------------------
Wed Feb 4 14:50:01 CET 2004 - werner@suse.de
- I like labels with 3D shadow
-------------------------------------------------------------------
Sat Jan 10 16:00:03 CET 2004 - adrian@suse.de
- build as user
-------------------------------------------------------------------
Tue Jul 1 11:53:25 CEST 2003 - werner@suse.de
- Avaiod nasty `Actions not found: StartScroll' message
-------------------------------------------------------------------
Wed May 28 15:41:39 CEST 2003 - coolo@suse.de
- use BuildRoot
-------------------------------------------------------------------
Mon May 19 18:34:16 CEST 2003 - werner@suse.de
- Don't crash on wrong cast's: add compat patch
-------------------------------------------------------------------
Mon May 5 15:30:11 CEST 2003 - werner@suse.de
- Update to Xaw3d-1.5E
* Add our thumb patch
* Add our secure patch
* Add our hsbar patch
-------------------------------------------------------------------
Fri Apr 5 18:31:02 CEST 2002 - pmladek@suse.cz
- used macro %{_lib} to fix for lib64
-------------------------------------------------------------------
Thu Dec 14 17:25:19 CET 2000 - werner@suse.de
- Group tag
-------------------------------------------------------------------
Thu Jun 29 15:34:57 CEST 2000 - werner@suse.de
- Add security fixes done for libXaw
- lib version 6.1 is required by older programs
-------------------------------------------------------------------
Fri May 12 11:50:18 CEST 2000 - schwab@suse.de
- Update library version number.
- Use %{_defaultdocdir}.
- Fix Scrollbar.c for all archs.
-------------------------------------------------------------------
Fri Mar 31 12:51:12 CEST 2000 - nadvornik@suse.cz
- removed /usr/X11R6/include/X11 from filelist
-------------------------------------------------------------------
Fri Oct 29 12:18:30 MEST 1999 - kukuk@suse.de
- fix Scrollbar.c for alpha
-------------------------------------------------------------------
Mon Sep 27 16:31:01 CEST 1999 - bs@suse.de
- fixed requirements for sub packages
-------------------------------------------------------------------
Mon Sep 13 17:23:57 CEST 1999 - bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
-------------------------------------------------------------------
Tue Apr 27 16:25:25 CEST 1999 - werner@suse.de
- Fix some `inner else'
-------------------------------------------------------------------
Tue Apr 27 14:45:25 MEST 1999 - ro@suse.de
- update to 1.5
-------------------------------------------------------------------
Thu Nov 12 15:15:48 MET 1998 - bs@suse.de
- fixed spec file for new rpm.
----------------------------------------------------------------------
Mon May 25 17:54:49 MET DST 1998 - werner@suse.de
- Add addable security fixes of XFree86[tm] patch 3.3.2-patch2
- Second *unused* patch to be able to reverse the background
feature of scrollbars
----------------------------------------------------------------------
Tue May 5 23:29:54 MET DST 1998 - werner@suse.de
- Update to new release 1.4
* add some small fixes
- Added some changes from Dimitrios P. Bouras
(background color for scrollbar, ...)
----------------------------------------------------------------------
Tue Oct 21 22:48:01 MET DST 1997 - werner@suse.de
- some changes for the new XFree86[tm] release
----------------------------------------------------------------------
23.08.96: (1.3)
- Update von 1.2a Original + 1.1 Patch für scrollbar
- 1.3 braucht kein scrollbar-3d patch mehr
allerdings können bei 1.3 die Pfeile nicht gedrückt
werden und die Resource scrollbarBackground arbeitet
nicht.

233
libXaw3d.spec Normal file
View File

@ -0,0 +1,233 @@
#
# spec file for package libXaw3d
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: libXaw3d
Version: 1.6.2
Release: 0
Summary: The 3D Athena Widget Set
License: MIT
Group: Development/Libraries/C and C++
Url: http://xorg.freedesktop.org/
#Git-Clone: git://anongit.freedesktop.org/xorg/lib/libXaw3d
#Git-Web: http://cgit.freedesktop.org/xorg/lib/libXaw3d/
#Freecode-URL: http://freecode.com/projects/xaw3d
Source: http://xorg.freedesktop.org/releases/individual/lib/%name-%version.tar.bz2
Source2: README.SuSE
Patch1: xaw3d-secure.patch
Patch2: xaw3d-thumb.patch
Patch3: xaw3d-hsbar.patch
Patch4: xaw3d-3dlabel.patch
Patch5: xaw3d-fontset.patch
Patch6: xaw3d-elf.patch
Patch7: xaw3d.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#git#BuildRequires: autoconf >= 2.60, automake, libtool
BuildRequires: bison
BuildRequires: flex
BuildRequires: pkgconfig
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xext)
BuildRequires: pkgconfig(xmu)
BuildRequires: pkgconfig(xorg-macros) >= 1.8
BuildRequires: pkgconfig(xt)
BuildRequires: xorg-x11-devel
%description
Xaw3d is a general-purpose replacement for the Athena toolkit which
adds a 3D appearance and support for XPM images.
This is a library that can be used instead of the standard
Athena Widget Library. It has tried to keep the standard of the
libXaw library. There are also programs which explicitly use this
library (this is the reason why the library was included).
NOTE: Do NOT replace /usr/lib/libXaw.so.6.1!
%package -n libXaw3d6
Summary: The 3D Athena Widget Set
Group: System/Libraries
Requires: libXaw3d8 = %version
%ifarch ppc64 s390x x86_64 sparc64
Provides: libXaw3d.so.6()(64bit)
%else
Provides: libXaw3d.so.6
%endif
%description -n libXaw3d6
Xaw3d is a general-purpose replacement for the Athena toolkit which
adds a 3D appearance and support for XPM images.
%package -n libXaw3d7
Summary: The 3D Athena Widget Set
Group: System/Libraries
Requires: libXaw3d8 = %version
%ifarch ppc64 s390x x86_64 sparc64
Provides: libXaw3d.so.7()(64bit)
%else
Provides: libXaw3d.so.7
%endif
%description -n libXaw3d7
Xaw3d is a general-purpose replacement for the Athena toolkit which
adds a 3D appearance and support for XPM images.
%package -n libXaw3d8
Summary: The 3D Athena Widget Set
Group: System/Libraries
Provides: Xaw3d = %version-%release
# bug437293
%ifarch ppc64
Obsoletes: xaw3d-64bit
%endif
# Added for 13.1
Obsoletes: xaw3d < %version-%release
Provides: xaw3d = %version-%release
%description -n libXaw3d8
Xaw3d is a general-purpose replacement for the Athena toolkit which
adds a 3D appearance and support for XPM images.
%package devel
Summary: Development files for the X Athena Widget Set
Group: Development/Libraries/C and C++
Requires: libXaw3d6 = %version
Requires: libXaw3d7 = %version
Requires: libXaw3d8 = %version
Provides: xaw3d:/usr/include/X11/Xaw3d/Xaw3dP.h
# bug437293
%ifarch ppc64
Obsoletes: xaw3d-devel-64bit
%endif
%description devel
Xaw3d is a general-purpose replacement for the Athena toolkit which
adds a 3D appearance and support for XPM images.
This package contains the development headers for the library found
in libXaw3d6/libXaw3d7/libXaw3d8.
%package -n xaw3dd
Summary: Select 3D Athena Widgets as a replacement for Athena Widgets
Group: System/Libraries
Requires: libXaw3d6 = %version
Requires: libXaw3d7 = %version
Requires: libXaw3d8 = %version
# Not only for cakes -- the library is a lie, too.
%ifarch ppc64 s390x x86_64 sparc64
Provides: libXaw.so.6()(64bit)
Provides: libXaw6.so.6()(64bit)
Provides: libXaw.so.7()(64bit)
Provides: libXaw7.so.7()(64bit)
Provides: libXaw.so.8()(64bit)
Provides: libXaw8.so.8()(64bit)
%else
Provides: libXaw.so.6
Provides: libXaw6.so.6
Provides: libXaw.so.7
Provides: libXaw7.so.7
Provides: libXaw.so.8
Provides: libXaw8.so.8
%endif
%description -n xaw3dd
Installation of this package will cause programs utilizing the Athena
Widget Toolkit to instead use the 3D Athena Widget set.
If any problems arise using or starting X Window System programs,
remove this package.
%prep
%setup -q
%patch -P 1 -P 2 -P 3 -P 4 -P 5 -P 6 -P 7 -p1
%build
%configure --docdir=%_docdir/%name --disable-static \
--enable-internationalization \
--enable-multiplane-bitmaps \
--enable-gray-stipples \
--enable-arrow-scrollbars \
--with-pic \
--with-gnu-ld \
make %{?_smp_mflags}
%install
make install DESTDIR=%buildroot
rm -vf %{buildroot}%{_libdir}/*.la
for i in 6 7; do
lib=libXaw3d.so.${i}.0.0
rm -vf %{buildroot}%{_libdir}/${lib}
install -m 0755 src/.mylibs/${lib} %{buildroot}%{_libdir}/
ln -sf ${lib} %{buildroot}%{_libdir}/libXaw3d.so.${i}
done
mkdir -p %{buildroot}%{_libdir}/Xaw3d
for i in 6 7 8; do
lib=libXaw.so.${i}.0.0
rm -vf %{buildroot}%{_libdir}/${lib}
rm -vf %{buildroot}%{_libdir}/Xaw3d/${lib}
install -m 0755 src/.mylibs/${lib} %{buildroot}%{_libdir}/Xaw3d/
ln -sf ${lib} %{buildroot}%{_libdir}/Xaw3d/libXaw.so.${i}
done
# Copy README here and then gobble it up via %%doc
mkdir -p %{buildroot}%_docdir/xaw3dd
cp %_sourcedir/README.SuSE %{buildroot}/%_docdir/xaw3dd/
ln -s %_docdir/xaw3dd/README.SuSE %{buildroot}%_libdir/Xaw3d/NOTE
# Create /etc/ld.so.conf.d/xaw3dd.conf
mkdir -p %{buildroot}%_sysconfdir/ld.so.conf.d
echo %_libdir/Xaw3d > %{buildroot}%_sysconfdir/ld.so.conf.d/xaw3dd.conf
%post -n libXaw3d6 -p /sbin/ldconfig
%postun -n libXaw3d6 -p /sbin/ldconfig
%post -n libXaw3d7 -p /sbin/ldconfig
%postun -n libXaw3d7 -p /sbin/ldconfig
%post -n libXaw3d8 -p /sbin/ldconfig
%postun -n libXaw3d8 -p /sbin/ldconfig
%post -n xaw3dd -p /sbin/ldconfig
%postun -n xaw3dd -p /sbin/ldconfig
%files -n libXaw3d6
%defattr(-,root,root)
%_libdir/libXaw3d.so.6*
%files -n libXaw3d7
%defattr(-,root,root)
%_libdir/libXaw3d.so.7*
%files -n libXaw3d8
%defattr(-,root,root)
%_libdir/libXaw3d.so.8*
%files devel
%defattr(-,root,root)
%_includedir/X11/Xaw3d/
%_libdir/libXaw3d.so
%_libdir/pkgconfig/xaw3d.pc
%_docdir/%name/
%files -n xaw3dd
%defattr(-,root,root)
%config %_sysconfdir/ld.so.conf.d/xaw3dd.conf
%_libdir/Xaw3d/
%doc %_libdir/Xaw3d/NOTE
%_docdir/xaw3dd/
%changelog

166
xaw3d-3dlabel.patch Normal file
View File

@ -0,0 +1,166 @@
---
src/Label.c | 65 +++++++++++++++++++++++++++++++++++++++++-------------------
1 file changed, 45 insertions(+), 20 deletions(-)
Index: libXaw3d-1.6.2/src/Label.c
===================================================================
--- libXaw3d-1.6.2.orig/src/Label.c
+++ libXaw3d-1.6.2/src/Label.c
@@ -418,9 +418,16 @@ GetgrayGC(LabelWidget lw)
static void
compute_bitmap_offsets (LabelWidget lw)
{
- if (lw->label.lbm_height != 0)
- lw->label.lbm_y = (lw->core.height - lw->label.lbm_height) / 2;
- else
+ /*
+ * bitmap will be eventually be displayed at
+ * (internal_width, internal_height + lbm_y)
+ */
+ if (lw->label.lbm_height != 0) {
+ lw->label.lbm_y = (lw->core.height -
+ (lw->threeD.shadow_width * 2 +
+ lw->label.internal_height * 2 +
+ lw->label.lbm_height)) / 2;
+ } else
lw->label.lbm_y = 0;
}
@@ -446,9 +453,11 @@ Initialize(Widget request, Widget new, A
{
LabelWidget lw = (LabelWidget) new;
+#if 0
/* disable shadows if we're not a subclass of Command */
if (!XtIsSubclass(new, commandWidgetClass))
lw->threeD.shadow_width = 0;
+#endif
if (lw->label.label == NULL)
lw->label.label = XtNewString(lw->core.name);
@@ -462,18 +471,20 @@ Initialize(Widget request, Widget new, A
if (lw->core.height == 0)
lw->core.height = lw->label.label_height +
- 2 * lw->label.internal_height;
+ 2 * lw->label.internal_height +
+ 2 * lw->threeD.shadow_width;
set_bitmap_info(lw); /* req's core.height, sets label.lbm_* */
if (lw->label.lbm_height > lw->label.label_height)
lw->core.height = lw->label.lbm_height +
- 2 * lw->label.internal_height;
+ 2 * lw->label.internal_height;
if (lw->core.width == 0)
lw->core.width = lw->label.label_width +
- 2 * lw->label.internal_width +
- LEFT_OFFSET(lw); /* req's label.lbm_width */
+ 2 * lw->label.internal_width +
+ 2 * lw->threeD.shadow_width +
+ LEFT_OFFSET(lw); /* req's label.lbm_width */
lw->label.label_x = lw->label.label_y = 0;
(*XtClass(new)->core_class.resize) ((Widget)lw);
@@ -551,14 +562,16 @@ Redisplay(Widget gw, XEvent *event, Regi
if (w->label.depth == 1)
XCopyPlane(XtDisplay(gw), pm, XtWindow(gw), gc, 0, 0,
w->label.lbm_width, w->label.lbm_height,
- (int) w->label.internal_width,
- (int) w->label.lbm_y,
+ (int) w->label.internal_width + w->threeD.shadow_width,
+ (int) w->label.internal_height + w->threeD.shadow_width
+ + w->label.lbm_y,
(unsigned long) 1L);
else
XCopyArea(XtDisplay(gw), pm, XtWindow(gw), gc, 0, 0,
w->label.lbm_width, w->label.lbm_height,
- (int) w->label.internal_width,
- (int) w->label.lbm_y);
+ (int) w->label.internal_width + w->threeD.shadow_width,
+ (int) w->label.internal_height + w->threeD.shadow_width
+ + w->label.lbm_y);
}
#ifdef XAW_INTERNATIONALIZATION
@@ -648,14 +661,16 @@ _Reposition(LabelWidget lw, Dimension wi
Position *dx, Position *dy)
{
Position newPos;
- Position leftedge = lw->label.internal_width + LEFT_OFFSET(lw);
+ Position leftedge = lw->label.internal_width + LEFT_OFFSET(lw) +
+ lw->threeD.shadow_width;
switch (lw->label.justify) {
case XtJustifyLeft:
newPos = leftedge;
break;
case XtJustifyRight:
- newPos = width - lw->label.label_width - lw->label.internal_width;
+ newPos = width - (lw->label.label_width + lw->label.internal_width +
+ lw->threeD.shadow_width);
break;
case XtJustifyCenter:
default:
@@ -747,17 +762,20 @@ SetValues(Widget current, Widget request
if (newlw->label.resize && was_resized) {
if (curlw->core.height == reqlw->core.height && !checks[HEIGHT])
newlw->core.height = newlw->label.label_height +
- 2 * newlw->label.internal_height;
+ 2 * newlw->label.internal_height +
+ 2 * newlw->threeD.shadow_width;
set_bitmap_info (newlw); /* req's core.height, sets label.lbm_* */
if (newlw->label.lbm_height > newlw->label.label_height)
newlw->core.height = newlw->label.lbm_height +
- 2 * newlw->label.internal_height;
+ 2 * newlw->label.internal_height +
+ 2 * newlw->threeD.shadow_width;
if (curlw->core.width == reqlw->core.width && !checks[WIDTH])
newlw->core.width = newlw->label.label_width +
2 * newlw->label.internal_width +
+ 2 * newlw->threeD.shadow_width +
LEFT_OFFSET(newlw); /* req's label.lbm_width */
}
@@ -766,15 +784,20 @@ SetValues(Widget current, Widget request
if (checks[HEIGHT]) {
if (newlw->label.label_height > newlw->label.lbm_height)
i = newlw->label.label_height +
- 2 * newlw->label.internal_height;
+ 2 * newlw->label.internal_height +
+ 2 * newlw->threeD.shadow_width;
else
- i = newlw->label.lbm_height + 2 * newlw->label.internal_height;
+ i = newlw->label.lbm_height +
+ 2 * newlw->label.internal_height +
+ 2 * newlw->threeD.shadow_width;
if (i > newlw->core.height)
newlw->core.height = i;
}
if (checks[WIDTH]) {
- i = newlw->label.label_width + 2 * newlw->label.internal_width +
- LEFT_OFFSET(newlw); /* req's label.lbm_width */
+ i = newlw->label.label_width +
+ 2 * newlw->label.internal_width +
+ 2 * newlw->threeD.shadow_width +
+ LEFT_OFFSET(newlw); /* req's label.lbm_width */
if (i > newlw->core.width)
newlw->core.width = i;
}
@@ -845,9 +868,11 @@ QueryGeometry(Widget w, XtWidgetGeometry
preferred->request_mode = CWWidth | CWHeight;
preferred->width = (lw->label.label_width +
2 * lw->label.internal_width +
+ 2 * lw->threeD.shadow_width +
LEFT_OFFSET(lw));
preferred->height = lw->label.label_height +
- 2 * lw->label.internal_height;
+ 2 * lw->label.internal_height +
+ 2 * lw->threeD.shadow_width;
if ( ((intended->request_mode & (CWWidth | CWHeight))
== (CWWidth | CWHeight)) &&
intended->width == preferred->width &&

22
xaw3d-elf.patch Normal file
View File

@ -0,0 +1,22 @@
--- libXaw3d-1.6.2/src/Makefile.in
+++ libXaw3d-1.6.2/src/Makefile.in 2013-10-29 15:45:03.514256258 +0000
@@ -438,7 +438,18 @@ laygram.h: laygram.c
$(MAKE) $(AM_MAKEFLAGS) laygram.c; \
else :; fi
libXaw3d.la: $(libXaw3d_la_OBJECTS) $(libXaw3d_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libXaw3d_la_LINK) -rpath $(libdir) $(libXaw3d_la_OBJECTS) $(libXaw3d_la_LIBADD) $(LIBS)
+ mkdir -p .mylibs
+ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) -version-info 6:0:0 -no-undefined $(LDFLAGS) -o libXaw.la -rpath $(libdir) $(libXaw3d_la_OBJECTS) $(libXaw3d_la_LIBADD) $(LIBS)
+ mv .libs/*.so* .mylibs
+ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) -version-info 6:0:0 -no-undefined $(LDFLAGS) -o $@ -rpath $(libdir) $(libXaw3d_la_OBJECTS) $(libXaw3d_la_LIBADD) $(LIBS)
+ mv .libs/*.so* .mylibs
+ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) -version-info 7:0:0 -no-undefined $(LDFLAGS) -o libXaw.la -rpath $(libdir) $(libXaw3d_la_OBJECTS) $(libXaw3d_la_LIBADD) $(LIBS)
+ mv .libs/*.so* .mylibs
+ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) -version-info 7:0:0 -no-undefined $(LDFLAGS) -o $@ -rpath $(libdir) $(libXaw3d_la_OBJECTS) $(libXaw3d_la_LIBADD) $(LIBS)
+ mv .libs/*.so* .mylibs
+ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) -version-info 8:0:0 -no-undefined $(LDFLAGS) -o libXaw.la -rpath $(libdir) $(libXaw3d_la_OBJECTS) $(libXaw3d_la_LIBADD) $(LIBS)
+ mv .libs/*.so* .mylibs
+ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) -version-info 8:0:0 -no-undefined $(LDFLAGS) -o $@ -rpath $(libdir) $(libXaw3d_la_OBJECTS) $(libXaw3d_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)

293
xaw3d-fontset.patch Normal file
View File

@ -0,0 +1,293 @@
---
src/AsciiSink.c | 2 ++
src/Command.c | 2 ++
src/Label.c | 11 ++++++++++-
src/List.c | 14 ++++++++++++--
src/MultiSink.c | 33 ++++++++++++++++++++++++++-------
src/SmeBSB.c | 2 ++
src/Tip.c | 16 ++++++++++++++--
src/XawIm.c | 14 +++++++++-----
8 files changed, 77 insertions(+), 17 deletions(-)
Index: libXaw3d-1.6.2/src/AsciiSink.c
===================================================================
--- libXaw3d-1.6.2.orig/src/AsciiSink.c
+++ libXaw3d-1.6.2/src/AsciiSink.c
@@ -513,6 +513,8 @@ Initialize(Widget request, Widget new, A
{
AsciiSinkObject sink = (AsciiSinkObject) new;
+ if (!sink->ascii_sink.font) XtError("Aborting: no font found\n");
+
GetGC(sink);
sink->ascii_sink.insertCursorOn= CreateInsertCursor(XtScreenOfObject(new));
Index: libXaw3d-1.6.2/src/Command.c
===================================================================
--- libXaw3d-1.6.2.orig/src/Command.c
+++ libXaw3d-1.6.2/src/Command.c
@@ -220,6 +220,8 @@ Initialize(Widget request, Widget new, A
CommandWidget cbw = (CommandWidget) new;
int shape_event_base, shape_error_base;
+ if (!cbw->label.font) XtError("Aborting: no font found\n");
+
if (cbw->command.shape_style != XawShapeRectangle
&& !XShapeQueryExtension(XtDisplay(new), &shape_event_base,
&shape_error_base))
Index: libXaw3d-1.6.2/src/Label.c
===================================================================
--- libXaw3d-1.6.2.orig/src/Label.c
+++ libXaw3d-1.6.2/src/Label.c
@@ -274,7 +274,10 @@ SetTextWidthAndHeight(LabelWidget lw)
#ifdef XAW_INTERNATIONALIZATION
if ( lw->simple.international == True ) {
XFontSet fset = lw->label.fontset;
- XFontSetExtents *ext = XExtentsOfFontSet(fset);
+ XFontSetExtents *ext;
+
+ if (!lw->label.fontset || !(ext = XExtentsOfFontSet(fset)))
+ XtError("Aborting: no fontset found\n");
lw->label.label_height = ext->max_ink_extent.height;
if (lw->label.label == NULL) {
@@ -459,6 +462,12 @@ Initialize(Widget request, Widget new, A
lw->threeD.shadow_width = 0;
#endif
+ if (!lw->label.font) XtError("Aborting: no font found\n");
+#ifdef XAW_INTERNATIONALIZATION
+ if (lw->simple.international && !lw->label.fontset)
+ XtError("Aborting: no fontset found\n");
+#endif
+
if (lw->label.label == NULL)
lw->label.label = XtNewString(lw->core.name);
else
Index: libXaw3d-1.6.2/src/List.c
===================================================================
--- libXaw3d-1.6.2.orig/src/List.c
+++ libXaw3d-1.6.2/src/List.c
@@ -362,6 +362,12 @@ Initialize(Widget junk, Widget new, ArgL
{
ListWidget lw = (ListWidget) new;
+ if (!lw->list.font) XtError("Aborting: no font found\n");
+#ifdef XAW_INTERNATIONALIZATION
+ if (lw->simple.international && !lw->list.fontset)
+ XtError("Aborting: no fontset found\n");
+#endif
+
/*
* Initialize all private resources.
*/
@@ -571,7 +577,9 @@ PaintItemName(Widget w, int item)
int x, y, str_y;
ListWidget lw = (ListWidget) w;
#ifdef XAW_INTERNATIONALIZATION
- XFontSetExtents *ext = XExtentsOfFontSet(lw->list.fontset);
+ XFontSetExtents *ext;
+ if (!lw->list.fontset || !(ext = XExtentsOfFontSet(lw->list.fontset)))
+ XtError("Aborting: no fontset found\n");
#endif
if (!XtIsRealized(w)) return; /* Just in case... */
@@ -926,7 +934,9 @@ SetValues(Widget current, Widget request
ListWidget nl = (ListWidget) new;
Boolean redraw = FALSE;
#ifdef XAW_INTERNATIONALIZATION
- XFontSetExtents *ext = XExtentsOfFontSet(nl->list.fontset);
+ XFontSetExtents *ext;
+ if (!nl->list.fontset || !(ext = XExtentsOfFontSet(nl->list.fontset)))
+ XtError("Aborting: no fontset found\n");
#endif
/* If the request height/width is different, lock it. Unless its 0. If */
Index: libXaw3d-1.6.2/src/MultiSink.c
===================================================================
--- libXaw3d-1.6.2.orig/src/MultiSink.c
+++ libXaw3d-1.6.2/src/MultiSink.c
@@ -252,7 +252,9 @@ PaintText(Widget w, GC gc, Position x, P
XFontSet fontset = sink->multi_sink.fontset;
Position max_x;
Dimension width = XwcTextEscapement(fontset, buf, len);
- XFontSetExtents *ext = XExtentsOfFontSet(fontset);
+ XFontSetExtents *ext;
+ if (!fontset || !(ext = XExtentsOfFontSet(fontset)))
+ XtError("Aborting: no fontset found\n");
max_x = (Position) ctx->core.width;
if ( ((int) width) <= -x) /* Don't draw if we can't see it. */
@@ -286,7 +288,9 @@ DisplayText(Widget w, Position x, Positi
MultiSinkObject sink = (MultiSinkObject) w;
Widget source = XawTextGetSource(XtParent(w));
wchar_t buf[BUFSIZ];
- XFontSetExtents *ext = XExtentsOfFontSet(sink->multi_sink.fontset);
+ XFontSetExtents *ext;
+ if (!sink->multi_sink.fontset || !(ext = XExtentsOfFontSet(sink->multi_sink.fontset)))
+ XtError("Aborting: no fontset found\n");
int j, k;
XawTextBlock blk;
@@ -403,8 +407,10 @@ FindDistance (Widget w, XawTextPosition
XawTextPosition index, lastPos;
wchar_t c;
- XFontSetExtents *ext = XExtentsOfFontSet(sink->multi_sink.fontset);
XawTextBlock blk;
+ XFontSetExtents *ext;
+ if (!sink->multi_sink.fontset || !(ext = XExtentsOfFontSet(sink->multi_sink.fontset)))
+ XtError("Aborting: no fontset found\n");
/* we may not need this */
lastPos = GETLASTPOS;
@@ -437,8 +443,10 @@ FindPosition(Widget w, XawTextPosition f
int lastWidth = 0, whiteSpaceWidth = 0;
Boolean whiteSpaceSeen;
wchar_t c;
- XFontSetExtents *ext = XExtentsOfFontSet(sink->multi_sink.fontset);
XawTextBlock blk;
+ XFontSetExtents *ext;
+ if (!sink->multi_sink.fontset || !(ext = XExtentsOfFontSet(sink->multi_sink.fontset)))
+ XtError("Aborting: no fontset found\n");
lastPos = GETLASTPOS;
@@ -535,6 +543,11 @@ Initialize(Widget request, Widget new, A
GetGC(sink);
+#ifdef XAW_INTERNATIONALIZATION
+ if (!sink->multi_sink.fontset) XtError("Aborting: no fontset found\n");
+#endif
+
+
sink->multi_sink.insertCursorOn= CreateInsertCursor(XtScreenOfObject(new));
sink->multi_sink.laststate = XawisOff;
sink->multi_sink.cursor_x = sink->multi_sink.cursor_y = 0;
@@ -615,7 +628,9 @@ MaxLines(Widget w, Dimension height)
{
MultiSinkObject sink = (MultiSinkObject) w;
int font_height;
- XFontSetExtents *ext = XExtentsOfFontSet(sink->multi_sink.fontset);
+ XFontSetExtents *ext;
+ if (!sink->multi_sink.fontset || !(ext = XExtentsOfFontSet(sink->multi_sink.fontset)))
+ XtError("Aborting: no fontset found\n");
font_height = ext->max_logical_extent.height;
return( ((int) height) / font_height );
@@ -636,7 +651,9 @@ MaxHeight(
int lines )
{
MultiSinkObject sink = (MultiSinkObject) w;
- XFontSetExtents *ext = XExtentsOfFontSet(sink->multi_sink.fontset);
+ XFontSetExtents *ext;
+ if (!sink->multi_sink.fontset || !(ext = XExtentsOfFontSet(sink->multi_sink.fontset)))
+ XtError("Aborting: no fontset found\n");
return(lines * ext->max_logical_extent.height);
}
@@ -718,7 +735,9 @@ _XawMultiSinkPosToXY(
Position *y )
{
MultiSinkObject sink = (MultiSinkObject) ((TextWidget)w)->text.sink;
- XFontSetExtents *ext = XExtentsOfFontSet( sink->multi_sink.fontset );
+ XFontSetExtents *ext;
+ if (!sink->multi_sink.fontset || !(ext = XExtentsOfFontSet( sink->multi_sink.fontset )))
+ XtError("Aborting: no fontset found\n");
_XawTextPosToXY( w, pos, x, y );
*y += abs( ext->max_logical_extent.y );
Index: libXaw3d-1.6.2/src/SmeBSB.c
===================================================================
--- libXaw3d-1.6.2.orig/src/SmeBSB.c
+++ libXaw3d-1.6.2/src/SmeBSB.c
@@ -208,6 +208,8 @@ Initialize(Widget request, Widget new, A
else
entry->sme_bsb.label = XtNewString( entry->sme_bsb.label );
+ if (!entry->sme_bsb.font) XtError("Aborting: no font found\n");
+
CreateGCs(new);
GetBitmapInfo(new, TRUE); /* Left Bitmap Info */
Index: libXaw3d-1.6.2/src/Tip.c
===================================================================
--- libXaw3d-1.6.2.orig/src/Tip.c
+++ libXaw3d-1.6.2/src/Tip.c
@@ -248,6 +248,12 @@ XawTipInitialize(Widget req, Widget w, A
TipWidget tip = (TipWidget)w;
XGCValues values;
+ if (!tip->tip.font) XtError("Aborting: no font found\n");
+#ifdef XAW_INTERNATIONALIZATION
+ if (tip->tip.international && !tip->tip.fontset)
+ XtError("Aborting: no fontset found\n");
+#endif
+
tip->tip.timer = 0;
values.foreground = tip->tip.foreground;
@@ -333,7 +339,10 @@ XawTipExpose(Widget w, XEvent *event, Re
#ifdef XAW_INTERNATIONALIZATION
if (tip->tip.international == True) {
Position ksy = tip->tip.internal_height;
- XFontSetExtents *ext = XExtentsOfFontSet(tip->tip.fontset);
+ XFontSetExtents *ext;
+
+ if (!tip->tip.fontset || !(ext = XExtentsOfFontSet(tip->tip.fontset)))
+ XtError("Aborting: no fontset found\n");
ksy += abs(ext->max_ink_extent.y);
@@ -414,7 +423,10 @@ TipLayout(XawTipInfo *info)
#ifdef XAW_INTERNATIONALIZATION
if (info->tip->tip.international == True) {
XFontSet fset = info->tip->tip.fontset;
- XFontSetExtents *ext = XExtentsOfFontSet(fset);
+ XFontSetExtents *ext;
+
+ if (!fset || !(ext = XExtentsOfFontSet(fset)))
+ XtError("Aborting: no fontset found\n");
height = ext->max_ink_extent.height;
if ((nl = index(label, '\n')) != NULL) {
Index: libXaw3d-1.6.2/src/XawIm.c
===================================================================
--- libXaw3d-1.6.2.orig/src/XawIm.c
+++ libXaw3d-1.6.2/src/XawIm.c
@@ -727,8 +727,10 @@ CreateIC(Widget w, XawVendorShellExtPart
SetVaArg( &pe_a[pe_cnt], (XPointer) p->font_set); pe_cnt++;
SetVaArg( &st_a[st_cnt], (XPointer) XNFontSet); st_cnt++;
SetVaArg( &st_a[st_cnt], (XPointer) p->font_set); st_cnt++;
- height = maxAscentOfFontSet(p->font_set)
- + maxDescentOfFontSet(p->font_set);
+ if (p->font_set) {
+ height = maxAscentOfFontSet(p->font_set)
+ + maxDescentOfFontSet(p->font_set);
+ }
height = SetVendorShellHeight(ve, height);
}
if (p->flg & CIFg) {
@@ -857,7 +859,7 @@ SetICValues(Widget w, XawVendorShellExtP
XPointer ic_a[20], pe_a[20], st_a[20];
int ic_cnt = 0, pe_cnt = 0, st_cnt = 0;
XawTextMargin *margin;
- int height;
+ int height = 0;
if ((ve->im.xim == NULL) || ((p = GetIcTableShared(w, ve)) == NULL) ||
(p->xic == NULL)) return;
@@ -884,8 +886,10 @@ SetICValues(Widget w, XawVendorShellExtP
SetVaArg( &pe_a[pe_cnt], (XPointer) p->font_set); pe_cnt++;
SetVaArg( &st_a[st_cnt], (XPointer) XNFontSet); st_cnt++;
SetVaArg( &st_a[st_cnt], (XPointer) p->font_set); st_cnt++;
- height = maxAscentOfFontSet(p->font_set)
- + maxDescentOfFontSet(p->font_set);
+ if (p->font_set) {
+ height = maxAscentOfFontSet(p->font_set)
+ + maxDescentOfFontSet(p->font_set);
+ }
height = SetVendorShellHeight(ve, height);
}
if (p->flg & CIFg) {

266
xaw3d-hsbar.patch Normal file
View File

@ -0,0 +1,266 @@
---
src/Text.c | 12 +++++--
src/Viewport.c | 86 +++++++++++++++++----------------------------------------
2 files changed, 35 insertions(+), 63 deletions(-)
Index: libXaw3d-1.6.2/src/Text.c
===================================================================
--- libXaw3d-1.6.2.orig/src/Text.c
+++ libXaw3d-1.6.2/src/Text.c
@@ -497,8 +497,10 @@ CreateHScrollBar(TextWidget ctx)
(XtPointer) NULL);
/**/
- ctx->text.r_margin.bottom += hbar->core.height + hbar->core.border_width;
- ctx->text.margin.bottom = ctx->text.r_margin.bottom;
+ if (ctx->text.scroll_vert == XawtextScrollAlways) {
+ ctx->text.r_margin.bottom += hbar->core.height + hbar->core.border_width;
+ ctx->text.margin.bottom = ctx->text.r_margin.bottom;
+ }
/**/
PositionHScrollBar(ctx);
if (XtIsRealized((Widget)ctx)) {
@@ -521,8 +523,10 @@ DestroyHScrollBar(TextWidget ctx)
if (hbar == NULL) return;
/**/
- ctx->text.r_margin.bottom -= hbar->core.height + hbar->core.border_width;
- ctx->text.margin.bottom = ctx->text.r_margin.bottom;
+ if (ctx->text.scroll_vert == XawtextScrollAlways) {
+ ctx->text.r_margin.bottom -= hbar->core.height + hbar->core.border_width;
+ ctx->text.margin.bottom = ctx->text.r_margin.bottom;
+ }
/**/
if (ctx->text.vbar == NULL)
XtRemoveCallback((Widget) ctx, XtNunrealizeCallback, UnrealizeScrollbars,
Index: libXaw3d-1.6.2/src/Viewport.c
===================================================================
--- libXaw3d-1.6.2.orig/src/Viewport.c
+++ libXaw3d-1.6.2/src/Viewport.c
@@ -244,7 +244,7 @@ Initialize(Widget request, Widget new, A
XtVaGetValues((Widget)(w->viewport.threeD), XtNshadowWidth, &sw, NULL);
if (sw)
{
- pad = 2;
+ pad = 2 * sw;
arg_cnt = 0;
XtSetArg(threeD_args[arg_cnt], XtNborderWidth, 0); arg_cnt++;
@@ -262,8 +262,8 @@ Initialize(Widget request, Widget new, A
XtSetArg(clip_args[arg_cnt], XtNright, XtChainRight); arg_cnt++;
XtSetArg(clip_args[arg_cnt], XtNtop, XtChainTop); arg_cnt++;
XtSetArg(clip_args[arg_cnt], XtNbottom, XtChainBottom); arg_cnt++;
- XtSetArg(clip_args[arg_cnt], XtNwidth, w->core.width - 2 * sw); arg_cnt++;
- XtSetArg(clip_args[arg_cnt], XtNheight, w->core.height - 2 * sw); arg_cnt++;
+ XtSetArg(clip_args[arg_cnt], XtNwidth, w->core.width - pad); arg_cnt++;
+ XtSetArg(clip_args[arg_cnt], XtNheight, w->core.height - pad); arg_cnt++;
w->viewport.clip = XtCreateManagedWidget("clip", widgetClass, new,
clip_args, arg_cnt);
@@ -283,8 +283,8 @@ Initialize(Widget request, Widget new, A
* Set the clip widget to the correct height.
*/
- clip_width = w->core.width - 2 * sw;
- clip_height = w->core.height - 2 * sw;
+ clip_width = w->core.width - pad;
+ clip_height = w->core.height - pad;
if ( (h_bar != NULL) &&
((int)w->core.width >
@@ -509,23 +509,13 @@ ComputeLayout(Widget widget, Boolean que
XtWidgetGeometry intended;
Dimension pad = 0, sw = 0;
- /*
- * I've made two optimizations here. The first does away with the
- * loop, and the second defers setting the child dimensions to the
- * clip if smaller until after adjusting for possible scrollbars.
- * If you find that these go too far, define the identifiers here
- * as required. -- djhjr
- */
-#define NEED_LAYOUT_LOOP
-#undef PREP_CHILD_TO_CLIP
-
if (child == (Widget) NULL) return;
XtVaGetValues(threeD, XtNshadowWidth, &sw, NULL);
- if (sw) pad = 2;
+ if (sw) pad = 2 * sw;
- clip_width = w->core.width - 2 * sw;
- clip_height = w->core.height - 2 * sw;
+ clip_width = w->core.width - pad;
+ clip_height = w->core.height - pad;
intended.request_mode = CWBorderWidth;
intended.border_width = 0;
@@ -536,10 +526,8 @@ ComputeLayout(Widget widget, Boolean que
&clip_width, &clip_height);
}
else {
-#ifdef NEED_LAYOUT_LOOP
Dimension prev_width, prev_height;
XtGeometryMask prev_mode;
-#endif
XtWidgetGeometry preferred;
needshoriz = needsvert = False;
@@ -554,30 +542,29 @@ ComputeLayout(Widget widget, Boolean que
intended.request_mode |= CWWidth;
#ifdef PREP_CHILD_TO_CLIP
- if ((int)child->core.width < clip_width)
- intended.width = clip_width;
+ if ((int)child->core.width < clip_width + pad)
+ intended.width = clip_width + pad;
else
#endif
intended.width = child->core.width;
- if (!w->viewport.allowvert)
- intended.request_mode |= CWHeight;
#ifdef PREP_CHILD_TO_CLIP
- if ((int)child->core.height < clip_height)
- intended.height = clip_height;
+ if ((int)child->core.height < clip_height + pad)
+ intended.height = clip_height + pad;
else
#endif
intended.height = child->core.height;
+ if (!w->viewport.allowvert)
+ intended.request_mode |= CWHeight;
+
if (!query) {
preferred.width = child->core.width;
preferred.height = child->core.height;
}
-#ifdef NEED_LAYOUT_LOOP
do { /* while intended != prev */
-#endif
if (query) {
(void) XtQueryGeometry( child, &intended, &preferred );
if ( !(preferred.request_mode & CWWidth) )
@@ -585,12 +572,9 @@ ComputeLayout(Widget widget, Boolean que
if ( !(preferred.request_mode & CWHeight) )
preferred.height = intended.height;
}
-
-#ifdef NEED_LAYOUT_LOOP
prev_width = intended.width;
prev_height = intended.height;
prev_mode = intended.request_mode;
-#endif
/*
* Note that having once decided to turn on either bar
@@ -600,7 +584,7 @@ ComputeLayout(Widget widget, Boolean que
#define CheckHoriz() \
if (w->viewport.allowhoriz && \
- (int)preferred.width > clip_width + 2 * sw) { \
+ (int)preferred.width > clip_width + pad) { \
if (!needshoriz) { \
Widget horiz_bar = w->viewport.horiz_bar; \
needshoriz = True; \
@@ -615,7 +599,7 @@ ComputeLayout(Widget widget, Boolean que
/* enddef */
CheckHoriz();
if (w->viewport.allowvert &&
- (int)preferred.height > clip_height + 2 * sw) {
+ (int)preferred.height > clip_height + pad) {
if (!needsvert) {
Widget vert_bar = w->viewport.vert_bar;
needsvert = True;
@@ -629,38 +613,22 @@ ComputeLayout(Widget widget, Boolean que
intended.height = preferred.height;
}
-#ifdef PREP_CHILD_TO_CLIP
if (!w->viewport.allowhoriz ||
- (int)preferred.width < clip_width) {
- intended.width = clip_width;
+ (int)preferred.width < clip_width + pad) {
+ intended.width = clip_width + pad;
intended.request_mode |= CWWidth;
}
if (!w->viewport.allowvert ||
- (int)preferred.height < clip_height) {
- intended.height = clip_height;
+ (int)preferred.height < clip_height + pad) {
+ intended.height = clip_height + pad;
intended.request_mode |= CWHeight;
}
-#endif
-#ifdef NEED_LAYOUT_LOOP
+
} while ( intended.request_mode != prev_mode ||
(intended.request_mode & CWWidth &&
intended.width != prev_width) ||
(intended.request_mode & CWHeight &&
intended.height != prev_height) );
-#endif
-
-#ifndef PREP_CHILD_TO_CLIP
- if (!w->viewport.allowhoriz ||
- (int)preferred.width < clip_width) {
- intended.width = clip_width;
- intended.request_mode |= CWWidth;
- }
- if (!w->viewport.allowvert ||
- (int)preferred.height < clip_height) {
- intended.height = clip_height;
- intended.request_mode |= CWHeight;
- }
-#endif
}
bar_width = bar_height = 0;
@@ -705,7 +673,7 @@ ComputeLayout(Widget widget, Boolean que
else {
int bw = bar->core.border_width;
XtResizeWidget( bar,
- (Dimension)(clip_width + 2 * sw), bar->core.height,
+ (Dimension)(clip_width + pad), bar->core.height,
(Dimension)bw );
XtMoveWidget( bar,
(Position)((needsvert && !w->viewport.useright)
@@ -730,7 +698,7 @@ ComputeLayout(Widget widget, Boolean que
else {
int bw = bar->core.border_width;
XtResizeWidget( bar,
- bar->core.width, (Dimension)(clip_height + 2 * sw),
+ bar->core.width, (Dimension)(clip_height + pad),
(Dimension)bw );
XtMoveWidget( bar,
(Position)(w->viewport.useright
@@ -780,7 +748,7 @@ ComputeWithForceBars(Widget widget, Bool
*/
XtVaGetValues((Widget)(w->viewport.threeD), XtNshadowWidth, &sw, NULL);
- if (sw) pad = 2;
+ if (sw) pad = 2 * sw;
if (w->viewport.allowvert) {
if (w->viewport.vert_bar == NULL)
@@ -926,7 +894,7 @@ GeometryRequestPlusScrollbar(ViewportWid
Dimension pad = 0, sw = 0;
XtVaGetValues((Widget)(w->viewport.threeD), XtNshadowWidth, &sw, NULL);
- if (sw) pad = 2;
+ if (sw) pad = 2 * sw;
plusScrollbars = *request;
if ((bar = w->viewport.horiz_bar) == (Widget)NULL)
@@ -997,7 +965,7 @@ GeometryManager(Widget child, XtWidgetGe
return XtGeometryNo;
XtVaGetValues((Widget)(w->viewport.threeD), XtNshadowWidth, &sw, NULL);
- if (sw) pad = 2;
+ if (sw) pad = 2 * sw;
allowed = *request;

548
xaw3d-secure.patch Normal file
View File

@ -0,0 +1,548 @@
---
include/X11/Xaw3d/AsciiSrcP.h | 6 ++-
include/X11/Xaw3d/MultiSrcP.h | 6 ++-
src/Layout.c | 18 ++++++++--
src/MenuButton.c | 15 +++++++-
src/Simple.c | 18 +++++++---
src/SimpleMenu.c | 16 +++++++--
src/SmeBSB.c | 51 +++++++++++++++++++-----------
src/Text.c | 50 +++++++++++++++++++++--------
src/TextPop.c | 71 +++++++++++++++++++++++++++++++++++-------
src/XawAlloc.h | 10 +++++
src/XawI18n.h | 2 +
src/XawIm.c | 4 +-
12 files changed, 206 insertions(+), 61 deletions(-)
Index: libXaw3d-1.6.2/include/X11/Xaw3d/AsciiSrcP.h
===================================================================
--- libXaw3d-1.6.2.orig/include/X11/Xaw3d/AsciiSrcP.h
+++ libXaw3d-1.6.2/include/X11/Xaw3d/AsciiSrcP.h
@@ -80,7 +80,11 @@ SOFTWARE.
#ifdef L_tmpnam
#define TMPSIZ L_tmpnam
#else
-#define TMPSIZ 32 /* bytes to allocate for tmpnam */
+#ifdef PATH_MAX
+#define TMPSIZ PATH_MAX
+#else
+#define TMPSIZ 1024 /* bytes to allocate for tmpnam */
+#endif
#endif
#define MAGIC_VALUE ((XawTextPosition) -1) /* Magic value. */
Index: libXaw3d-1.6.2/include/X11/Xaw3d/MultiSrcP.h
===================================================================
--- libXaw3d-1.6.2.orig/include/X11/Xaw3d/MultiSrcP.h
+++ libXaw3d-1.6.2/include/X11/Xaw3d/MultiSrcP.h
@@ -111,7 +111,11 @@ SOFTWARE.
#ifdef L_tmpnam
#define TMPSIZ L_tmpnam
#else
-#define TMPSIZ 32 /* bytes to allocate for tmpnam */
+#ifdef PATH_MAX
+#define TMPSIZ PATH_MAX
+#else
+#define TMPSIZ 1024 /* bytes to allocate for tmpnam */
+#endif
#endif
#define MAGIC_VALUE ((XawTextPosition) -1) /* Magic value. */
Index: libXaw3d-1.6.2/src/Layout.c
===================================================================
--- libXaw3d-1.6.2.orig/src/Layout.c
+++ libXaw3d-1.6.2/src/Layout.c
@@ -40,6 +40,8 @@
# include <X11/Xaw3d/LayoutP.h>
#endif
+#include "XawAlloc.h"
+
#include <ctype.h>
#include <stdio.h>
@@ -565,10 +567,18 @@ Evaluate (LayoutWidget l, BoxPtr box, Ex
nexpr = LookupVariable (box, expr->u.variable);
if (!nexpr)
{
- char buf[256];
- (void) sprintf (buf, "Layout: undefined variable %s\n",
- XrmQuarkToString (expr->u.variable));
- XtError (buf);
+ char *pvar = XrmQuarkToString (expr->u.variable);
+ char *msg = "Layout: undefined variable ";
+ int len = strlen(msg) + strlen(pvar) + 2;
+ char *pbuf, buf[256];
+
+ pbuf = XtStackAlloc(len, buf);
+ if (pbuf != NULL)
+ {
+ sprintf(pbuf, "%s%s\n", msg, pvar);
+ XtError (buf);
+ XtStackFree(pbuf, buf);
+ }
return 0.0;
}
return Evaluate (l, box, nexpr, natural);
Index: libXaw3d-1.6.2/src/MenuButton.c
===================================================================
--- libXaw3d-1.6.2.orig/src/MenuButton.c
+++ libXaw3d-1.6.2/src/MenuButton.c
@@ -54,6 +54,8 @@ in this Software without prior written a
#include <X11/Xaw3d/XawInit.h>
#include <X11/Xaw3d/MenuButtoP.h>
+#include "XawAlloc.h"
+
static void ClassInitialize(void);
static void PopupMenu(Widget, XEvent *, String *, Cardinal *);
@@ -177,9 +179,16 @@ PopupMenu(Widget w, XEvent *event, Strin
if (menu == NULL) {
char error_buf[BUFSIZ];
- (void) sprintf(error_buf, "MenuButton: %s %s.",
- "Could not find menu widget named", mbw->menu_button.menu_name);
- XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
+ char *err1 = "MenuButton: Could not find menu widget named ";
+ char *perr;
+ int len;
+
+ len = strlen(err1) + strlen(mbw->menu_button.menu_name) + 1 + 1;
+ perr = XtStackAlloc(len, error_buf);
+ if (perr == NULL) return;
+ sprintf(perr, "%s%s.", err1, mbw->menu_button.menu_name);
+ XtAppWarning(XtWidgetToApplicationContext(w), perr);
+ XtStackFree(perr, error_buf);
return;
}
if (!XtIsRealized(menu))
Index: libXaw3d-1.6.2/src/Simple.c
===================================================================
--- libXaw3d-1.6.2.orig/src/Simple.c
+++ libXaw3d-1.6.2/src/Simple.c
@@ -57,6 +57,8 @@ SOFTWARE.
#include <X11/Xaw3d/SimpleP.h>
#include <X11/Xmu/Drawing.h>
+#include "XawAlloc.h"
+
#define offset(field) XtOffsetOf(SimpleRec, simple.field)
static XtResource resources[] = {
@@ -154,11 +156,17 @@ ClassPartInitialize(WidgetClass class)
if (c->simple_class.change_sensitive == NULL) {
char buf[BUFSIZ];
-
- (void) sprintf(buf,
- "%s Widget: The Simple Widget class method 'change_sensitive' is undefined.\nA function must be defined or inherited.",
- c->core_class.class_name);
- XtWarning(buf);
+ char *pbuf;
+ char *msg1 = " Widget: The Simple Widget class method 'change_sensitive' is undefined.\nA function must be defined or inherited.";
+ int len;
+
+ len = strlen(msg1) + strlen(c->core_class.class_name) + 1;
+ pbuf = XtStackAlloc(len, buf);
+ if (pbuf != NULL) {
+ sprintf(pbuf, "%s%s", c->core_class.class_name, msg1);
+ XtWarning(pbuf);
+ XtStackFree(pbuf, buf);
+ }
c->simple_class.change_sensitive = ChangeSensitive;
}
Index: libXaw3d-1.6.2/src/SimpleMenu.c
===================================================================
--- libXaw3d-1.6.2.orig/src/SimpleMenu.c
+++ libXaw3d-1.6.2/src/SimpleMenu.c
@@ -52,6 +52,8 @@ in this Software without prior written a
#include <X11/Xmu/Initer.h>
#include <X11/Xmu/CharSet.h>
+#include "XawAlloc.h"
+
#define streq(a, b) ( strcmp((a), (b)) == 0 )
#define offset(field) XtOffsetOf(SimpleMenuRec, simple_menu.field)
@@ -749,9 +751,17 @@ PositionMenuAction(Widget w, XEvent * ev
if ( (menu = FindMenu(w, params[0])) == NULL) {
char error_buf[BUFSIZ];
- (void) sprintf(error_buf, "%s '%s'",
- "Xaw - SimpleMenuWidget: could not find menu named: ", params[0]);
- XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
+ char *err1 = "Xaw - SimpleMenuWidget: could not find menu named: ";
+ char *perr;
+ int len;
+
+ len = strlen(err1) + strlen(params[0]) + 2 + 1;
+ perr = XtStackAlloc(len, error_buf);
+ if (perr == NULL)
+ return;
+ sprintf(perr, "%s'%s'", err1, params[0]);
+ XtAppWarning(XtWidgetToApplicationContext(w), perr);
+ XtStackFree(perr, error_buf);
return;
}
Index: libXaw3d-1.6.2/src/SmeBSB.c
===================================================================
--- libXaw3d-1.6.2.orig/src/SmeBSB.c
+++ libXaw3d-1.6.2/src/SmeBSB.c
@@ -52,6 +52,7 @@ in this Software without prior written a
#include <X11/Xaw3d/SmeBSBP.h>
#include <X11/Xaw3d/Cardinals.h>
#include <stdio.h>
+#include "XawAlloc.h"
/* needed for abs() */
#ifndef X_NOT_STDC_ENV
@@ -700,6 +701,8 @@ GetBitmapInfo(Widget w, Boolean is_left)
int x, y;
unsigned int width, height, bw;
char buf[BUFSIZ];
+ char *pbuf;
+ int len;
if (is_left) {
width = height = 0;
@@ -708,18 +711,24 @@ GetBitmapInfo(Widget w, Boolean is_left)
if (!XGetGeometry(XtDisplayOfObject(w),
entry->sme_bsb.left_bitmap, &root, &x, &y,
&width, &height, &bw, &entry->sme_bsb.left_depth)) {
- (void) sprintf(buf, "Xaw SmeBSB Object: %s %s \"%s\".",
- "Could not get Left Bitmap",
- "geometry information for menu entry",
- XtName(w));
- XtAppError(XtWidgetToApplicationContext(w), buf);
+ char *err1 = "Xaw SmeBSB Object: Could not get Left Bitmap geometry information for menu entry ";
+ len = strlen(err1) + strlen(XtName(w)) + 3 + 1;
+ pbuf = XtStackAlloc(len, buf);
+ if (pbuf == NULL) return;
+ sprintf(pbuf, "%s\"%s\".", err1, XtName(w));
+ XtAppError(XtWidgetToApplicationContext(w), pbuf);
+ XtStackFree(pbuf, buf);
}
#ifdef NEVER
if (entry->sme_bsb.left_depth != 1) {
- (void) sprintf(buf, "Xaw SmeBSB Object: %s \"%s\" %s.",
- "Left Bitmap of entry", XtName(w),
- "is not one bit deep");
- XtAppError(XtWidgetToApplicationContext(w), buf);
+ char *err1 = "Xaw SmeBSB Object: Left Bitmap of entry ";
+ char *err2 = " is not one bit deep.";
+ len = strlen(err1) + strlen(err2) + strlen(XtName(w)) + 2 + 1;
+ pbuf = XtStackAlloc(len, buf);
+ if (pbuf == NULL) return;
+ sprintf(pbuf, "%s\"%s\"%s", err1, XtName(w), err2);
+ XtAppError(XtWidgetToApplicationContext(w), pbuf);
+ XtStackFree(pbuf, buf);
}
#endif
}
@@ -733,18 +742,24 @@ GetBitmapInfo(Widget w, Boolean is_left)
if (!XGetGeometry(XtDisplayOfObject(w),
entry->sme_bsb.right_bitmap, &root, &x, &y,
&width, &height, &bw, &entry->sme_bsb.right_depth)) {
- (void) sprintf(buf, "Xaw SmeBSB Object: %s %s \"%s\".",
- "Could not get Right Bitmap",
- "geometry information for menu entry",
- XtName(w));
- XtAppError(XtWidgetToApplicationContext(w), buf);
+ char *err1 = "Xaw SmeBSB Object: Could not get Right Bitmap geometry information for menu entry ";
+ len = strlen(err1) + strlen(XtName(w)) + 3 + 1;
+ pbuf = XtStackAlloc(len, buf);
+ if (pbuf == NULL) return;
+ sprintf(pbuf, "%s\"%s\".", err1, XtName(w));
+ XtAppError(XtWidgetToApplicationContext(w), pbuf);
+ XtStackFree(pbuf, buf);
}
#ifdef NEVER
if (entry->sme_bsb.right_depth != 1) {
- (void) sprintf(buf, "Xaw SmeBSB Object: %s \"%s\" %s.",
- "Right Bitmap of entry", XtName(w),
- "is not one bit deep");
- XtAppError(XtWidgetToApplicationContext(w), buf);
+ char *err1 = "Xaw SmeBSB Object: Right Bitmap of entry ";
+ char *err2 = " is not one bit deep.";
+ len = strlen(err1) + strlen(err2) + strlen(XtName(w)) + 2 + 1;
+ pbuf = XtStackAlloc(len, buf);
+ if (pbuf == NULL) return;
+ sprintf(pbuf, "%s\"%s\"%s", err1, XtName(w), err2);
+ XtAppError(XtWidgetToApplicationContext(w), pbuf);
+ XtStackFree(pbuf, buf);
}
#endif
}
Index: libXaw3d-1.6.2/src/Text.c
===================================================================
--- libXaw3d-1.6.2.orig/src/Text.c
+++ libXaw3d-1.6.2/src/Text.c
@@ -78,6 +78,8 @@ SOFTWARE.
#include <X11/Xfuncs.h>
#include <ctype.h> /* for isprint() */
+#include "XawAlloc.h"
+
#ifndef MAX_LEN_CT
#define MAX_LEN_CT 6 /* for sequence: ESC $ ( A \xx \xx */
#endif
@@ -535,7 +537,8 @@ Initialize(Widget request, Widget new, A
{
TextWidget ctx = (TextWidget) new;
char error_buf[BUFSIZ];
- int s;
+ char *perr;
+ int s, len;
ctx->text.threeD = XtVaCreateWidget("threeD", threeDWidgetClass, new,
XtNx, 0, XtNy, 0,
@@ -584,10 +587,17 @@ Initialize(Widget request, Widget new, A
if (ctx->text.scroll_vert != XawtextScrollNever) {
if ( (ctx->text.resize == XawtextResizeHeight) ||
(ctx->text.resize == XawtextResizeBoth) ) {
- (void) sprintf(error_buf, "Xaw Text Widget %s:\n %s %s.", ctx->core.name,
- "Vertical scrolling not allowed with height resize.\n",
- "Vertical scrolling has been DEACTIVATED.");
- XtAppWarning(XtWidgetToApplicationContext(new), error_buf);
+ char *err1 = "Xaw Text Widget ";
+ char *err2 = ":\nVertical scrolling not allowed with height resize.\n";
+ char *err3 = "Vertical scrolling has been DEACTIVATED.";
+ len = strlen(err1) + strlen(err2) + strlen(err3) +
+ strlen(ctx->core.name) + 1;
+ perr = XtStackAlloc(len, error_buf);
+ if (perr != NULL) {
+ (void) sprintf(perr, "%s%s%s%s", err1, ctx->core.name, err2, err3);
+ XtAppWarning(XtWidgetToApplicationContext(new), perr);
+ XtStackFree(perr, error_buf);
+ }
ctx->text.scroll_vert = XawtextScrollNever;
}
else if (ctx->text.scroll_vert == XawtextScrollAlways)
@@ -596,18 +606,32 @@ Initialize(Widget request, Widget new, A
if (ctx->text.scroll_horiz != XawtextScrollNever) {
if (ctx->text.wrap != XawtextWrapNever) {
- (void) sprintf(error_buf, "Xaw Text Widget %s:\n %s %s.", ctx->core.name,
- "Horizontal scrolling not allowed with wrapping active.\n",
- "Horizontal scrolling has been DEACTIVATED.");
- XtAppWarning(XtWidgetToApplicationContext(new), error_buf);
+ char *err1 = "Xaw Text Widget ";
+ char *err2 = ":\nHorizontal scrolling not allowed with wrapping active.";
+ char *err3 = "\nHorizontal scrolling has been DEACTIVATED.";
+ len = strlen(err1) + strlen(err2) + strlen(err3) +
+ strlen(ctx->core.name) + 1;
+ perr = XtStackAlloc(len, error_buf);
+ if (perr != NULL) {
+ (void) sprintf(perr, "%s%s%s%s", err1, ctx->core.name, err2, err3);
+ XtAppWarning(XtWidgetToApplicationContext(new), perr);
+ XtStackFree(perr, error_buf);
+ }
ctx->text.scroll_horiz = XawtextScrollNever;
}
else if ( (ctx->text.resize == XawtextResizeWidth) ||
(ctx->text.resize == XawtextResizeBoth) ) {
- (void) sprintf(error_buf, "Xaw Text Widget %s:\n %s %s.", ctx->core.name,
- "Horizontal scrolling not allowed with width resize.\n",
- "Horizontal scrolling has been DEACTIVATED.");
- XtAppWarning(XtWidgetToApplicationContext(new), error_buf);
+ char *err1 = "Xaw Text Widget ";
+ char *err2 = ":\nHorizontal scrolling not allowed with width resize.\n";
+ char *err3 = "Horizontal scrolling has been DEACTIVATED.";
+ len = strlen(err1) + strlen(err2) + strlen(err3) +
+ strlen(ctx->core.name) + 1;
+ perr = XtStackAlloc(len, error_buf);
+ if (perr != NULL) {
+ (void) sprintf(perr, "%s%s%s%s", err1, ctx->core.name, err2, err3);
+ XtAppWarning(XtWidgetToApplicationContext(new), perr);
+ XtStackFree(perr, error_buf);
+ }
ctx->text.scroll_horiz = XawtextScrollNever;
}
else if (ctx->text.scroll_horiz == XawtextScrollAlways)
Index: libXaw3d-1.6.2/src/TextPop.c
===================================================================
--- libXaw3d-1.6.2.orig/src/TextPop.c
+++ libXaw3d-1.6.2/src/TextPop.c
@@ -68,6 +68,8 @@ in this Software without prior written a
#include <X11/Xos.h> /* for O_RDONLY */
#include <errno.h>
+#include "XawAlloc.h"
+
#ifdef X_NOT_STDC_ENV
extern int errno;
#endif
@@ -789,6 +791,8 @@ static Boolean
DoSearch(struct SearchAndReplace * search)
{
char msg[BUFSIZ];
+ char *pmsg;
+ int len;
Widget tw = XtParent(search->search_popup);
XawTextPosition pos;
XawTextScanDirection dir;
@@ -815,9 +819,20 @@ DoSearch(struct SearchAndReplace * searc
/* The Raw string in find.ptr may be WC I can't use here, so I re - call
GetString to get a tame version. */
- if (pos == XawTextSearchError)
- (void) sprintf( msg, "Could not find string ``%s''.", GetString( search->search_text ) );
- else {
+ if (pos == XawTextSearchError) {
+ char *msg1 = "Could not find string ``";
+ char *msg2 = "''.";
+ len = strlen(msg1) + strlen(msg2) +
+ strlen(GetString( search->search_text )) + 1;
+ pmsg = XtStackAlloc(len, msg);
+ if (pmsg != NULL) {
+ (void) sprintf( pmsg, "%s%s%s", msg1, GetString( search->search_text ),
+ msg2);
+ } else {
+ pmsg = msg;
+ (void) sprintf( pmsg, "Could not find string");
+ }
+ } else {
if (dir == XawsdRight)
XawTextSetInsertionPoint( tw, pos + text.length);
else
@@ -829,7 +844,8 @@ DoSearch(struct SearchAndReplace * searc
}
XawTextUnsetSelection(tw);
- SetSearchLabels(search, msg, "", TRUE);
+ SetSearchLabels(search, pmsg, "", TRUE);
+ XtStackFree(pmsg, msg);
return(FALSE);
}
@@ -950,13 +966,26 @@ Replace(struct SearchAndReplace *search,
if (new_pos == XawTextSearchError) {
if (count == 0) {
char msg[BUFSIZ];
+ char *pmsg;
+ int len;
+ char *msg1 = "*** Error: Could not find string ``";
+ char *msg2 = "''. ***";
/* The Raw string in find.ptr may be WC I can't use here,
so I call GetString to get a tame version.*/
- (void) sprintf( msg, "%s %s %s", "*** Error: Could not find string ``",
- GetString( search->search_text ), "''. ***");
- SetSearchLabels(search, msg, "", TRUE);
+ len = strlen(msg1) + strlen(msg2) +
+ strlen(GetString( search->search_text )) + 1;
+ pmsg = XtStackAlloc(len, msg);
+ if (pmsg != NULL) {
+ (void) sprintf( pmsg, "%s%s%s", msg1,
+ GetString( search->search_text ), msg2);
+ } else {
+ pmsg = msg;
+ (void) sprintf(pmsg, "*** Error: Could not find string ***");
+ }
+ SetSearchLabels(search, pmsg, "", TRUE);
+ XtStackFree(pmsg, msg);
return(FALSE);
}
else
@@ -979,9 +1008,22 @@ Replace(struct SearchAndReplace *search,
if (XawTextReplace(tw, pos, end_pos, &replace) != XawEditDone) {
char msg[BUFSIZ];
-
- (void) sprintf( msg, "'%s' with '%s'. ***", find.ptr, replace.ptr);
+ char *pmsg;
+ int len;
+ char *msg1 = "' with '";
+ char *msg2 = "'. ***";
+
+ len = 1 + strlen(msg1) + strlen(msg2) + strlen(find.ptr) +
+ strlen(replace.ptr) + 1;
+ pmsg = XtStackAlloc(len, msg);
+ if (pmsg != NULL) {
+ (void) sprintf( pmsg, "`%s%s%s%s", find.ptr, msg1, replace.ptr, msg2);
+ } else {
+ pmsg = msg;
+ (void) sprintf(pmsg, "string ***");
+ }
SetSearchLabels(search, "*** Error while replacing", msg, TRUE);
+ XtStackFree(pmsg, msg);
return(FALSE);
}
@@ -1122,13 +1164,20 @@ SetResourceByName(Widget shell, char *na
{
Widget temp_widget;
char buf[BUFSIZ];
+ char *pbuf;
+ int len;
- (void) sprintf(buf, "%s.%s", FORM_NAME, name);
+ len = strlen(FORM_NAME) + strlen(name) + 2;
+ pbuf = XtStackAlloc(len, buf);
+ if (pbuf == NULL) return FALSE;
+ (void) sprintf(pbuf, "%s.%s", FORM_NAME, name);
- if ( (temp_widget = XtNameToWidget(shell, buf)) != NULL) {
+ if ( (temp_widget = XtNameToWidget(shell, pbuf)) != NULL) {
SetResource(temp_widget, res_name, value);
+ XtStackFree(pbuf, buf);
return(TRUE);
}
+ XtStackFree(pbuf, buf);
return(FALSE);
}
Index: libXaw3d-1.6.2/src/XawAlloc.h
===================================================================
--- /dev/null
+++ libXaw3d-1.6.2/src/XawAlloc.h
@@ -0,0 +1,10 @@
+/* $XFree86: xc/lib/Xaw/XawAlloc.h,v 1.1.2.1 1998/05/16 09:05:23 dawes Exp $ */
+
+#define XtStackAlloc(size, stack_cache_array) \
+ ((size) <= sizeof(stack_cache_array) \
+ ? (XtPointer)(stack_cache_array) \
+ : XtMalloc((unsigned)(size)))
+
+#define XtStackFree(pointer, stack_cache_array) \
+ if ((pointer) != ((XtPointer)(stack_cache_array))) XtFree(pointer); else
+
Index: libXaw3d-1.6.2/src/XawI18n.h
===================================================================
--- libXaw3d-1.6.2.orig/src/XawI18n.h
+++ libXaw3d-1.6.2/src/XawI18n.h
@@ -28,12 +28,14 @@ in this Software without prior written a
#ifdef HAVE_WCTYPE_H
#include <wctype.h>
#ifdef HAVE_WIDEC_H
+#ifndef NO_WIDEC_H
#include <widec.h>
#define wcslen(c) wslen(c)
#define wcscpy(d,s) wscpy(d,s)
#define wcsncpy(d,s,l) wsncpy(d,s,l)
#endif
#endif
+#endif
#ifdef HAVE_WCHAR_H
#include <wchar.h>
Index: libXaw3d-1.6.2/src/XawIm.c
===================================================================
--- libXaw3d-1.6.2.orig/src/XawIm.c
+++ libXaw3d-1.6.2/src/XawIm.c
@@ -1519,10 +1519,10 @@ _XawImWcLookupString(
if ((vw = SearchVendorShell(inwidg)) && (ve = GetExtPart(vw)) &&
ve->im.xim && (p = GetIcTableShared(inwidg, ve)) && p->xic) {
- return(XwcLookupString(p->xic, event, buffer_return, bytes_buffer,
+ return(XwcLookupString(p->xic, event, buffer_return, bytes_buffer/sizeof(wchar_t),
keysym_return, status_return));
}
- ret = XLookupString( event, tmp_buf, 64, keysym_return,
+ ret = XLookupString( event, tmp_buf, sizeof(tmp_buf), keysym_return,
(XComposeStatus*) status_return );
for ( i = 0, tmp_p = tmp_buf, buf_p = buffer_return; i < ret; i++ ) {
*buf_p++ = _Xaw_atowc(*tmp_p++);

970
xaw3d-thumb.patch Normal file
View File

@ -0,0 +1,970 @@
---
include/X11/Xaw3d/Scrollbar.h | 6
include/X11/Xaw3d/ScrollbarP.h | 3
include/X11/Xaw3d/SmeThreeD.h | 3
include/X11/Xaw3d/SmeThreeDP.h | 1
include/X11/Xaw3d/ThreeD.h | 3
include/X11/Xaw3d/ThreeDP.h | 1
src/Layout.c | 2
src/Paned.c | 6
src/Scrollbar.c | 533 ++++++++++++++++++++++++++++++-----------
src/SmeThreeD.c | 19 +
src/ThreeD.c | 6
11 files changed, 436 insertions(+), 147 deletions(-)
Index: libXaw3d-1.6.2/include/X11/Xaw3d/Scrollbar.h
===================================================================
--- libXaw3d-1.6.2.orig/include/X11/Xaw3d/Scrollbar.h
+++ libXaw3d-1.6.2/include/X11/Xaw3d/Scrollbar.h
@@ -92,6 +92,7 @@ SOFTWARE.
scrollRCursor Cursor Cursor XC_sb_right_arrow
scrollUCursor Cursor Cursor XC_sb_up_arrow
scrollVCursor Cursor Cursor XC_sb_v_double_arrow
+ scrollbarBackground ScrollbarBackground Pixel XtDefaultForeground
sensitive Sensitive Boolean True
shown Shown Float 0.0
thickness Thickness Dimension 14
@@ -99,6 +100,7 @@ SOFTWARE.
thumbProc Callback XtCallbackList NULL
topOfThumb TopOfThumb Float 0.0
pickTop PickTop Boolean False
+ pushThumb PushThumb Boolean True
translations Translations TranslationTable see source or doc
width Width Dimension thickness or length
x Position Position 0
@@ -113,11 +115,15 @@ SOFTWARE.
#define XtCMinimumThumb "MinimumThumb"
#define XtCShown "Shown"
#define XtCTopOfThumb "TopOfThumb"
+#define XtCScrollbarBackground "ScrollbarBackground"
#define XtCPickTop "PickTop"
+#define XtCPushThumb "PushThumb"
#define XtNminimumThumb "minimumThumb"
#define XtNtopOfThumb "topOfThumb"
+#define XtNscrollbarBackground "scrollbarBackground"
#define XtNpickTop "pickTop"
+#define XtNpushThumb "pushThumb"
typedef struct _ScrollbarRec *ScrollbarWidget;
typedef struct _ScrollbarClassRec *ScrollbarWidgetClass;
Index: libXaw3d-1.6.2/include/X11/Xaw3d/ScrollbarP.h
===================================================================
--- libXaw3d-1.6.2.orig/include/X11/Xaw3d/ScrollbarP.h
+++ libXaw3d-1.6.2/include/X11/Xaw3d/ScrollbarP.h
@@ -66,6 +66,7 @@ typedef struct {
XtCallbackList thumbProc; /* jump (to position) scroll */
XtCallbackList jumpProc; /* same as thumbProc but pass data by ref */
Pixmap thumb; /* thumb color */
+ Pixel background; /* background color */
#ifndef XAW_ARROW_SCROLLBARS
Cursor upCursor; /* scroll up cursor */
Cursor downCursor; /* scroll down cursor */
@@ -91,9 +92,11 @@ typedef struct {
char direction; /* a scroll has started; which direction */
#endif
GC gc; /* a (shared) gc */
+ GC bgc; /* a (shared) gc for background */
Position topLoc; /* Pixel that corresponds to top */
Dimension shownLength; /* Num pixels corresponding to shown */
Boolean pick_top; /* pick thumb at top or anywhere*/
+ Boolean push_thumb; /* push thumb in or not */
} ScrollbarPart;
Index: libXaw3d-1.6.2/include/X11/Xaw3d/SmeThreeD.h
===================================================================
--- libXaw3d-1.6.2.orig/include/X11/Xaw3d/SmeThreeD.h
+++ libXaw3d-1.6.2/include/X11/Xaw3d/SmeThreeD.h
@@ -46,6 +46,7 @@ SOFTWARE.
bottomShadowContrast BottomShadowContrast Int 40
userData UserData XtPointer NULL
beNiceToColormap BeNiceToColormap Boolean False
+ invertBorder InvertBorder Boolean False
*/
@@ -63,6 +64,8 @@ SOFTWARE.
#define XtCBeNiceToColormap "BeNiceToColormap"
#define XtNbeNiceToColourmap "beNiceToColormap"
#define XtCBeNiceToColourmap "BeNiceToColormap"
+#define XtNinvertBorder "invertBorder"
+#define XtCInvertBorder "InvertBorder"
#define XtNuserData "userData"
#define XtCUserData "UserData"
Index: libXaw3d-1.6.2/include/X11/Xaw3d/SmeThreeDP.h
===================================================================
--- libXaw3d-1.6.2.orig/include/X11/Xaw3d/SmeThreeDP.h
+++ libXaw3d-1.6.2/include/X11/Xaw3d/SmeThreeDP.h
@@ -43,6 +43,7 @@ typedef struct {
XtPointer user_data;
Boolean be_nice_to_cmap;
Boolean shadowed;
+ Boolean invert_border;
} SmeThreeDPart;
/* Full instance record declaration */
Index: libXaw3d-1.6.2/include/X11/Xaw3d/ThreeD.h
===================================================================
--- libXaw3d-1.6.2.orig/include/X11/Xaw3d/ThreeD.h
+++ libXaw3d-1.6.2/include/X11/Xaw3d/ThreeD.h
@@ -45,6 +45,7 @@ SOFTWARE.
bottomShadowContrast BottomShadowContrast Int 40
userData UserData XtPointer NULL
beNiceToColormap BeNiceToColormap Boolean False
+ invertBorder InvertBorder Boolean False
relief Relief XtRelief XtReliefRaised
*/
@@ -63,6 +64,8 @@ SOFTWARE.
#define XtCBeNiceToColormap "BeNiceToColormap"
#define XtNbeNiceToColourmap "beNiceToColormap"
#define XtCBeNiceToColourmap "BeNiceToColormap"
+#define XtNinvertBorder "invertBorder"
+#define XtCInvertBorder "InvertBorder"
#define XtNuserData "userData"
#define XtCUserData "UserData"
#define XtNrelief "relief"
Index: libXaw3d-1.6.2/include/X11/Xaw3d/ThreeDP.h
===================================================================
--- libXaw3d-1.6.2.orig/include/X11/Xaw3d/ThreeDP.h
+++ libXaw3d-1.6.2/include/X11/Xaw3d/ThreeDP.h
@@ -43,6 +43,7 @@ typedef struct {
GC bot_shadow_GC;
XtPointer user_data;
Boolean be_nice_to_cmap;
+ Boolean invert_border;
XtRelief relief;
} ThreeDPart;
Index: libXaw3d-1.6.2/src/Layout.c
===================================================================
--- libXaw3d-1.6.2.orig/src/Layout.c
+++ libXaw3d-1.6.2/src/Layout.c
@@ -509,7 +509,7 @@ LookupVariable (BoxPtr child, XrmQuark q
static double
Evaluate (LayoutWidget l, BoxPtr box, ExprPtr expr, double natural)
{
- double left, right, down;
+ double left = 0.0, right = 0.0, down = 0.0;
Widget widget;
SubInfoPtr info;
Index: libXaw3d-1.6.2/src/Paned.c
===================================================================
--- libXaw3d-1.6.2.orig/src/Paned.c
+++ libXaw3d-1.6.2/src/Paned.c
@@ -1114,13 +1114,14 @@ ManageAndUnmanageGrips(PanedWidget pw)
managedP = managed_grips = (WidgetList) XtMalloc(alloc_size);
unmanagedP = unmanaged_grips = (WidgetList) XtMalloc(alloc_size);
- ForAllChildren(pw, childP)
+ ForAllChildren(pw, childP) {
if (IsPane(*childP) && HasGrip(*childP)) {
if ( XtIsManaged(*childP) )
*managedP++ = PaneInfo(*childP)->grip;
else
*unmanagedP++ = PaneInfo(*childP)->grip;
}
+ }
if (managedP != managed_grips) {
*unmanagedP++ = *--managedP; /* Last grip is never managed */
@@ -1615,7 +1616,7 @@ ChangeManaged(Widget w)
ResortChildren(pw);
pw->paned.num_panes = 0;
- ForAllChildren(pw, childP)
+ ForAllChildren(pw, childP) {
if ( IsPane(*childP) ) {
if ( XtIsManaged(*childP) ) {
Pane pane = PaneInfo(*childP);
@@ -1627,6 +1628,7 @@ ChangeManaged(Widget w)
else
break; /* This list is already sorted. */
}
+ }
SetChildrenPrefSizes( (PanedWidget) w, size);
Index: libXaw3d-1.6.2/src/Scrollbar.c
===================================================================
--- libXaw3d-1.6.2.orig/src/Scrollbar.c
+++ libXaw3d-1.6.2/src/Scrollbar.c
@@ -134,14 +134,18 @@ static XtResource resources[] = {
Offset(scrollbar.thumb), XtRImmediate, (XtPointer) XtUnspecifiedPixmap},
{XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
Offset(scrollbar.foreground), XtRString, XtDefaultForeground},
+ {XtNscrollbarBackground, XtCScrollbarBackground, XtRPixel, sizeof(Pixel),
+ Offset(scrollbar.background), XtRString, XtDefaultForeground},
{XtNshown, XtCShown, XtRFloat, sizeof(float),
Offset(scrollbar.shown), XtRFloat, (XtPointer)&floatZero},
{XtNtopOfThumb, XtCTopOfThumb, XtRFloat, sizeof(float),
Offset(scrollbar.top), XtRFloat, (XtPointer)&floatZero},
{XtNpickTop, XtCPickTop, XtRBoolean, sizeof(Boolean),
- Offset(scrollbar.pick_top), XtRBoolean, (XtPointer) False},
+ Offset(scrollbar.pick_top), XtRImmediate, (XtPointer) False},
{XtNminimumThumb, XtCMinimumThumb, XtRDimension, sizeof(Dimension),
- Offset(scrollbar.min_thumb), XtRImmediate, (XtPointer) 7}
+ Offset(scrollbar.min_thumb), XtRImmediate, (XtPointer) 7},
+ {XtNpushThumb, XtCPushThumb, XtRBoolean, sizeof(Boolean),
+ Offset(scrollbar.push_thumb), XtRImmediate, (XtPointer) True}
};
#undef Offset
@@ -215,8 +219,7 @@ ScrollbarClassRec scrollbarClassRec = {
/* change_sensitive */ XtInheritChangeSensitive
},
{ /* threeD fields */
- /* shadowdraw */ XtInheritXaw3dShadowDraw /*,*/
- /* shadowboxdraw */ /*XtInheritXaw3dShadowBoxDraw*/
+ /* shadowdraw */ XtInheritXaw3dShadowDraw
},
{ /* scrollbar fields */
/* ignore */ 0
@@ -228,7 +231,7 @@ WidgetClass scrollbarWidgetClass = (Widg
#define NoButton -1
#define PICKLENGTH(widget, x, y) \
- ((widget->scrollbar.orientation == XtorientHorizontal) ? x : y)
+ ((widget->scrollbar.orientation == XtorientHorizontal) ? (x) : (y))
#define MIN(x,y) ((x) < (y) ? (x) : (y))
#define MAX(x,y) ((x) > (y) ? (x) : (y))
@@ -248,6 +251,23 @@ ClassInitialize(void)
#endif
/*
+ Used to swap X and Y coordinates when the scrollbar is horizontal.
+ */
+static void swap_short(short *a, short *b)
+{
+ short tmp = *a;
+ *a = *b;
+ *b = tmp;
+}
+static void swap(Dimension *a, Dimension *b)
+{
+ Dimension tmp = *a;
+ *a = *b;
+ *b = tmp;
+}
+
+
+/*
The original Xaw Scrollbar's FillArea *really* relied on the fact that the
server was going to clip at the window boundaries; so the logic was really
rather sloppy. To avoid drawing over the shadows and the arrows requires
@@ -297,161 +317,371 @@ FillArea (ScrollbarWidget sbw, Position
erasing is done cleverly so that no flickering will occur. */
static void
-PaintThumb (ScrollbarWidget sbw, XEvent *event)
+PaintThumb (ScrollbarWidget sbw, int pressed, int shadow)
{
- Dimension s = sbw->threeD.shadow_width;
- Position oldtop = sbw->scrollbar.topLoc;
- Position oldbot = oldtop + sbw->scrollbar.shownLength;
- Dimension margin = MARGIN (sbw);
- Dimension tzl = sbw->scrollbar.length - margin - margin;
- Position newtop, newbot;
- Position floor = sbw->scrollbar.length - margin;
+ Dimension margin, tzl;
+ Position floor;
+ Position oldtop = sbw->scrollbar.topLoc;
+ Position oldbot = oldtop + sbw->scrollbar.shownLength;
+ Position newtop, newbot;
+ Dimension x, y; /* upper-left corner of rectangle */
+ Dimension w, h; /* size of rectangle */
+ Dimension sw = sbw->threeD.shadow_width;
+ Dimension th = sbw->scrollbar.thickness;
+ XPoint ipt[4],opt[4]; /* inner and outer points of thumb */
+ XPoint pt[4]; /* points used for drawing */
+ Display *dpy = XtDisplay (sbw);
+ Window win = XtWindow (sbw);
+ double thumb_len;
+
+ margin = MARGIN (sbw);
+ tzl = sbw->scrollbar.length - 2*margin;
+ floor = sbw->scrollbar.length - margin;
newtop = margin + (int)(tzl * sbw->scrollbar.top);
- newbot = newtop + (int)(tzl * sbw->scrollbar.shown);
- if (sbw->scrollbar.shown < 1.) newbot++;
- if (newbot < newtop + (int)sbw->scrollbar.min_thumb +
- 2 * (int)sbw->threeD.shadow_width)
- newbot = newtop + sbw->scrollbar.min_thumb +
- 2 * sbw->threeD.shadow_width;
- if ( newbot >= floor ) {
- newtop = floor-(newbot-newtop)+1;
+ thumb_len = tzl * sbw->scrollbar.shown;
+ newbot = newtop + (int)thumb_len;
+ if ((thumb_len - (int)thumb_len) > 0.5) ++newbot;
+
+ if (newbot < newtop + (int)sbw->scrollbar.min_thumb + 2 * (int)sw)
+ newbot = newtop + sbw->scrollbar.min_thumb + 2 * sw;
+
+ if (newbot >= floor) {
+ newtop = floor - (newbot-newtop) + 1;
newbot = floor;
}
sbw->scrollbar.topLoc = newtop;
sbw->scrollbar.shownLength = newbot - newtop;
+
if (XtIsRealized ((Widget) sbw)) {
- /* 3D thumb wanted ?
- */
- if (s)
- {
- if (newtop < oldtop) FillArea(sbw, oldtop, oldtop + s, 0);
- if (newtop > oldtop) FillArea(sbw, oldtop, MIN(newtop, oldbot), 0);
- if (newbot < oldbot) FillArea(sbw, MAX(newbot, oldtop), oldbot, 0);
- if (newbot > oldbot) FillArea(sbw, oldbot - s, oldbot, 0);
-
- if (sbw->scrollbar.orientation == XtorientHorizontal)
- {
- _ShadowSurroundedBox((Widget)sbw, (ThreeDWidget)sbw,
- newtop, s, newbot, sbw->core.height - s,
- sbw->threeD.relief, TRUE);
- }
- else
- {
- _ShadowSurroundedBox((Widget)sbw, (ThreeDWidget)sbw,
- s, newtop, sbw->core.width - s, newbot,
- sbw->threeD.relief, TRUE);
- }
- }
- else
- {
- /*
- Note to Mitch: FillArea is (now) correctly implemented to
- not draw over shadows or the arrows. Therefore setting clipmasks
- doesn't seem to be necessary. Correct me if I'm wrong!
- */
- if (newtop < oldtop) FillArea(sbw, newtop, MIN(newbot, oldtop), 1);
- if (newtop > oldtop) FillArea(sbw, oldtop, MIN(newtop, oldbot), 0);
- if (newbot < oldbot) FillArea(sbw, MAX(newbot, oldtop), oldbot, 0);
- if (newbot > oldbot) FillArea(sbw, MAX(newtop, oldbot), newbot, 1);
- }
+ /* 3D? */
+ if (sw) {
+ GC top, bot;
+ GC back = sbw->scrollbar.bgc;
+ GC fore = sbw->scrollbar.gc;
+
+ if ((pressed && sbw->scrollbar.push_thumb) ^ sbw->threeD.invert_border) {
+ top = sbw->threeD.bot_shadow_GC;
+ bot = sbw->threeD.top_shadow_GC;
+ } else {
+ top = sbw->threeD.top_shadow_GC;
+ bot = sbw->threeD.bot_shadow_GC;
+ }
+
+ /* the space above the thumb */
+ x = sw;
+ y = margin;
+ w = th - sw * 2;
+ h = newtop - y;
+ if (sbw->scrollbar.orientation == XtorientHorizontal) {
+ swap(&x, &y);
+ swap(&w, &h);
+ }
+ XFillRectangle(dpy, win, back, x, y, (unsigned int)w, (unsigned int)h);
+
+ /* the space below the thumb */
+ x = sw;
+ y = newbot;
+ w = th - sw * 2;
+ h = tzl + margin - newbot;
+ if (sbw->scrollbar.orientation == XtorientHorizontal) {
+ swap(&x, &y);
+ swap(&w, &h);
+ }
+ XFillRectangle(dpy, win, back, x, y, (unsigned int)w, (unsigned int)h);
+
+ /* Return here if only the shadows should be repainted */
+ if (shadow) return;
+
+ /* the thumb itself */
+ x = sw * 2;
+ y = newtop + sw;
+ w = th - sw * 4;
+ h = newbot - newtop - 2 * sw;
+ if (sbw->scrollbar.orientation == XtorientHorizontal) {
+ swap(&x, &y);
+ swap(&w, &h);
+ }
+ /* we can't use "w > 0" and "h > 0" because they are
+ usually unsigned quantities */
+ if (th - sw * 4 > 0 && newbot - newtop - 2 * sw > 0)
+ XFillRectangle(dpy, win, fore, x, y, (unsigned int)w, (unsigned int)h);
+
+ /* the shades around the thumb
+
+ o0 +--------------+ o3
+ |\ i0 i3 /|
+ | +----------+ |
+ | | | |
+ | | | |
+ | | | |
+ | +----------+ |
+ |/ i1 i2 \|
+ o1 +--------------+ o2
+
+ */
+ opt[0].x = opt[1].x = sw;
+ opt[0].y = opt[3].y = newtop;
+ opt[2].x = opt[3].x = th - sw;
+ opt[2].y = opt[1].y = newbot;
+
+ ipt[0].x = ipt[1].x = opt[0].x + sw;
+ ipt[0].y = ipt[3].y = opt[0].y + sw;
+ ipt[2].x = ipt[3].x = opt[2].x - sw;
+ ipt[2].y = ipt[1].y = opt[2].y - sw;
+
+ /* make sure shades don't overlap */
+ if (ipt[0].x > ipt[3].x)
+ ipt[3].x = ipt[2].x = ipt[1].x = ipt[0].x = (ipt[0].x + ipt[3].x) / 2;
+ if (ipt[0].y > ipt[1].y)
+ ipt[3].y = ipt[2].y = ipt[1].y = ipt[0].y = (ipt[0].y + ipt[1].y) / 2;
+ if (sbw->scrollbar.orientation == XtorientHorizontal) {
+ int n;
+ for (n = 0; n < 4; n++) {
+ swap_short(&ipt[n].x, &ipt[n].y);
+ swap_short(&opt[n].x, &opt[n].y);
+ }
+ }
+
+ /* left */
+ pt[0] = opt[0];
+ pt[1] = opt[1];
+ pt[2] = ipt[1];
+ pt[3] = ipt[0];
+ XFillPolygon (dpy, win, top, pt, 4, Convex, CoordModeOrigin);
+
+ /* top */
+ pt[0] = opt[0];
+ pt[1] = opt[3];
+ pt[2] = ipt[3];
+ pt[3] = ipt[0];
+ XFillPolygon (dpy, win, top, pt, 4, Convex, CoordModeOrigin);
+
+ /* bottom */
+ pt[0] = opt[1];
+ pt[1] = opt[2];
+ pt[2] = ipt[2];
+ pt[3] = ipt[1];
+ XFillPolygon (dpy, win, bot, pt, 4, Convex, CoordModeOrigin);
+
+ /* right */
+ pt[0] = opt[3];
+ pt[1] = opt[2];
+ pt[2] = ipt[2];
+ pt[3] = ipt[3];
+ XFillPolygon (dpy, win, bot, pt, 4, Convex, CoordModeOrigin);
+
+
+ } else {
+ /* Return here if only the shadows should be repainted */
+ if (shadow) return;
+
+ /*
+ * Note to Mitch: FillArea is (now) correctly implemented to
+ * not draw over shadows or the arrows. Therefore setting clipmasks
+ * doesn't seem to be necessary. Correct me if I'm wrong!
+ */
+ if (newtop < oldtop) FillArea(sbw, newtop, MIN(newbot, oldtop), 1);
+ if (newtop > oldtop) FillArea(sbw, oldtop, MIN(newtop, oldbot), 0);
+ if (newbot < oldbot) FillArea(sbw, MAX(newbot, oldtop), oldbot, 0);
+ if (newbot > oldbot) FillArea(sbw, MAX(newtop, oldbot), newbot, 1);
+ }
}
}
#ifdef XAW_ARROW_SCROLLBARS
static void
-PaintArrows (ScrollbarWidget sbw)
-{
- XPoint pt[20];
- Dimension s = sbw->threeD.shadow_width;
- Dimension t = sbw->scrollbar.thickness;
- Dimension l = sbw->scrollbar.length;
- Dimension tms = t - s, lms = l - s;
- Dimension tm1 = t - 1;
- Dimension lmt = l - t;
- Dimension lp1 = lmt + 1;
- Dimension sm1 = s - 1;
- Dimension t2 = t / 2;
- Dimension sa30 = (Dimension)(1.732 * s ); /* cotangent of 30 deg */
- Display *dpy = XtDisplay (sbw);
- Window win = XtWindow (sbw);
- GC top = sbw->threeD.top_shadow_GC;
- GC bot = sbw->threeD.bot_shadow_GC;
-
+PaintArrows (ScrollbarWidget sbw, int toppressed, int botpressed)
+{
+ XPoint ipt[6], opt[6]; /* inner and outer points */
+ XPoint rpt[4]; /* the rectangle around arrows */
+ XPoint tpt[6]; /* temporary for args to XFillPolygon */
+ Dimension sw = sbw->threeD.shadow_width;
+ Dimension th = sbw->scrollbar.thickness;
+ Dimension len = sbw->scrollbar.length;
+ Display *dpy = XtDisplay (sbw);
+ Window win = XtWindow (sbw);
+ GC top, bot;
+ GC back = sbw->scrollbar.bgc;
+ GC fore = sbw->scrollbar.gc;
if (XtIsRealized ((Widget) sbw)) {
/* 3D arrows?
*/
- if (s) {
- /* upper/right arrow */
- pt[0].x = sm1; pt[0].y = tm1;
- pt[1].x = t2; pt[1].y = sm1;
- pt[2].x = t2; pt[2].y = s + sa30;
- pt[3].x = sm1 + sa30; pt[3].y = tms - 1;
-
- pt[4].x = sm1; pt[4].y = tm1;
- pt[5].x = tms; pt[5].y = tm1;
- pt[6].x = t2; pt[6].y = sm1;
- pt[7].x = t2; pt[7].y = s + sa30;
- pt[8].x = tms - sa30; pt[8].y = tms - 1;
- pt[9].x = sm1 + sa30; pt[9].y = tms - 1;
-
- /* lower/left arrow */
- pt[10].x = tms; pt[10].y = lp1;
- pt[11].x = s; pt[11].y = lp1;
- pt[12].x = t2; pt[12].y = lms;
- pt[13].x = t2; pt[13].y = lms - sa30;
- pt[14].x = s + sa30; pt[14].y = lmt + s + 1;
- pt[15].x = tms - sa30; pt[15].y = lmt + s + 1;
-
- pt[16].x = tms; pt[16].y = lp1;
- pt[17].x = t2; pt[17].y = lms;
- pt[18].x = t2; pt[18].y = lms - sa30;
- pt[19].x = tms - sa30; pt[19].y = lmt + s + 1;
+ if (sw) {
+ /*
+ The points are numbered like this:
+
+ r0 +---------+ r3
+ | ^ o2 |
+ | /|\ | a = i0
+ | /c^ \ | b = i1
+ | / / \ \ | c = i2
+ |/a<--->b\|
+ o0 +---------+ o1
+ | |
+ | |
+ o3 +---------+ o4
+ |\d<--->e/|
+ | \ \ / / | d = i3
+ | \fv / | e = i4
+ | \|/ | f = i5
+ | v o5 |
+ r1 +---------+ r2
+ */
+
+ rpt[0].x = rpt[1].x = opt[0].x = opt[3].x = sw;
+ ipt[0].x = ipt[3].x = sw * 2.5;
+ opt[2].x = opt[5].x = ipt[2].x = ipt[5].x = th / 2;
+ ipt[1].x = ipt[4].x = th - (int)(sw * 2.5);
+ rpt[2].x = rpt[3].x = opt[1].x = opt[4].x = th - sw;
+
+ rpt[0].y = rpt[3].y = opt[2].y = sw;
+ ipt[2].y = sw * 3.2;
+ ipt[0].y = ipt[1].y = th - sw;
+ opt[0].y = opt[1].y = th;
+ opt[3].y = opt[4].y = len - th;
+ ipt[3].y = ipt[4].y = len - th + sw;
+ ipt[5].y = len - (int)(sw * 3.2);
+ rpt[1].y = rpt[2].y = opt[5].y = len - sw;
+
+ /* some ugly kludges to make them look right */
+ opt[2].y--;
+ opt[0].x--;
+ ipt[2].y--;
+ ipt[0].x--;
+
+ /* make sure shades don't overlap */
+ if (ipt[0].x > ipt[1].x) {
+ Dimension tmp = (ipt[0].x + ipt[1].x) / 2;
+ ipt[4].x = ipt[3].x = ipt[1].x = ipt[0].x = tmp;
+ }
+ if (ipt[0].y < ipt[2].y) {
+ ipt[2].y = ipt[1].y = ipt[0].y = (ipt[0].y + ipt[2].y) / 2;
+ ipt[5].y = ipt[4].y = ipt[3].y = (ipt[3].y + ipt[5].y) / 2;
+ }
/* horizontal arrows require that x and y coordinates be swapped */
if (sbw->scrollbar.orientation == XtorientHorizontal) {
int n;
- int swap;
- for (n = 0; n < 20; n++) {
- swap = pt[n].x;
- pt[n].x = pt[n].y;
- pt[n].y = swap;
+ for (n = 0; n < 6; n++) {
+ swap(&ipt[n].x, &ipt[n].y);
+ swap(&opt[n].x, &opt[n].y);
}
+ for (n = 0; n < 4; n++)
+ swap(&rpt[n].x, &rpt[n].y);
+ }
+
+ if (toppressed ^ sbw->threeD.invert_border) {
+ top = sbw->threeD.bot_shadow_GC;
+ bot = sbw->threeD.top_shadow_GC;
+ } else {
+ top = sbw->threeD.top_shadow_GC;
+ bot = sbw->threeD.bot_shadow_GC;
+ }
+
+ /* top-left background */
+ tpt[0] = rpt[0];
+ tpt[1] = opt[0];
+ tpt[2] = opt[2];
+ XFillPolygon (dpy, win, back, tpt, 3, Convex, CoordModeOrigin);
+
+ /* top-right background */
+ tpt[0] = rpt[3];
+ tpt[1] = opt[2];
+ tpt[2] = opt[1];
+ XFillPolygon (dpy, win, back, tpt, 3, Convex, CoordModeOrigin);
+
+ /* the right shade */
+ tpt[0] = opt[1];
+ tpt[1] = opt[2];
+ tpt[2] = ipt[2];
+ tpt[3] = ipt[1];
+ XFillPolygon (dpy, win, bot, tpt, 4, Convex, CoordModeOrigin);
+
+ /* the left shade */
+ tpt[0] = opt[2];
+ tpt[1] = opt[0];
+ tpt[2] = ipt[0];
+ tpt[3] = ipt[2];
+ XFillPolygon (dpy, win, top, tpt, 4, Convex, CoordModeOrigin);
+
+ /* the bottom shade */
+ tpt[0] = opt[0];
+ tpt[1] = opt[1];
+ tpt[2] = ipt[1];
+ tpt[3] = ipt[0];
+ XFillPolygon (dpy, win, bot, tpt, 4, Convex, CoordModeOrigin);
+
+ /* the arrow itself */
+ XFillPolygon (dpy, win, fore, ipt, 3, Convex, CoordModeOrigin);
+
+ if (botpressed ^ sbw->threeD.invert_border) {
+ top = sbw->threeD.bot_shadow_GC;
+ bot = sbw->threeD.top_shadow_GC;
+ } else {
+ top = sbw->threeD.top_shadow_GC;
+ bot = sbw->threeD.bot_shadow_GC;
}
- XFillPolygon (dpy, win, top, pt, 4, Complex, CoordModeOrigin);
- XFillPolygon (dpy, win, bot, pt + 4, 6, Complex, CoordModeOrigin);
- XFillPolygon (dpy, win, top, pt + 10, 6, Complex, CoordModeOrigin);
- XFillPolygon (dpy, win, bot, pt + 16, 4, Complex, CoordModeOrigin);
+
+ /* bottom-left background */
+ tpt[0] = rpt[1];
+ tpt[1] = opt[5];
+ tpt[2] = opt[3];
+ XFillPolygon (dpy, win, back, tpt, 3, Convex, CoordModeOrigin);
+
+ /* bottom-right background */
+ tpt[0] = rpt[2];
+ tpt[1] = opt[4];
+ tpt[2] = opt[5];
+ XFillPolygon (dpy, win, back, tpt, 3, Convex, CoordModeOrigin);
+
+ /* the left shade */
+ tpt[0] = opt[3];
+ tpt[1] = opt[5];
+ tpt[2] = ipt[5];
+ tpt[3] = ipt[3];
+ XFillPolygon (dpy, win, top, tpt, 4, Convex, CoordModeOrigin);
+
+ /* the right shade */
+ tpt[0] = opt[5];
+ tpt[1] = opt[4];
+ tpt[2] = ipt[4];
+ tpt[3] = ipt[5];
+ XFillPolygon (dpy, win, bot, tpt, 4, Convex, CoordModeOrigin);
+
+ /* the top shade */
+ tpt[0] = opt[4];
+ tpt[1] = opt[3];
+ tpt[2] = ipt[3];
+ tpt[3] = ipt[4];
+ XFillPolygon (dpy, win, top, tpt, 4, Convex, CoordModeOrigin);
+
+ /* the arrow itself */
+ XFillPolygon (dpy, win, fore, ipt+3, 3, Convex, CoordModeOrigin);
} else {
- pt[0].x = 0; pt[0].y = tm1;
- pt[1].x = t; pt[1].y = tm1;
- pt[2].x = t2; pt[2].y = 0;
-
- pt[3].x = 0; pt[3].y = lp1;
- pt[4].x = t; pt[4].y = lp1;
- pt[5].x = t2; pt[5].y = l;
+
+ tpt[0] = opt[0];
+ tpt[1] = opt[1];
+ tpt[2] = opt[2];
+ tpt[3] = opt[3];
+ tpt[4] = opt[4];
+ tpt[5] = opt[5];
/* horizontal arrows require that x and y coordinates be swapped */
if (sbw->scrollbar.orientation == XtorientHorizontal) {
int n;
- int swap;
- for (n = 0; n < 6; n++) {
- swap = pt[n].x;
- pt[n].x = pt[n].y;
- pt[n].y = swap;
- }
+ for (n = 0; n < 6; n++)
+ swap(&tpt[n].x, &tpt[n].y);
}
/* draw the up/left arrow */
- XFillPolygon (dpy, win, sbw->scrollbar.gc,
- pt, 3,
- Convex, CoordModeOrigin);
+ XFillPolygon (dpy, win, fore, tpt, 3, Convex, CoordModeOrigin);
+
/* draw the down/right arrow */
- XFillPolygon (dpy, win, sbw->scrollbar.gc,
- pt+3, 3,
- Convex, CoordModeOrigin);
+ XFillPolygon (dpy, win, fore, tpt+3, 3, Convex, CoordModeOrigin);
+
}
}
}
@@ -471,6 +701,7 @@ Destroy (Widget w)
XtRemoveTimeOut (sbw->scrollbar.timer_id);
#endif
XtReleaseGC (w, sbw->scrollbar.gc);
+ XtReleaseGC (w, sbw->scrollbar.bgc);
}
/* Function Name: CreateGC
@@ -487,9 +718,22 @@ CreateGC (Widget w)
XtGCMask mask;
unsigned int depth = 1;
+ /* make GC for scrollbar background */
+ if (sbw->threeD.be_nice_to_cmap ||
+ DefaultDepthOfScreen (XtScreen(w)) == 1) {
+ mask = GCTile | GCFillStyle;
+ gcValues.tile = sbw->threeD.bot_shadow_pxmap;
+ gcValues.fill_style = FillTiled;
+ } else {
+ mask = GCForeground;
+ gcValues.foreground = sbw->scrollbar.background;
+ }
+ sbw->scrollbar.bgc = XtGetGC(w, mask, &gcValues);
+
+ /* make GC for scrollbar foreground */
if (sbw->scrollbar.thumb == XtUnspecifiedPixmap) {
sbw->scrollbar.thumb = XmuCreateStippledPixmap (XtScreen(w),
- (Pixel) 1, (Pixel) 0, depth);
+ (Pixel) 0, (Pixel) 0, depth);
} else if (sbw->scrollbar.thumb != None) {
Window root;
int x, y;
@@ -520,6 +764,9 @@ CreateGC (Widget w)
/* the creation should be non-caching, because */
/* we now set and clear clip masks on the gc returned */
sbw->scrollbar.gc = XtGetGC (w, mask, &gcValues);
+ gcValues.foreground = sbw->scrollbar.foreground;
+ gcValues.background = sbw->core.background_pixel;
+ mask = GCForeground | GCBackground;
}
static void
@@ -610,8 +857,10 @@ SetValues(Widget current, Widget request
if (XtIsRealized (desired)) {
if (sbw->scrollbar.foreground != dsbw->scrollbar.foreground ||
sbw->core.background_pixel != dsbw->core.background_pixel ||
- sbw->scrollbar.thumb != dsbw->scrollbar.thumb) {
+ sbw->scrollbar.thumb != dsbw->scrollbar.thumb ||
+ sbw->scrollbar.background != dsbw->scrollbar.background) {
XtReleaseGC (desired, sbw->scrollbar.gc);
+ XtReleaseGC (desired, sbw->scrollbar.bgc);
CreateGC (desired);
redraw = TRUE;
}
@@ -658,11 +907,14 @@ Redisplay(Widget w, XEvent *event, Regio
XRectInRegion (region, x, y, width, height) != RectangleOut) {
/* Forces entire thumb to be painted. */
sbw->scrollbar.topLoc = -(sbw->scrollbar.length + 1);
- PaintThumb (sbw, event);
+ PaintThumb (sbw, 0, 0);
+ } else {
+ /* Redraw the surounding shadows of the thumb */
+ PaintThumb (sbw, 0, 1);
}
#ifdef XAW_ARROW_SCROLLBARS
/* we'd like to be region aware here!!!! */
- PaintArrows (sbw);
+ PaintArrows (sbw, 0, 0);
#endif
}
@@ -888,12 +1140,13 @@ NotifyScroll (Widget w, XEvent *event, S
if (PICKLENGTH (sbw,x,y) < sbw->scrollbar.thickness) {
/* handle first arrow zone */
call_data = -MAX (A_FEW_PIXELS, sbw->scrollbar.length / 20);
- XtCallCallbacks (w, XtNscrollProc, (XtPointer)(call_data));
+ XtCallCallbacks (w, XtNscrollProc, (XtPointer) call_data);
/* establish autoscroll */
sbw->scrollbar.timer_id =
XtAppAddTimeOut (XtWidgetToApplicationContext (w),
(unsigned long) 300, RepeatNotify, (XtPointer)w);
sbw->scrollbar.scroll_mode = 1;
+ PaintArrows (sbw, 1, 0);
} else if (PICKLENGTH (sbw,x,y) > sbw->scrollbar.length - sbw->scrollbar.thickness) {
/* handle last arrow zone */
call_data = MAX (A_FEW_PIXELS, sbw->scrollbar.length / 20);
@@ -903,6 +1156,7 @@ NotifyScroll (Widget w, XEvent *event, S
XtAppAddTimeOut (XtWidgetToApplicationContext (w),
(unsigned long) 300, RepeatNotify, (XtPointer)w);
sbw->scrollbar.scroll_mode = 3;
+ PaintArrows (sbw, 0, 1);
} else if (PICKLENGTH (sbw, x, y) < sbw->scrollbar.topLoc) {
/* handle zone "above" the thumb */
call_data = - sbw->scrollbar.length;
@@ -911,10 +1165,10 @@ NotifyScroll (Widget w, XEvent *event, S
/* handle zone "below" the thumb */
call_data = sbw->scrollbar.length;
XtCallCallbacks (w, XtNscrollProc, (XtPointer)(call_data));
- } else
- {
- /* handle the thumb in the motion notify action */
- }
+ } else {
+ /* but we need to re-paint it "pressed in" here */
+ PaintThumb (sbw, 1, 0);
+ }
return;
}
#else /* XAW_ARROW_SCROLLBARS */
@@ -976,6 +1230,9 @@ EndScroll(Widget w, XEvent *event, Strin
/* no need to remove any autoscroll timeout; it will no-op */
/* because the scroll_mode is 0 */
/* but be sure to remove timeout in destroy proc */
+ /* release all buttons */
+ PaintArrows (sbw, 0, 0);
+ PaintThumb (sbw, 0, 0);
#else
XtVaSetValues (w, XtNcursor, sbw->scrollbar.inactiveCursor, NULL);
XFlush (XtDisplay (w));
@@ -1044,7 +1301,7 @@ MoveThumb (Widget w, XEvent *event, Stri
#ifdef XAW_ARROW_SCROLLBARS
sbw->scrollbar.scroll_mode = 2; /* indicate continuous scroll */
#endif
- PaintThumb (sbw, event);
+ PaintThumb (sbw, 1, 0);
XFlush (XtDisplay (w)); /* re-draw it before Notifying */
}
@@ -1131,6 +1388,6 @@ void XawScrollbarSetThumb (Widget w,
sbw->scrollbar.shown = (shown > 1.0) ? 1.0 :
(shown >= 0.0) ? shown : sbw->scrollbar.shown;
- PaintThumb (sbw, NULL);
+ PaintThumb (sbw, 0, 0);
}
Index: libXaw3d-1.6.2/src/SmeThreeD.c
===================================================================
--- libXaw3d-1.6.2.orig/src/SmeThreeD.c
+++ libXaw3d-1.6.2/src/SmeThreeD.c
@@ -71,6 +71,9 @@ static XtResource resources[] = {
{XtNborderWidth, XtCBorderWidth, XtRDimension, sizeof(Dimension),
XtOffsetOf(RectObjRec,rectangle.border_width), XtRImmediate,
(XtPointer)0}
+ ,
+ {XtNinvertBorder, XtCInvertBorder, XtRBoolean, sizeof(Boolean),
+ offset(sme_threeD.invert_border), XtRImmediate, (XtPointer) False},
};
#undef offset
@@ -210,7 +213,7 @@ AllocTopShadowPixmap (Widget new)
Display *dpy = XtDisplayOfObject (new);
Screen *scn = XtScreenOfObject (new);
unsigned long top_fg_pixel = 0, top_bg_pixel = 0;
- char *pm_data;
+ char *pm_data = NULL;
Boolean create_pixmap = FALSE;
/*
@@ -266,7 +269,7 @@ AllocBotShadowPixmap (Widget new)
Display *dpy = XtDisplayOfObject (new);
Screen *scn = XtScreenOfObject (new);
unsigned long bot_fg_pixel = 0, bot_bg_pixel = 0;
- char *pm_data;
+ char *pm_data = NULL;
Boolean create_pixmap = FALSE;
if (DefaultDepthOfScreen (scn) == 1) {
@@ -562,8 +565,16 @@ _XawSme3dDrawShadows(Widget gw)
if (tdo->sme_threeD.shadowed)
{
- top = tdo->sme_threeD.top_shadow_GC;
- bot = tdo->sme_threeD.bot_shadow_GC;
+ if (tdo->sme_threeD.invert_border)
+ {
+ bot = tdo->sme_threeD.top_shadow_GC;
+ top = tdo->sme_threeD.bot_shadow_GC;
+ }
+ else
+ {
+ top = tdo->sme_threeD.top_shadow_GC;
+ bot = tdo->sme_threeD.bot_shadow_GC;
+ }
}
else
top = bot = tdo->sme_threeD.erase_GC;
Index: libXaw3d-1.6.2/src/ThreeD.c
===================================================================
--- libXaw3d-1.6.2.orig/src/ThreeD.c
+++ libXaw3d-1.6.2/src/ThreeD.c
@@ -73,6 +73,8 @@ static XtResource resources[] = {
{XtNborderWidth, XtCBorderWidth, XtRDimension, sizeof(Dimension),
XtOffsetOf(RectObjRec,rectangle.border_width), XtRImmediate,
(XtPointer)0},
+ {XtNinvertBorder, XtCInvertBorder, XtRBoolean, sizeof(Boolean),
+ offset(threeD.invert_border), XtRImmediate, (XtPointer) False},
{XtNrelief, XtCRelief, XtRRelief, sizeof(XtRelief),
offset(threeD.relief), XtRString, (XtPointer) defRelief}
};
@@ -637,7 +639,7 @@ _Xaw3dDrawShadows (Widget gw, XEvent *ev
GC realbot = tdw->threeD.bot_shadow_GC;
GC top, bot;
- if (out) {
+ if ((out ^ tdw->threeD.invert_border)) {
top = tdw->threeD.top_shadow_GC;
bot = tdw->threeD.bot_shadow_GC;
} else {
@@ -774,7 +776,7 @@ _ShadowSurroundedBox(Widget gw, ThreeDWi
Window win = XtWindow(gw);
GC top, bot;
- if (out)
+ if ((out ^ tdw->threeD.invert_border))
{
top = tdw->threeD.top_shadow_GC;
bot = tdw->threeD.bot_shadow_GC;

70
xaw3d.patch Normal file
View File

@ -0,0 +1,70 @@
---
src/Scrollbar.c | 11 +++++++----
src/SimpleMenu.c | 2 +-
src/Xaw3dP.c | 2 +-
3 files changed, 9 insertions(+), 6 deletions(-)
Index: libXaw3d-1.6.2/src/Scrollbar.c
===================================================================
--- libXaw3d-1.6.2.orig/src/Scrollbar.c
+++ libXaw3d-1.6.2/src/Scrollbar.c
@@ -159,9 +159,8 @@ static Boolean SetValues(Widget, Widget,
#ifdef XAW_ARROW_SCROLLBARS
static void HandleThumb(Widget, XEvent *, String *, Cardinal *);
-#else
-static void StartScroll(Widget, XEvent *, String *, Cardinal *);
#endif
+static void StartScroll(Widget, XEvent *, String *, Cardinal *);
static void MoveThumb(Widget, XEvent *, String *, Cardinal *);
static void NotifyThumb(Widget, XEvent *, String *, Cardinal *);
static void NotifyScroll(Widget, XEvent *, String *, Cardinal *);
@@ -170,9 +169,8 @@ static void EndScroll(Widget, XEvent *,
static XtActionsRec actions[] = {
#ifdef XAW_ARROW_SCROLLBARS
{"HandleThumb", HandleThumb},
-#else
- {"StartScroll", StartScroll},
#endif
+ {"StartScroll", StartScroll},
{"MoveThumb", MoveThumb},
{"NotifyThumb", NotifyThumb},
{"NotifyScroll", NotifyScroll},
@@ -1055,6 +1053,11 @@ RepeatNotify(XtPointer client_data, XtIn
client_data);
}
+static void StartScroll (Widget w, XEvent *event, String *params, Cardinal *num_params )
+// String *params; /* direction: Back|Forward|Smooth */
+// Cardinal *num_params; /* we only support 1 */
+{
+}
#else /* XAW_ARROW_SCROLLBARS */
/* ARGSUSED */
static void
Index: libXaw3d-1.6.2/src/SimpleMenu.c
===================================================================
--- libXaw3d-1.6.2.orig/src/SimpleMenu.c
+++ libXaw3d-1.6.2/src/SimpleMenu.c
@@ -1302,7 +1302,7 @@ SetMarginWidths(Widget w)
SimpleMenuWidget smw = (SimpleMenuWidget)w;
SmeObject *entry;
SmeBSBObject bsb_entry;
- Dimension l_mrgn, l_bmw, r_mrgn, r_bmw;
+ Dimension l_mrgn = 0, l_bmw, r_mrgn = 0, r_bmw;
if (smw->simple_menu.left_whitespace || smw->simple_menu.right_whitespace)
{
Index: libXaw3d-1.6.2/src/Xaw3dP.c
===================================================================
--- libXaw3d-1.6.2.orig/src/Xaw3dP.c
+++ libXaw3d-1.6.2/src/Xaw3dP.c
@@ -73,7 +73,7 @@ stipplePixmap(Widget w, Pixmap pm, Color
Display *dpy;
XpmImage image;
XpmAttributes attr;
- XpmColor *src_table, *dst_table;
+ XpmColor *src_table = NULL, *dst_table;
int i, j, index = -1;
if (pm == None)