mirror of
https://github.com/gnustep/libs-back.git
synced 2025-05-31 01:11:00 +00:00
Merge from 0.8.0
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@14232 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7bf0662f77
commit
c910bb1351
10 changed files with 188 additions and 49 deletions
26
ChangeLog
26
ChangeLog
|
@ -1,3 +1,27 @@
|
||||||
|
2002-08-02 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
|
* Merge from 0.8.0 into main branch.
|
||||||
|
|
||||||
|
2002-08-01 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
|
* Version: 0.8.0
|
||||||
|
|
||||||
|
* configure.ac: Check for usleep.
|
||||||
|
* Source/x11/XGServerWindow.m ([XGServer -windowdevice:]):
|
||||||
|
Use alternate if no usleep.
|
||||||
|
|
||||||
|
2002-07-28 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
|
* Source/xlib/XGBitmap.m (_pixmap_combine_alpha): Use
|
||||||
|
interger arithmatic. (Patch from Jeff Teunissen)
|
||||||
|
|
||||||
|
2002-07-19 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
|
* Source/xlib/XGGeometry.m (clipXRectsForCopying): Shift rect
|
||||||
|
origin to account for clipping.
|
||||||
|
* Source/xlib/XGGState.m (-setAlphaColor:): Correct colorspace
|
||||||
|
of alpha color.
|
||||||
|
|
||||||
2002-07-17 Adam Fedor <fedor@gnu.org>
|
2002-07-17 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
* Version: 0.7.9
|
* Version: 0.7.9
|
||||||
|
@ -11,7 +35,7 @@
|
||||||
|
|
||||||
* Source/xlib/XGBitmap.m (_pixmap_combine_alpha): Fix and
|
* Source/xlib/XGBitmap.m (_pixmap_combine_alpha): Fix and
|
||||||
cleanup alpha blending (Rescale by alpha)
|
cleanup alpha blending (Rescale by alpha)
|
||||||
(_bitmap_combine_alpha): Idem. (Patch from deek@d2dc.net).
|
(_bitmap_combine_alpha): Idem. (Patch from Jeff Teunissen).
|
||||||
|
|
||||||
2002-06-28 Adam Fedor <fedor@gnu.org>
|
2002-06-28 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
@include version.texi
|
@include version.texi
|
||||||
@end ifset
|
@end ifset
|
||||||
|
|
||||||
@section Noteworthy changes in version @samp{0.7.9}
|
@section Noteworthy changes in version @samp{0.8.0}
|
||||||
|
|
||||||
Bug fixes.
|
Bug fixes.
|
||||||
|
|
||||||
|
@ -15,6 +15,10 @@ Bug fixes.
|
||||||
@c Keep the next line just below the list of changes in most recent version.
|
@c Keep the next line just below the list of changes in most recent version.
|
||||||
@ifclear ANNOUNCE-ONLY
|
@ifclear ANNOUNCE-ONLY
|
||||||
|
|
||||||
|
@section Noteworthy changes in version @samp{0.7.9}
|
||||||
|
|
||||||
|
Bug fixes.
|
||||||
|
|
||||||
@section Noteworthy changes in version @samp{0.7.8}
|
@section Noteworthy changes in version @samp{0.7.8}
|
||||||
|
|
||||||
Simplified backend selection using --enable-server and
|
Simplified backend selection using --enable-server and
|
||||||
|
|
|
@ -538,7 +538,8 @@ NSDebugLLog(@"Frame", @"X2O %d, %@, %@", win->number,
|
||||||
int x, y, width, height;
|
int x, y, width, height;
|
||||||
gswindow_device_t *window;
|
gswindow_device_t *window;
|
||||||
|
|
||||||
window = WINDOW_WITH_TAG(screen);
|
/* Screen number is negative to avoid conflict with windows */
|
||||||
|
window = WINDOW_WITH_TAG(-screen);
|
||||||
if (window)
|
if (window)
|
||||||
return window;
|
return window;
|
||||||
|
|
||||||
|
@ -550,7 +551,7 @@ NSDebugLLog(@"Frame", @"X2O %d, %@, %@", win->number,
|
||||||
window->ident = RootWindow(dpy, screen);
|
window->ident = RootWindow(dpy, screen);
|
||||||
window->root = window->ident;
|
window->root = window->ident;
|
||||||
window->type = NSBackingStoreNonretained;
|
window->type = NSBackingStoreNonretained;
|
||||||
window->number = screen;
|
window->number = -screen;
|
||||||
window->map_state = IsViewable;
|
window->map_state = IsViewable;
|
||||||
window->visibility = -1;
|
window->visibility = -1;
|
||||||
if (window->ident)
|
if (window->ident)
|
||||||
|
@ -1358,7 +1359,12 @@ NSDebugLLog(@"Frame", @"X2O %d, %@, %@", win->number,
|
||||||
*/
|
*/
|
||||||
if (height != window->siz_hints.height)
|
if (height != window->siz_hints.height)
|
||||||
{
|
{
|
||||||
|
#if HAVE_USLEEP
|
||||||
usleep(1);
|
usleep(1);
|
||||||
|
#else
|
||||||
|
for (x=0; x<10000; x++)
|
||||||
|
;
|
||||||
|
#endif
|
||||||
XGetGeometry(dpy, window->ident, &window->root,
|
XGetGeometry(dpy, window->ident, &window->root,
|
||||||
&x, &y, &width, &height,
|
&x, &y, &width, &height,
|
||||||
&window->border, &window->depth);
|
&window->border, &window->depth);
|
||||||
|
|
|
@ -150,18 +150,18 @@ _pixmap_combine_alpha(RContext *context,
|
||||||
|
|
||||||
for (col = 0; col < srect.width; col++)
|
for (col = 0; col < srect.width; col++)
|
||||||
{
|
{
|
||||||
unsigned sr, sg, sb, sa; // source
|
unsigned sr, sg, sb, sa; // source
|
||||||
unsigned dr, dg, db, da; // dest
|
unsigned dr, dg, db, da; // dest
|
||||||
double alpha, ialpha;
|
unsigned ialpha;
|
||||||
|
|
||||||
// Get the source pixel information
|
// Get the source pixel information
|
||||||
pixel = XGetPixel (source_im->image, srect.x+col, srect.y+row);
|
pixel = XGetPixel(source_im->image, srect.x+col, srect.y+row);
|
||||||
PixelToRGB (pixel, sr, sg, sb);
|
PixelToRGB(pixel, sr, sg, sb);
|
||||||
|
|
||||||
if (source_alpha)
|
if (source_alpha)
|
||||||
{
|
{
|
||||||
pixel = XGetPixel(source_alpha->image,
|
pixel = XGetPixel(source_alpha->image,
|
||||||
srect.x+col, srect.y+row);
|
srect.x + col, srect.y + row);
|
||||||
sa = (pixel >> _ashift) & _amask;
|
sa = (pixel >> _ashift) & _amask;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -173,30 +173,37 @@ _pixmap_combine_alpha(RContext *context,
|
||||||
if (fraction < 1.0)
|
if (fraction < 1.0)
|
||||||
sa *= fraction;
|
sa *= fraction;
|
||||||
|
|
||||||
alpha = ((double) sa) / _amask;
|
sr *= sa;
|
||||||
|
sg *= sa;
|
||||||
|
sb *= sa;
|
||||||
|
|
||||||
|
ialpha = (_amask - sa);
|
||||||
|
|
||||||
// Now get dest pixel
|
// Now get dest pixel
|
||||||
pixel = XGetPixel(dest_im->image, col, row);
|
pixel = XGetPixel(dest_im->image, col, row);
|
||||||
PixelToRGB (pixel, dr, dg, db);
|
PixelToRGB(pixel, dr, dg, db);
|
||||||
|
|
||||||
|
dr *= ialpha;
|
||||||
|
dg *= ialpha;
|
||||||
|
db *= ialpha;
|
||||||
|
|
||||||
if (dest_alpha)
|
if (dest_alpha)
|
||||||
{
|
{
|
||||||
pixel = XGetPixel(dest_alpha->image, col, row);
|
pixel = XGetPixel(dest_alpha->image, col, row);
|
||||||
da = (pixel >> _ashift) & _amask;
|
da = (pixel >> _ashift) & _amask;
|
||||||
}
|
}
|
||||||
else // no alpha channel, background is opaque
|
else // no alpha channel, background is opaque
|
||||||
da = _amask;
|
da = _amask;
|
||||||
|
|
||||||
ialpha = (1.0 - alpha);
|
dr = (sr + dr) / _amask;
|
||||||
dr = (sr * alpha) + (dr * ialpha);
|
dg = (sg + dg) / _amask;
|
||||||
dg = (sg * alpha) + (dg * ialpha);
|
db = (sb + db) / _amask;
|
||||||
db = (sb * alpha) + (db * ialpha);
|
|
||||||
|
|
||||||
// calc final alpha
|
// calc final alpha
|
||||||
if (sa == _amask || da == _amask)
|
if (sa == _amask || da == _amask)
|
||||||
da = _amask;
|
da = _amask;
|
||||||
else
|
else
|
||||||
da = sa + (da * ialpha);
|
da = sa + ((da * ialpha) / _amask);
|
||||||
|
|
||||||
CLAMP(dr);
|
CLAMP(dr);
|
||||||
CLAMP(dg);
|
CLAMP(dg);
|
||||||
|
@ -857,7 +864,7 @@ _bitmap_combine_alpha(RContext *context,
|
||||||
img.a = malloc(img.screen_w);
|
img.a = malloc(img.screen_w);
|
||||||
|
|
||||||
{
|
{
|
||||||
unsigned long pixel;
|
unsigned long pixel;
|
||||||
|
|
||||||
/* Two cases, the *_FAST* method, which
|
/* Two cases, the *_FAST* method, which
|
||||||
is covered in the first a part of the if
|
is covered in the first a part of the if
|
||||||
|
@ -911,24 +918,21 @@ _bitmap_combine_alpha(RContext *context,
|
||||||
unsigned short sg = (*gptr++ >> (8 - _gwidth));
|
unsigned short sg = (*gptr++ >> (8 - _gwidth));
|
||||||
unsigned short sb = (*bptr++ >> (8 - _bwidth));
|
unsigned short sb = (*bptr++ >> (8 - _bwidth));
|
||||||
unsigned short sa = (*aptr++ >> (8 - _awidth));
|
unsigned short sa = (*aptr++ >> (8 - _awidth));
|
||||||
unsigned dr, dg, db, da;
|
unsigned dr, dg, db, da; // dest
|
||||||
double alpha = (double) sa / ((1 << _rwidth) - 1);
|
|
||||||
|
|
||||||
if (sa == 0) // dest wouldn't be changed
|
if (sa == 0) // dest wouldn't be changed
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/*
|
if (sa == _amask) // source only, don't bother with the rest
|
||||||
* Unscale alpha value in each color component
|
|
||||||
*/
|
|
||||||
if (sa < _amask)
|
|
||||||
{
|
{
|
||||||
double multiplier = (double) _amask / sa;
|
// Yes, this is duplicated code -- but it's worth it.
|
||||||
|
RGBToPixel(sr, sg, sb, pixel);
|
||||||
sr *= multiplier;
|
XPutPixel(dest_im->image, col, row, pixel);
|
||||||
sg *= multiplier;
|
if (dest_alpha)
|
||||||
sb *= multiplier;
|
XPutPixel(dest_alpha->image, col, row, sa << _ashift);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the destination pixel
|
// get the destination pixel
|
||||||
pixel = XGetPixel(dest_im->image, col, row);
|
pixel = XGetPixel(dest_im->image, col, row);
|
||||||
PixelToRGB(pixel, dr, dg, db);
|
PixelToRGB(pixel, dr, dg, db);
|
||||||
|
@ -940,24 +944,28 @@ _bitmap_combine_alpha(RContext *context,
|
||||||
}
|
}
|
||||||
else // no alpha channel, background is opaque
|
else // no alpha channel, background is opaque
|
||||||
da = _amask;
|
da = _amask;
|
||||||
|
|
||||||
if (sa == _amask || da == 0) // source only
|
if (da == 0)
|
||||||
{
|
{
|
||||||
dr = sr;
|
/*
|
||||||
dg = sg;
|
* Unscale the colors
|
||||||
db = sb;
|
*/
|
||||||
|
dr = (sr * _amask) / sa;
|
||||||
|
dg = (sg * _amask) / sa;
|
||||||
|
db = (sb * _amask) / sa;
|
||||||
da = sa;
|
da = sa;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
double ialpha = (1.0 - alpha);
|
unsigned ialpha = _amask - sa;
|
||||||
dr = (sr * alpha) + (dr * ialpha);
|
|
||||||
dg = (sg * alpha) + (dg * ialpha);
|
dr = (sr * sa + (dr * ialpha)) / _amask;
|
||||||
db = (sb * alpha) + (db * ialpha);
|
dg = (sg * sa + (dg * ialpha)) / _amask;
|
||||||
|
db = (sb * sa + (db * ialpha)) / _amask;
|
||||||
if (da == _amask || da == _amask)
|
if (da == _amask || da == _amask)
|
||||||
da = _amask;
|
da = _amask;
|
||||||
else
|
else
|
||||||
da = sa + (da * ialpha);
|
da = sa + ((da * ialpha) / _amask);
|
||||||
}
|
}
|
||||||
|
|
||||||
CLAMP(dr);
|
CLAMP(dr);
|
||||||
|
|
|
@ -260,7 +260,7 @@ static Region emptyRegion;
|
||||||
/* Window device isn't set yet */
|
/* Window device isn't set yet */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
color = gsMakeColor(gray_colorspace, value, 0, 0, 0);
|
color = gsMakeColor(rgb_colorspace, value, value, value, 0);
|
||||||
gcv.foreground = xrRGBToPixel(context, color);
|
gcv.foreground = xrRGBToPixel(context, color);
|
||||||
if (agcntxt == None)
|
if (agcntxt == None)
|
||||||
agcntxt = XCreateGC(XDPY, draw, GCForeground, &gcv);
|
agcntxt = XCreateGC(XDPY, draw, GCForeground, &gcv);
|
||||||
|
|
|
@ -117,14 +117,23 @@ void
|
||||||
clipXRectsForCopying (gswindow_device_t* winA, XRectangle* rectA,
|
clipXRectsForCopying (gswindow_device_t* winA, XRectangle* rectA,
|
||||||
gswindow_device_t* winB, XRectangle* rectB)
|
gswindow_device_t* winB, XRectangle* rectB)
|
||||||
{
|
{
|
||||||
|
XPoint shiftA, shiftB;
|
||||||
// First make A smaller.
|
// First make A smaller.
|
||||||
|
shiftA.x = rectA->x;
|
||||||
|
shiftA.y = rectA->y;
|
||||||
*rectA = XGIntersectionRect (*rectA, accessibleRectForWindow (winA));
|
*rectA = XGIntersectionRect (*rectA, accessibleRectForWindow (winA));
|
||||||
// update size of B with the size of A
|
// update size of B with the size of A
|
||||||
|
rectB->x += rectA->x - shiftA.x;
|
||||||
|
rectB->y += rectA->y - shiftA.y;
|
||||||
rectB->width = MIN (rectA->width, rectB->width);
|
rectB->width = MIN (rectA->width, rectB->width);
|
||||||
rectB->height = MIN (rectA->height, rectB->height);
|
rectB->height = MIN (rectA->height, rectB->height);
|
||||||
// now make B smaller
|
// now make B smaller
|
||||||
|
shiftB.x = rectB->x;
|
||||||
|
shiftB.y = rectB->y;
|
||||||
*rectB = XGIntersectionRect (*rectB, accessibleRectForWindow (winB));
|
*rectB = XGIntersectionRect (*rectB, accessibleRectForWindow (winB));
|
||||||
// and update size of A with size of B
|
// and update size of A with size of B
|
||||||
|
rectA->x += rectB->x - shiftB.x;
|
||||||
|
rectA->y += rectB->y - shiftB.y;
|
||||||
rectA->width = rectB->width;
|
rectA->width = rectB->width;
|
||||||
rectA->height = rectB->height;
|
rectA->height = rectB->height;
|
||||||
}
|
}
|
||||||
|
|
4
Version
4
Version
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
# The version number of this release.
|
# The version number of this release.
|
||||||
GNUSTEP_BACK_MAJOR_VERSION=0
|
GNUSTEP_BACK_MAJOR_VERSION=0
|
||||||
GNUSTEP_BACK_MINOR_VERSION=7
|
GNUSTEP_BACK_MINOR_VERSION=8
|
||||||
GNUSTEP_BACK_SUBMINOR_VERSION=9
|
GNUSTEP_BACK_SUBMINOR_VERSION=0
|
||||||
GNUSTEP_BACK_VERSION=${GNUSTEP_BACK_MAJOR_VERSION}.${GNUSTEP_BACK_MINOR_VERSION}.${GNUSTEP_BACK_SUBMINOR_VERSION}
|
GNUSTEP_BACK_VERSION=${GNUSTEP_BACK_MAJOR_VERSION}.${GNUSTEP_BACK_MINOR_VERSION}.${GNUSTEP_BACK_SUBMINOR_VERSION}
|
||||||
VERSION=${GNUSTEP_BACK_VERSION}
|
VERSION=${GNUSTEP_BACK_VERSION}
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,9 @@
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
/* Define to 1 if you have the <unistd.h> header file. */
|
||||||
#undef HAVE_UNISTD_H
|
#undef HAVE_UNISTD_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `usleep' function. */
|
||||||
|
#undef HAVE_USLEEP
|
||||||
|
|
||||||
/* Define if you have XftDrawStringUtf8 */
|
/* Define if you have XftDrawStringUtf8 */
|
||||||
#undef HAVE_UTF8
|
#undef HAVE_UTF8
|
||||||
|
|
||||||
|
|
80
configure
vendored
80
configure
vendored
|
@ -4461,6 +4461,86 @@ _ACEOF
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
# Functions
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
|
||||||
|
for ac_func in usleep
|
||||||
|
do
|
||||||
|
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||||
|
echo "$as_me:$LINENO: checking for $ac_func" >&5
|
||||||
|
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
|
||||||
|
if eval "test \"\${$as_ac_var+set}\" = set"; then
|
||||||
|
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||||
|
else
|
||||||
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
|
#line $LINENO "configure"
|
||||||
|
#include "confdefs.h"
|
||||||
|
/* System header to define __stub macros and hopefully few prototypes,
|
||||||
|
which can conflict with char $ac_func (); below. */
|
||||||
|
#include <assert.h>
|
||||||
|
/* Override any gcc2 internal prototype to avoid an error. */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
#endif
|
||||||
|
/* We use char because int might match the return type of a gcc2
|
||||||
|
builtin and then its argument prototype would still apply. */
|
||||||
|
char $ac_func ();
|
||||||
|
char (*f) ();
|
||||||
|
|
||||||
|
#ifdef F77_DUMMY_MAIN
|
||||||
|
# ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
# endif
|
||||||
|
int F77_DUMMY_MAIN() { return 1; }
|
||||||
|
#endif
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
/* The GNU C library defines this for functions which it implements
|
||||||
|
to always fail with ENOSYS. Some functions are actually named
|
||||||
|
something starting with __ and the normal name is an alias. */
|
||||||
|
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
|
||||||
|
choke me
|
||||||
|
#else
|
||||||
|
f = $ac_func;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||||
|
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
||||||
|
(eval $ac_link) 2>&5
|
||||||
|
ac_status=$?
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); } &&
|
||||||
|
{ ac_try='test -s conftest$ac_exeext'
|
||||||
|
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||||
|
(eval $ac_try) 2>&5
|
||||||
|
ac_status=$?
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); }; }; then
|
||||||
|
eval "$as_ac_var=yes"
|
||||||
|
else
|
||||||
|
echo "$as_me: failed program was:" >&5
|
||||||
|
cat conftest.$ac_ext >&5
|
||||||
|
eval "$as_ac_var=no"
|
||||||
|
fi
|
||||||
|
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
|
||||||
|
fi
|
||||||
|
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
|
||||||
|
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
|
||||||
|
if test `eval echo '${'$as_ac_var'}'` = yes; then
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# Find for JPEG
|
# Find for JPEG
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
|
|
|
@ -195,6 +195,11 @@ if test "x$enable_xim" = "xyes"; then
|
||||||
AC_DEFINE(USE_XIM,1,[Define to enable XIM support])
|
AC_DEFINE(USE_XIM,1,[Define to enable XIM support])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
# Functions
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
AC_HAVE_FUNCS(usleep)
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# Find for JPEG
|
# Find for JPEG
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue