Mercurial > hg > xemacs-beta
comparison src/objects-msw.c @ 2527:491f8cf78a9c
[xemacs-hg @ 2005-01-28 02:58:38 by ben]
Abstract font-list/color-list
font-menu.el, font.el, frame.el, gtk-font-menu.el, minibuf.el, msw-faces.el, msw-font-menu.el, obsolete.el, x-faces.el, x-font-menu.el: list-fonts->font-list. Create color-list. Abstract out
x/msw-specific versions and obsolete the x/msw-specific Lisp
functions.
console-impl.h, objects-gtk.c, objects-msw.c, objects-tty.c, objects-x.c, objects.c: list-fonts->font-list. Create color-list. Abstract out
x/msw-specific versions and obsolete the x/msw-specific Lisp
functions.
author | ben |
---|---|
date | Fri, 28 Jan 2005 02:58:52 +0000 |
parents | de9952d2ed18 |
children | 98af8a976fc3 |
comparison
equal
deleted
inserted
replaced
2526:902d5bd9b75c | 2527:491f8cf78a9c |
---|---|
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 Ben Wing. | 5 Copyright (C) 1995, 1996, 2000, 2001, 2002, 2004 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 |
1924 FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f, 0, 0)); | 1924 FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f, 0, 0)); |
1925 | 1925 |
1926 } | 1926 } |
1927 | 1927 |
1928 static Lisp_Object | 1928 static Lisp_Object |
1929 mswindows_list_fonts (Lisp_Object pattern, Lisp_Object device, | 1929 mswindows_font_list (Lisp_Object pattern, Lisp_Object device, |
1930 Lisp_Object UNUSED (maxnumber)) | 1930 Lisp_Object UNUSED (maxnumber)) |
1931 { | 1931 { |
1932 struct device *d = XDEVICE (device); | 1932 struct device *d = XDEVICE (device); |
1933 Lisp_Object font_list = Qnil, fonttail, result = Qnil; | 1933 Lisp_Object font_list = Qnil, fonttail, result = Qnil; |
1934 | 1934 |
2186 { | 2186 { |
2187 Lisp_Object fontlist, fonttail; | 2187 Lisp_Object fontlist, fonttail; |
2188 | 2188 |
2189 /* If FONT specifies a particular charset, this will only list fonts with | 2189 /* If FONT specifies a particular charset, this will only list fonts with |
2190 that charset; otherwise, it will list fonts with all charsets. */ | 2190 that charset; otherwise, it will list fonts with all charsets. */ |
2191 fontlist = mswindows_list_fonts (font, device, Qnil); | 2191 fontlist = mswindows_font_list (font, device, Qnil); |
2192 | 2192 |
2193 if (!stage) | 2193 if (!stage) |
2194 { | 2194 { |
2195 LIST_LOOP (fonttail, fontlist) | 2195 LIST_LOOP (fonttail, fontlist) |
2196 { | 2196 { |
2217 | 2217 |
2218 /************************************************************************/ | 2218 /************************************************************************/ |
2219 /* non-methods */ | 2219 /* non-methods */ |
2220 /************************************************************************/ | 2220 /************************************************************************/ |
2221 | 2221 |
2222 DEFUN ("mswindows-color-list", Fmswindows_color_list, 0, 0, 0, /* | 2222 static Lisp_Object |
2223 Return a list of the colors available on mswindows devices. | 2223 mswindows_color_list (void) |
2224 */ | |
2225 ()) | |
2226 { | 2224 { |
2227 Lisp_Object result = Qnil; | 2225 Lisp_Object result = Qnil; |
2228 int i; | 2226 int i; |
2229 | 2227 |
2230 for (i = 0; i < countof (mswindows_X_color_map); i++) | 2228 for (i = 0; i < countof (mswindows_X_color_map); i++) |
2231 result = Fcons (build_string (mswindows_X_color_map[i].name), result); | 2229 result = Fcons (build_string (mswindows_X_color_map[i].name), result); |
2232 | 2230 |
2233 return Fnreverse (result); | 2231 return Fnreverse (result); |
2234 } | 2232 } |
2235 | |
2236 | 2233 |
2237 | 2234 |
2238 /************************************************************************/ | 2235 /************************************************************************/ |
2239 /* initialization */ | 2236 /* initialization */ |
2240 /************************************************************************/ | 2237 /************************************************************************/ |
2241 | 2238 |
2242 void | 2239 void |
2243 syms_of_objects_mswindows (void) | 2240 syms_of_objects_mswindows (void) |
2244 { | 2241 { |
2245 DEFSUBR (Fmswindows_color_list); | |
2246 } | 2242 } |
2247 | 2243 |
2248 void | 2244 void |
2249 console_type_create_objects_mswindows (void) | 2245 console_type_create_objects_mswindows (void) |
2250 { | 2246 { |
2255 CONSOLE_HAS_METHOD (mswindows, finalize_color_instance); | 2251 CONSOLE_HAS_METHOD (mswindows, finalize_color_instance); |
2256 CONSOLE_HAS_METHOD (mswindows, color_instance_equal); | 2252 CONSOLE_HAS_METHOD (mswindows, color_instance_equal); |
2257 CONSOLE_HAS_METHOD (mswindows, color_instance_hash); | 2253 CONSOLE_HAS_METHOD (mswindows, color_instance_hash); |
2258 CONSOLE_HAS_METHOD (mswindows, color_instance_rgb_components); | 2254 CONSOLE_HAS_METHOD (mswindows, color_instance_rgb_components); |
2259 CONSOLE_HAS_METHOD (mswindows, valid_color_name_p); | 2255 CONSOLE_HAS_METHOD (mswindows, valid_color_name_p); |
2256 CONSOLE_HAS_METHOD (mswindows, color_list); | |
2260 | 2257 |
2261 CONSOLE_HAS_METHOD (mswindows, initialize_font_instance); | 2258 CONSOLE_HAS_METHOD (mswindows, initialize_font_instance); |
2262 /* CONSOLE_HAS_METHOD (mswindows, mark_font_instance); */ | 2259 /* CONSOLE_HAS_METHOD (mswindows, mark_font_instance); */ |
2263 CONSOLE_HAS_METHOD (mswindows, print_font_instance); | 2260 CONSOLE_HAS_METHOD (mswindows, print_font_instance); |
2264 CONSOLE_HAS_METHOD (mswindows, finalize_font_instance); | 2261 CONSOLE_HAS_METHOD (mswindows, finalize_font_instance); |
2265 CONSOLE_HAS_METHOD (mswindows, font_instance_truename); | 2262 CONSOLE_HAS_METHOD (mswindows, font_instance_truename); |
2266 CONSOLE_HAS_METHOD (mswindows, list_fonts); | 2263 CONSOLE_HAS_METHOD (mswindows, font_list); |
2267 #ifdef MULE | 2264 #ifdef MULE |
2268 CONSOLE_HAS_METHOD (mswindows, font_spec_matches_charset); | 2265 CONSOLE_HAS_METHOD (mswindows, font_spec_matches_charset); |
2269 CONSOLE_HAS_METHOD (mswindows, find_charset_font); | 2266 CONSOLE_HAS_METHOD (mswindows, find_charset_font); |
2270 #endif | 2267 #endif |
2271 | 2268 |
2278 CONSOLE_INHERITS_METHOD (msprinter, mswindows, finalize_color_instance); | 2275 CONSOLE_INHERITS_METHOD (msprinter, mswindows, finalize_color_instance); |
2279 CONSOLE_INHERITS_METHOD (msprinter, mswindows, color_instance_equal); | 2276 CONSOLE_INHERITS_METHOD (msprinter, mswindows, color_instance_equal); |
2280 CONSOLE_INHERITS_METHOD (msprinter, mswindows, color_instance_hash); | 2277 CONSOLE_INHERITS_METHOD (msprinter, mswindows, color_instance_hash); |
2281 CONSOLE_INHERITS_METHOD (msprinter, mswindows, color_instance_rgb_components); | 2278 CONSOLE_INHERITS_METHOD (msprinter, mswindows, color_instance_rgb_components); |
2282 CONSOLE_INHERITS_METHOD (msprinter, mswindows, valid_color_name_p); | 2279 CONSOLE_INHERITS_METHOD (msprinter, mswindows, valid_color_name_p); |
2280 CONSOLE_INHERITS_METHOD (msprinter, mswindows, color_list); | |
2283 | 2281 |
2284 CONSOLE_HAS_METHOD (msprinter, initialize_font_instance); | 2282 CONSOLE_HAS_METHOD (msprinter, initialize_font_instance); |
2285 /* CONSOLE_INHERITS_METHOD (msprinter, mswindows, mark_font_instance); */ | 2283 /* CONSOLE_INHERITS_METHOD (msprinter, mswindows, mark_font_instance); */ |
2286 CONSOLE_INHERITS_METHOD (msprinter, mswindows, print_font_instance); | 2284 CONSOLE_INHERITS_METHOD (msprinter, mswindows, print_font_instance); |
2287 CONSOLE_INHERITS_METHOD (msprinter, mswindows, finalize_font_instance); | 2285 CONSOLE_INHERITS_METHOD (msprinter, mswindows, finalize_font_instance); |
2288 CONSOLE_INHERITS_METHOD (msprinter, mswindows, font_instance_truename); | 2286 CONSOLE_INHERITS_METHOD (msprinter, mswindows, font_instance_truename); |
2289 CONSOLE_INHERITS_METHOD (msprinter, mswindows, list_fonts); | 2287 CONSOLE_INHERITS_METHOD (msprinter, mswindows, font_list); |
2290 #ifdef MULE | 2288 #ifdef MULE |
2291 CONSOLE_INHERITS_METHOD (msprinter, mswindows, font_spec_matches_charset); | 2289 CONSOLE_INHERITS_METHOD (msprinter, mswindows, font_spec_matches_charset); |
2292 CONSOLE_INHERITS_METHOD (msprinter, mswindows, find_charset_font); | 2290 CONSOLE_INHERITS_METHOD (msprinter, mswindows, find_charset_font); |
2293 #endif | 2291 #endif |
2294 } | 2292 } |