Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

Inkscape::MessageStack Class Reference

#include <message-stack.h>

Inheritance diagram for Inkscape::MessageStack:

Inkscape::GC::Managed< default_scan, default_collect > Inkscape::GC::Anchored

List of all members.


Detailed Description

A class which holds a stack of displayed messages.

Messages can be pushed onto the top of the stack, and removed from any point in the stack by their id.

Messages may also be "flashed", meaning that they will be automatically removed from the stack a fixed period of time after they are pushed.

"Flashed" warnings and errors will persist longer than normal messages.

There is no simple "pop" operation provided, since these stacks are intended to be shared by many different clients; assuming that the message you pushed is still on top is an invalid and unsafe assumption.

Definition at line 45 of file message-stack.h.


Public Member Functions

unsigned _anchored_refcount () const
void anchor () const
void cancel (MessageId id)
 removes a message from the stack, given its id
sigc::connection connectChanged (sigc::slot< void, MessageType, gchar const * > slot)
 connects to the "changed" signal which is emitted whenever the topmost message on the stack changes.
gchar const * currentMessage ()
 returns the text of the message currently at the top of the stack
MessageType currentMessageType ()
 returns the type of message currently at the top of the stack
MessageId flash (MessageType type, gchar const *message)
 temporarily pushes a message onto the stack
MessageId flashF (MessageType type, gchar const *format,...) G_GNUC_PRINTF(3
 temporarily pushes a message onto the stack using printf-like formatting
MessageId MessageId flashVF (MessageType type, gchar const *format, va_list args)
 temporarily pushes a message onto the stack using printf-like formatting, using a stdarg argument list
void operator delete (void *p)
void * operator new (std::size_t size, ScanPolicy scan=default_scan, CollectionPolicy collect=default_collect) throw (std::bad_alloc)
void * operator new[] (std::size_t size, ScanPolicy scan=default_scan, CollectionPolicy collect=default_collect) throw (std::bad_alloc)
MessageId push (MessageType type, gchar const *message)
 pushes a message onto the stack
MessageId pushF (MessageType type, gchar const *format,...) G_GNUC_PRINTF(3
 pushes a message onto the stack using printf-like formatting
MessageId MessageId pushVF (MessageType type, gchar const *format, va_list args)
 pushes a message onto the stack using printf-like formatting, using a stdarg argument list
void release () const

Private Member Functions

Message * _discard (Message *m)
 frees a message struct and returns the next such struct in the list
void _emitChanged ()
 emits the "changed" signal
MessageId _push (MessageType type, guint lifetime, gchar const *message)
 pushes a message onto the stack with an optional timeout
 MessageStack (MessageStack const &)
void operator= (MessageStack const &)

Static Private Member Functions

static gboolean _timeout (gpointer data)
 callback to expire flashed messages

Private Attributes

sigc::signal< void,
MessageType, gchar const * > 
_changed_signal
Message * _messages
 the stack of messages as a linked list
MessageId _next_id
 the next message id to assign

Classes

struct  Message

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index