Crossfire Client, Branch
R11627
|
#include <config.h>
#include <stdio.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include "client.h"
#include "gx11.h"
#include "gtkproto.h"
#include "pixmaps/sign_flat.xpm"
#include "pixmaps/sign_west.xpm"
#include "pixmaps/sign_east.xpm"
#include "pixmaps/close.xpm"
Go to the source code of this file.
Data Structures | |
struct | picture_message_struct |
Defines | |
#define | STYLE_BOLD 1 |
#define | STYLE_ITALIC 2 |
Typedefs | |
typedef struct picture_message_struct | picture_message |
Functions | |
static void | add_book (char *title, char *message) |
static void | admin_callback (int flag, int type, int subtype, char *message) |
static void | book_callback (int flag, int type, int subtype, char *message) |
void | cleanup_textmanagers (void) |
static GtkWidget * | create_text_picture_window (picture_message *layout, char *message) |
news_entry * | get_news (void) |
const char * | get_rules (void) |
const char * | getMOTD (void) |
static void | init_fonts (void) |
static void | init_pictures (GtkWidget *refWindow) |
void | init_text_callbacks (void) |
static GdkFont * | load_a_font (const char *const font_list[]) |
static void | motd_callback (int flag, int type, int subtype, char *message) |
static void | prepare_book_window (void) |
static void | show_media_message (const char *title, const char *message) |
static void | sign_callback (int color, int type, int subtype, char *message) |
static void | void_callback (int flag, int type, int subtype, char *message) |
media_state | write_media (GtkText *textarea, const char *message) |
media_state | write_media_with_state (GtkText *textarea, const char *message, media_state current_state) |
Variables | |
static const char *const | arcane_medium_fontname [] |
Parse message, extract multimedia information, and push as appropriate in the GtkText. | |
GtkWidget * | book_notes = NULL |
GtkWidget * | book_root = NULL |
GdkBitmap * | btnClose_bm = NULL |
GdkPixmap * | btnClose_pm = NULL |
news_entry * | first_news = NULL |
static const char *const | fixed_bold_fontname [] |
static const char *const | fixed_italic_fontname [] |
static const char *const | fixed_italicbold_fontname [] |
static const char *const | fixed_medium_fontname [] |
GtkWidget * | gtkwin_info_text |
GtkWidget * | gtkwin_info_text2 |
static const char *const | hand_medium_fontname [] |
static char * | last_motd = NULL |
static char | NO_TITLE [] = "[no title]" |
static const char *const | print_bold_fontname [] |
static const char *const | print_italic_fontname [] |
static const char *const | print_italicbold_fontname [] |
static const char *const | print_medium_fontname [] |
const char *const | rcsid_gtk_text_c = "$Id: text.c 9190 2008-06-01 08:53:05Z anmaster $" |
static char * | rules = NULL |
static picture_message | sign_message [] |
static const char *const | strange_medium_fontname [] |
static GdkFont * | style_arcane [4] |
static GdkFont * | style_fixed [4] |
static GdkFont * | style_hand [4] |
static int | style_inited = 0 |
static GdkFont * | style_print [4] |
static GdkFont * | style_strange [4] |
#define STYLE_BOLD 1 |
Definition at line 255 of file text.c.
Referenced by write_media_with_state().
#define STYLE_ITALIC 2 |
Definition at line 256 of file text.c.
Referenced by write_media_with_state().
typedef struct picture_message_struct picture_message |
static void add_book | ( | char * | title, |
char * | message | ||
) | [static] |
Definition at line 339 of file text.c.
References book_notes, book_root, btnClose_bm, btnClose_pm, FALSE, prepare_book_window(), TRUE, and write_media().
Referenced by book_callback().
static void admin_callback | ( | int | flag, |
int | type, | ||
int | subtype, | ||
char * | message | ||
) | [static] |
Definition at line 465 of file text.c.
References CONFIG_SPLITINFO, draw_info(), first_news, gtkwin_info_text, gtkwin_info_text2, LOG(), LOG_ERROR, MSG_TYPE_ADMIN_NEWS, MSG_TYPE_ADMIN_RULES, rules, use_config, and write_media().
Referenced by init_text_callbacks().
static void book_callback | ( | int | flag, |
int | type, | ||
int | subtype, | ||
char * | message | ||
) | [static] |
Definition at line 391 of file text.c.
References add_book(), CONFIG_POPUPS, CONFIG_SPLITINFO, gtkwin_info_text, gtkwin_info_text2, LOG(), LOG_DEBUG, NO_TITLE, use_config, want_config, and write_media().
Referenced by init_text_callbacks().
void cleanup_textmanagers | ( | void | ) |
Definition at line 522 of file text.c.
References news_entry::content, first_news, last_motd, news_entry::next, rules, and news_entry::title.
Referenced by cleanup_connection(), disconnect(), and event_loop().
static GtkWidget* create_text_picture_window | ( | picture_message * | layout, |
char * | message | ||
) | [static] |
Definition at line 85 of file text.c.
References FALSE, picture_message_struct::height, init_pictures(), picture_message_struct::picture, picture_message_struct::title, TRUE, picture_message_struct::width, picture_message_struct::window_height, picture_message_struct::window_width, write_media(), picture_message_struct::x, picture_message_struct::xpm, and picture_message_struct::y.
Referenced by sign_callback().
news_entry* get_news | ( | void | ) |
Definition at line 462 of file text.c.
References first_news.
Referenced by buildLoginDialog().
const char* get_rules | ( | void | ) |
Definition at line 459 of file text.c.
References rules.
Referenced by buildLoginDialog().
const char* getMOTD | ( | void | ) |
Definition at line 454 of file text.c.
References last_motd.
Referenced by buildLoginDialog().
static void init_fonts | ( | void | ) | [static] |
Definition at line 259 of file text.c.
References arcane_medium_fontname, fixed_bold_fontname, fixed_italic_fontname, fixed_italicbold_fontname, fixed_medium_fontname, hand_medium_fontname, load_a_font(), print_bold_fontname, print_italic_fontname, print_italicbold_fontname, print_medium_fontname, strange_medium_fontname, style_arcane, style_fixed, style_hand, style_inited, style_print, and style_strange.
Referenced by write_media_with_state().
static void init_pictures | ( | GtkWidget * | refWindow | ) | [static] |
Definition at line 64 of file text.c.
References btnClose_bm, and btnClose_pm.
Referenced by create_text_picture_window(), and prepare_book_window().
void init_text_callbacks | ( | void | ) |
Definition at line 515 of file text.c.
References admin_callback(), book_callback(), motd_callback(), MSG_TYPE_ADMIN, MSG_TYPE_BOOK, MSG_TYPE_MOTD, MSG_TYPE_SIGN, setTextManager(), and sign_callback().
Referenced by main().
static GdkFont* load_a_font | ( | const char *const | font_list[] | ) | [static] |
Definition at line 238 of file text.c.
References LOG(), and LOG_INFO.
Referenced by init_fonts().
static void motd_callback | ( | int | flag, |
int | type, | ||
int | subtype, | ||
char * | message | ||
) | [static] |
Definition at line 416 of file text.c.
References CONFIG_POPUPS, gtkwin_info_text, last_motd, LOG(), LOG_ERROR, want_config, and write_media().
Referenced by init_text_callbacks().
static void prepare_book_window | ( | void | ) | [static] |
Definition at line 70 of file text.c.
References book_notes, book_root, and init_pictures().
Referenced by add_book().
static void show_media_message | ( | const char * | title, |
const char * | message | ||
) | [static] |
Definition at line 135 of file text.c.
References FALSE, TRUE, and write_media().
static void sign_callback | ( | int | color, |
int | type, | ||
int | subtype, | ||
char * | message | ||
) | [static] |
Definition at line 434 of file text.c.
References CONFIG_POPUPS, CONFIG_SIGNPOPUP, CONFIG_SPLITINFO, create_text_picture_window(), gtkwin_info_text, gtkwin_info_text2, gtkwin_root, use_config, want_config, and write_media().
Referenced by init_text_callbacks().
static void void_callback | ( | int | flag, |
int | type, | ||
int | subtype, | ||
char * | message | ||
) | [static] |
media_state write_media | ( | GtkText * | textarea, |
const char * | message | ||
) |
Definition at line 282 of file text.c.
References media_state::flavor, media_state::has_color, media_state::style, style_print, and write_media_with_state().
Referenced by add_book(), admin_callback(), book_callback(), buildLoginDialog(), create_text_picture_window(), fill_news(), motd_callback(), show_media_message(), and sign_callback().
media_state write_media_with_state | ( | GtkText * | textarea, |
const char * | message, | ||
media_state | current_state | ||
) |
Definition at line 289 of file text.c.
References media_state::flavor, media_state::fore, media_state::has_color, init_fonts(), LOG(), LOG_ERROR, LOG_INFO, media_state::style, style_arcane, STYLE_BOLD, style_fixed, style_hand, STYLE_ITALIC, style_print, and style_strange.
Referenced by fill_news(), and write_media().
const char* const arcane_medium_fontname[] [static] |
{ "-*-cuneifontlight-*-r-*-*-*-120-*-*-*-*-iso8859-*", "-*-linotext-*-r-*-*-*-120-*-*-*-*-iso8859-*", "-*-blackforest-*-r-*-*-*-120-*-*-*-*-iso8859-*", "-*-becker-*-*-*-*-*-120-*-*-*-*-iso8859-*", "-*-arnoldboecklin-*-r-*-*-*-120-*-*-*-*-iso8859-*", "-*-caligula-*-*-*-*-*-120-*-*-*-*-iso8859-*", NULL }
Parse message, extract multimedia information, and push as appropriate in the GtkText.
Definition at line 166 of file text.c.
Referenced by init_fonts().
GtkWidget* book_notes = NULL |
Definition at line 42 of file text.c.
Referenced by add_book(), and prepare_book_window().
GtkWidget* book_root = NULL |
Definition at line 41 of file text.c.
Referenced by add_book(), and prepare_book_window().
GdkBitmap* btnClose_bm = NULL |
Definition at line 43 of file text.c.
Referenced by add_book(), and init_pictures().
GdkPixmap* btnClose_pm = NULL |
Definition at line 44 of file text.c.
Referenced by add_book(), and init_pictures().
news_entry* first_news = NULL |
Definition at line 458 of file text.c.
Referenced by admin_callback(), cleanup_textmanagers(), and get_news().
const char* const fixed_bold_fontname[] [static] |
{ "-*-fixed-bold-r-*-*-*-120-*-*-*-*-iso8859-*", "-*-courrier-bold-*-*-*-*-120-*-*-*-*-iso8859-*", "-*-andale mono-medium-*-*-*-*-120-*-*-*-*-iso8859-*", NULL }
Definition at line 220 of file text.c.
Referenced by init_fonts().
const char* const fixed_italic_fontname[] [static] |
{ "-*-fixed-medium-o-*-*-*-120-*-*-*-*-iso8859-*", "-*-courrier-medium-o-*-*-*-120-*-*-*-*-iso8859-*", "-*-andale mono-medium-*-*-*-*-120-*-*-*-*-iso8859-*", NULL }
Definition at line 226 of file text.c.
Referenced by init_fonts().
const char* const fixed_italicbold_fontname[] [static] |
{ "-*-fixed-bold-i-*-*-*-120-*-*-*-*-iso8859-*", "-*-courrier-bold-o-*-*-*-120-*-*-*-*-iso8859-*", "-*-andale mono-*-*-*-*-*-120-*-*-*-*-iso8859-*", NULL }
Definition at line 232 of file text.c.
Referenced by init_fonts().
const char* const fixed_medium_fontname[] [static] |
{ "-*-fixed-medium-r-*-*-*-120-*-*-*-*-iso8859-*", "-*-courrier-medium-*-*-*-*-120-*-*-*-*-iso8859-*", "-*-andale mono-medium-*-*-*-*-120-*-*-*-*-iso8859-*", NULL }
Definition at line 214 of file text.c.
Referenced by init_fonts().
GtkWidget* gtkwin_info_text |
Definition at line 279 of file gx11.c.
Referenced by admin_callback(), book_callback(), count_callback(), draw_info(), draw_info_windows(), enter_callback(), get_info_display(), menu_clear(), motd_callback(), and sign_callback().
GtkWidget* gtkwin_info_text2 |
Definition at line 280 of file gx11.c.
Referenced by admin_callback(), book_callback(), draw_info(), draw_info_windows(), get_info_display(), menu_clear(), and sign_callback().
const char* const hand_medium_fontname[] [static] |
{ "-*-dobkinscript-*-r-*-*-*-120-*-*-*-*-iso8859-*", "-*-coronetscript-*-r-*-*-*-120-*-*-*-*-iso8859-*", "-*-muriel-*-r-*-*-*-120-*-*-*-*-iso8859-*", "-*-genoa-*-r-*-*-*-120-*-*-*-*-iso8859-*", "-*-parkavenue-*-r-*-*-*-120-*-*-*-*-iso8859-*", "-*-rechtmanscript-*-r-*-*-*-120-*-*-*-*-iso8859-*", NULL }
Definition at line 175 of file text.c.
Referenced by init_fonts().
char* last_motd = NULL [static] |
Definition at line 415 of file text.c.
Referenced by cleanup_textmanagers(), getMOTD(), and motd_callback().
char NO_TITLE[] = "[no title]" [static] |
Definition at line 35 of file text.c.
Referenced by book_callback().
const char* const print_bold_fontname[] [static] |
{ "-*-arial-bold-r-*-*-*-120-*-*-*-*-iso8859-*", "-*-bookman-demi-r-*-*-*-120-*-*-*-*-iso8859-*", "-*-agate-bold-r-*-*-*-120-*-*-*-*-iso8859-*", NULL }
Definition at line 196 of file text.c.
Referenced by init_fonts().
const char* const print_italic_fontname[] [static] |
{ "-*-arial-medium-i-*-*-*-120-*-*-*-*-iso8859-*", "-*-bookman-light-i-*-*-*-120-*-*-*-*-iso8859-*", "-*-agate-normal-i-*-*-*-120-*-*-*-*-iso8859-*", NULL }
Definition at line 202 of file text.c.
Referenced by init_fonts().
const char* const print_italicbold_fontname[] [static] |
{ "-*-arial-bold-i-*-*-*-120-*-*-*-*-iso8859-*", "-*-bookman-demi-i-*-*-*-120-*-*-*-*-iso8859-*", "-*-agate-bold-i-*-*-*-120-*-*-*-*-iso8859-*", NULL }
Definition at line 208 of file text.c.
Referenced by init_fonts().
const char* const print_medium_fontname[] [static] |
{ "-*-arial-medium-r-*-*-*-120-*-*-*-*-iso8859-*", "-*-bookman-light-r-*-*-*-120-*-*-*-*-iso8859-*", "-*-agate-normal-r-*-*-*-120-*-*-*-*-iso8859-*", NULL }
Definition at line 190 of file text.c.
Referenced by init_fonts().
const char* const rcsid_gtk_text_c = "$Id: text.c 9190 2008-06-01 08:53:05Z anmaster $" |
char* rules = NULL [static] |
Definition at line 457 of file text.c.
Referenced by admin_callback(), cleanup_textmanagers(), and get_rules().
picture_message sign_message[] [static] |
const char* const strange_medium_fontname[] [static] |
{ "-*-annstone-*-r-*-*-*-120-*-*-*-*-iso8859-*", "-*-shalomstick-*-r-*-*-*-120-*-*-*-*-iso8859-*", NULL }
Definition at line 184 of file text.c.
Referenced by init_fonts().
GdkFont* style_arcane[4] [static] |
Definition at line 251 of file text.c.
Referenced by init_fonts(), and write_media_with_state().
GdkFont* style_fixed[4] [static] |
Definition at line 250 of file text.c.
Referenced by init_fonts(), and write_media_with_state().
GdkFont* style_hand[4] [static] |
Definition at line 252 of file text.c.
Referenced by init_fonts(), and write_media_with_state().
int style_inited = 0 [static] |
Definition at line 257 of file text.c.
Referenced by init_fonts().
GdkFont* style_print[4] [static] |
Definition at line 254 of file text.c.
Referenced by init_fonts(), write_media(), and write_media_with_state().
GdkFont* style_strange[4] [static] |
Definition at line 253 of file text.c.
Referenced by init_fonts(), and write_media_with_state().