Package ghidra.app.decompiler.component
Class ClangLayoutController
- java.lang.Object
- 
- ghidra.app.decompiler.component.ClangLayoutController
 
- 
- All Implemented Interfaces:
- LayoutModel,- LayoutModelListener
 
 public class ClangLayoutController extends java.lang.Object implements LayoutModel, LayoutModelListener Control the GUI layout for displaying tokenized C code
- 
- 
Constructor SummaryConstructors Constructor Description ClangLayoutController(DecompileOptions opt, DecompilerPanel decompilerPanel, java.awt.FontMetrics met, HighlightFactory hlFactory)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLayoutModelListener(LayoutModelListener listener)Adds a LayoutModelListener to be notified when changes occur.voidbuildLayouts(Function function, ClangTokenGroup doc, java.lang.String errmsg, boolean display)booleanchangePending()voiddataChanged(java.math.BigInteger start, java.math.BigInteger end)Called when the data at an index or range of indexes changes.SearchLocationfindNextTokenForSearch(java.lang.String searchString, FieldLocation currentLocation, boolean forwardSearch)SearchLocationfindNextTokenForSearchRegex(java.lang.String searchString, FieldLocation currentLocation, boolean forwardSearch)voidflushChanges()Returns true if the model knows about changes that haven't yet been told to the LayoutModelListeners.HighFunctiongetHighFunction(int i)java.math.BigIntegergetIndexAfter(java.math.BigInteger index)Returns the closest larger index in the model that has a non-null layout.intgetIndexBefore(int index)java.math.BigIntegergetIndexBefore(java.math.BigInteger index)Returns the closest smaller index in the model that has a non-null layout.LayoutgetLayout(java.math.BigInteger index)Returns a layout for the given index.java.util.ArrayList<ClangLine>getLines()java.math.BigIntegergetNumIndexes()Returns the total number of indexes.java.awt.DimensiongetPreferredViewSize()Returns the width of the largest possible layout.ClangTokenGroupgetRoot()booleanisUniform()Returns true if every index returns a non-null layout and all the layouts are the same height.voidlayoutChanged()voidlocationChanged(FieldLocation loc, Field field, java.awt.Color locationColor, java.awt.Color parenColor)voidmodelChanged()voidmodelSizeChanged(IndexMapper mapper)Called whenever the number of indexes changedvoidremoveLayoutModelListener(LayoutModelListener listener)Removes a LayoutModelListener to be notified when changes occur.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface docking.widgets.fieldpanel.LayoutModeliterator, iterator
 
- 
 
- 
- 
- 
Constructor Detail- 
ClangLayoutControllerpublic ClangLayoutController(DecompileOptions opt, DecompilerPanel decompilerPanel, java.awt.FontMetrics met, HighlightFactory hlFactory) 
 
- 
 - 
Method Detail- 
getLinespublic java.util.ArrayList<ClangLine> getLines() 
 - 
isUniformpublic boolean isUniform() Description copied from interface:LayoutModelReturns true if every index returns a non-null layout and all the layouts are the same height.- Specified by:
- isUniformin interface- LayoutModel
 
 - 
getPreferredViewSizepublic java.awt.Dimension getPreferredViewSize() Description copied from interface:LayoutModelReturns the width of the largest possible layout.- Specified by:
- getPreferredViewSizein interface- LayoutModel
 
 - 
getNumIndexespublic java.math.BigInteger getNumIndexes() Description copied from interface:LayoutModelReturns the total number of indexes.- Specified by:
- getNumIndexesin interface- LayoutModel
 
 - 
getLayoutpublic Layout getLayout(java.math.BigInteger index) Description copied from interface:LayoutModelReturns a layout for the given index.- Specified by:
- getLayoutin interface- LayoutModel
- Parameters:
- index- the index of the layout to retrieve.
 
 - 
addLayoutModelListenerpublic void addLayoutModelListener(LayoutModelListener listener) Description copied from interface:LayoutModelAdds a LayoutModelListener to be notified when changes occur.- Specified by:
- addLayoutModelListenerin interface- LayoutModel
- Parameters:
- listener- the LayoutModelListener to add.
 
 - 
removeLayoutModelListenerpublic void removeLayoutModelListener(LayoutModelListener listener) Description copied from interface:LayoutModelRemoves a LayoutModelListener to be notified when changes occur.- Specified by:
- removeLayoutModelListenerin interface- LayoutModel
- Parameters:
- listener- the LayoutModelListener to remove.
 
 - 
modelSizeChangedpublic void modelSizeChanged(IndexMapper mapper) Description copied from interface:LayoutModelListenerCalled whenever the number of indexes changed- Specified by:
- modelSizeChangedin interface- LayoutModelListener
- Parameters:
- mapper- Maps indexes from before the model size change to indexes after the model size changed.
 
 - 
modelChangedpublic void modelChanged() 
 - 
dataChangedpublic void dataChanged(java.math.BigInteger start, java.math.BigInteger end)Description copied from interface:LayoutModelListenerCalled when the data at an index or range of indexes changes.- Specified by:
- dataChangedin interface- LayoutModelListener
- Parameters:
- start- the starting index for the region of data changes.
- end- the ending index (inclusive) for the region of data changes.
 
 - 
layoutChangedpublic void layoutChanged() 
 - 
getIndexAfterpublic java.math.BigInteger getIndexAfter(java.math.BigInteger index) Description copied from interface:LayoutModelReturns the closest larger index in the model that has a non-null layout.- Specified by:
- getIndexAfterin interface- LayoutModel
- Parameters:
- index- for which to find the next index with a non-null layout.
- Returns:
- returns the closest larger index in the model that has a non-null layout.
 
 - 
getIndexBeforepublic java.math.BigInteger getIndexBefore(java.math.BigInteger index) Description copied from interface:LayoutModelReturns the closest smaller index in the model that has a non-null layout.- Specified by:
- getIndexBeforein interface- LayoutModel
- Parameters:
- index- for which to find the previous index with a non-null layout.
- Returns:
- returns the closest smaller index in the model that has a non-null layout.
 
 - 
getIndexBeforepublic int getIndexBefore(int index) 
 - 
getRootpublic ClangTokenGroup getRoot() 
 - 
buildLayoutspublic void buildLayouts(Function function, ClangTokenGroup doc, java.lang.String errmsg, boolean display) 
 - 
getHighFunctionpublic HighFunction getHighFunction(int i) 
 - 
findNextTokenForSearchRegexpublic SearchLocation findNextTokenForSearchRegex(java.lang.String searchString, FieldLocation currentLocation, boolean forwardSearch) 
 - 
findNextTokenForSearchpublic SearchLocation findNextTokenForSearch(java.lang.String searchString, FieldLocation currentLocation, boolean forwardSearch) 
 - 
locationChangedpublic void locationChanged(FieldLocation loc, Field field, java.awt.Color locationColor, java.awt.Color parenColor) 
 - 
changePendingpublic boolean changePending() 
 - 
flushChangespublic void flushChanges() Description copied from interface:LayoutModelReturns true if the model knows about changes that haven't yet been told to the LayoutModelListeners.- Specified by:
- flushChangesin interface- LayoutModel
 
 
- 
 
-