Data Structures |
| struct | info_buffer_t |
| | A buffer record that supports suppression of duplicate messages. This buffer holds data for messages that are monitored for suppression of duplicates. The buffer holds all data passed to message_callback(), including type, subtype, suggested color, and the text. Age and count fields are provided to track the time a message is in the buffer, and how many times it occured during the time it is buffered. More...
|
| struct | buffer_parameter_t |
| | A container for a single buffer control parameter like output count or time. The structure holds a widget pointer, a state variable to track the widget value, and a default value. More...
|
| struct | buffer_control_t |
| | A container for all of the buffer control parameters like output count and time. The structure holds widget pointers, a state variables to track the parameter values, and the client built-in defaults. Only the final initializer for output_count and output_time is used as a default. More...
|
| struct | boolean_widget_t |
| | A container that holds the pointer and state of a checkbox control. Each Message Control dialog checkbox is tracked in one of these structs. More...
|
| struct | message_control_t |
| | A container for all of the checkboxes associated with a single message type. More...
|
| struct | msgctrl_data_t |
| | Descriptive message type names with pane routing and buffer enable. A single struct defines a hard-coded, player-friendly, descriptive name to use for a single message type. All other fields in the structure define routing of messages to either or both client message panels, and whether or not messages of this type are passed through the duplicate suppression buffer system. This struct is intended to be used as the base type of an array that contains one struct per message type defined in newclient.h. The hard-coding of the descriptive name for the message type here is not ideal as it would be nicer to have it alongside the MSG_TYPE_* defines. More...
|
Defines |
| #define | NUM_TEXT_VIEWS 2 |
Functions |
| void | set_text_tag_from_style (GtkTextTag *tag, GtkStyle *style, GtkStyle *base_style) |
| void | add_tags_to_textbuffer (Info_Pane *pane, GtkTextBuffer *textbuf) |
| void | add_style_to_textbuffer (Info_Pane *pane, GtkStyle *base_style) |
| void | info_get_styles (void) |
| void | info_init (GtkWidget *window_root) |
| void | add_marked_text_to_pane (Info_Pane *pane, const char *message, int type, int subtype, int orig_color) |
| void | draw_ext_info (int orig_color, int type, int subtype, const char *message) |
| void | info_buffer_init (void) |
| void | info_buffer_flush (const int id) |
| void | info_buffer_tick (void) |
| void | menu_clear (void) |
| void | set_scroll (const char *s) |
| void | set_autorepeat (const char *s) |
| int | get_info_width (void) |
| void | msgctrl_init (GtkWidget *window_root) |
| void | update_msgctrl_configuration (void) |
| void | save_msgctrl_configuration (void) |
| void | load_msgctrl_configuration (void) |
| void | default_msgctrl_configuration (void) |
| void | read_msgctrl_configuration (void) |
| void | on_msgctrl_button_save_clicked (GtkButton *button, gpointer user_data) |
| void | on_msgctrl_button_load_clicked (GtkButton *button, gpointer user_data) |
| void | on_msgctrl_button_defaults_clicked (GtkButton *button, gpointer user_data) |
| void | on_msgctrl_button_apply_clicked (GtkButton *button, gpointer user_data) |
| void | on_msgctrl_button_close_clicked (GtkButton *button, gpointer user_data) |
| void | on_msgctrl_activate (GtkMenuItem *menuitem, gpointer user_data) |
Variables |
| const char *const | rcsid_gtk2_info_c = "$Id: info.c 14516 2011-06-06 21:27:21Z ryo_saeba $" |
| const char *const | usercolorname [NUM_COLORS] |
| Info_Pane | info_pane [NUM_TEXT_VIEWS] |
| const char *const | colorname [NUM_COLORS] |
GTK V2 Message Control System. |
Supports a client-side implementation of what used to be provided by the server output-count and output-sync commands. These defines presently control the way the system works. The hardcoded values here are temporary and shall give way to client commands and/or a GUI method of configuring the system. Turn off the output count/sync by setting MESSAGE_COUNT_MAX to 1. It should be safe to experiment with most values as long as none of them are set less than 1, and as long as the two buffer sizes are set to reasonable values (buffer sizes include the terminating null character).
|
| #define | MESSAGE_BUFFER_COUNT 10 |
| #define | MESSAGE_BUFFER_SIZE 56 |
| #define | COUNT_BUFFER_SIZE 16 |
| #define | MESSAGE_COUNT_MAX 16 |
| #define | MESSAGE_AGE_MAX 16 |
| GtkWidget * | msgctrl_window |
| GtkWidget * | msgctrl_table |
| struct info_buffer_t | info_buffer [MESSAGE_BUFFER_COUNT] |
| struct buffer_control_t | buffer_control |
| message_control_t | msgctrl_widgets [MSG_TYPE_LAST-1] |
| struct msgctrl_data_t | msgctrl_defaults [MSG_TYPE_LAST-1] |
This covers drawing text to the info window.
Definition in file info.c.
This just does the work of taking text (which may have markup) and putting it into the target pane. This is a lower level than the draw_ext_info() below, as it does not do message routing. This is called from draw_ext_info() below, as well as account.c to update news/motd/rules.
- Parameters:
-
| pane | Pointer to the pane info to draw info. |
| message | Message that is parsed and displayed. |
| type | Type of the message - for default coloring information. |
| subtype | Subtype of message - used for default coloring information. |
| orig_color | Legacy color hint not based on type that is used when a theme does not define a style for the message. |
- Note:
- Note both type and subtype are the values passed to draw_ext_info().
< Only if we get a [color] tag should we care, otherwise, the type/subtype should dictate color (unless no style set!)
Definition at line 793 of file info.c.
| void draw_ext_info |
( |
int |
orig_color, |
|
|
int |
type, |
|
|
int |
subtype, |
|
|
const char * |
message |
|
) |
| |
A message processor that accepts messages along with meta information color and type. The message type and subtype are analyzed to select font and other text attributes. All gtk-v2 client messages pass through this processor before being output. Before addition of the output buffering feature, this was the message callback function. It is a separate function so that it can be called both by the callback, and but buffer maintenance functions.
Client-sourced messages generally should be passed directly to this handler instead of to the callback. This will save some overhead as the callback implements a system that coalesces duplicate messages - a feature that is not really applicable to most messages that do not come from the server.
- Parameters:
-
| orig_color | Suggested text color that type/subtype can over-ride. |
| type | Message type. See MSG_TYPE definitions in newclient.h. |
| subtype | Message subtype. See MSG_TYPE_*_* values in newclient.h. |
| message | The message text to display. |
< When 0, the type is valid and may be used to pick the panel routing, otherwise the message can only go to the main message pane.
Definition at line 894 of file info.c.
This is used by the common help system to determine when to wrap. Should be able to get width of window, and divide by character width - however, still not perfect if we are using a variable width font. Actually, GTK can do word wrapping for us, so maybe the real fix is to have it to the word wrapping and just run a sufficiently large value.
- Returns:
- The width of the info window in characters.
- Todo:
- Configure automatic line wrap in message panels and get rid of the hardcoded 40-character wrap.
Definition at line 1309 of file info.c.
A stub function that does nothing. These are callbacks used by the common code, but they are not implemented in GTK, either because it makes no sense (set_scroll for example), or because it may not be technically possible to do so if we limit ourselves to proper GTK2 code (Eg, don't mess with the internals of X or platform specific issues)
- Parameters:
-
Definition at line 1297 of file info.c.
A stub function that does nothing. These are callbacks used by the common code, but they are not implemented in GTK, either because it makes no sense (set_scroll for example), or because it may not be technically possible to do so if we limit ourselves to proper GTK2 code (Eg, don't mess with the internals of X or platform specific issues)
- Parameters:
-
Definition at line 1284 of file info.c.
EndOf GTK V2 Message Control System. Sets attributes in the text tag from a style. Best I can gather, there is no way to take all of the attributes from a style and apply them directly to a text tag, hence this function to do the work. GtkTextTags also know what attributes are set and which are not set - thus, you can apply multiple tags to the same text, and get all of the effects. For styles, that isn't the case - a style contains all of the information. So this function also compares the loaded style from the base style, and only sets the attributes that are different.
- Parameters:
-
| tag | Text tag to set values on. |
| style | Style name to get values from. |
| base_style | Base style for the widget to compare against. |
Definition at line 323 of file info.c.