frysk.gui.srcwin
Class InlineBuffer

java.lang.Object
  extended by org.gnu.glib.Struct
      extended by org.gnu.glib.GObject
          extended by org.gnu.gtk.TextBuffer
              extended by frysk.gui.srcwin.SourceBuffer
                  extended by frysk.gui.srcwin.InlineBuffer

public class InlineBuffer
extends SourceBuffer

The InlineBuffer performs much of the same functionality as the SourceBuffer, but also acts as an adapter to make the SourceWindow using it think that the function being displayed is actually a whole file, and that nothing exists beyond it. It also overrides some parent methods to take into acccount ellipsis


Nested Class Summary
 
Nested classes/interfaces inherited from class frysk.gui.srcwin.SourceBuffer
SourceBuffer.CommentList
 
Field Summary
(package private)  DebugInfoFrame currentFrame
           
private  DOMFunction declaration
           
private  org.gnu.gtk.TextChildAnchor ellipsisAnchor
           
private  DOMInlineInstance instance
           
private  DebugInfo stab
           
 
Fields inherited from class frysk.gui.srcwin.SourceBuffer
anchor, ASM_MODE, CLASS_TAG, COMMENT_TAG, comments, CURRENT_LINE, debugInfo, FOUND_TEXT, INLINE_TAG, MEMBER_TAG, MIXED_MODE, OUTER_LINE, scope, SOURCE_MODE
 
Fields inherited from class org.gnu.glib.GObject
eventsInitialized
 
Constructor Summary
InlineBuffer(DOMInlineInstance instance, DebugInfoFrame frame)
          Creates a new InlineBuffer to reflect the provided instance
 
Method Summary
 org.gnu.gtk.TextChildAnchor createEllipsisAnchor()
          Creates the anchor to hold the ellipsis.
protected  void createTags()
          Creates the tags, again taking into account the offset from the start of the file
 int getFirstLine()
           
 DOMInlineInstance getInlineInstance(int lineNumber)
           
 int getLastLine()
          Returns the last line being displayed
 int getLineCount()
          Returns the number of lines in this function, note that this is different than the number of lines in the file it is contained in
 String getVariable(org.gnu.gtk.TextIter iter)
          We need to do a little fancier Voodoo than the superclass to actually calculate variable values, since we're only displaying the inline function
 boolean hasInlineCode(int lineNumber)
          Ignores the line number (except to check that it is the current line), and returns whether or not this inlined code level has any further levels
 boolean isLineBroken(int lineNum)
          Returns true if the given line has a breakpoint set.
 boolean isLineExecutable(int lineNum)
          Returns true if the given line is executable.
protected  String loadLines(Iterator lines)
          Overriden.
 void moveDown()
          Tells the buffer to move down a scope level.
 void moveUp()
          Tells the buffer to move up a scope level.
 boolean toggleBreakpoint(int lineNum)
          Toggles the breakpoint on line lineNum, returning the previous state of the breakpoint on that line.
 
Methods inherited from class frysk.gui.srcwin.SourceBuffer
addComment, clear, clearAnchorAtCurrentLine, createAnchorAtCurrentLine, disassembleFrame, findNext, findPrevious, getCurrentLine, getFunctions, getNumberOfAssemblyLines, getScope, getStartCurrentFind, getVariable, getWordAtIter, highlightLine, loadAssembly, loadFile, setLineBroken, setMode, setScope, setScope
 
Methods inherited from class org.gnu.gtk.TextBuffer
addClipboard, addListener, applyTag, applyTag, backspace, beginUserAction, copyClipboard, create_tag, createChildAnchor, createMark, createTag, cutClipboard, deleteMark, deleteMark, deleteSelection, deleteText, deleteTextInteractive, endUserAction, findListener, fireTextBufferEvent, getCharCount, getEndIter, getEventListenerClass, getEventType, getInsert, getIter, getIter, getIter, getIter, getLineIter, getMark, getModified, getSelected, getSelectionBound, getSelectionEnd, getSelectionStart, getSlice, getStartIter, getText, getTextBuffer, getTextTagTable, getType, gtk_text_buffer_add_selection_clipboard, gtk_text_buffer_apply_tag_by_name, gtk_text_buffer_apply_tag, gtk_text_buffer_begin_user_action, gtk_text_buffer_copy_clipboard, gtk_text_buffer_create_child_anchor, gtk_text_buffer_create_mark, gtk_text_buffer_cut_clipboard, gtk_text_buffer_delete_interactive, gtk_text_buffer_delete_mark_by_name, gtk_text_buffer_delete_mark, gtk_text_buffer_delete_selection, gtk_text_buffer_delete, gtk_text_buffer_end_user_action, gtk_text_buffer_get_char_count, gtk_text_buffer_get_end_iter, gtk_text_buffer_get_insert, gtk_text_buffer_get_iter_at_child_anchor, gtk_text_buffer_get_iter_at_line_offset, gtk_text_buffer_get_iter_at_line, gtk_text_buffer_get_iter_at_mark, gtk_text_buffer_get_iter_at_offset, gtk_text_buffer_get_line_count, gtk_text_buffer_get_mark, gtk_text_buffer_get_modified, gtk_text_buffer_get_selection_bound, gtk_text_buffer_get_selection_end, gtk_text_buffer_get_selection_exists, gtk_text_buffer_get_selection_start, gtk_text_buffer_get_slice, gtk_text_buffer_get_start_iter, gtk_text_buffer_get_tag_table, gtk_text_buffer_get_text, gtk_text_buffer_get_type, gtk_text_buffer_insert_at_cursor, gtk_text_buffer_insert_child_anchor, gtk_text_buffer_insert_interactive_at_cursor, gtk_text_buffer_insert_interactive, gtk_text_buffer_insert_pixbuf, gtk_text_buffer_insert_range_interactive, gtk_text_buffer_insert_range, gtk_text_buffer_insert, gtk_text_buffer_move_mark_by_name, gtk_text_buffer_move_mark, gtk_text_buffer_new_noTable, gtk_text_buffer_new, gtk_text_buffer_paste_clipboard, gtk_text_buffer_paste_clipboardInsertPosition, gtk_text_buffer_place_cursor, gtk_text_buffer_remove_all_tags, gtk_text_buffer_remove_selection_clipboard, gtk_text_buffer_remove_tag_by_name, gtk_text_buffer_remove_tag, gtk_text_buffer_select_range, gtk_text_buffer_set_modified, gtk_text_buffer_set_text, inserChildAnchor, insert_with_tag, insertPixbuf, insertRange, insertRangeInteractive, insertText, insertText, insertText, insertText, insertTextInteractive, insertTextInteractive, markExists, moveMark, moveMark, pasteClipboard, pasteClipboard, placeCursor, removeAllTags, removeAllTags, removeClipboard, removeListener, removeTag, removeTag, selectRange, setModified, setText
 
Methods inherited from class org.gnu.glib.GObject
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addListener, collect, finalize, freezeNotify, getBooleanProperty, getData, getData, getDoubleProperty, getFloatProperty, getGObjectFromHandle, getIntFromHandle, getIntProperty, getJavaObjectProperty, getLongProperty, getPixbufProperty, getProperty, getStringFromHandle, getStringProperty, hasProperty, instantiateJGObjectFromGType, notify, removeEventHandler, removeListener, retrieveGObject, setBooleanProperty, setData, setData, setDoubleProperty, setFloatProperty, setIntProperty, setJavaObjectProperty, setLongProperty, setPixbufProperty, setProperty, setStringProperty, thawNotify
 
Methods inherited from class org.gnu.glib.Struct
equals, getHandle, getNullHandle, hashCode, setHandle
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

declaration

private DOMFunction declaration

instance

private DOMInlineInstance instance

ellipsisAnchor

private org.gnu.gtk.TextChildAnchor ellipsisAnchor

currentFrame

DebugInfoFrame currentFrame

stab

private DebugInfo stab
Constructor Detail

InlineBuffer

public InlineBuffer(DOMInlineInstance instance,
                    DebugInfoFrame frame)
Creates a new InlineBuffer to reflect the provided instance

Parameters:
instance - The inlined instance to display
frame - The file that the declaration is in
Method Detail

loadLines

protected String loadLines(Iterator lines)
Overriden. we ignore the iterator to the lines and instead give back the lines of the function

Overrides:
loadLines in class SourceBuffer
Parameters:
lines - Iterator of the lines to store in this SourceBuffer
Returns:
What should be the contents of the buffer

hasInlineCode

public boolean hasInlineCode(int lineNumber)
Ignores the line number (except to check that it is the current line), and returns whether or not this inlined code level has any further levels

Overrides:
hasInlineCode in class SourceBuffer
Parameters:
lineNumber - the line to check
Returns:
true iff the given line has inlined code

getLineCount

public int getLineCount()
Returns the number of lines in this function, note that this is different than the number of lines in the file it is contained in

Overrides:
getLineCount in class SourceBuffer
Returns:
The number of lines in the file

getLastLine

public int getLastLine()
Returns the last line being displayed

Overrides:
getLastLine in class SourceBuffer
Returns:
The number of the last line in the buffer, which may or may not be the same as the number of lines in the buffer due to an initial offset

getFirstLine

public int getFirstLine()
Returns:
The number of the first line being displayed

isLineExecutable

public boolean isLineExecutable(int lineNum)
Description copied from class: SourceBuffer
Returns true if the given line is executable.

Overrides:
isLineExecutable in class SourceBuffer
Parameters:
lineNum - The line to check
Returns:
Whether or not the line is executable

isLineBroken

public boolean isLineBroken(int lineNum)
Description copied from class: SourceBuffer
Returns true if the given line has a breakpoint set.

Overrides:
isLineBroken in class SourceBuffer
Returns:

toggleBreakpoint

public boolean toggleBreakpoint(int lineNum)
Description copied from class: SourceBuffer
Toggles the breakpoint on line lineNum, returning the previous state of the breakpoint on that line.

Overrides:
toggleBreakpoint in class SourceBuffer
Parameters:
lineNum - the number of the line to toggle the breakpoint for, starting at 0
Returns:
true if breakpoint was previously set on lineNum, false otherwise

getInlineInstance

public DOMInlineInstance getInlineInstance(int lineNumber)
Overrides:
getInlineInstance in class SourceBuffer
Parameters:
lineNumber - The line number to get Inline information from
Returns:
The DOMInlineInstance containing the inlined code information, or null if no information exists

getVariable

public String getVariable(org.gnu.gtk.TextIter iter)
We need to do a little fancier Voodoo than the superclass to actually calculate variable values, since we're only displaying the inline function

Overrides:
getVariable in class SourceBuffer
Parameters:
iter - The location to look for a variable
Returns:
The variable at that location, or null

createEllipsisAnchor

public org.gnu.gtk.TextChildAnchor createEllipsisAnchor()
Creates the anchor to hold the ellipsis.

Returns:
The anchor created

createTags

protected void createTags()
Creates the tags, again taking into account the offset from the start of the file


moveDown

public void moveDown()
Tells the buffer to move down a scope level. It is assumed that this method will not be called (and if so have no effect) when this is the lowest level of inlined code


moveUp

public void moveUp()
Tells the buffer to move up a scope level. It is assumed that this is not the topmost level already, and if so nothing happens