Mercurial > hg > xemacs-beta
comparison src/glyphs-msw.c @ 420:41dbb7a9d5f2 r21-2-18
Import from CVS: tag r21-2-18
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:24:09 +0200 |
parents | e804706bfb8c |
children | 95016f13131a |
comparison
equal
deleted
inserted
replaced
419:66615b78f1a5 | 420:41dbb7a9d5f2 |
---|---|
1 /* mswindows-specific glyph objects. | 1 /* mswindows-specific glyph objects. |
2 Copyright (C) 1998 Andy Piper. | 2 Copyright (C) 1998, 99 Andy Piper. |
3 | 3 |
4 This file is part of XEmacs. | 4 This file is part of XEmacs. |
5 | 5 |
6 XEmacs is free software; you can redistribute it and/or modify it | 6 XEmacs is free software; you can redistribute it and/or modify it |
7 under the terms of the GNU General Public License as published by the | 7 under the terms of the GNU General Public License as published by the |
51 #include <setjmp.h> | 51 #include <setjmp.h> |
52 #endif | 52 #endif |
53 | 53 |
54 #define WIDGET_GLYPH_SLOT 0 | 54 #define WIDGET_GLYPH_SLOT 0 |
55 | 55 |
56 DECLARE_IMAGE_INSTANTIATOR_FORMAT (nothing); | |
57 DECLARE_IMAGE_INSTANTIATOR_FORMAT (string); | |
58 DECLARE_IMAGE_INSTANTIATOR_FORMAT (formatted_string); | |
59 DECLARE_IMAGE_INSTANTIATOR_FORMAT (inherit); | |
60 #ifdef HAVE_JPEG | |
61 DECLARE_IMAGE_INSTANTIATOR_FORMAT (jpeg); | |
62 #endif | |
63 #ifdef HAVE_TIFF | |
64 DECLARE_IMAGE_INSTANTIATOR_FORMAT (tiff); | |
65 #endif | |
66 #ifdef HAVE_PNG | |
67 DECLARE_IMAGE_INSTANTIATOR_FORMAT (png); | |
68 #endif | |
69 #ifdef HAVE_GIF | |
70 DECLARE_IMAGE_INSTANTIATOR_FORMAT (gif); | |
71 #endif | |
56 #ifdef HAVE_XPM | 72 #ifdef HAVE_XPM |
57 DEFINE_DEVICE_IIFORMAT (mswindows, xpm); | 73 DEFINE_DEVICE_IIFORMAT (mswindows, xpm); |
58 #endif | 74 #endif |
59 DEFINE_DEVICE_IIFORMAT (mswindows, xbm); | 75 DEFINE_DEVICE_IIFORMAT (mswindows, xbm); |
60 #ifdef HAVE_XFACE | 76 #ifdef HAVE_XFACE |
61 DEFINE_DEVICE_IIFORMAT (mswindows, xface); | 77 DEFINE_DEVICE_IIFORMAT (mswindows, xface); |
62 #endif | 78 #endif |
63 DEFINE_DEVICE_IIFORMAT (mswindows, button); | 79 DEFINE_DEVICE_IIFORMAT (mswindows, button); |
64 DEFINE_DEVICE_IIFORMAT (mswindows, edit); | 80 DEFINE_DEVICE_IIFORMAT (mswindows, edit_field); |
65 #if 0 | 81 #if 0 |
66 DEFINE_DEVICE_IIFORMAT (mswindows, group); | 82 DEFINE_DEVICE_IIFORMAT (mswindows, group); |
67 #endif | 83 #endif |
68 DEFINE_DEVICE_IIFORMAT (mswindows, subwindow); | 84 DEFINE_DEVICE_IIFORMAT (mswindows, subwindow); |
69 DEFINE_DEVICE_IIFORMAT (mswindows, widget); | 85 DEFINE_DEVICE_IIFORMAT (mswindows, widget); |
70 DEFINE_DEVICE_IIFORMAT (mswindows, label); | 86 DEFINE_DEVICE_IIFORMAT (mswindows, label); |
71 DEFINE_DEVICE_IIFORMAT (mswindows, scrollbar); | 87 DEFINE_DEVICE_IIFORMAT (mswindows, scrollbar); |
72 DEFINE_DEVICE_IIFORMAT (mswindows, combo); | 88 DEFINE_DEVICE_IIFORMAT (mswindows, combo_box); |
73 DEFINE_DEVICE_IIFORMAT (mswindows, progress); | 89 DEFINE_DEVICE_IIFORMAT (mswindows, progress_gauge); |
74 DEFINE_DEVICE_IIFORMAT (mswindows, tree); | 90 DEFINE_DEVICE_IIFORMAT (mswindows, tree_view); |
75 DEFINE_DEVICE_IIFORMAT (mswindows, tab); | 91 DEFINE_DEVICE_IIFORMAT (mswindows, tab_control); |
76 | 92 |
77 DEFINE_IMAGE_INSTANTIATOR_FORMAT (bmp); | 93 DEFINE_IMAGE_INSTANTIATOR_FORMAT (bmp); |
78 Lisp_Object Qbmp; | 94 Lisp_Object Qbmp; |
79 Lisp_Object Vmswindows_bitmap_file_path; | 95 Lisp_Object Vmswindows_bitmap_file_path; |
80 static COLORREF transparent_color = RGB (1,1,1); | 96 static COLORREF transparent_color = RGB (1,1,1); |
2317 } | 2333 } |
2318 } | 2334 } |
2319 | 2335 |
2320 /* instantiate an edit control */ | 2336 /* instantiate an edit control */ |
2321 static void | 2337 static void |
2322 mswindows_edit_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, | 2338 mswindows_edit_field_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, |
2323 Lisp_Object pointer_fg, Lisp_Object pointer_bg, | 2339 Lisp_Object pointer_fg, Lisp_Object pointer_bg, |
2324 int dest_mask, Lisp_Object domain) | 2340 int dest_mask, Lisp_Object domain) |
2325 { | 2341 { |
2326 mswindows_widget_instantiate (image_instance, instantiator, pointer_fg, | 2342 mswindows_widget_instantiate (image_instance, instantiator, pointer_fg, |
2327 pointer_bg, dest_mask, domain, "EDIT", | 2343 pointer_bg, dest_mask, domain, "EDIT", |
2330 WS_EX_CLIENTEDGE | WS_EX_CONTROLPARENT); | 2346 WS_EX_CLIENTEDGE | WS_EX_CONTROLPARENT); |
2331 } | 2347 } |
2332 | 2348 |
2333 /* instantiate a progress gauge */ | 2349 /* instantiate a progress gauge */ |
2334 static void | 2350 static void |
2335 mswindows_progress_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, | 2351 mswindows_progress_gauge_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, |
2336 Lisp_Object pointer_fg, Lisp_Object pointer_bg, | 2352 Lisp_Object pointer_fg, Lisp_Object pointer_bg, |
2337 int dest_mask, Lisp_Object domain) | 2353 int dest_mask, Lisp_Object domain) |
2338 { | 2354 { |
2339 HWND wnd; | 2355 HWND wnd; |
2340 struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); | 2356 struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); |
2429 add_tree_item (image_instance, wnd, parent, XCAR (rest), FALSE, domain); | 2445 add_tree_item (image_instance, wnd, parent, XCAR (rest), FALSE, domain); |
2430 } | 2446 } |
2431 } | 2447 } |
2432 | 2448 |
2433 static void | 2449 static void |
2434 mswindows_tree_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, | 2450 mswindows_tree_view_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, |
2435 Lisp_Object pointer_fg, Lisp_Object pointer_bg, | 2451 Lisp_Object pointer_fg, Lisp_Object pointer_bg, |
2436 int dest_mask, Lisp_Object domain) | 2452 int dest_mask, Lisp_Object domain) |
2437 { | 2453 { |
2438 Lisp_Object rest; | 2454 Lisp_Object rest; |
2439 HWND wnd; | 2455 HWND wnd; |
2507 | 2523 |
2508 return ret; | 2524 return ret; |
2509 } | 2525 } |
2510 | 2526 |
2511 static void | 2527 static void |
2512 mswindows_tab_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, | 2528 mswindows_tab_control_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, |
2513 Lisp_Object pointer_fg, Lisp_Object pointer_bg, | 2529 Lisp_Object pointer_fg, Lisp_Object pointer_bg, |
2514 int dest_mask, Lisp_Object domain) | 2530 int dest_mask, Lisp_Object domain) |
2515 { | 2531 { |
2516 Lisp_Object rest; | 2532 Lisp_Object rest; |
2517 HWND wnd; | 2533 HWND wnd; |
2518 HTREEITEM parent; | |
2519 int index = 0; | 2534 int index = 0; |
2520 struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); | 2535 struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); |
2521 mswindows_widget_instantiate (image_instance, instantiator, pointer_fg, | 2536 mswindows_widget_instantiate (image_instance, instantiator, pointer_fg, |
2522 pointer_bg, dest_mask, domain, WC_TABCONTROL, | 2537 pointer_bg, dest_mask, domain, WC_TABCONTROL, |
2523 /* borders don't suit tabs so well */ | 2538 /* borders don't suit tabs so well */ |
2571 WS_EX_CLIENTEDGE ); | 2586 WS_EX_CLIENTEDGE ); |
2572 } | 2587 } |
2573 | 2588 |
2574 /* instantiate a combo control */ | 2589 /* instantiate a combo control */ |
2575 static void | 2590 static void |
2576 mswindows_combo_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, | 2591 mswindows_combo_box_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, |
2577 Lisp_Object pointer_fg, Lisp_Object pointer_bg, | 2592 Lisp_Object pointer_fg, Lisp_Object pointer_bg, |
2578 int dest_mask, Lisp_Object domain) | 2593 int dest_mask, Lisp_Object domain) |
2579 { | 2594 { |
2580 struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); | 2595 struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); |
2581 HANDLE wnd; | 2596 HANDLE wnd; |
2644 return Qunbound; | 2659 return Qunbound; |
2645 } | 2660 } |
2646 | 2661 |
2647 /* get properties of a combo box */ | 2662 /* get properties of a combo box */ |
2648 static Lisp_Object | 2663 static Lisp_Object |
2649 mswindows_combo_property (Lisp_Object image_instance, Lisp_Object prop) | 2664 mswindows_combo_box_property (Lisp_Object image_instance, Lisp_Object prop) |
2650 { | 2665 { |
2651 struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); | 2666 struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); |
2652 HANDLE wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); | 2667 HANDLE wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); |
2653 /* get the text from a control */ | 2668 /* get the text from a control */ |
2654 if (EQ (prop, Q_text)) | 2669 if (EQ (prop, Q_text)) |
2681 return Qunbound; | 2696 return Qunbound; |
2682 } | 2697 } |
2683 | 2698 |
2684 /* set the properties of a progres guage */ | 2699 /* set the properties of a progres guage */ |
2685 static Lisp_Object | 2700 static Lisp_Object |
2686 mswindows_progress_set_property (Lisp_Object image_instance, Lisp_Object prop, | 2701 mswindows_progress_gauge_set_property (Lisp_Object image_instance, Lisp_Object prop, |
2687 Lisp_Object val) | 2702 Lisp_Object val) |
2688 { | 2703 { |
2689 struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); | 2704 struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); |
2690 | 2705 |
2691 if (EQ (prop, Q_percent)) | 2706 if (EQ (prop, Q_percent)) |
2727 } | 2742 } |
2728 | 2743 |
2729 void | 2744 void |
2730 image_instantiator_format_create_glyphs_mswindows (void) | 2745 image_instantiator_format_create_glyphs_mswindows (void) |
2731 { | 2746 { |
2747 IIFORMAT_VALID_CONSOLE (mswindows, nothing); | |
2748 IIFORMAT_VALID_CONSOLE (mswindows, string); | |
2749 IIFORMAT_VALID_CONSOLE (mswindows, formatted_string); | |
2750 IIFORMAT_VALID_CONSOLE (mswindows, inherit); | |
2732 /* image-instantiator types */ | 2751 /* image-instantiator types */ |
2733 #ifdef HAVE_XPM | 2752 #ifdef HAVE_XPM |
2734 INITIALIZE_DEVICE_IIFORMAT (mswindows, xpm); | 2753 INITIALIZE_DEVICE_IIFORMAT (mswindows, xpm); |
2735 IIFORMAT_HAS_DEVMETHOD (mswindows, xpm, instantiate); | 2754 IIFORMAT_HAS_DEVMETHOD (mswindows, xpm, instantiate); |
2736 #endif | 2755 #endif |
2738 IIFORMAT_HAS_DEVMETHOD (mswindows, xbm, instantiate); | 2757 IIFORMAT_HAS_DEVMETHOD (mswindows, xbm, instantiate); |
2739 #ifdef HAVE_XFACE | 2758 #ifdef HAVE_XFACE |
2740 INITIALIZE_DEVICE_IIFORMAT (mswindows, xface); | 2759 INITIALIZE_DEVICE_IIFORMAT (mswindows, xface); |
2741 IIFORMAT_HAS_DEVMETHOD (mswindows, xface, instantiate); | 2760 IIFORMAT_HAS_DEVMETHOD (mswindows, xface, instantiate); |
2742 #endif | 2761 #endif |
2762 #ifdef HAVE_JPEG | |
2763 IIFORMAT_VALID_CONSOLE (mswindows, jpeg); | |
2764 #endif | |
2765 #ifdef HAVE_TIFF | |
2766 IIFORMAT_VALID_CONSOLE (mswindows, tiff); | |
2767 #endif | |
2768 #ifdef HAVE_PNG | |
2769 IIFORMAT_VALID_CONSOLE (mswindows, png); | |
2770 #endif | |
2771 #ifdef HAVE_GIF | |
2772 IIFORMAT_VALID_CONSOLE (mswindows, gif); | |
2773 #endif | |
2743 /* button widget */ | 2774 /* button widget */ |
2744 INITIALIZE_DEVICE_IIFORMAT (mswindows, button); | 2775 INITIALIZE_DEVICE_IIFORMAT (mswindows, button); |
2745 IIFORMAT_HAS_DEVMETHOD (mswindows, button, property); | 2776 IIFORMAT_HAS_DEVMETHOD (mswindows, button, property); |
2746 IIFORMAT_HAS_DEVMETHOD (mswindows, button, instantiate); | 2777 IIFORMAT_HAS_DEVMETHOD (mswindows, button, instantiate); |
2747 | 2778 |
2748 INITIALIZE_DEVICE_IIFORMAT (mswindows, edit); | 2779 INITIALIZE_DEVICE_IIFORMAT (mswindows, edit_field); |
2749 IIFORMAT_HAS_DEVMETHOD (mswindows, edit, instantiate); | 2780 IIFORMAT_HAS_DEVMETHOD (mswindows, edit_field, instantiate); |
2750 | 2781 |
2751 INITIALIZE_DEVICE_IIFORMAT (mswindows, subwindow); | 2782 INITIALIZE_DEVICE_IIFORMAT (mswindows, subwindow); |
2752 IIFORMAT_HAS_DEVMETHOD (mswindows, subwindow, instantiate); | 2783 IIFORMAT_HAS_DEVMETHOD (mswindows, subwindow, instantiate); |
2753 | 2784 |
2754 INITIALIZE_DEVICE_IIFORMAT (mswindows, widget); | 2785 INITIALIZE_DEVICE_IIFORMAT (mswindows, widget); |
2761 /* label */ | 2792 /* label */ |
2762 INITIALIZE_DEVICE_IIFORMAT (mswindows, label); | 2793 INITIALIZE_DEVICE_IIFORMAT (mswindows, label); |
2763 IIFORMAT_HAS_DEVMETHOD (mswindows, label, instantiate); | 2794 IIFORMAT_HAS_DEVMETHOD (mswindows, label, instantiate); |
2764 | 2795 |
2765 /* combo box */ | 2796 /* combo box */ |
2766 INITIALIZE_DEVICE_IIFORMAT (mswindows, combo); | 2797 INITIALIZE_DEVICE_IIFORMAT (mswindows, combo_box); |
2767 IIFORMAT_HAS_DEVMETHOD (mswindows, combo, property); | 2798 IIFORMAT_HAS_DEVMETHOD (mswindows, combo_box, property); |
2768 IIFORMAT_HAS_DEVMETHOD (mswindows, combo, instantiate); | 2799 IIFORMAT_HAS_DEVMETHOD (mswindows, combo_box, instantiate); |
2769 | 2800 |
2770 /* scrollbar */ | 2801 /* scrollbar */ |
2771 INITIALIZE_DEVICE_IIFORMAT (mswindows, scrollbar); | 2802 INITIALIZE_DEVICE_IIFORMAT (mswindows, scrollbar); |
2772 IIFORMAT_HAS_DEVMETHOD (mswindows, scrollbar, instantiate); | 2803 IIFORMAT_HAS_DEVMETHOD (mswindows, scrollbar, instantiate); |
2773 | 2804 |
2774 /* progress gauge */ | 2805 /* progress gauge */ |
2775 INITIALIZE_DEVICE_IIFORMAT (mswindows, progress); | 2806 INITIALIZE_DEVICE_IIFORMAT (mswindows, progress_gauge); |
2776 IIFORMAT_HAS_DEVMETHOD (mswindows, progress, set_property); | 2807 IIFORMAT_HAS_DEVMETHOD (mswindows, progress_gauge, set_property); |
2777 IIFORMAT_HAS_DEVMETHOD (mswindows, progress, instantiate); | 2808 IIFORMAT_HAS_DEVMETHOD (mswindows, progress_gauge, instantiate); |
2778 | 2809 |
2779 /* tree view widget */ | 2810 /* tree view widget */ |
2780 INITIALIZE_DEVICE_IIFORMAT (mswindows, tree); | 2811 INITIALIZE_DEVICE_IIFORMAT (mswindows, tree_view); |
2781 /* IIFORMAT_HAS_DEVMETHOD (mswindows, progress, set_property);*/ | 2812 /* IIFORMAT_HAS_DEVMETHOD (mswindows, progress, set_property);*/ |
2782 IIFORMAT_HAS_DEVMETHOD (mswindows, tree, instantiate); | 2813 IIFORMAT_HAS_DEVMETHOD (mswindows, tree_view, instantiate); |
2783 | 2814 |
2784 /* tab control widget */ | 2815 /* tab control widget */ |
2785 INITIALIZE_DEVICE_IIFORMAT (mswindows, tab); | 2816 INITIALIZE_DEVICE_IIFORMAT (mswindows, tab_control); |
2786 IIFORMAT_HAS_DEVMETHOD (mswindows, tab, instantiate); | 2817 IIFORMAT_HAS_DEVMETHOD (mswindows, tab_control, instantiate); |
2787 | 2818 |
2788 /* windows bitmap format */ | 2819 /* windows bitmap format */ |
2789 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (bmp, "bmp"); | 2820 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (bmp, "bmp"); |
2790 IIFORMAT_HAS_METHOD (bmp, validate); | 2821 IIFORMAT_HAS_METHOD (bmp, validate); |
2791 IIFORMAT_HAS_METHOD (bmp, normalize); | 2822 IIFORMAT_HAS_METHOD (bmp, normalize); |
2792 IIFORMAT_HAS_METHOD (bmp, possible_dest_types); | 2823 IIFORMAT_HAS_METHOD (bmp, possible_dest_types); |
2793 IIFORMAT_HAS_METHOD (bmp, instantiate); | 2824 IIFORMAT_HAS_METHOD (bmp, instantiate); |
2794 | 2825 |
2795 IIFORMAT_VALID_KEYWORD (bmp, Q_data, check_valid_string); | 2826 IIFORMAT_VALID_KEYWORD (bmp, Q_data, check_valid_string); |
2796 IIFORMAT_VALID_KEYWORD (bmp, Q_file, check_valid_string); | 2827 IIFORMAT_VALID_KEYWORD (bmp, Q_file, check_valid_string); |
2828 IIFORMAT_VALID_CONSOLE (mswindows, bmp); | |
2797 | 2829 |
2798 /* mswindows resources */ | 2830 /* mswindows resources */ |
2799 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (mswindows_resource, | 2831 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (mswindows_resource, |
2800 "mswindows-resource"); | 2832 "mswindows-resource"); |
2801 | 2833 |
2806 | 2838 |
2807 IIFORMAT_VALID_KEYWORD (mswindows_resource, Q_resource_type, | 2839 IIFORMAT_VALID_KEYWORD (mswindows_resource, Q_resource_type, |
2808 check_valid_resource_symbol); | 2840 check_valid_resource_symbol); |
2809 IIFORMAT_VALID_KEYWORD (mswindows_resource, Q_resource_id, check_valid_resource_id); | 2841 IIFORMAT_VALID_KEYWORD (mswindows_resource, Q_resource_id, check_valid_resource_id); |
2810 IIFORMAT_VALID_KEYWORD (mswindows_resource, Q_file, check_valid_string); | 2842 IIFORMAT_VALID_KEYWORD (mswindows_resource, Q_file, check_valid_string); |
2843 IIFORMAT_VALID_CONSOLE (mswindows, mswindows_resource); | |
2811 } | 2844 } |
2812 | 2845 |
2813 void | 2846 void |
2814 vars_of_glyphs_mswindows (void) | 2847 vars_of_glyphs_mswindows (void) |
2815 { | 2848 { |
2816 Fprovide (Qbmp); | |
2817 Fprovide (Qmswindows_resource); | |
2818 DEFVAR_LISP ("mswindows-bitmap-file-path", &Vmswindows_bitmap_file_path /* | 2849 DEFVAR_LISP ("mswindows-bitmap-file-path", &Vmswindows_bitmap_file_path /* |
2819 A list of the directories in which mswindows bitmap files may be found. | 2850 A list of the directories in which mswindows bitmap files may be found. |
2820 This is used by the `make-image-instance' function. | 2851 This is used by the `make-image-instance' function. |
2821 */ ); | 2852 */ ); |
2822 Vmswindows_bitmap_file_path = Qnil; | 2853 Vmswindows_bitmap_file_path = Qnil; |
2823 | |
2824 Fprovide (Qbutton); | |
2825 Fprovide (Qedit); | |
2826 Fprovide (Qcombo); | |
2827 Fprovide (Qscrollbar); | |
2828 Fprovide (Qlabel); | |
2829 Fprovide (Qprogress); | |
2830 Fprovide (Qtree); | |
2831 Fprovide (Qtab); | |
2832 } | 2854 } |
2833 | 2855 |
2834 void | 2856 void |
2835 complex_vars_of_glyphs_mswindows (void) | 2857 complex_vars_of_glyphs_mswindows (void) |
2836 { | 2858 { |