diff options
author | Rüdiger Timm <rt@openoffice.org> | 2004-11-26 16:06:24 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2004-11-26 16:06:24 +0000 |
commit | 8acc91b68e1666c17133d98606501b7a48e24a50 (patch) | |
tree | c1e85e45e7b83e66f657123adbf76b52906c1413 /canvas/source | |
parent | 01c8733855383c1c22b6e42e8761167e90e2820b (diff) |
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED
2004/09/08 16:34:44 dbo 1.2.2.5: #110496# separate service names for all kinds of canvas implementations
Issue number:
Submitted by:
Reviewed by:
2004/08/27 18:46:04 thb 1.2.2.4: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics
2004/07/28 10:44:58 thb 1.2.2.3: #110496# Brought javacanvas to comply with recent API changes
2004/04/12 15:12:22 thb 1.2.2.2: #110496# Adaptions after canvas01 merge
2004/04/05 15:57:55 thb 1.2.2.1: Resync with canvas01 changes
Diffstat (limited to 'canvas/source')
-rw-r--r-- | canvas/source/java/JavaCanvas.java | 126 |
1 files changed, 108 insertions, 18 deletions
diff --git a/canvas/source/java/JavaCanvas.java b/canvas/source/java/JavaCanvas.java index a556b457a4af..d519c8541bbc 100644 --- a/canvas/source/java/JavaCanvas.java +++ b/canvas/source/java/JavaCanvas.java @@ -83,15 +83,17 @@ public class JavaCanvas extends CanvasBase implements com.sun.star.awt.XWindow, drafts.com.sun.star.rendering.XSpriteCanvas, + drafts.com.sun.star.rendering.XIntegerBitmap, com.sun.star.lang.XServiceInfo, com.sun.star.lang.XInitialization { private WindowAdapter dummyFrame; - private BackBuffer backBuffer; + public BackBuffer backBuffer; private java.awt.image.BufferStrategy bufferStrategy; private java.awt.Font fpsFont; private long lastTime; + private com.sun.star.awt.Rectangle boundRect; public Graphics2D getGraphics() { @@ -121,20 +123,20 @@ public class JavaCanvas CanvasUtils.printLog( "System detected: " + os ); // tweak some speed knobs... - if( os.startsWith("Windows") ) - { - System.setProperty("sun.java2d.translaccel", "true"); - System.setProperty("sun.java2d.ddforcevram", "true"); - //System.setProperty("sun.java2d.accthreshold", "0"); +// if( os.startsWith("Windows") ) +// { +// System.setProperty("sun.java2d.translaccel", "true"); +// System.setProperty("sun.java2d.ddforcevram", "true"); +// //System.setProperty("sun.java2d.accthreshold", "0"); - CanvasUtils.printLog( "Optimizing for Windows" ); - } - else - { - System.setProperty("sun.java2d.opengl", "true"); +// CanvasUtils.printLog( "Optimizing for Windows" ); +// } +// else +// { +// System.setProperty("sun.java2d.opengl", "true"); - CanvasUtils.printLog( "Optimizing for Unix" ); - } +// CanvasUtils.printLog( "Optimizing for Unix" ); +// } /* we're initialized with the following array of anys: @@ -148,7 +150,7 @@ public class JavaCanvas */ try { - com.sun.star.awt.Rectangle boundRect = (com.sun.star.awt.Rectangle) arguments[2]; + boundRect = (com.sun.star.awt.Rectangle) arguments[2]; //boolean isFullScreen = arguments[1]; boolean isFullScreen = true; @@ -427,7 +429,7 @@ public class JavaCanvas } public synchronized XAnimatedSprite createSpriteFromBitmaps( drafts.com.sun.star.rendering.XBitmap[] animationBitmaps, - short interpolationMode ) + byte interpolationMode ) { return null; } @@ -444,13 +446,101 @@ public class JavaCanvas return new CanvasClonedSprite( this, original ); } - public synchronized boolean updateScreen() + public synchronized boolean updateScreen( boolean bUpdateAll ) { redrawAllLayers(); return true; } + // + // XBitmap implementation + // ====================== + // + + public synchronized IntegerSize2D getSize() + { + return new IntegerSize2D( boundRect.Width, + boundRect.Height ); + } + + //---------------------------------------------------------------------------------- + + public synchronized XBitmapCanvas queryBitmapCanvas() + { + return this; + } + + //---------------------------------------------------------------------------------- + + public synchronized drafts.com.sun.star.rendering.XBitmap getScaledBitmap( RealSize2D newSize, boolean beFast ) throws com.sun.star.lang.IllegalArgumentException, VolatileContentDestroyedException + { + // TODO + return null; + } + + //---------------------------------------------------------------------------------- + + // + // XIntegerBitmap implementation + // ============================= + // + + public synchronized byte[] getData( IntegerRectangle2D rect ) + { + // TODO + return null; + } + + //---------------------------------------------------------------------------------- + + public synchronized void setData( byte[] data, IntegerBitmapLayout bitmapLayout, drafts.com.sun.star.geometry.IntegerRectangle2D rect ) + { + // TODO + } + + //---------------------------------------------------------------------------------- + + public synchronized void setPixel( byte[] color, IntegerBitmapLayout bitmapLayout, drafts.com.sun.star.geometry.IntegerPoint2D pos ) + { + // TODO + } + + //---------------------------------------------------------------------------------- + + public synchronized byte[] getPixel( IntegerPoint2D pos ) + { + // TODO + return null; + } + + //---------------------------------------------------------------------------------- + + public synchronized XBitmapPalette getPalette() + { + // TODO + return null; + } + + //---------------------------------------------------------------------------------- + + public synchronized IntegerBitmapLayout getMemoryLayout() + { + // TODO: finish that one + IntegerBitmapLayout layout = new IntegerBitmapLayout(); + + layout.ScanLines = boundRect.Width; + layout.ScanLineBytes = boundRect.Width*4; + layout.ScanLineStride = layout.ScanLineBytes; + layout.Format = 0; + layout.NumComponents = 4; + layout.ComponentMasks = null; + layout.Endianness = 0; + layout.IsPseudoColor = false; + + return layout; + } + //---------------------------------------------------------------------------------- // @@ -533,7 +623,7 @@ public class JavaCanvas CanvasUtils.printLog( "Available vram: " + device.getAvailableAcceleratedMemory() ); // repaint background - //backBuffer.redraw( graph ); + backBuffer.redraw( graph ); // repaint all active sprites java.util.Set entries = activeSprites.entrySet(); @@ -579,7 +669,7 @@ public class JavaCanvas //---------------------------------------------------------------------------------- private static final String s_implName = "XCanvas.java.impl"; - private static final String s_serviceName = "drafts.com.sun.star.rendering.Canvas"; + private static final String s_serviceName = "drafts.com.sun.star.rendering.JavaCanvas"; //---------------------------------------------------------------------------------- |