Skip to content
This repository has been archived by the owner on Oct 16, 2021. It is now read-only.

Pasting (Call Stack)

nyanpasu64 edited this page Jun 3, 2018 · 6 revisions

Updated Docs


Most recent call last.

Ctrl+V (disables clipboard during breakpoint, call stack is inaccurate)

  • CFV::OnEditPaste
  • CFV::AddAction
  • CMainFrame::AddAction
  • CPatternAction::Redo
  • CPatternEditor::Paste(pClipData, m_iPastePos)

Pasting accesses CFamiTrackerView::m_iPastePos .

Drag and drop

  • CPatternAction::SetDragAndDrop
    • PASTE_DRAG

then

  • CFamiTrackerView::OnMouseMove
  • CPatternEditor::OnMouseMove
  • CPatternEditor::ContinueMouseSelection
  • CFamiTrackerView::BeginDragData
    • COleDataSource::DoDragDrop
    • ...
    • COleDropTarget::OnDrop
  • CFamiTrackerView::OnDrop
    • Renamed CFamiTrackerView::m_iClipboard to mClipboardFormat.
  • CPatternEditor::PerformDrop
  • CMainFrame::AddAction
  • CPatternAction::Redo
  • CPatternEditor::DragPaste
  • CPatternEditor::Paste(pClipData, PASTE_DRAG)

Swap-Paste

  • Swap middle-click with selection (middle-click with selection)
    • Afterwards, middle-click is selected.
  • Swap keyboard cursor with clipboard (Ctrl-Shift-V, may/not implement if I feel like it)

Swap middle-click with selection

  • CMainFrame::AddAction
  • CPatternAction::Redo
  • CPatternEditor::pasteSwap:
// Swap middle-click with selection (middle-click with selection)

CPatternClipData selBuffer = ???;
    - void CPatternClipData::FromMem(HGLOBAL hMem)
    - fuck win32 handles
CPatternClipData clickBuffer = ???;

// write clickBuffer to selPoint;
Paste(clickBuffer, PASTE_DEFAULT, PASTE_SELECTION);

// write selection to clickPoint;
Paste(selBuffer, PASTE_DEFAULT, PASTE_CURSOR);

// Afterwards, middle-click is selected.
???
void CPatternEditor::Paste(const CPatternClipData, const paste_mode_t, const paste_pos_t)