Mercurial > hg > xemacs-beta
comparison src/glyphs-msw.c @ 422:95016f13131a r21-2-19
Import from CVS: tag r21-2-19
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:25:01 +0200 |
parents | 41dbb7a9d5f2 |
children | 11054d720c21 |
comparison
equal
deleted
inserted
replaced
421:fff06e11db74 | 422:95016f13131a |
---|---|
105 static void | 105 static void |
106 mswindows_initialize_image_instance_mask (struct Lisp_Image_Instance* image, | 106 mswindows_initialize_image_instance_mask (struct Lisp_Image_Instance* image, |
107 struct frame* f); | 107 struct frame* f); |
108 | 108 |
109 COLORREF mswindows_string_to_color (CONST char *name); | 109 COLORREF mswindows_string_to_color (CONST char *name); |
110 void check_valid_item_list_1 (Lisp_Object items); | |
110 | 111 |
111 #define BPLINE(width) ((int)(~3UL & (unsigned long)((width) +3))) | 112 #define BPLINE(width) ((int)(~3UL & (unsigned long)((width) +3))) |
112 | 113 |
113 /************************************************************************/ | 114 /************************************************************************/ |
114 /* convert from a series of RGB triples to a BITMAPINFO formated for the*/ | 115 /* convert from a series of RGB triples to a BITMAPINFO formated for the*/ |
2047 x, y, 0, 0, | 2048 x, y, 0, 0, |
2048 SWP_NOZORDER | SWP_SHOWWINDOW | SWP_NOSIZE | 2049 SWP_NOZORDER | SWP_SHOWWINDOW | SWP_NOSIZE |
2049 | SWP_NOCOPYBITS | SWP_NOSENDCHANGING); | 2050 | SWP_NOCOPYBITS | SWP_NOSENDCHANGING); |
2050 } | 2051 } |
2051 | 2052 |
2053 /* resize the subwindow instance */ | |
2054 static void | |
2055 mswindows_resize_subwindow (struct Lisp_Image_Instance* ii, int w, int h) | |
2056 { | |
2057 SetWindowPos (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii), | |
2058 NULL, | |
2059 0, 0, w, h, | |
2060 SWP_NOZORDER | SWP_NOMOVE | |
2061 | SWP_NOCOPYBITS | SWP_NOSENDCHANGING); | |
2062 } | |
2063 | |
2052 /* when you click on a widget you may activate another widget this | 2064 /* when you click on a widget you may activate another widget this |
2053 needs to be checked and all appropriate widgets updated */ | 2065 needs to be checked and all appropriate widgets updated */ |
2054 static void | 2066 static void |
2055 mswindows_update_subwindow (struct Lisp_Image_Instance *p) | 2067 mswindows_update_subwindow (struct Lisp_Image_Instance *p) |
2056 { | 2068 { |
2538 /* borders don't suit tabs so well */ | 2550 /* borders don't suit tabs so well */ |
2539 WS_TABSTOP, | 2551 WS_TABSTOP, |
2540 WS_EX_CONTROLPARENT); | 2552 WS_EX_CONTROLPARENT); |
2541 | 2553 |
2542 wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); | 2554 wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); |
2543 | |
2544 /* add items to the tab */ | 2555 /* add items to the tab */ |
2545 LIST_LOOP (rest, Fplist_get (IMAGE_INSTANCE_WIDGET_PROPS (ii), Q_items, Qnil)) | 2556 LIST_LOOP (rest, Fplist_get (IMAGE_INSTANCE_WIDGET_PROPS (ii), Q_items, Qnil)) |
2546 { | 2557 { |
2547 add_tab_item (image_instance, wnd, XCAR (rest), domain, index); | 2558 add_tab_item (image_instance, wnd, XCAR (rest), domain, index); |
2548 index++; | 2559 index++; |
2549 } | 2560 } |
2561 } | |
2562 | |
2563 /* set the properties of a tab control */ | |
2564 static Lisp_Object | |
2565 mswindows_tab_control_set_property (Lisp_Object image_instance, Lisp_Object prop, | |
2566 Lisp_Object val) | |
2567 { | |
2568 struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); | |
2569 | |
2570 if (EQ (prop, Q_items)) | |
2571 { | |
2572 HWND wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii); | |
2573 int index = 0; | |
2574 Lisp_Object rest; | |
2575 check_valid_item_list_1 (val); | |
2576 | |
2577 /* delete the pre-existing items */ | |
2578 SendMessage (wnd, TCM_DELETEALLITEMS, 0, 0); | |
2579 | |
2580 /* add items to the tab */ | |
2581 LIST_LOOP (rest, val) | |
2582 { | |
2583 add_tab_item (image_instance, wnd, XCAR (rest), | |
2584 IMAGE_INSTANCE_SUBWINDOW_FRAME (ii), index); | |
2585 index++; | |
2586 } | |
2587 | |
2588 return Qt; | |
2589 } | |
2590 return Qunbound; | |
2550 } | 2591 } |
2551 | 2592 |
2552 /* instantiate a static control possible for putting other things in */ | 2593 /* instantiate a static control possible for putting other things in */ |
2553 static void | 2594 static void |
2554 mswindows_label_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, | 2595 mswindows_label_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, |
2737 CONSOLE_HAS_METHOD (mswindows, update_subwindow); | 2778 CONSOLE_HAS_METHOD (mswindows, update_subwindow); |
2738 CONSOLE_HAS_METHOD (mswindows, image_instance_equal); | 2779 CONSOLE_HAS_METHOD (mswindows, image_instance_equal); |
2739 CONSOLE_HAS_METHOD (mswindows, image_instance_hash); | 2780 CONSOLE_HAS_METHOD (mswindows, image_instance_hash); |
2740 CONSOLE_HAS_METHOD (mswindows, init_image_instance_from_eimage); | 2781 CONSOLE_HAS_METHOD (mswindows, init_image_instance_from_eimage); |
2741 CONSOLE_HAS_METHOD (mswindows, locate_pixmap_file); | 2782 CONSOLE_HAS_METHOD (mswindows, locate_pixmap_file); |
2783 CONSOLE_HAS_METHOD (mswindows, resize_subwindow); | |
2742 } | 2784 } |
2743 | 2785 |
2744 void | 2786 void |
2745 image_instantiator_format_create_glyphs_mswindows (void) | 2787 image_instantiator_format_create_glyphs_mswindows (void) |
2746 { | 2788 { |
2813 IIFORMAT_HAS_DEVMETHOD (mswindows, tree_view, instantiate); | 2855 IIFORMAT_HAS_DEVMETHOD (mswindows, tree_view, instantiate); |
2814 | 2856 |
2815 /* tab control widget */ | 2857 /* tab control widget */ |
2816 INITIALIZE_DEVICE_IIFORMAT (mswindows, tab_control); | 2858 INITIALIZE_DEVICE_IIFORMAT (mswindows, tab_control); |
2817 IIFORMAT_HAS_DEVMETHOD (mswindows, tab_control, instantiate); | 2859 IIFORMAT_HAS_DEVMETHOD (mswindows, tab_control, instantiate); |
2860 IIFORMAT_HAS_DEVMETHOD (mswindows, tab_control, set_property); | |
2818 | 2861 |
2819 /* windows bitmap format */ | 2862 /* windows bitmap format */ |
2820 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (bmp, "bmp"); | 2863 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (bmp, "bmp"); |
2821 IIFORMAT_HAS_METHOD (bmp, validate); | 2864 IIFORMAT_HAS_METHOD (bmp, validate); |
2822 IIFORMAT_HAS_METHOD (bmp, normalize); | 2865 IIFORMAT_HAS_METHOD (bmp, normalize); |