comparison src/objects-msw.c @ 5118:e0db3c197671 ben-lisp-object

merge up to latest default branch, doesn't compile yet
author Ben Wing <ben@xemacs.org>
date Sat, 26 Dec 2009 21:18:49 -0600
parents 68f74b080e94
children 8b63e21b0436
comparison
equal deleted inserted replaced
5117:3742ea8250b5 5118:e0db3c197671
1974 const Ibyte *font_charset; 1974 const Ibyte *font_charset;
1975 const Ibyte *the_nonreloc = nonreloc; 1975 const Ibyte *the_nonreloc = nonreloc;
1976 const Ibyte *c; 1976 const Ibyte *c;
1977 Bytecount the_length = length; 1977 Bytecount the_length = length;
1978 1978
1979 if (UNBOUNDP (charset)) 1979 if (NILP (charset))
1980 return 1; 1980 return 1;
1981 1981
1982 if (!the_nonreloc) 1982 if (!the_nonreloc)
1983 the_nonreloc = XSTRING_DATA (reloc); 1983 the_nonreloc = XSTRING_DATA (reloc);
1984 fixup_internal_substring (nonreloc, reloc, offset, &the_length); 1984 fixup_internal_substring (nonreloc, reloc, offset, &the_length);
2036 struct gcpro gcpro1; 2036 struct gcpro gcpro1;
2037 Lisp_Object fontsig; 2037 Lisp_Object fontsig;
2038 Bytecount the_length = length; 2038 Bytecount the_length = length;
2039 int i; 2039 int i;
2040 2040
2041 if (UNBOUNDP (charset)) 2041 if (NILP (charset))
2042 return 1; 2042 return 1;
2043 2043
2044 if (!the_nonreloc) 2044 if (!the_nonreloc)
2045 the_nonreloc = XSTRING_DATA (reloc); 2045 the_nonreloc = XSTRING_DATA (reloc);
2046 fixup_internal_substring (nonreloc, reloc, offset, &the_length); 2046 fixup_internal_substring (nonreloc, reloc, offset, &the_length);
2062 UNGCPRO; 2062 UNGCPRO;
2063 } 2063 }
2064 else 2064 else
2065 { 2065 {
2066 HDC hdc = CreateCompatibleDC (NULL); 2066 HDC hdc = CreateCompatibleDC (NULL);
2067 Lisp_Object font_list = DEVICE_MSWINDOWS_FONTLIST (d); 2067 Lisp_Object font_list = Qnil, truename;
2068 Lisp_Object truename; 2068
2069 if (DEVICE_TYPE_P (d, mswindows))
2070 {
2071 font_list = DEVICE_MSWINDOWS_FONTLIST (d);
2072 }
2073 else if (DEVICE_TYPE_P (d, msprinter))
2074 {
2075 font_list = DEVICE_MSPRINTER_FONTLIST (d);
2076 }
2077 else
2078 {
2079 assert(0);
2080 }
2081
2069 HFONT hfont = create_hfont_from_font_spec (the_nonreloc, hdc, Qnil, 2082 HFONT hfont = create_hfont_from_font_spec (the_nonreloc, hdc, Qnil,
2070 font_list, 2083 font_list,
2071 ERROR_ME_DEBUG_WARN, 2084 ERROR_ME_DEBUG_WARN,
2072 &truename); 2085 &truename);
2073 2086
2165 static int 2178 static int
2166 mswindows_font_spec_matches_charset (struct device *d, Lisp_Object charset, 2179 mswindows_font_spec_matches_charset (struct device *d, Lisp_Object charset,
2167 const Ibyte *nonreloc, 2180 const Ibyte *nonreloc,
2168 Lisp_Object reloc, 2181 Lisp_Object reloc,
2169 Bytecount offset, Bytecount length, 2182 Bytecount offset, Bytecount length,
2170 int stage) 2183 enum font_specifier_matchspec_stages stage)
2171 { 2184 {
2172 return stage ? 2185 return stage ?
2173 mswindows_font_spec_matches_charset_stage_2 (d, charset, nonreloc, 2186 mswindows_font_spec_matches_charset_stage_2 (d, charset, nonreloc,
2174 reloc, offset, length) 2187 reloc, offset, length)
2175 : mswindows_font_spec_matches_charset_stage_1 (d, charset, nonreloc, 2188 : mswindows_font_spec_matches_charset_stage_1 (d, charset, nonreloc,
2180 /* Find a font spec that matches font spec FONT and also matches 2193 /* Find a font spec that matches font spec FONT and also matches
2181 (the registry of) CHARSET. */ 2194 (the registry of) CHARSET. */
2182 2195
2183 static Lisp_Object 2196 static Lisp_Object
2184 mswindows_find_charset_font (Lisp_Object device, Lisp_Object font, 2197 mswindows_find_charset_font (Lisp_Object device, Lisp_Object font,
2185 Lisp_Object charset, int stage) 2198 Lisp_Object charset,
2199 enum font_specifier_matchspec_stages stage)
2186 { 2200 {
2187 Lisp_Object fontlist, fonttail; 2201 Lisp_Object fontlist, fonttail;
2188 2202
2189 /* If FONT specifies a particular charset, this will only list fonts with 2203 /* If FONT specifies a particular charset, this will only list fonts with
2190 that charset; otherwise, it will list fonts with all charsets. */ 2204 that charset; otherwise, it will list fonts with all charsets. */