Skip to content

Commit af974d1

Browse files
committed
The virtual terminal allows for faster tracking of changes by also saving vertical adjustments
1 parent fa75df5 commit af974d1

21 files changed

+509
-381
lines changed

.github/workflows/coverage.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414

1515
env:
1616
COVERALLS_REPO_TOKEN: "${{ secrets.COVERALLS_REPO_TOKEN }}"
17+
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
1718

1819
steps:
1920
- name: Repository checkout
@@ -57,7 +58,7 @@ jobs:
5758
lcov --remove lcov-all.info '/usr/include/*' './include/*' --ignore-errors unused,unused --output-file lcov.info
5859
lcov --list lcov.info
5960
rm -f lcov-all.info
60-
coveralls-lcov --branch=${GITHUB_REF##*/} --repo-token "${{ secrets.COVERALLS_REPO_TOKEN }}" lcov.info
61+
coveralls-lcov --branch=${GITHUB_REF##*/} --repo-token "$COVERALLS_REPO_TOKEN" lcov.info
6162
6263
- name: Codecov
6364
run: |
@@ -70,5 +71,5 @@ jobs:
7071
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
7172
shasum -a 256 -c codecov.SHA256SUM
7273
chmod +x codecov
73-
./codecov -t ${{ secrets.CODECOV_TOKEN }}
74+
./codecov -t "$CODECOV_TOKEN"
7475

ChangeLog

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
2025-11-09 Markus Gans <[email protected]>
2+
* The virtual terminal allows for faster tracking of changes by also
3+
saving vertical adjustments
4+
15
2025-10-20 Markus Gans <[email protected]>
26
* The rotozoomer example now uses a precomputed trigonometric lookup
37
table
48

59
2025-10-19 Markus Gans <[email protected]>
6-
* FVTerm's performance optimization reduces the number of CPU cycles
10+
* FVTerm's performance optimization reduces CPU cycle count
711

812
2025-10-09 Markus Gans <[email protected]>
913
* Some speed optimizations were made to the methods

examples/mouse.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* *
44
* This file is part of the FINAL CUT widget toolkit *
55
* *
6-
* Copyright 2017-2023 Markus Gans *
6+
* Copyright 2017-2025 Markus Gans *
77
* *
88
* FINAL CUT is free software; you can redistribute it and/or modify *
99
* it under the terms of the GNU Lesser General Public License as *
@@ -504,7 +504,7 @@ void MouseDraw::drawCanvas()
504504
std::memcpy ( &winchar
505505
, &canvaschar
506506
, sizeof(finalcut::FChar) * unsigned(x_end) );
507-
auto& line_changes = printarea->changes[unsigned(ay + y)];
507+
auto& line_changes = printarea->changes_in_line[unsigned(ay + y)];
508508

509509
if ( int(line_changes.xmin) > ax )
510510
line_changes.xmin = uInt(ax);
@@ -513,6 +513,7 @@ void MouseDraw::drawCanvas()
513513
line_changes.xmax = uInt(ax + x_end - 1);
514514
}
515515

516+
printarea->changes_in_row = {0, uInt(y_end - 1)};
516517
printarea->has_changes = true;
517518
forceTerminalUpdate();
518519
}

final/fapplication.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ class FApplication : public FWidget
259259
// non-member function forward declarations
260260
// implemented in fwidget_functions.cpp
261261
//----------------------------------------------------------------------
262-
auto getFApplication() -> FApplication*;
262+
auto getFApplication() noexcept -> FApplication*;
263263

264264

265265
// FApplication inline functions

final/fevent.cpp

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* *
44
* This file is part of the FINAL CUT widget toolkit *
55
* *
6-
* Copyright 2014-2022 Markus Gans *
6+
* Copyright 2014-2025 Markus Gans *
77
* *
88
* FINAL CUT is free software; you can redistribute it and/or modify *
99
* it under the terms of the GNU Lesser General Public License as *
@@ -35,15 +35,15 @@ FEvent::FEvent (Event ev_type) // constructor
3535
{ }
3636

3737
//----------------------------------------------------------------------
38-
auto FEvent::getType() const -> Event
38+
auto FEvent::getType() const noexcept -> Event
3939
{ return t; }
4040

4141
//----------------------------------------------------------------------
42-
auto FEvent::isQueued() const -> bool
42+
auto FEvent::isQueued() const noexcept -> bool
4343
{ return queued; }
4444

4545
//----------------------------------------------------------------------
46-
auto FEvent::wasSent() const -> bool
46+
auto FEvent::wasSent() const noexcept -> bool
4747
{ return send; }
4848

4949

@@ -57,19 +57,19 @@ FKeyEvent::FKeyEvent (Event ev_type, FKey key_num) // constructor
5757
{ }
5858

5959
//----------------------------------------------------------------------
60-
auto FKeyEvent::key() const -> FKey
60+
auto FKeyEvent::key() const noexcept -> FKey
6161
{ return k; }
6262

6363
//----------------------------------------------------------------------
64-
auto FKeyEvent::isAccepted() const -> bool
64+
auto FKeyEvent::isAccepted() const noexcept -> bool
6565
{ return accpt; }
6666

6767
//----------------------------------------------------------------------
68-
void FKeyEvent::accept()
68+
void FKeyEvent::accept() noexcept
6969
{ accpt = true; }
7070

7171
//----------------------------------------------------------------------
72-
void FKeyEvent::ignore()
72+
void FKeyEvent::ignore() noexcept
7373
{ accpt = false; }
7474

7575

@@ -95,39 +95,39 @@ FMouseEvent::FMouseEvent ( Event ev_type // constructor
9595
{ }
9696

9797
//----------------------------------------------------------------------
98-
auto FMouseEvent::getPos() const & -> const FPoint&
98+
auto FMouseEvent::getPos() const noexcept -> const FPoint&
9999
{ return p; }
100100

101101
//----------------------------------------------------------------------
102-
auto FMouseEvent::getTermPos() const & -> const FPoint&
102+
auto FMouseEvent::getTermPos() const noexcept -> const FPoint&
103103
{ return tp; }
104104

105105
//----------------------------------------------------------------------
106-
auto FMouseEvent::getX() const -> int
106+
auto FMouseEvent::getX() const noexcept -> int
107107
{ return p.getX(); }
108108

109109
//----------------------------------------------------------------------
110-
auto FMouseEvent::getY() const -> int
110+
auto FMouseEvent::getY() const noexcept -> int
111111
{ return p.getY(); }
112112

113113
//----------------------------------------------------------------------
114-
auto FMouseEvent::getTermX() const -> int
114+
auto FMouseEvent::getTermX() const noexcept -> int
115115
{ return tp.getX(); }
116116

117117
//----------------------------------------------------------------------
118-
auto FMouseEvent::getTermY() const -> int
118+
auto FMouseEvent::getTermY() const noexcept -> int
119119
{ return tp.getY(); }
120120

121121
//----------------------------------------------------------------------
122-
auto FMouseEvent::getButton() const -> MouseButton
122+
auto FMouseEvent::getButton() const noexcept -> MouseButton
123123
{ return b; }
124124

125125
//----------------------------------------------------------------------
126-
void FMouseEvent::setPos (const FPoint& pos)
126+
void FMouseEvent::setPos (const FPoint& pos) noexcept
127127
{ p = pos; }
128128

129129
//----------------------------------------------------------------------
130-
void FMouseEvent::setTermPos (const FPoint& termPos)
130+
void FMouseEvent::setTermPos (const FPoint& termPos) noexcept
131131
{ tp = termPos; }
132132

133133

@@ -153,31 +153,31 @@ FWheelEvent::FWheelEvent ( Event ev_type // constructor
153153
{ }
154154

155155
//----------------------------------------------------------------------
156-
auto FWheelEvent::getPos() const & -> const FPoint&
156+
auto FWheelEvent::getPos() const noexcept -> const FPoint&
157157
{ return p; }
158158

159159
//----------------------------------------------------------------------
160-
auto FWheelEvent::getTermPos() const & -> const FPoint&
160+
auto FWheelEvent::getTermPos() const noexcept -> const FPoint&
161161
{ return tp; }
162162

163163
//----------------------------------------------------------------------
164-
auto FWheelEvent::getX() const -> int
164+
auto FWheelEvent::getX() const noexcept -> int
165165
{ return p.getX(); }
166166

167167
//----------------------------------------------------------------------
168-
auto FWheelEvent::getY() const -> int
168+
auto FWheelEvent::getY() const noexcept -> int
169169
{ return p.getY(); }
170170

171171
//----------------------------------------------------------------------
172-
auto FWheelEvent::getTermX() const -> int
172+
auto FWheelEvent::getTermX() const noexcept -> int
173173
{ return tp.getX(); }
174174

175175
//----------------------------------------------------------------------
176-
auto FWheelEvent::getTermY() const -> int
176+
auto FWheelEvent::getTermY() const noexcept -> int
177177
{ return tp.getY(); }
178178

179179
//----------------------------------------------------------------------
180-
auto FWheelEvent::getWheel() const -> MouseWheel
180+
auto FWheelEvent::getWheel() const noexcept -> MouseWheel
181181
{ return w; }
182182

183183

@@ -190,35 +190,35 @@ FFocusEvent::FFocusEvent (Event ev_type) // constructor
190190
{ }
191191

192192
//----------------------------------------------------------------------
193-
auto FFocusEvent::gotFocus() const -> bool
193+
auto FFocusEvent::gotFocus() const noexcept -> bool
194194
{
195195
return getType() == Event::FocusIn;
196196
}
197197

198198
//----------------------------------------------------------------------
199-
auto FFocusEvent::lostFocus() const -> bool
199+
auto FFocusEvent::lostFocus() const noexcept -> bool
200200
{
201201
return getType() == Event::FocusOut;
202202
}
203203

204204
//----------------------------------------------------------------------
205-
auto FFocusEvent::getFocusType() const -> FocusTypes
205+
auto FFocusEvent::getFocusType() const noexcept -> FocusTypes
206206
{ return focus_type; }
207207

208208
//----------------------------------------------------------------------
209-
void FFocusEvent::setFocusType (FocusTypes ft)
209+
void FFocusEvent::setFocusType (FocusTypes ft) noexcept
210210
{ focus_type = ft; }
211211

212212
//----------------------------------------------------------------------
213-
auto FFocusEvent::isAccepted() const -> bool
213+
auto FFocusEvent::isAccepted() const noexcept -> bool
214214
{ return accpt; }
215215

216216
//----------------------------------------------------------------------
217-
void FFocusEvent::accept()
217+
void FFocusEvent::accept() noexcept
218218
{ accpt = true; }
219219

220220
//----------------------------------------------------------------------
221-
void FFocusEvent::ignore()
221+
void FFocusEvent::ignore() noexcept
222222
{ accpt = false; }
223223

224224

@@ -232,19 +232,19 @@ FAccelEvent::FAccelEvent (Event ev_type, FWidget* focused) // constructor
232232
{ }
233233

234234
//----------------------------------------------------------------------
235-
auto FAccelEvent::focusedWidget() const -> FWidget*
235+
auto FAccelEvent::focusedWidget() const noexcept -> FWidget*
236236
{ return focus_widget; }
237237

238238
//----------------------------------------------------------------------
239-
auto FAccelEvent::isAccepted() const -> bool
239+
auto FAccelEvent::isAccepted() const noexcept -> bool
240240
{ return accpt; }
241241

242242
//----------------------------------------------------------------------
243-
void FAccelEvent::accept()
243+
void FAccelEvent::accept() noexcept
244244
{ accpt = true; }
245245

246246
//----------------------------------------------------------------------
247-
void FAccelEvent::ignore()
247+
void FAccelEvent::ignore() noexcept
248248
{ accpt = false; }
249249

250250

@@ -257,15 +257,15 @@ FResizeEvent::FResizeEvent (Event ev_type) // constructor
257257
{ }
258258

259259
//----------------------------------------------------------------------
260-
auto FResizeEvent::isAccepted() const -> bool
260+
auto FResizeEvent::isAccepted() const noexcept -> bool
261261
{ return accpt; }
262262

263263
//----------------------------------------------------------------------
264-
void FResizeEvent::accept()
264+
void FResizeEvent::accept() noexcept
265265
{ accpt = true; }
266266

267267
//----------------------------------------------------------------------
268-
void FResizeEvent::ignore()
268+
void FResizeEvent::ignore() noexcept
269269
{ accpt = false; }
270270

271271

@@ -296,15 +296,15 @@ FCloseEvent::FCloseEvent (Event ev_type) // constructor
296296
{ }
297297

298298
//----------------------------------------------------------------------
299-
auto FCloseEvent::isAccepted() const -> bool
299+
auto FCloseEvent::isAccepted() const noexcept -> bool
300300
{ return accpt; }
301301

302302
//----------------------------------------------------------------------
303-
void FCloseEvent::accept()
303+
void FCloseEvent::accept() noexcept
304304
{ accpt = true; }
305305

306306
//----------------------------------------------------------------------
307-
void FCloseEvent::ignore()
307+
void FCloseEvent::ignore() noexcept
308308
{ accpt = false; }
309309

310310

@@ -318,7 +318,7 @@ FTimerEvent::FTimerEvent (Event ev_type, int timer_id) // constructor
318318
{ }
319319

320320
//----------------------------------------------------------------------
321-
auto FTimerEvent::getTimerId() const -> int
321+
auto FTimerEvent::getTimerId() const noexcept -> int
322322
{ return id; }
323323

324324

@@ -332,7 +332,7 @@ FUserEvent::FUserEvent (Event ev_type, int user_event_id) // constructor
332332
{ }
333333

334334
//----------------------------------------------------------------------
335-
auto FUserEvent::getUserId() const -> int
335+
auto FUserEvent::getUserId() const noexcept -> int
336336
{ return uid; }
337337

338338
} // namespace finalcut

0 commit comments

Comments
 (0)