Package ghidra.app.decompiler.component
Class ClangLayoutController
java.lang.Object
ghidra.app.decompiler.component.ClangLayoutController
- All Implemented Interfaces:
LayoutModel,LayoutModelListener,Iterable<Layout>
Control the GUI layout for displaying tokenized C code
-
Constructor Summary
ConstructorsConstructorDescriptionClangLayoutController(DecompileOptions opt, DecompilerPanel decompilerPanel, FontMetrics met, FieldHighlightFactory hlFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLayoutModelListener(LayoutModelListener listener) Adds a LayoutModelListener to be notified when changes occur.voidbuildLayouts(Function function, ClangTokenGroup doc, String errmsg, boolean display) voiddataChanged(BigInteger start, BigInteger end) Called when the data at an index or range of indexes changes.voidReturns true if the model knows about changes that haven't yet been told to the LayoutModelListeners.getHighFunction(int i) getIndexAfter(BigInteger index) Returns the closest larger index in the model that has a non-null layout.intgetIndexBefore(int index) getIndexBefore(BigInteger index) Returns the closest smaller index in the model that has a non-null layout.getLayout(BigInteger index) Returns a layout for the given index.getLines()Returns the total number of indexes.Returns the width of the largest possible layout.getRoot()booleanReturns true if every index returns a non-null layout and all the layouts are the same height.voidvoidlocationChanged(FieldLocation loc, Field field, Color locationColor, Color parenColor) voidvoidmodelSizeChanged(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.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface docking.widgets.fieldpanel.LayoutModel
iterator, iterator
-
Constructor Details
-
ClangLayoutController
public ClangLayoutController(DecompileOptions opt, DecompilerPanel decompilerPanel, FontMetrics met, FieldHighlightFactory hlFactory)
-
-
Method Details
-
getLines
-
isUniform
public 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 interfaceLayoutModel
-
getPreferredViewSize
Description copied from interface:LayoutModelReturns the width of the largest possible layout.- Specified by:
getPreferredViewSizein interfaceLayoutModel
-
getNumIndexes
Description copied from interface:LayoutModelReturns the total number of indexes.- Specified by:
getNumIndexesin interfaceLayoutModel
-
getLayout
Description copied from interface:LayoutModelReturns a layout for the given index.- Specified by:
getLayoutin interfaceLayoutModel- Parameters:
index- the index of the layout to retrieve.
-
addLayoutModelListener
Description copied from interface:LayoutModelAdds a LayoutModelListener to be notified when changes occur.- Specified by:
addLayoutModelListenerin interfaceLayoutModel- Parameters:
listener- the LayoutModelListener to add.
-
removeLayoutModelListener
Description copied from interface:LayoutModelRemoves a LayoutModelListener to be notified when changes occur.- Specified by:
removeLayoutModelListenerin interfaceLayoutModel- Parameters:
listener- the LayoutModelListener to remove.
-
modelSizeChanged
Description copied from interface:LayoutModelListenerCalled whenever the number of indexes changed- Specified by:
modelSizeChangedin interfaceLayoutModelListener- Parameters:
mapper- Maps indexes from before the model size change to indexes after the model size changed.
-
modelChanged
public void modelChanged() -
dataChanged
Description copied from interface:LayoutModelListenerCalled when the data at an index or range of indexes changes.- Specified by:
dataChangedin interfaceLayoutModelListener- Parameters:
start- the starting index for the region of data changes.end- the ending index (inclusive) for the region of data changes.
-
layoutChanged
public void layoutChanged() -
getIndexAfter
Description copied from interface:LayoutModelReturns the closest larger index in the model that has a non-null layout.- Specified by:
getIndexAfterin interfaceLayoutModel- 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.
-
getIndexBefore
Description copied from interface:LayoutModelReturns the closest smaller index in the model that has a non-null layout.- Specified by:
getIndexBeforein interfaceLayoutModel- 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.
-
getIndexBefore
public int getIndexBefore(int index) -
getRoot
-
buildLayouts
-
getHighFunction
-
locationChanged
-
flushChanges
public 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 interfaceLayoutModel
-