Removed more unused code. - sam - An updated version of the sam text editor.
(HTM) git clone git://vernunftzentrum.de/sam.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit 0afba348f33f094d58c3bf88eb9d8cc4dd77d60b
(DIR) parent b27b105be54d4930254975027523ceb9d853eb20
(HTM) Author: Rob King <jking@deadpixi.com>
Date: Tue, 4 Oct 2016 00:57:30 -0500
Removed more unused code.
Diffstat:
include/libg.h | 4 +---
libXg/Makefile | 4 ++--
libXg/font.c | 18 ------------------
libXg/string.c | 21 +++++++++++++++++++--
libXg/strwidth.c | 23 -----------------------
5 files changed, 22 insertions(+), 48 deletions(-)
---
(DIR) diff --git a/include/libg.h b/include/libg.h
@@ -177,10 +177,8 @@ extern void berror(char*);
extern void bitblt2(Bitmap*, Point, Bitmap*, Rectangle, Fcode, uint64_t, uint64_t);
extern void bitblt(Bitmap*, Point, Bitmap*, Rectangle, Fcode);
-
extern Point string(Bitmap*, Point, XftFont*, char*, Fcode);
-extern int64_t strwidth(XftFont*, char*);
-extern Point strsize(XftFont*, char*);
+extern int64_t strwidth(XftFont*, char*);
extern int64_t charwidth(XftFont*, wchar_t);
extern void texture(Bitmap*, Rectangle, Bitmap*, Fcode);
extern void wrbitmap(Bitmap*, int, int, unsigned char*);
(DIR) diff --git a/libXg/Makefile b/libXg/Makefile
@@ -25,9 +25,9 @@ CC?=c99
OBJS= arith.o balloc.o bitblt.o border.o bscreenrect.o\
clipr.o cursorset.o cursorswitch.o\
- font.o gcs.o getrect.o gwin.o ldconvert.o latin1.o\
+ gcs.o getrect.o gwin.o ldconvert.o latin1.o\
menuhit.o \
- rectclip.o rune.o string.o strwidth.o texture.o\
+ rectclip.o rune.o string.o texture.o\
wrbitmap.o xtbinit.o
all install: $(LIB)
(DIR) diff --git a/libXg/font.c b/libXg/font.c
@@ -1,18 +0,0 @@
-/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */
-#include <u.h>
-#include <libc.h>
-#include <libg.h>
-#include "libgint.h"
-
-#define PJW 0 /* use NUL==pjw for invisible characters */
-
-long
-charwidth(XftFont *f, wchar_t r)
-{
-
- char chars[MB_LEN_MAX + 1] = {0};
-
- runetochar(chars, r);
- return strwidth(f, chars);
-}
-
(DIR) diff --git a/libXg/string.c b/libXg/string.c
@@ -5,8 +5,6 @@
#include <libg.h>
#include "libgint.h"
-enum { Max = 128 };
-
Point
string(Bitmap *b, Point p, XftFont *ft, char *s, Fcode f)
{
@@ -35,3 +33,22 @@ string(Bitmap *b, Point p, XftFont *ft, char *s, Fcode f)
p.x = x + b->r.min.x;
return p;
}
+
+
+int64_t
+strwidth(XftFont *f, char *s)
+{
+ XGlyphInfo extents = {0};
+ XftTextExtentsUtf8(_dpy, f, (FcChar8 *)s, strlen(s), &extents);
+
+ return extents.xOff;
+}
+
+int64_t
+charwidth(XftFont *f, wchar_t r)
+{
+ char chars[MB_LEN_MAX + 1] = {0};
+
+ runetochar(chars, r);
+ return strwidth(f, chars);
+}
(DIR) diff --git a/libXg/strwidth.c b/libXg/strwidth.c
@@ -1,23 +0,0 @@
-/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */
-#include <u.h>
-#include <libc.h>
-#include <libg.h>
-#include "libgint.h"
-
-long
-strwidth(XftFont *f, char *s)
-{
- XGlyphInfo extents = {0};
- XftTextExtentsUtf8(_dpy, f, (FcChar8 *)s, strlen(s), &extents);
-
- return extents.xOff;
-}
-
-Point
-strsize(XftFont *f, char *s)
-{
- XGlyphInfo extents = {0};
- XftTextExtentsUtf8(_dpy, f, (FcChar8 *)s, strlen(s), &extents);
-
- return Pt(strwidth(f, s), extents.yOff);
-}