37 #if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) 38 #error "Only <final/final.h> can be included directly." 49 #include "final/output/tty/ftermcap.h" 50 #include "final/util/fstring.h" 101 bool automatic_left_margin;
109 auto getClassName()
const ->
FString;
111 auto getCursorHomeLength()
const noexcept -> uInt;
112 auto getCarriageReturnLength()
const noexcept -> uInt;
113 auto getCursorToLLLength()
const noexcept -> uInt;
114 auto getTabLength()
const noexcept -> uInt;
115 auto getBackTabLength()
const noexcept -> uInt;
116 auto getCursorUpLength()
const noexcept -> uInt;
117 auto getCursorDownLength()
const noexcept -> uInt;
118 auto getCursorLeftLength()
const noexcept -> uInt;
119 auto getCursorRightLength()
const noexcept -> uInt;
120 auto getCursorAddressLength()
const noexcept -> uInt;
121 auto getColumnAddressLength()
const noexcept -> uInt;
122 auto getRowAddressLength()
const noexcept -> uInt;
123 auto getParmUpCursorLength()
const noexcept -> uInt;
124 auto getParmDownCursorLength()
const noexcept -> uInt;
125 auto getParmLeftCursorLength()
const noexcept -> uInt;
126 auto getParmRightCursorLength()
const noexcept -> uInt;
127 auto getEraseCharsLength()
const noexcept -> uInt;
128 auto getRepeatCharLength()
const noexcept -> uInt;
129 auto getClrBolLength()
const noexcept -> uInt;
130 auto getClrEolLength()
const noexcept -> uInt;
133 void setBaudRate (
int);
134 void setTabStop (
int);
135 void setTermSize (std::size_t, std::size_t);
136 void setTermEnvironment (
const TermEnv&);
158 void set_auto_left_margin (
bool =
true) noexcept;
159 void set_eat_newline_glitch (
bool =
true) noexcept;
162 void check_boundaries (
int&,
int&,
int&,
int&)
const noexcept;
181 Capability carriage_return{};
183 Capability back_tab{};
192 Capability column_address{};
193 Capability row_address{};
194 Capability address{};
199 Capability erase_chars{};
200 Capability repeat_char{};
201 Capability repeat_last_char{};
202 Capability clr_bol{};
203 Capability clr_eol{};
209 std::size_t height{};
213 static constexpr std::string::size_type BUF_SIZE{512u};
216 static constexpr
int LONG_DURATION{INT_MAX};
218 static constexpr
int MOVE_LIMIT{7};
222 void calculateCharDuration() noexcept;
224 auto capDurationToLength (
int)
const noexcept -> int;
225 auto repeatedAppend (std::string&,
const Capability&,
int)
const -> int;
226 auto relativeMove (std::string&,
int,
int,
int,
int)
const -> int;
227 auto verticalMove (std::string&,
int,
int)
const -> int;
228 void downMove (std::string&,
int&,
int,
int)
const;
229 void upMove (std::string&,
int&,
int,
int)
const;
230 auto horizontalMove (std::string&,
int,
int)
const -> int;
231 void moveWithParmRightCursor (std::string&,
int&,
int)
const;
232 void moveWithRightCursor (std::string&,
int&,
int,
int,
int)
const;
233 void rightMove (std::string&,
int&,
int,
int)
const;
234 void moveWithParmLeftCursor (std::string&,
int&,
int)
const;
235 void moveWithLeftCursor (std::string&,
int&,
int,
int,
int)
const;
236 void leftMove (std::string&,
int&,
int,
int)
const;
238 auto isWideMove (
int,
int,
int,
int)
const noexcept -> bool;
239 auto isMethod0Faster (
int&,
int,
int) -> bool;
240 auto isMethod1Faster (
int&,
int,
int,
int,
int) -> bool;
241 auto isMethod2Faster (
int&,
int,
int,
int) -> bool;
242 auto isMethod3Faster (
int&,
int,
int) -> bool;
243 auto isMethod4Faster (
int&,
int,
int) -> bool;
244 auto isMethod5Faster (
int&,
int,
int,
int) -> bool;
245 void moveByMethod (
int,
int,
int,
int,
int);
246 void moveWithCarriageReturn (
int,
int,
int);
247 void moveWithHome (
int,
int);
248 void moveWithToLL (
int,
int);
249 void moveWithCRAndWrapToLeft (
int,
int,
int,
int);
253 ParamCursor parm_cursor{};
255 Dimension screen{80, 24};
256 int char_duration{1};
259 std::string move_buf{};
260 std::string temp_result{};
261 bool automatic_left_margin{
false};
262 bool eat_nl_glitch{
false};
265 friend void printDurations (
const FOptiMove&);
271 inline auto FOptiMove::getClassName()
const ->
FString 272 {
return "FOptiMove"; }
275 inline auto FOptiMove::getCursorHomeLength()
const noexcept -> uInt
276 {
return static_cast<uInt
>(cursor.home.length); }
279 inline auto FOptiMove::getCarriageReturnLength()
const noexcept -> uInt
280 {
return static_cast<uInt
>(cursor.carriage_return.length); }
283 inline auto FOptiMove::getCursorToLLLength()
const noexcept -> uInt
284 {
return static_cast<uInt
>(cursor.to_ll.length); }
287 inline auto FOptiMove::getTabLength()
const noexcept -> uInt
288 {
return static_cast<uInt
>(cursor.tab.length); }
291 inline auto FOptiMove::getBackTabLength()
const noexcept -> uInt
292 {
return static_cast<uInt
>(cursor.back_tab.length); }
295 inline auto FOptiMove::getCursorUpLength()
const noexcept -> uInt
296 {
return static_cast<uInt
>(cursor.up.length); }
299 inline auto FOptiMove::getCursorDownLength()
const noexcept -> uInt
300 {
return static_cast<uInt
>(cursor.down.length); }
303 inline auto FOptiMove::getCursorLeftLength()
const noexcept -> uInt
304 {
return static_cast<uInt
>(cursor.left.length); }
307 inline auto FOptiMove::getCursorRightLength()
const noexcept -> uInt
308 {
return static_cast<uInt
>(cursor.right.length); }
311 inline auto FOptiMove::getCursorAddressLength()
const noexcept -> uInt
312 {
return static_cast<uInt
>(parm_cursor.address.length); }
315 inline auto FOptiMove::getColumnAddressLength()
const noexcept -> uInt
316 {
return static_cast<uInt
>(parm_cursor.column_address.length); }
319 inline auto FOptiMove::getRowAddressLength()
const noexcept -> uInt
320 {
return static_cast<uInt
>(parm_cursor.row_address.length); }
323 inline auto FOptiMove::getParmUpCursorLength()
const noexcept -> uInt
324 {
return static_cast<uInt
>(parm_cursor.up.length); }
327 inline auto FOptiMove::getParmDownCursorLength()
const noexcept -> uInt
328 {
return static_cast<uInt
>(parm_cursor.down.length); }
331 inline auto FOptiMove::getParmLeftCursorLength()
const noexcept -> uInt
332 {
return static_cast<uInt
>(parm_cursor.left.length); }
335 inline auto FOptiMove::getParmRightCursorLength()
const noexcept -> uInt
336 {
return static_cast<uInt
>(parm_cursor.right.length); }
339 inline auto FOptiMove::getEraseCharsLength()
const noexcept -> uInt
340 {
return static_cast<uInt
>(edit.erase_chars.length); }
343 inline auto FOptiMove::getRepeatCharLength()
const noexcept -> uInt
344 {
return static_cast<uInt
>(edit.repeat_char.length); }
347 inline auto FOptiMove::getClrBolLength()
const noexcept -> uInt
348 {
return static_cast<uInt
>(edit.clr_bol.length); }
351 inline auto FOptiMove::getClrEolLength()
const noexcept -> uInt
352 {
return static_cast<uInt
>(edit.clr_eol.length); }
355 inline void FOptiMove::set_auto_left_margin (
bool bcap) noexcept
356 { automatic_left_margin = bcap; }
359 inline void FOptiMove::set_eat_newline_glitch (
bool bcap) noexcept
360 { eat_nl_glitch = bcap; }
369 #endif // FOPTIMOVE_H Definition: foptimove.h:75
Definition: ftermcap.h:72
Definition: foptimove.h:95
Definition: foptimove.h:59
Definition: class_template.cpp:25
Definition: foptimove.h:86
Definition: foptimove.h:62