/* sunview.c - sunview display process */
static char *rcsid
= "$Header: /f/osi/others/quipu/photo/RCS/sunview.c,v 7.2 91/02/22 09:29:25 mrose Interim $";
* $Header: /f/osi/others/quipu/photo/RCS/sunview.c,v 7.2 91/02/22 09:29:25 mrose Interim $
* Revision 7.2 91/02/22 09:29:25 mrose
* Revision 7.1 90/07/09 14:40:30 mrose
* Revision 7.0 89/11/23 22:01:47 mrose
* Acquisition, use, and distribution of this module and related
* materials are subject to the restrictions of a license agreement.
* Consult the Preface in the User's Manual for the full terms of
/* sunview display process */
#include <suntool/tool_hs.h>
#include <suntool/panel.h>
#include <suntool/gfxsw.h>
#include <sys/resource.h>
static struct gfxsubwindow
*gfx
;
static struct tool
*tool
;
static struct toolsw
*gfx_sw
;
static int sx
=20,sy
=20,x
,y
;
/* Initialise a window to recieve a photo of 'name' */
if (getenv ("WINDOW_PARENT") == (char *)NULL
) {
(void) fprintf (stderr
,"PHOTO: Must be running suntools on the console");
if (( tool
= tool_make (WIN_LABEL
,name
,WIN_TOP
,sx
,WIN_LEFT
,sy
,0)) == NULL
) {
(void) fprintf (stderr
,"PHOTO: can't create window");
signal (SIGWINCH
,sigwinched
);
gfx_sw
= gfxsw_createtoolsubwindow (tool
,"",TOOL_SWEXTENDTOEDGE
,TOOL_SWEXTENDTOEDGE
,NULL
);
gfx
= (struct gfxsubwindow
*) gfx_sw
->ts_data
;
/* return 0 if sucessful -1 if not */
/* Decoding has finished - display the photo */
(void) printf ("(See sunview window)");
/* return 0 if sucessful -1 if not */
tool_set_attributes (tool
,WIN_WIDTH
,PIC_LINESIZE
+40,WIN_HEIGHT
,sy
+40,0);
/* draw a black line of 'length' pixels */
/* draw a white line of 'length' pixels */
/* the end of a line has been reached */
/* A bit string is stored in line->dbuf_top */
pix
= mem_point (PIC_LINESIZE
,1,1,line
->dbuf_top
);
pw_write (gfx
->gfx_pixwin
, sx
, sy
, PIC_LINESIZE
-sx
, 1, PIX_SRC
,pix
,0,0);