Split HexEditor into own plugin

This commit is contained in:
peterdell 2020-09-06 21:48:05 +02:00
parent 9fedce0075
commit 9c779bad6f
68 changed files with 982 additions and 1285 deletions

View File

@ -21,6 +21,7 @@ Require-Bundle: org.eclipse.core.runtime;visibility:=reexport,
com.wudsn.ide.base;visibility:=reexport,
com.wudsn.ide.dsk,
com.wudsn.ide.gfx,
com.wudsn.ide.hex,
org.eclipse.debug.core;visibility:=reexport,
org.eclipse.debug.ui;visibility:=reexport,
org.eclipse.ui.workbench

View File

@ -37,6 +37,8 @@
<stringAttribute key="product" value="org.eclipse.platform.ide"/>
<setAttribute key="selected_features">
<setEntry value="com.wudsn.ide.feature:default"/>
<setEntry value="org.eclipse.egit.gitflow.feature:default"/>
<setEntry value="org.eclipse.egit:default"/>
<setEntry value="org.eclipse.equinox.p2.user.ui:default"/>
<setEntry value="org.eclipse.help:default"/>
<setEntry value="org.eclipse.platform:default"/>

View File

@ -45,8 +45,8 @@ import com.wudsn.ide.asm.compiler.parser.CompilerSourceParserTreeObjectType;
import com.wudsn.ide.asm.compiler.syntax.CompilerSyntax;
import com.wudsn.ide.base.common.NumberUtility;
import com.wudsn.ide.base.common.TextUtility;
import com.wudsn.ide.base.editor.hex.HexEditor;
import com.wudsn.ide.gfx.editor.GraphicsConversionEditor;
import com.wudsn.ide.hex.HexEditor;
/**
* Hyperlink detector implementation for opening source or binary include files.

View File

@ -318,4 +318,11 @@ POSSIBILITY OF SUCH DAMAGES.
version="0.0.0"
unpack="false"/>
<plugin
id="com.wudsn.ide.hex"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View File

@ -12,16 +12,14 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.filesystem,
org.eclipse.jface.text,
org.eclipse.ui,
org.eclipse.ui.ide,
org.eclipse.ui.views,
org.eclipse.ui.workbench.texteditor,
org.eclipse.compare
org.eclipse.ui.ide
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Export-Package: com.wudsn.ide.base,
com.wudsn.ide.base.common,
com.wudsn.ide.base.editor,
com.wudsn.ide.base.editor.hex,
com.wudsn.ide.base.gui
com.wudsn.ide.base.gui,
com.wudsn.ide.base.hardware
Import-Package: org.eclipse.ui.internal.editors.text
Automatic-Module-Name: com.wudsn.ide.base

View File

@ -28,32 +28,10 @@ com.wudsn.ide.base.editor.text.TextEditorReverseLinesCommand.mnemonic=R
com.wudsn.ide.base.editor.BinaryFile.name=Binary File
com.wudsn.ide.base.editor.hex.HexEditor.name=Hex Editor
com.wudsn.ide.base.editor.hex.HexEditorOpenCommand.name=Open With Hex Editor
com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardCommand.name=Copy
com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsMenu.name=Copy as
com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsDecimalValuesCommand.name=Copy as Decimal Values
com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsDecimalValuesBlockCommand.name=Copy as Decimal Values in Block Format
com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsHexValuesCommand.name=Copy as Hexadecimal Values
com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsASCIIStringCommand.name=Copy as ASCII String
com.wudsn.ide.base.editor.hex.HexEditorPasteFromClipboardCommand.name=Paste
com.wudsn.ide.base.editor.hex.HexEditorSaveSelectionAsCommand.name=Save Selection as...
com.wudsn.ide.base.editor.hex.HexEditorFileContentMode.BINARY=Binary
com.wudsn.ide.base.editor.hex.HexEditorFileContentMode.ATARI_COM_FILE=Atari COM File
com.wudsn.ide.base.editor.hex.HexEditorFileContentMode.ATARI_DISK_IMAGE=Atari Disk Image
com.wudsn.ide.base.editor.hex.HexEditorFileContentMode.ATARI_DISK_IMAGE_K_FILE=Atari Disk Image (k-File)
com.wudsn.ide.base.editor.hex.HexEditorFileContentMode.ATARI_MADS_FILE=Atari MADS File
com.wudsn.ide.base.editor.hex.HexEditorFileContentMode.ATARI_SDX_FILE=Atari SpartaDOS X File
com.wudsn.ide.base.editor.hex.HexEditorFileContentMode.ATARI_SAP_FILE=Atari SAP File
com.wudsn.ide.base.editor.hex.HexEditorFileContentMode.C64_PRG_FILE=C64 PRG File
com.wudsn.ide.base.editor.hex.HexEditorFileContentMode.IFF_FILE=IFF File
com.wudsn.ide.base.editor.hex.HexEditorCharacterSet.ASCII=ASCII
com.wudsn.ide.base.editor.hex.HexEditorCharacterSet.ATARI_ATASCII=Atari ATASCII
com.wudsn.ide.base.editor.hex.HexEditorCharacterSet.ATARI_ATASCII_SCREEN_CODE=Atari ATASCII Screen Code
com.wudsn.ide.base.editor.hex.HexEditorCharacterSet.ATARI_INTERNATIONAL=Atari International
com.wudsn.ide.base.editor.hex.HexEditorCharacterSet.ATARI_INTERNATIONAL_SCREEN_CODE=Atari International Screen Code
com.wudsn.ide.base.editor.hex.HexEditorCharacterSet.C64_PETSCII_UPPER_CASE=C64 PETSCII Upper Case
com.wudsn.ide.base.editor.hex.HexEditorCharacterSet.C64_PETSCII_LOWER_CASE=C64 PETSCII Lower Case
com.wudsn.ide.base.hardware.HardwareCharacterSet.ASCII=ASCII
com.wudsn.ide.base.hardware.HardwareCharacterSet.ATARI_ATASCII=Atari ATASCII
com.wudsn.ide.base.hardware.HardwareCharacterSet.ATARI_ATASCII_SCREEN_CODE=Atari ATASCII Screen Code
com.wudsn.ide.base.hardware.HardwareCharacterSet.ATARI_INTERNATIONAL=Atari International
com.wudsn.ide.base.hardware.HardwareCharacterSet.ATARI_INTERNATIONAL_SCREEN_CODE=Atari International Screen Code
com.wudsn.ide.base.hardware.HardwareCharacterSet.CBM_PETSCII_UPPER_CASE=C64 PETSCII Upper Case
com.wudsn.ide.base.hardware.HardwareCharacterSet.CBM_PETSCII_LOWER_CASE=C64 PETSCII Lower Case

View File

@ -266,235 +266,6 @@
</visibleWhen>
</menu>
</menuContribution>
<menuContribution
locationURI="popup:#TextEditorContext?after=additions">
<menu
id="com.wudsn.ide.base.editor.text.TextEditorSortMenu"
label="%com.wudsn.ide.base.editor.text.TextEditorSortMenu.label">
<command
commandId="com.wudsn.ide.base.editor.text.TextEditorSortLinesCaseSensitiveCommand"
id="com.wudsn.ide.base.editor.text.TextEditorSortLinesCaseSensitiveCommand"
style="push">
</command>
<command
commandId="com.wudsn.ide.base.editor.text.TextEditorSortLinesCaseSensitiveWithoutDuplicatesCommand"
id="com.wudsn.ide.base.editor.text.TextEditorSortLinesCaseSensitiveWithoutDuplicatesCommand"
style="push">
</command>
<command
commandId="com.wudsn.ide.base.editor.text.TextEditorSortLinesCaseInsensitiveCommand"
id="com.wudsn.ide.base.editor.text.TextEditorSortLinesCaseInsensitiveCommandHandler"
style="push">
</command>
<command
commandId="com.wudsn.ide.base.editor.text.TextEditorSortLinesCaseInsensitiveWithoutDuplicatesCommand"
id="com.wudsn.ide.base.editor.text.TextEditorSortLinesCaseInsensitiveWithoutDuplicates"
style="push">
</command>
<command
commandId="com.wudsn.ide.base.editor.text.TextEditorSortLinesNumericCommand"
id="com.wudsn.ide.base.editor.text.TextEditorSortLinesNumericCommand"
style="push">
</command>
<command
commandId="com.wudsn.ide.base.editor.text.TextEditorSortLinesNumericWithoutDuplicatesCommand"
id="com.wudsn.ide.base.editor.text.TextEditorSortLinesNumericWithoutDuplicatesCommand"
style="push">
</command>
<command
commandId="com.wudsn.ide.base.editor.text.TextEditorReverseLinesCommand"
id="com.wudsn.ide.base.editor.text.TextEditorReverseLinesCommand"
style="push">
</command>
<visibleWhen
checkEnabled="false">
<with
variable="activeEditor">
<instanceof
value="org.eclipse.ui.texteditor.ITextEditor">
</instanceof>
</with>
</visibleWhen>
</menu>
</menuContribution>
<menuContribution
locationURI="menu:edit?after=additions">
<menu
label="%com.wudsn.ide.base.editor.text.TextEditorSortMenu.label"
mnemonic="%com.wudsn.ide.base.editor.text.TextEditorSortMenu.mnemonic">
<command
commandId="com.wudsn.ide.base.editor.text.TextEditorSortLinesCaseSensitiveCommand"
id="com.wudsn.ide.base.editor.text.TextEditorSortLinesCaseSensitiveCommand"
mnemonic="%com.wudsn.ide.base.editor.text.TextEditorSortLinesCaseSensitiveCommand.mnemonic"
style="push">
</command>
<command
commandId="com.wudsn.ide.base.editor.text.TextEditorSortLinesCaseSensitiveWithoutDuplicatesCommand"
id="com.wudsn.ide.base.editor.text.TextEditorSortLinesCaseSensitiveWithoutDuplicatesCommand"
mnemonic="%com.wudsn.ide.base.editor.text.TextEditorSortLinesCaseSensitiveWithoutDuplicatesCommand.mnemonic"
style="push">
</command>
<command
commandId="com.wudsn.ide.base.editor.text.TextEditorSortLinesCaseInsensitiveCommand"
id="com.wudsn.ide.base.editor.text.TextEditorSortLinesCaseInsensitiveCommand"
mnemonic="%com.wudsn.ide.base.editor.text.TextEditorSortLinesCaseInsensitiveCommand.mnemonic"
style="push">
</command>
<command
commandId="com.wudsn.ide.base.editor.text.TextEditorSortLinesCaseInsensitiveWithoutDuplicatesCommand"
id="com.wudsn.ide.base.editor.text.TextEditorSortLinesCaseInsensitiveWithoutDuplicatesCommand"
mnemonic="%com.wudsn.ide.base.editor.text.TextEditorSortLinesCaseInsensitiveWithoutDuplicatesCommand.mnemonic"
style="push">
</command>
<command
commandId="com.wudsn.ide.base.editor.text.TextEditorSortLinesNumericCommand"
id="com.wudsn.ide.base.editor.text.TextEditorSortLinesNumericCommand"
mnemonic="%com.wudsn.ide.base.editor.text.TextEditorSortLinesNumericCommand.mnemonic"
style="push">
</command>
<command
commandId="com.wudsn.ide.base.editor.text.TextEditorSortLinesNumericWithoutDuplicatesCommand"
id="com.wudsn.ide.base.editor.text.TextEditorSortLinesNumericWithoutDuplicatesCommand"
mnemonic="%com.wudsn.ide.base.editor.text.TextEditorSortLinesNumericWithoutDuplicatesCommand.mnemonic"
style="push">
</command>
<command
commandId="com.wudsn.ide.base.editor.text.TextEditorReverseLinesCommand"
id="com.wudsn.ide.base.editor.text.TextEditorReverseLinesCommand"
mnemonic="%com.wudsn.ide.base.editor.text.TextEditorReverseLinesCommand.mnemonic"
style="push">
</command>
<visibleWhen
checkEnabled="false">
<with
variable="activeEditor">
<instanceof
value="org.eclipse.ui.texteditor.ITextEditor">
</instanceof>
</with>
</visibleWhen>
</menu>
</menuContribution>
</extension>
<extension
name="HexEditorCommands"
point="org.eclipse.ui.commands">
<command
id="com.wudsn.ide.base.editor.hex.HexEditorOpenCommand"
name="%com.wudsn.ide.base.editor.hex.HexEditorOpenCommand.name">
</command>
<command
id="com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardCommand"
name="%com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardCommand.name">
</command>
<command
id="com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsHexValuesCommand"
name="%com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsHexValuesCommand.name">
</command>
<command
id="com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsDecimalValuesCommand"
name="%com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsDecimalValuesCommand.name">
</command>
<command
id="com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsDecimalValuesBlockCommand"
name="%com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsDecimalValuesBlockCommand.name">
</command>
<command
id="com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsASCIIStringCommand"
name="%com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsASCIIStringCommand.name">
</command>
<command
id="com.wudsn.ide.base.editor.hex.HexEditorPasteFromClipboardCommand"
name="%com.wudsn.ide.base.editor.hex.HexEditorPasteFromClipboardCommand.name">
</command>
<command
id="com.wudsn.ide.base.editor.hex.HexEditorSaveSelectionAsCommand"
name="%com.wudsn.ide.base.editor.hex.HexEditorSaveSelectionAsCommand.name">
</command>
</extension>
<extension
name="HexEditorHandlers"
point="org.eclipse.ui.handlers">
<handler
class="com.wudsn.ide.base.editor.hex.HexEditorOpenCommandHandler"
commandId="com.wudsn.ide.base.editor.hex.HexEditorOpenCommand">
</handler>
<handler
class="com.wudsn.ide.base.editor.hex.HexEditorClipboardCommandHandler"
commandId="com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardCommand">
<activeWhen>
<with
variable="activeMenuSelection">
<instanceof
value="com.wudsn.ide.base.editor.hex.HexEditorSelection">
</instanceof>
</with>
</activeWhen>
</handler>
<handler
class="com.wudsn.ide.base.editor.hex.HexEditorClipboardCommandHandler"
commandId="com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsHexValuesCommand">
<activeWhen>
<with
variable="activeMenuSelection">
<instanceof
value="com.wudsn.ide.base.editor.hex.HexEditorSelection">
</instanceof>
</with>
</activeWhen>
</handler>
<handler
class="com.wudsn.ide.base.editor.hex.HexEditorClipboardCommandHandler"
commandId="com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsDecimalValuesCommand">
<activeWhen>
<with
variable="activeMenuSelection">
<instanceof
value="com.wudsn.ide.base.editor.hex.HexEditorSelection">
</instanceof>
</with>
</activeWhen>
</handler>
<handler
class="com.wudsn.ide.base.editor.hex.HexEditorClipboardCommandHandler"
commandId="com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsDecimalValuesBlockCommand">
<activeWhen>
<with
variable="activeMenuSelection">
<instanceof
value="com.wudsn.ide.base.editor.hex.HexEditorSelection">
</instanceof>
</with>
</activeWhen>
</handler>
<handler
class="com.wudsn.ide.base.editor.hex.HexEditorClipboardCommandHandler"
commandId="com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsASCIIStringCommand">
<activeWhen>
<with
variable="activeMenuSelection">
<instanceof
value="com.wudsn.ide.base.editor.hex.HexEditorSelection">
</instanceof>
</with>
</activeWhen>
</handler>
<handler
class="com.wudsn.ide.base.editor.hex.HexEditorClipboardCommandHandler"
commandId="com.wudsn.ide.base.editor.hex.HexEditorPasteFromClipboardCommand">
</handler>
<handler
class="com.wudsn.ide.base.editor.hex.HexEditorSaveSelectionAsCommandHandler"
commandId="com.wudsn.ide.base.editor.hex.HexEditorSaveSelectionAsCommand">
<activeWhen>
<with
variable="activeMenuSelection">
<instanceof
value="com.wudsn.ide.base.editor.hex.HexEditorSelection">
</instanceof>
</with>
</activeWhen>
</handler>
</extension>
<extension
name="HexEditorMenus"
@ -536,97 +307,6 @@
</visibleWhen>
</command>
</menuContribution>
<menuContribution
locationURI="popup:org.eclipse.ui.popup.any?before=group.openWith">
<command
commandId="com.wudsn.ide.base.editor.hex.HexEditorOpenCommand"
id="com.wudsn.ide.base.editor.hex.HexEditorOpenCommand"
style="push">
<visibleWhen
checkEnabled="false">
<or>
<with
variable="activeMenuSelection">
<iterate
ifEmpty="false"
operator="or">
<instanceof
value="org.eclipse.core.resources.IFile">
</instanceof>
</iterate>
</with>
<with
variable="activeMenuEditorInput">
<iterate
ifEmpty="false"
operator="or">
<instanceof
value="org.eclipse.ui.IFileEditorInput">
</instanceof>
</iterate>
</with>
</or>
</visibleWhen>
</command>
</menuContribution>
<menuContribution
locationURI="popup:#HexEditorContext">
<command
commandId="com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardCommand"
disabledIcon="icons/copy-disabled.gif"
icon="icons/copy-enabled.gif"
id="com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardCommand"
style="push">
</command>
<menu
label="%com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsMenu.name">
<command
commandId="com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsHexValuesCommand"
id="com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsHexValuesCommand"
style="push">
</command>
<command
commandId="com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsDecimalValuesCommand"
id="com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsDecimalValuesCommand"
style="push">
</command>
<command
commandId="com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsDecimalValuesBlockCommand"
id="com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsDecimalValuesBlockCommand"
style="push">
</command>
<command
commandId="com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsASCIIStringCommand"
id="com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsASCIIStringCommand"
style="push">
</command>
</menu>
<command
commandId="com.wudsn.ide.base.editor.hex.HexEditorPasteFromClipboardCommand"
icon="icons/paste-enabled.gif"
id="%com.wudsn.ide.base.editor.hex.HexEditorPasteFromClipboardCommand.name"
label="%com.wudsn.ide.base.editor.hex.HexEditorPasteFromClipboardCommand.name"
style="push">
</command>
<command
commandId="com.wudsn.ide.base.editor.hex.HexEditorSaveSelectionAsCommand"
disabledIcon="icons/save-as-disabled.gif"
icon="icons/save-as-enabled.gif"
label="%com.wudsn.ide.base.editor.hex.HexEditorSaveSelectionAsCommand.name"
style="push">
</command>
</menuContribution>
</extension>
<extension
name="HexEditor"
point="org.eclipse.ui.editors">
<editor
class="com.wudsn.ide.base.editor.hex.HexEditor"
default="true"
icon="icons/hex-editor-16x16.gif"
id="com.wudsn.ide.base.editor.hex.HexEditor"
name="%com.wudsn.ide.base.editor.hex.HexEditor.name">
</editor>
</extension>
</plugin>

View File

@ -28,32 +28,10 @@ com.wudsn.ide.base.editor.text.TextEditorReverseLinesCommand.mnemonic=U
com.wudsn.ide.base.editor.BinaryFile.name=Binär-Datei
com.wudsn.ide.base.editor.hex.HexEditor.name=Hex Editor
com.wudsn.ide.base.editor.hex.HexEditorOpenCommand.name=Öffnen mit Hex Editor
com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardCommand.name=Kopieren
com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsMenu.name=Kopieren als
com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsDecimalValuesCommand.name=Kopieren als dezimale Werte
com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsDecimalValuesBlockCommand.name=Kopieren als dezimale Werte im Blocksatz
com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsHexValuesCommand.name=Kopieren als hexadezimale Werte
com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsASCIIStringCommand.name=Kopieren als ASCII Text
com.wudsn.ide.base.editor.hex.HexEditorPasteFromClipboardCommand.name=Einfügen
com.wudsn.ide.base.editor.hex.HexEditorSaveSelectionAsCommand.name=Auswahl Speichern unter...
com.wudsn.ide.base.editor.hex.HexEditorFileContentMode.BINARY=Binär
com.wudsn.ide.base.editor.hex.HexEditorFileContentMode.ATARI_COM_FILE=Atari COM-Datei
com.wudsn.ide.base.editor.hex.HexEditorFileContentMode.ATARI_DISK_IMAGE=Atari Disk Image
com.wudsn.ide.base.editor.hex.HexEditorFileContentMode.ATARI_DISK_IMAGE_K_FILE=Atari Disk Image (k-Datei)
com.wudsn.ide.base.editor.hex.HexEditorFileContentMode.ATARI_MADS_FILE=Atari MADS-Datei
com.wudsn.ide.base.editor.hex.HexEditorFileContentMode.ATARI_SAP_FILE=Atari SAP-Datei
com.wudsn.ide.base.editor.hex.HexEditorFileContentMode.ATARI_SDX_FILE=Atari SpartaDOS X-Datei
com.wudsn.ide.base.editor.hex.HexEditorFileContentMode.C64_PRG_FILE=C64 PRG-Datei
com.wudsn.ide.base.editor.hex.HexEditorFileContentMode.IFF_FILE=IFF-Datei
com.wudsn.ide.base.editor.hex.HexEditorCharacterSet.ASCII=ASCII
com.wudsn.ide.base.editor.hex.HexEditorCharacterSet.ATARI_ATASCII=Atari ATASCII
com.wudsn.ide.base.editor.hex.HexEditorCharacterSet.ATARI_ATASCII_SCREEN_CODE=Atari ATASCII Bildschirmcode
com.wudsn.ide.base.editor.hex.HexEditorCharacterSet.ATARI_INTERNATIONAL=Atari International
com.wudsn.ide.base.editor.hex.HexEditorCharacterSet.ATARI_INTERNATIONAL_SCREEN_CODE=Atari International Bildschirmcode
com.wudsn.ide.base.editor.hex.HexEditorCharacterSet.C64_PETSCII_UPPER_CASE=C64 PETSCII Großbuchstaben
com.wudsn.ide.base.editor.hex.HexEditorCharacterSet.C64_PETSCII_LOWER_CASE=C64 PETSCII Kleinbuchstaben
com.wudsn.ide.base.hardware.HardwareCharacterSet.ASCII=ASCII
com.wudsn.ide.base.hardware.HardwareCharacterSet.ATARI_ATASCII=Atari ATASCII
com.wudsn.ide.base.hardware.HardwareCharacterSet.ATARI_ATASCII_SCREEN_CODE=Atari ATASCII Bildschirmcode
com.wudsn.ide.base.hardware.HardwareCharacterSet.ATARI_INTERNATIONAL=Atari International
com.wudsn.ide.base.hardware.HardwareCharacterSet.ATARI_INTERNATIONAL_SCREEN_CODE=Atari International Bildschirmcode
com.wudsn.ide.base.hardware.HardwareCharacterSet.CBM_PETSCII_UPPER_CASE=C64 PETSCII Großbuchstaben
com.wudsn.ide.base.hardware.HardwareCharacterSet.CBM_PETSCII_LOWER_CASE=C64 PETSCII Kleinbuchstaben

View File

@ -22,7 +22,6 @@ package com.wudsn.ide.base;
import org.eclipse.osgi.util.NLS;
import com.wudsn.ide.base.common.FileUtility;
import com.wudsn.ide.base.editor.hex.HexEditor;
/**
* Class which holds the localized text constants.
@ -38,53 +37,6 @@ public final class Texts extends NLS {
public static String FILE_PATH_FIELD_BROWSE_BUTTON_LABEL;
public static String FILE_PATH_FIELD_DIALOG_MESSAGE;
/**
* Hex editor
*/
public static String HEX_EDITOR_FILE_SIZE;
public static String HEX_EDITOR_ATARI_COM_BLOCK_HEADER;
public static String HEX_EDITOR_ATARI_COM_BLOCK_HEADER_PARAMETERS;
public static String HEX_EDITOR_ATARI_COM_BLOCK_ERROR;
public static String HEX_EDITOR_ATARI_DISK_IMAGE_HEADER;
public static String HEX_EDITOR_ATARI_SECTOR_HEADER;
public static String HEX_EDITOR_ATARI_SECTOR_HEADER_PARAMETERS;
public static String HEX_EDITOR_ATARI_SECTOR_ERROR;
public static String HEX_EDITOR_ATARI_MADS_RELOC_BLOCK_HEADER;
public static String HEX_EDITOR_ATARI_MADS_UPDATE_RELOC_BLOCK_HEADER;
public static String HEX_EDITOR_ATARI_MADS_UPDATE_SYMBOLS_BLOCK_HEADER;
public static String HEX_EDITOR_ATARI_MADS_DEFINE_SYMBOLS_BLOCK_HEADER;
public static String HEX_EDITOR_ATARI_MADS_DEFINE_SYMBOL_HEADER;
public static String HEX_EDITOR_ATARI_MADS_BLOCK_ERROR;
public static String HEX_EDITOR_ATARI_SAP_FILE_HEADER;
public static String HEX_EDITOR_ATARI_SDX_NON_RELOC_BLOCK_HEADER;
public static String HEX_EDITOR_ATARI_SDX_NON_RELOC_BLOCK_HEADER_PARAMETERS;
public static String HEX_EDITOR_ATARI_SDX_RELOC_BLOCK_HEADER;
public static String HEX_EDITOR_ATARI_SDX_UPDATE_RELOC_BLOCK_HEADER;
public static String HEX_EDITOR_ATARI_SDX_UPDATE_SYMBOLS_BLOCK_HEADER;
public static String HEX_EDITOR_ATARI_SDX_DEFINE_SYMBOLS_BLOCK_HEADER;
public static String HEX_EDITOR_ATARI_SDX_BLOCK_ERROR;
public static String HEX_EDITOR_C64_PRG_HEADER;
public static String HEX_EDITOR_C64_PRG_HEADER_PARAMETERS;
public static String HEX_EDITOR_C64_PRG_ERROR;
public static String HEX_EDITOR_IFF_CHUNK;
public static String HEX_EDITOR_IFF_FORM_CHUNK;
public static String HEX_EDITOR_IFF_FILE_ERROR;
public static String HEX_EDITOR_FILE_CONTENT_SIZE_FIELD_LABEL;
public static String HEX_EDITOR_FILE_CONTENT_SIZE_FIELD_TEXT;
public static String HEX_EDITOR_FILE_CONTENT_MODE_FIELD_LABEL;
public static String HEX_EDITOR_CHARACTER_SET_TYPE_FIELD_LABEL;
public static String HEX_EDITOR_BYTES_PER_ROW_FIELD_LABEL;
public static String HEX_EDITOR_SAVE_SELECTION_AS_DIALOG_TITLE;
/**
* Messages for {@link FileUtility}.
*/
@ -103,14 +55,6 @@ public final class Texts extends NLS {
public static String MESSAGE_E212;
public static String MESSAGE_E213;
/**
* Message for the {@link HexEditor}
*/
public static String MESSAGE_E300;
public static String MESSAGE_E301;
public static String MESSAGE_I302;
public static String MESSAGE_I303;
/**
* Initializes the constants.
*/

View File

@ -2,50 +2,6 @@ DIALOG_TITLE=WUDSN IDE Dialog
FILE_PATH_FIELD_BROWSE_BUTTON_LABEL=Browse...
FILE_PATH_FIELD_DIALOG_MESSAGE=Select {0}
HEX_EDITOR_FILE_SIZE=File contains ${0} ({1}) bytes.
HEX_EDITOR_ATARI_COM_BLOCK_HEADER=COM block
HEX_EDITOR_ATARI_COM_BLOCK_HEADER_PARAMETERS={0}-{1} ({2})
HEX_EDITOR_ATARI_COM_BLOCK_ERROR=COM file structure error
HEX_EDITOR_ATARI_DISK_IMAGE_HEADER=ATR header
HEX_EDITOR_ATARI_SECTOR_HEADER=Sector
HEX_EDITOR_ATARI_SECTOR_HEADER_PARAMETERS=({2})
HEX_EDITOR_ATARI_SECTOR_ERROR=Sector structure error
HEX_EDITOR_ATARI_MADS_RELOC_BLOCK_HEADER=MADS RELOC block {0}-{1} {2}
HEX_EDITOR_ATARI_MADS_UPDATE_RELOC_BLOCK_HEADER=MADS UPDATE RELOC block {0} {1}
HEX_EDITOR_ATARI_MADS_UPDATE_SYMBOLS_BLOCK_HEADER=MADS UPDATE SYMBOLS block {0} {1}
HEX_EDITOR_ATARI_MADS_DEFINE_SYMBOLS_BLOCK_HEADER=MADS DEFINE SYMBOLS block {0}
HEX_EDITOR_ATARI_MADS_DEFINE_SYMBOL_HEADER=MADS DEFINE SYMBOL {0} {1} {2} {3}
HEX_EDITOR_ATARI_MADS_BLOCK_ERROR=MADS file structure error
HEX_EDITOR_ATARI_SAP_FILE_HEADER=SAP Header
HEX_EDITOR_ATARI_SDX_NON_RELOC_BLOCK_HEADER=SDX NON-RELOC block
HEX_EDITOR_ATARI_SDX_NON_RELOC_BLOCK_HEADER_PARAMETERS={0}-{1} ({2})
HEX_EDITOR_ATARI_SDX_RELOC_BLOCK_HEADER=SDX RELOC block {0} {1} {2} {3}
HEX_EDITOR_ATARI_SDX_UPDATE_RELOC_BLOCK_HEADER=SDX UPDATE RELOC block {0} {1}
HEX_EDITOR_ATARI_SDX_UPDATE_SYMBOLS_BLOCK_HEADER=SDX UPDATE SYMBOLS block {0} {1}
HEX_EDITOR_ATARI_SDX_DEFINE_SYMBOLS_BLOCK_HEADER=SDX DEFINE SYMBOLS block {0} {1} {2}
HEX_EDITOR_ATARI_SDX_BLOCK_ERROR=SDX file structure error
HEX_EDITOR_C64_PRG_HEADER=Program
HEX_EDITOR_C64_PRG_HEADER_PARAMETERS={0}-{1} ({2})
HEX_EDITOR_C64_PRG_ERROR=PRG file structure error
HEX_EDITOR_IFF_CHUNK=Chunk {0} contains ${1} ({2}) bytes
HEX_EDITOR_IFF_FORM_CHUNK=Chunk {0} of type {1} contains ${2} ({3}) bytes
HEX_EDITOR_IFF_FILE_ERROR=IFF file structure error
HEX_EDITOR_FILE_CONTENT_SIZE_FIELD_LABEL=File Size
HEX_EDITOR_FILE_CONTENT_SIZE_FIELD_TEXT=${0} ({1}) bytes
HEX_EDITOR_FILE_CONTENT_MODE_FIELD_LABEL=File Mode
HEX_EDITOR_CHARACTER_SET_TYPE_FIELD_LABEL=Character Set
HEX_EDITOR_BYTES_PER_ROW_FIELD_LABEL=Bytes per Row
HEX_EDITOR_SAVE_SELECTION_AS_DIALOG_TITLE=Save ${0} ({1}) bytes as...
MESSAGE_E200=Folder '{0}' does not exist.
MESSAGE_E201='{0}' is no folder but a file.
MESSAGE_E202=Cannot create folder '{0}'.
@ -60,8 +16,3 @@ MESSAGE_E210=Cannot create file '{0}'.
MESSAGE_E211=Cannot open file '{0}' for writing.
MESSAGE_E212=Cannot write content of file '{0}'.
MESSAGE_E213=Cannot close output stream of file '{0}'.
MESSAGE_E300=File content cannot be interpreted as '{0}'.
MESSAGE_E301=File of type '{0}' is corrupted; check the last section of the file.
MESSAGE_I302=${0} ({1}) bytes copied to clipboard.
MESSAGE_I303=${0} ({1}) bytes saved as '{2}'.

View File

@ -2,50 +2,6 @@ DIALOG_TITLE=WUDSN IDE Dialog
FILE_PATH_FIELD_BROWSE_BUTTON_LABEL=Durchsuchen...
FILE_PATH_FIELD_DIALOG_MESSAGE={0} auswählen
HEX_EDITOR_FILE_SIZE=Datei enhält {0} ({1}) Bytes.
HEX_EDITOR_ATARI_COM_BLOCK_HEADER=COM Block
HEX_EDITOR_ATARI_COM_BLOCK_HEADER_PARAMETERS={0}-{1} ({2})
HEX_EDITOR_ATARI_COM_BLOCK_ERROR=COM Dateistruktur defekt
HEX_EDITOR_ATARI_DISK_IMAGE_HEADER=ATR Header
HEX_EDITOR_ATARI_SECTOR_HEADER=Sektor
HEX_EDITOR_ATARI_SECTOR_HEADER_PARAMETERS=({2})
HEX_EDITOR_ATARI_SECTOR_ERROR=Sektorfehler
HEX_EDITOR_ATARI_MADS_RELOC_BLOCK_HEADER=MADS RELOC Block {0}-{1} {2}
HEX_EDITOR_ATARI_MADS_UPDATE_RELOC_BLOCK_HEADER=MADS UPDATE RELOC Block {0} {1}
HEX_EDITOR_ATARI_MADS_UPDATE_SYMBOLS_BLOCK_HEADER=MADS UPDATE SYMBOLS Block {0} {1}
HEX_EDITOR_ATARI_MADS_DEFINE_SYMBOLS_BLOCK_HEADER=MADS DEFINE SYMBOLS Block {0}
HEX_EDITOR_ATARI_MADS_DEFINE_SYMBOL_HEADER=MADS DEFINE SYMBOL {0} {1} {2} {3}
HEX_EDITOR_ATARI_MADS_BLOCK_ERROR=MADS Dateistruktur defekt
HEX_EDITOR_ATARI_SAP_FILE_HEADER=SAP Header
HEX_EDITOR_ATARI_SDX_NON_RELOC_BLOCK_HEADER=SDX NON-RELOC block
HEX_EDITOR_ATARI_SDX_NON_RELOC_BLOCK_HEADER_PARAMETERS={0}-{1} ({2})
HEX_EDITOR_ATARI_SDX_RELOC_BLOCK_HEADER=SDX NON-RELOC Block {0} {1} {2} {3}
HEX_EDITOR_ATARI_SDX_UPDATE_RELOC_BLOCK_HEADER=SDX UPDATE RELOC Block {0} {1}
HEX_EDITOR_ATARI_SDX_UPDATE_SYMBOLS_BLOCK_HEADER=SDX UPDATE SYMBOLS Block {0} {1}
HEX_EDITOR_ATARI_SDX_DEFINE_SYMBOLS_BLOCK_HEADER=SDX DEFINE SYMBOLS Block {0} {1} {2}
HEX_EDITOR_ATARI_SDX_BLOCK_ERROR=SDX Dateistruktur defekt
HEX_EDITOR_C64_PRG_HEADER=Programm
HEX_EDITOR_C64_PRG_HEADER_PARAMETERS={0}-{1} ({2})
HEX_EDITOR_C64_PRG_ERROR=PRG Dateistruktur defekt
HEX_EDITOR_IFF_CHUNK=Chunk
HEX_EDITOR_IFF_FORM_CHUNK=Chunk {0} vom Typ {1} enhl#t ${2} ({3}) Bytes
HEX_EDITOR_IFF_FILE_ERROR=IFF Dateistruktur defekt
HEX_EDITOR_FILE_CONTENT_SIZE_FIELD_LABEL=Dateigröße
HEX_EDITOR_FILE_CONTENT_SIZE_FIELD_TEXT=${0} ({1}) Bytes
HEX_EDITOR_FILE_CONTENT_MODE_FIELD_LABEL=Datei-Modus
HEX_EDITOR_CHARACTER_SET_TYPE_FIELD_LABEL=Zeichensatz
HEX_EDITOR_BYTES_PER_ROW_FIELD_LABEL=Bytes pro Zeile
HEX_EDITOR_SAVE_SELECTION_AS_DIALOG_TITLE=Speichere ${0} ({1}) Bytes unter...
MESSAGE_E200=Ordner '{0}' existiert nicht.
MESSAGE_E201='{0}' ist kein Ordner sondern eine Datei.
MESSAGE_E202=Ordner '{0}' kann nicht erstellt werden.
@ -60,8 +16,3 @@ MESSAGE_E210=Datei '{0}' kann nicht erstellt werden.
MESSAGE_E211=Datei '{0}' kann nicht zum Schreiben geöffnet werden.
MESSAGE_E212=Inhalt der Datei '{0}' kann nicht geschrieben werden.
MESSAGE_E213=Ausgabedatenstrom der Datei '{0}' kann geschlossen werden.
MESSAGE_E300=Inhalt der Datei kann nicht als '{0}' interpretiert werden.
MESSAGE_E301=Datei vom Typ '{0}' ist korrupt; überprüfen Sie den letzten Abschnitt der Datei
MESSAGE_I302=${0} ({1}) Bytes in die Zwischenablage kopiert.
MESSAGE_I303=${0} ({1}) Bytes gespeichert unter '{2}'.

View File

@ -94,7 +94,7 @@ public abstract class AbstractIDEPlugin extends AbstractUIPlugin {
}
message = format(message, parameters);
getLog().log(new Status(IStatus.INFO, getPluginId(), IStatus.OK, message, null));
// System.out.println(message);
// System.out.println(message);
}
/**

View File

@ -16,11 +16,10 @@
* You should have received a copy of the GNU General Public License
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex;
package com.wudsn.ide.base.hardware;
/**
* Enum for the supported hardware platforms. Used for file content modes and
* character sets.
* Enum for the hardware platforms.
*
* @author Peter Dell
*

View File

@ -17,7 +17,7 @@
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex;
package com.wudsn.ide.base.hardware;
import java.io.File;
import java.util.Map;
@ -35,11 +35,12 @@ import com.wudsn.ide.base.common.ResourceUtility;
/**
* Logical character set with physical font and character mapping.
* TODO Generalize C64 to CBM ASCII
*
* @since 1.7.0
*/
enum HexEditorCharacterSet {
ASCII, ATARI_ATASCII, ATARI_ATASCII_SCREEN_CODE, ATARI_INTERNATIONAL, ATARI_INTERNATIONAL_SCREEN_CODE, C64_PETSCII_UPPER_CASE, C64_PETSCII_LOWER_CASE;
public enum HardwareCharacterSet {
ASCII, ATARI_ATASCII, ATARI_ATASCII_SCREEN_CODE, ATARI_INTERNATIONAL, ATARI_INTERNATIONAL_SCREEN_CODE, CBM_PETSCII_UPPER_CASE, CBM_PETSCII_LOWER_CASE;
/**
* Data class to encapsulate lazy loading and reuse of SWT fonts.
@ -54,20 +55,20 @@ enum HexEditorCharacterSet {
private final static int ATARI_FONT_BASE = 0xe000;
private final static int ATARI_INT_FONT_BASE = 0xe100;
private final static String C64_FONT_PATH = "fonts/c64/C64Classic-Regular.ttf";
private final static String C64_FONT_NAME = "C64 Classic";
private final static int C64_FONT_SIZE = 6;
private final static int C64_UPPER_FONT_BASE = 0x0100;
private final static int C64_LOWER_FONT_BASE = 0x0200;
private final static String CBM_FONT_PATH = "fonts/c64/C64Classic-Regular.ttf";
private final static String CBM_FONT_NAME = "C64 Classic";
private final static int CBM_FONT_SIZE = 6;
private final static int CBM_UPPER_FONT_BASE = 0x0100;
private final static int CBM_LOWER_FONT_BASE = 0x0200;
private static Map<HexEditorCharacterSet, Data> instanceMap;
private static Map<HardwareCharacterSet, Data> instanceMap;
private static Map<String, Font> fontMap;
Font font;
char[] characterMapping;
static {
instanceMap = new TreeMap<HexEditorCharacterSet, Data>();
instanceMap = new TreeMap<HardwareCharacterSet, Data>();
fontMap = new TreeMap<String, Font>();
}
@ -79,7 +80,7 @@ enum HexEditorCharacterSet {
*
* @return The instance, not <code>null</code>.
*/
public static Data getInstance(HexEditorCharacterSet type) {
public static Data getInstance(HardwareCharacterSet type) {
if (type == null) {
throw new IllegalArgumentException("Parameter 'type' must not be null.");
}
@ -131,17 +132,17 @@ enum HexEditorCharacterSet {
fontSize = ATARI_FONT_SIZE;
result.setAtariScreenCodeMapping(ATARI_INT_FONT_BASE);
break;
case C64_PETSCII_UPPER_CASE:
fontPath = C64_FONT_PATH;
fontName = C64_FONT_NAME;
fontSize = C64_FONT_SIZE;
result.setIdentityMapping(C64_UPPER_FONT_BASE);
case CBM_PETSCII_UPPER_CASE:
fontPath = CBM_FONT_PATH;
fontName = CBM_FONT_NAME;
fontSize = CBM_FONT_SIZE;
result.setIdentityMapping(CBM_UPPER_FONT_BASE);
break;
case C64_PETSCII_LOWER_CASE:
fontPath = C64_FONT_PATH;
fontName = C64_FONT_NAME;
fontSize = C64_FONT_SIZE;
result.setIdentityMapping(C64_LOWER_FONT_BASE);
case CBM_PETSCII_LOWER_CASE:
fontPath = CBM_FONT_PATH;
fontName = CBM_FONT_NAME;
fontSize = CBM_FONT_SIZE;
result.setIdentityMapping(CBM_LOWER_FONT_BASE);
break;
default:
throw new IllegalArgumentException("Unsupported font type " + type + ".");
@ -225,29 +226,6 @@ enum HexEditorCharacterSet {
}
/**
* Determines the default character set for a given file content mode.
*
* @param fileContentMode
* The file content mode, not <code>null</code>.
* @return The default character set, not <code>null</code>.
*/
public static HexEditorCharacterSet getDefaultCharacterSet(HexEditorFileContentMode fileContentMode) {
if (fileContentMode == null) {
throw new IllegalArgumentException("Parameter 'fileContentMode' must not be null.");
}
switch (fileContentMode.getHardware()) {
case GENERIC:
return ASCII;
case ATARI8BIT:
return ATARI_ATASCII;
case C64:
return C64_PETSCII_UPPER_CASE;
}
throw new IllegalArgumentException("File content mode " + fileContentMode + " has an unknown hardware "
+ fileContentMode.getHardware());
}
/**
* Gets the SWT font.
*

View File

@ -11,7 +11,8 @@ Require-Bundle: com.wudsn.ide.base,
org.eclipse.ui,
org.eclipse.ui.editors,
org.eclipse.ui.ide,
org.eclipse.ui.console
org.eclipse.ui.console,
org.eclipse.ui.views
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin

View File

@ -3,5 +3,6 @@
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/com.wudsn.ide.base"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -1,12 +1,18 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Hex Editor Test
Bundle-SymbolicName: com.wudsn.ide.hex
Bundle-Version: 1.7.1
Bundle-Name: WUDSN IDE Hex Editor Plugin
Bundle-SymbolicName: com.wudsn.ide.hex;singleton:=true
Bundle-Version: 1.7.1.qualifier
Bundle-Activator: com.wudsn.ide.hex.HexPlugin
Bundle-Vendor: WUDSN
Bundle-Localization: plugin
Bundle-Vendor: Peter Dell
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime
org.eclipse.core.runtime,
org.eclipse.core.resources,
org.eclipse.ui.ide,
org.eclipse.ui.views,
com.wudsn.ide.base
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Automatic-Module-Name: com.wudsn.ide.hex
Export-Package: com.wudsn.ide.hex

View File

@ -2,5 +2,8 @@ source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
fonts/
icons/,\
plugin.properties,\
plugin_de_DE.properties,\
plugin.xml

View File

@ -1,317 +0,0 @@
{\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\fmodern\fprq1 Atari Classic Chunky;}{\f3\froman Times New Roman;}{\f4\fswiss\fprq2 Arial;}}
{\colortbl\red0\green0\blue0;\red0\green0\blue255;}
\deflang1033\pard\plain\f2\fs24\cf1 Atari Classic TrueType Fonts \plain\f2\fs24\cf0
\par \plain\f4\fs16\cf0 (Windows Version 1.1)
\par Created by Mark Simonson (v.1.0-1998, v.1.1-2001)
\par marksim@bitstream.net
\par Website: Mac/Atari Fusion--Atari Home Computer Resources for Mac Users
\par http://www2.bitstream.net/~marksim/atarimac/
\par Macintosh version also available.
\par
\par With these fonts installed, you can view and print Atari text files in any text editor that allows you to change fonts (WordPad, for example). Tip: In order to get the correct line breaks, you will need to change the ATASCII return character (155) to the DOS LF character. (In the Character Map accessory, the ATASCII return is the blank character that comes just before the inverse up-arrow.)
\par
\par There are three different fonts. \plain\f4\fs16\cf0\b Atari Classic Chunky \plain\f4\fs16\cf0 is a pixel-for-pixel copy of the original ATASCII character set. \plain\f4\fs16\cf0\b Atari Classic Smooth \plain\f4\fs16\cf0 interprets the pixel aliasing (stair steps) as diagonal lines. \plain\f4\fs16\cf0\b Atari Classic Extrasmooth \plain\f4\fs16\cf0 refines this idea further with the addition of curves. \plain\f4\fs16\cf0\b Smooth\plain\f4\fs16\cf0 and \plain\f4\fs16\cf0\b Extrasmooth\plain\f4\fs16\cf0 were designed for better appearance and legibility at larger sizes and on print-outs. Use the one that looks best to you.
\par
\par These fonts will tend to look uneven at font sizes that do not correspond to the 8-by-8 pixel grid that the characters are based on. Because Windows assumes 96ppi screen resolution, they will look best in a font size that is a multiple of 6 (i.e., 6pt, 12pt, 18pt, etc.). (In Windows, 6 points = 8 pixels.)
\par
\par The Atari Classic TrueType fonts duplicate the ATASCII character set on a low-level basis. Unlike a normal Windows font, ATASCII utilizes all character codes from $00 to $FF (0 to 255). The lower half are normal characters; the upper half are inverse versions of the lower half. The basic ASCII characters ($00 to $7F) correspond fairly closely except for the first 32, which don't normally contain characters in a Windows font.
\par
\par Due to differences between the way Windows and the Atari use character codes, not all characters will display properly in Windows. In fact, some characters will not display at all (though they do exist in the font). Unfortunately, this is due to certain character codes being reserved in Windows and there doesn't appear to be any way to work around it. The character codes affected are: $00-$1F (0-31), $7F-$81 (127-129), $8D-$90 (141-144), $9D (157), and $9F (158).
\par
\par Not all characters can be typed from the keyboard. You can however copy characters as needed from this document (see tables below). The Character Map desk accessory can help also.
\par
\par \plain\f4\fs16\cf0\b ATASCII CHARACTER SET TABLES
\par \plain\f4\fs16\cf0
\par In order to see the ATASCII character set with these tables, the Atari Classic TrueType fonts must be installed. Characters that are not displayed properly are due to character code usage differences between ATASCII and Windows (see above).
\par
\par
\par \plain\f4\fs16\cf0\b TABLE 1: ATASCII Character Dump Block
\par \plain\f4\fs16\cf0
\par All characters (ATASCII $00 thru $FF) 16 characters per
\par line.
\par
\par
\par \plain\f2\fs12\cf0 \'01\'02\'03\'04\'05\'06\'07\'08\tab
\par \'0b\'0c
\par \'0e\'0f
\par \'10\'11\'12\'13\'14\'15\'16\'17\'18\'19\'1a\'1b\'1c\'1d\'1e\'1f
\par !"#$%&'()*+,-./
\par 0123456789:;<=>?
\par @ABCDEFGHIJKLMNO
\par PQRSTUVWXYZ[\\]^_
\par `abcdefghijklmno
\par pqrstuvwxyz\{|\}~
\par \'80\'81\'82\'83\'84\'85\'86\'87\'88\'89\'8a\'8b\'8c\'8d\'8e\'8f
\par \'90''""\bullet \endash \emdash \'98\'99\'9a \'9c\'9d\'9e\'9f
\par \~\'a1\'a2\'a3\'a4\'a5\'a6\'a7\'a8\'a9\'aa\'ab\'ac\'ad\'ae\'af
\par \'b0\'b1\'b2\'b3\'b4\'b5\'b6\'b7\'b8\'b9\'ba\'bb\'bc\'bd\'be\'bf
\par \'c0\'c1\'c2\'c3\'c4\'c5\'c6\'c7\'c8\'c9\'ca\'cb\'cc\'cd\'ce\'cf
\par \'d0\'d1\'d2\'d3\'d4\'d5\'d6\'d7\'d8\'d9\'da\'db\'dc\'dd\'de\'df
\par \'e0\'e1\'e2\'e3\'e4\'e5\'e6\'e7\'e8\'e9\'ea\'eb\'ec\'ed\'ee\'ef
\par \'f0\'f1\'f2\'f3\'f4\'f5\'f6\'f7\'f8\'f9\'fa\'fb\'fc\'fd\'fe\'ff
\par \plain\f4\fs16\cf0
\par
\par \plain\f4\fs16\cf0\b TABLE 2: ATASCII Character Dump List
\par \plain\f4\fs16\cf0
\par All characters (ATASCII $00 thru $FF) one character per
\par line with hexadecimal value indicated on the left.
\par
\par \plain\f2\fs12\cf0 00=
\par 01=\'01
\par 02=\'02
\par 03=\'03
\par 04=\'04
\par 05=\'05
\par 06=\'06
\par 07=\'07
\par 08=\'08
\par 09=\tab
\par 0A=
\par
\par 0B=\'0b
\par 0C=\'0c
\par 0D=
\par 0E=\'0e
\par 0F=\'0f
\par 10=\'10
\par 11=\'11
\par 12=\'12
\par 13=\'13
\par 14=\'14
\par 15=\'15
\par 16=\'16
\par 17=\'17
\par 18=\'18
\par 19=\'19
\par 1A=\'1a
\par 1B=\'1b
\par 1C=\'1c
\par 1D=\'1d
\par 1E=\'1e
\par 1F=\'1f
\par 20=
\par 21=!
\par 22="
\par 23=#
\par 24=$
\par 25=%
\par 26=&
\par 27='
\par 28=(
\par 29=)
\par 2A=*
\par 2B=+
\par 2C=,
\par 2D=-
\par 2E=.
\par 2F=/
\par 30=0
\par 31=1
\par 32=2
\par 33=3
\par 34=4
\par 35=5
\par 36=6
\par 37=7
\par 38=8
\par 39=9
\par 3A=:
\par 3B=;
\par 3C=<
\par 3D==
\par 3E=>
\par 3F=?
\par 40=@
\par 41=A
\par 42=B
\par 43=C
\par 44=D
\par 45=E
\par 46=F
\par 47=G
\par 48=H
\par 49=I
\par 4A=J
\par 4B=K
\par 4C=L
\par 4D=M
\par 4E=N
\par 4F=O
\par 50=P
\par 51=Q
\par 52=R
\par 53=S
\par 54=T
\par 55=U
\par 56=V
\par 57=W
\par 58=X
\par 59=Y
\par 5A=Z
\par 5B=[
\par 5C=\\
\par 5D=]
\par 5E=^
\par 5F=_
\par 60=`
\par 61=a
\par 62=b
\par 63=c
\par 64=d
\par 65=e
\par 66=f
\par 67=g
\par 68=h
\par 69=i
\par 6A=j
\par 6B=k
\par 6C=l
\par 6D=m
\par 6E=n
\par 6F=o
\par 70=p
\par 71=q
\par 72=r
\par 73=s
\par 74=t
\par 75=u
\par 76=v
\par 77=w
\par 78=x
\par 79=y
\par 7A=z
\par 7B=\{
\par 7C=|
\par 7D=\}
\par 7E=~
\par 7F=
\par 80=\'80
\par 81=\'81
\par 82=\'82
\par 83=\'83
\par 84=\'84
\par 85=\'85
\par 86=\'86
\par 87=\'87
\par 88=\'88
\par 89=\'89
\par 8A=\'8a
\par 8B=\'8b
\par 8C=\'8c
\par 8D=\'8d
\par 8E=\'8e
\par 8F=\'8f
\par 90=\'90
\par 91='
\par 92='
\par 93="
\par 94="
\par 95=\bullet
\par 96=\endash
\par 97=\emdash
\par 98=\'98
\par 99=\'99
\par 9A=\'9a
\par 9B=
\par 9C=\'9c
\par 9D=\'9d
\par 9E=\'9e
\par 9F=\'9f
\par A0=\~
\par A1=\'a1
\par A2=\'a2
\par A3=\'a3
\par A4=\'a4
\par A5=\'a5
\par A6=\'a6
\par A7=\'a7
\par A8=\'a8
\par A9=\'a9
\par AA=\'aa
\par AB=\'ab
\par AC=\'ac
\par AD=\'ad
\par AE=\'ae
\par AF=\'af
\par B0=\'b0
\par B1=\'b1
\par B2=\'b2
\par B3=\'b3
\par B4=\'b4
\par B5=\'b5
\par B6=\'b6
\par B7=\'b7
\par B8=\'b8
\par B9=\'b9
\par BA=\'ba
\par BB=\'bb
\par BC=\'bc
\par BD=\'bd
\par BE=\'be
\par BF=\'bf
\par C0=\'c0
\par C1=\'c1
\par C2=\'c2
\par C3=\'c3
\par C4=\'c4
\par C5=\'c5
\par C6=\'c6
\par C7=\'c7
\par C8=\'c8
\par C9=\'c9
\par CA=\'ca
\par CB=\'cb
\par CC=\'cc
\par CD=\'cd
\par CE=\'ce
\par CF=\'cf
\par D0=\'d0
\par D1=\'d1
\par D2=\'d2
\par D3=\'d3
\par D4=\'d4
\par D5=\'d5
\par D6=\'d6
\par D7=\'d7
\par D8=\'d8
\par D9=\'d9
\par DA=\'da
\par DB=\'db
\par DC=\'dc
\par DD=\'dd
\par DE=\'de
\par DF=\'df
\par E0=\'e0
\par E1=\'e1
\par E2=\'e2
\par E3=\'e3
\par E4=\'e4
\par E5=\'e5
\par E6=\'e6
\par E7=\'e7
\par E8=\'e8
\par E9=\'e9
\par EA=\'ea
\par EB=\'eb
\par EC=\'ec
\par ED=\'ed
\par EE=\'ee
\par EF=\'ef
\par F0=\'f0
\par F1=\'f1
\par F2=\'f2
\par F3=\'f3
\par F4=\'f4
\par F5=\'f5
\par F6=\'f6
\par F7=\'f7
\par F8=\'f8
\par F9=\'f9
\par FA=\'fa
\par FB=\'fb
\par FC=\'fc
\par FD=\'fd
\par FE=\'fe
\par FF=\'ff
\par }

View File

@ -1,6 +0,0 @@
Fonts in this package are (c) 2010 Style.
You MAY NOT: sell this font; include/redistribute this font in any font collection regardless of pricing; provide the font for direct download from any web site. You MAY: link to "http://style64.org/c64-truetype" in order for others to download and install the font; embed this font or its .eot and .woff variants without any modification and using the same filename it was provided with for display on any web site using @font-face rules; use this font in static images and vector art; include this font without any modification and using the same filename it was provided with as part of a software package but ONLY if said software package is freely provided to end users. You may also contact us to negotiate a (possibly commercial) license for your use outside of these guidelines at "http://style64.org/contact-style".
At all times the most recent version of this license can be found at "http://style64.org/c64-truetype/license".

View File

Before

Width:  |  Height:  |  Size: 366 B

After

Width:  |  Height:  |  Size: 366 B

View File

Before

Width:  |  Height:  |  Size: 594 B

After

Width:  |  Height:  |  Size: 594 B

View File

Before

Width:  |  Height:  |  Size: 138 B

After

Width:  |  Height:  |  Size: 138 B

View File

Before

Width:  |  Height:  |  Size: 212 B

After

Width:  |  Height:  |  Size: 212 B

View File

Before

Width:  |  Height:  |  Size: 221 B

After

Width:  |  Height:  |  Size: 221 B

View File

Before

Width:  |  Height:  |  Size: 365 B

After

Width:  |  Height:  |  Size: 365 B

View File

Before

Width:  |  Height:  |  Size: 183 B

After

Width:  |  Height:  |  Size: 183 B

View File

Before

Width:  |  Height:  |  Size: 143 B

After

Width:  |  Height:  |  Size: 143 B

View File

Before

Width:  |  Height:  |  Size: 327 B

After

Width:  |  Height:  |  Size: 327 B

View File

Before

Width:  |  Height:  |  Size: 361 B

After

Width:  |  Height:  |  Size: 361 B

View File

Before

Width:  |  Height:  |  Size: 605 B

After

Width:  |  Height:  |  Size: 605 B

View File

Before

Width:  |  Height:  |  Size: 232 B

After

Width:  |  Height:  |  Size: 232 B

View File

Before

Width:  |  Height:  |  Size: 583 B

After

Width:  |  Height:  |  Size: 583 B

View File

@ -0,0 +1,21 @@
com.wudsn.ide.hex.HexEditor.name=Hex Editor
com.wudsn.ide.hex.HexEditorOpenCommand.name=Open With Hex Editor
com.wudsn.ide.hex.HexEditorCopyToClipboardCommand.name=Copy
com.wudsn.ide.hex.HexEditorCopyToClipboardAsMenu.name=Copy as
com.wudsn.ide.hex.HexEditorCopyToClipboardAsDecimalValuesCommand.name=Copy as Decimal Values
com.wudsn.ide.hex.HexEditorCopyToClipboardAsDecimalValuesBlockCommand.name=Copy as Decimal Values in Block Format
com.wudsn.ide.hex.HexEditorCopyToClipboardAsHexValuesCommand.name=Copy as Hexadecimal Values
com.wudsn.ide.hex.HexEditorCopyToClipboardAsASCIIStringCommand.name=Copy as ASCII String
com.wudsn.ide.hex.HexEditorPasteFromClipboardCommand.name=Paste
com.wudsn.ide.hex.HexEditorSaveSelectionAsCommand.name=Save Selection as...
com.wudsn.ide.hex.HexEditorFileContentMode.BINARY=Binary
com.wudsn.ide.hex.HexEditorFileContentMode.ATARI_COM_FILE=Atari COM File
com.wudsn.ide.hex.HexEditorFileContentMode.ATARI_DISK_IMAGE=Atari Disk Image
com.wudsn.ide.hex.HexEditorFileContentMode.ATARI_DISK_IMAGE_K_FILE=Atari Disk Image (k-File)
com.wudsn.ide.hex.HexEditorFileContentMode.ATARI_MADS_FILE=Atari MADS File
com.wudsn.ide.hex.HexEditorFileContentMode.ATARI_SDX_FILE=Atari SpartaDOS X File
com.wudsn.ide.hex.HexEditorFileContentMode.ATARI_SAP_FILE=Atari SAP File
com.wudsn.ide.hex.HexEditorFileContentMode.C64_PRG_FILE=C64 PRG File
com.wudsn.ide.hex.HexEditorFileContentMode.IFF_FILE=IFF File

View File

@ -0,0 +1,221 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
<extension
name="HexEditorCommands"
point="org.eclipse.ui.commands">
<command
id="com.wudsn.ide.hex.HexEditorOpenCommand"
name="%com.wudsn.ide.hex.HexEditorOpenCommand.name">
</command>
<command
id="com.wudsn.ide.hex.HexEditorCopyToClipboardCommand"
name="%com.wudsn.ide.hex.HexEditorCopyToClipboardCommand.name">
</command>
<command
id="com.wudsn.ide.hex.HexEditorCopyToClipboardAsHexValuesCommand"
name="%com.wudsn.ide.hex.HexEditorCopyToClipboardAsHexValuesCommand.name">
</command>
<command
id="com.wudsn.ide.hex.HexEditorCopyToClipboardAsDecimalValuesCommand"
name="%com.wudsn.ide.hex.HexEditorCopyToClipboardAsDecimalValuesCommand.name">
</command>
<command
id="com.wudsn.ide.hex.HexEditorCopyToClipboardAsDecimalValuesBlockCommand"
name="%com.wudsn.ide.hex.HexEditorCopyToClipboardAsDecimalValuesBlockCommand.name">
</command>
<command
id="com.wudsn.ide.hex.HexEditorCopyToClipboardAsASCIIStringCommand"
name="%com.wudsn.ide.hex.HexEditorCopyToClipboardAsASCIIStringCommand.name">
</command>
<command
id="com.wudsn.ide.hex.HexEditorPasteFromClipboardCommand"
name="%com.wudsn.ide.hex.HexEditorPasteFromClipboardCommand.name">
</command>
<command
id="com.wudsn.ide.hex.HexEditorSaveSelectionAsCommand"
name="%com.wudsn.ide.hex.HexEditorSaveSelectionAsCommand.name">
</command>
</extension>
<extension
name="HexEditorHandlers"
point="org.eclipse.ui.handlers">
<handler
class="com.wudsn.ide.hex.HexEditorOpenCommandHandler"
commandId="com.wudsn.ide.hex.HexEditorOpenCommand">
</handler>
<handler
class="com.wudsn.ide.hex.HexEditorClipboardCommandHandler"
commandId="com.wudsn.ide.hex.HexEditorCopyToClipboardCommand">
<activeWhen>
<with
variable="activeMenuSelection">
<instanceof
value="com.wudsn.ide.hex.HexEditorSelection">
</instanceof>
</with>
</activeWhen>
</handler>
<handler
class="com.wudsn.ide.hex.HexEditorClipboardCommandHandler"
commandId="com.wudsn.ide.hex.HexEditorCopyToClipboardAsHexValuesCommand">
<activeWhen>
<with
variable="activeMenuSelection">
<instanceof
value="com.wudsn.ide.hex.HexEditorSelection">
</instanceof>
</with>
</activeWhen>
</handler>
<handler
class="com.wudsn.ide.hex.HexEditorClipboardCommandHandler"
commandId="com.wudsn.ide.hex.HexEditorCopyToClipboardAsDecimalValuesCommand">
<activeWhen>
<with
variable="activeMenuSelection">
<instanceof
value="com.wudsn.ide.hex.HexEditorSelection">
</instanceof>
</with>
</activeWhen>
</handler>
<handler
class="com.wudsn.ide.hex.HexEditorClipboardCommandHandler"
commandId="com.wudsn.ide.hex.HexEditorCopyToClipboardAsDecimalValuesBlockCommand">
<activeWhen>
<with
variable="activeMenuSelection">
<instanceof
value="com.wudsn.ide.hex.HexEditorSelection">
</instanceof>
</with>
</activeWhen>
</handler>
<handler
class="com.wudsn.ide.hex.HexEditorClipboardCommandHandler"
commandId="com.wudsn.ide.hex.HexEditorCopyToClipboardAsASCIIStringCommand">
<activeWhen>
<with
variable="activeMenuSelection">
<instanceof
value="com.wudsn.ide.hex.HexEditorSelection">
</instanceof>
</with>
</activeWhen>
</handler>
<handler
class="com.wudsn.ide.hex.HexEditorClipboardCommandHandler"
commandId="com.wudsn.ide.hex.HexEditorPasteFromClipboardCommand">
</handler>
<handler
class="com.wudsn.ide.hex.HexEditorSaveSelectionAsCommandHandler"
commandId="com.wudsn.ide.hex.HexEditorSaveSelectionAsCommand">
<activeWhen>
<with
variable="activeMenuSelection">
<instanceof
value="com.wudsn.ide.hex.HexEditorSelection">
</instanceof>
</with>
</activeWhen>
</handler>
</extension>
<extension
name="HexEditorMenus"
point="org.eclipse.ui.menus">
<menuContribution
locationURI="popup:org.eclipse.ui.popup.any?before=group.openWith">
<command
commandId="com.wudsn.ide.hex.HexEditorOpenCommand"
id="com.wudsn.ide.hex.HexEditorOpenCommand"
style="push">
<visibleWhen
checkEnabled="false">
<or>
<with
variable="activeMenuSelection">
<iterate
ifEmpty="false"
operator="or">
<instanceof
value="org.eclipse.core.resources.IFile">
</instanceof>
</iterate>
</with>
<with
variable="activeMenuEditorInput">
<iterate
ifEmpty="false"
operator="or">
<instanceof
value="org.eclipse.ui.IFileEditorInput">
</instanceof>
</iterate>
</with>
</or>
</visibleWhen>
</command>
</menuContribution>
<menuContribution
locationURI="popup:#HexEditorContext">
<command
commandId="com.wudsn.ide.hex.HexEditorCopyToClipboardCommand"
disabledIcon="icons/copy-disabled.gif"
icon="icons/copy-enabled.gif"
id="com.wudsn.ide.hex.HexEditorCopyToClipboardCommand"
style="push">
</command>
<menu
label="%com.wudsn.ide.hex.HexEditorCopyToClipboardAsMenu.name">
<command
commandId="com.wudsn.ide.hex.HexEditorCopyToClipboardAsHexValuesCommand"
id="com.wudsn.ide.hex.HexEditorCopyToClipboardAsHexValuesCommand"
style="push">
</command>
<command
commandId="com.wudsn.ide.hex.HexEditorCopyToClipboardAsDecimalValuesCommand"
id="com.wudsn.ide.hex.HexEditorCopyToClipboardAsDecimalValuesCommand"
style="push">
</command>
<command
commandId="com.wudsn.ide.hex.HexEditorCopyToClipboardAsDecimalValuesBlockCommand"
id="com.wudsn.ide.hex.HexEditorCopyToClipboardAsDecimalValuesBlockCommand"
style="push">
</command>
<command
commandId="com.wudsn.ide.hex.HexEditorCopyToClipboardAsASCIIStringCommand"
id="com.wudsn.ide.hex.HexEditorCopyToClipboardAsASCIIStringCommand"
style="push">
</command>
</menu>
<command
commandId="com.wudsn.ide.hex.HexEditorPasteFromClipboardCommand"
icon="icons/paste-enabled.gif"
id="%com.wudsn.ide.hex.HexEditorPasteFromClipboardCommand.name"
label="%com.wudsn.ide.hex.HexEditorPasteFromClipboardCommand.name"
style="push">
</command>
<command
commandId="com.wudsn.ide.hex.HexEditorSaveSelectionAsCommand"
disabledIcon="icons/save-as-disabled.gif"
icon="icons/save-as-enabled.gif"
label="%com.wudsn.ide.hex.HexEditorSaveSelectionAsCommand.name"
style="push">
</command>
</menuContribution>
</extension>
<extension
name="HexEditor"
point="org.eclipse.ui.editors">
<editor
class="com.wudsn.ide.hex.HexEditor"
default="true"
icon="icons/hex-editor-16x16.gif"
id="com.wudsn.ide.hex.HexEditor"
name="%com.wudsn.ide.hex.HexEditor.name">
</editor>
</extension>
</plugin>

View File

@ -0,0 +1,21 @@
com.wudsn.ide.hex.HexEditor.name=Hex Editor
com.wudsn.ide.hex.HexEditorOpenCommand.name=Öffnen mit Hex Editor
com.wudsn.ide.hex.HexEditorCopyToClipboardCommand.name=Kopieren
com.wudsn.ide.hex.HexEditorCopyToClipboardAsMenu.name=Kopieren als
com.wudsn.ide.hex.HexEditorCopyToClipboardAsDecimalValuesCommand.name=Kopieren als dezimale Werte
com.wudsn.ide.hex.HexEditorCopyToClipboardAsDecimalValuesBlockCommand.name=Kopieren als dezimale Werte im Blocksatz
com.wudsn.ide.hex.HexEditorCopyToClipboardAsHexValuesCommand.name=Kopieren als hexadezimale Werte
com.wudsn.ide.hex.HexEditorCopyToClipboardAsASCIIStringCommand.name=Kopieren als ASCII Text
com.wudsn.ide.hex.HexEditorPasteFromClipboardCommand.name=Einfügen
com.wudsn.ide.hex.HexEditorSaveSelectionAsCommand.name=Auswahl Speichern unter...
com.wudsn.ide.hex.HexEditorFileContentMode.BINARY=Binär
com.wudsn.ide.hex.HexEditorFileContentMode.ATARI_COM_FILE=Atari COM-Datei
com.wudsn.ide.hex.HexEditorFileContentMode.ATARI_DISK_IMAGE=Atari Disk Image
com.wudsn.ide.hex.HexEditorFileContentMode.ATARI_DISK_IMAGE_K_FILE=Atari Disk Image (k-Datei)
com.wudsn.ide.hex.HexEditorFileContentMode.ATARI_MADS_FILE=Atari MADS-Datei
com.wudsn.ide.hex.HexEditorFileContentMode.ATARI_SAP_FILE=Atari SAP-Datei
com.wudsn.ide.hex.HexEditorFileContentMode.ATARI_SDX_FILE=Atari SpartaDOS X-Datei
com.wudsn.ide.hex.HexEditorFileContentMode.C64_PRG_FILE=C64 PRG-Datei
com.wudsn.ide.hex.HexEditorFileContentMode.IFF_FILE=IFF-Datei

View File

@ -0,0 +1,47 @@
package com.wudsn.ide.hex;
public interface FileContent {
/**
* Gets the length of the file content.
*
* @return The length of the file content, a non-negative integer.
*/
public int getLength();
/**
* Gets a byte (8 bit) from the file content.
*
* @param offset
* The offset, a non-negative integer.
* @return The byte from the file content.
*/
public int getByte(long offset);
/**
* Gets a word (16 bit) in little endian format from the file content.
*
* @param offset
* The offset, a non-negative integer.
* @return The word from the file content.
*/
public int getWord(long offset);
/**
* Gets a word (16 bit) in big endian format from the file content.
*
* @param offset
* The offset, a non-negative integer.
* @return The word from the file content.
*/
public int getWordBigEndian(long offset);
/**
* Gets a double word (32 bit) in big endian format from the file content.
*
* @param offset
* The offset, a non-negative integer.
* @return The word from the file content.
*/
public long getDoubleWordBigEndian(long offset);
}

View File

@ -0,0 +1,78 @@
package com.wudsn.ide.hex;
public class FileContentImpl implements FileContent{
private byte[] fileContent;
public FileContentImpl(byte[] fileContent) {
if (fileContent == null) {
throw new IllegalArgumentException("Parameter 'fileContent' must not be null.");
}
this.fileContent = fileContent;
}
/**
* Gets the length of the file content.
*
* @return The length of the file content, a non-negative integer.
*/
@Override
public int getLength() {
return fileContent.length;
}
/**
* Gets a byte (8 bit) from the file content.
*
* @param offset
* The offset, a non-negative integer.
* @return The byte from the file content.
*/
@Override
public int getByte(long offset) {
if (offset < 0) {
throw new IllegalArgumentException("Parameter offset=" + offset + " must not be negative");
}
if (offset >= fileContent.length) {
throw new IllegalArgumentException(
"Parameter offset=" + offset + " must be less than the file content size " + fileContent.length);
}
return fileContent[(int) offset] & 0xff;
}
/**
* Gets a word (16 bit) in little endian format from the file content.
*
* @param offset
* The offset, a non-negative integer.
* @return The word from the file content.
*/
@Override
public int getWord(long offset) {
return getByte(offset) + 0x100 * getByte(offset + 1);
}
/**
* Gets a word (16 bit) in big endian format from the file content.
*
* @param offset
* The offset, a non-negative integer.
* @return The word from the file content.
*/
@Override
public int getWordBigEndian(long offset) {
return getByte(offset + 1) + 0x100 * getByte(offset);
}
/**
* Gets a double word (32 bit) in big endian format from the file content.
*
* @param offset
* The offset, a non-negative integer.
* @return The word from the file content.
*/
@Override
public long getDoubleWordBigEndian(long offset) {
return getWordBigEndian(offset + 2) + 0x10000 * getWordBigEndian(offset);
}
}

View File

@ -17,7 +17,7 @@
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex;
package com.wudsn.ide.hex;
import java.io.File;
import java.util.Iterator;
@ -26,7 +26,6 @@ import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
@ -54,7 +53,6 @@ import org.eclipse.ui.part.EditorPart;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
import com.wudsn.ide.base.BasePlugin;
import com.wudsn.ide.base.Texts;
import com.wudsn.ide.base.common.ByteArrayUtility;
import com.wudsn.ide.base.common.FileUtility;
import com.wudsn.ide.base.common.HexUtility;
@ -68,6 +66,7 @@ import com.wudsn.ide.base.gui.IntegerField;
import com.wudsn.ide.base.gui.MessageManager;
import com.wudsn.ide.base.gui.SWTFactory;
import com.wudsn.ide.base.gui.TextField;
import com.wudsn.ide.base.hardware.HardwareCharacterSet;
/**
* The Hex Editor. This editor offset and outline view for the block of the file
@ -108,7 +107,7 @@ public final class HexEditor extends EditorPart implements ISelectionProvider, A
public static final int BYTES_PER_ROW_CHANGED = 1002;
}
public static final String ID = "com.wudsn.ide.base.editor.hex.HexEditor";
public static final String ID = "com.wudsn.ide.hex.HexEditor";
private static final String CONTEXT_MENU_ID = "#HexEditorContext";
private static final long MAX_FILE_SIZE = 8 * ByteArrayUtility.MB;
@ -122,10 +121,12 @@ public final class HexEditor extends EditorPart implements ISelectionProvider, A
// Editor header area.
private TextField fileContentSizeField;
private EnumField<HexEditorFileContentMode> fileContentModeField;
private EnumField<HexEditorCharacterSet> characterSetField;
private EnumField<HardwareCharacterSet> characterSetField;
private IntegerField bytesPerRowField;
private StyledText textField;
private Point lastTextFieldSelection;
private HexEditorSelection lastEditorSelection;
// File source.
private IFile iFile;
@ -217,8 +218,8 @@ public final class HexEditor extends EditorPart implements ISelectionProvider, A
messageManager.registerField(fileContentModeField, MessageIds.FILE_CONTENT_MODE);
fileContentModeField.addSelectionAction(new Action(Actions.FILE_CONTENT_MODE_CHANGED, this));
characterSetField = new EnumField<HexEditorCharacterSet>(header,
Texts.HEX_EDITOR_CHARACTER_SET_TYPE_FIELD_LABEL + LABEL_SUFFIX, HexEditorCharacterSet.class, null);
characterSetField = new EnumField<HardwareCharacterSet>(header,
Texts.HEX_EDITOR_CHARACTER_SET_TYPE_FIELD_LABEL + LABEL_SUFFIX, HardwareCharacterSet.class, null);
characterSetField.getLabel().setAlignment(SWT.RIGHT);
messageManager.registerField(characterSetField, MessageIds.CHARACTER_SET);
characterSetField.addSelectionAction(new Action(Actions.CHARACTER_SET_TYPE_CHANGED, this));
@ -339,8 +340,7 @@ public final class HexEditor extends EditorPart implements ISelectionProvider, A
// character set.
parserComponent.setFileContent(fileContent);
HexEditorFileContentMode defaultFileContentMode = parserComponent.determinePossibleFileContentModes();
HexEditorCharacterSet defaultCharacterSet = HexEditorCharacterSet
.getDefaultCharacterSet(defaultFileContentMode);
HardwareCharacterSet defaultCharacterSet = defaultFileContentMode.getDefaultCharacterSet();
parserComponent.setFileContentMode(defaultFileContentMode);
parserComponent.setCharacterSet(defaultCharacterSet);
@ -365,18 +365,24 @@ public final class HexEditor extends EditorPart implements ISelectionProvider, A
@Override
public HexEditorSelection getSelection() {
Point selection = textField.getSelection();
Point textFieldSelection = textField.getSelection();
String selectedText = textField.getText().substring(textFieldSelection.x, textFieldSelection.y);
// if (selection.x == selection.y) {
// return null;
// }
if (textFieldSelection.x == textFieldSelection.y) {
return null;
}
// BasePlugin.getInstance().log(
// "HexEditor selection.x={0} selection.y={1}",
// new Object[] { String.valueOf(selection.x),
// String.valueOf(selection.y) });
// if (textFieldSelection.equals(lastTextFieldSelection) && lastEditorSelection != null) {
// return lastEditorSelection;
// }
return parserComponent.getSelection(selection.x, selection.y);
BasePlugin.getInstance().log("HexEditor selectedText=\"{0}\", selection.x={1}, selection.y={2}", new Object[] {
selectedText, String.valueOf(textFieldSelection.x), String.valueOf(textFieldSelection.y) });
lastTextFieldSelection = textFieldSelection;
lastEditorSelection = parserComponent.getSelection(textFieldSelection.x, textFieldSelection.y);
return lastEditorSelection;
}
@Override
@ -419,6 +425,9 @@ public final class HexEditor extends EditorPart implements ISelectionProvider, A
// Mark complete selection area. This also scrolls to
// the end of the area.
textField.setSelection(new Point((int) textStartOffset, (int) textEndOffset));
lastTextFieldSelection = null;
lastEditorSelection = null;
//
// // But we want to see start of the selection are, so
// // position explicitly.
@ -499,16 +508,17 @@ public final class HexEditor extends EditorPart implements ISelectionProvider, A
private void dataToUi() {
// File content size.
FileContent fileContent = parserComponent.getFileContent();
long length = fileContent.getLength();
String text = TextUtility.format(Texts.HEX_EDITOR_FILE_CONTENT_SIZE_FIELD_TEXT,
HexUtility.getLongValueHexString(parserComponent.getFileContent().length),
NumberUtility.getLongValueDecimalString(parserComponent.getFileContent().length));
HexUtility.getLongValueHexString(length), NumberUtility.getLongValueDecimalString(length));
fileContentSizeField.setValue(text);
// File content mode.
fileContentModeField.setValue(parserComponent.getFileContentMode());
// Character set.
HexEditorCharacterSet characterSet = parserComponent.getCharacterSet();
HardwareCharacterSet characterSet = parserComponent.getCharacterSet();
characterSetField.setValue(characterSet);
if (!textField.getFont().equals(characterSet.getFont())) {
textField.setFont(characterSet.getFont());
@ -520,6 +530,8 @@ public final class HexEditor extends EditorPart implements ISelectionProvider, A
if (parserComponent.isParsingFileContentRequired()) {
StyledString styledString = parserComponent.parseFileContent();
textField.setText(styledString.getString());
lastTextFieldSelection = null;
lastEditorSelection = null;
textField.setStyleRanges(styledString.getStyleRanges());
if (contentOutlinePage != null) {
@ -572,40 +584,48 @@ public final class HexEditor extends EditorPart implements ISelectionProvider, A
throw new IllegalArgumentException("Parameter 'bytes' must not be null.");
}
HexEditorSelection selection = getSelection();
byte[] newFileContent;
// If there is no end offset, we insert the new bytes.
if (selection.getEndOffset() != HexEditorParserComponent.UNDEFINED_OFFSET) {
int selectionStartOffset = (int) selection.getStartOffset();
int selectionEndOffset = (int) selection.getEndOffset();
int selectionLength = selectionEndOffset - selectionStartOffset + 1;
int newFileContentLength = parserComponent.getFileContent().length - selectionLength + bytes.length;
newFileContent = new byte[newFileContentLength];
System.arraycopy(parserComponent.getFileContent(), 0, newFileContent, 0, selectionStartOffset);
System.arraycopy(bytes, 0, newFileContent, selectionStartOffset, bytes.length);
int length = parserComponent.getFileContent().length - selectionEndOffset - 1;
if (length > 0) {
// TODO Hex paste is not working yet
System.arraycopy(parserComponent.getFileContent(), selectionEndOffset, newFileContent,
selectionStartOffset + bytes.length, length);
}
messageManager.sendMessage(0, IStatus.OK,
"${0} ({1}) bytes pasted from clipboard to replace ${2} ({3}) bytes ",
HexUtility.getLongValueHexString(bytes.length),
NumberUtility.getLongValueDecimalString(bytes.length),
HexUtility.getLongValueHexString(selectionLength),
NumberUtility.getLongValueDecimalString(selectionLength));
} else {
// If there is an end offset, we replace the selection with the new
// bytes.
newFileContent = parserComponent.getFileContent();
messageManager.sendMessage(0, IStatus.OK, "${0} ({1}) bytes inserted from clipboard",
HexUtility.getLongValueHexString(bytes.length),
NumberUtility.getLongValueDecimalString(bytes.length));
}
parserComponent.setFileContent(newFileContent);
// byte[] newFileContent;
//
// // If there is no end offset, we insert the new bytes.
// if (selection.getEndOffset() !=
// HexEditorParserComponent.UNDEFINED_OFFSET) {
// int selectionStartOffset = (int) selection.getStartOffset();
// int selectionEndOffset = (int) selection.getEndOffset();
//
// int selectionLength = selectionEndOffset - selectionStartOffset + 1;
// int newFileContentLength = parserComponent.getFileContent().length -
// selectionLength + bytes.length;
// newFileContent = new byte[newFileContentLength];
// System.arraycopy(parserComponent.getFileContent(), 0, newFileContent,
// 0, selectionStartOffset);
// System.arraycopy(bytes, 0, newFileContent, selectionStartOffset,
// bytes.length);
// int length = parserComponent.getFileContent().length -
// selectionEndOffset - 1;
// if (length > 0) {
// // TODO Hex paste is not working yet
// System.arraycopy(parserComponent.getFileContent(),
// selectionEndOffset, newFileContent,
// selectionStartOffset + bytes.length, length);
// }
// messageManager.sendMessage(0, IStatus.OK,
// "${0} ({1}) bytes pasted from clipboard to replace ${2} ({3}) bytes
// ",
// HexUtility.getLongValueHexString(bytes.length),
// NumberUtility.getLongValueDecimalString(bytes.length),
// HexUtility.getLongValueHexString(selectionLength),
// NumberUtility.getLongValueDecimalString(selectionLength));
// } else {
// // If there is an end offset, we replace the selection with the new
// // bytes.
// newFileContent = parserComponent.getFileContent();
// messageManager.sendMessage(0, IStatus.OK, "${0} ({1}) bytes inserted
// from clipboard",
// HexUtility.getLongValueHexString(bytes.length),
// NumberUtility.getLongValueDecimalString(bytes.length));
// }
//
// parserComponent.setFileContent(newFileContent);
dataToUi();
}

View File

@ -17,7 +17,7 @@
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex;
package com.wudsn.ide.hex;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IStatus;
@ -27,7 +27,7 @@ import org.eclipse.swt.dnd.Transfer;
import org.eclipse.ui.IWorkbenchSite;
import org.eclipse.ui.handlers.HandlerUtil;
import com.wudsn.ide.base.Texts;
import com.wudsn.ide.hex.Texts;
import com.wudsn.ide.base.common.HexUtility;
import com.wudsn.ide.base.common.NumberUtility;
@ -43,12 +43,12 @@ public final class HexEditorClipboardCommandHandler extends HexEditorSelectionCo
private CommandIds() {
}
public static final String COPY = "com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardCommand";
public static final String COPY_AS_HEX_VALUES = "com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsHexValuesCommand";
public static final String COPY_AS_DECIMAL_VALUES = "com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsDecimalValuesCommand";
public static final String COPY_AS_DECIMAL_VALUES_BLOCK = "com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsDecimalValuesBlockCommand";
public static final String COPY_AS_ASCII_STRING = "com.wudsn.ide.base.editor.hex.HexEditorCopyToClipboardAsASCIIStringCommand";
public static final String PASTE = "com.wudsn.ide.base.editor.hex.HexEditorPasteFromClipboardCommand";
public static final String COPY = "com.wudsn.ide.hex.HexEditorCopyToClipboardCommand";
public static final String COPY_AS_HEX_VALUES = "com.wudsn.ide.hex.HexEditorCopyToClipboardAsHexValuesCommand";
public static final String COPY_AS_DECIMAL_VALUES = "com.wudsn.ide.hex.HexEditorCopyToClipboardAsDecimalValuesCommand";
public static final String COPY_AS_DECIMAL_VALUES_BLOCK = "com.wudsn.ide.hex.HexEditorCopyToClipboardAsDecimalValuesBlockCommand";
public static final String COPY_AS_ASCII_STRING = "com.wudsn.ide.hex.HexEditorCopyToClipboardAsASCIIStringCommand";
public static final String PASTE = "com.wudsn.ide.hex.HexEditorPasteFromClipboardCommand";
}
/**
@ -77,8 +77,8 @@ public final class HexEditorClipboardCommandHandler extends HexEditorSelectionCo
} else if ((commandId.equals(CommandIds.COPY_AS_HEX_VALUES)
|| commandId.equals(CommandIds.COPY_AS_DECIMAL_VALUES)
|| commandId.equals(CommandIds.COPY_AS_DECIMAL_VALUES_BLOCK) || commandId
.equals(CommandIds.COPY_AS_ASCII_STRING)) && !hexEditorSelection.isEmpty()) {
|| commandId.equals(CommandIds.COPY_AS_DECIMAL_VALUES_BLOCK)
|| commandId.equals(CommandIds.COPY_AS_ASCII_STRING)) && !hexEditorSelection.isEmpty()) {
if (commandId.equals(CommandIds.COPY_AS_HEX_VALUES)) {
builder.append(".byte ");
for (int i = 0; i < bytes.length; i++) {

View File

@ -17,15 +17,13 @@
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex;
package com.wudsn.ide.hex;
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.StyledString;
import org.eclipse.swt.graphics.Image;
import com.wudsn.ide.base.BasePlugin;
/**
* Label provider for the tree objects in the outline page.
*
@ -65,8 +63,8 @@ final class HexEditorContentOutlineLabelProvider extends DelegatingStyledCellLab
*/
HexEditorContentOutlineLabelProvider() {
super(new HexEditorStyledLabelProvider());
BasePlugin plugin;
plugin = BasePlugin.getInstance();
HexPlugin plugin;
plugin = HexPlugin.getInstance();
segmentImage = plugin.getImage("hex-editor-segment-16x16.gif");
}

View File

@ -17,7 +17,7 @@
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex;
package com.wudsn.ide.hex;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.AbstractTreeViewer;

View File

@ -17,7 +17,7 @@
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex;
package com.wudsn.ide.hex;
import java.util.List;

View File

@ -17,7 +17,7 @@
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex;
package com.wudsn.ide.hex;
import org.eclipse.jface.viewers.StyledString;

View File

@ -17,9 +17,11 @@
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex;
package com.wudsn.ide.hex;
import com.wudsn.ide.base.editor.hex.parser.*;
import com.wudsn.ide.base.hardware.Hardware;
import com.wudsn.ide.base.hardware.HardwareCharacterSet;
import com.wudsn.ide.hex.parser.*;
enum HexEditorFileContentMode {
@ -51,6 +53,23 @@ enum HexEditorFileContentMode {
return hardware;
}
/**
* Determines the default character set for a given file content mode.
*
* @return The default character set, not <code>null</code>.
*/
public HardwareCharacterSet getDefaultCharacterSet() {
switch (hardware) {
case ATARI8BIT:
return HardwareCharacterSet.ATARI_ATASCII;
case C64:
return HardwareCharacterSet.CBM_PETSCII_UPPER_CASE;
default:
return HardwareCharacterSet.ASCII;
}
}
public HexEditorParser createParser() {
try {
return parserClass.newInstance();

View File

@ -17,7 +17,7 @@
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex;
package com.wudsn.ide.hex;
import com.wudsn.ide.base.editor.CommonOpenEditorCommandHandler;

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex;
package com.wudsn.ide.hex;
import org.eclipse.jface.viewers.StyledString;
import org.eclipse.jface.viewers.StyledString.Styler;
@ -31,6 +31,7 @@ public abstract class HexEditorParser {
private HexEditorParserComponent owner;
protected Styler offsetStyler;
protected Styler addressStyler;
protected FileContent fileContent;
/**
* Creation is protected.
@ -62,6 +63,7 @@ public abstract class HexEditorParser {
this.owner = owner;
this.offsetStyler = offsetStyler;
this.addressStyler = addressStyler;
this.fileContent = owner.getFileContent();
}
/**
@ -73,48 +75,6 @@ public abstract class HexEditorParser {
*/
public abstract boolean parse(StyledString contentBuilder);
/**
* Gets the length of the file content.
*
* @return The length of the file content, a non-negative integer.
*/
protected final int getFileContentLength() {
return owner.getFileContent().length;
}
/**
* Gets a byte (8-bit) from the file content.
*
* @param offset
* The offset, a non-negative integer.
* @return The byte from the file content.
*/
protected final int getFileContentByte(long offset) {
return owner.getFileContentByte(offset);
}
/**
* Gets a word (16 bit) in little endian format from the file content.
*
* @param offset
* The offset, a non-negative integer.
* @return The word from the file content.
*/
protected final int getFileContentWord(long offset) {
return owner.getFileContentWord(offset);
}
/**
* Gets a double word (32 bit) in big endian format from the file content.
*
* @param offset
* The offset, a non-negative integer.
* @return The word from the file content.
*/
protected final long getFileContentDoubleWordBigEndian(long offset) {
return owner.getFileContentDoubleWordBigEndian(offset);
}
/**
* Prints a block header in the context area and adds a block to the
* outline.

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex;
package com.wudsn.ide.hex;
import java.util.ArrayList;
import java.util.Arrays;
@ -28,24 +28,24 @@ import org.eclipse.jface.viewers.StyledString;
import org.eclipse.jface.viewers.StyledString.Styler;
import org.eclipse.swt.graphics.TextStyle;
import com.wudsn.ide.base.Texts;
import com.wudsn.ide.base.BasePlugin;
import com.wudsn.ide.base.common.EnumUtility;
import com.wudsn.ide.base.common.HexUtility;
import com.wudsn.ide.base.common.NumberUtility;
import com.wudsn.ide.base.common.Profiler;
import com.wudsn.ide.base.common.TextUtility;
import com.wudsn.ide.base.editor.hex.HexEditor.MessageIds;
import com.wudsn.ide.base.editor.hex.parser.AtariDiskImageKFileParser;
import com.wudsn.ide.base.editor.hex.parser.AtariMADSParser;
import com.wudsn.ide.base.editor.hex.parser.AtariParser;
import com.wudsn.ide.base.editor.hex.parser.AtariSDXParser;
import com.wudsn.ide.base.gui.MessageManager;
import com.wudsn.ide.base.hardware.HardwareCharacterSet;
import com.wudsn.ide.hex.HexEditor.MessageIds;
import com.wudsn.ide.hex.parser.AtariDiskImageKFileParser;
import com.wudsn.ide.hex.parser.AtariMADSParser;
import com.wudsn.ide.hex.parser.AtariParser;
import com.wudsn.ide.hex.parser.AtariSDXParser;
final class HexEditorParserComponent {
public static final long UNDEFINED_OFFSET = -1;
private final static int BYTES_PER_ROW = 16;
private static final int INT_FF = 0xff;
// Callback API.
private MessageManager messageManager;
@ -61,13 +61,13 @@ final class HexEditorParserComponent {
private HexEditorFileContentMode fileContentMode;
private byte[] fileContent;
private int bytesPerRow;
private HexEditorCharacterSet characterSet;
private HardwareCharacterSet characterSet;
// Previous state with regards to parsing.
private HexEditorFileContentMode oldFileContentMode;
private byte[] oldFileContent;
private int oldBytesPerRow;
private HexEditorCharacterSet oldCharacterSet;
private HardwareCharacterSet oldCharacterSet;
// Parsing state.
private List<HexEditorFileContentMode> possibleFileContentModes;
@ -105,7 +105,7 @@ final class HexEditorParserComponent {
// Initialize hex chars and normal character set type.
hexChars = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
characterSet = HexEditorCharacterSet.ASCII;
characterSet = HardwareCharacterSet.ASCII;
clear();
@ -116,7 +116,7 @@ final class HexEditorParserComponent {
fileContentParsed = false;
fileContentMode = HexEditorFileContentMode.BINARY;
setFileContent(new byte[0]);
characterSet = HexEditorCharacterSet.ASCII;
characterSet = HardwareCharacterSet.ASCII;
bytesPerRow = BYTES_PER_ROW;
oldFileContentMode = null;
@ -141,21 +141,13 @@ final class HexEditorParserComponent {
* offsets.
*/
private void initByteTextOffsets() {
// Twice the space, because some format display the content twice, for
// Twice the space, because some formats display the content twice, for
// example ATARI_DISK_IMAGE_K_FILE.
byteTextOffsets = new long[fileContent.length * 2];
Arrays.fill(byteTextOffsets, -1);
byteTextIndex = 0;
}
/**
* Gets the current file content.
*
* @return The file content, may be empty or <code>null</code>.
*/
public byte[] getFileContent() {
return fileContent;
}
/**
* Determines the possible file content modes based on the file content.
*
@ -168,19 +160,19 @@ final class HexEditorParserComponent {
possibleFileContentModes.add(fileContentMode);
HexEditorFileContentMode defaultMode = result;
FileContent fileContent = getFileContent();
// COM header present?
if (fileContent.length > 6) {
if (fileContent.getLength() > 6) {
// AtariDOS COM file?
if (getFileContentWord(0) == AtariParser.COM_HEADER) {
int startAddress = getFileContentWord(2);
int endAddress = getFileContentWord(4);
if (fileContent.getWord(0) == AtariParser.COM_HEADER) {
int startAddress = fileContent.getWord(2);
int endAddress = fileContent.getWord(4);
if (startAddress >= 0 && endAddress >= startAddress) {
defaultMode = HexEditorFileContentMode.ATARI_COM_FILE;
possibleFileContentModes.add(defaultMode);
if (fileContent.length > 16) {
if (getFileContentWord(6) == AtariMADSParser.RELOC_HEADER) {
if (fileContent.getLength() > 16) {
if (fileContent.getWord(6) == AtariMADSParser.RELOC_HEADER) {
defaultMode = HexEditorFileContentMode.ATARI_MADS_FILE;
possibleFileContentModes.add(defaultMode);
}
@ -191,9 +183,9 @@ final class HexEditorParserComponent {
}
}
} // SpartaDOS X non relocatable file?
else if (getFileContentWord(0) == AtariSDXParser.NON_RELOC_HEADER) {
int startAddress = getFileContentWord(2);
int endAddress = getFileContentWord(4);
else if (fileContent.getWord(0) == AtariSDXParser.NON_RELOC_HEADER) {
int startAddress = fileContent.getWord(2);
int endAddress = fileContent.getWord(4);
if (startAddress > 0 && endAddress >= startAddress) {
defaultMode = HexEditorFileContentMode.ATARI_SDX_FILE;
possibleFileContentModes.add(defaultMode);
@ -203,8 +195,8 @@ final class HexEditorParserComponent {
}
}
} // SpartaDOS X relocatable file?
else if (getFileContentWord(0) == AtariSDXParser.RELOC_HEADER && fileContent.length > 8) {
int blockNumber = getFileContentByte(2);
else if (fileContent.getWord(0) == AtariSDXParser.RELOC_HEADER && fileContent.getLength() > 8) {
int blockNumber = fileContent.getByte(2);
if (blockNumber > 0) {
defaultMode = HexEditorFileContentMode.ATARI_SDX_FILE;
possibleFileContentModes.add(defaultMode);
@ -217,17 +209,17 @@ final class HexEditorParserComponent {
}
// ATR header present?
if ((fileContent.length > 16 && getFileContentByte(0) == 0x96 && getFileContentByte(1) == 0x02)) {
if ((fileContent.getLength() > 16 && fileContent.getByte(0) == 0x96 && fileContent.getByte(1) == 0x02)) {
defaultMode = HexEditorFileContentMode.ATARI_DISK_IMAGE;
possibleFileContentModes.add(defaultMode);
// Special case of k-file (converted COM file)
int offset = AtariDiskImageKFileParser.ATARI_DISK_IMAGE_K_FILE_COM_FILE_OFFSET;
if (fileContent.length > offset + 2 && getFileContentWord(offset) == 0xffff) {
if (fileContent.getLength() > offset + 2 && fileContent.getWord(offset) == 0xffff) {
final int[] kFileBootHeader = new int[] { 0x00, 0x03, 0x00, 0x07, 0x14, 0x07, 0x4C, 0x14, 0x07 };
boolean kFileBootHeaderFound = true;
for (int i = 0; i < kFileBootHeader.length; i++) {
if (getFileContentByte(16 + i) != kFileBootHeader[i]) {
if (fileContent.getByte(16 + i) != kFileBootHeader[i]) {
kFileBootHeaderFound = false;
}
}
@ -244,8 +236,8 @@ final class HexEditorParserComponent {
}
// SAP header present?
if ((fileContent.length > 11 && getFileContentByte(0) == 0x53 && getFileContentByte(1) == 0x41)
&& getFileContentByte(2) == 0x50) {
if ((fileContent.getLength() > 11 && fileContent.getByte(0) == 0x53 && fileContent.getByte(1) == 0x41)
&& fileContent.getByte(2) == 0x50) {
possibleFileContentModes.add(HexEditorFileContentMode.ATARI_SAP_FILE);
// New default?
if (result.equals(HexEditorFileContentMode.BINARY)) {
@ -254,22 +246,22 @@ final class HexEditorParserComponent {
}
// PRG header present?
if ((fileContent.length > 2 && getFileContentWord(0) + getFileContent().length - 2 < 0x10000)) {
if ((fileContent.getLength() > 2 && fileContent.getWord(0) + fileContent.getLength() - 2 < 0x10000)) {
possibleFileContentModes.add(HexEditorFileContentMode.C64_PRG_FILE);
int loadAddress = getFileContentWord(0);
int loadAddress = fileContent.getWord(0);
if (result.equals(HexEditorFileContentMode.BINARY) && loadAddress >= 0x800 && loadAddress < 0x2000) {
result = HexEditorFileContentMode.C64_PRG_FILE;
}
}
// IFF files always have an even number of bytes
if (fileContent.length > 8 && (fileContent.length & 0x1) == 0) {
if (fileContent.getLength() > 8 && (fileContent.getLength() & 0x1) == 0) {
possibleFileContentModes.add(HexEditorFileContentMode.IFF_FILE);
char[] id = new char[4];
id[0] = (char) fileContent[0];
id[1] = (char) fileContent[1];
id[2] = (char) fileContent[2];
id[3] = (char) fileContent[3];
id[0] = (char) fileContent.getByte(0);
id[1] = (char) fileContent.getByte(1);
id[2] = (char) fileContent.getByte(2);
id[3] = (char) fileContent.getByte(3);
String chunk = String.copyValueOf(id);
boolean iff = chunk.equals("FORM") || chunk.equals("LIST") || chunk.equals("CAT ");
if (result.equals(HexEditorFileContentMode.BINARY) && iff) {
@ -307,7 +299,7 @@ final class HexEditorParserComponent {
* @param characterSet
* The character set type, not <code>null</code>.
*/
public void setCharacterSet(HexEditorCharacterSet characterSet) {
public void setCharacterSet(HardwareCharacterSet characterSet) {
if (characterSet == null) {
throw new IllegalArgumentException("Parameter 'characterSet' must not be null.");
}
@ -320,7 +312,7 @@ final class HexEditorParserComponent {
*
* @return characterSet The character set type, not <code>null</code>.
*/
public HexEditorCharacterSet getCharacterSet() {
public HardwareCharacterSet getCharacterSet() {
return characterSet;
}
@ -364,7 +356,7 @@ final class HexEditorParserComponent {
* to the parameters set with
* {@link #setFileContentMode(HexEditorFileContentMode)},
* {@link #setBytesPerRow(int)} and
* {@link #setCharacterSet(HexEditorCharacterSet)}.
* {@link #setCharacterSet(HardwareCharacterSet)}.
*
* @return The styles string representing the content.
*/
@ -430,54 +422,12 @@ final class HexEditorParserComponent {
}
/**
* Gets a byte (8 bit) from the file content.
* Gets the file content.
*
* @param offset
* The offset, a non-negative integer.
* @return The byte from the file content.
* @return The file content, not <code>null</code>.
*/
final int getFileContentByte(long offset) {
if (offset < 0) {
throw new IllegalArgumentException("Parameter offset=" + offset + " must not be negative");
}
if (offset >= fileContent.length) {
throw new IllegalArgumentException(
"Parameter offset=" + offset + " must be less than the file content size " + fileContent.length);
}
return fileContent[(int) offset] & INT_FF;
}
/**
* Gets a word (16 bit) in little endian format from the file content.
*
* @param offset
* The offset, a non-negative integer.
* @return The word from the file content.
*/
final int getFileContentWord(long offset) {
return getFileContentByte(offset) + 0x100 * getFileContentByte(offset + 1);
}
/**
* Gets a word (16 bit) in big endian format from the file content.
*
* @param offset
* The offset, a non-negative integer.
* @return The word from the file content.
*/
final int getFileContentWordBigEndian(long offset) {
return getFileContentByte(offset + 1) + 0x100 * getFileContentByte(offset);
}
/**
* Gets a double word (32 bit) in big endian format from the file content.
*
* @param offset
* The offset, a non-negative integer.
* @return The word from the file content.
*/
final long getFileContentDoubleWordBigEndian(long offset) {
return getFileContentWordBigEndian(offset + 2) + 0x10000 * getFileContentWordBigEndian(offset);
final FileContent getFileContent() {
return new FileContentImpl(fileContent); // TODO Do not create newly
}
/**
@ -587,7 +537,7 @@ final class HexEditorParserComponent {
lowChar = ' ';
charValue = ' ';
} else {
int byteValue = getFileContentByte(offset);
int byteValue = getFileContent().getByte(offset);
highChar = hexChars[byteValue >> 4];
lowChar = hexChars[byteValue & 0xf];
charValue = characterMapping[byteValue];
@ -631,56 +581,72 @@ final class HexEditorParserComponent {
*/
public HexEditorSelection getSelection(int x, int y) {
if (x > y) {
throw new IllegalArgumentException("x is greater than y");
}
long startOffset = UNDEFINED_OFFSET;
long endOffset = UNDEFINED_OFFSET;
long textOffset = 0;
for (int i = 0; i < byteTextIndex && (startOffset == UNDEFINED_OFFSET || endOffset == UNDEFINED_OFFSET); i++) {
long nextTextOffset;
if (i < byteTextIndex - 1) {
nextTextOffset = byteTextOffsets[i + 1];
} else {
nextTextOffset = Integer.MAX_VALUE;
}
if (startOffset == UNDEFINED_OFFSET && textOffset - 1 <= x && x < nextTextOffset - 1) {
for (long i = 0; i < byteTextIndex; i++) {
// BasePlugin.getInstance().log(
// "HexEditor.getSelection(): i={0} textOffset={1}
// nextTextOffset={2} startOffset={3} endOffset={4}",
// new Object[] { String.valueOf(i), String.valueOf(textOffset),
// String.valueOf(nextTextOffset),
// String.valueOf(startOffset), String.valueOf(endOffset) });
if (getByteTextOffset(i) >= x) {
startOffset = i;
break;
}
if (startOffset != UNDEFINED_OFFSET && endOffset == UNDEFINED_OFFSET && textOffset < y
&& y <= nextTextOffset) {
endOffset = i;
}
textOffset = nextTextOffset;
}
if (startOffset == UNDEFINED_OFFSET) {
return null;
}
long endOffset = UNDEFINED_OFFSET;
for (long i = startOffset; i < byteTextIndex; i++) {
// BasePlugin.getInstance().log(
// "HexEditor.getSelection(): i={0} textOffset={1}
// nextTextOffset={2} startOffset={3} endOffset={4}",
// new Object[] { String.valueOf(i), String.valueOf(textOffset),
// String.valueOf(nextTextOffset),
// String.valueOf(startOffset), String.valueOf(endOffset) });
if (getByteTextOffset(i) >= y ) {
endOffset = i;
break;
}
}
if (endOffset == UNDEFINED_OFFSET) {
return null;
}
long length;
byte[] bytes;
length = endOffset - startOffset + 1;
// BasePlugin.getInstance().log("HexEditor.getSelection():
// startOffset={0} endoffset={1} length={2}",
// new Object[] { String.valueOf(startOffset),
// String.valueOf(endOffset), String.valueOf(length) });
BasePlugin.getInstance().log("HexEditor.getSelection(): startOffset={2} endoffset={3} length={4}",
new Object[] { String.valueOf(x), String.valueOf(y), String.valueOf(startOffset),
String.valueOf(endOffset), String.valueOf(length) });
// Length not empty and selection does not cross file end boundary.
if (length > 0 && length < Integer.MAX_VALUE && startOffset < fileContent.length
&& endOffset < fileContent.length) {
// Length not empty or negative?
if (length > 0 && length < fileContent.length) {
// Reposition into first occurrence of in the file.
// This is relevant for the format that display the content more
// than once.
bytes = new byte[(int) length];
// startOffset = startOffset % fileContent.length;
// endOffset = endOffset % fileContent.length;
// length = endOffset - startOffset + 1;
System.arraycopy(fileContent, (int) startOffset, bytes, 0, bytes.length);
startOffset = startOffset % fileContent.length;
endOffset = endOffset % fileContent.length;
// Selection does not cross file end boundary?
if (startOffset <= endOffset) {
bytes = new byte[(int) length];
System.arraycopy(fileContent, (int) startOffset, bytes, 0, bytes.length);
// BasePlugin.getInstance().log(
// "HexEditor startOffset={0} endoffset={1} length={2}",
// new Object[] { String.valueOf(startOffset),
// String.valueOf(endOffset), String.valueOf(length) });
} else {
endOffset = startOffset;
bytes = new byte[0];
}
} else {
endOffset = startOffset;
bytes = new byte[0];
@ -694,14 +660,14 @@ final class HexEditorParserComponent {
*
* @param byteOffset
* The byte offset in the original byte array.
* @return The text offset where the byte is represented or <code>-1</code>
* if there is no such text offset.
* @return The text offset where the byte is represented or
* <code>UNDEFINED_OFFSET</code> if there is no such text offset.
*/
public long getByteTextOffset(long byteOffset) {
if (byteOffset < byteTextOffsets.length) {
return byteTextOffsets[(int) byteOffset];
}
return -1;
return UNDEFINED_OFFSET;
}
}

View File

@ -17,7 +17,7 @@
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex;
package com.wudsn.ide.hex;
import java.io.File;
@ -29,7 +29,6 @@ import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.handlers.HandlerUtil;
import com.wudsn.ide.base.Texts;
import com.wudsn.ide.base.common.FileUtility;
import com.wudsn.ide.base.common.HexUtility;
import com.wudsn.ide.base.common.NumberUtility;
@ -42,7 +41,7 @@ public final class HexEditorSaveSelectionAsCommandHandler extends HexEditorSelec
private CommandIds() {
}
public static final String SAVE_SELECTION_AS = "com.wudsn.ide.base.editor.hex.HexEditorSaveSelectionAsCommand";
public static final String SAVE_SELECTION_AS = "com.wudsn.ide.hex.HexEditorSaveSelectionAsCommand";
}
@Override
@ -58,8 +57,8 @@ public final class HexEditorSaveSelectionAsCommandHandler extends HexEditorSelec
int length = content.length;
String hexLength = HexUtility.getLongValueHexString(length);
String decimalLength = NumberUtility.getLongValueDecimalString(length);
dialog.setText(TextUtility
.format(Texts.HEX_EDITOR_SAVE_SELECTION_AS_DIALOG_TITLE, hexLength, decimalLength));
dialog.setText(
TextUtility.format(Texts.HEX_EDITOR_SAVE_SELECTION_AS_DIALOG_TITLE, hexLength, decimalLength));
dialog.setFileName(hexEditor.getSelectionSaveFilePath());
String filePath = dialog.open();
if (filePath != null) {

View File

@ -17,7 +17,7 @@
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex;
package com.wudsn.ide.hex;
import org.eclipse.jface.viewers.ISelection;

View File

@ -17,7 +17,7 @@
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex;
package com.wudsn.ide.hex;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;

View File

@ -1,4 +1,4 @@
package com.wudsn.ide.base.editor.hex;
package com.wudsn.ide.hex;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;

View File

@ -1,15 +1,16 @@
package com.wudsn.ide.hex;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
import com.wudsn.ide.base.common.AbstractIDEPlugin;
/**
* The activator class controls the plug-in life cycle
*/
public class HexPlugin extends AbstractUIPlugin {
public class HexPlugin extends AbstractIDEPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "com.wudsn.ide.hex"; //$NON-NLS-1$
public static final String ID = "com.wudsn.ide.hex"; //$NON-NLS-1$
// The shared instance
private static HexPlugin plugin;
@ -20,12 +21,16 @@ public class HexPlugin extends AbstractUIPlugin {
public HexPlugin() {
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
* )
/**
* {@inheritDoc}
*/
@Override
protected String getPluginId() {
return ID;
}
/**
* {@inheritDoc}
*/
@Override
public void start(BundleContext context) throws Exception {
@ -33,12 +38,8 @@ public class HexPlugin extends AbstractUIPlugin {
plugin = this;
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
* )
/**
* {@inheritDoc}
*/
@Override
public void stop(BundleContext context) throws Exception {
@ -47,11 +48,14 @@ public class HexPlugin extends AbstractUIPlugin {
}
/**
* Returns the shared instance
* Gets the shared plugin instance
*
* @return the shared instance
* @return The plug-in, not <code>null</code>.
*/
public static HexPlugin getInstance() {
if (plugin == null) {
throw new IllegalStateException("Plugin not initialized or already stopped");
}
return plugin;
}

View File

@ -0,0 +1,92 @@
/**
* Copyright (C) 2009 - 2019 <a href="https://www.wudsn.com" target="_top">Peter Dell</a>
*
* This file is part of WUDSN IDE.
*
* WUDSN IDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* WUDSN IDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.hex;
import org.eclipse.osgi.util.NLS;
/**
* Class which holds the localized text constants.
*
* @author Peter Dell
*/
public final class Texts extends NLS {
/**
* Hex editor
*/
public static String HEX_EDITOR_FILE_SIZE;
public static String HEX_EDITOR_ATARI_COM_BLOCK_HEADER;
public static String HEX_EDITOR_ATARI_COM_BLOCK_HEADER_PARAMETERS;
public static String HEX_EDITOR_ATARI_COM_BLOCK_ERROR;
public static String HEX_EDITOR_ATARI_DISK_IMAGE_HEADER;
public static String HEX_EDITOR_ATARI_SECTOR_HEADER;
public static String HEX_EDITOR_ATARI_SECTOR_HEADER_PARAMETERS;
public static String HEX_EDITOR_ATARI_SECTOR_ERROR;
public static String HEX_EDITOR_ATARI_MADS_RELOC_BLOCK_HEADER;
public static String HEX_EDITOR_ATARI_MADS_UPDATE_RELOC_BLOCK_HEADER;
public static String HEX_EDITOR_ATARI_MADS_UPDATE_SYMBOLS_BLOCK_HEADER;
public static String HEX_EDITOR_ATARI_MADS_DEFINE_SYMBOLS_BLOCK_HEADER;
public static String HEX_EDITOR_ATARI_MADS_DEFINE_SYMBOL_HEADER;
public static String HEX_EDITOR_ATARI_MADS_BLOCK_ERROR;
public static String HEX_EDITOR_ATARI_SAP_FILE_HEADER;
public static String HEX_EDITOR_ATARI_SDX_NON_RELOC_BLOCK_HEADER;
public static String HEX_EDITOR_ATARI_SDX_NON_RELOC_BLOCK_HEADER_PARAMETERS;
public static String HEX_EDITOR_ATARI_SDX_RELOC_BLOCK_HEADER;
public static String HEX_EDITOR_ATARI_SDX_UPDATE_RELOC_BLOCK_HEADER;
public static String HEX_EDITOR_ATARI_SDX_UPDATE_SYMBOLS_BLOCK_HEADER;
public static String HEX_EDITOR_ATARI_SDX_DEFINE_SYMBOLS_BLOCK_HEADER;
public static String HEX_EDITOR_ATARI_SDX_BLOCK_ERROR;
public static String HEX_EDITOR_C64_PRG_HEADER;
public static String HEX_EDITOR_C64_PRG_HEADER_PARAMETERS;
public static String HEX_EDITOR_C64_PRG_ERROR;
public static String HEX_EDITOR_IFF_CHUNK;
public static String HEX_EDITOR_IFF_FORM_CHUNK;
public static String HEX_EDITOR_IFF_FILE_ERROR;
public static String HEX_EDITOR_FILE_CONTENT_SIZE_FIELD_LABEL;
public static String HEX_EDITOR_FILE_CONTENT_SIZE_FIELD_TEXT;
public static String HEX_EDITOR_FILE_CONTENT_MODE_FIELD_LABEL;
public static String HEX_EDITOR_CHARACTER_SET_TYPE_FIELD_LABEL;
public static String HEX_EDITOR_BYTES_PER_ROW_FIELD_LABEL;
public static String HEX_EDITOR_SAVE_SELECTION_AS_DIALOG_TITLE;
/**
* Message for the {@link HexEditor}
*/
public static String MESSAGE_E300;
public static String MESSAGE_E301;
public static String MESSAGE_I302;
public static String MESSAGE_I303;
/**
* Initializes the constants.
*/
static {
NLS.initializeMessages(Texts.class.getName(), Texts.class);
}
}

View File

@ -0,0 +1,48 @@
HEX_EDITOR_FILE_SIZE=File contains ${0} ({1}) bytes.
HEX_EDITOR_ATARI_COM_BLOCK_HEADER=COM block
HEX_EDITOR_ATARI_COM_BLOCK_HEADER_PARAMETERS={0}-{1} ({2})
HEX_EDITOR_ATARI_COM_BLOCK_ERROR=COM file structure error
HEX_EDITOR_ATARI_DISK_IMAGE_HEADER=ATR header
HEX_EDITOR_ATARI_SECTOR_HEADER=Sector
HEX_EDITOR_ATARI_SECTOR_HEADER_PARAMETERS=({2})
HEX_EDITOR_ATARI_SECTOR_ERROR=Sector structure error
HEX_EDITOR_ATARI_MADS_RELOC_BLOCK_HEADER=MADS RELOC block {0}-{1} {2}
HEX_EDITOR_ATARI_MADS_UPDATE_RELOC_BLOCK_HEADER=MADS UPDATE RELOC block {0} {1}
HEX_EDITOR_ATARI_MADS_UPDATE_SYMBOLS_BLOCK_HEADER=MADS UPDATE SYMBOLS block {0} {1}
HEX_EDITOR_ATARI_MADS_DEFINE_SYMBOLS_BLOCK_HEADER=MADS DEFINE SYMBOLS block {0}
HEX_EDITOR_ATARI_MADS_DEFINE_SYMBOL_HEADER=MADS DEFINE SYMBOL {0} {1} {2} {3}
HEX_EDITOR_ATARI_MADS_BLOCK_ERROR=MADS file structure error
HEX_EDITOR_ATARI_SAP_FILE_HEADER=SAP Header
HEX_EDITOR_ATARI_SDX_NON_RELOC_BLOCK_HEADER=SDX NON-RELOC block
HEX_EDITOR_ATARI_SDX_NON_RELOC_BLOCK_HEADER_PARAMETERS={0}-{1} ({2})
HEX_EDITOR_ATARI_SDX_RELOC_BLOCK_HEADER=SDX RELOC block {0} {1} {2} {3}
HEX_EDITOR_ATARI_SDX_UPDATE_RELOC_BLOCK_HEADER=SDX UPDATE RELOC block {0} {1}
HEX_EDITOR_ATARI_SDX_UPDATE_SYMBOLS_BLOCK_HEADER=SDX UPDATE SYMBOLS block {0} {1}
HEX_EDITOR_ATARI_SDX_DEFINE_SYMBOLS_BLOCK_HEADER=SDX DEFINE SYMBOLS block {0} {1} {2}
HEX_EDITOR_ATARI_SDX_BLOCK_ERROR=SDX file structure error
HEX_EDITOR_C64_PRG_HEADER=Program
HEX_EDITOR_C64_PRG_HEADER_PARAMETERS={0}-{1} ({2})
HEX_EDITOR_C64_PRG_ERROR=PRG file structure error
HEX_EDITOR_IFF_CHUNK=Chunk {0} contains ${1} ({2}) bytes
HEX_EDITOR_IFF_FORM_CHUNK=Chunk {0} of type {1} contains ${2} ({3}) bytes
HEX_EDITOR_IFF_FILE_ERROR=IFF file structure error
HEX_EDITOR_FILE_CONTENT_SIZE_FIELD_LABEL=File Size
HEX_EDITOR_FILE_CONTENT_SIZE_FIELD_TEXT=${0} ({1}) bytes
HEX_EDITOR_FILE_CONTENT_MODE_FIELD_LABEL=File Mode
HEX_EDITOR_CHARACTER_SET_TYPE_FIELD_LABEL=Character Set
HEX_EDITOR_BYTES_PER_ROW_FIELD_LABEL=Bytes per Row
HEX_EDITOR_SAVE_SELECTION_AS_DIALOG_TITLE=Save ${0} ({1}) bytes as...
MESSAGE_E300=File content cannot be interpreted as '{0}'.
MESSAGE_E301=File of type '{0}' is corrupted; check the last section of the file.
MESSAGE_I302=${0} ({1}) bytes copied to clipboard.
MESSAGE_I303=${0} ({1}) bytes saved as '{2}'.

View File

@ -0,0 +1,48 @@
HEX_EDITOR_FILE_SIZE=Datei enhält {0} ({1}) Bytes.
HEX_EDITOR_ATARI_COM_BLOCK_HEADER=COM Block
HEX_EDITOR_ATARI_COM_BLOCK_HEADER_PARAMETERS={0}-{1} ({2})
HEX_EDITOR_ATARI_COM_BLOCK_ERROR=COM Dateistruktur defekt
HEX_EDITOR_ATARI_DISK_IMAGE_HEADER=ATR Header
HEX_EDITOR_ATARI_SECTOR_HEADER=Sektor
HEX_EDITOR_ATARI_SECTOR_HEADER_PARAMETERS=({2})
HEX_EDITOR_ATARI_SECTOR_ERROR=Sektorfehler
HEX_EDITOR_ATARI_MADS_RELOC_BLOCK_HEADER=MADS RELOC Block {0}-{1} {2}
HEX_EDITOR_ATARI_MADS_UPDATE_RELOC_BLOCK_HEADER=MADS UPDATE RELOC Block {0} {1}
HEX_EDITOR_ATARI_MADS_UPDATE_SYMBOLS_BLOCK_HEADER=MADS UPDATE SYMBOLS Block {0} {1}
HEX_EDITOR_ATARI_MADS_DEFINE_SYMBOLS_BLOCK_HEADER=MADS DEFINE SYMBOLS Block {0}
HEX_EDITOR_ATARI_MADS_DEFINE_SYMBOL_HEADER=MADS DEFINE SYMBOL {0} {1} {2} {3}
HEX_EDITOR_ATARI_MADS_BLOCK_ERROR=MADS Dateistruktur defekt
HEX_EDITOR_ATARI_SAP_FILE_HEADER=SAP Header
HEX_EDITOR_ATARI_SDX_NON_RELOC_BLOCK_HEADER=SDX NON-RELOC block
HEX_EDITOR_ATARI_SDX_NON_RELOC_BLOCK_HEADER_PARAMETERS={0}-{1} ({2})
HEX_EDITOR_ATARI_SDX_RELOC_BLOCK_HEADER=SDX NON-RELOC Block {0} {1} {2} {3}
HEX_EDITOR_ATARI_SDX_UPDATE_RELOC_BLOCK_HEADER=SDX UPDATE RELOC Block {0} {1}
HEX_EDITOR_ATARI_SDX_UPDATE_SYMBOLS_BLOCK_HEADER=SDX UPDATE SYMBOLS Block {0} {1}
HEX_EDITOR_ATARI_SDX_DEFINE_SYMBOLS_BLOCK_HEADER=SDX DEFINE SYMBOLS Block {0} {1} {2}
HEX_EDITOR_ATARI_SDX_BLOCK_ERROR=SDX Dateistruktur defekt
HEX_EDITOR_C64_PRG_HEADER=Programm
HEX_EDITOR_C64_PRG_HEADER_PARAMETERS={0}-{1} ({2})
HEX_EDITOR_C64_PRG_ERROR=PRG Dateistruktur defekt
HEX_EDITOR_IFF_CHUNK=Chunk
HEX_EDITOR_IFF_FORM_CHUNK=Chunk {0} vom Typ {1} enhl#t ${2} ({3}) Bytes
HEX_EDITOR_IFF_FILE_ERROR=IFF Dateistruktur defekt
HEX_EDITOR_FILE_CONTENT_SIZE_FIELD_LABEL=Dateigröße
HEX_EDITOR_FILE_CONTENT_SIZE_FIELD_TEXT=${0} ({1}) Bytes
HEX_EDITOR_FILE_CONTENT_MODE_FIELD_LABEL=Datei-Modus
HEX_EDITOR_CHARACTER_SET_TYPE_FIELD_LABEL=Zeichensatz
HEX_EDITOR_BYTES_PER_ROW_FIELD_LABEL=Bytes pro Zeile
HEX_EDITOR_SAVE_SELECTION_AS_DIALOG_TITLE=Speichere ${0} ({1}) Bytes unter...
MESSAGE_E300=Inhalt der Datei kann nicht als '{0}' interpretiert werden.
MESSAGE_E301=Datei vom Typ '{0}' ist korrupt; überprüfen Sie den letzten Abschnitt der Datei
MESSAGE_I302=${0} ({1}) Bytes in die Zwischenablage kopiert.
MESSAGE_I303=${0} ({1}) Bytes gespeichert unter '{2}'.

View File

@ -17,7 +17,7 @@
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex.parser;
package com.wudsn.ide.hex.parser;
import org.eclipse.jface.viewers.StyledString;
@ -29,7 +29,7 @@ public final class AtariCOMParser extends AtariParser {
throw new IllegalArgumentException("Parameter 'contentBuilder' must not be null.");
}
int offset = 0;
int fileContentLenght = getFileContentLength();
int fileContentLenght = fileContent.getLength();
return parseAtariCOMFile(contentBuilder, offset, fileContentLenght);
}

View File

@ -17,7 +17,7 @@
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex.parser;
package com.wudsn.ide.hex.parser;
import org.eclipse.jface.viewers.StyledString;
@ -38,8 +38,8 @@ public final class AtariDiskImageKFileParser extends AtariDiskImageParser {
// as well.
if (!error) {
// The length of the k-file is stored in $709/$70a.
int length = ATARI_DISK_IMAGE_K_FILE_COM_FILE_OFFSET + getFileContentByte(0x19) + 256
* getFileContentByte(0x1a);
int length = ATARI_DISK_IMAGE_K_FILE_COM_FILE_OFFSET + fileContent.getByte(0x19) + 256
* fileContent.getByte(0x1a);
error = parseAtariCOMFile(contentBuilder, ATARI_DISK_IMAGE_K_FILE_COM_FILE_OFFSET, length);
}
return error;

View File

@ -17,12 +17,12 @@
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex.parser;
package com.wudsn.ide.hex.parser;
import org.eclipse.jface.viewers.StyledString;
import com.wudsn.ide.base.Texts;
import com.wudsn.ide.base.editor.hex.HexEditorContentOutlineTreeObject;
import com.wudsn.ide.hex.Texts;
import com.wudsn.ide.hex.HexEditorContentOutlineTreeObject;
public class AtariDiskImageParser extends AtariParser {
@ -34,7 +34,7 @@ public class AtariDiskImageParser extends AtariParser {
}
boolean error = false;
int length = getFileContentLength();
int length = fileContent.getLength();
long offset = 0;
HexEditorContentOutlineTreeObject treeObject;
@ -47,7 +47,7 @@ public class AtariDiskImageParser extends AtariParser {
blockMode = true;
int mainSectorSize = getFileContentByte(4) + 256 * getFileContentByte(5);
int mainSectorSize = fileContent.getByte(4) + 256 * fileContent.getByte(5);
int bootSectorSize = mainSectorSize;
if (bootSectorSize == 256 && (length % 256) == 128 + 16) {

View File

@ -17,15 +17,15 @@
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex.parser;
package com.wudsn.ide.hex.parser;
import org.eclipse.jface.viewers.StyledString;
import com.wudsn.ide.base.Texts;
import com.wudsn.ide.hex.Texts;
import com.wudsn.ide.base.common.HexUtility;
import com.wudsn.ide.base.common.TextUtility;
import com.wudsn.ide.base.editor.hex.HexEditorContentOutlineTreeObject;
import com.wudsn.ide.base.editor.hex.HexEditorParser;
import com.wudsn.ide.hex.HexEditorContentOutlineTreeObject;
import com.wudsn.ide.hex.HexEditorParser;
/**
* All parsing in here is based on the format description in the MADS online
@ -54,7 +54,7 @@ public class AtariMADSParser extends HexEditorParser {
skipByteTextIndex(offset);
HexEditorContentOutlineTreeObject treeObject;
int fileContentLength = getFileContentLength();
int fileContentLength = fileContent.getLength();
error = (fileContentLength - offset) < 17;
boolean first = true;
@ -68,11 +68,11 @@ public class AtariMADSParser extends HexEditorParser {
if (offset == fileContentLength) {
more = false;
} else {
int header = getFileContentWord(offset);
if (header == COM_HEADER && getFileContentWord(offset + 6) == RELOC_HEADER) {
int startAddress = getFileContentWord(offset + 2);
int endAddress = getFileContentWord(offset + 4);
int config = getFileContentByte(offset + 9);
int header = fileContent.getWord(offset);
if (header == COM_HEADER && fileContent.getWord(offset + 6) == RELOC_HEADER) {
int startAddress = fileContent.getWord(offset + 2);
int endAddress = fileContent.getWord(offset + 4);
int config = fileContent.getByte(offset + 9);
String headerText = TextUtility.format(Texts.HEX_EDITOR_ATARI_MADS_RELOC_BLOCK_HEADER,
HexUtility.getLongValueHexString(startAddress, 4),
@ -88,8 +88,8 @@ public class AtariMADSParser extends HexEditorParser {
} else if (header == UPDATE_RELOC_HEADER) {
int type = getFileContentByte(offset + 2);
int dataLength = getFileContentWord(offset + 3);
int type = fileContent.getByte(offset + 2);
int dataLength = fileContent.getWord(offset + 3);
treeObject = printTypedHeader(contentBuilder, offset,
Texts.HEX_EDITOR_ATARI_MADS_UPDATE_RELOC_BLOCK_HEADER, type, dataLength);
@ -115,9 +115,9 @@ public class AtariMADSParser extends HexEditorParser {
* DATA WORD .. .. .. (DATA_LENGTH words)
* </pre>
*/
int type = getFileContentByte(offset + 2);
int dataLength = getFileContentWord(offset + 3);
int labelLength = getFileContentWord(offset + 5);
int type = fileContent.getByte(offset + 2);
int dataLength = fileContent.getWord(offset + 3);
int labelLength = fileContent.getWord(offset + 5);
treeObject = printTypedHeader(contentBuilder, offset,
Texts.HEX_EDITOR_ATARI_MADS_UPDATE_SYMBOLS_BLOCK_HEADER, type, dataLength);
@ -127,7 +127,7 @@ public class AtariMADSParser extends HexEditorParser {
} else if (header == DEFINE_SYMBOLS_HEADER) {
int length = getFileContentWord(offset + 2);
int length = fileContent.getWord(offset + 2);
String headerText = TextUtility.format(Texts.HEX_EDITOR_ATARI_MADS_DEFINE_SYMBOLS_BLOCK_HEADER,
HexUtility.getLongValueHexString(length, 4));
StyledString headerStyledString = new StyledString(headerText, offsetStyler);
@ -136,16 +136,16 @@ public class AtariMADSParser extends HexEditorParser {
offset += 4;
for (int i = 0; i < length; i++) {
int type = getFileContentByte(offset);
int labelType = getFileContentByte(offset + 1);
int labelLength = getFileContentWord(offset + 2);
int type = fileContent.getByte(offset);
int labelType = fileContent.getByte(offset + 1);
int labelLength = fileContent.getWord(offset + 2);
String labelName = getLabelName(offset + 4, labelLength);
int address = getFileContentWord(offset + 4 + labelLength);
int address = fileContent.getWord(offset + 4 + labelLength);
long headerEnd = offset + 6 + labelLength - 1;
switch (labelType) {
case 'P':
int procType = getFileContentByte(headerEnd + 1);
int paramCount = getFileContentWord(headerEnd + 2);
int procType = fileContent.getByte(headerEnd + 1);
int paramCount = fileContent.getWord(headerEnd + 2);
headerEnd += 4;
for (int j = 0; j < paramCount; j++) {
switch (procType) {
@ -156,7 +156,7 @@ public class AtariMADSParser extends HexEditorParser {
break;
case 'V':
headerEnd += 1;
int paramLenght = getFileContentWord(headerEnd);
int paramLenght = fileContent.getWord(headerEnd);
headerEnd += 2 + paramLenght;
break;
}
@ -214,7 +214,7 @@ public class AtariMADSParser extends HexEditorParser {
private String getLabelName(long offset, int length) {
StringBuffer buffer = new StringBuffer(8);
for (int i = 0; i < length; i++) {
buffer.append((char) getFileContentByte(offset + i));
buffer.append((char) fileContent.getByte(offset + i));
}
return buffer.toString();
}

View File

@ -17,13 +17,13 @@
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex.parser;
package com.wudsn.ide.hex.parser;
import org.eclipse.jface.viewers.StyledString;
import com.wudsn.ide.base.Texts;
import com.wudsn.ide.base.editor.hex.HexEditorContentOutlineTreeObject;
import com.wudsn.ide.base.editor.hex.HexEditorParser;
import com.wudsn.ide.hex.Texts;
import com.wudsn.ide.hex.HexEditorContentOutlineTreeObject;
import com.wudsn.ide.hex.HexEditorParser;
public abstract class AtariParser extends HexEditorParser {
@ -47,8 +47,8 @@ public abstract class AtariParser extends HexEditorParser {
error = (fileContentLength - offset) < 7;
if (!error) {
startAddress = getFileContentWord(offset + 2);
endAddress = getFileContentWord(offset + 4);
startAddress = fileContent.getWord(offset + 2);
endAddress = fileContent.getWord(offset + 4);
blockCount = 1;
blockEnd = offset + endAddress - startAddress + 6;
@ -74,7 +74,7 @@ public abstract class AtariParser extends HexEditorParser {
error = true;
} else {
boolean comHeader;
comHeader = getFileContentWord(offset) == COM_HEADER;
comHeader = fileContent.getWord(offset) == COM_HEADER;
if (comHeader) {
// At least 7 bytes available? (6 header bytes and 1
// data byte)
@ -83,14 +83,14 @@ public abstract class AtariParser extends HexEditorParser {
} else {
// Inner COM header found
headerLength = 6;
startAddress = getFileContentByte(offset + 2) + 256 * getFileContentByte(offset + 3);
endAddress = getFileContentByte(offset + 4) + 256 * getFileContentByte(offset + 5);
startAddress = fileContent.getByte(offset + 2) + 256 * fileContent.getByte(offset + 3);
endAddress = fileContent.getByte(offset + 4) + 256 * fileContent.getByte(offset + 5);
}
} else {
// No inner COM header found
headerLength = 4;
startAddress = getFileContentByte(offset + 0) + 256 * getFileContentByte(offset + 1);
endAddress = getFileContentByte(offset + 2) + 256 * getFileContentByte(offset + 3);
startAddress = fileContent.getByte(offset + 0) + 256 * fileContent.getByte(offset + 1);
endAddress = fileContent.getByte(offset + 2) + 256 * fileContent.getByte(offset + 3);
}
error = endAddress < startAddress;
}

View File

@ -17,12 +17,12 @@
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex.parser;
package com.wudsn.ide.hex.parser;
import org.eclipse.jface.viewers.StyledString;
import com.wudsn.ide.base.Texts;
import com.wudsn.ide.base.editor.hex.HexEditorContentOutlineTreeObject;
import com.wudsn.ide.hex.Texts;
import com.wudsn.ide.hex.HexEditorContentOutlineTreeObject;
public final class AtariSAPParser extends AtariParser {
@ -32,9 +32,9 @@ public final class AtariSAPParser extends AtariParser {
throw new IllegalArgumentException("Parameter 'contentBuilder' must not be null.");
}
long offset = 0;
int fileContentLenght = getFileContentLength();
int fileContentLenght = fileContent.getLength();
int maxOffset = fileContentLenght - 2;
while (offset < maxOffset && getFileContentByte(offset) != 0xff && getFileContentByte(offset) != 0xff) {
while (offset < maxOffset && fileContent.getByte(offset) != 0xff && fileContent.getByte(offset) != 0xff) {
offset++;
}
if (offset == maxOffset) {

View File

@ -17,16 +17,16 @@
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex.parser;
package com.wudsn.ide.hex.parser;
import org.eclipse.jface.viewers.StyledString;
import com.wudsn.ide.base.Texts;
import com.wudsn.ide.base.common.HexUtility;
import com.wudsn.ide.base.common.NumberUtility;
import com.wudsn.ide.base.common.TextUtility;
import com.wudsn.ide.base.editor.hex.HexEditorContentOutlineTreeObject;
import com.wudsn.ide.base.editor.hex.HexEditorParser;
import com.wudsn.ide.hex.HexEditorContentOutlineTreeObject;
import com.wudsn.ide.hex.HexEditorParser;
import com.wudsn.ide.hex.Texts;
public class AtariSDXParser extends HexEditorParser {
@ -49,7 +49,7 @@ public class AtariSDXParser extends HexEditorParser {
skipByteTextIndex(offset);
HexEditorContentOutlineTreeObject treeObject;
int fileContentLength = getFileContentLength();
int fileContentLength = fileContent.getLength();
error = (fileContentLength - offset) < 7;
boolean first = true;
@ -63,14 +63,13 @@ public class AtariSDXParser extends HexEditorParser {
if (offset == fileContentLength) {
more = false;
} else {
int header = getFileContentWord(offset);
int header = fileContent.getWord(offset);
if (header == NON_RELOC_HEADER) {
int startAddress = getFileContentWord(offset + 2);
int endAddress = getFileContentWord(offset + 4);
int startAddress = fileContent.getWord(offset + 2);
int endAddress = fileContent.getWord(offset + 4);
treeObject = printBlockHeader(contentBuilder,
Texts.HEX_EDITOR_ATARI_SDX_NON_RELOC_BLOCK_HEADER, -1,
Texts.HEX_EDITOR_ATARI_SDX_NON_RELOC_BLOCK_HEADER_PARAMETERS, offset, startAddress,
treeObject = printBlockHeader(contentBuilder, Texts.HEX_EDITOR_ATARI_SDX_NON_RELOC_BLOCK_HEADER,
-1, Texts.HEX_EDITOR_ATARI_SDX_NON_RELOC_BLOCK_HEADER_PARAMETERS, offset, startAddress,
endAddress);
offset = printBytes(treeObject, contentBuilder, offset, offset + 5, true, 0);
@ -79,10 +78,10 @@ public class AtariSDXParser extends HexEditorParser {
offset = printBytes(treeObject, contentBuilder, offset, blockEnd, true, startAddress);
} else if (header == RELOC_HEADER) {
int blockNumber = getFileContentByte(offset + 2);
int blockId = getFileContentByte(offset + 3);
int blockOffset = getFileContentWord(offset + 4);
int blockLength = getFileContentWord(offset + 6);
int blockNumber = fileContent.getByte(offset + 2);
int blockId = fileContent.getByte(offset + 3);
int blockOffset = fileContent.getWord(offset + 4);
int blockLength = fileContent.getWord(offset + 6);
String headerText = TextUtility.format(Texts.HEX_EDITOR_ATARI_SDX_RELOC_BLOCK_HEADER,
NumberUtility.getLongValueDecimalString(blockNumber),
@ -101,8 +100,8 @@ public class AtariSDXParser extends HexEditorParser {
offset = printBytes(treeObject, contentBuilder, offset, blockEnd, true, blockOffset);
}
} else if (header == UPDATE_RELOC_HEADER) {
int blockNumber = getFileContentByte(offset + 2);
int blockLength = getFileContentWord(offset + 3);
int blockNumber = fileContent.getByte(offset + 2);
int blockLength = fileContent.getWord(offset + 3);
String headerText = TextUtility.format(Texts.HEX_EDITOR_ATARI_SDX_UPDATE_RELOC_BLOCK_HEADER,
NumberUtility.getLongValueDecimalString(blockNumber),
@ -115,7 +114,7 @@ public class AtariSDXParser extends HexEditorParser {
offset = printBytes(treeObject, contentBuilder, offset, blockEnd, true, 0);
} else if (header == UPDATE_SYMBOLS_HEADER) {
String symbolName = getSymbolName(offset + 2);
int blockLength = getFileContentWord(offset + 10);
int blockLength = fileContent.getWord(offset + 10);
String headerText = TextUtility.format(Texts.HEX_EDITOR_ATARI_SDX_UPDATE_SYMBOLS_BLOCK_HEADER,
symbolName, HexUtility.getLongValueHexString(blockLength, 4));
@ -126,8 +125,8 @@ public class AtariSDXParser extends HexEditorParser {
long blockEnd = getBlockEnd(offset);
offset = printBytes(treeObject, contentBuilder, offset, blockEnd, true, 0);
} else if (header == DEFINE_SYMBOLS_HEADER) {
int blockNumber = getFileContentByte(offset + 2);
int blockOffset = getFileContentWord(offset + 3);
int blockNumber = fileContent.getByte(offset + 2);
int blockOffset = fileContent.getWord(offset + 3);
String symbolName = getSymbolName(offset + 5);
String headerText = TextUtility.format(Texts.HEX_EDITOR_ATARI_SDX_DEFINE_SYMBOLS_BLOCK_HEADER,
@ -161,11 +160,11 @@ public class AtariSDXParser extends HexEditorParser {
* @return The end offset, a non-negative integer.
*/
private long getBlockEnd(long offset) {
int fileContentLength = getFileContentLength();
int fileContentLength = fileContent.getLength();
long i = offset;
long blockEnd = -1;
while (blockEnd < 0 && i < fileContentLength) {
int location = getFileContentByte(i);
int location = fileContent.getByte(i);
switch (location) {
case 0xfc:
blockEnd = i;
@ -187,7 +186,7 @@ public class AtariSDXParser extends HexEditorParser {
private String getSymbolName(long offset) {
StringBuffer buffer = new StringBuffer(8);
for (int i = 0; i < 8; i++) {
buffer.append((char) getFileContentByte(offset + i));
buffer.append((char) fileContent.getByte(offset + i));
}
return buffer.toString();
}

View File

@ -17,12 +17,12 @@
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex.parser;
package com.wudsn.ide.hex.parser;
import org.eclipse.jface.viewers.StyledString;
import com.wudsn.ide.base.editor.hex.HexEditorContentOutlineTreeObject;
import com.wudsn.ide.base.editor.hex.HexEditorParser;
import com.wudsn.ide.hex.HexEditorContentOutlineTreeObject;
import com.wudsn.ide.hex.HexEditorParser;
public class BinaryParser extends HexEditorParser {
@ -32,7 +32,7 @@ public class BinaryParser extends HexEditorParser {
throw new IllegalArgumentException("Parameter 'contentBuilder' must not be null.");
}
HexEditorContentOutlineTreeObject treeObject = new HexEditorContentOutlineTreeObject(contentBuilder);
printBytes(treeObject, contentBuilder, 0, getFileContentLength() - 1, false, 0);
printBytes(treeObject, contentBuilder, 0, fileContent.getLength() - 1, false, 0);
return false;
}

View File

@ -17,13 +17,13 @@
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex.parser;
package com.wudsn.ide.hex.parser;
import org.eclipse.jface.viewers.StyledString;
import com.wudsn.ide.base.Texts;
import com.wudsn.ide.base.editor.hex.HexEditorContentOutlineTreeObject;
import com.wudsn.ide.base.editor.hex.HexEditorParser;
import com.wudsn.ide.hex.Texts;
import com.wudsn.ide.hex.HexEditorContentOutlineTreeObject;
import com.wudsn.ide.hex.HexEditorParser;
public class C64PRGParser extends HexEditorParser {
@ -36,12 +36,12 @@ public class C64PRGParser extends HexEditorParser {
int startAddress;
int endAddress;
int length = getFileContentLength();
int length = fileContent.getLength();
long offset = 0;
error = (length < 2);
if (!error) {
startAddress = getFileContentByte(offset + 0) + 256 * getFileContentByte(offset + 1);
startAddress = fileContent.getByte(offset + 0) + 256 * fileContent.getByte(offset + 1);
endAddress = startAddress + length - 3;
HexEditorContentOutlineTreeObject treeObject;

View File

@ -17,16 +17,16 @@
* along with WUDSN IDE. If not, see <http://www.gnu.org/licenses/>.
*/
package com.wudsn.ide.base.editor.hex.parser;
package com.wudsn.ide.hex.parser;
import org.eclipse.jface.viewers.StyledString;
import com.wudsn.ide.base.Texts;
import com.wudsn.ide.base.common.HexUtility;
import com.wudsn.ide.base.common.NumberUtility;
import com.wudsn.ide.base.common.TextUtility;
import com.wudsn.ide.base.editor.hex.HexEditorContentOutlineTreeObject;
import com.wudsn.ide.base.editor.hex.HexEditorParser;
import com.wudsn.ide.hex.HexEditorContentOutlineTreeObject;
import com.wudsn.ide.hex.HexEditorParser;
import com.wudsn.ide.hex.Texts;
public final class IFFParser extends HexEditorParser {
@ -37,7 +37,7 @@ public final class IFFParser extends HexEditorParser {
}
boolean error;
long offset = 0;
long fileContentLength = getFileContentLength();
long fileContentLength = fileContent.getLength();
error = parse(contentBuilder, offset, fileContentLength, null);
return error;
}
@ -51,7 +51,7 @@ public final class IFFParser extends HexEditorParser {
while ((fileContentLength - offset) >= 8 && !error) {
long headerLength = 8;
String chunkName = getChunkName(offset);
long chunkLength = getFileContentDoubleWordBigEndian(offset + 4);
long chunkLength = fileContent.getDoubleWordBigEndian(offset + 4);
String headerText;
String formTypeName = "";
boolean hasInnerChunks = false;
@ -63,7 +63,8 @@ public final class IFFParser extends HexEditorParser {
NumberUtility.getLongValueDecimalString(chunkLength));
headerLength += 4;
chunkLength -= 4;
// Ignore trailing parts in the file outside of the main chunk
// Ignore trailing parts in the file outside of the main
// chunk
fileContentLength = offset + chunkLength;
hasInnerChunks = true;
} else {
@ -110,10 +111,10 @@ public final class IFFParser extends HexEditorParser {
private String getChunkName(long offset) {
char[] id = new char[4];
id[0] = (char) getFileContentByte(offset);
id[1] = (char) getFileContentByte(offset + 1);
id[2] = (char) getFileContentByte(offset + 2);
id[3] = (char) getFileContentByte(offset + 3);
id[0] = (char) fileContent.getByte(offset);
id[1] = (char) fileContent.getByte(offset + 1);
id[2] = (char) fileContent.getByte(offset + 2);
id[3] = (char) fileContent.getByte(offset + 3);
return String.copyValueOf(id);
}