From 04776464b0bb48f32dd3483237371562c1fbe863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bl=C3=A4sing?= Date: Sat, 21 Oct 2023 12:00:14 +0200 Subject: [PATCH] Move child structure definitions to the end of the structure definition --- .../com/sun/jna/platform/win32/WinGDI.java | 191 +++++++++--------- 1 file changed, 96 insertions(+), 95 deletions(-) diff --git a/contrib/platform/src/com/sun/jna/platform/win32/WinGDI.java b/contrib/platform/src/com/sun/jna/platform/win32/WinGDI.java index ce52777e4..a4683a735 100644 --- a/contrib/platform/src/com/sun/jna/platform/win32/WinGDI.java +++ b/contrib/platform/src/com/sun/jna/platform/win32/WinGDI.java @@ -191,8 +191,104 @@ public static class ByReference extends DEVMODE implements Structure.ByReference * For printers: This member is not used for printers. */ public int dmPelsHeight; + public DUMMYUNIONNAME2 dummyunionname2; + /** + * For displays: Specifies the frequency, in hertz (cycles per second), of the display device in a particular + * mode. This value is also known as the display device's vertical refresh rate. Display drivers use this + * member. It is used, for example, in the ChangeDisplaySettings function. + * + * When you call the EnumDisplaySettings function, the dmDisplayFrequency member may + * return with the value 0 or 1. These values represent the display hardware's default refresh rate. This + * default rate is typically set by switches on a display card or computer motherboard, or by a configuration + * program that does not use display functions such as ChangeDisplaySettings. + * + * For printers: This member is not used for printers. + */ + public int dmDisplayFrequency; + + /** + * For printers: Specifies how ICM (image color management) is handled. For a non-ICM application, this member determines + * if ICM is enabled or disabled. For ICM applications, the system examines this member to determine how to + * handle ICM support. This member can be one of the predefined DMICMMETHOD_XXXvalues, or a driver-defined value + * greater than or equal to the value of DMICMMETHOD_USER. + * + * The printer driver must provide a user interface for setting this member. Most printer drivers support only + * the DMICMMETHOD_SYSTEM or DMICMMETHOD_NONE value. Drivers for PostScript printers + * support all DCMICMMETHOD_XXXvalues. + * + * For displays: This member is not used for displays. + */ + public int dmICMMethod; + + /** + * For printers: Specifies which color matching method, or intent, should be used by default. This member is primarily for + * non-ICM applications. ICM applications can establish intents by using the ICM functions. This member can be + * one of the following predefined values, or a driver defined value greater than or equal to the value of + * DMICM_USER. + * + * For displays: This member is not used for displays. + */ + public int dmICMIntent; + + /** + * For printers: Specifies the type of media being printed on. The member can be one of the predefined + * DMMEDIA_XXX values, or a driver-defined value greater than or equal to the value of DMMEDIA_USER. + * + * To retrieve a list of the available media types for a printer, use the DeviceCapabilities + * function with the DC_MEDIATYPES flag. + * + * For displays: This member is not used for displays. + */ + public int dmMediaType; + + /** + * For printers: Specifies how dithering is to be done. The member can be one of the predefined + * DMDITHER_XXX values, or a driver-defined value greater than or equal to the value of + * DMDITHER_USER. + * + * For displays: This member is not used for displays. + */ + public int dmDitherType; + + /** + * Not used; must be zero. + */ + public int dmReserved1; + + /** + * Not used; must be zero. + */ + public int dmReserved2; + + /** + * This member must be zero. + */ + public int dmPanningWidth; + + /** + * This member must be zero. + */ + public int dmPanningHeight; + + /** + * Converts dmDeviceName from raw byte[] to String + */ + public String getDmDeviceName() { + int offset = fieldOffset("dmDeviceName"); + return CHAR_WIDTH == 1 ? getPointer().getString(offset) : getPointer().getWideString(offset); + } + + /** + * Converts dmFormName from raw byte[] to String + */ + public String getDmFormName() { + int offset = fieldOffset("dmFormName"); + return CHAR_WIDTH == 1 ? getPointer().getString(offset) : getPointer().getWideString(offset); + } + + public static class DUMMYUNIONNAME extends Union { public DUMMYSTRUCTNAME dummystructname; @@ -353,101 +449,6 @@ public static class DUMMYUNIONNAME2 extends Union { */ public int dmNup; } - - - /** - * For displays: Specifies the frequency, in hertz (cycles per second), of the display device in a particular - * mode. This value is also known as the display device's vertical refresh rate. Display drivers use this - * member. It is used, for example, in the ChangeDisplaySettings function. - * - * When you call the EnumDisplaySettings function, the dmDisplayFrequency member may - * return with the value 0 or 1. These values represent the display hardware's default refresh rate. This - * default rate is typically set by switches on a display card or computer motherboard, or by a configuration - * program that does not use display functions such as ChangeDisplaySettings. - * - * For printers: This member is not used for printers. - */ - public int dmDisplayFrequency; - - /** - * For printers: Specifies how ICM (image color management) is handled. For a non-ICM application, this member determines - * if ICM is enabled or disabled. For ICM applications, the system examines this member to determine how to - * handle ICM support. This member can be one of the predefined DMICMMETHOD_XXXvalues, or a driver-defined value - * greater than or equal to the value of DMICMMETHOD_USER. - * - * The printer driver must provide a user interface for setting this member. Most printer drivers support only - * the DMICMMETHOD_SYSTEM or DMICMMETHOD_NONE value. Drivers for PostScript printers - * support all DCMICMMETHOD_XXXvalues. - * - * For displays: This member is not used for displays. - */ - public int dmICMMethod; - - /** - * For printers: Specifies which color matching method, or intent, should be used by default. This member is primarily for - * non-ICM applications. ICM applications can establish intents by using the ICM functions. This member can be - * one of the following predefined values, or a driver defined value greater than or equal to the value of - * DMICM_USER. - * - * For displays: This member is not used for displays. - */ - public int dmICMIntent; - - /** - * For printers: Specifies the type of media being printed on. The member can be one of the predefined - * DMMEDIA_XXX values, or a driver-defined value greater than or equal to the value of DMMEDIA_USER. - * - * To retrieve a list of the available media types for a printer, use the DeviceCapabilities - * function with the DC_MEDIATYPES flag. - * - * For displays: This member is not used for displays. - */ - public int dmMediaType; - - /** - * For printers: Specifies how dithering is to be done. The member can be one of the predefined - * DMDITHER_XXX values, or a driver-defined value greater than or equal to the value of - * DMDITHER_USER. - * - * For displays: This member is not used for displays. - */ - public int dmDitherType; - - /** - * Not used; must be zero. - */ - public int dmReserved1; - - /** - * Not used; must be zero. - */ - public int dmReserved2; - - /** - * This member must be zero. - */ - public int dmPanningWidth; - - /** - * This member must be zero. - */ - public int dmPanningHeight; - - /** - * Converts dmDeviceName from raw byte[] to String - */ - public String getDmDeviceName() { - int offset = fieldOffset("dmDeviceName"); - return CHAR_WIDTH == 1 ? getPointer().getString(offset) : getPointer().getWideString(offset); - } - - /** - * Converts dmFormName from raw byte[] to String - */ - public String getDmFormName() { - int offset = fieldOffset("dmFormName"); - return CHAR_WIDTH == 1 ? getPointer().getString(offset) : getPointer().getWideString(offset); - } } @FieldOrder({"dwSize", "iType", "nCount", "nRgnSize", "rcBound"})