Package org.lwjgl.system.windows
Class DEVMODE
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.system.windows.DEVMODE
-
- All Implemented Interfaces:
- java.lang.AutoCloseable, NativeResource, Pointer
public class DEVMODE extends Struct implements NativeResource
Contains information about the initialization and environment of a printer or a display device.Member documentation
dmDeviceName
– A zero-terminated character array that specifies the "friendly" name of the printer or display; for example, "PCL/HP LaserJet" in the case of PCL/HP LaserJet. This string is unique among device drivers. Note that this name may be truncated to fit in thedmDeviceName
array.dmSpecVersion
– the version number of the initialization data specification on which the structure is based. To ensure the correct version is used for any operating system, useGDI32.DM_SPECVERSION
.dmDriverVersion
– the driver version number assigned by the driver developerdmSize
– specifies the size, in bytes, of theDEVMODE
structure, not including any private driver-specific data that might follow the structure's public members. Set this member toDEVMODE.SIZEOF
to indicate the version of theDEVMODE
structure being used.dmDriverExtra
– contains the number of bytes of private driver-data that follow this structure. If a device driver does not use device-specific information, set this member to zero.dmFields
– specifies whether certain members of theDEVMODE
structure have been initialized. If a member is initialized, its corresponding bit is set otherwise the bit is clear. A driver supports only thoseDEVMODE
members that are appropriate for the printer or display technology.dmOrientation
– for printer devices onlydmPaperSize
– for printer devices onlydmPaperLength
– for printer devices onlydmPaperWidth
– for printer devices onlydmScale
– for printer devices onlydmCopies
– for printer devices onlydmDefaultSource
– for printer devices onlydmPrintQuality
– for printer devices onlydmPosition
– for display devices only, aPOINTL
structure that indicates the positional coordinates of the display device in reference to the desktop area. The primary display device is always located at coordinates (0,0).dmDisplayOrientation
– for display devices only, the orientation at which images should be presented. IfGDI32.DM_DISPLAYORIENTATION
is not set, this member must be zero. IfGDI32.DM_DISPLAYORIENTATION
is set, this member must be one of the following values:GDI32.DMDO_DEFAULT
,GDI32.DMDO_90
,GDI32.DMDO_180
,GDI32.DMDO_270
To determine whether the display orientation is portrait or landscape orientation, check the ratio of
dmPelsWidth
todmPelsHeight
.dmDisplayFixedOutput
– for fixed-resolution display devices only, how the display presents a low-resolution mode on a higher-resolution display. For example, if a display device's resolution is fixed at 1024 x 768 pixels but its mode is set to 640 x 480 pixels, the device can either display a 640 x 480 image somewhere in the interior of the 1024 x 768 screen space or stretch the 640 x 480 image to fill the larger screen space. IfGDI32.DM_DISPLAYFIXEDOUTPUT
is not set, this member must be zero. IfGDI32.DM_DISPLAYFIXEDOUTPUT
is set, this member must be one of the following values:GDI32.DMDFO_DEFAULT
,GDI32.DMDFO_CENTER
,GDI32.DMDFO_STRETCH
dmColor
– for printer devices onlydmDuplex
– for printer devices onlydmYResolution
– for printer devices onlydmTTOption
– for printer devices onlydmCollate
– for printer devices onlydmFormName
– for printer devices onlydmLogPixels
– the number of pixels per logical inchdmBitsPerPel
– specifies the color resolution, in bits per pixel, of the display device (for example: 4 bits for 16 colors, 8 bits for 256 colors, or 16 bits for 65,536 colors)dmPelsWidth
– specifies the width, in pixels, of the visible device surfacedmPelsHeight
– specifies the height, in pixels, of the visible device surfacedmDisplayFlags
– specifies the device's display mode, one or more of:GDI32.DM_INTERLACED
,GDI32.DMDISPLAYFLAGS_TEXTMODE
dmNup
– for printer devices onlydmDisplayFrequency
– 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.When you call the
User32.EnumDisplaySettingsEx(java.nio.ByteBuffer, int, org.lwjgl.system.windows.DEVMODE, int)
function, thedmDisplayFrequency
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 asChangeDisplaySettingsEx
.dmICMMethod
– for printer devices onlydmICMIntent
– for printer devices onlydmMediaType
– for printer devices onlydmDitherType
– for printer devices onlydmReserved1
– not used; must be zerodmReserved2
– not used; must be zerodmPanningWidth
– this member must be zerodmPanningHeight
– this member must be zero
Layout
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 {
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; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
DEVMODE.Buffer
An array ofDEVMODE
structs.-
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
-
Field Summary
Fields Modifier and Type Field and Description static int
SIZEOF
The struct size in bytes.-
Fields inherited from interface org.lwjgl.system.Pointer
POINTER_SHIFT, POINTER_SIZE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static DEVMODE
calloc()
static DEVMODE.Buffer
calloc(int capacity)
Returns a newDEVMODE.Buffer
instance allocated withmemCalloc
.static DEVMODE
callocStack()
Returns a newDEVMODE
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static DEVMODE.Buffer
callocStack(int capacity)
Returns a newDEVMODE.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static DEVMODE.Buffer
callocStack(int capacity, MemoryStack stack)
Returns a newDEVMODE.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static DEVMODE
callocStack(MemoryStack stack)
Returns a newDEVMODE
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static DEVMODE
create()
Returns a newDEVMODE
instance allocated withBufferUtils
.static DEVMODE.Buffer
create(int capacity)
Returns a newDEVMODE.Buffer
instance allocated withBufferUtils
.static DEVMODE
create(long address)
static DEVMODE.Buffer
create(long address, int capacity)
Create aDEVMODE.Buffer
instance at the specified memory.int
dmBitsPerPel()
Returns the value of thedmBitsPerPel
field.short
dmCollate()
Returns the value of thedmCollate
field.short
dmColor()
Returns the value of thedmColor
field.short
dmCopies()
Returns the value of thedmCopies
field.short
dmDefaultSource()
Returns the value of thedmDefaultSource
field.java.nio.ByteBuffer
dmDeviceName()
Returns aByteBuffer
view of thedmDeviceName
field.java.lang.String
dmDeviceNameString()
Decodes the null-terminated string stored in thedmDeviceName
field.int
dmDisplayFixedOutput()
Returns the value of thedmDisplayFixedOutput
field.int
dmDisplayFlags()
Returns the value of thedmDisplayFlags
field.int
dmDisplayFrequency()
Returns the value of thedmDisplayFrequency
field.int
dmDisplayOrientation()
Returns the value of thedmDisplayOrientation
field.int
dmDitherType()
Returns the value of thedmDitherType
field.short
dmDriverExtra()
Returns the value of thedmDriverExtra
field.DEVMODE
dmDriverExtra(short value)
Sets the specified value to thedmDriverExtra
field.short
dmDriverVersion()
Returns the value of thedmDriverVersion
field.short
dmDuplex()
Returns the value of thedmDuplex
field.int
dmFields()
Returns the value of thedmFields
field.java.nio.ByteBuffer
dmFormName()
Returns aByteBuffer
view of thedmFormName
field.java.lang.String
dmFormNameString()
Decodes the null-terminated string stored in thedmFormName
field.int
dmICMIntent()
Returns the value of thedmICMIntent
field.int
dmICMMethod()
Returns the value of thedmICMMethod
field.short
dmLogPixels()
Returns the value of thedmLogPixels
field.int
dmMediaType()
Returns the value of thedmMediaType
field.int
dmNup()
Returns the value of thedmNup
field.short
dmOrientation()
Returns the value of thedmOrientation
field.int
dmPanningHeight()
Returns the value of thedmPanningHeight
field.int
dmPanningWidth()
Returns the value of thedmPanningWidth
field.short
dmPaperLength()
Returns the value of thedmPaperLength
field.short
dmPaperSize()
Returns the value of thedmPaperSize
field.short
dmPaperWidth()
Returns the value of thedmPaperWidth
field.int
dmPelsHeight()
Returns the value of thedmPelsHeight
field.int
dmPelsWidth()
Returns the value of thedmPelsWidth
field.POINTL
dmPosition()
Returns aPOINTL
view of thedmPosition
field.short
dmPrintQuality()
Returns the value of thedmPrintQuality
field.int
dmReserved1()
Returns the value of thedmReserved1
field.int
dmReserved2()
Returns the value of thedmReserved2
field.short
dmScale()
Returns the value of thedmScale
field.short
dmSize()
Returns the value of thedmSize
field.DEVMODE
dmSize(short value)
Sets the specified value to thedmSize
field.short
dmSpecVersion()
Returns the value of thedmSpecVersion
field.DEVMODE
dmSpecVersion(short value)
Sets the specified value to thedmSpecVersion
field.short
dmTTOption()
Returns the value of thedmTTOption
field.short
dmYResolution()
Returns the value of thedmYResolution
field.static DEVMODE
malloc()
static DEVMODE.Buffer
malloc(int capacity)
Returns a newDEVMODE.Buffer
instance allocated withmemAlloc
.static DEVMODE
mallocStack()
Returns a newDEVMODE
instance allocated on the thread-localMemoryStack
.static DEVMODE.Buffer
mallocStack(int capacity)
Returns a newDEVMODE.Buffer
instance allocated on the thread-localMemoryStack
.static DEVMODE.Buffer
mallocStack(int capacity, MemoryStack stack)
Returns a newDEVMODE.Buffer
instance allocated on the specifiedMemoryStack
.static DEVMODE
mallocStack(MemoryStack stack)
Returns a newDEVMODE
instance allocated on the specifiedMemoryStack
.DEVMODE
set(DEVMODE src)
Copies the specified struct data to this struct.int
sizeof()
Returnssizeof(struct)
.-
Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
-
Methods inherited from interface org.lwjgl.system.NativeResource
close, free
-
-
-
-
Constructor Detail
-
DEVMODE
public DEVMODE(java.nio.ByteBuffer container)
Creates aDEVMODE
instance at the current position of the specifiedByteBuffer
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 Detail
-
sizeof
public int sizeof()
Description copied from class:Struct
Returnssizeof(struct)
.
-
dmDeviceName
public java.nio.ByteBuffer dmDeviceName()
Returns aByteBuffer
view of thedmDeviceName
field.
-
dmDeviceNameString
public java.lang.String dmDeviceNameString()
Decodes the null-terminated string stored in thedmDeviceName
field.
-
dmSpecVersion
public short dmSpecVersion()
Returns the value of thedmSpecVersion
field.
-
dmDriverVersion
public short dmDriverVersion()
Returns the value of thedmDriverVersion
field.
-
dmSize
public short dmSize()
Returns the value of thedmSize
field.
-
dmDriverExtra
public short dmDriverExtra()
Returns the value of thedmDriverExtra
field.
-
dmFields
public int dmFields()
Returns the value of thedmFields
field.
-
dmOrientation
public short dmOrientation()
Returns the value of thedmOrientation
field.
-
dmPaperSize
public short dmPaperSize()
Returns the value of thedmPaperSize
field.
-
dmPaperLength
public short dmPaperLength()
Returns the value of thedmPaperLength
field.
-
dmPaperWidth
public short dmPaperWidth()
Returns the value of thedmPaperWidth
field.
-
dmScale
public short dmScale()
Returns the value of thedmScale
field.
-
dmCopies
public short dmCopies()
Returns the value of thedmCopies
field.
-
dmDefaultSource
public short dmDefaultSource()
Returns the value of thedmDefaultSource
field.
-
dmPrintQuality
public short dmPrintQuality()
Returns the value of thedmPrintQuality
field.
-
dmDisplayOrientation
public int dmDisplayOrientation()
Returns the value of thedmDisplayOrientation
field.
-
dmDisplayFixedOutput
public int dmDisplayFixedOutput()
Returns the value of thedmDisplayFixedOutput
field.
-
dmColor
public short dmColor()
Returns the value of thedmColor
field.
-
dmDuplex
public short dmDuplex()
Returns the value of thedmDuplex
field.
-
dmYResolution
public short dmYResolution()
Returns the value of thedmYResolution
field.
-
dmTTOption
public short dmTTOption()
Returns the value of thedmTTOption
field.
-
dmCollate
public short dmCollate()
Returns the value of thedmCollate
field.
-
dmFormName
public java.nio.ByteBuffer dmFormName()
Returns aByteBuffer
view of thedmFormName
field.
-
dmFormNameString
public java.lang.String dmFormNameString()
Decodes the null-terminated string stored in thedmFormName
field.
-
dmLogPixels
public short dmLogPixels()
Returns the value of thedmLogPixels
field.
-
dmBitsPerPel
public int dmBitsPerPel()
Returns the value of thedmBitsPerPel
field.
-
dmPelsWidth
public int dmPelsWidth()
Returns the value of thedmPelsWidth
field.
-
dmPelsHeight
public int dmPelsHeight()
Returns the value of thedmPelsHeight
field.
-
dmDisplayFlags
public int dmDisplayFlags()
Returns the value of thedmDisplayFlags
field.
-
dmNup
public int dmNup()
Returns the value of thedmNup
field.
-
dmDisplayFrequency
public int dmDisplayFrequency()
Returns the value of thedmDisplayFrequency
field.
-
dmICMMethod
public int dmICMMethod()
Returns the value of thedmICMMethod
field.
-
dmICMIntent
public int dmICMIntent()
Returns the value of thedmICMIntent
field.
-
dmMediaType
public int dmMediaType()
Returns the value of thedmMediaType
field.
-
dmDitherType
public int dmDitherType()
Returns the value of thedmDitherType
field.
-
dmReserved1
public int dmReserved1()
Returns the value of thedmReserved1
field.
-
dmReserved2
public int dmReserved2()
Returns the value of thedmReserved2
field.
-
dmPanningWidth
public int dmPanningWidth()
Returns the value of thedmPanningWidth
field.
-
dmPanningHeight
public int dmPanningHeight()
Returns the value of thedmPanningHeight
field.
-
dmSpecVersion
public DEVMODE dmSpecVersion(short value)
Sets the specified value to thedmSpecVersion
field.
-
dmSize
public DEVMODE dmSize(short value)
Sets the specified value to thedmSize
field.
-
dmDriverExtra
public DEVMODE dmDriverExtra(short value)
Sets the specified value to thedmDriverExtra
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()
-
calloc
public static DEVMODE calloc()
-
create
public static DEVMODE create()
Returns a newDEVMODE
instance allocated withBufferUtils
.
-
create
public static DEVMODE create(long address)
-
malloc
public static DEVMODE.Buffer malloc(int capacity)
Returns a newDEVMODE.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static DEVMODE.Buffer calloc(int capacity)
Returns a newDEVMODE.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static DEVMODE.Buffer create(int capacity)
Returns a newDEVMODE.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static DEVMODE.Buffer create(long address, int capacity)
Create aDEVMODE.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
mallocStack
public static DEVMODE mallocStack()
Returns a newDEVMODE
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static DEVMODE callocStack()
Returns a newDEVMODE
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static DEVMODE mallocStack(MemoryStack stack)
Returns a newDEVMODE
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static DEVMODE callocStack(MemoryStack stack)
Returns a newDEVMODE
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static DEVMODE.Buffer mallocStack(int capacity)
Returns a newDEVMODE.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static DEVMODE.Buffer callocStack(int capacity)
Returns a newDEVMODE.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static DEVMODE.Buffer mallocStack(int capacity, MemoryStack stack)
Returns a newDEVMODE.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static DEVMODE.Buffer callocStack(int capacity, MemoryStack stack)
Returns a newDEVMODE.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
-