Package ghidra.app.decompiler.component

# Class DecompilerController

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

public class DecompilerController extends Object
Coordinates the interactions between the DecompilerProvider, DecompilerPanel, and the DecompilerManager

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DecompilerController(DecompilerCallbackHandler handler, DecompileOptions options, ghidra.app.plugin.core.decompile.DecompilerClipboardProvider clipboard)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `clear()`
  clears all internal state and releases all resources.
  `void`
  `clearCache()`
  `void`
  `display(Program program, ProgramLocation location, ViewerPosition viewerPosition)`
  Shows the function containing the given location in the decompilerPanel.
  `void`
  `dispose()`
  Called by the provider when the provider is disposed.
  `void`
  `doWhenNotBusy(Callback c)`
  `void`
  `exportLocation()`
  `ClangTokenGroup`
  `getCCodeModel()`
  `DecompileData`
  `getDecompileData()`
  `DecompilerPanel`
  `getDecompilerPanel()`
  `Function`
  `getFunction()`
  `HighFunction`
  `getHighFunction()`
  `ProgramLocation`
  `getLocation()`
  `Program`
  `getProgram()`
  `boolean`
  `hasDecompileResults()`
  `boolean`
  `isDecompiling()`
  `void`
  `programClosed(Program closedProgram)`
  `void`
  `refreshDisplay(Program program, ProgramLocation location, File debugFile)`
  Always decompiles the function containing the given location before positioning the decompilerPanel's cursor to the closest equivalent position.
  `void`
  `resetDecompiler()`
  Resets the native decompiler process.
  `void`
  `setDecompileData(DecompileData decompileData)`
  Called by the DecompilerManager to update the currently displayed DecompileData
  `void`
  `setMouseNavigationEnabled(boolean enabled)`
  `void`
  `setOptions(DecompileOptions decompilerOptions)`
  Sets new decompiler options and triggers a new decompile.
  `void`
  `setSelection(ProgramSelection selection)`
  `void`
  `setStatusMessage(String message)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### DecompilerController

    public DecompilerController(DecompilerCallbackHandler handler, DecompileOptions options, ghidra.app.plugin.core.decompile.DecompilerClipboardProvider clipboard)

- ## Method Details

  - ### getDecompilerPanel

    public DecompilerPanel getDecompilerPanel()

  - ### dispose

    public void dispose()
    Called by the provider when the provider is disposed. Once dispose is called, it should never be used again.

  - ### clear

    public void clear()
    clears all internal state and releases all resources. Called when the provider is no longer visible or the currently displayed program is closed.

  - ### display

    public void display(Program program, ProgramLocation location, ViewerPosition viewerPosition)
    Shows the function containing the given location in the decompilerPanel. Also, positions the decompilerPanel's cursor to the closest equivalent position. If the decompilerPanel is already displaying the function, then only the cursor is repositioned. To force a re-decompile use `refreshDisplay(Program, ProgramLocation, File)`.
    Parameters:
      `program` - the program for the given location
      `location` - the location containing the function to be displayed and the location in that function to position the cursor.
      `viewerPosition` - the viewer position

  - ### setSelection

    public void setSelection(ProgramSelection selection)

  - ### setOptions

    public void setOptions(DecompileOptions decompilerOptions)
    Sets new decompiler options and triggers a new decompile.
    Parameters:
      `decompilerOptions` - the options

  - ### isDecompiling

    public boolean isDecompiling()

  - ### setMouseNavigationEnabled

    public void setMouseNavigationEnabled(boolean enabled)

  - ### resetDecompiler

    public void resetDecompiler()
    Resets the native decompiler process. Call this method when the decompiler's view of a program has been invalidated, such as when a new overlay space has been added.

  - ### setDecompileData

    public void setDecompileData(DecompileData decompileData)
    Called by the DecompilerManager to update the currently displayed DecompileData
    Parameters:
      `decompileData` - the new data

  - ### doWhenNotBusy

    public void doWhenNotBusy(Callback c)

  - ### refreshDisplay

    public void refreshDisplay(Program program, ProgramLocation location, File debugFile)
    Always decompiles the function containing the given location before positioning the decompilerPanel's cursor to the closest equivalent position.
    Parameters:
      `program` - the program for the given location
      `location` - the location containing the function to be displayed and the location in that function to position the cursor.
      `debugFile` - the debug file

  - ### hasDecompileResults

    public boolean hasDecompileResults()

  - ### getCCodeModel

    public ClangTokenGroup getCCodeModel()

  - ### setStatusMessage

    public void setStatusMessage(String message)

  - ### getProgram

    public Program getProgram()

  - ### getFunction

    public Function getFunction()

  - ### getHighFunction

    public HighFunction getHighFunction()

  - ### getLocation

    public ProgramLocation getLocation()

  - ### getDecompileData

    public DecompileData getDecompileData()

  - ### exportLocation

    public void exportLocation()

  - ### clearCache

    public void clearCache()

  - ### programClosed

    public void programClosed(Program closedProgram)