mirror of
https://github.com/gnustep/libs-back.git
synced 2025-05-31 09:21:26 +00:00
Moved extend string showing methods to GSG.
Simple (not working) alpha handling on windows. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@19686 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b829fc0758
commit
3c77485016
6 changed files with 1268 additions and 655 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2004-07-06 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Source/winlib/Win32GState.m (-_compositeGState:...fraction:):
|
||||||
|
Applied alpha blending patch by MA Garcias <lists@tragnarion.com>.
|
||||||
|
Disabled GDI_WIDELINE_BEZIERPATH_BUG.
|
||||||
|
* configure.ac: Added test for msimg32, needed for AlphaBlend.
|
||||||
|
* configure: Regenerated.
|
||||||
|
* Source/xlib/XGGState.m: Moved additional show methods to super class.
|
||||||
|
* Source/gsc/GSGState.m: Implemented additional show methods based
|
||||||
|
on (-showGlyphs::) and simple glyph conversion.
|
||||||
|
|
||||||
2004-06-19 Fred Kiefer <FredKiefer@gmx.de>
|
2004-06-19 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Source/x11/XGServerWindow.m (-standardcursor::): Added more
|
* Source/x11/XGServerWindow.m (-standardcursor::): Added more
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include "gsc/GSContext.h"
|
#include "gsc/GSContext.h"
|
||||||
#include "gsc/GSGState.h"
|
#include "gsc/GSGState.h"
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
|
#include <GNUstepBase/Unicode.h>
|
||||||
|
|
||||||
#define CHECK_PATH \
|
#define CHECK_PATH \
|
||||||
if (!path) \
|
if (!path) \
|
||||||
|
@ -357,15 +358,117 @@
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* Text operations */
|
/* Text operations */
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
- (void) DPSashow: (float)x : (float)y : (const char*)s
|
/* Show the first lenght characters from C string s at the current point
|
||||||
|
and return the width of the string. Does not move the point.
|
||||||
|
*/
|
||||||
|
- (float) _showString: (const char*)s lenght: (int)lenght
|
||||||
{
|
{
|
||||||
[self subclassResponsibility: _cmd];
|
[self subclassResponsibility: _cmd];
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
show_delta, show_array_x, show_array_y, show_array_xy
|
||||||
|
} show_array_t;
|
||||||
|
|
||||||
|
/* Omnibus show string routine that combines that characteristics of
|
||||||
|
ashow, awidthshow, widthshow, xshow, xyshow, and yshow */
|
||||||
|
- (void) _showString: (const char *)s
|
||||||
|
xCharAdj: (float)cx
|
||||||
|
yCharAdj: (float)cy
|
||||||
|
char: (char)c
|
||||||
|
adjArray: (const float *)arr
|
||||||
|
arrType: (show_array_t)type
|
||||||
|
isRelative: (BOOL)relative;
|
||||||
|
{
|
||||||
|
NSPoint point = [path currentPoint];
|
||||||
|
unichar *uch;
|
||||||
|
int ulen;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
/*
|
||||||
|
FIXME: We should use proper glyph generation here.
|
||||||
|
*/
|
||||||
|
uch = NULL;
|
||||||
|
ulen = 0;
|
||||||
|
GSToUnicode(&uch, &ulen, s, strlen(s), [font mostCompatibleStringEncoding],
|
||||||
|
NSDefaultMallocZone(), 0);
|
||||||
|
|
||||||
|
for (i = 0; i < ulen; i++)
|
||||||
|
{
|
||||||
|
NSPoint delta;
|
||||||
|
NSGlyph glyph;
|
||||||
|
|
||||||
|
glyph = (NSGlyph)uch[i];
|
||||||
|
[self GSShowGlyphs: &glyph : 1];
|
||||||
|
/* Note we update the current point according to the current
|
||||||
|
transformation scaling, although the text isn't currently
|
||||||
|
scaled (FIXME). */
|
||||||
|
if (type == show_array_xy)
|
||||||
|
{
|
||||||
|
delta.x = arr[2*i]; delta.y = arr[2*i+1];
|
||||||
|
}
|
||||||
|
else if (type == show_array_x)
|
||||||
|
{
|
||||||
|
delta.x = arr[i]; delta.y = 0;
|
||||||
|
}
|
||||||
|
else if (type == show_array_y)
|
||||||
|
{
|
||||||
|
delta.x = 0; delta.y = arr[i];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
delta.x = arr[0]; delta.y = arr[1];
|
||||||
|
}
|
||||||
|
delta = [ctm deltaPointInMatrixSpace: delta];
|
||||||
|
if (relative == YES)
|
||||||
|
{
|
||||||
|
NSSize advancement;
|
||||||
|
|
||||||
|
advancement = [font advancementForGlyph: glyph];
|
||||||
|
/* Use only delta transformations (no offset). Is this conversion needed?*/
|
||||||
|
advancement = [ctm sizeInMatrixSpace: NSMakeSize(advancement.width,
|
||||||
|
[font ascender])];
|
||||||
|
delta.x += advancement.width;
|
||||||
|
delta.y += advancement.height;
|
||||||
|
}
|
||||||
|
if (c && *(s+i) == c)
|
||||||
|
{
|
||||||
|
NSPoint cdelta;
|
||||||
|
|
||||||
|
cdelta.x = cx; cdelta.y = cy;
|
||||||
|
cdelta = [ctm deltaPointInMatrixSpace: cdelta];
|
||||||
|
delta.x += cdelta.x; delta.y += cdelta.y;
|
||||||
|
}
|
||||||
|
point.x += delta.x;
|
||||||
|
if (type != show_delta)
|
||||||
|
{
|
||||||
|
point.y += delta.y;
|
||||||
|
}
|
||||||
|
[path moveToPoint: point];
|
||||||
|
}
|
||||||
|
free(uch);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) DPSashow: (float)x : (float)y : (const char*)s
|
||||||
|
{
|
||||||
|
float arr[2];
|
||||||
|
|
||||||
|
arr[0] = x; arr[1] = y;
|
||||||
|
[self _showString: s
|
||||||
|
xCharAdj: 0 yCharAdj: 0 char: 0 adjArray: arr arrType: show_delta
|
||||||
|
isRelative: YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) DPSawidthshow: (float)cx : (float)cy : (int)c : (float)ax : (float)ay
|
- (void) DPSawidthshow: (float)cx : (float)cy : (int)c : (float)ax : (float)ay
|
||||||
: (const char*)s
|
: (const char*)s
|
||||||
{
|
{
|
||||||
[self subclassResponsibility: _cmd];
|
float arr[2];
|
||||||
|
|
||||||
|
arr[0] = ax; arr[1] = ay;
|
||||||
|
[self _showString: s
|
||||||
|
xCharAdj: cx yCharAdj: cy char: c adjArray: arr arrType: show_delta
|
||||||
|
isRelative: YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) DPScharpath: (const char*)s : (int)b
|
- (void) DPScharpath: (const char*)s : (int)b
|
||||||
|
@ -380,22 +483,33 @@
|
||||||
|
|
||||||
- (void) DPSwidthshow: (float)x : (float)y : (int)c : (const char*)s
|
- (void) DPSwidthshow: (float)x : (float)y : (int)c : (const char*)s
|
||||||
{
|
{
|
||||||
[self subclassResponsibility: _cmd];
|
float arr[2];
|
||||||
|
|
||||||
|
arr[0] = 0; arr[1] = 0;
|
||||||
|
[self _showString: s
|
||||||
|
xCharAdj: x yCharAdj: y char: c adjArray: arr arrType: show_delta
|
||||||
|
isRelative: YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) DPSxshow: (const char*)s : (const float*)numarray : (int)size
|
- (void) DPSxshow: (const char*)s : (const float*)numarray : (int)size
|
||||||
{
|
{
|
||||||
[self subclassResponsibility: _cmd];
|
[self _showString: s
|
||||||
|
xCharAdj: 0 yCharAdj: 0 char: 0 adjArray: numarray arrType: show_array_x
|
||||||
|
isRelative: NO];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) DPSxyshow: (const char*)s : (const float*)numarray : (int)size
|
- (void) DPSxyshow: (const char*)s : (const float*)numarray : (int)size
|
||||||
{
|
{
|
||||||
[self subclassResponsibility: _cmd];
|
[self _showString: s
|
||||||
|
xCharAdj: 0 yCharAdj: 0 char: 0 adjArray: numarray arrType: show_array_xy
|
||||||
|
isRelative: NO];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) DPSyshow: (const char*)s : (const float*)numarray : (int)size
|
- (void) DPSyshow: (const char*)s : (const float*)numarray : (int)size
|
||||||
{
|
{
|
||||||
[self subclassResponsibility: _cmd];
|
[self _showString: s
|
||||||
|
xCharAdj: 0 yCharAdj: 0 char: 0 adjArray: numarray arrType: show_array_y
|
||||||
|
isRelative: NO];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) GSSetCharacterSpacing: (float)extra
|
- (void) GSSetCharacterSpacing: (float)extra
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
#include <AppKit/NSFont.h>
|
#include <AppKit/NSFont.h>
|
||||||
#include <AppKit/NSGraphics.h>
|
#include <AppKit/NSGraphics.h>
|
||||||
|
|
||||||
|
// Define this so we pick up AlphaBlend, when loading windows.h
|
||||||
|
#define WINVER 0x0500
|
||||||
#include "winlib/WIN32GState.h"
|
#include "winlib/WIN32GState.h"
|
||||||
#include "winlib/WIN32Context.h"
|
#include "winlib/WIN32Context.h"
|
||||||
#include "winlib/WIN32FontInfo.h"
|
#include "winlib/WIN32FontInfo.h"
|
||||||
|
@ -35,11 +37,16 @@
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
#ifndef AC_SRC_ALPHA
|
||||||
|
// Missing definitions from wingdi.h
|
||||||
|
#define AC_SRC_ALPHA 0x01
|
||||||
|
#endif
|
||||||
|
|
||||||
// There is a bug in Win32 GDI drawing with lines wider than 0
|
// There is a bug in Win32 GDI drawing with lines wider than 0
|
||||||
// before and after a bezier path forming an oblique
|
// before and after a bezier path forming an oblique
|
||||||
// angle. The solution is to insert extra MoveToEx()'s
|
// angle. The solution is to insert extra MoveToEx()'s
|
||||||
// before and after the PolyBezierTo().
|
// before and after the PolyBezierTo().
|
||||||
#define GDI_WIDELINE_BEZIERPATH_BUG 1
|
#define GDI_WIDELINE_BEZIERPATH_BUG 0
|
||||||
|
|
||||||
static inline
|
static inline
|
||||||
int WindowHeight(HWND window)
|
int WindowHeight(HWND window)
|
||||||
|
@ -167,64 +174,93 @@ RECT GSViewRectToWin(WIN32GState *s, NSRect r)
|
||||||
wscolor = RGB(color.field[0]*255, color.field[1]*255, color.field[2]*255);
|
wscolor = RGB(color.field[0]*255, color.field[1]*255, color.field[2]*255);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) copyBits: (WIN32GState*)source
|
- (void) _compositeGState: (WIN32GState *) source
|
||||||
fromRect: (NSRect)aRect
|
fromRect: (NSRect) sourceRect
|
||||||
toPoint: (NSPoint)aPoint
|
toPoint: (NSPoint) destPoint
|
||||||
|
op: (NSCompositingOperation) op
|
||||||
|
fraction: (float)delta
|
||||||
{
|
{
|
||||||
HDC otherDC;
|
HDC sourceDC;
|
||||||
HDC hDC;
|
HDC hDC;
|
||||||
RECT rect;
|
RECT rectFrom;
|
||||||
|
RECT rectTo;
|
||||||
int h;
|
int h;
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
NSRect r;
|
NSRect destRect;
|
||||||
RECT rect2;
|
BOOL success;
|
||||||
|
|
||||||
rect = GSViewRectToWin(source, aRect);
|
NSDebugLLog(@"WIN32GState", @"compositeGState: fromRect: %@ toPoint: %@ op: %d",
|
||||||
h = rect.bottom - rect.top;
|
NSStringFromRect(sourceRect), NSStringFromPoint(destPoint), op);
|
||||||
|
|
||||||
|
rectFrom = GSViewRectToWin(source, sourceRect);
|
||||||
|
h = rectFrom.bottom - rectFrom.top;
|
||||||
|
|
||||||
|
destRect.size = sourceRect.size;
|
||||||
|
destRect.origin = destPoint;
|
||||||
|
rectTo = GSViewRectToWin( self, destRect );
|
||||||
|
x = rectTo.left;
|
||||||
|
y = rectTo.top;
|
||||||
|
|
||||||
r.size = aRect.size;
|
|
||||||
r.origin = aPoint;
|
|
||||||
rect2 = GSViewRectToWin(self, r);
|
|
||||||
x = rect2.left;
|
|
||||||
y = rect2.top;
|
|
||||||
if (source->ctm->matrix.m22 < 0 && ctm->matrix.m22 > 0) y += h;
|
if (source->ctm->matrix.m22 < 0 && ctm->matrix.m22 > 0) y += h;
|
||||||
if (source->ctm->matrix.m22 > 0 && ctm->matrix.m22 < 0) y -= h;
|
if (source->ctm->matrix.m22 > 0 && ctm->matrix.m22 < 0) y -= h;
|
||||||
|
|
||||||
otherDC = [source getHDC];
|
sourceDC = [source getHDC];
|
||||||
if (!otherDC)
|
|
||||||
|
if( !sourceDC )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (self == source)
|
|
||||||
|
if( self == source )
|
||||||
{
|
{
|
||||||
hDC = otherDC;
|
hDC = sourceDC;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
hDC = [self getHDC];
|
hDC = [self getHDC];
|
||||||
if (!hDC)
|
if( !hDC )
|
||||||
{
|
{
|
||||||
[source releaseHDC: otherDC];
|
[source releaseHDC: sourceDC];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!BitBlt(hDC, x, y, (rect.right - rect.left), h,
|
switch (op)
|
||||||
otherDC, rect.left, rect.top, SRCCOPY))
|
|
||||||
{
|
{
|
||||||
NSLog(@"Copy bitmap failed %d", GetLastError());
|
case NSCompositeSourceOver:
|
||||||
NSLog(@"Orig Copy Bits to %f, %f from %@", aPoint.x, aPoint.y,
|
{
|
||||||
NSStringFromRect(aRect));
|
// Use (0..1) fraction to set a (0..255) alpha constant value
|
||||||
NSLog(@"Copy Bits to %d %d from %d %d size %d %d", x , y,
|
BYTE SourceCosntantAlpha = (BYTE)(delta * 255);
|
||||||
rect.left, rect.top, (rect.right - rect.left), h);
|
BLENDFUNCTION blendFunc = {AC_SRC_OVER, 0, SourceCosntantAlpha, AC_SRC_ALPHA};
|
||||||
|
success = AlphaBlend(hDC,
|
||||||
|
x, y, (rectFrom.right - rectFrom.left), h,
|
||||||
|
sourceDC,
|
||||||
|
rectFrom.left, rectFrom.top,
|
||||||
|
(rectFrom.right - rectFrom.left), h, blendFunc);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
success = BitBlt( hDC, x, y, (rectFrom.right - rectFrom.left), h,
|
||||||
|
sourceDC, rectFrom.left, rectFrom.top, SRCCOPY );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!success)
|
||||||
|
{
|
||||||
|
NSLog(@"Blit operation failed %d", GetLastError());
|
||||||
|
NSLog(@"Orig Copy Bits to %@ from %@", NSStringFromPoint(destPoint),
|
||||||
|
NSStringFromRect(destRect));
|
||||||
|
NSLog(@"Copy bits to {%d, %d} from {%d, %d} size {%d, %d}", x, y,
|
||||||
|
rectFrom.left, rectFrom.top, (rectFrom.right - rectFrom.left), h);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self != source)
|
if (self != source)
|
||||||
{
|
{
|
||||||
[self releaseHDC: hDC];
|
[self releaseHDC: hDC];
|
||||||
}
|
}
|
||||||
[source releaseHDC: otherDC];
|
[source releaseHDC: sourceDC];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) compositeGState: (GSGState *)source
|
- (void) compositeGState: (GSGState *)source
|
||||||
|
@ -232,8 +268,11 @@ RECT GSViewRectToWin(WIN32GState *s, NSRect r)
|
||||||
toPoint: (NSPoint)aPoint
|
toPoint: (NSPoint)aPoint
|
||||||
op: (NSCompositingOperation)op
|
op: (NSCompositingOperation)op
|
||||||
{
|
{
|
||||||
// FIXME
|
[self _compositeGState: (WIN32GState *) source
|
||||||
[self copyBits: (WIN32GState *)source fromRect: aRect toPoint: aPoint];
|
fromRect: aRect
|
||||||
|
toPoint: aPoint
|
||||||
|
op: op
|
||||||
|
fraction: 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) dissolveGState: (GSGState *)source
|
- (void) dissolveGState: (GSGState *)source
|
||||||
|
@ -241,8 +280,11 @@ RECT GSViewRectToWin(WIN32GState *s, NSRect r)
|
||||||
toPoint: (NSPoint)aPoint
|
toPoint: (NSPoint)aPoint
|
||||||
delta: (float)delta
|
delta: (float)delta
|
||||||
{
|
{
|
||||||
// FIXME
|
[self _compositeGState: (WIN32GState *) source
|
||||||
[self copyBits: (WIN32GState *)source fromRect: aRect toPoint: aPoint];
|
fromRect: aRect
|
||||||
|
toPoint: aPoint
|
||||||
|
op: NSCompositeSourceOver
|
||||||
|
fraction: delta];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) compositerect: (NSRect)aRect
|
- (void) compositerect: (NSRect)aRect
|
||||||
|
@ -432,6 +474,16 @@ HBITMAP GSCreateBitmap(HDC hDC, int pixelsWide, int pixelsHigh,
|
||||||
int h;
|
int h;
|
||||||
int y1;
|
int y1;
|
||||||
|
|
||||||
|
NSDebugLLog(@"WIN32GState", @"DPSImage : pixelsWide = %d : pixelsHigh = %d"
|
||||||
|
": bitsPerSample = %d : samplesPerPixel = %d"
|
||||||
|
": bitsPerPixel = %d : bytesPerRow = %d "
|
||||||
|
": isPlanar = %d"
|
||||||
|
": hasAlpha = %d : colorSpaceName = %@",
|
||||||
|
pixelsWide, pixelsHigh,
|
||||||
|
bitsPerSample, samplesPerPixel,
|
||||||
|
bitsPerPixel, bytesPerRow,
|
||||||
|
isPlanar, hasAlpha, colorSpaceName);
|
||||||
|
|
||||||
if (window == NULL)
|
if (window == NULL)
|
||||||
{
|
{
|
||||||
NSLog(@"No window in DPSImage");
|
NSLog(@"No window in DPSImage");
|
||||||
|
|
|
@ -1175,127 +1175,6 @@ static Region emptyRegion;
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* Text operations */
|
/* Text operations */
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
typedef enum {
|
|
||||||
show_delta, show_array_x, show_array_y, show_array_xy
|
|
||||||
} show_array_t;
|
|
||||||
|
|
||||||
/* Omnibus show string routine that combines that characteristics of
|
|
||||||
ashow, awidthshow, widthshow, xshow, xyshow, and yshow */
|
|
||||||
- (void) _showString: (const char *)s
|
|
||||||
xCharAdj: (float)cx
|
|
||||||
yCharAdj: (float)cy
|
|
||||||
char: (char)c
|
|
||||||
adjArray: (const float *)arr
|
|
||||||
arrType: (show_array_t)type
|
|
||||||
isRelative: (BOOL)relative;
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
int len;
|
|
||||||
int width;
|
|
||||||
NSSize scale;
|
|
||||||
NSPoint point = [path currentPoint];
|
|
||||||
|
|
||||||
if (font == nil)
|
|
||||||
{
|
|
||||||
NSLog(@"DPS (xgps): no font set\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
COPY_GC_ON_CHANGE;
|
|
||||||
if (draw == 0)
|
|
||||||
{
|
|
||||||
DPS_WARN(DPSinvalidid, @"No Drawable defined for show");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((cstate & COLOR_FILL) == 0)
|
|
||||||
[self setColor: &fillColor state: COLOR_FILL];
|
|
||||||
|
|
||||||
/* Use only delta transformations (no offset) */
|
|
||||||
len = strlen(s);
|
|
||||||
scale = [ctm sizeInMatrixSpace: NSMakeSize(1,1)];
|
|
||||||
for (i = 0; i < len; i++)
|
|
||||||
{
|
|
||||||
NSPoint delta;
|
|
||||||
XPoint xp;
|
|
||||||
|
|
||||||
// FIXME: We should put this line before the loop
|
|
||||||
// and do all computation in display space.
|
|
||||||
xp = XGWindowPointToX(self, point);
|
|
||||||
width = [(XGFontInfo *)font widthOf: s+i lenght: 1];
|
|
||||||
// Hack: Only draw when alpha is not zero
|
|
||||||
if (drawingAlpha == NO || fillColor.field[AINDEX] != 0.0)
|
|
||||||
[(XGFontInfo *)font draw: s+i lenght: 1
|
|
||||||
onDisplay: XDPY drawable: draw
|
|
||||||
with: xgcntxt at: xp];
|
|
||||||
|
|
||||||
if (drawingAlpha)
|
|
||||||
{
|
|
||||||
NSAssert(alpha_buffer, NSInternalInconsistencyException);
|
|
||||||
|
|
||||||
[self setAlphaColor: fillColor.field[AINDEX]];
|
|
||||||
[(XGFontInfo *)font draw: s+i lenght: 1
|
|
||||||
onDisplay: XDPY drawable: alpha_buffer
|
|
||||||
with: agcntxt at: xp];
|
|
||||||
}
|
|
||||||
/* Note we update the current point according to the current
|
|
||||||
transformation scaling, although the text isn't currently
|
|
||||||
scaled (FIXME). */
|
|
||||||
if (type == show_array_xy)
|
|
||||||
{
|
|
||||||
delta.x = arr[2*i]; delta.y = arr[2*i+1];
|
|
||||||
}
|
|
||||||
else if (type == show_array_x)
|
|
||||||
{
|
|
||||||
delta.x = arr[i]; delta.y = 0;
|
|
||||||
}
|
|
||||||
else if (type == show_array_y)
|
|
||||||
{
|
|
||||||
delta.x = 0; delta.y = arr[i];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
delta.x = arr[0]; delta.y = arr[1];
|
|
||||||
}
|
|
||||||
delta = [ctm deltaPointInMatrixSpace: delta];
|
|
||||||
if (relative == YES)
|
|
||||||
{
|
|
||||||
delta.x += width * scale.width;
|
|
||||||
delta.y += [font ascender] * scale.height;
|
|
||||||
}
|
|
||||||
if (c && *(s+i) == c)
|
|
||||||
{
|
|
||||||
NSPoint cdelta;
|
|
||||||
cdelta.x = cx; cdelta.y = cy;
|
|
||||||
cdelta = [ctm deltaPointInMatrixSpace: cdelta];
|
|
||||||
delta.x += cdelta.x; delta.y += cdelta.y;
|
|
||||||
}
|
|
||||||
point.x += delta.x;
|
|
||||||
if (type != show_delta)
|
|
||||||
point.y += delta.y;
|
|
||||||
}
|
|
||||||
// FIXME: Should we set the current point now?
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)DPSashow: (float)x : (float)y : (const char *)s
|
|
||||||
{
|
|
||||||
float arr[2];
|
|
||||||
|
|
||||||
arr[0] = x; arr[1] = y;
|
|
||||||
[self _showString: s
|
|
||||||
xCharAdj: 0 yCharAdj: 0 char: 0 adjArray: arr arrType: show_delta
|
|
||||||
isRelative: YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)DPSawidthshow: (float)cx : (float)cy : (int)c : (float)ax : (float)ay : (const char *)s
|
|
||||||
{
|
|
||||||
float arr[2];
|
|
||||||
|
|
||||||
arr[0] = ax; arr[1] = ay;
|
|
||||||
[self _showString: s
|
|
||||||
xCharAdj: cx yCharAdj: cy char: c adjArray: arr arrType: show_delta
|
|
||||||
isRelative: YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)DPSshow: (const char *)s
|
- (void)DPSshow: (const char *)s
|
||||||
{
|
{
|
||||||
|
@ -1346,7 +1225,6 @@ typedef enum {
|
||||||
[path relativeMoveToPoint: NSMakePoint(width * scale.width, 0)];
|
[path relativeMoveToPoint: NSMakePoint(width * scale.width, 0)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (void) GSShowGlyphs: (const NSGlyph *)glyphs : (size_t) length
|
- (void) GSShowGlyphs: (const NSGlyph *)glyphs : (size_t) length
|
||||||
{
|
{
|
||||||
int width;
|
int width;
|
||||||
|
@ -1394,37 +1272,6 @@ typedef enum {
|
||||||
[path relativeMoveToPoint: NSMakePoint(width * scale.width, 0)];
|
[path relativeMoveToPoint: NSMakePoint(width * scale.width, 0)];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)DPSwidthshow: (float)x : (float)y : (int)c : (const char *)s
|
|
||||||
{
|
|
||||||
float arr[2];
|
|
||||||
|
|
||||||
arr[0] = 0; arr[1] = 0;
|
|
||||||
[self _showString: s
|
|
||||||
xCharAdj: x yCharAdj: y char: c adjArray: arr arrType: show_delta
|
|
||||||
isRelative: YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)DPSxshow: (const char *)s : (const float *)numarray : (int)size
|
|
||||||
{
|
|
||||||
[self _showString: s
|
|
||||||
xCharAdj: 0 yCharAdj: 0 char: 0 adjArray: numarray arrType: show_array_x
|
|
||||||
isRelative: NO];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)DPSxyshow: (const char *)s : (const float *)numarray : (int)size
|
|
||||||
{
|
|
||||||
[self _showString: s
|
|
||||||
xCharAdj: 0 yCharAdj: 0 char: 0 adjArray: numarray arrType: show_array_xy
|
|
||||||
isRelative: NO];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)DPSyshow: (const char *)s : (const float *)numarray : (int)size
|
|
||||||
{
|
|
||||||
[self _showString: s
|
|
||||||
xCharAdj: 0 yCharAdj: 0 char: 0 adjArray: numarray arrType: show_array_y
|
|
||||||
isRelative: NO];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void) GSSetFont: (GSFontInfo *)newFont
|
- (void) GSSetFont: (GSFontInfo *)newFont
|
||||||
{
|
{
|
||||||
if (font == newFont)
|
if (font == newFont)
|
||||||
|
|
|
@ -255,6 +255,10 @@ AC_CHECK_LIB(gdi32, main, have_gdi32=yes, have_gdi32=no)
|
||||||
if test "$have_gdi32" = yes; then
|
if test "$have_gdi32" = yes; then
|
||||||
WIN32_LIBS="-lgdi32"
|
WIN32_LIBS="-lgdi32"
|
||||||
fi
|
fi
|
||||||
|
AC_CHECK_LIB(msimg32, main, have_msimg32=yes, have_msimg32=no)
|
||||||
|
if test "$have_msimg32" = yes; then
|
||||||
|
WIN32_LIBS="${WIN32_LIBS} -lmsimg32"
|
||||||
|
fi
|
||||||
CPPFLAGS="${save_header}"
|
CPPFLAGS="${save_header}"
|
||||||
LIBS="${save_libs}"
|
LIBS="${save_libs}"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue