From: Chris Hanson Date: Fri, 19 May 1995 21:04:27 +0000 (+0000) Subject: Add hooks to update PM console's font metric data when the font is X-Git-Tag: 20090517-FFI~6299 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=04ae341bbfe7f9c3164ae712851e28d18e25081f;p=mit-scheme.git Add hooks to update PM console's font metric data when the font is changed. --- diff --git a/v7/src/microcode/os2pm.c b/v7/src/microcode/os2pm.c index b31e7113c..d58efe26e 100644 --- a/v7/src/microcode/os2pm.c +++ b/v7/src/microcode/os2pm.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: os2pm.c,v 1.15 1995/05/16 09:20:06 cph Exp $ +$Id: os2pm.c,v 1.16 1995/05/19 21:04:16 cph Exp $ Copyright (c) 1994-95 Massachusetts Institute of Technology @@ -35,6 +35,9 @@ MIT in each case. */ #define INCL_WIN #define INCL_GPI #include "os2.h" + +extern psid_t OS2_console_psid (void); +extern void OS2_console_font_change_hook (font_metrics_t *); typedef enum { pst_window, pst_memory } pst_t; @@ -2373,6 +2376,8 @@ OS2_ps_set_font (psid_t psid, unsigned short id, const char * name) = (OS2_message_transaction ((PS_QID (ps)), message, mt_ps_set_font_reply)); metrics = (SM_PS_SET_FONT_REPLY_METRICS (message)); OS2_destroy_message (message); + if ((metrics != 0) && (psid == (OS2_console_psid ()))) + OS2_console_font_change_hook (metrics); return (metrics); } diff --git a/v7/src/microcode/os2pmcon.c b/v7/src/microcode/os2pmcon.c index 03b61d344..aa442535b 100644 --- a/v7/src/microcode/os2pmcon.c +++ b/v7/src/microcode/os2pmcon.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: os2pmcon.c,v 1.7 1995/05/07 05:53:20 cph Exp $ +$Id: os2pmcon.c,v 1.8 1995/05/19 21:04:27 cph Exp $ Copyright (c) 1994-95 Massachusetts Institute of Technology @@ -61,7 +61,7 @@ static unsigned short console_pel_height; static unsigned short console_width; static unsigned short console_height; static char * console_chars; -static font_metrics_t * metrics; +static font_metrics_t * console_metrics; static unsigned short point_x; static unsigned short point_y; static int console_visiblep; @@ -78,9 +78,9 @@ static qid_t console_pm_qid; static wid_t console_wid; static psid_t console_psid; -#define CHAR_WIDTH (FONT_METRICS_WIDTH (metrics)) -#define CHAR_HEIGHT (FONT_METRICS_HEIGHT (metrics)) -#define CHAR_DESCENDER (FONT_METRICS_DESCENDER (metrics)) +#define CHAR_WIDTH (FONT_METRICS_WIDTH (console_metrics)) +#define CHAR_HEIGHT (FONT_METRICS_HEIGHT (console_metrics)) +#define CHAR_DESCENDER (FONT_METRICS_DESCENDER (console_metrics)) #define CHAR_LOC(x, y) (& (console_chars [((y) * console_width) + (x)])) #define FASTFILL(p, n, c) \ @@ -117,8 +117,8 @@ OS2_initialize_pm_console (void) } OS2_window_permanent (console_wid); console_psid = (OS2_window_client_ps (console_wid)); - metrics = (OS2_ps_set_font (console_psid, 1, "4.System VIO")); - if (metrics == 0) + console_metrics = (OS2_ps_set_font (console_psid, 1, "4.System VIO")); + if (console_metrics == 0) OS2_logic_error ("Unable to find 4 point System VIO font."); OS2_window_set_grid (console_wid, CHAR_WIDTH, CHAR_HEIGHT); OS2_window_shape_cursor @@ -142,6 +142,18 @@ OS2_console_wid (void) { return (console_wid); } + +psid_t +OS2_console_psid (void) +{ + return (console_psid); +} + +void +OS2_console_font_change_hook (font_metrics_t * metrics) +{ + font_metrics = metrics; +} static void grab_console_lock (void)