2001-02-21 19:35:06 +00:00
|
|
|
/*
|
|
|
|
console.h
|
|
|
|
|
|
|
|
Console definitions and prototypes
|
|
|
|
|
|
|
|
Copyright (C) 1996-1997 Id Software, Inc.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to:
|
|
|
|
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
59 Temple Place - Suite 330
|
|
|
|
Boston, MA 02111-1307, USA
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2020-02-24 03:21:20 +00:00
|
|
|
#ifndef __QF_console_h
|
|
|
|
#define __QF_console_h
|
2001-09-21 04:22:46 +00:00
|
|
|
|
2022-09-18 02:30:40 +00:00
|
|
|
#include <stdint.h>
|
2001-02-21 19:35:06 +00:00
|
|
|
|
2001-03-27 23:36:02 +00:00
|
|
|
#include "QF/qtypes.h"
|
2001-02-21 19:35:06 +00:00
|
|
|
|
2007-04-08 08:48:13 +00:00
|
|
|
/** \defgroup console 2d Console Stuff
|
|
|
|
*/
|
|
|
|
|
2001-09-30 05:59:33 +00:00
|
|
|
typedef struct {
|
2022-09-18 02:30:40 +00:00
|
|
|
uint32_t text;
|
|
|
|
uint32_t len;
|
2001-09-30 05:59:33 +00:00
|
|
|
} con_line_t;
|
|
|
|
|
|
|
|
typedef struct {
|
2022-09-18 02:30:40 +00:00
|
|
|
byte *buffer;
|
|
|
|
con_line_t *lines;
|
|
|
|
uint32_t buffer_size;
|
|
|
|
uint32_t max_lines; // size of lines array
|
|
|
|
uint32_t line_head; // number of lines used
|
|
|
|
uint32_t line_tail; // current line
|
2001-09-30 05:59:33 +00:00
|
|
|
} con_buffer_t;
|
|
|
|
|
2021-11-08 02:20:04 +00:00
|
|
|
typedef enum {
|
|
|
|
con_inactive,
|
|
|
|
con_active,
|
|
|
|
con_fullscreen,
|
2021-11-28 13:42:01 +00:00
|
|
|
con_message, //FIXME should not be here ?
|
|
|
|
con_menu, //FIXME should not be here ?
|
2021-11-08 02:20:04 +00:00
|
|
|
} con_state_t;
|
|
|
|
|
2001-10-28 04:23:37 +00:00
|
|
|
extern int con_linewidth;
|
2002-01-16 21:53:42 +00:00
|
|
|
extern struct plugin_s *con_module;
|
2002-01-18 19:19:33 +00:00
|
|
|
extern struct console_data_s con_data;
|
2001-02-21 19:35:06 +00:00
|
|
|
|
2002-01-16 21:53:42 +00:00
|
|
|
//extern int con_totallines;
|
|
|
|
//extern qboolean con_initialized;
|
|
|
|
//extern byte *con_chars;
|
2001-02-21 19:35:06 +00:00
|
|
|
|
2003-07-25 22:21:47 +00:00
|
|
|
void Con_DrawConsole (void);
|
2001-09-16 05:41:28 +00:00
|
|
|
|
2021-03-27 10:52:59 +00:00
|
|
|
void Con_Printf (const char *fmt, ...) __attribute__((format(PRINTF, 1, 2)));
|
|
|
|
void Con_Print (const char *fmt, va_list args) __attribute__((format(PRINTF, 1, 0)));
|
2021-11-08 02:20:04 +00:00
|
|
|
void Con_SetState (con_state_t state);
|
2001-02-21 19:35:06 +00:00
|
|
|
|
2021-06-12 13:50:51 +00:00
|
|
|
struct inputline_s;
|
2001-06-28 04:05:14 +00:00
|
|
|
// wrapper function to attempt to either complete the command line
|
|
|
|
// or to list possible matches grouped by type
|
|
|
|
// (i.e. will display possible variables, aliases, commands
|
|
|
|
// that match what they've typed so far)
|
2021-06-12 13:50:51 +00:00
|
|
|
void Con_BasicCompleteCommandLine (struct inputline_s *il);
|
2001-06-28 04:05:14 +00:00
|
|
|
|
|
|
|
// Generic libs/util/console.c function to display a list
|
|
|
|
// formatted in columns on the console
|
2001-07-15 07:04:17 +00:00
|
|
|
void Con_DisplayList(const char **list, int con_linewidth);
|
2021-03-27 10:52:59 +00:00
|
|
|
extern void (*con_list_print)(const char *fmt, ...) __attribute__((format(PRINTF, 1, 2)));
|
2001-06-28 04:05:14 +00:00
|
|
|
|
2001-09-30 05:59:33 +00:00
|
|
|
con_buffer_t *Con_CreateBuffer (size_t buffer_size, int max_lines);
|
|
|
|
void Con_DestroyBuffer (con_buffer_t *buffer);
|
|
|
|
void Con_BufferAddText (con_buffer_t *buf, const char *text);
|
|
|
|
#define Con_BufferLine(b,l) ((b)->lines + ((l) + (b)->max_lines) % (b)->max_lines)
|
2022-09-20 03:14:01 +00:00
|
|
|
void Con_ClearBuffer (con_buffer_t *buffer);
|
2001-07-17 16:46:51 +00:00
|
|
|
|
2001-09-16 05:41:28 +00:00
|
|
|
// init/shutdown functions
|
2023-01-20 04:27:17 +00:00
|
|
|
void Con_Load (const char *plugin_name);
|
|
|
|
void Con_Init (void);
|
2007-04-07 05:50:29 +00:00
|
|
|
void Con_ExecLine (const char *line);
|
2001-09-16 05:41:28 +00:00
|
|
|
|
|
|
|
void Con_ProcessInput (void);
|
2002-01-16 21:53:42 +00:00
|
|
|
void Con_SetOrMask (int mask);
|
2002-01-18 19:19:33 +00:00
|
|
|
void Con_NewMap (void);
|
2001-09-16 05:41:28 +00:00
|
|
|
|
2001-11-05 22:24:16 +00:00
|
|
|
void Con_Maplist_f (void);
|
2001-11-06 07:14:29 +00:00
|
|
|
void Con_Skinlist_f (void);
|
|
|
|
void Con_Skyboxlist_f (void);
|
|
|
|
void Con_Demolist_QWD_f (void);
|
|
|
|
void Con_Demolist_DEM_f (void);
|
2001-11-05 22:24:16 +00:00
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
//FIXME need a better way to communicate this (bah, need a better menu system
|
|
|
|
// in general :P)
|
2021-06-12 13:50:51 +00:00
|
|
|
void C_DrawInputLine (struct inputline_s *il);
|
2003-01-06 18:28:13 +00:00
|
|
|
|
2003-05-06 02:19:13 +00:00
|
|
|
struct view_s;
|
2002-01-18 19:19:33 +00:00
|
|
|
void Menu_Init (void);
|
|
|
|
void Menu_Load (void);
|
2022-11-04 01:38:07 +00:00
|
|
|
void Menu_Draw (struct view_s view);
|
|
|
|
void Menu_Draw_Hud (struct view_s view);
|
2021-11-28 13:42:01 +00:00
|
|
|
struct IE_event_s;
|
|
|
|
int Menu_EventHandler (const struct IE_event_s *ie_event);
|
2002-01-18 23:45:28 +00:00
|
|
|
void Menu_Enter (void);
|
|
|
|
void Menu_Leave (void);
|
2002-01-18 19:19:33 +00:00
|
|
|
|
2013-01-26 19:34:53 +00:00
|
|
|
void Menu_Enter_f (void);
|
|
|
|
void Menu_Leave_f (void);
|
|
|
|
void Menu_Prev_f (void);
|
|
|
|
void Menu_Next_f (void);
|
|
|
|
|
2020-02-24 03:21:20 +00:00
|
|
|
#endif//__QF_console_h
|