Changeset 2996
- Timestamp:
- 02/17/03 20:21:45 (6 years ago)
- Files:
-
- work/cvs2svn/src/ChangeLog.Meadow (modified) (1 diff)
- work/cvs2svn/src/mw32fns.c (modified) (4 diffs)
- work/cvs2svn/src/mw32font.c (modified) (1 diff)
- work/cvs2svn/src/mw32term.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
work/cvs2svn/src/ChangeLog.Meadow
r2995 r2996 1 2003-02-17 MIYOSHI Masanori <miyoshi@boreas.dti.ne.jp> 2 3 * mw32fns.c (mw32_cross_disabled_image): Restore the GDI object 4 that has been attached to the DC object. 5 6 * mw32font.c (mw32_lf_equal): Compare font requests instead of 7 font infos. 8 9 * mw32term.c (mw32_free_frame_resources): Free resources of 10 menubar and faces. 11 (x_destroy_window): Free frame resources before the destruction of 12 a window. 13 (mw32_draw_relief_rect): Restore the GDI object that has been 14 attached to the DC object. 15 (mw32_draw_box_rect): Ditto. 16 1 17 2003-02-14 MIYOSHI Masanori <miyoshi@boreas.dti.ne.jp> 2 18 work/cvs2svn/src/mw32fns.c
r2989 r2996 7827 7827 struct image *img; 7828 7828 { 7829 HDC hdc = FRAME_HDC (f);7829 HDC hdc = FRAME_HDC (f); 7830 7830 HDC hCompatDC; 7831 7831 HBITMAP hbmp, hbmpmask; … … 7833 7833 BITMAPINFO *pbmpinfo = pmimg->pbmpinfo; 7834 7834 unsigned char *pdata; 7835 HGDIOBJ hold1, hold2; 7835 7836 7836 7837 if (!cross_disabled_images) return; 7837 7838 7838 hCompatDC = CreateCompatibleDC (hdc);7839 hCompatDC = CreateCompatibleDC (hdc); 7839 7840 7840 7841 hbmp = CreateDIBSection (hCompatDC, pbmpinfo, DIB_RGB_COLORS, 7841 7842 (void **)&pdata, NULL, 0); 7842 if (!hbmp)7843 { 7844 DeleteDC (hCompatDC);7843 if (!hbmp) 7844 { 7845 DeleteDC (hCompatDC); 7845 7846 return; 7846 7847 } 7847 memcpy(pdata, pmimg->pbmpdata, pmimg->size); 7848 7849 SelectObject(hCompatDC, hbmp); 7850 SelectObject(hCompatDC, GetStockObject(BLACK_BRUSH)); 7851 MoveToEx(hCompatDC, 0, 0, NULL); 7852 LineTo(hCompatDC, img->width, img->height); 7853 MoveToEx(hCompatDC, img->width, 0, NULL); 7854 LineTo(hCompatDC, 0, img->height); 7855 7856 memcpy(pmimg->pbmpdata, pdata, pmimg->size); 7857 DeleteObject(hbmp); 7848 memcpy (pdata, pmimg->pbmpdata, pmimg->size); 7849 7850 hold1 = SelectObject (hCompatDC, hbmp); 7851 hold2 = SelectObject (hCompatDC, GetStockObject (BLACK_BRUSH)); 7852 MoveToEx (hCompatDC, 0, 0, NULL); 7853 LineTo (hCompatDC, img->width, img->height); 7854 MoveToEx (hCompatDC, img->width, 0, NULL); 7855 LineTo (hCompatDC, 0, img->height); 7856 7857 memcpy (pmimg->pbmpdata, pdata, pmimg->size); 7858 SelectObject (hCompatDC, hold2); 7859 SelectObject (hCompatDC, hold1); 7860 DeleteObject (hbmp); 7858 7861 7859 7862 if (pmimg->pbmpmask) … … 7864 7867 } maskinfo; 7865 7868 7866 memset (&maskinfo, 0, sizeof(maskinfo));7867 maskinfo.h.biSize = sizeof (BITMAPINFOHEADER);7869 memset (&maskinfo, 0, sizeof (maskinfo)); 7870 maskinfo.h.biSize = sizeof (BITMAPINFOHEADER); 7868 7871 maskinfo.h.biWidth = pmimg->pbmpinfo->bmiHeader.biWidth; 7869 7872 maskinfo.h.biHeight = pmimg->pbmpinfo->bmiHeader.biHeight; … … 7871 7874 maskinfo.h.biBitCount = 1; 7872 7875 maskinfo.h.biCompression = BI_RGB; 7873 maskinfo.c[1].rgbRed = maskinfo.c[1].rgbGreen = maskinfo.c[1].rgbBlue = 255; 7874 7875 hbmp = CreateDIBSection (hCompatDC, (LPBITMAPINFO)&maskinfo, 7876 maskinfo.c[1].rgbRed = maskinfo.c[1].rgbGreen 7877 = maskinfo.c[1].rgbBlue = 255; 7878 7879 hbmp = CreateDIBSection (hCompatDC, (LPBITMAPINFO) &maskinfo, 7876 7880 DIB_RGB_COLORS, (void **) &pdata, 7877 7881 NULL, 0); 7878 7882 if (!(hbmp)) 7879 7883 { 7880 DeleteDC (hCompatDC);7884 DeleteDC (hCompatDC); 7881 7885 return; 7882 7886 } 7883 7887 memcpy (pdata, pmimg->pbmpmask, pmimg->mask_size); 7884 7888 7885 SelectObject(hCompatDC, hbmp);7886 SelectObject(hCompatDC, GetStockObject(WHITE_BRUSH));7887 MoveToEx (hCompatDC, 0, 0, NULL);7888 LineTo (hCompatDC, img->width, img->height);7889 MoveToEx (hCompatDC, img->width, 0, NULL);7890 LineTo (hCompatDC, 0, img->height);7889 hold1 = SelectObject (hCompatDC, hbmp); 7890 hold2 = SelectObject (hCompatDC, GetStockObject (WHITE_BRUSH)); 7891 MoveToEx (hCompatDC, 0, 0, NULL); 7892 LineTo (hCompatDC, img->width, img->height); 7893 MoveToEx (hCompatDC, img->width, 0, NULL); 7894 LineTo (hCompatDC, 0, img->height); 7891 7895 memcpy (pmimg->pbmpmask, pdata, pmimg->mask_size); 7892 7896 7893 DeleteObject(hbmp); 7894 } 7895 7896 DeleteDC(hCompatDC); 7897 SelectObject (hCompatDC, hold2); 7898 SelectObject (hCompatDC, hold1); 7899 DeleteObject (hbmp); 7900 } 7901 7902 DeleteDC (hCompatDC); 7897 7903 return; 7898 7904 } work/cvs2svn/src/mw32font.c
r2995 r2996 1290 1290 1291 1291 static int 1292 mw32_lf_equal (MW32LogicalFont *plf1, MW32LogicalFont *plf2)1292 mw32_lf_equal (MW32LogicalFont *plf1, MW32LogicalFont *plf2) 1293 1293 { 1294 1294 #define LF_EQUAL_ELEM(elem) (plf1->elem == plf2->elem) 1295 return (LF_EQUAL_ELEM(width) 1296 && LF_EQUAL_ELEM(ascent) 1297 && LF_EQUAL_ELEM(descent) 1298 && LF_EQUAL_ELEM(overhang) 1299 && LF_EQUAL_ELEM(encoding_type) 1300 && LF_EQUAL_ELEM(relative_compose) 1301 && LF_EQUAL_ELEM(character_spacing) 1302 && LF_EQUAL_ELEM(default_ascent) 1303 && LF_EQUAL_ELEM(fixed_pitch) 1304 && LF_EQUAL_ELEM(dim) 1305 && LF_EQUAL_ELEM(hash) 1306 && LF_EQUAL_ELEM(textout) 1307 && LF_EQUAL_ELEM(glyph_metric) 1308 && LF_EQUAL_ELEM(set_layout) 1309 && LF_EQUAL_ELEM(free) 1310 && mw32_ccl_method_equal(plf1->ccl_method, plf2->ccl_method) 1311 && plf1->fontip && plf2->fontip 1312 && strcmp(plf1->fontip->full_name, plf2->fontip->full_name) == 0); 1295 return (LF_EQUAL_ELEM (width) 1296 && LF_EQUAL_ELEM (ascent) 1297 && LF_EQUAL_ELEM (descent) 1298 && LF_EQUAL_ELEM (overhang) 1299 && LF_EQUAL_ELEM (encoding_type) 1300 && LF_EQUAL_ELEM (relative_compose) 1301 && LF_EQUAL_ELEM (character_spacing) 1302 && LF_EQUAL_ELEM (default_ascent) 1303 && LF_EQUAL_ELEM (fixed_pitch) 1304 && LF_EQUAL_ELEM (dim) 1305 && LF_EQUAL_ELEM (hash) 1306 && LF_EQUAL_ELEM (textout) 1307 && LF_EQUAL_ELEM (glyph_metric) 1308 && LF_EQUAL_ELEM (set_layout) 1309 && LF_EQUAL_ELEM (free) 1310 && LF_EQUAL_ELEM (pfr) 1311 && mw32_ccl_method_equal (plf1->ccl_method, plf2->ccl_method)); 1313 1312 #undef LF_EQUAL_ELEM 1314 1313 } work/cvs2svn/src/mw32term.c
r2995 r2996 615 615 xassert (i < MAX_DC_NUM); 616 616 RestoreDC (hdc, -1); 617 ReleaseDC (FRAME_MW32_WINDOW (f), hdc);617 ReleaseDC (FRAME_MW32_WINDOW (f), hdc); 618 618 } 619 619 } … … 3605 3605 LOGBRUSH logpenbrush; 3606 3606 HPEN hp1, hp2, hptmp; 3607 HGDIOBJ hold1, hold2; 3608 3607 3609 logpenbrush.lbStyle = BS_SOLID; 3608 3610 logpenbrush.lbHatch = 0; … … 3629 3631 } 3630 3632 3631 SelectObject (hdc, hp1);3633 hold1 = SelectObject (hdc, hp1); 3632 3634 if (left_p) 3633 3635 { … … 3648 3650 /* To draw the point (left_x, bottom_y), sub 1 to the end. */ 3649 3651 LineTo (hdc, left_x - 1, bottom_y); 3652 SelectObject (hdc, hold1); 3650 3653 } 3651 3654 else if (width > 1) … … 3669 3672 width--; 3670 3673 /* top-left. */ 3671 SelectObject (hdc, hp1);3672 SelectObject (hdc, hb1);3674 hold1 = SelectObject (hdc, hp1); 3675 hold2 = SelectObject (hdc, hb1); 3673 3676 if (left_p) 3674 3677 { … … 3704 3707 right_x + 1, bottom_y + 1); 3705 3708 } 3709 SelectObject (hdc, hold2); 3710 SelectObject (hdc, hold1); 3706 3711 DeleteObject (hb1); 3707 3712 DeleteObject (hb2); … … 3728 3733 HRGN rr_rgn; 3729 3734 HBRUSH hb; 3735 HGDIOBJ hold; 3730 3736 3731 3737 SaveDC (hdc); 3732 3738 hb = CreateSolidBrush (s->face->box_color); 3733 SelectObject (hdc, hb);3739 hold = SelectObject (hdc, hb); 3734 3740 if (clip_rgn != INVALID_HANDLE_VALUE) 3735 3741 SelectClipRgn (hdc, clip_rgn); … … 3754 3760 r.bottom = bottom_y; 3755 3761 FillRect (hdc, &r, hb); 3756 3762 3763 SelectObject (hdc, hold); 3757 3764 RestoreDC (hdc, -1); 3758 3765 DeleteObject (hb); … … 10023 10030 BLOCK_INPUT; 10024 10031 10032 free_frame_menubar (f); 10033 10034 if (FRAME_FACE_CACHE (f)) 10035 free_frame_faces (f); 10036 10025 10037 mw32_destroy_frame_hdc(f); 10026 10038 CloseHandle(f->output_data.mw32->mainthread_to_frame_handle); … … 10056 10068 MSG msg; 10057 10069 struct mw32_display_info *dpyinfo = FRAME_MW32_DISPLAY_INFO (f); 10058 10059 SEND_INFORM_MESSAGE (FRAME_MW32_WINDOW(f), 10060 WM_EMACS_DESTROY_FRAME, 0, 0); 10070 HWND hwnd = FRAME_MW32_WINDOW(f); 10071 10072 mw32_free_frame_resources (f); 10073 10074 SEND_INFORM_MESSAGE (hwnd, WM_EMACS_DESTROY_FRAME, 0, 0); 10061 10075 WAIT_REPLY_MESSAGE (&msg, WM_EMACS_DESTROY_FRAME_REPLY); 10062 10063 mw32_free_frame_resources (f);10064 10076 10065 10077 dpyinfo->reference_count--;
