Ghidra is a software reverse engineering (SRE) framework
GP-2858 - fixes to update the PR with theming concepts
dragonmacher1f70c3ffdcae
diff --git a/Ghidra/Framework/SoftwareModeling/data/softwaremodeling.theme.properties b/Ghidra/Framework/SoftwareModeling/data/softwaremodeling.theme.propertiesindex be5955e97d..9c1b524ff2 100644--- a/Ghidra/Framework/SoftwareModeling/data/softwaremodeling.theme.properties+++ b/Ghidra/Framework/SoftwareModeling/data/softwaremodeling.theme.properties@@ -4,9 +4,7 @@icon.content.handler.archive.dt = closedBookBlue.pngicon.content.handler.program = program_obj.png-icon.data.type.aiff = audio-volume-medium.png-icon.data.type.au = audio-volume-medium.png-icon.data.type.wave = audio-volume-medium.png+icon.data.type.audio.player = audio-volume-medium.png[Dark Defaults]diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AUDataType.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AUDataType.javaindex 9f32b357c8..d02df66117 100644--- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AUDataType.java+++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AUDataType.java@@ -4,9 +4,9 @@* Licensed under the Apache License, Version 2.0 (the "License");* you may not use this file except in compliance with the License.* You may obtain a copy of the License at- *+ ** http://www.apache.org/licenses/LICENSE-2.0- *+ ** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an "AS IS" BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AudioPlayer.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AudioPlayer.javaindex 92f87e9c2c..3c1e0a8bea 100644--- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AudioPlayer.java+++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AudioPlayer.java@@ -19,38 +19,32 @@ import java.awt.event.MouseEvent;import java.io.ByteArrayInputStream;import java.io.IOException;-import javax.sound.sampled.AudioInputStream;-import javax.sound.sampled.AudioSystem;-import javax.sound.sampled.Clip;-import javax.sound.sampled.LineEvent;+import javax.sound.sampled.*;import javax.sound.sampled.LineEvent.Type;-import javax.sound.sampled.LineListener;-import javax.sound.sampled.LineUnavailableException;-import javax.sound.sampled.UnsupportedAudioFileException;-import javax.swing.ImageIcon;+import javax.swing.Icon;+import generic.theme.GIcon;import ghidra.util.Msg;-import resources.ResourceManager;public class AudioPlayer implements Playable, LineListener {- private static final ImageIcon AUDIO_ICON =- ResourceManager.loadImage("images/audio-volume-medium.png");+ private static final Icon AUDIO_ICON = new GIcon("icon.data.type.audio.player");private byte[] bytes;-+public AudioPlayer(byte[] bytes) {this.bytes = bytes;}@Override- public ImageIcon getImageIcon() {+ public Icon getImageIcon() {return AUDIO_ICON;}@Overridepublic void clicked(MouseEvent event) {- try (AudioInputStream stream = AudioSystem.getAudioInputStream(new ByteArrayInputStream(bytes))) {+ try (AudioInputStream stream =+ AudioSystem.getAudioInputStream(new ByteArrayInputStream(bytes))) {Clip clip = AudioSystem.getClip();clip.addLineListener(this);clip.open(stream);@@ -72,6 +66,6 @@ public class AudioPlayer implements Playable, LineListener {if (event.getSource() instanceof Clip clip) {clip.removeLineListener(this);clip.close();- }+ }}}