Namespace

Rotulus – 1

A GTK4 scrollback view for text-stream chat

Version0.2.2
AuthorsMisha Nasledov
LicenseLGPL-2.1-or-later
Websitehttps://github.com/mishan/rotulus
Sourcehttps://github.com/mishan/rotulus

Build

C headersrotulus.h
pkg-config filesrotulus-1

Dependencies

GLib—2.0 The base utility library
Browse documentation
GObject—2.0 The base type system library
Browse documentation

Additional documentation

Classes

View

A widget that shows a long, fast-growing stream of chat messages.

Structs

Frame

One frame of an animation.

Mark

An opaque handle to a row. A mark stays valid until the row it names goes (removed, trimmed by RotulusView:max-lines, or cleared), and is weak: using a stale one is a safe no-op, and rotulus_view_remove() returning FALSE is the intended way to find out.

Message

A row under construction: the introspectable counterpart of RotulusRow. Build one, hand it to rotulus_view_append_message(), and free it; the view copies what it needs.

Reactions

A row’s reactions under construction. Build one, hand it to rotulus_view_set_reactions(), and free it; the view copies what it needs.

Row

A row, for the C row API. Language bindings use RotulusMessage.

Run

A slice of text with a color and attributes, for the C row API. Runs are borrowed for the duration of the call; the view copies what it needs, so build them on the stack. The first four fields are all most callers set (ROTULUS_RUN).

Speaker

Who said it. The view only compares key, hands it back in the speaker signals, and passes it to the avatar function. A wrong key is worse than none: it attaches the wrong avatar and groups two people’s messages.

Enumerations

LoadDirection

Which way a RotulusView::load-more request pages.

RowKind

What a row is.

Callbacks

AvatarFunc

Resolves a speaker’s key to the image in their avatar slot. Called on every draw, so an animated avatar animates; cache anything expensive. The function must not change the view.

Functions

mirc_parse

Splits text carrying mIRC formatting codes (bold, italic, underline, strikethrough, monospace, reverse, reset, and colors by number or hex) into runs, with the codes removed. The runs point into text, which must outlive them. Colors 0..15 address the palette’s mIRC slots; the extended colors and hex colors are RGB.

Constants

ATTR_BACKGROUND

The run’s background is a palette index for its background.

ATTR_BACKGROUND_RGB

The run’s background_rgb is its background, as 0xRRGGBB.

ATTR_BOLD

Bold text.

ATTR_ITALIC

Italic text.

ATTR_MONOSPACE

Monospace text, as for code.

ATTR_NONE

No attributes.

ATTR_REVERSE

Swap the run’s foreground and background.

ATTR_RGB

The run’s rgb is its foreground, as 0xRRGGBB, instead of color.

ATTR_STRIKETHROUGH

Struck-through text.

ATTR_UNDERLINE

Underlined text.

AVATAR_SIZE_DEFAULT

The default RotulusView:avatar-size, in pixels.

COLOR_DEFAULT

A run color meaning the view’s default text color.

GROUP_GAP_DEFAULT

The default RotulusView:group-gap, in seconds.

PAL_BG

The palette slot for the default background.

PAL_COLS

How many colors a palette holds: the mIRC colors, the roles, and the per-nick colors. rotulus_view_set_palette() takes this many.

PAL_FG

The palette slot for the default text color.

PAL_HIGHLIGHT

The palette slot for the nick on a line that mentions you.

PAL_MARK_BG

The palette slot for the selection’s background.

PAL_MARK_FG

The palette slot for the selection’s foreground.

PAL_MARKER

The palette slot for the last-read marker line.

PAL_MIRC_COLS

How many palette slots the mIRC colors take, from slot 0, so that IRC formatting can address them by number.

PAL_MUTED

The palette slot for secondary text: history rows and captions.

PAL_NICK

The palette slot for other people’s nicks.

PAL_NICK_BRACKET

The palette slot for the brackets around other people’s nicks.

PAL_NICK_COLOR0

The first of the per-nick color slots.

PAL_NICK_COLORS

How many per-nick color slots there are, from ROTULUS_PAL_NICK_COLOR0.

PAL_RULE

The palette slot for the column divider.

PAL_SELF_BRACKET

The palette slot for the brackets around your own nick.

PAL_SELF_NICK

The palette slot for your own nick.

PAL_SYSTEM

The palette slot for the tag of a status line.

PAL_SYSTEM_BRACKET

The palette slot for the brackets around a status line’s tag.

PAL_TIMESTAMP

The palette slot for the timestamp column.

ROW_ACTION

A “/me” action. It never groups with its neighbors.

ROW_OUTGOING

The row originated here rather than arriving from elsewhere. It breaks grouping independently of who the speaker is: in a conversation with yourself, both halves have the same speaker, and only direction tells your echo from the copy that came back.