/* $Id$ * $URL$ * * simple text widget handling * * Copyright (C) 2003, 2004 Michael Reinelt * Copyright (C) 2004 The LCD4Linux Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ /* * exported functions: * * WIDGET_CLASS Widget_Text * a simple text widget which * must be supported by all displays * */ #include "config.h" #include #include #include #include #include "debug.h" #include "cfg.h" #include "evaluator.h" #include "property.h" #include "timer.h" #include "widget.h" #include "widget_text.h" # #ifdef WITH_DMALLOC #include #endif void widget_text_scroll(void *Self) { WIDGET *W = (WIDGET *) Self; WIDGET_TEXT *T = W->data; char *prefix = P2S(&T->prefix); char *postfix = P2S(&T->postfix); char *string = T->string; int num, len, width, pad; char *src, *dst; num = 0; len = strlen(string); width = T->width - strlen(prefix) - strlen(postfix); if (width < 0) width = 0; switch (T->align) { case ALIGN_LEFT: pad = 0; break; case ALIGN_CENTER: pad = (width - len) / 2; if (pad < 0) pad = 0; break; case ALIGN_RIGHT: pad = width - len; if (pad < 0) pad = 0; break; case ALIGN_MARQUEE: pad = width - T->scroll; T->scroll++; if (T->scroll >= width + len) T->scroll = 0; break; default: /* not reached */ pad = 0; } dst = T->buffer; /* process prefix */ src = prefix; while (num < T->width) { if (*src == '\0') break; *(dst++) = *(src++); num++; } src = string; /* pad blanks on the beginning */ while (pad > 0 && num < T->width) { *(dst++) = ' '; num++; pad--; } /* skip src chars (marquee) */ while (pad < 0) { src++; pad++; } /* copy content */ while (num < T->width) { if (*src == '\0') break; *(dst++) = *(src++); num++; } /* pad blanks on the end */ src = postfix; len = strlen(src); while (num < T->width - len) { *(dst++) = ' '; num++; } /* process postfix */ while (num < T->width) { if (*src == '\0') break; *(dst++) = *(src++); num++; } *dst = '\0'; /* finally, draw it! */ if (W->class->draw) W->class->draw(W); } void widget_text_update(void *Self) { WIDGET *W = (WIDGET *) Self; WIDGET_TEXT *T = W->data; char *string; int update = 0; /* evaluate properties */ update += property_eval(&T->prefix); update += property_eval(&T->postfix); update += property_eval(&T->style); /* evaluate value */ property_eval(&T->value); /* string or number? */ if (T->precision == 0xDEAD) { string = strdup(P2S(&T->value)); } else { double number = P2N(&T->value); int width = T->width - strlen(P2S(&T->prefix)) - strlen(P2S(&T->postfix)); int precision = T->precision; /* print zero bytes so we can specify NULL as target */ /* and get the length of the resulting string */ int size = snprintf(NULL, 0, "%.*f", precision, number); /* number does not fit into field width: try to reduce precision */ if (width < 0) width = 0; if (size > width && precision > 0) { int delta = size - width; if (delta > precision) delta = precision; precision -= delta; size -= delta; /* zero pre
# Rega Sense, Switzerland
# freq sr fec mod

# Pay TV
C 434000000 6900000 NONE QAM64 # Teleclub
C 714000000 6900000 NONE QAM64
C 722000000 6900000 NONE QAM64

# Basis offer
C 125000000 6900000 NONE QAM64
C 450000000 6900000 NONE QAM64
C 458000000 6900000 NONE QAM64
C 466000000 6900000 NONE QAM64
C 474000000 6900000 NONE QAM64
C 482000000 6900000 NONE QAM64
C 514000000 6900000 NONE QAM64
C 522000000 6900000 NONE QAM64
C 578000000 6900000 NONE QAM64
C 586000000 6900000 NONE QAM64
C 634000000 6900000 NONE QAM64
C 642000000 6900000 NONE QAM64
C 650000000 6900000 NONE QAM64
C 658000000 6900000 NONE QAM64
C 666000000 6900000 NONE QAM64
C 682000000 6900000 NONE QAM64
C 698000000 6900000 NONE QAM64
C 730000000 6900000 NONE QAM64

C 618000000 6900000 NONE QAM256
C 674000000 6900000 NONE QAM256

# HDTV
C 642000000 6900000 NONE QAM256
C 690000000 6900000 NONE QAM256