Update of /cvsroot/win32forth/win32forth/src/gdi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26322/src/gdi Modified Files: gdiBase.f gdiBitmap.f gdiBrush.f gdiDC.f gdiFont.f gdiMetafile.f gdiMetafileDc.f gdiPen.f gdiWindowDc.f Log Message: More documentation added. Index: gdiMetafile.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/gdi/gdiMetafile.f,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gdiMetafile.f 5 Nov 2005 14:08:13 -0000 1.3 --- gdiMetafile.f 26 Dec 2005 09:28:23 -0000 1.4 *************** *** 1,7 **** ! \ gdiMetafile.f ! \ ! \ Written by Dirk Busch ! \ Sonntag, Oktober 09 2005 ! \ Licence: Public Domain cr .( Loading GDI class library - Metafile...) --- 1,8 ---- ! \ *D doc\classes\ ! \ *! gdiMetafile ! \ *T gdiMetafile -- Metafile class ! \ *Q Version 1.0 ! \ ** This GDI class library was written and placed in the Public Domain ! \ ** in 2005 by Dirk Busch cr .( Loading GDI class library - Metafile...) *************** *** 14,20 **** \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ - \ Metafile class - This class only support's enhanced metafiles (emf) ! \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ :class gdiMetafile <super gdiObject rectangle RECT --- 15,21 ---- \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ :class gdiMetafile <super gdiObject + \ *G Metafile class. This class only support's enhanced metafiles (emf) ! rectangle RECT *************** *** 112,115 **** --- 113,119 ---- ;class + \ *G End of gdiMetafile class module + + \ *Z Index: gdiBitmap.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/gdi/gdiBitmap.f,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gdiBitmap.f 1 Nov 2005 12:21:40 -0000 1.1 --- gdiBitmap.f 26 Dec 2005 09:28:23 -0000 1.2 *************** *** 1,7 **** ! \ gdiBitmap.f ! \ ! \ Written by Dirk Busch ! \ Sonntag, Oktober 09 2005 ! \ Licence: Public Domain cr .( Loading GDI class library - Bitmap...) --- 1,9 ---- ! \ *D doc\classes\ ! \ *! gdiBitmap ! \ *T gdiBitmap -- GDI Bitmap class. ! \ *Q Version 1.0 ! \ ** This GDI class library was written and placed in the Public Domain ! \ ** in 2005 by Dirk Busch ! \ *S Glossary cr .( Loading GDI class library - Bitmap...) *************** *** 16,20 **** --- 18,24 ---- \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ + \ *W <a name="gdiBitmap"></a> :class gdiBitmap <super gdiObject + \ *G Bitmap class gdiSize SIZE *************** *** 24,215 **** ;M - \ The CreateBitmap function creates a bitmap with the specified width, height, - \ and color format (color planes and bits-per-pixel). - \ - \ Width Specifies the bitmap width, in pixels. - \ Height Specifies the bitmap height, in pixels. - \ Planes Specifies the number of color planes used by the device. - \ BitsPerPel Specifies the number of bits required to identify the color of a - \ single pixel. - \ pBits Pointer to an array of color data used to set the colors in a rectangle - \ of pixels. Each scan line in the rectangle must be word aligned (scan - \ lines that are not word aligned must be padded with zeros). If this - \ parameter is NULL, the contents of the new bitmap is undefined. - \ - \ After a bitmap is created, it can be selected into a device context by calling - \ the SelectObject function. The CreateBitmap function can be used to create color - \ bitmaps. However, for performance reasons applications should use CreateBitmap - \ to create monochrome bitmaps and CreateCompatibleBitmap to create color bitmaps. - \ When a color bitmap returned from CreateBitmap is selected into a device context, - \ the system must ensure that the bitmap matches the format of the device context - \ it is being selected into. Since CreateCompatibleBitmap takes a device context, - \ it returns a bitmap that has the same format as the specified device context. - \ Because of this, subsequent calls to SelectObject are faster than with a color - \ bitmap returned from CreateBitmap. - \ - \ If the bitmap is monochrome, zeros represent the foreground color and ones represent - \ the background color for the destination device context. - \ - \ If an application sets the nWidth or nHeight parameters to zero, CreateBitmap - \ returns the handle to a 1-by-1 pixel, monochrome bitmap. - \ - \ When you no longer need the bitmap, call the Destroy: method to delete it. - \ - \ Windows 95/98: The created bitmap cannot exceed 16MB in size :M CreateBitmap: ( Width Height Planes BitsPerPel pBits -- f ) 5reverse call CreateBitmap SetHandle: super Valid?: super ;M - \ The CreateBitmapIndirect function creates a bitmap with the specified width, - \ height, and color format (color planes and bits-per-pixel). - \ pBitmap Pointer to a BITMAP structure that contains information about the - \ bitmap. If an application sets the bmWidth or bmHeight members to zero, - \ CreateBitmapIndirect returns the handle to a 1-by-1 pixel, monochrome bitmap. :M CreateBitmapIndirect: ( pBitmap -- f ) call CreateBitmapIndirect SetHandle: super Valid?: super ;M - \ The CreateCompatibleBitmap function creates a bitmap compatible with the device - \ that is associated with the specified device context. - \ - \ The color format of the bitmap created by the CreateCompatibleBitmap function - \ matches the color format of the device identified by the hdc parameter. This - \ bitmap can be selected into any memory device context that is compatible with - \ the original device. - \ - \ Because memory device contexts allow both color and monochrome bitmaps, the format - \ of the bitmap returned by the CreateCompatibleBitmap function differs when the - \ specified device context is a memory device context. However, a compatible bitmap - \ that was created for a nonmemory device context always possesses the same color - \ format and uses the same color palette as the specified device context. - \ - \ Note: When a memory device context is created, it initially has a 1-by-1 monochrome - \ bitmap selected into it. If this memory device context is used in CreateCompatibleBitmap, - \ the bitmap that is created is a monochrome bitmap. To create a color bitmap, use the - \ hDC that was used to create the memory device context, as shown in the following code: - \ - \ HDC memDC = CreateCompatibleDC ( hDC ); - \ HBITMAP memBM = CreateCompatibleBitmap ( hDC ); - \ SelectObject ( memDC, memBM ); - \ - \ If an application sets the nWidth or nHeight parameters to zero, CreateCompatibleBitmap - \ returns the handle to a 1-by-1 pixel, monochrome bitmap. - \ - \ If a DIB section, which is a bitmap created by the CreateDIBSection function, is selected - \ into the device context identified by the hdc parameter, CreateCompatibleBitmap creates a - \ DIB section. - \ - \ When you no longer need the bitmap, call the DeleteObject function to delete it. - \ - \ Windows 95/98: The created bitmap cannot exceed 16MB in size. :M CreateCompatibleBitmap: ( Width Height hDC -- f ) GetGdiObjectHandle >r swap r> call CreateCompatibleBitmap SetHandle: super Valid?: super ;M - \ The CreateDIBitmap function creates a device-dependent bitmap (DDB) from a DIB and, - \ optionally, sets the bitmap bits. - \ - \ lpbmih Pointer to a bitmap information header structure, which may be one of those - \ shown in the following table. Operating system Bitmap information header - \ Windows NT 3.51 and earlier BITMAPINFOHEADER - \ Windows NT 4.0 and Windows 95 BITMAPV4HEADER NOT SUPPORTED !!! - \ Windows 2000 and Windows 98 BITMAPV5HEADER NOT SUPPORTED !!! - \ - \ If fdwInit is CBM_INIT, the function uses the bitmap information header structure to - \ obtain the desired width and height of the bitmap as well as other information. Note - \ that a positive value for the height indicates a bottom-up DIB while a negative value - \ for the height indicates a top-down DIB. Calling CreateDIBitmap with fdwInit as CBM_INIT - \ is equivalent to calling the CreateCompatibleBitmap function to create a DDB in the format - \ of the device and then calling the SetDIBits function to translate the DIB bits to the DDB. - \ - \ fdwInit Specifies how the system initializes the bitmap bits. The following values is defined. - \ Value Meaning CBM_INIT If this flag is set, the system uses the data pointed to by the lpbInit - \ and lpbmi parameters to initialize the bitmap's bits. If this flag is clear, the data pointed - \ to by those parameters is not used. - \ - \ If fdwInit is zero, the system does not initialize the bitmap's bits. - \ - \ lpbInit Pointer to an array of bytes containing the initial bitmap data. The format of the data - \ depends on the biBitCount member of the BITMAPINFO structure to which the lpbmi parameter points. - \ - \ lpbmi Pointer to a BITMAPINFO structure that describes the dimensions and color format of the - \ array pointed to by the lpbInit parameter. - \ - \ fuUsage Specifies whether the bmiColors member of the BITMAPINFO structure was initialized and, - \ if so, whether bmiColors contains explicit red, green, blue (RGB) values or palette indexes. - \ The fuUsage parameter must be one of the following values. Value Meaning - \ DIB_PAL_COLORS A color table is provided and consists of an array of 16-bit indexes into the - \ logical palette of the device context into which the bitmap is to be selected. - \ DIB_RGB_COLORS A color table is provided and contains literal RGB values. :M CreateDIBitmap: ( pbmih fdwInit pbInit pbmi fuUsage hdc -- f ) GetGdiObjectHandle >r 5reverse r> call CreateDIBitmap SetHandle: super Valid?: super ;M - \ The CreateDIBSection function creates a DIB that applications can write to directly. The function - \ gives you a pointer to the location of the bitmap's bit values. You can supply a handle to a - \ file-mapping object that the function will use to create the bitmap, or you can let the system - \ allocate the memory for the bitmap. - \ - \ hdc Handle to a device context. If the value of iUsage is DIB_PAL_COLORS, the function uses - \ this device context's logical palette to initialize the DIB's colors. - \ - \ pbmi Pointer to a BITMAPINFO structure that specifies various attributes of the DIB, including - \ the bitmap's dimensions and colors. - \ - \ iUsage Specifies the type of data contained in the bmiColors array member of the BITMAPINFO - \ structure pointed to by pbmi (either logical palette indexes or literal RGB values). The - \ following values are defined. Value Meaning - \ DIB_PAL_COLORS The bmiColors member is an array of 16-bit indexes into the logical palette of - \ the device context specified by hdc. - \ DIB_RGB_COLORS The BITMAPINFO structure contains an array of literal RGB values. - \ - \ ppvBits Pointer to a variable that receives a pointer to the location of the DIB's bit values. - \ - \ hSection Handle to a file-mapping object that the function will use to create the DIB. This - \ parameter can be NULL. If hSection is not NULL, it must be a handle to a file-mapping object - \ created by calling the CreateFileMapping function with the PAGE_READWRITE or PAGE_WRITECOPY flag. - \ Read-only DIB sections are not supported. Handles created by other means will cause CreateDIBSection - \ to fail. If hSection is not NULL, the CreateDIBSection function locates the bitmap's bit values at - \ offset dwOffset in the file-mapping object referred to by hSection. An application can later retrieve - \ the hSection handle by calling the GetObject function with the HBITMAP returned by CreateDIBSection. - \ If hSection is NULL, the system allocates memory for the DIB. In this case, the CreateDIBSection - \ function ignores the dwOffset parameter. An application cannot later obtain a handle to this memory. - \ The dshSection member of the DIBSECTION structure filled in by calling the GetObject function will - \ be NULL. - \ - \ dwOffset Specifies the offset from the beginning of the file-mapping object referenced by hSection - \ where storage for the bitmap's bit values is to begin. This value is ignored if hSection is NULL. - \ The bitmap's bit values are aligned on doubleword boundaries, so dwOffset must be a multiple of the - \ size of a DWORD. :M CreateDIBSection: ( pbmi iUsage ppvBits hSection dwOffset hdc -- f ) GetGdiObjectHandle >r 5reverse r> call CreateDIBSection SetHandle: super Valid?: super ;M - \ The SetBitmapDimension function assigns preferred dimensions to a bitmap. These dimensions can be - \ used by applications; however, they are not used by the system. - \ Width Specifies the width, in 0.1-millimeter units, of the bitmap. - \ Height Specifies the height, in 0.1-millimeter units, of the bitmap. - \ An application can retrieve the dimensions assigned to a bitmap with the SetBitmapDimensionEx function - \ by calling the GetBitmapDimension function. - \ The bitmap identified by hBitmap cannot be a DIB section, which is a bitmap created by the - \ CreateDIBSection function. If the bitmap is a DIB section, the SetBitmapDimension function fails. :M SetBitmapDimension: ( width height -- oldwidth oldheight ) Addr: SIZE 3reverse hObject call SetBitmapDimensionEx ?win-error GetX: SIZE GetY: SIZE ;M - \ The GetBitmapDimension function retrieves the dimensions of a bitmap. The retrieved dimensions must - \ have been set by the SetBitmapDimension function. - \ The function returns the height and width of the bitmap, in .01-mm units. :M GetBitmapDimension: ( -- width height ) Addr: SIZE hObject call GetBitmapDimensionEx ?win-error GetX: SIZE GetY: SIZE ;M ! \ SetDIBits ! \ GetDIBits ! \ LoadBitmap ! \ MaskBlt ! \ PlgBlt ;class module --- 28,216 ---- ;M :M CreateBitmap: ( Width Height Planes BitsPerPel pBits -- f ) + \ *G The CreateBitmap function creates a bitmap with the specified width, height, + \ ** and color format (color planes and bits-per-pixel). \n + \ ** \n + \ ** Width Specifies the bitmap width, in pixels. \n + \ ** Height Specifies the bitmap height, in pixels. \n + \ ** Planes Specifies the number of color planes used by the device. \n + \ ** BitsPerPel Specifies the number of bits required to identify the color of a + \ ** single pixel. \n + \ ** pBits Pointer to an array of color data used to set the colors in a rectangle + \ ** of pixels. Each scan line in the rectangle must be word aligned (scan + \ ** lines that are not word aligned must be padded with zeros). If this + \ ** parameter is NULL, the contents of the new bitmap is undefined. \n + \ ** \n + \ ** After a bitmap is created, it can be selected into a device context by calling + \ ** the SelectObject function. The CreateBitmap function can be used to create color + \ ** bitmaps. However, for performance reasons applications should use CreateBitmap + \ ** to create monochrome bitmaps and CreateCompatibleBitmap to create color bitmaps. + \ ** When a color bitmap returned from CreateBitmap is selected into a device context, + \ ** the system must ensure that the bitmap matches the format of the device context + \ ** it is being selected into. Since CreateCompatibleBitmap takes a device context, + \ ** it returns a bitmap that has the same format as the specified device context. + \ ** Because of this, subsequent calls to SelectObject are faster than with a color + \ ** bitmap returned from CreateBitmap. \n + \ ** \n + \ ** If the bitmap is monochrome, zeros represent the foreground color and ones represent + \ ** the background color for the destination device context. \n + \ ** \n + \ ** If an application sets the nWidth or nHeight parameters to zero, CreateBitmap + \ ** returns the handle to a 1-by-1 pixel, monochrome bitmap. \n + \ ** \n + \ ** When you no longer need the bitmap, call the Destroy: method to delete it. \n + \ ** \n + \ ** Windows 95/98: The created bitmap cannot exceed 16MB in size 5reverse call CreateBitmap SetHandle: super Valid?: super ;M :M CreateBitmapIndirect: ( pBitmap -- f ) + \ *G The CreateBitmapIndirect function creates a bitmap with the specified width, + \ ** height, and color format (color planes and bits-per-pixel). + \ ** pBitmap Pointer to a BITMAP structure that contains information about the + \ ** bitmap. If an application sets the bmWidth or bmHeight members to zero, + \ ** CreateBitmapIndirect returns the handle to a 1-by-1 pixel, monochrome bitmap. call CreateBitmapIndirect SetHandle: super Valid?: super ;M :M CreateCompatibleBitmap: ( Width Height hDC -- f ) + \ *G The CreateCompatibleBitmap function creates a bitmap compatible with the device + \ ** that is associated with the specified device context. \n + \ ** \n + \ ** The color format of the bitmap created by the CreateCompatibleBitmap function + \ ** matches the color format of the device identified by the hdc parameter. This + \ ** bitmap can be selected into any memory device context that is compatible with + \ ** the original device. \n + \ ** \n + \ ** Because memory device contexts allow both color and monochrome bitmaps, the format + \ ** of the bitmap returned by the CreateCompatibleBitmap function differs when the + \ ** specified device context is a memory device context. However, a compatible bitmap + \ ** that was created for a nonmemory device context always possesses the same color + \ ** format and uses the same color palette as the specified device context. \n + \ ** \n + \ ** Note: When a memory device context is created, it initially has a 1-by-1 monochrome + \ ** bitmap selected into it. If this memory device context is used in CreateCompatibleBitmap, + \ ** the bitmap that is created is a monochrome bitmap. To create a color bitmap, use the + \ ** hDC that was used to create the memory device context, as shown in the following code: \n + \ ** \n + \ ** HDC memDC = CreateCompatibleDC ( hDC ); \n + \ ** HBITMAP memBM = CreateCompatibleBitmap ( hDC ); \n + \ ** SelectObject ( memDC, memBM ); \n + \ ** \n + \ ** If an application sets the nWidth or nHeight parameters to zero, CreateCompatibleBitmap + \ ** returns the handle to a 1-by-1 pixel, monochrome bitmap. \n + \ ** \n + \ ** If a DIB section, which is a bitmap created by the CreateDIBSection function, is selected + \ ** into the device context identified by the hdc parameter, CreateCompatibleBitmap creates a + \ ** DIB section. \n + \ ** \n + \ ** When you no longer need the bitmap, call the DeleteObject function to delete it. \n + \ ** \n + \ ** Windows 95/98: The created bitmap cannot exceed 16MB in size. GetGdiObjectHandle >r swap r> call CreateCompatibleBitmap SetHandle: super Valid?: super ;M :M CreateDIBitmap: ( pbmih fdwInit pbInit pbmi fuUsage hdc -- f ) + \ *G The CreateDIBitmap function creates a device-dependent bitmap (DDB) from a DIB and, + \ ** optionally, sets the bitmap bits. \n + \ ** lpbmih Pointer to a bitmap information header structure, which may be one of those + \ ** shown in the following table. + \ *L + \ *| Operating system | Bitmap information header + \ *| Windows NT 3.51 and earlier | BITMAPINFOHEADER | + \ *| Windows NT 4.0 and Windows 95 | BITMAPV4HEADER (NOT SUPPORTED !!!) | + \ *| Windows 2000 and Windows 98 | BITMAPV5HEADER (NOT SUPPORTED !!!) | + \ *P If fdwInit is CBM_INIT, the function uses the bitmap information header structure to + \ ** obtain the desired width and height of the bitmap as well as other information. Note + \ ** that a positive value for the height indicates a bottom-up DIB while a negative value + \ ** for the height indicates a top-down DIB. Calling CreateDIBitmap with fdwInit as CBM_INIT + \ ** is equivalent to calling the CreateCompatibleBitmap function to create a DDB in the format + \ ** of the device and then calling the SetDIBits function to translate the DIB bits to the DDB. \n + \ ** fdwInit Specifies how the system initializes the bitmap bits. The following values is defined. + \ ** Value Meaning CBM_INIT If this flag is set, the system uses the data pointed to by the lpbInit + \ ** and lpbmi parameters to initialize the bitmap's bits. If this flag is clear, the data pointed + \ ** to by those parameters is not used. \n + \ ** If fdwInit is zero, the system does not initialize the bitmap's bits. \n + \ ** lpbInit Pointer to an array of bytes containing the initial bitmap data. The format of the data + \ ** depends on the biBitCount member of the BITMAPINFO structure to which the lpbmi parameter points. \n + \ ** lpbmi Pointer to a BITMAPINFO structure that describes the dimensions and color format of the + \ ** array pointed to by the lpbInit parameter. \n + \ ** fuUsage Specifies whether the bmiColors member of the BITMAPINFO structure was initialized and, + \ ** if so, whether bmiColors contains explicit red, green, blue (RGB) values or palette indexes. + \ ** The fuUsage parameter must be one of the following values. + \ *L + \ *| DIB_PAL_COLORS | A color table is provided and consists of an array of 16-bit indexes into the logical palette of the device context into which the bitmap is to be selected. | + \ *| DIB_RGB_COLORS | A color table is provided and contains literal RGB values. | GetGdiObjectHandle >r 5reverse r> call CreateDIBitmap SetHandle: super Valid?: super ;M :M CreateDIBSection: ( pbmi iUsage ppvBits hSection dwOffset hdc -- f ) + \ *G The CreateDIBSection function creates a DIB that applications can write to directly. The function + \ ** gives you a pointer to the location of the bitmap's bit values. You can supply a handle to a + \ ** file-mapping object that the function will use to create the bitmap, or you can let the system + \ ** allocate the memory for the bitmap. \n + \ ** hdc Handle to a device context. If the value of iUsage is DIB_PAL_COLORS, the function uses + \ ** this device context's logical palette to initialize the DIB's colors. \n + \ ** pbmi Pointer to a BITMAPINFO structure that specifies various attributes of the DIB, including + \ ** the bitmap's dimensions and colors. \n + \ ** iUsage Specifies the type of data contained in the bmiColors array member of the BITMAPINFO + \ ** structure pointed to by pbmi (either logical palette indexes or literal RGB values). The + \ ** following values are defined. + \ *L + \ *| DIB_PAL_COLORS | The bmiColors member is an array of 16-bit indexes into the logical palette of the device context specified by hdc. | + \ *| DIB_RGB_COLORS | The BITMAPINFO structure contains an array of literal RGB values. | + \ *P ppvBits Pointer to a variable that receives a pointer to the location of the DIB's bit values. \n + \ ** hSection Handle to a file-mapping object that the function will use to create the DIB. This + \ ** parameter can be NULL. If hSection is not NULL, it must be a handle to a file-mapping object + \ ** created by calling the CreateFileMapping function with the PAGE_READWRITE or PAGE_WRITECOPY flag. + \ ** Read-only DIB sections are not supported. Handles created by other means will cause CreateDIBSection + \ ** to fail. If hSection is not NULL, the CreateDIBSection function locates the bitmap's bit values at + \ ** offset dwOffset in the file-mapping object referred to by hSection. An application can later retrieve + \ ** the hSection handle by calling the GetObject function with the HBITMAP returned by CreateDIBSection. + \ ** If hSection is NULL, the system allocates memory for the DIB. In this case, the CreateDIBSection + \ ** function ignores the dwOffset parameter. An application cannot later obtain a handle to this memory. + \ ** The dshSection member of the DIBSECTION structure filled in by calling the GetObject function will + \ ** be NULL. \n + \ ** dwOffset Specifies the offset from the beginning of the file-mapping object referenced by hSection + \ ** where storage for the bitmap's bit values is to begin. This value is ignored if hSection is NULL. + \ ** The bitmap's bit values are aligned on doubleword boundaries, so dwOffset must be a multiple of the + \ ** size of a DWORD. GetGdiObjectHandle >r 5reverse r> call CreateDIBSection SetHandle: super Valid?: super ;M :M SetBitmapDimension: ( width height -- oldwidth oldheight ) + \ *G The SetBitmapDimension function assigns preferred dimensions to a bitmap. These dimensions can be + \ ** used by applications; however, they are not used by the system. \n + \ ** Width Specifies the width, in 0.1-millimeter units, of the bitmap. \n + \ ** Height Specifies the height, in 0.1-millimeter units, of the bitmap. \n + \ ** An application can retrieve the dimensions assigned to a bitmap with the SetBitmapDimensionEx function + \ ** by calling the GetBitmapDimension function. \n + \ ** The bitmap identified by hBitmap cannot be a DIB section, which is a bitmap created by the + \ ** CreateDIBSection function. If the bitmap is a DIB section, the SetBitmapDimension function fails. Addr: SIZE 3reverse hObject call SetBitmapDimensionEx ?win-error GetX: SIZE GetY: SIZE ;M :M GetBitmapDimension: ( -- width height ) + \ *G The GetBitmapDimension function retrieves the dimensions of a bitmap. The retrieved dimensions must + \ ** have been set by the SetBitmapDimension function. + \ ** The function returns the height and width of the bitmap, in .01-mm units. Addr: SIZE hObject call GetBitmapDimensionEx ?win-error GetX: SIZE GetY: SIZE ;M ! :M SetDIBits: ;M ! \ *G not implemented, yet. ! :M GetDIBits: ;M ! \ *G not implemented, yet. ! :M LoadBitmap: ;M ! \ *G not implemented, yet. ! :M MaskBlt: ;M ! \ *G not implemented, yet. ! :M PlgBlt: ;M ! \ *G not implemented, yet. ;class + \ *G End of Bitmap class module + + \ *Z Index: gdiBrush.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/gdi/gdiBrush.f,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gdiBrush.f 17 Dec 2005 15:11:19 -0000 1.2 --- gdiBrush.f 26 Dec 2005 09:28:23 -0000 1.3 *************** *** 1,2 **** --- 1,3 ---- + \ *D doc\classes\ \ *! gdiBrush \ *T GdiBrush -- Classes for GDI Brushes. *************** *** 17,22 **** internal :class gdiBrush <super gdiObject ! \ *G Base class for all brush objects gdiPoint origin --- 18,25 ---- internal + \ *W <a name="gdiBrush"></a> :class gdiBrush <super gdiObject ! \ *G Base class for all brush objects. \n ! \ ** This is an internal class of the GDI Class library. Don't use it yourself. gdiPoint origin *************** *** 27,33 **** --- 30,58 ---- :M SetOrigin: { xOrg yOrg hdc -- } + \ *G Set the brush origin that GDI assigns to the next brush an application selects + \ ** into the specified device context. \n + \ ** Note: hdc can be the address of a gdiDC class instance or a DC handle. \n + \ ** A brush is a bitmap that the system uses to paint the interiors of filled shapes. \n + \ ** The brush origin is a pair of coordinates specifying the location of one pixel in + \ ** the bitmap. The default brush origin coordinates are (0,0). For horizontal coordinates, + \ ** the value 0 corresponds to the leftmost column of pixels; the width corresponds to the + \ ** rightmost column. For vertical coordinates, the value 0 corresponds to the uppermost + \ ** row of pixels; the height corresponds to the lowermost row. \n + \ ** The system automatically tracks the origin of all window-managed device contexts and + \ ** adjusts their brushes as necessary to maintain an alignment of patterns on the surface. + \ ** The brush origin that is set with this call is relative to the upper-left corner of the + \ ** client area. \n + \ ** An application should call SetOrigin: after setting the bitmap stretching mode to + \ ** HALFTONE by using SetStretchBltMode. This must be done to avoid brush misalignment. \n + \ ** Windows NT/ 2000: The system automatically tracks the origin of all window-managed device + \ ** contexts and adjusts their brushes as necessary to maintain an alignment of patterns on + \ ** the surface. \n + \ ** Windows 95/98: Automatic tracking of the brush origin is not supported. Applications must + \ ** use the UnrealizeObject, SetBrushOrgEx, and SelectObject functions to align the brush before + \ ** using it. \n NULL yOrg xOrg hdc GetGdiObjectHandle call SetBrushOrgEx ?win-error ;M :M GetOrigin: ( hdc -- xOrg yOrg ) + \ *G Get the current brush origin for the specified device context. Addr: origin call GetBrushOrgEx 0= if -1 -1 \ error *************** *** 35,47 **** then ;M - \ The Create function creates a logical brush that has the specified style, - \ color, and pattern. - \ lplb Pointer to a LOGBRUSH structure that contains information about the - \ brush. :M Create: ( lplb -- f ) call CreateBrushIndirect SetHandle: super Valid?: super ;M ;class external --- 60,71 ---- then ;M :M Create: ( lplb -- f ) + \ *G The Create function creates a logical brush that has the specified style, color, and pattern. + \ ** lplb Pointer to a LOGBRUSH structure that contains information about the brush. call CreateBrushIndirect SetHandle: super Valid?: super ;M ;class + \ *G End of gdiBrush class external *************** *** 49,52 **** --- 73,77 ---- \ ---------------------------------------------------------------------- \ ---------------------------------------------------------------------- + \ *W <a name="gdiSolidBrush"></a> :class gdiSolidBrush <super gdiBrush \ *G Solid brush class *************** *** 109,115 **** --- 134,142 ---- ;class + \ *G End of gdiSolidBrush class \ ---------------------------------------------------------------------- \ ---------------------------------------------------------------------- + \ *W <a name="gdiHatchBrush"></a> :class gdiHatchBrush <super gdiSolidBrush \ *G Hatch brush class *************** *** 131,135 **** :M SetStyle: ( style -- ) \ *G Set the style of the brush. Possible values are: ! \ *L HS_BDIAGONAL | 45-degree downward left-to-right hatch | \ *| HS_CROSS | Horizontal and vertical crosshatch | \ *| HS_DIAGCROSS | 45-degree crosshatch | --- 158,163 ---- :M SetStyle: ( style -- ) \ *G Set the style of the brush. Possible values are: ! \ *L ! \ *| HS_BDIAGONAL | 45-degree downward left-to-right hatch | \ *| HS_CROSS | Horizontal and vertical crosshatch | \ *| HS_DIAGCROSS | 45-degree crosshatch | *************** *** 141,145 **** :M GetStyle: ( -- style ) \ *G Get the style of the brush. Possible return values are: ! \ *L HS_BDIAGONAL | 45-degree downward left-to-right hatch | \ *| HS_CROSS | Horizontal and vertical crosshatch | \ *| HS_DIAGCROSS | 45-degree crosshatch | --- 169,174 ---- :M GetStyle: ( -- style ) \ *G Get the style of the brush. Possible return values are: ! \ *L ! \ *| HS_BDIAGONAL | 45-degree downward left-to-right hatch | \ *| HS_CROSS | Horizontal and vertical crosshatch | \ *| HS_DIAGCROSS | 45-degree crosshatch | *************** *** 155,163 **** ;class \ ---------------------------------------------------------------------- \ ---------------------------------------------------------------------- :class gdiPatternBrush <super gdiBrush ! \ *G Pattern brush class \ Bitmap of the brush. --- 184,194 ---- ;class + \ *G End of gdiHatchBrush class \ ---------------------------------------------------------------------- \ ---------------------------------------------------------------------- + \ *W <a name="gdiPatternBrush"></a> :class gdiPatternBrush <super gdiBrush ! \ *G Pattern brush class. \n \ Bitmap of the brush. *************** *** 170,187 **** --- 201,224 ---- :M SetBitmap: ( Bitmap -- ) + \ *G Set the Bitmap for the PatternBrush. The Bitmap can be a DIB section bitmap, + \ ** which is created by the CreateDIBSection function. to Bitmap ;M :M GetBitmap: ( -- Bitmap ) + \ *G Get the Bitmap for the PatternBrush. Bitmap ;M :M Create: ( -- f ) + \ *G Creates a logical brush with the specified bitmap pattern. Bitmap ?dup if call CreatePatternBrush SetHandle: super then Valid?: super ;M ;class + \ *G End of gdiPatternBrush class \ ---------------------------------------------------------------------- \ DIBPattern brush class \ ---------------------------------------------------------------------- + \ *W <a name="gdiHatchBrush"></a> :class gdiDIBPatternBrush <super gdiBrush \ *G DIBPattern brush class *************** *** 205,214 **** \ ** explicit red, green, blue (RGB) values or palette indexes. The iUsage parameter \ ** must be one of the following values. ! \ *L DIB_PAL_COLORS | A color table is provided and consists of an array of 16-bit indexes into the logical palette of the device context into which the brush is to be selected. | ! \ ** DIB_RGB_COLORS | A color table is provided and contains literal RGB values. | call CreateDIBPatternBrushPt SetHandle: super Valid?: super ;M ;class module --- 242,253 ---- \ ** explicit red, green, blue (RGB) values or palette indexes. The iUsage parameter \ ** must be one of the following values. ! \ *L ! \ *| DIB_PAL_COLORS | A color table is provided and consists of an array of 16-bit indexes into the logical palette of the device context into which the brush is to be selected. | ! \ *| DIB_RGB_COLORS | A color table is provided and contains literal RGB values. | call CreateDIBPatternBrushPt SetHandle: super Valid?: super ;M ;class + \ *G End of gdiDIBPatternBrush class module Index: gdiDC.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/gdi/gdiDC.f,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gdiDC.f 19 Nov 2005 11:13:09 -0000 1.5 --- gdiDC.f 26 Dec 2005 09:28:23 -0000 1.6 *************** *** 1,8 **** ! \ gdiDC.f ! \ ! \ Written by Dirk Busch ! \ Sonntag, Oktober 09 2005 ! \ Licence: Public Domain ! \ \ Missing: - WorldTransform support --- 1,9 ---- ! \ *D doc\classes\ ! \ *! gdiDC ! \ *T gdiDC -- Base device context class ! \ *Q Version 1.0 ! \ ** This GDI class library was written and placed in the Public Domain ! \ ** in 2005 by Dirk Busch ! \ Missing: - WorldTransform support *************** *** 12,16 **** internal - external --- 13,16 ---- *************** *** 19,25 **** \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ - \ Base device context class \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ :class gdiDC <super gdiObject gdiSIZE SIZE --- 19,25 ---- \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ :class gdiDC <super gdiObject + \ *G Base device context class gdiSIZE SIZE *************** *** 1289,1292 **** --- 1289,1295 ---- ;class + \ *G End of gdiDC class module + + \ *Z Index: gdiPen.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/gdi/gdiPen.f,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gdiPen.f 24 Dec 2005 11:58:00 -0000 1.3 --- gdiPen.f 26 Dec 2005 09:28:23 -0000 1.4 *************** *** 20,24 **** \ ---------------------------------------------------------------------- \ *W <a name="gdiPen"></a> - :class gdiPen <super gdiObject \ *G Class for cosmetic pen's --- 20,23 ---- Index: gdiWindowDc.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/gdi/gdiWindowDc.f,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gdiWindowDc.f 5 Nov 2005 13:22:16 -0000 1.2 --- gdiWindowDc.f 26 Dec 2005 09:28:23 -0000 1.3 *************** *** 1,7 **** ! \ gdiWindowDc.f ! \ ! \ Written by Dirk Busch ! \ Sonntag, Oktober 09 2005 ! \ Licence: Public Domain cr .( Loading GDI class library - Window device context...) --- 1,8 ---- ! \ *D doc\classes\ ! \ *! gdiWindowDc ! \ *T gdiWindowDc -- Window device context class ! \ *Q Version 1.0 ! \ ** This GDI class library was written and placed in the Public Domain ! \ ** in 2005 by Dirk Busch cr .( Loading GDI class library - Window device context...) *************** *** 13,19 **** \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ - \ Window device context class \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ :class gdiWindowDC <super gdiDC int hWnd \ handle of the window in which this device context is used --- 14,20 ---- \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ :class gdiWindowDC <super gdiDC + \ *G Window device context class int hWnd \ handle of the window in which this device context is used *************** *** 123,126 **** --- 124,130 ---- ;class + \ *G End of gdiWindowDC class module + + \ *Z Index: gdiBase.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/gdi/gdiBase.f,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gdiBase.f 24 Dec 2005 11:58:00 -0000 1.5 --- gdiBase.f 26 Dec 2005 09:28:23 -0000 1.6 *************** *** 1,30 **** - \ *D doc\classes\ \ *! gdiBase ! \ *T GdiObject -- Base class for GDI objects \ *Q Version 1.0 \ ** This GDI class library was written and placed in the Public Domain \ ** in 2005 by Dirk Busch ! \ *P GdiObject is the base class for all GDI objects. This class \ ** contains a single ivar, hObject, that is the (MS Windows) handle for the ! \ ** GDI object. \n ! \ ** There will be the following subclasses of GdiObject: ! \ *E gdiPen Class for cosmetic pen's ! \ ** gdiGeometricPen Class for geometric pen's ! \ ** gdiSolidBrush Solid brush class ! \ ** gdiHatchBrush Hatch brush class ! \ ** gdiPatternBrush Pattern brush class ! \ ** gdiDIBPatternBrush DIBPattern brush class ! \ ** GdiFont Class for windows fonts ! \ ** gdiBitmap Class for bitmaps ! \ ** gdiMetafile Class for enhanced metafiles ! \ ** gdiDC Base device context class ! \ ** gdiWindowDC Device context class for windows ! \ ** gdiMetafileDC Device context class for enhanced metafiles ! \ *P Since GdiObject is a generic class it should not be used to create ! \ ** any instances. \n \ *S Glossary --- 1,44 ---- \ *D doc\classes\ \ *! gdiBase ! \ *T gdiObject -- Base class for GDI objects \ *Q Version 1.0 \ ** This GDI class library was written and placed in the Public Domain \ ** in 2005 by Dirk Busch ! \ *P gdiObject is the base class for all GDI objects. This class \ ** contains a single ivar, hObject, that is the (MS Windows) handle for the ! \ ** GDI object. Since GdiObject is a generic class it should not be used to create ! \ ** any instances. There will be the following subclasses of gdiObject: ! \ *W <ul> ! \ *W <li><a href="gdiPen.htm#gdiPen">gdiPen</a> Class for cosmetic pen's</li> ! \ *W <li><a href="gdiPen.htm#gdiGeometricPen">gdiGeometricPen</a> Class for geometric pen's</li> ! \ *W <li><a href="gdiBrush.htm#gdiSolidBrush">gdiSolidBrush</a> Solid brush class</li> ! \ *W <li><a href="gdiBrush.htm#gdiHatchBrush">gdiHatchBrush</a> Hatch brush class</li> ! \ *W <li><a href="gdiBrush.htm#gdiPatternBrush">gdiPatternBrush</a> Pattern brush class</li> ! \ *W <li><a href="gdiBrush.htm#gdiDIBPatternBrush">gdiDIBPatternBrush</a> DIBPattern brush class</li> ! ! \ *W <li><a href="gdiFont.htm">gdiFont</a> Class for windows fonts</li> ! ! \ *W <li><a href="gdiBitmap.htm">gdiBitmap</a> Class for bitmaps</li> ! \ *W <li><a href="gdiMetafile.htm">gdiMetafile</a> Class for enhanced metafiles</li> ! ! \ *W <li><a href="gdiDC.htm">gdiDC</a> Base device context class</li> ! \ *W <li><a href="gdiWindowDC.htm">gdiWindowDC</a> Device context class for windows</li> ! \ *W <li><a href="gdiMetafileDC.htm">gdiMetafileDC</a> Device context class for enhanced metafiles</li> ! ! \ *W </ul> ! ! \ *P There are some other (old) classes in Win32Forth that are dealing with the GDI: ! \ *L ! \ *| ColorObject | Class for color objects | ! \ *| ExtColorObject | Class for extended color objects | ! \ *| HatchColorObject | Class for hatch color objects | ! \ *| Font | Class for fonts | ! \ *| WinDC | Device context class for windows | ! \ *| WinPrinter | Device context class for printing | ! ! \ *P All old classes are rewritten to use the GDI class library. \ *S Glossary *************** *** 51,56 **** \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ! :class GdiObject <super object ! \ *G GdiObject is the base class for all GDI Object classes. int hObject \ handle of the GDI object --- 65,70 ---- \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ! :class gdiObject <super object ! \ *G gdiObject is the base class for all GDI Object classes. int hObject \ handle of the GDI object Index: gdiMetafileDc.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/gdi/gdiMetafileDc.f,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gdiMetafileDc.f 1 Nov 2005 12:21:40 -0000 1.1 --- gdiMetafileDc.f 26 Dec 2005 09:28:23 -0000 1.2 *************** *** 1,7 **** ! \ gdiMetafileDC.f ! \ ! \ Written by Dirk Busch ! \ Sonntag, Oktober 09 2005 ! \ Licence: Public Domain cr .( Loading GDI class library - Metafile device context...) --- 1,8 ---- ! \ *D doc\classes\ ! \ *! gdiMetafileDC ! \ *T gdiMetafileDC -- Metafile device context class ! \ *Q Version 1.0 ! \ ** This GDI class library was written and placed in the Public Domain ! \ ** in 2005 by Dirk Busch cr .( Loading GDI class library - Metafile device context...) *************** *** 14,20 **** \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ - \ Metafile device context class \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ :class gdiMetafileDC <super gdiDC RECTANGLE MetaRect --- 15,21 ---- \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ :class gdiMetafileDC <super gdiDC + \ *G Metafile device context class RECTANGLE MetaRect *************** *** 109,112 **** --- 110,116 ---- Metafile ;M ;class + \ *G End of gdiMetafileDC class module + + \ *Z Index: gdiFont.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/gdi/gdiFont.f,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gdiFont.f 12 Nov 2005 09:52:17 -0000 1.2 --- gdiFont.f 26 Dec 2005 09:28:23 -0000 1.3 *************** *** 1,7 **** ! \ gdiFont.f ! \ ! \ Written by Dirk Busch ! \ Sonntag, Oktober 09 2005 ! \ Licence: Public Domain cr .( Loading GDI class library - Font...) --- 1,9 ---- ! \ *D doc\classes\ ! \ *! gdiFont ! \ *T gdiFont -- Class for GDI Fonts. ! \ *Q Version 1.0 ! \ ** This GDI class library was written and placed in the Public Domain ! \ ** in 2005 by Dirk Busch ! \ *S Glossary cr .( Loading GDI class library - Font...) *************** *** 13,19 **** \ ---------------------------------------------------------------------- - \ Font class \ ---------------------------------------------------------------------- ! :Class GdiFont <Super GdiObject Record: LOGFONT --- 15,22 ---- \ ---------------------------------------------------------------------- \ ---------------------------------------------------------------------- ! \ *W <a name="gdiFont"></a> ! :Class gdiFont <Super GdiObject ! \ *G GDI Font class Record: LOGFONT *************** *** 92,133 **** ;M ! :M SetHeight: ( n1 -- ) to lfHeight ;M ! :M SetWidth: ( n1 -- ) to lfWidth ;M ! :M SetEscapement: ( n1 -- ) to lfEscapement ;M ! :M SetOrientation: ( n1 -- ) to lfOrientation ;M \ 10th/degree increments ! :M SetWeight: ( n1 -- ) to lfWeight ;M ! :M SetItalic: ( f1 -- ) to lfItalic ;M \ TRUE/FALSE ! :M SetUnderline: ( f1 -- ) to lfUnderline ;M \ TRUE/FALSE ! :M SetStrikeOut: ( f1 -- ) to lfStrikeOut ;M \ TRUE/FALSE ! :M SetCharSet: ( n1 -- ) to lfCharSet ;M ! :M SetOutPrecision: ( n1 -- ) to lfOutPrecision ;M ! :M SetClipPrecision: ( n1 -- ) to lfClipPrecision ;M ! :M SetQuality: ( n1 -- ) to lfQuality ;M ! :M SetPitchAndFamily: ( n1 -- ) to lfPitchAndFamily ;M :M SetFaceName: ( a1 n1 -- ) lfFaceName LF_FACESIZE erase LF_FACESIZE 1- min lfFaceName swap move ;M ! :M GetHeight: ( -- n1 ) lfHeight ;M ! :M GetWidth: ( -- n1 ) lfWidth ;M ! :M GetEscapement: ( -- n1 ) lfEscapement ;M ! :M GetOrientation: ( -- n1 ) lfOrientation ;M \ 10th/degree increments ! :M GetWeight: ( -- n1 ) lfWeight ;M ! :M GetItalic: ( -- f1 ) lfItalic ;M \ TRUE/FALSE ! :M GetUnderline: ( -- f1 ) lfUnderline ;M \ TRUE/FALSE ! :M GetStrikeOut: ( -- f1 ) lfStrikeOut ;M \ TRUE/FALSE ! :M GetCharSet: ( -- n1 ) lfCharSet ;M ! :M GetOutPrecision: ( -- n1 ) lfOutPrecision ;M ! :M GetClipPrecision: ( -- n1 ) lfClipPrecision ;M ! :M GetQuality: ( -- n1 ) lfQuality ;M ! :M GetPitchAndFamily: ( -- n1 ) lfPitchAndFamily ;M ! :M GetLogfont: ( -- n1 ) LOGFONT ;M :M GetFaceName: ( -- a1 n1 ) lfFaceName LF_FACESIZE 2dup 0 scan nip - ;M :M Create: ( -- f ) LOGFONT Call CreateFontIndirect SetHandle: super Valid?: super ;M --- 95,349 ---- ;M ! :M SetHeight: ( n1 -- ) ! \ *G Set the height, in logical units, of the font's character cell or character. The character ! \ ** height value (also known as the em height) is the character cell height value minus the ! \ ** internal-leading value. The font mapper interprets the value specified in lfHeight in the ! \ ** following manner. ! \ *L ! \ *| > 0 | The font mapper transforms this value into device units and matches it against the cell height of the available fonts. | ! \ *| 0 | The font mapper uses a default height value when it searches for a match. | ! \ *| < 0 | The font mapper transforms this value into device units and matches its absolute value against the character height of the available fonts. | ! \ *P For all height comparisons, the font mapper looks for the largest font that does not exceed ! \ ** the requested size. This mapping occurs when the font is used for the first time. ! to lfHeight ;M ! ! :M SetWidth: ( n1 -- ) ! \ *G Specifies the average width, in logical units, of characters in the font. If lfWidth is zero, ! \ ** the aspect ratio of the device is matched against the digitization aspect ratio of the available ! \ ** fonts to find the closest match, determined by the absolute value of the difference. ! to lfWidth ;M ! ! :M SetEscapement: ( n1 -- ) ! \ *G Set the angle, in tenths of degrees, between the escapement vector and the x-axis of the device. ! \ ** The escapement vector is parallel to the base line of a row of text. \n ! \ ** Windows NT/ 2000: When the graphics mode is set to GM_ADVANCED, you can specify the escapement ! \ ** angle of the string independently of the orientation angle of the string's characters. \n ! \ ** When the graphics mode is set to GM_COMPATIBLE, lfEscapement specifies both the escapement and ! \ ** orientation. You should set lfEscapement and lfOrientation to the same value. \n ! \ ** Windows 95: The lfEscapement member specifies both the escapement and orientation. You should set ! \ ** lfEscapement and lfOrientation to the same value. ! to lfEscapement ;M ! ! :M SetOrientation: ( n1 -- ) ! \ *G Set the angle, in tenths of degrees, between each character's base line and the x-axis of the device. ! to lfOrientation ;M \ 10th/degree increments ! ! :M SetWeight: ( n1 -- ) ! \ *G Specifies the weight of the font in the range 0 through 1000. For example, 400 is normal and 700 is bold. ! \ ** If this value is zero, a default weight is used. The following values are defined for convenience. ! \ *L ! \ *| FW_DONTCARE | 0 | ! \ *| FW_THIN | 100 | ! \ *| FW_EXTRALIGHT | 200 | ! \ *| FW_ULTRALIGHT | 200 | ! \ *| FW_LIGHT | 300 | ! \ *| FW_NORMAL | 400 | ! \ *| FW_REGULAR | 400 | ! \ *| FW_MEDIUM | 500 | ! \ *| FW_SEMIBOLD | 600 | ! \ *| FW_DEMIBOLD | 600 | ! \ *| FW_BOLD | 700 | ! \ *| FW_EXTRABOLD | 800 | ! \ *| FW_ULTRABOLD | 800 | ! \ *| FW_HEAVY | 900 | ! \ *| FW_BLACK | 900 | ! to lfWeight ;M ! ! :M SetItalic: ( f1 -- ) ! \ *G Specifies an italic font if set to TRUE. ! to lfItalic ;M ! ! :M SetUnderline: ( f1 -- ) ! \ *G Specifies an underlined font if set to TRUE. ! to lfUnderline ;M ! ! :M SetStrikeOut: ( f1 -- ) ! \ *G Specifies a strikeout font if set to TRUE. ! to lfStrikeOut ;M ! ! :M SetCharSet: ( n1 -- ) ! \ *G Specifies the character set. The following values are predefined. ! \ *L ! \ *| ANSI_CHARSET | ! \ *| BALTIC_CHARSET | ! \ *| CHINESEBIG5_CHARSET | ! \ *| DEFAULT_CHARSET | ! \ *| EASTEUROPE_CHARSET | ! \ *| GB2312_CHARSET | ! \ *| GREEK_CHARSET | ! \ *| HANGUL_CHARSET | ! \ *| MAC_CHARSET | ! \ *| OEM_CHARSET | ! \ *| RUSSIAN_CHARSET | ! \ *| SHIFTJIS_CHARSET | ! \ *| SYMBOL_CHARSET | ! \ *| TURKISH_CHARSET | ! \ *P Windows NT/ 2000 or Middle-Eastern Windows 3.1 or later: ! \ *L ! \ *| HEBREW_CHARSET | ! \ *| ARABIC_CHARSET | ! \ *P Windows NT/ 2000 or Thai Windows 3.1 or later: ! \ *L ! \ *| THAI_CHARSET | ! \ *P The OEM_CHARSET value specifies a character set that is operating-system dependent. ! \ ** Windows 95/98: You can use the DEFAULT_CHARSET value to allow the name and size of a font ! \ ** to fully describe the logical font. If the specified font name does not exist, a font from ! \ ** any character set can be substituted for the specified font, so you should use DEFAULT_CHARSET ! \ ** sparingly to avoid unexpected results. \n ! \ ** Windows NT/ 2000: DEFAULT_CHARSET is set to a value based on the current system locale. For ! \ ** example, when the system locale is English (United States), it is set as ANSI_CHARSET. \n ! \ ** Fonts with other character sets may exist in the operating system. If an application uses a ! \ ** font with an unknown character set, it should not attempt to translate or interpret strings ! \ ** that are rendered with that font. \n ! \ ** This parameter is important in the font mapping process. To ensure consistent results, specify ! \ ** a specific character set. If you specify a typeface name in the lfFaceName member, make sure ! \ ** that the lfCharSet value matches the character set of the typeface specified in lfFaceName. ! to lfCharSet ;M ! ! :M SetOutPrecision: ( n1 -- ) ! \ *G Specifies the output precision. The output precision defines how closely the output must match ! \ ** the requested font's height, width, character orientation, escapement, pitch, and font type. It can ! \ ** be one of the following values. ! \ *L ! \ *| OUT_CHARACTER_PRECIS Not used. ! \ *| OUT_DEFAULT_PRECIS | Specifies the default font mapper behavior. | ! \ *| OUT_DEVICE_PRECIS | Instructs the font mapper to choose a Device font when the system contains multiple fonts with the same name. | ! \ *| OUT_OUTLINE_PRECIS | Windows NT/ 2000: This value instructs the font mapper to choose from TrueType and other outline-based fonts. | ! \ *| OUT_RASTER_PRECIS | Instructs the font mapper to choose a raster font when the system contains multiple fonts with the same name. | ! \ *| OUT_TT_ONLY_PRECIS | Instructs the font mapper to choose from only TrueType fonts. If there are no TrueType fonts installed in the system, the font mapper returns to default behavior. | ! \ *| OUT_TT_PRECIS | Instructs the font mapper to choose a TrueType font when the system contains multiple fonts with the same name. | ! \ *P Applications can use the OUT_DEVICE_PRECIS, OUT_RASTER_PRECIS, and OUT_TT_PRECIS values to control ! \ ** how the font mapper chooses a font when the operating system contains more than one font with a ! \ ** specified name. For example, if an operating system contains a font named Symbol in raster and TrueType ! \ ** form, specifying OUT_TT_PRECIS forces the font mapper to choose the TrueType version. Specifying ! \ ** OUT_TT_ONLY_PRECIS forces the font mapper to choose a TrueType font, even if it must substitute a TrueType ! \ ** font of another name. ! to lfOutPrecision ;M ! ! :M SetClipPrecision: ( n1 -- ) ! \ *G Specifies the clipping precision. The clipping precision defines how to clip characters that are partially ! \ ** outside the clipping region. It can be one or more of the following values. ! \ *L ! \ *| CLIP_DEFAULT_PRECIS | Specifies default clipping behavior. | ! \ *| CLIP_CHARACTER_PRECIS | Not used. | ! \ *| CLIP_EMBEDDED | You must specify this flag to use an embedded read-only font. | ! \ *| CLIP_LH_ANGLES | When this value is used, the rotation for all fonts depends on whether the orientation of the coordinate system is left-handed or right-handed. ! \ *P For more information about the orientation of coordinate systems, see the description of the nOrientation parameter | ! to lfClipPrecision ;M ! ! :M SetQuality: ( n1 -- ) ! \ *G Specifies the output quality. The output quality defines how carefully the graphics device interface (GDI) must ! \ ** attempt to match the logical-font attributes to those of an actual physical font. It can be one of the following ! \ ** values. ! \ *L ! \ *| ANTIALIASED_QUALITY | Font is always antialiased if the font supports it and the size of the font is not too small or too large. | ! \ *| DEFAULT_QUALITY | Appearance of the font does not matter. | ! \ *| DRAFT_QUALITY | Appearance of the font is less important than when PROOF_QUALITY is used. For GDI raster fonts, scaling is enabled, which means that more font sizes are available, but the quality may be lower. < ! \ *| NONANTIALIASED_QUALITY | Font is never antialiased. | ! \ *| PROOF_QUALITY | Character quality of the font is more important than exact matching of the logical-font attributes. | ! \ *P If neither ANTIALIASED_QUALITY nor NONANTIALIASED_QUALITY is selected, the font is antialiased only if the user chooses ! \ ** smooth screen fonts in Control Panel. ! to lfQuality ;M ! ! :M SetPitchAndFamily: ( n1 -- ) ! \ *G Specifies the pitch and family of the font. The two low-order bits specify the pitch of the font and can ! \ ** be one of the following values. ! \ *L ! \ *| DEFAULT_PITCH | ! \ *| FIXED_PITCH | ! \ *| VARIABLE_PITCH | ! \ *P Bits 4 through 7 of the member specify the font family and can be one of the following values. ! \ *L ! \ *| FF_DECORATIVE ! \ *| FF_DONTCARE ! \ *| FF_MODERN ! \ *| FF_ROMAN ! \ *| FF_SCRIPT ! \ *| FF_SWISS ! \ *P The proper value can be obtained by using the Boolean OR operator to join one pitch constant with one ! \ ** family constant. ! \ *P Font families describe the look of a font in a general way. They are intended for specifying fonts ! \ ** when the exact typeface desired is not available. The values for font families are as follows. ! \ *L ! \ *| FF_DECORATIVE | Novelty fonts. Old English is an example. | ! \ *| FF_DONTCARE | Don't care or don't know. | ! \ *| FF_MODERN | Fonts with constant stroke width (monospace), with or without serifs. Monospace fonts are usually modern. Pica, Elite, and CourierNew® are examples. | ! \ *| FF_ROMAN | Fonts with variable stroke width (proportional) and with serifs. MS® Serif is an example. | ! \ *| FF_SCRIPT | Fonts designed to look like handwriting. Script and Cursive are examples. | ! \ *| FF_SWISS | Fonts with variable stroke width (proportional) and without serifs. MS® Sans Serif is an example. | ! to lfPitchAndFamily ;M :M SetFaceName: ( a1 n1 -- ) + \ *G Specifies the typeface name of the font. The length of this string must not exceed 32 characters, including + \ ** the null terminator. The EnumFontFamilies function can be used to enumerate the typeface names of all + \ ** currently available fonts. If lfFaceName is an empty string, GDI uses the first font that matches the other + \ ** specified attributes. lfFaceName LF_FACESIZE erase LF_FACESIZE 1- min lfFaceName swap move ;M ! :M GetHeight: ( -- n1 ) ! \ *G Fet the height, in logical units, of the font's character cell or character ! lfHeight ;M ! ! :M GetWidth: ( -- n1 ) ! \ *G Get the average width, in logical units, of characters in the font ! lfWidth ;M ! ! :M GetEscapement: ( -- n1 ) ! \ *G Get the angle, in tenths of degrees, between the escapement vector and the x-axis of ! \ ** the device. The escapement vector is parallel to the base line of a row of text. ! lfEscapement ;M ! ! :M GetOrientation: ( -- n1 ) ! \ *G Get the angle, in tenths of degrees, between each character's base line and the x-axis of the device. ! lfOrientation ;M ! ! :M GetWeight: ( -- n1 ) ! \ *G Get the weight of the font ! lfWeight ;M ! ! :M GetItalic: ( -- f1 ) ! \ *G TRUE if it's an italic font. ! lfItalic ;M ! ! :M GetUnderline: ( -- f1 ) ! \ *G TRUE if it's a underlined font. ! lfUnderline ;M ! ! :M GetStrikeOut: ( -- f1 ) ! \ *G TRUE if it's a strikeout font. ! lfStrikeOut ;M ! ! :M GetCharSet: ( -- n1 ) ! \ *G Get the character set. ! lfCharSet ;M ! ! :M GetOutPrecision: ( -- n1 ) ! \ *G Get the output precision. ! lfOutPrecision ;M ! ! :M GetClipPrecision: ( -- n1 ) ! \ *G Get the clipping precision ! lfClipPrecision ;M ! ! :M GetQuality: ( -- n1 ) ! \ *G Get the output quality. ! lfQuality ;M ! ! :M GetPitchAndFamily: ( -- n1 ) ! \ *G Get the pitch and family of the font. ! lfPitchAndFamily ;M :M GetFaceName: ( -- a1 n1 ) + \ *G Get the typeface name of the font. lfFaceName LF_FACESIZE 2dup 0 scan nip - ;M + :M GetLogfont: ( -- n1 ) + \ *G Get the address of the LOGFONT structure + LOGFONT ;M + :M Create: ( -- f ) + \ *G Create a new font. If the current font handle is valid, the font will be destroyed. LOGFONT Call CreateFontIndirect SetHandle: super Valid?: super ;M *************** *** 140,155 **** then ; - \ let the user choose a Screen font :M Choose: ( hWnd -- f ) NULL to hDC [ CF_SCREENFONTS CF_INITTOLOGFONTSTRUCT or ] literal to Flags Choose ;M - \ let the user choose a Printer font for the PrinterDC hDC :M ChoosePrinter: ( hWnd hDC -- f ) G... [truncated message content] |