Freeciv-3.3
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <gdk/gdkkeysyms.h>
#include "fcintl.h"
#include "genlist.h"
#include "log.h"
#include "mem.h"
#include "support.h"
#include "chat.h"
#include "featured_text.h"
#include "game.h"
#include "packets.h"
#include "client_main.h"
#include "climap.h"
#include "control.h"
#include "mapview_common.h"
#include "update_queue.h"
#include "colors.h"
#include "gui_main.h"
#include "gui_stuff.h"
#include "pages.h"
#include "chatline.h"
Go to the source code of this file.
Data Structures | |
struct | inputline_toolkit |
Macros | |
#define | MAX_CHATLINE_HISTORY 20 |
#define | MAX_MATCHES 10 |
Variables | |
static struct genlist * | history_list = NULL |
static int | history_pos = -1 |
static struct inputline_toolkit | toolkit |
#define MAX_CHATLINE_HISTORY 20 |
Definition at line 53 of file chatline.c.
#define MAX_MATCHES 10 |
void apply_text_tag | ( | const struct text_tag * | ptag, |
GtkTextBuffer * | buf, | ||
ft_offset_t | text_start_offset, | ||
const char * | text | ||
) |
Convert a struct text_tag to a GtkTextTag.
Definition at line 756 of file chatline.c.
Referenced by real_luaconsole_append(), and real_output_window_append().
|
static |
|
static |
Autocompletes the input line with a player or user name. Returns FALSE if there is no string to complete.
Definition at line 285 of file chatline.c.
Referenced by inputline_handler(), and inputline_handler().
Initializes the chatline stuff.
Definition at line 1303 of file chatline.c.
Referenced by activate_gui(), and ui_main().
Returns whether the chatline is scrolled to the bottom.
Definition at line 960 of file chatline.c.
Referenced by button_toggled(), and voteinfo_gui_update().
Scrolls the pregame and in-game chat windows all the way to the bottom.
Why do we do it in such a convuluted fasion rather than calling chatline_scroll_to_bottom directly from toplevel_configure? Because the widget is not at its final size yet when the configure event occurs.
Definition at line 995 of file chatline.c.
Referenced by chatline_scroll_to_bottom().
Scrolls the pregame and in-game chat windows all the way to the bottom. If delayed is TRUE, it will be done in a idle_callback.
Definition at line 1007 of file chatline.c.
Referenced by button_toggled(), chatline_scroll_callback(), main_message_area_resize(), main_message_area_size_allocate(), real_set_client_page(), and voteinfo_gui_update().
|
static |
Find a player or a user by prefix.
prefix | The prefix. |
matches | A string array to set the matches result. |
max_matches | The maximum of matches. |
Definition at line 203 of file chatline.c.
Referenced by chatline_autocomplete().
Clear output window. This does not destroy it, or free its resources
Definition at line 944 of file chatline.c.
Referenced by clear_chat_logs_callback(), and clear_chat_logs_callback().
Color selection dialog response.
Definition at line 1095 of file chatline.c.
Referenced by select_color_callback(), and select_color_callback().
|
static |
Set the color for an object. Update the button if not NULL.
Definition at line 1044 of file chatline.c.
|
static |
Click a link.
Definition at line 585 of file chatline.c.
Referenced by set_message_buffer_view_link_handlers().
|
static |
Find the larger common prefix.
prefixes - A list of prefixes. num_prefixes - The number of prefixes. buf - The buffer to set. buf_len - The maximal size of the buffer.
Returns the length of the common prefix (in characters).
Definition at line 258 of file chatline.c.
Referenced by chatline_autocomplete().
Returns the name of player or user, set in the same list.
Definition at line 176 of file chatline.c.
Referenced by check_player_or_user_name().
Gives the focus to the intput line.
Definition at line 80 of file chatline.c.
Referenced by real_set_client_page(), toplevel_key_press_handler(), and toplevel_key_press_handler().
|
static |
Called when a key is pressed.
Definition at line 346 of file chatline.c.
Referenced by chatline_init().
Returns TRUE iff the input line has focus.
Definition at line 72 of file chatline.c.
Referenced by toplevel_key_press_handler(), toplevel_key_press_handler(), and toplevel_key_release_handler().
Returns TRUE iff the input line is currently visible.
Definition at line 88 of file chatline.c.
Referenced by toplevel_key_press_handler(), and toplevel_key_press_handler().
Make a chat link at the current position or make the current selection clickable.
Definition at line 475 of file chatline.c.
Referenced by butt_down_mapcanvas(), and right_butt_down_mapcanvas().
|
static |
Make a text tag for the selected text.
Definition at line 417 of file chatline.c.
Referenced by inputline_handler(), inputline_handler(), make_tag_callback(), and make_tag_callback().
Called when the return key is pressed.
Definition at line 140 of file chatline.c.
Referenced by chatline_init().
Appends a button to the inputline toolkit view widget.
Definition at line 1293 of file chatline.c.
Referenced by create_start_page(), and setup_widgets().
Returns a new inputline toolkit view widget that can contain the inputline.
This widget has the following datas: "button_box": pointer to the GtkHBox where to append buttons.
Definition at line 1271 of file chatline.c.
Referenced by create_start_page(), and setup_widgets().
Helper function to determine if a given client input line is intended as a "plain" public message. Note that messages prefixed with : are a special case (explicit public messages), and will return FALSE.
Definition at line 98 of file chatline.c.
Referenced by inputline_return(), and chat_listener::send_chat_message().
I have no idea what module this belongs in – Syela I've decided to put output_window routines in chatline.c, because the are somewhat related and output_window_* is already here. –dwp
Definition at line 929 of file chatline.c.
Referenced by save_chat_logs_callback(), and save_chat_logs_callback().
|
static |
|
static |
Maybe are the mouse is moving over a link.
Definition at line 729 of file chatline.c.
Referenced by set_message_buffer_view_link_handlers().
Moves the tool kit to the toolkit view.
Definition at line 1156 of file chatline.c.
Referenced by inputline_toolkit_view_new().
void real_output_window_append | ( | const char * | astring, |
const struct text_tag_list * | tags, | ||
int | conn_id | ||
) |
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 875 of file chatline.c.
Referenced by fc_client::fc_main(), output_window_append(), and output_window_event().
void scroll_if_necessary | ( | GtkTextView * | textview, |
GtkTextMark * | scroll_target | ||
) |
Scroll a textview so that the given mark is visible, but only if the scroll window containing the textview is very close to the bottom. The text mark 'scroll_target' should probably be the first character of the last line in the text buffer.
Definition at line 558 of file chatline.c.
Referenced by real_luaconsole_append(), and real_output_window_append().
|
static |
Color selection tool button clicked.
Definition at line 1121 of file chatline.c.
Referenced by chatline_init().
|
static |
Set the "hand" cursor when moving over a link.
Definition at line 675 of file chatline.c.
Referenced by chat_pointer_motion(), and motion_notify_event().
Set the appropriate callbacks for the message buffer.
Definition at line 745 of file chatline.c.
Referenced by luaconsole_dialog_create(), and setup_widgets().
Set given text to output window
Definition at line 952 of file chatline.c.
Got version message from metaserver thread.
Definition at line 1478 of file chatline.c.
Main thread side callback to print version message
Definition at line 1464 of file chatline.c.
Referenced by version_message().
Definition at line 55 of file chatline.c.
Referenced by chatline_init(), inputline_handler(), inputline_handler(), and inputline_return().
|
static |
Definition at line 56 of file chatline.c.
Referenced by chatline_init(), inputline_handler(), inputline_handler(), and inputline_return().
|
static |