first commit
This commit is contained in:
commit
cf97b64877
27585 changed files with 3281780 additions and 0 deletions
5
rus/WEB-INF/lib/wmf2svg-0.9.0_src/META-INF/MANIFEST.MF
Normal file
5
rus/WEB-INF/lib/wmf2svg-0.9.0_src/META-INF/MANIFEST.MF
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
Manifest-Version: 1.0
|
||||
Ant-Version: Apache Ant 1.8.2
|
||||
Created-By: 1.6.0_23-b05 (Sun Microsystems Inc.)
|
||||
Main-Class: net.arnx.wmf2svg.Main
|
||||
|
||||
152
rus/WEB-INF/lib/wmf2svg-0.9.0_src/net/arnx/wmf2svg/Main.java
Normal file
152
rus/WEB-INF/lib/wmf2svg-0.9.0_src/net/arnx/wmf2svg/Main.java
Normal file
|
|
@ -0,0 +1,152 @@
|
|||
package net.arnx.wmf2svg;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.lang.reflect.InvocationHandler;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Proxy;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
import net.arnx.wmf2svg.gdi.Gdi;
|
||||
import net.arnx.wmf2svg.gdi.svg.SvgGdi;
|
||||
import net.arnx.wmf2svg.gdi.wmf.WmfParser;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
public class Main {
|
||||
private static Logger log = Logger.getLogger(Main.class.getName());
|
||||
|
||||
public static void main(String[] paramArrayOfString) {
|
||||
String str1 = null;
|
||||
String str2 = null;
|
||||
boolean bool1 = false;
|
||||
boolean bool2 = false;
|
||||
for (int i = 0; i < paramArrayOfString.length; i++) {
|
||||
if (paramArrayOfString[i].startsWith("-")) {
|
||||
if (paramArrayOfString[i].equals("-debug")) {
|
||||
bool1 = true;
|
||||
} else if (paramArrayOfString[i].equals("-compatible")) {
|
||||
bool2 = true;
|
||||
} else {
|
||||
usage();
|
||||
return;
|
||||
}
|
||||
} else if (i == paramArrayOfString.length - 2) {
|
||||
str1 = paramArrayOfString[i];
|
||||
} else if (i == paramArrayOfString.length - 1) {
|
||||
str2 = paramArrayOfString[i];
|
||||
}
|
||||
}
|
||||
if (str1 == null || str2 == null) {
|
||||
usage();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
GZIPOutputStream gZIPOutputStream;
|
||||
FileInputStream fileInputStream = new FileInputStream(str1);
|
||||
WmfParser wmfParser = new WmfParser();
|
||||
final SvgGdi gdi = new SvgGdi(bool2);
|
||||
if (bool1) {
|
||||
ClassLoader classLoader = gdi.getClass().getClassLoader();
|
||||
Class[] arrayOfClass = new Class[] { Gdi.class };
|
||||
wmfParser.parse(fileInputStream, (Gdi)Proxy.newProxyInstance(classLoader, arrayOfClass, new InvocationHandler() {
|
||||
StringBuffer sb = new StringBuffer(1000);
|
||||
|
||||
public Object invoke(Object param1Object, Method param1Method, Object[] param1ArrayOfObject) throws Throwable {
|
||||
this.sb.setLength(0);
|
||||
this.sb.append(param1Method.getName()).append("(");
|
||||
if (param1ArrayOfObject != null)
|
||||
for (int i = 0; i < param1ArrayOfObject.length; i++) {
|
||||
if (i > 0)
|
||||
this.sb.append(", ");
|
||||
if (param1ArrayOfObject[i] instanceof int[]) {
|
||||
int[] arrayOfInt = (int[])param1ArrayOfObject[i];
|
||||
this.sb.append("[");
|
||||
for (int j = 0; j < arrayOfInt.length; j++) {
|
||||
if (j > 0)
|
||||
this.sb.append(", ");
|
||||
this.sb.append(arrayOfInt[j]);
|
||||
}
|
||||
this.sb.append("]");
|
||||
} else if (param1ArrayOfObject[i] instanceof byte[]) {
|
||||
byte[] arrayOfByte = (byte[])param1ArrayOfObject[i];
|
||||
if (param1Method.getName().equals("extTextOut") && i == 4) {
|
||||
this.sb.append('"');
|
||||
this.sb.append(new String(arrayOfByte, System.getProperty("file.encoding")));
|
||||
this.sb.append('"');
|
||||
} else {
|
||||
this.sb.append("[");
|
||||
for (int j = 0; j < arrayOfByte.length; j++) {
|
||||
if (j > 0)
|
||||
this.sb.append(", ");
|
||||
this.sb.append(Integer.toHexString(arrayOfByte[j]));
|
||||
}
|
||||
this.sb.append("]");
|
||||
}
|
||||
} else if (param1ArrayOfObject[i] instanceof double[]) {
|
||||
double[] arrayOfDouble = (double[])param1ArrayOfObject[i];
|
||||
this.sb.append("[");
|
||||
for (int j = 0; j < arrayOfDouble.length; j++) {
|
||||
if (j > 0)
|
||||
this.sb.append(", ");
|
||||
this.sb.append(arrayOfDouble[j]);
|
||||
}
|
||||
this.sb.append("]");
|
||||
} else if (param1ArrayOfObject[i] instanceof Object[]) {
|
||||
Object[] arrayOfObject = (Object[])param1ArrayOfObject[i];
|
||||
this.sb.append("[");
|
||||
for (int j = 0; j < arrayOfObject.length; j++) {
|
||||
if (j > 0)
|
||||
this.sb.append(", ");
|
||||
this.sb.append(arrayOfObject[j]);
|
||||
}
|
||||
this.sb.append("]");
|
||||
} else {
|
||||
this.sb.append(param1ArrayOfObject[i]);
|
||||
}
|
||||
}
|
||||
this.sb.append(")");
|
||||
Main.log.fine(this.sb.toString());
|
||||
try {
|
||||
return param1Method.invoke(gdi, param1ArrayOfObject);
|
||||
} catch (InvocationTargetException e) {
|
||||
throw e.getTargetException();
|
||||
}
|
||||
}
|
||||
}));
|
||||
} else {
|
||||
wmfParser.parse(fileInputStream, gdi);
|
||||
}
|
||||
Document document = gdi.getDocument();
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(str2);
|
||||
if (paramArrayOfString[1].endsWith(".svgz"))
|
||||
gZIPOutputStream = new GZIPOutputStream(fileOutputStream);
|
||||
output(document, gZIPOutputStream);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private static void output(Document paramDocument, OutputStream paramOutputStream) throws Exception {
|
||||
TransformerFactory transformerFactory = TransformerFactory.newInstance();
|
||||
Transformer transformer = transformerFactory.newTransformer();
|
||||
transformer.setOutputProperty("method", "xml");
|
||||
transformer.setOutputProperty("encoding", "UTF-8");
|
||||
transformer.setOutputProperty("indent", "yes");
|
||||
transformer.setOutputProperty("doctype-public", "-//W3C//DTD SVG 1.0//EN");
|
||||
transformer.setOutputProperty("doctype-system", "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd");
|
||||
transformer.transform(new DOMSource(paramDocument), new StreamResult(paramOutputStream));
|
||||
paramOutputStream.flush();
|
||||
paramOutputStream.close();
|
||||
}
|
||||
|
||||
private static void usage() {
|
||||
System.out.println("java -jar wmf2svg.jar [wmf filename] [svg filename(svg, xml, or .svgz)]");
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
301
rus/WEB-INF/lib/wmf2svg-0.9.0_src/net/arnx/wmf2svg/gdi/Gdi.java
Normal file
301
rus/WEB-INF/lib/wmf2svg-0.9.0_src/net/arnx/wmf2svg/gdi/Gdi.java
Normal file
|
|
@ -0,0 +1,301 @@
|
|||
package net.arnx.wmf2svg.gdi;
|
||||
|
||||
public interface Gdi {
|
||||
public static final int OPAQUE = 2;
|
||||
|
||||
public static final int TRANSPARENT = 1;
|
||||
|
||||
public static final int TA_BASELINE = 24;
|
||||
|
||||
public static final int TA_BOTTOM = 8;
|
||||
|
||||
public static final int TA_TOP = 0;
|
||||
|
||||
public static final int TA_CENTER = 6;
|
||||
|
||||
public static final int TA_LEFT = 0;
|
||||
|
||||
public static final int TA_RIGHT = 2;
|
||||
|
||||
public static final int TA_NOUPDATECP = 0;
|
||||
|
||||
public static final int TA_RTLREADING = 256;
|
||||
|
||||
public static final int TA_UPDATECP = 1;
|
||||
|
||||
public static final int VTA_BASELINE = 24;
|
||||
|
||||
public static final int VTA_CENTER = 6;
|
||||
|
||||
public static final int ETO_CLIPPED = 4;
|
||||
|
||||
public static final int ETO_NUMERICSLOCAL = 1024;
|
||||
|
||||
public static final int ETO_NUMERICSLATIN = 2048;
|
||||
|
||||
public static final int ETO_GLYPH_INDEX = 16;
|
||||
|
||||
public static final int ETO_OPAQUE = 2;
|
||||
|
||||
public static final int ETO_PDY = 8192;
|
||||
|
||||
public static final int ETO_RTLREADING = 128;
|
||||
|
||||
public static final int ETO_IGNORELANGUAGE = 4096;
|
||||
|
||||
public static final int MM_ANISOTROPIC = 8;
|
||||
|
||||
public static final int MM_HIENGLISH = 5;
|
||||
|
||||
public static final int MM_HIMETRIC = 3;
|
||||
|
||||
public static final int MM_ISOTROPIC = 7;
|
||||
|
||||
public static final int MM_LOENGLISH = 4;
|
||||
|
||||
public static final int MM_LOMETRIC = 2;
|
||||
|
||||
public static final int MM_TEXT = 1;
|
||||
|
||||
public static final int MM_TWIPS = 6;
|
||||
|
||||
public static final int STRETCH_ANDSCANS = 2;
|
||||
|
||||
public static final int STRETCH_DELETESCANS = 3;
|
||||
|
||||
public static final int STRETCH_HALFTONE = 4;
|
||||
|
||||
public static final int STRETCH_ORSCANS = 2;
|
||||
|
||||
public static final int BLACKONWHITE = 2;
|
||||
|
||||
public static final int COLORONCOLOR = 3;
|
||||
|
||||
public static final int HALFTONE = 4;
|
||||
|
||||
public static final int WHITEONBLACK = 2;
|
||||
|
||||
public static final int ALTERNATE = 1;
|
||||
|
||||
public static final int WINDING = 2;
|
||||
|
||||
public static final int R2_BLACK = 1;
|
||||
|
||||
public static final int R2_COPYPEN = 13;
|
||||
|
||||
public static final int R2_MASKNOTPEN = 3;
|
||||
|
||||
public static final int R2_MASKPEN = 9;
|
||||
|
||||
public static final int R2_MASKPENNOT = 5;
|
||||
|
||||
public static final int R2_MERGENOTPEN = 12;
|
||||
|
||||
public static final int R2_MERGEPEN = 15;
|
||||
|
||||
public static final int R2_MERGEPENNOT = 14;
|
||||
|
||||
public static final int R2_NOP = 11;
|
||||
|
||||
public static final int R2_NOT = 6;
|
||||
|
||||
public static final int R2_NOTCOPYPEN = 4;
|
||||
|
||||
public static final int R2_NOTMASKPEN = 8;
|
||||
|
||||
public static final int R2_NOTMERGEPEN = 2;
|
||||
|
||||
public static final int R2_NOTXORPEN = 10;
|
||||
|
||||
public static final int R2_WHITE = 16;
|
||||
|
||||
public static final int R2_XORPEN = 7;
|
||||
|
||||
public static final long BLACKNESS = 66L;
|
||||
|
||||
public static final long DSTINVERT = 5570569L;
|
||||
|
||||
public static final long MERGECOPY = 12583114L;
|
||||
|
||||
public static final long MERGEPAINT = 12255782L;
|
||||
|
||||
public static final long NOTSRCCOPY = 3342344L;
|
||||
|
||||
public static final long NOTSRCERASE = 1114278L;
|
||||
|
||||
public static final long PATCOPY = 15728673L;
|
||||
|
||||
public static final long PATINVERT = 5898313L;
|
||||
|
||||
public static final long PATPAINT = 16452105L;
|
||||
|
||||
public static final long SRCAND = 8913094L;
|
||||
|
||||
public static final long SRCCOPY = 13369376L;
|
||||
|
||||
public static final long SRCERASE = 4457256L;
|
||||
|
||||
public static final long SRCINVERT = 6684742L;
|
||||
|
||||
public static final long SRCPAINT = 15597702L;
|
||||
|
||||
public static final long WHITENESS = 16711778L;
|
||||
|
||||
public static final int DIB_RGB_COLORS = 0;
|
||||
|
||||
public static final int DIB_PAL_COLORS = 1;
|
||||
|
||||
public static final int LAYOUT_BITMAPORIENTATIONPRESERVED = 8;
|
||||
|
||||
public static final int LAYOUT_RTL = 1;
|
||||
|
||||
public static final int ABSOLUTE = 1;
|
||||
|
||||
public static final int RELATIVE = 2;
|
||||
|
||||
public static final int ASPECT_FILTERING = 1;
|
||||
|
||||
void placeableHeader(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5);
|
||||
|
||||
void header();
|
||||
|
||||
void animatePalette(GdiPalette paramGdiPalette, int paramInt, int[] paramArrayOfint);
|
||||
|
||||
void arc(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8);
|
||||
|
||||
void bitBlt(byte[] paramArrayOfbyte, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, long paramLong);
|
||||
|
||||
void chord(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8);
|
||||
|
||||
GdiBrush createBrushIndirect(int paramInt1, int paramInt2, int paramInt3);
|
||||
|
||||
GdiFont createFontIndirect(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3, int paramInt6, int paramInt7, int paramInt8, int paramInt9, int paramInt10, byte[] paramArrayOfbyte);
|
||||
|
||||
GdiPalette createPalette(int paramInt, int[] paramArrayOfint);
|
||||
|
||||
GdiPatternBrush createPatternBrush(byte[] paramArrayOfbyte);
|
||||
|
||||
GdiPen createPenIndirect(int paramInt1, int paramInt2, int paramInt3);
|
||||
|
||||
GdiRegion createRectRgn(int paramInt1, int paramInt2, int paramInt3, int paramInt4);
|
||||
|
||||
void deleteObject(GdiObject paramGdiObject);
|
||||
|
||||
void dibBitBlt(byte[] paramArrayOfbyte, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, long paramLong);
|
||||
|
||||
GdiPatternBrush dibCreatePatternBrush(byte[] paramArrayOfbyte, int paramInt);
|
||||
|
||||
void dibStretchBlt(byte[] paramArrayOfbyte, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8, long paramLong);
|
||||
|
||||
void ellipse(int paramInt1, int paramInt2, int paramInt3, int paramInt4);
|
||||
|
||||
void escape(byte[] paramArrayOfbyte);
|
||||
|
||||
int excludeClipRect(int paramInt1, int paramInt2, int paramInt3, int paramInt4);
|
||||
|
||||
void extFloodFill(int paramInt1, int paramInt2, int paramInt3, int paramInt4);
|
||||
|
||||
void extTextOut(int paramInt1, int paramInt2, int paramInt3, int[] paramArrayOfint1, byte[] paramArrayOfbyte, int[] paramArrayOfint2);
|
||||
|
||||
void fillRgn(GdiRegion paramGdiRegion, GdiBrush paramGdiBrush);
|
||||
|
||||
void floodFill(int paramInt1, int paramInt2, int paramInt3);
|
||||
|
||||
void frameRgn(GdiRegion paramGdiRegion, GdiBrush paramGdiBrush, int paramInt1, int paramInt2);
|
||||
|
||||
void intersectClipRect(int paramInt1, int paramInt2, int paramInt3, int paramInt4);
|
||||
|
||||
void invertRgn(GdiRegion paramGdiRegion);
|
||||
|
||||
void lineTo(int paramInt1, int paramInt2);
|
||||
|
||||
void moveToEx(int paramInt1, int paramInt2, Point paramPoint);
|
||||
|
||||
void offsetClipRgn(int paramInt1, int paramInt2);
|
||||
|
||||
void offsetViewportOrgEx(int paramInt1, int paramInt2, Point paramPoint);
|
||||
|
||||
void offsetWindowOrgEx(int paramInt1, int paramInt2, Point paramPoint);
|
||||
|
||||
void paintRgn(GdiRegion paramGdiRegion);
|
||||
|
||||
void patBlt(int paramInt1, int paramInt2, int paramInt3, int paramInt4, long paramLong);
|
||||
|
||||
void pie(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8);
|
||||
|
||||
void polygon(Point[] paramArrayOfPoint);
|
||||
|
||||
void polyline(Point[] paramArrayOfPoint);
|
||||
|
||||
void polyPolygon(Point[][] paramArrayOfPoint);
|
||||
|
||||
void realizePalette();
|
||||
|
||||
void restoreDC(int paramInt);
|
||||
|
||||
void rectangle(int paramInt1, int paramInt2, int paramInt3, int paramInt4);
|
||||
|
||||
void resizePalette(GdiPalette paramGdiPalette);
|
||||
|
||||
void roundRect(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6);
|
||||
|
||||
void seveDC();
|
||||
|
||||
void scaleViewportExtEx(int paramInt1, int paramInt2, int paramInt3, int paramInt4, Size paramSize);
|
||||
|
||||
void scaleWindowExtEx(int paramInt1, int paramInt2, int paramInt3, int paramInt4, Size paramSize);
|
||||
|
||||
void selectClipRgn(GdiRegion paramGdiRegion);
|
||||
|
||||
void selectObject(GdiObject paramGdiObject);
|
||||
|
||||
void selectPalette(GdiPalette paramGdiPalette, boolean paramBoolean);
|
||||
|
||||
void setBkColor(int paramInt);
|
||||
|
||||
void setBkMode(int paramInt);
|
||||
|
||||
void setDIBitsToDevice(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8, byte[] paramArrayOfbyte, int paramInt9);
|
||||
|
||||
void setLayout(long paramLong);
|
||||
|
||||
void setMapMode(int paramInt);
|
||||
|
||||
void setMapperFlags(long paramLong);
|
||||
|
||||
void setPaletteEntries(GdiPalette paramGdiPalette, int paramInt, int[] paramArrayOfint);
|
||||
|
||||
void setPixel(int paramInt1, int paramInt2, int paramInt3);
|
||||
|
||||
void setPolyFillMode(int paramInt);
|
||||
|
||||
void setRelAbs(int paramInt);
|
||||
|
||||
void setROP2(int paramInt);
|
||||
|
||||
void setStretchBltMode(int paramInt);
|
||||
|
||||
void setTextAlign(int paramInt);
|
||||
|
||||
void setTextCharacterExtra(int paramInt);
|
||||
|
||||
void setTextColor(int paramInt);
|
||||
|
||||
void setTextJustification(int paramInt1, int paramInt2);
|
||||
|
||||
void setViewportExtEx(int paramInt1, int paramInt2, Size paramSize);
|
||||
|
||||
void setViewportOrgEx(int paramInt1, int paramInt2, Point paramPoint);
|
||||
|
||||
void setWindowExtEx(int paramInt1, int paramInt2, Size paramSize);
|
||||
|
||||
void setWindowOrgEx(int paramInt1, int paramInt2, Point paramPoint);
|
||||
|
||||
void stretchBlt(byte[] paramArrayOfbyte, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8, long paramLong);
|
||||
|
||||
void stretchDIBits(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8, byte[] paramArrayOfbyte, int paramInt9, long paramLong);
|
||||
|
||||
void textOut(int paramInt1, int paramInt2, byte[] paramArrayOfbyte);
|
||||
|
||||
void footer();
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package net.arnx.wmf2svg.gdi;
|
||||
|
||||
public interface GdiBrush extends GdiObject {
|
||||
public static final int BS_DIBPATTERN = 5;
|
||||
|
||||
public static final int BS_DIBPATTERN8X8 = 8;
|
||||
|
||||
public static final int BS_DIBPATTERNPT = 6;
|
||||
|
||||
public static final int BS_HATCHED = 2;
|
||||
|
||||
public static final int BS_HOLLOW = 1;
|
||||
|
||||
public static final int BS_NULL = 1;
|
||||
|
||||
public static final int BS_PATTERN = 3;
|
||||
|
||||
public static final int BS_PATTERN8X8 = 7;
|
||||
|
||||
public static final int BS_SOLID = 0;
|
||||
|
||||
public static final int DIB_PAL_COLORS = 1;
|
||||
|
||||
public static final int DIB_RGB_COLORS = 0;
|
||||
|
||||
public static final int HS_HORIZONTAL = 0;
|
||||
|
||||
public static final int HS_VERTICAL = 1;
|
||||
|
||||
public static final int HS_FDIAGONAL = 2;
|
||||
|
||||
public static final int HS_BDIAGONAL = 3;
|
||||
|
||||
public static final int HS_CROSS = 4;
|
||||
|
||||
public static final int HS_DIAGCROSS = 5;
|
||||
|
||||
int getStyle();
|
||||
|
||||
int getColor();
|
||||
|
||||
int getHatch();
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package net.arnx.wmf2svg.gdi;
|
||||
|
||||
public class GdiException extends Exception {
|
||||
private static final long serialVersionUID = 6015311832170522581L;
|
||||
|
||||
public GdiException() {}
|
||||
|
||||
public GdiException(String paramString) {
|
||||
super(paramString);
|
||||
}
|
||||
|
||||
public GdiException(String paramString, Throwable paramThrowable) {
|
||||
super(paramString, paramThrowable);
|
||||
}
|
||||
|
||||
public GdiException(Throwable paramThrowable) {
|
||||
super(paramThrowable);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,163 @@
|
|||
package net.arnx.wmf2svg.gdi;
|
||||
|
||||
public interface GdiFont extends GdiObject {
|
||||
public static final int FW_DONTCARE = 0;
|
||||
|
||||
public static final int FW_THIN = 100;
|
||||
|
||||
public static final int FW_EXTRALIGHT = 200;
|
||||
|
||||
public static final int FW_ULTRALIGHT = 200;
|
||||
|
||||
public static final int FW_LIGHT = 300;
|
||||
|
||||
public static final int FW_NORMAL = 400;
|
||||
|
||||
public static final int FW_REGULAR = 400;
|
||||
|
||||
public static final int FW_MEDIUM = 500;
|
||||
|
||||
public static final int FW_SEMIBOLD = 600;
|
||||
|
||||
public static final int FW_DEMIBOLD = 600;
|
||||
|
||||
public static final int FW_BOLD = 700;
|
||||
|
||||
public static final int FW_EXTRABOLD = 800;
|
||||
|
||||
public static final int FW_ULTRABOLD = 800;
|
||||
|
||||
public static final int FW_HEAVY = 900;
|
||||
|
||||
public static final int FW_BLACK = 900;
|
||||
|
||||
public static final int ANSI_CHARSET = 0;
|
||||
|
||||
public static final int DEFAULT_CHARSET = 1;
|
||||
|
||||
public static final int SYMBOL_CHARSET = 2;
|
||||
|
||||
public static final int MAC_CHARSET = 77;
|
||||
|
||||
public static final int SHIFTJIS_CHARSET = 128;
|
||||
|
||||
public static final int HANGUL_CHARSET = 129;
|
||||
|
||||
public static final int JOHAB_CHARSET = 130;
|
||||
|
||||
public static final int GB2312_CHARSET = 134;
|
||||
|
||||
public static final int CHINESEBIG5_CHARSET = 136;
|
||||
|
||||
public static final int GREEK_CHARSET = 161;
|
||||
|
||||
public static final int TURKISH_CHARSET = 162;
|
||||
|
||||
public static final int VIETNAMESE_CHARSET = 163;
|
||||
|
||||
public static final int ARABIC_CHARSET = 178;
|
||||
|
||||
public static final int HEBREW_CHARSET = 177;
|
||||
|
||||
public static final int BALTIC_CHARSET = 186;
|
||||
|
||||
public static final int RUSSIAN_CHARSET = 204;
|
||||
|
||||
public static final int THAI_CHARSET = 222;
|
||||
|
||||
public static final int EASTEUROPE_CHARSET = 238;
|
||||
|
||||
public static final int OEM_CHARSET = 255;
|
||||
|
||||
public static final int OUT_DEFAULT_PRECIS = 0;
|
||||
|
||||
public static final int OUT_STRING_PRECIS = 1;
|
||||
|
||||
public static final int OUT_CHARACTER_PRECIS = 2;
|
||||
|
||||
public static final int OUT_STROKE_PRECIS = 3;
|
||||
|
||||
public static final int OUT_TT_PRECIS = 4;
|
||||
|
||||
public static final int OUT_DEVICE_PRECIS = 5;
|
||||
|
||||
public static final int OUT_RASTER_PRECIS = 6;
|
||||
|
||||
public static final int OUT_TT_ONLY_PRECIS = 7;
|
||||
|
||||
public static final int OUT_OUTLINE_PRECIS = 8;
|
||||
|
||||
public static final int OUT_SCREEN_OUTLINE_PRECIS = 9;
|
||||
|
||||
public static final int CLIP_DEFAULT_PRECIS = 0;
|
||||
|
||||
public static final int CLIP_CHARACTER_PRECIS = 1;
|
||||
|
||||
public static final int CLIP_STROKE_PRECIS = 2;
|
||||
|
||||
public static final int CLIP_MASK = 15;
|
||||
|
||||
public static final int CLIP_LH_ANGLES = 16;
|
||||
|
||||
public static final int CLIP_TT_ALWAYS = 32;
|
||||
|
||||
public static final int CLIP_EMBEDDED = 128;
|
||||
|
||||
public static final int DEFAULT_QUALITY = 0;
|
||||
|
||||
public static final int DRAFT_QUALITY = 1;
|
||||
|
||||
public static final int PROOF_QUALITY = 2;
|
||||
|
||||
public static final int NONANTIALIASED_QUALITY = 3;
|
||||
|
||||
public static final int ANTIALIASED_QUALITY = 4;
|
||||
|
||||
public static final int CLEARTYPE_QUALITY = 5;
|
||||
|
||||
public static final int DEFAULT_PITCH = 0;
|
||||
|
||||
public static final int FIXED_PITCH = 1;
|
||||
|
||||
public static final int VARIABLE_PITCH = 2;
|
||||
|
||||
public static final int FF_DONTCARE = 0;
|
||||
|
||||
public static final int FF_ROMAN = 16;
|
||||
|
||||
public static final int FF_SWISS = 32;
|
||||
|
||||
public static final int FF_MODERN = 48;
|
||||
|
||||
public static final int FF_SCRIPT = 64;
|
||||
|
||||
public static final int FF_DECORATIVE = 80;
|
||||
|
||||
int getHeight();
|
||||
|
||||
int getWidth();
|
||||
|
||||
int getEscapement();
|
||||
|
||||
int getOrientation();
|
||||
|
||||
int getWeight();
|
||||
|
||||
boolean isItalic();
|
||||
|
||||
boolean isUnderlined();
|
||||
|
||||
boolean isStrikedOut();
|
||||
|
||||
int getCharset();
|
||||
|
||||
int getOutPrecision();
|
||||
|
||||
int getClipPrecision();
|
||||
|
||||
int getQuality();
|
||||
|
||||
int getPitchAndFamily();
|
||||
|
||||
String getFaceName();
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package net.arnx.wmf2svg.gdi;
|
||||
|
||||
public interface GdiObject {}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package net.arnx.wmf2svg.gdi;
|
||||
|
||||
public interface GdiPalette extends GdiObject {
|
||||
int getVersion();
|
||||
|
||||
int[] getEntries();
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package net.arnx.wmf2svg.gdi;
|
||||
|
||||
public interface GdiPatternBrush extends GdiObject {
|
||||
byte[] getPattern();
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package net.arnx.wmf2svg.gdi;
|
||||
|
||||
public interface GdiPen extends GdiObject {
|
||||
public static final int PS_SOLID = 0;
|
||||
|
||||
public static final int PS_DASH = 1;
|
||||
|
||||
public static final int PS_DOT = 2;
|
||||
|
||||
public static final int PS_DASHDOT = 3;
|
||||
|
||||
public static final int PS_DASHDOTDOT = 4;
|
||||
|
||||
public static final int PS_NULL = 5;
|
||||
|
||||
public static final int PS_INSIDEFRAME = 6;
|
||||
|
||||
int getStyle();
|
||||
|
||||
int getWidth();
|
||||
|
||||
int getColor();
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package net.arnx.wmf2svg.gdi;
|
||||
|
||||
public interface GdiRegion extends GdiObject {
|
||||
public static final int NULLREGION = 1;
|
||||
|
||||
public static final int SIMPLEREGION = 2;
|
||||
|
||||
public static final int COMPLEXREGION = 3;
|
||||
|
||||
public static final int ERROR = 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,131 @@
|
|||
package net.arnx.wmf2svg.gdi;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
public final class GdiUtils {
|
||||
private static int[][] FBA_SHIFT_JIS = new int[][] { new int[] { 129, 159 }, new int[] { 224, 252 } };
|
||||
|
||||
private static int[][] FBA_HANGUL_CHARSET = new int[][] { new int[] { 128, 255 } };
|
||||
|
||||
private static int[][] FBA_JOHAB_CHARSET = new int[][] { new int[] { 128, 255 } };
|
||||
|
||||
private static int[][] FBA_GB2312_CHARSET = new int[][] { new int[] { 128, 255 } };
|
||||
|
||||
private static int[][] FBA_CHINESEBIG5_CHARSET = new int[][] { new int[] { 161, 254 } };
|
||||
|
||||
public static String convertString(byte[] paramArrayOfbyte, int paramInt) {
|
||||
String str = null;
|
||||
int i;
|
||||
for (i = 0; i < paramArrayOfbyte.length && paramArrayOfbyte[i] != 0; i++);
|
||||
try {
|
||||
str = new String(paramArrayOfbyte, 0, i, getCharset(paramInt));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
try {
|
||||
str = new String(paramArrayOfbyte, 0, i, "Cp1252");
|
||||
} catch (UnsupportedEncodingException unsupportedEncodingException) {
|
||||
throw new IllegalStateException(unsupportedEncodingException);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
public static String getCharset(int paramInt) {
|
||||
switch (paramInt) {
|
||||
case 0:
|
||||
return "Cp1252";
|
||||
case 2:
|
||||
return "Cp1252";
|
||||
case 77:
|
||||
return "MacRoman";
|
||||
case 128:
|
||||
return "MS932";
|
||||
case 129:
|
||||
return "MS949";
|
||||
case 130:
|
||||
return "Johab";
|
||||
case 134:
|
||||
return "MS936";
|
||||
case 136:
|
||||
return "MS950";
|
||||
case 161:
|
||||
return "Cp1253";
|
||||
case 162:
|
||||
return "Cp1254";
|
||||
case 163:
|
||||
return "Cp1258";
|
||||
case 177:
|
||||
return "Cp1255";
|
||||
case 178:
|
||||
return "Cp1256";
|
||||
case 186:
|
||||
return "Cp1257";
|
||||
case 204:
|
||||
return "Cp1251";
|
||||
case 222:
|
||||
return "MS874";
|
||||
case 238:
|
||||
return "Cp1250";
|
||||
case 255:
|
||||
return "Cp1252";
|
||||
}
|
||||
return "Cp1252";
|
||||
}
|
||||
|
||||
public static String getLanguage(int paramInt) {
|
||||
switch (paramInt) {
|
||||
case 0:
|
||||
return "en";
|
||||
case 2:
|
||||
return "en";
|
||||
case 77:
|
||||
return "en";
|
||||
case 128:
|
||||
return "ja";
|
||||
case 129:
|
||||
return "ko";
|
||||
case 130:
|
||||
return "ko";
|
||||
case 134:
|
||||
return "zh-CN";
|
||||
case 136:
|
||||
return "zh-TW";
|
||||
case 161:
|
||||
return "el";
|
||||
case 162:
|
||||
return "tr";
|
||||
case 163:
|
||||
return "vi";
|
||||
case 177:
|
||||
return "iw";
|
||||
case 178:
|
||||
return "ar";
|
||||
case 186:
|
||||
return "bat";
|
||||
case 204:
|
||||
return "ru";
|
||||
case 222:
|
||||
return "th";
|
||||
case 238:
|
||||
return null;
|
||||
case 255:
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static int[][] getFirstByteArea(int paramInt) {
|
||||
switch (paramInt) {
|
||||
case 128:
|
||||
return FBA_SHIFT_JIS;
|
||||
case 129:
|
||||
return FBA_HANGUL_CHARSET;
|
||||
case 130:
|
||||
return FBA_JOHAB_CHARSET;
|
||||
case 134:
|
||||
return FBA_GB2312_CHARSET;
|
||||
case 136:
|
||||
return FBA_CHINESEBIG5_CHARSET;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package net.arnx.wmf2svg.gdi;
|
||||
|
||||
public class Point {
|
||||
public int x;
|
||||
|
||||
public int y;
|
||||
|
||||
public Point(int paramInt1, int paramInt2) {
|
||||
this.x = paramInt1;
|
||||
this.y = paramInt2;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
null = 1;
|
||||
null = 31 * null + this.x;
|
||||
return 31 * null + this.y;
|
||||
}
|
||||
|
||||
public boolean equals(Object paramObject) {
|
||||
if (this == paramObject)
|
||||
return true;
|
||||
if (paramObject == null)
|
||||
return false;
|
||||
if (getClass() != paramObject.getClass())
|
||||
return false;
|
||||
Point point = (Point)paramObject;
|
||||
return (this.x != point.x) ? false : (!(this.y != point.y));
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "Point [x=" + this.x + ", y=" + this.y + "]";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package net.arnx.wmf2svg.gdi;
|
||||
|
||||
public class Size {
|
||||
public int width;
|
||||
|
||||
public int height;
|
||||
|
||||
public Size(int paramInt1, int paramInt2) {
|
||||
this.width = paramInt1;
|
||||
this.height = paramInt2;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
null = 1;
|
||||
null = 31 * null + this.height;
|
||||
return 31 * null + this.width;
|
||||
}
|
||||
|
||||
public boolean equals(Object paramObject) {
|
||||
if (this == paramObject)
|
||||
return true;
|
||||
if (paramObject == null)
|
||||
return false;
|
||||
if (getClass() != paramObject.getClass())
|
||||
return false;
|
||||
Size size = (Size)paramObject;
|
||||
return (this.height != size.height) ? false : (!(this.width != size.width));
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "Size [width=" + this.width + ", height=" + this.height + "]";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,166 @@
|
|||
package net.arnx.wmf2svg.gdi.svg;
|
||||
|
||||
import net.arnx.wmf2svg.gdi.GdiBrush;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Text;
|
||||
|
||||
class SvgBrush extends SvgObject implements GdiBrush {
|
||||
private int style;
|
||||
|
||||
private int color;
|
||||
|
||||
private int hatch;
|
||||
|
||||
public SvgBrush(SvgGdi paramSvgGdi, int paramInt1, int paramInt2, int paramInt3) {
|
||||
super(paramSvgGdi);
|
||||
this.style = paramInt1;
|
||||
this.color = paramInt2;
|
||||
this.hatch = paramInt3;
|
||||
}
|
||||
|
||||
public int getStyle() {
|
||||
return this.style;
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
public int getHatch() {
|
||||
return this.hatch;
|
||||
}
|
||||
|
||||
public Element createFillPattern(String paramString) {
|
||||
Element element = null;
|
||||
if (this.style == 2) {
|
||||
Element element1;
|
||||
Element element2;
|
||||
element = getGDI().getDocument().createElement("pattern");
|
||||
element.setAttribute("id", paramString);
|
||||
element.setAttribute("patternUnits", "userSpaceOnUse");
|
||||
element.setAttribute("x", "" + toRealSize(0));
|
||||
element.setAttribute("y", "" + toRealSize(0));
|
||||
element.setAttribute("width", "" + toRealSize(8));
|
||||
element.setAttribute("height", "" + toRealSize(8));
|
||||
if (getGDI().getDC().getBkMode() == 2) {
|
||||
Element element3 = getGDI().getDocument().createElement("rect");
|
||||
element3.setAttribute("fill", toColor(getGDI().getDC().getBkColor()));
|
||||
element3.setAttribute("x", "" + toRealSize(0));
|
||||
element3.setAttribute("y", "" + toRealSize(0));
|
||||
element3.setAttribute("width", "" + toRealSize(8));
|
||||
element3.setAttribute("height", "" + toRealSize(8));
|
||||
element.appendChild(element3);
|
||||
}
|
||||
switch (this.hatch) {
|
||||
case 0:
|
||||
element1 = getGDI().getDocument().createElement("line");
|
||||
element1.setAttribute("stroke", toColor(this.color));
|
||||
element1.setAttribute("x1", "" + toRealSize(0));
|
||||
element1.setAttribute("y1", "" + toRealSize(4));
|
||||
element1.setAttribute("x2", "" + toRealSize(8));
|
||||
element1.setAttribute("y2", "" + toRealSize(4));
|
||||
element.appendChild(element1);
|
||||
break;
|
||||
case 1:
|
||||
element1 = getGDI().getDocument().createElement("line");
|
||||
element1.setAttribute("stroke", toColor(this.color));
|
||||
element1.setAttribute("x1", "" + toRealSize(4));
|
||||
element1.setAttribute("y1", "" + toRealSize(0));
|
||||
element1.setAttribute("x2", "" + toRealSize(4));
|
||||
element1.setAttribute("y2", "" + toRealSize(8));
|
||||
element.appendChild(element1);
|
||||
break;
|
||||
case 2:
|
||||
element1 = getGDI().getDocument().createElement("line");
|
||||
element1.setAttribute("stroke", toColor(this.color));
|
||||
element1.setAttribute("x1", "" + toRealSize(0));
|
||||
element1.setAttribute("y1", "" + toRealSize(0));
|
||||
element1.setAttribute("x2", "" + toRealSize(8));
|
||||
element1.setAttribute("y2", "" + toRealSize(8));
|
||||
element.appendChild(element1);
|
||||
break;
|
||||
case 3:
|
||||
element1 = getGDI().getDocument().createElement("line");
|
||||
element1.setAttribute("stroke", toColor(this.color));
|
||||
element1.setAttribute("x1", "" + toRealSize(0));
|
||||
element1.setAttribute("y1", "" + toRealSize(8));
|
||||
element1.setAttribute("x2", "" + toRealSize(8));
|
||||
element1.setAttribute("y2", "" + toRealSize(0));
|
||||
element.appendChild(element1);
|
||||
break;
|
||||
case 4:
|
||||
element1 = getGDI().getDocument().createElement("line");
|
||||
element1.setAttribute("stroke", toColor(this.color));
|
||||
element1.setAttribute("x1", "" + toRealSize(0));
|
||||
element1.setAttribute("y1", "" + toRealSize(4));
|
||||
element1.setAttribute("x2", "" + toRealSize(8));
|
||||
element1.setAttribute("y2", "" + toRealSize(4));
|
||||
element.appendChild(element1);
|
||||
element2 = getGDI().getDocument().createElement("line");
|
||||
element2.setAttribute("stroke", toColor(this.color));
|
||||
element2.setAttribute("x1", "" + toRealSize(4));
|
||||
element2.setAttribute("y1", "" + toRealSize(0));
|
||||
element2.setAttribute("x2", "" + toRealSize(4));
|
||||
element2.setAttribute("y2", "" + toRealSize(8));
|
||||
element.appendChild(element2);
|
||||
break;
|
||||
case 5:
|
||||
element1 = getGDI().getDocument().createElement("line");
|
||||
element1.setAttribute("stroke", toColor(this.color));
|
||||
element1.setAttribute("x1", "" + toRealSize(0));
|
||||
element1.setAttribute("y1", "" + toRealSize(0));
|
||||
element1.setAttribute("x2", "" + toRealSize(8));
|
||||
element1.setAttribute("y2", "" + toRealSize(8));
|
||||
element.appendChild(element1);
|
||||
element2 = getGDI().getDocument().createElement("line");
|
||||
element2.setAttribute("stroke", toColor(this.color));
|
||||
element2.setAttribute("x1", "" + toRealSize(0));
|
||||
element2.setAttribute("y1", "" + toRealSize(8));
|
||||
element2.setAttribute("x2", "" + toRealSize(8));
|
||||
element2.setAttribute("y2", "" + toRealSize(0));
|
||||
element.appendChild(element2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return element;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
null = 1;
|
||||
null = 31 * null + this.color;
|
||||
null = 31 * null + this.hatch;
|
||||
return 31 * null + this.style;
|
||||
}
|
||||
|
||||
public boolean equals(Object paramObject) {
|
||||
if (this == paramObject)
|
||||
return true;
|
||||
if (paramObject == null)
|
||||
return false;
|
||||
if (getClass() != paramObject.getClass())
|
||||
return false;
|
||||
SvgBrush svgBrush = (SvgBrush)paramObject;
|
||||
return (this.color != svgBrush.color) ? false : ((this.hatch != svgBrush.hatch) ? false : (!(this.style != svgBrush.style)));
|
||||
}
|
||||
|
||||
public Text createTextNode(String paramString) {
|
||||
return getGDI().getDocument().createTextNode("." + paramString + " { " + toString() + " }\n");
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
switch (this.style) {
|
||||
case 0:
|
||||
stringBuffer.append("fill: ").append(toColor(this.color)).append("; ");
|
||||
break;
|
||||
case 2:
|
||||
break;
|
||||
default:
|
||||
stringBuffer.append("fill: none; ");
|
||||
break;
|
||||
}
|
||||
if (stringBuffer.length() > 0)
|
||||
stringBuffer.setLength(stringBuffer.length() - 1);
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,568 @@
|
|||
package net.arnx.wmf2svg.gdi.svg;
|
||||
|
||||
import net.arnx.wmf2svg.gdi.Point;
|
||||
import net.arnx.wmf2svg.gdi.Size;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
public class SvgDc implements Cloneable {
|
||||
private SvgGdi gdi;
|
||||
|
||||
private int dpi = 1440;
|
||||
|
||||
private int wx = 0;
|
||||
|
||||
private int wy = 0;
|
||||
|
||||
private int ww = 0;
|
||||
|
||||
private int wh = 0;
|
||||
|
||||
private int wox = 0;
|
||||
|
||||
private int woy = 0;
|
||||
|
||||
private double wsx = 1.0D;
|
||||
|
||||
private double wsy = 1.0D;
|
||||
|
||||
private double mx = 1.0D;
|
||||
|
||||
private double my = 1.0D;
|
||||
|
||||
private int vx = 0;
|
||||
|
||||
private int vy = 0;
|
||||
|
||||
private int vw = 0;
|
||||
|
||||
private int vh = 0;
|
||||
|
||||
private int vox = 0;
|
||||
|
||||
private int voy = 0;
|
||||
|
||||
private double vsx = 1.0D;
|
||||
|
||||
private double vsy = 1.0D;
|
||||
|
||||
private int cx = 0;
|
||||
|
||||
private int cy = 0;
|
||||
|
||||
private int cox = 0;
|
||||
|
||||
private int coy = 0;
|
||||
|
||||
private int mapMode = 1;
|
||||
|
||||
private int bkColor = 16777215;
|
||||
|
||||
private int bkMode = 2;
|
||||
|
||||
private int textColor = 0;
|
||||
|
||||
private int textSpace = 0;
|
||||
|
||||
private int textAlign = 0;
|
||||
|
||||
private int textDx = 0;
|
||||
|
||||
private int polyFillMode = 1;
|
||||
|
||||
private int relAbsMode = 0;
|
||||
|
||||
private int rop2Mode = 13;
|
||||
|
||||
private int stretchBltMode = 2;
|
||||
|
||||
private long layout = 0L;
|
||||
|
||||
private long mapperFlags = 0L;
|
||||
|
||||
private SvgBrush brush = null;
|
||||
|
||||
private SvgFont font = null;
|
||||
|
||||
private SvgPen pen = null;
|
||||
|
||||
private Element mask = null;
|
||||
|
||||
public SvgDc(SvgGdi paramSvgGdi) {
|
||||
this.gdi = paramSvgGdi;
|
||||
}
|
||||
|
||||
public int getDpi() {
|
||||
return this.dpi;
|
||||
}
|
||||
|
||||
public void setWindowOrgEx(int paramInt1, int paramInt2, Point paramPoint) {
|
||||
if (paramPoint != null) {
|
||||
paramPoint.x = this.wx;
|
||||
paramPoint.y = this.wy;
|
||||
}
|
||||
this.wx = paramInt1;
|
||||
this.wy = paramInt2;
|
||||
}
|
||||
|
||||
public void setWindowExtEx(int paramInt1, int paramInt2, Size paramSize) {
|
||||
if (paramSize != null) {
|
||||
paramSize.width = this.ww;
|
||||
paramSize.height = this.wh;
|
||||
}
|
||||
this.ww = paramInt1;
|
||||
this.wh = paramInt2;
|
||||
}
|
||||
|
||||
public void offsetWindowOrgEx(int paramInt1, int paramInt2, Point paramPoint) {
|
||||
if (paramPoint != null) {
|
||||
paramPoint.x = this.wox;
|
||||
paramPoint.y = this.woy;
|
||||
}
|
||||
this.wox += paramInt1;
|
||||
this.woy += paramInt2;
|
||||
}
|
||||
|
||||
public void scaleWindowExtEx(int paramInt1, int paramInt2, int paramInt3, int paramInt4, Size paramSize) {
|
||||
this.wsx = this.wsx * (double)paramInt1 / (double)paramInt2;
|
||||
this.wsy = this.wsy * (double)paramInt3 / (double)paramInt4;
|
||||
}
|
||||
|
||||
public int getWindowX() {
|
||||
return this.wx;
|
||||
}
|
||||
|
||||
public int getWindowY() {
|
||||
return this.wy;
|
||||
}
|
||||
|
||||
public int getWindowWidth() {
|
||||
return this.ww;
|
||||
}
|
||||
|
||||
public int getWindowHeight() {
|
||||
return this.wh;
|
||||
}
|
||||
|
||||
public void setViewportOrgEx(int paramInt1, int paramInt2, Point paramPoint) {
|
||||
if (paramPoint != null) {
|
||||
paramPoint.x = this.vx;
|
||||
paramPoint.y = this.vy;
|
||||
}
|
||||
this.vx = paramInt1;
|
||||
this.vy = paramInt2;
|
||||
}
|
||||
|
||||
public void setViewportExtEx(int paramInt1, int paramInt2, Size paramSize) {
|
||||
if (paramSize != null) {
|
||||
paramSize.width = this.vw;
|
||||
paramSize.height = this.vh;
|
||||
}
|
||||
this.vw = paramInt1;
|
||||
this.vh = paramInt2;
|
||||
}
|
||||
|
||||
public void offsetViewportOrgEx(int paramInt1, int paramInt2, Point paramPoint) {
|
||||
if (paramPoint != null) {
|
||||
paramPoint.x = this.vox;
|
||||
paramPoint.y = this.voy;
|
||||
}
|
||||
this.vox = paramInt1;
|
||||
this.voy = paramInt2;
|
||||
}
|
||||
|
||||
public void scaleViewportExtEx(int paramInt1, int paramInt2, int paramInt3, int paramInt4, Size paramSize) {
|
||||
this.vsx = this.vsx * (double)paramInt1 / (double)paramInt2;
|
||||
this.vsy = this.vsy * (double)paramInt3 / (double)paramInt4;
|
||||
}
|
||||
|
||||
public void offsetClipRgn(int paramInt1, int paramInt2) {
|
||||
this.cox = paramInt1;
|
||||
this.coy = paramInt2;
|
||||
}
|
||||
|
||||
public int getMapMode() {
|
||||
return this.mapMode;
|
||||
}
|
||||
|
||||
public void setMapMode(int paramInt) {
|
||||
this.mapMode = paramInt;
|
||||
switch (paramInt) {
|
||||
case 5:
|
||||
this.mx = 0.09D;
|
||||
this.my = -0.09D;
|
||||
break;
|
||||
case 4:
|
||||
this.mx = 0.9D;
|
||||
this.my = -0.9D;
|
||||
break;
|
||||
case 3:
|
||||
this.mx = 0.03543307D;
|
||||
this.my = -0.03543307D;
|
||||
break;
|
||||
case 2:
|
||||
this.mx = 0.3543307D;
|
||||
this.my = -0.3543307D;
|
||||
break;
|
||||
case 6:
|
||||
this.mx = 0.0625D;
|
||||
this.my = -0.0625D;
|
||||
break;
|
||||
default:
|
||||
this.mx = 1.0D;
|
||||
this.my = 1.0D;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public int getCurrentX() {
|
||||
return this.cx;
|
||||
}
|
||||
|
||||
public int getCurrentY() {
|
||||
return this.cy;
|
||||
}
|
||||
|
||||
public int getOffsetClipX() {
|
||||
return this.cox;
|
||||
}
|
||||
|
||||
public int getOffsetClipY() {
|
||||
return this.coy;
|
||||
}
|
||||
|
||||
public void moveToEx(int paramInt1, int paramInt2, Point paramPoint) {
|
||||
if (paramPoint != null) {
|
||||
paramPoint.x = this.cx;
|
||||
paramPoint.y = this.cy;
|
||||
}
|
||||
this.cx = paramInt1;
|
||||
this.cy = paramInt2;
|
||||
}
|
||||
|
||||
public int toAbsoluteX(double paramDouble) {
|
||||
return (int)((double)((this.ww >= 0) ? true : -1) * (this.mx * paramDouble - (double)(this.wx + this.wox)) / this.wsx);
|
||||
}
|
||||
|
||||
public int toAbsoluteY(double paramDouble) {
|
||||
return (int)((double)((this.wh >= 0) ? true : -1) * (this.my * paramDouble - (double)(this.wy + this.woy)) / this.wsy);
|
||||
}
|
||||
|
||||
public int toRelativeX(double paramDouble) {
|
||||
return (int)((double)((this.ww >= 0) ? true : -1) * this.mx * paramDouble / this.wsx);
|
||||
}
|
||||
|
||||
public int toRelativeY(double paramDouble) {
|
||||
return (int)((double)((this.wh >= 0) ? true : -1) * this.my * paramDouble / this.wsy);
|
||||
}
|
||||
|
||||
public void setDpi(int paramInt) {
|
||||
this.dpi = (paramInt > 0) ? paramInt : 1440;
|
||||
}
|
||||
|
||||
public int getBkColor() {
|
||||
return this.bkColor;
|
||||
}
|
||||
|
||||
public void setBkColor(int paramInt) {
|
||||
this.bkColor = paramInt;
|
||||
}
|
||||
|
||||
public int getBkMode() {
|
||||
return this.bkMode;
|
||||
}
|
||||
|
||||
public void setBkMode(int paramInt) {
|
||||
this.bkMode = paramInt;
|
||||
}
|
||||
|
||||
public int getTextColor() {
|
||||
return this.textColor;
|
||||
}
|
||||
|
||||
public void setTextColor(int paramInt) {
|
||||
this.textColor = paramInt;
|
||||
}
|
||||
|
||||
public int getPolyFillMode() {
|
||||
return this.polyFillMode;
|
||||
}
|
||||
|
||||
public void setPolyFillMode(int paramInt) {
|
||||
this.polyFillMode = paramInt;
|
||||
}
|
||||
|
||||
public int getRelAbs() {
|
||||
return this.relAbsMode;
|
||||
}
|
||||
|
||||
public void setRelAbs(int paramInt) {
|
||||
this.relAbsMode = paramInt;
|
||||
}
|
||||
|
||||
public int getROP2() {
|
||||
return this.rop2Mode;
|
||||
}
|
||||
|
||||
public void setROP2(int paramInt) {
|
||||
this.rop2Mode = paramInt;
|
||||
}
|
||||
|
||||
public int getStretchBltMode() {
|
||||
return this.stretchBltMode;
|
||||
}
|
||||
|
||||
public void setStretchBltMode(int paramInt) {
|
||||
this.stretchBltMode = paramInt;
|
||||
}
|
||||
|
||||
public int getTextSpace() {
|
||||
return this.textSpace;
|
||||
}
|
||||
|
||||
public void setTextSpace(int paramInt) {
|
||||
this.textSpace = paramInt;
|
||||
}
|
||||
|
||||
public int getTextAlign() {
|
||||
return this.textAlign;
|
||||
}
|
||||
|
||||
public void setTextAlign(int paramInt) {
|
||||
this.textAlign = paramInt;
|
||||
}
|
||||
|
||||
public int getTextCharacterExtra() {
|
||||
return this.textDx;
|
||||
}
|
||||
|
||||
public void setTextCharacterExtra(int paramInt) {
|
||||
this.textDx = paramInt;
|
||||
}
|
||||
|
||||
public long getLayout() {
|
||||
return this.layout;
|
||||
}
|
||||
|
||||
public void setLayout(long paramLong) {
|
||||
this.layout = paramLong;
|
||||
}
|
||||
|
||||
public long getMapperFlags() {
|
||||
return this.mapperFlags;
|
||||
}
|
||||
|
||||
public void setMapperFlags(long paramLong) {
|
||||
this.mapperFlags = paramLong;
|
||||
}
|
||||
|
||||
public SvgBrush getBrush() {
|
||||
return this.brush;
|
||||
}
|
||||
|
||||
public void setBrush(SvgBrush paramSvgBrush) {
|
||||
this.brush = paramSvgBrush;
|
||||
}
|
||||
|
||||
public SvgFont getFont() {
|
||||
return this.font;
|
||||
}
|
||||
|
||||
public void setFont(SvgFont paramSvgFont) {
|
||||
this.font = paramSvgFont;
|
||||
}
|
||||
|
||||
public SvgPen getPen() {
|
||||
return this.pen;
|
||||
}
|
||||
|
||||
public void setPen(SvgPen paramSvgPen) {
|
||||
this.pen = paramSvgPen;
|
||||
}
|
||||
|
||||
public void setMask(Element paramElement) {
|
||||
this.mask = paramElement;
|
||||
}
|
||||
|
||||
public Element getMask() {
|
||||
return this.mask;
|
||||
}
|
||||
|
||||
public String getRopFilter(long paramLong) {
|
||||
String str = null;
|
||||
Document document = this.gdi.getDocument();
|
||||
if (paramLong == 66L) {
|
||||
str = "BLACKNESS_FILTER";
|
||||
Element element = document.getElementById(str);
|
||||
if (element == null) {
|
||||
element = this.gdi.getDocument().createElement("filter");
|
||||
element.setAttribute("id", str);
|
||||
element.setIdAttribute("id", true);
|
||||
Element element1 = document.createElement("feColorMatrix");
|
||||
element1.setAttribute("type", "matrix");
|
||||
element1.setAttribute("in", "SourceGraphic");
|
||||
element1.setAttribute("values", "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0");
|
||||
element.appendChild(element1);
|
||||
this.gdi.getDefsElement().appendChild(element);
|
||||
}
|
||||
} else if (paramLong == 1114278L) {
|
||||
str = "NOTSRCERASE_FILTER";
|
||||
Element element = document.getElementById(str);
|
||||
if (element == null) {
|
||||
element = this.gdi.getDocument().createElement("filter");
|
||||
element.setAttribute("id", str);
|
||||
element.setIdAttribute("id", true);
|
||||
Element element1 = document.createElement("feComposite");
|
||||
element1.setAttribute("in", "SourceGraphic");
|
||||
element1.setAttribute("in2", "BackgroundImage");
|
||||
element1.setAttribute("operator", "arithmetic");
|
||||
element1.setAttribute("k1", "1");
|
||||
element1.setAttribute("result", "result0");
|
||||
element.appendChild(element1);
|
||||
Element element2 = document.createElement("feColorMatrix");
|
||||
element2.setAttribute("in", "result0");
|
||||
element2.setAttribute("values", "-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0");
|
||||
element.appendChild(element2);
|
||||
this.gdi.getDefsElement().appendChild(element);
|
||||
}
|
||||
} else if (paramLong == 3342344L) {
|
||||
str = "NOTSRCCOPY_FILTER";
|
||||
Element element = document.getElementById(str);
|
||||
if (element == null) {
|
||||
element = this.gdi.getDocument().createElement("filter");
|
||||
element.setAttribute("id", str);
|
||||
element.setIdAttribute("id", true);
|
||||
Element element1 = document.createElement("feColorMatrix");
|
||||
element1.setAttribute("type", "matrix");
|
||||
element1.setAttribute("in", "SourceGraphic");
|
||||
element1.setAttribute("values", "-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0");
|
||||
element.appendChild(element1);
|
||||
this.gdi.getDefsElement().appendChild(element);
|
||||
}
|
||||
} else if (paramLong == 4457256L) {
|
||||
str = "SRCERASE_FILTER";
|
||||
Element element = document.getElementById(str);
|
||||
if (element == null) {
|
||||
element = this.gdi.getDocument().createElement("filter");
|
||||
element.setAttribute("id", str);
|
||||
element.setIdAttribute("id", true);
|
||||
Element element1 = document.createElement("feColorMatrix");
|
||||
element1.setAttribute("type", "matrix");
|
||||
element1.setAttribute("in", "BackgroundImage");
|
||||
element1.setAttribute("values", "-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0");
|
||||
element1.setAttribute("result", "result0");
|
||||
element.appendChild(element1);
|
||||
Element element2 = document.createElement("feComposite");
|
||||
element2.setAttribute("in", "SourceGraphic");
|
||||
element2.setAttribute("in2", "result0");
|
||||
element2.setAttribute("operator", "arithmetic");
|
||||
element2.setAttribute("k2", "1");
|
||||
element2.setAttribute("k3", "1");
|
||||
element.appendChild(element2);
|
||||
this.gdi.getDefsElement().appendChild(element);
|
||||
}
|
||||
} else if (paramLong != 5898313L && paramLong != 6684742L) {
|
||||
if (paramLong == 5570569L) {
|
||||
str = "DSTINVERT_FILTER";
|
||||
Element element = document.getElementById(str);
|
||||
if (element == null) {
|
||||
element = this.gdi.getDocument().createElement("filter");
|
||||
element.setAttribute("id", str);
|
||||
element.setIdAttribute("id", true);
|
||||
Element element1 = document.createElement("feColorMatrix");
|
||||
element1.setAttribute("type", "matrix");
|
||||
element1.setAttribute("in", "BackgroundImage");
|
||||
element1.setAttribute("values", "-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0");
|
||||
element.appendChild(element1);
|
||||
this.gdi.getDefsElement().appendChild(element);
|
||||
}
|
||||
} else if (paramLong == 8913094L) {
|
||||
str = "SRCAND_FILTER";
|
||||
Element element = document.getElementById(str);
|
||||
if (element == null) {
|
||||
element = this.gdi.getDocument().createElement("filter");
|
||||
element.setAttribute("id", str);
|
||||
element.setIdAttribute("id", true);
|
||||
Element element1 = document.createElement("feComposite");
|
||||
element1.setAttribute("in", "SourceGraphic");
|
||||
element1.setAttribute("in2", "BackgroundImage");
|
||||
element1.setAttribute("operator", "arithmetic");
|
||||
element1.setAttribute("k1", "1");
|
||||
element.appendChild(element1);
|
||||
this.gdi.getDefsElement().appendChild(element);
|
||||
}
|
||||
} else if (paramLong == 12255782L) {
|
||||
str = "MERGEPAINT_FILTER";
|
||||
Element element = document.getElementById(str);
|
||||
if (element == null) {
|
||||
element = this.gdi.getDocument().createElement("filter");
|
||||
element.setAttribute("id", str);
|
||||
element.setIdAttribute("id", true);
|
||||
Element element1 = document.createElement("feColorMatrix");
|
||||
element1.setAttribute("type", "matrix");
|
||||
element1.setAttribute("in", "SourceGraphic");
|
||||
element1.setAttribute("values", "-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0");
|
||||
element1.setAttribute("result", "result0");
|
||||
element.appendChild(element1);
|
||||
Element element2 = document.createElement("feComposite");
|
||||
element2.setAttribute("in", "result0");
|
||||
element2.setAttribute("in2", "BackgroundImage");
|
||||
element2.setAttribute("operator", "arithmetic");
|
||||
element2.setAttribute("k1", "1");
|
||||
element.appendChild(element2);
|
||||
this.gdi.getDefsElement().appendChild(element);
|
||||
}
|
||||
} else if (paramLong != 12583114L) {
|
||||
if (paramLong == 15597702L) {
|
||||
str = "SRCPAINT_FILTER";
|
||||
Element element = document.getElementById(str);
|
||||
if (element == null) {
|
||||
element = this.gdi.getDocument().createElement("filter");
|
||||
element.setAttribute("id", str);
|
||||
element.setIdAttribute("id", true);
|
||||
Element element1 = document.createElement("feComposite");
|
||||
element1.setAttribute("in", "SourceGraphic");
|
||||
element1.setAttribute("in2", "BackgroundImage");
|
||||
element1.setAttribute("operator", "arithmetic");
|
||||
element1.setAttribute("k2", "1");
|
||||
element1.setAttribute("k3", "1");
|
||||
element.appendChild(element1);
|
||||
this.gdi.getDefsElement().appendChild(element);
|
||||
}
|
||||
} else if (paramLong != 15728673L && paramLong != 16452105L && paramLong == 16711778L) {
|
||||
str = "WHITENESS_FILTER";
|
||||
Element element = document.getElementById(str);
|
||||
if (element == null) {
|
||||
element = this.gdi.getDocument().createElement("filter");
|
||||
element.setAttribute("id", str);
|
||||
element.setIdAttribute("id", true);
|
||||
Element element1 = document.createElement("feColorMatrix");
|
||||
element1.setAttribute("type", "matrix");
|
||||
element1.setAttribute("in", "SourceGraphic");
|
||||
element1.setAttribute("values", "1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 1 0");
|
||||
element.appendChild(element1);
|
||||
this.gdi.getDefsElement().appendChild(element);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (str != null) {
|
||||
if (!document.getDocumentElement().hasAttribute("enable-background"))
|
||||
document.getDocumentElement().setAttribute("enable-background", "new");
|
||||
return "url(#" + str + ")";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Object clone() {
|
||||
try {
|
||||
return super.clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
throw new InternalError(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "SvgDc [gdi=" + this.gdi + ", dpi=" + this.dpi + ", wx=" + this.wx + ", wy=" + this.wy + ", ww=" + this.ww + ", wh=" + this.wh + ", wox=" + this.wox + ", woy=" + this.woy + ", wsx=" + this.wsx + ", wsy=" + this.wsy + ", mx=" + this.mx + ", my=" + this.my + ", vx=" + this.vx + ", vy=" + this.vy + ", vw=" + this.vw + ", vh=" + this.vh + ", vox=" + this.vox + ", voy=" + this.voy + ", vsx=" + this.vsx + ", vsy=" + this.vsy + ", cx=" + this.cx + ", cy=" + this.cy + ", mapMode=" + this.mapMode + ", bkColor=" + this.bkColor + ", bkMode=" + this.bkMode + ", textColor=" + this.textColor + ", textSpace=" + this.textSpace + ", textAlign=" + this.textAlign + ", textDx=" + this.textDx + ", polyFillMode=" + this.polyFillMode + ", relAbsMode=" + this.relAbsMode + ", rop2Mode=" + this.rop2Mode + ", stretchBltMode=" + this.stretchBltMode + ", brush=" + this.brush + ", font=" + this.font + ", pen=" + this.pen + "]";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,289 @@
|
|||
package net.arnx.wmf2svg.gdi.svg;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import net.arnx.wmf2svg.gdi.GdiFont;
|
||||
import net.arnx.wmf2svg.gdi.GdiUtils;
|
||||
import org.w3c.dom.Text;
|
||||
|
||||
class SvgFont extends SvgObject implements GdiFont {
|
||||
private int height;
|
||||
|
||||
private int width;
|
||||
|
||||
private int escapement;
|
||||
|
||||
private int orientation;
|
||||
|
||||
private int weight;
|
||||
|
||||
private boolean italic;
|
||||
|
||||
private boolean underline;
|
||||
|
||||
private boolean strikeout;
|
||||
|
||||
private int charset;
|
||||
|
||||
private int outPrecision;
|
||||
|
||||
private int clipPrecision;
|
||||
|
||||
private int quality;
|
||||
|
||||
private int pitchAndFamily;
|
||||
|
||||
private String faceName;
|
||||
|
||||
private String lang;
|
||||
|
||||
public SvgFont(SvgGdi paramSvgGdi, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3, int paramInt6, int paramInt7, int paramInt8, int paramInt9, int paramInt10, byte[] paramArrayOfbyte) {
|
||||
super(paramSvgGdi);
|
||||
this.height = paramInt1;
|
||||
this.width = paramInt2;
|
||||
this.escapement = paramInt3;
|
||||
this.orientation = paramInt4;
|
||||
this.weight = paramInt5;
|
||||
this.italic = paramBoolean1;
|
||||
this.underline = paramBoolean2;
|
||||
this.strikeout = paramBoolean3;
|
||||
this.charset = paramInt6;
|
||||
this.outPrecision = paramInt7;
|
||||
this.clipPrecision = paramInt8;
|
||||
this.quality = paramInt9;
|
||||
this.pitchAndFamily = paramInt10;
|
||||
this.faceName = GdiUtils.convertString(paramArrayOfbyte, paramInt6);
|
||||
this.lang = GdiUtils.getLanguage(paramInt6);
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return this.height;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return this.width;
|
||||
}
|
||||
|
||||
public int getEscapement() {
|
||||
return this.escapement;
|
||||
}
|
||||
|
||||
public int getOrientation() {
|
||||
return this.orientation;
|
||||
}
|
||||
|
||||
public int getWeight() {
|
||||
return this.weight;
|
||||
}
|
||||
|
||||
public boolean isItalic() {
|
||||
return this.italic;
|
||||
}
|
||||
|
||||
public boolean isUnderlined() {
|
||||
return this.underline;
|
||||
}
|
||||
|
||||
public boolean isStrikedOut() {
|
||||
return this.strikeout;
|
||||
}
|
||||
|
||||
public int getCharset() {
|
||||
return this.charset;
|
||||
}
|
||||
|
||||
public int getOutPrecision() {
|
||||
return this.outPrecision;
|
||||
}
|
||||
|
||||
public int getClipPrecision() {
|
||||
return this.clipPrecision;
|
||||
}
|
||||
|
||||
public int getQuality() {
|
||||
return this.quality;
|
||||
}
|
||||
|
||||
public int getPitchAndFamily() {
|
||||
return this.pitchAndFamily;
|
||||
}
|
||||
|
||||
public String getFaceName() {
|
||||
return this.faceName;
|
||||
}
|
||||
|
||||
public String getLang() {
|
||||
return this.lang;
|
||||
}
|
||||
|
||||
private String getPitchString() {
|
||||
int i = this.pitchAndFamily & 0x3;
|
||||
switch (i) {
|
||||
case 1:
|
||||
return "FIXED_PITCH";
|
||||
case 2:
|
||||
return "VARIABLE_PITCH";
|
||||
}
|
||||
return "DEFAULT_PITCH";
|
||||
}
|
||||
|
||||
private String getFontFamilyString() {
|
||||
int i = this.pitchAndFamily & 0xF0;
|
||||
switch (i) {
|
||||
case 80:
|
||||
return "FF_DECORATIVE";
|
||||
case 48:
|
||||
return "FF_MODERN";
|
||||
case 16:
|
||||
return "FF_ROMAN";
|
||||
case 64:
|
||||
return "FF_SCRIPT";
|
||||
case 32:
|
||||
return "FF_SWISS";
|
||||
}
|
||||
return "FF_DONTCARE";
|
||||
}
|
||||
|
||||
public int[] validateDx(byte[] paramArrayOfbyte, int[] paramArrayOfint) {
|
||||
if (paramArrayOfint == null || paramArrayOfint.length == 0)
|
||||
return null;
|
||||
int[][] arrayOfInt = GdiUtils.getFirstByteArea(this.charset);
|
||||
if (arrayOfInt == null)
|
||||
return paramArrayOfint;
|
||||
int i = 0;
|
||||
boolean bool = false;
|
||||
for (int j = 0; j < paramArrayOfbyte.length && j < paramArrayOfint.length; j++) {
|
||||
int k = 0xFF & paramArrayOfbyte[j];
|
||||
if (bool) {
|
||||
paramArrayOfint[i - 1] = paramArrayOfint[i - 1] + paramArrayOfint[j];
|
||||
bool = false;
|
||||
} else {
|
||||
for (int m = 0; m < arrayOfInt.length; m++) {
|
||||
if (arrayOfInt[m][0] <= k && k <= arrayOfInt[m][1]) {
|
||||
bool = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
paramArrayOfint[i++] = paramArrayOfint[j];
|
||||
}
|
||||
}
|
||||
int[] arrayOfInt1 = new int[i];
|
||||
System.arraycopy(paramArrayOfint, 0, arrayOfInt1, 0, i);
|
||||
return arrayOfInt1;
|
||||
}
|
||||
|
||||
public int getFontSize() {
|
||||
return Math.abs(getGDI().getDC().toRelativeY((double)this.height));
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
null = 1;
|
||||
null = 31 * null + this.charset;
|
||||
null = 31 * null + this.clipPrecision;
|
||||
null = 31 * null + this.escapement;
|
||||
null = 31 * null + ((this.faceName == null) ? 0 : this.faceName.hashCode());
|
||||
null = 31 * null + this.height;
|
||||
null = 31 * null + (this.italic ? 1231 : 1237);
|
||||
null = 31 * null + this.orientation;
|
||||
null = 31 * null + this.outPrecision;
|
||||
null = 31 * null + this.pitchAndFamily;
|
||||
null = 31 * null + this.quality;
|
||||
null = 31 * null + (this.strikeout ? 1231 : 1237);
|
||||
null = 31 * null + (this.underline ? 1231 : 1237);
|
||||
null = 31 * null + this.weight;
|
||||
return 31 * null + this.width;
|
||||
}
|
||||
|
||||
public boolean equals(Object paramObject) {
|
||||
if (this == paramObject)
|
||||
return true;
|
||||
if (paramObject == null)
|
||||
return false;
|
||||
if (getClass() != paramObject.getClass())
|
||||
return false;
|
||||
SvgFont svgFont = (SvgFont)paramObject;
|
||||
if (this.charset != svgFont.charset)
|
||||
return false;
|
||||
if (this.clipPrecision != svgFont.clipPrecision)
|
||||
return false;
|
||||
if (this.escapement != svgFont.escapement)
|
||||
return false;
|
||||
if (this.faceName == null) {
|
||||
if (svgFont.faceName != null)
|
||||
return false;
|
||||
} else if (!this.faceName.equals(svgFont.faceName)) {
|
||||
return false;
|
||||
}
|
||||
return (this.height != svgFont.height) ? false : ((this.italic != svgFont.italic) ? false : ((this.orientation != svgFont.orientation) ? false : ((this.outPrecision != svgFont.outPrecision) ? false : ((this.pitchAndFamily != svgFont.pitchAndFamily) ? false : ((this.quality != svgFont.quality) ? false : ((this.strikeout != svgFont.strikeout) ? false : ((this.underline != svgFont.underline) ? false : ((this.weight != svgFont.weight) ? false : (!(this.width != svgFont.width))))))))));
|
||||
}
|
||||
|
||||
public Text createTextNode(String paramString) {
|
||||
return getGDI().getDocument().createTextNode("." + paramString + " { " + toString() + " }\n");
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
if (this.italic)
|
||||
stringBuffer.append("font-style: italic; ");
|
||||
if (this.weight != 0 && this.weight != 400) {
|
||||
if (this.weight < 100) {
|
||||
this.weight = 100;
|
||||
} else if (this.weight > 900) {
|
||||
this.weight = 900;
|
||||
} else {
|
||||
this.weight = this.weight / 100 * 100;
|
||||
}
|
||||
if (this.weight == 700) {
|
||||
stringBuffer.append("font-weight: bold; ");
|
||||
} else {
|
||||
stringBuffer.append("font-weight: " + this.weight + "; ");
|
||||
}
|
||||
}
|
||||
int i = getFontSize();
|
||||
if (i != 0)
|
||||
stringBuffer.append("font-size: ").append(i).append("px; ");
|
||||
ArrayList arrayList = new ArrayList();
|
||||
if (this.faceName.length() != 0) {
|
||||
String str3 = this.faceName;
|
||||
if (this.faceName.charAt(0) == '@')
|
||||
str3 = this.faceName.substring(1);
|
||||
arrayList.add(str3);
|
||||
String str4 = (String)getGDI().getProperty("alternative-font." + str3);
|
||||
if (str4 != null && str4.length() != 0)
|
||||
arrayList.add(str4);
|
||||
}
|
||||
String str1 = (String)getGDI().getProperty("generic-font." + getPitchString());
|
||||
String str2 = (String)getGDI().getProperty("generic-font." + getFontFamilyString());
|
||||
if (str1 != null && str1.length() != 0) {
|
||||
arrayList.add(str1);
|
||||
} else if (str2 != null && str2.length() != 0) {
|
||||
arrayList.add(str2);
|
||||
}
|
||||
if (!arrayList.isEmpty())
|
||||
stringBuffer.append("font-family:");
|
||||
boolean bool = false;
|
||||
Iterator iterator = arrayList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
String str = (String)iterator.next();
|
||||
if (str.indexOf(" ") != -1) {
|
||||
stringBuffer.append(" \"" + str + "\"");
|
||||
} else {
|
||||
stringBuffer.append(" " + str);
|
||||
}
|
||||
if (iterator.hasNext())
|
||||
stringBuffer.append(",");
|
||||
}
|
||||
stringBuffer.append("; ");
|
||||
if (this.underline || this.strikeout) {
|
||||
stringBuffer.append("text-decoration:");
|
||||
if (this.underline)
|
||||
stringBuffer.append(" underline");
|
||||
if (this.strikeout)
|
||||
stringBuffer.append(" overline");
|
||||
stringBuffer.append("; ");
|
||||
}
|
||||
if (stringBuffer.length() > 0)
|
||||
stringBuffer.setLength(stringBuffer.length() - 1);
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,20 @@
|
|||
# This file is used by the files under the wmf.svg package.
|
||||
|
||||
# These properties is used to convert windows generic fonts
|
||||
# to css generic font.
|
||||
#generic-font.DEFAULT_PITCH =
|
||||
#generic-font.VARIABLE_PITCH = sans-serif
|
||||
#generic-font.FIXED_PITCH = monospece
|
||||
generic-font.FF_DONTCARE =
|
||||
generic-font.FF_ROMAN = serif
|
||||
generic-font.FF_SWISS = sans-serif
|
||||
generic-font.FF_SCRIPT = cursive
|
||||
generic-font.FF_DECORATIVE = fantasy
|
||||
generic-font.FF_MODERN = monospace
|
||||
|
||||
# Font name converts for Adobe SVG Viewer
|
||||
alternative-font.\uff2d\uff33\ \u30b4\u30b7\u30c3\u30af = MS-Gothic
|
||||
alternative-font.\uff2d\uff33\ \uff30\u30b4\u30b7\u30c3\u30af = MS-PGothic
|
||||
alternative-font.\uff2d\uff33\ \u660e\u671d = MS-Mincho
|
||||
alternative-font.\uff2d\uff33\ \uff30\u660e\u671d = MS-PMincho
|
||||
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package net.arnx.wmf2svg.gdi.svg;
|
||||
|
||||
import net.arnx.wmf2svg.gdi.GdiException;
|
||||
|
||||
public class SvgGdiException extends GdiException {
|
||||
private static final long serialVersionUID = -2096332410542422534L;
|
||||
|
||||
public SvgGdiException() {}
|
||||
|
||||
public SvgGdiException(String paramString) {
|
||||
super(paramString);
|
||||
}
|
||||
|
||||
public SvgGdiException(String paramString, Throwable paramThrowable) {
|
||||
super(paramString, paramThrowable);
|
||||
}
|
||||
|
||||
public SvgGdiException(Throwable paramThrowable) {
|
||||
super(paramThrowable);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package net.arnx.wmf2svg.gdi.svg;
|
||||
|
||||
abstract class SvgObject {
|
||||
private SvgGdi gdi;
|
||||
|
||||
public SvgObject(SvgGdi paramSvgGdi) {
|
||||
this.gdi = paramSvgGdi;
|
||||
}
|
||||
|
||||
public SvgGdi getGDI() {
|
||||
return this.gdi;
|
||||
}
|
||||
|
||||
public int toRealSize(int paramInt) {
|
||||
return getGDI().getDC().getDpi() * paramInt / 90;
|
||||
}
|
||||
|
||||
public static String toColor(int paramInt) {
|
||||
int i = (0xFF0000 & paramInt) >> 16;
|
||||
int j = (0xFF00 & paramInt) >> 8;
|
||||
int k = 0xFF & paramInt;
|
||||
return "rgb(" + k + "," + j + "," + i + ")";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package net.arnx.wmf2svg.gdi.svg;
|
||||
|
||||
import net.arnx.wmf2svg.gdi.GdiPalette;
|
||||
|
||||
class SvgPalette extends SvgObject implements GdiPalette {
|
||||
private int version;
|
||||
|
||||
private int[] entries;
|
||||
|
||||
public SvgPalette(SvgGdi paramSvgGdi, int paramInt, int[] paramArrayOfint) {
|
||||
super(paramSvgGdi);
|
||||
this.version = paramInt;
|
||||
this.entries = paramArrayOfint;
|
||||
}
|
||||
|
||||
public int getVersion() {
|
||||
return this.version;
|
||||
}
|
||||
|
||||
public int[] getEntries() {
|
||||
return this.entries;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package net.arnx.wmf2svg.gdi.svg;
|
||||
|
||||
import net.arnx.wmf2svg.gdi.GdiPatternBrush;
|
||||
|
||||
class SvgPatternBrush extends SvgObject implements GdiPatternBrush {
|
||||
private byte[] bmp;
|
||||
|
||||
public SvgPatternBrush(SvgGdi paramSvgGdi, byte[] paramArrayOfbyte) {
|
||||
super(paramSvgGdi);
|
||||
this.bmp = paramArrayOfbyte;
|
||||
}
|
||||
|
||||
public byte[] getPattern() {
|
||||
return this.bmp;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
package net.arnx.wmf2svg.gdi.svg;
|
||||
|
||||
import net.arnx.wmf2svg.gdi.GdiPen;
|
||||
import org.w3c.dom.Text;
|
||||
|
||||
class SvgPen extends SvgObject implements GdiPen {
|
||||
private int style;
|
||||
|
||||
private int width;
|
||||
|
||||
private int color;
|
||||
|
||||
public SvgPen(SvgGdi paramSvgGdi, int paramInt1, int paramInt2, int paramInt3) {
|
||||
super(paramSvgGdi);
|
||||
this.style = paramInt1;
|
||||
this.width = (paramInt2 > 0) ? paramInt2 : 1;
|
||||
this.color = paramInt3;
|
||||
}
|
||||
|
||||
public int getStyle() {
|
||||
return this.style;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return this.width;
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
null = 1;
|
||||
null = 31 * null + this.color;
|
||||
null = 31 * null + this.style;
|
||||
return 31 * null + this.width;
|
||||
}
|
||||
|
||||
public boolean equals(Object paramObject) {
|
||||
if (this == paramObject)
|
||||
return true;
|
||||
if (paramObject == null)
|
||||
return false;
|
||||
if (getClass() != paramObject.getClass())
|
||||
return false;
|
||||
SvgPen svgPen = (SvgPen)paramObject;
|
||||
return (this.color != svgPen.color) ? false : ((this.style != svgPen.style) ? false : (!(this.width != svgPen.width)));
|
||||
}
|
||||
|
||||
public Text createTextNode(String paramString) {
|
||||
return getGDI().getDocument().createTextNode("." + paramString + " { " + toString() + " }\n");
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
if (this.style == 5) {
|
||||
stringBuffer.append("stroke: none; ");
|
||||
} else {
|
||||
stringBuffer.append("stroke: " + toColor(this.color) + "; ");
|
||||
stringBuffer.append("stroke-width: " + this.width + "; ");
|
||||
stringBuffer.append("stroke-linejoin: round; ");
|
||||
if (this.width == 1 && 1 <= this.style && this.style <= 4) {
|
||||
stringBuffer.append("stroke-dasharray: ");
|
||||
switch (this.style) {
|
||||
case 1:
|
||||
stringBuffer.append("" + toRealSize(18) + "," + toRealSize(6));
|
||||
break;
|
||||
case 2:
|
||||
stringBuffer.append("" + toRealSize(3) + "," + toRealSize(3));
|
||||
break;
|
||||
case 3:
|
||||
stringBuffer.append("" + toRealSize(9) + "," + toRealSize(3) + "," + toRealSize(3) + "," + toRealSize(3));
|
||||
break;
|
||||
case 4:
|
||||
stringBuffer.append("" + toRealSize(9) + "," + toRealSize(3) + "," + toRealSize(3) + "," + toRealSize(3) + "," + toRealSize(3) + "," + toRealSize(3));
|
||||
break;
|
||||
}
|
||||
stringBuffer.append("; ");
|
||||
}
|
||||
}
|
||||
if (stringBuffer.length() > 0)
|
||||
stringBuffer.setLength(stringBuffer.length() - 1);
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package net.arnx.wmf2svg.gdi.svg;
|
||||
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
class SvgRectRegion extends SvgRegion {
|
||||
private int left;
|
||||
|
||||
private int top;
|
||||
|
||||
private int right;
|
||||
|
||||
private int bottom;
|
||||
|
||||
public SvgRectRegion(SvgGdi paramSvgGdi, int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
|
||||
super(paramSvgGdi);
|
||||
this.left = paramInt1;
|
||||
this.top = paramInt2;
|
||||
this.right = paramInt3;
|
||||
this.bottom = paramInt4;
|
||||
}
|
||||
|
||||
public int getLeft() {
|
||||
return this.left;
|
||||
}
|
||||
|
||||
public int getTop() {
|
||||
return this.top;
|
||||
}
|
||||
|
||||
public int getRight() {
|
||||
return this.right;
|
||||
}
|
||||
|
||||
public int getBottom() {
|
||||
return this.bottom;
|
||||
}
|
||||
|
||||
public Element createElement() {
|
||||
Element element = getGDI().getDocument().createElement("rect");
|
||||
element.setAttribute("x", "" + getGDI().getDC().toAbsoluteX((double)getLeft()));
|
||||
element.setAttribute("y", "" + getGDI().getDC().toAbsoluteY((double)getTop()));
|
||||
element.setAttribute("width", "" + getGDI().getDC().toRelativeX((double)(getRight() - getLeft())));
|
||||
element.setAttribute("height", "" + getGDI().getDC().toRelativeY((double)(getBottom() - getTop())));
|
||||
return element;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
null = 1;
|
||||
null = 31 * null + this.bottom;
|
||||
null = 31 * null + this.left;
|
||||
null = 31 * null + this.right;
|
||||
return 31 * null + this.top;
|
||||
}
|
||||
|
||||
public boolean equals(Object paramObject) {
|
||||
if (this == paramObject)
|
||||
return true;
|
||||
if (paramObject == null)
|
||||
return false;
|
||||
if (getClass() != paramObject.getClass())
|
||||
return false;
|
||||
SvgRectRegion svgRectRegion = (SvgRectRegion)paramObject;
|
||||
return (this.bottom != svgRectRegion.bottom) ? false : ((this.left != svgRectRegion.left) ? false : ((this.right != svgRectRegion.right) ? false : (!(this.top != svgRectRegion.top))));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package net.arnx.wmf2svg.gdi.svg;
|
||||
|
||||
import net.arnx.wmf2svg.gdi.GdiRegion;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
abstract class SvgRegion extends SvgObject implements GdiRegion {
|
||||
public SvgRegion(SvgGdi paramSvgGdi) {
|
||||
super(paramSvgGdi);
|
||||
}
|
||||
|
||||
public abstract Element createElement();
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package net.arnx.wmf2svg.gdi.wmf;
|
||||
|
||||
import net.arnx.wmf2svg.gdi.GdiBrush;
|
||||
|
||||
class WmfBrush extends WmfObject implements GdiBrush {
|
||||
private int style;
|
||||
|
||||
private int color;
|
||||
|
||||
private int hatch;
|
||||
|
||||
public WmfBrush(int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
|
||||
super(paramInt1);
|
||||
this.style = paramInt2;
|
||||
this.color = paramInt3;
|
||||
this.hatch = paramInt4;
|
||||
}
|
||||
|
||||
public int getStyle() {
|
||||
return this.style;
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
public int getHatch() {
|
||||
return this.hatch;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,141 @@
|
|||
package net.arnx.wmf2svg.gdi.wmf;
|
||||
|
||||
interface WmfConstants {
|
||||
public static final int RECORD_ANIMATE_PALETTE = 1078;
|
||||
|
||||
public static final int RECORD_ARC = 2071;
|
||||
|
||||
public static final int RECORD_BIT_BLT = 2338;
|
||||
|
||||
public static final int RECORD_CHORD = 2096;
|
||||
|
||||
public static final int RECORD_CREATE_BRUSH_INDIRECT = 764;
|
||||
|
||||
public static final int RECORD_CREATE_FONT_INDIRECT = 763;
|
||||
|
||||
public static final int RECORD_CREATE_PALETTE = 247;
|
||||
|
||||
public static final int RECORD_CREATE_PATTERN_BRUSH = 505;
|
||||
|
||||
public static final int RECORD_CREATE_PEN_INDIRECT = 762;
|
||||
|
||||
public static final int RECORD_CREATE_RECT_RGN = 1791;
|
||||
|
||||
public static final int RECORD_DELETE_OBJECT = 496;
|
||||
|
||||
public static final int RECORD_DIB_BIT_BLT = 2368;
|
||||
|
||||
public static final int RECORD_DIB_CREATE_PATTERN_BRUSH = 322;
|
||||
|
||||
public static final int RECORD_DIB_STRETCH_BLT = 2881;
|
||||
|
||||
public static final int RECORD_ELLIPSE = 1048;
|
||||
|
||||
public static final int RECORD_ESCAPE = 1574;
|
||||
|
||||
public static final int RECORD_EXCLUDE_CLIP_RECT = 1045;
|
||||
|
||||
public static final int RECORD_EXT_FLOOD_FILL = 1352;
|
||||
|
||||
public static final int RECORD_EXT_TEXT_OUT = 2610;
|
||||
|
||||
public static final int RECORD_FILL_RGN = 552;
|
||||
|
||||
public static final int RECORD_FLOOD_FILL = 1049;
|
||||
|
||||
public static final int RECORD_FRAME_RGN = 1065;
|
||||
|
||||
public static final int RECORD_INTERSECT_CLIP_RECT = 1046;
|
||||
|
||||
public static final int RECORD_INVERT_RGN = 298;
|
||||
|
||||
public static final int RECORD_LINE_TO = 531;
|
||||
|
||||
public static final int RECORD_MOVE_TO_EX = 532;
|
||||
|
||||
public static final int RECORD_OFFSET_CLIP_RGN = 544;
|
||||
|
||||
public static final int RECORD_OFFSET_VIEWPORT_ORG_EX = 529;
|
||||
|
||||
public static final int RECORD_OFFSET_WINDOW_ORG_EX = 527;
|
||||
|
||||
public static final int RECORD_PAINT_RGN = 299;
|
||||
|
||||
public static final int RECORD_PAT_BLT = 1565;
|
||||
|
||||
public static final int RECORD_PIE = 2074;
|
||||
|
||||
public static final int RECORD_POLYGON = 804;
|
||||
|
||||
public static final int RECORD_POLYLINE = 805;
|
||||
|
||||
public static final int RECORD_POLY_POLYGON = 1336;
|
||||
|
||||
public static final int RECORD_REALIZE_PALETTE = 53;
|
||||
|
||||
public static final int RECORD_RECTANGLE = 1051;
|
||||
|
||||
public static final int RECORD_RESIZE_PALETTE = 313;
|
||||
|
||||
public static final int RECORD_RESTORE_DC = 295;
|
||||
|
||||
public static final int RECORD_ROUND_RECT = 1564;
|
||||
|
||||
public static final int RECORD_SAVE_DC = 30;
|
||||
|
||||
public static final int RECORD_SCALE_VIEWPORT_EXT_EX = 1042;
|
||||
|
||||
public static final int RECORD_SCALE_WINDOW_EXT_EX = 1040;
|
||||
|
||||
public static final int RECORD_SELECT_CLIP_RGN = 300;
|
||||
|
||||
public static final int RECORD_SELECT_OBJECT = 301;
|
||||
|
||||
public static final int RECORD_SELECT_PALETTE = 564;
|
||||
|
||||
public static final int RECORD_SET_BK_COLOR = 513;
|
||||
|
||||
public static final int RECORD_SET_BK_MODE = 258;
|
||||
|
||||
public static final int RECORD_SET_DIBITS_TO_DEVICE = 3379;
|
||||
|
||||
public static final int RECORD_SET_LAYOUT = 329;
|
||||
|
||||
public static final int RECORD_SET_MAP_MODE = 259;
|
||||
|
||||
public static final int RECORD_SET_MAPPER_FLAGS = 561;
|
||||
|
||||
public static final int RECORD_SET_PALETTE_ENTRIES = 55;
|
||||
|
||||
public static final int RECORD_SET_PIXEL = 1055;
|
||||
|
||||
public static final int RECORD_SET_POLY_FILL_MODE = 262;
|
||||
|
||||
public static final int RECORD_SET_REL_ABS = 261;
|
||||
|
||||
public static final int RECORD_SET_ROP2 = 260;
|
||||
|
||||
public static final int RECORD_SET_STRETCH_BLT_MODE = 263;
|
||||
|
||||
public static final int RECORD_SET_TEXT_ALIGN = 302;
|
||||
|
||||
public static final int RECORD_SET_TEXT_CHARACTER_EXTRA = 264;
|
||||
|
||||
public static final int RECORD_SET_TEXT_COLOR = 521;
|
||||
|
||||
public static final int RECORD_SET_TEXT_JUSTIFICATION = 522;
|
||||
|
||||
public static final int RECORD_SET_VIEWPORT_EXT_EX = 526;
|
||||
|
||||
public static final int RECORD_SET_VIEWPORT_ORG_EX = 525;
|
||||
|
||||
public static final int RECORD_SET_WINDOW_EXT_EX = 524;
|
||||
|
||||
public static final int RECORD_SET_WINDOW_ORG_EX = 523;
|
||||
|
||||
public static final int RECORD_STRETCH_BLT = 2851;
|
||||
|
||||
public static final int RECORD_STRETCH_DIBITS = 3907;
|
||||
|
||||
public static final int RECORD_TEXT_OUT = 1313;
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
package net.arnx.wmf2svg.gdi.wmf;
|
||||
|
||||
import net.arnx.wmf2svg.gdi.GdiFont;
|
||||
import net.arnx.wmf2svg.gdi.GdiUtils;
|
||||
|
||||
class WmfFont extends WmfObject implements GdiFont {
|
||||
private int height;
|
||||
|
||||
private int width;
|
||||
|
||||
private int escapement;
|
||||
|
||||
private int orientation;
|
||||
|
||||
private int weight;
|
||||
|
||||
private boolean italic;
|
||||
|
||||
private boolean underline;
|
||||
|
||||
private boolean strikeout;
|
||||
|
||||
private int charset;
|
||||
|
||||
private int outPrecision;
|
||||
|
||||
private int clipPrecision;
|
||||
|
||||
private int quality;
|
||||
|
||||
private int pitchAndFamily;
|
||||
|
||||
private String faceName;
|
||||
|
||||
public WmfFont(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3, int paramInt7, int paramInt8, int paramInt9, int paramInt10, int paramInt11, byte[] paramArrayOfbyte) {
|
||||
super(paramInt1);
|
||||
this.height = paramInt2;
|
||||
this.width = paramInt3;
|
||||
this.escapement = paramInt4;
|
||||
this.orientation = paramInt5;
|
||||
this.weight = paramInt6;
|
||||
this.italic = paramBoolean1;
|
||||
this.underline = paramBoolean2;
|
||||
this.strikeout = paramBoolean3;
|
||||
this.charset = paramInt7;
|
||||
this.outPrecision = paramInt8;
|
||||
this.clipPrecision = paramInt9;
|
||||
this.quality = paramInt10;
|
||||
this.pitchAndFamily = paramInt11;
|
||||
this.faceName = GdiUtils.convertString(paramArrayOfbyte, paramInt7);
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return this.height;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return this.width;
|
||||
}
|
||||
|
||||
public int getEscapement() {
|
||||
return this.escapement;
|
||||
}
|
||||
|
||||
public int getOrientation() {
|
||||
return this.orientation;
|
||||
}
|
||||
|
||||
public int getWeight() {
|
||||
return this.weight;
|
||||
}
|
||||
|
||||
public boolean isItalic() {
|
||||
return this.italic;
|
||||
}
|
||||
|
||||
public boolean isUnderlined() {
|
||||
return this.underline;
|
||||
}
|
||||
|
||||
public boolean isStrikedOut() {
|
||||
return this.strikeout;
|
||||
}
|
||||
|
||||
public int getCharset() {
|
||||
return this.charset;
|
||||
}
|
||||
|
||||
public int getOutPrecision() {
|
||||
return this.outPrecision;
|
||||
}
|
||||
|
||||
public int getClipPrecision() {
|
||||
return this.clipPrecision;
|
||||
}
|
||||
|
||||
public int getQuality() {
|
||||
return this.quality;
|
||||
}
|
||||
|
||||
public int getPitchAndFamily() {
|
||||
return this.pitchAndFamily;
|
||||
}
|
||||
|
||||
public String getFaceName() {
|
||||
return this.faceName;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,986 @@
|
|||
package net.arnx.wmf2svg.gdi.wmf;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import net.arnx.wmf2svg.gdi.Gdi;
|
||||
import net.arnx.wmf2svg.gdi.GdiBrush;
|
||||
import net.arnx.wmf2svg.gdi.GdiFont;
|
||||
import net.arnx.wmf2svg.gdi.GdiObject;
|
||||
import net.arnx.wmf2svg.gdi.GdiPalette;
|
||||
import net.arnx.wmf2svg.gdi.GdiPatternBrush;
|
||||
import net.arnx.wmf2svg.gdi.GdiPen;
|
||||
import net.arnx.wmf2svg.gdi.GdiRegion;
|
||||
import net.arnx.wmf2svg.gdi.Point;
|
||||
import net.arnx.wmf2svg.gdi.Size;
|
||||
|
||||
public class WmfGdi implements Gdi, WmfConstants {
|
||||
private byte[] placeableHeader;
|
||||
|
||||
private byte[] header;
|
||||
|
||||
private List objects = new ArrayList();
|
||||
|
||||
private List records = new ArrayList();
|
||||
|
||||
public void write(OutputStream paramOutputStream) throws IOException {
|
||||
footer();
|
||||
if (this.placeableHeader != null)
|
||||
paramOutputStream.write(this.placeableHeader);
|
||||
if (this.header != null)
|
||||
paramOutputStream.write(this.header);
|
||||
Iterator iterator = this.records.iterator();
|
||||
while (iterator.hasNext())
|
||||
paramOutputStream.write((byte[])iterator.next());
|
||||
}
|
||||
|
||||
public void placeableHeader(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5) {
|
||||
byte[] arrayOfByte = new byte[22];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, -1698247209L);
|
||||
i = setInt16(arrayOfByte, i, 0);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt3);
|
||||
i = setInt16(arrayOfByte, i, paramInt4);
|
||||
i = setUint16(arrayOfByte, i, paramInt5);
|
||||
i = setUint32(arrayOfByte, i, 0L);
|
||||
int j = 0;
|
||||
for (int k = 0; k < arrayOfByte.length - 2; k += 2)
|
||||
j ^= 0xFF & arrayOfByte[k] | (0xFF & arrayOfByte[k + 1]) << 8;
|
||||
i = setUint16(arrayOfByte, i, j);
|
||||
this.placeableHeader = arrayOfByte;
|
||||
}
|
||||
|
||||
public void header() {
|
||||
byte[] arrayOfByte = new byte[18];
|
||||
int i = 0;
|
||||
i = setUint16(arrayOfByte, i, 1);
|
||||
i = setUint16(arrayOfByte, i, 9);
|
||||
i = setUint16(arrayOfByte, i, 768);
|
||||
i = setUint32(arrayOfByte, i, 0L);
|
||||
i = setUint16(arrayOfByte, i, 0);
|
||||
i = setUint32(arrayOfByte, i, 0L);
|
||||
i = setUint16(arrayOfByte, i, 0);
|
||||
this.header = arrayOfByte;
|
||||
}
|
||||
|
||||
public void animatePalette(GdiPalette paramGdiPalette, int paramInt, int[] paramArrayOfint) {
|
||||
byte[] arrayOfByte = new byte[22];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 1078);
|
||||
i = setUint16(arrayOfByte, i, paramArrayOfint.length);
|
||||
i = setUint16(arrayOfByte, i, paramInt);
|
||||
i = setUint16(arrayOfByte, i, ((WmfPalette)paramGdiPalette).getID());
|
||||
for (int j = 0; j < paramArrayOfint.length; j++)
|
||||
i = setInt32(arrayOfByte, i, paramArrayOfint[j]);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void arc(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8) {
|
||||
byte[] arrayOfByte = new byte[22];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 2071);
|
||||
i = setInt16(arrayOfByte, i, paramInt8);
|
||||
i = setInt16(arrayOfByte, i, paramInt7);
|
||||
i = setInt16(arrayOfByte, i, paramInt6);
|
||||
i = setInt16(arrayOfByte, i, paramInt5);
|
||||
i = setInt16(arrayOfByte, i, paramInt4);
|
||||
i = setInt16(arrayOfByte, i, paramInt3);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void bitBlt(byte[] paramArrayOfbyte, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, long paramLong) {
|
||||
byte[] arrayOfByte = new byte[22 + paramArrayOfbyte.length + paramArrayOfbyte.length % 2];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 2338);
|
||||
i = setUint32(arrayOfByte, i, paramLong);
|
||||
i = setInt16(arrayOfByte, i, paramInt6);
|
||||
i = setInt16(arrayOfByte, i, paramInt5);
|
||||
i = setInt16(arrayOfByte, i, paramInt3);
|
||||
i = setInt16(arrayOfByte, i, paramInt4);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
i = setBytes(arrayOfByte, i, paramArrayOfbyte);
|
||||
if (paramArrayOfbyte.length % 2 == 1)
|
||||
i = setByte(arrayOfByte, i, 0);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void chord(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8) {
|
||||
byte[] arrayOfByte = new byte[22];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 2096);
|
||||
i = setInt16(arrayOfByte, i, paramInt8);
|
||||
i = setInt16(arrayOfByte, i, paramInt7);
|
||||
i = setInt16(arrayOfByte, i, paramInt6);
|
||||
i = setInt16(arrayOfByte, i, paramInt5);
|
||||
i = setInt16(arrayOfByte, i, paramInt4);
|
||||
i = setInt16(arrayOfByte, i, paramInt3);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public GdiBrush createBrushIndirect(int paramInt1, int paramInt2, int paramInt3) {
|
||||
byte[] arrayOfByte = new byte[14];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 764);
|
||||
i = setUint16(arrayOfByte, i, paramInt1);
|
||||
i = setInt32(arrayOfByte, i, paramInt2);
|
||||
i = setUint16(arrayOfByte, i, paramInt3);
|
||||
this.records.add(arrayOfByte);
|
||||
WmfBrush wmfBrush = new WmfBrush(this.objects.size(), paramInt1, paramInt2, paramInt3);
|
||||
this.objects.add(wmfBrush);
|
||||
return wmfBrush;
|
||||
}
|
||||
|
||||
public GdiFont createFontIndirect(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3, int paramInt6, int paramInt7, int paramInt8, int paramInt9, int paramInt10, byte[] paramArrayOfbyte) {
|
||||
byte[] arrayOfByte = new byte[24 + paramArrayOfbyte.length + paramArrayOfbyte.length % 2];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 763);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt3);
|
||||
i = setInt16(arrayOfByte, i, paramInt4);
|
||||
i = setInt16(arrayOfByte, i, paramInt5);
|
||||
i = setByte(arrayOfByte, i, paramBoolean1 ? 1 : 0);
|
||||
i = setByte(arrayOfByte, i, paramBoolean2 ? 1 : 0);
|
||||
i = setByte(arrayOfByte, i, paramBoolean3 ? 1 : 0);
|
||||
i = setByte(arrayOfByte, i, paramInt6);
|
||||
i = setByte(arrayOfByte, i, paramInt7);
|
||||
i = setByte(arrayOfByte, i, paramInt8);
|
||||
i = setByte(arrayOfByte, i, paramInt9);
|
||||
i = setByte(arrayOfByte, i, paramInt10);
|
||||
i = setBytes(arrayOfByte, i, paramArrayOfbyte);
|
||||
if (paramArrayOfbyte.length % 2 == 1)
|
||||
i = setByte(arrayOfByte, i, 0);
|
||||
this.records.add(arrayOfByte);
|
||||
WmfFont wmfFont = new WmfFont(this.objects.size(), paramInt1, paramInt2, paramInt3, paramInt4, paramInt5, paramBoolean1, paramBoolean2, paramBoolean3, paramInt6, paramInt7, paramInt8, paramInt9, paramInt10, paramArrayOfbyte);
|
||||
this.objects.add(wmfFont);
|
||||
return wmfFont;
|
||||
}
|
||||
|
||||
public GdiPalette createPalette(int paramInt, int[] paramArrayOfint) {
|
||||
byte[] arrayOfByte = new byte[10 + paramArrayOfint.length * 4];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 247);
|
||||
i = setUint16(arrayOfByte, i, paramInt);
|
||||
i = setUint16(arrayOfByte, i, paramArrayOfint.length);
|
||||
for (int j = 0; j < paramArrayOfint.length; j++)
|
||||
i = setInt32(arrayOfByte, i, paramArrayOfint[j]);
|
||||
this.records.add(arrayOfByte);
|
||||
WmfPalette wmfPalette = new WmfPalette(this.objects.size(), paramInt, paramArrayOfint);
|
||||
this.objects.add(wmfPalette);
|
||||
return wmfPalette;
|
||||
}
|
||||
|
||||
public GdiPatternBrush createPatternBrush(byte[] paramArrayOfbyte) {
|
||||
byte[] arrayOfByte = new byte[6 + paramArrayOfbyte.length + paramArrayOfbyte.length % 2];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 505);
|
||||
i = setBytes(arrayOfByte, i, paramArrayOfbyte);
|
||||
if (paramArrayOfbyte.length % 2 == 1)
|
||||
i = setByte(arrayOfByte, i, 0);
|
||||
this.records.add(arrayOfByte);
|
||||
WmfPatternBrush wmfPatternBrush = new WmfPatternBrush(this.objects.size(), paramArrayOfbyte);
|
||||
this.objects.add(wmfPatternBrush);
|
||||
return wmfPatternBrush;
|
||||
}
|
||||
|
||||
public GdiPen createPenIndirect(int paramInt1, int paramInt2, int paramInt3) {
|
||||
byte[] arrayOfByte = new byte[16];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 762);
|
||||
i = setUint16(arrayOfByte, i, paramInt1);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, 0);
|
||||
i = setInt32(arrayOfByte, i, paramInt3);
|
||||
this.records.add(arrayOfByte);
|
||||
WmfPen wmfPen = new WmfPen(this.objects.size(), paramInt1, paramInt2, paramInt3);
|
||||
this.objects.add(wmfPen);
|
||||
return wmfPen;
|
||||
}
|
||||
|
||||
public GdiRegion createRectRgn(int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
|
||||
byte[] arrayOfByte = new byte[14];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 1791);
|
||||
i = setInt16(arrayOfByte, i, paramInt4);
|
||||
i = setInt16(arrayOfByte, i, paramInt3);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
WmfRectRegion wmfRectRegion = new WmfRectRegion(this.objects.size(), paramInt1, paramInt2, paramInt3, paramInt4);
|
||||
this.objects.add(wmfRectRegion);
|
||||
return wmfRectRegion;
|
||||
}
|
||||
|
||||
public void deleteObject(GdiObject paramGdiObject) {
|
||||
byte[] arrayOfByte = new byte[8];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 496);
|
||||
i = setUint16(arrayOfByte, i, ((WmfObject)paramGdiObject).getID());
|
||||
this.records.add(arrayOfByte);
|
||||
this.objects.set(((WmfObject)paramGdiObject).getID(), null);
|
||||
}
|
||||
|
||||
public void dibBitBlt(byte[] paramArrayOfbyte, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, long paramLong) {
|
||||
byte[] arrayOfByte = new byte[22 + paramArrayOfbyte.length + paramArrayOfbyte.length % 2];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 2368);
|
||||
i = setUint32(arrayOfByte, i, paramLong);
|
||||
i = setInt16(arrayOfByte, i, paramInt6);
|
||||
i = setInt16(arrayOfByte, i, paramInt5);
|
||||
i = setInt16(arrayOfByte, i, paramInt3);
|
||||
i = setInt16(arrayOfByte, i, paramInt4);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
i = setBytes(arrayOfByte, i, paramArrayOfbyte);
|
||||
if (paramArrayOfbyte.length % 2 == 1)
|
||||
i = setByte(arrayOfByte, i, 0);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public GdiPatternBrush dibCreatePatternBrush(byte[] paramArrayOfbyte, int paramInt) {
|
||||
byte[] arrayOfByte = new byte[10 + paramArrayOfbyte.length + paramArrayOfbyte.length % 2];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 322);
|
||||
i = setInt32(arrayOfByte, i, paramInt);
|
||||
i = setBytes(arrayOfByte, i, paramArrayOfbyte);
|
||||
if (paramArrayOfbyte.length % 2 == 1)
|
||||
i = setByte(arrayOfByte, i, 0);
|
||||
this.records.add(arrayOfByte);
|
||||
WmfPatternBrush wmfPatternBrush = new WmfPatternBrush(this.objects.size(), paramArrayOfbyte);
|
||||
this.objects.add(wmfPatternBrush);
|
||||
return wmfPatternBrush;
|
||||
}
|
||||
|
||||
public void dibStretchBlt(byte[] paramArrayOfbyte, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8, long paramLong) {
|
||||
byte[] arrayOfByte = new byte[26 + paramArrayOfbyte.length + paramArrayOfbyte.length % 2];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 2881);
|
||||
i = setUint32(arrayOfByte, i, paramLong);
|
||||
i = setInt16(arrayOfByte, i, paramInt8);
|
||||
i = setInt16(arrayOfByte, i, paramInt7);
|
||||
i = setInt16(arrayOfByte, i, paramInt6);
|
||||
i = setInt16(arrayOfByte, i, paramInt5);
|
||||
i = setInt16(arrayOfByte, i, paramInt3);
|
||||
i = setInt16(arrayOfByte, i, paramInt4);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
i = setBytes(arrayOfByte, i, paramArrayOfbyte);
|
||||
if (paramArrayOfbyte.length % 2 == 1)
|
||||
i = setByte(arrayOfByte, i, 0);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void ellipse(int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
|
||||
byte[] arrayOfByte = new byte[14];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 1048);
|
||||
i = setInt16(arrayOfByte, i, paramInt4);
|
||||
i = setInt16(arrayOfByte, i, paramInt3);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void escape(byte[] paramArrayOfbyte) {
|
||||
byte[] arrayOfByte = new byte[10 + paramArrayOfbyte.length + paramArrayOfbyte.length % 2];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 1574);
|
||||
i = setBytes(arrayOfByte, i, paramArrayOfbyte);
|
||||
if (paramArrayOfbyte.length % 2 == 1)
|
||||
i = setByte(arrayOfByte, i, 0);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public int excludeClipRect(int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
|
||||
byte[] arrayOfByte = new byte[14];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 1045);
|
||||
i = setInt16(arrayOfByte, i, paramInt4);
|
||||
i = setInt16(arrayOfByte, i, paramInt3);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
return 3;
|
||||
}
|
||||
|
||||
public void extFloodFill(int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
|
||||
byte[] arrayOfByte = new byte[16];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 1352);
|
||||
i = setUint16(arrayOfByte, i, paramInt4);
|
||||
i = setInt32(arrayOfByte, i, paramInt3);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void extTextOut(int paramInt1, int paramInt2, int paramInt3, int[] paramArrayOfint1, byte[] paramArrayOfbyte, int[] paramArrayOfint2) {
|
||||
if (paramArrayOfint1 != null && paramArrayOfint1.length != 4)
|
||||
throw new IllegalArgumentException("rect must be 4 length.");
|
||||
byte[] arrayOfByte = new byte[14 + ((paramArrayOfint1 != null) ? 8 : 0) + paramArrayOfbyte.length + paramArrayOfbyte.length % 2 + paramArrayOfint2.length * 2];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 2610);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
i = setInt16(arrayOfByte, i, paramArrayOfbyte.length);
|
||||
i = setInt16(arrayOfByte, i, paramInt3);
|
||||
if (paramArrayOfint1 != null) {
|
||||
i = setInt16(arrayOfByte, i, paramArrayOfint1[0]);
|
||||
i = setInt16(arrayOfByte, i, paramArrayOfint1[1]);
|
||||
i = setInt16(arrayOfByte, i, paramArrayOfint1[2]);
|
||||
i = setInt16(arrayOfByte, i, paramArrayOfint1[3]);
|
||||
}
|
||||
i = setBytes(arrayOfByte, i, paramArrayOfbyte);
|
||||
if (paramArrayOfbyte.length % 2 == 1)
|
||||
i = setByte(arrayOfByte, i, 0);
|
||||
for (int j = 0; j < paramArrayOfint2.length; j++)
|
||||
i = setInt16(arrayOfByte, i, paramArrayOfint2[j]);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void fillRgn(GdiRegion paramGdiRegion, GdiBrush paramGdiBrush) {
|
||||
byte[] arrayOfByte = new byte[10];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 1049);
|
||||
i = setUint16(arrayOfByte, i, ((WmfBrush)paramGdiBrush).getID());
|
||||
i = setUint16(arrayOfByte, i, ((WmfRegion)paramGdiRegion).getID());
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void floodFill(int paramInt1, int paramInt2, int paramInt3) {
|
||||
byte[] arrayOfByte = new byte[16];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 1049);
|
||||
i = setInt32(arrayOfByte, i, paramInt3);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void frameRgn(GdiRegion paramGdiRegion, GdiBrush paramGdiBrush, int paramInt1, int paramInt2) {
|
||||
byte[] arrayOfByte = new byte[14];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 1065);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
i = setUint16(arrayOfByte, i, ((WmfBrush)paramGdiBrush).getID());
|
||||
i = setUint16(arrayOfByte, i, ((WmfRegion)paramGdiRegion).getID());
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void intersectClipRect(int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
|
||||
byte[] arrayOfByte = new byte[16];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 1046);
|
||||
i = setInt16(arrayOfByte, i, paramInt4);
|
||||
i = setInt16(arrayOfByte, i, paramInt3);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void invertRgn(GdiRegion paramGdiRegion) {
|
||||
byte[] arrayOfByte = new byte[8];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 298);
|
||||
i = setUint16(arrayOfByte, i, ((WmfRegion)paramGdiRegion).getID());
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void lineTo(int paramInt1, int paramInt2) {
|
||||
byte[] arrayOfByte = new byte[10];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 531);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void moveToEx(int paramInt1, int paramInt2, Point paramPoint) {
|
||||
byte[] arrayOfByte = new byte[10];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 532);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void offsetClipRgn(int paramInt1, int paramInt2) {
|
||||
byte[] arrayOfByte = new byte[10];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 544);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void offsetViewportOrgEx(int paramInt1, int paramInt2, Point paramPoint) {
|
||||
byte[] arrayOfByte = new byte[10];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 529);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void offsetWindowOrgEx(int paramInt1, int paramInt2, Point paramPoint) {
|
||||
byte[] arrayOfByte = new byte[10];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 527);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void paintRgn(GdiRegion paramGdiRegion) {
|
||||
byte[] arrayOfByte = new byte[8];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 299);
|
||||
i = setUint16(arrayOfByte, i, ((WmfRegion)paramGdiRegion).getID());
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void patBlt(int paramInt1, int paramInt2, int paramInt3, int paramInt4, long paramLong) {
|
||||
byte[] arrayOfByte = new byte[18];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 1565);
|
||||
i = setUint32(arrayOfByte, i, paramLong);
|
||||
i = setInt16(arrayOfByte, i, paramInt4);
|
||||
i = setInt16(arrayOfByte, i, paramInt3);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void pie(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8) {
|
||||
byte[] arrayOfByte = new byte[22];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 2074);
|
||||
i = setInt16(arrayOfByte, i, paramInt8);
|
||||
i = setInt16(arrayOfByte, i, paramInt7);
|
||||
i = setInt16(arrayOfByte, i, paramInt6);
|
||||
i = setInt16(arrayOfByte, i, paramInt5);
|
||||
i = setInt16(arrayOfByte, i, paramInt4);
|
||||
i = setInt16(arrayOfByte, i, paramInt3);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void polygon(Point[] paramArrayOfPoint) {
|
||||
byte[] arrayOfByte = new byte[8 + paramArrayOfPoint.length * 4];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 804);
|
||||
i = setInt16(arrayOfByte, i, paramArrayOfPoint.length);
|
||||
for (int j = 0; j < paramArrayOfPoint.length; j++) {
|
||||
i = setInt16(arrayOfByte, i, (paramArrayOfPoint[j]).x);
|
||||
i = setInt16(arrayOfByte, i, (paramArrayOfPoint[j]).y);
|
||||
}
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void polyline(Point[] paramArrayOfPoint) {
|
||||
byte[] arrayOfByte = new byte[8 + paramArrayOfPoint.length * 4];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 805);
|
||||
i = setInt16(arrayOfByte, i, paramArrayOfPoint.length);
|
||||
for (int j = 0; j < paramArrayOfPoint.length; j++) {
|
||||
i = setInt16(arrayOfByte, i, (paramArrayOfPoint[j]).x);
|
||||
i = setInt16(arrayOfByte, i, (paramArrayOfPoint[j]).y);
|
||||
}
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void polyPolygon(Point[][] paramArrayOfPoint) {
|
||||
int i = 8;
|
||||
for (int j = 0; j < paramArrayOfPoint.length; j++)
|
||||
i += 2 + (paramArrayOfPoint[j]).length * 4;
|
||||
byte[] arrayOfByte = new byte[i];
|
||||
int k = 0;
|
||||
k = setUint32(arrayOfByte, k, (long)(arrayOfByte.length / 2));
|
||||
k = setUint16(arrayOfByte, k, 805);
|
||||
k = setInt16(arrayOfByte, k, paramArrayOfPoint.length);
|
||||
for (int n = 0; n < paramArrayOfPoint.length; n++)
|
||||
k = setInt16(arrayOfByte, k, (paramArrayOfPoint[n]).length);
|
||||
for (int m = 0; m < paramArrayOfPoint.length; m++) {
|
||||
for (int i1 = 0; i1 < (paramArrayOfPoint[m]).length; i1++) {
|
||||
k = setInt16(arrayOfByte, k, (paramArrayOfPoint[m][i1]).x);
|
||||
k = setInt16(arrayOfByte, k, (paramArrayOfPoint[m][i1]).y);
|
||||
}
|
||||
}
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void realizePalette() {
|
||||
byte[] arrayOfByte = new byte[6];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 53);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void restoreDC(int paramInt) {
|
||||
byte[] arrayOfByte = new byte[8];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 295);
|
||||
i = setInt16(arrayOfByte, i, paramInt);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void rectangle(int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
|
||||
byte[] arrayOfByte = new byte[14];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 1051);
|
||||
i = setInt16(arrayOfByte, i, paramInt4);
|
||||
i = setInt16(arrayOfByte, i, paramInt3);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void resizePalette(GdiPalette paramGdiPalette) {
|
||||
byte[] arrayOfByte = new byte[8];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 53);
|
||||
i = setUint16(arrayOfByte, i, ((WmfPalette)paramGdiPalette).getID());
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void roundRect(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6) {
|
||||
byte[] arrayOfByte = new byte[18];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 1564);
|
||||
i = setInt16(arrayOfByte, i, paramInt6);
|
||||
i = setInt16(arrayOfByte, i, paramInt5);
|
||||
i = setInt16(arrayOfByte, i, paramInt4);
|
||||
i = setInt16(arrayOfByte, i, paramInt3);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void seveDC() {
|
||||
byte[] arrayOfByte = new byte[6];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 30);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void scaleViewportExtEx(int paramInt1, int paramInt2, int paramInt3, int paramInt4, Size paramSize) {
|
||||
byte[] arrayOfByte = new byte[14];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 1042);
|
||||
i = setInt16(arrayOfByte, i, paramInt4);
|
||||
i = setInt16(arrayOfByte, i, paramInt3);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void scaleWindowExtEx(int paramInt1, int paramInt2, int paramInt3, int paramInt4, Size paramSize) {
|
||||
byte[] arrayOfByte = new byte[14];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 1040);
|
||||
i = setInt16(arrayOfByte, i, paramInt4);
|
||||
i = setInt16(arrayOfByte, i, paramInt3);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void selectClipRgn(GdiRegion paramGdiRegion) {
|
||||
byte[] arrayOfByte = new byte[8];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 300);
|
||||
i = setUint16(arrayOfByte, i, ((WmfRegion)paramGdiRegion).getID());
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void selectObject(GdiObject paramGdiObject) {
|
||||
byte[] arrayOfByte = new byte[8];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 301);
|
||||
i = setUint16(arrayOfByte, i, ((WmfObject)paramGdiObject).getID());
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void selectPalette(GdiPalette paramGdiPalette, boolean paramBoolean) {
|
||||
byte[] arrayOfByte = new byte[8];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 564);
|
||||
i = setInt16(arrayOfByte, i, paramBoolean ? 1 : 0);
|
||||
i = setUint16(arrayOfByte, i, ((WmfPalette)paramGdiPalette).getID());
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void setBkColor(int paramInt) {
|
||||
byte[] arrayOfByte = new byte[10];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 513);
|
||||
i = setInt32(arrayOfByte, i, paramInt);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void setBkMode(int paramInt) {
|
||||
byte[] arrayOfByte = new byte[8];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 258);
|
||||
i = setInt16(arrayOfByte, i, paramInt);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void setDIBitsToDevice(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8, byte[] paramArrayOfbyte, int paramInt9) {
|
||||
byte[] arrayOfByte = new byte[24 + paramArrayOfbyte.length + paramArrayOfbyte.length % 2];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 3379);
|
||||
i = setUint16(arrayOfByte, i, paramInt9);
|
||||
i = setUint16(arrayOfByte, i, paramInt8);
|
||||
i = setUint16(arrayOfByte, i, paramInt7);
|
||||
i = setInt16(arrayOfByte, i, paramInt6);
|
||||
i = setInt16(arrayOfByte, i, paramInt5);
|
||||
i = setInt16(arrayOfByte, i, paramInt3);
|
||||
i = setInt16(arrayOfByte, i, paramInt4);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
i = setBytes(arrayOfByte, i, paramArrayOfbyte);
|
||||
if (paramArrayOfbyte.length % 2 == 1)
|
||||
i = setByte(arrayOfByte, i, 0);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void setLayout(long paramLong) {
|
||||
byte[] arrayOfByte = new byte[10];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 329);
|
||||
i = setUint32(arrayOfByte, i, paramLong);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void setMapMode(int paramInt) {
|
||||
byte[] arrayOfByte = new byte[8];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 259);
|
||||
i = setInt16(arrayOfByte, i, paramInt);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void setMapperFlags(long paramLong) {
|
||||
byte[] arrayOfByte = new byte[10];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 561);
|
||||
i = setUint32(arrayOfByte, i, paramLong);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void setPaletteEntries(GdiPalette paramGdiPalette, int paramInt, int[] paramArrayOfint) {
|
||||
byte[] arrayOfByte = new byte[6 + paramArrayOfint.length * 4];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 55);
|
||||
i = setUint16(arrayOfByte, i, ((WmfPalette)paramGdiPalette).getID());
|
||||
i = setUint16(arrayOfByte, i, paramArrayOfint.length);
|
||||
i = setUint16(arrayOfByte, i, paramInt);
|
||||
for (int j = 0; j < paramArrayOfint.length; j++)
|
||||
i = setInt32(arrayOfByte, i, paramArrayOfint[j]);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void setPixel(int paramInt1, int paramInt2, int paramInt3) {
|
||||
byte[] arrayOfByte = new byte[14];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 1055);
|
||||
i = setInt32(arrayOfByte, i, paramInt3);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void setPolyFillMode(int paramInt) {
|
||||
byte[] arrayOfByte = new byte[8];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 262);
|
||||
i = setInt16(arrayOfByte, i, paramInt);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void setRelAbs(int paramInt) {
|
||||
byte[] arrayOfByte = new byte[8];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 261);
|
||||
i = setInt16(arrayOfByte, i, paramInt);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void setROP2(int paramInt) {
|
||||
byte[] arrayOfByte = new byte[8];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 260);
|
||||
i = setInt16(arrayOfByte, i, paramInt);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void setStretchBltMode(int paramInt) {
|
||||
byte[] arrayOfByte = new byte[8];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 263);
|
||||
i = setInt16(arrayOfByte, i, paramInt);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void setTextAlign(int paramInt) {
|
||||
byte[] arrayOfByte = new byte[8];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 302);
|
||||
i = setInt16(arrayOfByte, i, paramInt);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void setTextCharacterExtra(int paramInt) {
|
||||
byte[] arrayOfByte = new byte[8];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 264);
|
||||
i = setInt16(arrayOfByte, i, paramInt);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void setTextColor(int paramInt) {
|
||||
byte[] arrayOfByte = new byte[10];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 521);
|
||||
i = setInt32(arrayOfByte, i, paramInt);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void setTextJustification(int paramInt1, int paramInt2) {
|
||||
byte[] arrayOfByte = new byte[10];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 521);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void setViewportExtEx(int paramInt1, int paramInt2, Size paramSize) {
|
||||
byte[] arrayOfByte = new byte[10];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 526);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void setViewportOrgEx(int paramInt1, int paramInt2, Point paramPoint) {
|
||||
byte[] arrayOfByte = new byte[10];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 525);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void setWindowExtEx(int paramInt1, int paramInt2, Size paramSize) {
|
||||
byte[] arrayOfByte = new byte[10];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 524);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void setWindowOrgEx(int paramInt1, int paramInt2, Point paramPoint) {
|
||||
byte[] arrayOfByte = new byte[10];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 523);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void stretchBlt(byte[] paramArrayOfbyte, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8, long paramLong) {
|
||||
byte[] arrayOfByte = new byte[26 + paramArrayOfbyte.length + paramArrayOfbyte.length % 2];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 2851);
|
||||
i = setUint32(arrayOfByte, i, paramLong);
|
||||
i = setInt16(arrayOfByte, i, paramInt8);
|
||||
i = setInt16(arrayOfByte, i, paramInt7);
|
||||
i = setInt16(arrayOfByte, i, paramInt6);
|
||||
i = setInt16(arrayOfByte, i, paramInt5);
|
||||
i = setInt16(arrayOfByte, i, paramInt3);
|
||||
i = setInt16(arrayOfByte, i, paramInt4);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
i = setBytes(arrayOfByte, i, paramArrayOfbyte);
|
||||
if (paramArrayOfbyte.length % 2 == 1)
|
||||
i = setByte(arrayOfByte, i, 0);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void stretchDIBits(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8, byte[] paramArrayOfbyte, int paramInt9, long paramLong) {
|
||||
byte[] arrayOfByte = new byte[26 + paramArrayOfbyte.length + paramArrayOfbyte.length % 2];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 3907);
|
||||
i = setUint32(arrayOfByte, i, paramLong);
|
||||
i = setUint16(arrayOfByte, i, paramInt9);
|
||||
i = setInt16(arrayOfByte, i, paramInt8);
|
||||
i = setInt16(arrayOfByte, i, paramInt7);
|
||||
i = setInt16(arrayOfByte, i, paramInt6);
|
||||
i = setInt16(arrayOfByte, i, paramInt5);
|
||||
i = setInt16(arrayOfByte, i, paramInt3);
|
||||
i = setInt16(arrayOfByte, i, paramInt4);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
i = setBytes(arrayOfByte, i, paramArrayOfbyte);
|
||||
if (paramArrayOfbyte.length % 2 == 1)
|
||||
i = setByte(arrayOfByte, i, 0);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void textOut(int paramInt1, int paramInt2, byte[] paramArrayOfbyte) {
|
||||
byte[] arrayOfByte = new byte[10 + paramArrayOfbyte.length + paramArrayOfbyte.length % 2];
|
||||
int i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 1313);
|
||||
i = setInt16(arrayOfByte, i, paramArrayOfbyte.length);
|
||||
i = setBytes(arrayOfByte, i, paramArrayOfbyte);
|
||||
if (paramArrayOfbyte.length % 2 == 1)
|
||||
i = setByte(arrayOfByte, i, 0);
|
||||
i = setInt16(arrayOfByte, i, paramInt2);
|
||||
i = setInt16(arrayOfByte, i, paramInt1);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
public void footer() {
|
||||
int i = 0;
|
||||
if (this.header != null) {
|
||||
long l1 = (long)this.header.length;
|
||||
long l2 = 0L;
|
||||
Iterator iterator = this.records.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
byte[] arrayOfByte1 = (byte[])iterator.next();
|
||||
l1 += (long)arrayOfByte1.length;
|
||||
if ((long)arrayOfByte1.length > l2)
|
||||
l2 = (long)arrayOfByte1.length;
|
||||
}
|
||||
i = setUint32(this.header, 6, l1 / 2L);
|
||||
i = setUint16(this.header, i, this.objects.size());
|
||||
i = setUint32(this.header, i, l2 / 2L);
|
||||
}
|
||||
byte[] arrayOfByte = new byte[6];
|
||||
i = 0;
|
||||
i = setUint32(arrayOfByte, i, (long)(arrayOfByte.length / 2));
|
||||
i = setUint16(arrayOfByte, i, 0);
|
||||
this.records.add(arrayOfByte);
|
||||
}
|
||||
|
||||
private int setByte(byte[] paramArrayOfbyte, int paramInt1, int paramInt2) {
|
||||
paramArrayOfbyte[paramInt1] = (byte)(0xFF & paramInt2);
|
||||
return paramInt1 + 1;
|
||||
}
|
||||
|
||||
private int setBytes(byte[] paramArrayOfbyte1, int paramInt, byte[] paramArrayOfbyte2) {
|
||||
System.arraycopy(paramArrayOfbyte2, 0, paramArrayOfbyte1, paramInt, paramArrayOfbyte2.length);
|
||||
return paramInt + paramArrayOfbyte2.length;
|
||||
}
|
||||
|
||||
private int setInt16(byte[] paramArrayOfbyte, int paramInt1, int paramInt2) {
|
||||
paramArrayOfbyte[paramInt1] = (byte)(0xFF & paramInt2);
|
||||
paramArrayOfbyte[paramInt1 + 1] = (byte)(0xFF & paramInt2 >> 8);
|
||||
return paramInt1 + 2;
|
||||
}
|
||||
|
||||
private int setInt32(byte[] paramArrayOfbyte, int paramInt1, int paramInt2) {
|
||||
paramArrayOfbyte[paramInt1] = (byte)(0xFF & paramInt2);
|
||||
paramArrayOfbyte[paramInt1 + 1] = (byte)(0xFF & paramInt2 >> 8);
|
||||
paramArrayOfbyte[paramInt1 + 2] = (byte)(0xFF & paramInt2 >> 16);
|
||||
paramArrayOfbyte[paramInt1 + 3] = (byte)(0xFF & paramInt2 >> 24);
|
||||
return paramInt1 + 4;
|
||||
}
|
||||
|
||||
private int setUint16(byte[] paramArrayOfbyte, int paramInt1, int paramInt2) {
|
||||
paramArrayOfbyte[paramInt1] = (byte)(0xFF & paramInt2);
|
||||
paramArrayOfbyte[paramInt1 + 1] = (byte)(0xFF & paramInt2 >> 8);
|
||||
return paramInt1 + 2;
|
||||
}
|
||||
|
||||
private int setUint32(byte[] paramArrayOfbyte, int paramInt, long paramLong) {
|
||||
paramArrayOfbyte[paramInt] = (byte)(int)(0xFFL & paramLong);
|
||||
paramArrayOfbyte[paramInt + 1] = (byte)(int)(0xFFL & paramLong >> 8L);
|
||||
paramArrayOfbyte[paramInt + 2] = (byte)(int)(0xFFL & paramLong >> 16L);
|
||||
paramArrayOfbyte[paramInt + 3] = (byte)(int)(0xFFL & paramLong >> 24L);
|
||||
return paramInt + 4;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package net.arnx.wmf2svg.gdi.wmf;
|
||||
|
||||
import net.arnx.wmf2svg.gdi.GdiObject;
|
||||
|
||||
class WmfObject implements GdiObject {
|
||||
public int id;
|
||||
|
||||
public WmfObject(int paramInt) {
|
||||
this.id = paramInt;
|
||||
}
|
||||
|
||||
public int getID() {
|
||||
return this.id;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package net.arnx.wmf2svg.gdi.wmf;
|
||||
|
||||
import net.arnx.wmf2svg.gdi.GdiPalette;
|
||||
|
||||
class WmfPalette extends WmfObject implements GdiPalette {
|
||||
private int version;
|
||||
|
||||
private int[] entries;
|
||||
|
||||
public WmfPalette(int paramInt1, int paramInt2, int[] paramArrayOfint) {
|
||||
super(paramInt1);
|
||||
this.version = paramInt2;
|
||||
this.entries = paramArrayOfint;
|
||||
}
|
||||
|
||||
public int getVersion() {
|
||||
return this.version;
|
||||
}
|
||||
|
||||
public int[] getEntries() {
|
||||
return this.entries;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package net.arnx.wmf2svg.gdi.wmf;
|
||||
|
||||
public class WmfParseException extends Exception {
|
||||
private static final long serialVersionUID = 42724981894237705L;
|
||||
|
||||
public WmfParseException() {}
|
||||
|
||||
public WmfParseException(String paramString) {
|
||||
super(paramString);
|
||||
}
|
||||
|
||||
public WmfParseException(String paramString, Throwable paramThrowable) {
|
||||
super(paramString, paramThrowable);
|
||||
}
|
||||
|
||||
public WmfParseException(Throwable paramThrowable) {
|
||||
super(paramThrowable);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,650 @@
|
|||
package net.arnx.wmf2svg.gdi.wmf;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.EOFException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.logging.Logger;
|
||||
import net.arnx.wmf2svg.gdi.Gdi;
|
||||
import net.arnx.wmf2svg.gdi.GdiBrush;
|
||||
import net.arnx.wmf2svg.gdi.GdiFont;
|
||||
import net.arnx.wmf2svg.gdi.GdiObject;
|
||||
import net.arnx.wmf2svg.gdi.GdiPalette;
|
||||
import net.arnx.wmf2svg.gdi.GdiRegion;
|
||||
import net.arnx.wmf2svg.gdi.Point;
|
||||
import net.arnx.wmf2svg.io.DataInput;
|
||||
|
||||
public class WmfParser implements WmfConstants {
|
||||
private static Logger log = Logger.getLogger(WmfParser.class.getName());
|
||||
|
||||
public void parse(InputStream paramInputStream, Gdi paramGdi) throws IOException, WmfParseException {
|
||||
DataInput dataInput = null;
|
||||
boolean bool = true;
|
||||
try {
|
||||
dataInput = new DataInput(new BufferedInputStream(paramInputStream), ByteOrder.LITTLE_ENDIAN);
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
long l1 = dataInput.readUint32();
|
||||
bool = false;
|
||||
if (l1 == -1698247209L) {
|
||||
int i1 = dataInput.readInt16();
|
||||
int i2 = dataInput.readInt16();
|
||||
int i3 = dataInput.readInt16();
|
||||
int i4 = dataInput.readInt16();
|
||||
int i5 = dataInput.readInt16();
|
||||
int i6 = dataInput.readUint16();
|
||||
long l = dataInput.readUint32();
|
||||
int i7 = dataInput.readUint16();
|
||||
paramGdi.placeableHeader(i2, i3, i4, i5, i6);
|
||||
i = dataInput.readUint16();
|
||||
j = dataInput.readUint16();
|
||||
} else {
|
||||
i = (int)(l1 & 0xFFFFL);
|
||||
j = (int)((l1 & 0xFFFFFFFFFFFF0000L) >> 16L);
|
||||
}
|
||||
int k = dataInput.readUint16();
|
||||
long l2 = dataInput.readUint32();
|
||||
int m = dataInput.readUint16();
|
||||
long l3 = dataInput.readUint32();
|
||||
int n = dataInput.readUint16();
|
||||
if (i != 1 || j != 9)
|
||||
throw new WmfParseException("invalid file format.");
|
||||
paramGdi.header();
|
||||
GdiObject[] arrayOfGdiObject = new GdiObject[m];
|
||||
while (true) {
|
||||
int[] arrayOfInt2;
|
||||
int i12;
|
||||
long l9;
|
||||
int i11;
|
||||
byte[] arrayOfByte2;
|
||||
int i10;
|
||||
long l8;
|
||||
int i9;
|
||||
byte[] arrayOfByte1;
|
||||
int i8;
|
||||
long l7;
|
||||
int i7;
|
||||
Point[] arrayOfPoint1;
|
||||
Point[][] arrayOfPoint;
|
||||
int i6;
|
||||
long l6;
|
||||
int i5;
|
||||
long l5;
|
||||
int[] arrayOfInt1;
|
||||
int i4;
|
||||
long l4;
|
||||
int i17;
|
||||
int[] arrayOfInt3;
|
||||
int i16;
|
||||
long l10;
|
||||
byte[] arrayOfByte4;
|
||||
int i15;
|
||||
GdiRegion gdiRegion;
|
||||
int i14;
|
||||
byte[] arrayOfByte3;
|
||||
int i18;
|
||||
int i19;
|
||||
int i20;
|
||||
int i22;
|
||||
int[] arrayOfInt4;
|
||||
int i21;
|
||||
int i24;
|
||||
byte[] arrayOfByte5;
|
||||
int i23;
|
||||
int i26;
|
||||
int[] arrayOfInt5;
|
||||
int i25;
|
||||
byte[] arrayOfByte6;
|
||||
int i27;
|
||||
int i29;
|
||||
byte[] arrayOfByte7;
|
||||
int i28;
|
||||
int i31;
|
||||
byte[] arrayOfByte8;
|
||||
int i30;
|
||||
int i32;
|
||||
byte[] arrayOfByte9;
|
||||
int i33;
|
||||
int i34;
|
||||
int i35;
|
||||
byte[] arrayOfByte10;
|
||||
GdiFont gdiFont;
|
||||
int i36;
|
||||
int i1 = (int)dataInput.readUint32() - 3;
|
||||
int i2 = dataInput.readUint16();
|
||||
if (i2 == 0) {
|
||||
dataInput.close();
|
||||
paramGdi.footer();
|
||||
return;
|
||||
}
|
||||
dataInput.setCount(0);
|
||||
switch (i2) {
|
||||
case 1078:
|
||||
arrayOfInt2 = new int[dataInput.readUint16()];
|
||||
i17 = dataInput.readUint16();
|
||||
i18 = dataInput.readUint16();
|
||||
for (i19 = 0; i19 < arrayOfInt2.length; i19++)
|
||||
arrayOfInt2[i19] = dataInput.readInt32();
|
||||
paramGdi.animatePalette((GdiPalette)arrayOfGdiObject[i18], i17, arrayOfInt2);
|
||||
break;
|
||||
case 2071:
|
||||
i12 = dataInput.readInt16();
|
||||
i17 = dataInput.readInt16();
|
||||
i18 = dataInput.readInt16();
|
||||
i19 = dataInput.readInt16();
|
||||
i20 = dataInput.readInt16();
|
||||
i22 = dataInput.readInt16();
|
||||
i24 = dataInput.readInt16();
|
||||
i26 = dataInput.readInt16();
|
||||
paramGdi.arc(i26, i24, i22, i20, i19, i18, i17, i12);
|
||||
break;
|
||||
case 2338:
|
||||
l9 = dataInput.readUint32();
|
||||
i18 = dataInput.readInt16();
|
||||
i19 = dataInput.readInt16();
|
||||
i20 = dataInput.readInt16();
|
||||
i22 = dataInput.readInt16();
|
||||
i24 = dataInput.readInt16();
|
||||
i26 = dataInput.readInt16();
|
||||
arrayOfByte6 = dataInput.readBytes(i1 * 2 - dataInput.getCount());
|
||||
paramGdi.bitBlt(arrayOfByte6, i26, i24, i22, i20, i19, i18, l9);
|
||||
break;
|
||||
case 2096:
|
||||
i11 = dataInput.readInt16();
|
||||
i17 = dataInput.readInt16();
|
||||
i18 = dataInput.readInt16();
|
||||
i19 = dataInput.readInt16();
|
||||
i20 = dataInput.readInt16();
|
||||
i22 = dataInput.readInt16();
|
||||
i24 = dataInput.readInt16();
|
||||
i26 = dataInput.readInt16();
|
||||
paramGdi.chord(i26, i24, i22, i20, i19, i18, i17, i11);
|
||||
break;
|
||||
case 764:
|
||||
i11 = dataInput.readUint16();
|
||||
i17 = dataInput.readInt32();
|
||||
i18 = dataInput.readUint16();
|
||||
for (i19 = 0; i19 < arrayOfGdiObject.length; i19++) {
|
||||
if (arrayOfGdiObject[i19] == null) {
|
||||
arrayOfGdiObject[i19] = paramGdi.createBrushIndirect(i11, i17, i18);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 763:
|
||||
i11 = dataInput.readInt16();
|
||||
i17 = dataInput.readInt16();
|
||||
i18 = dataInput.readInt16();
|
||||
i19 = dataInput.readInt16();
|
||||
i20 = dataInput.readInt16();
|
||||
i22 = (dataInput.readByte() == 1) ? 1 : 0;
|
||||
i24 = (dataInput.readByte() == 1) ? 1 : 0;
|
||||
i26 = (dataInput.readByte() == 1) ? 1 : 0;
|
||||
i27 = dataInput.readByte();
|
||||
i29 = dataInput.readByte();
|
||||
i31 = dataInput.readByte();
|
||||
i32 = dataInput.readByte();
|
||||
i33 = dataInput.readByte();
|
||||
i34 = 0x3 & i33;
|
||||
i35 = 0xF0 & i33;
|
||||
arrayOfByte10 = dataInput.readBytes(2 * (i1 - 9));
|
||||
gdiFont = paramGdi.createFontIndirect(i11, i17, i18, i19, i20, i22, i24, i26, i27, i29, i31, i32, i33, arrayOfByte10);
|
||||
for (i36 = 0; i36 < arrayOfGdiObject.length; i36++) {
|
||||
if (arrayOfGdiObject[i36] == null) {
|
||||
arrayOfGdiObject[i36] = gdiFont;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 247:
|
||||
i11 = dataInput.readUint16();
|
||||
arrayOfInt3 = new int[dataInput.readUint16()];
|
||||
for (i18 = 0; i18 < arrayOfInt3.length; i18++)
|
||||
arrayOfInt3[i18] = dataInput.readInt32();
|
||||
for (i18 = 0; i18 < arrayOfGdiObject.length; i18++) {
|
||||
if (arrayOfGdiObject[i18] == null) {
|
||||
arrayOfGdiObject[i18] = paramGdi.createPalette(i11, arrayOfInt3);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 505:
|
||||
arrayOfByte2 = dataInput.readBytes(i1 * 2 - dataInput.getCount());
|
||||
for (i16 = 0; i16 < arrayOfGdiObject.length; i16++) {
|
||||
if (arrayOfGdiObject[i16] == null) {
|
||||
arrayOfGdiObject[i16] = paramGdi.createPatternBrush(arrayOfByte2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 762:
|
||||
i10 = dataInput.readUint16();
|
||||
i16 = dataInput.readInt16();
|
||||
dataInput.readInt16();
|
||||
i18 = dataInput.readInt32();
|
||||
for (i19 = 0; i19 < arrayOfGdiObject.length; i19++) {
|
||||
if (arrayOfGdiObject[i19] == null) {
|
||||
arrayOfGdiObject[i19] = paramGdi.createPenIndirect(i10, i16, i18);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1791:
|
||||
i10 = dataInput.readInt16();
|
||||
i16 = dataInput.readInt16();
|
||||
i18 = dataInput.readInt16();
|
||||
i19 = dataInput.readInt16();
|
||||
for (i20 = 0; i20 < arrayOfGdiObject.length; i20++) {
|
||||
if (arrayOfGdiObject[i20] == null) {
|
||||
arrayOfGdiObject[i20] = paramGdi.createRectRgn(i19, i18, i16, i10);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 496:
|
||||
i10 = dataInput.readUint16();
|
||||
paramGdi.deleteObject(arrayOfGdiObject[i10]);
|
||||
arrayOfGdiObject[i10] = null;
|
||||
break;
|
||||
case 2368:
|
||||
i10 = 0;
|
||||
l10 = dataInput.readUint32();
|
||||
i19 = dataInput.readInt16();
|
||||
i20 = dataInput.readInt16();
|
||||
i22 = dataInput.readInt16();
|
||||
if (i22 == 0) {
|
||||
i22 = dataInput.readInt16();
|
||||
i10 = 1;
|
||||
}
|
||||
i24 = dataInput.readInt16();
|
||||
i26 = dataInput.readInt16();
|
||||
i27 = dataInput.readInt16();
|
||||
if (i10 != 0) {
|
||||
paramGdi.dibBitBlt(null, i27, i26, i24, i22, i20, i19, l10);
|
||||
} else {
|
||||
byte[] arrayOfByte = dataInput.readBytes(i1 * 2 - dataInput.getCount());
|
||||
paramGdi.dibBitBlt(arrayOfByte, i27, i26, i24, i22, i20, i19, l10);
|
||||
}
|
||||
break;
|
||||
case 322:
|
||||
i10 = dataInput.readInt32();
|
||||
arrayOfByte4 = dataInput.readBytes(i1 * 2 - dataInput.getCount());
|
||||
for (i18 = 0; i18 < arrayOfGdiObject.length; i18++) {
|
||||
if (arrayOfGdiObject[i18] == null) {
|
||||
arrayOfGdiObject[i18] = paramGdi.dibCreatePatternBrush(arrayOfByte4, i10);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2881:
|
||||
l8 = dataInput.readUint32();
|
||||
i18 = dataInput.readInt16();
|
||||
i19 = dataInput.readInt16();
|
||||
i20 = dataInput.readInt16();
|
||||
i22 = dataInput.readInt16();
|
||||
i24 = dataInput.readInt16();
|
||||
i26 = dataInput.readInt16();
|
||||
i27 = dataInput.readInt16();
|
||||
i29 = dataInput.readInt16();
|
||||
arrayOfByte8 = dataInput.readBytes(i1 * 2 - dataInput.getCount());
|
||||
paramGdi.dibStretchBlt(arrayOfByte8, i29, i27, i26, i24, i20, i22, i19, i18, l8);
|
||||
break;
|
||||
case 1048:
|
||||
i9 = dataInput.readInt16();
|
||||
i15 = dataInput.readInt16();
|
||||
i18 = dataInput.readInt16();
|
||||
i19 = dataInput.readInt16();
|
||||
paramGdi.ellipse(i19, i18, i15, i9);
|
||||
break;
|
||||
case 1574:
|
||||
arrayOfByte1 = dataInput.readBytes(2 * i1);
|
||||
paramGdi.escape(arrayOfByte1);
|
||||
break;
|
||||
case 1045:
|
||||
i8 = dataInput.readInt16();
|
||||
i15 = dataInput.readInt16();
|
||||
i18 = dataInput.readInt16();
|
||||
i19 = dataInput.readInt16();
|
||||
paramGdi.excludeClipRect(i19, i18, i15, i8);
|
||||
break;
|
||||
case 1352:
|
||||
i8 = dataInput.readUint16();
|
||||
i15 = dataInput.readInt32();
|
||||
i18 = dataInput.readInt16();
|
||||
i19 = dataInput.readInt16();
|
||||
paramGdi.extFloodFill(i19, i18, i15, i8);
|
||||
break;
|
||||
case 2610:
|
||||
i8 = i1;
|
||||
i15 = dataInput.readInt16();
|
||||
i18 = dataInput.readInt16();
|
||||
i19 = dataInput.readInt16();
|
||||
i20 = dataInput.readUint16();
|
||||
i8 -= 4;
|
||||
arrayOfInt4 = null;
|
||||
if ((i20 & 0x6) > 0) {
|
||||
arrayOfInt4 = new int[] { dataInput.readInt16(), dataInput.readInt16(), dataInput.readInt16(), dataInput.readInt16() };
|
||||
i8 -= 4;
|
||||
}
|
||||
arrayOfByte5 = dataInput.readBytes(i19);
|
||||
if (i19 % 2 == 1)
|
||||
dataInput.readByte();
|
||||
i8 -= (i19 + 1) / 2;
|
||||
arrayOfInt5 = null;
|
||||
if (i8 > 0) {
|
||||
arrayOfInt5 = new int[i8];
|
||||
for (int i37 = 0; i37 < arrayOfInt5.length; i37++)
|
||||
arrayOfInt5[i37] = dataInput.readInt16();
|
||||
}
|
||||
paramGdi.extTextOut(i18, i15, i20, arrayOfInt4, arrayOfByte5, arrayOfInt5);
|
||||
break;
|
||||
case 552:
|
||||
i8 = dataInput.readUint16();
|
||||
i15 = dataInput.readUint16();
|
||||
paramGdi.fillRgn((GdiRegion)arrayOfGdiObject[i15], (GdiBrush)arrayOfGdiObject[i8]);
|
||||
break;
|
||||
case 1049:
|
||||
i8 = dataInput.readInt32();
|
||||
i15 = dataInput.readInt16();
|
||||
i18 = dataInput.readInt16();
|
||||
paramGdi.floodFill(i18, i15, i8);
|
||||
break;
|
||||
case 1065:
|
||||
i8 = dataInput.readInt16();
|
||||
i15 = dataInput.readInt16();
|
||||
i18 = dataInput.readUint16();
|
||||
i19 = dataInput.readUint16();
|
||||
paramGdi.frameRgn((GdiRegion)arrayOfGdiObject[i19], (GdiBrush)arrayOfGdiObject[i18], i15, i8);
|
||||
break;
|
||||
case 1046:
|
||||
i8 = dataInput.readInt16();
|
||||
i15 = dataInput.readInt16();
|
||||
i18 = dataInput.readInt16();
|
||||
i19 = dataInput.readInt16();
|
||||
paramGdi.intersectClipRect(i19, i18, i15, i8);
|
||||
break;
|
||||
case 298:
|
||||
i8 = dataInput.readUint16();
|
||||
paramGdi.invertRgn((GdiRegion)arrayOfGdiObject[i8]);
|
||||
break;
|
||||
case 531:
|
||||
i8 = dataInput.readInt16();
|
||||
i15 = dataInput.readInt16();
|
||||
paramGdi.lineTo(i15, i8);
|
||||
break;
|
||||
case 532:
|
||||
i8 = dataInput.readInt16();
|
||||
i15 = dataInput.readInt16();
|
||||
paramGdi.moveToEx(i15, i8, null);
|
||||
break;
|
||||
case 544:
|
||||
i8 = dataInput.readInt16();
|
||||
i15 = dataInput.readInt16();
|
||||
paramGdi.offsetClipRgn(i15, i8);
|
||||
break;
|
||||
case 529:
|
||||
i8 = dataInput.readInt16();
|
||||
i15 = dataInput.readInt16();
|
||||
paramGdi.offsetViewportOrgEx(i15, i8, null);
|
||||
break;
|
||||
case 527:
|
||||
i8 = dataInput.readInt16();
|
||||
i15 = dataInput.readInt16();
|
||||
paramGdi.offsetWindowOrgEx(i15, i8, null);
|
||||
break;
|
||||
case 299:
|
||||
i8 = dataInput.readUint16();
|
||||
paramGdi.paintRgn((GdiRegion)arrayOfGdiObject[i8]);
|
||||
break;
|
||||
case 1565:
|
||||
l7 = dataInput.readUint32();
|
||||
i18 = dataInput.readInt16();
|
||||
i19 = dataInput.readInt16();
|
||||
i20 = dataInput.readInt16();
|
||||
i21 = dataInput.readInt16();
|
||||
paramGdi.patBlt(i21, i20, i19, i18, l7);
|
||||
break;
|
||||
case 2074:
|
||||
i7 = dataInput.readInt16();
|
||||
i15 = dataInput.readInt16();
|
||||
i18 = dataInput.readInt16();
|
||||
i19 = dataInput.readInt16();
|
||||
i20 = dataInput.readInt16();
|
||||
i21 = dataInput.readInt16();
|
||||
i23 = dataInput.readInt16();
|
||||
i25 = dataInput.readInt16();
|
||||
paramGdi.pie(i25, i23, i21, i20, i19, i18, i15, i7);
|
||||
break;
|
||||
case 804:
|
||||
arrayOfPoint1 = new Point[dataInput.readInt16()];
|
||||
for (i15 = 0; i15 < arrayOfPoint1.length; i15++)
|
||||
arrayOfPoint1[i15] = new Point(dataInput.readInt16(), dataInput.readInt16());
|
||||
paramGdi.polygon(arrayOfPoint1);
|
||||
break;
|
||||
case 805:
|
||||
arrayOfPoint1 = new Point[dataInput.readInt16()];
|
||||
for (i15 = 0; i15 < arrayOfPoint1.length; i15++)
|
||||
arrayOfPoint1[i15] = new Point(dataInput.readInt16(), dataInput.readInt16());
|
||||
paramGdi.polyline(arrayOfPoint1);
|
||||
break;
|
||||
case 1336:
|
||||
arrayOfPoint = new Point[dataInput.readInt16()][];
|
||||
for (i15 = 0; i15 < arrayOfPoint.length; i15++)
|
||||
arrayOfPoint[i15] = new Point[dataInput.readInt16()];
|
||||
for (i15 = 0; i15 < arrayOfPoint.length; i15++) {
|
||||
for (int i37 = 0; i37 < (arrayOfPoint[i15]).length; i37++)
|
||||
arrayOfPoint[i15][i37] = new Point(dataInput.readInt16(), dataInput.readInt16());
|
||||
}
|
||||
paramGdi.polyPolygon(arrayOfPoint);
|
||||
break;
|
||||
case 53:
|
||||
paramGdi.realizePalette();
|
||||
break;
|
||||
case 1051:
|
||||
i6 = dataInput.readInt16();
|
||||
i15 = dataInput.readInt16();
|
||||
i18 = dataInput.readInt16();
|
||||
i19 = dataInput.readInt16();
|
||||
paramGdi.rectangle(i19, i18, i15, i6);
|
||||
break;
|
||||
case 313:
|
||||
i6 = dataInput.readUint16();
|
||||
paramGdi.resizePalette((GdiPalette)arrayOfGdiObject[i6]);
|
||||
break;
|
||||
case 295:
|
||||
i6 = dataInput.readInt16();
|
||||
paramGdi.restoreDC(i6);
|
||||
break;
|
||||
case 1564:
|
||||
i6 = dataInput.readInt16();
|
||||
i15 = dataInput.readInt16();
|
||||
i18 = dataInput.readInt16();
|
||||
i19 = dataInput.readInt16();
|
||||
i20 = dataInput.readInt16();
|
||||
i21 = dataInput.readInt16();
|
||||
paramGdi.roundRect(i21, i20, i19, i18, i15, i6);
|
||||
break;
|
||||
case 30:
|
||||
paramGdi.seveDC();
|
||||
break;
|
||||
case 1042:
|
||||
i6 = dataInput.readInt16();
|
||||
i15 = dataInput.readInt16();
|
||||
i18 = dataInput.readInt16();
|
||||
i19 = dataInput.readInt16();
|
||||
paramGdi.scaleViewportExtEx(i19, i18, i15, i6, null);
|
||||
break;
|
||||
case 1040:
|
||||
i6 = dataInput.readInt16();
|
||||
i15 = dataInput.readInt16();
|
||||
i18 = dataInput.readInt16();
|
||||
i19 = dataInput.readInt16();
|
||||
paramGdi.scaleWindowExtEx(i19, i18, i15, i6, null);
|
||||
break;
|
||||
case 300:
|
||||
i6 = dataInput.readUint16();
|
||||
gdiRegion = (i6 > 0) ? (GdiRegion)arrayOfGdiObject[i6] : null;
|
||||
paramGdi.selectClipRgn(gdiRegion);
|
||||
break;
|
||||
case 301:
|
||||
i6 = dataInput.readUint16();
|
||||
paramGdi.selectObject(arrayOfGdiObject[i6]);
|
||||
break;
|
||||
case 564:
|
||||
i6 = (dataInput.readInt16() != 0) ? 1 : 0;
|
||||
if (i1 * 2 - dataInput.getCount() > 0) {
|
||||
int i37 = dataInput.readUint16();
|
||||
paramGdi.selectPalette((GdiPalette)arrayOfGdiObject[i37], i6);
|
||||
}
|
||||
break;
|
||||
case 513:
|
||||
i6 = dataInput.readInt32();
|
||||
paramGdi.setBkColor(i6);
|
||||
break;
|
||||
case 258:
|
||||
i6 = dataInput.readInt16();
|
||||
paramGdi.setBkMode(i6);
|
||||
break;
|
||||
case 3379:
|
||||
i6 = dataInput.readUint16();
|
||||
i14 = dataInput.readUint16();
|
||||
i18 = dataInput.readUint16();
|
||||
i19 = dataInput.readInt16();
|
||||
i20 = dataInput.readInt16();
|
||||
i21 = dataInput.readInt16();
|
||||
i23 = dataInput.readInt16();
|
||||
i25 = dataInput.readInt16();
|
||||
i27 = dataInput.readInt16();
|
||||
arrayOfByte7 = dataInput.readBytes(i1 * 2 - dataInput.getCount());
|
||||
paramGdi.setDIBitsToDevice(i27, i25, i23, i21, i20, i19, i18, i14, arrayOfByte7, i6);
|
||||
break;
|
||||
case 329:
|
||||
l6 = dataInput.readUint32();
|
||||
paramGdi.setLayout(l6);
|
||||
break;
|
||||
case 259:
|
||||
i5 = dataInput.readInt16();
|
||||
paramGdi.setMapMode(i5);
|
||||
break;
|
||||
case 561:
|
||||
l5 = dataInput.readUint32();
|
||||
paramGdi.setMapperFlags(l5);
|
||||
break;
|
||||
case 55:
|
||||
arrayOfInt1 = new int[dataInput.readUint16()];
|
||||
i14 = dataInput.readUint16();
|
||||
i18 = dataInput.readUint16();
|
||||
for (i19 = 0; i19 < arrayOfInt1.length; i19++)
|
||||
arrayOfInt1[i19] = dataInput.readInt32();
|
||||
paramGdi.setPaletteEntries((GdiPalette)arrayOfGdiObject[i18], i14, arrayOfInt1);
|
||||
break;
|
||||
case 1055:
|
||||
i4 = dataInput.readInt32();
|
||||
i14 = dataInput.readInt16();
|
||||
i18 = dataInput.readInt16();
|
||||
paramGdi.setPixel(i18, i14, i4);
|
||||
break;
|
||||
case 262:
|
||||
i4 = dataInput.readInt16();
|
||||
paramGdi.setPolyFillMode(i4);
|
||||
break;
|
||||
case 261:
|
||||
i4 = dataInput.readInt16();
|
||||
paramGdi.setRelAbs(i4);
|
||||
break;
|
||||
case 260:
|
||||
i4 = dataInput.readInt16();
|
||||
paramGdi.setROP2(i4);
|
||||
break;
|
||||
case 263:
|
||||
i4 = dataInput.readInt16();
|
||||
paramGdi.setStretchBltMode(i4);
|
||||
break;
|
||||
case 302:
|
||||
i4 = dataInput.readInt16();
|
||||
paramGdi.setTextAlign(i4);
|
||||
break;
|
||||
case 264:
|
||||
i4 = dataInput.readInt16();
|
||||
paramGdi.setTextCharacterExtra(i4);
|
||||
break;
|
||||
case 521:
|
||||
i4 = dataInput.readInt32();
|
||||
paramGdi.setTextColor(i4);
|
||||
break;
|
||||
case 522:
|
||||
i4 = dataInput.readInt16();
|
||||
i14 = dataInput.readInt16();
|
||||
paramGdi.setTextJustification(i14, i4);
|
||||
break;
|
||||
case 526:
|
||||
i4 = dataInput.readInt16();
|
||||
i14 = dataInput.readInt16();
|
||||
paramGdi.setViewportExtEx(i14, i4, null);
|
||||
break;
|
||||
case 525:
|
||||
i4 = dataInput.readInt16();
|
||||
i14 = dataInput.readInt16();
|
||||
paramGdi.setViewportOrgEx(i14, i4, null);
|
||||
break;
|
||||
case 524:
|
||||
i4 = dataInput.readInt16();
|
||||
i14 = dataInput.readInt16();
|
||||
paramGdi.setWindowExtEx(i14, i4, null);
|
||||
break;
|
||||
case 523:
|
||||
i4 = dataInput.readInt16();
|
||||
i14 = dataInput.readInt16();
|
||||
paramGdi.setWindowOrgEx(i14, i4, null);
|
||||
break;
|
||||
case 2851:
|
||||
l4 = dataInput.readUint32();
|
||||
i18 = dataInput.readInt16();
|
||||
i19 = dataInput.readInt16();
|
||||
i20 = dataInput.readInt16();
|
||||
i21 = dataInput.readInt16();
|
||||
i23 = dataInput.readInt16();
|
||||
i25 = dataInput.readInt16();
|
||||
i27 = dataInput.readInt16();
|
||||
i28 = dataInput.readInt16();
|
||||
arrayOfByte8 = dataInput.readBytes(i1 * 2 - dataInput.getCount());
|
||||
paramGdi.stretchBlt(arrayOfByte8, i28, i27, i25, i23, i21, i20, i19, i18, l4);
|
||||
break;
|
||||
case 3907:
|
||||
l4 = dataInput.readUint32();
|
||||
i18 = dataInput.readUint16();
|
||||
i19 = dataInput.readInt16();
|
||||
i20 = dataInput.readInt16();
|
||||
i21 = dataInput.readInt16();
|
||||
i23 = dataInput.readInt16();
|
||||
i25 = dataInput.readInt16();
|
||||
i27 = dataInput.readInt16();
|
||||
i28 = dataInput.readInt16();
|
||||
i30 = dataInput.readInt16();
|
||||
arrayOfByte9 = dataInput.readBytes(i1 * 2 - dataInput.getCount());
|
||||
paramGdi.stretchDIBits(i30, i28, i27, i25, i23, i21, i20, i19, arrayOfByte9, i18, l4);
|
||||
break;
|
||||
case 1313:
|
||||
i3 = dataInput.readInt16();
|
||||
arrayOfByte3 = dataInput.readBytes(i3);
|
||||
if (i3 % 2 == 1)
|
||||
dataInput.readByte();
|
||||
i18 = dataInput.readInt16();
|
||||
i19 = dataInput.readInt16();
|
||||
paramGdi.textOut(i19, i18, arrayOfByte3);
|
||||
break;
|
||||
default:
|
||||
log.fine("unsuppored id find: " + i2 + " (size=" + i1 + ")");
|
||||
break;
|
||||
}
|
||||
int i3 = i1 * 2 - dataInput.getCount();
|
||||
for (int i13 = 0; i13 < i3; i13++)
|
||||
dataInput.readByte();
|
||||
}
|
||||
} catch (EOFException e) {
|
||||
if (bool)
|
||||
throw new WmfParseException("input file size is zero.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package net.arnx.wmf2svg.gdi.wmf;
|
||||
|
||||
import net.arnx.wmf2svg.gdi.GdiPatternBrush;
|
||||
|
||||
class WmfPatternBrush extends WmfObject implements GdiPatternBrush {
|
||||
private byte[] image;
|
||||
|
||||
public WmfPatternBrush(int paramInt, byte[] paramArrayOfbyte) {
|
||||
super(paramInt);
|
||||
this.image = paramArrayOfbyte;
|
||||
}
|
||||
|
||||
public byte[] getPattern() {
|
||||
return this.image;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package net.arnx.wmf2svg.gdi.wmf;
|
||||
|
||||
import net.arnx.wmf2svg.gdi.GdiPen;
|
||||
|
||||
class WmfPen extends WmfObject implements GdiPen {
|
||||
private int style;
|
||||
|
||||
private int width;
|
||||
|
||||
private int color;
|
||||
|
||||
public WmfPen(int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
|
||||
super(paramInt1);
|
||||
}
|
||||
|
||||
public int getStyle() {
|
||||
return this.style;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return this.width;
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
return this.color;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package net.arnx.wmf2svg.gdi.wmf;
|
||||
|
||||
import net.arnx.wmf2svg.gdi.GdiRegion;
|
||||
|
||||
class WmfRectRegion extends WmfObject implements GdiRegion {
|
||||
private int left;
|
||||
|
||||
private int top;
|
||||
|
||||
private int right;
|
||||
|
||||
private int bottom;
|
||||
|
||||
public WmfRectRegion(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5) {
|
||||
super(paramInt1);
|
||||
this.left = paramInt2;
|
||||
this.top = paramInt3;
|
||||
this.right = paramInt4;
|
||||
this.bottom = paramInt5;
|
||||
}
|
||||
|
||||
public int getLeft() {
|
||||
return this.left;
|
||||
}
|
||||
|
||||
public int getTop() {
|
||||
return this.top;
|
||||
}
|
||||
|
||||
public int getRight() {
|
||||
return this.right;
|
||||
}
|
||||
|
||||
public int getBottom() {
|
||||
return this.bottom;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package net.arnx.wmf2svg.gdi.wmf;
|
||||
|
||||
import net.arnx.wmf2svg.gdi.GdiRegion;
|
||||
|
||||
class WmfRegion extends WmfObject implements GdiRegion {
|
||||
public WmfRegion(int paramInt) {
|
||||
super(paramInt);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,133 @@
|
|||
package net.arnx.wmf2svg.io;
|
||||
|
||||
import java.io.EOFException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
public class DataInput {
|
||||
private InputStream in;
|
||||
|
||||
private ByteOrder endian;
|
||||
|
||||
private byte[] buf = new byte[4];
|
||||
|
||||
private int count = 0;
|
||||
|
||||
public DataInput(InputStream paramInputStream) {
|
||||
this.endian = ByteOrder.nativeOrder();
|
||||
this.in = paramInputStream;
|
||||
}
|
||||
|
||||
public DataInput(InputStream paramInputStream, ByteOrder paramByteOrder) {
|
||||
if (paramByteOrder != ByteOrder.BIG_ENDIAN && paramByteOrder != ByteOrder.LITTLE_ENDIAN)
|
||||
throw new IllegalArgumentException();
|
||||
this.in = paramInputStream;
|
||||
this.endian = paramByteOrder;
|
||||
}
|
||||
|
||||
public int readByte() throws IOException, EOFException {
|
||||
if (this.in.read(this.buf, 0, 1) == 1) {
|
||||
this.count++;
|
||||
return 0xFF & this.buf[0];
|
||||
}
|
||||
throw new EOFException();
|
||||
}
|
||||
|
||||
public int readInt16() throws IOException, EOFException {
|
||||
if (this.in.read(this.buf, 0, 2) == 2) {
|
||||
int i = 0;
|
||||
if (this.endian == ByteOrder.BIG_ENDIAN) {
|
||||
i = (short)(i | 0xFF & this.buf[1]);
|
||||
i = (short)(i | (0xFF & this.buf[0]) << 8);
|
||||
} else {
|
||||
i = (short)(i | 0xFF & this.buf[0]);
|
||||
i = (short)(i | (0xFF & this.buf[1]) << 8);
|
||||
}
|
||||
this.count += 2;
|
||||
return i;
|
||||
}
|
||||
throw new EOFException();
|
||||
}
|
||||
|
||||
public int readInt32() throws IOException, EOFException {
|
||||
if (this.in.read(this.buf, 0, 4) == 4) {
|
||||
int i = 0;
|
||||
if (this.endian == ByteOrder.BIG_ENDIAN) {
|
||||
i |= 0xFF & this.buf[3];
|
||||
i |= (0xFF & this.buf[2]) << 8;
|
||||
i |= (0xFF & this.buf[1]) << 16;
|
||||
i |= (0xFF & this.buf[0]) << 24;
|
||||
} else {
|
||||
i |= 0xFF & this.buf[0];
|
||||
i |= (0xFF & this.buf[1]) << 8;
|
||||
i |= (0xFF & this.buf[2]) << 16;
|
||||
i |= (0xFF & this.buf[3]) << 24;
|
||||
}
|
||||
this.count += 4;
|
||||
return i;
|
||||
}
|
||||
throw new EOFException();
|
||||
}
|
||||
|
||||
public int readUint16() throws IOException, EOFException {
|
||||
if (this.in.read(this.buf, 0, 2) == 2) {
|
||||
int i = 0;
|
||||
if (this.endian == ByteOrder.BIG_ENDIAN) {
|
||||
i |= 0xFF & this.buf[1];
|
||||
i |= (0xFF & this.buf[0]) << 8;
|
||||
} else {
|
||||
i |= 0xFF & this.buf[0];
|
||||
i |= (0xFF & this.buf[1]) << 8;
|
||||
}
|
||||
this.count += 2;
|
||||
return i;
|
||||
}
|
||||
throw new EOFException();
|
||||
}
|
||||
|
||||
public long readUint32() throws IOException, EOFException {
|
||||
if (this.in.read(this.buf, 0, 4) == 4) {
|
||||
long l = 0L;
|
||||
if (this.endian == ByteOrder.BIG_ENDIAN) {
|
||||
l |= (long)(0xFF & this.buf[3]);
|
||||
l |= (long)((0xFF & this.buf[2]) << 8);
|
||||
l |= (long)((0xFF & this.buf[1]) << 16);
|
||||
l |= (long)((0xFF & this.buf[0]) << 24);
|
||||
} else {
|
||||
l |= (long)(0xFF & this.buf[0]);
|
||||
l |= (long)((0xFF & this.buf[1]) << 8);
|
||||
l |= (long)((0xFF & this.buf[2]) << 16);
|
||||
l |= (long)((0xFF & this.buf[3]) << 24);
|
||||
}
|
||||
this.count += 4;
|
||||
return l;
|
||||
}
|
||||
throw new EOFException();
|
||||
}
|
||||
|
||||
public byte[] readBytes(int paramInt) throws IOException, EOFException {
|
||||
byte[] arrayOfByte = new byte[paramInt];
|
||||
if (this.in.read(arrayOfByte) == paramInt) {
|
||||
this.count += paramInt;
|
||||
return arrayOfByte;
|
||||
}
|
||||
throw new EOFException();
|
||||
}
|
||||
|
||||
public void setCount(int paramInt) {
|
||||
this.count = paramInt;
|
||||
}
|
||||
|
||||
public int getCount() {
|
||||
return this.count;
|
||||
}
|
||||
|
||||
public void close() {
|
||||
try {
|
||||
this.in.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package net.arnx.wmf2svg.util;
|
||||
|
||||
public class Base64 {
|
||||
private static final char[] ENCODE_DATA = new char[] {
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
|
||||
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
|
||||
'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd',
|
||||
'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
|
||||
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
|
||||
'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7',
|
||||
'8', '9', '+', '/' };
|
||||
|
||||
public static String encode(byte[] paramArrayOfbyte) {
|
||||
char[] arrayOfChar = null;
|
||||
if (paramArrayOfbyte.length % 3 == 0) {
|
||||
arrayOfChar = new char[paramArrayOfbyte.length / 3 * 4];
|
||||
} else {
|
||||
arrayOfChar = new char[(paramArrayOfbyte.length / 3 + 1) * 4];
|
||||
}
|
||||
int i = 0;
|
||||
for (int j = 0; j < paramArrayOfbyte.length; j++) {
|
||||
switch (j % 3) {
|
||||
case 0:
|
||||
arrayOfChar[j / 3 * 4] = ENCODE_DATA[(paramArrayOfbyte[j] & 0xFC) >> 2];
|
||||
i = (paramArrayOfbyte[j] & 0x3) << 4;
|
||||
if (j + 1 == paramArrayOfbyte.length) {
|
||||
arrayOfChar[j / 3 * 4 + 1] = ENCODE_DATA[i];
|
||||
arrayOfChar[j / 3 * 4 + 2] = '=';
|
||||
arrayOfChar[j / 3 * 4 + 3] = '=';
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
i += (paramArrayOfbyte[j] & 0xF0) >> 4;
|
||||
arrayOfChar[j / 3 * 4 + 1] = ENCODE_DATA[i];
|
||||
i = (paramArrayOfbyte[j] & 0xF) << 2;
|
||||
if (j + 1 == paramArrayOfbyte.length) {
|
||||
arrayOfChar[j / 3 * 4 + 2] = ENCODE_DATA[i];
|
||||
arrayOfChar[j / 3 * 4 + 3] = '=';
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
i += (paramArrayOfbyte[j] & 0xC0) >> 6;
|
||||
arrayOfChar[j / 3 * 4 + 2] = ENCODE_DATA[i];
|
||||
arrayOfChar[j / 3 * 4 + 3] = ENCODE_DATA[paramArrayOfbyte[j] & 0x3F];
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new String(arrayOfChar);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
package net.arnx.wmf2svg.util;
|
||||
|
||||
import com.google.appengine.api.images.Image;
|
||||
import com.google.appengine.api.images.ImagesService;
|
||||
import com.google.appengine.api.images.ImagesServiceFactory;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.ColorConvertOp;
|
||||
import java.awt.image.DataBuffer;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
public class ImageUtil {
|
||||
private static Converter converter;
|
||||
|
||||
public static byte[] convert(byte[] paramArrayOfbyte, String paramString, boolean paramBoolean) {
|
||||
if (converter == null)
|
||||
throw new UnsupportedOperationException("Image Conversion API(Image IO or GAE Image API) is missing.");
|
||||
return converter.convert(paramArrayOfbyte, paramString, paramBoolean);
|
||||
}
|
||||
|
||||
static {
|
||||
if ("Production".equals(System.getProperty("com.google.appengine.runtime.environment"))) {
|
||||
converter = new GAEConverter();
|
||||
} else {
|
||||
try {
|
||||
Class.forName("javax.imageio.ImageIO");
|
||||
converter = new ImageIOConverter();
|
||||
} catch (ClassNotFoundException e) {}
|
||||
}
|
||||
}
|
||||
|
||||
private static class GAEConverter implements Converter {
|
||||
private GAEConverter() {}
|
||||
|
||||
public byte[] convert(byte[] param1ArrayOfbyte, String param1String, boolean param1Boolean) {
|
||||
if (param1String == null)
|
||||
throw new IllegalArgumentException("dest type is null.");
|
||||
param1String = param1String.toLowerCase();
|
||||
ImagesService.OutputEncoding outputEncoding = null;
|
||||
if ("png".equals(param1String)) {
|
||||
outputEncoding = ImagesService.OutputEncoding.PNG;
|
||||
} else if ("jpeg".equals(param1String)) {
|
||||
outputEncoding = ImagesService.OutputEncoding.JPEG;
|
||||
} else {
|
||||
throw new UnsupportedOperationException("unsupported image encoding: " + param1String);
|
||||
}
|
||||
ImagesService imagesService = ImagesServiceFactory.getImagesService();
|
||||
Image image = ImagesServiceFactory.makeImage(param1ArrayOfbyte);
|
||||
Object object = param1Boolean ? ImagesServiceFactory.makeVerticalFlip() : ImagesServiceFactory.makeCompositeTransform();
|
||||
return imagesService.applyTransform(object, image, outputEncoding).getImageData();
|
||||
}
|
||||
|
||||
GAEConverter(ImageUtil.null param1null) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
|
||||
private static class ImageIOConverter implements Converter {
|
||||
private ImageIOConverter() {}
|
||||
|
||||
public byte[] convert(byte[] param1ArrayOfbyte, String param1String, boolean param1Boolean) {
|
||||
if (param1String == null)
|
||||
throw new IllegalArgumentException("dest type is null.");
|
||||
param1String = param1String.toLowerCase();
|
||||
byte[] arrayOfByte = null;
|
||||
try {
|
||||
BufferedImage bufferedImage1 = ImageIO.read(new ByteArrayInputStream(param1ArrayOfbyte));
|
||||
BufferedImage bufferedImage2 = new BufferedImage(bufferedImage1.getWidth(), bufferedImage1.getHeight(), 5);
|
||||
ColorConvertOp colorConvertOp = new ColorConvertOp(bufferedImage2.getColorModel().getColorSpace(), null);
|
||||
colorConvertOp.filter(bufferedImage1, bufferedImage2);
|
||||
bufferedImage1 = bufferedImage2;
|
||||
if (param1Boolean) {
|
||||
DataBuffer dataBuffer1 = bufferedImage1.getRaster().getDataBuffer();
|
||||
BufferedImage bufferedImage = new BufferedImage(bufferedImage1.getWidth(), bufferedImage1.getHeight(), bufferedImage1.getType());
|
||||
DataBuffer dataBuffer2 = bufferedImage.getRaster().getDataBuffer();
|
||||
int i = bufferedImage1.getWidth() * bufferedImage1.getColorModel().getPixelSize() / 8;
|
||||
int j = 0;
|
||||
for (int k = bufferedImage1.getHeight() - 1; j < bufferedImage1.getHeight(); k--) {
|
||||
for (int m = 0; m < i; m++)
|
||||
dataBuffer2.setElem(j * i + m, dataBuffer1.getElem(k * i + m));
|
||||
j++;
|
||||
}
|
||||
bufferedImage1 = bufferedImage;
|
||||
}
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
ImageIO.write(bufferedImage1, param1String, byteArrayOutputStream);
|
||||
arrayOfByte = byteArrayOutputStream.toByteArray();
|
||||
} catch (IOException e) {}
|
||||
return arrayOfByte;
|
||||
}
|
||||
|
||||
ImageIOConverter(ImageUtil.null param1null) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
|
||||
private static interface Converter {
|
||||
byte[] convert(byte[] param1ArrayOfbyte, String param1String, boolean param1Boolean);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue