How to make an OS shell function in a svgalib program

Search this archive.

From: Karel Kulhavy (clock@atrey.karlin.mff.cuni.cz)
Date: Mon 08 Apr 2002 - 21:22:31 IDT


Hi

I need to implement a function similar to "OS shell".

In fact I have a web browser written under svgallib that calls external,
text-mode program.

I need to implement function vga_block and vga_unblock.

vga_block restores original state before start of the program (vga_setmode(TEXT))
and also has to restore original mouse state (so that the program can use mouse services
without problems).

vga_unblock has to set up the graphics mode and restart the mouse.

I found it is impossible under 1.9.13. Because only way how to restore
original mouse state is mouse_close. When I call mouse_close, __svgalib_mouse_fd is
closed, and mouse_open is still left at 1.

The only way how to reengage the mouse is do in my program this gross hack:
extern int mouse_open;

There are also two limiting factors in my program:
a) I need to know the __svgalib_mouse_fd because I need to do a select() on the descriptor when
   the program is idle and doing nothing. This is only possible via calling mouse_init_return_fd
   when the mouse is already running.
b) I may not use mouse_init because I don't know the values that are normally set up in
   /etc/vga/libvga.config.  So I can't use mouse_init and mouse_init_return_fd to kick up the mouse.
   The only remaining possibility is vga_init.

I have written it this way:

vga_ublock(int mode)
{
	...
	mouse_open=0;
	vga_init();
	vga_setmousesupport(1);
	vga_setmode(mode);
	mouse_fd_for_use_ini_select=mouse_init_return_fd(...);
}


But the I realized my program doesn't work with svgalib 1.4.1 because it knows nothing about mouse_open.

I am gonna puke from the svgalib.

Please tell me how to correctly write my vga_block and vga_unblock according to said specifications.

Clock


------------------------------------------------------------------
Unsubscribe:  To:   listbot@svgalib.org
              Body: unsubscribe linux-svgalib


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:24 IST