3.7 Toolkit Datastructure DM_ToolkitDataArgs

This structure can be passed as data parameter to the function DM_GetToolkitDataEx. It serves as a means of communication in both directions and allows the transfer and return of different value types. DM_TKAM_* defines in the argmask field of the structure linked with logical OR serve as marker for a set value.

The argmask field must be initialized before calling DM_GetToolkitDataEx.

The DM_Rectangle structure is an auxiliary structure for the coordinates and size of a rectangular object shape.

typedef struct {

DM_Int4 x;

DM_Int4 y;

DM_UInt4 width;

DM_UInt4 height;

} DM_Rectangle;

 

/*

** T O O L K I T A R G U M E N T S

**

** Extend the DM_GetToolkitData() and DM_SetToolkitData() functions

** with additional calling informationen and output data.

*/

#define DM_TKAM_index (1 << 0)

#define DM_TKAM_data (1 << 1)

#define DM_TKAM_handle (1 << 2)

#define DM_TKAM_widget (1 << 3)

#define DM_TKAM_rectangle (1 << 4)

#define DM_TKAM_tile (1 << 5)

#define DM_TKAM_dpi (1 << 6)

#define DM_TKAM_scaledpi (1 << 7)

#define DM_TKAM_tile_req (1 << 8)

 

typedef struct {

DM_UInt4 argmask;

DM_Value index;

DM_Value data;

#if defined(WSIWIN) || defined(WIN32)

HANDLE handle;

#endif

# if defined(MOTIF) || defined(QT)

# ifdef _XtIntrinsic_h

Widget widget;

# else

DM_Pointer widget;

# endif

#endif

DM_Rectangle rectangle;

 

/* structure members for DM_TKAM_tile */

struct {

DM_UInt2 gfxtype; /* the specific DM_GFX picture type */

#if defined(WSIWIN) || defined(WIN32)

DM_UInt2 datatype;

union {

struct {

HANDLE data;

HBITMAP mask;

HPALETTE palette;

};

LPUNKNOWN iunk;

};

#endif

#if defined(QT)

DM_Pointer pixmap;

#endif

#if defined(MOTIF)

# ifdef _X11_XLIB_H_

XImage* ximage;

# else

DM_Pointer ximage;

# endif

# ifdef X_H

Pixmap pixmap;

Pixmap trans_mask;

# else

DM_Pointer pixmap;

DM_Pointer trans_mask;

# endif

#endif

DM_UInt dpi;

} tile;

 

/* structure members for DM_TKAM_dpi */

DM_UInt dpi;

/* structure members for DM_TKAM_scaledpi */

struct {

DM_UInt dpi;

DM_UInt factor; /* in percent */

} scale;

 

/* structure member for DM_TKAM_tile_reqtype */

DM_UInt2 tile_req; /* the possible DM_GFX picture types (bitwise or'ed) */

} DM_ToolkitDataArgs;

Meaning of elements

DM_UInt4 argmask

Input/Output: Must be initialized before the call. If fields are used as input, then the corresponding bits must be set. DM_GetToolkitDataEx fills in fields of this structure depending on the queried attribute and adds the corresponding bits to the "argmask". In the following list the corresponding bit is listed in brackets behind the field.

DM_Value index

Input: Index of a table cell

Bits: DM_TKAM_index

DM_Value data

Output: DM_ID and data type of an IDM object.

Bits: DM_TKAM_widget, DM_TKAM_widget

DM_Rectangle rectangle

Output: coordinates and size of a rectangular object shape or width and height of an image - depending on the argmask set.

Bits: DM_TKAM_rectangle, DM_TKAM_tile

DM_UInt2 tile.gfxtype

Output: Set to the GFX Type that fits best.

Bits: DM_TKAM_tile

DM_UInt tile.dpi

Output: The DPI value for which the images loaded by the IDM were designed.

Bits: DM_TKAM_tile

DM_UInt dpi

Output: The standard DPI value of the system (mostly 96). (Microsoft Windows: see below)

Bits: DM_TKAM_dpi, DM_TKAM_tile

int scale.dpi

Output: The DPI value set by the system according to the set scaling. (Microsoft Windows: see below)

Bits: DM_TKAM_scaledpi, DM_TKAM_tile

int scale.factor

Output: system scale factor (Microsoft Windows: see below)

Bits: DM_TKAM_scaledpi, DM_TKAM_tile

DM_UInt2 tile_req

Input: Desired data type when querying a tile resource.

Bit: DM_TKAM_tile_reqtype

3.7.1 Specific structure elements for Microsoft Windows

The parameters specific to the Microsoft Windows window system are defined as follows:

HANDLE handle

Input: Depending on the queried attribute, a Microsoft Windows handle can be set here as an additional input parameter.

Bits: DM_TKAM_handle

DM_UInt2 tile.gfxtype

Output: Is set to the GFX type that is returned. Possible values are:

- DM_GFX_BMP: GDI Bitmap Handle (HBITMAP) in "tile.data"
- DM_GFX_WMF: GDI Metafile Handle (HMETAFILE) in "tile.data"
- DM_GFX_EMF: GDI Enhanced Metafile Handle (HENHMETAFILE) in "tile.data"
- DM_GFX_ICO: GDI Icon Handle (HICON) in "tile.data"
- DM_GFX_D2D1BMP: Direct2D Bitmap (ID2D1Bitmap *) in "tile.iunk"
- DM_GFX_D2D1SVG: Direct2D SVG Document (ID2D1SvgDocument *) in "tile.iunk"
- DM_GFX_D2D1EMF: Direct2D Metafile (ID2D1GdiMetafile *) in "tile.iunk"

Bits: DM_TKAM_tile

DM_UInt2 tile.datatype

Output: Setting to “DMF_TlkData*”” type that is returned. Possible values are:

- DMF_TlkDataIsIcon: Microsoft Windows Icon Handle in "tile.data"
- DMF_TlkDataIsWMF: Microsoft Windows Metafile Handle in "tile.data"
- DMF_TlkDataIsEMF: Microsoft Windows Enhanced Metafile Handle in "tile.data"
- DMF_TlkDataIsD2D1Bmp: Microsoft Direct2D Bitmap (ID2D1Bitmap *) in "tile.iunk"
- DMF_TlkDataIsD2D1SVG: Microsoft Direct2D SVG Documnet (ID2D1SvgDocument *)
in "tile.iunk"
- DMF_TlkDataIsD2D1EMF: Microsoft Direct2D Metafile (ID2D1GdiMetafile *) in "tile.iunk"
- sonst: Microsoft-Windows Bitmap Handle in "tile.data"

Bits: DM_TKAM_tile

HANDLE tile.data

Output: Set to the data, the exact type depends on tile.gfxtype or tile.datatype:

  • HICON: if DM_GFX_ICO resp. DMF_TlkDataIsIcon

  • HBITMAP: if DM_GFX_BMP resp. 0

  • HMETAFILE: if DM_GFX_WMF resp. DMF_TlkDataIsWMF

  • HENHMETAFILE: if DM_GFX_EMF resp. DMF_TlkDataIsEMF

Bits: DM_TKAM_tile

HBITMAP tile.mask

Output: Set to the monochrome mask if one exists. This can only occur with DM_GFX_BMP.

Bits: DM_TKAM_tile

HPALETTE tile.palette

A output: Set to the color palette if one is available.

Bits: DM_TKAM_tile

LPUNKNOWN tile.iunk

Output: The Microsoft Direct2D interface pointer may be stored in this element.

Bits: DM_TKAM_tile

DM_UInt dpi

Output: Set to the Microsoft Windows default DPI value. This is the value that applications that are DPI Unaware use. This value is defined by Microsoft Windows as a constant USER_DEFAULT_SCREEN_DPI (value: 96).

The IDM also uses this value for its pixel coordinates.

Bits: DM_TKAM_dpi, DM_TKAM_tile

int scale.dpi

Output: Set to the current DPI value of the object. If the AT_DPI attribute is queried, the return value of DM_GetToolkitDataEx and this value are identical. This value is dynamic for IDM for Windows 11 if the application is DPI Aware. Otherwise, DPI Unaware or IDM for Windows 10, the value is fixed at 96.

Bits: DM_TKAM_scaledpi, DM_TKAM_tile

int scale.factor

Output: Integer percentage value calculated from scale.dpi and dpi.)

Bits: DM_TKAM_scaledpi, DM_TKAM_tile

DM_UInt2 tile_req

Input: Used to obtain a specific data type when querying a tile resource.
The following values are available:

- DM_GFX_BMP: GDI Bitmap Handle (HBITMAP)
- DM_GFX_WMF: GDI Metafile Handle (HMETAFILE)
- DM_GFX_EMF: GDI Enhanced Metafile Handle (HENHMETAFILE)
- DM_GFX_ICO: GDI Icon Handle (HICON)
- DM_GFX_D2D1BMP: Direct2D Bitmap (ID2D1Bitmap *)
- DM_GFX_D2D1SVG: Direct2D SVG Documnet (ID2D1SvgDocument *)
- DM_GFX_D2D1EMF: Direct2D Metafile (ID2D1GdiMetafile *)

These data types can be specified linked with “bitwise or”. The value DM_GFX_BMP is preselected as a fallback.

Bits: DM_TKAM_tile_req

3.7.2 Specific structure elements for Qt

The parameters specific to the QT window system are defined as follows:

DM_Pointer widget

Input: Depending on the queried attribute, a QWidget can be set here as an additional input parameter.

Bits: DM_TKAM_widget

DM_Pointer tile.pixmap

Output: Set to the QPixmap of the tile. Data type in tile.gfxtype is always DM_GFX_QPIXMAP.

Bits: DM_TKAM_tile

3.7.3 Specific structure elements for Motif

The parameters specific to the Motif window system are defined as follows:

Widget/ DM_Pointer widget

Input: Depending on the queried attribute, an XWidget can be set here as an additional input parameter.

Bits: DM_TKAM_widget

XImage*/ DM_Pointer tile.ximage

Output: complete image information as XImage, if tile.gfxtype = DM_GFX_XIMAGE

Bits: DM_TKAM_tile

Pixmap/DM_Pointer tile.pixmap

Output: image information as pixmap, if tile.gfxtype = DM_GFX_PIXMAP

Bits: DM_TKAM_tile

Pixmap/DM_Pointer tile.trans_mask

Output: the transparency clipmask associated with the image information in tile.pixmap if tile.gfxtype = DM_GFX_PIXMAP

Bits: DM_TKAM_tile