comparison win/dw.c @ 1694:31f16da1052a

Fix warnings building with MinGW on Windows.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 02 May 2012 00:11:15 +0000
parents 31dd366acfc8
children 873304f581be
comparison
equal deleted inserted replaced
1693:b2311922a4de 1694:31f16da1052a
10112 int ratioy = (int)GetDeviceCaps(hdc, LOGPIXELSY)/96; 10112 int ratioy = (int)GetDeviceCaps(hdc, LOGPIXELSY)/96;
10113 if(ratiox > 1 && ratioy > 1) 10113 if(ratiox > 1 && ratioy > 1)
10114 { 10114 {
10115 if(mult) 10115 if(mult)
10116 { 10116 {
10117 *x *= ratiox; 10117 if(x)
10118 *y *= ratioy; 10118 *x *= ratiox;
10119 if(y)
10120 *y *= ratioy;
10119 } 10121 }
10120 else 10122 else
10121 { 10123 {
10122 *x /= ratiox; 10124 if(x)
10123 *y /= ratioy; 10125 *x /= ratiox;
10126 if(y)
10127 *y /= ratioy;
10124 } 10128 }
10125 } 10129 }
10126 } 10130 }
10127 #endif 10131 #endif
10128 10132
10230 } 10234 }
10231 oldFont = SelectObject(hdc, hFont); 10235 oldFont = SelectObject(hdc, hFont);
10232 10236
10233 GetTextExtentPoint32(hdc, wtext, (int)_tcslen(wtext), &sz); 10237 GetTextExtentPoint32(hdc, wtext, (int)_tcslen(wtext), &sz);
10234 10238
10235 #ifdef GDIPLUS
10236 _convert_dpi(hdc, &(sz.cx), &(sz.cy), FALSE);
10237 #endif
10238
10239 if(width) 10239 if(width)
10240 *width = sz.cx; 10240 *width = sz.cx;
10241 10241
10242 if(height) 10242 if(height)
10243 *height = sz.cy; 10243 *height = sz.cy;
10244
10245 #ifdef GDIPLUS
10246 _convert_dpi(hdc, width, height, FALSE);
10247 #endif
10244 10248
10245 SelectObject(hdc, oldFont); 10249 SelectObject(hdc, oldFont);
10246 if(mustdelete) 10250 if(mustdelete)
10247 DeleteObject(hFont); 10251 DeleteObject(hFont);
10248 if(!pixmap) 10252 if(!pixmap)
11706 */ 11710 */
11707 int API dw_print_run(HPRINT print, unsigned long flags) 11711 int API dw_print_run(HPRINT print, unsigned long flags)
11708 { 11712 {
11709 DWPrint *p = print; 11713 DWPrint *p = print;
11710 HPIXMAP pixmap; 11714 HPIXMAP pixmap;
11711 int x, result = DW_ERROR_UNKNOWN; 11715 int x, width, height, result = DW_ERROR_UNKNOWN;
11712 11716
11713 if(!p) 11717 if(!p)
11714 return result; 11718 return result;
11715 11719
11716 if (!(pixmap = calloc(1,sizeof(struct _hpixmap)))) 11720 if (!(pixmap = calloc(1,sizeof(struct _hpixmap))))
11717 return result; 11721 return result;
11718 11722
11719 pixmap->width = GetDeviceCaps(p->pd.hDC, HORZRES); 11723 width = GetDeviceCaps(p->pd.hDC, HORZRES);
11720 pixmap->height = GetDeviceCaps(p->pd.hDC, VERTRES); 11724 height = GetDeviceCaps(p->pd.hDC, VERTRES);
11721 11725
11722 pixmap->hbm = CreateCompatibleBitmap(p->pd.hDC, pixmap->width, pixmap->height); 11726 pixmap->hbm = CreateCompatibleBitmap(p->pd.hDC, width, height);
11723 pixmap->hdc = p->pd.hDC; 11727 pixmap->hdc = p->pd.hDC;
11724 pixmap->transcolor = DW_RGB_TRANSPARENT; 11728 pixmap->transcolor = DW_RGB_TRANSPARENT;
11725 11729
11726 #ifdef GDIPLUS 11730 #ifdef GDIPLUS
11727 /* Convert the size based on the DPI */ 11731 /* Convert the size based on the DPI */
11728 _convert_dpi(pixmap->hdc, &(pixmap->width), &(pixmap->height), FALSE); 11732 _convert_dpi(pixmap->hdc, &width, &height, FALSE);
11729 #endif 11733 #endif
11734
11735 pixmap->width = width;
11736 pixmap->height = height;
11730 11737
11731 SelectObject(pixmap->hdc, pixmap->hbm); 11738 SelectObject(pixmap->hdc, pixmap->hbm);
11732 11739
11733 /* Start the job */ 11740 /* Start the job */
11734 StartDoc(p->pd.hDC, &(p->di)); 11741 StartDoc(p->pd.hDC, &(p->di));