---
name: "EMF_GLOBALOBJECTS"
section: "3"
platform: "linux"
package: "libemf-doc"
version: "1.0.13-8"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/EMF_GLOBALOBJECTS"
---

# EMF\_GLOBALOBJECTS(3)

## NAME

EMF::GLOBALOBJECTS

## SYNOPSIS

`#include <libemf.h>`

### Public Member Functions

HGDIOBJ **add** (**OBJECT** \*object)\
 **OBJECT** \* **find** (const HGDIOBJ handle)\
 void **remove** (const **OBJECT** \*object)\
 auto **begin** (void) const\
 auto **end** (void) const\
 METARECORDCTOR **newRecord** (DWORD iType) const\

### Static Public Member Functions

static **EMF::METARECORD** \* **new\_eof** (**DATASTREAM** &ds)\
 Create a new **EMREOF** record.  static **EMF::METARECORD** \* **new\_setviewportorgex** (**DATASTREAM** &ds)\
 Create a new **EMRSETVIEWPORTORGEX** record.  static **EMF::METARECORD** \* **new\_setwindoworgex** (**DATASTREAM** &ds)\
 Create a new **EMRSETWINDOWORGEX** record.  static **EMF::METARECORD** \* **new\_setviewportextex** (**DATASTREAM** &ds)\
 Create a new **EMRSETVIEWPORTEXTEX** record.  static **EMF::METARECORD** \* **new\_setwindowextex** (**DATASTREAM** &ds)\
 Create a new **EMRSETWINDOWEXTEX** record.  static **EMF::METARECORD** \* **new\_scaleviewportextex** (**DATASTREAM** &ds)\
 Create a new SCALEVIEWPORTEXTEX record.  static **EMF::METARECORD** \* **new\_scalewindowextex** (**DATASTREAM** &ds)\
 Create a new SCALEWINDOWEXTEX record.  static **EMF::METARECORD** \* **new\_modifyworldtransform** (**DATASTREAM** &ds)\
 Create a new MODIFYWORLDTRANSFORM record.  static **EMF::METARECORD** \* **new\_setworldtransform** (**DATASTREAM** &ds)\
 Create a new SETWORLDTRANSFORM record.  static **EMF::METARECORD** \* **new\_settextalign** (**DATASTREAM** &ds)\
 Create a new SETTEXTALIGN record.  static **EMF::METARECORD** \* **new\_settextcolor** (**DATASTREAM** &ds)\
 Create a new SETTEXTCOLOR record.  static **EMF::METARECORD** \* **new\_setbkcolor** (**DATASTREAM** &ds)\
 Create a new SETBKCOLOR record.  static **EMF::METARECORD** \* **new\_setbkmode** (**DATASTREAM** &ds)\
 Create a new SETBKMODE record.  static **EMF::METARECORD** \* **new\_setpolyfillmode** (**DATASTREAM** &ds)\
 Create a new SETPOLYFILLMODE record.  static **EMF::METARECORD** \* **new\_setmapmode** (**DATASTREAM** &ds)\
 Create a new SETMAPMODE record.  static **EMF::METARECORD** \* **new\_selectobject** (**DATASTREAM** &ds)\
 Create a new SELECTOBJECT record.  static **EMF::METARECORD** \* **new\_deleteobject** (**DATASTREAM** &ds)\
 Create a new DELETEOBJECT record.  static **EMF::METARECORD** \* **new\_movetoex** (**DATASTREAM** &ds)\
 Create a new MOVETOEX record.  static **EMF::METARECORD** \* **new\_lineto** (**DATASTREAM** &ds)\
 Create a new LINETO record.  static **EMF::METARECORD** \* **new\_arc** (**DATASTREAM** &ds)\
 Create a new ARC record.  static **EMF::METARECORD** \* **new\_arcto** (**DATASTREAM** &ds)\
 Create a new ARCTO record.  static **EMF::METARECORD** \* **new\_rectangle** (**DATASTREAM** &ds)\
 Create a new RECTANGLE record.  static **EMF::METARECORD** \* **new\_ellipse** (**DATASTREAM** &ds)\
 Create a new ELLIPSE record.  static **EMF::METARECORD** \* **new\_polyline** (**DATASTREAM** &ds)\
 Create a new POLYLINE record.  static **EMF::METARECORD** \* **new\_polyline16** (**DATASTREAM** &ds)\
 Create a new POLYLINE16 record.  static **EMF::METARECORD** \* **new\_polygon** (**DATASTREAM** &ds)\
 Create a new POLYGON record.  static **EMF::METARECORD** \* **new\_polygon16** (**DATASTREAM** &ds)\
 Create a new POLYGON16 record.  static **EMF::METARECORD** \* **new\_polypolygon** (**DATASTREAM** &ds)\
 Create a new POLYPOLYGON record.  static **EMF::METARECORD** \* **new\_polypolygon16** (**DATASTREAM** &ds)\
 Create a new POLYPOLYGON16 record.  static **EMF::METARECORD** \* **new\_polybezier** (**DATASTREAM** &ds)\
 Create a new POLYBEZIER record.  static **EMF::METARECORD** \* **new\_polybezier16** (**DATASTREAM** &ds)\
 Create a new POLYBEZIER16 record.  static **EMF::METARECORD** \* **new\_polybezierto** (**DATASTREAM** &ds)\
 Create a new POLYBEZIERTO record.  static **EMF::METARECORD** \* **new\_polybezierto16** (**DATASTREAM** &ds)\
 Create a new POLYBEZIERTO16 record.  static **EMF::METARECORD** \* **new\_polylineto** (**DATASTREAM** &ds)\
 Create a new POLYLINETO record.  static **EMF::METARECORD** \* **new\_polylineto16** (**DATASTREAM** &ds)\
 Create a new POLYLINETO16 record.  static **EMF::METARECORD** \* **new\_exttextouta** (**DATASTREAM** &ds)\
 Create a new EXTTEXTOUTA record.  static **EMF::METARECORD** \* **new\_exttextoutw** (**DATASTREAM** &ds)\
 Create a new EXTTEXTOUTW record.  static **EMF::METARECORD** \* **new\_setpixelv** (**DATASTREAM** &ds)\
 Create a new SETPIXELV record.  static **EMF::METARECORD** \* **new\_createpen** (**DATASTREAM** &ds)\
 Create a new CREATEPEN record.  static **EMF::METARECORD** \* **new\_extcreatepen** (**DATASTREAM** &ds)\
 Create a new EXTCREATEPEN record.  static **EMF::METARECORD** \* **new\_createbrushindirect** (**DATASTREAM** &ds)\
 Create a new CREATEBRUSHINDIRECT record.  static **EMF::METARECORD** \* **new\_extcreatefontindirectw** (**DATASTREAM** &ds)\
 Create a new EXTCREATEFONTINDIRECTW record.  static **EMF::METARECORD** \* **new\_fillpath** (**DATASTREAM** &ds)\
 Create a new FILLPATH record.  static **EMF::METARECORD** \* **new\_strokepath** (**DATASTREAM** &ds)\
 Create a new STROKEPATH record.  static **EMF::METARECORD** \* **new\_strokeandfillpath** (**DATASTREAM** &ds)\
 Create a new STROKEANDFILLPATH record.  static **EMF::METARECORD** \* **new\_beginpath** (**DATASTREAM** &ds)\
 Create a new BEGINPATH record.  static **EMF::METARECORD** \* **new\_endpath** (**DATASTREAM** &ds)\
 Create a new ENDPATH record.  static **EMF::METARECORD** \* **new\_closefigure** (**DATASTREAM** &ds)\
 Create a new CLOSEFIGURE record.  static **EMF::METARECORD** \* **new\_savedc** (**DATASTREAM** &ds)\
 Create a new SAVEDC record.  static **EMF::METARECORD** \* **new\_restoredc** (**DATASTREAM** &ds)\
 Create a new RESTOREDC record.  static **EMF::METARECORD** \* **new\_setmetargn** (**DATASTREAM** &ds)\
 Create a new SETMETARGN record.  static **EMF::METARECORD** \* **new\_setmiterlimit** (**DATASTREAM** &ds)\
 Create a new SETMITERLIMIT record.

## Detailed Description

Stores all the objects in a single database within a process.

## Member Function Documentation

### HGDIOBJ EMF::GLOBALOBJECTS::add (OBJECT \* object)

Add an object to the global vector. The object's handle is simply its index in the global object vector, which is computed by the very interesting 'difference between two iterators' method.

**Parameters**

*object* pointer to a real instance of an object, not its handle.

### auto EMF::GLOBALOBJECTS::begin (void) const` [inline]`

**Returns**

an iterator pointing to the first global object.

### auto EMF::GLOBALOBJECTS::end (void) const` [inline]`

**Returns**

an iterator pointing to (one past) the final global object.

### OBJECT \* EMF::GLOBALOBJECTS::find (const HGDIOBJ handle)

Look up a object by handle in the global object vector. Note: Stock objects (like a gray brush or the black pen) have their high order bit set, so this has to be masked out when using their handles.

**Parameters**

*handle* the object's handle.

**Returns**

pointer to object.

### METARECORDCTOR EMF::GLOBALOBJECTS::newRecord (DWORD iType) const

See if we have a constructor for a record of the given type.

**Parameters**

*iType* metarecord type.

**Returns**

pointer to 'virtual' constructor.

### void EMF::GLOBALOBJECTS::remove (const OBJECT \* object)

A call to the metafile function DeleteObject() allows a particular object's handle to be reused, so some care has to be taken to erase it.

**Parameters**

*object* pointer to object to delete.

## Author

Generated automatically by Doxygen for libemf from the source code.
