Main Page Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members File Members

# libemf.cpp File Reference

`#include "libemf.h"`

## Namespaces
namespace | EMF
## Functions
BOOL | DeleteDC (HDC context)
HDC | CreateEnhMetaFileA (HDC referenceContext, LPCSTR filename, const RECT *size, LPCSTR description)
HDC | CreateEnhMetaFileW (HDC referenceContext, LPCWSTR filename, const RECT *size, LPCWSTR description)
HDC | CreateEnhMetaFileWithFILEA (HDC referenceContext, FILE *fp, const RECT *size, LPCSTR description)
HDC | CreateEnhMetaFileWithFILEW (HDC referenceContext, FILE *fp, const RECT *size, LPCWSTR description)
HMETAFILE | CreateMetaFileA (LPCSTR filename)
HENHMETAFILE | CloseEnhMetaFile (HDC context)
HMETAFILE | CloseMetaFile (HDC context)
HENHMETAFILE | CloseEnhMetaFileWithFILE (HDC context)
BOOL | DeleteEnhMetaFile (HENHMETAFILE metafile)
BOOL | DeleteMetaFile (HMETAFILE metafile)
HENHMETAFILE | GetEnhMetaFileA (LPCSTR filename)
HENHMETAFILE | GetEnhMetaFileW (LPCWSTR filename)
BOOL | PlayEnhMetaFile (HDC context, HENHMETAFILE metafile, const RECT *)
void | EditEnhMetaFile (HENHMETAFILE metafile)
DWORD | GetLastError ()
BOOL | MoveToEx (HDC context, INT x, INT y, LPPOINT point)
BOOL | LineTo (HDC context, INT x, INT y)
HGDIOBJ | GetStockObject (INT obj)
HGDIOBJ | SelectObject (HDC context, HGDIOBJ obj)
INT | GetObjectA (HGDIOBJ obj, INT size, LPVOID buffer)
BOOL | DeleteObject (HGDIOBJ obj)
BOOL | SetViewportOrgEx (HDC context, INT x, INT y, LPPOINT point)
BOOL | GetViewportOrgEx (HDC context, LPPOINT point)
BOOL | SetWindowOrgEx (HDC context, INT x, INT y, LPPOINT point)
BOOL | GetWindowOrgEx (HDC context, LPPOINT point)
BOOL | SetViewportExtEx (HDC context, INT cx, INT cy, LPSIZE size)
BOOL | ScaleViewportExtEx (HDC context, INT x_num, INT x_den, INT y_num, INT y_den, LPSIZE size)
BOOL | GetViewportExtEx (HDC context, LPSIZE size)
BOOL | SetWindowExtEx (HDC context, INT cx, INT cy, LPSIZE size)
BOOL | ScaleWindowExtEx (HDC context, INT x_num, INT x_den, INT y_num, INT y_den, LPSIZE size)
BOOL | GetWindowExtEx (HDC context, LPSIZE size)
BOOL | ModifyWorldTransform (HDC context, const XFORM *transform, DWORD mode)
BOOL | SetWorldTransform (HDC context, const XFORM *transform)
HPEN | CreatePen (INT style, INT width, COLORREF color)
HPEN | ExtCreatePen (DWORD style, DWORD width, const LOGBRUSH *brush, DWORD, const DWORD *)
HPEN | CreatePenIndirect (const LOGPEN *lpen)
HBRUSH | CreateBrushIndirect (const LOGBRUSH *lbrush)
HBRUSH | CreateSolidBrush (COLORREF color)
UINT | SetTextAlign (HDC context, UINT alignment)
COLORREF | SetTextColor (HDC context, COLORREF color)
COLORREF | SetBkColor (HDC context, COLORREF color)
INT | SetBkMode (HDC context, INT mode)
INT | SetMapMode (HDC context, INT mode)
HFONT | CreateFontA (INT height, INT width, INT escapement, INT orientation, INT weight, DWORD italic, DWORD underline, DWORD strike_out, DWORD charset, DWORD out_precision, DWORD clip_precision, DWORD quality, DWORD pitch_family, LPCSTR name)
HFONT | CreateFontW (INT height, INT width, INT escapement, INT orientation, INT weight, DWORD italic, DWORD underline, DWORD strike_out, DWORD charset, DWORD out_precision, DWORD clip_precision, DWORD quality, DWORD pitch_family, LPCWSTR name)
HFONT | CreateFontIndirectW (const LOGFONTW *lfont)
HFONT | CreateFontIndirectA (const LOGFONTA *lfonta)
BOOL | TextOutA (HDC context, INT x, INT y, LPCSTR string, INT count)
BOOL | ExtTextOutA (HDC context, INT x, INT y, UINT flags, const RECT *rect, LPCSTR string, UINT count, const INT *dx)
BOOL | Arc (HDC context, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend)
BOOL | ArcTo (HDC context, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend)
BOOL | Rectangle (HDC context, INT left, INT top, INT right, INT bottom)
BOOL | Ellipse (HDC context, INT left, INT top, INT right, INT bottom)
BOOL | PolyBezier (HDC context, const POINT *points, DWORD n)
BOOL | PolyBezier16 (HDC16 context, const POINT16 *points, INT16 n)
UINT | GetEnhMetaFileHeader (HENHMETAFILE metafile, const UINT sizeof_enhmetaheader, LPENHMETAHEADER metaheader)
INT | GetDeviceCaps (HDC context, INT capability)
BOOL | Polyline (HDC context, const POINT *points, INT n)
BOOL | Polyline16 (HDC context, const POINT16 *points, INT16 n)
BOOL | Polygon (HDC context, const POINT *points, INT n)
BOOL | PolyPolygon (HDC context, const POINT *points, const INT *counts, UINT polygons)
BOOL | PolyPolygon16 (HDC context, const POINT16 *points, const INT *counts, UINT16 polygons)
INT | GetTextFaceA (HDC, INT, LPSTR)
BOOL | SetTextJustification (HDC, INT, INT)
INT | SetPolyFillMode (HDC context, INT mode)
BOOL | FillPath (HDC context)
BOOL | StrokePath (HDC context)
BOOL | PolyBezierTo (HDC context, const POINT *points, DWORD n)
BOOL | PolyBezierTo16 (HDC context, const POINT16 *points, INT16 n)
BOOL | PolylineTo (HDC context, const POINT *points, DWORD n)
BOOL | PolylineTo16 (HDC context, const POINT16 *points, INT16 n)
BOOL | GetTextMetricsA (HDC, LPTEXTMETRICA)
BOOL | GetTextExtentPoint32A (HDC, LPCSTR, INT, LPSIZE)
BOOL | BeginPath (HDC context)
BOOL | EndPath (HDC context)
BOOL | CloseFigure (HDC context)
INT | SaveDC (HDC context)
INT | RestoreDC (HDC context, INT n)
INT | SetMetaRgn (HDC context)
INT | SetTextCharacterExtra (HDC, INT)
INT | GetTextCharacterExtra (HDC)
COLORREF | SetPixel (HDC context, INT x, INT y, COLORREF color)
HWND | GetDesktopWindow (void)
HDC | GetDC (HWND)
INT | ReleaseDC (HWND, HDC)
INT | EnumFontFamiliesA (HDC, LPCSTR, FONTENUMPROCA, LPARAM)
INT | EnumFontFamiliesW (HDC, LPCWSTR, FONTENUMPROCW, LPARAM)
INT | EnumFontFamiliesExA (HDC, LPLOGFONTA, FONTENUMPROCEXA, LPARAM, DWORD)
INT | EnumFontFamiliesExW (HDC, LPLOGFONTW, FONTENUMPROCEXW, LPARAM, DWORD)
INT | EnumFontsA (HDC, LPCSTR, FONTENUMPROCA, LPARAM)
INT | EnumFontsW (HDC, LPCWSTR, FONTENUMPROCW, LPARAM)
INT | StretchDIBits (HDC, INT, INT, INT, INT, INT, INT, INT, INT, const void *,const BITMAPINFO *,UINT, DWORD)
INT | SetDIBitsToDevice (HDC, INT, INT, DWORD, DWORD, INT, INT, UINT, UINT, LPCVOID, const BITMAPINFO *,UINT)

## Function Documentation

BOOL Arc ( | HDC context,
| INT left,
| INT top,
| INT right,
| INT bottom,
| INT xstart,
| INT ystart,
| INT xend,
| INT yend )

  | Draw an arc. Not sure what the specification here means, though. Parameters:
  left | x position of left edge of arc box.
  top | y position of top edge of arc box.
  right | x position of right edge of arc box.
  bottom | y position bottom edge of arc box.
  xstart | x position of arc start.
  ystart | y position of arc start.
  xend | x position of arc end.
  yend | y position of arc end.
Returns: true if arc was successfully rendered.

BOOL ArcTo ( | HDC context,
| INT left,
| INT top,
| INT right,
| INT bottom,
| INT xstart,
| INT ystart,
| INT xend,
| INT yend )

  | Draw another arc. Not sure what the specification here means, though. Parameters:
  left | x position of left edge of arc box.
  top | y position of top edge of arc box.
  right | x position of right edge of arc box.
  bottom | y position bottom edge of arc box.
  xstart | x position of arc start.
  ystart | y position of arc start.
  xend | x position of arc end.
  yend | y position of arc end.
Returns: true if arc was successfully rendered.

BOOL BeginPath ( | HDC context )

  | Begin defining a path. Parameters:
  context | handle to metafile context.
Returns: true if successful.

HENHMETAFILE CloseEnhMetaFile ( | HDC context )

  | If the metafile was opened with CreateEnhMetaFileA or CreateEnhMetaFileW, use this routine to close the metafile. Parameters:
  context | metafile device context.
Returns: a handle to the metafile.

HENHMETAFILE CloseEnhMetaFileWithFILE ( | HDC context )

  | Close a metafile which was created with an already open FILE pointer. Parameters:
  context | handle of metafile context
Returns: handle to a metafile. I don't think there's anything you can do with it, though.

BOOL CloseFigure ( | HDC context )

  | Close the figure (how is this different from EndPath?) Parameters:
  context | handle to metafile context.
Returns: true if successful.

HMETAFILE CloseMetaFile ( | HDC context )

  | If the metafile was opened with CreateEnhMetaFileA or CreateEnhMetaFileW, use this routine to close the metafile (same as CloseEnhMetaFile) Parameters:
  context | metafile device context.
Returns: a handle to the metafile.

HBRUSH CreateBrushIndirect ( | const LOGBRUSH * lbrush )

  | Create a BRUSH, used to fill polygons. Parameters:
  lbrush | use a structure to define the BRUSH attributes.
Returns: handle to BRUSH graphics object.

HDC CreateEnhMetaFileA ( | HDC referenceContext,
| LPCSTR filename,
| const RECT * size,
| LPCSTR description )

  | Create an enhanced metafile on disk. Parameters:
  context | pseudo device context.
  filename | ASCII filename of metafile.
  size | the size (really the position on the paper) of the plot image.
  description | description string for metafile (see EMF::METAFILE constructor for details).
Returns: handle to a metafile device context.

HDC CreateEnhMetaFileW ( | HDC referenceContext,
| LPCWSTR filename,
| const RECT * size,
| LPCWSTR description )

  | Create an enhanced metafile on disk. This differs from CreateEnhMetaFileA only in that the filename and description are made of wide characters. Parameters:
  context | pseudo device context.
  filename | ASCII filename of metafile.
  size | the size (really the position on the paper) of the plot image.
  description | description string for metafile (see EMF::METAFILE constructor for details).
Returns: handle to a metafile device context.

HDC CreateEnhMetaFileWithFILEA ( | HDC referenceContext,
| FILE * fp,
| const RECT * size,
| LPCSTR description )

  | Many graphics programs want to open and close output files themselves. At least, gnuplot and Grace do. So, supply the FILE pointer when creating a metafile and let the plotting program's driver handle it. Parameters:
  context | pseudo device context.
  fp | open FILE pointer.
  size | the size (really the position on the paper) of the plot image.
  description | description string for metafile (see EMF::METAFILE constructor for details).
Returns: handle to a metafile device context.

HDC CreateEnhMetaFileWithFILEW ( | HDC referenceContext,
| FILE * fp,
| const RECT * size,
| LPCWSTR description )

  | Many graphics programs want to open and close output files themselves. At least, gnuplot and Grace do. So, supply the FILE pointer when creating a metafile and let the plotting program's driver handle it. This differs from CreateEnhMetaFileWithFILEA only in that the description string uses wide characters. Parameters:
  context | pseudo device context.
  fp | open FILE pointer.
  size | the size (really the position on the paper) of the plot image.
  description | description string for metafile (see EMF::METAFILE constructor for details).
Returns: handle to a metafile device context.

HFONT CreateFontA ( | INT height,
| INT width,
| INT escapement,
| INT orientation,
| INT weight,
| DWORD italic,
| DWORD underline,
| DWORD strike_out,
| DWORD charset,
| DWORD out_precision,
| DWORD clip_precision,
| DWORD quality,
| DWORD pitch_family,
| LPCSTR name )

  | Create a new FONT object. Presumably, the system tries to find a reasonable approximation to all the requested attributes. Parameters:
  height | typical glyph height.
  width | typical glyph width.
  escapement | (what is this?)
  orientation | angle, in degrees*10, of rendered string rotation.
  weight | weight has (at least) the following values: FW_DONTCARE FW_THIN FW_EXTRALIGHT FW_ULTRALIGHT FW_LIGHT FW_NORMAL FW_REGULAR FW_MEDIUM FW_SEMIBOLD FW_DEMIBOLD FW_BOLD FW_EXTRABOLD FW_ULTRABOLD FW_HEAVY FW_BLACK
  italic | non-zero means try to find an italic version of the face.
  underline | non-zero means to underline the glyphs.
  strike_out | non-zero means to strike-out the glyphs.
  charset | select the character set from the following list: ANSI_CHARSET DEFAULT_CHARSET SYMBOL_CHARSET SHIFTJIS_CHARSET HANGEUL_CHARSET HANGUL_CHARSET GB2312_CHARSET CHINESEBIG5_CHARSET GREEK_CHARSET TURKISH_CHARSET HEBREW_CHARSET ARABIC_CHARSET BALTIC_CHARSET RUSSIAN_CHARSET EE_CHARSET EASTEUROPE_CHARSET THAI_CHARSET JOHAB_CHARSET MAC_CHARSET OEM_CHARSET
  out_precision | the precision of the face may have on of the following values: OUT_DEFAULT_PRECIS OUT_STRING_PRECIS OUT_CHARACTER_PRECIS OUT_STROKE_PRECIS OUT_TT_PRECIS OUT_DEVICE_PRECIS OUT_RASTER_PRECIS OUT_TT_ONLY_PRECIS OUT_OUTLINE_PRECIS
  clip_precision | the precision of glyph clipping may have one of the following values: CLIP_DEFAULT_PRECIS CLIP_CHARACTER_PRECIS CLIP_STROKE_PRECIS CLIP_MASK CLIP_LH_ANGLES CLIP_TT_ALWAYS CLIP_EMBEDDED
  quality | (subjective) quality of the font. Choose from the following values: DEFAULT_QUALITY DRAFT_QUALITY PROOF_QUALITY NONANTIALIASED_QUALITY ANTIALIASED_QUALITY
  pitch_family | the pitch and family of the FONT face. Add up the desired values from this list: DEFAULT_PITCH FIXED_PITCH VARIABLE_PITCH MONO_FONT FF_DONTCARE FF_ROMAN FF_SWISS FF_MODERN FF_SCRIPT FF_DECORATIVE
  name | ASCII string containing the name of the FONT face.
Returns: handle of font.

HFONT CreateFontIndirectA ( | const LOGFONTA * lfonta )

  | Create a new FONT using the logical(?) font specification. Parameters:
  lfont | pointer to logical font description.
Returns: handle of FONT object.

HFONT CreateFontIndirectW ( | const LOGFONTW * lfont )

  | Create a new FONT using the logical(?) font specification. Parameters:
  lfont | pointer to logical font description.
Returns: handle of FONT object.

HFONT CreateFontW ( | INT height,
| INT width,
| INT escapement,
| INT orientation,
| INT weight,
| DWORD italic,
| DWORD underline,
| DWORD strike_out,
| DWORD charset,
| DWORD out_precision,
| DWORD clip_precision,
| DWORD quality,
| DWORD pitch_family,
| LPCWSTR name )

  | Create a new FONT object. Presumably, the system tries to find a reasonable approximation to all the requested attributes. Parameters:
  height | typical glyph height.
  width | typical glyph width.
  escapement | (what is this?)
  orientation | angle, in degrees*10, of rendered string rotation.
  weight | weight has (at least) the following values: FW_DONTCARE FW_THIN FW_EXTRALIGHT FW_ULTRALIGHT FW_LIGHT FW_NORMAL FW_REGULAR FW_MEDIUM FW_SEMIBOLD FW_DEMIBOLD FW_BOLD FW_EXTRABOLD FW_ULTRABOLD FW_HEAVY FW_BLACK
  italic | non-zero means try to find an italic version of the face.
  underline | non-zero means to underline the glyphs.
  strike_out | non-zero means to strike-out the glyphs.
  charset | select the character set from the following list: ANSI_CHARSET DEFAULT_CHARSET SYMBOL_CHARSET SHIFTJIS_CHARSET HANGEUL_CHARSET HANGUL_CHARSET GB2312_CHARSET CHINESEBIG5_CHARSET GREEK_CHARSET TURKISH_CHARSET HEBREW_CHARSET ARABIC_CHARSET BALTIC_CHARSET RUSSIAN_CHARSET EE_CHARSET EASTEUROPE_CHARSET THAI_CHARSET JOHAB_CHARSET MAC_CHARSET OEM_CHARSET
  out_precision | the precision of the face may have on of the following values: OUT_DEFAULT_PRECIS OUT_STRING_PRECIS OUT_CHARACTER_PRECIS OUT_STROKE_PRECIS OUT_TT_PRECIS OUT_DEVICE_PRECIS OUT_RASTER_PRECIS OUT_TT_ONLY_PRECIS OUT_OUTLINE_PRECIS
  clip_precision | the precision of glyph clipping may have one of the following values: CLIP_DEFAULT_PRECIS CLIP_CHARACTER_PRECIS CLIP_STROKE_PRECIS CLIP_MASK CLIP_LH_ANGLES CLIP_TT_ALWAYS CLIP_EMBEDDED
  quality | (subjective) quality of the font. Choose from the following values: DEFAULT_QUALITY DRAFT_QUALITY PROOF_QUALITY NONANTIALIASED_QUALITY ANTIALIASED_QUALITY
  pitch_family | the pitch and family of the FONT face. Add up the desired values from this list: DEFAULT_PITCH FIXED_PITCH VARIABLE_PITCH MONO_FONT FF_DONTCARE FF_ROMAN FF_SWISS FF_MODERN FF_SCRIPT FF_DECORATIVE
  name | wide character string containing the name of the FONT face.
Returns: handle of font.

HMETAFILE CreateMetaFileA ( | LPCSTR filename )

  | The old 16-bit metafile constructor. Actually creates an Enhanced Metafile anyway. Parameters:
  filename | ASCII filename of metafile.
Returns: a handle to the metafile

HPEN CreatePen ( | INT style,
| INT width,
| COLORREF color )

  | Create a PEN, used to draw lines. Styles have (at least) the following values: PS_SOLID PS_DASH PS_DOT PS_DASHDOT PS_DASHDOTDOT PS_NULL PS_INSIDEFRAME PS_USERSTYLE PS_ALTERNATE Parameters:
  style | the style of the new PEN.
  width | the width of the new PEN.
  color | the color of the new PEN.
Returns: handle of new PEN graphics object.

HPEN CreatePenIndirect ( | const LOGPEN * lpen )

  | Create a PEN, used to draw lines. Parameters:
  lpen | use a structure to define the PEN attributes.
Returns: handle to PEN graphics object.

HBRUSH CreateSolidBrush ( | COLORREF color )

  | Create a solid BRUSH, used to fill polygons. Parameters:
  color | the color of the solid BRUSH.
Returns: handle to BRUSH graphics object.

BOOL DeleteDC ( | HDC context )

  | Delete a device context. (Have to check to see if there is any reason to ever call this.) Parameters:
  context | device context to delete.
Returns: true if context successfully deleted.

BOOL DeleteEnhMetaFile ( | HENHMETAFILE metafile )

  | Delete the metafile. Well, you can call this to clear out the memory used by the metafile, but it's already been written to disk by the time this is callable. Parameters:
  metafile | handle to the metafile.
Returns: true if metafile successfully deleted.

BOOL DeleteMetaFile ( | HMETAFILE metafile )

  | Delete the metafile. Well, you can call this to clear out the memory used by the metafile, but it's already been written to disk by the time this is callable. Just calls DeleteEnhMetafile. Parameters:
  metafile | handle to the metafile.
Returns: true if metafile successfully deleted.

BOOL DeleteObject ( | HGDIOBJ obj )

  | Delete the given graphics object. Note that, now, only those contexts into which the object has been selected get a delete object records. (Makes a lot more sense to me now.) Parameters:
  obj | handle of graphics object to make current.
Returns: true if the object was successfully deleted.

void EditEnhMetaFile ( | HENHMETAFILE metafile )

  | This is not a ECMA-234 standard function. Edit (print) the contents of the metafile to stdout. Also, this function does nothing if editing wasn't enabled at ./configure time. Parameters:
  metafile | The handle of a metafile (which implies that the metafile has been closed already even though it will work on an open metafile).

BOOL Ellipse ( | HDC context,
| INT left,
| INT top,
| INT right,
| INT bottom )

  | Draw an ellipse. (I have no idea how the ellipse is defined!) Parameters:
  context | handle to metafile context.
  left | x position of left extrema of ellipse.
  top | y position of top extrema of ellipse.
  right | x position of right extrema of ellipse.
  bottom | y position of bottom extrema of ellipse.
Returns: true if the ellipse was successfully rendered.

BOOL EndPath ( | HDC context )

  | End the path definition. Parameters:
  context | handle to metafile context.
Returns: true if successful.

INT EnumFontFamiliesA ( | HDC,
| LPCSTR,
| FONTENUMPROCA,
| LPARAM )

INT EnumFontFamiliesExA ( | HDC,
| LPLOGFONTA,
| FONTENUMPROCEXA,
| LPARAM,
| DWORD )

INT EnumFontFamiliesExW ( | HDC,
| LPLOGFONTW,
| FONTENUMPROCEXW,
| LPARAM,
| DWORD )

INT EnumFontFamiliesW ( | HDC,
| LPCWSTR,
| FONTENUMPROCW,
| LPARAM )

INT EnumFontsA ( | HDC,
| LPCSTR,
| FONTENUMPROCA,
| LPARAM )

INT EnumFontsW ( | HDC,
| LPCWSTR,
| FONTENUMPROCW,
| LPARAM )

HPEN ExtCreatePen ( | DWORD style,
| DWORD width,
| const LOGBRUSH * brush,
| DWORD,
| const DWORD * )

  | Create a PEN. Use the color from brush. WINE does not do anything with style_count and style_bits, so I'm not sure what to do here. Parameters:
  style | the style of the new PEN.
  width | the width of the new PEN.
  brush | use the color of the brush.
  style_count | the number of styles in style_bits.
  style_bits | list of styles.
Returns: handle of new PEN graphics object.

BOOL ExtTextOutA ( | HDC context,
| INT x,
| INT y,
| UINT flags,
| const RECT * rect,
| LPCSTR string,
| UINT count,
| const INT * dx )

  | Draw a string of text at the given position and using the additional placement specifications. Parameters:
  context | handle to metafile context.
  x | x position of text.
  y | y position of text.
  flags | additional rendering information, sum of the following attributes: ETO_GRAYED ETO_OPAQUE ETO_CLIPPED ETO_GLYPH_INDEX ETO_RTLREADING ETO_IGNORELANGUAGE
  rect | optional clipping rectangle for text(?)
  string | ASCII text string to render.
  count | number of characters in string to draw.
  dx | returns a list of where each glyph was drawn(?)
Returns: true if text was successfully rendered.

BOOL FillPath ( | HDC context )

| Fill the defined path. Returns: true if successful.

HDC GetDC ( | HWND )

  | Return a device context from the given window handle. Neither of these exist here, actually. Parameters:
  window | handle to a window.
Returns: device context of window.

HWND GetDesktopWindow ( | void )

| Return a dummy handle to the desktop window (graphics systems aren't a requirement). Returns: 0

INT GetDeviceCaps ( | HDC context,
| INT capability )

  | Return various information about the "capabilities" of the device context. This is wholly fabricated for the metafile (i.e., there is no real device to which these attributes relate). Parameters:
  context | handle to metafile context.
  capability | enumeration with the following options: DRIVERVERSION TECHNOLOGY HORZSIZE VERTSIZE HORZRES VERTRES LOGPIXELSX LOGPIXELSY
Returns: device capability

HENHMETAFILE GetEnhMetaFileA ( | LPCSTR filename )

  | Read an enhanced metafile from the given file. Parameters:
  filename | ASCII file name.
Returns: metafile handle.

UINT GetEnhMetaFileHeader ( | HENHMETAFILE metafile,
| const UINT sizeof_enhmetaheader,
| LPENHMETAHEADER metaheader )

  | Retrieve the handle of a *closed* metafile. Parameters:
  metafile | metafile handle returned by CloseEnhMetaFile.
  sizeof_enhmetaheader | the size of the metafile file header structure passed in.
  metaheader | pointer to memory where the metafile header is to be stored
Returns: actual size of metafile header

HENHMETAFILE GetEnhMetaFileW ( | LPCWSTR filename )

  | Read an enhanced metafile from the given file. Parameters:
  filename | WCHAR file name.
Returns: metafile handle.

DWORD GetLastError ( | )

| Return the number of the last error. Since libEMF doesn't really do any graphics, this is always returns OK. Also, since this doesn't take any arguments, there appears to be only one, global, error number. Returns: the number of the last error.

INT GetObjectA ( | HGDIOBJ obj,
| INT size,
| LPVOID buffer )

  | Return information about the object. What does it want? Parameters:
  obj | handle of graphics object to query
  size | the size of the buffer to fill in
  buffer | memory to hold returned object
Returns: the actual size of the object copied into buffer

HGDIOBJ GetStockObject ( | INT obj )

  | Retrieve the handle for a predefined graphics object. Stock objects include (at least) the following: WHITE_BRUSH LTGRAY_BRUSH GRAY_BRUSH DKGRAY_BRUSH BLACK_BRUSH NULL_BRUSH HOLLOW_BRUSH WHITE_PEN BLACK_PEN NULL_PEN OEM_FIXED_FONT ANSI_FIXED_FONT ANSI_VAR_FONT SYSTEM_FONT DEVICE_DEFAULT_FONT DEFAULT_PALETTE SYSTEM_FIXED_FONT DEFAULT_GUI_FONT Parameters:
  obj | number of stock object.
Returns: handle of stock graphics object.

INT GetTextCharacterExtra ( | HDC )

  | Returns the extra space between each character setting. Parameters:
  context | handle to metafile context.
Returns: the current setting.

BOOL GetTextExtentPoint32A ( | HDC,
| LPCSTR,
| INT,
| LPSIZE )

  | Measure the extents of a string. Parameters:
  context | handle to metafile context.
  string | ASCII string to measure.
  count | number of characters in string.
  size | size of text extents.
Returns: true if successful.

INT GetTextFaceA ( | HDC,
| INT,
| LPSTR )

  | Evidently returns the name of the current font. Parameters:
  context | handle to metafile context.
  count | size of name buffer
  name | buffer to store returned name
Returns: real number of bytes in name

BOOL GetTextMetricsA ( | HDC,
| LPTEXTMETRICA )

  | Return information about the current font. Parameters:
  context | handle to metafile context
  textmetrics | returns the font metrics.
Returns: true if successful.

BOOL GetViewportExtEx ( | HDC context,
| LPSIZE size )

  | Get the dimensions of the viewport. Parameters:
  context | handle of metafile context.
  size | returns the current size of the viewport.
Returns: true if viewport size successfully returned.

BOOL GetViewportOrgEx ( | HDC context,
| LPPOINT point )

  | Get the origin of the viewport. Parameters:
  context | handle of metafile context.
  point | returns the current viewport origin.
Returns: true if viewport origin successfully returned.

BOOL GetWindowExtEx ( | HDC context,
| LPSIZE size )

  | Get the dimensions of the window. Parameters:
  context | handle of metafile context.
  size | returns the previous size of the window.
Returns: true if window size successfully returned.

BOOL GetWindowOrgEx ( | HDC context,
| LPPOINT point )

  | Get the origin of the window. Parameters:
  context | handle of metafile context.
  point | returns the current window origin.
Returns: true if window origin successfully returned.

BOOL LineTo ( | HDC context,
| INT x,
| INT y )

  | Draw a straight line using the current PEN from the current point to the given position. Parameters:
  context | handle to metafile context
  x | x position of line end.
  y | y position of line end.
Returns: true if line is drawn (can this fail?)

BOOL ModifyWorldTransform ( | HDC context,
| const XFORM * transform,
| DWORD mode )

  | Multiply the given Affine transform times the current global transformation. (Not handled correctly by StarOffice 5.2, as near as I can tell, anyway.) Parameters:
  context | handle of metafile context.
  transform | transformation modification array.
  mode | indicate whether the transformation should be pre- or post- multiplied into the current transformation.
Returns: true if global transformation was successfully modified.

BOOL MoveToEx ( | HDC context,
| INT x,
| INT y,
| LPPOINT point )

  | Move the current point to the given position. Parameters:
  context | handle to metafile context
  x | new x position.
  y | new y position.
  point | returns a copy of the old current point.
Returns: true if position successfully changed (can this fail?)

BOOL PlayEnhMetaFile ( | HDC context,
| HENHMETAFILE metafile,
| const RECT * )

  | "Display" the enhanced metafile in the given device context. For the purposes of this library, this re-executes each graphics command in the given context. Parameters:
  context | The device context in which to display the metafile.
  metafile | The (loaded) metafile to display.
  frame | A bounding rectangle in context for the metafile.
  true | if successfully copied.

BOOL PolyBezier ( | HDC context,
| const POINT * points,
| DWORD n )

  | Draw a Bezier curve. Parameters:
  context | handle to metafile context.
  point | array of points to draw.
  n | number of points in the array.
Returns: true if Bezier curve is successfully rendered.

BOOL PolyBezier16 ( | HDC16 context,
| const POINT16 * points,
| INT16 n )

  | Draw a Bezier curve using 16-bit points. Parameters:
  context | handle to metafile context.
  point | array of points to draw.
  n | number of points in the array.
Returns: true if Bezier curve is successfully rendered.

BOOL PolyBezierTo ( | HDC context,
| const POINT * points,
| DWORD n )

  | Draw a Bezier curve to (what?). Parameters:
  context | handle to metafile context.
  point | array of points to draw.
  n | number of points in the array.
Returns: true if Bezier curve is successfully rendered.

BOOL PolyBezierTo16 ( | HDC context,
| const POINT16 * points,
| INT16 n )

  | Draw a Bezier curve to (what?) using 16-bit points. Parameters:
  context | handle to metafile context.
  point | array of points to draw.
  n | number of points in the array.
Returns: true if Bezier curve is successfully rendered.

BOOL PolyPolygon ( | HDC context,
| const POINT * points,
| const INT * counts,
| UINT polygons )

  | Draw a series of sequences of connected straight line segments where the end of the last line segment is connect to the beginning of the first line segment. Parameters:
  context | handle to metafile context.
  points | array of points to draw.
  counts | array of number of points in each polygon.
  polygons | number of polygons (i.e. number of values in counts array).
Returns: true if the polygons are successfully rendered.

BOOL PolyPolygon16 ( | HDC context,
| const POINT16 * points,
| const INT * counts,
| UINT16 polygons )

  | Draw a series of sequences of connected straight line segments where the end of the last line segment is connect to the beginning of the first line segment. Uses the 16-bit interface (not directly callable from a user-program, though). Parameters:
  context | handle to metafile context.
  points | array of points to draw.
  counts | array of number of points in each polygon.
  polygons | number of polygons (i.e. number of values in counts array).
Returns: true if the polygons are successfully rendered.

BOOL Polygon ( | HDC context,
| const POINT * points,
| INT n )

  | Draw a sequence of connected straight line segments where the end of the last line segment is connect to the beginning of the first line segment. Parameters:
  context | handle to metafile context.
  points | array of points to draw.
  n | number of points in the array.
Returns: true if polygon is successfully rendered.

BOOL Polyline ( | HDC context,
| const POINT * points,
| INT n )

  | Draw a sequence of connected lines. Parameters:
  context | handle to metafile context.
  point | array of points to draw.
  n | number of points in the array.
Returns: true if polyline is successfully rendered.

BOOL Polyline16 ( | HDC context,
| const POINT16 * points,
| INT16 n )

  | Draw a sequence of connected lines using 16-bit points. Parameters:
  context | handle to metafile context.
  point | array of points to draw.
  n | number of points in the array.
Returns: true if polyline is successfully rendered.

BOOL PolylineTo ( | HDC context,
| const POINT * points,
| DWORD n )

  | Draw a Polyline to (what?). Parameters:
  context | handle to metafile context.
  point | array of points to draw.
  n | number of points in the array.
Returns: true if Polyline is successfully rendered.

BOOL PolylineTo16 ( | HDC context,
| const POINT16 * points,
| INT16 n )

  | Draw a Polyline to (what?) using 16-bit points. Parameters:
  context | handle to metafile context.
  point | array of points to draw.
  n | number of points in the array.
Returns: true if Polyline is successfully rendered.

BOOL Rectangle ( | HDC context,
| INT left,
| INT top,
| INT right,
| INT bottom )

  | Draw a rectangle using the current brush. Parameters:
  context | handle to metafile context.
  left | x position of left side of rectangle.
  top | y position of top side of rectangle.
  right | x position of right edge of rectangle.
  bottom | y position of bottom edge of rectangle.
Returns: true if rectangle was successfully rendered.

INT ReleaseDC ( | HWND,
| HDC )

  | Surrender device context associated with the given window. Does nothing here. Parameters:
  window | handle to a window.
  context | device context associated with window.
Returns: 1 (determined from wine source code)

INT RestoreDC ( | HDC context,
| INT n )

  | Get the (contents of?) given Device Context off a stack (?). Parameters:
  dc | device context to restore into
  n | pushed context to restore
Returns: number of save'd contexts?

INT SaveDC ( | HDC context )

  | Push the (contents of?) given Device Context on to a stack (?). Parameters:
  dc | device context to save
Returns: number of save'd contexts?

BOOL ScaleViewportExtEx ( | HDC context,
| INT x_num,
| INT x_den,
| INT y_num,
| INT y_den,
| LPSIZE size )

  | Scale the dimensions of the viewport. Parameters:
  context | handle of metafile context.
  x_num | numerator of x scale
  x_den | denominator of x scale
  y_num | numerator of y scale
  y_den | denominator of y scale
Returns: true if viewport size successfully set.

BOOL ScaleWindowExtEx ( | HDC context,
| INT x_num,
| INT x_den,
| INT y_num,
| INT y_den,
| LPSIZE size )

  | Scale the dimensions of the window. Parameters:
  context | handle of metafile context.
  x_num | numerator of x scale
  x_den | denominator of x scale
  y_num | numerator of y scale
  y_den | denominator of y scale
Returns: true if window size successfully set.

HGDIOBJ SelectObject ( | HDC context,
| HGDIOBJ obj )

  | Make the given graphics object current. Parameters:
  context | handle to metafile context.
  obj | handle of graphics object to make current.
Returns: the handle of the current graphics object which obj replaces.

COLORREF SetBkColor ( | HDC context,
| COLORREF color )

  | Set the background color. (As near as I can tell, StarOffice only uses this for text background.) Parameters:
  context | handle of metafile context.
  color | background color.
Returns: previous background color.

INT SetBkMode ( | HDC context,
| INT mode )

  | Set the background mode. (As near as I can tell, StarOffice ignores this value.) The choices for mode are: TRANSPARENT OPAQUE Parameters:
  context | handle of metafile context.
  mode | background mode.
Returns: previous background mode.

INT SetDIBitsToDevice ( | HDC,
| INT,
| INT,
| DWORD,
| DWORD,
| INT,
| INT,
| UINT,
| UINT,
| LPCVOID,
| const BITMAPINFO *,
| UINT )

INT SetMapMode ( | HDC context,
| INT mode )

  | Set the window mapping mode. (Unfortunately, as near as I can tell, StarOffice ignores this value.) The choices for mode are: MM_TEXT MM_LOMETRIC MM_HIMETRIC MM_LOENGLISH MM_HIENGLISH MM_TWIPS MM_ISOTROPIC MM_ANISOTROPIC Parameters:
  context | handle of metafile context.
  mode | window mapping mode.
Returns: previous window mapping mode.

INT SetMetaRgn ( | HDC context )

  | Uhm? Parameters:
  dc | device context
Returns: number of somethings?

COLORREF SetPixel ( | HDC context,
| INT x,
| INT y,
| COLORREF color )

  | Set the pixel to the given color. Parameters:
  context | the metafile device context.
  x | the horizontal position of the pixel to color.
  y | the vertical position of the pixel to color.
  color | the color to color the pixel with.
Returns: the previous color of the pixel? (not really implemented, though).

INT SetPolyFillMode ( | HDC context,
| INT mode )

  | Set the polygon fill mode. Parameters:
  polygon | fill mode with the following options: ALTERNATE WINDING
Returns: previous fill mode.

UINT SetTextAlign ( | HDC context,
| UINT alignment )

  | Set the subsequent alignment of drawn text. You can also pass a flag indicating whether or not to update the current point to the end of the text. Alignment may have the (sum of) values: TA_NOUPDATECP TA_UPDATECP TA_LEFT TA_RIGHT TA_CENTER TA_TOP TA_BOTTOM TA_BASELINE TA_RTLREADING Parameters:
  context | handle of metafile context.
  alignment | new text alignment.
Returns: previous text alignment value.

INT SetTextCharacterExtra ( | HDC,
| INT )

  | Adds extra space between each character drawn. Parameters:
  context | handle to metafile context.
  extra | extra space to add.
Returns: previous value.

COLORREF SetTextColor ( | HDC context,
| COLORREF color )

  | Set the text foreground color. Parameters:
  context | handle of metafile context.
  color | text foreground color.
Returns: previous text foreground color.

BOOL SetTextJustification ( | HDC,
| INT,
| INT )

  | Even after reading the documentation for this function, I still don't understand what it does. This has no EMF implementation. Parameters:
  context | handle to metafile context.
  extra | number of extra spaces.
  breaks | number of break characters.
Returns: true if successful.

BOOL SetViewportExtEx ( | HDC context,
| INT cx,
| INT cy,
| LPSIZE size )

  | Set the dimensions of the viewport. (Not honored by StarOffice!) Parameters:
  context | handle of metafile context.
  cx | new width of the viewport.
  cy | new height of the viewport.
  size | returns the previous size of the viewport (currently unused).
Returns: true if viewport size successfully set.

BOOL SetViewportOrgEx ( | HDC context,
| INT x,
| INT y,
| LPPOINT point )

  | Set the origin of the viewport. (Not entirely sure if this is honored by StarOffice.) Parameters:
  context | handle of metafile context.
  x | new x position of the viewport origin.
  y | new y position of the viewport origin.
  point | returns the previous viewport origin.
Returns: true if viewport origin successfully set.

BOOL SetWindowExtEx ( | HDC context,
| INT cx,
| INT cy,
| LPSIZE size )

  | Set the dimensions of the window. (Not entirely sure if this is honored by StarOffice.) Parameters:
  context | handle of metafile context.
  cx | new width of the window.
  cy | new height of the window.
  size | returns the previous size of the window (currently unused).
Returns: true if window size successfully set.

BOOL SetWindowOrgEx ( | HDC context,
| INT x,
| INT y,
| LPPOINT point )

  | Set the origin of the window. Evidently, this means that a point drawn at the given coordinates will appear at the Viewport origin. Parameters:
  context | handle of metafile context.
  x | new x position of the window origin.
  y | new y position of the window origin.
  point | returns the previous window origin (currently unused).
Returns: true if window origin successfully set.

BOOL SetWorldTransform ( | HDC context,
| const XFORM * transform )

  | Replace the global transformation with the given transformation. (Not handled correctly by StarOffice 5.2, as near as I can tell, anyway.) Parameters:
  context | handle of metafile context.
  transform | new global transformation.
Returns: true if global transformation was successfully replaced.

INT StretchDIBits ( | HDC,
| INT,
| INT,
| INT,
| INT,
| INT,
| INT,
| INT,
| INT,
| const void *,
| const BITMAPINFO *,
| UINT,
| DWORD )

BOOL StrokePath ( | HDC context )

| Outline the defined path. Returns: true if successful.

BOOL TextOutA ( | HDC context,
| INT x,
| INT y,
| LPCSTR string,
| INT count )

  | Draw a string of text at the given position using the current FONT and other text attributes. Parameters:
  context | handle to metafile context.
  x | x position of text.
  y | y position of text.
  string | ASCII text string to render.
  count | number of characters in string to draw.
Returns: true of string successfully drawn.