comparison src/glyphs-msw.c @ 371:cc15677e0335 r21-2b1

Import from CVS: tag r21-2b1
author cvs
date Mon, 13 Aug 2007 11:03:08 +0200
parents 4711e16a8e49
children 6240c7796c7a
comparison
equal deleted inserted replaced
370:bd866891f083 371:cc15677e0335
519 hcdc, 0, 0, 519 hcdc, 0, 0,
520 IMAGE_INSTANCE_PIXMAP_WIDTH (ii), 520 IMAGE_INSTANCE_PIXMAP_WIDTH (ii),
521 IMAGE_INSTANCE_PIXMAP_HEIGHT (ii), 521 IMAGE_INSTANCE_PIXMAP_HEIGHT (ii),
522 SRCCOPY)) 522 SRCCOPY))
523 { 523 {
524 DeleteObject (newbmp);
525 DeleteDC (hdcDst);
526 return 0; 524 return 0;
527 } 525 }
528 526
529 SelectObject (hdcDst, old2); 527 SelectObject (hdcDst, old2);
530 SelectObject (hcdc, old1); 528 SelectObject (hcdc, old1);
553 hcdc, 0, 0, 551 hcdc, 0, 0,
554 IMAGE_INSTANCE_PIXMAP_WIDTH (ii), 552 IMAGE_INSTANCE_PIXMAP_WIDTH (ii),
555 IMAGE_INSTANCE_PIXMAP_HEIGHT (ii), 553 IMAGE_INSTANCE_PIXMAP_HEIGHT (ii),
556 SRCCOPY)) 554 SRCCOPY))
557 { 555 {
558 DeleteObject (newmask);
559 DeleteDC (hdcDst);
560 return NULL; 556 return NULL;
561 } 557 }
562 558
563 SelectObject (hdcDst, old2); 559 SelectObject (hdcDst, old2);
564 SelectObject (hcdc, old1); 560 SelectObject (hcdc, old1);
1009 #define OIC_HAND 32513 1005 #define OIC_HAND 32513
1010 #define OIC_QUES 32514 1006 #define OIC_QUES 32514
1011 #define OIC_BANG 32515 1007 #define OIC_BANG 32515
1012 #define OIC_NOTE 32516 1008 #define OIC_NOTE 32516
1013 #define OIC_WINLOGO 32517 1009 #define OIC_WINLOGO 32517
1014 #if defined (__CYGWIN32__) && CYGWIN_VERSION_DLL_MAJOR < 21
1015 #define LR_SHARED 0x8000 1010 #define LR_SHARED 0x8000
1016 #endif
1017 #endif 1011 #endif
1018 1012
1019 static CONST resource_t bitmap_table[] = 1013 static CONST resource_t bitmap_table[] =
1020 { 1014 {
1021 /* bitmaps */ 1015 /* bitmaps */
1041 { "rgarrowi", OBM_RGARROWI }, 1035 { "rgarrowi", OBM_RGARROWI },
1042 { "lfarrowi", OBM_LFARROWI }, 1036 { "lfarrowi", OBM_LFARROWI },
1043 { "size", OBM_SIZE }, 1037 { "size", OBM_SIZE },
1044 { "btsize", OBM_BTSIZE }, 1038 { "btsize", OBM_BTSIZE },
1045 { "check", OBM_CHECK }, 1039 { "check", OBM_CHECK },
1046 { "checkboxes", OBM_CHECKBOXES }, 1040 { "cehckboxes", OBM_CHECKBOXES },
1047 { "btncorners" , OBM_BTNCORNERS }, 1041 { "btncorners" , OBM_BTNCORNERS },
1048 {0} 1042 {0}
1049 }; 1043 };
1050 1044
1051 static CONST resource_t cursor_table[] = 1045 static CONST resource_t cursor_table[] =
1540 xbm_create_bitmap_from_data (HDC hdc, char *data, 1534 xbm_create_bitmap_from_data (HDC hdc, char *data,
1541 unsigned int width, unsigned int height, 1535 unsigned int width, unsigned int height,
1542 int mask, COLORREF fg, COLORREF bg) 1536 int mask, COLORREF fg, COLORREF bg)
1543 { 1537 {
1544 int old_width = (width + 7)/8; 1538 int old_width = (width + 7)/8;
1545 int new_width = BPLINE (2*((width + 15)/16)); 1539 int new_width = 2*((width + 15)/16);
1546 unsigned char *offset; 1540 unsigned char *offset;
1547 void *bmp_buf = 0; 1541 void *bmp_buf = 0;
1548 unsigned char *new_data, *new_offset; 1542 unsigned char *new_data, *new_offset;
1549 int i, j; 1543 int i, j;
1550 BITMAPINFO* bmp_info = 1544 BITMAPINFO* bmp_info =
1732 if (NILP (foreground)) 1726 if (NILP (foreground))
1733 foreground = pointer_fg; 1727 foreground = pointer_fg;
1734 if (NILP (background)) 1728 if (NILP (background))
1735 background = pointer_bg; 1729 background = pointer_bg;
1736 1730
1737 IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii) = 1731 XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii),
1738 find_keyword_in_vector (instantiator, Q_hotspot_x); 1732 find_keyword_in_vector (instantiator, Q_hotspot_x));
1739 IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii) = 1733 XSETINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii),
1740 find_keyword_in_vector (instantiator, Q_hotspot_y); 1734 find_keyword_in_vector (instantiator, Q_hotspot_y));
1741 IMAGE_INSTANCE_PIXMAP_FG (ii) = foreground; 1735 IMAGE_INSTANCE_PIXMAP_FG (ii) = foreground;
1742 IMAGE_INSTANCE_PIXMAP_BG (ii) = background; 1736 IMAGE_INSTANCE_PIXMAP_BG (ii) = background;
1743 if (COLOR_INSTANCEP (foreground)) 1737 if (COLOR_INSTANCEP (foreground))
1744 fg = COLOR_INSTANCE_MSWINDOWS_COLOR (XCOLOR_INSTANCE (foreground)); 1738 fg = COLOR_INSTANCE_MSWINDOWS_COLOR (XCOLOR_INSTANCE (foreground));
1745 if (COLOR_INSTANCEP (background)) 1739 if (COLOR_INSTANCEP (background))