<--- Cannot embed stylesheet: [Errno 2] No such file or directory: '../../../../aros.css' --->

Floattext.mui

MUIA_Floattext_Justify

Function

Enable insertion of spaces to fill wrapped lines.

Inputs

Initialize, set and get, BOOL. Default FALSE. The setter normalizes
nonzero values to TRUE.

Notes

The formatter inserts whole space characters among words when eligible
spaces exist. It can also stretch the last paragraph line; that line is
excluded only when the computed multiplier exceeds five. There is no
fractional spacing or exact pixel-width guarantee. Get returns the
stored flag. Setting it always rebuilds the list; it does not merely
change drawing style. A font with zero-width spaces is not protected
against division by zero.

MUIA_Floattext_SkipChars

Function

Supply bytes to omit during typesetting.

Inputs

Initialize and set, STRPTR. Default NULL. No local getter.

Notes

The pointer is borrowed without copying; keep its NUL-terminated string
valid through all later retypesetting until replacement or disposal.
NULL disables this filter. A non-NULL pointer also selects code paths
that strip leading spaces, even when it points to an empty string.
Tabs and two-byte escape handling have their own formatting paths;
SkipChars is not a general escaping or sanitizing mechanism. Setting
this attribute rebuilds all lines. A paragraph filtered to no printable
text can prevent formatter progress; arbitrary filtering is not
protected against that case.

MUIA_Floattext_TabSize

Function

Choose the number of spaces emitted for each tab.

Inputs

Initialize and set, header LONG, stored ULONG. Default 8. Zero becomes
8; values greater than 20 become 20. No local getter.

Notes

Every tab expands to this many spaces, independent of its column; these
are not tab stops. Conversion to ULONG occurs before the upper-limit
check, so negative input is not a negative tab width. Construction and
any recognized attribute set normalize the stored size before
rebuilding. Buffer lengths still use narrower counters and are not
protected against expansion overflow.

MUIA_Floattext_Text

Function

Replace or retrieve the source text used for wrapping.

Inputs

Initialize, set and get, STRPTR. Default NULL. Supply a readable
NUL-terminated string; NULL clears the source.

Notes

The class owns a StrDup copy. Get returns a borrowed pointer valid until
replacement, successful Append or disposal; do not modify or free it.
The setter frees the previous source before duplication, so the
replacement must not alias that allocation. Copy failure loses the
previous text and leaves NULL; construction and set do not report this
as a separate error.
Each set rebuilds the list, including an unchanged value. Repeated
constructor Text tags overwrite earlier copies without freeing them. The
original tag is forwarded to List and normal notification processing; it
contains the supplied pointer, not the owned copy. Formatting
temporarily writes terminators into the owned source and restores them,
so do not read it concurrently during typesetting.

MUIC_Floattext

Superclass

List.mui

Description

Wrap text into List entries using the native window RastPort's font and
the object's width minus inner margins and eight pixels. Newlines
delimit paragraphs. Text is copied; SkipChars is borrowed. Defaults are
no source text, no skip characters, Justify FALSE and TabSize 8.
Construction installs List's string construction/destruction hooks,
replacing caller hook selections. Preserve these hooks while the class
manages its generated lines.
Each typesetting pass clears the list and rebuilds its entries. Without
a window or source text it leaves the list empty. Full Draw retypesets
when the outer width differs from the cached width; a font or margin
change alone does not satisfy that width test. Setting any Floattext
attribute also retypesets, even if the value is unchanged. Text source
storage and generated line copies have separate ownership. Disposal
frees the source and delegates list cleanup to List.

Methods

The formatter expands tabs to a fixed number of spaces, filters
SkipChars and carries two-byte escape commands across wrapped lines
within a paragraph. It is not a general parser for all multi-byte Zune
escape forms. It fits text with TextFit and prefers spaces as break
points. Justification adds whole spaces; even the last paragraph line
can be justified unless its computed space multiplier exceeds five.
Draw suppresses superclass drawing while typesetting and always returns
zero. Typesetting clears its suppression flag and redraws the list only
on normal completion. Temporary paragraph/line allocation failures
return early with the flag still set and can leave an empty or partially
rebuilt list. List insertion results are ignored; success of
construction, set or Append does not establish that every line was
generated.

Bugs

The formatter uses UWORD positions, counts and allocation sizes, and
unchecked arithmetic. Long paragraphs, tab expansion or accumulated
escape commands can truncate lengths and overrun buffers. Incomplete
escapes can read beyond input. A nonempty paragraph for which TextFit
returns zero without advancing the source, including an entirely
filtered paragraph, can cause a loop without progress. No cancellation
or timeout is provided. Justification assumes a nonzero measured space
width.
Setting Text frees the old source before copying the replacement. Never
pass the current Text getter pointer or a pointer into it to that
setter. Append copies into new storage before freeing the old source,
but its ULONG allocation-size calculation is unchecked. These
limitations describe this implementation, not guaranteed safe
arbitrary-input handling.

MUIM_Floattext_Append

Synopsis

IPTR result = DoMethod(obj, MUIM_Floattext_Append, (IPTR)text);

Function

Append a string directly to the stored source and rebuild all lines.

Inputs

text - Readable NUL-terminated string, or NULL for no operation. No
newline or separator is inserted.

Result

Always zero, including successful append, NULL input and allocation
failure.

Notes

A new combined allocation is filled before the old source is freed. The
input may therefore refer to the current source while copying. Combined
length plus terminator must fit the unchecked ULONG allocation
calculation. Allocation failure preserves the old source and list.
Successful replacement invalidates prior getter pointers and retypesets
the entire list; subsequent formatting failure is not reported.
The method writes private source state directly and does not send a
Floattext_Text setter tag or notification for that attribute. It does
not explicitly scroll to the appended text. An empty non-NULL string
still allocates and rebuilds.