ReactOS  0.4.15-dev-5097-g328cc41
metadc.c File Reference
#include "wine/config.h"
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winnls.h"
#include "winerror.h"
#include "gdi_private.h"
#include "winternl.h"
#include "wine/wingdi16.h"
#include "wine/debug.h"
Include dependency graph for metadc.c:

Go to the source code of this file.

Classes

struct  metadc
 

Macros

#define HANDLE_LIST_INC   20
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (metafile)
 
struct metadcget_metadc_ptr (HDC hdc)
 
static BOOL metadc_write_record (struct metadc *metadc, METARECORD *mr, unsigned int rlen)
 
static BOOL metadc_record (HDC hdc, METARECORD *mr, DWORD rlen)
 
static BOOL metadc_param0 (HDC hdc, short func)
 
static BOOL metadc_param1 (HDC hdc, short func, short param)
 
static BOOL metadc_param2 (HDC hdc, short func, short param1, short param2)
 
static BOOL metadc_param4 (HDC hdc, short func, short param1, short param2, short param3, short param4)
 
static BOOL metadc_param5 (HDC hdc, short func, short param1, short param2, short param3, short param4, short param5)
 
static BOOL metadc_param6 (HDC hdc, short func, short param1, short param2, short param3, short param4, short param5, short param6)
 
static BOOL metadc_param8 (HDC hdc, short func, short param1, short param2, short param3, short param4, short param5, short param6, short param7, short param8)
 
BOOL METADC_SaveDC (HDC hdc)
 
BOOL METADC_RestoreDC (HDC hdc, INT level)
 
BOOL METADC_SetTextAlign (HDC hdc, UINT align)
 
BOOL METADC_SetBkMode (HDC hdc, INT mode)
 
BOOL METADC_SetBkColor (HDC hdc, COLORREF color)
 
BOOL METADC_SetTextColor (HDC hdc, COLORREF color)
 
BOOL METADC_SetROP2 (HDC hdc, INT rop)
 
BOOL METADC_SetRelAbs (HDC hdc, INT mode)
 
BOOL METADC_SetPolyFillMode (HDC hdc, INT mode)
 
BOOL METADC_SetStretchBltMode (HDC hdc, INT mode)
 
BOOL METADC_IntersectClipRect (HDC hdc, INT left, INT top, INT right, INT bottom)
 
BOOL METADC_ExcludeClipRect (HDC hdc, INT left, INT top, INT right, INT bottom)
 
BOOL METADC_OffsetClipRgn (HDC hdc, INT x, INT y)
 
BOOL METADC_SetLayout (HDC hdc, DWORD layout)
 
BOOL METADC_SetMapMode (HDC hdc, INT mode)
 
BOOL METADC_SetViewportExtEx (HDC hdc, INT x, INT y)
 
BOOL METADC_SetViewportOrgEx (HDC hdc, INT x, INT y)
 
BOOL METADC_SetWindowExtEx (HDC hdc, INT x, INT y)
 
BOOL METADC_SetWindowOrgEx (HDC hdc, INT x, INT y)
 
BOOL METADC_OffsetViewportOrgEx (HDC hdc, INT x, INT y)
 
BOOL METADC_OffsetWindowOrgEx (HDC hdc, INT x, INT y)
 
BOOL METADC_ScaleViewportExtEx (HDC hdc, INT x_num, INT x_denom, INT y_num, INT y_denom)
 
BOOL METADC_ScaleWindowExtEx (HDC hdc, INT x_num, INT x_denom, INT y_num, INT y_denom)
 
BOOL METADC_SetTextJustification (HDC hdc, INT extra, INT breaks)
 
BOOL METADC_SetTextCharacterExtra (HDC hdc, INT extra)
 
BOOL METADC_SetMapperFlags (HDC hdc, DWORD flags)
 
BOOL METADC_MoveTo (HDC hdc, INT x, INT y)
 
BOOL METADC_LineTo (HDC hdc, INT x, INT y)
 
BOOL METADC_Arc (HDC hdc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend)
 
BOOL METADC_Pie (HDC hdc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend)
 
BOOL METADC_Chord (HDC hdc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend)
 
BOOL METADC_Ellipse (HDC hdc, INT left, INT top, INT right, INT bottom)
 
BOOL METADC_Rectangle (HDC hdc, INT left, INT top, INT right, INT bottom)
 
BOOL METADC_RoundRect (HDC hdc, INT left, INT top, INT right, INT bottom, INT ell_width, INT ell_height)
 
BOOL METADC_SetPixel (HDC hdc, INT x, INT y, COLORREF color)
 
static BOOL metadc_poly (HDC hdc, short func, POINTS *pt, short count)
 
BOOL METADC_Polyline (HDC hdc, const POINT *pt, INT count)
 
BOOL METADC_Polygon (HDC hdc, const POINT *pt, INT count)
 
BOOL METADC_PolyPolygon (HDC hdc, const POINT *pt, const INT *counts, UINT polygons)
 
BOOL METADC_ExtFloodFill (HDC hdc, INT x, INT y, COLORREF color, UINT fill_type)
 
static UINT metadc_add_handle (struct metadc *metadc, HGDIOBJ obj)
 
static BOOL metadc_remove_handle (struct metadc *metadc, UINT index)
 
static INT16 metadc_create_brush (struct metadc *metadc, HBRUSH brush)
 
static INT16 metadc_create_region (struct metadc *metadc, HRGN hrgn)
 
BOOL METADC_PaintRgn (HDC hdc, HRGN hrgn)
 
BOOL METADC_InvertRgn (HDC hdc, HRGN hrgn)
 
BOOL METADC_FillRgn (HDC hdc, HRGN hrgn, HBRUSH hbrush)
 
BOOL METADC_FrameRgn (HDC hdc, HRGN hrgn, HBRUSH hbrush, INT x, INT y)
 
BOOL METADC_PatBlt (HDC hdc, INT left, INT top, INT width, INT height, DWORD rop)
 
static BOOL metadc_stretchblt (HDC hdc, INT x_dst, INT y_dst, INT width_dst, INT height_dst, HDC hdc_src, INT x_src, INT y_src, INT width_src, INT height_src, DWORD rop, WORD type)
 
BOOL METADC_BitBlt (HDC hdc, INT x_dst, INT y_dst, INT width, INT height, HDC hdc_src, INT x_src, INT y_src, DWORD rop)
 
BOOL METADC_StretchBlt (HDC hdc_dst, INT x_dst, INT y_dst, INT width_dst, INT height_dst, HDC hdc_src, INT x_src, INT y_src, INT width_src, INT height_src, DWORD rop)
 
INT METADC_StretchDIBits (HDC hdc, INT x_dst, INT y_dst, INT width_dst, INT height_dst, INT x_src, INT y_src, INT width_src, INT height_src, const void *bits, const BITMAPINFO *info, UINT usage, DWORD rop)
 
INT METADC_SetDIBitsToDevice (HDC hdc, INT x_dst, INT y_dst, DWORD width, DWORD height, INT x_src, INT y_src, UINT startscan, UINT lines, const void *bits, const BITMAPINFO *info, UINT coloruse)
 
static BOOL metadc_text (HDC hdc, short x, short y, UINT16 flags, const RECT16 *rect, const char *str, short count, const INT16 *dx)
 
BOOL METADC_ExtTextOut (HDC hdc, INT x, INT y, UINT flags, const RECT *lprect, const WCHAR *str, UINT count, const INT *dx)
 
BOOL METADC_ExtSelectClipRgn (HDC hdc, HRGN hrgn, INT mode)
 
static INT16 metadc_find_object (struct metadc *metadc, HGDIOBJ obj)
 
void METADC_DeleteObject (HDC hdc, HGDIOBJ obj)
 
static BOOL metadc_select_object (HDC hdc, INT16 index)
 
static HBRUSH METADC_SelectBrush (HDC hdc, HBRUSH hbrush)
 
static UINT16 metadc_create_font (struct metadc *metadc, HFONT font, LOGFONTW *logfont)
 
static HFONT METADC_SelectFont (HDC hdc, HFONT hfont)
 
static UINT16 metadc_create_pen (struct metadc *metadc, HPEN pen, LOGPEN16 *logpen)
 
static HPEN METADC_SelectPen (HDC hdc, HPEN hpen)
 
static BOOL metadc_create_palette (struct metadc *metadc, HPALETTE palette, LOGPALETTE *log_palette, int sizeofPalette)
 
BOOL METADC_SelectPalette (HDC hdc, HPALETTE palette)
 
BOOL METADC_RealizePalette (HDC hdc)
 
HGDIOBJ METADC_SelectObject (HDC hdc, HGDIOBJ obj)
 
BOOL METADC_ExtEscape (HDC hdc, INT escape, INT input_size, LPCSTR input, INT output_size, LPVOID output)
 
INT METADC_GetDeviceCaps (HDC hdc, INT cap)
 
static void metadc_free (struct metadc *metadc)
 
BOOL METADC_DeleteDC (HDC hdc)
 
HDC WINAPI CreateMetaFileW (const WCHAR *filename)
 
HDC WINAPI CreateMetaFileA (const char *filename)
 
HMETAFILE WINAPI CloseMetaFile (HDC hdc)
 

Macro Definition Documentation

◆ HANDLE_LIST_INC

#define HANDLE_LIST_INC   20

Definition at line 57 of file metadc.c.

Function Documentation

◆ CloseMetaFile()

HMETAFILE WINAPI CloseMetaFile ( HDC  hdc)

Definition at line 1424 of file metadc.c.

1425 {
1426  struct metadc *metadc;
1427  DWORD bytes_written;
1428  HMETAFILE hmf;
1429 
1430  TRACE( "(%p)\n", hdc );
1431 
1432  if (!(metadc = get_metadc_ptr( hdc ))) return FALSE;
1433 
1434  /* Construct the end of metafile record - this is documented
1435  * in SDK Knowledgebase Q99334.
1436  */
1437  if (!metadc_param0( hdc, META_EOF )) return FALSE;
1438  if (!GdiDeleteClientObj( hdc )) return FALSE;
1439 
1440  if (metadc->hFile && !WriteFile( metadc->hFile, metadc->mh, metadc->mh->mtSize * sizeof(WORD),
1441  &bytes_written, NULL ))
1442  {
1443  metadc_free( metadc );
1444  return FALSE;
1445  }
1446 
1447  /* Now allocate a global handle for the metafile */
1448  hmf = MF_Create_HMETAFILE( metadc->mh );
1449  if (hmf) metadc->mh = NULL; /* So it won't be deleted */
1450  metadc_free( metadc );
1451  return hmf;
1452 }
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
METAHEADER * mh
Definition: metadc.c:48
DWORD mtSize
Definition: wingdi.h:2313
HANDLE hFile
Definition: metadc.c:51
#define FALSE
Definition: types.h:117
#define TRACE(s)
Definition: solgame.cpp:4
static void metadc_free(struct metadc *metadc)
Definition: metadc.c:1305
HMETAFILE MF_Create_HMETAFILE(METAHEADER *mh) DECLSPEC_HIDDEN
Definition: metafile.c:107
unsigned short WORD
Definition: ntddk_ex.h:93
PVOID WINAPI GdiDeleteClientObj(_In_ HGDIOBJ hobj)
Definition: clientobj.c:173
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL metadc_param0(HDC hdc, short func)
Definition: metadc.c:96
Definition: metadc.c:45
HDC hdc
Definition: main.c:9
#define NULL
Definition: types.h:112
struct metadc * get_metadc_ptr(HDC hdc)
Definition: metadc.c:60
#define META_EOF
Definition: gdi_private.h:71

◆ CreateMetaFileA()

HDC WINAPI CreateMetaFileA ( const char filename)

Definition at line 1400 of file metadc.c.

1401 {
1402  LPWSTR filenameW;
1403  DWORD len;
1404  HDC hdc;
1405 
1406  if (!filename) return CreateMetaFileW( NULL );
1407 
1408  len = MultiByteToWideChar( CP_ACP, 0, filename, -1, NULL, 0 );
1409  filenameW = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
1411 
1413 
1415  return hdc;
1416 }
#define CP_ACP
Definition: compat.h:109
static HDC
Definition: imagelist.c:92
const char * filename
Definition: ioapi.h:135
static const WCHAR filenameW[]
Definition: amstream.c:41
HDC WINAPI CreateMetaFileW(const WCHAR *filename)
Definition: metadc.c:1334
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
HDC hdc
Definition: main.c:9
GLenum GLsizei len
Definition: glext.h:6722
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:594

◆ CreateMetaFileW()

HDC WINAPI CreateMetaFileW ( const WCHAR filename)

Definition at line 1334 of file metadc.c.

1335 {
1336  struct metadc *metadc;
1337  HANDLE hdc;
1338 
1339  TRACE( "%s\n", debugstr_w(filename) );
1340 
1341  metadc = HeapAlloc( GetProcessHeap(), 0, sizeof(*metadc) );
1342  if (!metadc)
1343  {
1344  return NULL;
1345  }
1346  if (!(metadc->mh = HeapAlloc( GetProcessHeap(), 0, sizeof(*metadc->mh) )))
1347  {
1348  HeapFree( GetProcessHeap(), 0, metadc );
1349  return NULL;
1350  }
1351 
1353  {
1354  HeapFree( GetProcessHeap(), 0, metadc );
1355  return NULL;
1356  }
1357 
1358  metadc->hdc = hdc;
1359 
1361  HANDLE_LIST_INC * sizeof(metadc->handles[0]) );
1363  metadc->cur_handles = 0;
1364 
1365  metadc->hFile = 0;
1366 
1367  metadc->mh->mtHeaderSize = sizeof(METAHEADER) / sizeof(WORD);
1368  metadc->mh->mtVersion = 0x0300;
1370  metadc->mh->mtNoObjects = 0;
1371  metadc->mh->mtMaxRecord = 0;
1372  metadc->mh->mtNoParameters = 0;
1374 
1378 
1379  SetVirtualResolution( hdc, 0, 0, 0, 0);
1380 
1381  if (filename) /* disk based metafile */
1382  {
1384  if (file == INVALID_HANDLE_VALUE)
1385  {
1386  HeapFree( GetProcessHeap(), 0, metadc );
1388  return 0;
1389  }
1390  metadc->hFile = file;
1391  }
1392 
1393  TRACE( "returning %p\n", hdc );
1394  return hdc;
1395 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
METAHEADER * mh
Definition: metadc.c:48
HBRUSH brush
Definition: metadc.c:53
DWORD mtSize
Definition: wingdi.h:2313
UINT handles_size
Definition: metadc.c:49
HGDIOBJ * handles
Definition: metadc.c:50
struct tagMETAHEADER METAHEADER
HGDIOBJ WINAPI GdiCreateClientObj(_In_ PVOID pvObject, _In_ GDILOOBJTYPE eObjType)
Definition: clientobj.c:148
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
#define WHITE_BRUSH
Definition: wingdi.h:902
#define HANDLE_LIST_INC
Definition: metadc.c:57
const char * filename
Definition: ioapi.h:135
HPEN pen
Definition: metadc.c:52
WORD mtType
Definition: wingdi.h:2310
HANDLE hFile
Definition: metadc.c:51
#define GENERIC_WRITE
Definition: nt_native.h:90
#define debugstr_w
Definition: kernel32.h:32
#define DEVICE_DEFAULT_FONT
Definition: wingdi.h:908
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HDC hdc
Definition: metadc.c:47
UINT cur_handles
Definition: metadc.c:49
const char file[]
Definition: icontest.c:11
WORD mtHeaderSize
Definition: wingdi.h:2311
unsigned short WORD
Definition: ntddk_ex.h:93
PVOID WINAPI GdiDeleteClientObj(_In_ HGDIOBJ hobj)
Definition: clientobj.c:173
Definition: metadc.c:45
HDC hdc
Definition: main.c:9
WORD mtVersion
Definition: wingdi.h:2312
BOOL WINAPI SetVirtualResolution(HDC hdc, DWORD horz_res, DWORD vert_res, DWORD horz_size, DWORD vert_size)
Definition: rosglue.c:278
DWORD mtMaxRecord
Definition: wingdi.h:2315
HFONT font
Definition: metadc.c:54
#define CREATE_ALWAYS
Definition: disk.h:72
#define BLACK_PEN
Definition: wingdi.h:903
WORD mtNoObjects
Definition: wingdi.h:2314
#define NULL
Definition: types.h:112
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
WORD mtNoParameters
Definition: wingdi.h:2316
#define CreateFileW
Definition: compat.h:600
#define METAFILE_MEMORY
Definition: gdi32p.h:76
#define HeapFree(x, y, z)
Definition: compat.h:594
Definition: fci.c:126

Referenced by CreateMetaFileA().

◆ get_metadc_ptr()

struct metadc* get_metadc_ptr ( HDC  hdc)

Definition at line 60 of file metadc.c.

61 {
62  struct metadc *metafile = GdiGetClientObjLink(hdc);//get_gdi_client_ptr( hdc, NTGDI_OBJ_METADC );
64  return metafile;
65 }
PVOID WINAPI GdiGetClientObjLink(_In_ HGDIOBJ hobj)
Definition: clientobj.c:61
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
static const unsigned char metafile[]
Definition: olepicture.c:138
#define SetLastError(x)
Definition: compat.h:611
Definition: metadc.c:45
HDC hdc
Definition: main.c:9

Referenced by CloseMetaFile(), METADC_DeleteDC(), METADC_DeleteObject(), METADC_ExtSelectClipRgn(), METADC_FillRgn(), METADC_FrameRgn(), METADC_GetDeviceCaps(), METADC_InvertRgn(), METADC_PaintRgn(), metadc_record(), METADC_SelectBrush(), METADC_SelectFont(), METADC_SelectPalette(), and METADC_SelectPen().

◆ metadc_add_handle()

static UINT metadc_add_handle ( struct metadc metadc,
HGDIOBJ  obj 
)
static

Definition at line 497 of file metadc.c.

498 {
499  UINT16 index;
500 
501  for (index = 0; index < metadc->handles_size; index++)
502  if (metadc->handles[index] == 0) break;
503  if(index == metadc->handles_size)
504  {
507  metadc->handles,
508  metadc->handles_size * sizeof(metadc->handles[0]) );
509  }
511 
512  metadc->cur_handles++;
514  metadc->mh->mtNoObjects++;
515 
516  return index ; /* index 0 is not reserved for metafiles */
517 }
METAHEADER * mh
Definition: metadc.c:48
UINT handles_size
Definition: metadc.c:49
HGDIOBJ * handles
Definition: metadc.c:50
#define HANDLE_LIST_INC
Definition: metadc.c:57
HGDIOBJ get_full_gdi_handle(HGDIOBJ handle) DECLSPEC_HIDDEN
GLuint index
Definition: glext.h:6031
#define GetProcessHeap()
Definition: compat.h:595
UINT cur_handles
Definition: metadc.c:49
#define index(s, c)
Definition: various.h:29
Definition: metadc.c:45
WORD mtNoObjects
Definition: wingdi.h:2314
#define HeapReAlloc
Definition: compat.h:593
unsigned short UINT16
#define HEAP_ZERO_MEMORY
Definition: compat.h:134

Referenced by metadc_create_brush(), metadc_create_font(), metadc_create_palette(), metadc_create_pen(), and metadc_create_region().

◆ METADC_Arc()

BOOL METADC_Arc ( HDC  hdc,
INT  left,
INT  top,
INT  right,
INT  bottom,
INT  xstart,
INT  ystart,
INT  xend,
INT  yend 
)

Definition at line 341 of file metadc.c.

343 {
345  xstart, ystart, xend, yend );
346 }
GLint GLint bottom
Definition: glext.h:7726
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
HDC hdc
Definition: main.c:9
#define META_ARC
Definition: wingdi.h:233
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
static BOOL metadc_param8(HDC hdc, short func, short param1, short param2, short param3, short param4, short param5, short param6, short param7, short param8)
Definition: metadc.c:180

◆ METADC_BitBlt()

BOOL METADC_BitBlt ( HDC  hdc,
INT  x_dst,
INT  y_dst,
INT  width,
INT  height,
HDC  hdc_src,
INT  x_src,
INT  y_src,
DWORD  rop 
)

Definition at line 800 of file metadc.c.

802 {
803  return metadc_stretchblt( hdc, x_dst, y_dst, width, height,
804  hdc_src, x_src, y_src, width, height, rop, META_DIBBITBLT );
805 }
GLint GLint GLsizei width
Definition: gl.h:1546
static int rop(int rop, int src, int dst)
Definition: nanoxwin.c:124
static BOOL metadc_stretchblt(HDC hdc, INT x_dst, INT y_dst, INT width_dst, INT height_dst, HDC hdc_src, INT x_src, INT y_src, INT width_src, INT height_src, DWORD rop, WORD type)
Definition: metadc.c:743
#define META_DIBBITBLT
Definition: wingdi.h:267
HDC hdc
Definition: main.c:9
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546

◆ METADC_Chord()

BOOL METADC_Chord ( HDC  hdc,
INT  left,
INT  top,
INT  right,
INT  bottom,
INT  xstart,
INT  ystart,
INT  xend,
INT  yend 
)

Definition at line 355 of file metadc.c.

357 {
359  xstart, ystart, xend, yend );
360 }
GLint GLint bottom
Definition: glext.h:7726
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
HDC hdc
Definition: main.c:9
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
#define META_CHORD
Definition: wingdi.h:257
static BOOL metadc_param8(HDC hdc, short func, short param1, short param2, short param3, short param4, short param5, short param6, short param7, short param8)
Definition: metadc.c:180

◆ metadc_create_brush()

static INT16 metadc_create_brush ( struct metadc metadc,
HBRUSH  brush 
)
static

Definition at line 532 of file metadc.c.

533 {
534  DWORD size;
535  METARECORD *mr;
536  LOGBRUSH logbrush;
537  BOOL r;
538 
539  if (!GetObjectA( brush, sizeof(logbrush), &logbrush )) return -1;
540 
541  switch (logbrush.lbStyle)
542  {
543  case BS_SOLID:
544  case BS_NULL:
545  case BS_HATCHED:
546  {
547  LOGBRUSH16 lb16;
548 
549  lb16.lbStyle = logbrush.lbStyle;
550  lb16.lbColor = logbrush.lbColor;
551  lb16.lbHatch = logbrush.lbHatch;
552  size = sizeof(METARECORD) + sizeof(LOGBRUSH16) - sizeof(WORD);
553  mr = HeapAlloc( GetProcessHeap(), 0, size );
554  mr->rdSize = size / sizeof(WORD);
556  memcpy( mr->rdParm, &lb16, sizeof(LOGBRUSH16) );
557  break;
558  }
559  case BS_PATTERN:
560  case BS_DIBPATTERN:
561  {
562  unsigned char buffer[FIELD_OFFSET(BITMAPINFO, bmiColors)
563  + 256*RTL_FIELD_SIZE(BITMAPINFO, bmiColors)];
564  BITMAPINFO *dst_info, *src_info = (BITMAPINFO *)buffer;
565  DWORD info_size;
566  UINT usage;
567 
568  if (!get_brush_bitmap_info( brush, src_info, NULL, &usage )) goto done;
569 
570  info_size = get_dib_info_size( src_info, usage );
571  size = FIELD_OFFSET( METARECORD, rdParm[2] ) +
572  info_size + src_info->bmiHeader.biSizeImage;
573 
574  if (!(mr = HeapAlloc( GetProcessHeap(), 0, size ))) goto done;
576  mr->rdSize = size / sizeof(WORD);
577  mr->rdParm[0] = logbrush.lbStyle;
578  mr->rdParm[1] = usage;
579  dst_info = (BITMAPINFO *)(mr->rdParm + 2);
580  get_brush_bitmap_info( brush, dst_info, (char *)dst_info + info_size, NULL );
581  if (dst_info->bmiHeader.biClrUsed == 1 << dst_info->bmiHeader.biBitCount)
582  dst_info->bmiHeader.biClrUsed = 0;
583  break;
584  }
585 
586  default:
587  FIXME( "Unknown brush style %x\n", logbrush.lbStyle );
588  return 0;
589  }
590 
591  r = metadc_write_record( metadc, mr, mr->rdSize * sizeof(WORD) );
592  HeapFree(GetProcessHeap(), 0, mr);
593  if (!r) return -1;
594 done:
595  return metadc_add_handle( metadc, brush );
596 }
int WINAPI GetObjectA(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
INT16 lbHatch
Definition: wingdi16.h:34
#define RTL_FIELD_SIZE(type, field)
Definition: kdb_expr.c:84
#define BS_DIBPATTERN
Definition: wingdi.h:1092
#define META_CREATEBRUSHINDIRECT
Definition: wingdi.h:277
HBRUSH brush
Definition: metadc.c:53
UINT16 lbStyle
Definition: wingdi16.h:32
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1476
UINT lbStyle
Definition: wingdi.h:1747
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
ULONG_PTR lbHatch
Definition: wingdi.h:1749
WORD rdFunction
Definition: wingdi.h:2346
GLuint buffer
Definition: glext.h:5915
struct tagMETARECORD METARECORD
DWORD rdSize
Definition: wingdi.h:2345
#define BS_NULL
Definition: wingdi.h:1087
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FIXME(fmt,...)
Definition: debug.h:111
#define META_DIBCREATEPATTERNBRUSH
Definition: wingdi.h:269
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
COLORREF lbColor
Definition: wingdi.h:1748
unsigned short WORD
Definition: ntddk_ex.h:93
static UINT metadc_add_handle(struct metadc *metadc, HGDIOBJ obj)
Definition: metadc.c:497
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD biSizeImage
Definition: amvideo.idl:36
BOOL get_brush_bitmap_info(HBRUSH handle, BITMAPINFO *info, void *bits, UINT *usage) DECLSPEC_HIDDEN
Definition: metadc.c:45
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
WORD rdParm[1]
Definition: wingdi.h:2347
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define BS_PATTERN
Definition: wingdi.h:1090
static int get_dib_info_size(const BITMAPINFO *info, UINT coloruse)
Definition: gdi_private.h:212
COLORREF lbColor
Definition: wingdi16.h:33
#define BS_HATCHED
Definition: wingdi.h:1089
#define BS_SOLID
Definition: wingdi.h:1086
static BOOL metadc_write_record(struct metadc *metadc, METARECORD *mr, unsigned int rlen)
Definition: metadc.c:67
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by METADC_FillRgn(), METADC_FrameRgn(), and METADC_SelectBrush().

◆ metadc_create_font()

static UINT16 metadc_create_font ( struct metadc metadc,
HFONT  font,
LOGFONTW logfont 
)
static

Definition at line 1068 of file metadc.c.

1069 {
1070  unsigned char buffer[FIELD_OFFSET(METARECORD, rdParm) + sizeof(LOGFONT16)];
1071  METARECORD *mr = (METARECORD *)&buffer;
1072  LOGFONT16 *font16;
1073  INT written;
1074 
1075  mr->rdSize = sizeof(buffer) / sizeof(WORD);
1076  mr->rdFunction = META_CREATEFONTINDIRECT;
1077  font16 = (LOGFONT16 *)&mr->rdParm;
1078 
1079  font16->lfHeight = logfont->lfHeight;
1080  font16->lfWidth = logfont->lfWidth;
1081  font16->lfEscapement = logfont->lfEscapement;
1082  font16->lfOrientation = logfont->lfOrientation;
1083  font16->lfWeight = logfont->lfWeight;
1084  font16->lfItalic = logfont->lfItalic;
1085  font16->lfUnderline = logfont->lfUnderline;
1086  font16->lfStrikeOut = logfont->lfStrikeOut;
1087  font16->lfCharSet = logfont->lfCharSet;
1088  font16->lfOutPrecision = logfont->lfOutPrecision;
1089  font16->lfClipPrecision = logfont->lfClipPrecision;
1090  font16->lfQuality = logfont->lfQuality;
1091  font16->lfPitchAndFamily = logfont->lfPitchAndFamily;
1092  written = WideCharToMultiByte( CP_ACP, 0, logfont->lfFaceName, -1, font16->lfFaceName,
1093  LF_FACESIZE - 1, NULL, NULL );
1094  /* Zero pad the facename buffer, so that we don't write uninitialized data to disk */
1095  memset( font16->lfFaceName + written, 0, LF_FACESIZE - written );
1096 
1097  if (!metadc_write_record( metadc, mr, mr->rdSize * 2 ))
1098  return 0;
1099  return metadc_add_handle( metadc, font );
1100 }
INT16 lfEscapement
Definition: sysparams.c:499
#define LF_FACESIZE
Definition: dimm.idl:39
BYTE lfPitchAndFamily
Definition: dimm.idl:71
BYTE lfUnderline
Definition: sysparams.c:503
#define WideCharToMultiByte
Definition: compat.h:111
Definition: mk_font.cpp:20
#define CP_ACP
Definition: compat.h:109
LONG lfHeight
Definition: dimm.idl:59
BYTE lfCharSet
Definition: dimm.idl:67
BYTE lfClipPrecision
Definition: dimm.idl:69
GLuint buffer
Definition: glext.h:5915
LONG lfEscapement
Definition: dimm.idl:61
BYTE lfOutPrecision
Definition: sysparams.c:506
CHAR lfFaceName[LF_FACESIZE]
Definition: sysparams.c:510
int32_t INT
Definition: typedefs.h:58
INT16 lfWidth
Definition: sysparams.c:498
LONG lfOrientation
Definition: dimm.idl:62
LONG lfWidth
Definition: dimm.idl:60
BYTE lfStrikeOut
Definition: sysparams.c:504
BYTE lfOutPrecision
Definition: dimm.idl:68
BYTE lfClipPrecision
Definition: sysparams.c:507
INT16 lfWeight
Definition: sysparams.c:501
unsigned short WORD
Definition: ntddk_ex.h:93
static UINT metadc_add_handle(struct metadc *metadc, HGDIOBJ obj)
Definition: metadc.c:497
BYTE lfQuality
Definition: sysparams.c:508
BYTE lfQuality
Definition: dimm.idl:70
Definition: metadc.c:45
INT16 lfOrientation
Definition: sysparams.c:500
BYTE lfStrikeOut
Definition: dimm.idl:66
#define META_CREATEFONTINDIRECT
Definition: wingdi.h:276
BYTE lfPitchAndFamily
Definition: sysparams.c:509
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
BYTE lfItalic
Definition: dimm.idl:64
#define NULL
Definition: types.h:112
BYTE lfItalic
Definition: sysparams.c:502
INT16 lfHeight
Definition: sysparams.c:497
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
LONG lfWeight
Definition: dimm.idl:63
BYTE lfCharSet
Definition: sysparams.c:505
static BOOL metadc_write_record(struct metadc *metadc, METARECORD *mr, unsigned int rlen)
Definition: metadc.c:67
BYTE lfUnderline
Definition: dimm.idl:65
#define memset(x, y, z)
Definition: compat.h:39

Referenced by METADC_SelectFont().

◆ metadc_create_palette()

static BOOL metadc_create_palette ( struct metadc metadc,
HPALETTE  palette,
LOGPALETTE log_palette,
int  sizeofPalette 
)
static

Definition at line 1189 of file metadc.c.

1191 {
1192  int index;
1193  BOOL ret;
1194  METARECORD *mr;
1195 
1196  mr = HeapAlloc( GetProcessHeap(), 0, sizeof(METARECORD) + sizeofPalette - sizeof(WORD) );
1197  if (!mr) return FALSE;
1198  mr->rdSize = (sizeof(METARECORD) + sizeofPalette - sizeof(WORD)) / sizeof(WORD);
1200  memcpy(&(mr->rdParm), log_palette, sizeofPalette);
1201  if (!metadc_write_record( metadc, mr, mr->rdSize * sizeof(WORD) ))
1202  {
1203  HeapFree(GetProcessHeap(), 0, mr);
1204  return FALSE;
1205  }
1206 
1207  mr->rdSize = sizeof(METARECORD) / sizeof(WORD);
1209 
1210  if ((index = metadc_add_handle( metadc, palette )) == -1) ret = FALSE;
1211  else
1212  {
1213  mr->rdParm[0] = index;
1214  ret = metadc_write_record( metadc, mr, mr->rdSize * sizeof(WORD) );
1215  }
1216  HeapFree( GetProcessHeap(), 0, mr );
1217  return ret;
1218 }
WORD rdFunction
Definition: wingdi.h:2346
struct tagMETARECORD METARECORD
DWORD rdSize
Definition: wingdi.h:2345
#define META_CREATEPALETTE
Definition: wingdi.h:273
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint index
Definition: glext.h:6031
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define META_SELECTPALETTE
Definition: wingdi.h:261
unsigned short WORD
Definition: ntddk_ex.h:93
static UINT metadc_add_handle(struct metadc *metadc, HGDIOBJ obj)
Definition: metadc.c:497
int ret
#define index(s, c)
Definition: various.h:29
Definition: metadc.c:45
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
WORD rdParm[1]
Definition: wingdi.h:2347
static HPALETTE palette
Definition: clipboard.c:1345
static BOOL metadc_write_record(struct metadc *metadc, METARECORD *mr, unsigned int rlen)
Definition: metadc.c:67
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by METADC_SelectPalette().

◆ metadc_create_pen()

static UINT16 metadc_create_pen ( struct metadc metadc,
HPEN  pen,
LOGPEN16 logpen 
)
static

Definition at line 1125 of file metadc.c.

1126 {
1127  unsigned char buffer[FIELD_OFFSET(METARECORD, rdParm)
1128  + (sizeof(*logpen) / sizeof(WORD)) * RTL_FIELD_SIZE(METARECORD, rdParm)];
1129  METARECORD *mr = (METARECORD *)&buffer;
1130 
1131  mr->rdSize = sizeof(buffer) / sizeof(WORD);
1133  memcpy( mr->rdParm, logpen, sizeof(*logpen) );
1134  if (!metadc_write_record( metadc, mr, mr->rdSize * sizeof(WORD) )) return 0;
1135  return metadc_add_handle( metadc, pen );
1136 }
#define RTL_FIELD_SIZE(type, field)
Definition: kdb_expr.c:84
WORD rdFunction
Definition: wingdi.h:2346
GLuint buffer
Definition: glext.h:5915
DWORD rdSize
Definition: wingdi.h:2345
HPEN pen
Definition: metadc.c:52
unsigned short WORD
Definition: ntddk_ex.h:93
static UINT metadc_add_handle(struct metadc *metadc, HGDIOBJ obj)
Definition: metadc.c:497
Definition: metadc.c:45
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
WORD rdParm[1]
Definition: wingdi.h:2347
#define META_CREATEPENINDIRECT
Definition: wingdi.h:275
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
static BOOL metadc_write_record(struct metadc *metadc, METARECORD *mr, unsigned int rlen)
Definition: metadc.c:67

Referenced by METADC_SelectPen().

◆ metadc_create_region()

static INT16 metadc_create_region ( struct metadc metadc,
HRGN  hrgn 
)
static

Definition at line 598 of file metadc.c.

599 {
600  DWORD len;
601  METARECORD *mr;
602  RGNDATA *rgndata;
603  RECT *cur_rect, *end_rect;
604  WORD bands = 0, max_bounds = 0;
605  WORD *param, *start_band;
606  BOOL ret;
607 
608  if (!(len = GetRegionData( hrgn, 0, NULL ))) return -1;
609  if (!(rgndata = HeapAlloc( GetProcessHeap(), 0, len )))
610  {
611  WARN( "Can't alloc rgndata buffer\n" );
612  return -1;
613  }
614  GetRegionData( hrgn, len, rgndata );
615 
616  /* Overestimate of length:
617  * Assume every rect is a separate band -> 6 WORDs per rect,
618  * see MF_Play_MetaCreateRegion for format details.
619  */
620  len = sizeof(METARECORD) + 20 + rgndata->rdh.nCount * 12;
622  {
623  WARN( "Can't alloc METARECORD buffer\n" );
624  HeapFree( GetProcessHeap(), 0, rgndata );
625  return -1;
626  }
627 
628  param = mr->rdParm + 11;
629  start_band = NULL;
630 
631  end_rect = (RECT *)rgndata->Buffer + rgndata->rdh.nCount;
632  for (cur_rect = (RECT *)rgndata->Buffer; cur_rect < end_rect; cur_rect++)
633  {
634  if (start_band && cur_rect->top == start_band[1])
635  {
636  *param++ = cur_rect->left;
637  *param++ = cur_rect->right;
638  }
639  else
640  {
641  if (start_band)
642  {
643  *start_band = param - start_band - 3;
644  *param++ = *start_band;
645  if (*start_band > max_bounds)
646  max_bounds = *start_band;
647  bands++;
648  }
649  start_band = param++;
650  *param++ = cur_rect->top;
651  *param++ = cur_rect->bottom;
652  *param++ = cur_rect->left;
653  *param++ = cur_rect->right;
654  }
655  }
656 
657  if (start_band)
658  {
659  *start_band = param - start_band - 3;
660  *param++ = *start_band;
661  if (*start_band > max_bounds)
662  max_bounds = *start_band;
663  bands++;
664  }
665 
666  mr->rdParm[0] = 0;
667  mr->rdParm[1] = 6;
668  mr->rdParm[2] = 0x2f6;
669  mr->rdParm[3] = 0;
670  mr->rdParm[4] = (WORD)((param - &mr->rdFunction) * sizeof(WORD));
671  mr->rdParm[5] = bands;
672  mr->rdParm[6] = max_bounds;
673  mr->rdParm[7] = rgndata->rdh.rcBound.left;
674  mr->rdParm[8] = rgndata->rdh.rcBound.top;
675  mr->rdParm[9] = rgndata->rdh.rcBound.right;
676  mr->rdParm[10] = rgndata->rdh.rcBound.bottom;
678  mr->rdSize = param - (WORD *)mr;
679  ret = metadc_write_record( metadc, mr, mr->rdSize * 2 );
680  HeapFree( GetProcessHeap(), 0, mr );
681  HeapFree( GetProcessHeap(), 0, rgndata );
682  if (!ret)
683  {
684  WARN("MFDRV_WriteRecord failed\n");
685  return -1;
686  }
687  return metadc_add_handle( metadc, hrgn );
688 }
#define WARN(fmt,...)
Definition: debug.h:112
LONG top
Definition: windef.h:307
char Buffer[1]
Definition: axextend.idl:400
WORD rdFunction
Definition: wingdi.h:2346
LONG left
Definition: windef.h:306
if(dx==0 &&dy==0)
Definition: linetemp.h:174
struct tagMETARECORD METARECORD
LONG right
Definition: windef.h:308
DWORD rdSize
Definition: wingdi.h:2345
#define META_CREATEREGION
Definition: wingdi.h:278
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
GLfloat param
Definition: glext.h:5796
unsigned short WORD
Definition: ntddk_ex.h:93
static UINT metadc_add_handle(struct metadc *metadc, HGDIOBJ obj)
Definition: metadc.c:497
#define for
Definition: utility.h:88
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
Definition: metadc.c:45
static HRGN hrgn
Definition: win.c:55
GLenum GLsizei len
Definition: glext.h:6722
WORD rdParm[1]
Definition: wingdi.h:2347
#define NULL
Definition: types.h:112
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
RGNDATAHEADER rdh
Definition: axextend.idl:399
LONG bottom
Definition: windef.h:309
static BOOL metadc_write_record(struct metadc *metadc, METARECORD *mr, unsigned int rlen)
Definition: metadc.c:67
DWORD WINAPI GetRegionData(_In_ HRGN hrgn, _In_ DWORD nCount, _Out_writes_bytes_to_opt_(nCount, return) LPRGNDATA lpRgnData)
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by METADC_ExtSelectClipRgn(), METADC_FillRgn(), METADC_FrameRgn(), METADC_InvertRgn(), and METADC_PaintRgn().

◆ METADC_DeleteDC()

BOOL METADC_DeleteDC ( HDC  hdc)

Definition at line 1318 of file metadc.c.

1319 {
1320  struct metadc *metadc;
1321 
1322  if (!(metadc = get_metadc_ptr( hdc ))) return FALSE;
1323  if (!GdiDeleteClientObj( hdc )) return FALSE;
1324  metadc_free( metadc );
1325  return TRUE;
1326 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static void metadc_free(struct metadc *metadc)
Definition: metadc.c:1305
PVOID WINAPI GdiDeleteClientObj(_In_ HGDIOBJ hobj)
Definition: clientobj.c:173
Definition: metadc.c:45
HDC hdc
Definition: main.c:9
struct metadc * get_metadc_ptr(HDC hdc)
Definition: metadc.c:60

Referenced by METADC_RosGlueDeleteDC().

◆ METADC_DeleteObject()

void METADC_DeleteObject ( HDC  hdc,
HGDIOBJ  obj 
)

Definition at line 1015 of file metadc.c.

1016 {
1017  struct metadc *metadc = get_metadc_ptr( hdc );
1018  METARECORD mr;
1019  INT16 index;
1020 
1021  if ((index = metadc_find_object( metadc, obj )) < 0) return;
1022  if (obj == metadc->pen || obj == metadc->brush || obj == metadc->font)
1023  {
1024  WARN( "deleting selected object %p\n", obj );
1025  return;
1026  }
1027 
1028  mr.rdSize = sizeof(mr) / sizeof(WORD);
1030  mr.rdParm[0] = index;
1031 
1032  metadc_write_record( metadc, &mr, mr.rdSize * sizeof(WORD) );
1033 
1034  metadc->handles[index] = 0;
1035  metadc->cur_handles--;
1036 }
HBRUSH brush
Definition: metadc.c:53
HGDIOBJ * handles
Definition: metadc.c:50
#define WARN(fmt,...)
Definition: debug.h:112
static INT16 metadc_find_object(struct metadc *metadc, HGDIOBJ obj)
Definition: metadc.c:1005
WORD rdFunction
Definition: wingdi.h:2346
DWORD rdSize
Definition: wingdi.h:2345
HPEN pen
Definition: metadc.c:52
GLuint index
Definition: glext.h:6031
UINT cur_handles
Definition: metadc.c:49
unsigned short WORD
Definition: ntddk_ex.h:93
#define index(s, c)
Definition: various.h:29
Definition: metadc.c:45
HDC hdc
Definition: main.c:9
WORD rdParm[1]
Definition: wingdi.h:2347
HFONT font
Definition: metadc.c:54
#define META_DELETEOBJECT
Definition: wingdi.h:272
struct metadc * get_metadc_ptr(HDC hdc)
Definition: metadc.c:60
static BOOL metadc_write_record(struct metadc *metadc, METARECORD *mr, unsigned int rlen)
Definition: metadc.c:67
signed short INT16

Referenced by METADC_RosGlueDeleteObject().

◆ METADC_Ellipse()

BOOL METADC_Ellipse ( HDC  hdc,
INT  left,
INT  top,
INT  right,
INT  bottom 
)

Definition at line 362 of file metadc.c.

363 {
365 }
static BOOL metadc_param4(HDC hdc, short func, short param1, short param2, short param3, short param4)
Definition: metadc.c:128
GLint GLint bottom
Definition: glext.h:7726
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
HDC hdc
Definition: main.c:9
#define META_ELLIPSE
Definition: wingdi.h:234
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ METADC_ExcludeClipRect()

BOOL METADC_ExcludeClipRect ( HDC  hdc,
INT  left,
INT  top,
INT  right,
INT  bottom 
)

Definition at line 256 of file metadc.c.

257 {
259 }
static BOOL metadc_param4(HDC hdc, short func, short param1, short param2, short param3, short param4)
Definition: metadc.c:128
GLint GLint bottom
Definition: glext.h:7726
#define META_EXCLUDECLIPRECT
Definition: wingdi.h:231
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
HDC hdc
Definition: main.c:9
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ METADC_ExtEscape()

BOOL METADC_ExtEscape ( HDC  hdc,
INT  escape,
INT  input_size,
LPCSTR  input,
INT  output_size,
LPVOID  output 
)

Definition at line 1269 of file metadc.c.

1270 {
1271  METARECORD *mr;
1272  DWORD len;
1273  BOOL ret;
1274 
1275  if (output_size) return FALSE; /* escapes that require output cannot work in metafiles */
1276 
1277  len = sizeof(*mr) + sizeof(WORD) + ((input_size + 1) & ~1);
1278  if (!(mr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, len ))) return FALSE;
1279  mr->rdSize = len / sizeof(WORD);
1280  mr->rdFunction = META_ESCAPE;
1281  mr->rdParm[0] = escape;
1282  mr->rdParm[1] = input_size;
1283  memcpy( &mr->rdParm[2], input, input_size );
1284  ret = metadc_record( hdc, mr, len );
1285  HeapFree(GetProcessHeap(), 0, mr);
1286  return ret;
1287 }
WORD rdFunction
Definition: wingdi.h:2346
DWORD rdSize
Definition: wingdi.h:2345
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static BOOL metadc_record(HDC hdc, METARECORD *mr, DWORD rlen)
Definition: metadc.c:88
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define META_ESCAPE
Definition: wingdi.h:248
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
HDC hdc
Definition: main.c:9
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
WORD rdParm[1]
Definition: wingdi.h:2347
GLenum GLenum GLenum input
Definition: glext.h:9031
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
static WCHAR escape[]
Definition: url.c:36
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by Escape().

◆ METADC_ExtFloodFill()

BOOL METADC_ExtFloodFill ( HDC  hdc,
INT  x,
INT  y,
COLORREF  color,
UINT  fill_type 
)

Definition at line 492 of file metadc.c.

493 {
494  return metadc_param5( hdc, META_EXTFLOODFILL, x, y, HIWORD(color), LOWORD(color), fill_type );
495 }
static BOOL metadc_param5(HDC hdc, short func, short param1, short param2, short param3, short param4, short param5)
Definition: metadc.c:144
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint color
Definition: glext.h:6243
HDC hdc
Definition: main.c:9
#define META_EXTFLOODFILL
Definition: wingdi.h:271
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define HIWORD(l)
Definition: typedefs.h:247
#define LOWORD(l)
Definition: pedump.c:82

◆ METADC_ExtSelectClipRgn()

BOOL METADC_ExtSelectClipRgn ( HDC  hdc,
HRGN  hrgn,
INT  mode 
)

Definition at line 988 of file metadc.c.

989 {
990  struct metadc *metadc;
991  INT16 rgn;
992  INT ret;
993 
994  if (!(metadc = get_metadc_ptr( hdc ))) return FALSE;
995  if (mode != RGN_COPY) return ERROR;
996  if (!hrgn) return NULLREGION;
997  rgn = metadc_create_region( metadc, hrgn );
998  if(rgn == -1) return ERROR;
1001  metadc_remove_handle( metadc, rgn );
1002  return ret;
1003 }
static BOOL metadc_param1(HDC hdc, short func, short param)
Definition: metadc.c:105
#define ERROR(name)
Definition: error_private.h:53
#define NULLREGION
Definition: wingdi.h:361
int32_t INT
Definition: typedefs.h:58
#define FALSE
Definition: types.h:117
static BOOL metadc_remove_handle(struct metadc *metadc, UINT index)
Definition: metadc.c:519
static INT16 metadc_create_region(struct metadc *metadc, HRGN hrgn)
Definition: metadc.c:598
int ret
Definition: metadc.c:45
HDC hdc
Definition: main.c:9
static HRGN hrgn
Definition: win.c:55
GLenum mode
Definition: glext.h:6217
#define RGN_COPY
Definition: wingdi.h:357
#define META_DELETEOBJECT
Definition: wingdi.h:272
#define META_SELECTOBJECT
Definition: wingdi.h:255
struct metadc * get_metadc_ptr(HDC hdc)
Definition: metadc.c:60
signed short INT16

◆ METADC_ExtTextOut()

BOOL METADC_ExtTextOut ( HDC  hdc,
INT  x,
INT  y,
UINT  flags,
const RECT lprect,
const WCHAR str,
UINT  count,
const INT dx 
)

Definition at line 904 of file metadc.c.

906 {
907  RECT16 rect16;
908  LPINT16 lpdx16 = NULL;
909  BOOL ret;
910  unsigned int i, j;
911  char *ascii;
912  DWORD len;
913  CHARSETINFO csi;
914  int charset = GetTextCharset( hdc );
915  UINT cp = CP_ACP;
916 
918  cp = csi.ciACP;
919  else
920  {
921  switch(charset)
922  {
923  case OEM_CHARSET:
924  cp = GetOEMCP();
925  break;
926  case DEFAULT_CHARSET:
927  cp = GetACP();
928  break;
929 
930  case VISCII_CHARSET:
931  case TCVN_CHARSET:
932  case KOI8_CHARSET:
933  case ISO3_CHARSET:
934  case ISO4_CHARSET:
935  case ISO10_CHARSET:
936  case CELTIC_CHARSET:
937  /* FIXME: These have no place here, but because x11drv
938  enumerates fonts with these (made up) charsets some apps
939  might use them and then the FIXME below would become
940  annoying. Now we could pick the intended codepage for
941  each of these, but since it's broken anyway we'll just
942  use CP_ACP and hope it'll go away...
943  */
944  cp = CP_ACP;
945  break;
946 
947  default:
948  FIXME("Can't find codepage for charset %d\n", charset);
949  break;
950  }
951  }
952 
953 
954  TRACE( "cp = %d\n", cp );
955  len = WideCharToMultiByte( cp, 0, str, count, NULL, 0, NULL, NULL );
956  ascii = HeapAlloc( GetProcessHeap(), 0, len );
957  WideCharToMultiByte( cp, 0, str, count, ascii, len, NULL, NULL );
958  TRACE( "mapped %s -> %s\n", debugstr_wn(str, count), debugstr_an(ascii, len) );
959 
960 
961  if (lprect)
962  {
963  rect16.left = lprect->left;
964  rect16.top = lprect->top;
965  rect16.right = lprect->right;
966  rect16.bottom = lprect->bottom;
967  }
968 
969  if (dx)
970  {
971  lpdx16 = HeapAlloc( GetProcessHeap(), 0, sizeof(INT16) * len );
972  for (i = j = 0; i < len; )
973  if (IsDBCSLeadByteEx( cp, ascii[i] ))
974  {
975  lpdx16[i++] = dx[j++];
976  lpdx16[i++] = 0;
977  }
978  else
979  lpdx16[i++] = dx[j++];
980  }
981 
982  ret = metadc_text( hdc, x, y, flags, lprect ? &rect16 : NULL, ascii, len, lpdx16 );
983  HeapFree( GetProcessHeap(), 0, ascii );
984  HeapFree( GetProcessHeap(), 0, lpdx16 );
985  return ret;
986 }
#define ISO10_CHARSET
Definition: wingdi.h:412
#define ULongToPtr(ul)
Definition: basetsd.h:92
CFF_Charset charset
Definition: cffcmap.c:138
#define WideCharToMultiByte
Definition: compat.h:111
#define CP_ACP
Definition: compat.h:109
GLuint GLuint GLsizei count
Definition: gl.h:1545
INT16 * LPINT16
Definition: windef16.h:43
LONG top
Definition: windef.h:307
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
INT16 left
Definition: windef16.h:143
LONG left
Definition: windef.h:306
#define DEFAULT_CHARSET
Definition: wingdi.h:384
LONG right
Definition: windef.h:308
#define ISO4_CHARSET
Definition: wingdi.h:411
INT16 right
Definition: windef16.h:145
BOOL WINAPI IsDBCSLeadByteEx(UINT CodePage, BYTE TestByte)
Definition: nls.c:2248
INT16 bottom
Definition: windef16.h:146
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FIXME(fmt,...)
Definition: debug.h:111
const WCHAR * str
UINT WINAPI GetACP(VOID)
Definition: nls.c:2218
static BOOL metadc_text(HDC hdc, short x, short y, UINT16 flags, const RECT16 *rect, const char *str, short count, const INT16 *dx)
Definition: metadc.c:875
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
BOOL WINAPI TranslateCharsetInfo(_Inout_ PDWORD, _Out_ LPCHARSETINFO, _In_ DWORD)
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define VISCII_CHARSET
Definition: wingdi.h:407
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
#define ISO3_CHARSET
Definition: wingdi.h:410
int ret
#define OEM_CHARSET
Definition: wingdi.h:400
HDC hdc
Definition: main.c:9
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:55
GLenum GLsizei len
Definition: glext.h:6722
#define CELTIC_CHARSET
Definition: wingdi.h:413
#define debugstr_wn
Definition: kernel32.h:33
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
INT16 top
Definition: windef16.h:144
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint dx
Definition: linetemp.h:97
POINT cp
Definition: magnifier.c:59
int WINAPI GetTextCharset(_In_ HDC)
Definition: text.c:187
#define KOI8_CHARSET
Definition: wingdi.h:409
LONG bottom
Definition: windef.h:309
#define HeapFree(x, y, z)
Definition: compat.h:594
#define TCI_SRCCHARSET
Definition: wingdi.h:961
#define TCVN_CHARSET
Definition: wingdi.h:408
UINT WINAPI GetOEMCP(VOID)
Definition: nls.c:2233
signed short INT16

◆ METADC_FillRgn()

BOOL METADC_FillRgn ( HDC  hdc,
HRGN  hrgn,
HBRUSH  hbrush 
)

Definition at line 710 of file metadc.c.

711 {
712  struct metadc *metadc;
713  INT16 rgn, brush;
714 
715  if (!(metadc = get_metadc_ptr( hdc ))) return FALSE;
716 
717  rgn = metadc_create_region( metadc, hrgn );
718  if (rgn == -1) return FALSE;
720  if (!brush) return FALSE;
721  return metadc_param2( hdc, META_FILLREGION, rgn, brush );
722 }
HBRUSH brush
Definition: metadc.c:53
static HBRUSH hbrush
#define FALSE
Definition: types.h:117
static INT16 metadc_create_brush(struct metadc *metadc, HBRUSH brush)
Definition: metadc.c:532
static INT16 metadc_create_region(struct metadc *metadc, HRGN hrgn)
Definition: metadc.c:598
#define META_FILLREGION
Definition: wingdi.h:250
Definition: metadc.c:45
HDC hdc
Definition: main.c:9
static HRGN hrgn
Definition: win.c:55
static BOOL metadc_param2(HDC hdc, short func, short param1, short param2)
Definition: metadc.c:115
struct metadc * get_metadc_ptr(HDC hdc)
Definition: metadc.c:60
signed short INT16

◆ metadc_find_object()

static INT16 metadc_find_object ( struct metadc metadc,
HGDIOBJ  obj 
)
static

Definition at line 1005 of file metadc.c.

1006 {
1007  INT16 index;
1008 
1009  for (index = 0; index < metadc->handles_size; index++)
1010  if (metadc->handles[index] == obj) return index;
1011 
1012  return -1;
1013 }
UINT handles_size
Definition: metadc.c:49
HGDIOBJ * handles
Definition: metadc.c:50
GLuint index
Definition: glext.h:6031
#define index(s, c)
Definition: various.h:29
Definition: metadc.c:45
signed short INT16

Referenced by METADC_DeleteObject(), METADC_SelectBrush(), METADC_SelectFont(), and METADC_SelectPen().

◆ METADC_FrameRgn()

BOOL METADC_FrameRgn ( HDC  hdc,
HRGN  hrgn,
HBRUSH  hbrush,
INT  x,
INT  y 
)

Definition at line 724 of file metadc.c.

725 {
726  struct metadc *metadc;
727  INT16 rgn, brush;
728 
729  if (!(metadc = get_metadc_ptr( hdc ))) return FALSE;
730  rgn = metadc_create_region( metadc, hrgn );
731  if (rgn == -1) return FALSE;
733  if (!brush) return FALSE;
734  return metadc_param4( hdc, META_FRAMEREGION, rgn, brush, x, y );
735 }
HBRUSH brush
Definition: metadc.c:53
static HBRUSH hbrush
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static BOOL metadc_param4(HDC hdc, short func, short param1, short param2, short param3, short param4)
Definition: metadc.c:128
#define FALSE
Definition: types.h:117
#define META_FRAMEREGION
Definition: wingdi.h:251
static INT16 metadc_create_brush(struct metadc *metadc, HBRUSH brush)
Definition: metadc.c:532
static INT16 metadc_create_region(struct metadc *metadc, HRGN hrgn)
Definition: metadc.c:598
Definition: metadc.c:45
HDC hdc
Definition: main.c:9
static HRGN hrgn
Definition: win.c:55
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
struct metadc * get_metadc_ptr(HDC hdc)
Definition: metadc.c:60
signed short INT16

◆ metadc_free()

static void metadc_free ( struct metadc metadc)
static

Definition at line 1305 of file metadc.c.

1306 {
1307  DWORD index;
1308 
1309  CloseHandle( metadc->hFile );
1310  HeapFree( GetProcessHeap(), 0, metadc->mh );
1311  for(index = 0; index < metadc->handles_size; index++)
1312  if(metadc->handles[index])
1315  HeapFree( GetProcessHeap(), 0, metadc );
1316 }
METAHEADER * mh
Definition: metadc.c:48
#define CloseHandle
Definition: compat.h:598
UINT handles_size
Definition: metadc.c:49
HGDIOBJ * handles
Definition: metadc.c:50
HANDLE hFile
Definition: metadc.c:51
GLuint index
Definition: glext.h:6031
#define GetProcessHeap()
Definition: compat.h:595
HDC hdc
Definition: metadc.c:47
unsigned long DWORD
Definition: ntddk_ex.h:95
#define index(s, c)
Definition: various.h:29
Definition: metadc.c:45
void GDI_hdc_not_using_object(HGDIOBJ obj, HDC hdc) DECLSPEC_HIDDEN
Definition: rosglue.c:182
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by CloseMetaFile(), and METADC_DeleteDC().

◆ METADC_GetDeviceCaps()

INT METADC_GetDeviceCaps ( HDC  hdc,
INT  cap 
)

Definition at line 1289 of file metadc.c.

1290 {
1291  if (!get_metadc_ptr( hdc )) return 0;
1292 
1293  switch(cap)
1294  {
1295  case TECHNOLOGY:
1296  return DT_METAFILE;
1297  case TEXTCAPS:
1298  return 0;
1299  default:
1300  TRACE(" unsupported capability %d, will return 0\n", cap );
1301  }
1302  return 0;
1303 }
#define TECHNOLOGY
Definition: wingdi.h:706
#define TEXTCAPS
Definition: wingdi.h:806
GLenum cap
Definition: glext.h:9639
#define TRACE(s)
Definition: solgame.cpp:4
HDC hdc
Definition: main.c:9
struct metadc * get_metadc_ptr(HDC hdc)
Definition: metadc.c:60
#define DT_METAFILE
Definition: wingdi.h:712

◆ METADC_IntersectClipRect()

BOOL METADC_IntersectClipRect ( HDC  hdc,
INT  left,
INT  top,
INT  right,
INT  bottom 
)

Definition at line 251 of file metadc.c.

252 {
254 }
static BOOL metadc_param4(HDC hdc, short func, short param1, short param2, short param3, short param4)
Definition: metadc.c:128
GLint GLint bottom
Definition: glext.h:7726
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
HDC hdc
Definition: main.c:9
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
#define META_INTERSECTCLIPRECT
Definition: wingdi.h:232

◆ METADC_InvertRgn()

BOOL METADC_InvertRgn ( HDC  hdc,
HRGN  hrgn 
)

Definition at line 700 of file metadc.c.

701 {
702  struct metadc *metadc;
703  INT16 index;
704  if (!(metadc = get_metadc_ptr( hdc ))) return FALSE;
706  if (index == -1) return FALSE;
708 }
static BOOL metadc_param1(HDC hdc, short func, short param)
Definition: metadc.c:105
#define META_INVERTREGION
Definition: wingdi.h:252
#define FALSE
Definition: types.h:117
GLuint index
Definition: glext.h:6031
static INT16 metadc_create_region(struct metadc *metadc, HRGN hrgn)
Definition: metadc.c:598
#define index(s, c)
Definition: various.h:29
Definition: metadc.c:45
HDC hdc
Definition: main.c:9
static HRGN hrgn
Definition: win.c:55
struct metadc * get_metadc_ptr(HDC hdc)
Definition: metadc.c:60
signed short INT16

◆ METADC_LineTo()

BOOL METADC_LineTo ( HDC  hdc,
INT  x,
INT  y 
)

Definition at line 336 of file metadc.c.

337 {
338  return metadc_param2( hdc, META_LINETO, x, y );
339 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define META_LINETO
Definition: wingdi.h:229
HDC hdc
Definition: main.c:9
static BOOL metadc_param2(HDC hdc, short func, short param1, short param2)
Definition: metadc.c:115
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ METADC_MoveTo()

BOOL METADC_MoveTo ( HDC  hdc,
INT  x,
INT  y 
)

Definition at line 331 of file metadc.c.

332 {
333  return metadc_param2( hdc, META_MOVETO, x, y );
334 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define META_MOVETO
Definition: wingdi.h:230
HDC hdc
Definition: main.c:9
static BOOL metadc_param2(HDC hdc, short func, short param1, short param2)
Definition: metadc.c:115
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ METADC_OffsetClipRgn()

BOOL METADC_OffsetClipRgn ( HDC  hdc,
INT  x,
INT  y 
)

Definition at line 261 of file metadc.c.

262 {
263  return metadc_param2( hdc, META_OFFSETCLIPRGN, x, y );
264 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define META_OFFSETCLIPRGN
Definition: wingdi.h:242
HDC hdc
Definition: main.c:9
static BOOL metadc_param2(HDC hdc, short func, short param1, short param2)
Definition: metadc.c:115
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ METADC_OffsetViewportOrgEx()

BOOL METADC_OffsetViewportOrgEx ( HDC  hdc,
INT  x,
INT  y 
)

Definition at line 296 of file metadc.c.

297 {
299 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define META_OFFSETVIEWPORTORG
Definition: wingdi.h:227
HDC hdc
Definition: main.c:9
static BOOL metadc_param2(HDC hdc, short func, short param1, short param2)
Definition: metadc.c:115
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ METADC_OffsetWindowOrgEx()

BOOL METADC_OffsetWindowOrgEx ( HDC  hdc,
INT  x,
INT  y 
)

Definition at line 301 of file metadc.c.

302 {
304 }
#define META_OFFSETWINDOWORG
Definition: wingdi.h:225
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
HDC hdc
Definition: main.c:9
static BOOL metadc_param2(HDC hdc, short func, short param1, short param2)
Definition: metadc.c:115
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ METADC_PaintRgn()

BOOL METADC_PaintRgn ( HDC  hdc,
HRGN  hrgn 
)

Definition at line 690 of file metadc.c.

691 {
692  struct metadc *metadc;
693  INT16 index;
694  if (!(metadc = get_metadc_ptr( hdc ))) return FALSE;
696  if(index == -1) return FALSE;
698 }
static BOOL metadc_param1(HDC hdc, short func, short param)
Definition: metadc.c:105
#define META_PAINTREGION
Definition: wingdi.h:253
#define FALSE
Definition: types.h:117
GLuint index
Definition: glext.h:6031
static INT16 metadc_create_region(struct metadc *metadc, HRGN hrgn)
Definition: metadc.c:598
#define index(s, c)
Definition: various.h:29
Definition: metadc.c:45
HDC hdc
Definition: main.c:9
static HRGN hrgn
Definition: win.c:55
struct metadc * get_metadc_ptr(HDC hdc)
Definition: metadc.c:60
signed short INT16

◆ metadc_param0()

static BOOL metadc_param0 ( HDC  hdc,
short  func 
)
static

Definition at line 96 of file metadc.c.

97 {
98  METARECORD mr;
99 
100  mr.rdSize = FIELD_OFFSET(METARECORD, rdParm[0]) / sizeof(WORD);
101  mr.rdFunction = func;
102  return metadc_record( hdc, &mr, mr.rdSize * sizeof(WORD) );
103 }
GLenum func
Definition: glext.h:6028
WORD rdFunction
Definition: wingdi.h:2346
DWORD rdSize
Definition: wingdi.h:2345
static BOOL metadc_record(HDC hdc, METARECORD *mr, DWORD rlen)
Definition: metadc.c:88
unsigned short WORD
Definition: ntddk_ex.h:93
HDC hdc
Definition: main.c:9
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by CloseMetaFile(), METADC_RealizePalette(), and METADC_SaveDC().

◆ metadc_param1()

static BOOL metadc_param1 ( HDC  hdc,
short  func,
short  param 
)
static

Definition at line 105 of file metadc.c.

106 {
107  METARECORD mr;
108 
109  mr.rdSize = sizeof(mr) / sizeof(WORD);
110  mr.rdFunction = func;
111  mr.rdParm[0] = param;
112  return metadc_record( hdc, &mr, mr.rdSize * sizeof(WORD) );
113 }
GLenum func
Definition: glext.h:6028
WORD rdFunction
Definition: wingdi.h:2346
DWORD rdSize
Definition: wingdi.h:2345
static BOOL metadc_record(HDC hdc, METARECORD *mr, DWORD rlen)
Definition: metadc.c:88
GLfloat param
Definition: glext.h:5796
unsigned short WORD
Definition: ntddk_ex.h:93
HDC hdc
Definition: main.c:9
WORD rdParm[1]
Definition: wingdi.h:2347

Referenced by METADC_ExtSelectClipRgn(), METADC_InvertRgn(), METADC_PaintRgn(), METADC_RestoreDC(), METADC_SetBkMode(), METADC_SetMapMode(), METADC_SetPolyFillMode(), METADC_SetRelAbs(), METADC_SetROP2(), METADC_SetStretchBltMode(), and METADC_SetTextCharacterExtra().

◆ metadc_param2()

static BOOL metadc_param2 ( HDC  hdc,
short  func,
short  param1,
short  param2 
)
static

Definition at line 115 of file metadc.c.

116 {
117  unsigned char buffer[FIELD_OFFSET(METARECORD, rdParm)
118  + 2*RTL_FIELD_SIZE(METARECORD, rdParm)];
119  METARECORD *mr = (METARECORD *)&buffer;
120 
121  mr->rdSize = sizeof(buffer) / sizeof(WORD);
122  mr->rdFunction = func;
123  mr->rdParm[0] = param2;
124  mr->rdParm[1] = param1;
125  return metadc_record( hdc, mr, sizeof(buffer) );
126 }
GLenum func
Definition: glext.h:6028
#define RTL_FIELD_SIZE(type, field)
Definition: kdb_expr.c:84
WORD rdFunction
Definition: wingdi.h:2346
GLuint buffer
Definition: glext.h:5915
DWORD rdSize
Definition: wingdi.h:2345
static BOOL metadc_record(HDC hdc, METARECORD *mr, DWORD rlen)
Definition: metadc.c:88
unsigned short WORD
Definition: ntddk_ex.h:93
HDC hdc
Definition: main.c:9
WORD rdParm[1]
Definition: wingdi.h:2347
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by METADC_FillRgn(), METADC_LineTo(), METADC_MoveTo(), METADC_OffsetClipRgn(), METADC_OffsetViewportOrgEx(), METADC_OffsetWindowOrgEx(), METADC_SetBkColor(), METADC_SetLayout(), METADC_SetMapperFlags(), METADC_SetTextAlign(), METADC_SetTextColor(), METADC_SetTextJustification(), METADC_SetViewportExtEx(), METADC_SetViewportOrgEx(), METADC_SetWindowExtEx(), and METADC_SetWindowOrgEx().

◆ metadc_param4()

static BOOL metadc_param4 ( HDC  hdc,
short  func,
short  param1,
short  param2,
short  param3,
short  param4 
)
static

Definition at line 128 of file metadc.c.

130 {
131  unsigned char buffer[FIELD_OFFSET(METARECORD, rdParm)
132  + 4*RTL_FIELD_SIZE(METARECORD, rdParm)];
133  METARECORD *mr = (METARECORD *)&buffer;
134 
135  mr->rdSize = sizeof(buffer) / sizeof(WORD);
136  mr->rdFunction = func;
137  mr->rdParm[0] = param4;
138  mr->rdParm[1] = param3;
139  mr->rdParm[2] = param2;
140  mr->rdParm[3] = param1;
141  return metadc_record( hdc, mr, sizeof(buffer) );
142 }
GLenum func
Definition: glext.h:6028
#define RTL_FIELD_SIZE(type, field)
Definition: kdb_expr.c:84
WORD rdFunction
Definition: wingdi.h:2346
GLuint buffer
Definition: glext.h:5915
DWORD rdSize
Definition: wingdi.h:2345
static BOOL metadc_record(HDC hdc, METARECORD *mr, DWORD rlen)
Definition: metadc.c:88
unsigned short WORD
Definition: ntddk_ex.h:93
HDC hdc
Definition: main.c:9
WORD rdParm[1]
Definition: wingdi.h:2347
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by METADC_Ellipse(), METADC_ExcludeClipRect(), METADC_FrameRgn(), METADC_IntersectClipRect(), METADC_Rectangle(), METADC_ScaleViewportExtEx(), METADC_ScaleWindowExtEx(), and METADC_SetPixel().

◆ metadc_param5()

static BOOL metadc_param5 ( HDC  hdc,
short  func,
short  param1,
short  param2,
short  param3,
short  param4,
short  param5 
)
static

Definition at line 144 of file metadc.c.

146 {
147  unsigned char buffer[FIELD_OFFSET(METARECORD, rdParm)
148  + 5*RTL_FIELD_SIZE(METARECORD, rdParm)];
149  METARECORD *mr = (METARECORD *)&buffer;
150 
151  mr->rdSize = sizeof(buffer) / sizeof(WORD);
152  mr->rdFunction = func;
153  mr->rdParm[0] = param5;
154  mr->rdParm[1] = param4;
155  mr->rdParm[2] = param3;
156  mr->rdParm[3] = param2;
157  mr->rdParm[4] = param1;
158  return metadc_record( hdc, mr, sizeof(buffer) );
159 }
GLenum func
Definition: glext.h:6028
#define RTL_FIELD_SIZE(type, field)
Definition: kdb_expr.c:84
WORD rdFunction
Definition: wingdi.h:2346
GLuint buffer
Definition: glext.h:5915
DWORD rdSize
Definition: wingdi.h:2345
static BOOL metadc_record(HDC hdc, METARECORD *mr, DWORD rlen)
Definition: metadc.c:88
unsigned short WORD
Definition: ntddk_ex.h:93
HDC hdc
Definition: main.c:9
WORD rdParm[1]
Definition: wingdi.h:2347
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by METADC_ExtFloodFill().

◆ metadc_param6()

static BOOL metadc_param6 ( HDC  hdc,
short  func,
short  param1,
short  param2,
short  param3,
short  param4,
short  param5,
short  param6 
)
static

Definition at line 161 of file metadc.c.

164 {
165  unsigned char buffer[FIELD_OFFSET(METARECORD, rdParm)
166  + 6*RTL_FIELD_SIZE(METARECORD, rdParm)];
167  METARECORD *mr = (METARECORD *)&buffer;
168 
169  mr->rdSize = sizeof(buffer) / sizeof(WORD);
170  mr->rdFunction = func;
171  mr->rdParm[0] = param6;
172  mr->rdParm[1] = param5;
173  mr->rdParm[2] = param4;
174  mr->rdParm[3] = param3;
175  mr->rdParm[4] = param2;
176  mr->rdParm[5] = param1;
177  return metadc_record( hdc, mr, sizeof(buffer) );
178 }
GLenum func
Definition: glext.h:6028
#define RTL_FIELD_SIZE(type, field)
Definition: kdb_expr.c:84
WORD rdFunction
Definition: wingdi.h:2346
GLuint buffer
Definition: glext.h:5915
DWORD rdSize
Definition: wingdi.h:2345
static BOOL metadc_record(HDC hdc, METARECORD *mr, DWORD rlen)
Definition: metadc.c:88
unsigned short WORD
Definition: ntddk_ex.h:93
HDC hdc
Definition: main.c:9
WORD rdParm[1]
Definition: wingdi.h:2347
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by METADC_PatBlt(), and METADC_RoundRect().

◆ metadc_param8()

static BOOL metadc_param8 ( HDC  hdc,
short  func,
short  param1,
short  param2,
short  param3,
short  param4,
short  param5,
short  param6,
short  param7,
short  param8 
)
static

Definition at line 180 of file metadc.c.

183 {
184  unsigned char buffer[FIELD_OFFSET(METARECORD, rdParm)
185  + 8*RTL_FIELD_SIZE(METARECORD, rdParm)];
186  METARECORD *mr = (METARECORD *)&buffer;
187 
188  mr->rdSize = sizeof(buffer) / sizeof(WORD);
189  mr->rdFunction = func;
190  mr->rdParm[0] = param8;
191  mr->rdParm[1] = param7;
192  mr->rdParm[2] = param6;
193  mr->rdParm[3] = param5;
194  mr->rdParm[4] = param4;
195  mr->rdParm[5] = param3;
196  mr->rdParm[6] = param2;
197  mr->rdParm[7] = param1;
198  return metadc_record( hdc, mr, sizeof(buffer) );
199 }
GLenum func
Definition: glext.h:6028
#define RTL_FIELD_SIZE(type, field)
Definition: kdb_expr.c:84
WORD rdFunction
Definition: wingdi.h:2346
GLuint buffer
Definition: glext.h:5915
DWORD rdSize
Definition: wingdi.h:2345
static BOOL metadc_record(HDC hdc, METARECORD *mr, DWORD rlen)
Definition: metadc.c:88
unsigned short WORD
Definition: ntddk_ex.h:93
HDC hdc
Definition: main.c:9
WORD rdParm[1]
Definition: wingdi.h:2347
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by METADC_Arc(), METADC_Chord(), and METADC_Pie().

◆ METADC_PatBlt()

BOOL METADC_PatBlt ( HDC  hdc,
INT  left,
INT  top,
INT  width,
INT  height,
DWORD  rop 
)

Definition at line 737 of file metadc.c.

738 {
740  HIWORD(rop), LOWORD(rop) );
741 }
GLint GLint GLsizei width
Definition: gl.h:1546
static BOOL metadc_param6(HDC hdc, short func, short param1, short param2, short param3, short param4, short param5, short param6)
Definition: metadc.c:161
#define META_PATBLT
Definition: wingdi.h:239
static int rop(int rop, int src, int dst)
Definition: nanoxwin.c:124
GLint left
Definition: glext.h:7726
HDC hdc
Definition: main.c:9
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define HIWORD(l)
Definition: typedefs.h:247
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
#define LOWORD(l)
Definition: pedump.c:82

◆ METADC_Pie()

BOOL METADC_Pie ( HDC  hdc,
INT  left,
INT  top,
INT  right,
INT  bottom,
INT  xstart,
INT  ystart,
INT  xend,
INT  yend 
)

Definition at line 348 of file metadc.c.

350 {
352  xstart, ystart, xend, yend );
353 }
GLint GLint bottom
Definition: glext.h:7726
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
HDC hdc
Definition: main.c:9
#define META_PIE
Definition: wingdi.h:236
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
static BOOL metadc_param8(HDC hdc, short func, short param1, short param2, short param3, short param4, short param5, short param6, short param7, short param8)
Definition: metadc.c:180

◆ metadc_poly()

static BOOL metadc_poly ( HDC  hdc,
short  func,
POINTS pt,
short  count 
)
static

Definition at line 384 of file metadc.c.

385 {
386  BOOL ret;
387  DWORD len;
388  METARECORD *mr;
389 
390  len = sizeof(METARECORD) + count * 4;
391  if (!(mr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, len )))
392  return FALSE;
393 
394  mr->rdSize = len / 2;
395  mr->rdFunction = func;
396  *(mr->rdParm) = count;
397  memcpy(mr->rdParm + 1, pt, count * 4);
398  ret = metadc_record( hdc, mr, mr->rdSize * 2);
399  HeapFree( GetProcessHeap(), 0, mr);
400  return ret;
401 }
GLenum func
Definition: glext.h:6028
#define pt(x, y)
Definition: drawing.c:79
GLuint GLuint GLsizei count
Definition: gl.h:1545
WORD rdFunction
Definition: wingdi.h:2346
struct tagMETARECORD METARECORD
DWORD rdSize
Definition: wingdi.h:2345
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static BOOL metadc_record(HDC hdc, METARECORD *mr, DWORD rlen)
Definition: metadc.c:88
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
HDC hdc
Definition: main.c:9
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
WORD rdParm[1]
Definition: wingdi.h:2347
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by METADC_Polygon(), and METADC_Polyline().

◆ METADC_Polygon()

BOOL METADC_Polygon ( HDC  hdc,
const POINT pt,
INT  count 
)

Definition at line 422 of file metadc.c.

423 {
424  int i;
425  POINTS *pts;
426  BOOL ret;
427 
428  pts = HeapAlloc( GetProcessHeap(), 0, sizeof(POINTS) * count );
429  if(!pts) return FALSE;
430  for (i = count; i--;)
431  {
432  pts[i].x = pt[i].x;
433  pts[i].y = pt[i].y;
434  }
435  ret = metadc_poly( hdc, META_POLYGON, pts, count );
436 
437  HeapFree( GetProcessHeap(), 0, pts );
438  return ret;
439 }
#define pt(x, y)
Definition: drawing.c:79
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
SHORT x
Definition: windef.h:342
#define META_POLYGON
Definition: wingdi.h:246
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
int ret
HDC hdc
Definition: main.c:9
static BOOL metadc_poly(HDC hdc, short func, POINTS *pt, short count)
Definition: metadc.c:384
SHORT y
Definition: windef.h:343
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define HeapFree(x, y, z)
Definition: compat.h:594

◆ METADC_Polyline()

BOOL METADC_Polyline ( HDC  hdc,
const POINT pt,
INT  count 
)

Definition at line 403 of file metadc.c.

404 {
405  int i;
406  POINTS *pts;
407  BOOL ret;
408 
409  pts = HeapAlloc( GetProcessHeap(), 0, sizeof(POINTS) * count );
410  if(!pts) return FALSE;
411  for (i=count;i--;)
412  {
413  pts[i].x = pt[i].x;
414  pts[i].y = pt[i].y;
415  }
416  ret = metadc_poly( hdc, META_POLYLINE, pts, count );
417 
418  HeapFree( GetProcessHeap(), 0, pts );
419  return ret;
420 }
#define pt(x, y)
Definition: drawing.c:79
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
SHORT x
Definition: windef.h:342
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define META_POLYLINE
Definition: wingdi.h:247
int ret
HDC hdc
Definition: main.c:9
static BOOL metadc_poly(HDC hdc, short func, POINTS *pt, short count)
Definition: metadc.c:384
SHORT y
Definition: windef.h:343
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define HeapFree(x, y, z)
Definition: compat.h:594

◆ METADC_PolyPolygon()

BOOL METADC_PolyPolygon ( HDC  hdc,
const POINT pt,
const INT counts,
UINT  polygons 
)

Definition at line 441 of file metadc.c.

442 {
443  BOOL ret;
444  DWORD len;
445  METARECORD *mr;
446  unsigned int i,j;
447  POINTS *pts;
448  INT16 totalpoint16 = 0;
449  INT16 * pointcounts;
450 
451  for (i = 0; i < polygons; i++)
452  totalpoint16 += counts[i];
453 
454  /* allocate space for all points */
455  pts=HeapAlloc( GetProcessHeap(), 0, sizeof(POINTS) * totalpoint16 );
456  pointcounts = HeapAlloc( GetProcessHeap(), 0, sizeof(INT16) * totalpoint16 );
457 
458  /* copy point counts */
459  for (i = 0; i < polygons; i++)
460  pointcounts[i] = counts[i];
461 
462  /* convert all points */
463  for (j = totalpoint16; j--;)
464  {
465  pts[j].x = pt[j].x;
466  pts[j].y = pt[j].y;
467  }
468 
469  len = sizeof(METARECORD) + sizeof(WORD) + polygons * sizeof(INT16) +
470  totalpoint16 * sizeof(*pts);
471 
472  if (!(mr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, len )))
473  {
474  HeapFree( GetProcessHeap(), 0, pts );
475  HeapFree( GetProcessHeap(), 0, pointcounts );
476  return FALSE;
477  }
478 
479  mr->rdSize = len / sizeof(WORD);
481  *mr->rdParm = polygons;
482  memcpy( mr->rdParm + 1, pointcounts, polygons * sizeof(INT16) );
483  memcpy( mr->rdParm + 1+polygons, pts , totalpoint16 * sizeof(*pts) );
484  ret = metadc_record( hdc, mr, mr->rdSize * sizeof(WORD) );
485 
486  HeapFree( GetProcessHeap(), 0, pts );
487  HeapFree( GetProcessHeap(), 0, pointcounts );
488  HeapFree( GetProcessHeap(), 0, mr);
489  return ret;
490 }
#define pt(x, y)
Definition: drawing.c:79
WORD rdFunction
Definition: wingdi.h:2346
struct tagMETARECORD METARECORD
DWORD rdSize
Definition: wingdi.h:2345
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
SHORT x
Definition: windef.h:342
static BOOL metadc_record(HDC hdc, METARECORD *mr, DWORD rlen)
Definition: metadc.c:88
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define META_POLYPOLYGON
Definition: wingdi.h:265
HDC hdc
Definition: main.c:9
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
WORD rdParm[1]
Definition: wingdi.h:2347
SHORT y
Definition: windef.h:343
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define HeapFree(x, y, z)
Definition: compat.h:594
signed short INT16

◆ METADC_RealizePalette()

BOOL METADC_RealizePalette ( HDC  hdc)

Definition at line 1247 of file metadc.c.

1248 {
1250 }
#define META_REALIZEPALETTE
Definition: wingdi.h:262
static BOOL metadc_param0(HDC hdc, short func)
Definition: metadc.c:96
HDC hdc
Definition: main.c:9

Referenced by RealizePalette().

◆ metadc_record()

static BOOL metadc_record ( HDC  hdc,
METARECORD mr,
DWORD  rlen 
)
static

Definition at line 88 of file metadc.c.

89 {
90  struct metadc *metadc;
91 
92  if (!(metadc = get_metadc_ptr( hdc ))) return FALSE;
93  return metadc_write_record( metadc, mr, rlen );
94 }
#define FALSE
Definition: types.h:117
Definition: metadc.c:45
HDC hdc
Definition: main.c:9
struct metadc * get_metadc_ptr(HDC hdc)
Definition: metadc.c:60
static BOOL metadc_write_record(struct metadc *metadc, METARECORD *mr, unsigned int rlen)
Definition: metadc.c:67

Referenced by METADC_ExtEscape(), metadc_param0(), metadc_param1(), metadc_param2(), metadc_param4(), metadc_param5(), metadc_param6(), metadc_param8(), metadc_poly(), METADC_PolyPolygon(), metadc_select_object(), METADC_SetDIBitsToDevice(), metadc_stretchblt(), METADC_StretchDIBits(), and metadc_text().

◆ METADC_Rectangle()

BOOL METADC_Rectangle ( HDC  hdc,
INT  left,
INT  top,
INT  right,
INT  bottom 
)

Definition at line 367 of file metadc.c.

368 {
370 }
static BOOL metadc_param4(HDC hdc, short func, short param1, short param2, short param3, short param4)
Definition: metadc.c:128
#define META_RECTANGLE
Definition: wingdi.h:237
GLint GLint bottom
Definition: glext.h:7726
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
HDC hdc
Definition: main.c:9
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ metadc_remove_handle()

static BOOL metadc_remove_handle ( struct metadc metadc,
UINT  index 
)
static

Definition at line 519 of file metadc.c.

520 {
521  BOOL ret = FALSE;
522 
524  {
525  metadc->handles[index] = 0;
526  metadc->cur_handles--;
527  ret = TRUE;
528  }
529  return ret;
530 }
#define TRUE
Definition: types.h:120
UINT handles_size
Definition: metadc.c:49
HGDIOBJ * handles
Definition: metadc.c:50
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint index
Definition: glext.h:6031
UINT cur_handles
Definition: metadc.c:49
int ret
#define index(s, c)
Definition: various.h:29
Definition: metadc.c:45

Referenced by METADC_ExtSelectClipRgn().

◆ METADC_RestoreDC()

BOOL METADC_RestoreDC ( HDC  hdc,
INT  level 
)

Definition at line 206 of file metadc.c.

207 {
209 }
#define META_RESTOREDC
Definition: wingdi.h:249
GLint level
Definition: gl.h:1546
static BOOL metadc_param1(HDC hdc, short func, short param)
Definition: metadc.c:105
HDC hdc
Definition: main.c:9

◆ METADC_RoundRect()

BOOL METADC_RoundRect ( HDC  hdc,
INT  left,
INT  top,
INT  right,
INT  bottom,
INT  ell_width,
INT  ell_height 
)

Definition at line 372 of file metadc.c.

374 {
376  ell_width, ell_height );
377 }
static BOOL metadc_param6(HDC hdc, short func, short param1, short param2, short param3, short param4, short param5, short param6)
Definition: metadc.c:161
GLint GLint bottom
Definition: glext.h:7726
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
HDC hdc
Definition: main.c:9
#define META_ROUNDRECT
Definition: wingdi.h:238
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ METADC_SaveDC()

BOOL METADC_SaveDC ( HDC  hdc)

Definition at line 201 of file metadc.c.

202 {
203  return metadc_param0( hdc, META_SAVEDC );
204 }
#define META_SAVEDC
Definition: wingdi.h:240
static BOOL metadc_param0(HDC hdc, short func)
Definition: metadc.c:96
HDC hdc
Definition: main.c:9

◆ METADC_ScaleViewportExtEx()

BOOL METADC_ScaleViewportExtEx ( HDC  hdc,
INT  x_num,
INT  x_denom,
INT  y_num,
INT  y_denom 
)

Definition at line 306 of file metadc.c.

307 {
308  return metadc_param4( hdc, META_SCALEVIEWPORTEXT, x_num, x_denom, y_num, y_denom );
309 }
#define META_SCALEVIEWPORTEXT
Definition: wingdi.h:228
static BOOL metadc_param4(HDC hdc, short func, short param1, short param2, short param3, short param4)
Definition: metadc.c:128
HDC hdc
Definition: main.c:9

◆ METADC_ScaleWindowExtEx()

BOOL METADC_ScaleWindowExtEx ( HDC  hdc,
INT  x_num,
INT  x_denom,
INT  y_num,
INT  y_denom 
)

Definition at line 311 of file metadc.c.

312 {
313  return metadc_param4( hdc, META_SCALEWINDOWEXT, x_num, x_denom, y_num, y_denom );
314 }
static BOOL metadc_param4(HDC hdc, short func, short param1, short param2, short param3, short param4)
Definition: metadc.c:128
#define META_SCALEWINDOWEXT
Definition: wingdi.h:226
HDC hdc
Definition: main.c:9

◆ metadc_select_object()

static BOOL metadc_select_object ( HDC  hdc,
INT16  index 
)
static

Definition at line 1038 of file metadc.c.

1039 {
1040  METARECORD mr;
1041 
1042  mr.rdSize = sizeof mr / 2;
1044  mr.rdParm[0] = index;
1045  return metadc_record( hdc, &mr, mr.rdSize * sizeof(WORD) );
1046 }
WORD rdFunction
Definition: wingdi.h:2346
DWORD rdSize
Definition: wingdi.h:2345
static BOOL metadc_record(HDC hdc, METARECORD *mr, DWORD rlen)
Definition: metadc.c:88
unsigned short WORD
Definition: ntddk_ex.h:93
#define index(s, c)
Definition: various.h:29
HDC hdc
Definition: main.c:9
WORD rdParm[1]
Definition: wingdi.h:2347
#define META_SELECTOBJECT
Definition: wingdi.h:255

Referenced by METADC_SelectBrush(), METADC_SelectFont(), and METADC_SelectPen().

◆ METADC_SelectBrush()

static HBRUSH METADC_SelectBrush ( HDC  hdc,
HBRUSH  hbrush 
)
static

Definition at line 1048 of file metadc.c.

1049 {
1050  struct metadc *metadc = get_metadc_ptr( hdc );
1051  INT16 index;
1052  HBRUSH ret;
1053 
1055  if( index < 0 )
1056  {
1058  if( index < 0 )
1059  return 0;
1060  GDI_hdc_using_object( hbrush, hdc );//, METADC_DeleteObject );
1061  }
1062  if (!metadc_select_object( hdc, index )) return 0;
1063  ret = metadc->brush;
1064  metadc->brush = hbrush;
1065  return ret;
1066 }
HBRUSH brush
Definition: metadc.c:53
static HBRUSH hbrush
static INT16 metadc_find_object(struct metadc *metadc, HGDIOBJ obj)
Definition: metadc.c:1005
static BOOL metadc_select_object(HDC hdc, INT16 index)
Definition: metadc.c:1038
GLuint index
Definition: glext.h:6031
static INT16 metadc_create_brush(struct metadc *metadc, HBRUSH brush)
Definition: metadc.c:532
int ret
#define index(s, c)
Definition: various.h:29
Definition: metadc.c:45
HDC hdc
Definition: main.c:9
struct metadc * get_metadc_ptr(HDC hdc)
Definition: metadc.c:60
void GDI_hdc_using_object(HGDIOBJ obj, HDC hdc) DECLSPEC_HIDDEN
Definition: rosglue.c:166
signed short INT16

Referenced by METADC_SelectObject().

◆ METADC_SelectFont()

static HFONT METADC_SelectFont ( HDC  hdc,
HFONT  hfont 
)
static

Definition at line 1102 of file metadc.c.

1103 {
1104  struct metadc *metadc = get_metadc_ptr( hdc );
1105  LOGFONTW font;
1106  INT16 index;
1107  HFONT ret;
1108 
1110  if (index < 0)
1111  {
1112  if (!GetObjectW( hfont, sizeof(font), &font ))
1113  return 0;
1115  if( index < 0 )
1116  return 0;
1117  GDI_hdc_using_object( hfont, hdc );//, METADC_DeleteObject );
1118  }
1119  if (!metadc_select_object( hdc, index )) return 0;
1120  ret = metadc->font;
1121  metadc->font = hfont;
1122  return ret;
1123 }
Definition: mk_font.cpp:20
static INT16 metadc_find_object(struct metadc *metadc, HGDIOBJ obj)
Definition: metadc.c:1005
static BOOL metadc_select_object(HDC hdc, INT16 index)
Definition: metadc.c:1038
GLuint index
Definition: glext.h:6031
static HFONT hfont
int ret
#define index(s, c)
Definition: various.h:29
Definition: metadc.c:45
HDC hdc
Definition: main.c:9
static UINT16 metadc_create_font(struct metadc *metadc, HFONT font, LOGFONTW *logfont)
Definition: metadc.c:1068
HFONT font
Definition: metadc.c:54
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
struct metadc * get_metadc_ptr(HDC hdc)
Definition: metadc.c:60
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
void GDI_hdc_using_object(HGDIOBJ obj, HDC hdc) DECLSPEC_HIDDEN
Definition: rosglue.c:166
signed short INT16

Referenced by METADC_SelectObject().

◆ METADC_SelectObject()

HGDIOBJ METADC_SelectObject ( HDC  hdc,
HGDIOBJ  obj 
)

Definition at line 1252 of file metadc.c.

1253 {
1254  switch (GDI_HANDLE_GET_TYPE( obj ))
1255  {
1257  return METADC_SelectBrush( hdc, obj );
1259  return METADC_SelectFont( hdc, obj );
1262  return METADC_SelectPen( hdc, obj );
1263  default:
1265  return 0;
1266  }
1267 }
static HFONT METADC_SelectFont(HDC hdc, HFONT hfont)
Definition: metadc.c:1102
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
static HBRUSH METADC_SelectBrush(HDC hdc, HBRUSH hbrush)
Definition: metadc.c:1048
#define SetLastError(x)
Definition: compat.h:611
HDC hdc
Definition: main.c:9
static HPEN METADC_SelectPen(HDC hdc, HPEN hpen)
Definition: metadc.c:1138

◆ METADC_SelectPalette()

BOOL METADC_SelectPalette ( HDC  hdc,
HPALETTE  palette 
)

Definition at line 1220 of file metadc.c.

1221 {
1222  struct metadc *metadc;
1223  PLOGPALETTE log_palette;
1224  WORD count = 0;
1225  BOOL ret;
1226  int size;
1227 
1228  if (!(metadc = get_metadc_ptr( hdc ))) return FALSE;
1229  GetObjectA( palette, sizeof(WORD), &count );
1230  if (!count) return 0;
1231 
1232  size = sizeof(LOGPALETTE) + (count - 1) * sizeof(PALETTEENTRY);
1233  log_palette = HeapAlloc( GetProcessHeap(), 0, size );
1234  if (!log_palette) return 0;
1235 
1236  log_palette->palVersion = 0x300;
1237  log_palette->palNumEntries = count;
1238 
1239  GetPaletteEntries( palette, 0, count, log_palette->palPalEntry );
1240 
1241  ret = metadc_create_palette( metadc, palette, log_palette, size );
1242 
1243  HeapFree( GetProcessHeap(), 0, log_palette );
1244  return ret;
1245 }
int WINAPI GetObjectA(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
UINT WINAPI GetPaletteEntries(HPALETTE hpal, UINT iStartIndex, UINT cEntries, LPPALETTEENTRY ppe)
Definition: palette.c:64
GLuint GLuint GLsizei count
Definition: gl.h:1545
WORD palVersion
Definition: wingdi.h:1833
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned short WORD
Definition: ntddk_ex.h:93
static BOOL metadc_create_palette(struct metadc *metadc, HPALETTE palette, LOGPALETTE *log_palette, int sizeofPalette)
Definition: metadc.c:1189
int ret
Definition: metadc.c:45
HDC hdc
Definition: main.c:9
static HPALETTE palette
Definition: clipboard.c:1345
struct tagLOGPALETTE LOGPALETTE
struct metadc * get_metadc_ptr(HDC hdc)
Definition: metadc.c:60
struct tagPALETTEENTRY PALETTEENTRY
WORD palNumEntries
Definition: wingdi.h:1834
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by SelectPalette().

◆ METADC_SelectPen()

static HPEN METADC_SelectPen ( HDC  hdc,
HPEN  hpen 
)
static

Definition at line 1138 of file metadc.c.

1139 {
1140  struct metadc *metadc = get_metadc_ptr( hdc );
1141  LOGPEN16 logpen;
1142  INT16 index;
1143  HPEN ret;
1144 
1146  if (index < 0)
1147  {
1148  /* must be an extended pen */
1149  INT size = GetObjectW( hpen, 0, NULL );
1150 
1151  if (!size) return 0;
1152 
1153  if (size == sizeof(LOGPEN))
1154  {
1155  LOGPEN pen;
1156 
1157  GetObjectW( hpen, sizeof(pen), &pen );
1158  logpen.lopnStyle = pen.lopnStyle;
1159  logpen.lopnWidth.x = pen.lopnWidth.x;
1160  logpen.lopnWidth.y = pen.lopnWidth.y;
1161  logpen.lopnColor = pen.lopnColor;
1162  }
1163  else /* must be an extended pen */
1164  {
1165  EXTLOGPEN *elp = HeapAlloc( GetProcessHeap(), 0, size );
1166 
1167  GetObjectW( hpen, size, elp );
1168  /* FIXME: add support for user style pens */
1169  logpen.lopnStyle = elp->elpPenStyle;
1170  logpen.lopnWidth.x = elp->elpWidth;
1171  logpen.lopnWidth.y = 0;
1172  logpen.lopnColor = elp->elpColor;
1173 
1174  HeapFree( GetProcessHeap(), 0, elp );
1175  }
1176 
1177  index = metadc_create_pen( metadc, hpen, &logpen );
1178  if( index < 0 )
1179  return 0;
1180  GDI_hdc_using_object( hpen, hdc );//, METADC_DeleteObject );
1181  }
1182 
1183  if (!metadc_select_object( hdc, index )) return 0;
1184  ret = metadc->pen;
1185  metadc->pen = hpen;
1186  return ret;
1187 }
COLORREF elpColor
Definition: wingdi.h:1945
static UINT16 metadc_create_pen(struct metadc *metadc, HPEN pen, LOGPEN16 *logpen)
Definition: metadc.c:1125
DWORD elpWidth
Definition: wingdi.h:1943
UINT16 lopnStyle
Definition: wingdi16.h:65
static INT16 metadc_find_object(struct metadc *metadc, HGDIOBJ obj)
Definition: metadc.c:1005
static BOOL metadc_select_object(HDC hdc, INT16 index)
Definition: metadc.c:1038
INT16 x
Definition: windef16.h:135
static HPEN hpen
int32_t INT
Definition: typedefs.h:58
HPEN pen
Definition: metadc.c:52
DWORD elpPenStyle
Definition: wingdi.h:1942
GLuint index
Definition: glext.h:6031
INT16 y
Definition: windef16.h:136
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
int ret
#define index(s, c)
Definition: various.h:29
Definition: metadc.c:45
HDC hdc
Definition: main.c:9
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
#define NULL
Definition: types.h:112
struct metadc * get_metadc_ptr(HDC hdc)
Definition: metadc.c:60
void GDI_hdc_using_object(HGDIOBJ obj, HDC hdc) DECLSPEC_HIDDEN
Definition: rosglue.c:166
COLORREF lopnColor
Definition: wingdi16.h:67
POINT16 lopnWidth
Definition: wingdi16.h:66
#define HeapFree(x, y, z)
Definition: compat.h:594
signed short INT16

Referenced by METADC_SelectObject().

◆ METADC_SetBkColor()

BOOL METADC_SetBkColor ( HDC  hdc,
COLORREF  color 
)

Definition at line 221 of file metadc.c.

222 {
224 }
GLuint color
Definition: glext.h:6243
HDC hdc
Definition: main.c:9
static BOOL metadc_param2(HDC hdc, short func, short param1, short param2)
Definition: metadc.c:115
#define META_SETBKCOLOR
Definition: wingdi.h:210
#define HIWORD(l)
Definition: typedefs.h:247
#define LOWORD(l)
Definition: pedump.c:82

◆ METADC_SetBkMode()

BOOL METADC_SetBkMode ( HDC  hdc,
INT  mode 
)

Definition at line 216 of file metadc.c.

217 {
219 }
static BOOL metadc_param1(HDC hdc, short func, short param)
Definition: metadc.c:105
#define META_SETBKMODE
Definition: wingdi.h:211
unsigned short WORD
Definition: ntddk_ex.h:93
HDC hdc
Definition: main.c:9
GLenum mode
Definition: glext.h:6217

◆ METADC_SetDIBitsToDevice()

INT METADC_SetDIBitsToDevice ( HDC  hdc,
INT  x_dst,
INT  y_dst,
DWORD  width,
DWORD  height,
INT  x_src,
INT  y_src,
UINT  startscan,
UINT  lines,
const void bits,
const BITMAPINFO info,
UINT  coloruse 
)

Definition at line 846 of file metadc.c.

850 {
851  DWORD infosize = get_dib_info_size(info, coloruse);
852  DWORD len = sizeof(METARECORD) + 8 * sizeof(WORD) + infosize + info->bmiHeader.biSizeImage;
853  METARECORD *mr;
854 
855  if (!(mr = HeapAlloc( GetProcessHeap(), 0, len ))) return 0;
856 
857  mr->rdSize = len / sizeof(WORD);
859  mr->rdParm[0] = coloruse;
860  mr->rdParm[1] = lines;
861  mr->rdParm[2] = startscan;
862  mr->rdParm[3] = y_src;
863  mr->rdParm[4] = x_src;
864  mr->rdParm[5] = height;
865  mr->rdParm[6] = width;
866  mr->rdParm[7] = y_dst;
867  mr->rdParm[8] = x_dst;
868  memcpy( mr->rdParm + 9, info, infosize );
869  memcpy( mr->rdParm + 9 + infosize / sizeof(WORD), bits, info->bmiHeader.biSizeImage );
870  metadc_record( hdc, mr, mr->rdSize * sizeof(WORD) );
871  HeapFree( GetProcessHeap(), 0, mr );
872  return lines;
873 }
GLint GLint GLsizei width
Definition: gl.h:1546
WORD rdFunction
Definition: wingdi.h:2346
struct tagMETARECORD METARECORD
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
DWORD rdSize
Definition: wingdi.h:2345
static BOOL metadc_record(HDC hdc, METARECORD *mr, DWORD rlen)
Definition: metadc.c:88
eMaj lines
Definition: tritemp.h:206
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#define META_SETDIBTODEV
Definition: wingdi.h:260
HDC hdc
Definition: main.c:9
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
WORD rdParm[1]
Definition: wingdi.h:2347
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
static int get_dib_info_size(const BITMAPINFO *info, UINT coloruse)
Definition: gdi_private.h:212
#define HeapFree(x, y, z)
Definition: compat.h:594

◆ METADC_SetLayout()

BOOL METADC_SetLayout ( HDC  hdc,
DWORD  layout 
)

Definition at line 266 of file metadc.c.

267 {
269 }
HDC hdc
Definition: main.c:9
static DWORD layout
Definition: bitmap.c:46
static BOOL metadc_param2(HDC hdc, short func, short param1, short param2)
Definition: metadc.c:115
#define META_SETLAYOUT
Definition: wingdi.h:218
#define HIWORD(l)
Definition: typedefs.h:247
#define LOWORD(l)
Definition: pedump.c:82

◆ METADC_SetMapMode()

BOOL METADC_SetMapMode ( HDC  hdc,
INT  mode 
)

Definition at line 271 of file metadc.c.

272 {
274 }
static BOOL metadc_param1(HDC hdc, short func, short param)
Definition: metadc.c:105
HDC hdc
Definition: main.c:9
GLenum mode
Definition: glext.h:6217
#define META_SETMAPMODE
Definition: wingdi.h:212

Referenced by METADC_SetD(), and SetMapMode().

◆ METADC_SetMapperFlags()

BOOL METADC_SetMapperFlags ( HDC  hdc,
DWORD  flags 
)

Definition at line 326 of file metadc.c.

327 {
329 }
#define META_SETMAPPERFLAGS
Definition: wingdi.h:258
GLbitfield flags
Definition: glext.h:7161
HDC hdc
Definition: main.c:9
static BOOL metadc_param2(HDC hdc, short func, short param1, short param2)
Definition: metadc.c:115
#define HIWORD(l)
Definition: typedefs.h:247
#define LOWORD(l)
Definition: pedump.c:82

◆ METADC_SetPixel()

BOOL METADC_SetPixel ( HDC  hdc,
INT  x,
INT  y,
COLORREF  color 
)

Definition at line 379 of file metadc.c.

380 {
382 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static BOOL metadc_param4(HDC hdc, short func, short param1, short param2, short param3, short param4)
Definition: metadc.c:128
GLuint color
Definition: glext.h:6243
#define META_SETPIXEL
Definition: wingdi.h:241
HDC hdc
Definition: main.c:9
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define HIWORD(l)
Definition: typedefs.h:247
#define LOWORD(l)
Definition: pedump.c:82

◆ METADC_SetPolyFillMode()

BOOL METADC_SetPolyFillMode ( HDC  hdc,
INT  mode 
)

Definition at line 241 of file metadc.c.

242 {
244 }
#define META_SETPOLYFILLMODE
Definition: wingdi.h:215
static BOOL metadc_param1(HDC hdc, short func, short param)
Definition: metadc.c:105
HDC hdc
Definition: main.c:9
GLenum mode
Definition: glext.h:6217

◆ METADC_SetRelAbs()

BOOL METADC_SetRelAbs ( HDC  hdc,
INT  mode 
)

Definition at line 236 of file metadc.c.

237 {
239 }
static BOOL metadc_param1(HDC hdc, short func, short param)
Definition: metadc.c:105
unsigned short WORD
Definition: ntddk_ex.h:93
HDC hdc
Definition: main.c:9
#define META_SETRELABS
Definition: wingdi.h:214
GLenum mode
Definition: glext.h:6217

Referenced by METADC_SetD().

◆ METADC_SetROP2()

BOOL METADC_SetROP2 ( HDC  hdc,
INT  rop 
)

Definition at line 231 of file metadc.c.

232 {
233  return metadc_param1( hdc, META_SETROP2, (WORD)rop );
234 }
#define META_SETROP2
Definition: wingdi.h:213
static BOOL metadc_param1(HDC hdc, short func, short param)
Definition: metadc.c:105
static int rop(int rop, int src, int dst)
Definition: nanoxwin.c:124
unsigned short WORD
Definition: ntddk_ex.h:93
HDC hdc
Definition: main.c:9

◆ METADC_SetStretchBltMode()

BOOL METADC_SetStretchBltMode ( HDC  hdc,
INT  mode 
)

Definition at line 246 of file metadc.c.

247 {
249 }
static BOOL metadc_param1(HDC hdc, short func, short param)
Definition: metadc.c:105
#define META_SETSTRETCHBLTMODE
Definition: wingdi.h:216
HDC hdc
Definition: main.c:9
GLenum mode
Definition: glext.h:6217

◆ METADC_SetTextAlign()

BOOL METADC_SetTextAlign ( HDC  hdc,
UINT  align 
)

Definition at line 211 of file metadc.c.

212 {
214 }
int align(int length, int align)
Definition: dsound8.c:36
HDC hdc
Definition: main.c:9
#define META_SETTEXTALIGN
Definition: wingdi.h:256
static BOOL metadc_param2(HDC hdc, short func, short param1, short param2)
Definition: metadc.c:115
#define HIWORD(l)
Definition: typedefs.h:247
#define LOWORD(l)
Definition: pedump.c:82

◆ METADC_SetTextCharacterExtra()

BOOL METADC_SetTextCharacterExtra ( HDC  hdc,
INT  extra 
)

Definition at line 321 of file metadc.c.

322 {
324 }
static BOOL metadc_param1(HDC hdc, short func, short param)
Definition: metadc.c:105
#define META_SETTEXTCHAREXTRA
Definition: wingdi.h:217
Definition: id3.c:95
HDC hdc
Definition: main.c:9

◆ METADC_SetTextColor()

BOOL METADC_SetTextColor ( HDC  hdc,
COLORREF  color 
)

Definition at line 226 of file metadc.c.

227 {
229 }
GLuint color
Definition: glext.h:6243
#define META_SETTEXTCOLOR
Definition: wingdi.h:219
HDC hdc
Definition: main.c:9
static BOOL metadc_param2(HDC hdc, short func, short param1, short param2)
Definition: metadc.c:115
#define HIWORD(l)
Definition: typedefs.h:247
#define LOWORD(l)
Definition: pedump.c:82

◆ METADC_SetTextJustification()

BOOL METADC_SetTextJustification ( HDC  hdc,
INT  extra,
INT  breaks 
)

Definition at line 316 of file metadc.c.

317 {
318  return metadc_param2( hdc, META_SETTEXTJUSTIFICATION, extra, breaks );
319 }
Definition: id3.c:95
HDC hdc
Definition: main.c:9
#define META_SETTEXTJUSTIFICATION
Definition: wingdi.h:220
static BOOL metadc_param2(HDC hdc, short func, short param1, short param2)
Definition: metadc.c:115

◆ METADC_SetViewportExtEx()

BOOL METADC_SetViewportExtEx ( HDC  hdc,
INT  x,
INT  y 
)

Definition at line 276 of file metadc.c.

277 {
278  return metadc_param2( hdc, META_SETVIEWPORTEXT, x, y );
279 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define META_SETVIEWPORTEXT
Definition: wingdi.h:224
HDC hdc
Definition: main.c:9
static BOOL metadc_param2(HDC hdc, short func, short param1, short param2)
Definition: metadc.c:115
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ METADC_SetViewportOrgEx()

BOOL METADC_SetViewportOrgEx ( HDC  hdc,
INT  x,
INT  y 
)

Definition at line 281 of file metadc.c.

282 {
283  return metadc_param2( hdc, META_SETVIEWPORTORG, x, y );
284 }
#define META_SETVIEWPORTORG
Definition: wingdi.h:223
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
HDC hdc
Definition: main.c:9
static BOOL metadc_param2(HDC hdc, short func, short param1, short param2)
Definition: metadc.c:115
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ METADC_SetWindowExtEx()

BOOL METADC_SetWindowExtEx ( HDC  hdc,
INT  x,
INT  y 
)

Definition at line 286 of file metadc.c.

287 {
288  return metadc_param2( hdc, META_SETWINDOWEXT, x, y );
289 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
HDC hdc
Definition: main.c:9
static BOOL metadc_param2(HDC hdc, short func, short param1, short param2)
Definition: metadc.c:115
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define META_SETWINDOWEXT
Definition: wingdi.h:222

◆ METADC_SetWindowOrgEx()

BOOL METADC_SetWindowOrgEx ( HDC  hdc,
INT  x,
INT  y 
)

Definition at line 291 of file metadc.c.

292 {
293  return metadc_param2( hdc, META_SETWINDOWORG, x, y );
294 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define META_SETWINDOWORG
Definition: wingdi.h:221
HDC hdc
Definition: main.c:9
static BOOL metadc_param2(HDC hdc, short func, short param1, short param2)
Definition: metadc.c:115
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ metadc_stretchblt()

static BOOL metadc_stretchblt ( HDC  hdc,
INT  x_dst,
INT  y_dst,
INT  width_dst,
INT  height_dst,
HDC  hdc_src,
INT  x_src,
INT  y_src,
INT  width_src,
INT  height_src,
DWORD  rop,
WORD  type 
)
static

Definition at line 743 of file metadc.c.

746 {
747  BITMAPINFO src_info = {{ sizeof( src_info.bmiHeader ) }};
748  UINT bmi_size, size, bpp;
749  int i = 0, bitmap_offset;
750  BITMAPINFO *bmi;
751  METARECORD *mr;
752  HBITMAP bitmap;
753  BOOL ret;
754 
755  if (!(bitmap = GetCurrentObject( hdc_src, OBJ_BITMAP ))) return FALSE;
756  if (!GetDIBits( hdc_src, bitmap, 0, INT_MAX, NULL, &src_info, DIB_RGB_COLORS )) return FALSE;
757 
758  bpp = src_info.bmiHeader.biBitCount;
759  if (bpp <= 8)
760  bmi_size = sizeof(BITMAPINFOHEADER) + (1L << bpp) * sizeof(RGBQUAD);
761  else if (bpp == 16 || bpp == 32)
762  bmi_size = sizeof(BITMAPINFOHEADER) + 3 * sizeof(RGBQUAD);
763  else
764  bmi_size = sizeof(BITMAPINFOHEADER);
765 
766  bitmap_offset = type == META_DIBBITBLT ? 8 : 10;
767  size = FIELD_OFFSET( METARECORD, rdParm[bitmap_offset] ) + bmi_size +
768  src_info.bmiHeader.biSizeImage;
769  if (!(mr = HeapAlloc( GetProcessHeap(), 0, size ))) return FALSE;
770  mr->rdFunction = type;
771  bmi = (BITMAPINFO *)&mr->rdParm[bitmap_offset];
772  bmi->bmiHeader = src_info.bmiHeader;
773  TRACE( "size = %u rop=%x\n", size, rop );
774 
775  ret = GetDIBits( hdc_src, bitmap, 0, src_info.bmiHeader.biHeight, (BYTE *)bmi + bmi_size,
776  bmi, DIB_RGB_COLORS );
777  if (ret)
778  {
779  mr->rdSize = size / sizeof(WORD);
780  mr->rdParm[i++] = LOWORD(rop);
781  mr->rdParm[i++] = HIWORD(rop);
782  if (bitmap_offset > 8)
783  {
784  mr->rdParm[i++] = height_src;
785  mr->rdParm[i++] = width_src;
786  }
787  mr->rdParm[i++] = y_src;
788  mr->rdParm[i++] = x_src;
789  mr->rdParm[i++] = height_dst;
790  mr->rdParm[i++] = width_dst;
791  mr->rdParm[i++] = y_dst;
792  mr->rdParm[i++] = x_dst;
793  ret = metadc_record( hdc, mr, size );
794  }
795 
796  HeapFree( GetProcessHeap(), 0, mr);
797  return ret;
798 }
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1476
#define INT_MAX
Definition: limits.h:40
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
WORD rdFunction
Definition: wingdi.h:2346
DWORD rdSize
Definition: wingdi.h:2345
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static int rop(int rop, int src, int dst)
Definition: nanoxwin.c:124
#define META_DIBBITBLT
Definition: wingdi.h:267
static BOOL metadc_record(HDC hdc, METARECORD *mr, DWORD rlen)
Definition: metadc.c:88
Definition: uimain.c:88
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
ULONG RGBQUAD
Definition: precomp.h:50
unsigned short WORD
Definition: ntddk_ex.h:93
DWORD biSizeImage
Definition: amvideo.idl:36
int ret
HDC hdc
Definition: main.c:9
WORD rdParm[1]
Definition: wingdi.h:2347
unsigned char BYTE
Definition: xxhash.c:193
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
int WINAPI GetDIBits(_In_ HDC hdc, _In_ HBITMAP hbm, _In_ UINT start, _In_ UINT cLines, _Out_opt_ LPVOID lpvBits, _At_((LPBITMAPINFOHEADER) lpbmi, _Inout_) LPBITMAPINFO lpbmi, _In_ UINT usage)
#define HIWORD(l)
Definition: typedefs.h:247
DWORD bpp
Definition: surface.c:185
static HBITMAP bitmap
Definition: clipboard.c:1344
static HBITMAP
Definition: button.c:44
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define DIB_RGB_COLORS
Definition: wingdi.h:367
#define LOWORD(l)
Definition: pedump.c:82
#define OBJ_BITMAP
Definition: objidl.idl:1415
#define HeapFree(x, y, z)
Definition: compat.h:594
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
Definition: dc.c:428

Referenced by METADC_BitBlt(), and METADC_StretchBlt().

◆ METADC_StretchBlt()

BOOL METADC_StretchBlt ( HDC  hdc_dst,
INT  x_dst,
INT  y_dst,
INT  width_dst,
INT  height_dst,
HDC  hdc_src,
INT  x_src,
INT  y_src,
INT  width_src,
INT  height_src,
DWORD  rop 
)

Definition at line 807 of file metadc.c.

810 {
811  return metadc_stretchblt( hdc_dst, x_dst, y_dst, width_dst, height_dst,
812  hdc_src, x_src, y_src, width_src, height_src, rop, META_DIBSTRETCHBLT );
813 }
static int rop(int rop, int src, int dst)
Definition: nanoxwin.c:124
static BOOL metadc_stretchblt(HDC hdc, INT x_dst, INT y_dst, INT width_dst, INT height_dst, HDC hdc_src, INT x_src, INT y_src, INT width_src, INT height_src, DWORD rop, WORD type)
Definition: metadc.c:743
#define META_DIBSTRETCHBLT
Definition: wingdi.h:268

◆ METADC_StretchDIBits()

INT METADC_StretchDIBits ( HDC  hdc,
INT  x_dst,
INT  y_dst,
INT  width_dst,
INT  height_dst,
INT  x_src,
INT  y_src,
INT  width_src,
INT  height_src,
const void bits,
const BITMAPINFO info,
UINT  usage,
DWORD  rop 
)

Definition at line 815 of file metadc.c.

819 {
820  DWORD infosize = get_dib_info_size( info, usage );
821  DWORD len = sizeof(METARECORD) + 10 * sizeof(WORD) + infosize + info->bmiHeader.biSizeImage;
822  METARECORD *mr;
823 
824  if (!(mr = HeapAlloc( GetProcessHeap(), 0, len ))) return 0;
825 
826  mr->rdSize = len / sizeof(WORD);
828  mr->rdParm[0] = LOWORD(rop);
829  mr->rdParm[1] = HIWORD(rop);
830  mr->rdParm[2] = usage;
831  mr->rdParm[3] = height_src;
832  mr->rdParm[4] = width_src;
833  mr->rdParm[5] = y_src;
834  mr->rdParm[6] = x_src;
835  mr->rdParm[7] = height_dst;
836  mr->rdParm[8] = width_dst;
837  mr->rdParm[9] = y_dst;
838  mr->rdParm[10] = x_dst;
839  memcpy( mr->rdParm + 11, info, infosize );
840  memcpy( mr->rdParm + 11 + infosize / 2, bits, info->bmiHeader.biSizeImage );
841  metadc_record( hdc, mr, mr->rdSize * sizeof(WORD) );
842  HeapFree( GetProcessHeap(), 0, mr );
843  return height_src;
844 }
#define META_STRETCHDIB
Definition: wingdi.h:270
WORD rdFunction
Definition: wingdi.h:2346
struct tagMETARECORD METARECORD
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
DWORD rdSize
Definition: wingdi.h:2345
static int rop(int rop, int src, int dst)
Definition: nanoxwin.c:124
static BOOL metadc_record(HDC hdc, METARECORD *mr, DWORD rlen)
Definition: metadc.c:88
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
HDC hdc
Definition: main.c:9
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
WORD rdParm[1]
Definition: wingdi.h:2347
static int get_dib_info_size(const BITMAPINFO *info, UINT coloruse)
Definition: gdi_private.h:212
#define HIWORD(l)
Definition: typedefs.h:247
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:594

◆ metadc_text()

static BOOL metadc_text ( HDC  hdc,
short  x,
short  y,
UINT16  flags,
const RECT16 rect,
const char str,
short  count,
const INT16 dx 
)
static

Definition at line 875 of file metadc.c.

877 {
878  BOOL ret;
879  DWORD len;
880  METARECORD *mr;
881  BOOL isrect = flags & (ETO_CLIPPED | ETO_OPAQUE);
882 
883  len = sizeof(METARECORD) + (((count + 1) >> 1) * 2) + 2 * sizeof(short)
884  + sizeof(UINT16);
885  if (isrect) len += sizeof(RECT16);
886  if (dx) len += count * sizeof(INT16);
887  if (!(mr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, len ))) return FALSE;
888 
889  mr->rdSize = len / sizeof(WORD);
891  mr->rdParm[0] = y;
892  mr->rdParm[1] = x;
893  mr->rdParm[2] = count;
894  mr->rdParm[3] = flags;
895  if (isrect) memcpy( mr->rdParm + 4, rect, sizeof(RECT16) );
896  memcpy( mr->rdParm + (isrect ? 8 : 4), str, count );
897  if (dx)
898  memcpy( mr->rdParm + (isrect ? 8 : 4) + ((count + 1) >> 1), dx, count * sizeof(INT16) );
899  ret = metadc_record( hdc, mr, mr->rdSize * sizeof(WORD) );
900  HeapFree( GetProcessHeap(), 0, mr );
901  return ret;
902 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
WORD rdFunction
Definition: wingdi.h:2346
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
struct tagMETARECORD METARECORD
DWORD rdSize
Definition: wingdi.h:2345
& rect
Definition: startmenu.cpp:1413
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
#define FALSE
Definition: types.h:117
#define ETO_OPAQUE
Definition: wingdi.h:647
unsigned int BOOL
Definition: ntddk_ex.h:94
const WCHAR * str
#define ETO_CLIPPED
Definition: wingdi.h:648
static BOOL metadc_record(HDC hdc, METARECORD *mr, DWORD rlen)
Definition: metadc.c:88
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#define META_EXTTEXTOUT
Definition: wingdi.h:259
GLbitfield flags
Definition: glext.h:7161
int ret
HDC hdc
Definition: main.c:9
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
WORD rdParm[1]
Definition: wingdi.h:2347
unsigned short UINT16
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint dx
Definition: linetemp.h:97
#define HeapFree(x, y, z)
Definition: compat.h:594
signed short INT16

Referenced by METADC_ExtTextOut().

◆ metadc_write_record()

static BOOL metadc_write_record ( struct metadc metadc,
METARECORD mr,
unsigned int  rlen 
)
static

Definition at line 67 of file metadc.c.

68 {
69  DWORD len, size;
70  METAHEADER *mh;
71 
72  len = metadc->mh->mtSize * sizeof(WORD) + rlen;
73  size = HeapSize( GetProcessHeap(), 0, metadc->mh );
74  if (len > size)
75  {
76  size += size / sizeof(WORD) + rlen;
78  if (!mh) return FALSE;
79  metadc->mh = mh;
80  }
81  memcpy( (WORD *)metadc->mh + metadc->mh->mtSize, mr, rlen );
82 
83  metadc->mh->mtSize += rlen / sizeof(WORD);
84  metadc->mh->mtMaxRecord = max( metadc->mh->mtMaxRecord, rlen / sizeof(WORD) );
85  return TRUE;
86 }
METAHEADER * mh
Definition: metadc.c:48
#define max(a, b)
Definition: svc.c:63
DWORD mtSize
Definition: wingdi.h:2313
#define TRUE
Definition: types.h:120
SIZE_T WINAPI HeapSize(HANDLE, DWORD, LPCVOID)
#define FALSE
Definition: types.h:117
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:595
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
Definition: metadc.c:45
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
DWORD mtMaxRecord
Definition: wingdi.h:2315
#define HeapReAlloc
Definition: compat.h:593

Referenced by metadc_create_brush(), metadc_create_font(), metadc_create_palette(), metadc_create_pen(), metadc_create_region(), METADC_DeleteObject(), and metadc_record().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( metafile  )