Crossfire Client, Branches  R11627
text.c
Go to the documentation of this file.
1 const char * const rcsid_gtk_text_c =
2  "$Id: text.c 9190 2008-06-01 08:53:05Z anmaster $";
3 /*
4  Crossfire client, a client program for the crossfire program.
5 
6  Copyright (C) 2001 Mark Wedel & Crossfire Development Team
7 
8  This program is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 
22  The author can be reached via e-mail to crossfire-devel@real-time.com
23 */
24 #include <config.h>
25 #include <stdio.h>
26 #include <gtk/gtk.h>
27 #ifndef WIN32
28 #include <gdk/gdkx.h>
29 #else
30 #include <gdk/gdkwin32.h>
31 #endif
32 #include "client.h"
33 #include "gx11.h"
34 #include "gtkproto.h"
35 static char NO_TITLE[] = "[no title]";
36 
37 #include "pixmaps/sign_flat.xpm"
38 #include "pixmaps/sign_west.xpm"
39 #include "pixmaps/sign_east.xpm"
40 #include "pixmaps/close.xpm"
41 GtkWidget* book_root = NULL;
42 GtkWidget* book_notes = NULL;
43 GdkBitmap* btnClose_bm = NULL;
44 GdkPixmap* btnClose_pm = NULL;
45 
46 typedef struct picture_message_struct {
47  const char *title;
48  const char *const *xpm;
49  int x;
50  int y;
51  int width;
52  int height;
55  GdkPixmap *picture;
56 
58 
60  {"sign",sign_flat_xpm,70,45,390,305,500,500,NULL},
61  {"left sign",sign_west_xpm,95,85,615,190,750,400,NULL},
62  {"right sign",sign_east_xpm,45,85,615,190,750,400,NULL},
63  {"direction sign",sign_flat_xpm,70,45,390,305,500,500,NULL} };
64 static void init_pictures(GtkWidget *refWindow) {
65  if (btnClose_pm==NULL)
66  btnClose_pm = gdk_pixmap_create_from_xpm_d(refWindow->window,&btnClose_bm,
67  &gtk_widget_get_style(refWindow)->bg[GTK_STATE_NORMAL],
68  (gchar**)close_xpm);
69 }
70 static void prepare_book_window(void) {
71  if (!book_root){
72  book_root= gtk_window_new (GTK_WINDOW_TOPLEVEL);
73  gtk_window_set_title(GTK_WINDOW(book_root),"books");
74  book_notes = gtk_notebook_new();
75  gtk_notebook_set_tab_pos(GTK_NOTEBOOK(book_notes),GTK_POS_LEFT);
76  gtk_container_add(GTK_CONTAINER(book_root),book_notes);
77  gtk_widget_show(GTK_WIDGET(book_notes));
78  gtk_widget_show(GTK_WIDGET(book_root));
80  gtk_signal_connect (GTK_OBJECT (book_root), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &book_root);
81  gtk_window_set_default_size(GTK_WINDOW(book_root),500,600);
82  gtk_window_set_position(GTK_WINDOW(book_root),GTK_WIN_POS_CENTER);
83  }
84 }
85 static GtkWidget *create_text_picture_window(picture_message *layout, char *message) {
86  GtkWidget *window, *content, *fixed, *scroll, *close;
87  window = gtk_window_new (GTK_WINDOW_DIALOG);
88  gtk_window_set_title(GTK_WINDOW(window),layout->title);
89  gtk_widget_set_app_paintable(window,TRUE);
90  gtk_widget_realize(window);
91  init_pictures(window);
92  if (layout->picture == NULL){
93  layout->picture = gdk_pixmap_create_from_xpm_d(window->window,NULL,
94  &gtk_widget_get_style(window)->bg[GTK_STATE_NORMAL],
95  (gchar**)layout->xpm);
96  }
97  gdk_window_set_back_pixmap(window->window,layout->picture,FALSE);
98  content = gtk_text_new(NULL,NULL);
99  gtk_text_set_editable(GTK_TEXT(content),FALSE);
100  gtk_text_set_word_wrap(GTK_TEXT(content),TRUE);
101  gtk_text_set_line_wrap(GTK_TEXT(content),TRUE);
102  write_media(GTK_TEXT(content),message);
103  gtk_window_set_default_size(GTK_WINDOW(window),layout->window_width,layout->window_height);
104  gtk_window_set_position(GTK_WINDOW(window),GTK_WIN_POS_CENTER);
105  fixed=gtk_fixed_new();
106  gtk_widget_set_app_paintable(fixed,TRUE);
107  gtk_container_add(GTK_CONTAINER(window),fixed);
108  gtk_widget_realize(fixed);
109  gdk_window_set_back_pixmap(fixed->window,layout->picture,TRUE);
110 
111  scroll = gtk_scrolled_window_new (NULL, NULL);
112  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
113  GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
114  gtk_widget_show (scroll);
115  gtk_widget_set_usize(scroll,layout->width,layout->height);
116  gtk_fixed_put(GTK_FIXED(fixed),scroll,layout->x,layout->y);
117  close=gtk_button_new();
118  gtk_widget_set_usize(close,0,0);
119  gtk_fixed_put(GTK_FIXED(fixed),close,0,0);
120  gtk_widget_show(fixed);
121  gtk_widget_show(content);
122 
123  gtk_container_add(GTK_CONTAINER(scroll),content);
124  gtk_text_set_adjustments(GTK_TEXT(content),
125  NULL,
126  gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(scroll))
127  );
128 
129  gtk_signal_connect_object (GTK_OBJECT (close), "clicked",
130  GTK_SIGNAL_FUNC(gtk_widget_destroy),
131  GTK_OBJECT (window));
132  gtk_widget_grab_focus (GTK_WIDGET(close));
133  return window;
134 }
135 static void show_media_message(const char *title, const char *message) {
136  GtkWidget *window, *scroll, *content;
137  window = gtk_window_new (GTK_WINDOW_DIALOG);
138  gtk_window_set_title(GTK_WINDOW(window),message);
139  gtk_window_set_default_size(GTK_WINDOW(window),500,500);
140  gtk_window_set_position(GTK_WINDOW(window),GTK_WIN_POS_CENTER);
141 
142  content = gtk_text_new(NULL,NULL);
143  gtk_text_set_editable(GTK_TEXT(content),FALSE);
144  gtk_text_set_word_wrap(GTK_TEXT(content),TRUE);
145  gtk_text_set_line_wrap(GTK_TEXT(content),TRUE);
146  write_media(GTK_TEXT(content),message);
147  gtk_widget_show(content);
148 
149  scroll = gtk_scrolled_window_new (NULL, NULL);
150  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
151  GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
152  gtk_container_add(GTK_CONTAINER(scroll),content);
153  gtk_text_set_adjustments(GTK_TEXT(content),
154  NULL,
155  gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(scroll))
156  );
157 
158  gtk_widget_show(content);
159  gtk_widget_show (scroll);
160  gtk_widget_show (window);
161 }
166 static const char *const arcane_medium_fontname[] = {
167  "-*-cuneifontlight-*-r-*-*-*-120-*-*-*-*-iso8859-*",
168  "-*-linotext-*-r-*-*-*-120-*-*-*-*-iso8859-*",
169  "-*-blackforest-*-r-*-*-*-120-*-*-*-*-iso8859-*",
170  "-*-becker-*-*-*-*-*-120-*-*-*-*-iso8859-*",
171  "-*-arnoldboecklin-*-r-*-*-*-120-*-*-*-*-iso8859-*",
172  "-*-caligula-*-*-*-*-*-120-*-*-*-*-iso8859-*",
173  NULL
174  };
175 static const char *const hand_medium_fontname[] = {
176  "-*-dobkinscript-*-r-*-*-*-120-*-*-*-*-iso8859-*",
177  "-*-coronetscript-*-r-*-*-*-120-*-*-*-*-iso8859-*",
178  "-*-muriel-*-r-*-*-*-120-*-*-*-*-iso8859-*",
179  "-*-genoa-*-r-*-*-*-120-*-*-*-*-iso8859-*",
180  "-*-parkavenue-*-r-*-*-*-120-*-*-*-*-iso8859-*",
181  "-*-rechtmanscript-*-r-*-*-*-120-*-*-*-*-iso8859-*",
182  NULL
183 };
184 static const char *const strange_medium_fontname[] = {
185  "-*-annstone-*-r-*-*-*-120-*-*-*-*-iso8859-*",
186  "-*-shalomstick-*-r-*-*-*-120-*-*-*-*-iso8859-*",
187  NULL
188 
189 };
190 static const char *const print_medium_fontname[] = {
191  "-*-arial-medium-r-*-*-*-120-*-*-*-*-iso8859-*",
192  "-*-bookman-light-r-*-*-*-120-*-*-*-*-iso8859-*",
193  "-*-agate-normal-r-*-*-*-120-*-*-*-*-iso8859-*",
194  NULL
195  };
196 static const char *const print_bold_fontname[] = {
197  "-*-arial-bold-r-*-*-*-120-*-*-*-*-iso8859-*",
198  "-*-bookman-demi-r-*-*-*-120-*-*-*-*-iso8859-*",
199  "-*-agate-bold-r-*-*-*-120-*-*-*-*-iso8859-*",
200  NULL
201  };
202 static const char *const print_italic_fontname[] = {
203  "-*-arial-medium-i-*-*-*-120-*-*-*-*-iso8859-*",
204  "-*-bookman-light-i-*-*-*-120-*-*-*-*-iso8859-*",
205  "-*-agate-normal-i-*-*-*-120-*-*-*-*-iso8859-*",
206  NULL
207  };
208 static const char *const print_italicbold_fontname[] = {
209  "-*-arial-bold-i-*-*-*-120-*-*-*-*-iso8859-*",
210  "-*-bookman-demi-i-*-*-*-120-*-*-*-*-iso8859-*",
211  "-*-agate-bold-i-*-*-*-120-*-*-*-*-iso8859-*",
212  NULL
213  };
214 static const char *const fixed_medium_fontname[] = {
215  "-*-fixed-medium-r-*-*-*-120-*-*-*-*-iso8859-*",
216  "-*-courrier-medium-*-*-*-*-120-*-*-*-*-iso8859-*",
217  "-*-andale mono-medium-*-*-*-*-120-*-*-*-*-iso8859-*",
218  NULL
219  };
220 static const char *const fixed_bold_fontname[] = {
221  "-*-fixed-bold-r-*-*-*-120-*-*-*-*-iso8859-*",
222  "-*-courrier-bold-*-*-*-*-120-*-*-*-*-iso8859-*",
223  "-*-andale mono-medium-*-*-*-*-120-*-*-*-*-iso8859-*",
224  NULL
225  };
226 static const char *const fixed_italic_fontname[] = {
227  "-*-fixed-medium-o-*-*-*-120-*-*-*-*-iso8859-*",
228  "-*-courrier-medium-o-*-*-*-120-*-*-*-*-iso8859-*",
229  "-*-andale mono-medium-*-*-*-*-120-*-*-*-*-iso8859-*",
230  NULL
231  };
232 static const char *const fixed_italicbold_fontname[] = {
233  "-*-fixed-bold-i-*-*-*-120-*-*-*-*-iso8859-*",
234  "-*-courrier-bold-o-*-*-*-120-*-*-*-*-iso8859-*",
235  "-*-andale mono-*-*-*-*-*-120-*-*-*-*-iso8859-*",
236  NULL
237  };
238 static GdkFont *load_a_font(const char *const font_list[]) {
239  GdkFont* result;
240  int i;
241  for (i=0; font_list[i]!=NULL;i++){
242  result = gdk_font_load(font_list[i]);
243  if (result != NULL){
244  LOG(LOG_INFO,"gtk::load_a_font","Loaded font %s.",font_list[i]);
245  return result;
246  }
247  }
248  return NULL;
249 }
250 static GdkFont *style_fixed[4];
251 static GdkFont *style_arcane[4];
252 static GdkFont *style_hand[4];
253 static GdkFont *style_strange[4];
254 static GdkFont *style_print[4];
255 #define STYLE_BOLD 1
256 #define STYLE_ITALIC 2
257 static int style_inited = 0;
258 
259 static void init_fonts(void) {
260  if (!style_inited){
265 
268 
271 
274 
279  style_inited=1;
280  }
281 }
282 media_state write_media(GtkText* textarea, const char* message){
283  media_state simple_state;
284  simple_state.style=style_print;
285  simple_state.has_color=0;
286  simple_state.flavor=0;
287  return write_media_with_state(textarea,message, simple_state);
288 }
289 media_state write_media_with_state(GtkText* textarea, const char* message, media_state current_state){
290 
291  char *current, *marker, *original;
292  if (message==NULL)
293  return current_state;
294  init_fonts();
295  current=malloc(strlen(message)+1);
296  if (current==NULL){
297  LOG(LOG_ERROR,"gtk::write_media","couldn't alloc memory for string manipualtion. Dropping media\n");
298  return current_state;
299  }
300  strcpy(current,message);
301  original=current;
302  while( (marker=strchr(current,'['))!=NULL){
303  *marker='\0';
304  gtk_text_insert(textarea,current_state.style[current_state.flavor],current_state.has_color?&current_state.fore:NULL,NULL,current,marker-current);
305  current = marker+1;
306  if ( (marker = strchr(current,']')) ==NULL)
307  return current_state;
308  *marker='\0';
309  if (!strcmp(current,"b"))
310  current_state.flavor |=STYLE_BOLD;
311  else if (!strcmp(current,"i"))
312  current_state.flavor |=STYLE_ITALIC;
313  else if (!strcmp(current,"/b"))
314  current_state.flavor &=!STYLE_BOLD;
315  else if (!strcmp(current,"/i"))
316  current_state.flavor &=!STYLE_ITALIC;
317  else if (!strcmp(current,"/color"))
318  current_state.has_color = 0;
319  else if (!strncmp(current,"color=",6))
320  current_state.has_color = gdk_color_parse(current+6,&current_state.fore);
321  else if (!strcmp(current,"fixed"))
322  current_state.style = style_fixed;
323  else if (!strcmp(current,"arcane"))
324  current_state.style = style_arcane;
325  else if (!strcmp(current,"hand"))
326  current_state.style = style_hand;
327  else if (!strcmp(current,"strange"))
328  current_state.style = style_strange;
329  else if (!strcmp(current,"print"))
330  current_state.style = style_print;
331  else
332  LOG(LOG_INFO,"gtk::write_media_with_state","unidentified message: %s",current);
333  current=marker+1;
334  }
335  gtk_text_insert(textarea,current_state.style[current_state.flavor],current_state.has_color?&current_state.fore:NULL,NULL,current,marker-current);
336  free(original);
337  return current_state;
338 }
339 static void add_book(char *title, char *message) {
340  GtkWidget *content,*label,*hbox, *scroll, *panel, *close, *closepic;
342 
343  content = gtk_text_new(NULL,NULL);
344  gtk_text_set_editable(GTK_TEXT(content),FALSE);
345  gtk_text_set_word_wrap(GTK_TEXT(content),FALSE);
346  gtk_text_set_line_wrap(GTK_TEXT(content),TRUE);
347  write_media(GTK_TEXT(content),message);
348 
349  panel = gtk_vbox_new(FALSE,0);
350  close = gtk_button_new();
351  closepic = gtk_pixmap_new (btnClose_pm, btnClose_bm);
352  gtk_container_add(GTK_CONTAINER(close),closepic);
353  gtk_box_pack_start (GTK_BOX (panel), close, FALSE, FALSE, 0);
354 
355  hbox=gtk_hbox_new(FALSE,0);
356 
357  gtk_box_pack_start (GTK_BOX (hbox), content, TRUE, TRUE, 0);
358  scroll = gtk_vscrollbar_new(GTK_TEXT (content)->vadj);
359  gtk_box_pack_start (GTK_BOX (hbox),scroll, FALSE, FALSE, 0);
360  gtk_box_pack_start (GTK_BOX (panel), hbox, TRUE, TRUE, 0);
361 
362  label = gtk_label_new(title);
363 /* tab = gtk_hbox_new();*/
364 /* button_pic = gtk_pixmap_new(btnClose_pm, btnClose_bm);*/
365 /* button = gtk_button_new();*/
366 
367  gtk_notebook_append_page(GTK_NOTEBOOK(book_notes),panel,label);
368  gtk_widget_show(content);
369  gtk_widget_show(label);
370  gtk_widget_show(close);
371  gtk_widget_show(closepic);
372  gtk_widget_show(panel);
373  gtk_widget_show(book_root);
374  gtk_widget_show(hbox);
375  gtk_widget_show(scroll);
376 
377  gtk_notebook_set_page(GTK_NOTEBOOK(book_notes),gtk_notebook_page_num(GTK_NOTEBOOK(book_notes),panel));
378  gdk_window_raise (book_root->window);
379  gtk_widget_grab_focus (GTK_WIDGET(close));
380  gtk_signal_connect_object (GTK_OBJECT (close), "clicked",
381  GTK_SIGNAL_FUNC(gtk_widget_destroy),
382  GTK_OBJECT (panel));
383 
384 }
385 /* we need access to those when a sign is auto applied.
386  * We don't want to show player a new window while his character
387  * keeps running in background
388  */
389 extern GtkWidget* gtkwin_info_text;
390 extern GtkWidget* gtkwin_info_text2;
391 static void book_callback(int flag, int type, int subtype, char *message) {
392  LOG(LOG_DEBUG,"gtk::book_callback","got callback %d subtype %d\n",type,subtype);
393  if (message!=NULL){
394  char* title = message;
395  while ( (*message!='\0') && (*message!='\n') )
396  message++;
397  if (*message!='\0'){
398  *message='\0';
399  message++;
400  }
401  if (*message=='\0'){
402  message=title;
403  title=NO_TITLE;
404  }
405  if (!want_config[CONFIG_POPUPS]) /*autoapply*/{
407  write_media(GTK_TEXT(gtkwin_info_text2),message);
408  else
409  write_media(GTK_TEXT(gtkwin_info_text),message);
410  } else
411  add_book(title,message);
412 
413  }
414 }
415 static char *last_motd = NULL;
416 static void motd_callback(int flag, int type, int subtype, char *message) {
417 
418  free(last_motd);
419  last_motd = malloc(strlen(message)+1);
420  if (last_motd==NULL)
421  LOG(LOG_ERROR,"gtk::motd_callback","Outa memory, no save of motd");
422  else
423  strcpy(last_motd,message);
424 
425  if (!want_config[CONFIG_POPUPS] || last_motd == NULL) {
426  write_media(GTK_TEXT(gtkwin_info_text), message);
427  }
428 }
429 static void void_callback(int flag, int type, int subtype, char *message) {
430 
431  LOG(LOG_INFO,"gtk::void_callback","got message --\n%s\n",message);
432 
433 }
434 static void sign_callback(int color, int type, int subtype, char *message) {
435  GtkWidget *window;
436 
437  if ( (subtype>4) || (subtype <1))
438  subtype=1;
439  if (message==NULL)
440  return;
441 
442  if ((!want_config[CONFIG_POPUPS]) || (!want_config[CONFIG_SIGNPOPUP])) /*autoapply*/{
444  write_media(GTK_TEXT(gtkwin_info_text2),message);
445  else
446  write_media(GTK_TEXT(gtkwin_info_text),message);
447  }else{
448  window=create_text_picture_window(&(sign_message[subtype-1]), message);
449  gtk_window_set_transient_for(GTK_WINDOW(window),GTK_WINDOW(gtkwin_root));
450  gtk_widget_show(window);
451  }
452 
453 }
454 const char *getMOTD(void) {
455  return last_motd==NULL?"Please read motd written\nin [i]green[/i] inside main\nmessage window":last_motd;
456 }
457 static char *rules = NULL;
459 const char *get_rules(void) {
460  return rules;
461 }
463  return first_news;
464 }
465 static void admin_callback(int flag, int type, int subtype, char *message) {
466  char* str1;
467  news_entry* new;
468  switch (subtype){
469  case MSG_TYPE_ADMIN_NEWS:
470  str1 = strstr(message,"\n");
471  if (str1){
472  *str1= '\0';
473  str1+=strlen("\n");
474  new = malloc(sizeof(news_entry));
475  if (new){
476  new->title= malloc(strlen(message)+1);
477  new->content=malloc(strlen(str1)+1);
478  if ( (!new->title) || (!new->content)){
479  free(new->title);
480  free(new->content);
481  LOG(LOG_ERROR,"gtk::admin_callback","Outa memory, no save of news");
482  free(new);
483  return;
484  }
485  strcpy(new->title,message);
486  strcpy(new->content,str1);
487  new->next=first_news;
488  first_news=new;
490  write_media(GTK_TEXT(gtkwin_info_text2),str1);
491  write_media(GTK_TEXT(gtkwin_info_text),str1);
492  } else {
493  LOG(LOG_ERROR,"gtk::admin_callback","Outa memory, no save of news");
494  }
495  return;
496  }
497  break;
498 
500  free(rules);
501  rules = malloc(strlen(message)+1);
502  if (rules){
503  strcpy(rules,message);
505  write_media(GTK_TEXT(gtkwin_info_text2),message);
506  write_media(GTK_TEXT(gtkwin_info_text),message);
507  }
508  else
509  LOG(LOG_ERROR,"gtk::admin_callback","Outa memory, no save of rules");
510  return;
511 
512  }
513  draw_info(message, flag);
514 }
518 /* setTextManager(MSG_TYPE_MONUMENT,void_callback);*/
521 }
523  news_entry* last_entry;
524  free(last_motd);
525  last_motd=NULL;
526  free(rules);
527  rules = NULL;
528  last_entry= first_news;
529  while (last_entry){
530  first_news=last_entry->next;
531  free(last_entry->content);
532  free(last_entry->title);
533  free(last_entry);
534  last_entry=first_news;
535  }
536 
537 }
#define MSG_TYPE_MOTD
Definition: newclient.h:321
static GdkFont * style_hand[4]
Definition: text.c:252
const char * getMOTD(void)
Definition: text.c:454
static GtkWidget * create_text_picture_window(picture_message *layout, char *message)
Definition: text.c:85
struct news_entry * next
Definition: gx11.h:107
void init_text_callbacks(void)
Definition: text.c:515
static const char *const hand_medium_fontname[]
Definition: text.c:175
GdkPixmap * picture
Definition: text.c:55
GdkFont ** style
Definition: gx11.h:112
static const char *const arcane_medium_fontname[]
Definition: text.c:166
static GdkFont * load_a_font(const char *const font_list[])
Definition: text.c:238
#define CONFIG_POPUPS
Definition: client.h:160
static int style_inited
Definition: text.c:257
void setTextManager(int type, ExtTextManager callback)
Definition: commands.c:497
static void init_pictures(GtkWidget *refWindow)
Definition: text.c:64
news_entry * first_news
Definition: text.c:458
#define MSG_TYPE_SIGN
Definition: newclient.h:318
static picture_message sign_message[]
Definition: text.c:59
#define STYLE_ITALIC
Definition: text.c:256
static GdkFont * style_fixed[4]
Definition: text.c:250
#define CONFIG_SIGNPOPUP
Definition: client.h:181
sint16 want_config[CONFIG_NUMS]
Definition: init.c:50
#define MSG_TYPE_ADMIN_RULES
Definition: newclient.h:410
static GdkFont * style_print[4]
Definition: text.c:254
static void admin_callback(int flag, int type, int subtype, char *message)
Definition: text.c:465
int flavor
Definition: gx11.h:114
#define CONFIG_SPLITINFO
Definition: client.h:165
static const char *const strange_medium_fontname[]
Definition: text.c:184
Definition: gx11.h:104
static GdkFont * style_arcane[4]
Definition: text.c:251
GdkColor fore
Definition: gx11.h:111
void LOG(LogLevel level, const char *origin, const char *format,...)
Definition: misc.c:178
char * content
Definition: gx11.h:106
#define TRUE
Definition: client-types.h:71
#define MSG_TYPE_BOOK
Definition: newclient.h:315
const char *const rcsid_gtk_text_c
Definition: text.c:1
static char NO_TITLE[]
Definition: text.c:35
char * title
Definition: gx11.h:105
sint16 use_config[CONFIG_NUMS]
Definition: init.c:50
static const char *const print_italic_fontname[]
Definition: text.c:202
static const char *const fixed_italic_fontname[]
Definition: text.c:226
static const char *const fixed_italicbold_fontname[]
Definition: text.c:232
GtkWidget * gtkwin_root
Definition: gx11.c:278
struct picture_message_struct picture_message
static const char *const fixed_bold_fontname[]
Definition: text.c:220
news_entry * get_news(void)
Definition: text.c:462
#define STYLE_BOLD
Definition: text.c:255
int has_color
Definition: gx11.h:113
const char *const * xpm
Definition: text.c:48
const char * title
Definition: text.c:47
void cleanup_textmanagers(void)
Definition: text.c:522
#define MSG_TYPE_ADMIN
Definition: newclient.h:322
static void sign_callback(int color, int type, int subtype, char *message)
Definition: text.c:434
static const char *const print_bold_fontname[]
Definition: text.c:196
static char * last_motd
Definition: text.c:415
static char * rules
Definition: text.c:457
media_state write_media_with_state(GtkText *textarea, const char *message, media_state current_state)
Definition: text.c:289
static GdkFont * style_strange[4]
Definition: text.c:253
static const char *const print_italicbold_fontname[]
Definition: text.c:208
static void add_book(char *title, char *message)
Definition: text.c:339
static void prepare_book_window(void)
Definition: text.c:70
static void book_callback(int flag, int type, int subtype, char *message)
Definition: text.c:391
GtkWidget * book_notes
Definition: text.c:42
static void show_media_message(const char *title, const char *message)
Definition: text.c:135
GtkWidget * gtkwin_info_text2
Definition: gx11.c:280
media_state write_media(GtkText *textarea, const char *message)
Definition: text.c:282
static void void_callback(int flag, int type, int subtype, char *message)
Definition: text.c:429
const char * get_rules(void)
Definition: text.c:459
void draw_info(const char *str, int color)
Definition: gx11.c:1773
GdkPixmap * btnClose_pm
Definition: text.c:44
#define MSG_TYPE_ADMIN_NEWS
Definition: newclient.h:411
static void motd_callback(int flag, int type, int subtype, char *message)
Definition: text.c:416
static const char *const fixed_medium_fontname[]
Definition: text.c:214
#define FALSE
Definition: client-types.h:68
GtkWidget * book_root
Definition: text.c:41
GdkBitmap * btnClose_bm
Definition: text.c:43
static const char *const print_medium_fontname[]
Definition: text.c:190
static void init_fonts(void)
Definition: text.c:259
GtkWidget * gtkwin_info_text
Definition: gx11.c:279