[comp.windows.x] X11 fix #41, clients/bitmap/bitmap.c, invert in color

RWS@ZERMATT.LCS.MIT.EDU (Robert Scheifler) (10/30/87)

VERSION:
	X11 release 1
DESCRIPTION:
	bitmap had a wrong assumption about the relationship
	between BlackPixel() and WhitePixel().
REPEAT-BY:
	try invert on some color displays
FIX:
	includes some lint cleanups

*** /tmp/,RCSt1008153	Fri Oct 30 14:27:09 1987
--- clients/bitmap/bitmap.c	Fri Oct 30 14:14:10 1987
***************
*** 1,5 ****
  #ifndef lint
! static char *rcsid_bitmap_c = "$Header: bitmap.c,v 1.14 87/09/23 09:30:32 rws Exp $";
  #endif
  
  #include <errno.h>
--- 1,5 ----
  #ifndef lint
! static char *rcsid_bitmap_c = "$Header: bitmap.c,v 1.15 87/10/30 14:11:30 newman Exp $";
  #endif
  
  #include <errno.h>
***************
*** 48,54 ****
  unsigned long background; /* pixel */
  unsigned long border;     /* pixel */
  int borderwidth = 3;
! int invertplane = 1;
  static int highlightplane = 1;
  
  static XImage image = {
--- 48,54 ----
  unsigned long background; /* pixel */
  unsigned long border;     /* pixel */
  int borderwidth = 3;
! int invertplane;
  static int highlightplane = 1;
  
  static XImage image = {
***************
*** 275,281 ****
    {
    char *StripName(), *BackupName(), *index();
    char *option;
-   FILE *file;
    char *geometry = NULL, *host = NULL, *dimensions = NULL;
    int i;
    int status;
--- 275,280 ----
***************
*** 306,312 ****
    stripped_name = StripName (filename);
    backup_filename = BackupName (filename);
  
!   status = ReadBitmapFile(filename, image, &x_hot_spot, &y_hot_spot);
    if (status == BitmapFileInvalid) {
        fprintf(stderr, "Bitmap file invalid\n");
        exit (1);
--- 305,311 ----
    stripped_name = StripName (filename);
    backup_filename = BackupName (filename);
  
!   status = ReadBitmapFile(filename);
    if (status == BitmapFileInvalid) {
        fprintf(stderr, "Bitmap file invalid\n");
        exit (1);
***************
*** 364,369 ****
--- 363,369 ----
  
    foreground = border = BlackPixel (d, screen);
    background = WhitePixel (d, screen);
+   invertplane = foreground ^ background;
  
    if (DisplayCells(d, screen) > 2) {
      Colormap cmap = DefaultColormap (d, screen);
***************
*** 901,914 ****
    }
    }
  
- /* StringEndsWith returns TRUE if "s" ends with "suffix", else returns FALSE */
- boolean StringEndsWith (s, suffix)
-   char *s, *suffix;
-   {
-   int s_len = strlen (s);
-   int suffix_len = strlen (suffix);
-   return (strcmp (s + s_len - suffix_len, suffix) == 0);
-   }
  
  /* LayoutStage1 creates the grid window, all commmand windows and both
     raster windows.
--- 901,906 ----