} specials[128];
static int special_count;
+#ifdef X11
static int special_index; /* used when drawing */
+#endif /* X11 */
#define MAX_GRAPH_DEPTH 256 /* why 256? who knows. */
return args;
}
+
static char *scan_font(const char *args)
{
if (args && sizeof(args) < 127) {
return NULL;
}
+#ifdef X11
static void new_font(char *buf, char * args) {
struct special_t *s = new_special(buf, FONT);
-#ifdef X11
if (!s->font_added || strcmp(args, fonts[s->font_added].name)) {
int tmp = selected_font;
selected_font = s->font_added = addfont(args);
set_font();
selected_font = tmp;
}
-#endif /* X11 */
}
+#endif
inline void graph_append(struct special_t *graph, double f)
{
OBJ(color) {
new_fg(p, obj->data.l);
}
+#ifdef X11
OBJ(font) {
new_font(p, obj->data.s);
}
+#endif /* X11 */
OBJ(downspeed) {
if (!use_spacer) {
snprintf(p, n, "%d",
int fontchange = 0;
+#ifdef X11
static void text_size_updater(char *s)
{
int w = 0;
else if (specials[special_index].type == OFFSET) {
w += specials[special_index].arg + get_string_width("a"); /* filthy, but works */
}
-#ifdef X11
else if (specials[special_index].type == FONT) {
fontchange = specials[special_index].font_added;
selected_font = specials[special_index].font_added;
h = font_height();
}
-#endif /* X11 */
special_index++;
}
p++;
}
-#ifdef X11
w += get_string_width(s);
if (w > text_width)
text_width = w;
if (fontchange) {
selected_font = 0;
}
-#endif /* X11 */
}
+#endif /* X11 */
+
#ifdef X11
static void update_text_area()
if (s[0] == '\0')
return;
int i, i2, pos, width_of_s;
- int max, added;
+ int max=0;
+ int added;
width_of_s = get_string_width(s);
if (out_to_console) {
printf("%s\n", s);