wxMaxima
Loading...
Searching...
No Matches
Bidi.h
Go to the documentation of this file.
1// -*- mode: c++; c-file-style: "linux"; c-basic-offset: 2; indent-tabs-mode: nil -*-
2// Copyright (C) 2026 Claude
3//
4// This program is free software; you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation; either version 2 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14//
15// You should have received a copy of the GNU General Public License
16// along with this program; if not, write to the Free Software
17// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18//
19// SPDX-License-Identifier: GPL-2.0+
20
21#ifndef BIDI_H
22#define BIDI_H
23
24#include <cstdint>
25#include <vector>
26#include <wx/string.h>
27
47struct BidiRun {
48 size_t logicalStart;
49 size_t logicalEnd;
51};
52
53class Bidi {
54public:
56 static bool IsAvailable();
57
69 static std::vector<BidiRun> GetRuns(const wxString &line, bool paragraphIsRightToLeft);
70
74 static std::vector<BidiRun> GetRuns(const std::vector<uint32_t> &codepoints,
75 bool paragraphIsRightToLeft);
76};
77
78#endif // BIDI_H
Definition: Bidi.h:53
static bool IsAvailable()
True if libfribidi is compiled in, so GetRuns() reorders mixed-direction lines correctly.
Definition: Bidi.cpp:29
static std::vector< BidiRun > GetRuns(const wxString &line, bool paragraphIsRightToLeft)
The runs that make up line, in visual (left-to-right on screen) order.
Definition: Bidi.cpp:37
One maximal run of same-direction text within a display line, in visual (left-to-right on screen) ord...
Definition: Bidi.h:47
size_t logicalEnd
one past the index of the run's last character (logicalStart < logicalEnd)
Definition: Bidi.h:49
bool rightToLeft
whether this run is drawn right-to-left
Definition: Bidi.h:50
size_t logicalStart
index of the run's first character, in logical (storage) order
Definition: Bidi.h:48