From: <kr_...@us...> - 2004-05-07 12:45:52
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21556/src/cbits/Win32 Modified Files: Canvas.c Internals.h Log Message: Remove GetResolution and GetScaleFactors functions Index: Canvas.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Canvas.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Canvas.c 24 Aug 2003 19:02:45 -0000 1.9 --- Canvas.c 7 May 2004 12:45:42 -0000 1.10 *************** *** 2,10 **** #include "Internals.h" ! int osGetVertResolution (void) { ! static int res = 0; ! if (res == 0) { HDC screen; --- 2,10 ---- #include "Internals.h" ! int osMMtoVPixels(double mm) { ! static int vres = 0; ! if (vres == 0) { HDC screen; *************** *** 15,48 **** exit(1); } ! res = GetDeviceCaps (screen, LOGPIXELSY); DeleteDC (screen); }; ! return res; ! } /* osGetVertResolution */ ! int osGetHorzResolution (void) { ! static int res = 0; ! if (res == 0) { HDC screen; screen = CreateDC ("DISPLAY", NULL, NULL, NULL); ! res = GetDeviceCaps (screen, LOGPIXELSX); DeleteDC (screen); }; ! return res; ! } /* osGetHorzResolution */ ! ! int osMMtoVPixels(double mm) ! { ! return (int) ((mm/25.4) * osGetVertResolution()); ! } ! ! int osMMtoHPixels(double mm) ! { ! return (int) ((mm/25.4) * osGetHorzResolution()); } --- 15,38 ---- exit(1); } ! vres = GetDeviceCaps (screen, LOGPIXELSY); DeleteDC (screen); }; ! return (int) ((mm/25.4) * vres); ! } ! int osMMtoHPixels(double mm) { ! static int hres = 0; ! if (hres == 0) { HDC screen; screen = CreateDC ("DISPLAY", NULL, NULL, NULL); ! hres = GetDeviceCaps (screen, LOGPIXELSX); DeleteDC (screen); }; ! return (int) ((mm/25.4) * hres); } *************** *** 343,347 **** SetBkMode(canvas->hDC, bkMode ? OPAQUE : TRANSPARENT); ! SelectObject (canvas->hDC, font); canvas->theFont = font; --- 333,337 ---- SetBkMode(canvas->hDC, bkMode ? OPAQUE : TRANSPARENT); ! SelectObject (canvas->hDC, font); canvas->theFont = font; *************** *** 561,599 **** /*----------------------------- ! Font stuff -----------------------------*/ - void osGetResolution(CanvasHandle canvas, int *xResP, int *yResP) - { - int mapMode = GetMapMode(canvas->hDC); - if (mapMode==MM_ISOTROPIC) - { *xResP = osGetHorzResolution(); - *yResP = osGetVertResolution(); - } - else - { *xResP = GetDeviceCaps(canvas->hDC,LOGPIXELSX); - *yResP = GetDeviceCaps(canvas->hDC,LOGPIXELSY); - }; - } /* osGetResolution */ - - void osGetScaleFactor(CanvasHandle canvas, int *nh, int *dh, int *nv, int *dv) - { - if (GetMapMode(canvas->hDC)==MM_TEXT) - { *nh = 1; - *dh = 1; - *nv = 1; - *dv = 1; - } - else - { SIZE sRes,pRes; - GetWindowExtEx (canvas->hDC,&sRes); - GetViewportExtEx(canvas->hDC,&pRes); - *nh = pRes.cx; - *dh = sRes.cx; - *nv = pRes.cy; - *dv = sRes.cy; - }; - } /* osGetScaleFactor */ - unsigned int osGetDialogColor() { --- 551,557 ---- /*----------------------------- ! Colors stuff -----------------------------*/ unsigned int osGetDialogColor() { Index: Internals.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Internals.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Internals.h 7 May 2004 10:22:00 -0000 1.19 --- Internals.h 7 May 2004 12:45:42 -0000 1.20 *************** *** 72,77 **** void DrawCheckListBoxItem(LPDRAWITEMSTRUCT lpDIS); - int osGetVertResolution(); - int osGetHorzResolution(); - #endif --- 72,74 ---- |