/*
 * @(#)sungeneric.h 24.2 91/02/26
 *
 */

#ifndef _sungeneric_h
#define _sungeneric_h

#define	TV_TO_TIME(sec, usec) (fract) (((sec) * 1000) + ((usec) / 1000))

struct sunwin {
    int		fd;
};

extern int vsdev;

#define osprivate(scr)	((struct sunwin *)((scr)->ospriv))

/*
 * For zap_cursor()
 */
#if defined(SYSV) && defined(sun)
#include <sys/pixrect.h>
#include <sys/pr_util.h>
#include <sys/memvar.h>
#include <sys/pr_planegroups.h>
#else
#include <pixrect/pixrect.h>
#include <pixrect/pr_util.h>
#include <pixrect/memvar.h>
#include <pixrect/pr_planegroups.h>
#endif

/* HACK -- this is done to avoid calling the real thing */
#define fake_mpr_static(name, w, h, d, image) \
        struct  mpr_data CAT(name,_data) = \
            {mpr_linebytes(w,d), (short *)(image), {0, 0}, 0, 0}; \
        Pixrect name = \
            {(struct pixrectops *)0, w, h, d, (caddr_t)&CAT(name,_data)} 
/*
 * from sunwindow/win_ioctl.h
 */
#define     WINSETLOCATOR   _IOW(g, 48, struct cursor)
#define     WINGETLOCATOR   _IOWR(g, 49, struct cursor)

/*
 * from sunwindow/win_cursor.h
 */
struct cursor {
        short   cur_xhot, cur_yhot;     /* offset of mouse position from shape*/        int     cur_function;           /* relationship of shape to screen */
        struct  pixrect *cur_shape;     /* memory image to use */
        int     flags;                  /* various options */
 
        short   horiz_hair_thickness;   /* horizontal crosshair height */
        int     horiz_hair_op;          /*            drawing op       */
        int     horiz_hair_color;       /*            color            */
        short   horiz_hair_length;      /*            width           */ 
        short   horiz_hair_gap;         /*            gap             */ 
 
        short   vert_hair_thickness;    /* vertical crosshair width  */
        int     vert_hair_op;           /*          drawing op       */  
        int     vert_hair_color;        /*          color            */  
        short   vert_hair_length;       /*          height           */  
        short   vert_hair_gap;          /*          gap              */  
};

#endif /* _sungeneric_h */

