emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/xfns.c


From: Ken Raeburn
Subject: [Emacs-diffs] Changes to emacs/src/xfns.c
Date: Sun, 14 Jul 2002 20:01:02 -0400

Index: emacs/src/xfns.c
diff -c emacs/src/xfns.c:1.552 emacs/src/xfns.c:1.553
*** emacs/src/xfns.c:1.552      Thu Jul 11 11:23:58 2002
--- emacs/src/xfns.c    Sun Jul 14 20:00:38 2002
***************
*** 636,642 ****
      {
        if (dpyinfo->bitmaps[id].refcount
          && dpyinfo->bitmaps[id].file
!         && !strcmp (dpyinfo->bitmaps[id].file, (char *) XSTRING (file)->data))
        {
          ++dpyinfo->bitmaps[id].refcount;
          return id + 1;
--- 636,642 ----
      {
        if (dpyinfo->bitmaps[id].refcount
          && dpyinfo->bitmaps[id].file
!         && !strcmp (dpyinfo->bitmaps[id].file, (char *) SDATA (file)))
        {
          ++dpyinfo->bitmaps[id].refcount;
          return id + 1;
***************
*** 649,655 ****
      return -1;
    emacs_close (fd);
  
!   filename = (char *) XSTRING (found)->data;
  
    result = XReadBitmapFile (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
                            filename, &width, &height, &bitmap, &xhot, &yhot);
--- 649,655 ----
      return -1;
    emacs_close (fd);
  
!   filename = (char *) SDATA (found);
  
    result = XReadBitmapFile (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
                            filename, &width, &height, &bitmap, &xhot, &yhot);
***************
*** 660,670 ****
    dpyinfo->bitmaps[id - 1].pixmap = bitmap;
    dpyinfo->bitmaps[id - 1].refcount = 1;
    dpyinfo->bitmaps[id - 1].file
!     = (char *) xmalloc (STRING_BYTES (XSTRING (file)) + 1);
    dpyinfo->bitmaps[id - 1].depth = 1;
    dpyinfo->bitmaps[id - 1].height = height;
    dpyinfo->bitmaps[id - 1].width = width;
!   strcpy (dpyinfo->bitmaps[id - 1].file, XSTRING (file)->data);
  
    return id;
  }
--- 660,670 ----
    dpyinfo->bitmaps[id - 1].pixmap = bitmap;
    dpyinfo->bitmaps[id - 1].refcount = 1;
    dpyinfo->bitmaps[id - 1].file
!     = (char *) xmalloc (SBYTES (file) + 1);
    dpyinfo->bitmaps[id - 1].depth = 1;
    dpyinfo->bitmaps[id - 1].height = height;
    dpyinfo->bitmaps[id - 1].width = width;
!   strcpy (dpyinfo->bitmaps[id - 1].file, SDATA (file));
  
    return id;
  }
***************
*** 1385,1393 ****
  #if 0 /* Don't do this.  It's wrong when we're not using the default
         colormap, it makes freeing difficult, and it's probably not
         an important optimization.  */
!   if (strcmp (XSTRING (color_name)->data, "black") == 0)
      return BLACK_PIX_DEFAULT (f);
!   else if (strcmp (XSTRING (color_name)->data, "white") == 0)
      return WHITE_PIX_DEFAULT (f);
  #endif
  
--- 1385,1393 ----
  #if 0 /* Don't do this.  It's wrong when we're not using the default
         colormap, it makes freeing difficult, and it's probably not
         an important optimization.  */
!   if (strcmp (SDATA (color_name), "black") == 0)
      return BLACK_PIX_DEFAULT (f);
!   else if (strcmp (SDATA (color_name), "white") == 0)
      return WHITE_PIX_DEFAULT (f);
  #endif
  
***************
*** 1397,1403 ****
  
    /* x_defined_color is responsible for coping with failures
       by looking for a near-miss.  */
!   if (x_defined_color (f, XSTRING (color_name)->data, &cdef, 1))
      return cdef.pixel;
  
    Fsignal (Qerror, Fcons (build_string ("Undefined color"),
--- 1397,1403 ----
  
    /* x_defined_color is responsible for coping with failures
       by looking for a near-miss.  */
!   if (x_defined_color (f, SDATA (color_name), &cdef, 1))
      return cdef.pixel;
  
    Fsignal (Qerror, Fcons (build_string ("Undefined color"),
***************
*** 1914,1922 ****
    BLOCK_INPUT;
    if (NILP (arg))
      result = x_text_icon (f,
!                         (char *) XSTRING ((!NILP (f->icon_name)
                                             ? f->icon_name
!                                            : f->name))->data);
    else
      result = x_bitmap_icon (f, arg);
  
--- 1914,1922 ----
    BLOCK_INPUT;
    if (NILP (arg))
      result = x_text_icon (f,
!                         (char *) SDATA ((!NILP (f->icon_name)
                                             ? f->icon_name
!                                            : f->name)));
    else
      result = x_bitmap_icon (f, arg);
  
***************
*** 1968,1978 ****
    BLOCK_INPUT;
  
    result = x_text_icon (f,
!                       (char *) XSTRING ((!NILP (f->icon_name)
!                                          ? f->icon_name
!                                          : !NILP (f->title)
!                                          ? f->title
!                                          : f->name))->data);
  
    if (result)
      {
--- 1968,1978 ----
    BLOCK_INPUT;
  
    result = x_text_icon (f,
!                       (char *) SDATA ((!NILP (f->icon_name)
!                                        ? f->icon_name
!                                        : !NILP (f->title)
!                                        ? f->title
!                                        : f->name)));
  
    if (result)
      {
***************
*** 2000,2011 ****
  
    BLOCK_INPUT;
    result = (STRINGP (fontset_name)
!           ? x_new_fontset (f, XSTRING (fontset_name)->data)
!           : x_new_font (f, XSTRING (arg)->data));
    UNBLOCK_INPUT;
    
    if (EQ (result, Qnil))
!     error ("Font `%s' is not defined", XSTRING (arg)->data);
    else if (EQ (result, Qt))
      error ("The characters of the given font have varying widths");
    else if (STRINGP (result))
--- 2000,2011 ----
  
    BLOCK_INPUT;
    result = (STRINGP (fontset_name)
!           ? x_new_fontset (f, SDATA (fontset_name))
!           : x_new_font (f, SDATA (arg)));
    UNBLOCK_INPUT;
    
    if (EQ (result, Qnil))
!     error ("Font `%s' is not defined", SDATA (arg));
    else if (EQ (result, Qt))
      error ("The characters of the given font have varying widths");
    else if (STRINGP (result))
***************
*** 2375,2383 ****
       int *text_bytes, *stringp;
       int selectionp;
  {
!   unsigned char *str = XSTRING (string)->data;
!   int chars = XSTRING (string)->size;
!   int bytes = STRING_BYTES (XSTRING (string));
    int charset_info;
    int bufsize;
    unsigned char *buf;
--- 2375,2383 ----
       int *text_bytes, *stringp;
       int selectionp;
  {
!   unsigned char *str = SDATA (string);
!   int chars = SCHARS (string);
!   int bytes = SBYTES (string);
    int charset_info;
    int bufsize;
    unsigned char *buf;
***************
*** 2399,2407 ****
        && !NILP (Ffboundp (coding.pre_write_conversion)))
      {
        string = run_pre_post_conversion_on_str (string, &coding, 1);
!       str = XSTRING (string)->data;
!       chars = XSTRING (string)->size;
!       bytes = STRING_BYTES (XSTRING (string));
      }
    coding.src_multibyte = 1;
    coding.dst_multibyte = 0;
--- 2399,2407 ----
        && !NILP (Ffboundp (coding.pre_write_conversion)))
      {
        string = run_pre_post_conversion_on_str (string, &coding, 1);
!       str = SDATA (string);
!       chars = SCHARS (string);
!       bytes = SBYTES (string);
      }
    coding.src_multibyte = 1;
    coding.dst_multibyte = 0;
***************
*** 2458,2464 ****
        /* Check for no change needed in this very common case
         before we do any consing.  */
        if (!strcmp (FRAME_X_DISPLAY_INFO (f)->x_id_name,
!                  XSTRING (f->name)->data))
        return;
        name = build_string (FRAME_X_DISPLAY_INFO (f)->x_id_name);
      }
--- 2458,2464 ----
        /* Check for no change needed in this very common case
         before we do any consing.  */
        if (!strcmp (FRAME_X_DISPLAY_INFO (f)->x_id_name,
!                  SDATA (f->name)))
        return;
        name = build_string (FRAME_X_DISPLAY_INFO (f)->x_id_name);
      }
***************
*** 2517,2532 ****
        XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &icon);
  #endif /* not USE_X_TOOLKIT */
        if (!NILP (f->icon_name)
!           && icon.value != XSTRING (f->icon_name)->data)
          xfree (icon.value);
!       if (text.value != XSTRING (name)->data)
          xfree (text.value);
        }
  #else /* not HAVE_X11R4 */
        XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
!                   XSTRING (name)->data);
        XStoreName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
!                 XSTRING (name)->data);
  #endif /* not HAVE_X11R4 */
        UNBLOCK_INPUT;
      }
--- 2517,2532 ----
        XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &icon);
  #endif /* not USE_X_TOOLKIT */
        if (!NILP (f->icon_name)
!           && icon.value != SDATA (f->icon_name))
          xfree (icon.value);
!       if (text.value != SDATA (name))
          xfree (text.value);
        }
  #else /* not HAVE_X11R4 */
        XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
!                   SDATA (name));
        XStoreName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
!                 SDATA (name));
  #endif /* not HAVE_X11R4 */
        UNBLOCK_INPUT;
      }
***************
*** 2624,2639 ****
        XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &icon);
  #endif /* not USE_X_TOOLKIT */
        if (!NILP (f->icon_name)
!           && icon.value != XSTRING (f->icon_name)->data)
          xfree (icon.value);
!       if (text.value != XSTRING (name)->data)
          xfree (text.value);
        }
  #else /* not HAVE_X11R4 */
        XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
!                   XSTRING (name)->data);
        XStoreName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
!                 XSTRING (name)->data);
  #endif /* not HAVE_X11R4 */
        UNBLOCK_INPUT;
      }
--- 2624,2639 ----
        XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &icon);
  #endif /* not USE_X_TOOLKIT */
        if (!NILP (f->icon_name)
!           && icon.value != SDATA (f->icon_name))
          xfree (icon.value);
!       if (text.value != SDATA (name))
          xfree (text.value);
        }
  #else /* not HAVE_X11R4 */
        XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
!                   SDATA (name));
        XStoreName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
!                 SDATA (name));
  #endif /* not HAVE_X11R4 */
        UNBLOCK_INPUT;
      }
***************
*** 2758,2767 ****
  
    if (STRINGP (Vx_resource_name))
      {
!       unsigned char *p = XSTRING (Vx_resource_name)->data;
        int i;
  
!       len = STRING_BYTES (XSTRING (Vx_resource_name));
  
        /* Only letters, digits, - and _ are valid in resource names.
         Count the valid characters and count the invalid ones.  */
--- 2758,2767 ----
  
    if (STRINGP (Vx_resource_name))
      {
!       unsigned char *p = SDATA (Vx_resource_name);
        int i;
  
!       len = SBYTES (Vx_resource_name);
  
        /* Only letters, digits, - and _ are valid in resource names.
         Count the valid characters and count the invalid ones.  */
***************
*** 2800,2811 ****
  
    for (i = 0; i < len; i++)
      {
!       int c = XSTRING (new)->data[i];
        if (! ((c >= 'a' && c <= 'z')
             || (c >= 'A' && c <= 'Z')
             || (c >= '0' && c <= '9')
             || c == '-' || c == '_'))
!       XSTRING (new)->data[i] = '_';
      }
  }
  
--- 2800,2811 ----
  
    for (i = 0; i < len; i++)
      {
!       int c = SREF (new, i);
        if (! ((c >= 'a' && c <= 'z')
             || (c >= 'A' && c <= 'Z')
             || (c >= '0' && c <= '9')
             || c == '-' || c == '_'))
!       SREF (new, i) = '_';
      }
  }
  
***************
*** 2845,2881 ****
  
    /* Allocate space for the components, the dots which separate them,
       and the final '\0'.  Make them big enough for the worst case.  */
!   name_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_name))
                              + (STRINGP (component)
!                                ? STRING_BYTES (XSTRING (component)) : 0)
!                             + STRING_BYTES (XSTRING (attribute))
                              + 3);
  
!   class_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_class))
!                              + STRING_BYTES (XSTRING (class))
                               + (STRINGP (subclass)
!                                 ? STRING_BYTES (XSTRING (subclass)) : 0)
                               + 3);
  
    /* Start with emacs.FRAMENAME for the name (the specific one)
       and with `Emacs' for the class key (the general one).  */
!   strcpy (name_key, XSTRING (Vx_resource_name)->data);
!   strcpy (class_key, XSTRING (Vx_resource_class)->data);
  
    strcat (class_key, ".");
!   strcat (class_key, XSTRING (class)->data);
  
    if (!NILP (component))
      {
        strcat (class_key, ".");
!       strcat (class_key, XSTRING (subclass)->data);
  
        strcat (name_key, ".");
!       strcat (name_key, XSTRING (component)->data);
      }
  
    strcat (name_key, ".");
!   strcat (name_key, XSTRING (attribute)->data);
  
    value = x_get_string_resource (check_x_display_info (Qnil)->xrdb,
                                 name_key, class_key);
--- 2845,2881 ----
  
    /* Allocate space for the components, the dots which separate them,
       and the final '\0'.  Make them big enough for the worst case.  */
!   name_key = (char *) alloca (SBYTES (Vx_resource_name)
                              + (STRINGP (component)
!                                ? SBYTES (component) : 0)
!                             + SBYTES (attribute)
                              + 3);
  
!   class_key = (char *) alloca (SBYTES (Vx_resource_class)
!                              + SBYTES (class)
                               + (STRINGP (subclass)
!                                 ? SBYTES (subclass) : 0)
                               + 3);
  
    /* Start with emacs.FRAMENAME for the name (the specific one)
       and with `Emacs' for the class key (the general one).  */
!   strcpy (name_key, SDATA (Vx_resource_name));
!   strcpy (class_key, SDATA (Vx_resource_class));
  
    strcat (class_key, ".");
!   strcat (class_key, SDATA (class));
  
    if (!NILP (component))
      {
        strcat (class_key, ".");
!       strcat (class_key, SDATA (subclass));
  
        strcat (name_key, ".");
!       strcat (name_key, SDATA (component));
      }
  
    strcat (name_key, ".");
!   strcat (name_key, SDATA (attribute));
  
    value = x_get_string_resource (check_x_display_info (Qnil)->xrdb,
                                 name_key, class_key);
***************
*** 2911,2947 ****
  
    /* Allocate space for the components, the dots which separate them,
       and the final '\0'.  Make them big enough for the worst case.  */
!   name_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_name))
                              + (STRINGP (component)
!                                ? STRING_BYTES (XSTRING (component)) : 0)
!                             + STRING_BYTES (XSTRING (attribute))
                              + 3);
  
!   class_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_class))
!                              + STRING_BYTES (XSTRING (class))
                               + (STRINGP (subclass)
!                                 ? STRING_BYTES (XSTRING (subclass)) : 0)
                               + 3);
  
    /* Start with emacs.FRAMENAME for the name (the specific one)
       and with `Emacs' for the class key (the general one).  */
!   strcpy (name_key, XSTRING (Vx_resource_name)->data);
!   strcpy (class_key, XSTRING (Vx_resource_class)->data);
  
    strcat (class_key, ".");
!   strcat (class_key, XSTRING (class)->data);
  
    if (!NILP (component))
      {
        strcat (class_key, ".");
!       strcat (class_key, XSTRING (subclass)->data);
  
        strcat (name_key, ".");
!       strcat (name_key, XSTRING (component)->data);
      }
  
    strcat (name_key, ".");
!   strcat (name_key, XSTRING (attribute)->data);
  
    value = x_get_string_resource (dpyinfo->xrdb, name_key, class_key);
  
--- 2911,2947 ----
  
    /* Allocate space for the components, the dots which separate them,
       and the final '\0'.  Make them big enough for the worst case.  */
!   name_key = (char *) alloca (SBYTES (Vx_resource_name)
                              + (STRINGP (component)
!                                ? SBYTES (component) : 0)
!                             + SBYTES (attribute)
                              + 3);
  
!   class_key = (char *) alloca (SBYTES (Vx_resource_class)
!                              + SBYTES (class)
                               + (STRINGP (subclass)
!                                 ? SBYTES (subclass) : 0)
                               + 3);
  
    /* Start with emacs.FRAMENAME for the name (the specific one)
       and with `Emacs' for the class key (the general one).  */
!   strcpy (name_key, SDATA (Vx_resource_name));
!   strcpy (class_key, SDATA (Vx_resource_class));
  
    strcat (class_key, ".");
!   strcat (class_key, SDATA (class));
  
    if (!NILP (component))
      {
        strcat (class_key, ".");
!       strcat (class_key, SDATA (subclass));
  
        strcat (name_key, ".");
!       strcat (name_key, SDATA (component));
      }
  
    strcat (name_key, ".");
!   strcat (name_key, SDATA (attribute));
  
    value = x_get_string_resource (dpyinfo->xrdb, name_key, class_key);
  
***************
*** 2963,2975 ****
  
    /* Allocate space for the components, the dots which separate them,
       and the final '\0'.  */
!   name_key = (char *) alloca (STRING_BYTES (XSTRING (Vinvocation_name))
                              + strlen (attribute) + 2);
    class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1)
                               + strlen (class) + 2);
  
    sprintf (name_key, "%s.%s",
!          XSTRING (Vinvocation_name)->data,
           attribute);
    sprintf (class_key, "%s.%s", EMACS_CLASS, class);
  
--- 2963,2975 ----
  
    /* Allocate space for the components, the dots which separate them,
       and the final '\0'.  */
!   name_key = (char *) alloca (SBYTES (Vinvocation_name)
                              + strlen (attribute) + 2);
    class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1)
                               + strlen (class) + 2);
  
    sprintf (name_key, "%s.%s",
!          SDATA (Vinvocation_name),
           attribute);
    sprintf (class_key, "%s.%s", EMACS_CLASS, class);
  
***************
*** 3027,3041 ****
          switch (type)
            {
            case RES_TYPE_NUMBER:
!             return make_number (atoi (XSTRING (tem)->data));
  
            case RES_TYPE_FLOAT:
!             return make_float (atof (XSTRING (tem)->data));
  
            case RES_TYPE_BOOLEAN:
              tem = Fdowncase (tem);
!             if (!strcmp (XSTRING (tem)->data, "on")
!                 || !strcmp (XSTRING (tem)->data, "true"))
                return Qt;
              else 
                return Qnil;
--- 3027,3041 ----
          switch (type)
            {
            case RES_TYPE_NUMBER:
!             return make_number (atoi (SDATA (tem)));
  
            case RES_TYPE_FLOAT:
!             return make_float (atof (SDATA (tem)));
  
            case RES_TYPE_BOOLEAN:
              tem = Fdowncase (tem);
!             if (!strcmp (SDATA (tem), "on")
!                 || !strcmp (SDATA (tem), "true"))
                return Qt;
              else 
                return Qnil;
***************
*** 3049,3059 ****
              {
                Lisp_Object lower;
                lower = Fdowncase (tem);
!               if (!strcmp (XSTRING (lower)->data, "on")
!                   || !strcmp (XSTRING (lower)->data, "true"))
                  return Qt;
!               else if (!strcmp (XSTRING (lower)->data, "off")
!                     || !strcmp (XSTRING (lower)->data, "false"))
                  return Qnil;
                else
                  return Fintern (tem, Qnil);
--- 3049,3059 ----
              {
                Lisp_Object lower;
                lower = Fdowncase (tem);
!               if (!strcmp (SDATA (lower), "on")
!                   || !strcmp (SDATA (lower), "true"))
                  return Qt;
!               else if (!strcmp (SDATA (lower), "off")
!                     || !strcmp (SDATA (lower), "false"))
                  return Qnil;
                else
                  return Fintern (tem, Qnil);
***************
*** 3186,3192 ****
  
    CHECK_STRING (string);
  
!   geometry = XParseGeometry ((char *) XSTRING (string)->data,
                             &x, &y, &width, &height);
  
  #if 0
--- 3186,3192 ----
  
    CHECK_STRING (string);
  
!   geometry = XParseGeometry ((char *) SDATA (string),
                             &x, &y, &width, &height);
  
  #if 0
***************
*** 3559,3565 ****
        {
          /* Determine the base fontname from the ASCII font name of
             FONTSET.  */
!         char *ascii_font = (char *) XSTRING (fontset_ascii (fontset))->data;
          char *p = ascii_font;
          int i;
  
--- 3559,3565 ----
        {
          /* Determine the base fontname from the ASCII font name of
             FONTSET.  */
!         char *ascii_font = (char *) SDATA (fontset_ascii (fontset));
          char *p = ascii_font;
          int i;
  
***************
*** 3780,3786 ****
       Elsewhere we specify the window name for the window manager.  */
       
    {
!     char *str = (char *) XSTRING (Vx_resource_name)->data;
      f->namebuf = (char *) xmalloc (strlen (str) + 1);
      strcpy (f->namebuf, str);
    }
--- 3780,3786 ----
       Elsewhere we specify the window name for the window manager.  */
       
    {
!     char *str = (char *) SDATA (Vx_resource_name);
      f->namebuf = (char *) xmalloc (strlen (str) + 1);
      strcpy (f->namebuf, str);
    }
***************
*** 3913,3920 ****
  
    validate_x_resource_name ();
  
!   class_hints.res_name = (char *) XSTRING (Vx_resource_name)->data;
!   class_hints.res_class = (char *) XSTRING (Vx_resource_class)->data;
    XSetClassHint (FRAME_X_DISPLAY (f), XtWindow (shell_widget), &class_hints);
  
  #ifdef HAVE_X_I18N
--- 3913,3920 ----
  
    validate_x_resource_name ();
  
!   class_hints.res_name = (char *) SDATA (Vx_resource_name);
!   class_hints.res_class = (char *) SDATA (Vx_resource_class);
    XSetClassHint (FRAME_X_DISPLAY (f), XtWindow (shell_widget), &class_hints);
  
  #ifdef HAVE_X_I18N
***************
*** 4041,4048 ****
    
    validate_x_resource_name ();
  
!   class_hints.res_name = (char *) XSTRING (Vx_resource_name)->data;
!   class_hints.res_class = (char *) XSTRING (Vx_resource_class)->data;
    XSetClassHint (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &class_hints);
  
    /* The menubar is part of the ordinary display;
--- 4041,4048 ----
    
    validate_x_resource_name ();
  
!   class_hints.res_name = (char *) SDATA (Vx_resource_name);
!   class_hints.res_class = (char *) SDATA (Vx_resource_class);
    XSetClassHint (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &class_hints);
  
    /* The menubar is part of the ordinary display;
***************
*** 4129,4137 ****
         ? IconicState
         : NormalState));
  
!   x_text_icon (f, (char *) XSTRING ((!NILP (f->icon_name)
                                     ? f->icon_name
!                                    : f->name))->data);
  
    UNBLOCK_INPUT;
  }
--- 4129,4137 ----
         ? IconicState
         : NormalState));
  
!   x_text_icon (f, (char *) SDATA ((!NILP (f->icon_name)
                                     ? f->icon_name
!                                    : f->name)));
  
    UNBLOCK_INPUT;
  }
***************
*** 4464,4472 ****
        {
        tem = Fquery_fontset (font, Qnil);
        if (STRINGP (tem))
!         font = x_new_fontset (f, XSTRING (tem)->data);
        else
!         font = x_new_font (f, XSTRING (font)->data);
        }
      
      /* Try out a font which we hope has bold and italic variations.  */
--- 4464,4472 ----
        {
        tem = Fquery_fontset (font, Qnil);
        if (STRINGP (tem))
!         font = x_new_fontset (f, SDATA (tem));
        else
!         font = x_new_font (f, SDATA (font));
        }
      
      /* Try out a font which we hope has bold and italic variations.  */
***************
*** 4780,4786 ****
  
    CHECK_STRING (color);
  
!   if (x_defined_color (f, XSTRING (color)->data, &foo, 0))
      return Qt;
    else
      return Qnil;
--- 4780,4786 ----
  
    CHECK_STRING (color);
  
!   if (x_defined_color (f, SDATA (color), &foo, 0))
      return Qt;
    else
      return Qnil;
***************
*** 4796,4802 ****
  
    CHECK_STRING (color);
  
!   if (x_defined_color (f, XSTRING (color)->data, &foo, 0))
      {
        Lisp_Object rgb[3];
  
--- 4796,4802 ----
  
    CHECK_STRING (color);
  
!   if (x_defined_color (f, SDATA (color), &foo, 0))
      {
        Lisp_Object rgb[3];
  
***************
*** 5207,5218 ****
        /* VALUE should be of the form CLASS-DEPTH, where CLASS is one
         of `PseudoColor', `TrueColor' etc. and DEPTH is the color
         depth, a decimal number.  NAME is compared with case ignored.  */
!       char *s = (char *) alloca (STRING_BYTES (XSTRING (value)) + 1);
        char *dash;
        int i, class = -1;
        XVisualInfo vinfo;
  
!       strcpy (s, XSTRING (value)->data);
        dash = index (s, '-');
        if (dash)
        {
--- 5207,5218 ----
        /* VALUE should be of the form CLASS-DEPTH, where CLASS is one
         of `PseudoColor', `TrueColor' etc. and DEPTH is the color
         depth, a decimal number.  NAME is compared with case ignored.  */
!       char *s = (char *) alloca (SBYTES (value) + 1);
        char *dash;
        int i, class = -1;
        XVisualInfo vinfo;
  
!       strcpy (s, SDATA (value));
        dash = index (s, '-');
        if (dash)
        {
***************
*** 5236,5242 ****
        if (class == -1
          || !XMatchVisualInfo (dpy, XScreenNumberOfScreen (screen),
                                dpyinfo->n_planes, class, &vinfo))
!       fatal ("Invalid visual specification `%s'", XSTRING (value)->data);
        
        dpyinfo->visual = vinfo.visual;
      }
--- 5236,5242 ----
        if (class == -1
          || !XMatchVisualInfo (dpy, XScreenNumberOfScreen (screen),
                                dpyinfo->n_planes, class, &vinfo))
!       fatal ("Invalid visual specification `%s'", SDATA (value));
        
        dpyinfo->visual = vinfo.visual;
      }
***************
*** 5295,5304 ****
    validate_x_resource_name ();
  
    dpyinfo = x_term_init (name, (char *)0,
!                        (char *) XSTRING (Vx_resource_name)->data);
  
    if (dpyinfo == 0)
!     error ("Cannot connect to X server %s", XSTRING (name)->data);
  
    x_in_use = 1;
    XSETFASTINT (Vwindow_system_version, 11);
--- 5295,5304 ----
    validate_x_resource_name ();
  
    dpyinfo = x_term_init (name, (char *)0,
!                        (char *) SDATA (Vx_resource_name));
  
    if (dpyinfo == 0)
!     error ("Cannot connect to X server %s", SDATA (name));
  
    x_in_use = 1;
    XSETFASTINT (Vwindow_system_version, 11);
***************
*** 5328,5334 ****
      error ("Not using X Windows");
  
    if (! NILP (xrm_string))
!     xrm_option = (unsigned char *) XSTRING (xrm_string)->data;
    else
      xrm_option = (unsigned char *) 0;
  
--- 5328,5334 ----
      error ("Not using X Windows");
  
    if (! NILP (xrm_string))
!     xrm_option = (unsigned char *) SDATA (xrm_string);
    else
      xrm_option = (unsigned char *) 0;
  
***************
*** 5337,5343 ****
    /* This is what opens the connection and sets x_current_display.
       This also initializes many symbols, such as those used for input.  */
    dpyinfo = x_term_init (display, xrm_option,
!                        (char *) XSTRING (Vx_resource_name)->data);
  
    if (dpyinfo == 0)
      {
--- 5337,5343 ----
    /* This is what opens the connection and sets x_current_display.
       This also initializes many symbols, such as those used for input.  */
    dpyinfo = x_term_init (display, xrm_option,
!                        (char *) SDATA (Vx_resource_name));
  
    if (dpyinfo == 0)
      {
***************
*** 5346,5354 ****
  Check the DISPLAY environment variable or use `-d'.\n\
  Also use the `xhost' program to verify that it is set to permit\n\
  connections from your machine.\n",
!              XSTRING (display)->data);
        else
!       error ("Cannot connect to X server %s", XSTRING (display)->data);
      }
  
    x_in_use = 1;
--- 5346,5354 ----
  Check the DISPLAY environment variable or use `-d'.\n\
  Also use the `xhost' program to verify that it is set to permit\n\
  connections from your machine.\n",
!              SDATA (display));
        else
!       error ("Cannot connect to X server %s", SDATA (display));
      }
  
    x_in_use = 1;
***************
*** 5662,5668 ****
  
        /* Find key in KEYWORDS.  Error if not found.  */
        for (i = 0; i < nkeywords; ++i)
!       if (strcmp (keywords[i].name, XSTRING (SYMBOL_NAME (key))->data) == 0)
          break;
  
        if (i == nkeywords)
--- 5662,5668 ----
  
        /* Find key in KEYWORDS.  Error if not found.  */
        for (i = 0; i < nkeywords; ++i)
!       if (strcmp (keywords[i].name, SDATA (SYMBOL_NAME (key))) == 0)
          break;
  
        if (i == nkeywords)
***************
*** 6142,6148 ****
  
    xassert (STRINGP (color_name));
  
!   if (x_defined_color (f, XSTRING (color_name)->data, &color, 1))
      {
        /* This isn't called frequently so we get away with simply
         reallocating the color vector to the needed size, here.  */
--- 6142,6148 ----
  
    xassert (STRINGP (color_name));
  
!   if (x_defined_color (f, SDATA (color_name), &color, 1))
      {
        /* This isn't called frequently so we get away with simply
         reallocating the color vector to the needed size, here.  */
***************
*** 6880,6886 ****
  
              if (STRINGP (elt))
                {
!                 if (XSTRING (elt)->size
                      < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR)
                    return 0;
                }
--- 6880,6886 ----
  
              if (STRINGP (elt))
                {
!                 if (SCHARS (elt)
                      < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR)
                    return 0;
                }
***************
*** 6895,6901 ****
        }
        else if (STRINGP (data))
        {
!         if (XSTRING (data)->size
              < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR * height)
            return 0;
        }
--- 6895,6901 ----
        }
        else if (STRINGP (data))
        {
!         if (SCHARS (data)
              < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR * height)
            return 0;
        }
***************
*** 7225,7233 ****
  {
    int w, h;
    return (STRINGP (data)
!         && xbm_read_bitmap_data (XSTRING (data)->data,
!                                  (XSTRING (data)->data
!                                   + STRING_BYTES (XSTRING (data))),
                                   &w, &h, NULL));
  }
  
--- 7225,7233 ----
  {
    int w, h;
    return (STRINGP (data)
!         && xbm_read_bitmap_data (SDATA (data),
!                                  (SDATA (data)
!                                   + SBYTES (data)),
                                   &w, &h, NULL));
  }
  
***************
*** 7263,7269 ****
          return 0;
        }
  
!       contents = slurp_file (XSTRING (file)->data, &size);
        if (contents == NULL)
        {
          image_error ("Error loading XBM image `%s'", img->spec, Qnil);
--- 7263,7269 ----
          return 0;
        }
  
!       contents = slurp_file (SDATA (file), &size);
        if (contents == NULL)
        {
          image_error ("Error loading XBM image `%s'", img->spec, Qnil);
***************
*** 7313,7321 ****
                                          background);
  
        if (in_memory_file_p)
!       success_p = xbm_load_image (f, img, XSTRING (data)->data,
!                                   (XSTRING (data)->data
!                                    + STRING_BYTES (XSTRING (data))));
        else
        {
          if (VECTORP (data))
--- 7313,7321 ----
                                          background);
  
        if (in_memory_file_p)
!       success_p = xbm_load_image (f, img, SDATA (data),
!                                   (SDATA (data)
!                                    + SBYTES (data)));
        else
        {
          if (VECTORP (data))
***************
*** 7329,7341 ****
                {
                  Lisp_Object line = XVECTOR (data)->contents[i];
                  if (STRINGP (line))
!                   bcopy (XSTRING (line)->data, p, nbytes);
                  else
                    bcopy (XBOOL_VECTOR (line)->data, p, nbytes);
                }
            }
          else if (STRINGP (data))
!           bits = XSTRING (data)->data;
          else
            bits = XBOOL_VECTOR (data)->data;
  
--- 7329,7341 ----
                {
                  Lisp_Object line = XVECTOR (data)->contents[i];
                  if (STRINGP (line))
!                   bcopy (SDATA (line), p, nbytes);
                  else
                    bcopy (XBOOL_VECTOR (line)->data, p, nbytes);
                }
            }
          else if (STRINGP (data))
!           bits = SDATA (data);
          else
            bits = XBOOL_VECTOR (data)->data;
  
***************
*** 7737,7746 ****
        {
          Lisp_Object name = XCAR (XCAR (tail));
          Lisp_Object color = XCDR (XCAR (tail));
!         xpm_syms[i].name = (char *) alloca (XSTRING (name)->size + 1);
!         strcpy (xpm_syms[i].name, XSTRING (name)->data);
!         xpm_syms[i].value = (char *) alloca (XSTRING (color)->size + 1);
!         strcpy (xpm_syms[i].value, XSTRING (color)->data);
        }
      }
  
--- 7737,7746 ----
        {
          Lisp_Object name = XCAR (XCAR (tail));
          Lisp_Object color = XCDR (XCAR (tail));
!         xpm_syms[i].name = (char *) alloca (SCHARS (name) + 1);
!         strcpy (xpm_syms[i].name, SDATA (name));
!         xpm_syms[i].value = (char *) alloca (SCHARS (color) + 1);
!         strcpy (xpm_syms[i].value, SDATA (color));
        }
      }
  
***************
*** 7761,7774 ****
        }
        
        rc = XpmReadFileToPixmap (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
!                               XSTRING (file)->data, &img->pixmap, &img->mask,
                                &attrs);
      }
    else
      {
        Lisp_Object buffer = image_spec_value (img->spec, QCdata, NULL);
        rc = XpmCreatePixmapFromBuffer (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
!                                     XSTRING (buffer)->data,
                                      &img->pixmap, &img->mask,
                                      &attrs);
      }
--- 7761,7774 ----
        }
        
        rc = XpmReadFileToPixmap (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
!                               SDATA (file), &img->pixmap, &img->mask,
                                &attrs);
      }
    else
      {
        Lisp_Object buffer = image_spec_value (img->spec, QCdata, NULL);
        rc = XpmCreatePixmapFromBuffer (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
!                                     SDATA (buffer),
                                      &img->pixmap, &img->mask,
                                      &attrs);
      }
***************
*** 8568,8574 ****
          return 0;
        }
  
!       contents = slurp_file (XSTRING (file)->data, &size);
        if (contents == NULL)
        {
          image_error ("Error reading `%s'", file, Qnil);
--- 8568,8574 ----
          return 0;
        }
  
!       contents = slurp_file (SDATA (file), &size);
        if (contents == NULL)
        {
          image_error ("Error reading `%s'", file, Qnil);
***************
*** 8583,8590 ****
      {
        Lisp_Object data;
        data = image_spec_value (img->spec, QCdata, NULL);
!       p = XSTRING (data)->data;
!       end = p + STRING_BYTES (XSTRING (data));
      }
  
    /* Check magic number.  */
--- 8583,8590 ----
      {
        Lisp_Object data;
        data = image_spec_value (img->spec, QCdata, NULL);
!       p = SDATA (data);
!       end = p + SBYTES (data);
      }
  
    /* Check magic number.  */
***************
*** 8933,8939 ****
        }
  
        /* Open the image file.  */
!       fp = fopen (XSTRING (file)->data, "rb");
        if (!fp)
        {
          image_error ("Cannot open image file `%s'", file, Qnil);
--- 8933,8939 ----
        }
  
        /* Open the image file.  */
!       fp = fopen (SDATA (file), "rb");
        if (!fp)
        {
          image_error ("Cannot open image file `%s'", file, Qnil);
***************
*** 8955,8962 ****
    else
      {
        /* Read from memory.  */
!       tbr.bytes = XSTRING (specified_data)->data;
!       tbr.len = STRING_BYTES (XSTRING (specified_data));
        tbr.index = 0;
  
        /* Check PNG signature.  */
--- 8955,8962 ----
    else
      {
        /* Read from memory.  */
!       tbr.bytes = SDATA (specified_data);
!       tbr.len = SBYTES (specified_data);
        tbr.index = 0;
  
        /* Check PNG signature.  */
***************
*** 9079,9085 ****
        /* The user specified `:background', use that.  */
        {
          XColor color;
!         if (x_defined_color (f, XSTRING (specified_bg)->data, &color, 0))
            {
              png_color_16 user_bg;
  
--- 9079,9085 ----
        /* The user specified `:background', use that.  */
        {
          XColor color;
!         if (x_defined_color (f, SDATA (specified_bg), &color, 0))
            {
              png_color_16 user_bg;
  
***************
*** 9499,9505 ****
          return 0;
        }
    
!       fp = fopen (XSTRING (file)->data, "r");
        if (fp == NULL)
        {
          image_error ("Cannot open `%s'", file, Qnil);
--- 9499,9505 ----
          return 0;
        }
    
!       fp = fopen (SDATA (file), "r");
        if (fp == NULL)
        {
          image_error ("Cannot open `%s'", file, Qnil);
***************
*** 9546,9553 ****
    if (NILP (specified_data))
      jpeg_stdio_src (&cinfo, (FILE *) fp);
    else
!     jpeg_memory_src (&cinfo, XSTRING (specified_data)->data,
!                    STRING_BYTES (XSTRING (specified_data)));
  
    jpeg_read_header (&cinfo, TRUE);
  
--- 9546,9553 ----
    if (NILP (specified_data))
      jpeg_stdio_src (&cinfo, (FILE *) fp);
    else
!     jpeg_memory_src (&cinfo, SDATA (specified_data),
!                    SBYTES (specified_data));
  
    jpeg_read_header (&cinfo, TRUE);
  
***************
*** 9893,9899 ****
        }
          
        /* Try to open the image file.  */
!       tiff = TIFFOpen (XSTRING (file)->data, "r");
        if (tiff == NULL)
        {
          image_error ("Cannot open `%s'", file, Qnil);
--- 9893,9899 ----
        }
          
        /* Try to open the image file.  */
!       tiff = TIFFOpen (SDATA (file), "r");
        if (tiff == NULL)
        {
          image_error ("Cannot open `%s'", file, Qnil);
***************
*** 9904,9911 ****
    else
      {
        /* Memory source! */
!       memsrc.bytes = XSTRING (specified_data)->data;
!       memsrc.len = STRING_BYTES (XSTRING (specified_data));
        memsrc.index = 0;
  
        tiff = TIFFClientOpen ("memory_source", "r", &memsrc,
--- 9904,9911 ----
    else
      {
        /* Memory source! */
!       memsrc.bytes = SDATA (specified_data);
!       memsrc.len = SBYTES (specified_data);
        memsrc.index = 0;
  
        tiff = TIFFClientOpen ("memory_source", "r", &memsrc,
***************
*** 10142,10148 ****
        }
    
        /* Open the GIF file.  */
!       gif = DGifOpenFileName (XSTRING (file)->data);
        if (gif == NULL)
        {
          image_error ("Cannot open `%s'", file, Qnil);
--- 10142,10148 ----
        }
    
        /* Open the GIF file.  */
!       gif = DGifOpenFileName (SDATA (file));
        if (gif == NULL)
        {
          image_error ("Cannot open `%s'", file, Qnil);
***************
*** 10154,10161 ****
      {
        /* Read from memory! */
        current_gif_memory_src = &memsrc;
!       memsrc.bytes = XSTRING (specified_data)->data;
!       memsrc.len = STRING_BYTES (XSTRING (specified_data));
        memsrc.index = 0;
  
        gif = DGifOpen(&memsrc, gif_read_from_memory);
--- 10154,10161 ----
      {
        /* Read from memory! */
        current_gif_memory_src = &memsrc;
!       memsrc.bytes = SDATA (specified_data);
!       memsrc.len = SBYTES (specified_data);
        memsrc.index = 0;
  
        gif = DGifOpen(&memsrc, gif_read_from_memory);
***************
*** 10605,10614 ****
    CHECK_STRING (value);
  
    BLOCK_INPUT;
!   prop_atom = XInternAtom (FRAME_X_DISPLAY (f), XSTRING (prop)->data, False);
    XChangeProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
                   prop_atom, XA_STRING, 8, PropModeReplace,
!                  XSTRING (value)->data, XSTRING (value)->size);
  
    /* Make sure the property is set when we return.  */
    XFlush (FRAME_X_DISPLAY (f));
--- 10605,10614 ----
    CHECK_STRING (value);
  
    BLOCK_INPUT;
!   prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SDATA (prop), False);
    XChangeProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
                   prop_atom, XA_STRING, 8, PropModeReplace,
!                  SDATA (value), SCHARS (value));
  
    /* Make sure the property is set when we return.  */
    XFlush (FRAME_X_DISPLAY (f));
***************
*** 10630,10636 ****
  
    CHECK_STRING (prop);
    BLOCK_INPUT;
!   prop_atom = XInternAtom (FRAME_X_DISPLAY (f), XSTRING (prop)->data, False);
    XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), prop_atom);
  
    /* Make sure the property is removed when we return.  */
--- 10630,10636 ----
  
    CHECK_STRING (prop);
    BLOCK_INPUT;
!   prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SDATA (prop), False);
    XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), prop_atom);
  
    /* Make sure the property is removed when we return.  */
***************
*** 10661,10667 ****
  
    CHECK_STRING (prop);
    BLOCK_INPUT;
!   prop_atom = XInternAtom (FRAME_X_DISPLAY (f), XSTRING (prop)->data, False);
    rc = XGetWindowProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
                           prop_atom, 0, 0, False, XA_STRING,
                           &actual_type, &actual_format, &actual_size,
--- 10661,10667 ----
  
    CHECK_STRING (prop);
    BLOCK_INPUT;
!   prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SDATA (prop), False);
    rc = XGetWindowProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
                           prop_atom, 0, 0, False, XA_STRING,
                           &actual_type, &actual_format, &actual_size,
***************
*** 11054,11062 ****
        {
        tem = Fquery_fontset (font, Qnil);
        if (STRINGP (tem))
!         font = x_new_fontset (f, XSTRING (tem)->data);
        else
!         font = x_new_font (f, XSTRING (font)->data);
        }
      
      /* Try out a font which we hope has bold and italic variations.  */
--- 11054,11062 ----
        {
        tem = Fquery_fontset (font, Qnil);
        if (STRINGP (tem))
!         font = x_new_fontset (f, SDATA (tem));
        else
!         font = x_new_font (f, SDATA (font));
        }
      
      /* Try out a font which we hope has bold and italic variations.  */
***************
*** 11620,11629 ****
    /* Create the dialog with PROMPT as title, using DIR as initial
       directory and using "*" as pattern.  */
    dir = Fexpand_file_name (dir, Qnil);
!   dir_xmstring = XmStringCreateLocalized (XSTRING (dir)->data);
    pattern_xmstring = XmStringCreateLocalized ("*");
      
!   XtSetArg (al[ac], XmNtitle, XSTRING (prompt)->data); ++ac;
    XtSetArg (al[ac], XmNdirectory, dir_xmstring); ++ac;
    XtSetArg (al[ac], XmNpattern, pattern_xmstring); ++ac;
    XtSetArg (al[ac], XmNresizePolicy, XmRESIZE_GROW); ++ac;
--- 11620,11629 ----
    /* Create the dialog with PROMPT as title, using DIR as initial
       directory and using "*" as pattern.  */
    dir = Fexpand_file_name (dir, Qnil);
!   dir_xmstring = XmStringCreateLocalized (SDATA (dir));
    pattern_xmstring = XmStringCreateLocalized ("*");
      
!   XtSetArg (al[ac], XmNtitle, SDATA (prompt)); ++ac;
    XtSetArg (al[ac], XmNdirectory, dir_xmstring); ++ac;
    XtSetArg (al[ac], XmNpattern, pattern_xmstring); ++ac;
    XtSetArg (al[ac], XmNresizePolicy, XmRESIZE_GROW); ++ac;
***************
*** 11674,11680 ****
        int item_pos;
  
        default_xmstring
!       = XmStringCreateLocalized (XSTRING (default_filename)->data);
  
        if (!XmListItemExists (list, default_xmstring))
        {
--- 11674,11680 ----
        int item_pos;
  
        default_xmstring
!       = XmStringCreateLocalized (SDATA (default_filename));
  
        if (!XmListItemExists (list, default_xmstring))
        {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]