shithub: vdict

Download patch

ref: 4b4c40d3bfac59285d82260ba545087c087ddd17
parent: adff7393a37000c5ded14e44b8e53311681c9c3a
author: phil9 <[email protected]>
date: Tue Jan 24 05:48:35 EST 2023

remove old theme code

--- a/theme.c
+++ /dev/null
@@ -1,84 +1,0 @@
-#include <u.h>
-#include <libc.h>
-#include <bio.h>
-#include <draw.h>
-#include "theme.h"
-
-Image*
-ereadcol(char *s)
-{
-	Image *i;
-	char *e;
-	ulong c;
-
-	c = strtoul(s, &e, 16);
-	if(e == nil || e == s)
-		return nil;
-	c = (c << 8) | 0xff;
-	i = allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, c);
-	if(i == nil)
-		sysfatal("allocimage: %r");
-	return i;
-}
-
-Theme*
-loadtheme(void)
-{
-	Theme *theme;
-	Biobuf *bp;
-	char *s;
-
-	if(access("/dev/theme", AREAD) < 0)
-		return 0;
-	bp = Bopen("/dev/theme", OREAD);
-	if(bp == nil)
-		return 0;
-	theme = malloc(sizeof *theme);
-	if(theme == nil){
-		Bterm(bp);
-		return nil;
-	}
-	for(;;){
-		s = Brdstr(bp, '\n', 1);
-		if(s == nil)
-			break;
-		if(strncmp(s, "back", 4) == 0)
-			theme->back = ereadcol(s+5);
-		else if(strncmp(s, "high", 4) == 0)
-			theme->high = ereadcol(s+5);
-		else if(strncmp(s, "border", 6) == 0)
-			theme->border = ereadcol(s+7);
-		else if(strncmp(s, "text", 4) == 0)
-			theme->text = ereadcol(s+5);
-		else if(strncmp(s, "htext", 5) == 0)
-			theme->htext = ereadcol(s+6);
-		else if(strncmp(s, "title", 5) == 0)
-			theme->title = ereadcol(s+6);
-		else if(strncmp(s, "ltitle", 6) == 0)
-			theme->ltitle = ereadcol(s+7);
-		else if(strncmp(s, "hold", 4) == 0)
-			theme->hold = ereadcol(s+5);
-		else if(strncmp(s, "lhold", 5) == 0)
-			theme->lhold = ereadcol(s+6);
-		else if(strncmp(s, "palehold", 8) == 0)
-			theme->palehold = ereadcol(s+9);
-		else if(strncmp(s, "paletext", 8) == 0)
-			theme->paletext = ereadcol(s+9);
-		else if(strncmp(s, "size", 4) == 0)
-			theme->size = ereadcol(s+5);
-		else if(strncmp(s, "menuback", 8) == 0)
-			theme->menuback = ereadcol(s+9);
-		else if(strncmp(s, "menuhigh", 8) == 0)
-			theme->menuhigh = ereadcol(s+9);
-		else if(strncmp(s, "menubord", 8) == 0)
-			theme->menubord = ereadcol(s+9);
-		else if(strncmp(s, "menutext", 8) == 0)
-			theme->menutext = ereadcol(s+9);
-		else if(strncmp(s, "menuhtext", 5) == 0)
-			theme->menuhtext = ereadcol(s+6);
-		free(s);
-	}
-	Bterm(bp);
-	return theme;
-}
-
--- a/theme.h
+++ /dev/null
@@ -1,25 +1,0 @@
-typedef struct Theme Theme;
-
-struct Theme
-{
-	Image *back;
-	Image *high;
-	Image *border;
-	Image *text;
-	Image *htext;
-	Image *title;
-	Image *ltitle;
-	Image *hold;
-	Image *lhold;
-	Image *palehold;
-	Image *paletext;
-	Image *size;
-	Image *menubar;
-	Image *menuback;
-	Image *menuhigh;
-	Image *menubord;
-	Image *menutext;
-	Image *menuhtext;
-};
-
-Theme* loadtheme(void);