Class DEVMODE

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class DEVMODE extends Struct<DEVMODE> implements NativeResource

 struct DEVMODE {
     TCHAR dmDeviceName[32];
     WORD dmSpecVersion;
     WORD dmDriverVersion;
     WORD dmSize;
     WORD dmDriverExtra;
     DWORD dmFields;
     union {
         struct {
             short dmOrientation;
             short dmPaperSize;
             short dmPaperLength;
             short dmPaperWidth;
             short dmScale;
             short dmCopies;
             short dmDefaultSource;
             short dmPrintQuality;
         };
         struct {
             {@link POINTL POINTL} dmPosition;
             DWORD dmDisplayOrientation;
             DWORD dmDisplayFixedOutput;
         };
     };
     short dmColor;
     short dmDuplex;
     short dmYResolution;
     short dmTTOption;
     short dmCollate;
     TCHAR dmFormName[32];
     WORD dmLogPixels;
     DWORD dmBitsPerPel;
     DWORD dmPelsWidth;
     DWORD dmPelsHeight;
     union {
         DWORD dmDisplayFlags;
         DWORD dmNup;
     };
     DWORD dmDisplayFrequency;
     DWORD dmICMMethod;
     DWORD dmICMIntent;
     DWORD dmMediaType;
     DWORD dmDitherType;
     DWORD dmReserved1;
     DWORD dmReserved2;
     DWORD dmPanningWidth;
     DWORD dmPanningHeight;
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • DMDEVICENAME

      public static final int DMDEVICENAME
      The struct member offsets.
    • DMSPECVERSION

      public static final int DMSPECVERSION
      The struct member offsets.
    • DMDRIVERVERSION

      public static final int DMDRIVERVERSION
      The struct member offsets.
    • DMSIZE

      public static final int DMSIZE
      The struct member offsets.
    • DMDRIVEREXTRA

      public static final int DMDRIVEREXTRA
      The struct member offsets.
    • DMFIELDS

      public static final int DMFIELDS
      The struct member offsets.
    • DMORIENTATION

      public static final int DMORIENTATION
      The struct member offsets.
    • DMPAPERSIZE

      public static final int DMPAPERSIZE
      The struct member offsets.
    • DMPAPERLENGTH

      public static final int DMPAPERLENGTH
      The struct member offsets.
    • DMPAPERWIDTH

      public static final int DMPAPERWIDTH
      The struct member offsets.
    • DMSCALE

      public static final int DMSCALE
      The struct member offsets.
    • DMCOPIES

      public static final int DMCOPIES
      The struct member offsets.
    • DMDEFAULTSOURCE

      public static final int DMDEFAULTSOURCE
      The struct member offsets.
    • DMPRINTQUALITY

      public static final int DMPRINTQUALITY
      The struct member offsets.
    • DMPOSITION

      public static final int DMPOSITION
      The struct member offsets.
    • DMDISPLAYORIENTATION

      public static final int DMDISPLAYORIENTATION
      The struct member offsets.
    • DMDISPLAYFIXEDOUTPUT

      public static final int DMDISPLAYFIXEDOUTPUT
      The struct member offsets.
    • DMCOLOR

      public static final int DMCOLOR
      The struct member offsets.
    • DMDUPLEX

      public static final int DMDUPLEX
      The struct member offsets.
    • DMYRESOLUTION

      public static final int DMYRESOLUTION
      The struct member offsets.
    • DMTTOPTION

      public static final int DMTTOPTION
      The struct member offsets.
    • DMCOLLATE

      public static final int DMCOLLATE
      The struct member offsets.
    • DMFORMNAME

      public static final int DMFORMNAME
      The struct member offsets.
    • DMLOGPIXELS

      public static final int DMLOGPIXELS
      The struct member offsets.
    • DMBITSPERPEL

      public static final int DMBITSPERPEL
      The struct member offsets.
    • DMPELSWIDTH

      public static final int DMPELSWIDTH
      The struct member offsets.
    • DMPELSHEIGHT

      public static final int DMPELSHEIGHT
      The struct member offsets.
    • DMDISPLAYFLAGS

      public static final int DMDISPLAYFLAGS
      The struct member offsets.
    • DMNUP

      public static final int DMNUP
      The struct member offsets.
    • DMDISPLAYFREQUENCY

      public static final int DMDISPLAYFREQUENCY
      The struct member offsets.
    • DMICMMETHOD

      public static final int DMICMMETHOD
      The struct member offsets.
    • DMICMINTENT

      public static final int DMICMINTENT
      The struct member offsets.
    • DMMEDIATYPE

      public static final int DMMEDIATYPE
      The struct member offsets.
    • DMDITHERTYPE

      public static final int DMDITHERTYPE
      The struct member offsets.
    • DMRESERVED1

      public static final int DMRESERVED1
      The struct member offsets.
    • DMRESERVED2

      public static final int DMRESERVED2
      The struct member offsets.
    • DMPANNINGWIDTH

      public static final int DMPANNINGWIDTH
      The struct member offsets.
    • DMPANNINGHEIGHT

      public static final int DMPANNINGHEIGHT
      The struct member offsets.
  • Constructor Details

    • DEVMODE

      public DEVMODE(ByteBuffer container)
      Creates a DEVMODE instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<DEVMODE>
    • dmDeviceName

      public ByteBuffer dmDeviceName()
      Returns:
      a ByteBuffer view of the dmDeviceName field.
    • dmDeviceNameString

      public String dmDeviceNameString()
      Returns:
      the null-terminated string stored in the dmDeviceName field.
    • dmSpecVersion

      public short dmSpecVersion()
      Returns:
      the value of the dmSpecVersion field.
    • dmDriverVersion

      public short dmDriverVersion()
      Returns:
      the value of the dmDriverVersion field.
    • dmSize

      public short dmSize()
      Returns:
      the value of the dmSize field.
    • dmDriverExtra

      public short dmDriverExtra()
      Returns:
      the value of the dmDriverExtra field.
    • dmFields

      public int dmFields()
      Returns:
      the value of the dmFields field.
    • dmOrientation

      public short dmOrientation()
      Returns:
      the value of the dmOrientation field.
    • dmPaperSize

      public short dmPaperSize()
      Returns:
      the value of the dmPaperSize field.
    • dmPaperLength

      public short dmPaperLength()
      Returns:
      the value of the dmPaperLength field.
    • dmPaperWidth

      public short dmPaperWidth()
      Returns:
      the value of the dmPaperWidth field.
    • dmScale

      public short dmScale()
      Returns:
      the value of the dmScale field.
    • dmCopies

      public short dmCopies()
      Returns:
      the value of the dmCopies field.
    • dmDefaultSource

      public short dmDefaultSource()
      Returns:
      the value of the dmDefaultSource field.
    • dmPrintQuality

      public short dmPrintQuality()
      Returns:
      the value of the dmPrintQuality field.
    • dmPosition

      public POINTL dmPosition()
      Returns:
      a POINTL view of the dmPosition field.
    • dmDisplayOrientation

      public int dmDisplayOrientation()
      Returns:
      the value of the dmDisplayOrientation field.
    • dmDisplayFixedOutput

      public int dmDisplayFixedOutput()
      Returns:
      the value of the dmDisplayFixedOutput field.
    • dmColor

      public short dmColor()
      Returns:
      the value of the dmColor field.
    • dmDuplex

      public short dmDuplex()
      Returns:
      the value of the dmDuplex field.
    • dmYResolution

      public short dmYResolution()
      Returns:
      the value of the dmYResolution field.
    • dmTTOption

      public short dmTTOption()
      Returns:
      the value of the dmTTOption field.
    • dmCollate

      public short dmCollate()
      Returns:
      the value of the dmCollate field.
    • dmFormName

      public ByteBuffer dmFormName()
      Returns:
      a ByteBuffer view of the dmFormName field.
    • dmFormNameString

      public String dmFormNameString()
      Returns:
      the null-terminated string stored in the dmFormName field.
    • dmLogPixels

      public short dmLogPixels()
      Returns:
      the value of the dmLogPixels field.
    • dmBitsPerPel

      public int dmBitsPerPel()
      Returns:
      the value of the dmBitsPerPel field.
    • dmPelsWidth

      public int dmPelsWidth()
      Returns:
      the value of the dmPelsWidth field.
    • dmPelsHeight

      public int dmPelsHeight()
      Returns:
      the value of the dmPelsHeight field.
    • dmDisplayFlags

      public int dmDisplayFlags()
      Returns:
      the value of the dmDisplayFlags field.
    • dmNup

      public int dmNup()
      Returns:
      the value of the dmNup field.
    • dmDisplayFrequency

      public int dmDisplayFrequency()
      Returns:
      the value of the dmDisplayFrequency field.
    • dmICMMethod

      public int dmICMMethod()
      Returns:
      the value of the dmICMMethod field.
    • dmICMIntent

      public int dmICMIntent()
      Returns:
      the value of the dmICMIntent field.
    • dmMediaType

      public int dmMediaType()
      Returns:
      the value of the dmMediaType field.
    • dmDitherType

      public int dmDitherType()
      Returns:
      the value of the dmDitherType field.
    • dmReserved1

      public int dmReserved1()
      Returns:
      the value of the dmReserved1 field.
    • dmReserved2

      public int dmReserved2()
      Returns:
      the value of the dmReserved2 field.
    • dmPanningWidth

      public int dmPanningWidth()
      Returns:
      the value of the dmPanningWidth field.
    • dmPanningHeight

      public int dmPanningHeight()
      Returns:
      the value of the dmPanningHeight field.
    • dmSpecVersion

      public DEVMODE dmSpecVersion(short value)
      Sets the specified value to the dmSpecVersion field.
    • dmSize

      public DEVMODE dmSize(short value)
      Sets the specified value to the dmSize field.
    • dmDriverExtra

      public DEVMODE dmDriverExtra(short value)
      Sets the specified value to the dmDriverExtra field.
    • set

      public DEVMODE set(DEVMODE src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static DEVMODE malloc()
      Returns a new DEVMODE instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static DEVMODE calloc()
      Returns a new DEVMODE instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static DEVMODE create()
      Returns a new DEVMODE instance allocated with BufferUtils.
    • create

      public static DEVMODE create(long address)
      Returns a new DEVMODE instance for the specified memory address.
    • createSafe

      public static @Nullable DEVMODE createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static DEVMODE.Buffer malloc(int capacity)
      Returns a new DEVMODE.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static DEVMODE.Buffer calloc(int capacity)
      Returns a new DEVMODE.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static DEVMODE.Buffer create(int capacity)
      Returns a new DEVMODE.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static DEVMODE.Buffer create(long address, int capacity)
      Create a DEVMODE.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable DEVMODE.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • mallocStack

      @Deprecated public static DEVMODE mallocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static DEVMODE callocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static DEVMODE mallocStack(MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static DEVMODE callocStack(MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static DEVMODE.Buffer mallocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static DEVMODE.Buffer callocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • mallocStack

      @Deprecated public static DEVMODE.Buffer mallocStack(int capacity, MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static DEVMODE.Buffer callocStack(int capacity, MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • malloc

      public static DEVMODE malloc(MemoryStack stack)
      Returns a new DEVMODE instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static DEVMODE calloc(MemoryStack stack)
      Returns a new DEVMODE instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static DEVMODE.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new DEVMODE.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static DEVMODE.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new DEVMODE.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • ndmDeviceName

      public static ByteBuffer ndmDeviceName(long struct)
      Unsafe version of dmDeviceName().
    • ndmDeviceNameString

      public static String ndmDeviceNameString(long struct)
      Unsafe version of dmDeviceNameString().
    • ndmSpecVersion

      public static short ndmSpecVersion(long struct)
      Unsafe version of dmSpecVersion().
    • ndmDriverVersion

      public static short ndmDriverVersion(long struct)
      Unsafe version of dmDriverVersion().
    • ndmSize

      public static short ndmSize(long struct)
      Unsafe version of dmSize().
    • ndmDriverExtra

      public static short ndmDriverExtra(long struct)
      Unsafe version of dmDriverExtra().
    • ndmFields

      public static int ndmFields(long struct)
      Unsafe version of dmFields().
    • ndmOrientation

      public static short ndmOrientation(long struct)
      Unsafe version of dmOrientation().
    • ndmPaperSize

      public static short ndmPaperSize(long struct)
      Unsafe version of dmPaperSize().
    • ndmPaperLength

      public static short ndmPaperLength(long struct)
      Unsafe version of dmPaperLength().
    • ndmPaperWidth

      public static short ndmPaperWidth(long struct)
      Unsafe version of dmPaperWidth().
    • ndmScale

      public static short ndmScale(long struct)
      Unsafe version of dmScale().
    • ndmCopies

      public static short ndmCopies(long struct)
      Unsafe version of dmCopies().
    • ndmDefaultSource

      public static short ndmDefaultSource(long struct)
      Unsafe version of dmDefaultSource().
    • ndmPrintQuality

      public static short ndmPrintQuality(long struct)
      Unsafe version of dmPrintQuality().
    • ndmPosition

      public static POINTL ndmPosition(long struct)
      Unsafe version of dmPosition().
    • ndmDisplayOrientation

      public static int ndmDisplayOrientation(long struct)
      Unsafe version of dmDisplayOrientation().
    • ndmDisplayFixedOutput

      public static int ndmDisplayFixedOutput(long struct)
      Unsafe version of dmDisplayFixedOutput().
    • ndmColor

      public static short ndmColor(long struct)
      Unsafe version of dmColor().
    • ndmDuplex

      public static short ndmDuplex(long struct)
      Unsafe version of dmDuplex().
    • ndmYResolution

      public static short ndmYResolution(long struct)
      Unsafe version of dmYResolution().
    • ndmTTOption

      public static short ndmTTOption(long struct)
      Unsafe version of dmTTOption().
    • ndmCollate

      public static short ndmCollate(long struct)
      Unsafe version of dmCollate().
    • ndmFormName

      public static ByteBuffer ndmFormName(long struct)
      Unsafe version of dmFormName().
    • ndmFormNameString

      public static String ndmFormNameString(long struct)
      Unsafe version of dmFormNameString().
    • ndmLogPixels

      public static short ndmLogPixels(long struct)
      Unsafe version of dmLogPixels().
    • ndmBitsPerPel

      public static int ndmBitsPerPel(long struct)
      Unsafe version of dmBitsPerPel().
    • ndmPelsWidth

      public static int ndmPelsWidth(long struct)
      Unsafe version of dmPelsWidth().
    • ndmPelsHeight

      public static int ndmPelsHeight(long struct)
      Unsafe version of dmPelsHeight().
    • ndmDisplayFlags

      public static int ndmDisplayFlags(long struct)
      Unsafe version of dmDisplayFlags().
    • ndmNup

      public static int ndmNup(long struct)
      Unsafe version of dmNup().
    • ndmDisplayFrequency

      public static int ndmDisplayFrequency(long struct)
      Unsafe version of dmDisplayFrequency().
    • ndmICMMethod

      public static int ndmICMMethod(long struct)
      Unsafe version of dmICMMethod().
    • ndmICMIntent

      public static int ndmICMIntent(long struct)
      Unsafe version of dmICMIntent().
    • ndmMediaType

      public static int ndmMediaType(long struct)
      Unsafe version of dmMediaType().
    • ndmDitherType

      public static int ndmDitherType(long struct)
      Unsafe version of dmDitherType().
    • ndmReserved1

      public static int ndmReserved1(long struct)
      Unsafe version of dmReserved1().
    • ndmReserved2

      public static int ndmReserved2(long struct)
      Unsafe version of dmReserved2().
    • ndmPanningWidth

      public static int ndmPanningWidth(long struct)
      Unsafe version of dmPanningWidth().
    • ndmPanningHeight

      public static int ndmPanningHeight(long struct)
      Unsafe version of dmPanningHeight().
    • ndmSpecVersion

      public static void ndmSpecVersion(long struct, short value)
      Unsafe version of dmSpecVersion.
    • ndmSize

      public static void ndmSize(long struct, short value)
      Unsafe version of dmSize.
    • ndmDriverExtra

      public static void ndmDriverExtra(long struct, short value)
      Unsafe version of dmDriverExtra.