diff --git a/.gitignore b/.gitignore index baa95c7..da5c16f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ Xaw3d-1.5E.tar.gz +/libXaw3d-1.6.1.tar.bz2 diff --git a/Xaw3d-1.5-box.c.patch b/Xaw3d-1.5-box.c.patch index 252238a..455f5b8 100644 --- a/Xaw3d-1.5-box.c.patch +++ b/Xaw3d-1.5-box.c.patch @@ -6,8 +6,8 @@ @DPATCH@ diff -urNad xaw3d-1.5+E~/lib/Xaw3d/Box.c xaw3d-1.5+E/lib/Xaw3d/Box.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/Box.c 1996-10-15 16:41:18.000000000 +0200 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/Box.c 2007-04-24 15:28:39.000000000 +0200 +--- Xaw3d-1.5libXaw3d-1.6.1/src/Box.c 1996-10-15 16:41:18.000000000 +0200 ++++ Xaw3d-1.5libXaw3d-1.6.1/src/Box.c 2007-04-24 15:28:39.000000000 +0200 @@ -353,8 +353,16 @@ else { width = preferred_width; diff --git a/Xaw3d-1.5-debian-fixes.patch b/Xaw3d-1.5-debian-fixes.patch index 5593f24..df15d79 100644 --- a/Xaw3d-1.5-debian-fixes.patch +++ b/Xaw3d-1.5-debian-fixes.patch @@ -1,6 +1,6 @@ -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrc.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrc.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrc.c.debian 2000-11-27 14:19:36.000000000 +0100 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrc.c 2008-10-06 11:42:13.000000000 +0200 +diff -up Xaw3d-1.5libXaw3d-1.6.1/src/AsciiSrc.c.debian Xaw3d-1.5libXaw3d-1.6.1/src/AsciiSrc.c +--- Xaw3d-1.5libXaw3d-1.6.1/src/AsciiSrc.c.debian 2000-11-27 14:19:36.000000000 +0100 ++++ Xaw3d-1.5libXaw3d-1.6.1/src/AsciiSrc.c 2008-10-06 11:42:13.000000000 +0200 @@ -51,11 +51,17 @@ in this Software without prior written a #include #endif @@ -90,9 +90,9 @@ diff -up Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrc.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/Ascii } static void -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrcP.h.debian Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrcP.h ---- Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrcP.h.debian 1996-10-15 16:41:18.000000000 +0200 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrcP.h 2008-10-06 11:42:13.000000000 +0200 +diff -up Xaw3d-1.5libXaw3d-1.6.1/src/AsciiSrcP.h.debian Xaw3d-1.5libXaw3d-1.6.1/src/AsciiSrcP.h +--- Xaw3d-1.5libXaw3d-1.6.1/src/AsciiSrcP.h.debian 1996-10-15 16:41:18.000000000 +0200 ++++ Xaw3d-1.5libXaw3d-1.6.1/src/AsciiSrcP.h 2008-10-06 11:42:13.000000000 +0200 @@ -85,7 +85,11 @@ SOFTWARE. #ifdef L_tmpnam #define TMPSIZ L_tmpnam @@ -106,9 +106,9 @@ diff -up Xaw3d-1.5E/xc/lib/Xaw3d/AsciiSrcP.h.debian Xaw3d-1.5E/xc/lib/Xaw3d/Asci #endif #define MAGIC_VALUE ((XawTextPosition) -1) /* Magic value. */ -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/MenuButton.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/MenuButton.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/MenuButton.c.debian 1996-10-15 16:41:20.000000000 +0200 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/MenuButton.c 2008-10-06 11:42:13.000000000 +0200 +diff -up Xaw3d-1.5libXaw3d-1.6.1/src/MenuButton.c.debian Xaw3d-1.5libXaw3d-1.6.1/src/MenuButton.c +--- Xaw3d-1.5libXaw3d-1.6.1/src/MenuButton.c.debian 1996-10-15 16:41:20.000000000 +0200 ++++ Xaw3d-1.5libXaw3d-1.6.1/src/MenuButton.c 2008-10-06 11:42:13.000000000 +0200 @@ -53,6 +53,8 @@ in this Software without prior written a #include #include @@ -138,9 +138,9 @@ diff -up Xaw3d-1.5E/xc/lib/Xaw3d/MenuButton.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/Men return; } if (!XtIsRealized(menu)) -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrc.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrc.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrc.c.debian 2008-10-06 11:42:13.000000000 +0200 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrc.c 2008-10-06 11:42:13.000000000 +0200 +diff -up Xaw3d-1.5libXaw3d-1.6.1/src/MultiSrc.c.debian Xaw3d-1.5libXaw3d-1.6.1/src/MultiSrc.c +--- Xaw3d-1.5libXaw3d-1.6.1/src/MultiSrc.c.debian 2008-10-06 11:42:13.000000000 +0200 ++++ Xaw3d-1.5libXaw3d-1.6.1/src/MultiSrc.c 2008-10-06 11:42:13.000000000 +0200 @@ -74,6 +74,9 @@ in this Software without prior written a #include #include @@ -222,9 +222,9 @@ diff -up Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrc.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/Multi #undef StrLen } -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrcP.h.debian Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrcP.h ---- Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrcP.h.debian 1996-10-15 16:41:21.000000000 +0200 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrcP.h 2008-10-06 11:42:13.000000000 +0200 +diff -up Xaw3d-1.5libXaw3d-1.6.1/src/MultiSrcP.h.debian Xaw3d-1.5libXaw3d-1.6.1/src/MultiSrcP.h +--- Xaw3d-1.5libXaw3d-1.6.1/src/MultiSrcP.h.debian 1996-10-15 16:41:21.000000000 +0200 ++++ Xaw3d-1.5libXaw3d-1.6.1/src/MultiSrcP.h 2008-10-06 11:42:13.000000000 +0200 @@ -113,7 +113,11 @@ SOFTWARE. #ifdef L_tmpnam #define TMPSIZ L_tmpnam @@ -238,9 +238,9 @@ diff -up Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrcP.h.debian Xaw3d-1.5E/xc/lib/Xaw3d/Mult #endif #define MAGIC_VALUE ((XawTextPosition) -1) /* Magic value. */ -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/Simple.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/Simple.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/Simple.c.debian 2000-11-27 14:19:36.000000000 +0100 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/Simple.c 2008-10-06 11:42:13.000000000 +0200 +diff -up Xaw3d-1.5libXaw3d-1.6.1/src/Simple.c.debian Xaw3d-1.5libXaw3d-1.6.1/src/Simple.c +--- Xaw3d-1.5libXaw3d-1.6.1/src/Simple.c.debian 2000-11-27 14:19:36.000000000 +0100 ++++ Xaw3d-1.5libXaw3d-1.6.1/src/Simple.c 2008-10-06 11:42:13.000000000 +0200 @@ -56,6 +56,8 @@ SOFTWARE. #include #include @@ -273,9 +273,9 @@ diff -up Xaw3d-1.5E/xc/lib/Xaw3d/Simple.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/Simple. c->simple_class.change_sensitive = ChangeSensitive; } -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/SimpleMenu.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/SimpleMenu.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/SimpleMenu.c.debian 2003-02-17 07:45:07.000000000 +0100 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/SimpleMenu.c 2008-10-06 11:42:13.000000000 +0200 +diff -up Xaw3d-1.5libXaw3d-1.6.1/src/SimpleMenu.c.debian Xaw3d-1.5libXaw3d-1.6.1/src/SimpleMenu.c +--- Xaw3d-1.5libXaw3d-1.6.1/src/SimpleMenu.c.debian 2003-02-17 07:45:07.000000000 +0100 ++++ Xaw3d-1.5libXaw3d-1.6.1/src/SimpleMenu.c 2008-10-06 11:42:13.000000000 +0200 @@ -51,6 +51,8 @@ in this Software without prior written a #include #include @@ -306,9 +306,9 @@ diff -up Xaw3d-1.5E/xc/lib/Xaw3d/SimpleMenu.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/Sim return; } -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/StripChart.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/StripChart.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/StripChart.c.debian 2003-02-10 18:18:00.000000000 +0100 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/StripChart.c 2008-10-06 11:42:13.000000000 +0200 +diff -up Xaw3d-1.5libXaw3d-1.6.1/src/StripChart.c.debian Xaw3d-1.5libXaw3d-1.6.1/src/StripChart.c +--- Xaw3d-1.5libXaw3d-1.6.1/src/StripChart.c.debian 2003-02-10 18:18:00.000000000 +0100 ++++ Xaw3d-1.5libXaw3d-1.6.1/src/StripChart.c 2008-10-06 11:42:13.000000000 +0200 @@ -315,7 +315,15 @@ XtIntervalId *id; /* unused */ if (w->strip_chart.points != NULL) { w->strip_chart.points[0].x = w->strip_chart.interval + s; @@ -326,9 +326,9 @@ diff -up Xaw3d-1.5E/xc/lib/Xaw3d/StripChart.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/Str CoordModePrevious); } -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/Text.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/Text.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/Text.c.debian 2008-10-06 11:42:13.000000000 +0200 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/Text.c 2008-10-06 11:43:16.000000000 +0200 +diff -up Xaw3d-1.5libXaw3d-1.6.1/src/Text.c.debian Xaw3d-1.5libXaw3d-1.6.1/src/Text.c +--- Xaw3d-1.5libXaw3d-1.6.1/src/Text.c.debian 2008-10-06 11:42:13.000000000 +0200 ++++ Xaw3d-1.5libXaw3d-1.6.1/src/Text.c 2008-10-06 11:43:16.000000000 +0200 @@ -76,6 +76,8 @@ SOFTWARE. #include /* for isprint() */ #include @@ -410,9 +410,9 @@ diff -up Xaw3d-1.5E/xc/lib/Xaw3d/Text.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/Text.c ctx->text.scroll_horiz = XawtextScrollNever; } else if (ctx->text.scroll_horiz == XawtextScrollAlways) -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/TextPop.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/TextPop.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/TextPop.c.debian 2000-11-27 14:19:36.000000000 +0100 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/TextPop.c 2008-10-06 11:42:13.000000000 +0200 +diff -up Xaw3d-1.5libXaw3d-1.6.1/src/TextPop.c.debian Xaw3d-1.5libXaw3d-1.6.1/src/TextPop.c +--- Xaw3d-1.5libXaw3d-1.6.1/src/TextPop.c.debian 2000-11-27 14:19:36.000000000 +0100 ++++ Xaw3d-1.5libXaw3d-1.6.1/src/TextPop.c 2008-10-06 11:42:13.000000000 +0200 @@ -66,6 +66,8 @@ in this Software without prior written a #include /* for O_RDONLY */ #include @@ -543,9 +543,9 @@ diff -up Xaw3d-1.5E/xc/lib/Xaw3d/TextPop.c.debian Xaw3d-1.5E/xc/lib/Xaw3d/TextPo return(FALSE); } -diff -up /dev/null Xaw3d-1.5E/xc/lib/Xaw3d/XawAlloc.h +diff -up /dev/null Xaw3d-1.5libXaw3d-1.6.1/src/XawAlloc.h --- /dev/null 2008-10-06 08:37:32.418005377 +0200 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/XawAlloc.h 2008-10-06 11:42:13.000000000 +0200 ++++ Xaw3d-1.5libXaw3d-1.6.1/src/XawAlloc.h 2008-10-06 11:42:13.000000000 +0200 @@ -0,0 +1,10 @@ +/* $XFree86: xc/lib/Xaw/XawAlloc.h,v 1.1.2.1 1998/05/16 09:05:23 dawes Exp $ */ + @@ -557,8 +557,8 @@ diff -up /dev/null Xaw3d-1.5E/xc/lib/Xaw3d/XawAlloc.h +#define XtStackFree(pointer, stack_cache_array) \ + if ((pointer) != ((XtPointer)(stack_cache_array))) XtFree(pointer); else + ---- xaw3d-1.5e/xc/lib/Xaw3d/SmeBSB.c 2003-08-04 17:27:58.000000000 +0200 -+++ xaw3d-1.5e/xc/lib/Xaw3d/SmeBSB.c 2003-08-07 15:02:39.000000000 +0200 +--- xaw3d-1.5libXaw3d-1.6.1/src/SmeBSB.c 2003-08-04 17:27:58.000000000 +0200 ++++ xaw3d-1.5libXaw3d-1.6.1/src/SmeBSB.c 2003-08-07 15:02:39.000000000 +0200 @@ -52,6 +52,8 @@ #include #include diff --git a/Xaw3d-1.5E-cast.patch b/Xaw3d-1.5E-cast.patch index f7f4f62..b337434 100644 --- a/Xaw3d-1.5E-cast.patch +++ b/Xaw3d-1.5E-cast.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Xaw3d-1.5E-cast.patch xc/lib/Xaw3d/Scrollbar.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -diff --git a/xc/lib/Xaw3d/Scrollbar.c b/xc/lib/Xaw3d/Scrollbar.c +diff --git libXaw3d-1.6.1/src/Scrollbar.c libXaw3d-1.6.1/src/Scrollbar.c index 0566733..6ed1480 100644 ---- a/xc/lib/Xaw3d/Scrollbar.c -+++ b/xc/lib/Xaw3d/Scrollbar.c +--- libXaw3d-1.6.1/src/Scrollbar.c ++++ libXaw3d-1.6.1/src/Scrollbar.c @@ -1375,7 +1375,7 @@ static void NotifyThumb (w, event, params, num_params ) the arrows. */ top += 0.0001; diff --git a/Xaw3d-1.5E-close-destroy-crash.patch b/Xaw3d-1.5E-close-destroy-crash.patch index 265ad88..c4df7aa 100644 --- a/Xaw3d-1.5E-close-destroy-crash.patch +++ b/Xaw3d-1.5E-close-destroy-crash.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Xaw3d-1.5E-close-destroy-crash.patch xc/lib/Xaw3d/XawIm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -diff --git a/xc/lib/Xaw3d/XawIm.c b/xc/lib/Xaw3d/XawIm.c +diff --git libXaw3d-1.6.1/src/XawIm.c libXaw3d-1.6.1/src/XawIm.c index ead7166..730c393 100644 ---- a/xc/lib/Xaw3d/XawIm.c -+++ b/xc/lib/Xaw3d/XawIm.c +--- libXaw3d-1.6.1/src/XawIm.c ++++ libXaw3d-1.6.1/src/XawIm.c @@ -331,12 +331,12 @@ static void DestroyAllIM( ve ) /* * Close Input Method diff --git a/Xaw3d-1.5E-compat.patch b/Xaw3d-1.5E-compat.patch index 1a25815..ab8cc54 100644 --- a/Xaw3d-1.5E-compat.patch +++ b/Xaw3d-1.5E-compat.patch @@ -10,10 +10,10 @@ Subject: [PATCH] Xaw3d-1.5E-compat.patch xc/lib/Xaw3d/Text.h | 6 ++++++ 4 files changed, 21 insertions(+), 0 deletions(-) -diff --git a/xc/lib/Xaw3d/Command.c b/xc/lib/Xaw3d/Command.c +diff --git libXaw3d-1.6.1/src/Command.c libXaw3d-1.6.1/src/Command.c index 5fe16b6..6e04860 100644 ---- a/xc/lib/Xaw3d/Command.c -+++ b/xc/lib/Xaw3d/Command.c +--- libXaw3d-1.6.1/src/Command.c ++++ libXaw3d-1.6.1/src/Command.c @@ -91,6 +91,8 @@ static XtResource resources[] = { {XtNcornerRoundPercent, XtCCornerRoundPercent, XtRDimension, sizeof(Dimension), offset(command.corner_round), XtRImmediate, @@ -23,10 +23,10 @@ index 5fe16b6..6e04860 100644 {XtNborderWidth, XtCBorderWidth, XtRDimension, sizeof(Dimension), XtOffsetOf(RectObjRec,rectangle.border_width), XtRImmediate, (XtPointer) 0} -diff --git a/xc/lib/Xaw3d/Label.c b/xc/lib/Xaw3d/Label.c +diff --git libXaw3d-1.6.1/src/Label.c libXaw3d-1.6.1/src/Label.c index 5fd2e32..8bda3a7 100644 ---- a/xc/lib/Xaw3d/Label.c -+++ b/xc/lib/Xaw3d/Label.c +--- libXaw3d-1.6.1/src/Label.c ++++ libXaw3d-1.6.1/src/Label.c @@ -113,6 +113,8 @@ static XtResource resources[] = { offset(label.pixmap), XtRImmediate, (XtPointer)None}, {XtNresize, XtCResize, XtRBoolean, sizeof(Boolean), @@ -36,10 +36,10 @@ index 5fd2e32..8bda3a7 100644 {XtNborderWidth, XtCBorderWidth, XtRDimension, sizeof(Dimension), XtOffsetOf(RectObjRec,rectangle.border_width), XtRImmediate, (XtPointer)1} -diff --git a/xc/lib/Xaw3d/Text.c b/xc/lib/Xaw3d/Text.c +diff --git libXaw3d-1.6.1/src/Text.c libXaw3d-1.6.1/src/Text.c index baaba17..81ff472 100644 ---- a/xc/lib/Xaw3d/Text.c -+++ b/xc/lib/Xaw3d/Text.c +--- libXaw3d-1.6.1/src/Text.c ++++ libXaw3d-1.6.1/src/Text.c @@ -3527,6 +3527,17 @@ Widget w; return ((TextWidget)w)->text.source; } @@ -58,10 +58,10 @@ index baaba17..81ff472 100644 void #if NeedFunctionPrototypes XawTextDisplayCaret (Widget w, -diff --git a/xc/lib/Xaw3d/Text.h b/xc/lib/Xaw3d/Text.h +diff --git libXaw3d-1.6.1/include/X11/Xaw3d/Text.h libXaw3d-1.6.1/include/X11/Xaw3d/Text.h index 9157927..d68f94e 100644 ---- a/xc/lib/Xaw3d/Text.h -+++ b/xc/lib/Xaw3d/Text.h +--- libXaw3d-1.6.1/include/X11/Xaw3d/Text.h ++++ libXaw3d-1.6.1/include/X11/Xaw3d/Text.h @@ -274,6 +274,12 @@ extern Widget XawTextGetSource( #endif ); diff --git a/Xaw3d-1.5E-fontset.patch b/Xaw3d-1.5E-fontset.patch deleted file mode 100644 index 23c9937..0000000 --- a/Xaw3d-1.5E-fontset.patch +++ /dev/null @@ -1,106 +0,0 @@ -This is commit 762bcb8c50fd0256a545ad6ed2304403daca8081 from -Markus Steinborn Xaw3d git repo, with -the making a missing fontset abort changes removed, while keeping the -checks for missing fonts as those can lead to NULL ptr dereferences. - -The checks for missing font sets is removed, because when the locale -is set to a UTF-8 locale (default now a days on most Linux distributions), -libXt will usually print: - -Warning: Missing charsets in String to FontSet conversion -Warning: Unable to load any usable fontset - -When resolving any fontset string, and return a NULL fontset. -For more details on this issue see: -http://tracker.xemacs.org/XEmacs/its/issue650 - -This however is not a fatal error (it means the default font set will be -used, and that some characters of the entire unicode range may not render -properly). - -The changes in the original commit made this a fatal error causing many -programs, which worked fine before, to abort. - -Below is the header of the orignal patch for reference: - -From 762bcb8c50fd0256a545ad6ed2304403daca8081 Mon Sep 17 00:00:00 2001 -From: Markus Steinborn -Date: Sat, 24 Apr 2010 16:54:35 +0200 -Subject: [PATCH] Xaw3d-1.5E-fontset.patch - ---- - xc/lib/Xaw3d/AsciiSink.c | 2 ++ - xc/lib/Xaw3d/Command.c | 2 ++ - xc/lib/Xaw3d/Label.c | 11 ++++++++++- - xc/lib/Xaw3d/List.c | 14 ++++++++++++-- - xc/lib/Xaw3d/MultiSink.c | 34 ++++++++++++++++++++++++++-------- - xc/lib/Xaw3d/SmeBSB.c | 2 ++ - xc/lib/Xaw3d/Tip.c | 16 ++++++++++++++-- - xc/lib/Xaw3d/XawIm.c | 14 +++++++++----- - 8 files changed, 77 insertions(+), 18 deletions(-) - -diff --git a/xc/lib/Xaw3d/AsciiSink.c b/xc/lib/Xaw3d/AsciiSink.c -index 2ebd952..a664db5 100644 ---- a/xc/lib/Xaw3d/AsciiSink.c -+++ b/xc/lib/Xaw3d/AsciiSink.c -@@ -532,6 +532,8 @@ Cardinal *num_args; - { - AsciiSinkObject sink = (AsciiSinkObject) new; - -+ if (!sink->ascii_sink.font) XtError("Aborting: no font found\n"); -+ - GetGC(sink); - - sink->ascii_sink.insertCursorOn= CreateInsertCursor(XtScreenOfObject(new)); -diff --git a/xc/lib/Xaw3d/Command.c b/xc/lib/Xaw3d/Command.c -index 6e04860..9f22d78 100644 ---- a/xc/lib/Xaw3d/Command.c -+++ b/xc/lib/Xaw3d/Command.c -@@ -215,6 +215,8 @@ Cardinal *num_args; /* unused */ - 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)) -diff --git a/xc/lib/Xaw3d/List.c b/xc/lib/Xaw3d/List.c -index 99faf31..e7d7d57 100644 ---- a/xc/lib/Xaw3d/List.c -+++ b/xc/lib/Xaw3d/List.c -@@ -366,6 +366,8 @@ Cardinal *num_args; - { - ListWidget lw = (ListWidget) new; - -+ if (!lw->list.font) XtError("Aborting: no font found\n"); -+ - /* - * Initialize all private resources. - */ -diff --git a/xc/lib/Xaw3d/SmeBSB.c b/xc/lib/Xaw3d/SmeBSB.c -index abf811f..dbb39aa 100644 ---- a/xc/lib/Xaw3d/SmeBSB.c -+++ b/xc/lib/Xaw3d/SmeBSB.c -@@ -203,6 +203,8 @@ Cardinal *num_args; - 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 */ -diff --git a/xc/lib/Xaw3d/Tip.c b/xc/lib/Xaw3d/Tip.c -index 888eeac..233cc8d 100644 ---- a/xc/lib/Xaw3d/Tip.c -+++ b/xc/lib/Xaw3d/Tip.c -@@ -252,6 +252,8 @@ Cardinal *num_args; - TipWidget tip = (TipWidget)w; - XGCValues values; - -+ if (!tip->tip.font) XtError("Aborting: no font found\n"); -+ - tip->tip.timer = 0; - - values.foreground = tip->tip.foreground; diff --git a/Xaw3d-1.5E-null.patch b/Xaw3d-1.5E-null.patch deleted file mode 100644 index 3c029bf..0000000 --- a/Xaw3d-1.5E-null.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 3993a874007d8b99c4d9e55f10e556b2f90dc6a5 Mon Sep 17 00:00:00 2001 -From: Markus Steinborn -Date: Sat, 24 Apr 2010 16:54:55 +0200 -Subject: [PATCH] Xaw3d-1.5E-null.patch - ---- - xc/lib/Xaw3d/XawIm.c | 16 ++++++++-------- - 1 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/xc/lib/Xaw3d/XawIm.c b/xc/lib/Xaw3d/XawIm.c -index 0aeb9ac..2d6cf8d 100644 ---- a/xc/lib/Xaw3d/XawIm.c -+++ b/xc/lib/Xaw3d/XawIm.c -@@ -674,7 +674,7 @@ static void SizeNegotiation(p, width, height) - SetVaArg( &ic_a[ic_cnt], (XPointer) NULL); - - if (ic_cnt > 0) { -- XGetICValues(p->xic, ic_a[0], ic_a[1], ic_a[2], ic_a[3], ic_a[4]); -+ XGetICValues(p->xic, ic_a[0], ic_a[1], ic_a[2], ic_a[3], NULL); - if (pe_attr) XFree(pe_attr); - if (st_attr) XFree(st_attr); - if (p->xic == NULL) { -@@ -714,7 +714,7 @@ static void SizeNegotiation(p, width, height) - SetVaArg( &ic_a[ic_cnt], (XPointer) pe_attr); ic_cnt++; - } - SetVaArg( &ic_a[ic_cnt], (XPointer) NULL); -- XSetICValues(p->xic, ic_a[0], ic_a[1], ic_a[2], ic_a[3], ic_a[4]); -+ XSetICValues(p->xic, ic_a[0], ic_a[1], ic_a[2], ic_a[3], NULL); - if (pe_attr) XFree(pe_attr); - if (st_attr) XFree(st_attr); - if (p->xic == NULL) { -@@ -833,7 +833,7 @@ static void CreateIC( w, ve ) - pe_a[4], pe_a[5], pe_a[6], pe_a[7], pe_a[8], - pe_a[9], pe_a[10], pe_a[11], pe_a[12], - pe_a[13], pe_a[14], pe_a[15], pe_a[16], -- pe_a[17], pe_a[18], pe_a[19]); -+ pe_a[17], pe_a[18], NULL); - SetVaArg( &ic_a[ic_cnt], (XPointer) XNPreeditAttributes); ic_cnt++; - SetVaArg( &ic_a[ic_cnt], (XPointer) pe_attr); ic_cnt++; - } -@@ -844,7 +844,7 @@ static void CreateIC( w, ve ) - st_a[4], st_a[5], st_a[6], st_a[7], st_a[8], - st_a[9], st_a[10], st_a[11], st_a[12], - st_a[13], st_a[14], st_a[15], st_a[16], -- st_a[17], st_a[18], st_a[19]); -+ st_a[17], st_a[18], NULL); - SetVaArg( &ic_a[ic_cnt], (XPointer) XNStatusAttributes); ic_cnt++; - SetVaArg( &ic_a[ic_cnt], (XPointer) st_attr); ic_cnt++; - } -@@ -853,7 +853,7 @@ static void CreateIC( w, ve ) - p->xic = XCreateIC(ve->im.xim, ic_a[0], ic_a[1], ic_a[2], ic_a[3], - ic_a[4], ic_a[5], ic_a[6], ic_a[7], ic_a[8], ic_a[9], - ic_a[10], ic_a[11], ic_a[12], ic_a[13], ic_a[14], -- ic_a[15], ic_a[16], ic_a[17], ic_a[18], ic_a[19]); -+ ic_a[15], ic_a[16], ic_a[17], ic_a[18], NULL); - if (pe_attr) XtFree(pe_attr); - if (st_attr) XtFree(st_attr); - -@@ -973,7 +973,7 @@ static void SetICValues( w, ve, focus ) - pe_a[4], pe_a[5], pe_a[6], pe_a[7], - pe_a[8], pe_a[9], pe_a[10], pe_a[11], - pe_a[12], pe_a[13], pe_a[14], pe_a[15], -- pe_a[16], pe_a[17], pe_a[18], pe_a[19]); -+ pe_a[16], pe_a[17], pe_a[18], NULL); - SetVaArg( &ic_a[ic_cnt], (XPointer) XNPreeditAttributes); ic_cnt++; - SetVaArg( &ic_a[ic_cnt], (XPointer) pe_attr); ic_cnt++; - } -@@ -983,7 +983,7 @@ static void SetICValues( w, ve, focus ) - st_a[4], st_a[5], st_a[6], st_a[7], - st_a[8], st_a[9], st_a[10], st_a[11], - st_a[12], st_a[13], st_a[14], st_a[15], -- st_a[16], st_a[17], st_a[18], st_a[19]); -+ st_a[16], st_a[17], st_a[18], NULL); - SetVaArg( &ic_a[ic_cnt], (XPointer) XNStatusAttributes); ic_cnt++; - SetVaArg( &ic_a[ic_cnt], (XPointer) st_attr); ic_cnt++; - } -@@ -996,7 +996,7 @@ static void SetICValues( w, ve, focus ) - XSetICValues(p->xic, ic_a[0], ic_a[1], ic_a[2], ic_a[3], ic_a[4], - ic_a[5], ic_a[6], ic_a[7], ic_a[8], ic_a[9], ic_a[10], - ic_a[11], ic_a[12], ic_a[13], ic_a[14], ic_a[15], -- ic_a[16], ic_a[17], ic_a[18], ic_a[19]); -+ ic_a[16], ic_a[17], ic_a[18], NULL); - if (pe_attr) XtFree(pe_attr); - if (st_attr) XtFree(st_attr); - } --- -1.6.1 - diff --git a/Xaw3d-1.5E-secure.patch b/Xaw3d-1.5E-secure.patch index 68878d4..e1ee138 100644 --- a/Xaw3d-1.5E-secure.patch +++ b/Xaw3d-1.5E-secure.patch @@ -19,10 +19,10 @@ Subject: [PATCH] Xaw3d-1.5E-secure.patch 12 files changed, 206 insertions(+), 61 deletions(-) create mode 100644 xc/lib/Xaw3d/XawAlloc.h -diff --git a/xc/lib/Xaw3d/Layout.c b/xc/lib/Xaw3d/Layout.c +diff --git libXaw3d-1.6.1/src/Layout.c libXaw3d-1.6.1/src/Layout.c index 44d391a..dd4b253 100644 ---- a/xc/lib/Xaw3d/Layout.c -+++ b/xc/lib/Xaw3d/Layout.c +--- libXaw3d-1.6.1/src/Layout.c ++++ libXaw3d-1.6.1/src/Layout.c @@ -39,6 +39,8 @@ # include #endif @@ -55,10 +55,10 @@ index 44d391a..dd4b253 100644 return 0.0; } return Evaluate (l, box, nexpr, natural); -diff --git a/xc/lib/Xaw3d/XawI18n.h b/xc/lib/Xaw3d/XawI18n.h +diff --git libXaw3d-1.6.1/src/XawI18n.h libXaw3d-1.6.1/src/XawI18n.h index 1b0ee5d..b0176bf 100644 ---- a/xc/lib/Xaw3d/XawI18n.h -+++ b/xc/lib/Xaw3d/XawI18n.h +--- libXaw3d-1.6.1/src/XawI18n.h ++++ libXaw3d-1.6.1/src/XawI18n.h @@ -29,11 +29,13 @@ in this Software without prior written authorization from the X Consortium. #ifdef HAS_WCTYPE_H @@ -73,10 +73,10 @@ index 1b0ee5d..b0176bf 100644 #ifdef HAS_WCHAR_H #include -diff --git a/xc/lib/Xaw3d/XawIm.c b/xc/lib/Xaw3d/XawIm.c +diff --git libXaw3d-1.6.1/src/XawIm.c libXaw3d-1.6.1/src/XawIm.c index 730c393..a5d0032 100644 ---- a/xc/lib/Xaw3d/XawIm.c -+++ b/xc/lib/Xaw3d/XawIm.c +--- libXaw3d-1.6.1/src/XawIm.c ++++ libXaw3d-1.6.1/src/XawIm.c @@ -1644,10 +1644,10 @@ _XawImWcLookupString( inwidg, event, buffer_return, bytes_buffer, if ((vw = SearchVendorShell(inwidg)) && (ve = GetExtPart(vw)) && diff --git a/Xaw3d-1.5E-thumb.patch b/Xaw3d-1.5E-thumb.patch deleted file mode 100644 index 22b76eb..0000000 --- a/Xaw3d-1.5E-thumb.patch +++ /dev/null @@ -1,1725 +0,0 @@ -From 56c87e83f85e1c850702557936421f8181a30481 Mon Sep 17 00:00:00 2001 -From: Markus Steinborn -Date: Sat, 24 Apr 2010 16:53:10 +0200 -Subject: [PATCH] Xaw3d-1.5E-thumb.patch - ---- - xc/lib/Xaw3d/AsciiSink.c | 6 +- - xc/lib/Xaw3d/Form.c | 2 +- - xc/lib/Xaw3d/Layout.c | 2 +- - xc/lib/Xaw3d/MultiSink.c | 6 +- - xc/lib/Xaw3d/Paned.c | 27 ++- - xc/lib/Xaw3d/Panner.c | 2 +- - xc/lib/Xaw3d/Scrollbar.c | 627 +++++++++++++++++++++++++++++++------------- - xc/lib/Xaw3d/Scrollbar.h | 6 + - xc/lib/Xaw3d/ScrollbarP.h | 7 +- - xc/lib/Xaw3d/SimpleMenu.c | 3 +- - xc/lib/Xaw3d/SmeThreeD.c | 20 +- - xc/lib/Xaw3d/SmeThreeD.h | 3 + - xc/lib/Xaw3d/SmeThreeDP.h | 1 + - xc/lib/Xaw3d/StripChart.c | 43 ++-- - xc/lib/Xaw3d/Text.c | 6 +- - xc/lib/Xaw3d/TextAction.c | 1 + - xc/lib/Xaw3d/TextPop.c | 3 +- - xc/lib/Xaw3d/ThreeD.c | 19 +- - xc/lib/Xaw3d/ThreeD.h | 3 + - xc/lib/Xaw3d/ThreeDP.h | 1 + - xc/lib/Xaw3d/Toggle.c | 3 +- - xc/lib/Xaw3d/Viewport.c | 6 +- - xc/lib/Xaw3d/XawI18n.c | 3 + - xc/lib/Xaw3d/XawI18n.h | 2 + - xc/lib/Xaw3d/XawIm.c | 5 +- - 25 files changed, 565 insertions(+), 242 deletions(-) - -diff --git a/xc/lib/Xaw3d/AsciiSink.c b/xc/lib/Xaw3d/AsciiSink.c -index b427c80..2ebd952 100644 ---- a/xc/lib/Xaw3d/AsciiSink.c -+++ b/xc/lib/Xaw3d/AsciiSink.c -@@ -174,13 +174,14 @@ unsigned char c; - return 0; - } - -- if ( (nonPrinting = (c < (unsigned char) XawSP)) ) -+ if ( (nonPrinting = (c < (unsigned char) XawSP)) ) { - if (sink->ascii_sink.display_nonprinting) - c += '@'; - else { - c = XawSP; - nonPrinting = False; - } -+ } - - if (font->per_char && - (c >= font->min_char_or_byte2 && c <= font->max_char_or_byte2)) -@@ -661,12 +662,13 @@ short *tabs; - XA_FIGURE_WIDTH = XInternAtom(XtDisplayOfObject(w), "FIGURE_WIDTH", FALSE); - if ( (XA_FIGURE_WIDTH != None) && - ( (!XGetFontProperty(font, XA_FIGURE_WIDTH, &figure_width)) || -- (figure_width == 0)) ) -+ (figure_width == 0)) ) { - if (font->per_char && font->min_char_or_byte2 <= '$' && - font->max_char_or_byte2 >= '$') - figure_width = font->per_char['$' - font->min_char_or_byte2].width; - else - figure_width = font->max_bounds.width; -+ } - - if (tab_count > sink->text_sink.tab_count) { - sink->text_sink.tabs = (Position *) -diff --git a/xc/lib/Xaw3d/Form.c b/xc/lib/Xaw3d/Form.c -index c4eae4b..d628618 100644 ---- a/xc/lib/Xaw3d/Form.c -+++ b/xc/lib/Xaw3d/Form.c -@@ -780,7 +780,7 @@ static XtGeometryResult PreferredGeometry( widget, request, reply ) - reply->width = w->form.preferred_width; - reply->height = w->form.preferred_height; - reply->request_mode = CWWidth | CWHeight; -- if ( request->request_mode & (CWWidth | CWHeight) == -+ if ( (request->request_mode & (CWWidth | CWHeight)) == - (CWWidth | CWHeight) - && request->width == reply->width - && request->height == reply->height) -diff --git a/xc/lib/Xaw3d/Layout.c b/xc/lib/Xaw3d/Layout.c -index dd4b253..497b9c2 100644 ---- a/xc/lib/Xaw3d/Layout.c -+++ b/xc/lib/Xaw3d/Layout.c -@@ -539,7 +539,7 @@ Evaluate (l, box, expr, natural) - ExprPtr expr; - double natural; - { -- double left, right, down; -+ double left = 0.0, right = 0.0, down = 0.0; - Widget widget; - SubInfoPtr info; - -diff --git a/xc/lib/Xaw3d/MultiSink.c b/xc/lib/Xaw3d/MultiSink.c -index 204470f..d8aac3f 100644 ---- a/xc/lib/Xaw3d/MultiSink.c -+++ b/xc/lib/Xaw3d/MultiSink.c -@@ -204,12 +204,13 @@ CharWidth (w, x, c) - return 0; - } - -- if (XwcTextEscapement (fontset, &c, 1) == 0) -+ if (XwcTextEscapement (fontset, &c, 1) == 0) { - if (sink->multi_sink.display_nonprinting) - c = _Xaw_atowc('@'); - else { - c = _Xaw_atowc(XawSP); - } -+ } - - /* - * if more efficiency(suppose one column is one ASCII char) -@@ -731,12 +732,13 @@ SetTabs( w, tab_count, tabs ) - XA_FIGURE_WIDTH = XInternAtom(XtDisplayOfObject(w), "FIGURE_WIDTH", FALSE); - if ( (XA_FIGURE_WIDTH != None) && - ( (!XGetFontProperty(font, XA_FIGURE_WIDTH, &figure_width)) || -- (figure_width == 0)) ) -+ (figure_width == 0)) ) { - if (font->per_char && font->min_char_or_byte2 <= '$' && - font->max_char_or_byte2 >= '$') - figure_width = font->per_char['$' - font->min_char_or_byte2].width; - else - figure_width = font->max_bounds.width; -+ } - - if (tab_count > sink->text_sink.tab_count) { - sink->text_sink.tabs = (Position *) -diff --git a/xc/lib/Xaw3d/Paned.c b/xc/lib/Xaw3d/Paned.c -index babd492..adbbc77 100644 ---- a/xc/lib/Xaw3d/Paned.c -+++ b/xc/lib/Xaw3d/Paned.c -@@ -1157,12 +1157,14 @@ PanedWidget pw; - managedP = managed_grips = (WidgetList) XtMalloc(alloc_size); - unmanagedP = unmanaged_grips = (WidgetList) XtMalloc(alloc_size); - -- ForAllChildren(pw, childP) -- if (IsPane(*childP) && HasGrip(*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 */ -@@ -1194,11 +1196,12 @@ Widget child; - - XtSetArg(arglist[num_args], XtNtranslations, pw->paned.grip_translations); - num_args++; -- if ( (cursor = pw->paned.grip_cursor) == None ) -+ if ( (cursor = pw->paned.grip_cursor) == None ) { - if (IsVert(pw)) - cursor = pw->paned.v_grip_cursor; - else - cursor = pw->paned.h_grip_cursor; -+ } - - XtSetArg(arglist[num_args], XtNcursor, cursor); - num_args++; -@@ -1310,11 +1313,12 @@ PanedWidget pw; - Arg arglist[1]; - Cursor cursor; - -- if ( (cursor = pw->paned.grip_cursor) == None ) -+ if ( (cursor = pw->paned.grip_cursor) == None ) { - if ( IsVert(pw) ) - cursor = pw->paned.v_grip_cursor; - else - cursor = pw->paned.h_grip_cursor; -+ } - - if (HasGrip (*childP)) { - XtSetArg(arglist[0], XtNcursor, cursor); -@@ -1489,11 +1493,12 @@ XtWidgetGeometry *request, *reply; - * a different on_size; - */ - -- if (result != XtGeometryNo) -+ if (result != XtGeometryNo) { - if (vert) - pw->core.height = on_size; - else - pw->core.width = on_size; -+ } - - RefigureLocations(pw, PaneIndex(w), AnyPane); - -@@ -1524,11 +1529,12 @@ XtWidgetGeometry *request, *reply; - * THEN: set almost - */ - -- if ( !((vert ? CWWidth : CWHeight) & mask)) -+ if ( !((vert ? CWWidth : CWHeight) & mask)) { - if (vert) - request->width = w->core.width; - else - request->height = w->core.height; -+ } - - almost = GetRequestInfo(request, !vert) != GetRequestInfo(reply, !vert); - almost |= (GetRequestInfo(request, vert) != GetRequestInfo(reply, vert)); -@@ -1673,8 +1679,8 @@ static void ChangeManaged(w) - ResortChildren(pw); - - pw->paned.num_panes = 0; -- ForAllChildren(pw, childP) -- if ( IsPane(*childP) ) -+ ForAllChildren(pw, childP) { -+ if ( IsPane(*childP) ) { - if ( XtIsManaged(*childP) ) { - Pane pane = PaneInfo(*childP); - if (HasGrip(*childP)) -@@ -1684,6 +1690,8 @@ static void ChangeManaged(w) - } - else - break; /* This list is already sorted. */ -+ } -+ } - - SetChildrenPrefSizes( (PanedWidget) w, size); - -@@ -1806,7 +1814,7 @@ Cardinal *num_args; - - /* Check for change in XtNshowGrip. */ - -- if (old_pane->show_grip != new_pane->show_grip) -+ if (old_pane->show_grip != new_pane->show_grip) { - if (new_pane->show_grip == TRUE) { - CreateGrip(new); - if (XtIsRealized(XtParent(new))) { -@@ -1822,6 +1830,7 @@ Cardinal *num_args; - new_pane->grip = NULL; - redisplay = TRUE; - } -+ } - - /* ||| need to look at position changes */ - -diff --git a/xc/lib/Xaw3d/Scrollbar.c b/xc/lib/Xaw3d/Scrollbar.c -index c105688..0566733 100644 ---- a/xc/lib/Xaw3d/Scrollbar.c -+++ b/xc/lib/Xaw3d/Scrollbar.c -@@ -130,14 +130,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 - -@@ -211,8 +215,7 @@ ScrollbarClassRec scrollbarClassRec = { - /* change_sensitive */ XtInheritChangeSensitive - }, - { /* threeD fields */ -- /* shadowdraw */ XtInheritXaw3dShadowDraw /*,*/ -- /* shadowboxdraw */ /*XtInheritXaw3dShadowBoxDraw*/ -+ /* shadowdraw */ XtInheritXaw3dShadowDraw - }, - { /* scrollbar fields */ - /* ignore */ 0 -@@ -224,7 +227,7 @@ WidgetClass scrollbarWidgetClass = (WidgetClass)&scrollbarClassRec; - - #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)) - -@@ -242,6 +245,18 @@ static void ClassInitialize() - #define MARGIN(sbw) (sbw)->threeD.shadow_width - #endif - -+/* -+ Used to swap X and Y coordinates when the scrollbar is horizontal. -+ */ -+static void swap(a, b) -+ Dimension *a, *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 -@@ -280,11 +295,11 @@ static void FillArea (sbw, top, bottom, fill) - if (lh <= 0 || lw <= 0) return; - if (fill) { - XFillRectangle(XtDisplay((Widget) sbw), XtWindow((Widget) sbw), -- sbw->scrollbar.gc, -+ sbw->scrollbar.gc, - lx, ly, (unsigned int) lw, (unsigned int) lh); - } else { - XClearArea (XtDisplay((Widget) sbw), XtWindow((Widget) sbw), -- lx, ly, (unsigned int) lw, (unsigned int) lh, -+ lx, ly, (unsigned int) lw, (unsigned int) lh, - FALSE); - } - } -@@ -293,163 +308,375 @@ static void FillArea (sbw, top, bottom, fill) - sbw->shown. The old area is erased. The painting and - erasing is done cleverly so that no flickering will occur. */ - --static void PaintThumb (sbw, event) -+static void PaintThumb (sbw, pressed, shadow) - ScrollbarWidget sbw; -- XEvent *event; -+ int pressed, 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(&ipt[n].x, &ipt[n].y); -+ swap(&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 (sbw) -+static void PaintArrows (sbw, toppressed, botpressed) - ScrollbarWidget sbw; -+ int toppressed, botpressed; - { -- 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; -- -+ 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 */ -+ /* 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); -+ - } - } - } -@@ -469,12 +696,13 @@ static void Destroy (w) - XtRemoveTimeOut (sbw->scrollbar.timer_id); - #endif - XtReleaseGC (w, sbw->scrollbar.gc); -+ XtReleaseGC (w, sbw->scrollbar.bgc); - } - - /* Function Name: CreateGC - * Description: Creates the GC. - * Arguments: w - the scrollbar widget. -- * Returns: none. -+ * Returns: none. - */ - - static void CreateGC (w) -@@ -485,9 +713,22 @@ static void CreateGC (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); -+ sbw->scrollbar.thumb = XmuCreateStippledPixmap (XtScreen(w), -+ (Pixel) 0, (Pixel) 0, depth); - } else if (sbw->scrollbar.thumb != None) { - Window root; - int x, y; -@@ -518,6 +759,9 @@ static void CreateGC (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 SetDimensions (sbw) -@@ -581,10 +825,10 @@ static void Realize (w, valueMask, attributes) - - XtVaSetValues (w, XtNcursor, sbw->scrollbar.inactiveCursor, NULL); - #endif -- /* -- * The Simple widget actually stuffs the value in the valuemask. -+ /* -+ * The Simple widget actually stuffs the value in the valuemask. - */ -- -+ - (*scrollbarWidgetClass->core_class.superclass->core_class.realize) - (w, valueMask, attributes); - } -@@ -617,8 +861,10 @@ static Boolean SetValues (current, request, desired, args, num_args) - 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; - } -@@ -667,11 +913,15 @@ static void Redisplay (w, event, region) - 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 - - } -@@ -688,23 +938,23 @@ static Boolean CompareEvents (oldEvent, newEvent) - - switch (newEvent->type) { - case MotionNotify: -- Check(xmotion.state); -+ Check(xmotion.state); - break; - case ButtonPress: - case ButtonRelease: - Check(xbutton.state); -- Check(xbutton.button); -+ Check(xbutton.button); - break; - case KeyPress: - case KeyRelease: - Check(xkey.state); -- Check(xkey.keycode); -+ Check(xkey.keycode); - break; - case EnterNotify: - case LeaveNotify: - Check(xcrossing.mode); - Check(xcrossing.detail); -- Check(xcrossing.state); -+ Check(xcrossing.state); - break; - } - #undef Check -@@ -753,23 +1003,23 @@ static void ExtractPosition (event, x, y) - { - switch( event->type ) { - case MotionNotify: -- *x = event->xmotion.x; -- *y = event->xmotion.y; -+ *x = event->xmotion.x; -+ *y = event->xmotion.y; - break; - case ButtonPress: - case ButtonRelease: -- *x = event->xbutton.x; -- *y = event->xbutton.y; -+ *x = event->xbutton.x; -+ *y = event->xbutton.y; - break; - case KeyPress: - case KeyRelease: -- *x = event->xkey.x; -- *y = event->xkey.y; -+ *x = event->xkey.x; -+ *y = event->xkey.y; - break; - case EnterNotify: - case LeaveNotify: -- *x = event->xcrossing.x; -- *y = event->xcrossing.y; -+ *x = event->xcrossing.x; -+ *y = event->xcrossing.y; - break; - default: - *x = 0; *y = 0; -@@ -792,7 +1042,8 @@ static void HandleThumb (w, event, params, num_params) - /* also call Move and Notify if we're already in continuous scroll mode */ - if (sbw->scrollbar.scroll_mode == 2 || - (PICKLENGTH (sbw,x,y) >= sbw->scrollbar.topLoc && -- PICKLENGTH (sbw,x,y) <= sbw->scrollbar.topLoc + sbw->scrollbar.shownLength)){ -+ PICKLENGTH (sbw,x,y) <= (sbw->scrollbar.topLoc + -+ sbw->scrollbar.shownLength))){ - XtCallActionProc(w, "MoveThumb", event, params, *num_params); - XtCallActionProc(w, "NotifyThumb", event, params, *num_params); - } -@@ -812,8 +1063,8 @@ static void RepeatNotify (client_data, idp) - call_data = MAX (A_FEW_PIXELS, sbw->scrollbar.length / 20); - if (sbw->scrollbar.scroll_mode == 1) - call_data = -call_data; -- XtCallCallbacks((Widget)sbw, XtNscrollProc, (XtPointer) call_data); -- sbw->scrollbar.timer_id = -+ XtCallCallbacks((Widget)sbw, XtNscrollProc, (XtPointer)(long)call_data); -+ sbw->scrollbar.timer_id = - XtAppAddTimeOut(XtWidgetToApplicationContext((Widget)sbw), - (unsigned long) 150, - RepeatNotify, -@@ -833,7 +1084,7 @@ static void StartScroll (w, event, params, num_params ) - char direction; - - if (sbw->scrollbar.direction != 0) return; /* if we're already scrolling */ -- if (*num_params > 0) -+ if (*num_params > 0) - direction = *params[0]; - else - direction = 'C'; -@@ -842,24 +1093,24 @@ static void StartScroll (w, event, params, num_params ) - - switch (direction) { - case 'B': -- case 'b': -+ case 'b': - cursor = (sbw->scrollbar.orientation == XtorientVertical) - ? sbw->scrollbar.downCursor -- : sbw->scrollbar.rightCursor; -+ : sbw->scrollbar.rightCursor; - break; - case 'F': - case 'f': - cursor = (sbw->scrollbar.orientation == XtorientVertical) - ? sbw->scrollbar.upCursor -- : sbw->scrollbar.leftCursor; -+ : sbw->scrollbar.leftCursor; - break; - case 'C': - case 'c': - cursor = (sbw->scrollbar.orientation == XtorientVertical) - ? sbw->scrollbar.rightCursor -- : sbw->scrollbar.upCursor; -+ : sbw->scrollbar.upCursor; - break; -- default: -+ default: - return; /* invalid invocation */ - } - XtVaSetValues (w, XtNcursor, cursor, NULL); -@@ -881,7 +1132,7 @@ static int InRange(num, small, big) - #endif - - /* -- * Same as above, but for floating numbers. -+ * Same as above, but for floating numbers. - */ - - static float FloatInRange(num, small, big) -@@ -895,15 +1146,15 @@ static float FloatInRange(num, small, big) - static void NotifyScroll (w, event, params, num_params) - Widget w; - XEvent *event; -- String *params; -- Cardinal *num_params; -+ String *params; -+ Cardinal *num_params; - { - ScrollbarWidget sbw = (ScrollbarWidget) w; - int call_data; - Position x, y; - - if (sbw->scrollbar.scroll_mode == 2 /* if scroll continuous */ -- || LookAhead (w, event)) -+ || LookAhead (w, event)) - return; - - ExtractPosition (event, &x, &y); -@@ -911,33 +1162,36 @@ static void NotifyScroll (w, event, params, num_params) - 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)(long)call_data); - /* establish autoscroll */ -- sbw->scrollbar.timer_id = -+ 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); -- XtCallCallbacks (w, XtNscrollProc, (XtPointer)(call_data)); -+ XtCallCallbacks (w, XtNscrollProc, (XtPointer)(long)call_data); - /* establish autoscroll */ - sbw->scrollbar.timer_id = -- XtAppAddTimeOut (XtWidgetToApplicationContext (w), -+ 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; -- XtCallCallbacks (w, XtNscrollProc, (XtPointer)(call_data)); -+ call_data = - (sbw->scrollbar.length); -+ XtCallCallbacks (w, XtNscrollProc, (XtPointer)(long)call_data); - } else if (PICKLENGTH (sbw, x, y) > sbw->scrollbar.topLoc + sbw->scrollbar.shownLength) { - /* handle zone "below" the thumb */ - call_data = sbw->scrollbar.length; -- XtCallCallbacks (w, XtNscrollProc, (XtPointer)(call_data)); -- } else -- { -+ XtCallCallbacks (w, XtNscrollProc, (XtPointer)(long)call_data); -+ } else { - /* handle the thumb in the motion notify action */ -- } -+ /* but we need to re-paint it "pressed in" here */ -+ PaintThumb (sbw, 1, 0); -+ } - return; - } - #else /* XAW_ARROW_SCROLLBARS */ -@@ -954,7 +1208,7 @@ static void NotifyScroll (w, event, params, num_params) - - if (sbw->scrollbar.direction == 0) return; /* if no StartScroll */ - if (LookAhead (w, event)) return; -- if (*num_params > 0) -+ if (*num_params > 0) - style = *params[0]; - else - style = 'P'; -@@ -963,24 +1217,24 @@ static void NotifyScroll (w, event, params, num_params) - case 'P': /* Proportional */ - case 'p': - ExtractPosition (event, &x, &y); -- call_data = -- InRange (PICKLENGTH (sbw, x, y), 0, (int) sbw->scrollbar.length); -+ call_data = -+ InRange (PICKLENGTH (sbw, x, y), 0, (int) sbw->scrollbar.length); - break; - - case 'F': /* FullLength */ -- case 'f': -- call_data = sbw->scrollbar.length; -+ case 'f': -+ call_data = sbw->scrollbar.length; - break; - } - switch (sbw->scrollbar.direction) { - case 'B': -- case 'b': -+ case 'b': - call_data = -call_data; - /* fall through */ - - case 'F': -- case 'f': -- XtCallCallbacks (w, XtNscrollProc, (XtPointer)call_data); -+ case 'f': -+ XtCallCallbacks (w, XtNscrollProc, (XtPointer)(long)call_data); - break; - - case 'C': -@@ -1005,6 +1259,9 @@ static void EndScroll(w, event, params, num_params ) - /* 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)); -@@ -1055,7 +1312,7 @@ static void MoveThumb (w, event, params, num_params) - #ifdef XAW_ARROW_SCROLLBARS - if (sbw->scrollbar.scroll_mode != 2 ) - /* initialize picked position */ -- sbw->scrollbar.picked = (FloatInRange( loc, t, t + s ) - t); -+ sbw->scrollbar.picked = (FloatInRange(loc, t, t+s) - t); - #else - sbw->scrollbar.picked = 0.5 * s; - #endif -@@ -1074,7 +1331,7 @@ static void MoveThumb (w, event, params, num_params) - #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 */ - } - -@@ -1164,6 +1421,6 @@ void XawScrollbarSetThumb (w, top, shown) - sbw->scrollbar.shown = (shown > 1.0) ? 1.0 : - (shown >= 0.0) ? shown : sbw->scrollbar.shown; - -- PaintThumb (sbw, NULL); -+ PaintThumb (sbw, 0, 0); - } - -diff --git a/xc/lib/Xaw3d/Scrollbar.h b/xc/lib/Xaw3d/Scrollbar.h -index 2821018..0c84582 100644 ---- a/xc/lib/Xaw3d/Scrollbar.h -+++ b/xc/lib/Xaw3d/Scrollbar.h -@@ -94,6 +94,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 -@@ -101,6 +102,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 -@@ -115,11 +117,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; -diff --git a/xc/lib/Xaw3d/ScrollbarP.h b/xc/lib/Xaw3d/ScrollbarP.h -index d4c8b72..5573e1d 100644 ---- a/xc/lib/Xaw3d/ScrollbarP.h -+++ b/xc/lib/Xaw3d/ScrollbarP.h -@@ -70,6 +70,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 */ -@@ -94,10 +95,12 @@ typedef struct { - Cursor inactiveCursor; /* the normal cursor for scrollbar */ - char direction; /* a scroll has started; which direction */ - #endif -- GC gc; /* a (shared) gc */ -+ GC gc; /* a (shared) gc for foreground */ -+ 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 pick_top; /* pick thumb at top or anywhere */ -+ Boolean push_thumb; /* push thumb in or not */ - - } ScrollbarPart; - -diff --git a/xc/lib/Xaw3d/SimpleMenu.c b/xc/lib/Xaw3d/SimpleMenu.c -index 2bf439d..96a1a61 100644 ---- a/xc/lib/Xaw3d/SimpleMenu.c -+++ b/xc/lib/Xaw3d/SimpleMenu.c -@@ -547,7 +547,7 @@ Cardinal *num_args; - XDefineCursor(XtDisplay(new), - XtWindow(new), smw_new->simple_menu.cursor); - -- if (smw_old->simple_menu.label_string !=smw_new->simple_menu.label_string) -+ if (smw_old->simple_menu.label_string !=smw_new->simple_menu.label_string) { - if (smw_new->simple_menu.label_string == NULL) /* Destroy. */ - XtDestroyWidget((Widget) smw_old->simple_menu.label); - else if (smw_old->simple_menu.label_string == NULL) /* Create. */ -@@ -558,6 +558,7 @@ Cardinal *num_args; - XtSetArg(arglist[0], XtNlabel, smw_new->simple_menu.label_string); - XtSetValues((Widget) smw_new->simple_menu.label, arglist, ONE); - } -+ } - - if (smw_old->simple_menu.label_class != smw_new->simple_menu.label_class) - XtAppWarning(XtWidgetToApplicationContext(new), -diff --git a/xc/lib/Xaw3d/SmeThreeD.c b/xc/lib/Xaw3d/SmeThreeD.c -index a01023c..ee4374c 100644 ---- a/xc/lib/Xaw3d/SmeThreeD.c -+++ b/xc/lib/Xaw3d/SmeThreeD.c -@@ -71,7 +71,9 @@ static XtResource resources[] = { - offset(sme_threeD.shadowed), XtRImmediate, (XtPointer) False}, - {XtNborderWidth, XtCBorderWidth, XtRDimension, sizeof(Dimension), - XtOffsetOf(RectObjRec,rectangle.border_width), XtRImmediate, -- (XtPointer)0} -+ (XtPointer)0}, -+ {XtNinvertBorder, XtCInvertBorder, XtRBoolean, sizeof(Boolean), -+ offset(sme_threeD.invert_border), XtRImmediate, (XtPointer) False}, - }; - - #undef offset -@@ -209,7 +211,7 @@ static void AllocTopShadowPixmap (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; - - /* -@@ -265,7 +267,7 @@ static void AllocBotShadowPixmap (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) { -@@ -568,8 +570,16 @@ _XawSme3dDrawShadows(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; -diff --git a/xc/lib/Xaw3d/SmeThreeD.h b/xc/lib/Xaw3d/SmeThreeD.h -index b4d458f..bcffb8f 100644 ---- a/xc/lib/Xaw3d/SmeThreeD.h -+++ b/xc/lib/Xaw3d/SmeThreeD.h -@@ -50,6 +50,7 @@ SOFTWARE. - bottomShadowContrast BottomShadowContrast Int 40 - userData UserData XtPointer NULL - beNiceToColormap BeNiceToColormap Boolean False -+ invertBorder InvertBorder Boolean False - - */ - -@@ -67,6 +68,8 @@ SOFTWARE. - #define XtCBeNiceToColormap "BeNiceToColormap" - #define XtNbeNiceToColourmap "beNiceToColormap" - #define XtCBeNiceToColourmap "BeNiceToColormap" -+#define XtNinvertBorder "invertBorder" -+#define XtCInvertBorder "InvertBorder" - #define XtNuserData "userData" - #define XtCUserData "UserData" - -diff --git a/xc/lib/Xaw3d/SmeThreeDP.h b/xc/lib/Xaw3d/SmeThreeDP.h -index a07dd40..15e222a 100644 ---- a/xc/lib/Xaw3d/SmeThreeDP.h -+++ b/xc/lib/Xaw3d/SmeThreeDP.h -@@ -47,6 +47,7 @@ typedef struct { - XtPointer user_data; - Boolean be_nice_to_cmap; - Boolean shadowed; -+ Boolean invert_border; - } SmeThreeDPart; - - /* Full instance record declaration */ -diff --git a/xc/lib/Xaw3d/StripChart.c b/xc/lib/Xaw3d/StripChart.c -index 5344f97..14e808d 100644 ---- a/xc/lib/Xaw3d/StripChart.c -+++ b/xc/lib/Xaw3d/StripChart.c -@@ -292,7 +292,7 @@ XtIntervalId *id; /* unused */ - if (XtIsRealized((Widget)w) && - w->strip_chart.max_value > w->strip_chart.scale) { - XClearWindow(XtDisplay ((Widget) w), XtWindow ((Widget) w)); -- w->strip_chart.interval = repaint_window((Widget)w, 0, (int) w->core.width - 2 * s); -+ w->strip_chart.interval = repaint_window((Widget)w, 0, (int) w->core.width); - (*swclass->threeD_class.shadowdraw) ((Widget) w, - (XEvent *)0, (Region)0, - w->threeD.relief, FALSE); -@@ -346,6 +346,7 @@ int left, width; - int next = w->strip_chart.interval; - int scale = w->strip_chart.scale; - int scalewidth = 0; -+ int margin = w->core.width - s; - - /* Compute the minimum scale required to graph the data, but don't go - lower than min_scale. */ -@@ -358,7 +359,7 @@ int left, width; - w->strip_chart.scale = scale; - left = 0; - width = next; /* check this */ -- scalewidth = w->core.width - 2 * s; -+ scalewidth = w->core.width - 2 * s - 1; - - SetPoints(gw); - -@@ -373,10 +374,18 @@ int left, width; - Display *dpy = XtDisplay(gw); - Window win = XtWindow(gw); - -- width += left - 1; -- if (!scalewidth) scalewidth = width; -+ if (left < s) left = 0; -+ else left -= s; -+ if (left >= margin) left = margin - 1; - -- if (next < (++width - s)) width = next + s; -+ width += (left - 1); -+ -+ if (!scalewidth) { -+ scalewidth = w->core.width - 2 * s - 1; -+ if (width < scalewidth) scalewidth = width; -+ } -+ -+ if (next < ++width) width = next; - - /* Draw data point lines. */ - for (i = left; i < width; i++) { -@@ -390,7 +399,7 @@ int left, width; - } - - /* Draw graph reference lines */ -- for (i = 1; i < w->strip_chart.scale; i++) { -+ if (left <= scalewidth) for (i = 1; i < w->strip_chart.scale; i++) { - j = i * ((w->core.height - 2 * s) / w->strip_chart.scale); - XDrawLine(dpy, win, w->strip_chart.hiGC, - left + s, j + s, scalewidth + s, j + s); -@@ -415,6 +424,7 @@ Boolean blit; - double old_max; - int left, i, j; - int next = w->strip_chart.interval; -+ int margin = w->core.width - s; - - if (!XtIsRealized((Widget) w)) return; - -@@ -447,7 +457,7 @@ Boolean blit; - - if ( ((int) old_max) != ( (int) w->strip_chart.max_value) ) { - XClearWindow(XtDisplay(w), XtWindow(w)); -- repaint_window((Widget)w, 0, w->core.width - 2 * s); -+ repaint_window((Widget)w, 0, w->core.width); - return; - } - -@@ -466,12 +476,13 @@ Boolean blit; - FALSE); - - /* Draw graph reference lines */ -- left = j; -- for (i = 1; i < w->strip_chart.scale; i++) { -- j = i * ((w->core.height - 2 * s) / w->strip_chart.scale); -- XDrawLine(XtDisplay((Widget) w), XtWindow( (Widget) w), -- w->strip_chart.hiGC, -- left, j + s, ((int)w->core.width - s - 1), j + s); -+ if ((left = j) < margin) { -+ for (i = 1; i < w->strip_chart.scale; i++) { -+ j = i * ((w->core.height - 2 * s) / w->strip_chart.scale); -+ XDrawLine(XtDisplay((Widget) w), XtWindow( (Widget) w), -+ w->strip_chart.hiGC, -+ left, j + s, margin - 1, j + s); -+ } - } - return; - } -@@ -523,7 +534,7 @@ static Boolean SetValues (current, request, new, args, num_args) - * Returns: none. - */ - --#define HEIGHT ( (unsigned int) w->core.height) -+#define HEIGHT ( (double)w->core.height - 2.0 * (double)s ) - - static void - SetPoints(widget) -@@ -550,7 +561,7 @@ Widget widget; - - for (i = 1; i < w->strip_chart.scale; i++) { - points[i - 1].x = 0; -- points[i - 1].y = ( short)(((double)w->core.height - 2.0 * (double) s) / (double) w->strip_chart.scale ); -+ points[i - 1].y = (short)(HEIGHT / (double) w->strip_chart.scale); - } - points[0].y += (short)s; - } -diff --git a/xc/lib/Xaw3d/Text.c b/xc/lib/Xaw3d/Text.c -index 32a3f8d..1716890 100644 ---- a/xc/lib/Xaw3d/Text.c -+++ b/xc/lib/Xaw3d/Text.c -@@ -1150,11 +1150,12 @@ TextWidget ctx; - _XawTextBuildLineTable (ctx, zeroPosition, FALSE); - } - } -- else if (ctx->text.vbar != NULL) -+ else if (ctx->text.vbar != NULL) { - if (ctx->text.scroll_vert == XawtextScrollWhenNeeded) - DestroyVScrollBar(ctx); - else if (ctx->text.scroll_vert == XawtextScrollAlways) - XawScrollbarSetThumb(ctx->text.vbar, 0.0, 1.0); -+ } - } - - /* -@@ -1182,11 +1183,12 @@ TextWidget ctx; - else - widest = ctx->core.width - 2 * s; - widest /= (last = GetWidestLine(ctx)); -- if (ctx->text.scroll_horiz == XawtextScrollWhenNeeded) -+ if (ctx->text.scroll_horiz == XawtextScrollWhenNeeded) { - if (widest < 1.0) - CreateHScrollBar(ctx); - else - DestroyHScrollBar(ctx); -+ } - - if ( (ctx->text.hbar == NULL) != temp ) { - _XawTextBuildLineTable (ctx, ctx->text.lt.top, TRUE); -diff --git a/xc/lib/Xaw3d/TextAction.c b/xc/lib/Xaw3d/TextAction.c -index 65b8539..32c8e51 100644 ---- a/xc/lib/Xaw3d/TextAction.c -+++ b/xc/lib/Xaw3d/TextAction.c -@@ -1852,6 +1852,7 @@ Cardinal* num_params; - { - TextWidget ctx = (TextWidget) w; - int mult; -+ int atoi(); - - if (*num_params != 1) { - XtAppError( XtWidgetToApplicationContext( w ), -diff --git a/xc/lib/Xaw3d/TextPop.c b/xc/lib/Xaw3d/TextPop.c -index cf01b4f..ee3e595 100644 ---- a/xc/lib/Xaw3d/TextPop.c -+++ b/xc/lib/Xaw3d/TextPop.c -@@ -1064,13 +1064,14 @@ Boolean once_only, show_current; - else - XawTextSetInsertionPoint( tw, pos); - -- if (once_only) -+ if (once_only) { - if (show_current) - break; - else { - DoSearch(search); - return(TRUE); - } -+ } - count++; - } - -diff --git a/xc/lib/Xaw3d/ThreeD.c b/xc/lib/Xaw3d/ThreeD.c -index 8166a7c..65251f8 100644 ---- a/xc/lib/Xaw3d/ThreeD.c -+++ b/xc/lib/Xaw3d/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} - }; -@@ -222,14 +224,13 @@ static void AllocTopShadowPixmap (new) - if (tdw->core.background_pixel == WhitePixelOfScreen (scn) || - tdw->core.background_pixel == BlackPixelOfScreen (scn)) { - pm_data = mtshadowpm_bits; -- pm_size = mtshadowpm_size; -- } else -+ pm_size = mtshadowpm_size; -+ } else - #endif -- { -- pm_data = shadowpm_bits; -- pm_size = shadowpm_size; -- } -- -+ { -+ pm_data = shadowpm_bits; -+ pm_size = shadowpm_size; -+ } - create_pixmap = TRUE; - } else { - pm_size = 0; /* keep gcc happy */ -@@ -651,7 +652,7 @@ _Xaw3dDrawShadows (gw, event, region, relief, out) - 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 { -@@ -792,7 +793,7 @@ Boolean out; - 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; -diff --git a/xc/lib/Xaw3d/ThreeD.h b/xc/lib/Xaw3d/ThreeD.h -index d7cf8e2..a2f6570 100644 ---- a/xc/lib/Xaw3d/ThreeD.h -+++ b/xc/lib/Xaw3d/ThreeD.h -@@ -49,6 +49,7 @@ SOFTWARE. - bottomShadowContrast BottomShadowContrast Int 40 - userData UserData XtPointer NULL - beNiceToColormap BeNiceToColormap Boolean False -+ invertBorder InvertBorder Boolean False - relief Relief XtRelief XtReliefRaised - - */ -@@ -67,6 +68,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" -diff --git a/xc/lib/Xaw3d/ThreeDP.h b/xc/lib/Xaw3d/ThreeDP.h -index 44ccb97..c61bf78 100644 ---- a/xc/lib/Xaw3d/ThreeDP.h -+++ b/xc/lib/Xaw3d/ThreeDP.h -@@ -47,6 +47,7 @@ typedef struct { - GC bot_shadow_GC; - XtPointer user_data; - Boolean be_nice_to_cmap; -+ Boolean invert_border; - XtRelief relief; - } ThreeDPart; - -diff --git a/xc/lib/Xaw3d/Toggle.c b/xc/lib/Xaw3d/Toggle.c -index 66902c4..bd97876 100644 ---- a/xc/lib/Xaw3d/Toggle.c -+++ b/xc/lib/Xaw3d/Toggle.c -@@ -499,10 +499,11 @@ Widget w, radio_group; - if ( tw->command.set && radio_group != NULL ) - XawToggleUnsetCurrent(radio_group); - -- if (radio_group != NULL) -+ if (radio_group != NULL) { - if ((group = GetRadioGroup(radio_group)) == NULL) - CreateRadioGroup(w, radio_group); - else AddToRadioGroup(group, w); -+ } - } - - /* Function Name: XawToggleGetCurrent -diff --git a/xc/lib/Xaw3d/Viewport.c b/xc/lib/Xaw3d/Viewport.c -index b257cd3..813cea6 100644 ---- a/xc/lib/Xaw3d/Viewport.c -+++ b/xc/lib/Xaw3d/Viewport.c -@@ -824,17 +824,19 @@ int *clip_width, *clip_height; - if ( (w->viewport.allowvert || w->viewport.allowhoriz) ) { - XtQueryGeometry( child, intended, &preferred ); - -- if ( !(intended->request_mode & CWWidth) ) -+ if ( !(intended->request_mode & CWWidth) ) { - if ( preferred.request_mode & CWWidth ) - intended->width = preferred.width; - else - intended->width = child->core.width; -+ } - -- if ( !(intended->request_mode & CWHeight) ) -+ if ( !(intended->request_mode & CWHeight) ) { - if ( preferred.request_mode & CWHeight ) - intended->height = preferred.height; - else - intended->height = child->core.height; -+ } - } - } - else { -diff --git a/xc/lib/Xaw3d/XawI18n.c b/xc/lib/Xaw3d/XawI18n.c -index c911057..9204ff4 100644 ---- a/xc/lib/Xaw3d/XawI18n.c -+++ b/xc/lib/Xaw3d/XawI18n.c -@@ -68,6 +68,9 @@ wchar_t _Xaw_atowc(c) - { - wchar_t wc; - char str[2]; -+#ifndef USE_XMBTOWC -+ int mbtowc(); -+#endif - - str[0] = c; - str[1] = '\0'; -diff --git a/xc/lib/Xaw3d/XawI18n.h b/xc/lib/Xaw3d/XawI18n.h -index b0176bf..9c02c76 100644 ---- a/xc/lib/Xaw3d/XawI18n.h -+++ b/xc/lib/Xaw3d/XawI18n.h -@@ -58,10 +58,12 @@ extern int _Xaw_iswspace(wchar_t); - #endif - - #ifdef USE_XWCHAR_STRING -+int _Xwcsncpy(), _Xwcscpy(), _Xwcslen(); - #define wcslen(c) _Xwcslen(c) - #define wcscpy(d,s) _Xwcscpy(d,s) - #define wcsncpy(d,s,l) _Xwcsncpy(d,s,l) - #ifdef USE_XMBTOWC -+int _Xmbtowc(); - #define mbtowc(wc,s,l) _Xmbtowc(wc,s,l) - #endif - #endif -diff --git a/xc/lib/Xaw3d/XawIm.c b/xc/lib/Xaw3d/XawIm.c -index a5d0032..2cf2113 100644 ---- a/xc/lib/Xaw3d/XawIm.c -+++ b/xc/lib/Xaw3d/XawIm.c -@@ -1080,6 +1080,7 @@ static void SetValues( w, ve, args, num_args ) - XrmResourceList xrmres; - int i; - XawIcTablePart *p, save_tbl; -+ void _XtCopyFromArg(); - - if ((p = GetIcTable(w, ve)) == NULL) return; - -@@ -1331,8 +1332,6 @@ static Boolean Initialize( vw, ve ) - VendorShellWidget vw; - XawVendorShellExtPart* ve; - { -- int i; -- - if (!XtIsVendorShell((Widget)vw)) return(FALSE); - ve->parent = (Widget)vw; - ve->im.xim = NULL; -@@ -1531,6 +1530,8 @@ _XawImSetValues( inwidg, args, num_args ) - SetFocusValues( inwidg, args, num_args, FALSE ); - } - -+void _XtCountVaList(), _XtVaToArgList(); -+ - void - #if NeedVarargsPrototypes - _XawImVASetValues( Widget inwidg, ... ) --- -1.6.1 - diff --git a/Xaw3d-1.5E-warnings.patch b/Xaw3d-1.5E-warnings.patch deleted file mode 100644 index 8ffa7f8..0000000 --- a/Xaw3d-1.5E-warnings.patch +++ /dev/null @@ -1,114 +0,0 @@ ---- Xaw3d-1.5E/xc/lib/Xaw3d/MultiSrc.c 2009-03-15 17:04:35.000000000 +0100 -+++ Xaw3d-1.5E.new/xc/lib/Xaw3d/MultiSrc.c 2009-03-15 14:22:05.000000000 +0100 -@@ -77,6 +77,7 @@ - #include - #include - #include -+#include - - /**************************************************************** - * ---- Xaw3d-1.5E/xc/lib/Xaw3d/Panner.c 2000-11-27 14:19:24.000000000 +0100 -+++ Xaw3d-1.5E.new/xc/lib/Xaw3d/Panner.c 2009-03-15 13:50:40.000000000 +0100 -@@ -36,7 +36,7 @@ - #include /* for Min */ - #include - #include /* for isascii() etc. */ --#include /* for atof() */ -+#include /* for atof() */ - - extern Bool XmuDistinguishablePixels(); /* not defined in any Xmu headers */ - ---- Xaw3d-1.5E/xc/lib/Xaw3d/Text.c 2009-03-15 17:04:35.000000000 +0100 -+++ Xaw3d-1.5E.new/xc/lib/Xaw3d/Text.c 2009-03-15 13:54:10.000000000 +0100 -@@ -75,6 +75,7 @@ - #include - #include /* for isprint() */ - #include -+#include - - #include "XawAlloc.h" - ---- Xaw3d-1.5E/xc/lib/Xaw3d/TextAction.c 2000-11-27 14:19:36.000000000 +0100 -+++ Xaw3d-1.5E.new/xc/lib/Xaw3d/TextAction.c 2009-03-15 14:19:27.000000000 +0100 -@@ -45,7 +45,9 @@ - #include "XawI18n.h" - #endif - #include -+#include - #include -+#include - - #define SrcScan XawTextSourceScan - #define FindDist XawTextSinkFindDistance ---- Xaw3d-1.5E/xc/lib/Xaw3d/TextPop.c 2009-03-15 17:04:35.000000000 +0100 -+++ Xaw3d-1.5E.new/xc/lib/Xaw3d/TextPop.c 2009-03-15 14:19:44.000000000 +0100 -@@ -65,6 +65,7 @@ - #include - #include /* for O_RDONLY */ - #include -+#include - - #include "XawAlloc.h" - ---- Xaw3d-1.5E/xc/lib/Xaw3d/TextSrc.c 2000-11-27 14:19:36.000000000 +0100 -+++ Xaw3d-1.5E.new/xc/lib/Xaw3d/TextSrc.c 2009-03-15 14:19:13.000000000 +0100 -@@ -49,6 +49,7 @@ - #endif - #include - #include -+#include - - /**************************************************************** - * ---- Xaw3d-1.5E/xc/lib/Xaw3d/ThreeD.c 2003-02-11 12:41:56.000000000 +0100 -+++ Xaw3d-1.5E.new/xc/lib/Xaw3d/ThreeD.c 2009-03-15 14:21:20.000000000 +0100 -@@ -39,6 +39,7 @@ - #include - #include - #include -+#include - - /* Initialization of defaults */ - ---- Xaw3d-1.5E/xc/lib/Xaw3d/Tip.c 2003-03-09 01:31:49.000000000 +0100 -+++ Xaw3d-1.5E.new/xc/lib/Xaw3d/Tip.c 2009-03-15 14:21:36.000000000 +0100 -@@ -41,6 +41,7 @@ - #include - #include - #include -+#include - - #define TIP_EVENT_MASK (ButtonPressMask | \ - ButtonReleaseMask | \ ---- Xaw3d-1.5E/xc/lib/Xaw3d/XawI18n.c 1996-10-15 16:41:25.000000000 +0200 -+++ Xaw3d-1.5E.new/xc/lib/Xaw3d/XawI18n.c 2009-03-15 14:23:11.000000000 +0100 -@@ -55,6 +55,7 @@ - - */ - -+#include - #include - #include "XawI18n.h" - ---- Xaw3d-1.5E/xc/lib/Xaw3d/XawIm.c 1998-04-21 15:42:02.000000000 +0200 -+++ Xaw3d-1.5E.new/xc/lib/Xaw3d/XawIm.c 2009-03-15 14:22:41.000000000 +0100 -@@ -59,6 +59,7 @@ - #include - #include - #include -+#include - #include - #include - #include -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/XawI18n.h~ Xaw3d-1.5E/xc/lib/Xaw3d/XawI18n.h ---- Xaw3d-1.5E/xc/lib/Xaw3d/XawI18n.h~ 1996-10-15 16:41:26.000000000 +0200 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/XawI18n.h 2009-03-15 17:18:04.000000000 +0100 -@@ -72,7 +72,4 @@ extern wchar_t _Xaw_atowc ( - - #ifndef HAS_ISW_FUNCS - #include --#ifndef iswspace --#define iswspace(c) (isascii(c) && isspace(toascii(c))) --#endif - #endif diff --git a/Xaw3d-1.5E-xorg-imake.patch b/Xaw3d-1.5E-xorg-imake.patch deleted file mode 100644 index 9d5312e..0000000 --- a/Xaw3d-1.5E-xorg-imake.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- Imakefile.config 2003-03-08 15:55:18.000000000 +0100 -+++ Imakefile 2005-01-20 14:48:55.630795072 +0100 -@@ -5,24 +5,24 @@ - XCOMM Build options. Have you read the README.XAW3D file yet? - XCOMM - XCOMM For color pixmaps, define MULTIPLANE_PIXMAPS: --#undef MULTIPLANE_PIXMAPS -+#define MULTIPLANE_PIXMAPS - XCOMM For grayed stipple shadows, define GRAY_BLKWHT_STIPPLES: - #define GRAY_BLKWHT_STIPPLES - XCOMM For scrollbars with arrows, define ARROW_SCROLLBARS: --#undef ARROW_SCROLLBARS -+#define ARROW_SCROLLBARS - --#define DoNormalLib NormalLibXaw --#define DoSharedLib SharedLibXaw --#define DoDebugLib DebugLibXaw --#define DoProfileLib ProfileLibXaw -+#define DoNormalLib NormalLibXaw7 -+#define DoSharedLib SharedLibXaw7 -+#define DoDebugLib DebugLibXaw7 -+#define DoProfileLib ProfileLibXaw7 - #define HasSharedData YES - #define LibName Xaw3d --#define SoRev SOXAWREV -+#define SoRev SOXAW7REV - #define IncSubdir X11 - #define IncSubSubdir Xaw3d - - XCOMM When building outside an X11 source tree: --XCOMM EXTRA_INCLUDES = -I. -+EXTRA_INCLUDES = -I. - - #ifdef SharedXawReqs - REQUIREDLIBS = SharedXawReqs diff --git a/Xaw3d-1.5E-3Dlabel.patch b/Xaw3d-1.6.1-3Dlabel.patch similarity index 77% rename from Xaw3d-1.5E-3Dlabel.patch rename to Xaw3d-1.6.1-3Dlabel.patch index 5a9b5b8..0feb7aa 100644 --- a/Xaw3d-1.5E-3Dlabel.patch +++ b/Xaw3d-1.6.1-3Dlabel.patch @@ -1,19 +1,9 @@ -From 282b0b2a42dec11a772be36f4b4aa70ae7fb6a0d Mon Sep 17 00:00:00 2001 -From: Markus Steinborn -Date: Sat, 24 Apr 2010 16:54:15 +0200 -Subject: [PATCH] Xaw3d-1.5E-3Dlabel.patch - ---- - xc/lib/Xaw3d/Label.c | 67 +++++++++++++++++++++++++++++++++++--------------- - 1 files changed, 47 insertions(+), 20 deletions(-) - -diff --git a/xc/lib/Xaw3d/Label.c b/xc/lib/Xaw3d/Label.c -index 8bda3a7..c4e1ff9 100644 ---- a/xc/lib/Xaw3d/Label.c -+++ b/xc/lib/Xaw3d/Label.c -@@ -422,9 +422,16 @@ static void GetgrayGC(lw) - static void compute_bitmap_offsets (lw) - LabelWidget lw; +diff -up libXaw3d-1.6.1/src/Label.c.3Dlabel libXaw3d-1.6.1/src/Label.c +--- libXaw3d-1.6.1/src/Label.c.3Dlabel 2011-09-19 15:42:36.000000000 -0600 ++++ libXaw3d-1.6.1/src/Label.c 2012-02-25 14:44:33.766774776 -0700 +@@ -416,9 +416,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; @@ -31,13 +21,8 @@ index 8bda3a7..c4e1ff9 100644 lw->label.lbm_y = 0; } -@@ -450,12 +457,16 @@ static void Initialize(request, new, args, num_args) - ArgList args; - Cardinal *num_args; +@@ -444,9 +451,11 @@ Initialize(Widget request, Widget new, A { -+#if 0 - extern WidgetClass commandWidgetClass; -+#endif LabelWidget lw = (LabelWidget) new; +#if 0 @@ -46,9 +31,9 @@ index 8bda3a7..c4e1ff9 100644 lw->threeD.shadow_width = 0; +#endif - if (lw->label.label == NULL) + if (lw->label.label == NULL) lw->label.label = XtNewString(lw->core.name); -@@ -469,18 +480,20 @@ static void Initialize(request, new, args, num_args) +@@ -460,18 +469,20 @@ Initialize(Widget request, Widget new, A if (lw->core.height == 0) lw->core.height = lw->label.label_height + @@ -73,7 +58,7 @@ index 8bda3a7..c4e1ff9 100644 lw->label.label_x = lw->label.label_y = 0; (*XtClass(new)->core_class.resize) ((Widget)lw); -@@ -559,14 +572,16 @@ static void Redisplay(gw, event, region) +@@ -549,14 +560,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, @@ -94,13 +79,14 @@ index 8bda3a7..c4e1ff9 100644 } #ifdef XAW_INTERNATIONALIZATION -@@ -657,14 +672,16 @@ static void _Reposition(lw, width, height, dx, dy) - Position *dx, *dy; +@@ -646,14 +659,17 @@ _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: @@ -113,7 +99,7 @@ index 8bda3a7..c4e1ff9 100644 break; case XtJustifyCenter: default: -@@ -758,17 +775,20 @@ static Boolean SetValues(current, request, new, args, num_args) +@@ -745,17 +761,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 + @@ -136,7 +122,7 @@ index 8bda3a7..c4e1ff9 100644 LEFT_OFFSET(newlw); /* req's label.lbm_width */ } -@@ -777,15 +797,20 @@ static Boolean SetValues(current, request, new, args, num_args) +@@ -764,15 +783,20 @@ SetValues(Widget current, Widget request if (checks[HEIGHT]) { if (newlw->label.label_height > newlw->label.lbm_height) i = newlw->label.label_height + @@ -161,19 +147,16 @@ index 8bda3a7..c4e1ff9 100644 if (i > newlw->core.width) newlw->core.width = i; } -@@ -857,9 +882,11 @@ static XtGeometryResult QueryGeometry(w, intended, preferred) +@@ -843,9 +867,11 @@ QueryGeometry(Widget w, XtWidgetGeometry preferred->request_mode = CWWidth | CWHeight; - preferred->width = (lw->label.label_width + + 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 + + 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 && --- -1.6.1 - diff --git a/Xaw3d-1.6.1-fontset.patch b/Xaw3d-1.6.1-fontset.patch new file mode 100644 index 0000000..0f3c8d2 --- /dev/null +++ b/Xaw3d-1.6.1-fontset.patch @@ -0,0 +1,60 @@ +diff -up libXaw3d-1.6.1/src/AsciiSink.c.fontset libXaw3d-1.6.1/src/AsciiSink.c +--- libXaw3d-1.6.1/src/AsciiSink.c.fontset 2012-02-01 12:24:00.000000000 -0700 ++++ libXaw3d-1.6.1/src/AsciiSink.c 2012-02-25 14:52:46.802779081 -0700 +@@ -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)); +diff -up libXaw3d-1.6.1/src/Command.c.fontset libXaw3d-1.6.1/src/Command.c +--- libXaw3d-1.6.1/src/Command.c.fontset 2011-09-19 15:42:36.000000000 -0600 ++++ libXaw3d-1.6.1/src/Command.c 2012-02-25 14:51:26.075372823 -0700 +@@ -218,6 +218,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)) +diff -up libXaw3d-1.6.1/src/List.c.fontset libXaw3d-1.6.1/src/List.c +--- libXaw3d-1.6.1/src/List.c.fontset 2011-10-09 12:01:20.000000000 -0600 ++++ libXaw3d-1.6.1/src/List.c 2012-02-25 14:53:16.327465260 -0700 +@@ -362,6 +362,8 @@ Initialize(Widget junk, Widget new, ArgL + { + ListWidget lw = (ListWidget) new; + ++ if (!lw->list.font) XtError("Aborting: no font found\n"); ++ + /* + * Initialize all private resources. + */ +diff -up libXaw3d-1.6.1/src/SmeBSB.c.fontset libXaw3d-1.6.1/src/SmeBSB.c +--- libXaw3d-1.6.1/src/SmeBSB.c.fontset 2011-09-19 15:42:36.000000000 -0600 ++++ libXaw3d-1.6.1/src/SmeBSB.c 2012-02-25 14:50:19.056358107 -0700 +@@ -207,6 +207,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 */ +diff -up libXaw3d-1.6.1/src/Tip.c.fontset libXaw3d-1.6.1/src/Tip.c +--- libXaw3d-1.6.1/src/Tip.c.fontset 2012-02-15 12:10:38.000000000 -0700 ++++ libXaw3d-1.6.1/src/Tip.c 2012-02-25 14:50:19.058358017 -0700 +@@ -248,6 +248,8 @@ XawTipInitialize(Widget req, Widget w, A + TipWidget tip = (TipWidget)w; + XGCValues values; + ++ if (!tip->tip.font) XtError("Aborting: no font found\n"); ++ + tip->tip.timer = 0; + + values.foreground = tip->tip.foreground; diff --git a/Xaw3d-1.5E-hsbar.patch b/Xaw3d-1.6.1-hsbar.patch similarity index 74% rename from Xaw3d-1.5E-hsbar.patch rename to Xaw3d-1.6.1-hsbar.patch index 92a9476..1f3987e 100644 --- a/Xaw3d-1.5E-hsbar.patch +++ b/Xaw3d-1.6.1-hsbar.patch @@ -1,18 +1,7 @@ -From 4b6b6b0ee611cdbff470794c9ec9e095296abfd2 Mon Sep 17 00:00:00 2001 -From: Markus Steinborn -Date: Sat, 24 Apr 2010 16:53:43 +0200 -Subject: [PATCH] Xaw3d-1.5E-hsbar.patch - ---- - xc/lib/Xaw3d/Text.c | 12 ++++-- - xc/lib/Xaw3d/Viewport.c | 92 ++++++++++++++--------------------------------- - 2 files changed, 35 insertions(+), 69 deletions(-) - -diff --git a/xc/lib/Xaw3d/Text.c b/xc/lib/Xaw3d/Text.c -index 1716890..baaba17 100644 ---- a/xc/lib/Xaw3d/Text.c -+++ b/xc/lib/Xaw3d/Text.c -@@ -478,8 +478,10 @@ TextWidget ctx; +diff -up libXaw3d-1.6.1/src/Text.c.hsbar libXaw3d-1.6.1/src/Text.c +--- libXaw3d-1.6.1/src/Text.c.hsbar 2011-10-06 13:17:19.000000000 -0600 ++++ libXaw3d-1.6.1/src/Text.c 2012-02-25 14:54:41.996656624 -0700 +@@ -495,8 +495,10 @@ CreateHScrollBar(TextWidget ctx) (XtPointer) NULL); /**/ @@ -25,7 +14,7 @@ index 1716890..baaba17 100644 /**/ PositionHScrollBar(ctx); if (XtIsRealized((Widget)ctx)) { -@@ -503,8 +505,10 @@ TextWidget ctx; +@@ -519,8 +521,10 @@ DestroyHScrollBar(TextWidget ctx) if (hbar == NULL) return; /**/ @@ -38,11 +27,10 @@ index 1716890..baaba17 100644 /**/ if (ctx->text.vbar == NULL) XtRemoveCallback((Widget) ctx, XtNunrealizeCallback, UnrealizeScrollbars, -diff --git a/xc/lib/Xaw3d/Viewport.c b/xc/lib/Xaw3d/Viewport.c -index 813cea6..c50d629 100644 ---- a/xc/lib/Xaw3d/Viewport.c -+++ b/xc/lib/Xaw3d/Viewport.c -@@ -239,7 +239,7 @@ static void Initialize(request, new, args, num_args) +diff -up libXaw3d-1.6.1/src/Viewport.c.hsbar libXaw3d-1.6.1/src/Viewport.c +--- libXaw3d-1.6.1/src/Viewport.c.hsbar 2012-01-24 14:56:03.000000000 -0700 ++++ libXaw3d-1.6.1/src/Viewport.c 2012-02-25 14:58:18.474098582 -0700 +@@ -244,7 +244,7 @@ Initialize(Widget request, Widget new, A XtVaGetValues((Widget)(w->viewport.threeD), XtNshadowWidth, &sw, NULL); if (sw) { @@ -51,7 +39,7 @@ index 813cea6..c50d629 100644 arg_cnt = 0; XtSetArg(threeD_args[arg_cnt], XtNborderWidth, 0); arg_cnt++; -@@ -257,8 +257,8 @@ static void Initialize(request, new, args, num_args) +@@ -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++; @@ -62,7 +50,7 @@ index 813cea6..c50d629 100644 w->viewport.clip = XtCreateManagedWidget("clip", widgetClass, new, clip_args, arg_cnt); -@@ -278,8 +278,8 @@ static void Initialize(request, new, args, num_args) +@@ -283,8 +283,8 @@ Initialize(Widget request, Widget new, A * Set the clip widget to the correct height. */ @@ -73,15 +61,7 @@ index 813cea6..c50d629 100644 if ( (h_bar != NULL) && ((int)w->core.width > -@@ -498,7 +498,6 @@ static void MoveChild(w, x, y) - RedrawThumbs(w); - } - -- - static void ComputeLayout(widget, query, destroy_scrollbars) - Widget widget; /* Viewport */ - Boolean query; /* query child's preferred geom? */ -@@ -516,23 +515,13 @@ static void ComputeLayout(widget, query, destroy_scrollbars) +@@ -509,23 +509,13 @@ ComputeLayout(Widget widget, Boolean que XtWidgetGeometry intended; Dimension pad = 0, sw = 0; @@ -108,7 +88,7 @@ index 813cea6..c50d629 100644 intended.request_mode = CWBorderWidth; intended.border_width = 0; -@@ -543,10 +532,8 @@ static void ComputeLayout(widget, query, destroy_scrollbars) +@@ -536,10 +526,8 @@ ComputeLayout(Widget widget, Boolean que &clip_width, &clip_height); } else { @@ -119,12 +99,12 @@ index 813cea6..c50d629 100644 XtWidgetGeometry preferred; needshoriz = needsvert = False; -@@ -560,31 +547,25 @@ static void ComputeLayout(widget, query, destroy_scrollbars) - if (!w->viewport.allowhoriz) +@@ -553,31 +541,25 @@ ComputeLayout(Widget widget, Boolean que + if (!w->viewport.allowhoriz) intended.request_mode |= CWWidth; -#ifdef PREP_CHILD_TO_CLIP -- if ((int)child->core.width < clip_width) +- if ((int)child->core.width < clip_width) - intended.width = clip_width; + if ((int)child->core.width < clip_width + pad) + intended.width = clip_width + pad; @@ -132,11 +112,11 @@ index 813cea6..c50d629 100644 -#endif intended.width = child->core.width; -- if (!w->viewport.allowvert) +- if (!w->viewport.allowvert) - intended.request_mode |= CWHeight; - -#ifdef PREP_CHILD_TO_CLIP -- if ((int)child->core.height < clip_height) +- if ((int)child->core.height < clip_height) - intended.height = clip_height; + if ((int)child->core.height < clip_height + pad) + intended.height = clip_height + pad; @@ -158,7 +138,7 @@ index 813cea6..c50d629 100644 if (query) { (void) XtQueryGeometry( child, &intended, &preferred ); if ( !(preferred.request_mode & CWWidth) ) -@@ -592,12 +573,9 @@ static void ComputeLayout(widget, query, destroy_scrollbars) +@@ -585,12 +567,9 @@ ComputeLayout(Widget widget, Boolean que if ( !(preferred.request_mode & CWHeight) ) preferred.height = intended.height; } @@ -171,25 +151,25 @@ index 813cea6..c50d629 100644 /* * Note that having once decided to turn on either bar -@@ -607,7 +585,7 @@ static void ComputeLayout(widget, query, destroy_scrollbars) +@@ -600,7 +579,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) { \ +++ (int)preferred.width > clip_width + pad) { \ if (!needshoriz) { \ - Widget bar = w->viewport.horiz_bar; \ + Widget horiz_bar = w->viewport.horiz_bar; \ needshoriz = True; \ -@@ -622,7 +600,7 @@ static void ComputeLayout(widget, query, destroy_scrollbars) +@@ -615,7 +594,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 bar = w->viewport.vert_bar; + Widget vert_bar = w->viewport.vert_bar; needsvert = True; -@@ -636,38 +614,22 @@ static void ComputeLayout(widget, query, destroy_scrollbars) +@@ -629,38 +608,22 @@ ComputeLayout(Widget widget, Boolean que intended.height = preferred.height; } @@ -233,7 +213,7 @@ index 813cea6..c50d629 100644 } bar_width = bar_height = 0; -@@ -712,7 +674,7 @@ static void ComputeLayout(widget, query, destroy_scrollbars) +@@ -705,7 +668,7 @@ ComputeLayout(Widget widget, Boolean que else { int bw = bar->core.border_width; XtResizeWidget( bar, @@ -242,7 +222,7 @@ index 813cea6..c50d629 100644 (Dimension)bw ); XtMoveWidget( bar, (Position)((needsvert && !w->viewport.useright) -@@ -737,7 +699,7 @@ static void ComputeLayout(widget, query, destroy_scrollbars) +@@ -730,7 +693,7 @@ ComputeLayout(Widget widget, Boolean que else { int bw = bar->core.border_width; XtResizeWidget( bar, @@ -251,7 +231,7 @@ index 813cea6..c50d629 100644 (Dimension)bw ); XtMoveWidget( bar, (Position)(w->viewport.useright -@@ -790,7 +752,7 @@ int *clip_width, *clip_height; +@@ -780,7 +743,7 @@ ComputeWithForceBars(Widget widget, Bool */ XtVaGetValues((Widget)(w->viewport.threeD), XtNshadowWidth, &sw, NULL); @@ -259,8 +239,8 @@ index 813cea6..c50d629 100644 + if (sw) pad = 2 * sw; if (w->viewport.allowvert) { - if (w->viewport.vert_bar == NULL) -@@ -944,7 +906,7 @@ GeometryRequestPlusScrollbar(w, horizontal, request, reply_return) + if (w->viewport.vert_bar == NULL) +@@ -926,7 +889,7 @@ GeometryRequestPlusScrollbar(ViewportWid Dimension pad = 0, sw = 0; XtVaGetValues((Widget)(w->viewport.threeD), XtNshadowWidth, &sw, NULL); @@ -269,7 +249,7 @@ index 813cea6..c50d629 100644 plusScrollbars = *request; if ((bar = w->viewport.horiz_bar) == (Widget)NULL) -@@ -1017,7 +979,7 @@ static XtGeometryResult GeometryManager(child, request, reply) +@@ -997,7 +960,7 @@ GeometryManager(Widget child, XtWidgetGe return XtGeometryNo; XtVaGetValues((Widget)(w->viewport.threeD), XtNshadowWidth, &sw, NULL); @@ -278,6 +258,3 @@ index 813cea6..c50d629 100644 allowed = *request; --- -1.6.1 - diff --git a/Xaw3d-1.5-i18n.patch b/Xaw3d-1.6.1-i18n.patch similarity index 66% rename from Xaw3d-1.5-i18n.patch rename to Xaw3d-1.6.1-i18n.patch index aa47302..1b9d9c8 100644 --- a/Xaw3d-1.5-i18n.patch +++ b/Xaw3d-1.6.1-i18n.patch @@ -1,7 +1,7 @@ ---- Xaw3d-1.5/xc/lib/Xaw3d/MultiSrc.c.orig Tue Aug 6 22:51:08 2002 -+++ Xaw3d-1.5/xc/lib/Xaw3d/MultiSrc.c Tue Aug 6 22:51:16 2002 -@@ -735,6 +735,7 @@ - +--- libXaw3d-1.6.1/src/MultiSrc.c.orig 2011-09-19 15:42:36.000000000 -0600 ++++ libXaw3d-1.6.1/src/MultiSrc.c 2012-02-25 14:33:44.336534494 -0700 +@@ -728,6 +728,7 @@ + if ( string_set || (old_src->multi_src.type != src->multi_src.type) ) { RemoveOldStringOrFile(old_src, string_set); + src->multi_src.allocated_string = old_src->multi_src.allocated_string; diff --git a/Xaw3d-ia64.patch b/Xaw3d-ia64.patch deleted file mode 100644 index 90ce711..0000000 --- a/Xaw3d-ia64.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/List.c.prototypes Xaw3d-1.5E/xc/lib/Xaw3d/List.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/List.c.prototypes 2000-11-27 14:19:36.000000000 +0100 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/List.c 2008-10-06 10:11:28.000000000 +0200 -@@ -38,6 +38,7 @@ in this Software without prior written a - - #include "Xaw3dP.h" - #include -+#include - #include - #include - #include -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/MultiSink.c.prototypes Xaw3d-1.5E/xc/lib/Xaw3d/MultiSink.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/MultiSink.c.prototypes 1996-10-15 16:41:20.000000000 +0200 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/MultiSink.c 2008-10-06 10:10:37.000000000 +0200 -@@ -81,6 +81,7 @@ SOFTWARE. - #include - #include "XawI18n.h" - #include -+#include - #include - - #ifdef GETLASTPOS -diff -up Xaw3d-1.5E/xc/lib/Xaw3d/Text.c.prototypes Xaw3d-1.5E/xc/lib/Xaw3d/Text.c ---- Xaw3d-1.5E/xc/lib/Xaw3d/Text.c.prototypes 2003-02-10 18:28:13.000000000 +0100 -+++ Xaw3d-1.5E/xc/lib/Xaw3d/Text.c 2008-10-06 10:11:11.000000000 +0200 -@@ -74,6 +74,7 @@ SOFTWARE. - #include - #include - #include /* for isprint() */ -+#include - - #ifndef MAX_LEN_CT - #define MAX_LEN_CT 6 /* for sequence: ESC $ ( A \xx \xx */ diff --git a/Xaw3d.spec b/Xaw3d.spec index 7e61771..9660f5e 100644 --- a/Xaw3d.spec +++ b/Xaw3d.spec @@ -1,27 +1,21 @@ Summary: A version of the MIT Athena widget set for X Name: Xaw3d -Version: 1.5E -Release: 21%{?dist} +Version: 1.6.1 +Release: 1%{?dist} Group: System Environment/Libraries -Source: ftp://ftp.visi.com/users/hawkeyd/X/Xaw3d-%{version}.tar.gz -Patch: Xaw3d-1.5E-xorg-imake.patch +Source: http://xorg.freedesktop.org/archive/individual/lib/libXaw3d-%{version}.tar.bz2 Patch1: Xaw3d-1.5E-cast.patch -Patch2: Xaw3d-ia64.patch -Patch3: Xaw3d-1.5-i18n.patch +Patch3: Xaw3d-1.6.1-i18n.patch Patch4: Xaw3d-1.5-box.c.patch Patch5: Xaw3d-1.5-debian-fixes.patch -Patch6: Xaw3d-1.5E-warnings.patch -Patch7: Xaw3d-1.5E-3Dlabel.patch +Patch7: Xaw3d-1.6.1-3Dlabel.patch Patch8: Xaw3d-1.5E-close-destroy-crash.patch Patch9: Xaw3d-1.5E-compat.patch -Patch10: Xaw3d-1.5E-fontset.patch -Patch11: Xaw3d-1.5E-hsbar.patch -Patch12: Xaw3d-1.5E-null.patch -Patch13: Xaw3d-1.5E-secure.patch -Patch14: Xaw3d-1.5E-thumb.patch +Patch10: Xaw3d-1.6.1-fontset.patch +Patch11: Xaw3d-1.6.1-hsbar.patch License: MIT -URL: http://directory.fsf.org/project/xaw3d/ +URL: http://xorg.freedesktop.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: libXmu-devel @@ -30,7 +24,7 @@ BuildRequires: libSM-devel BuildRequires: libXext-devel BuildRequires: libX11-devel BuildRequires: libXpm-devel -BuildRequires: imake +BuildRequires: xorg-x11-util-macros BuildRequires: bison BuildRequires: flex BuildRequires: ed @@ -68,39 +62,30 @@ package. %prep -%setup -q -c -# Xaw3d7 -pushd xc/lib/Xaw3d -ln -s .. X11 -%patch -p0 -b .config -popd +%setup -q -n libXaw3d-%{version} %patch1 -p1 -%patch2 -p1 -%patch3 -p1 +%patch3 -p1 -b .i18n %patch4 -p1 -%patch5 -p1 -%patch6 -p1 +# This doesn't apply cleanly, but has not been applied +#patch5 -p1 %patch7 -p1 -b .3Dlabel %patch8 -p1 -b .close-destroy-crash -%patch9 -p1 -b .compat +# This doesn't apply cleanly, but has not been applied +#patch9 -p1 -b .compat %patch10 -p1 -b .fontset %patch11 -p1 -b .hsbar -%patch12 -p1 -b .null -%patch13 -p1 -%patch14 -p1 %build -# Xaw3d7 -pushd xc/lib/Xaw3d -xmkmf -make CDEBUGFLAGS="${RPM_OPT_FLAGS} -DARROW_SCROLLBAR" -popd +%configure --disable-static --enable-arrow-scrollbars +make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT -make install DESTDIR=$RPM_BUILD_ROOT SHLIBDIR=%{_libdir} INCDIR=%{_includedir} -C xc/lib/Xaw3d +make install DESTDIR=$RPM_BUILD_ROOT +rm $RPM_BUILD_ROOT%{_libdir}/libXaw3d.la +rm -r $RPM_BUILD_ROOT%{_docdir} %clean @@ -114,15 +99,19 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) -%doc xc/lib/Xaw3d/README.XAW3D +%doc ChangeLog COPYING README src/README.XAW3D %{_libdir}/*.so.* %files devel %defattr(-,root,root) %{_libdir}/*.so +%{_libdir}/pkgconfig/xaw3d.pc %{_includedir}/X11/Xaw3d %changelog +* Sat Feb 25 2012 Orion Poplawski - 1.6.1-1 +- Update to 1.6.1 + * Thu Jan 12 2012 Fedora Release Engineering - 1.5E-21 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild diff --git a/sources b/sources index aa5d5b7..24464b8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -29ecfdcd6bcf47f62ecfd672d31269a1 Xaw3d-1.5E.tar.gz +3db4cfe29ee911a519ef254625809f9c libXaw3d-1.6.1.tar.bz2