/************************************************************************ * "Epsilon", "EEL" and "Lugaru" are trademarks of Lugaru Software, Ltd. * * * * Copyright (C) 1985, 1990 Lugaru Software Ltd. All rights reserved. * * * * Limited permission is hereby granted to reproduce and modify this * * copyrighted material provided that the resulting code is used only in * * conjunction with Lugaru products and that this notice is retained in * * any such reproduction or modification. * ************************************************************************* * Modified by David S. Bakin: OS/2 set_cursor. * ************************************************************************/ #include "eel.h" #include "lowlevel.h" char prev_over_mode = -1; #ifdef OS2 struct CursorData OriginalCursorData; #endif /* Modified from disp.e, and with Joseph M. Newcomer modification: */ make_mode() { if (prev_over_mode != over_mode) set_cursor(over_mode); prev_over_mode = over_mode; strcpy(mode, major_mode); if (fill_mode) { char fw[5]; strcat(mode, " Fill "); sprintf(fw,"%d",margin_right); strcat(mode,fw); } if (over_mode) strcat(mode, " Over"); if (!strip_returns) strcat(mode, " NoTrans"); if (len_def_mac) strcat(mode, " (Def)"); } /* Call the following from your finish_up routine in order to clean up the cursor when leaving Epsilon: */ finish_up_cursor() { set_cursor(0); } set_cursor(over) { #ifdef OS2 struct CursorData cd; /* Overlay mode: Set the cursor start to 0. Insert mode: Set the cursor to the original cursor. */ cd.cur_start = OriginalCursorData.cur_start; cd.cur_end = OriginalCursorData.cur_end; cd.cur_width = OriginalCursorData.cur_width; cd.cur_attribute= OriginalCursorData.cur_attribute; if (over) cd.cur_start =0; os2call("VIOCALLS", 0, "VIOSETCURTYPE", 3 /* # words of argument */, get_pointer(&cd, SEGMENT), get_pointer(&cd, !SEGMENT), 0 /* VIO handle */, 0, 0 /* two placeholders */); #else m_regs.w.cx = over ? 0x0007 : 0x0607; vid_int(0x100); #endif } /* Modified from window.e: */ command next_window() on cx_tab['n'], cx_tab['o'], reg_tab[NUMALT(NUMDIGIT(3))] { window_number++; make_mode(); } /* Modified from window.e: */ command previous_window() on cx_tab['p'], reg_tab[NUMALT(NUMDIGIT(9))] { window_number--; make_mode(); } /* Modified from window.e: */ command kill_window() on cx_tab[CTRL('D')] { window_kill(); make_mode(); } #ifdef OS2 when_loading() { /* Get the original cursor value */ os2call("VIOCALLS", 0, "VIOGETCURTYPE", 3 /* # words of argument */, get_pointer(&OriginalCursorData, SEGMENT), get_pointer(&OriginalCursorData, !SEGMENT), 0 /* VIO handle */, 0, 0 /* two placeholders */); } #endif