/[emacs]/emacs/src/xfaces.c
ViewVC logotype

Diff of /emacs/src/xfaces.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.258 by lektu, Thu Jul 11 14:17:04 2002 UTC revision 1.259 by raeburn, Mon Jul 15 00:00:37 2002 UTC
# Line 290  Boston, MA 02111-1307, USA.  */ Line 290  Boston, MA 02111-1307, USA.  */
290  /* Make a copy of the contents of Lisp string S on the stack using  /* Make a copy of the contents of Lisp string S on the stack using
291     alloca.  Value is a pointer to the copy.  */     alloca.  Value is a pointer to the copy.  */
292    
293  #define LSTRDUPA(S) STRDUPA (XSTRING ((S))->data)  #define LSTRDUPA(S) STRDUPA (SDATA ((S)))
294    
295  /* Size of hash table of realized faces in face caches (should be a  /* Size of hash table of realized faces in face caches (should be a
296     prime number).  */     prime number).  */
# Line 1146  the pixmap.  Bits are stored row by row, Line 1146  the pixmap.  Bits are stored row by row,
1146          {          {
1147            int bytes_per_row = ((XFASTINT (width) + BITS_PER_CHAR - 1)            int bytes_per_row = ((XFASTINT (width) + BITS_PER_CHAR - 1)
1148                                 / BITS_PER_CHAR);                                 / BITS_PER_CHAR);
1149            if (STRING_BYTES (XSTRING (data)) >= bytes_per_row * XINT (height))            if (SBYTES (data) >= bytes_per_row * XINT (height))
1150              pixmap_p = 1;              pixmap_p = 1;
1151          }          }
1152      }      }
# Line 1190  load_pixmap (f, name, w_ptr, h_ptr) Line 1190  load_pixmap (f, name, w_ptr, h_ptr)
1190        h = XINT (Fcar (Fcdr (name)));        h = XINT (Fcar (Fcdr (name)));
1191        bits = Fcar (Fcdr (Fcdr (name)));        bits = Fcar (Fcdr (Fcdr (name)));
1192    
1193        bitmap_id = x_create_bitmap_from_data (f, XSTRING (bits)->data,        bitmap_id = x_create_bitmap_from_data (f, SDATA (bits),
1194                                               w, h);                                               w, h);
1195      }      }
1196    else    else
# Line 1569  If FRAME is nil or omitted, use the sele Line 1569  If FRAME is nil or omitted, use the sele
1569    CHECK_FRAME (frame);    CHECK_FRAME (frame);
1570    CHECK_STRING (color);    CHECK_STRING (color);
1571    f = XFRAME (frame);    f = XFRAME (frame);
1572    return face_color_gray_p (f, XSTRING (color)->data) ? Qt : Qnil;    return face_color_gray_p (f, SDATA (color)) ? Qt : Qnil;
1573  }  }
1574    
1575    
# Line 1587  COLOR must be a valid color name.  */) Line 1587  COLOR must be a valid color name.  */)
1587    CHECK_FRAME (frame);    CHECK_FRAME (frame);
1588    CHECK_STRING (color);    CHECK_STRING (color);
1589    f = XFRAME (frame);    f = XFRAME (frame);
1590    if (face_color_supported_p (f, XSTRING (color)->data, !NILP (background_p)))    if (face_color_supported_p (f, SDATA (color), !NILP (background_p)))
1591      return Qt;      return Qt;
1592    return Qnil;    return Qnil;
1593  }  }
# Line 1621  load_color (f, face, name, target_index) Line 1621  load_color (f, face, name, target_index)
1621    
1622    /* if the color map is full, defined_color will return a best match    /* if the color map is full, defined_color will return a best match
1623       to the values in an existing cell. */       to the values in an existing cell. */
1624    if (!defined_color (f, XSTRING (name)->data, &color, 1))    if (!defined_color (f, SDATA (name), &color, 1))
1625      {      {
1626        add_to_log ("Unable to load color \"%s\"", name, Qnil);        add_to_log ("Unable to load color \"%s\"", name, Qnil);
1627    
# Line 1701  load_face_colors (f, face, attrs) Line 1701  load_face_colors (f, face, attrs)
1701       face_color_supported_p is smart enough to know that grays are       face_color_supported_p is smart enough to know that grays are
1702       "supported" as background because we are supposed to use stipple       "supported" as background because we are supposed to use stipple
1703       for them.  */       for them.  */
1704    if (!face_color_supported_p (f, XSTRING (bg)->data, 0)    if (!face_color_supported_p (f, SDATA (bg), 0)
1705        && !NILP (Fbitmap_spec_p (Vface_default_stipple)))        && !NILP (Fbitmap_spec_p (Vface_default_stipple)))
1706      {      {
1707        x_destroy_bitmap (f, face->stipple);        x_destroy_bitmap (f, face->stipple);
# Line 2476  x_face_list_fonts (f, pattern, fonts, nf Line 2476  x_face_list_fonts (f, pattern, fonts, nf
2476    for (tem = lfonts; CONSP (tem) && n < nfonts; tem = XCDR (tem))    for (tem = lfonts; CONSP (tem) && n < nfonts; tem = XCDR (tem))
2477      {      {
2478        Lisp_Object elt, tail;        Lisp_Object elt, tail;
2479        char *name = XSTRING (XCAR (tem))->data;        char *name = SDATA (XCAR (tem));
2480    
2481        /* Ignore fonts matching a pattern from face-ignored-fonts.  */        /* Ignore fonts matching a pattern from face-ignored-fonts.  */
2482        for (tail = Vface_ignored_fonts; CONSP (tail); tail = XCDR (tail))        for (tail = Vface_ignored_fonts; CONSP (tail); tail = XCDR (tail))
# Line 2520  x_face_list_fonts (f, pattern, fonts, nf Line 2520  x_face_list_fonts (f, pattern, fonts, nf
2520            Lisp_Object entry = XCAR (list);            Lisp_Object entry = XCAR (list);
2521            if (CONSP (entry)            if (CONSP (entry)
2522                && STRINGP (XCAR (entry))                && STRINGP (XCAR (entry))
2523                && strcmp (XSTRING (XCAR (entry))->data, pattern) == 0)                && strcmp (SDATA (XCAR (entry)), pattern) == 0)
2524              break;              break;
2525            list = XCDR (list);            list = XCDR (list);
2526          }          }
# Line 2536  x_face_list_fonts (f, pattern, fonts, nf Line 2536  x_face_list_fonts (f, pattern, fonts, nf
2536                       STRINGP (name))                       STRINGP (name))
2537                   /* Ignore patterns equal to PATTERN because we tried that                   /* Ignore patterns equal to PATTERN because we tried that
2538                      already with no success.  */                      already with no success.  */
2539                   && (strcmp (XSTRING (name)->data, pattern) == 0                   && (strcmp (SDATA (name), pattern) == 0
2540                       || (n = x_face_list_fonts (f, XSTRING (name)->data,                       || (n = x_face_list_fonts (f, SDATA (name),
2541                                                  fonts, nfonts, 0),                                                  fonts, nfonts, 0),
2542                           n == 0)))                           n == 0)))
2543              patterns = XCDR (patterns);              patterns = XCDR (patterns);
# Line 2647  font_list_1 (f, pattern, family, registr Line 2647  font_list_1 (f, pattern, family, registr
2647    
2648    if (NILP (pattern))    if (NILP (pattern))
2649      {      {
2650        family_str = (NILP (family) ? "*" : (char *) XSTRING (family)->data);        family_str = (NILP (family) ? "*" : (char *) SDATA (family));
2651        registry_str = (NILP (registry) ? "*" : (char *) XSTRING (registry)->data);        registry_str = (NILP (registry) ? "*" : (char *) SDATA (registry));
2652    
2653        pattern_str = (char *) alloca (strlen (family_str)        pattern_str = (char *) alloca (strlen (family_str)
2654                                       + strlen (registry_str)                                       + strlen (registry_str)
# Line 2666  font_list_1 (f, pattern, family, registr Line 2666  font_list_1 (f, pattern, family, registr
2666          }          }
2667      }      }
2668    else    else
2669      pattern_str = (char *) XSTRING (pattern)->data;      pattern_str = (char *) SDATA (pattern);
2670    
2671    return sorted_font_list (f, pattern_str, cmp_font_names, fonts);    return sorted_font_list (f, pattern_str, cmp_font_names, fonts);
2672  }  }
# Line 3087  resolve_face_name (face_name) Line 3087  resolve_face_name (face_name)
3087    Lisp_Object aliased;    Lisp_Object aliased;
3088    
3089    if (STRINGP (face_name))    if (STRINGP (face_name))
3090      face_name = intern (XSTRING (face_name)->data);      face_name = intern (SDATA (face_name));
3091    
3092    while (SYMBOLP (face_name))    while (SYMBOLP (face_name))
3093      {      {
# Line 3210  set_lface_from_font_name (f, lface, font Line 3210  set_lface_from_font_name (f, lface, font
3210    int pt;    int pt;
3211    int have_xlfd_p;    int have_xlfd_p;
3212    int fontset;    int fontset;
3213    char *font_name = XSTRING (fontname)->data;    char *font_name = SDATA (fontname);
3214    struct font_info *font_info;    struct font_info *font_info;
3215    
3216    /* If FONTNAME is actually a fontset name, get ASCII font name of it.  */    /* If FONTNAME is actually a fontset name, get ASCII font name of it.  */
3217    fontset = fs_query_fontset (fontname, 0);    fontset = fs_query_fontset (fontname, 0);
3218    if (fontset >= 0)    if (fontset >= 0)
3219      font_name = XSTRING (fontset_ascii (fontset))->data;      font_name = SDATA (fontset_ascii (fontset));
3220    
3221    /* Check if FONT_NAME is surely available on the system.  Usually    /* Check if FONT_NAME is surely available on the system.  Usually
3222       FONT_NAME is already cached for the frame F and FS_LOAD_FONT       FONT_NAME is already cached for the frame F and FS_LOAD_FONT
# Line 3522  merge_face_vector_with_property (f, to, Line 3522  merge_face_vector_with_property (f, to,
3522              add_to_log ("Invalid face color", color_name, Qnil);              add_to_log ("Invalid face color", color_name, Qnil);
3523          }          }
3524        else if (SYMBOLP (first)        else if (SYMBOLP (first)
3525                 && *XSTRING (SYMBOL_NAME (first))->data == ':')                 && *SDATA (SYMBOL_NAME (first)) == ':')
3526          {          {
3527            /* Assume this is the property list form.  */            /* Assume this is the property list form.  */
3528            while (CONSP (prop) && CONSP (XCDR (prop)))            while (CONSP (prop) && CONSP (XCDR (prop)))
# Line 3904  FRAME 0 means change the face on all fra Line 3904  FRAME 0 means change the face on all fra
3904        if (!UNSPECIFIEDP (value))        if (!UNSPECIFIEDP (value))
3905          {          {
3906            CHECK_STRING (value);            CHECK_STRING (value);
3907            if (XSTRING (value)->size == 0)            if (SCHARS (value) == 0)
3908              signal_error ("Invalid face family", value);              signal_error ("Invalid face family", value);
3909          }          }
3910        old_value = LFACE_FAMILY (lface);        old_value = LFACE_FAMILY (lface);
# Line 3964  FRAME 0 means change the face on all fra Line 3964  FRAME 0 means change the face on all fra
3964               && !EQ (value, Qnil))               && !EQ (value, Qnil))
3965              /* Underline color.  */              /* Underline color.  */
3966              || (STRINGP (value)              || (STRINGP (value)
3967                  && XSTRING (value)->size == 0))                  && SCHARS (value) == 0))
3968            signal_error ("Invalid face underline", value);            signal_error ("Invalid face underline", value);
3969    
3970        old_value = LFACE_UNDERLINE (lface);        old_value = LFACE_UNDERLINE (lface);
# Line 3978  FRAME 0 means change the face on all fra Line 3978  FRAME 0 means change the face on all fra
3978               && !EQ (value, Qnil))               && !EQ (value, Qnil))
3979              /* Overline color.  */              /* Overline color.  */
3980              || (STRINGP (value)              || (STRINGP (value)
3981                  && XSTRING (value)->size == 0))                  && SCHARS (value) == 0))
3982            signal_error ("Invalid face overline", value);            signal_error ("Invalid face overline", value);
3983    
3984        old_value = LFACE_OVERLINE (lface);        old_value = LFACE_OVERLINE (lface);
# Line 3992  FRAME 0 means change the face on all fra Line 3992  FRAME 0 means change the face on all fra
3992               && !EQ (value, Qnil))               && !EQ (value, Qnil))
3993              /* Strike-through color.  */              /* Strike-through color.  */
3994              || (STRINGP (value)              || (STRINGP (value)
3995                  && XSTRING (value)->size == 0))                  && SCHARS (value) == 0))
3996            signal_error ("Invalid face strike-through", value);            signal_error ("Invalid face strike-through", value);
3997    
3998        old_value = LFACE_STRIKE_THROUGH (lface);        old_value = LFACE_STRIKE_THROUGH (lface);
# Line 4014  FRAME 0 means change the face on all fra Line 4014  FRAME 0 means change the face on all fra
4014        else if (INTEGERP (value))        else if (INTEGERP (value))
4015          valid_p = XINT (value) != 0;          valid_p = XINT (value) != 0;
4016        else if (STRINGP (value))        else if (STRINGP (value))
4017          valid_p = XSTRING (value)->size > 0;          valid_p = SCHARS (value) > 0;
4018        else if (CONSP (value))        else if (CONSP (value))
4019          {          {
4020            Lisp_Object tem;            Lisp_Object tem;
# Line 4038  FRAME 0 means change the face on all fra Line 4038  FRAME 0 means change the face on all fra
4038                  }                  }
4039                else if (EQ (k, QCcolor))                else if (EQ (k, QCcolor))
4040                  {                  {
4041                    if (!STRINGP (v) || XSTRING (v)->size == 0)                    if (!STRINGP (v) || SCHARS (v) == 0)
4042                      break;                      break;
4043                  }                  }
4044                else if (EQ (k, QCstyle))                else if (EQ (k, QCstyle))
# Line 4081  FRAME 0 means change the face on all fra Line 4081  FRAME 0 means change the face on all fra
4081               on the frame (display) whether the color will be valid               on the frame (display) whether the color will be valid
4082               when the face is realized.  */               when the face is realized.  */
4083            CHECK_STRING (value);            CHECK_STRING (value);
4084            if (XSTRING (value)->size == 0)            if (SCHARS (value) == 0)
4085              signal_error ("Empty foreground color value", value);              signal_error ("Empty foreground color value", value);
4086          }          }
4087        old_value = LFACE_FOREGROUND (lface);        old_value = LFACE_FOREGROUND (lface);
# Line 4095  FRAME 0 means change the face on all fra Line 4095  FRAME 0 means change the face on all fra
4095               on the frame (display) whether the color will be valid               on the frame (display) whether the color will be valid
4096               when the face is realized.  */               when the face is realized.  */
4097            CHECK_STRING (value);            CHECK_STRING (value);
4098            if (XSTRING (value)->size == 0)            if (SCHARS (value) == 0)
4099              signal_error ("Empty background color value", value);              signal_error ("Empty background color value", value);
4100          }          }
4101        old_value = LFACE_BACKGROUND (lface);        old_value = LFACE_BACKGROUND (lface);
# Line 4445  face_boolean_x_resource_value (value, si Line 4445  face_boolean_x_resource_value (value, si
4445    
4446    xassert (STRINGP (value));    xassert (STRINGP (value));
4447    
4448    if (xstricmp (XSTRING (value)->data, "on") == 0    if (xstricmp (SDATA (value), "on") == 0
4449        || xstricmp (XSTRING (value)->data, "true") == 0)        || xstricmp (SDATA (value), "true") == 0)
4450      result = Qt;      result = Qt;
4451    else if (xstricmp (XSTRING (value)->data, "off") == 0    else if (xstricmp (SDATA (value), "off") == 0
4452             || xstricmp (XSTRING (value)->data, "false") == 0)             || xstricmp (SDATA (value), "false") == 0)
4453      result = Qnil;      result = Qnil;
4454    else if (xstricmp (XSTRING (value)->data, "unspecified") == 0)    else if (xstricmp (SDATA (value), "unspecified") == 0)
4455      result = Qunspecified;      result = Qunspecified;
4456    else if (signal_p)    else if (signal_p)
4457      signal_error ("Invalid face attribute value from X resource", value);      signal_error ("Invalid face attribute value from X resource", value);
# Line 4471  DEFUN ("internal-set-lisp-face-attribute Line 4471  DEFUN ("internal-set-lisp-face-attribute
4471    CHECK_SYMBOL (attr);    CHECK_SYMBOL (attr);
4472    CHECK_STRING (value);    CHECK_STRING (value);
4473    
4474    if (xstricmp (XSTRING (value)->data, "unspecified") == 0)    if (xstricmp (SDATA (value), "unspecified") == 0)
4475      value = Qunspecified;      value = Qunspecified;
4476    else if (EQ (attr, QCheight))    else if (EQ (attr, QCheight))
4477      {      {
# Line 4482  DEFUN ("internal-set-lisp-face-attribute Line 4482  DEFUN ("internal-set-lisp-face-attribute
4482    else if (EQ (attr, QCbold) || EQ (attr, QCitalic))    else if (EQ (attr, QCbold) || EQ (attr, QCitalic))
4483      value = face_boolean_x_resource_value (value, 1);      value = face_boolean_x_resource_value (value, 1);
4484    else if (EQ (attr, QCweight) || EQ (attr, QCslant) || EQ (attr, QCwidth))    else if (EQ (attr, QCweight) || EQ (attr, QCslant) || EQ (attr, QCwidth))
4485      value = intern (XSTRING (value)->data);      value = intern (SDATA (value));
4486    else if (EQ (attr, QCreverse_video) || EQ (attr, QCinverse_video))    else if (EQ (attr, QCreverse_video) || EQ (attr, QCinverse_video))
4487      value = face_boolean_x_resource_value (value, 1);      value = face_boolean_x_resource_value (value, 1);
4488    else if (EQ (attr, QCunderline)    else if (EQ (attr, QCunderline)
# Line 4528  x_update_menu_appearance (f) Line 4528  x_update_menu_appearance (f)
4528        char line[512];        char line[512];
4529        Lisp_Object lface = lface_from_face_name (f, Qmenu, 1);        Lisp_Object lface = lface_from_face_name (f, Qmenu, 1);
4530        struct face *face = FACE_FROM_ID (f, MENU_FACE_ID);        struct face *face = FACE_FROM_ID (f, MENU_FACE_ID);
4531        char *myname = XSTRING (Vx_resource_name)->data;        char *myname = SDATA (Vx_resource_name);
4532        int changed_p = 0;        int changed_p = 0;
4533  #ifdef USE_MOTIF  #ifdef USE_MOTIF
4534        const char *popup_path = "popup_menu";        const char *popup_path = "popup_menu";
# Line 4540  x_update_menu_appearance (f) Line 4540  x_update_menu_appearance (f)
4540          {          {
4541            sprintf (line, "%s.%s*foreground: %s",            sprintf (line, "%s.%s*foreground: %s",
4542                     myname, popup_path,                     myname, popup_path,
4543                     XSTRING (LFACE_FOREGROUND (lface))->data);                     SDATA (LFACE_FOREGROUND (lface)));
4544            XrmPutLineResource (&rdb, line);            XrmPutLineResource (&rdb, line);
4545            sprintf (line, "%s.pane.menubar*foreground: %s",            sprintf (line, "%s.pane.menubar*foreground: %s",
4546                     myname, XSTRING (LFACE_FOREGROUND (lface))->data);                     myname, SDATA (LFACE_FOREGROUND (lface)));
4547            XrmPutLineResource (&rdb, line);            XrmPutLineResource (&rdb, line);
4548            changed_p = 1;            changed_p = 1;
4549          }          }
# Line 4552  x_update_menu_appearance (f) Line 4552  x_update_menu_appearance (f)
4552          {          {
4553            sprintf (line, "%s.%s*background: %s",            sprintf (line, "%s.%s*background: %s",
4554                     myname, popup_path,                     myname, popup_path,
4555                     XSTRING (LFACE_BACKGROUND (lface))->data);                     SDATA (LFACE_BACKGROUND (lface)));
4556            XrmPutLineResource (&rdb, line);            XrmPutLineResource (&rdb, line);
4557            sprintf (line, "%s.pane.menubar*background: %s",            sprintf (line, "%s.pane.menubar*background: %s",
4558                     myname, XSTRING (LFACE_BACKGROUND (lface))->data);                     myname, SDATA (LFACE_BACKGROUND (lface)));
4559            XrmPutLineResource (&rdb, line);            XrmPutLineResource (&rdb, line);
4560            changed_p = 1;            changed_p = 1;
4561          }          }
# Line 4837  lface_equal_p (v1, v2) Line 4837  lface_equal_p (v1, v2)
4837            switch (XTYPE (a))            switch (XTYPE (a))
4838              {              {
4839              case Lisp_String:              case Lisp_String:
4840                equal_p = ((STRING_BYTES (XSTRING (a))                equal_p = ((SBYTES (a)
4841                            == STRING_BYTES (XSTRING (b)))                            == SBYTES (b))
4842                           && bcmp (XSTRING (a)->data, XSTRING (b)->data,                           && bcmp (SDATA (a), SDATA (b),
4843                                    STRING_BYTES (XSTRING (a))) == 0);                                    SBYTES (a)) == 0);
4844                break;                break;
4845    
4846              case Lisp_Int:              case Lisp_Int:
# Line 4942  hash_string_case_insensitive (string) Line 4942  hash_string_case_insensitive (string)
4942    unsigned char *s;    unsigned char *s;
4943    unsigned hash = 0;    unsigned hash = 0;
4944    xassert (STRINGP (string));    xassert (STRINGP (string));
4945    for (s = XSTRING (string)->data; *s; ++s)    for (s = SDATA (string); *s; ++s)
4946      hash = (hash << 1) ^ tolower (*s);      hash = (hash << 1) ^ tolower (*s);
4947    return hash;    return hash;
4948  }  }
# Line 4975  lface_same_font_attributes_p (lface1, lf Line 4975  lface_same_font_attributes_p (lface1, lf
4975  {  {
4976    xassert (lface_fully_specified_p (lface1)    xassert (lface_fully_specified_p (lface1)
4977             && lface_fully_specified_p (lface2));             && lface_fully_specified_p (lface2));
4978    return (xstricmp (XSTRING (lface1[LFACE_FAMILY_INDEX])->data,    return (xstricmp (SDATA (lface1[LFACE_FAMILY_INDEX]),
4979                      XSTRING (lface2[LFACE_FAMILY_INDEX])->data) == 0                      SDATA (lface2[LFACE_FAMILY_INDEX])) == 0
4980            && EQ (lface1[LFACE_HEIGHT_INDEX], lface2[LFACE_HEIGHT_INDEX])            && EQ (lface1[LFACE_HEIGHT_INDEX], lface2[LFACE_HEIGHT_INDEX])
4981            && EQ (lface1[LFACE_SWIDTH_INDEX], lface2[LFACE_SWIDTH_INDEX])            && EQ (lface1[LFACE_SWIDTH_INDEX], lface2[LFACE_SWIDTH_INDEX])
4982            && EQ (lface1[LFACE_AVGWIDTH_INDEX], lface2[LFACE_AVGWIDTH_INDEX])            && EQ (lface1[LFACE_AVGWIDTH_INDEX], lface2[LFACE_AVGWIDTH_INDEX])
# Line 4985  lface_same_font_attributes_p (lface1, lf Line 4985  lface_same_font_attributes_p (lface1, lf
4985            && (EQ (lface1[LFACE_FONT_INDEX], lface2[LFACE_FONT_INDEX])            && (EQ (lface1[LFACE_FONT_INDEX], lface2[LFACE_FONT_INDEX])
4986                || (STRINGP (lface1[LFACE_FONT_INDEX])                || (STRINGP (lface1[LFACE_FONT_INDEX])
4987                    && STRINGP (lface2[LFACE_FONT_INDEX])                    && STRINGP (lface2[LFACE_FONT_INDEX])
4988                    && xstricmp (XSTRING (lface1[LFACE_FONT_INDEX])->data,                    && xstricmp (SDATA (lface1[LFACE_FONT_INDEX]),
4989                                 XSTRING (lface2[LFACE_FONT_INDEX])->data))));                                 SDATA (lface2[LFACE_FONT_INDEX])))));
4990  }  }
4991    
4992    
# Line 5141  If FRAME is unspecified or nil, the curr Line 5141  If FRAME is unspecified or nil, the curr
5141    
5142    if ((CONSP (color1) && !parse_rgb_list (color1, &cdef1))    if ((CONSP (color1) && !parse_rgb_list (color1, &cdef1))
5143        || !STRINGP (color1)        || !STRINGP (color1)
5144        || !defined_color (f, XSTRING (color1)->data, &cdef1, 0))        || !defined_color (f, SDATA (color1), &cdef1, 0))
5145      signal_error ("Invalid color", color1);      signal_error ("Invalid color", color1);
5146    if ((CONSP (color2) && !parse_rgb_list (color2, &cdef2))    if ((CONSP (color2) && !parse_rgb_list (color2, &cdef2))
5147        || !STRINGP (color2)        || !STRINGP (color2)
5148        || !defined_color (f, XSTRING (color2)->data, &cdef2, 0))        || !defined_color (f, SDATA (color2), &cdef2, 0))
5149      signal_error ("Invalid color", color2);      signal_error ("Invalid color", color2);
5150    
5151    return make_number (color_distance (&cdef1, &cdef2));    return make_number (color_distance (&cdef1, &cdef2));
# Line 6347  try_font_list (f, attrs, family, registr Line 6347  try_font_list (f, attrs, family, registr
6347       if the family is -etl-fixed, e.g.  The following widens the       if the family is -etl-fixed, e.g.  The following widens the
6348       choices and fixes that problem.  */       choices and fixes that problem.  */
6349    if (nfonts == 0 && STRINGP (face_family) && STRINGP (registry)    if (nfonts == 0 && STRINGP (face_family) && STRINGP (registry)
6350        && xstricmp (XSTRING (registry)->data, "mac-roman") == 0)        && xstricmp (SDATA (registry), "mac-roman") == 0)
6351      nfonts = try_alternative_families (f, face_family, Qnil, fonts);      nfonts = try_alternative_families (f, face_family, Qnil, fonts);
6352  #endif  #endif
6353    
# Line 6421  choose_face_font (f, attrs, fontset, c) Line 6421  choose_face_font (f, attrs, fontset, c)
6421        
6422    /* If what we got is a name pattern, return it.  */    /* If what we got is a name pattern, return it.  */
6423    if (STRINGP (pattern))    if (STRINGP (pattern))
6424      return xstrdup (XSTRING (pattern)->data);      return xstrdup (SDATA (pattern));
6425    
6426    /* Get a list of fonts matching that pattern and choose the    /* Get a list of fonts matching that pattern and choose the
6427       best match for the specified face attributes from it.  */       best match for the specified face attributes from it.  */
# Line 6927  map_tty_color (f, face, idx, defaulted) Line 6927  map_tty_color (f, face, idx, defaulted)
6927    color = face->lface[idx];    color = face->lface[idx];
6928        
6929    if (STRINGP (color)    if (STRINGP (color)
6930        && XSTRING (color)->size        && SCHARS (color)
6931        && CONSP (Vtty_defined_color_alist)        && CONSP (Vtty_defined_color_alist)
6932        && (def = assq_no_quit (color, call1 (Qtty_color_alist, frame)),        && (def = assq_no_quit (color, call1 (Qtty_color_alist, frame)),
6933            CONSP (def)))            CONSP (def)))
# Line 7277  face_at_string_position (w, string, pos, Line 7277  face_at_string_position (w, string, pos,
7277       Limit is the maximum position up to which to check for property       Limit is the maximum position up to which to check for property
7278       changes in Fnext_single_property_change.  Strings are usually       changes in Fnext_single_property_change.  Strings are usually
7279       short, so set the limit to the end of the string.  */       short, so set the limit to the end of the string.  */
7280    XSETFASTINT (limit, XSTRING (string)->size);    XSETFASTINT (limit, SCHARS (string));
7281    end = Fnext_single_property_change (position, prop_name, string, limit);    end = Fnext_single_property_change (position, prop_name, string, limit);
7282    if (INTEGERP (end))    if (INTEGERP (end))
7283      *endptr = XFASTINT (end);      *endptr = XFASTINT (end);
# Line 7345  dump_realized_face (face) Line 7345  dump_realized_face (face)
7345  #endif  #endif
7346    fprintf (stderr, "foreground: 0x%lx (%s)\n",    fprintf (stderr, "foreground: 0x%lx (%s)\n",
7347             face->foreground,             face->foreground,
7348             XSTRING (face->lface[LFACE_FOREGROUND_INDEX])->data);             SDATA (face->lface[LFACE_FOREGROUND_INDEX]));
7349    fprintf (stderr, "background: 0x%lx (%s)\n",    fprintf (stderr, "background: 0x%lx (%s)\n",
7350             face->background,             face->background,
7351             XSTRING (face->lface[LFACE_BACKGROUND_INDEX])->data);             SDATA (face->lface[LFACE_BACKGROUND_INDEX]));
7352    fprintf (stderr, "font_name: %s (%s)\n",    fprintf (stderr, "font_name: %s (%s)\n",
7353             face->font_name,             face->font_name,
7354             XSTRING (face->lface[LFACE_FAMILY_INDEX])->data);             SDATA (face->lface[LFACE_FAMILY_INDEX]));
7355  #ifdef HAVE_X_WINDOWS  #ifdef HAVE_X_WINDOWS
7356    fprintf (stderr, "font = %p\n", face->font);    fprintf (stderr, "font = %p\n", face->font);
7357  #endif  #endif
# Line 7359  dump_realized_face (face) Line 7359  dump_realized_face (face)
7359    fprintf (stderr, "fontset: %d\n", face->fontset);    fprintf (stderr, "fontset: %d\n", face->fontset);
7360    fprintf (stderr, "underline: %d (%s)\n",    fprintf (stderr, "underline: %d (%s)\n",
7361             face->underline_p,             face->underline_p,
7362             XSTRING (Fsymbol_name (face->lface[LFACE_UNDERLINE_INDEX]))->data);             SDATA (Fsymbol_name (face->lface[LFACE_UNDERLINE_INDEX])));
7363    fprintf (stderr, "hash: %d\n", face->hash);    fprintf (stderr, "hash: %d\n", face->hash);
7364    fprintf (stderr, "charset: %d\n", face->charset);    fprintf (stderr, "charset: %d\n", face->charset);
7365  }  }

Legend:
Removed from v.1.258  
changed lines
  Added in v.1.259

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26