Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ames!mailrus!tut.cis.ohio-state.edu!rutgers!bellcore!texbell!bigtex!milano!titan!janssen@titan.sw.mcc.com From: janssen@titan.sw.mcc.com (Bill Janssen) Newsgroups: comp.windows.x Subject: Re: physical screen dimensions on a Sun Summary: here's some code that should work Message-ID: <1492@titan.> Date: 1 Nov 88 19:41:50 GMT References: <8811010704.AA01663@sparky> Sender: janssen@titan. Reply-To: janssen@titan.sw.mcc.com (Bill Janssen) Lines: 50 In-reply-to: jdi@sparky.UUCP (John Irwin) This is an on-the-fly mod of a subroutine I keep around for getting info about sun screens: #include #include #include #include #define AND && #define OR || #define NOT ! /* Get some info about a screen device Ref: 1. pp. 119-129, SunCore Ref Manual 2. man entry for "fbio(4S)" 3. /usr/include/sun/fbio.h */ screen_info (screen_name, type, height, width, depth, cmsize, size) char *screen_name; int *type, *width, *height, *depth, *cmsize, *size; { int screen_fd; int stat; struct fbtype fb; screen_fd = open (screen_name, O_RDWR, 0); if (screen_fd < 0) { perror ("screen_info: Open on framebuffer failed"); return 0; } stat = ioctl (screen_fd, FBIOGTYPE, &fb); if (stat < 0) { perror ("screen_info: ioctl on framebuffer failed"); close (screen_fd); return 0; } close (screen_fd); *type = fb.fb_type; *width = fb.fb_width; *height = fb.fb_height; *depth = fb.fb_depth; *cmsize = fb.fb_cmsize; /* colormap size */ *size = fb.fb_size; /* ?? */ return 1; } --