BOOL FAR PASCAL ScrReSize (HWND hWnd, UINT wParam, WORD cx, WORD cy) /* returns TRUE only if real resizing performed */ { BOOL ChgWidth, ChgHeight; if ((wParam != SIZENORMAL) && (wParam != SIZEFULLSCREEN)) { return FALSE; } ChgWidth = (cx != GetWindowWord (hWnd, GWW_SCRCX)); ChgHeight = (cy != GetWindowWord (hWnd, GWW_SCRCY)); if (!ChgWidth && !ChgHeight) return FALSE; SetWindowWord (hWnd, GWW_SCRCX, cx); SetWindowWord (hWnd, GWW_SCRCY, cy); if (!InternalRequest) { SCREEN *TopScreen; InternalRequest = TRUE; TopScreen = first_screen; select_screen ((SCREEN *)GetWindowLong (hWnd, GWL_SCRPTR), FALSE); if (ChgWidth) { newwidth (TRUE, DisplayableColumns (hWnd, cx, &EmacsCM)); } if (ChgHeight) { newsize (TRUE, DisplayableRows (hWnd, cy, &EmacsCM)); } select_screen (TopScreen, FALSE); update (FALSE); InternalRequest = FALSE; } return TRUE; } /* ScrReSize */
/* ========== */ static void PASCAL ChangeFont (void) { SCREEN *sp, *fsp; RECT Rect; /*-loop through all the screens, resizing the vision that emacs has of them, processing the current ("first") screen last */ InternalRequest = TRUE; fsp = first_screen; do { sp = first_screen; while (sp->s_next_screen != (SCREEN *)NULL) sp = sp->s_next_screen; select_screen (sp, FALSE); GetClientRect (sp->s_drvhandle, &Rect); newwidth (TRUE, DisplayableColumns (sp->s_drvhandle, Rect.right, &EmacsCM)); newsize (TRUE, DisplayableRows (sp->s_drvhandle, Rect.bottom, &EmacsCM)); } while (sp != fsp); InternalRequest = FALSE; /*-update the frame's client area and the MDIClient's size */ InvalidateRect (hFrameWnd, NULL, TRUE); GetClientRect (hFrameWnd, &Rect); MoveWindow (hMDIClientWnd, 0, 0, Rect.right, Rect.bottom - EmacsCM.MLHeight, TRUE); } /* ChangeFont */
/*** * smgcres - Change screen resolution * * smgcres changes the screen resolution of the current window. * Allowable sizes are NORMAL and WIDE. * * Nothing returned ***/ smgcres(char *value) { int width; /* Skip if not supported */ if (width_wide == NULL || width_narrow == NULL) return; /* Check value */ if (strcmp(value, "WIDE") == 0) { width = wide_char; smgputs(width_wide); } else if (strcmp(value, "NORMAL") == 0) { width = narrow_char; smgputs(width_narrow); } /* Change width */ orgchar.width = width; newwidth(TRUE, width); /* Set resolution variable */ strcpy(sres, value); }
/* * Set a variable. * * @var: variable to set. * @value: value to set to. */ int svar(struct variable_description *var, char *value) { int vnum; /* ordinal number of var refrenced */ int vtype; /* type of variable to set */ int status; /* status return */ int c; /* translated character */ char *sp; /* scratch string pointer */ /* simplify the vd structure (we are gonna look at it a lot) */ vnum = var->v_num; vtype = var->v_type; /* and set the appropriate value */ status = TRUE; switch (vtype) { case TKVAR: /* set a user variable */ if (uv[vnum].u_value != NULL) free(uv[vnum].u_value); sp = malloc(strlen(value) + 1); if (sp == NULL) return FALSE; strcpy(sp, value); uv[vnum].u_value = sp; break; case TKENV: /* set an environment variable */ status = TRUE; /* by default */ switch (vnum) { case EVFILLCOL: fillcol = atoi(value); break; case EVPAGELEN: status = newsize(TRUE, atoi(value)); break; case EVCURCOL: status = setccol(atoi(value)); break; case EVCURLINE: status = gotoline(TRUE, atoi(value)); break; case EVRAM: break; case EVFLICKER: flickcode = stol(value); break; case EVCURWIDTH: status = newwidth(TRUE, atoi(value)); break; case EVCBUFNAME: strcpy(curbp->b_bname, value); curwp->w_flag |= WFMODE; break; case EVCFNAME: strcpy(curbp->b_fname, value); curwp->w_flag |= WFMODE; break; case EVSRES: status = TTrez(value); break; case EVDEBUG: macbug = stol(value); break; case EVSTATUS: cmdstatus = stol(value); break; case EVASAVE: gasave = atoi(value); break; case EVACOUNT: gacount = atoi(value); break; case EVLASTKEY: lastkey = atoi(value); break; case EVCURCHAR: ldelchar(1, FALSE); /* delete 1 char */ c = atoi(value); if (c == '\n') lnewline(); else linsert(1, c); backchar(FALSE, 1); break; case EVDISCMD: discmd = stol(value); break; case EVVERSION: break; case EVPROGNAME: break; case EVSEED: seed = atoi(value); break; case EVDISINP: disinp = stol(value); break; case EVWLINE: status = resize(TRUE, atoi(value)); break; case EVCWLINE: status = forwline(TRUE, atoi(value) - getwpos()); break; case EVTARGET: curgoal = atoi(value); thisflag = saveflag; break; case EVSEARCH: strcpy(pat, value); rvstrcpy(tap, pat); #if MAGIC mcclear(); #endif break; case EVREPLACE: strcpy(rpat, value); break; case EVMATCH: break; case EVKILL: break; case EVCMODE: curbp->b_mode = atoi(value); curwp->w_flag |= WFMODE; break; case EVGMODE: gmode = atoi(value); break; case EVTPAUSE: term.t_pause = atoi(value); break; case EVPENDING: break; case EVLWIDTH: break; case EVLINE: putctext(value); case EVGFLAGS: gflags = atoi(value); break; case EVRVAL: break; case EVTAB: tabmask = atoi(value) - 1; if (tabmask != 0x07 && tabmask != 0x03) tabmask = 0x07; curwp->w_flag |= WFHARD; break; case EVOVERLAP: overlap = atoi(value); break; case EVSCROLLCOUNT: scrollcount = atoi(value); break; case EVSCROLL: #if SCROLLCODE if (!stol(value)) term.t_scroll = NULL; #endif break; } break; } return status; }