Package ghidra.app.decompiler.component
Class ClangHighlightController
- java.lang.Object
-
- ghidra.app.decompiler.component.ClangHighlightController
-
- Direct Known Subclasses:
LocationClangHighlightController
public abstract class ClangHighlightController extends java.lang.Object
Class to handle highlights for a decompiled function.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.Color
defaultHighlightColor
protected java.awt.Color
defaultNonFunctionBackgroundColor
protected java.awt.Color
defaultParenColor
protected java.awt.Color
defaultSpecialColor
protected java.util.ArrayList<ClangHighlightListener>
highlightListenerList
protected java.util.HashSet<ClangToken>
highlightTokenSet
-
Constructor Summary
Constructors Constructor Description ClangHighlightController()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addHighlight(ClangToken clangToken, java.awt.Color highlightColor)
void
addHighlightBrace(ClangSyntaxToken token, java.awt.Color highlightColor)
void
addHighlightFill()
Add highlighting to tokens that are surrounded by highlighted tokens, but which have no addressjava.util.List<ClangToken>
addHighlightParen(ClangSyntaxToken tok, java.awt.Color highlightColor)
If input token is a parenthesis, highlight all tokens between it and its matchboolean
addListener(ClangHighlightListener listener)
void
addPcodeOpsToHighlight(ClangNode parentNode, java.util.Set<PcodeOp> ops, java.awt.Color highlightColor)
void
addTokensToHighlights(java.util.List<ClangToken> tokenList, java.awt.Color highlightColor)
void
addVarnodesToHighlight(ClangNode parentNode, java.util.Set<Varnode> varnodes, java.awt.Color highlightColor, Varnode specificvn, PcodeOp specificop, java.awt.Color specialColor)
void
clearHighlight(ClangToken clangToken)
void
clearHighlights()
void
doAddHighlight(ClangToken clangToken, java.awt.Color highlightColor)
abstract void
fieldLocationChanged(FieldLocation location, Field field, EventTrigger trigger)
java.awt.Color
getDefaultHighlightColor()
java.awt.Color
getDefaultParenColor()
java.awt.Color
getDefaultSpecialColor()
java.lang.String
getHighlightedText()
ClangToken
getHighlightedToken()
Return the current highlighted token (if exists and unique)boolean
isHighlighted(ClangToken clangToken)
boolean
removeListener(ClangHighlightListener listener)
void
setDefaultHighlightColor(java.awt.Color highlightColor)
void
setDefaultParenColor(java.awt.Color parenColor)
void
setDefaultSpecialColor(java.awt.Color specialColor)
-
-
-
Field Detail
-
defaultNonFunctionBackgroundColor
protected java.awt.Color defaultNonFunctionBackgroundColor
-
defaultHighlightColor
protected java.awt.Color defaultHighlightColor
-
defaultSpecialColor
protected java.awt.Color defaultSpecialColor
-
defaultParenColor
protected java.awt.Color defaultParenColor
-
highlightTokenSet
protected java.util.HashSet<ClangToken> highlightTokenSet
-
highlightListenerList
protected java.util.ArrayList<ClangHighlightListener> highlightListenerList
-
-
Method Detail
-
fieldLocationChanged
public abstract void fieldLocationChanged(FieldLocation location, Field field, EventTrigger trigger)
-
setDefaultHighlightColor
public void setDefaultHighlightColor(java.awt.Color highlightColor)
-
setDefaultSpecialColor
public void setDefaultSpecialColor(java.awt.Color specialColor)
-
setDefaultParenColor
public void setDefaultParenColor(java.awt.Color parenColor)
-
getDefaultHighlightColor
public java.awt.Color getDefaultHighlightColor()
-
getDefaultSpecialColor
public java.awt.Color getDefaultSpecialColor()
-
getDefaultParenColor
public java.awt.Color getDefaultParenColor()
-
getHighlightedText
public java.lang.String getHighlightedText()
-
getHighlightedToken
public ClangToken getHighlightedToken()
Return the current highlighted token (if exists and unique)- Returns:
- token or null
-
addVarnodesToHighlight
public void addVarnodesToHighlight(ClangNode parentNode, java.util.Set<Varnode> varnodes, java.awt.Color highlightColor, Varnode specificvn, PcodeOp specificop, java.awt.Color specialColor)
-
addPcodeOpsToHighlight
public void addPcodeOpsToHighlight(ClangNode parentNode, java.util.Set<PcodeOp> ops, java.awt.Color highlightColor)
-
addTokensToHighlights
public void addTokensToHighlights(java.util.List<ClangToken> tokenList, java.awt.Color highlightColor)
-
clearHighlights
public void clearHighlights()
-
addHighlight
public void addHighlight(ClangToken clangToken, java.awt.Color highlightColor)
-
doAddHighlight
public void doAddHighlight(ClangToken clangToken, java.awt.Color highlightColor)
-
clearHighlight
public void clearHighlight(ClangToken clangToken)
-
isHighlighted
public boolean isHighlighted(ClangToken clangToken)
-
addHighlightParen
public java.util.List<ClangToken> addHighlightParen(ClangSyntaxToken tok, java.awt.Color highlightColor)
If input token is a parenthesis, highlight all tokens between it and its match- Parameters:
tok
- = potential parenthesis token- Returns:
- a list of all tokens that were highlighted.
-
addHighlightBrace
public void addHighlightBrace(ClangSyntaxToken token, java.awt.Color highlightColor)
-
addHighlightFill
public void addHighlightFill()
Add highlighting to tokens that are surrounded by highlighted tokens, but which have no address
-
addListener
public boolean addListener(ClangHighlightListener listener)
-
removeListener
public boolean removeListener(ClangHighlightListener listener)
-
-