Freeciv-3.1
|
#include <gdk/gdkkeysyms.h>
#include "fcintl.h"
#include "log.h"
#include "shared.h"
#include "featured_text.h"
#include "game.h"
#include "options.h"
#include "chatline.h"
#include "gui_main.h"
#include "gui_stuff.h"
#include "script_client.h"
#include "luaconsole.h"
Go to the source code of this file.
Data Structures | |
struct | luaconsole_data |
Macros | |
#define | MAX_LUACONSOLE_HISTORY 20 |
Enumerations | |
enum | luaconsole_res { LUACONSOLE_RES_OPEN } |
Functions | |
static struct luaconsole_data * | luaconsole_dialog_get (void) |
static void | luaconsole_dialog_create (struct luaconsole_data *pdialog) |
static void | luaconsole_dialog_refresh (struct luaconsole_data *pdialog) |
static void | luaconsole_dialog_destroy (struct luaconsole_data *pdialog) |
static void | luaconsole_dialog_area_size_allocate (GtkWidget *widget, GtkAllocation *allocation, gpointer data) |
static void | luaconsole_dialog_scroll_to_bottom (void) |
static void | luaconsole_input_return (GtkEntry *w, gpointer data) |
static gboolean | luaconsole_input_handler (GtkWidget *w, GdkEventKey *ev) |
static void | luaconsole_response_callback (struct gui_dialog *pgui_dialog, int response, gpointer data) |
static void | luaconsole_load_file_popup (void) |
static void | luaconsole_load_file_callback (GtkWidget *widget, gint response, gpointer data) |
void | luaconsole_dialog_init (void) |
void | luaconsole_dialog_done (void) |
void | luaconsole_dialog_popup (bool raise) |
void | luaconsole_dialog_popdown (void) |
bool | luaconsole_dialog_is_open (void) |
void | real_luaconsole_dialog_update (void) |
void | real_luaconsole_append (const char *astring, const struct text_tag_list *tags) |
Variables | |
static struct luaconsole_data * | luaconsole = NULL |
#define MAX_LUACONSOLE_HISTORY 20 |
Definition at line 46 of file luaconsole.c.
enum luaconsole_res |
Enumerator | |
---|---|
LUACONSOLE_RES_OPEN |
Definition at line 42 of file luaconsole.c.
|
static |
When the luaconsole text view is resized, scroll it to the bottom. This prevents users from accidentally missing messages when the chatline gets scrolled up a small amount and stops scrolling down automatically.
Definition at line 394 of file luaconsole.c.
Referenced by luaconsole_dialog_create().
|
static |
Initialize a lua console.
Definition at line 183 of file luaconsole.c.
Referenced by luaconsole_dialog_popup().
|
static |
Closes a lua console.
Definition at line 442 of file luaconsole.c.
Referenced by luaconsole_dialog_popdown().
void luaconsole_dialog_done | ( | void | ) |
|
static |
Get the data for the lua console.
Definition at line 118 of file luaconsole.c.
Referenced by luaconsole_dialog_is_open(), luaconsole_dialog_popdown(), luaconsole_dialog_popup(), luaconsole_dialog_scroll_to_bottom(), luaconsole_input_handler(), luaconsole_input_handler(), luaconsole_input_return(), real_luaconsole_append(), and real_luaconsole_dialog_update().
void luaconsole_dialog_init | ( | void | ) |
Create a lua console.
Definition at line 83 of file luaconsole.c.
Referenced by activate_gui(), and ui_main().
bool luaconsole_dialog_is_open | ( | void | ) |
Return TRUE iff the lua console is open.
Definition at line 157 of file luaconsole.c.
void luaconsole_dialog_popdown | ( | void | ) |
Closes the lua console; the content is saved till the client is done.
Definition at line 144 of file luaconsole.c.
Referenced by luaconsole_dialog_done().
void luaconsole_dialog_popup | ( | bool | raise | ) |
Popup the lua console inside the main-window, and optionally raise it.
Definition at line 126 of file luaconsole.c.
Referenced by client_lua_script_callback(), and client_lua_script_callback().
|
static |
Refresh a lua console.
Definition at line 434 of file luaconsole.c.
Referenced by luaconsole_dialog_create(), and real_luaconsole_dialog_update().
|
static |
Scrolls the luaconsole all the way to the bottom. If delayed is TRUE, it will be done in a idle_callback.
Modified copy of chatline_scroll_to_bottom().
Definition at line 413 of file luaconsole.c.
Referenced by luaconsole_dialog_area_resize(), and luaconsole_dialog_area_size_allocate().
|
static |
Called when a key is pressed.
Definition at line 352 of file luaconsole.c.
Referenced by luaconsole_dialog_create().
|
static |
Called when the return key is pressed.
Definition at line 256 of file luaconsole.c.
Referenced by luaconsole_dialog_create().
|
static |
Callback for luaconsole_load_file_popup().
Definition at line 332 of file luaconsole.c.
Referenced by luaconsole_load_file_popup().
|
static |
Create a file selector for loading a lua file..
Definition at line 309 of file luaconsole.c.
Referenced by luaconsole_response_callback().
|
static |
Dialog response callback.
Definition at line 288 of file luaconsole.c.
Referenced by luaconsole_dialog_create().
void real_luaconsole_append | ( | const char * | astring, |
const struct text_tag_list * | tags | ||
) |
Appends the string to the chat output window. The string should be inserted on its own line, although it will have no newline.
Definition at line 458 of file luaconsole.c.
Referenced by luaconsole_append(), and luaconsole_event().
void real_luaconsole_dialog_update | ( | void | ) |
Update the lua console.
Definition at line 169 of file luaconsole.c.
|
static |
Definition at line 58 of file luaconsole.c.
Referenced by luaconsole_dialog_done(), luaconsole_dialog_get(), and luaconsole_dialog_init().