Don't crash if key settings are set in a configuration file that are out of range...
[chocolate-doom.git] / textscreen / txt_label.h
blob16395c9370a87d57fd8dfb6748c54a0b0ea48667
1 // Emacs style mode select -*- C++ -*-
2 //-----------------------------------------------------------------------------
3 //
4 // Copyright(C) 2006 Simon Howard
5 //
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19 // 02111-1307, USA.
22 #ifndef TXT_LABEL_H
23 #define TXT_LABEL_H
25 /**
26 * @file txt_label.h
28 * Text label widget.
31 /**
32 * Label widget.
34 * A label widget does nothing except show a text label.
37 typedef struct txt_label_s txt_label_t;
39 #include "txt_main.h"
40 #include "txt_widget.h"
42 struct txt_label_s
44 txt_widget_t widget;
45 char *label;
46 char **lines;
47 unsigned int w, h;
48 txt_color_t fgcolor;
49 txt_color_t bgcolor;
52 /**
53 * Create a new label widget.
55 * @param label String to display in the widget.
56 * @return Pointer to the new label widget.
59 txt_label_t *TXT_NewLabel(char *label);
61 /**
62 * Set the string displayed in a label widget.
64 * @param label The widget.
65 * @param value The string to display.
68 void TXT_SetLabel(txt_label_t *label, char *value);
70 /**
71 * Set the background color of a label widget.
73 * @param label The widget.
74 * @param color The background color to use.
77 void TXT_SetBGColor(txt_label_t *label, txt_color_t color);
79 /**
80 * Set the foreground color of a label widget.
82 * @param label The widget.
83 * @param color The foreground color to use.
86 void TXT_SetFGColor(txt_label_t *label, txt_color_t color);
88 #endif /* #ifndef TXT_LABEL_H */