comparison src/objects-msw.c @ 5027:22179cd0fe15

merge
author Ben Wing <ben@xemacs.org>
date Wed, 10 Feb 2010 07:25:19 -0600
parents 7e57c0575a15
children
comparison
equal deleted inserted replaced
5026:46cf825f6158 5027:22179cd0fe15
1 /* mswindows-specific Lisp objects. 1 /* mswindows-specific Lisp objects.
2 Copyright (C) 1993, 1994 Free Software Foundation, Inc. 2 Copyright (C) 1993, 1994 Free Software Foundation, Inc.
3 Copyright (C) 1995 Board of Trustees, University of Illinois. 3 Copyright (C) 1995 Board of Trustees, University of Illinois.
4 Copyright (C) 1995 Tinker Systems. 4 Copyright (C) 1995 Tinker Systems.
5 Copyright (C) 1995, 1996, 2000, 2001, 2002, 2004 Ben Wing. 5 Copyright (C) 1995, 1996, 2000, 2001, 2002, 2004, 2005, 2010 Ben Wing.
6 Copyright (C) 1995 Sun Microsystems, Inc. 6 Copyright (C) 1995 Sun Microsystems, Inc.
7 Copyright (C) 1997 Jonathan Harris. 7 Copyright (C) 1997 Jonathan Harris.
8 8
9 This file is part of XEmacs. 9 This file is part of XEmacs.
10 10
25 25
26 /* Synched up with: Not in FSF. */ 26 /* Synched up with: Not in FSF. */
27 27
28 /* Authorship: 28 /* Authorship:
29 29
30 Jamie Zawinski, Chuck Thompson, Ben Wing 30 This file created by Jonathan Harris, November 1997 for 21.0; based
31 Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0. 31 heavily on objects-x.c (see authorship there). Much further work
32 by Ben Wing.
32 */ 33 */
33 34
34 /* This function Mule-ized by Ben Wing, 3-24-02. */ 35 /* This function Mule-ized by Ben Wing, 3-24-02. */
35 36
36 /* TODO: palette handling */ 37 /* TODO: palette handling */
2014 return !qxestrcasecmp (XSTRING_DATA (charset_registry), font_charset); 2015 return !qxestrcasecmp (XSTRING_DATA (charset_registry), font_charset);
2015 } 2016 }
2016 2017
2017 /* 2018 /*
2018 2019
2020 #### The following comment is old and probably not applicable any longer.
2021
2019 1. handle standard mapping and inheritance vectors properly in Face-frob-property. 2022 1. handle standard mapping and inheritance vectors properly in Face-frob-property.
2020 2. finish impl of mswindows-charset-registry. 2023 2. finish impl of mswindows-charset-registry.
2021 3. see if everything works under fixup, now that i copied the stuff over. 2024 3. see if everything works under fixup, now that i copied the stuff over.
2022 4. consider generalizing Face-frob-property to frob-specifier. 2025 4. consider generalizing Face-frob-property to frob-specifier.
2023 5. maybe extract some of the flets out of Face-frob-property as useful specifier frobbing. 2026 5. maybe extract some of the flets out of Face-frob-property as useful specifier frobbing.
2065 } 2068 }
2066 else 2069 else
2067 { 2070 {
2068 HDC hdc = CreateCompatibleDC (NULL); 2071 HDC hdc = CreateCompatibleDC (NULL);
2069 Lisp_Object font_list = Qnil, truename; 2072 Lisp_Object font_list = Qnil, truename;
2073 HFONT hfont;
2070 2074
2071 if (DEVICE_TYPE_P (d, mswindows)) 2075 if (DEVICE_TYPE_P (d, mswindows))
2072 { 2076 {
2073 font_list = DEVICE_MSWINDOWS_FONTLIST (d); 2077 font_list = DEVICE_MSWINDOWS_FONTLIST (d);
2074 } 2078 }
2079 else 2083 else
2080 { 2084 {
2081 assert(0); 2085 assert(0);
2082 } 2086 }
2083 2087
2084 HFONT hfont = create_hfont_from_font_spec (the_nonreloc, hdc, Qnil, 2088 hfont = create_hfont_from_font_spec (the_nonreloc, hdc, Qnil,
2085 font_list, 2089 font_list,
2086 ERROR_ME_DEBUG_WARN, 2090 ERROR_ME_DEBUG_WARN,
2087 &truename); 2091 &truename);
2088 2092
2089 if (!hfont || !(hfont = (HFONT) SelectObject (hdc, hfont))) 2093 if (!hfont || !(hfont = (HFONT) SelectObject (hdc, hfont)))
2090 { 2094 {
2091 nope: 2095 nope:
2092 DeleteDC (hdc); 2096 DeleteDC (hdc);
2093 UNGCPRO; 2097 UNGCPRO;
2094 return 0; 2098 return 0;
2095 } 2099 }
2096 2100
2097 if (GetTextCharsetInfo (hdc, &fs, 0) == DEFAULT_CHARSET) 2101 if (GetTextCharsetInfo (hdc, &fs, 0) == DEFAULT_CHARSET)
2098 { 2102 {
2099 SelectObject (hdc, hfont); 2103 SelectObject (hdc, hfont);
2100 goto nope; 2104 goto nope;
2101 } 2105 }
2182 const Ibyte *nonreloc, 2186 const Ibyte *nonreloc,
2183 Lisp_Object reloc, 2187 Lisp_Object reloc,
2184 Bytecount offset, Bytecount length, 2188 Bytecount offset, Bytecount length,
2185 enum font_specifier_matchspec_stages stage) 2189 enum font_specifier_matchspec_stages stage)
2186 { 2190 {
2187 return stage ? 2191 return stage == STAGE_FINAL ?
2188 mswindows_font_spec_matches_charset_stage_2 (d, charset, nonreloc, 2192 mswindows_font_spec_matches_charset_stage_2 (d, charset, nonreloc,
2189 reloc, offset, length) 2193 reloc, offset, length)
2190 : mswindows_font_spec_matches_charset_stage_1 (d, charset, nonreloc, 2194 : mswindows_font_spec_matches_charset_stage_1 (d, charset, nonreloc,
2191 reloc, offset, length); 2195 reloc, offset, length);
2192 } 2196 }
2204 2208
2205 /* If FONT specifies a particular charset, this will only list fonts with 2209 /* If FONT specifies a particular charset, this will only list fonts with
2206 that charset; otherwise, it will list fonts with all charsets. */ 2210 that charset; otherwise, it will list fonts with all charsets. */
2207 fontlist = mswindows_font_list (font, device, Qnil); 2211 fontlist = mswindows_font_list (font, device, Qnil);
2208 2212
2209 if (!stage) 2213 if (stage == STAGE_INITIAL)
2210 { 2214 {
2211 LIST_LOOP (fonttail, fontlist) 2215 LIST_LOOP (fonttail, fontlist)
2212 { 2216 {
2213 if (mswindows_font_spec_matches_charset_stage_1 2217 if (mswindows_font_spec_matches_charset_stage_1
2214 (XDEVICE (device), charset, 0, XCAR (fonttail), 0, -1)) 2218 (XDEVICE (device), charset, 0, XCAR (fonttail), 0, -1))