File: msg.h

package info (click to toggle)
powder 117-2
  • links: PTS
  • area: non-free
  • in suites: stretch
  • size: 10,576 kB
  • ctags: 3,545
  • sloc: cpp: 55,002; makefile: 541; sh: 258; objc: 245; ansic: 107; csh: 54
file content (70 lines) | stat: -rw-r--r-- 2,076 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
 * PROPRIETARY INFORMATION.  This software is proprietary to POWDER
 * Development, and is not to be reproduced, transmitted, or disclosed
 * in any way without written permission.
 *
 * Produced by:	Jeff Lait
 *
 *      	POWDER Development
 *
 * NAME:        msg.h ( POWDER Library, C++ )
 *
 * COMMENTS:
 * 	Platform independent message handler.
 *
 *	This is the message glue library.  It handles the writing
 *	of status messages or prompts to the display.  It deals with
 *	-more-, scrollback, wordwrap, etc.
 *
 *	For displaying a block of scrollable text, see the gfx_
 *	functions in gfx_engine.
 */

#ifndef __msg_h__
#define __msg_h__

#include "buf.h"

void msg_init();

// Waits for any net-new keypress.
void msg_awaitaccept();

// Send a standard message across.  This program will handle line wrapping,
// pausing for user to read long messages or for the previous message
// to clear, etc.
void msg_report(const char *msg, bool wait=true);
void msg_report(BUF buf, bool wait=true);

// Much like msg_report, except the message is first broadcast across
// the center of the screen.  It is then placed into the message buffer
// for scrollback purposes.
void msg_announce(const char *msg);
void msg_announce(BUF buf);

// This does an append-style message.  It will allow this message to break
// between lines (but not "pages"), and be tacked on after other messages.
void msg_append(const char *msg);

// This message requires an accept before it continues.
void msg_alert(const char *msg);

// Asks the user for a questions, return false if cancelled
bool msg_askdir(const char *question, int &dx, int &dy, bool allowdiag=false);

// Clear all messages.
void msg_clear();

// Reports if queue is empty.
bool msg_isempty();

// Restores the last message that was cleared.
// Using this repeatedly will get earlier messages, and restorelast
// of false will get later messages.  If it is outside its valid range,
// false is returned.
bool msg_restore(bool restorelast);

// Shows the entire message history in the pager.
void msg_displayhistory();

#endif