summaryrefslogtreecommitdiff
path: root/src/font.h
diff options
context:
space:
mode:
authorMichael Jennings <mej@kainx.org>2000-09-02 04:12:16 +0000
committerMichael Jennings <mej@kainx.org>2000-09-02 04:12:16 +0000
commitc567ebcf337b96efbcb37aab5728825e601151cc (patch)
treeaeb6d2e8af6c9a3af540284423e41bceccf382aa /src/font.h
parente1573e95c8c404bc9048d36544b734bc689814ec (diff)
downloadeterm-c567ebcf337b96efbcb37aab5728825e601151cc.tar.gz
Fri Sep 1 21:03:53 PDT 2000 Michael Jennings <mej@eterm.org>
I'm working on some deallocators now. The idea is that when Eterm exits and memory debugging is on, several routines get called to free the in-use memory (menus, font cache, etc.) that we still know about. Anything left after that would be either unavoidable leaks (like environment variables...read the putenv() man page sometime...sigh) or genuine memory leaks that need fixing. I'm down to about 4.5K of leftover malloc'd memory now. Making progress.... SVN revision: 3295
Diffstat (limited to 'src/font.h')
-rw-r--r--src/font.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/font.h b/src/font.h
index b96956c..94c3816 100644
--- a/src/font.h
+++ b/src/font.h
@@ -46,6 +46,7 @@
#define SHADOW_BOTTOM_LEFT 2
#define SHADOW_BOTTOM_RIGHT 3
+/* The macros are used to advance to the next/previous font as with Ctrl-> and Ctrl-< */
#define NEXT_FONT(i) do { if (font_idx + ((i)?(i):1) >= font_cnt) {font_idx = font_cnt - 1;} else {font_idx += ((i)?(i):1);} \
while (!etfonts[font_idx]) {if (font_idx == font_cnt) {font_idx--; break;} font_idx++;} } while (0)
#define PREV_FONT(i) do { if (font_idx - ((i)?(i):1) < 0) {font_idx = 0;} else {font_idx -= ((i)?(i):1);} \
@@ -55,10 +56,11 @@
/************ Structures ************/
typedef struct cachefont_struct {
- char *name;
- unsigned char type;
- unsigned char ref_cnt;
+ char *name; /* Font name in canonical format */
+ unsigned char type; /* Font type (FONT_TYPE_* from above */
+ unsigned char ref_cnt; /* Reference count */
union {
+ /* This union will eventually have members for TTF/Fnlib fonts */
XFontStruct *xfontinfo;
} fontinfo;
struct cachefont_struct *next;
@@ -86,6 +88,8 @@ _XFUNCPROTOBEGIN
extern void eterm_font_add(char ***plist, const char *fontname, unsigned char idx);
extern void eterm_font_delete(char **flist, unsigned char idx);
+extern void eterm_font_list_clear(void);
+extern void font_cache_clear(void);
extern void *load_font(const char *, const char *, unsigned char);
extern void free_font(const void *);
extern void change_font(int, const char *);