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

Diff of /emacs/src/xfns.c

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

revision 1.642 by ttn, Sun Aug 7 12:33:18 2005 UTC revision 1.643 by kfstorm, Mon Sep 12 10:27:20 2005 UTC
# Line 1515  x_set_scroll_bar_background (f, value, o Line 1515  x_set_scroll_bar_background (f, value, o
1515     Otherwise store 0 in *STRINGP, which means that the `encoding' of     Otherwise store 0 in *STRINGP, which means that the `encoding' of
1516     the result should be `COMPOUND_TEXT'.  */     the result should be `COMPOUND_TEXT'.  */
1517    
1518  unsigned char *  static unsigned char *
1519  x_encode_text (string, coding_system, selectionp, text_bytes, stringp)  x_encode_text (string, coding_system, selectionp, text_bytes, stringp, freep)
1520       Lisp_Object string, coding_system;       Lisp_Object string, coding_system;
1521       int *text_bytes, *stringp;       int *text_bytes, *stringp;
1522       int selectionp;       int selectionp;
1523         int *freep;
1524  {  {
1525    unsigned char *str = SDATA (string);    unsigned char *str = SDATA (string);
1526    int chars = SCHARS (string);    int chars = SCHARS (string);
# Line 1536  x_encode_text (string, coding_system, se Line 1537  x_encode_text (string, coding_system, se
1537        /* No multibyte character in OBJ.  We need not encode it.  */        /* No multibyte character in OBJ.  We need not encode it.  */
1538        *text_bytes = bytes;        *text_bytes = bytes;
1539        *stringp = 1;        *stringp = 1;
1540          *freep = 0;
1541        return str;        return str;
1542      }      }
1543    
# Line 1563  x_encode_text (string, coding_system, se Line 1565  x_encode_text (string, coding_system, se
1565    *stringp = (charset_info == 1    *stringp = (charset_info == 1
1566                || (!EQ (coding_system, Qcompound_text)                || (!EQ (coding_system, Qcompound_text)
1567                    && !EQ (coding_system, Qcompound_text_with_extensions)));                    && !EQ (coding_system, Qcompound_text_with_extensions)));
1568      *freep = 1;
1569    return buf;    return buf;
1570  }  }
1571    
# Line 1601  x_set_name_internal (f, name) Line 1604  x_set_name_internal (f, name)
1604             in the future which can encode all Unicode characters.             in the future which can encode all Unicode characters.
1605             But, for the moment, there's no way to know that the             But, for the moment, there's no way to know that the
1606             current window manager supports it or not.  */             current window manager supports it or not.  */
1607          text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp);          text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp,
1608                                        &do_free_text_value);
1609          text.encoding = (stringp ? XA_STRING          text.encoding = (stringp ? XA_STRING
1610                           : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);                           : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
1611          text.format = 8;          text.format = 8;
1612          text.nitems = bytes;          text.nitems = bytes;
1613    
         /* Check early, because ENCODE_UTF_8 below may GC and name may be  
            relocated.  */  
         do_free_text_value = text.value != SDATA (name);  
   
1614          if (NILP (f->icon_name))          if (NILP (f->icon_name))
1615            {            {
1616              icon = text;              icon = text;
# Line 1619  x_set_name_internal (f, name) Line 1619  x_set_name_internal (f, name)
1619            {            {
1620              /* See the above comment "Note: Encoding strategy".  */              /* See the above comment "Note: Encoding strategy".  */
1621              icon.value = x_encode_text (f->icon_name, coding_system, 0,              icon.value = x_encode_text (f->icon_name, coding_system, 0,
1622                                          &bytes, &stringp);                                          &bytes, &stringp, &do_free_icon_value);
1623              icon.encoding = (stringp ? XA_STRING              icon.encoding = (stringp ? XA_STRING
1624                               : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);                               : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
1625              icon.format = 8;              icon.format = 8;
1626              icon.nitems = bytes;              icon.nitems = bytes;
             do_free_icon_value = icon.value != SDATA (f->icon_name);  
1627            }            }
1628    
1629  #ifdef USE_GTK  #ifdef USE_GTK
# Line 1987  xic_create_fontsetname (base_fontname, m Line 1986  xic_create_fontsetname (base_fontname, m
1986           - the same but with the family also replaced with -*-*-.  */           - the same but with the family also replaced with -*-*-.  */
1987        char *p = base_fontname;        char *p = base_fontname;
1988        int i;        int i;
1989          
1990        for (i = 0; *p; p++)        for (i = 0; *p; p++)
1991          if (*p == '-') i++;          if (*p == '-') i++;
1992        if (i != 14)        if (i != 14)
# Line 2011  xic_create_fontsetname (base_fontname, m Line 2010  xic_create_fontsetname (base_fontname, m
2010            char *allcs = "*-*-*-*-*-*-*";            char *allcs = "*-*-*-*-*-*-*";
2011            char *allfamilies = "-*-*-";            char *allfamilies = "-*-*-";
2012            char *all = "*-*-*-*-";            char *all = "*-*-*-*-";
2013              
2014            for (i = 0, p = base_fontname; i < 8; p++)            for (i = 0, p = base_fontname; i < 8; p++)
2015              {              {
2016                if (*p == '-')                if (*p == '-')

Legend:
Removed from v.1.642  
changed lines
  Added in v.1.643

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