Package ghidra.app.decompiler.component

# Class ClangLayoutController

java.lang.Object
ghidra.app.decompiler.component.ClangLayoutController

All Implemented Interfaces:
  `LayoutModel`, `LayoutModelListener`, `Iterable<Layout>`

public class ClangLayoutController extends Object implements LayoutModel, LayoutModelListener
Control the GUI layout for displaying tokenized C code

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ClangLayoutController(DecompileOptions opt, DecompilerPanel decompilerPanel, FontMetrics met, FieldHighlightFactory hlFactory)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addLayoutModelListener(LayoutModelListener listener)`
  Adds a LayoutModelListener to be notified when changes occur.
  `void`
  `buildLayouts(Function function, ClangTokenGroup doc, String errmsg, boolean display)`
  `boolean`
  `changePending()`
  `void`
  `dataChanged(BigInteger start, BigInteger end)`
  Called when the data at an index or range of indexes changes.
  `SearchLocation`
  `findNextTokenForSearch(String searchString, FieldLocation currentLocation, boolean forwardSearch)`
  `SearchLocation`
  `findNextTokenForSearchRegex(String searchString, FieldLocation currentLocation, boolean forwardSearch)`
  `void`
  `flushChanges()`
  Returns true if the model knows about changes that haven't yet been told to the LayoutModelListeners.
  `HighFunction`
  `getHighFunction(int i)`
  `BigInteger`
  `getIndexAfter(BigInteger index)`
  Returns the closest larger index in the model that has a non-null layout.
  `int`
  `getIndexBefore(int index)`
  `BigInteger`
  `getIndexBefore(BigInteger index)`
  Returns the closest smaller index in the model that has a non-null layout.
  `Layout`
  `getLayout(BigInteger index)`
  Returns a layout for the given index.
  `ArrayList<ClangLine>`
  `getLines()`
  `BigInteger`
  `getNumIndexes()`
  Returns the total number of indexes.
  `Dimension`
  `getPreferredViewSize()`
  Returns the width of the largest possible layout.
  `ClangTokenGroup`
  `getRoot()`
  `boolean`
  `isUniform()`
  Returns true if every index returns a non-null layout and all the layouts are the same height.
  `void`
  `layoutChanged()`
  `void`
  `locationChanged(FieldLocation loc, Field field, Color locationColor, Color parenColor)`
  `void`
  `modelChanged()`
  `void`
  `modelSizeChanged(IndexMapper mapper)`
  Called whenever the number of indexes changed
  `void`
  `removeLayoutModelListener(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, wait`

  ### Methods inherited from interface java.lang.Iterable

  `forEach, spliterator`

  ### Methods 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

    public ArrayList<ClangLine> getLines()

  - ### isUniform

    public boolean isUniform()
    Description copied from interface: `LayoutModel`
    Returns true if every index returns a non-null layout and all the layouts are the same height.
    Specified by:
      `isUniform` in interface `LayoutModel`

  - ### getPreferredViewSize

    public Dimension getPreferredViewSize()
    Description copied from interface: `LayoutModel`
    Returns the width of the largest possible layout.
    Specified by:
      `getPreferredViewSize` in interface `LayoutModel`

  - ### getNumIndexes

    public BigInteger getNumIndexes()
    Description copied from interface: `LayoutModel`
    Returns the total number of indexes.
    Specified by:
      `getNumIndexes` in interface `LayoutModel`

  - ### getLayout

    public Layout getLayout(BigInteger index)
    Description copied from interface: `LayoutModel`
    Returns a layout for the given index.
    Specified by:
      `getLayout` in interface `LayoutModel`
    Parameters:
      `index` - the index of the layout to retrieve.

  - ### addLayoutModelListener

    public void addLayoutModelListener(LayoutModelListener listener)
    Description copied from interface: `LayoutModel`
    Adds a LayoutModelListener to be notified when changes occur.
    Specified by:
      `addLayoutModelListener` in interface `LayoutModel`
    Parameters:
      `listener` - the LayoutModelListener to add.

  - ### removeLayoutModelListener

    public void removeLayoutModelListener(LayoutModelListener listener)
    Description copied from interface: `LayoutModel`
    Removes a LayoutModelListener to be notified when changes occur.
    Specified by:
      `removeLayoutModelListener` in interface `LayoutModel`
    Parameters:
      `listener` - the LayoutModelListener to remove.

  - ### modelSizeChanged

    public void modelSizeChanged(IndexMapper mapper)
    Description copied from interface: `LayoutModelListener`
    Called whenever the number of indexes changed
    Specified by:
      `modelSizeChanged` in interface `LayoutModelListener`
    Parameters:
      `mapper` - Maps indexes from before the model size change to indexes after the model size changed.

  - ### modelChanged

    public void modelChanged()

  - ### dataChanged

    public void dataChanged(BigInteger start, BigInteger end)
    Description copied from interface: `LayoutModelListener`
    Called when the data at an index or range of indexes changes.
    Specified by:
      `dataChanged` in interface `LayoutModelListener`
    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

    public BigInteger getIndexAfter(BigInteger index)
    Description copied from interface: `LayoutModel`
    Returns the closest larger index in the model that has a non-null layout.
    Specified by:
      `getIndexAfter` in 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.

  - ### getIndexBefore

    public BigInteger getIndexBefore(BigInteger index)
    Description copied from interface: `LayoutModel`
    Returns the closest smaller index in the model that has a non-null layout.
    Specified by:
      `getIndexBefore` in 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.

  - ### getIndexBefore

    public int getIndexBefore(int index)

  - ### getRoot

    public ClangTokenGroup getRoot()

  - ### buildLayouts

    public void buildLayouts(Function function, ClangTokenGroup doc, String errmsg, boolean display)

  - ### getHighFunction

    public HighFunction getHighFunction(int i)

  - ### findNextTokenForSearchRegex

    public SearchLocation findNextTokenForSearchRegex(String searchString, FieldLocation currentLocation, boolean forwardSearch)

  - ### findNextTokenForSearch

    public SearchLocation findNextTokenForSearch(String searchString, FieldLocation currentLocation, boolean forwardSearch)

  - ### locationChanged

    public void locationChanged(FieldLocation loc, Field field, Color locationColor, Color parenColor)

  - ### changePending

    public boolean changePending()

  - ### flushChanges

    public void flushChanges()
    Description copied from interface: `LayoutModel`
    Returns true if the model knows about changes that haven't yet been told to the LayoutModelListeners.
    Specified by:
      `flushChanges` in interface `LayoutModel`