From 868bf973c7174f35feea1f0fe36c4a7762498d94 Mon Sep 17 00:00:00 2001 From: Victor Date: Wed, 14 Nov 2018 23:15:18 +0200 Subject: [PATCH] Initial --- build.xml | 83 ++ nbproject/build-impl.xml | 1247 ++++++++++++++++++++++++++ nbproject/genfiles.properties | 8 + nbproject/private/private.properties | 7 + nbproject/private/private.xml | 5 + nbproject/project.properties | 142 +++ nbproject/project.xml | 10 + src/AccelUtil.java | 147 +++ src/BufDataInputStream.java | 244 +++++ src/Effects.java | 75 ++ src/FWCashe.java | 40 + src/Fonts.java | 38 + src/InputStreamDecoder.java | 49 + src/Key.java | 17 + src/Landscape.java | 64 ++ src/Loading.java | 125 +++ src/Main.java | 35 + src/Options.java | 50 ++ src/Rms.java | 190 ++++ src/StringEncoder.java | 30 + src/TMyPngFont.java | 146 +++ src/TextView.java | 731 +++++++++++++++ src/UI.java | 136 +++ src/Util.java | 159 ++++ src/Viewer.java | 82 ++ src/aNMPWR.java | 307 +++++++ src/res/1 | Bin 0 -> 2307 bytes src/res/2 | Bin 0 -> 2317 bytes src/res/3 | Bin 0 -> 1690 bytes src/res/about | 21 + src/res/icon.png | Bin 0 -> 671 bytes src/res/logo1.mdat | Bin 0 -> 3421 bytes src/res/skin.ini | 11 + 33 files changed, 4199 insertions(+) create mode 100644 build.xml create mode 100644 nbproject/build-impl.xml create mode 100644 nbproject/genfiles.properties create mode 100644 nbproject/private/private.properties create mode 100644 nbproject/private/private.xml create mode 100644 nbproject/project.properties create mode 100644 nbproject/project.xml create mode 100644 src/AccelUtil.java create mode 100644 src/BufDataInputStream.java create mode 100644 src/Effects.java create mode 100644 src/FWCashe.java create mode 100644 src/Fonts.java create mode 100644 src/InputStreamDecoder.java create mode 100644 src/Key.java create mode 100644 src/Landscape.java create mode 100644 src/Loading.java create mode 100644 src/Main.java create mode 100644 src/Options.java create mode 100644 src/Rms.java create mode 100644 src/StringEncoder.java create mode 100644 src/TMyPngFont.java create mode 100644 src/TextView.java create mode 100644 src/UI.java create mode 100644 src/Util.java create mode 100644 src/Viewer.java create mode 100644 src/aNMPWR.java create mode 100644 src/res/1 create mode 100644 src/res/2 create mode 100644 src/res/3 create mode 100644 src/res/about create mode 100644 src/res/icon.png create mode 100644 src/res/logo1.mdat create mode 100644 src/res/skin.ini diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..317061f --- /dev/null +++ b/build.xml @@ -0,0 +1,83 @@ + + + + + + Builds, tests, and runs the project . + + + diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml new file mode 100644 index 0000000..2af8c05 --- /dev/null +++ b/nbproject/build-impl.xml @@ -0,0 +1,1247 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Classpath to J2ME Ant extension library (libs.j2me_ant_ext.classpath property) is not set. For example: location of mobility/modules/org-netbeans-mobility-antext.jar file in the IDE installation directory. + Platform home (platform.home property) is not set. Value of this property should be ${platform.active.description} emulator home directory location. + Platform boot classpath (platform.bootclasspath property) is not set. Value of this property should be ${platform.active.description} emulator boot classpath containing all J2ME classes provided by emulator. + Must set src.dir + Must set build.dir + Must set dist.dir + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set preprocessed.dir + + + + + + + + + + + + + + + + + + Must set build.classes.dir + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + Must set obfuscated.classes.dir + + + + Must set obfuscated.classes.dir + Must set obfuscator.srcjar + Must set obfuscator.destjar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set preverify.classes.dir + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MicroEdition-Configuration: ${platform.configuration} + + MicroEdition-Configuration: ${platform.configuration} + + + + MicroEdition-Profile: ${platform.profile} + + MicroEdition-Profile: ${platform.profile} + + + + Must set dist.jad + + + + + + + + + + + + + + + + + + + + + + + + ${manifest.midlets}${evaluated.manifest.apipermissions}${evaluated.manifest.pushregistry}${manifest.others}${manifest.jad} + ${manifest.midlets}${evaluated.manifest.apipermissions}${evaluated.manifest.pushregistry}${manifest.others}${manifest.manifest} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Starting emulator with port number ${active.debug.port} + + + + + + + + + + + + + + + + + Starting emulator with port number ${active.debug.port} + + + + + + + + + + + + + + + + + Must set dist.javadoc.dir + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${all.configurations} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property deployment.${deployment.method}.scriptfile not set. The property should point to an Ant script providing ${deployment.method} deployment. + + + + + + + + Classpath to Ant Contrib library (libs.ant-contrib.classpath property) is not set. + + + + + + + + + Active project configuration: @{cfg} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property build.root.dir is not set. By default its value should be \"build\". + Property dist.root.dir is not set. By default its value should be \"dist\". + + + + + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties new file mode 100644 index 0000000..9f0b0fb --- /dev/null +++ b/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +build.xml.data.CRC32=8fbe159c +build.xml.script.CRC32=312b9483 +build.xml.stylesheet.CRC32=9c6a911d +nbproject/build-impl.xml.data.CRC32=8fbe159c +nbproject/build-impl.xml.script.CRC32=1a76ba78 +nbproject/build-impl.xml.stylesheet.CRC32=e46c2d22 diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties new file mode 100644 index 0000000..1bcbfa1 --- /dev/null +++ b/nbproject/private/private.properties @@ -0,0 +1,7 @@ +#Wed, 05 Jan 2011 12:46:31 +0200 +app-version.autoincrement=true +config.active= +deployment.counter=15 +deployment.number=0.0.14 +javadoc.preview=true +netbeans.user=C:\\Users\\aNNiMON\\Documents\\NetBeansProjects\\_NBModules\\Pastebin\\build\\testuserdir diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml new file mode 100644 index 0000000..8505fc1 --- /dev/null +++ b/nbproject/private/private.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/nbproject/project.properties b/nbproject/project.properties new file mode 100644 index 0000000..c61b721 --- /dev/null +++ b/nbproject/project.properties @@ -0,0 +1,142 @@ +abilities=MMAPI=1.1,SATSAJCRMI=1.0,SATSACRYPTO=1.0,lib/jsr256.jar=1.0,JSR82=1.1,JSR226=1.0,MIDP=2.0,JSR229=1.1.0,SATSAAPDU=1.0,CLDC=1.1,JSR177=1.0,JSR179=1.0.1,J2MEWS=1.0,WMA=2.0,JSR172=1.0,ColorScreen,OBEX=1.0,JSR238=1.0,JSR211=1.0,JSR234=1.0,lib/midpapi21.jar=1.0,JSR75=1.0,JSR184=1.1,SATSAPKI=1.0,ScreenHeight=225,ScreenColorDepth=8,JSR180=1.1.0,J2MEXMLRPC=1.0, +all.configurations=\ +application.args= +application.description= +application.description.detail= +application.name= +application.vendor=Vendor +build.classes.dir=${build.dir}/compiled +build.classes.excludes=**/*.java,**/*.form,**/*.class,**/.nbintdb,**/*.mvd,**/*.wsclient,**/*.vmd +build.dir=build/${config.active} +build.root.dir=build +debug.level=debug +debugger.timeout= +deployment.copy.target=deploy +deployment.instance=default +deployment.jarurl=${dist.jar} +deployment.method=NONE +deployment.override.jarurl=false +dist.dir=dist/${config.active} +dist.jad=AcceLockView.jad +dist.jar=AcceLockView.jar +dist.javadoc.dir=${dist.dir}/doc +dist.root.dir=dist +extra.classpath= +filter.exclude.tests=false +filter.excludes=changelog.txt +filter.more.excludes=**/overview.html,**/package.html +filter.use.standard=true +jar.compress=true +javac.debug=true +javac.deprecation=false +javac.encoding=UTF-8 +javac.optimize=false +javac.source=1.3 +javac.target=1.3 +javadoc.author=false +javadoc.encoding= +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +libs.classpath= +main.class= +main.class.class=applet +manifest.apipermissions= +manifest.file=manifest.mf +manifest.is.liblet=false +manifest.jad= +manifest.manifest= +manifest.midlets=MIDlet-1: AcceLockView,/res/icon.png,Main\n +manifest.others=MIDlet-Vendor: aNNiMON\nMIDlet-Name: AcceLockView\nMIDlet-Version: 1.1\n +manifest.pushregistry= +name=aNMPWR +no.dependencies=false +nokiaS80.application.icon= +nsicom.application.monitorhost= +nsicom.application.runremote= +nsicom.application.runverbose= +nsicom.remoteapp.location=\\My Documents\\NetBeans Applications +nsicom.remotevm.location=\\Windows\\creme\\bin\\CrEme.exe +obfuscated.classes.dir=${build.dir}/obfuscated +obfuscation.custom=-keep public class * extends javax.microedition.midlet.MIDlet \n-obfuscationdictionary E:\\SETUPS\\Disk\\Programming\\Java\\compact.txt\n-dontusemixedcaseclassnames\n-repackageclasses '' +obfuscation.level=1 +obfuscator.destjar=${build.dir}/obfuscated.jar +obfuscator.srcjar=${build.dir}/before-obfuscation.jar +platform.active=Sony_Ericsson_SDK_2_5_0_6_for_the_Java_TM__ME_Platform_Emulator_ +platform.active.description=Sony Ericsson SDK 2.5.0.6 for the Java(TM) ME Platform(Emulator) +platform.apis=JSR234-1.0,J2ME-WS-1.0,JSR238-1.0,MMAPI-1.1,JSR256-1.1,NokiaUI-1.0,JSR75-1.0,WMA-2.0,JSR82-1.1 +platform.bootclasspath=${platform.home}/lib/jsr256.jar:${platform.home}/lib/jsr238.jar:${platform.home}/lib/jsr082.jar:${platform.home}/lib/nokiaext.jar:${platform.home}/lib/jsr75.jar:${platform.home}/lib/mmapi.jar:${platform.home}/lib/j2me-ws.jar:${platform.home}/lib/wma20.jar:${platform.home}/lib/jsr234.jar:${platform.home}/lib/cldcapi11.jar:${platform.home}/lib/midpapi20.jar +platform.configuration=CLDC-1.1 +platform.device=SonyEricsson_JP8_240x320_Emu +platform.fat.jar=true +platform.profile=MIDP-2.0 +platform.trigger=CLDC +platform.type=UEI-1.0.1 +preprocessed.dir=${build.dir}/preprocessed +preverify.classes.dir=${build.dir}/preverified +preverify.sources.dir=${build.dir}/preverifysrc +resources.dir=resources +ricoh.application.email= +ricoh.application.fax= +ricoh.application.icon= +ricoh.application.target-jar= +ricoh.application.telephone= +ricoh.application.uid=91211980 +ricoh.application.version= +ricoh.dalp.application-desc.auto-run=false +ricoh.dalp.application-desc.energy-save= +ricoh.dalp.application-desc.exec-auth= +ricoh.dalp.application-desc.visible=true +ricoh.dalp.argument= +ricoh.dalp.codebase= +ricoh.dalp.display-mode.color=true +ricoh.dalp.display-mode.is-4line-support=false +ricoh.dalp.display-mode.is-hvga-support=true +ricoh.dalp.display-mode.is-vga-support=false +ricoh.dalp.display-mode.is-wvga-support=false +ricoh.dalp.information.abbreviation= +ricoh.dalp.information.icon.basepath= +ricoh.dalp.information.icon.location= +ricoh.dalp.information.is-icon-used=true +ricoh.dalp.install.destination=hdd +ricoh.dalp.install.mode.auto=true +ricoh.dalp.install.work-dir=hdd +ricoh.dalp.is-managed=true +ricoh.dalp.resources.dsdk.version=2.0 +ricoh.dalp.resources.jar.basepath= +ricoh.dalp.resources.jar.version= +ricoh.dalp.version= +ricoh.icon.invert=false +ricoh.platform.target.version= +run.cmd.options= +run.jvmargs= +run.method=STANDARD +run.security.domain=trusted +run.use.security.domain=false +savaje.application.icon= +savaje.application.icon.focused= +savaje.application.icon.small= +savaje.application.uid=TBD +savaje.bundle.base= +savaje.bundle.debug=false +savaje.bundle.debug.port= +semc.application.caps= +semc.application.icon= +semc.application.icon.count= +semc.application.icon.splash= +semc.application.icon.splash.installonly=false +semc.application.uid=E3524877 +semc.certificate.path= +semc.private.key.password= +semc.private.key.path= +sign.alias= +sign.enabled=false +sign.keystore= +src.dir=src +use.emptyapis=true +use.preprocessor=false diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100644 index 0000000..c30384b --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,10 @@ + + + org.netbeans.modules.kjava.j2meproject + + + AcceLockView + 1.6 + + + diff --git a/src/AccelUtil.java b/src/AccelUtil.java new file mode 100644 index 0000000..9795174 --- /dev/null +++ b/src/AccelUtil.java @@ -0,0 +1,147 @@ +/* + * aNNiMON 2010 + * For more info visit http://annimon.com/ + */ + +import java.io.IOException; +import java.util.Vector; +import javax.microedition.io.Connector; +import javax.microedition.sensor.*; + +/** + * + * @author aNNiMON + */ +public class AccelUtil implements DataListener { + + private int[] channels; + private String[] channelNames; + private SensorConnection sensor; + private String URL; //URL для коннекта + private int numChannels; //количество каналов + private int dataType; //тип приёма данных + private double + minValue,//минимальное значение + maxValue; //максимальное значение + //Сохранённые + private Vector saved; + + public AccelUtil() { + saved = new Vector(); + getInfo(); + } + + public void checkKeys(int key) { + if(key==Rms.keyC) savePositions(); + else if(key==Rms.keyF) saved.removeAllElements(); + } + + public void savePositions() { + saved.addElement(new Pos(channels[0], channels[1], channels[2])); + } + + public boolean isInPosition() { + int x,y,z; + x = channels[0]; + y = channels[1]; + z = channels[2]; + int SENS = Rms.sensetivity; + int n = saved.size(); + for(int i = 0; i x-SENS) && (ps.x < x+SENS) && + (ps.y > y-SENS) && (ps.y < y+SENS) && + (ps.z > z-SENS) && (ps.z < z+SENS)) { + if(Rms.lightsOff) com.nokia.mid.ui.DeviceControl.setLights(0, 100); + return true; + } + } + if(Rms.lightsOff) com.nokia.mid.ui.DeviceControl.setLights(0, 0); + return false; + } + + private void getInfo() { + //Получаем список ВСЕХ сенсоров + SensorInfo[] info = SensorManager.findSensors(null, null); + if (info==null || info.length==0) return; //ничего не нашли, выходим + //Сканируем найденные сенсоры + for(int i=0; i=0) value = (int) (doublevalue * 1024 / maxValue); + else value = (int) (doublevalue * (-1024) / minValue); + + return value; + } + + private class Pos { + int x,y,z; + + Pos(int x, int y, int z) { + this.x = x; + this.y = y; + this.z = z; + } + } +} diff --git a/src/BufDataInputStream.java b/src/BufDataInputStream.java new file mode 100644 index 0000000..045e3e5 --- /dev/null +++ b/src/BufDataInputStream.java @@ -0,0 +1,244 @@ + + +import java.io.*; + +public class BufDataInputStream extends InputStream implements DataInput { + + public static byte buffer[]; + public static int capacity, is_available, bpos, blen; + protected InputStream is; + + public BufDataInputStream(InputStream iis) throws IOException { + bpos = blen = 0; + is = iis; + capacity = is_available = is.available(); + buffer = new byte[capacity]; + if (is != null) is.read(buffer); + } + + public void close() throws IOException { + if (is != null) is.close(); + } + + public int available() { + return blen - bpos + is_available; + } + + public int getCapacity() { + return capacity; + } + + public void seek(int pos) { + bpos = pos; + } + + public int tell() throws IOException { + return capacity - available(); + } + + public int read() throws IOException { + if (bpos > buffer.length) { + return -1; + } + return ((int) buffer[bpos++]) & 0xFF; + } + + public int readBack() throws IOException { + if (bpos == 0) { + if (available() == capacity) return -1; + int old = tell(); + bpos = old; + } + return ((int) buffer[--bpos]) & 0xFF; + } + + public boolean readBoolean() throws IOException { + int r = read(); + if (r == -1) { + throw new IOException("EOF"); + } + return r != 0; + } + + public byte readByte() throws IOException { + int r = read(); + if (r == -1) { + throw new IOException("EOF"); + } + return (byte) r; + } + + public char readChar() throws IOException { + return (char) ((readUnsignedByte() << 8) | readUnsignedByte()); + } + + public void readFully(byte[] b) throws IOException { + if (read(b) < b.length) { + throw new IOException("EOF"); + } + } + + public void readFully(byte[] b, int off, int len) throws IOException { + if (read(b, off, len) < len) { + throw new IOException("EOF"); + } + } + + public int readInt() throws IOException { + return (readUnsignedByte() << 24) | + (readUnsignedByte() << 16) | + (readUnsignedByte() << 8) | + (readUnsignedByte()); + } + + public long readLong() throws IOException { + byte bb[] = new byte[8]; + readFully(bb); + return (bb[0] << 24) | + (bb[1] << 16) | + (bb[2] << 8) | + (bb[3]); + } + + public short readShort() throws IOException { + return (short) ((readUnsignedByte() << 8) | readUnsignedByte()); + } + + public int readUnsignedByte() throws IOException { + return ((int) readByte()) & 0xFF; + } + + public int readUnsignedShort() throws IOException { + return ((int) readShort()) & 0xFFFF; + } + + public int skipBytes(int len) throws IOException { + return (int) skip(len); + } + + public String readUTF() throws IOException, UTFDataFormatException { + int n = readUnsignedShort(); + byte b[] = new byte[n]; + readFully(b); + return new String(b, 0, b.length, "UTF-8"); + } + + public char readCharUTF() throws IOException, UTFDataFormatException { + int b, c, d; + b = read(); + if (b == -1) { + return (char) -1; + } + if ((b & 0x80) == 0) { + return (char) b; + } else if ((b & 0xE0) == 0xC0) { + c = read(); + if ((c & 0xC0) != 0x80) { + throw new UTFDataFormatException(); + } + return (char) (((b & 0x1F) << 6) | (c & 0x3F)); + } else if ((b & 0xF0) == 0xE0) { + c = read(); + d = read(); + if ((c & 0xC0) != 0x80 || (d & 0xC0) != 0x80) { + throw new UTFDataFormatException(); + } + return (char) (((b & 0x0F) << 12) | ((c & 0x3F) << 6) | (d & 0x3F)); + } + throw new UTFDataFormatException(); + } + + public char readCharBackUTF() throws IOException, UTFDataFormatException { + int b, c, d; + d = readBack(); + c = readBack(); + b = readBack(); + if (d == -1) { + return (char) -1; + } + if ((d & 0x80) == 0) { + read(); + read(); + return (char) d; + } else if ((c & 0xE0) == 0xC0 && (d & 0xC0) == 0x80) { + read(); + return (char) (((c & 0x1F) << 6) | (d & 0x3F)); + } else if ((b & 0xF0) == 0xE0 && (c & 0xC0) == 0x80 && (d & 0xC0) == 0x80) { + return (char) (((b & 0x0F) << 12) | ((c & 0x3F) << 6) | (d & 0x3F)); + } + throw new UTFDataFormatException(); + } + + public String readUTF(int count) throws IOException, UTFDataFormatException { + String s = ""; + int i = 0; + while (i < count && available() > 0) { + s += readCharUTF(); + i++; + } + return s; + } + + public int skipUTF(int count) throws IOException, UTFDataFormatException { + byte b; + int i = 0, r = 0; + while (i < count) { + b = readByte(); + if ((b & 0x80) == 0) { + r++; + } else if ((((int) b) & 0xE0) == 0xC0) { + readByte(); + r += 2; + } else if ((((int) b) & 0xF0) == 0xE0) { + readShort(); + r += 3; + } else { + throw new UTFDataFormatException(); + } + i++; + } + return r; + } + + public boolean checkBOM() { + try { + if (available() < 3 || + read() != 0xEF || + read() != 0xBB || + read() != 0xBF) { + return false; + } + } catch (IOException iox) { + return false; + } + return true; + } + + public boolean find(byte[] b) { + if (b == null) return false; + int po = 0; + for (int i = bpos + 1; i < buffer.length; i++) { + po = 0; + if (buffer[i] == b[0]) { + for (int j = 0; j < b.length; j++) { //System.out.println("b "+b[j]); + if (buffer[i + j] == b[j]) { + po += 1; + } else break; + } + } + if (po == b.length) { + bpos = i; + break; + } + } + return (po > 0); + } + + public float readFloat() throws IOException { + return 0; + } + + public double readDouble() throws IOException { + return 0; + } +} diff --git a/src/Effects.java b/src/Effects.java new file mode 100644 index 0000000..c8a9f5c --- /dev/null +++ b/src/Effects.java @@ -0,0 +1,75 @@ +import javax.microedition.lcdui.*; + +/** + * + * @author aNNiMON + */ +public class Effects { + + public static Image effect(Image img) { + int[] pixel = new int[img.getWidth() * img.getHeight()]; + img.getRGB(pixel, 0, img.getWidth(), 0, 0, img.getWidth(), img.getHeight()); + for (int io = 0; io < pixel.length; io++) { + int qa = (pixel[io] >> 24) & 0xff; + int qr = (pixel[io] >> 16) & 0xff; + int qg = (pixel[io] >> 8) & 0xff; + int qb = pixel[io] & 0xff; + qr += UI.osv;if(qr>255) qr=255;if(qr<0) qr=0; + qg += UI.osv;if(qg>255) qg=255;if(qg<0) qg=0; + qb += UI.osv;if(qb>255) qb=255;if(qb<0) qb=0; + pixel[io] = (qa << 24) | (qr << 16) | (qg << 8) | qb; + + } + return Image.createRGBImage(pixel, img.getWidth(), img.getHeight(), true); + } + + public static Image osv(Image img, byte mode) { + int[] ar = new int[] {-255, -200, -150, -100, -50, 0, 50, 100, 150, 200, 255}; + //{-255,-60,-50,-40,-30,-20,-10,0,10,20,30,40,50,60,255}; + int osv = ar[mode]; + int[] pixel = new int[img.getWidth() * img.getHeight()]; + img.getRGB(pixel, 0, img.getWidth(), 0, 0, img.getWidth(), img.getHeight()); + for (int io = 0; io < pixel.length; io++) { + int qa = (pixel[io] >> 24) & 0xff; + int qr = (pixel[io] >> 16) & 0xff; + int qg = (pixel[io] >> 8) & 0xff; + int qb = pixel[io] & 0xff; + qr += osv;if(qr>255) qr=255;if(qr<0) qr=0; + qg += osv;if(qg>255) qg=255;if(qg<0) qg=0; + qb += osv;if(qb>255) qb=255;if(qb<0) qb=0; + pixel[io] = (qa << 24) | (qr << 16) | (qg << 8) | qb; + + } + return Image.createRGBImage(pixel, img.getWidth(), img.getHeight(), true); + } + + public static Image Resize(Image temp, int newX, int newY) + { + newX=Math.abs(newX)+1; newY=Math.abs(newY)+1; + int rgb[] = new int[temp.getWidth() * temp.getHeight()]; + temp.getRGB(rgb, 0, temp.getWidth(), 0, 0, temp.getWidth(), temp.getHeight()); + int rgb2[] = rescaleArray(rgb, temp.getWidth(), temp.getHeight(), newX, newY); + Image temp2 = Image.createRGBImage(rgb2, newX, newY, true); + return temp2; + } + + private static int[] rescaleArray(int ini[], int x, int y, int x2, int y2) { + int out[] = new int[x2 * y2]; + for(int yy = 0; yy < y2; yy++) { + int dy = (yy * y) / y2; + for(int xx = 0; xx < x2; xx++) { + int dx = (xx * x) / x2; + out[x2 * yy + xx] = ini[x * dy + dx]; + } + } + return out; + } + + public static int acolor(int argb, char c) { + if(c=='a') return ((argb >> 24) & 0xff); + else if(c=='r') return ((argb >> 16) & 0xff); + else if(c=='g') return ((argb >> 8) & 0xff); + else if(c=='b') return (argb & 0xff); + else return argb; + } +} diff --git a/src/FWCashe.java b/src/FWCashe.java new file mode 100644 index 0000000..4813aa9 --- /dev/null +++ b/src/FWCashe.java @@ -0,0 +1,40 @@ +import javax.microedition.lcdui.Font; +import java.util.Vector; + +public class FWCashe { + protected static Vector fwc = new Vector(); + protected static Vector fwc_f = new Vector(); + protected Object font; + protected byte[][] caches; + + public static FWCashe getCache(Object font) { + int t = fwc.size(); + for (int i = 0; i < t; i++) { + if (fwc_f.elementAt(i).equals(font)) + return (FWCashe)fwc.elementAt(i); + } + fwc_f.addElement(font); + FWCashe f; + fwc.addElement(f = new FWCashe (font)); + return f; + } + + protected FWCashe(Object font) { + this.font = font; + caches = new byte [256][]; + for (int i = 0; i < 256; i++) + caches[i] = null; + } + + public int charWidth (char ch) { + int hi = (ch >> 8)&0xFF, lo = (ch)&0xFF; + if (caches[hi] == null) { + caches[hi] = new byte [256]; + for (int i = 0; i < 256; i++) + caches [hi][i] = -1; + } + if (caches [hi][lo] == -1) + caches [hi][lo] = (byte) Fonts.charWidth(font, ch); + return caches [hi][lo]; + } +} diff --git a/src/Fonts.java b/src/Fonts.java new file mode 100644 index 0000000..914d92a --- /dev/null +++ b/src/Fonts.java @@ -0,0 +1,38 @@ + +import javax.microedition.lcdui.Font; + +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +/** + * + * @author aNNiMON + */ +public class Fonts { + + public static int getHeight(Object fnt) { + if(fnt instanceof Font) { + return ((Font) (fnt)).getHeight(); + }else{ + return ((TMyPngFont) (fnt)).getHeight(); + } + } + + public static int charWidth(Object fnt, char ch) { + if(fnt instanceof Font) { + return ((Font) (fnt)).charWidth(ch); + }else{ + return ((TMyPngFont) (fnt)).CharWidth((byte) ch); + } + } + + public static int stringWidth(Object fnt, String s) { + if(fnt instanceof Font) { + return ((Font) (fnt)).stringWidth(s); + }else{ + return ((TMyPngFont) (fnt)).TextWidth(s); + } + } +} diff --git a/src/InputStreamDecoder.java b/src/InputStreamDecoder.java new file mode 100644 index 0000000..d8818c4 --- /dev/null +++ b/src/InputStreamDecoder.java @@ -0,0 +1,49 @@ + + +import java.io.*; + +public class InputStreamDecoder +{ + private int enc; + private BufDataInputStream bdis; + + public InputStreamDecoder (BufDataInputStream bdis, String enc) throws UnsupportedEncodingException + { + if (enc.compareTo ("UTF-8") == 0) this.enc = 1; + else if (enc.compareTo ("windows-1251") == 0) this.enc = 2; + else throw new UnsupportedEncodingException ("Encoding " + enc + " is not supported"); + this.bdis = bdis; + } + + public char readChar() throws IOException + { + char c = (char)(-1); + if (bdis.available () > 0) + { + if (enc == 2) + { + int i = bdis.read(); + if (i != -1) + c = StringEncoder.decodeCharCP1251((byte)i); + } + else if (enc == 1) {int i = bdis.readCharUTF(); c = (char) (i);} + else throw new IOException ("Internal InputStreamDecoder error"); + } + return (char) (c); + } + + public char readCharBack () throws IOException + { + if (bdis.tell () <= 0) return (char)(-1); + if (enc == 1) { + int i = bdis.readCharBackUTF(); + return (char) (i); + } + else if (enc == 2) { + int i = bdis.readBack(); + if (i == -1) return (char)(-1); + return StringEncoder.decodeCharCP1251 ((byte)(i)); + } + throw new IOException ("error"); + } +} diff --git a/src/Key.java b/src/Key.java new file mode 100644 index 0000000..b47219e --- /dev/null +++ b/src/Key.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +/** + * + * @author sinaz + */ +public class Key { + + public static int leftSoftKey = -6;//ALL Devices + public static int rightSoftKey = -7;//ALL Devices + public static int Back = -11;//SonyEricsson + public static int C = -8;//SonyEricsson + public static int Focus = -25;//SonyEricsson +} diff --git a/src/Landscape.java b/src/Landscape.java new file mode 100644 index 0000000..40fd0a6 --- /dev/null +++ b/src/Landscape.java @@ -0,0 +1,64 @@ +import javax.microedition.lcdui.*; + +/** + * + * @author aNNiMON + */ +public class Landscape { + + public static Image I; + public static Graphics G; + private static int w,h; + + public static void drawImage() { + UI.drawRect(G, UI.col1, UI.col2, 0, 0, w, h); + } + + public static void init(int w, int h) { + Landscape.w = w; Landscape.h = h; + I = Image.createImage(w, h); + G = I.getGraphics(); + } + + public static void draw(Graphics g) { + g.drawRegion(I, 0, 0, w, h, 5, 0, 0, 20); + } + + public static int reverseKey(int key) { + if(!Rms.landscape) return key; + switch(key) { + case 50://KEY_NUM2: + key = 52;//KEY_NUM4; + break; + case 52://KEY_NUM4: + key = 56;//KEY_NUM8; + break; + case 54://KEY_NUM6: + key = 50;//KEY_NUM2; + break; + case 56://KEY_NUM8: + key = 54;//KEY_NUM6; + break; + } + return key; + } + + public static int reverseActionKey(int ga) { + if(!Rms.landscape) return ga; + switch(ga) { + case 1://UP: + ga = 2;//LEFT; + break; + case 2://LEFT: + ga = 6;//DOWN; + break; + case 5://RIGHT: + ga = 1;//UP; + break; + case 6://DOWN: + ga = 5;//RIGHT; + break; + } + return ga; + } +} diff --git a/src/Loading.java b/src/Loading.java new file mode 100644 index 0000000..0be99fb --- /dev/null +++ b/src/Loading.java @@ -0,0 +1,125 @@ +import java.io.InputStream; +import javax.microedition.lcdui.*; + +/** + * @author aNNiMON + */ +public class Loading extends Canvas implements Runnable { + + private int w,h, sleep; + private byte mode; + private Thread thr; + private Image logo1; + private long lt; + private boolean slp; + private String aNMPWR; + + public Loading() { + setFullScreenMode(true); + slp = true; + w = getWidth(); + h = getHeight(); + mode=0; sleep=3000; + try { + logo1 = load("/res/logo1.mdat", 3407); + } catch (Exception ex) { + ex.printStackTrace(); + } + thr = new Thread(this); + thr.start(); + } + + public final void paint(Graphics g) { + g.setColor(0x100201); + g.fillRect(0,0,w,h); + switch(mode) { + case 1: + g.drawImage(logo1, w/2, h/2, 3); + g.setColor(0x990000); + g.drawString(aNMPWR, w/2, 5, 17); + repaint(); + break; + case 2: + slp = false; + System.gc(); + Main.midlet.dsp.setCurrent(new aNMPWR()); + break; + } + } + + protected void pointerPressed(int pix, int piy) { + lt = System.currentTimeMillis(); + mode++; + repaint(); + } + + public final void keyPressed(int key) { + if(getGameAction(key)==FIRE) { + lt = System.currentTimeMillis(); + mode++; + repaint(); + } + } + + public void run() { + while(true) { + if(!slp) break; + if(System.currentTimeMillis()-lt>sleep) { + mode++; + lt = System.currentTimeMillis(); + repaint(); + } + } + } + + private Image load(String str, int ii) { + try { + byte[] abyte0 = new byte[ii]; + InputStream dis = getClass().getResourceAsStream(str); + dis.read(abyte0, 0, ii); + BufDataInputStream bdis = new BufDataInputStream(dis); + aNMPWR = bdis.readUTF(); + dis.close(); + int j; + if (ii < 100) j = 10 + ii % 10; + else if (ii < 200) j = 50 + ii % 20; + else if (ii < 300) j = 80 + ii % 20; + else j = 100 + ii % 50; + for (int k = 0; k < j; k++) { + byte byte0 = abyte0[k]; + abyte0[k] = abyte0[ii - k - 1]; + abyte0[ii - k - 1] = byte0; + } + byte[] start = new byte[] {(byte) 0x89, (byte) 0x50, (byte) 0x4E, (byte) 0x47, + (byte) 0x0D, (byte) 0x0A, (byte) 0x1A, (byte) 0x0A, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x0D, + (byte) 0x49, (byte) 0x48, (byte) 0x44, (byte) 0x52}; + byte[] end = new byte[] {(byte) 0x49, (byte) 0x45, (byte) 0x4E, (byte) 0x44, + (byte) 0xAE, (byte) 0x42, (byte) 0x60, (byte) 0x82}; + byte[] png = new byte[start.length+abyte0.length+end.length]; + int y = start.length; + System.arraycopy(start, 0, png, 0, y); + System.arraycopy(abyte0, 0, png, y, abyte0.length); + y+=abyte0.length; + System.arraycopy(end, 0, png, y, end.length); + start=null; + end=null; + abyte0=null; + //save(png); + return Image.createImage(png, 0, png.length); + } catch (Exception in) { + in.printStackTrace(); + return null; + } + } + + /* private void save(byte[] png) throws IOException { + javax.microedition.io.file.FileConnection fc = (javax.microedition.io.file.FileConnection) javax.microedition.io.Connector.open("file:///c:/anm.png"); + fc.create(); + java.io.OutputStream is = fc.openOutputStream(); + is.write(png); + is.close(); + fc.close(); + + }*/ +} \ No newline at end of file diff --git a/src/Main.java b/src/Main.java new file mode 100644 index 0000000..e7e437d --- /dev/null +++ b/src/Main.java @@ -0,0 +1,35 @@ +import javax.microedition.midlet.*; +import javax.microedition.lcdui.*; + +/** + * @author aNNiMON + */ +public class Main extends MIDlet { + + public Display dsp; + public static Main midlet; + public static String name; + public Loading cnv; + + public Main () { + midlet = this; + } + + public void startApp() { + Rms.loadBookMarks(); + cnv = new Loading(); + cnv.setFullScreenMode(true); + name = "AcceLockView"; + Util.getUI("/res/skin.ini"); + dsp = Display.getDisplay(this); + dsp.setCurrent(cnv); + } + + public void pauseApp() { + } + + public void destroyApp(boolean un) { + Rms.saveBookMarks(); + notifyDestroyed(); + } +} diff --git a/src/Options.java b/src/Options.java new file mode 100644 index 0000000..25a8aff --- /dev/null +++ b/src/Options.java @@ -0,0 +1,50 @@ +import javax.microedition.lcdui.*; + +/* + * aNNiMON 2011 + * For more info visit http://annimon.com/ + */ + +/** + * + * @author aNNiMON + */ +public class Options extends Form implements CommandListener{ + + private Displayable pv; + private Command back, ok; + private TextField key_C, key_F, sens; + private ChoiceGroup cRC; + + public Options(Displayable ds) { + super("Настройки"); + pv = ds; + ok = new Command("Ok", Command.OK, 1); + back = new Command("Назад", Command.BACK, 3); + cRC = new ChoiceGroup ("", ChoiceGroup.MULTIPLE); + cRC.append("Выключать подсветку", null); + cRC.setSelectedIndex(0, Rms.lightsOff); + sens = new TextField("Чувствительность", String.valueOf(Rms.sensetivity), 3, TextField.NUMERIC); + key_C = new TextField("Код клавиши установки", String.valueOf(Rms.keyC), 3, TextField.DECIMAL); + key_F = new TextField("Код клавиши сброса", String.valueOf(Rms.keyF), 3, TextField.DECIMAL); + append(cRC); + append(sens); + append(key_C); + append(key_F); + addCommand(back); + addCommand(ok); + setCommandListener(Options.this); + } + + public void commandAction(Command c, Displayable d) { + if (c==back) Main.midlet.dsp.setCurrent(pv); + else if(c == ok) { + Rms.lightsOff = cRC.isSelected(0); + Rms.sensetivity = Integer.parseInt(sens.getString()); + Rms.keyC = Integer.parseInt(key_C.getString()); + Rms.keyF = Integer.parseInt(key_F.getString()); + Main.midlet.dsp.setCurrent(pv); + } + } + +} diff --git a/src/Rms.java b/src/Rms.java new file mode 100644 index 0000000..b952bc4 --- /dev/null +++ b/src/Rms.java @@ -0,0 +1,190 @@ +import java.io.*; +import java.util.Vector; +import javax.microedition.rms.*; + +/** + * + * @author aNNiMON + */ +public class Rms { + + private static RecordStore bookmarksStore; + private static final String bookmarksName = "ALV_bkmrk"; + protected static Vector bookmarks = new Vector(); + private static final String rmsName = "ALV"; + private static RecordStore rmsStore; + public static boolean firstStart = true; + public static boolean landscape = false; + public static boolean fsmode = true; + public static boolean lightsOff = false; + public static byte osvmode = 5; + public static int sensetivity = 80; + public static int keyC = -8; //Установка + public static int keyF = -25; //Сброс + //public static int run = 0; + + protected static class BookMarkRecord { + + public String name; + public int srcStart; + public int srcEnd; + } + + public static void setBookMark(String name, int strpos, int endpos) { + BookMarkRecord bmr = null; + for (int i = 0; i < bookmarks.size(); i++) { + bmr = (BookMarkRecord) bookmarks.elementAt(i); + if (bmr.name.equals(name)) { + bmr.srcStart = strpos; + bmr.srcEnd = endpos; + return; + } + } + bmr = new BookMarkRecord(); + bmr.name = name; + bmr.srcStart = strpos; + bmr.srcEnd = endpos; + bookmarks.addElement(bmr); + } + + public static int[] getBookMark(String name) { + BookMarkRecord bmr = null; + int[] r = new int[3]; + r[0]=-666; + for (int i = 0; i < bookmarks.size(); i++) { + bmr = (BookMarkRecord) bookmarks.elementAt(i); + if (bmr.name.equals(name)) { + r[0] = bmr.srcStart; + r[1] = bmr.srcEnd; + break; + } + } + return r; + } + + /** + * Сохранение закладок + */ + public static void saveBookMarks() { + saveOptions(); + try { + RecordStore.deleteRecordStore(bookmarksName); + } catch (RecordStoreException e) { + } + + try { + bookmarksStore = RecordStore.openRecordStore(bookmarksName, true); + + for (int i = 0; i < bookmarks.size(); i++) { + try { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + DataOutputStream dos = new DataOutputStream(baos); + + dos.writeUTF(((BookMarkRecord) bookmarks.elementAt(i)).name); + dos.writeInt(((BookMarkRecord) bookmarks.elementAt(i)).srcStart); + dos.writeInt(((BookMarkRecord) bookmarks.elementAt(i)).srcEnd); + + byte b[] = baos.toByteArray(); + bookmarksStore.addRecord(b, 0, b.length); + } catch (Exception e) { + } + } + + bookmarksStore.closeRecordStore(); + } catch (Exception e) { + } + } + + /** + * Чтение закладок из хранилища + */ + public static void loadBookMarks() { + restoreOptions(); + bookmarks.removeAllElements(); + try { + bookmarksStore = RecordStore.openRecordStore(bookmarksName, true); + try { + for (RecordEnumeration enumX = bookmarksStore.enumerateRecords(null, null, true); enumX.hasNextElement();) { + int recId = enumX.nextRecordId(); + ByteArrayInputStream bais = new ByteArrayInputStream(bookmarksStore.getRecord(recId)); + DataInputStream dis = new DataInputStream(bais); + + BookMarkRecord bmr = new BookMarkRecord(); + bmr.name = dis.readUTF(); + bmr.srcStart = dis.readInt(); + bmr.srcEnd = dis.readInt(); + + bookmarks.addElement(bmr); + } + } catch (Exception e) { + } + + bookmarksStore.closeRecordStore(); + } catch (RecordStoreNotFoundException e) { + } catch (RecordStoreException e) { + } + } + + public static void saveOptions() { + if (rmsStore != null) { + byte[] options = null; + try { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + DataOutputStream dos = new DataOutputStream(baos); + dos.writeBoolean(firstStart); + dos.writeInt(TextView.fntTextc); + dos.writeByte(osvmode); + dos.writeBoolean(fsmode); + dos.writeBoolean(landscape); + dos.writeInt(sensetivity); + dos.writeInt(keyC); + dos.writeInt(keyF); + dos.writeBoolean(lightsOff); + //dos.writeInt(run); + dos.flush(); + options = baos.toByteArray(); + dos.close(); + rmsStore.setRecord(1, options, 0, options.length); + } catch (InvalidRecordIDException ridex) { + try { + rmsStore.addRecord(options, 0, options.length); + } catch (RecordStoreException ex) { + } + } catch (Exception ex) { + } + } + if (rmsStore != null) { + try { + rmsStore.closeRecordStore(); + rmsStore = null; + } catch (RecordStoreException ex) { + } + } + } + + public static void restoreOptions() { + try { + rmsStore = RecordStore.openRecordStore(rmsName, true); + } catch (RecordStoreException ex) { + rmsStore = null; + } + if (rmsStore != null) { + try { + DataInputStream dis = new DataInputStream(new ByteArrayInputStream(rmsStore.getRecord(1))); + firstStart = dis.readBoolean(); + TextView.fntTextc = dis.readInt(); + osvmode = dis.readByte(); + fsmode = dis.readBoolean(); + landscape = dis.readBoolean(); + sensetivity = dis.readInt(); + keyC = dis.readInt(); + keyF = dis.readInt(); + lightsOff = dis.readBoolean(); + //run = dis.readInt() + 1; + dis.close(); + } catch (Exception ex) { + } + } + } +} + diff --git a/src/StringEncoder.java b/src/StringEncoder.java new file mode 100644 index 0000000..1524d1c --- /dev/null +++ b/src/StringEncoder.java @@ -0,0 +1,30 @@ + + +public class StringEncoder +{ + protected static char cp1251 [] = + { + '\u0410', '\u0411', '\u0412', '\u0413', '\u0414', '\u0415', '\u0416', + '\u0417', '\u0418', '\u0419', '\u041A', '\u041B', '\u041C', '\u041D', + '\u041E', '\u041F', '\u0420', '\u0421', '\u0422', '\u0423', '\u0424', + '\u0425', '\u0426', '\u0427', '\u0428', '\u0429', '\u042A', '\u042B', + '\u042C', '\u042D', '\u042E', '\u042F', '\u0430', '\u0431', '\u0432', + '\u0433', '\u0434', '\u0435', '\u0436', '\u0437', '\u0438', '\u0439', + '\u043A', '\u043B', '\u043C', '\u043D', '\u043E', '\u043F', '\u0440', + '\u0441', '\u0442', '\u0443', '\u0444', '\u0445', '\u0446', '\u0447', + '\u0448', '\u0449', '\u044A', '\u044B', '\u044C', '\u044D', '\u044E', + '\u044F' + }; + + public static char decodeCharCP1251 (byte b) + { + int ich = b & 0xff; + if (ich == 0xb8) // ё + return 0x0451; + else if (ich == 0xa8) // Ё + return 0x0401; + else if (ich >= 0xc0) + return cp1251[ich-192]; + return (char)ich; + } +} diff --git a/src/TMyPngFont.java b/src/TMyPngFont.java new file mode 100644 index 0000000..bcc182f --- /dev/null +++ b/src/TMyPngFont.java @@ -0,0 +1,146 @@ + + + +import java.io.IOException; +import java.io.InputStream; +import javax.microedition.lcdui.Graphics; +import javax.microedition.lcdui.Image; + +public class TMyPngFont //extends TMyFont +{ + + private Image FontImage = null; + private short CharOffsetX[] = null; + private short CharOffsetY[] = null; + private byte CharWidth[] = null; + private InputStream is; + private byte height; + private int textColor; + private int backgroundColor; + + int ReadWord() throws IOException { + return (is.read() & 0xff) | (is.read() & 0xff) << 8; + } + + int ReadInt() throws IOException { + return ((is.read() & 0xff) | (is.read() & 0xff) << 8) | ((is.read() & 0xff) | (is.read() & 0xff) << 8) << 16; + } + + byte ReadByte() throws IOException { + return (byte) is.read(); + } + + public TMyPngFont(String s) throws Exception { + try { + CharOffsetX = new short[256]; + CharOffsetY = new short[256]; + CharWidth = new byte[256]; + is = getClass().getResourceAsStream(s); + if (ReadWord() != 13313) + { + is.close(); + throw new Exception(); + } + ReadInt(); + height = ReadByte(); + ReadByte(); + textColor = ReadInt(); + backgroundColor = ReadInt(); + for (int l = 0; l < 32; l++) { + CharOffsetX[l] = 0; + CharOffsetY[l] = 0; + CharWidth[l] = 0; + } + short word0 = 0; + short word1 = 0; + for (int i1 = 32; i1 < 256; i1++) { + byte byte2 = ReadByte(); + if (word0 + byte2 > 200) { + word0 = 0; + word1 += ((short) height); + } + CharOffsetX[i1] = word0; + CharOffsetY[i1] = word1; + CharWidth[i1] = byte2; + word0 += ((short) (byte2)); + } + int imgsize = ReadInt(); + byte imgbyte[] = new byte[imgsize]; + is.read(imgbyte, 0, imgsize); + is.close(); + FontImage = Image.createImage(imgbyte, 0, imgsize); + backgroundColor = ChangeColor(0, backgroundColor); + } catch (Exception exception) { + throw new Exception(); + } catch (OutOfMemoryError outofmemoryerror) { + throw new Exception(); + } + } + + public void SetColor(int newcolor) { + textColor = ChangeColor(newcolor |= 0xff000000, textColor); + } + + private int ChangeColor(int newcolor, int textColor) { + textColor |= 0xff000000; + int width = FontImage.getWidth(); + int height = FontImage.getHeight(); + int lenght = width * height; + int pixelARGB[] = new int[lenght]; + FontImage.getRGB(pixelARGB, 0, width, 0, 0, width, height); + for (int pos = 0; pos < lenght; pos++) { + if (pixelARGB[pos] == textColor) { + pixelARGB[pos] = newcolor; + } + } + FontImage = Image.createRGBImage(pixelARGB, width, height, true); + return textColor = newcolor - 0xff000000; + } + + public void DrawText(Graphics g, int x, int y, String s) { + int[] clip = getClip(g); + for (int k = 0; k < s.length(); k++) { + int ch = s.charAt(k); + /* unicode to ansi */ + ch = ch == 0x401 ? 0xa8 : ch == 0x451 ? 0xb8 : ch; + ch = ch > 0x400 ? ch - 0x350 : ch; + char c = (char) ch; + if (CharWidth[c] == 0) continue; + if (x + CharWidth[c] >= 0) { + g.setClip(x, y, ((int) (CharWidth[c])), ((int) height)); + g.drawImage(FontImage, x - CharOffsetX[c], y - CharOffsetY[c], 20); + } + x += ((int) (CharWidth[c])); + } + g.setClip(clip[0], clip[1], clip[2], clip[3]); + } + + public int TextWidth(String s) { + int j = 0; + for (int i = 0; i < s.length(); i++) { + int ch = s.charAt(i); + ch = ch == /*�*/ 0x401 ? 0xa8 : ch == /*�*/ 0x451 ? 0xb8 : ch; + ch = ch > 0x400 ? ch - 0x350 : ch;//if (c > '\377') c = '\0'; + j += ((int) (CharWidth[ch])); + } + return j; + } + + public int CharWidth(byte byte0) { + int i = ((int) (byte0)); + if (i < 0) i = 256 + i; + return ((int) (CharWidth[i])); + } + + public int getHeight() { + return height; + } + + private int[] getClip(Graphics g) { + int[] a = new int[4]; + a[0]=g.getClipX(); a[1]=g.getClipY(); + a[2]=g.getClipWidth(); a[3]=g.getClipHeight(); + return a; + } + +} \ No newline at end of file diff --git a/src/TextView.java b/src/TextView.java new file mode 100644 index 0000000..b2beac6 --- /dev/null +++ b/src/TextView.java @@ -0,0 +1,731 @@ +import javax.microedition.lcdui.*; +import java.io.*; +import java.util.Vector; +import javax.microedition.io.ConnectionNotFoundException; +import javax.microedition.io.Connector; + +/** + * @author aNNiMON + */ +public class TextView extends Canvas { + + public Displayable parent; + // Чтение и запись текста + private Image im; + private BufDataInputStream bdis = null; + private InputStreamDecoder isd = null; + private String enc = null; + private int scrStart, scrEnd, aupause, dry, iy; + public static int fntTextc = 1; + private int maxnumFont = 9; + private boolean auto, center; + //тред + private boolean up,down; + // Отрисовка текста и заголовок + private FWCashe fch; + private Object fntText; + private String caption, dmi, lines[], url, urlname, imgname; + private int linesPerScreen, fntTextHeight, w, h, lineposes[]; + private boolean wordWrapGlobal = true; + // Полноэкранный режим + private int color = UI.def;//буфер для цвета + private int header, footer; + private int fore = 0x000080; + private int imgsh; + private boolean showimage = false; + private boolean showinf; + + private AccelUtil au; + + public TextView(AccelUtil au) { + setFullScreenMode(true); + this.au = au; + initScreenModes(); + aupause=2; showinf=false; + fntText = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_SMALL); + fntTextHeight = Fonts.getHeight(fntText); + fch = FWCashe.getCache(fntText); + linesPerScreen = (h - 2*UI.getSoftBarHeight()) / (fntTextHeight+1)-1; + lines = new String[linesPerScreen]; + lineposes = new int[linesPerScreen + 1]; + // инициализация переменных i/o + bdis = null; + isd = null; + // фулл/не фулл скрин + setFSMode(!Rms.fsmode); + } + + private void init() { + fntTextHeight = Fonts.getHeight(fntText); + fch = FWCashe.getCache(fntText); + linesPerScreen =(h - 2*UI.getSoftBarHeight()) / (fntTextHeight+1)-1; + lines = new String[linesPerScreen]; + lineposes = new int[linesPerScreen + 1]; + // фулл/не фулл скрин + setFSMode(Rms.fsmode); + } + + private void setFSMode(boolean nm) { + Rms.fsmode = nm; + int ft = Fonts.getHeight(fntText); + if (!Rms.fsmode) { + header = UI.getSoftBarHeight(); + footer = UI.getSoftBarHeight(); + } else { + header = footer = 0; + ft -= 1; + } + linesPerScreen =(h - (header+footer)) / (ft+1)-1; + lines = new String[linesPerScreen]; + lineposes = new int[linesPerScreen + 1]; + if (bdis != null) { + try { + bdis.seek(scrStart); + readScreen(wordWrapGlobal); + } catch (Exception x) { + } + } + repaint(); + } + + private void openStream(InputStream is) { + clearScreen(); + if (bdis != null) bdis = null; + try { + bdis = new BufDataInputStream(is); + try { + detectEncoding(); + } catch (Exception exception) { + enc = "windows-1251"; + } + isd = new InputStreamDecoder(bdis, enc); + if(scrStart < 0) scrStart = 0; + bdis.seek(scrStart); + if (is != null) { + readScreen(wordWrapGlobal); + repaint(); + } + Main.midlet.dsp.setCurrent(this); + } catch (Exception iox) { + iox.printStackTrace(); + } + } + + private void detectEncoding() throws Exception { + enc = "windows-1251";// 0xEFBBBF + if (BufDataInputStream.buffer[0]==-17 && BufDataInputStream.buffer[1]==-69 && BufDataInputStream.buffer[2]==-65) enc="UTF-8"; + else if (checkUTF()) enc = "UTF-8"; + } + + private boolean checkUTF() { + if (bdis.available() <= 0) return false; + String utf = "АЕИЙОУЭЮЯаеийоуэюя"; + int ch = 0; + for (int i = 0; i < utf.length(); i++) { + try { + if (bdis.find((""+utf.charAt(i)).getBytes("UTF-8"))) ch++; + } catch (UnsupportedEncodingException ex) { + ex.printStackTrace(); + } + BufDataInputStream.bpos = 0; + } + return (ch != 0); + } + + public void openFile(final String file, Displayable parent, String title) { + this.parent = parent; + //System.out.println(file); + dmi=imgname=urlname=url=""; + caption = title; + auto = center = false; + switchFont(); getBKMRK(); + new Thread(new Runnable() { + public void run() { + try { + InputStream is = null; + if(file.equals("/res/about")) is = getClass().getResourceAsStream(file); + else is = Connector.openInputStream("file://"+file); + //FileConnection fc = (FileConnection) Connector.open("file://"+file); + //is = fc.openInputStream(); + openStream(is); + } catch (Exception x) { + x.printStackTrace(); + } + } + }).start(); + } + + private void getBKMRK() { + int[] lk = Rms.getBookMark(caption); + if (lk[0] != -666) { + scrStart = lk[0]; + scrEnd = lk[1]; + } + setFSMode(false); + } + + private void closeStream() { + Rms.setBookMark(caption, scrStart, scrEnd); + if (bdis != null) { + try { + bdis.close(); + } catch (IOException iox) { + iox.printStackTrace(); + } + bdis = null; + } + if (parent != null) { + Main.midlet.dsp.setCurrent(parent); + parent = null; + } else { + Main.midlet.dsp.setCurrent(new aNMPWR()); + } + } + + private String readString(boolean wordWrap) { + String s = ""; + int otst; + if(UI.otst<0) center=true; + else center=false; + otst=Math.abs(UI.otst); + int maxStrWidth = w - (otst+5); + char c = '0', cmin1 = (char) -1; + int afterspace = -1, cut = 0, strwidth = 0; + try { + if (bdis == null || bdis.available() <= 0) return null; + + do { + c = isd.readChar(); + + if(c=='i') {//img + char ch='i'; + String u = "i"; int ul = fch.charWidth(ch); + for(int i=0; i<3; i++) { + ch=isd.readChar(); + u+=ch; ul+=fch.charWidth(ch); + } + if(u.equals("img/")) { + do{ch=isd.readChar(); if(ch=='\n') break; u+=ch;}while(ch!=' ');//дочитываем url до конца + String imgurl = u.substring(3).trim(); u=""; + //System.out.println(imgurl); + im = getImage(imgurl); + do{ch=isd.readChar(); if(ch=='\n') break; u+=ch;}while(ch!=' '); + imgname = u.replace('_', ' '); u=""; + dmi = imgname.equals("")?urlname:imgname; + continue; + }else{ + s+=u; strwidth+=ul; continue; + } + } + + if(c=='h') {//парсинг http ссылок + char ch='h'; + String u = "h"; int ul = fch.charWidth(ch); + for(int i=0; i<6; i++) { + ch=isd.readChar(); + u+=ch; ul+=fch.charWidth(ch); + } + if(u.equals("http://")) { + do{ch=isd.readChar(); if(ch=='\n') break; u+=ch;}while(ch!=' ');//дочитываем url до конца + url = u.replace('^','-').substring(7).trim(); u=""; + do{ch=isd.readChar(); if(ch=='\n') break; u+=ch;}while(ch!=' '); + urlname = u.replace('_', ' '); u=""; + dmi = imgname.equals("")?urlname:imgname; + continue; + }else{ + s+=u; strwidth+=ul; continue; + } + } + + if (c != cmin1 && c != '\r') {s += c; strwidth += fch.charWidth(c); } + + if ((c == cmin1) || (c == '\n')) {// новая строка или конец файла + wordWrap = false; + break; + } + if (c == ' ') afterspace = 0; + else if (afterspace >= 0) afterspace++; + } while (strwidth < maxStrWidth); + + if (wordWrap && afterspace >= 0) cut += afterspace; + else if (strwidth > maxStrWidth && c != ' ') cut = 1; + if (cut > 0) { + s = s.substring(0, s.length() - cut); + if (enc.compareTo("UTF-8") != 0) { + bdis.seek(bdis.tell() - cut); + } else { + for (int i = 0; i < cut; i++) { + isd.readCharBack(); + } + } + } + } catch (IOException iox) { + return null; + } + return s; + } + + private String readStringBack(boolean wordWrap) { + String s = ""; + int otst; + if(UI.otst<0) center=true; + else center=false; + otst=Math.abs(UI.otst); + int maxStrWidth = w - (otst+5); + char c = '0', cmin1 = (char) -1; + int afterspace = -1; + int cut = 0; + int strwidth = 0; + try { + if (bdis == null || bdis.tell() <= 0) return null; + + do { + c = isd.readCharBack(); + if (c != cmin1 && c != '\r') { + s = c + s; + strwidth += fch.charWidth(c); + } + if ((c == cmin1) || (c == '\n' && s.length() > 1)) // новая строка или начало файла + { + wordWrap = false; + break; + } + if (c == ' ') afterspace = 1; + else if (c == '\n') afterspace = 0; + else if (afterspace >= 0) afterspace++; + } while (strwidth < maxStrWidth); + + if (wordWrap && afterspace >= 0 && s.length() > afterspace) cut += afterspace; + else if ((strwidth > maxStrWidth && c != ' ') || (c == '\n' && s.length() > 1)) cut = 1; + if (cut > 0) { + s = s.substring(cut, s.length()); + if (enc.compareTo("UTF-8") != 0) bdis.seek(bdis.tell() + cut); + else { + for (int i = 0; i < cut; i++) { + isd.readChar(); + } + } + } + } catch (IOException iox) { + return null; + } + return s; + } + + private void readScreen(boolean wordWrap) { + try { + for (int i = 0; i < linesPerScreen; i++) { + lineposes[i] = bdis.tell(); + lines[i] = readString(wordWrap); + } + lineposes[linesPerScreen] = bdis.tell(); + scrStart = lineposes[0]; + scrEnd = lineposes[linesPerScreen]; + } catch (IOException iox) { + iox.printStackTrace(); + } + } + + private void clearScreen() { + for (int i = 0; i < linesPerScreen; i++) { + lineposes[i] = 0; + lines[i] = null; + } + lineposes[linesPerScreen] = 0; + } + + private void lineUp() { + if(scrStart>0) iy+=5; + if(iy 0) { + bdis.seek(scrStart); + scrEnd = lineposes[linesPerScreen] = lineposes[linesPerScreen - 1]; + for (int i = linesPerScreen - 1; i > 0; i--) { + lines[i] = lines[i - 1]; + lineposes[i] = lineposes[i - 1]; + } + lines[0] = readStringBack(wordWrapGlobal); + scrStart = lineposes[0] = bdis.tell(); + bdis.seek(scrEnd); + } + } catch (IOException iox) { + } + } + + private void lineDown() { + if (scrEnd < bdis.getCapacity()) iy-=5; + if(iy>0) return; + else iy=Fonts.getHeight(fntText); + try { + if (scrEnd < bdis.getCapacity()) { + scrStart = lineposes[1]; + for (int i = 0; i < linesPerScreen - 1; i++) { + lines[i] = lines[i + 1]; + lineposes[i] = lineposes[i + 1]; + } + lineposes[linesPerScreen - 1] = lineposes[linesPerScreen]; + lines[linesPerScreen - 1] = readString(wordWrapGlobal); + lineposes[linesPerScreen] = scrEnd = bdis.tell(); + } + } catch (IOException iox) {} + } + + private void screenUp() { + try { + bdis.seek(scrStart); + for (int i = 0; i < linesPerScreen; i++) { + readStringBack(false); + } + readScreen(wordWrapGlobal); + } catch (Exception iox) {} + } + + private void screenDown() { + try { + if (scrEnd < bdis.getCapacity()) { + readScreen(wordWrapGlobal); + } + } catch (Exception iox) {} + } + + private void initScreenModes() { + if(Rms.landscape) { + w = getHeight(); + h = getWidth(); + Landscape.init(w, h); + }else{ + w = getWidth(); + h = getHeight(); + } + } + + public void paint(Graphics g) { + if(Rms.landscape) { + if(checkosvmode()) { + g.setColor(0xFFFFFF-osvcolor(0x67)); + g.fillRect(0, 0, w, h); + } else Landscape.drawImage(); + portrait(Landscape.G); + Landscape.draw(g); + }else{ + if(checkosvmode()) { + g.setColor(0xFFFFFF-osvcolor(0x67)); + g.fillRect(0, 0, w, h); + } else { + UI.drawRect(g, UI.col1, UI.col2, 0, 0, w, h); + } + portrait(g); + } + if(up) lineUp(); + else if(down) lineDown(); + if(auto) { + try {Thread.sleep(20*aupause);} catch (InterruptedException ex) {ex.printStackTrace();} + lineDown(); + + } + repaint(); + } + + public void portrait(Graphics g) { + if(!au.isInPosition() && (!caption.equals("О программе"))) { + UI.drawScreensaver(g); + return; + } + if(showimage) { + if(imgsh<(w/2)) imgsh+=5; + UI.ACLS(g, w, h, 0x77000000); + g.drawImage(im, imgsh, h/2, 3); + UI.drawMenuInterface(g,imgname,"Закрыть",urlname); + repaint(); + return; + } + g.setColor(osvcolor(UI.def)); + boolean png = fntText instanceof TMyPngFont; + if(!png) g.setFont((Font)fntText); + else if (Rms.osvmode==0 || Rms.osvmode==10) ((TMyPngFont) fntText).SetColor(osvcolor(UI.def)); + int otst; center=(UI.otst<0); otst=Math.abs(UI.otst); //выравнивание + for (int i = 0; i < linesPerScreen; i++) { + if (lines[i] != null) { + try { + parse(g, lines[i], otst, header+2+iy+i*(fntTextHeight + 1), i); + } catch (Exception ex) { + if(png) { + ((TMyPngFont) fntText).DrawText(g, otst, header + iy + 2 + i * (fntTextHeight + 1), lines[i].replace('\n',' '));//.drawString(, , Graphics.HCENTER | Graphics.TOP); + }else{ + if(center) g.drawString(lines[i].replace('\n',' '), w/2, header + iy + 2 + i * (fntTextHeight + 1), Graphics.HCENTER | Graphics.TOP); + else g.drawString(lines[i].replace('\n',' '), otst, header + iy + 2 + i * (fntTextHeight + 1), Graphics.LEFT | Graphics.TOP); + } + } + } + } + drawPosition(g); + if(showinf) { + UI.drawRect(g, UI.curcol1, UI.curcol2, 0, h-UI.getSoftBarHeight()*2, w, UI.getSoftBarHeight()); + if(!png) g.setColor(UI.textcolor); + //else ((TMyPngFont) fntText).SetColor(UI.textcolor); + int cur = (scrStart+scrEnd)/2; + int pr = cur*100/bdis.getCapacity(); + String t = String.valueOf(pr)+"% "+cur+ " из "+ bdis.getCapacity(); + if(png) ((TMyPngFont) fntText).DrawText(g, w/2-Fonts.stringWidth(fntText, t)/2, h-UI.getSoftBarHeight()-fntTextHeight, t); + else g.drawString(t, w/2, h-UI.getSoftBarHeight(), 33); + } + if(Rms.fsmode) return; + if(auto) UI.drawMenuInterface(g,caption+" "+Integer.toString(aupause),dmi,"Назад"); + else UI.drawMenuInterface(g,caption,dmi,"Назад"); + } + + protected void keyPressed(int key) { + int ga = getGameAction(key); + ga = Landscape.reverseActionKey(ga); + if (ga==UP) up=true; + else if (ga==DOWN) down=true; + else if (ga==RIGHT) { + if(auto) {if(aupause<25)aupause++;} + else screenDown(); + } else if (ga==LEFT) { + if(auto) {if(aupause>0)aupause--;} + else screenUp(); + } else if (ga==FIRE) auto=!auto; + else if (key==KEY_NUM1) {//Прыгнуть вверх + scrStart = bdis.bpos = 0; + readScreen(wordWrapGlobal); + } else if (key==KEY_NUM7) {//Прыгнуть вниз + bdis.bpos = bdis.capacity - 3; + readScreen(wordWrapGlobal); + } else if (key==KEY_NUM3) { + fntTextc++; + if (fntTextc > maxnumFont) fntTextc = 1; + switchFont(); + } else if (key==KEY_NUM9) { + fntTextc--; + if (fntTextc < 1) fntTextc = maxnumFont; + switchFont(); + } else if (key==KEY_NUM0) { + Rms.osvmode++; + if(Rms.osvmode>10) Rms.osvmode=0; + repaint(); + } else if (key==KEY_STAR) { + showinf=!showinf; + } else if (key==Key.leftSoftKey) { + if (leftSoft()) { + return; + } + } else if (key==Key.rightSoftKey) { + rightSoft(); + } else if (key==Key.Back) closeStream(); + else if(key==KEY_POUND) setFSMode(!Rms.fsmode); + au.checkKeys(key); + repaint(); + } + + private boolean leftSoft() { + if (im != null) { + showimage = !showimage; + imgsh = -im.getWidth() / 2; + return true; + } + if (url.equals("")) return true; + try { + Main.midlet.platformRequest("http://" + url.toLowerCase()); + } catch (ConnectionNotFoundException ex) { + ex.printStackTrace(); + } + return false; + } + + private void rightSoft() { + if (showimage && !url.equals("")) { + try { + Main.midlet.platformRequest("http://" + url.toLowerCase()); + } catch (ConnectionNotFoundException ex) { + ex.printStackTrace(); + } + } else closeStream(); + } + + protected void pointerPressed(int pix, int piy) { + dry = piy; + int y = UI.getSoftBarHeight(); + if(pix<2*y && piy>h-y) { + if (leftSoft()) { + return; + } + }else if(pix>w-2*y && piy>h-y) { + rightSoft(); + } + } + + protected void pointerDragged(int pix, int piy) { + if(dry>piy) { + while(dry>piy) { + dry-=2; + lineDown(); + } + }else{ + while(dry1 && s.startsWith("#")) { + color = getColor(g, s.substring(1).toLowerCase()); + //i++; + continue; + }else{ + int temp = Fonts.stringWidth(fntText, cs[i]+" "); + if(!png) g.setColor(osvcolor(color)); + //else ((TMyPngFont) fntText).SetColor(osvcolor(color)); + if(center || png) { + cen+=cs[i].replace('\n',' ')+" ";// + } else { + //if(png) ((TMyPngFont) fntText).DrawText(g, x+xcar, ycar, cs[i].replace('\n',' ')); + g.drawString(cs[i].replace('\n',' '), x+xcar, ycar, 20); + x+=temp; + } + } + } + if(center) { + if(png) ((TMyPngFont) fntText).DrawText(g, w/2-Fonts.stringWidth(fntText, cen)/2, ycar, cen); + else g.drawString(cen, w/2, ycar, 17); + }else{ + if(png) ((TMyPngFont) fntText).DrawText(g, xcar, ycar, cen); + } + } + + private void drawPosition(Graphics g) { + g.setColor(fore); + int slall = h - header - footer; + int slpos = 0; + int slend = 0; + try { + slpos = header + slall * scrStart / bdis.getCapacity(); + slend = header + slall * scrEnd / bdis.getCapacity(); + if (slend > h - footer) slend = h - footer; + } catch (Exception iox) { + return; + } + g.drawLine(w - 1, slpos, w - 1, slend); + } + + private Image getImage(String path) { + Image img = Image.createImage(1, 1); + try { + img = Image.createImage(path); + } catch (IOException ex) { + try { + img = Image.createImage(getClass().getResourceAsStream(path)); + } catch (IOException ex1) { + ex1.printStackTrace(); + } + ex.printStackTrace(); + } + return img; + } + + private String[] threshold(String s, char c, boolean remove) { + Vector ml = new Vector(); + int j = s.length(); + String s2 = ""; + for(int k = 0; k < j; k++) { + int i = s.charAt(k); + if(i == c) { + if(s2.length() > 0) { + if(!remove) s2+=" "+String.valueOf(c); + ml.addElement(s2); + s2 = ""; + } + } else { + s2 = s2 + String.valueOf((char)i); + } + } + if(s2.length() > 0) { + if(!remove) s2+=" "+String.valueOf(c); + ml.addElement(s2); + } + String[] m = new String[ml.size()]; + ml.copyInto(m); + return m; + } + + private int getColor(Graphics g, String q) { + if (q.equals("yellow")) return clr(255, 255, 0); + if (q.equals("pink")) return clr(255, 192, 203); + if (q.equals("orange")) return clr(255, 165, 0); + if (q.equals("gold")) return clr(255, 215, 0); + if (q.equals("lime")) return clr(0, 255, 0); + if (q.equals("red")) return clr(255, 0, 0); + if (q.equals("green")) return clr(0, 128, 0); + if (q.equals("blue")) return clr(0, 0, 255); + if (q.equals("black")) return clr(0, 0, 0); + if (q.equals("white")) return clr(255, 255, 255); + if (q.equals("purple")) return clr(0, 0, 255); + if (q.equals("maroon")) return clr(128, 0, 0); + if (q.equals("0")) return 0; + if (q.length()==6) return Integer.parseInt(q,16); + return UI.def; + } + + private int clr(int r, int g, int b) { + int rgb = (r << 16) | (g << 8) | b; + return rgb; + } + + private int osvcolor(int def) { + int col = def; + if (Rms.osvmode==0) col=0xFFFFFF; + else if (Rms.osvmode==10) col=0; + return col; + } + + private boolean checkosvmode() { + return (Rms.osvmode==0 || Rms.osvmode==10); + } + + private void switchFont() { + switch (fntTextc) { + case 1: fntText = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_SMALL); break; + case 2: fntText = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_SMALL); break; + case 3: fntText = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_MEDIUM); break; + case 4: fntText = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_MEDIUM); break; + case 5: fntText = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_LARGE); break; + case 6: fntText = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_LARGE); break; + } + if(fntTextc>6 && fntTextc<=maxnumFont) { + try { + fntText = new TMyPngFont("/res/" + String.valueOf(fntTextc - 6)); + ((TMyPngFont)fntText).SetColor(osvcolor(UI.def)); + } catch (Exception ex) { + fntTextc=1; switchFont(); + } + } + init(); + } + +} \ No newline at end of file diff --git a/src/UI.java b/src/UI.java new file mode 100644 index 0000000..848dcf3 --- /dev/null +++ b/src/UI.java @@ -0,0 +1,136 @@ + +import java.util.Calendar; +import javax.microedition.lcdui.*; + +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +/** + * + * @author aNNiMON + */ +public class UI { + + protected static final Font smallFont = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_SMALL); + protected static final Font bigboldFont = Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_LARGE); + public static Font stFont = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_MEDIUM); + public static Font bstFont = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_MEDIUM); + public static int col1=0xD0419f62, col2=0xD077da9a; + public static int curcol1=0xDCF8D6, curcol2=0x75B68C; + public static int textcolor=0xFFFFFF, timecolor=0xFFFFFF; + public static int textnc = 0x296321, shadow = 0x282828, def = 0xFFFFFF; + public static int osv=180; + public static int otst = 2; + //int col1=0xD0419f62, col2=0xD077da9a;джунгли + private static int MFHeight = smallFont.getHeight(); + private static boolean isLight=false; + + public static void drawMenuInterface(Graphics g, String title, String leftsoft, String rightsoft) { + drawTitle(g, title); + drawTimeSoftBar(g, leftsoft, rightsoft); + } + + public static void drawTimeSoftBar(Graphics g, String left, String right) { + int w = g.getClipWidth(); int h = g.getClipHeight(); + int y = h - getSoftBarHeight() + 1; + int fontHeight = MFHeight; + int cY = (h + y + 1 - fontHeight) / 2; + showTime(g, smallFont, w/2, h); + g.setColor(textcolor); + g.setFont(smallFont); + if (left != null) { + if(Rms.landscape) { + g.drawString(left, w-2, cY, Graphics.TOP | Graphics.RIGHT); + }else g.drawString(left, 2, cY, Graphics.TOP | Graphics.LEFT); + } + if (right != null) { + if(Rms.landscape) { + g.drawString(right, w-2, 2, Graphics.TOP | Graphics.RIGHT); + }else g.drawString(right, (w-2), cY, Graphics.TOP | Graphics.RIGHT); + } + } + + public static void drawScreensaver(Graphics g) { + int w = g.getClipWidth(); + int h = g.getClipHeight(); + g.setColor(0); + showTime(g, bigboldFont, w/2, h/2); + } + + public static void drawTitle(Graphics g, String title) { + int w = g.getClipWidth(); + if (isLight) { + g.setColor(col1); + g.fillRect(0, 0, w, getSoftBarHeight() + 1); + } else { + drawRect(g, col1, col2, 0, 0, w, getSoftBarHeight() + 1); + } + if (title != null) { + g.setColor(textcolor); + g.setFont(smallFont); + if(Rms.landscape) g.drawString(title, 2, 2, 20); + else g.drawString(title, w/2, 2, Graphics.TOP | Graphics.HCENTER); + } + } + + public static void drawPointerEvents(Graphics g) { + int w = g.getClipWidth(); int h = g.getClipHeight(); + int q = getSoftBarHeight(); + g.setColor(col1); + g.fillTriangle(w-q, h-q, w-q-q, h-q-q, w, h-q-q); + g.fillTriangle(w-q, q, w-q-q, q+q, w, q+q); + } + + public static void showTime(Graphics g, Font font, int x, int y) { + Calendar calendar = Calendar.getInstance(); + int w = g.getClipWidth(); int h = g.getClipHeight(); + String s = calendar.get(11) + ""; + String s1 = calendar.get(12) + ""; + if (s.length() == 1) s = "0" + s; + if (s1.length() == 1) s1 = "0" + s1; + int r1=Effects.acolor(col2, 'r'); + int g1=Effects.acolor(col2, 'g'); + int b1=Effects.acolor(col2, 'b'); + int fh=UI.getSoftBarHeight()-2; + g.setColor(r1, g1, b1); + g.fillRect(0, (h-fh)+1, w, fh); + int k = font.stringWidth(s + ":" + s1) / 2; + g.setFont(font); + g.setColor(timecolor); + g.drawString(s + ":" + s1, x - k, y, 36); + } + + public static void drawRect(Graphics g, int color1, int color2, int x1, int y1, int w, int h) { + int r1 = ((color1 & 0xFF0000) >> 16); + int g1 = ((color1 & 0x00FF00) >> 8); + int b1 = (color1 & 0x0000FF); + int r2 = ((color2 & 0xFF0000) >> 16); + int g2 = ((color2 & 0x00FF00) >> 8); + int b2 = (color2 & 0x0000FF); + + int count = h / 3; + if (count < 0) count = -count; + if (count < 8) count = 8; + int crd1, crd2; + for (int i = count - 1; i >= 0; i--) { + crd1 = i * h / count + y1; + crd2 = (i + 1) * h / count + y1; + if (crd1 == crd2) continue; + g.setColor(i * (r2 - r1) / (count - 1) + r1, i * (g2 - g1) / (count - 1) + g1, i * (b2 - b1) / (count - 1) + b1); + g.fillRect(x1, crd1, w, crd2 - crd1); + } + } + + public static void ACLS(Graphics g, int w, int h, int color) { + int[] pixelArray = new int[w * h]; + for (int io = 0; io < pixelArray.length; io++) { + pixelArray[io] = color; + } + g.drawRGB(pixelArray, 0, w, 0, 0, w, h, true); + } + + public static int getSoftBarHeight() { + return smallFont.getHeight() + 2; + } +} diff --git a/src/Util.java b/src/Util.java new file mode 100644 index 0000000..0d19f8e --- /dev/null +++ b/src/Util.java @@ -0,0 +1,159 @@ +import java.io.*; +import java.util.Enumeration; +import java.util.Vector; +import javax.microedition.io.Connector; +import javax.microedition.io.file.*; +import javax.microedition.lcdui.Image; + +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +/** + * + * @author aNNiMON + */ +public class Util { + + private static Enumeration en; + + public static String[] getFiles(String s) { + Vector vector = new Vector(); + try { + FileConnection fc = null; + if ("/".equals(s)) { + en = FileSystemRegistry.listRoots(); + } else { + fc = (FileConnection) Connector.open("file://" + s, 1); + en = fc.list(); + } + String s1; + for (; en.hasMoreElements(); vector.addElement(s1)) { + s1 = (String) en.nextElement(); + } + if (fc != null) { + fc.close(); + } + } catch (IOException ioexception) { + } + if ("/".equals(s)) { + vector.addElement("Настройки"); + vector.addElement("О программе"); + } + String[] as; + as = new String[vector.size()]; + vector.copyInto(as); + String as1[] = new String[as.length]; + int i = 0; + for (int j = 0; j < as.length; j++) { + if (as[j].indexOf("/") != -1) { + as1[i] = as[j]; + i++; + } + } + for (int k = 0; k < as.length; k++) { + if (as[k].indexOf("/") == -1) { + as1[i] = as[k]; + i++; + } + } + return as1; + } + + public static String[] getDataAList(String path) { + return getFiles(path); + } + + public static String getText(InputStream is) { + StringBuffer strBuff = new StringBuffer(); + int ch = 0; + try { + while ((ch = is.read()) != -1) { + strBuff.append(StringEncoder.decodeCharCP1251((byte)ch));//(char) ((ch >= 0xc0 && ch <= 0xFF) ? (ch + 0x350) : ch)); + } + } catch (Exception e) {e.printStackTrace();} + return strBuff.toString(); + } + + public static Image getImage(String s, String s1) { + Image image = Image.createImage(1, 1); + String fileName = s+s1; + if(!fileName.startsWith("file://")) fileName="file://"+fileName; + FileConnection fc; + try { + fc = (FileConnection) Connector.open(fileName, Connector.READ); + InputStream fis = fc.openInputStream(); + image = Image.createImage(fis); + fis.close(); + fc.close(); + } catch (Exception e) { + } + return image; + } + + public static String[] threshold(String s, String s1, boolean data) + { + Vector ml = new Vector(); + char c = s1.charAt(0); + int j = s.length(); + String s2 = ""; + for(int k = 0; k < j; k++) + { + int i = s.charAt(k); + if(i == c) + { + if(s2.length() > 0) + { + if(data) ml.addElement(s2.substring(0, s2.lastIndexOf('-')).replace('^', '-').trim()); + else ml.addElement(s2.substring(s2.lastIndexOf('-')+1).replace('^', '-').trim()); + s2 = ""; + } + } else + { + s2 = s2 + String.valueOf((char)i); + } + } + if(s2.length() > 0) { + if(data) ml.addElement(s2.substring(0, s2.lastIndexOf('-')).replace('^', '-').trim()); + else ml.addElement(s2.substring(s2.lastIndexOf('-')+1).replace('^', '-').trim()); + } + String[] m; + m = new String[ml.size()]; + ml.copyInto(m); + return m; + } + + public static void getUI(String path) { + try { + String[] k = null; + InputStream is = Main.midlet.getClass().getResourceAsStream(path); + k = threshold(getText(is), "\n", false); + UI.col1 = color(k[0]); + UI.col2 = color(k[1]); + UI.curcol1 = color(k[2]); + UI.curcol2 = color(k[3]); + UI.osv = Integer.parseInt(k[4].trim().replace('^', '-')); + UI.textcolor = color(k[5]); + UI.timecolor = color(k[6]); + UI.textnc = color(k[7]); + UI.shadow = color(k[8]); + UI.def = color(k[9]); + UI.otst = Integer.parseInt(k[10].trim()); + is.close(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + + private static int color(String str) { + int i = 0; + try { + i=Integer.parseInt(str.trim(), 16); + }catch(Exception ex) { + i=Integer.parseInt(str.trim()); + } + return i; + } + +} diff --git a/src/Viewer.java b/src/Viewer.java new file mode 100644 index 0000000..39e0213 --- /dev/null +++ b/src/Viewer.java @@ -0,0 +1,82 @@ +import javax.microedition.lcdui.*; + +/** + * @author aNNiMON + */ +public class Viewer extends Canvas { + + private int w,h,x,y; + private Image img, timg; + private Displayable qb = null; + private int imageWidth,imageHeight,stx,sty; + private AccelUtil au; + + public Viewer(Image img, Displayable q, AccelUtil au) { + setFullScreenMode(true); + this.au = au; + w = getWidth(); + h = getHeight(); + qb=q; + this.img=timg=img; + init(); + stx = 10; + sty = 10; + } + + private void init() { + imageWidth = img.getWidth(); + imageHeight = img.getHeight(); + x=w/2; + y=h/2; + } + + public void paint(Graphics g) { + setFullScreenMode(true); + UI.drawRect(g, UI.col1, UI.col2, 0, 0, w, h); + if(!au.isInPosition()) { + UI.drawScreensaver(g); + repaint(); + return; + } + g.drawImage(img, x, y, Graphics.HCENTER | Graphics.VCENTER); + repaint(); + } + + protected void sizeChanged(int w, int h) { + w = getWidth(); + h = getHeight(); + init(); + super.sizeChanged(w, h); + } + + public void keyPressed(int key) { + int ga=getGameAction(key); + if (ga == UP && y(h-imageHeight/2)) {y=y-sty>(h-imageHeight/2) ? y-sty : y + (h-imageHeight/2-y);} + else if (ga == LEFT && x(w-imageWidth/2)) {x=x-stx>(w-imageWidth/2) ? x-stx : x + (w-imageWidth/2-x);} + else if (ga == FIRE || key==Key.rightSoftKey || key==Key.leftSoftKey) { + Main.midlet.dsp.setCurrent(qb); + }else if(key==KEY_STAR) { + if((imageHeight<=h) && (imageWidth<=w)) { + if (timg.getHeight()!=imageHeight) img = timg; + else return; + }else{ + if(imageHeight>imageWidth) img = Effects.Resize(img, imageWidth*h/imageHeight, h); + else img = Effects.Resize(img, w, imageHeight*w/imageWidth); + } + init(); + } + au.checkKeys(key); + repaint(); + } + + protected void pointerPressed(int pix, int piy) { + if(qb!=null) Main.midlet.dsp.setCurrent(qb); + } + + public void keyRepeated(int key) { + keyPressed(key); + } + +} \ No newline at end of file diff --git a/src/aNMPWR.java b/src/aNMPWR.java new file mode 100644 index 0000000..35b0a5a --- /dev/null +++ b/src/aNMPWR.java @@ -0,0 +1,307 @@ +import javax.microedition.lcdui.*; + + +public class aNMPWR extends Canvas implements Runnable { + + public String pathFile, aaall; + private int FileY, CursorY, startPrintFile; + private int cu, h, w, sh, fh; + private Font MainFont = Font.getFont(Font.STYLE_PLAIN, Font.STYLE_PLAIN, Font.SIZE_SMALL); + private Font BordFont = Font.getFont(Font.STYLE_PLAIN, Font.STYLE_BOLD, Font.SIZE_SMALL); + private String[][] data = new String[10][50]; + private int[] index = new int[10]; + private int idx=0, len=0; + private int bb=0; + private long ty; + private boolean prkr=false, moveleft=true; + private int chm;//плавный курсор + private Thread thr; + private AccelUtil au; + private String[] TypeImg = { + "gif","jpeg","jpg","bmp","png" + }; + + public aNMPWR() { + this("/"); + } + + public aNMPWR(String s) { + setFullScreenMode(true); + FileY = 0; CursorY = 0; startPrintFile = 0; cu = 0; + pathFile = s; + thr = new Thread(this); + initScreenModes(); + fh = MainFont.getHeight() + 2; + sh = BordFont.getHeight() + 3; + chm = 0; + au = new AccelUtil(); + thr.start(); + restart(); + } + + public void run() { + while(true) { + if(prkr) { + if(moveleft) { + if (bb > -(len-w)) { + bb -= 2; + } else {moveleft=!moveleft;} + }else{ + if (bb < 0) { + bb += 2; + //if(Rms.run>=InputStreamDecoder.bb) Main.midlet.destroyApp(true); + } else {moveleft=!moveleft;} + } + try { + Thread.sleep(100L); + } catch (Exception ex) {} + repaint(); + } + } + } + + private void initScreenModes() { + if(Rms.landscape) { + w = getHeight(); + h = getWidth(); + Landscape.init(w, h); + }else{ + w = getWidth(); + h = getHeight(); + } + } + + public void paint(Graphics g) { + setFullScreenMode(true); + if(Rms.landscape) { + Landscape.drawImage(); + portrait(Landscape.G); + Landscape.draw(g); + }else{ + UI.drawRect(g, UI.col1, UI.col2, 0, 0, w, h); + portrait(g); + } + } + + public void portrait(Graphics g) { + if(!au.isInPosition() && (!pathFile.equals("/"))) { + UI.drawScreensaver(g); + return; + } + mainDisp(g); + if(pathFile.equals("/")) UI.drawMenuInterface(g, Main.name, "Выбор","Назад"); + else UI.drawMenuInterface(g, data[idx-1][index[idx-1]], "Выбор","Назад"); + if(hasPointerEvents()) UI.drawPointerEvents(g); + if(chm<0) {chm+=fh/5;repaint();} + if(chm>0) {chm-=fh/5;repaint();} + } + + private void mainDisp(Graphics g) { + g.setFont(MainFont); + g.translate(0, sh); + FileY = 0; + for (int i = startPrintFile; i < data[idx].length; i++) { + if (FileY == CursorY) { + FileY+=chm; + drawCursor(g); + g.setColor(UI.shadow); + g.setFont(BordFont); + len = BordFont.stringWidth(data[idx][i]); + if(len0) { + pathFile = pathFile.substring(0, i + 1); + } else { + pathFile = "/"; + CursorY = 0; + cu = 0; + startPrintFile = 0; + return; + } + idx--; + CursorY = index[idx]*fh; + cu = index[idx]; + startPrintFile = 0; + } + + private void nextDir(int s) { + if(data[idx][s].toLowerCase().endsWith("/")) { + pathFile += data[idx][s]; + index[idx]=s; + idx++; + restart(); + cu = 0; + startPrintFile = 0; + CursorY = 0; + }else if(getType(TypeImg, data[idx][s])) { + Image image1 = null; + image1 = Util.getImage(pathFile, data[idx][s]); + Main.midlet.dsp.setCurrent(new Viewer(image1, this, au)); + }else { + if(data[idx][s].equals("Настройки")) { + Main.midlet.dsp.setCurrent(new Options(this)); + }else{ + TextView tv = new TextView(au); + if(data[idx][s].equals("О программе")) tv.openFile("/res/about", this, data[idx][s]); + else tv.openFile(pathFile+data[idx][s], this, data[idx][s]); + //Viewer tv = new Viewer(Util.getText(JM.midlet.getClass().getResourceAsStream(back[idx][s])), this); + Main.midlet.dsp.setCurrent(tv); + } + } + } + + public void keyPressed(int key) { + bb=0;moveleft=true; + int ga = getGameAction(key); + ga = Landscape.reverseActionKey(ga); + if (key == Key.leftSoftKey) nextDir(cu); + if (key == Key.rightSoftKey || key==Key.Back || key==KEY_NUM0) backDir(); + if(key==KEY_STAR) {Rms.landscape=!Rms.landscape; initScreenModes();} + switch (ga) { + case RIGHT: + case DOWN: + cursorDown(); + break; + case LEFT: + case UP: + cursorUp(); + break; + case FIRE: + nextDir(cu); + break; + } + au.checkKeys(key); + repaint(); + } + + protected void pointerPressed(int pix, int piy) { + int q = UI.getSoftBarHeight(); + if(pix<2*q && piy>h-q) { + nextDir(cu); + }else if((piyh-q-q) && (pix>w-2*q)) { + cursorDown(); + }else if((piy>q && piyw-2*q)) { + cursorUp(); + }else if(pix>w-2*q && piy>h-q) { + backDir(); + }else{ + int cu1=cu; + piy-=q; + if(piy>0 && piy 0) { + if (cu == data[idx].length - 1) { + CursorY = 0; + cu = 0; + startPrintFile = 0; + } else if (cu > (h - 2 * sh) / fh - 3) { + if (CursorY >= h - 2 * sh - 2 * fh) { + startPrintFile++; + cu++; + } else { + cu++; + CursorY += fh; + } + } else { + CursorY += fh; + cu++; + } + chm=-fh; + } + } + + private void cursorUp() { + if (data[idx].length > 0) { + if (cu == 0) { + cu = data[idx].length - 1; + if (data[idx].length > (h - 2 * sh) / fh) { + startPrintFile = (data[idx].length - (h - 2 * sh) / fh) + 1; + CursorY = (data[idx].length - 1 - startPrintFile) * fh; + } else { + CursorY = (data[idx].length - 1) * fh; + } + } else if ((CursorY == 0) & (cu > 0)) { + startPrintFile--; + cu--; + } else if (CursorY > 0) { + CursorY -= fh; + cu--; + } + chm=fh; + } + } + + private boolean getType(String[] t, String data) { + for (int i = 0; i < t.length; i++) { + if (data.toLowerCase().endsWith("." + t[i])) { + return true; + } + } + return false; + } +} diff --git a/src/res/1 b/src/res/1 new file mode 100644 index 0000000000000000000000000000000000000000..8b22d964e4e088cd0a7d0dee2a64dab43b98f201 GIT binary patch literal 2307 zcmV+e3HTvjwa6^nooV1Nb;d zA$P%`mV;8(+LyHEY{{@rT9zAkQ`S{O?D`xa1i|l1Rnq!4jHtAFIaLO>W~)#vIfyDG z<~w%z)3Cevj!yvSiWuN#=_~-(^Wo2`+yvme{=(yM!3Vxew4Z`SU3w&zn^j@O1sVY~ zSXNYcpUAB)F*-^eyEG%$g1R+W^_ai0dn#Ai!zJb+EALwAm_DeV(GQy`Q_tsbq#39g z7zPO-0|5!PdUmjFgP+t0H2qL)lp7_)Eke}~%u*W&Mq9w?f-qo)rf`AHcJ4q$mDHdL zf!A(l;D~2f(mAV)M0k6KYEz|r{4hWtSwI3tKYJjR*8(bVqdrTu4I~3p*2^8G1yw@B z&%AZ2xRYtDq4UwMHJ8M?fF2e>=!?*pJl=2|OsBk)n)=~|l%=1Er_++#+5Bm?_IT9# zi#j;jy}!ZUWZxOB@7ZYhrw$_wBKD+^+7ogM_ zGeT1XC%Ru{+>}li*%%4rO_F9vgtQd?BI#fo%u9V9mvbBjRKf4hk&dK6nYV>XKx%=^G%X@guO%ch`I;(=VK7L%^`b;TW3mRWq-AK9NI<1|Itv`pnDm{_ z;PX#3H-CcOx2($H!;qJ5t$O^wDGScv4TAiRe^<2}WaKZa>xY zd^udp{XpUj;{hF@gj(8kC?iWO!Xn$DMeK`@pQAw`uqi04SDEdi=D8lQj0C43a4nP) zZ)IhB%bsih#>TJi-n{wg@2=NXH42Z5MG+mHyFUFE6OoQ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aOmf7goUZ|)D zO;eMT2}MTpnPsf_Ht6AHMX_&<4A1;LxSXkzL8)XS`wsNJb? z@#KqL8cX~m0z+AYNGNMw{b^92c3v&HWO{yAxr47>QIwOTy|H`uz8owq$GqZM;Rp1_ zquk9ZN_8KD1@bvHpJMY=7;gV)wHwyV+uhL8{$|R=eSD(74xZ+$J|)zcZ*$C+OV*W0 z|E*+3ngz6*DMN&JtOPpig6bJ9qSl=;pmcWq%U77%IJXH&Ns74Y4SQTlpMD*%5#}h` zqn4E>k_xs?*+O}9T|Nw)BP>cY*Yl3%#!8uCUlc~;>59zb>padf7eK0nS*H8+ChNoB z;GhiNw_WHy+Bsw5V=%&qiGzN+USXX;nB$5=SUF+N8XqAH=$p=BB=``L@gVSlPgLXF zdz1SNr@XP1N#dDOo8^Afrn-z5YNmDZ6^lu};(=$UB)26Qi97+ebLx^z*%|>!8B$L& z!Y@@e4X-GSY0{3>PxSbF+$V^Fg8PsTGewz9#$lq>MmT=!$1|1ShIpTmtZLyvk>XLz z>2-cB%ug#XC^qfEJzP1lljn|@BSSkRhRm7Z;8c;vtClo{7Q*|*Giw%iu435c=zl_f O9x%?0fN63K$@~v2^sj#a literal 0 HcmV?d00001 diff --git a/src/res/about b/src/res/about new file mode 100644 index 0000000..c83afaf --- /dev/null +++ b/src/res/about @@ -0,0 +1,21 @@ +AcceLockView + +: aNNiMON + : 007 + + . , , . - . : , ( C), . - , , . + + 1.1: + - . + - . + - . + - , + +: + - + C - + * - + 0, , . - + +aNNiMON (Melnik Software) 2011 +http://annimon.com/ . diff --git a/src/res/icon.png b/src/res/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..eed31be24fb1795019224f3ee7769c2148d6e8a9 GIT binary patch literal 671 zcmV;Q0$}}#P)ZT3e&tI1|I@sdUKZ}2Yu z4}vJ$izkob*^44xytQ_-JM)~`I@xs-Q>re!!@S-1+4tl7Mi4^J(~+39D$ADezn+{d z!Ga`0zjtjxfCIsNJjDD12x!8u9HGN00dR2ayiYTbLMA^dV6kizVfqF|+lWNTcK zY#rejS`(mJ>$qXy+M|xEApp&U!5JSHgOU!@z;fZ$R~E#A!$99>4glt9-%>|TeV9lr zfYNXY^TlP!P8>b`k@Zyn72E?vc)Ks~ChgrZ`r+l-wjW$I+)qh5=~3z{7VSMC3V`WJ zcJ_#7;5T}cTqJuq=)=`VVX_aBh|Y1 zzBfBWW;k$azT@)X>^1PUs2Blol7gl$0aP}f?|co_hU=}iVXPn6-{Cv!0YHy#3gX*B zfDe%wU5amA5Tzed8rTW%YFHLs?bY2cia~|VvO)xFCWV@q&{ZTG4N~d?HN*SNL5k6F zAGAn33_9?As5NlM*H_KK(Tnx3fT{@zn)Y*6`oG-PKLKnt@5{Td=WhT2002ovPDHLk FV1n-sLSz5{ literal 0 HcmV?d00001 diff --git a/src/res/logo1.mdat b/src/res/logo1.mdat new file mode 100644 index 0000000000000000000000000000000000000000..29378e51a52226bcc088d8f8cb21042c0b05e54a GIT binary patch literal 3421 zcmV-j4WjY@0002VKl)%$&Gb0||2*&hL@(v-8J%xQ&*8IwW=E{wY4M)8!@W;jG`fG5 z*i`V+hZC0wEGIvg5xS#`8A@{cnQqBh6aB+}clNoLb2)AQN>vyllQVZwl zeH~rF#8*iND>y*r*k%9#4A4nLK~#9!?OTbK;~)+kBd`q?CY=BOsawK!-$|U=PUh`< z>$$rpAcRy^68O)b|3Cl5bJ?DC{YUe!y8+=}S+FiER^Ok0Gygg-VOc^5u;ZUZz&g9x zIytabEAK_3wSv!)o?mGHU{oSns--p6D-l8}9@tniI4RtMZsGBI<+&D|iWp zObCfF8Lsu|SdfD@VgOV~Gqp%eG&o?I#0mIvem)5F2m}f_@0(1g7zUV8tQw3ePoJNw z#2j*v{T}p+ha_2mc}56e2@BK==kdF$_V2Yy=0VaUl8tyGo@b7I+hV@~S;g z2{gZ@JCe|UT&SX+oDzv3q-VJxlp>(tA5-b$I%}0vg&J;0N-bh)-3f z9tGV4&vF6kF_U%=jP!XD#byUc4}^G*0jhdB<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000C400;m9HUR=8 z2nj_100960|3y?xP(=U$0Qr&N^Z)<=0|{d literal 0 HcmV?d00001 diff --git a/src/res/skin.ini b/src/res/skin.ini new file mode 100644 index 0000000..27a64e5 --- /dev/null +++ b/src/res/skin.ini @@ -0,0 +1,11 @@ +1 - 303030 +2 - 606060 +3 - A9A8E2 +4 - 0602C0 +5 - ^140 +6 - D46905 +7 - A5A575 +8 - FFFFE7 +9 - ffffff +0 - ffffff +1 - 4 \ No newline at end of file