* Source/cairo/CairoPDFSurface.m:

* Source/cairo/CairoContext.m:
* Source/cairo/CairoSurface.m:
* Source/cairo/CairoPSSurface.m:
* Headers/cairo/CairoSurface.h: Add a -isDrawingToScreen method
to CairoSurface. Returns NO for PDF/PS surfaces, yes for others.
Use it to implement -[CairoContext isDrawingToScreen], so that
-[NSGraphicsContext isDrawingToScreen] will return the correct
value.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@35610 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Eric Wasylishen 2012-09-26 19:09:19 +00:00
parent ccde063b3e
commit 8018242a9c
6 changed files with 36 additions and 0 deletions

View file

@ -1,3 +1,15 @@
2012-09-26 Eric Wasylishen <ewasylishen@gmail.com>
* Source/cairo/CairoPDFSurface.m:
* Source/cairo/CairoContext.m:
* Source/cairo/CairoSurface.m:
* Source/cairo/CairoPSSurface.m:
* Headers/cairo/CairoSurface.h: Add a -isDrawingToScreen method
to CairoSurface. Returns NO for PDF/PS surfaces, yes for others.
Use it to implement -[CairoContext isDrawingToScreen], so that
-[NSGraphicsContext isDrawingToScreen] will return the correct
value.
2012-09-21 Wolfgang Lux <wolfgang.lux@gmail.com> 2012-09-21 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/x11/XGServerWindow.m (-imagecursor:::): Fix Xcursor * Source/x11/XGServerWindow.m (-imagecursor:::): Fix Xcursor

View file

@ -44,6 +44,8 @@
- (void) handleExposeRect: (NSRect)rect; - (void) handleExposeRect: (NSRect)rect;
- (BOOL) isDrawingToScreen;
@end @end
#endif #endif

View file

@ -105,6 +105,13 @@
return YES; return YES;
} }
- (BOOL) isDrawingToScreen
{
CairoSurface *surface = nil;
[CGSTATE GSCurrentSurface: &surface : NULL : NULL];
return [surface isDrawingToScreen];
}
- (void) flushGraphics - (void) flushGraphics
{ {
// FIXME: Why is this here? When is it called? // FIXME: Why is this here? When is it called?

View file

@ -62,4 +62,9 @@
{ {
} }
- (BOOL) isDrawingToScreen
{
return NO;
}
@end @end

View file

@ -62,4 +62,9 @@
cairo_ps_surface_dsc_comment(_surface, [comment UTF8String]); cairo_ps_surface_dsc_comment(_surface, [comment UTF8String]);
} }
- (BOOL) isDrawingToScreen
{
return NO;
}
@end @end

View file

@ -69,4 +69,9 @@
{ {
} }
- (BOOL) isDrawingToScreen
{
return YES;
}
@end @end