Added some icon definitions in lcd.h;

Using ICON_BLOCK_FILLED now in titles.
This commit is contained in:
robijn
2002-05-18 23:42:46 +00:00
parent 31641610d1
commit 7c49cb535c
4 changed files with 60 additions and 28 deletions
+4
View File
@@ -33,6 +33,8 @@
#include "screen.h"
#include "widget.h"
#include "drivers.h"
/*************************************************************************
* Adds a widget to a screen, but doesn't give it a value
@@ -340,6 +342,8 @@ widget_set_func (Client * c, int argc, char **argv)
report( RPT_WARNING, "widget_set_func: Allocation error");
return -1;
}
/* Set width too */
w->width = display_props->width;
debug (RPT_DEBUG, "Widget %s set to %s", wid, w->text);
sock_send_string(c->sock, "success\n");
}
+21 -13
View File
@@ -436,25 +436,33 @@ driver_alt_heartbeat( Driver * drv, int state )
void
driver_alt_icon( Driver * drv, int x, int y, int icon )
{
char ch;
char ch1 = '?';
char ch2 = 0;
if (!drv->chr)
return;
switch (icon) {
case ICON_HEART_OPEN:
ch = '-';
break;
case ICON_HEART_FILLED:
ch = '#';
break;
case ICON_BLOCK_FILLED:
ch = '#';
break;
default:
ch = '?';
case ICON_BLOCK_FILLED: ch1 = '#'; break;
case ICON_HEART_OPEN: ch1 = '-'; break;
case ICON_HEART_FILLED: ch1 = '#'; break;
case ICON_ARROW_UP: ch1 = '^'; break;
case ICON_ARROW_DOWN: ch1 = 'v'; break;
case ICON_ARROW_LEFT: ch1 = '<'; break;
case ICON_ARROW_RIGHT: ch1 = '>'; break;
case ICON_STOP: ch1 = '['; ch2 = ']'; break;
case ICON_PAUSE: ch1 = '|'; ch2 = '|'; break;
case ICON_PLAY: ch1 = '>'; ch2 = ' '; break;
case ICON_PLAYR: ch1 = '<'; ch2 = ' '; break;
case ICON_FF: ch1 = '>'; ch2 = '>'; break;
case ICON_FR: ch1 = '<'; ch2 = '<'; break;
case ICON_NEXT: ch1 = '>'; ch2 = '|'; break;
case ICON_PREV: ch1 = '|'; ch2 = '<'; break;
case ICON_REC: ch1 = '('; ch2 = ')'; break;
}
drv->chr( drv, x, y, ch);
drv->chr( drv, x, y, ch1);
if (ch2)
drv->chr( drv, x+1, y, ch2);
}
void driver_alt_cursor( Driver * drv, int x, int y, int state )
+19 -4
View File
@@ -42,10 +42,25 @@
#define BACKLIGHT_WARNING 2
#define BACKLIGHT_RED_ALERT 3
/* Icons for icon function */
#define ICON_BLOCK_FILLED 0
#define ICON_HEART_OPEN 8
#define ICON_HEART_FILLED 9
/* Icons below are one character wide */
#define ICON_BLOCK_FILLED 0x100
#define ICON_HEART_OPEN 0x108
#define ICON_HEART_FILLED 0x109
#define ICON_ARROW_UP 0x110
#define ICON_ARROW_DOWN 0x111
#define ICON_ARROW_LEFT 0x112
#define ICON_ARROW_RIGHT 0x113
/* Icons below are two characters wide */
#define ICON_STOP 0x200 /* should look like [] */
#define ICON_PAUSE 0x201 /* should look like || */
#define ICON_PLAY 0x202 /* should look like > */
#define ICON_PLAYR 0x203 /* should llok like < */
#define ICON_FF 0x204 /* should look like >> */
#define ICON_FR 0x205 /* should look like << */
#define ICON_NEXT 0x206 /* should look like >| */
#define ICON_PREV 0x207 /* should look like |< */
#define ICON_REC 0x208 /* should look like () */
/* Heartbeat data, taken from render.h */
/* ??? What does OPEN mean here ? */
+16 -11
View File
@@ -31,7 +31,6 @@
#include "shared/report.h"
#include "shared/LL.h"
#include "drivers.h"
#include "drivers.h"
#include "screen.h"
@@ -314,15 +313,15 @@ draw_frame (LinkedList * list,
if (vis_width < 8)
break;
/*memset (str, 255, width);*/
memset (str, '*', vis_width);
/* TODO: Use icon function to draw the bar */
drivers_icon (w->x, w->y, ICON_BLOCK_FILLED);
drivers_icon (w->x+1, w->y, ICON_BLOCK_FILLED);
str[2] = ' ';
str[0] = ' ';
length = strlen (w->text);
if (length <= vis_width - 6) {
memcpy (str + 3, w->text, length);
str[length + 3] = ' ';
memcpy (str + 1, w->text, length);
str[length + 1] = ' ';
x = length + 4;
} else /* Scroll the title, if it doesn't fit...*/
{
speed = 1;
@@ -348,12 +347,18 @@ draw_frame (LinkedList * list,
{
x = (length - (vis_width - 6)) - x;
}
strncpy (str + 3, w->text + x, (vis_width - 6));
str[vis_width - 3] = ' ';
strncpy (str + 1, w->text + x, (vis_width - 6));
str[vis_width - 5] = ' ';
x = vis_width - 2;
}
str[vis_width] = 0;
str[vis_width-4] = 0;
drivers_string (1 + left, 1 + top, str);
drivers_string (3 + left, 1 + top, str);
for (; x<vis_width; x++) {
drivers_icon (w->x+x, w->y, ICON_BLOCK_FILLED);
}
break;
case WID_SCROLLER: /* FIXME: doesn't work in frames...*/
{