File: chatbox.h

package info (click to toggle)
freespace2 24.0.2%2Brepack-1
  • links: PTS, VCS
  • area: non-free
  • in suites: trixie
  • size: 43,188 kB
  • sloc: cpp: 583,107; ansic: 21,729; python: 1,174; sh: 464; makefile: 248; xml: 181
file content (73 lines) | stat: -rw-r--r-- 2,371 bytes parent folder | download | duplicates (3)
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
71
72
73
/*
 * Copyright (C) Volition, Inc. 1999.  All rights reserved.
 *
 * All source code herein is the property of Volition, Inc. You may not sell 
 * or otherwise commercially exploit the source or things you created based on the 
 * source.
 *
*/ 



#ifndef __FREESPACE_CHATBOX_H__
#define __FREESPACE_CHATBOX_H__

// prototype
struct net_player;

#define CHATBOX_MAX_LEN						125			// max length of the actual text string

// chatbox flags for creation/switching between modes
#define CHATBOX_FLAG_SMALL					 (1<<0)		// small chatbox
#define CHATBOX_FLAG_BIG					 (1<<1)		// big chatbox
#define CHATBOX_FLAG_MULTI_PAUSED		 (1<<2)		// chatbox in the multiplayer paused screen
#define CHATBOX_FLAG_DRAW_BOX				 (1<<3)		// should be drawn by the chatbox code
#define CHATBOX_FLAG_BUTTONS				 (1<<4)		// the chatbox should be drawing/checking its own buttons
// NOTE : CHATBOX_FLAG_BUTTONS requires that CHATBOX_FLAG_DRAW_BOX is also set!

// initialize all chatbox details with the given mode flags
int chatbox_create(int mode_flags = (CHATBOX_FLAG_SMALL | CHATBOX_FLAG_DRAW_BOX | CHATBOX_FLAG_BUTTONS));

// process this frame for the chatbox
int chatbox_process(int key_in=-1);

// shutdown all chatbox functionality
void chatbox_close();

// render the chatbox for this frame
void chatbox_render();

// try and scroll the chatbox up. return 0 or 1 on fail or success
int chatbox_scroll_up();

// try and scroll the chatbox down, return 0 or 1 on fail or success
int chatbox_scroll_down();

// clear the contents of the chatbox
void chatbox_clear();

// add a line of text (from the player identified by pid) to the chatbox
void chatbox_add_line(const char *msg, int pid, int add_id = 1);

// force the chatbox to go into small mode (if its in large mode) - will not wotk if in multi paused chatbox mode
void chatbox_force_small();

// force the chatbox to go into big mode (if its in small mode) - will not work if in multi paused chatbox mode
void chatbox_force_big();

// "lose" the focus on the chatbox inputbox
void chatbox_lose_focus();

// return if the inputbox for the chatbox currently has focus
int chatbox_has_focus();

// grab the focus for the chatbox inputbox
void chatbox_set_focus();

// return if the inputbox was pressed - "clicked on"
int chatbox_pressed();

// reset all timestamps associated with the chatbox
void chatbox_reset_timestamps();

#endif