mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
45
Libraries/LibLine/StringMetrics.h
Normal file
45
Libraries/LibLine/StringMetrics.h
Normal file
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* Copyright (c) 2020-2021, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Types.h>
|
||||
#include <AK/Vector.h>
|
||||
|
||||
namespace Line {
|
||||
|
||||
struct StringMetrics {
|
||||
struct MaskedChar {
|
||||
size_t position { 0 };
|
||||
size_t original_length { 0 };
|
||||
size_t masked_length { 0 };
|
||||
};
|
||||
struct LineMetrics {
|
||||
Vector<MaskedChar> masked_chars;
|
||||
size_t length { 0 };
|
||||
size_t visible_length { 0 };
|
||||
Optional<size_t> bit_length { 0 };
|
||||
|
||||
size_t total_length() const { return length; }
|
||||
};
|
||||
|
||||
Vector<LineMetrics> line_metrics;
|
||||
Vector<size_t> grapheme_breaks {};
|
||||
size_t total_length { 0 };
|
||||
size_t max_line_length { 0 };
|
||||
|
||||
size_t lines_with_addition(StringMetrics const& offset, size_t column_width) const;
|
||||
size_t offset_with_addition(StringMetrics const& offset, size_t column_width) const;
|
||||
void reset()
|
||||
{
|
||||
line_metrics.clear();
|
||||
total_length = 0;
|
||||
max_line_length = 0;
|
||||
line_metrics.append({ {}, 0 });
|
||||
}
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue