Logo Search packages:      
Sourcecode: codeblocks version File versions  Download package

Public Types | Public Member Functions | Protected Member Functions | Private Attributes

HexEditViewBase Class Reference

Base class for the view in editor area. More...

#include <HexEditViewBase.h>

Inheritance diagram for HexEditViewBase:
Inheritance graph
Collaboration diagram for HexEditViewBase:
Collaboration graph

List of all members.

Public Types

typedef FileContentBase::OffsetT OffsetT

Public Member Functions

void CalculateBlockSize (OffsetT screenStartOffset, OffsetT currentOffset, OffsetT &blockStart, OffsetT &blockEnd)
 Calculate size of block at current offset's position.
bool GetActive ()
 Get the active state.
OffsetT GetBlockEndOffset ()
 Get block end offset.
void GetBlockSizes (int &blockLength, int &blockBytes, int &spacing)
 Get block sizez.
OffsetT GetBlockStartOffset ()
 Get block start offset.
OffsetT GetCurrentOffset ()
 Get current position offset.
int GetCurrentPositionFlags ()
 Get flags for current offset.
int GetOffsetFromColumn (int column, int &positionFlags)
 Detect offset from position in line.
OffsetT GetScreenStartOffset ()
 Get scrren start offset.
 HexEditViewBase (HexEditPanel *panel)
void JumpToOffset (OffsetT screenStartOffset, OffsetT currentOffset, OffsetT blockStart, OffsetT blockEnd, int positionFlags)
 Jump to given offset and calculate range for current data block.
void MoveDown ()
 Move cursor down.
void MoveLeft ()
 Move cursor left.
void MoveRight ()
 Move cursor right.
void MoveUp ()
 Move cursor up.
void PutChar (wxChar ch)
 Drop a character into this view.
void PutLine (OffsetT lineStartOffset, HexEditLineBuffer &buffer, char *content, int bytes)
 Put given line into line buffer.
bool SetActive (bool makeMeActive=true)
 Activate this view.
virtual ~HexEditViewBase ()

Protected Member Functions

void ContentChange ()
 Notify about content change.
FileContentBaseGetContent ()
 Fetch assigned file content.
unsigned int GetLineBytes ()
 Get length of one line.
void OffsetChange (OffsetT currentOffset)
 Notify about offset change.
virtual void OnActivate (bool becomesActive)=0
 Called when switching the active state.
virtual void OnCalculateBlockSize (OffsetT &blockStart, OffsetT &blockEnd)
 Detect block start and end at given offset.
virtual void OnGetBlockSizes (int &blockLength, int &blockBytes, int &spacing)=0
 Fetching informations about current data block sizes.
virtual int OnGetCurrentPositionFlags ()
 Called when fetching current position flags.
virtual int OnGetOffsetFromColumn (int column, int &positionFlags)=0
 Calculate offset from the beginning of the line at given position.
virtual void OnMoveDown ()=0
 Called when moving down.
virtual void OnMoveLeft ()=0
 Called when moving left.
virtual void OnMoveRight ()=0
 Called when moving right.
virtual void OnMoveUp ()=0
 Called when moving up.
virtual void OnOffsetChange (int positionFlags)
 Called when changing current cursor offset.
virtual void OnProcessChar (wxChar)=0
 Called when character is sent to this view.
virtual void OnPutLine (OffsetT startOffset, HexEditLineBuffer &buff, char *content, int bytes)=0
 Called when there's need to fill line buffer for this content.

Private Attributes

OffsetT m_BlockEndOffset
 End offset of current data block.
OffsetT m_BlockStartOffset
 Start offset of current data block.
OffsetT m_CurrentOffset
 Offset of current byte.
bool m_IsActive
 Set to true if this view is active (has keyboard focus)
 Owning panel.
OffsetT m_ScreenStartOffset
 Offset of first data byte shown on the screen.

Detailed Description

Base class for the view in editor area.

This is base interface used to represent views inside of the editor (like the hex view or character preview, I don't know anything about other usages at the momment of writing this peace of code ;) )

Offtopic: There's strange story about how this class was created I tried to make some nice solution for the problem with lack of editor's flexibility. I tied at least four solutions and I was dropping the m one after another since more problems were found while coding. Finally I was so angry about that that I said "God help me" ... and the solution was just few hours later, jumped into my mind just with all those details needed to make it work. Yeah, for me it's a proof that God really exists and that He cares about the Open-Source community :)

Definition at line 49 of file HexEditViewBase.h.

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index