/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see .
*/
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Media;
using dnSpy.Contracts.Hex.Formatting;
using VST = Microsoft.VisualStudio.Text;
namespace dnSpy.Contracts.Hex.Editor {
///
/// WPF hex view line collection
///
public abstract class WpfHexViewLineCollection : HexViewLineCollection {
///
/// Constructor
///
protected WpfHexViewLineCollection() { }
///
/// Gets a line
///
/// Index
///
public abstract WpfHexViewLine GetWpfHexViewLine(int index);
///
/// Gets a line
///
/// Index
///
public override HexViewLine this[int index] => GetWpfHexViewLine(index);
///
/// Gets the first visible line
///
public abstract WpfHexViewLine FirstVisibleWpfLine { get; }
///
/// Gets the last visible line
///
public abstract WpfHexViewLine LastVisibleWpfLine { get; }
///
/// Gets the first visible line
///
public override HexViewLine FirstVisibleLine => FirstVisibleWpfLine;
///
/// Gets the last visible line
///
public override HexViewLine LastVisibleLine => LastVisibleWpfLine;
///
/// Gets all the lines
///
public abstract ReadOnlyCollection WpfHexViewLines { get; }
///
/// Gets a line marker geometry
///
/// A line in this collection
/// Text span
///
public abstract Geometry? GetLineMarkerGeometry(WpfHexViewLine line, VST.Span span);
///
/// Gets a line marker geometry
///
/// A line in this collection
/// Text span
/// true to clip the geometry to the viewport
/// Padding to use
///
public abstract Geometry? GetLineMarkerGeometry(WpfHexViewLine line, VST.Span span, bool clipToViewport, Thickness padding);
///
/// Gets a text marker geometry
///
/// A line in this collection
/// Text span
///
public abstract Geometry? GetTextMarkerGeometry(WpfHexViewLine line, VST.Span span);
///
/// Gets a text marker geometry
///
/// A line in this collection
/// Text span
/// true to clip the geometry to the viewport
/// Padding to use
///
public abstract Geometry? GetTextMarkerGeometry(WpfHexViewLine line, VST.Span span, bool clipToViewport, Thickness padding);
///
/// Gets a line marker geometry
///
/// Span
/// Flags
///
public abstract Geometry? GetLineMarkerGeometry(HexBufferSpan bufferSpan, HexSpanSelectionFlags flags);
///
/// Gets a line marker geometry
///
/// Span
/// Flags
/// true to clip the geometry to the viewport
/// Padding to use
///
public abstract Geometry? GetLineMarkerGeometry(HexBufferSpan bufferSpan, HexSpanSelectionFlags flags, bool clipToViewport, Thickness padding);
///
/// Gets a marker geometry
///
/// Span
/// Flags
///
public abstract Geometry? GetMarkerGeometry(HexBufferSpan bufferSpan, HexSpanSelectionFlags flags);
///
/// Gets a marker geometry
///
/// Span
/// Flags
/// true to clip the geometry to the viewport
/// Padding to use
///
public abstract Geometry? GetMarkerGeometry(HexBufferSpan bufferSpan, HexSpanSelectionFlags flags, bool clipToViewport, Thickness padding);
///
/// Gets a text marker geometry
///
/// Span
/// Flags
///
public abstract Geometry? GetTextMarkerGeometry(HexBufferSpan bufferSpan, HexSpanSelectionFlags flags);
///
/// Gets a text marker geometry
///
/// Span
/// Flags
/// true to clip the geometry to the viewport
/// Padding to use
///
public abstract Geometry? GetTextMarkerGeometry(HexBufferSpan bufferSpan, HexSpanSelectionFlags flags, bool clipToViewport, Thickness padding);
///
/// Gets the line containing
///
/// Buffer position
///
public abstract WpfHexViewLine? GetWpfHexViewLineContainingBufferPosition(HexBufferPoint bufferPosition);
}
}