17#ifndef SEEN_INKSCAPE_MESSAGE_STACK_H
18#define SEEN_INKSCAPE_MESSAGE_STACK_H
23#include <glibmm/ustring.h>
24#include <sigc++/sigc++.h>
A class which holds a stack of displayed messages.
MessageId flash(MessageType type, char const *message)
Temporarily pushes a message onto the stack.
MessageId flashF(MessageType type, char const *format,...) G_GNUC_PRINTF(3
temporarily pushes a message onto the stack using printf-like formatting
Message * _discard(Message *m)
frees a message struct and returns the next such struct in the list
Message * _messages
the stack of messages as a linked list
MessageStack(MessageStack const &)=delete
MessageId _next_id
the next message id to assign
char const * currentMessage()
returns the text of the message currently at the top of the stack
MessageId _push(MessageType type, unsigned int lifetime, char const *message)
pushes a message onto the stack with an optional timeout
void cancel(MessageId id)
removes a message from the stack, given its id
MessageType currentMessageType()
returns the type of message currently at the top of the stack
static int _timeout(void *data)
callback to expire flashed messages
sigc::connection connectChanged(sigc::slot< void(MessageType, char const *)> slot)
connects to the "changed" signal which is emitted whenever the topmost message on the stack changes.
void operator=(MessageStack const &)=delete
MessageId pushF(MessageType type, char const *format,...) G_GNUC_PRINTF(3
pushes a message onto the stack using printf-like formatting
MessageId push(MessageType type, char const *message)
pushes a message onto the stack
MessageId MessageId flashVF(MessageType type, char const *format, va_list args)
temporarily pushes a message onto the stack using printf-like formatting, using a stdarg argument lis...
sigc::signal< void(MessageType, char const *)> _changed_signal
void _emitChanged()
emits the "changed" signal
MessageId MessageId pushVF(MessageType type, char const *format, va_list args)
pushes a message onto the stack using printf-like formatting, using a stdarg argument list
Helper class to stream background task notifications as a series of messages.
std::uint_least32_t MessageId
An integer ID which identifies a displayed message in a particular Inkscape::MessageStack.
MessageType
A hint about the meaning of a message; is it an ordinary message, a message advising the user of some...
int G_GNUC_PRINTF(2, 3) safeprintf(char(&buf)[N]