Commit 83954a04 authored by Daniel Dreibrodt's avatar Daniel Dreibrodt

README.TXT - version number fix

src/vlcskineditor/Main.java - Skin can be tested in VLC (Somehow the xml code generation is not quite working as it should it seems)
src/vlcskineditor/Skin.java - alpha/movealpha value parsing corrected
src/vlcskineditor/Items/Panel.java - id attribute is not in dtd, made a workaround (e.g. <!-- id="id" --> is added to the xml code)
src/vlcskineditor/Items/Image.java - image attribute code generation fixed
parent ad879d4d
VLC Skin Editor release 0.3.0a
VLC Skin Editor release 0.3.0b
-----------------------------------------------------------
Changelog:
-----------------------------------------------------------
......
/*
** Java native interface to the Windows Registry API.
**
** Authored by Timothy Gerard Endres
** <mailto:time@gjt.org> <http://www.trustice.com>
**
** This work has been placed into the public domain.
** You may use this work in any way and for any purpose you wish.
**
** THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
** NOT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY. THE AUTHOR
** OF THIS SOFTWARE, ASSUMES _NO_ RESPONSIBILITY FOR ANY
** CONSEQUENCE RESULTING FROM THE USE, MODIFICATION, OR
** REDISTRIBUTION OF THIS SOFTWARE.
**
*/
package com.ice.jni.registry;
import java.lang.*;
import java.text.*;
import java.util.*;
/**
* The HexNumberFormat class implements the code necessary
* to format and parse Hexidecimal integer numbers.
*
* @version 3.1.3
*
* @author Timothy Gerard Endres, <a href="mailto:time@ice.com">time@ice.com</a>.
* @see java.text.NumberFormat
*/
public
class HexNumberFormat
extends Format
{
static public final String RCS_ID = "$Id: HexNumberFormat.java,v 1.1 2000/05/20 17:10:15 time Exp $";
static public final String RCS_REV = "$Revision: 1.1 $";
private static char[] lowChars;
private static char[] uprChars;
private int count;
private String pattern;
private static char[] hexChars;
static
{
HexNumberFormat.lowChars = new char[20];
HexNumberFormat.uprChars = new char[20];
HexNumberFormat.uprChars[0] = HexNumberFormat.lowChars[0] = '0';
HexNumberFormat.uprChars[1] = HexNumberFormat.lowChars[1] = '1';
HexNumberFormat.uprChars[2] = HexNumberFormat.lowChars[2] = '2';
HexNumberFormat.uprChars[3] = HexNumberFormat.lowChars[3] = '3';
HexNumberFormat.uprChars[4] = HexNumberFormat.lowChars[4] = '4';
HexNumberFormat.uprChars[5] = HexNumberFormat.lowChars[5] = '5';
HexNumberFormat.uprChars[6] = HexNumberFormat.lowChars[6] = '6';
HexNumberFormat.uprChars[7] = HexNumberFormat.lowChars[7] = '7';
HexNumberFormat.uprChars[8] = HexNumberFormat.lowChars[8] = '8';
HexNumberFormat.uprChars[9] = HexNumberFormat.lowChars[9] = '9';
HexNumberFormat.uprChars[10] = 'A'; HexNumberFormat.lowChars[10] = 'a';
HexNumberFormat.uprChars[11] = 'B'; HexNumberFormat.lowChars[11] = 'b';
HexNumberFormat.uprChars[12] = 'C'; HexNumberFormat.lowChars[12] = 'c';
HexNumberFormat.uprChars[13] = 'D'; HexNumberFormat.lowChars[13] = 'd';
HexNumberFormat.uprChars[14] = 'E'; HexNumberFormat.lowChars[14] = 'e';
HexNumberFormat.uprChars[15] = 'F'; HexNumberFormat.lowChars[15] = 'f';
}
static public final HexNumberFormat
getInstance()
{
return new HexNumberFormat( "XXXXXXXX" );
}
public
HexNumberFormat( String pattern )
{
super();
this.pattern = pattern;
this.count = pattern.length();
this.hexChars =
( pattern.charAt(0) == 'X'
? HexNumberFormat.uprChars
: HexNumberFormat.lowChars );
}
public String
format( int hexNum )
throws IllegalArgumentException
{
FieldPosition pos = new FieldPosition(0);
StringBuffer hexBuf = new StringBuffer(8);
this.format( new Integer( hexNum ), hexBuf, pos );
return hexBuf.toString();
}
public StringBuffer
format( Object hexInt, StringBuffer appendTo, FieldPosition fieldPos )
throws IllegalArgumentException
{
char[] hexBuf = new char[16];
int end = fieldPos.getEndIndex();
int beg = fieldPos.getBeginIndex();
int hexNum = ((Integer) hexInt).intValue();
for ( int i = 7 ; i >= 0 ; --i )
{
hexBuf[i] = this.hexChars[ (hexNum & 0x0F) ];
hexNum = hexNum >> 4;
}
for ( int i = (8 - this.count) ; i < 8 ; ++i )
{
appendTo.append( hexBuf[i] );
}
return appendTo;
}
public int
parse( String source )
throws ParseException
{
throw new ParseException( "unimplemented!", 0 );
}
public Object
parseObject( String source, ParsePosition pos )
{
return null;
}
}
Manifest-Version: 1.0
Created-By: "Tim Endres <time@gjt.org>"
Main-Class: com.ice.jni.registry.Registry
Class-Path:
Name: com/ice/jni/registry/Registry/
Specification-Title: "JNI Registry - Windows Registry Package"
Specification-Version: "3.1.3"
Specification-Vendor: "ICE Engineering, Inc.".
Implementation-Title: "com.ice.jni.registry.Registry"
Implementation-Version: "3.1.3"
Implementation-Vendor: "ICE Engineering, Inc."
/*
** Java native interface to the Windows Registry API.
**
** Authored by Timothy Gerard Endres
** <mailto:time@gjt.org> <http://www.trustice.com>
**
** This work has been placed into the public domain.
** You may use this work in any way and for any purpose you wish.
**
** THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
** NOT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY. THE AUTHOR
** OF THIS SOFTWARE, ASSUMES _NO_ RESPONSIBILITY FOR ANY
** CONSEQUENCE RESULTING FROM THE USE, MODIFICATION, OR
** REDISTRIBUTION OF THIS SOFTWARE.
**
*/
package com.ice.jni.registry;
/**
* This exception is used to indicate that no such key exists in the registry.
*
* @version 3.1.3
*
* @author Timothy Gerard Endres,
* <a href="mailto:time@ice.com">time@ice.com</a>.
*/
public class
NoSuchKeyException extends RegistryException
{
static public final String RCS_ID = "$Id: NoSuchKeyException.java,v 1.1.1.1 1998/02/22 00:37:22 time Exp $";
static public final String RCS_REV = "$Revision: 1.1.1.1 $";
static public final String RCS_NAME = "$Name: $";
public
NoSuchKeyException()
{
super();
}
public
NoSuchKeyException( String msg )
{
super( msg, Registry.ERROR_FILE_NOT_FOUND );
}
public
NoSuchKeyException( String msg, int regErr )
{
super( msg, regErr );
}
}
/*
** Java native interface to the Windows Registry API.
**
** Authored by Timothy Gerard Endres
** <mailto:time@gjt.org> <http://www.trustice.com>
**
** This work has been placed into the public domain.
** You may use this work in any way and for any purpose you wish.
**
** THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
** NOT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY. THE AUTHOR
** OF THIS SOFTWARE, ASSUMES _NO_ RESPONSIBILITY FOR ANY
** CONSEQUENCE RESULTING FROM THE USE, MODIFICATION, OR
** REDISTRIBUTION OF THIS SOFTWARE.
**
*/
package com.ice.jni.registry;
/**
* This exception is used to indicate that no such key exists in the registry.
*
* @version 3.1.3
*
* @version $Revision: 1.1.1.1 $
* @author Timothy Gerard Endres,
* <a href="mailto:time@ice.com">time@ice.com</a>.
*/
public class
NoSuchValueException extends RegistryException
{
static public final String RCS_ID = "$Id: NoSuchValueException.java,v 1.1.1.1 1998/02/22 00:37:22 time Exp $";
static public final String RCS_REV = "$Revision: 1.1.1.1 $";
static public final String RCS_NAME = "$Name: $";
public
NoSuchValueException()
{
super();
}
public
NoSuchValueException( String msg )
{
super( msg, Registry.ERROR_FILE_NOT_FOUND );
}
public
NoSuchValueException( String msg, int regErr )
{
super( msg, regErr );
}
}
/*
** Java native interface to the Windows Registry API.
**
** Authored by Timothy Gerard Endres
** <mailto:time@gjt.org> <http://www.trustice.com>
**
** This work has been placed into the public domain.
** You may use this work in any way and for any purpose you wish.
**
** THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
** NOT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY. THE AUTHOR
** OF THIS SOFTWARE, ASSUMES _NO_ RESPONSIBILITY FOR ANY
** CONSEQUENCE RESULTING FROM THE USE, MODIFICATION, OR
** REDISTRIBUTION OF THIS SOFTWARE.
**
*/
package com.ice.jni.registry;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
/**
* The RegBinaryValue class represents a binary value in the
* registry (REG_BINARY).
*
* @version 3.1.3
*
* @see com.ice.jni.registry.Registry
* @see com.ice.jni.registry.RegistryKey
*/
public class
RegBinaryValue extends RegistryValue
{
byte[] data;
int dataLen;
public
RegBinaryValue( RegistryKey key, String name )
{
super( key, name, RegistryValue.REG_BINARY );
this.data = null;
this.dataLen = 0;
}
public
RegBinaryValue( RegistryKey key, String name, int type )
{
super( key, name, type );
this.data = null;
this.dataLen = 0;
}
public
RegBinaryValue( RegistryKey key, String name, byte[] data )
{
super( key, name, RegistryValue.REG_BINARY );
this.setData( data );
}
public byte[]
getData()
{
return this.data;
}
public int
getLength()
{
return this.dataLen;
}
public void
setData( byte[] data )
{
this.data = data;
this.dataLen = data.length;
}
public byte[]
getByteData()
{
return this.data;
}
public int
getByteLength()
{
return this.dataLen;
}
public void
setByteData( byte[] data )
{
this.data = data;
this.dataLen = data.length;
}
public void
export( PrintWriter out )
{
out.println( "\"" + this.getName() + "\"=hex:\\" );
RegistryValue.exportHexData( out, this.data );
}
}
/*
** Java native interface to the Windows Registry API.
**
** Authored by Timothy Gerard Endres
** <mailto:time@gjt.org> <http://www.trustice.com>
**
** This work has been placed into the public domain.
** You may use this work in any way and for any purpose you wish.
**
** THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
** NOT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY. THE AUTHOR
** OF THIS SOFTWARE, ASSUMES _NO_ RESPONSIBILITY FOR ANY
** CONSEQUENCE RESULTING FROM THE USE, MODIFICATION, OR
** REDISTRIBUTION OF THIS SOFTWARE.
**
*/
package com.ice.jni.registry;
import java.io.PrintWriter;
/**
* The RegDWordValue class represents a double word, or
* integer, value in the registry (REG_DWORD).
*
* @see com.ice.jni.registry.Registry
* @see com.ice.jni.registry.RegistryKey
*
* @version 3.1.3
*
*/
public class
RegDWordValue extends RegistryValue
{
int data;
int dataLen;
public
RegDWordValue( RegistryKey key, String name )
{
super( key, name, RegistryValue.REG_DWORD );
this.data = 0;
this.dataLen = 0;
}
public
RegDWordValue( RegistryKey key, String name, int type )
{
super( key, name, type );
this.data = 0;
this.dataLen = 0;
}
public
RegDWordValue( RegistryKey key, String name, int type, int data )
{
super( key, name, RegistryValue.REG_DWORD );
this.setData( data );
}
public int
getData()
{
return this.data;
}
public int
getLength()
{
return this.dataLen;
}
public void
setData( int data )
{
this.data = data;
this.dataLen = 1;
}
public byte[]
getByteData()
{
byte[] result = new byte[4];
result[0] = (byte) ( (this.data >> 24) & 255 );
result[1] = (byte) ( (this.data >> 16) & 255 );
result[2] = (byte) ( (this.data >> 8) & 255 );
result[3] = (byte) ( this.data & 255 );
return result;
}
public int
getByteLength()
{
return 4;
}
public void
setByteData( byte[] data )
{
int newValue =
( (((int) data[0]) << 24) & 0xFF000000 )
| ( (((int) data[1]) << 16) & 0x00FF0000 )
| ( (((int) data[2]) << 8) & 0x0000FF00 )
| ( ((int) data[3]) & 0x000000FF );
this.setData( newValue );
}
public void
export( PrintWriter out )
{
out.print( "\"" + this.getName() + "\"=" );
HexNumberFormat nFmt =
new HexNumberFormat( "xxxxxxxx" );
out.println( "dword:" + nFmt.format( this.getData() ) );
}
}
/*
** Java native interface to the Windows Registry API.
**
** Authored by Timothy Gerard Endres
** <mailto:time@gjt.org> <http://www.trustice.com>
**
** This work has been placed into the public domain.
** You may use this work in any way and for any purpose you wish.
**
** THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
** NOT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY. THE AUTHOR
** OF THIS SOFTWARE, ASSUMES _NO_ RESPONSIBILITY FOR ANY
** CONSEQUENCE RESULTING FROM THE USE, MODIFICATION, OR
** REDISTRIBUTION OF THIS SOFTWARE.
**
*/
package com.ice.jni.registry;
import java.io.PrintWriter;
/**
* The RegMultiStringValue class represents a multiple
* string, or string array, value in the registry
* (REG_MULTI_SZ).
*
* @version 3.1.3
*
* @see com.ice.jni.registry.Registry
* @see com.ice.jni.registry.RegistryKey
*/
public class
RegMultiStringValue extends RegistryValue
{
String[] data;
int dataLen;
public
RegMultiStringValue( RegistryKey key, String name )
{
super( key, name, RegistryValue.REG_MULTI_SZ );
this.data = null;
this.dataLen = 0;
}
public
RegMultiStringValue( RegistryKey key, String name, int type )
{
super( key, name, type );
this.data = null;
this.dataLen = 0;
}
public
RegMultiStringValue( RegistryKey key, String name, String[] data )
{
super( key, name, RegistryValue.REG_MULTI_SZ );
this.setData( data );
}
public String[]
getData()
{
return this.data;
}
public int
getLength()
{
return this.dataLen;
}
public void
setData( String[] data )
{
this.data = data;
this.dataLen = data.length;
}
public byte[]
getByteData()
{
int len = this.getByteLength();
int ri = 0;
byte[] result = new byte[len];
for ( int i = 0 ; i < this.dataLen ; ++i )
{
byte[] strBytes = this.data[i].getBytes();
for ( int j = 0 ; j < strBytes.length ; ++j )
result[ri++] = strBytes[j];
result[ri++] = 0;
}
return result;
}
public int
getByteLength()
{
int len = 0;
for ( int i = 0 ; i < this.dataLen ; ++i )
len += this.data[i].length() + 1;
return len;
}
public void
setByteData( byte[] data )
{
int start;
int count = 0;
for ( int i = 0 ; i < data.length ; ++i )
{
if ( data[i] == 0 )
count++;
}
int si = 0;
String[] newData = new String[ count ];
for ( int i = start = 0 ; i < data.length ; ++i )
{
if ( data[i] == 0 )
{
newData[si] = new String( data, start, (i - start) );
start = si;
}
}
this.setData( newData );
}
public void
export( PrintWriter out )
{
byte[] hexData;
int dataLen = 0;
out.println( "\"" + this.getName() + "\"=hex(7):\\" );
for ( int i = 0 ; i < this.data.length ; ++i )
{
dataLen += this.data[i].length() + 1;
}
++dataLen;
int idx = 0;
hexData = new byte[ dataLen ];
for ( int i = 0 ; i < this.data.length ; ++i )
{
int strLen = this.data[i].length();
byte[] strBytes = this.data[i].getBytes();
System.arraycopy
( strBytes, 0, hexData, idx, strLen );
idx += strLen;