please dont rip this site

language ccpp cref X_EXAMPLES hardware

/ ************************************************************************
 *
 * Purpose: Program extracts information from the X server and displays
 *          it on the screen.
 *
 * Notes:   Use the following command to compile. 
 *
 *                      gcc hardware.c -lX11
 *
 * Author:  M.J. Leslie
 *
 * Date:    26-Mar-95
 *
 ************************************************************************/

/****************** Includes ********************************************/
				/* These are in /usr/X386		*/
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>

#include <stdio.h>

main()
{
  Display * display;
  int       screen;
  char *    display_name=NULL;
  Window    root;
  Visual*   visual;

  /* Connect to X display server.		*/
  display=XOpenDisplay(display_name);

  /* Get screen ID			*/
  screen=DefaultScreen(display);


  printf("\n\tInformation extracted from the X server\n");
  printf("\t---------------------------------------\n\n");

  printf(" X server by \'%s\'\n",        ServerVendor(display));

  printf(" X Server protocol %d\n",      ProtocolVersion(display));

  printf(" X server Release %d\n",       VendorRelease(display));

  printf(" Screen is %dmm high.\n",      DisplayHeightMM(display, screen));

  printf(" Screen is %dmm wide.\n",      DisplayWidthMM(display, screen));

  printf(" Screen is %d pixels high.\n", DisplayHeight(display, screen));

  printf(" Screen is %d pixels wide.\n", DisplayWidth(display, screen));

  visual = DefaultVisual(display,screen);
  printf(" %3d Colour map entries", visual->map_entries);
  printf(" (Number of colours on the screen at one time).\n");

  printf(" %3d Display planes (bits per screen pixel).\n", DisplayPlanes(display, screen));

  printf(" There is %d screen(s).\n", ScreenCount (display));
}

file: /Techref/language/ccpp/cref/X_EXAMPLES/hardware.c, 1KB, , updated: 1997/5/21 14:07, local time: 2012/5/25 05:28,
TOP NEW HELP FIND: 
38.107.179.234:LOG IN

 ©2012 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE! / 

<A HREF="http://www.piclist.com/techref/language/ccpp/cref/X_EXAMPLES/hardware.c"> language ccpp cref X_EXAMPLES hardware</A>

Did you find what you needed?

 
The PICList mailing list is hosted by MIT and we GRATEFULLY ACKNOWLEDGE the huge bandwidth and server load they sholder for us. If you want this list to continue, please consider contributing to MIT... Every little bit helps them educate the worlds finest minds and justify their expense in running the PICList mailing list.
  'What can I do?' - SiCKO

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .