Subject:
RE: Kaffe port to Microwindows
From:
Jean-Eric Cuendet ####@####.####
Date:
23 Mar 2000 08:20:30 -0000
Message-Id: <B45465FD9C23D21193E90000F8D0F3DF6831E0@mailsrv.linkvest.ch>
Hi all,
Kaffe port is stopped for the dynamic library issue.
Kaffe needs to do all dynamic libraries to link at runtime to the needed
libs. Ex, it loads libawt.so when someone asks for an AWT class.
When would you make dynamic libs of MWin? I sent an eye to akefiles but I'm
not so good to make that work...
More comments in the following:
>
>
> : - StretchBlt, MaskBlt, PatBlt
>
> I plan on adding StretchBlt, it's quite some work, though.
> For PatBlt,
> could you send some code surrounding that to me? I'm particularly
> interested in the last parameter, and calls to CreateXXXBrush
> around it.
> For MaskBlt, that can be added, but I'd like to see code
> around that too.
> There will be BitBlt issues also, I'd like to see code around
> it as well.
>
Here is some PatBlt code:
boolean fillRect( int x, int y, int w, int h, int clr) {
HBRUSH hbr = 0;
HPEN hp;
if ( clr < 0 )
return false;
if ( (COLORREF)clr != fgClr ) {
hbr = (HBRUSH)SelectObject( dc, CreateSolidBrush(
(COLORREF)clr ));
}
#if defined( UNDER_95 )
// strange repaint() behaviour under NT ???
PatBlt( dc, x+x0, y+y0, w, h, PATCOPY );
#else
hp = (HPEN)SelectObject( dc, HP_0);
Rectangle( dc, x+x0, y+y0, x+x0+w+1, y+y0+h+1);
SelectObject( dc, hp);
#endif
if ( hbr != 0) {
DeleteObject( SelectObject( dc, hbr));
}
GFLUSH();
return true;
}
Other function:
SelectObject( img->dcMask, img->mask);
PatBlt( img->dcMask, 0, 0, img->width, img->height,
BLACKNESS);
And here is some MaskBlt code:
void __cdecl
Java_java_awt_Toolkit_graDrawImage ( JNIEnv* env, jclass
clazz, Graphics* gr, Image* img,
jint srcX, jint srcY,
jint dstX, jint dstY,
jint width, jint height, jint bgval )
{
if ( img ) {
if ( img->mask) {
// gr->fillRect( dstX, dstY, width, height,
bgval);
#if defined (UNDER_95)
BitBlt( gr->dc, dstX+gr->x0, dstY+gr->y0,
width, height, img->dcMask, srcX, srcY, SRCAND);
BitBlt( gr->dc, dstX+gr->x0, dstY+gr->y0,
width, height, img->dc, srcX, srcY, SRCINVERT);
#else
MaskBlt( gr->dc, dstX+gr->x0, dstY+gr->y0,
width, height, img->dc, srcX, srcY,
img->mask, 0, 0, MAKEROP4( SRCPAINT,
SRCCOPY));
#endif
}
else {
BitBlt( gr->dc, dstX+gr->x0, dstY+gr->y0,
width, height, img->dc, srcX, srcY, SRCCOPY);
}
}
GFLUSH();
}
Bye
-jec