commit b6114dd1dd6a8dd56613ecb5c6cf8ab725f84fe8
parent 7dac53a708dd3625c7aa43f97a79ff0ef94158e3
Author: lumidify <nobody@lumidify.org>
Date: Fri, 19 Feb 2021 22:54:09 +0100
Somewhat simplify compile options
Diffstat:
6 files changed, 9 insertions(+), 21 deletions(-)
diff --git a/README.md b/README.md
@@ -3,7 +3,7 @@ Not much to see here.
WARNING: DON'T TRY TO USE THIS! IT IS ONLY A PLACE FOR ME TO TRY OUT MY
WILDEST FANTASIES, NOT ACTUAL WORKING CODE.
-To build with or without pango: Follow instructions in config.mk and defs.h.
+To build with or without pango: Follow instructions in config.mk.
Note: The basic (non-pango) text doesn't work properly on my i386 machine
because it's a bit of a hack.
diff --git a/color.c b/color.c
@@ -1,7 +1,6 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
-#include "defs.h"
#include "util.h"
#include "color.h"
@@ -14,7 +13,7 @@ ltk_color_create(Display *dpy, int screen, Colormap cm, const char *hex, LtkColo
}
XAllocColor(dpy, cm, &col->xcolor);
/* FIXME: replace with XftColorAllocValue; error checking */
- #ifdef USE_XFT
+ #ifdef USE_PANGO
XftColorAllocName(dpy, DefaultVisual(dpy, screen), cm, hex, &col->xftcolor);
#endif
}
diff --git a/color.h b/color.h
@@ -1,15 +1,13 @@
-#include "defs.h"
-
#ifndef _LTK_COLOR_H_
#define _LTK_COLOR_H_
-#ifdef USE_XFT
+#ifdef USE_PANGO
#include <X11/Xft/Xft.h>
#endif
typedef struct {
XColor xcolor;
- #ifdef USE_XFT
+ #ifdef USE_PANGO
XftColor xftcolor;
#endif
} LtkColor;
diff --git a/config.mk b/config.mk
@@ -1,13 +1,14 @@
VERSION = -999
-CFLAGS = -DDEBUG -D_POSIX_C_SOURCE=200809L -g -std=c99 -w -fcommon -Wall -Werror -Wextra `pkg-config --cflags x11 fontconfig` -pedantic
+CFLAGS = -DDEBUG -D_POSIX_C_SOURCE=200809L -g -std=c99 -w -fno-common -Wall -Werror -Wextra `pkg-config --cflags x11 fontconfig` -pedantic
LDFLAGS = -lm `pkg-config --libs x11 fontconfig`
+
# Comment when enabling pango rendering:
OBJ = stb_truetype.o text_stb.o
# Uncomment to enable pango rendering:
#OBJ = text_pango.o
-#CFLAGS += `pkg-config --cflags pangoxft`
+#CFLAGS += -DUSE_PANGO `pkg-config --cflags pangoxft`
#LDFLAGS += `pkg-config --libs pangoxft`
# OpenBSD
diff --git a/defs.h b/defs.h
@@ -1,9 +0,0 @@
-/*
- Uncomment USE_PANGO and USE_XFT and comment USE_STB to enable pango,
- and vice versa to enable basic rendering.
-*/
-/*
-#define USE_PANGO
-#define USE_XFT
-*/
-#define USE_STB
diff --git a/text.h b/text.h
@@ -1,9 +1,8 @@
-#include "defs.h"
-#include "color.h"
-
#ifndef _LTK_TEXT_H_
#define _LTK_TEXT_H_
+#include "color.h"
+
typedef struct LtkTextLine LtkTextLine;
void ltk_init_text(const char *default_font, Display *dpy, int screen, Colormap cm);