File indexing completed on 2024-05-12 09:56:58
0001 /* 0002 SPDX-FileCopyrightText: 2007-2008 Robert Knight <robertknight@gmail.com> 0003 SPDX-FileCopyrightText: 2020 Tomaz Canabrava <tcanabrava@gmail.com> 0004 0005 SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #ifndef TERMINAL_IMAGE_FILTER_CHAIN 0009 #define TERMINAL_IMAGE_FILTER_CHAIN 0010 0011 #include <QString> 0012 #include <memory> 0013 0014 #include "../characters/Character.h" 0015 #include "FilterChain.h" 0016 0017 namespace Konsole 0018 { 0019 class TerminalDisplay; 0020 0021 /** A filter chain which processes character images from terminal displays */ 0022 class KONSOLEPRIVATE_EXPORT TerminalImageFilterChain : public FilterChain 0023 { 0024 public: 0025 explicit TerminalImageFilterChain(TerminalDisplay *terminalDisplay); 0026 ~TerminalImageFilterChain() override; 0027 0028 /** 0029 * Set the current terminal image to @p image. 0030 * 0031 * @param image The terminal image 0032 * @param lines The number of lines in the terminal image 0033 * @param columns The number of columns in the terminal image 0034 * @param lineProperties The line properties to set for image 0035 */ 0036 void setImage(const Character *const image, int lines, int columns, const QVector<LineProperty> &lineProperties); 0037 0038 private: 0039 Q_DISABLE_COPY(TerminalImageFilterChain) 0040 0041 /* usually QStrings and QLists are not supposed to be in the heap, here we have a problem: 0042 we need a shared memory space between many filter objeccts, defined by this TerminalImage. */ 0043 std::unique_ptr<QString> _buffer; 0044 std::unique_ptr<QList<int>> _linePositions; 0045 }; 0046 0047 } 0048 #endif