GP-1981 Theme help and module conversions

This commit is contained in:
ghidragon
2022-09-13 16:36:26 -04:00
parent 4eb3d8fd86
commit 9a0d7892da
120 changed files with 1540 additions and 2846 deletions
@@ -67,6 +67,7 @@
<tocdef id="Ghidra Project Window" sortgroup="g" text="Ghidra Project Window" target="help/topics/FrontEndPlugin/Ghidra_Front_end.htm#Project_Window" />
<tocdef id="Ghidra Server" sortgroup="h" text="Ghidra Server" target="help/topics/GhidraServer/GhidraServer.htm" />
<tocdef id="About Ghidra" sortgroup="i" text="About Ghidra" target="help/topics/About/About_Ghidra.htm" />
</tocdef>
@@ -15,7 +15,6 @@
*/
package ghidra.app.plugin.core.function.editor;
import java.awt.Color;
import java.awt.Component;
import java.awt.event.*;
import java.math.BigInteger;
@@ -28,6 +27,7 @@ import javax.swing.table.TableCellEditor;
import docking.widgets.combobox.GhidraComboBox;
import docking.widgets.textfield.IntegerTextField;
import generic.theme.GThemeDefaults.Colors.Palette;
import ghidra.app.util.AddressInput;
import ghidra.program.model.address.Address;
import ghidra.program.model.address.AddressOutOfBoundsException;
@@ -44,12 +44,7 @@ class VarnodeLocationCellEditor extends AbstractCellEditor implements TableCellE
private AddressInput addressInput;
private IntegerTextField offsetInput;
private Comparator<Register> registerWrapperComparator = new Comparator<Register>() {
@Override
public int compare(Register r1, Register r2) {
return r1.toString().compareToIgnoreCase(r2.toString());
}
};
private Comparator<Register> registerWrapperComparator = (r1, r2) -> r1.toString().compareToIgnoreCase(r2.toString());
private VarnodeInfo currentVarnode;
private int maxRegisterSize;
@@ -146,12 +141,7 @@ class VarnodeLocationCellEditor extends AbstractCellEditor implements TableCellE
if (address != null) {
addressInput.setAddress(address);
}
addressInput.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
stopCellEditing();
}
});
addressInput.addActionListener(e -> stopCellEditing());
return addressInput;
}
@@ -162,14 +152,9 @@ class VarnodeLocationCellEditor extends AbstractCellEditor implements TableCellE
if (address != null) {
offsetInput.setValue(address.getOffset());
}
offsetInput.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
stopCellEditing();
}
});
offsetInput.addActionListener(e -> stopCellEditing());
JComponent component = offsetInput.getComponent();
component.setBorder(BorderFactory.createLineBorder(Color.GRAY, 1));
component.setBorder(BorderFactory.createLineBorder(Palette.GRAY, 1));
return component;
}
@@ -215,12 +200,7 @@ class VarnodeLocationCellEditor extends AbstractCellEditor implements TableCellE
}
});
combo.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
stopCellEditing();
}
});
combo.addActionListener(e -> stopCellEditing());
return combo;
}
@@ -15,7 +15,6 @@
*/
package ghidra.app.plugin.core.function.editor;
import java.awt.Color;
import java.awt.Component;
import java.awt.event.*;
import java.math.BigInteger;
@@ -25,6 +24,7 @@ import javax.swing.*;
import javax.swing.table.TableCellEditor;
import docking.widgets.textfield.IntegerTextField;
import generic.theme.GThemeDefaults.Colors.Palette;
class VarnodeSizeCellEditor extends AbstractCellEditor implements TableCellEditor {
@@ -70,14 +70,9 @@ class VarnodeSizeCellEditor extends AbstractCellEditor implements TableCellEdito
};
input.getComponent().addFocusListener(focusListener);
}
input.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
stopCellEditing();
}
});
input.addActionListener(e -> stopCellEditing());
JComponent component = input.getComponent();
component.setBorder(BorderFactory.createLineBorder(Color.GRAY, 1));
component.setBorder(BorderFactory.createLineBorder(Palette.GRAY, 1));
return component;
}
@@ -27,6 +27,7 @@ import javax.swing.*;
import docking.widgets.OptionDialog;
import docking.widgets.table.*;
import generic.theme.GColor;
import generic.theme.GThemeDefaults.Colors.Palette;
import ghidra.app.cmd.register.SetRegisterCmd;
import ghidra.app.events.ProgramSelectionPluginEvent;
import ghidra.app.services.*;
@@ -492,7 +493,7 @@ class RegisterValueRange {
class RegisterValueRenderer extends GTableCellRenderer {
private Color defaultColor = Color.LIGHT_GRAY;
private Color defaultColor = Palette.LIGHT_GRAY;
RegisterValueRenderer(JTable table) {
setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
@@ -15,10 +15,9 @@
*/
package ghidra.app.util.viewer.field;
import java.awt.Color;
import docking.widgets.fieldpanel.field.AttributedString;
import generic.theme.GThemeDefaults.Colors.Messages;
import generic.theme.GThemeDefaults.Colors.Palette;
import ghidra.app.nav.Navigatable;
import ghidra.app.services.GoToService;
import ghidra.framework.plugintool.ServiceProvider;
@@ -76,7 +75,7 @@ public class AddressAnnotatedStringHandler implements AnnotatedStringHandler {
buffer.append(string).append(" ");
}
return new AttributedString(buffer.toString(), Color.LIGHT_GRAY,
return new AttributedString(buffer.toString(), Palette.LIGHT_GRAY,
prototypeString.getFontMetrics(0));
}
@@ -22,6 +22,7 @@ import javax.swing.JComponent;
import docking.widgets.fieldpanel.internal.FieldBackgroundColorManager;
import docking.widgets.fieldpanel.internal.PaintContext;
import docking.widgets.fieldpanel.support.*;
import generic.theme.GThemeDefaults.Colors.Palette;
import ghidra.app.util.viewer.format.FieldFormatModel;
import ghidra.app.util.viewer.proxy.EmptyProxy;
import ghidra.app.util.viewer.proxy.ProxyObj;
@@ -177,7 +178,7 @@ public class IndentField implements ListingField {
public void paint(JComponent c, Graphics g, PaintContext context,
Rectangle clip, FieldBackgroundColorManager map, RowColLocation cursorLoc,
int rowHeight) {
g.setColor(Color.LIGHT_GRAY);
g.setColor(Palette.LIGHT_GRAY);
// draw the vertical lines to the left of the data (these are shown when there are vertical
// bars drawn for inset data)
@@ -23,6 +23,7 @@ import javax.swing.JComponent;
import docking.widgets.fieldpanel.internal.FieldBackgroundColorManager;
import docking.widgets.fieldpanel.internal.PaintContext;
import docking.widgets.fieldpanel.support.*;
import generic.theme.GThemeDefaults.Colors.Palette;
import ghidra.app.util.viewer.format.FieldFormatModel;
import ghidra.app.util.viewer.proxy.EmptyProxy;
import ghidra.app.util.viewer.proxy.ProxyObj;
@@ -176,7 +177,7 @@ public class OpenCloseField implements ListingField {
}
}
g.setColor(Color.LIGHT_GRAY);
g.setColor(Palette.LIGHT_GRAY);
// draw the vertical lines to the left of the toggle handle (these are shown when
// there are vertical bars drawn for inset data)
@@ -35,6 +35,7 @@ import docking.widgets.fieldpanel.internal.FieldPanelCoordinator;
import docking.widgets.fieldpanel.listener.FieldLocationListener;
import docking.widgets.fieldpanel.support.FieldLocation;
import docking.widgets.fieldpanel.support.ViewerPosition;
import generic.theme.GThemeDefaults.Colors.Palette;
import ghidra.GhidraOptions;
import ghidra.app.nav.Navigatable;
import ghidra.app.plugin.core.codebrowser.MarkerServiceBackgroundColorModel;
@@ -72,6 +73,8 @@ public class ListingCodeComparisonPanel
extends CodeComparisonPanel<ListingComparisonFieldPanelCoordinator> implements
FormatModelListener, CodeFormatService, ListingDiffChangeListener, OptionsChangeListener {
private static final Color FG_COLOR_TITLE = Palette.DARK_GRAY;
private static final String DUAL_LISTING_HEADER_SHOWING = "DUAL_LISTING_HEADER_SHOWING";
private static final String DUAL_LISTING_SIDE_BY_SIDE = "DUAL_LISTING_SIDE_BY_SIDE";
public static final String NAME = "DualListing";
@@ -1406,7 +1409,7 @@ public class ListingCodeComparisonPanel
String programStr =
HTMLUtilities.friendlyEncodeHTML(program.getDomainFile().getPathname());
String specialProgramStr = HTMLUtilities.colorString(Color.DARK_GRAY, programStr);
String specialProgramStr = HTMLUtilities.colorString(FG_COLOR_TITLE, programStr);
buf.append(specialProgramStr);
buf.append(padStr);
}
@@ -1441,7 +1444,7 @@ public class ListingCodeComparisonPanel
String programStr =
HTMLUtilities.friendlyEncodeHTML(program.getDomainFile().getPathname());
String specialProgramStr = HTMLUtilities.colorString(Color.DARK_GRAY, programStr);
String specialProgramStr = HTMLUtilities.colorString(FG_COLOR_TITLE, programStr);
buf.append(specialProgramStr);
buf.append(padStr);
}
@@ -1461,7 +1464,7 @@ public class ListingCodeComparisonPanel
String padStr = HTMLUtilities.spaces(4);
buf.append(padStr);
String programStr = HTMLUtilities.friendlyEncodeHTML(program.getDomainFile().getPathname());
String specialProgramStr = HTMLUtilities.colorString(Color.DARK_GRAY, programStr);
String specialProgramStr = HTMLUtilities.colorString(FG_COLOR_TITLE, programStr);
buf.append(specialProgramStr);
buf.append(padStr);
return HTMLUtilities.wrapAsHTML(buf.toString());
@@ -15,11 +15,11 @@
*/
package ghidra.app.util.xml;
import java.awt.Color;
import java.util.*;
import javax.swing.ImageIcon;
import generic.theme.GThemeDefaults.Colors.Palette;
import ghidra.app.cmd.function.*;
import ghidra.app.services.DataTypeManagerService;
import ghidra.app.util.NamespaceUtils;
@@ -129,7 +129,8 @@ class FunctionsXmlMgr {
if (bt == null) {
ImageIcon icon =
ResourceManager.loadImage("images/imported_bookmark.gif");
bt = bm.defineType("IMPORTED", icon, Color.DARK_GRAY, 0);
bt = bm.defineType("IMPORTED", icon, Palette.DARK_GRAY,
0);
}
bm.setBookmark(entryPoint, "IMPORTED", LIB_BOOKMARK_CATEGORY,
"Library function");
@@ -680,7 +681,7 @@ class FunctionsXmlMgr {
private Parameter[] getRegisterParameters(Function function) {
ArrayList<Parameter> list = new ArrayList<Parameter>();
ArrayList<Parameter> list = new ArrayList<>();
Parameter[] params = function.getParameters();
for (Parameter param : params) {
if (param.isRegisterVariable()) {
@@ -15,9 +15,9 @@
*/
package ghidra.program.util;
import java.awt.Color;
import java.util.*;
import generic.theme.GThemeDefaults.Colors.Palette;
import ghidra.program.model.address.Address;
import ghidra.program.model.data.DataType;
import ghidra.program.model.data.GenericCallingConvention;
@@ -381,7 +381,7 @@ public class FunctionUtility {
String programStr =
HTMLUtilities.friendlyEncodeHTML(program.getDomainFile().getPathname());
String specialProgramStr = HTMLUtilities.colorString(Color.DARK_GRAY, programStr);
String specialProgramStr = HTMLUtilities.colorString(Palette.DARK_GRAY, programStr);
buf.append(specialProgramStr);
buf.append(padStr);
}
@@ -23,6 +23,7 @@ import javax.swing.ImageIcon;
import javax.swing.JLabel;
import docking.widgets.table.GTableCellRenderingData;
import generic.theme.GThemeDefaults.Colors;
import ghidra.docking.settings.Settings;
import ghidra.framework.plugintool.ServiceProvider;
import ghidra.program.model.listing.Program;
@@ -75,7 +76,7 @@ public class MemoryTypeProgramLocationBasedTableColumn
private class MemoryTypeRenderer extends AbstractGhidraColumnRenderer<MemoryBlock> {
private Color disabledColor = Color.LIGHT_GRAY;
private Color disabledColor = Colors.DISABLED;
private ImageIcon offIcon = ResourceManager.loadImage("images/EmptyIcon16.gif");
private ImageIcon onIcon = ResourceManager.loadImage("images/check.png");
@@ -38,6 +38,14 @@ import ghidra.framework.main.FrontEndTool;
import ghidra.util.Msg;
import ghidra.util.exception.AssertException;
/**
* Extend this class to create screen shot images for help. The name of the class determines the
* topic directory where the captured image will be stored. So if the class name is
* XyzShreenShots, the resulting captured image will appear in help topic directy "Xyz", regardless
* of which module has that topic. The test name will determine the name of the image file
* that is generated. So if the test name is testHappyBirthday, the filename will be
* HappyBirthday.png.
*/
public abstract class GhidraScreenShotGenerator extends AbstractScreenShotGenerator {
private static final Color FG_COLOR_TEXT = Palette.getColor("color.palate.cornflowerblue");
@@ -25,6 +25,8 @@ import docking.*;
import docking.action.DockingAction;
import docking.action.MenuData;
import docking.widgets.table.GFilterTable;
import generic.theme.GColor;
import generic.theme.GThemeDefaults.Colors;
import ghidra.bitpatterns.info.*;
import ghidra.util.HelpLocation;
import ghidra.util.bytesearch.DittedBitSequence;
@@ -35,6 +37,8 @@ import resources.ResourceManager;
*/
public abstract class ByteSequenceAnalyzerProvider extends DialogComponentProvider {
private static final Color BG_DISABLED = new GColor("color.bg.uneditable");
protected ByteSequenceTableModel byteSequenceTable;
protected FunctionBitPatternsExplorerPlugin plugin;
protected JPanel mainPanel;
@@ -175,9 +179,9 @@ public abstract class ByteSequenceAnalyzerProvider extends DialogComponentProvid
}
mergedSeqTextField.setText(merged.getHexString());
bitsOfCheckField.setText(Integer.toString(merged.getNumFixedBits()));
mergedSeqTextField.setBackground(Color.WHITE);
bitsOfCheckField.setBackground(Color.WHITE);
noteField.setBackground(Color.WHITE);
mergedSeqTextField.setBackground(Colors.BACKGROUND);
bitsOfCheckField.setBackground(Colors.BACKGROUND);
noteField.setBackground(Colors.BACKGROUND);
mergedToSend = true;
}
@@ -211,9 +215,9 @@ public abstract class ByteSequenceAnalyzerProvider extends DialogComponentProvid
mergedInfo.setNote(note);
plugin.addPattern(mergedInfo);
plugin.updateClipboard();
mergedSeqTextField.setBackground(Color.lightGray);
bitsOfCheckField.setBackground(Color.LIGHT_GRAY);
noteField.setBackground(Color.LIGHT_GRAY);
mergedSeqTextField.setBackground(BG_DISABLED);
bitsOfCheckField.setBackground(BG_DISABLED);
noteField.setBackground(BG_DISABLED);
mergedToSend = false;
}
}
@@ -1,6 +1,7 @@
[Defaults]
color.bg.byteviewer = color.bg
color.bg.byteviewer.highlight = yellow
color.fg.byteviewer.novalue = blue
color.fg.byteviewer.changed = red
@@ -8,7 +9,12 @@ color.cursor.focused.byteviewer.current = color.cursor.focused
color.cursor.focused.byteviewer.noncurrent = black
color.cursor.unfocused.byteviewer = color.cursor.unfocused
[Dark Defaults]
color.bg.byteviewer.highlight = rgb(191, 191, 64) // olive
color.fg.byteviewer.novalue = DarkBlue
color.fg.byteviewer.changed = indianRed
color.cursor.focused.byteviewer.current = color.cursor.focused
@@ -29,6 +29,7 @@ import docking.widgets.fieldpanel.Layout;
import docking.widgets.fieldpanel.field.Field;
import docking.widgets.fieldpanel.listener.*;
import docking.widgets.fieldpanel.support.*;
import generic.theme.GColor;
import ghidra.app.plugin.core.format.*;
import ghidra.program.model.address.*;
import ghidra.util.Msg;
@@ -885,7 +886,7 @@ public class ByteViewerComponent extends FieldPanel implements FieldMouseListene
private class ByteViewerBackgroundColorModel implements BackgroundColorModel {
private Color defaultBackgroundColor = Color.WHITE;
private Color defaultBackgroundColor = new GColor("color.bg.byteviewer");
@Override
public Color getBackgroundColor(BigInteger index) {
@@ -1,6 +1,5 @@
/* ###
* IP: GHIDRA
* REVIEWED: YES
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,18 +15,19 @@
*/
package ghidra.app.plugin.core.byteviewer;
import ghidra.app.util.HighlightProvider;
import ghidra.app.util.viewer.field.FieldFactory;
import java.awt.Color;
import docking.widgets.fieldpanel.support.Highlight;
import generic.theme.GColor;
import ghidra.app.util.HighlightProvider;
import ghidra.app.util.viewer.field.FieldFactory;
public class ByteViewerHighlightProvider implements HighlightProvider {
private static Highlight[] NO_HIGHLIGHTS = new Highlight[0];
private String highlightText;
private Color highlightColor = Color.YELLOW;
private Color highlightColor = new GColor("color.bg.byteviewer.highlight");
@Override
public Highlight[] getHighlights(String text, Object obj,
Class<? extends FieldFactory> fieldFactoryClass, int cursorTextOffset) {
@@ -15,12 +15,12 @@
*/
package ghidra.app.plugin.core.byteviewer;
import java.awt.*;
import java.awt.Component;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.math.BigInteger;
import java.util.*;
import java.util.List;
import java.util.Map.Entry;
import javax.swing.*;
@@ -31,6 +31,8 @@ import javax.swing.event.ChangeListener;
import docking.DialogComponentProvider;
import docking.widgets.checkbox.GCheckBox;
import docking.widgets.label.GLabel;
import generic.theme.GThemeDefaults.Colors;
import generic.theme.GThemeDefaults.Colors.Messages;
import ghidra.app.plugin.core.format.ByteBlockSelection;
import ghidra.app.plugin.core.format.DataFormatModel;
import ghidra.app.util.AddressInput;
@@ -266,10 +268,10 @@ public class ByteViewerOptionsDialog extends DialogComponentProvider
JCheckBox checkBox = entry.getValue();
DataFormatModel model = provider.getDataFormatModel(entry.getKey());
if (model.validateBytesPerLine(bytesPerLine)) {
checkBox.setForeground(Color.BLACK);
checkBox.setForeground(Colors.FOREGROUND);
}
else {
checkBox.setForeground(Color.RED);
checkBox.setForeground(Messages.ERROR);
isBad |= checkBox.isSelected();
}
}
@@ -23,7 +23,6 @@ import java.util.List;
import javax.swing.*;
import javax.swing.event.*;
import docking.help.HelpService;
import docking.widgets.fieldpanel.*;
import docking.widgets.fieldpanel.field.EmptyTextField;
import docking.widgets.fieldpanel.field.Field;
@@ -43,6 +42,7 @@ import ghidra.util.exception.InvalidInputException;
import ghidra.util.layout.HorizontalLayout;
import ghidra.util.layout.PairLayout;
import help.Help;
import help.HelpService;
/**
* Top level component that contains has a scrolled pane for the panel of components that show the
@@ -34,6 +34,7 @@ import docking.action.DockingActionIf;
import docking.action.ToggleDockingAction;
import docking.widgets.EventTrigger;
import docking.widgets.fieldpanel.support.*;
import generic.theme.GThemeDefaults.Colors.Palette;
import ghidra.app.plugin.core.codebrowser.CodeBrowserPlugin;
import ghidra.app.plugin.core.format.*;
import ghidra.app.plugin.core.navigation.*;
@@ -1215,10 +1216,10 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
Options opt = tool.getOptions("ByteViewer");
// change the color for Current View Cursor Color
putColor(opt, ByteViewerComponentProvider.OPTION_CURRENT_VIEW_CURSOR_COLOR, Color.GREEN);
putColor(opt, ByteViewerComponentProvider.OPTION_CURRENT_VIEW_CURSOR_COLOR, Palette.GREEN);
ByteViewerComponent c = panel.getCurrentComponent();
assertEquals(Color.GREEN, c.getFocusedCursorColor());
assertEquals(Palette.GREEN, c.getFocusedCursorColor());
}
@Test
@@ -1235,10 +1236,10 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
Options opt = tool.getOptions("ByteViewer");
// change the color for Current View Cursor Color
putColor(opt, ByteViewerComponentProvider.OPTION_CURSOR_COLOR, Color.GREEN);
putColor(opt, ByteViewerComponentProvider.OPTION_CURSOR_COLOR, Palette.GREEN);
ByteViewerComponent c = findComponent(panel, "Octal");
assertEquals(Color.GREEN, c.getNonFocusCursorColor());
assertEquals(Palette.GREEN, c.getNonFocusCursorColor());
}
@Test
@@ -1254,10 +1255,10 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
Options opt = tool.getOptions("ByteViewer");
// change the color for Current View Cursor Color
putColor(opt, ByteViewerComponentProvider.OPTION_NONFOCUS_CURSOR_COLOR, Color.CYAN);
putColor(opt, ByteViewerComponentProvider.OPTION_NONFOCUS_CURSOR_COLOR, Palette.CYAN);
ByteViewerComponent c = findComponent(panel, "Octal");
assertEquals(Color.CYAN, c.getNonFocusCursorColor());
assertEquals(Palette.CYAN, c.getNonFocusCursorColor());
}
private void putFont(final Options options, final String optionName, final Font font) {
@@ -1282,7 +1283,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
Options opt = tool.getOptions("ByteViewer");
// change the color for Edit Color
putColor(opt, ByteViewerComponentProvider.OPTION_EDIT_COLOR, Color.GREEN);
putColor(opt, ByteViewerComponentProvider.OPTION_EDIT_COLOR, Palette.GREEN);
final FieldLocation loc = getFieldLocation(getAddr(0x01001000));
SwingUtilities.invokeAndWait(() -> {
@@ -1302,7 +1303,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
program.flushEvents();
ByteViewerComponent c = panel.getCurrentComponent();
ByteField field = c.getField(loc.getIndex(), loc.getFieldNum());
assertEquals(Color.GREEN, field.getForeground());
assertEquals(Palette.GREEN, field.getForeground());
}
@Test
@@ -1340,12 +1341,12 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
Options opt = tool.getOptions("ByteViewer");
// change the color for block separator
putColor(opt, ByteViewerComponentProvider.OPTION_SEPARATOR_COLOR, Color.GREEN);
putColor(opt, ByteViewerComponentProvider.OPTION_SEPARATOR_COLOR, Palette.GREEN);
ByteViewerComponent c = panel.getCurrentComponent();
FieldLocation loc = getFieldLocation(getAddr(0x0f001000));
ByteField field = c.getField(loc.getIndex().subtract(BigInteger.ONE), 0);
assertEquals(Color.GREEN, field.getForeground());
assertEquals(Palette.GREEN, field.getForeground());
}
@Test
@@ -1,10 +1,12 @@
[Defaults]
color.bg.decompiler = color.bg
color.fg.decompiler = color.fg
color.fg.decompiler.keyword = #0001e6
color.fg.decompiler.function.name = blue
color.fg.decompiler.comment = blueViolet
color.fg.decompiler.error = crimson
color.fg.decompiler.variable = #999900 // close to oliveDrab
color.fg.decompiler.constant = forestGreen
color.fg.decompiler.type = mediumBlue
@@ -37,6 +39,7 @@ color.bg.decompiler.pcode.dfg.edge.between.blocks = red
color.fg.decompiler.keyword = peru
color.fg.decompiler.function.name = cadetBlue
color.fg.decompiler.comment = lightSlateGray
color.fg.decompiler.error = crimson
color.fg.decompiler.variable = #999900 // close to oliveDrab
color.fg.decompiler.constant = forestGreen
color.fg.decompiler.type = blue
@@ -354,7 +354,7 @@ public class DecompileOptions {
private Color defaultSearchHighlightColor = SEARCH_HIGHLIGHT_DEF;
// Color applied to a token to indicate warning/error
private final static Color ERROR_COLOR = new Color(204, 0, 51); // Dark Red
private final static Color ERROR_COLOR = new GColor("color.fg.decompiler.comment");
final static String FONT_MSG = "Display.Font";
final static Font DEFAULT_FONT = new Font(Font.MONOSPACED, Font.PLAIN, 12);
@@ -436,7 +436,7 @@ public class FunctionGraphGroupVertices1Test extends AbstractFunctionGraphTest {
// The coloring algorithm:
// 1) If the grouped vertices are not colored, then use the default group color
// 2) If the grouped vertices are colored, but not all the same color,
// then use the default group color=
// then use the default group color
// 3) If all grouped vertices share the same color, then make the group that color
//
// This test is for 1)
@@ -472,7 +472,7 @@ public class FunctionGraphGroupVertices1Test extends AbstractFunctionGraphTest {
// The coloring algorithm:
// 1) If the grouped vertices are not colored, then use the default group color
// 2) If the grouped vertices are colored, but not all the same color,
// then use the default group color=
// then use the default group color
// 3) If all grouped vertices share the same color, then make the group that color
//
// This test is for 2)
@@ -514,7 +514,7 @@ public class FunctionGraphGroupVertices1Test extends AbstractFunctionGraphTest {
// The coloring algorithm:
// 1) If the grouped vertices are not colored, then use the default group color
// 2) If the grouped vertices are colored, but not all the same color,
// then use the default group color=
// then use the default group color
// 3) If all grouped vertices share the same color, then make the group that color
//
// This test is for 3)
@@ -29,8 +29,8 @@ import javax.swing.border.LineBorder;
import docking.widgets.EmptyBorderButton;
import docking.widgets.label.GDLabel;
import generic.theme.GColor;
import generic.theme.Gui;
import generic.theme.GThemeDefaults.Colors.Palette;
import generic.theme.Gui;
import ghidra.graph.viewer.vertex.AbstractVisualVertex;
import ghidra.graph.viewer.vertex.VertexShapeProvider;
import ghidra.program.model.address.Address;
@@ -250,7 +250,7 @@ public class FcgVertex extends AbstractVisualVertex implements VertexShapeProvid
compactShape = (Double) vertexShape.clone();
vertexImageLabel.setIcon(new ImageIcon(image));
Border border = createDebugBorder(new LineBorder(Color.PINK, 1));
Border border = createDebugBorder(new LineBorder(Palette.PINK, 1));
vertexImageLabel.setBorder(border);
}
@@ -299,7 +299,7 @@ public class FcgVertex extends AbstractVisualVertex implements VertexShapeProvid
private void addNameLabel() {
Border border = createDebugBorder(new LineBorder(Color.GREEN, 1));
Border border = createDebugBorder(new LineBorder(Palette.GREEN, 1));
nameLabel.setBorder(border);
// assume the vertex label has been bounded
@@ -116,7 +116,7 @@ public class FunctionCallGraphPluginScreenShots extends GhidraScreenShotGenerato
area.width += (2 * offset);
area.height += (2 * offset);
// drawRectangle(Color.ORANGE, area, 5);
// drawRectangle(Palette.ORANGE, area, 5);
crop(area);
}
@@ -30,6 +30,7 @@ import javax.swing.event.EventListenerList;
import com.google.common.collect.HashMultiset;
import com.google.common.collect.Multiset;
import generic.theme.GThemeDefaults.Colors;
import ghidra.service.graph.Attributed;
/**
@@ -60,8 +61,7 @@ public class AttributeFilters implements ItemSelectable {
/**
* a {@link Function} to allow custom coloring of the individual toolkit button foreground
*/
private Function<String, Paint> paintFunction = v -> Color.black;
private Function<String, Paint> paintFunction = v -> Colors.FOREGROUND;
/**
* @param excluded ignored keys
@@ -53,6 +53,7 @@ import docking.options.editor.OptionsDialog;
import docking.widgets.EventTrigger;
import docking.widgets.OptionDialog;
import generic.theme.GColor;
import generic.theme.GThemeDefaults.Colors;
import generic.util.WindowUtilities;
import ghidra.framework.options.Options;
import ghidra.framework.options.ToolOptions;
@@ -1025,7 +1026,7 @@ public class DefaultGraphDisplay implements GraphDisplay {
.elements(vertices)
.maxFactor(.05)
.buttonSupplier(JRadioButton::new)
.paintFunction(v -> Color.BLACK)
.paintFunction(v -> Colors.FOREGROUND)
.build();
vertexFilters.addItemListener(item -> {
@@ -1043,7 +1044,7 @@ public class DefaultGraphDisplay implements GraphDisplay {
.elements(edges)
.maxFactor(.01)
.buttonSupplier(JRadioButton::new)
.paintFunction(e -> Color.BLACK)
.paintFunction(e -> Colors.FOREGROUND)
.build();
edgeFilters.addItemListener(item -> {
@@ -37,6 +37,7 @@ import org.jungrapht.visualization.renderers.Renderer;
import org.jungrapht.visualization.renderers.Renderer.VertexLabel.Position;
import org.jungrapht.visualization.util.RectangleUtils;
import generic.theme.GThemeDefaults.Colors;
import generic.util.image.ImageUtils;
import ghidra.service.graph.*;
import ghidra.util.HTMLUtilities;
@@ -78,8 +79,8 @@ public class DefaultGraphRenderer implements GraphRenderer {
this.options = options;
renderingHints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
label = new JLabel();
label.setForeground(Color.black);
label.setBackground(Color.white);
label.setForeground(Colors.FOREGROUND);
label.setBackground(Colors.BACKGROUND);
label.setOpaque(false);
Border marginBorder = BorderFactory.createEmptyBorder(labelBorderSize, 2 * labelBorderSize,
labelBorderSize, 2 * labelBorderSize);
@@ -163,7 +164,7 @@ public class DefaultGraphRenderer implements GraphRenderer {
}
renderContext.setVertexFontFunction(this::getFont);
renderContext.setVertexLabelRenderer(new JLabelVertexLabelRenderer(Color.black));
renderContext.setVertexLabelRenderer(new JLabelVertexLabelRenderer(Colors.FOREGROUND));
renderContext.setVertexDrawPaintFunction(this::getVertexColor);
renderContext.setVertexFillPaintFunction(this::getVertexColor);
renderContext.setVertexStrokeFunction(n -> new BasicStroke(3.0f));
@@ -290,7 +291,7 @@ public class DefaultGraphRenderer implements GraphRenderer {
// shapes are centered at the origin, so translate the graphics to compensate
graphics.translate(-bounds.x + strokeThickness, -bounds.y + strokeThickness);
graphics.setPaint(Color.WHITE);
graphics.setPaint(Colors.BACKGROUND);
graphics.fill(scaledShape);
graphics.setPaint(vertexColor);
graphics.setStroke(new BasicStroke(strokeThickness));
@@ -304,7 +305,7 @@ public class DefaultGraphRenderer implements GraphRenderer {
int yOffset = (int) ((iconHeight - label.getHeight()) * labelOffsetRatio);
graphics.translate(xOffset, yOffset);
graphics.setPaint(Color.black);
graphics.setPaint(Colors.FOREGROUND);
label.paint(graphics);
graphics.setTransform(graphicsTransform); // restore the original transform
@@ -42,6 +42,7 @@ import docking.widgets.label.GLabel;
import docking.widgets.textfield.HexOrDecimalInput;
import docking.widgets.textfield.HintTextField;
import generic.theme.GThemeDefaults.Colors;
import generic.theme.GThemeDefaults.Colors.Messages;
import generic.theme.TempColorUtils;
import ghidra.app.util.bin.format.pdb.PdbParser;
import ghidra.app.util.bin.format.pdb2.pdbreader.PdbIdentifiers;
@@ -910,7 +911,7 @@ public class LoadPdbDialog extends DialogComponentProvider {
}
Graphics2D g2 = (Graphics2D) g;
g2.setColor(hintColor != null ? hintColor : Color.LIGHT_GRAY);
g2.setColor(hintColor != null ? hintColor : Messages.HINT);
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
Dimension size = getSize();
@@ -26,7 +26,6 @@ import javax.swing.text.*;
import javax.swing.tree.TreeSelectionModel;
import docking.DockingUtils;
import docking.help.HelpService;
import docking.widgets.EventTrigger;
import docking.widgets.OptionDialog;
import docking.widgets.fieldpanel.FieldPanel;
@@ -63,6 +62,7 @@ import ghidra.util.exception.CancelledException;
import ghidra.util.exception.VersionException;
import ghidra.util.task.*;
import help.Help;
import help.HelpService;
import resources.ResourceManager;
/**
@@ -33,6 +33,7 @@ import docking.action.ToggleDockingAction;
import docking.tool.ToolConstants;
import docking.widgets.fieldpanel.FieldPanel;
import generic.test.AbstractGenericTest;
import generic.theme.GThemeDefaults.Colors.Palette;
import ghidra.app.events.ProgramLocationPluginEvent;
import ghidra.app.plugin.core.codebrowser.CodeBrowserPlugin;
import ghidra.app.plugin.core.marker.MarkerManagerPlugin;
@@ -271,10 +272,10 @@ public class DiffTestAdapter extends AbstractGhidraHeadedIntegrationTest {
builder.setIntProperty("10018ff", "Space", 1);
builder.setIntProperty("100248c", "Space", 1);
builder.setObjectProperty("100248c", "testColor", new SaveableColor(Color.CYAN));
builder.setObjectProperty("10039dd", "testColor", new SaveableColor(Color.BLACK));
builder.setObjectProperty("10039f8", "testColor", new SaveableColor(Color.BLACK));
builder.setObjectProperty("10039fe", "testColor", new SaveableColor(Color.RED));
builder.setObjectProperty("100248c", "testColor", new SaveableColor(Palette.CYAN));
builder.setObjectProperty("10039dd", "testColor", new SaveableColor(Palette.BLACK));
builder.setObjectProperty("10039f8", "testColor", new SaveableColor(Palette.BLACK));
builder.setObjectProperty("10039fe", "testColor", new SaveableColor(Palette.RED));
AbstractGenericTest.setInstanceField("recordChanges", builder.getProgram(), Boolean.TRUE);
@@ -450,10 +451,10 @@ public class DiffTestAdapter extends AbstractGhidraHeadedIntegrationTest {
builder.setIntProperty("1002428", "Space", 1);
builder.setIntProperty("100248c", "Space", 1);
builder.setObjectProperty("100248c", "testColor", new SaveableColor(Color.WHITE));
builder.setObjectProperty("10039f1", "testColor", new SaveableColor(Color.BLACK));
builder.setObjectProperty("10039f8", "testColor", new SaveableColor(Color.BLACK));
builder.setObjectProperty("10039fe", "testColor", new SaveableColor(Color.GREEN));
builder.setObjectProperty("100248c", "testColor", new SaveableColor(Palette.WHITE));
builder.setObjectProperty("10039f1", "testColor", new SaveableColor(Palette.BLACK));
builder.setObjectProperty("10039f8", "testColor", new SaveableColor(Palette.BLACK));
builder.setObjectProperty("10039fe", "testColor", new SaveableColor(Palette.GREEN));
AbstractGenericTest.setInstanceField("recordChanges", builder.getProgram(), Boolean.TRUE);
@@ -2,6 +2,7 @@
##MODULE IP: Jython License
##MODULE IP: LGPL 2.1
Module.manifest||GHIDRA||||END|
data/python.theme.properties||GHIDRA||||END|
src/main/help/help/TOC_Source.xml||GHIDRA||||END|
src/main/help/help/topics/Python/images/erase16.png||GHIDRA||||END|
src/main/help/help/topics/Python/interpreter.html||GHIDRA||||END|
@@ -0,0 +1,19 @@
[Defaults]
color.fg.plugin.python.syntax.class = blue
color.fg.plugin.python.syntax.code = darkgreen
color.fg.plugin.python.syntax.function = green
color.fg.plugin.python.syntax.instance = purple
color.fg.plugin.python.syntax.map = steelblue
color.fg.plugin.python.syntax.method = teal
color.fg.plugin.python.syntax.null = red
color.fg.plugin.python.syntax.number = darkgray
color.fg.plugin.python.syntax.package = darkred
color.fg.plugin.python.syntax.sequence = rbg(128, 96, 64)
color.fg.plugin.python.syntax.special = darkgreen
[Dark Defaults]
@@ -25,6 +25,7 @@ import org.python.core.PyInstance;
import org.python.core.PyObject;
import docking.widgets.label.GDLabel;
import generic.theme.GColor;
import ghidra.app.plugin.core.console.CodeCompletion;
import ghidra.framework.options.Options;
import ghidra.util.Msg;
@@ -57,19 +58,21 @@ public class PythonCodeCompletionFactory {
private final static boolean INCLUDE_TYPES_DEFAULT = true;
private static boolean includeTypes = INCLUDE_TYPES_DEFAULT;
public static final Color NULL_COLOR = new Color(255, 0, 0);
public static final Color FUNCTION_COLOR = new Color(0, 128, 0);
public static final Color PACKAGE_COLOR = new Color(128, 0, 0);
public static final Color CLASS_COLOR = new Color(0, 0, 255);
public static final Color METHOD_COLOR = new Color(0, 128, 128);
//@formatter:off
public static final Color NULL_COLOR = new GColor("color.fg.plugin.python.syntax.null");
public static final Color FUNCTION_COLOR = new GColor("color.fg.plugin.python.syntax.function");
public static final Color PACKAGE_COLOR = new GColor("color.fg.plugin.python.syntax.package");
public static final Color CLASS_COLOR = new GColor("color.fg.plugin.python.syntax.class");
public static final Color METHOD_COLOR = new GColor("color.fg.plugin.python.syntax.method");
/* anonymous code chunks */
public static final Color CODE_COLOR = new Color(0, 64, 0);
public static final Color INSTANCE_COLOR = new Color(128, 0, 128);
public static final Color SEQUENCE_COLOR = new Color(128, 96, 64);
public static final Color MAP_COLOR = new Color(64, 96, 128);
public static final Color NUMBER_COLOR = new Color(64, 64, 64);
public static final Color CODE_COLOR = new GColor("color.fg.plugin.python.syntax.code");
public static final Color INSTANCE_COLOR = new GColor("color.fg.plugin.python.syntax.instance");
public static final Color SEQUENCE_COLOR = new GColor("color.fg.plugin.python.syntax.sequence");
public static final Color MAP_COLOR = new GColor("color.fg.plugin.python.syntax.map");
public static final Color NUMBER_COLOR = new GColor("color.fg.plugin.python.syntax.number");
/* for weird Jython-specific stuff */
public static final Color SPECIAL_COLOR = new Color(64, 96, 64);
public static final Color SPECIAL_COLOR = new GColor("color.fg.plugin.python.syntax.special");
//@formatter:on
static {
/* Order matters! This is the order in which classes are checked for
@@ -9,21 +9,14 @@
##MODULE IP: Tango Icons - Public Domain
Module.manifest||GHIDRA||||END|
data/ExtensionPoint.manifest||GHIDRA||||END|
src/main/help/help/TOC_Source.xml||GHIDRA||||END|
src/main/help/help/shared/arrow.gif||GHIDRA||||END|
src/main/help/help/shared/close16.gif||GHIDRA||||END|
src/main/help/help/shared/menu16.gif||GHIDRA||||END|
src/main/help/help/shared/note-red.png||Oxygen Icons - LGPL 3.0|||Oxygen icon theme (dual license; LGPL or CC-SA-3.0)|END|
src/main/help/help/shared/note.png||Oxygen Icons - LGPL 3.0|||Oxygen icon theme (dual license; LGPL or CC-SA-3.0)|END|
src/main/help/help/shared/note.yellow.png||Oxygen Icons - LGPL 3.0|||Oxygen icon theme (dual license; LGPL or CC-SA-3.0)|END|
src/main/help/help/shared/redo.png||GHIDRA||||END|
src/main/help/help/shared/tip.png||Oxygen Icons - LGPL 3.0|||Oxygen icon theme (dual license; LGPL or CC-SA-3.0)|END|
src/main/help/help/shared/undo.png||GHIDRA||||END|
src/main/help/help/shared/warning.png||Oxygen Icons - LGPL 3.0|||Oxygen icon theme (dual license; LGPL or CC-SA-3.0)|END|
src/main/help/help/topics/PlacheholderTopic/Placeholder.htm||GHIDRA||||END|
data/docking.palette.material.theme.properties||GHIDRA||||END|
data/docking.palette.theme.properties||GHIDRA||||END|
data/docking.theme.properties||GHIDRA||||END|
src/main/help/help/TOC_Source.xml||GHIDRA||||END|
src/main/help/help/topics/Theming/Theming.htm||GHIDRA||||END|
src/main/help/help/topics/Theming/images/ColorEditor.png||GHIDRA||||END|
src/main/help/help/topics/Theming/images/FontEditor.png||GHIDRA||||END|
src/main/help/help/topics/Theming/images/IconEditor.png||GHIDRA||||END|
src/main/help/help/topics/Theming/images/ThemeDialog.png||GHIDRA||||END|
src/main/java/docking/dnd/package.html||GHIDRA||reviewed||END|
src/main/java/docking/options/editor/package.html||GHIDRA||reviewed||END|
src/main/java/docking/widgets/fieldpanel/package.html||GHIDRA||reviewed||END|
@@ -6,17 +6,21 @@ color.palette.disabled = rgba(255,255,255,0)
color.palette.black = black
color.palette.blue = blue
color.palate.cornflowerblue = cornflowerblue
color.palate.cornsilk = cornsilk
color.palette.crimson = crimson
color.palette.cyan = cyan
color.palette.darkblue = DarkBlue
color.palette.darkgray = DarkGray
color.palette.darkgreen = darkgreen
color.palette.darkkhaki = DarkKhaki
color.palette.darkred = DarkRed
color.palette.darkslategray = darkslategray
color.palette.dodgerblue = DodgerBlue
color.palette.fuchsia = fuchsia
color.palette.gold = gold
color.palette.gray = gray
color.palette.green = green
color.palette.greenyellow = greenyellow
color.palette.indigo = indigo
color.palette.khaki = khaki
color.palette.lavender = lavender
@@ -36,10 +40,14 @@ color.palette.olive = olive
color.palette.orange = orange
color.palette.palegreen = palegreen
color.palette.palevioletred = PaleVioletRed
color.palette.peachpuff = peachpuff
color.palette.pink = pink
color.palette.purple = purple
color.palette.red = red
color.palette.silver = silver
color.palette.steelblue = steelblue
color.palette.tan = tan
color.palette.teal = teal
color.palette.yellow = yellow
color.palette.yellowgreen = yellowgreen
color.palette.white = white
@@ -73,7 +73,7 @@ color.bg.tree.drag.no.selection = rgb(204, 204, 255)
color.bg.filterfield = color.bg.filtered
color.fg.filterfield = black
color.bg.selection.help = lightSteelBlue
color.bg.selection.help = lightsteelblue
// generic component items
color.border.bevel.highlight = lightGray
@@ -20,9 +20,9 @@
During the help build time, all TOC_Source.xml files will be parsed and validated to ensure
that all <tocref> tags point to valid <tocdef> tags. From these files will be generated
<module name>_TOC.xml files, which are table of contents files written in the format
desired by the JavaHelp system. Additionally, the genated files will be merged together
desired by the JavaHelp system. Additionally, the generated files will be merged together
as they are loaded by the JavaHelp system. In the end, when displaying help in the Ghidra
help GUI, there will be on table of contents that has been created from the definitions in
help GUI, there will be one table of contents that has been created from the definitions in
all of the modules' TOC_Source.xml files.
@@ -43,12 +43,14 @@
**The URL for the target is relative and should start with 'help/topics'. This text is
used by the Ghidra help system to provide a universal starting point for all links so that
they can be resolved at runtime, across modules.
-->
<tocroot>
</tocroot>
<tocdef id="Theming"
text="Theming"
target="help/topics/Theming/Theming.htm" >
</tocdef>
</tocroot>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

@@ -1,17 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
<HTML>
<HEAD>
<TITLE>Placholder Title</TITLE>
<LINK rel="stylesheet" type="text/css" href="../../shared/Frontpage.css">
</HEAD>
<BODY>
<H1>Stub</H1>
<P>Blah blah</P>
<P class="relatedtopic">Related Topics:</P>
</BODY>
</HTML>
@@ -0,0 +1,302 @@
<!DOCTYPE doctype>
<HTML>
<HEAD>
<META name="generator" content=
"HTML Tidy for Java (vers. 2009-12-01), see jtidy.sourceforge.net">
<TITLE>Theming</TITLE>
<LINK rel="stylesheet" type="text/css" href="../../shared/Frontpage.css">
</HEAD>
<BODY>
<H1 align="center">Theming</H1>
<H2>Overview</H2>
<P>The Theming feature allows users to customize the colors, fonts, and icons used throughout
the application. The active theme determines the Java LookAndFeel, whether the theme should use
light or dark defaults, and any custom colors, fonts, and icons that override the default
values. Users can can easily switch between any of the built-in themes or any saved themes from
their home application directory</P>
<P>Users can also edit and create their own themes using the Theme Editor. Custom themes are
stored in the users &lt;application dir&gt;/themes. These are simple text files that can also
easily be modified using any text editor. Also, users can share themes by exporting them to a
file that can be given to other users who can them import them into their own system.</P>
<H2>Theme Dialog<A name="Edit_Theme"></A></H2>
<P>The Theme Dialog is the primary means for creating, editing, and saving themes.</P>
<P align="center"><IMG alt="" src="images/ThemeDialog.png"><BR>
&nbsp;</P>
<P>The Theme Dialog consists of a theme comboBox and a tabbed set of tables that display the
values for every color property, font property, and icon property defined by either the Java
LookAndFeel or the Ghidra application. All Ghidra defined properties start with "color.",
"font.", or "icon." depending on whether the the property is a color, font, or icon
respectively. All other properties are defined by the Java LookAndFeel.</P>
<P>Each table entry shows the property id string and then the current value, the theme value,
and the default color. Most often, the three values are equal. If the theme value is different
from the default value, that means that the active theme has overridden the default value for
that property. If the current value is different from the theme value, that means the user has
changed that value, but not yet saved the changes back to the theme.</P>
<P>Individual values can be changed by double clicking the Id or Current Color column. This
will bring up an appropriate editor for changing the value. When editing a value, the change
takes place immediately in the application so you can see the effect. When you leave the
specific property editor, you have the choice of keeping the change or canceling and having it
revert back to its previous value.</P>
<P>If any values have been changed, the "Save" button will become enabled, allowing you to save
any changes you have made. (Hitting "Dismiss" will also give the the option to save.) If the
current theme is a built-in theme, you will first have to supply a new theme name. If the
current theme is a not a built-in theme, you will have the option to overwrite the existing
theme or supplying a new name to save it as a new theme.</P>
<BLOCKQUOTE>
<H3>Color Editor</H3>
<P>When you double-click on a color value, the Edit Color dialog appears.</P>
<P align="center"><IMG alt="" src="images/ColorEditor.png"><BR>
&nbsp;</P>
<P>Any change you make in the editor is applied to the application immediately. If you press
the OK button, the change will stay. If you press the Cancel button, the color will revert
back to the original color.</P>
<H3>Font Editor</H3>
<P>When you double-click on a font value, the Edit Font dialog appears.</P>
<P align="center"><IMG alt="" src="images/FontEditor.png"><BR>
&nbsp;</P>
<P>Any change you make in the editor is applied to the application immediately. If you press
the OK button, the change will stay. If you press the Cancel button, the font will revert
back to the original font.</P>
<H3>Icon Editor</H3>
<P>When you double-click on an Icon value, the Edit Icon dialog appears.</P>
<P align="center"><IMG alt="" src="images/IconEditor.png"><BR>
&nbsp;</P>
<P>The Edit Icon dialog has a drop down text field where you can find any existing icon on
the classpath. If you want to choose an Icon from the file system, press the "..." button and
a FileChooser will appear, allowing you to pick an icon file from anywhere in the filesystem.
Any change you make in the editor is applied to the application immediately. If you press the
OK button, the change will stay. If you press the Cancel button, the icon will revert back to
the original icon.</P>
</BLOCKQUOTE>
<H2>Theme Actions</H2>
<BLOCKQUOTE>
<H3>Switching Themes</H3>
<P>To change the current theme, first bring up the <A href="#Edit_Theme">Theme Dialog</A>.
The Theme Dialog can be invoked from the Ghidra Project Window menu using the
<B>Edit</B><IMG alt="" src="images/arrow.gif" border="0"><B>Theme</B> menu. Then select
a theme from the combo box at the top of the Theme Editor dialog.</P>
<H3>Modifying Theme Values</H3>
<P>All the colors, fonts, and icons that have been externalized can be modified using the <A
href="#Edit_Theme">Theme Dialog</A>. The Theme Dialog can be invoked from the
Ghidra Project Window using the
<B>Edit</B><IMG alt="" src="images/arrow.gif" border="0"><B>Theme</B> menu. Choose the
tab for the appropriate type and double-click on the id column or current value column of the
item you want to change. An editor for that type will appear.</P>
<H3>Reseting Theme Values</H3>
<P>To reset an individual value back to its original theme value, invoke the <A href=
"#Edit_Theme">Theme Dialog</A> using the <B>Edit</B> <IMG alt="" src="images/arrow.gif"
border="0"><B>Theme</B> menu. Switch to the appropriate tab for either colors, fonts, or
icons. Right-click on the row of the value you want to reset and choose the <B>Restore
Value</B> menu item.</P>
<H3>Reseting All Theme Values<A name="Reset_Theme_Values"></A></H3>
<P>To reset all values back to the original values established by the current theme, invoked
the <B>Edit</B><IMG alt="" src="images/arrow.gif" border="0"><B>Theme Actions</B> <IMG
alt="" src="images/arrow.gif" border="0"><B>Reset Theme Values</B> menu.</P>
<H3>Saving Themes</H3>
<P>After making changes to one or more theme values, the <A href="#Edit_Theme">Theme
Dialog's</A> <B>Save</B> button will be enabled. Pressing the <B>Save</B> button will give
the user the option of creating a new theme or overwriting the current them (if the current
theme is not a built-in theme). Also, users will have the options of saving a theme if they
dismiss the Theme Dialog while there are changes to one or more theme values.</P>
<H3>Deleting Themes<A name="Delete_Theme"></A></H3>
<P>To delete a custom saved theme, invoked the <B>Edit</B><IMG alt="" src=
"images/arrow.gif" border="0"><B>Theme Actions</B> <IMG alt="" src=
"images/arrow.gif" border="0"><B>Delete Theme...</B> menu. This will bring up a dialog
with a list of themes that can be deleted. Select the theme to delete and press the <B>Ok</B>
button.</P>
<H3>Exporting Themes&gt;<A name="Export_Theme"></A></H3>
<P>To export a theme so that it can be shared with others, invoke the <B>Edit</B> <IMG alt=""
src="images/arrow.gif" border="0"><B>Theme Actions</B> <IMG alt="" src=
"images/arrow.gif" border="0"><B>Export Theme...</B> menu. You will first be asked if
you want to export as a regular theme file or as a Zip file. The Zip file option is useful if
the current theme has icon values that are not included with standard Ghidra. In that case,
the Zip file will include those non standard icon files.</P>
<H3>Importing Themes<A name="Import_Theme"></A></H3>
<P>To import a theme, invoke the <B>Edit</B> <IMG alt="" src="images/arrow.gif" border=
"0"><B>Theme Actions</B> <IMG alt="" src="images/arrow.gif" border="0"><B>Import
Theme...</B> menu. A file chooser dialog will appear allowing the user to choose a theme file
to import. The selected file can be either a standard theme file or a Zip file containing the
theme file and any non-standard icon files defined by that theme.</P>
<H3>Reloading Default Values</H3>
<P>XThis action causes Ghidra to reload all theme default values. It is really only useful
for developers who are actively making changes to theme.properties files. To activate this
action, press the refresh button <IMG alt="" src="images/reload3.png" border="0"> in the top
right corner of the <A href="#Edit_Theme">Theme Dialog</A>.</P>
</BLOCKQUOTE>
<H2>Theme Property Names</H2>
<P>Theme Property Names (also referred to as ids or keys) that are defined by Ghidra use a
common format to help make sorting and viewing properties more intuitive as to their use.</P>
<P>The general format is:</P>
<BLOCKQUOTE>
<BLOCKQUOTE>
[type].[category[...]].[client].[specialized uses]
<UL>
<LI><B>type:</B> color, font, or icon</LI>
<LI><B>category:</B> any value, examples include "bg" (background), "fg" (foreground);
this may be multiple separated values</LI>
<LI><B>client:</B> the plugin name or feature name; any value used to represent a more
specialized use</LI>
<LI><B>specialized uses:</B> any key value here that applies to the client, such as
"vertex" for a vertex background</LI>
</UL>Examples:
<UL>
<LI>color.bg</LI>
<LI>color.bg.listing</LI>
<LI>font.button</LI>
<LI>icon.refresh</LI>
<LI>icon.refresh.disabled</LI>
</UL>
</BLOCKQUOTE>
</BLOCKQUOTE>
<H2>Theme File Format</H2>
<BLOCKQUOTE>
<P>Saved theme files have the following format:</P>
<PRE>
<CODE class="code">
name = ThemeName
lookAndFeel = Nimbus
useDarkDefaults = false
color.bg = Black
color.bg.foo = #012345
[color]Panel.background = Red
font.button = dialog-PLAIN-14
icon.refresh = images/reload3.png
color.bg.bar = color.bg.foo
color.bg.xxx = [color]Panel.background
</CODE>
</PRE>
<P>The first three properties are always the theme name, the look and feel name, and whether
the theme uses standard defaults or dark defaults. Then there is just a list of overridden
property "name = value" lines.</P>
<P>Each property line is expected to begin with either "color.", "font.", or "icon." Since
java defined properties don't start with these prefixes, they will have "[color]", "[font]",
or "[icon]" prepended to their property name. These are just there for the purposes of
parsing this file. When the properties are used in Ghidra, those bracketed prefixes are
removed.</P>
<P>Also, note that the values of these properties can reference other property names. If the
right side of the assignment is a property name and not a value, then it must also use the
bracketed prefix if the property name doesn't start with "color.", "font.", or "icon."</P>
<H3>Specifying Color Values</H3>
<P>To specify the value for a color, there are 3 acceptable formats:</P>
<UL>
<LI><B>Web Color Name</B> - Examples: Blue, Red, Black, etc.</LI>
<LI><B>Hex value</B> - #rrggbb, Example: #ff01a4, where ff is the red value, 01 is the
green value, and a4 is the blue value</LI>
<LI><B>Hex with alpha value</B> -Example: #ff01a480, where ff is the red value, 01 is the
green value, and a4 is the blue value, and 80 is the alpha value</LI>
<LI><B>RGB values</B> - Example: rgb(12, 34, 56) where red is 12(decimal), green is 34, and
blue is 56</LI>
<LI><B>RGBA values</B> - Eample: rgba(12, 34, 56, 127) where red is 12(decimal), green is
34, blue is 56, and alpha is 127</LI>
</UL>
<H3>Specifying Font Values</H3>
<P>Font values are specified as follows:</P>
<PRE>
familyName-style-size
</PRE>
<UL>
<LI><B>familyName:</B> the font family name such as "monospace", "dialog", "courier"</LI>
<LI><B>style:</B>either PLAIN, BOLD, ITALIC, or BOLDITALIC</LI>
<LI><B>size:</B> the font size such as 12, 14, 22</LI>
</UL>
<P>Examples: monospace-PLAIN-12 or courier-BOLD-15</P>
<H3>Specifying Icon Values</H3>
<P>Icon values are specified by a relative path to the icon file. There are two types of
icons; those that are included with Ghidra and those that were selected from the filesystem
and imported into the theme. Icons that have been imported into the theme are stored in an
images directory in the users Ghidra application directory. Icons included with Ghidra are
relative to an images data directory in some module. So for example,</P>
<PRE>
icon.refresh = images/view-refresh.png
icon.push = [EXTERNAL]images/energy.png
</PRE>
<P>The first example is a standard icon included with Ghidra. It exists in a module's data
directory in the images folder. The second example is for an icon that is not included with
Ghidra. The "[EXTERNAL]" prefix indicates that this icon is being stored in the user's
application directory in the images folder.</P>
</BLOCKQUOTE>
</BODY>
</HTML>
Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Some files were not shown because too many files have changed in this diff Show More