FS2_Open
Open source remastering of the Freespace 2 engine
chatbox.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) Volition, Inc. 1999. All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell
5  * or otherwise commercially exploit the source or things you created based on the
6  * source.
7  *
8 */
9 
10 
11 
12 #ifndef __FREESPACE_CHATBOX_H__
13 #define __FREESPACE_CHATBOX_H__
14 
15 // prototype
16 struct net_player;
17 
18 #define CHATBOX_MAX_LEN 125 // max length of the actual text string
19 
20 // chatbox flags for creation/switching between modes
21 #define CHATBOX_FLAG_SMALL (1<<0) // small chatbox
22 #define CHATBOX_FLAG_BIG (1<<1) // big chatbox
23 #define CHATBOX_FLAG_MULTI_PAUSED (1<<2) // chatbox in the multiplayer paused screen
24 #define CHATBOX_FLAG_DRAW_BOX (1<<3) // should be drawn by the chatbox code
25 #define CHATBOX_FLAG_BUTTONS (1<<4) // the chatbox should be drawing/checking its own buttons
26 // NOTE : CHATBOX_FLAG_BUTTONS requires that CHATBOX_FLAG_DRAW_BOX is also set!
27 
28 // initialize all chatbox details with the given mode flags
30 
31 // process this frame for the chatbox
32 int chatbox_process(int key_in=-1);
33 
34 // shutdown all chatbox functionality
35 void chatbox_close();
36 
37 // render the chatbox for this frame
38 void chatbox_render();
39 
40 // try and scroll the chatbox up. return 0 or 1 on fail or success
41 int chatbox_scroll_up();
42 
43 // try and scroll the chatbox down, return 0 or 1 on fail or success
45 
46 // clear the contents of the chatbox
47 void chatbox_clear();
48 
49 // add a line of text (from the player identified by pid) to the chatbox
50 void chatbox_add_line(const char *msg, int pid, int add_id = 1);
51 
52 // force the chatbox to go into small mode (if its in large mode) - will not wotk if in multi paused chatbox mode
53 void chatbox_force_small();
54 
55 // force the chatbox to go into big mode (if its in small mode) - will not work if in multi paused chatbox mode
56 void chatbox_force_big();
57 
58 // "lose" the focus on the chatbox inputbox
59 void chatbox_lose_focus();
60 
61 // return if the inputbox for the chatbox currently has focus
62 int chatbox_has_focus();
63 
64 // grab the focus for the chatbox inputbox
65 void chatbox_set_focus();
66 
67 // return if the inputbox was pressed - "clicked on"
68 int chatbox_pressed();
69 
70 // reset all timestamps associated with the chatbox
72 
73 #endif
void chatbox_lose_focus()
Definition: chatbox.cpp:1082
int chatbox_scroll_down()
Definition: chatbox.cpp:724
void chatbox_close()
Definition: chatbox.cpp:634
int chatbox_create(int mode_flags=(CHATBOX_FLAG_SMALL|CHATBOX_FLAG_DRAW_BOX|CHATBOX_FLAG_BUTTONS))
Definition: chatbox.cpp:495
void chatbox_set_focus()
Definition: chatbox.cpp:1099
int chatbox_scroll_up()
Definition: chatbox.cpp:708
void chatbox_force_small()
Definition: chatbox.cpp:1020
#define CHATBOX_FLAG_BUTTONS
Definition: chatbox.h:25
int chatbox_process(int key_in=-1)
Definition: chatbox.cpp:575
#define CHATBOX_FLAG_SMALL
Definition: chatbox.h:21
void chatbox_force_big()
Definition: chatbox.cpp:1051
void chatbox_clear()
Definition: chatbox.cpp:664
void chatbox_reset_timestamps()
Definition: chatbox.cpp:1195
int chatbox_has_focus()
Definition: chatbox.cpp:1093
#define CHATBOX_FLAG_DRAW_BOX
Definition: chatbox.h:24
void chatbox_render()
Definition: chatbox.cpp:683
int chatbox_pressed()
Definition: chatbox.cpp:1105
void chatbox_add_line(const char *msg, int pid, int add_id=1)
Definition: chatbox.cpp:779