Open source remastering of the Freespace 2 engine
popup.cpp File Reference
#include <stdarg.h>
#include "anim/animplay.h"
#include "freespace2/freespace.h"
#include "gamesequence/gamesequence.h"
#include "gamesnd/gamesnd.h"
#include "globalincs/alphacolors.h"
#include "graphics/font.h"
#include "io/key.h"
#include "io/mouse.h"
#include "osapi/osapi.h"
#include "parse/parselo.h"
#include "playerman/player.h"
#include "popup/popup.h"
#include "ui/ui.h"

Go to the source code of this file.


struct  popup_info
struct  popup_background


#define POPUP_MAX_LINE_CHARS   256
#define POPUP_MAX_LINES   30
#define POPUP_MAX_CHARS   2048
#define POPUP_NOCHANGE   100
#define POPUP_ABORT   101
#define PF_INPUT   (1<<0)


typedef struct popup_info popup_info
typedef struct popup_background popup_background


int popup_check_buttons (popup_info *pi)
void popup_play_default_change_sound (popup_info *pi)
int popup_process_keys (popup_info *pi, int k, int flags)
void popup_split_lines (popup_info *pi, int flags)
char * popup_get_button_filename (popup_info *pi, int i, int flags)
void popup_slider_bogus ()
int popup_init (popup_info *pi, int flags)
void popup_close (popup_info *pi, int screen_id)
void popup_set_text_color (int flags)
void popup_set_title_color (int flags)
void popup_draw_title (int sy, char *line, int flags)
int popup_calc_starting_index (popup_info *pi)
int popup_calc_starting_y (popup_info *pi, int flags)
void popup_draw_msg_text (popup_info *pi, int flags)
void popup_draw_button_text (popup_info *pi, int flags)
void popup_force_draw_buttons (popup_info *pi)
int popup_do (popup_info *pi, int flags)
int popup_do_with_condition (popup_info *pi, int flags, int(*condition)())
void popup_maybe_assign_keypress (popup_info *pi, int n, char *str)
int popup (int flags, int nchoices,...)
int popup_active ()
int popup_till_condition (int(*condition)(),...)
char * popup_input (int flags, const char *caption, int max_output_len)
int popup_running_state ()
void popup_kill_any_active ()
void popup_change_text (const char *new_text)


int Popup_max_display [GR_NUM_RESOLUTIONS]
char * Popup_slider_name [GR_NUM_RESOLUTIONS]
int Popup_slider_coords [GR_NUM_RESOLUTIONS][4]
UI_WINDOW Popup_window
UI_BUTTON Popup_button_regions [POPUP_MAX_CHOICES]
UI_INPUTBOX Popup_input
UI_SLIDER2 Popup_slider
int Popup_text_coords [GR_NUM_RESOLUTIONS][4]
int Popup_input_y_offset [GR_NUM_RESOLUTIONS]
int Popup_input_text_y_offset [GR_NUM_RESOLUTIONS]
int Popup_running_state
int Popup_default_choice

Macro Definition Documentation


Definition at line 189 of file popup.cpp.


Definition at line 190 of file popup.cpp.


Definition at line 191 of file popup.cpp.


Definition at line 187 of file popup.cpp.


Definition at line 188 of file popup.cpp.

#define PF_INPUT   (1<<0)

Definition at line 61 of file popup.cpp.

#define POPUP_ABORT   101

Definition at line 37 of file popup.cpp.


Definition at line 34 of file popup.cpp.

#define POPUP_MAX_CHARS   2048

Definition at line 33 of file popup.cpp.


Definition at line 29 of file popup.cpp.

#define POPUP_MAX_LINE_CHARS   256

Definition at line 31 of file popup.cpp.

#define POPUP_MAX_LINES   30

Definition at line 32 of file popup.cpp.

#define POPUP_NOCHANGE   100

Definition at line 36 of file popup.cpp.

Typedef Documentation

typedef struct popup_info popup_info

Function Documentation

int popup ( int  flags,
int  nchoices,

Definition at line 993 of file popup.cpp.

int popup_active ( )

Definition at line 1039 of file popup.cpp.

int popup_calc_starting_index ( popup_info pi)

Definition at line 647 of file popup.cpp.

int popup_calc_starting_y ( popup_info pi,
int  flags 

Definition at line 660 of file popup.cpp.

void popup_change_text ( const char *  new_text)

Definition at line 1150 of file popup.cpp.

int popup_check_buttons ( popup_info pi)

Definition at line 228 of file popup.cpp.

void popup_close ( popup_info pi,
int  screen_id 

Definition at line 553 of file popup.cpp.

int popup_do ( popup_info pi,
int  flags 

Definition at line 812 of file popup.cpp.

int popup_do_with_condition ( popup_info pi,
int  flags,
int(*)()  condition 

Definition at line 886 of file popup.cpp.

void popup_draw_button_text ( popup_info pi,
int  flags 

Definition at line 741 of file popup.cpp.

void popup_draw_msg_text ( popup_info pi,
int  flags 

Definition at line 692 of file popup.cpp.

void popup_draw_title ( int  sy,
char *  line,
int  flags 

Definition at line 629 of file popup.cpp.

void popup_force_draw_buttons ( popup_info pi)

Definition at line 777 of file popup.cpp.

char* popup_get_button_filename ( popup_info pi,
int  i,
int  flags 

Definition at line 391 of file popup.cpp.

int popup_init ( popup_info pi,
int  flags 

Definition at line 462 of file popup.cpp.

char* popup_input ( int  flags,
const char *  caption,
int  max_output_len 

Definition at line 1092 of file popup.cpp.

void popup_kill_any_active ( )

Definition at line 1142 of file popup.cpp.

void popup_maybe_assign_keypress ( popup_info pi,
int  n,
char *  str 

Definition at line 948 of file popup.cpp.

void popup_play_default_change_sound ( popup_info pi)

Definition at line 249 of file popup.cpp.

int popup_process_keys ( popup_info pi,
int  k,
int  flags 

Definition at line 288 of file popup.cpp.

int popup_running_state ( )

Definition at line 1136 of file popup.cpp.

void popup_set_text_color ( int  flags)

Definition at line 582 of file popup.cpp.

void popup_set_title_color ( int  flags)

Definition at line 603 of file popup.cpp.

void popup_slider_bogus ( )

Definition at line 457 of file popup.cpp.

void popup_split_lines ( popup_info pi,
int  flags 

Definition at line 353 of file popup.cpp.

int popup_till_condition ( int(*)()  condition,

Definition at line 1048 of file popup.cpp.

Variable Documentation

UI_BUTTON Popup_button_regions[POPUP_MAX_CHOICES]

Definition at line 86 of file popup.cpp.


Definition at line 85 of file popup.cpp.

int Popup_default_choice

Definition at line 223 of file popup.cpp.

UI_INPUTBOX Popup_input

Definition at line 87 of file popup.cpp.

int Popup_input_text_y_offset[GR_NUM_RESOLUTIONS]
Initial value:
= {

Definition at line 108 of file popup.cpp.

int Popup_input_y_offset[GR_NUM_RESOLUTIONS]
Initial value:
= {

Definition at line 102 of file popup.cpp.

int Popup_max_display[GR_NUM_RESOLUTIONS]
Initial value:
= {

Definition at line 39 of file popup.cpp.

int Popup_running_state

Definition at line 222 of file popup.cpp.

UI_SLIDER2 Popup_slider

Definition at line 88 of file popup.cpp.

int Popup_slider_coords[GR_NUM_RESOLUTIONS][4]
Initial value:
= {
121, 109, 15, 105
195, 177, 30, 173

Definition at line 49 of file popup.cpp.

char* Popup_slider_name[GR_NUM_RESOLUTIONS]
Initial value:
= {

Definition at line 44 of file popup.cpp.

int Popup_text_coords[GR_NUM_RESOLUTIONS][4]
Initial value:
= {
137, 106, 343, 113
219, 169, 558, 182

Definition at line 91 of file popup.cpp.

UI_WINDOW Popup_window

Definition at line 84 of file popup.cpp.