wdvi

network DVI viewer
Log | Files | Refs

commit ee751029066ab7791856f1287724fee4bafeb988
parent 6d08c77f9f52decec0544d54ee5143099488f877
Author: Kyle Milz <krwmilz@gmail.com>
Date:   Tue, 14 Sep 2021 16:34:26 +0000

move struct drawinf and friends to better header

Diffstat:
Mdata.h | 2++
Mdvi-draw.h | 36++++++++++++++++++++++++++++++++++++
Mfont.h | 38+-------------------------------------
Mspecial.c | 4+++-
4 files changed, 42 insertions(+), 38 deletions(-)

diff --git a/data.h b/data.h @@ -38,5 +38,7 @@ struct avl { /* generic data structure */ AVL_COMMON; }; +typedef long (*set_char_proc)(unsigned char); + #endif diff --git a/dvi-draw.h b/dvi-draw.h @@ -1,5 +1,41 @@ #include <X11/Intrinsic.h> /* Boolean */ +#include "data.h" /* set_char_proc */ + + +struct frame { + struct framedata { + long dvi_h, dvi_v, w, x, y, z; + int pxl_v; + } data; + struct frame *next, *prev; +}; + +struct drawinf { /* this information is saved when using virtual fonts */ + struct framedata data; + struct font *fontp; + set_char_proc set_char_p; + int tn_table_len; + struct font **tn_table; + struct tn *tn_head; + unsigned char *pos, *end; + struct font *virtual; +}; + +struct drawinf currinf; + +/* entries below with the characters 'dvi' in them are actually stored in + scaled pixel units */ + +#define DVI_H currinf.data.dvi_h +#define PXL_H pixel_conv(currinf.data.dvi_h) +#define DVI_V currinf.data.dvi_v +#define PXL_V currinf.data.pxl_v +#define WW currinf.data.w +#define XX currinf.data.x +#define YY currinf.data.y +#define ZZ currinf.data.z + Boolean drawing_mag = False; void draw_page(void); diff --git a/font.h b/font.h @@ -6,43 +6,7 @@ #include <ft2build.h> #include FT_SIZES_H /* FT_Size */ -#include "data.h" /* struct bitmap */ - - -struct frame { - struct framedata { - long dvi_h, dvi_v, w, x, y, z; - int pxl_v; - } data; - struct frame *next, *prev; -}; - -typedef long (*set_char_proc)(unsigned char); - -struct drawinf { /* this information is saved when using virtual fonts */ - struct framedata data; - struct font *fontp; - set_char_proc set_char_p; - int tn_table_len; - struct font **tn_table; - struct tn *tn_head; - unsigned char *pos, *end; - struct font *virtual; -}; - -struct drawinf currinf; - -/* entries below with the characters 'dvi' in them are actually stored in - scaled pixel units */ - -#define DVI_H currinf.data.dvi_h -#define PXL_H pixel_conv(currinf.data.dvi_h) -#define DVI_V currinf.data.dvi_v -#define PXL_V currinf.data.pxl_v -#define WW currinf.data.w -#define XX currinf.data.x -#define YY currinf.data.y -#define ZZ currinf.data.z +#include "data.h" /* struct bitmap, set_char_proc */ /* diff --git a/special.c b/special.c @@ -54,10 +54,12 @@ NOTE: */ #include <err.h> +#include <limits.h> /* abs() */ #include <math.h> #include <ctype.h> +#include <stdlib.h> /* abs() */ -#include "font.h" +#include "dvi-draw.h" /* PXL_V, PXL_H */ #include "events.h" /* do_color_change() */ #include "special.h" #include "xdvi.h"