From f4a23121d852c0f36598c9d16d0a59de03239a3a Mon Sep 17 00:00:00 2001 From: Fred Kiefer Date: Mon, 23 Aug 2004 12:28:16 +0000 Subject: [PATCH] Small cleanup of cairo backend. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@19902 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 10 ++++++++++ Source/cairo/CairoContext.m | 10 ---------- Source/cairo/CairoGState.m | 30 +++++++++++++++++++----------- Source/gsc/GSGState.m | 8 -------- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index 40f0017..e57ee30 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2004-08-23 Fred Kiefer + + * Source/cairo/CairoContext.m (-DPScurrentalpha:, + -DPSsetoffset::): Removed methods. + * Source/cairo/CairoGState.m (-offset, -setoffset:): Added methods. + (-forwardInvocation:): Improved output. + (-GSSetDevice:::) Commented out NSLog calls. + * Source/gsc/GSGState.m (-_showString:lenght:): Removed this + method which was a left over from last patch. + 2004-08-09 14:38 Alexander Malmberg * Source/win32/WIN32Server.m, Source/win32/WIN32ServerEvent.m, diff --git a/Source/cairo/CairoContext.m b/Source/cairo/CairoContext.m index b97e1b1..7360e93 100644 --- a/Source/cairo/CairoContext.m +++ b/Source/cairo/CairoContext.m @@ -104,11 +104,6 @@ return self; } -- (void) DPSsetoffset: (short int)x : (short int)y -{ - XRGSTATE->_offset = NSMakePoint(x, y); -} - - (void) flushGraphics { /* FIXME */ @@ -145,9 +140,4 @@ [XRGSTATE GSSetDevice: device : x : y]; } -- (void) DPScurrentalpha: (float *)a -{ - *a = cairo_current_alpha(XRGSTATE->_ct); -} - @end diff --git a/Source/cairo/CairoGState.m b/Source/cairo/CairoGState.m index fc56065..a75e3df 100644 --- a/Source/cairo/CairoGState.m +++ b/Source/cairo/CairoGState.m @@ -31,7 +31,6 @@ #define NEEDS_CSMK() NSLog(@"Need CSMK %@ %s", [self description], sel_get_name(_cmd)) #define FIXME() NSLog(@":::FIXME::: %@ %s", [self description], sel_get_name(_cmd)) - static cairo_matrix_t *local_matrix; /* Be warned that CairoGState didn't derived GSGState */ @@ -39,13 +38,16 @@ static cairo_matrix_t *local_matrix; + (void) initialize { - local_matrix = cairo_matrix_create(); + if (self == [CairoGState class]) + { + local_matrix = cairo_matrix_create(); + } } - (void) forwardInvocation: (NSInvocation *)anInvocation { /* only for trapping any unknown message. */ - FIXME(); + NSLog (@":::UNKNOWN::: %@ %@", self, anInvocation); exit(1); } @@ -106,6 +108,16 @@ _flipCairoSurfaceMatrix(cairo_t *ct, CairoSurface *surface) cairo_set_matrix(ct, local_matrix); } +- (void) setOffset: (NSPoint)theOffset +{ + _offset = theOffset; +} + +- (NSPoint) offset +{ + return _offset; +} + - (void) GSCurrentDevice: (void **)device: (int *)x : (int *)y { if (x) @@ -133,22 +145,18 @@ _flipCairoSurfaceMatrix(cairo_t *ct, CairoSurface *surface) ASSIGN(_surface, [CairoSurface surfaceForDevice: device depthInfo: &cairo_info]); _offset = NSMakePoint(x, y); +/* NSLog(@"before: surface %p on state %p", cairo_current_target_surface(_ct), self); +*/ [_surface setAsTargetOfCairo: _ct]; _flipCairoSurfaceMatrix(_ct, _surface); +/* NSLog(@"after: surface %p on state %p %@", cairo_current_target_surface (_ct), self, NSStringFromSize([_surface size])); -} - -/* This shall be invoked by Context */ -/* --(void) _setSurface: (CairoSurface *)surface -{ - ASSIGN(_surface, surface); -} */ +} @end diff --git a/Source/gsc/GSGState.m b/Source/gsc/GSGState.m index 03d4798..cf731c9 100644 --- a/Source/gsc/GSGState.m +++ b/Source/gsc/GSGState.m @@ -358,14 +358,6 @@ /* ----------------------------------------------------------------------- */ /* Text operations */ /* ----------------------------------------------------------------------- */ -/* 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]; - return 0.0; -} typedef enum { show_delta, show_array_x, show_array_y, show_array_xy