/* $Id$ * $URL$ * * simple text widget handling * * Copyright (C) 2003, 2004 Michael Reinelt * Copyright (C) 2004 The LCD4Linux Team * Copyright (C) 2008 Michael Vogt * * 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_AUTOMATIC: if (len <= width) { pad = 0; break; } case ALIGN_MARQUEE: pad = width - T->scroll; T->scroll++; if (T->scroll >= width + len) T->scroll = 0; break; case ALIGN_PINGPONG: #define PINGPONGWAIT 2 /* scrolling is not necessary - center the string */ if (len <= width) { pad = (width - len) / 2; } else { if (T->direction == 1) T->scroll++; /* scroll right */ else T->scroll--; /* scroll left */ /*pad = if positive, add leading space characters, else offset of string begin */ pad = 0 - T->scroll; if (pad < 0 - (len - width)) { if (T->delay-- < 1) { /* wait before switch direction */ T->direction = 0; /* change scroll direction */ T->delay = PINGPONGWAIT; T->scroll -= PINGPONGWAIT; } /* else debug("wait1"); */ pad = 0 - (len - width); } else if (pad > 0) { if (T->delay-- < 1) { T->direction = 1; T->delay = PINGPONGWAIT; T->scroll += PINGPONGWAIT; } /* else debug("wait2"); */ pad = 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);
# 2014-04-18 Antti Palosaari <crope@iki.fi>
# generated from http://www.digita.fi/kuluttajat/tv/nakyvyysalueet/kanavanumerot_ja_taajuudet

[Kihnio]
	DELIVERY_SYSTEM = DVBT
	FREQUENCY = 738000000
	BANDWIDTH_HZ = 8000000

[Kihnio]
	DELIVERY_SYSTEM = DVBT
	FREQUENCY = 786000000
	BANDWIDTH_HZ = 8000000

[Kihnio]
	DELIVERY_SYSTEM = DVBT
	FREQUENCY = 674000000
	BANDWIDTH_HZ = 8000000

[Kihnio]
	DELIVERY_SYSTEM = DVBT
	FREQUENCY = 714000000
	BANDWIDTH_HZ = 8000000