UIContext

UIContext contains the "globals" of the UI. It also provides additional APIs for UIElement.

Constructors

this
this(GUIGraphics owner)
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

beginDragging
void beginDragging(UIElement element)
Undocumented in source. Be warned that the author may not have intended to support it.
getCurrentMouseCursor
MouseCursor getCurrentMouseCursor()
Undocumented in source. Be warned that the author may not have intended to support it.
getDefaultUIHeight
int getDefaultUIHeight()
Undocumented in source. Be warned that the author may not have intended to support it.
getDefaultUISizeInPixels
vec2i getDefaultUISizeInPixels()
Undocumented in source. Be warned that the author may not have intended to support it.
getDefaultUIWidth
int getDefaultUIWidth()
Undocumented in source. Be warned that the author may not have intended to support it.
getElementById
UIElement getElementById(const(char)* id)
Undocumented in source. Be warned that the author may not have intended to support it.
getRootElement
UIElement getRootElement()
Undocumented in source. Be warned that the author may not have intended to support it.
getUINearestValidSize
void getUINearestValidSize(int* widthLogicalPixels, int* heightLogicalPixels)
Undocumented in source. Be warned that the author may not have intended to support it.
getUIScale
float getUIScale()
Undocumented in source. Be warned that the author may not have intended to support it.
getUISizeInPixelsLogical
vec2i getUISizeInPixelsLogical()
Undocumented in source. Be warned that the author may not have intended to support it.
getUISizeInPixelsPhysical
vec2i getUISizeInPixelsPhysical()
Undocumented in source. Be warned that the author may not have intended to support it.
getUISizeInPixelsUser
vec2i getUISizeInPixelsUser()
Undocumented in source. Be warned that the author may not have intended to support it.
getUserPointer
void* getUserPointer(int pointerID)
Undocumented in source. Be warned that the author may not have intended to support it.
getUserScale
float getUserScale()
Undocumented in source. Be warned that the author may not have intended to support it.
globalImageResizer
ImageResizer* globalImageResizer()
Undocumented in source. Be warned that the author may not have intended to support it.
globalThreadPool
ThreadPool* globalThreadPool()
Undocumented in source. Be warned that the author may not have intended to support it.
isUIResizable
bool isUIResizable()
Undocumented in source. Be warned that the author may not have intended to support it.
profiler
IProfiler profiler()
Undocumented in source. Be warned that the author may not have intended to support it.
requestUIResize
bool requestUIResize(int widthLogicalPixels, int heightLogicalPixels)
Undocumented in source. Be warned that the author may not have intended to support it.
requestUIScreenshot
void requestUIScreenshot()
Undocumented in source. Be warned that the author may not have intended to support it.
setFocused
void setFocused(UIElement focused)
Undocumented in source. Be warned that the author may not have intended to support it.
setMouseOver
void setMouseOver(UIElement elem)
Undocumented in source. Be warned that the author may not have intended to support it.
setUserPointer
void setUserPointer(int pointerID, void* userPointer)
Undocumented in source. Be warned that the author may not have intended to support it.
sortingScratchBuffer
Vec!UIElement sortingScratchBuffer()
Undocumented in source. Be warned that the author may not have intended to support it.
stopDragging
void stopDragging()
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

dirtyListPBR
DirtyRectList dirtyListPBR;
Undocumented in source.
dirtyListRaw
DirtyRectList dirtyListRaw;
Undocumented in source.
dragged
UIElement dragged;

Currently dragged element.

focused
UIElement focused;

Last clicked element.

mouseOver
UIElement mouseOver;

Currently mouse-over'd element.

Inherited Members

From IUIContext

getUIScale
float getUIScale()
getUserScale
float getUserScale()
getDefaultUISizeInPixels
vec2i getDefaultUISizeInPixels()

Get default size of the UI, at creation time, in user pixels.

getDefaultUIWidth
int getDefaultUIWidth()

Get default width of the UI, at creation time, in user pixels.

getDefaultUIHeight
int getDefaultUIHeight()

Get default width of the UI, at creation time, in user pixels.

getUISizeInPixelsUser
vec2i getUISizeInPixelsUser()

Get current size of the UI, in user pixels.

getUISizeInPixelsLogical
vec2i getUISizeInPixelsLogical()

Get current size of the UI, in logical pixels.

getUISizeInPixelsPhysical
vec2i getUISizeInPixelsPhysical()

Get current size of the UI, in physical pixels.

requestUIResize
bool requestUIResize(int widthLogicalPixels, int heightLogicalPixels)

Trigger a resize of the plugin window. This isn't guaranteed to succeed.

requestUIScreenshot
void requestUIScreenshot()

Trigger a screenshot of the plugin window. The callback onScreenshotComputed can then be implemented in your main GUI object (gui.d). However, if the operation fails, it may well not be called.

getUINearestValidSize
void getUINearestValidSize(int* widthLogicalPixels, int* heightLogicalPixels)

Find the nearest valid _logical_ UI size. Given an input size, get the nearest valid size.

isUIResizable
bool isUIResizable()
globalImageResizer
ImageResizer* globalImageResizer()

A shared image resizer to be used in reflow() of element. Resizing using dplug:graphics use a lot of memory, so it can be better if this is a shared resource. It is lazily constructed.

globalThreadPool
ThreadPool* globalThreadPool()

A shared threadpool, used to draw widgets concurrently. NEW: A widget can opt to be drawn alone, and use the threadpool for its own drawing itself. Can ONLY be called from onDrawRaw AND when the flag flagDrawAloneRaw is used, or from onDrawPBR AND when the flag flagDrawAlonePBR is used.

profiler
IProfiler profiler()

Returns a UI-wide profiler that records UI performance, as long as Dplug_ProfileUI version is defined. Else, it is a null IProfiler that forgets everything. For performance purpose, it is recommended: 1. not to record profile if Dplug_ProfileUI is not defined, 2. and undefine Dplug_ProfileUI if you're not looking for a bottleneck.

setUserPointer
void setUserPointer(int pointerID, void* userPointer)

Store an user-defined pointer globally for the UI. This is useful to implement an optional extension to dplug:gui. id 0..7 are reserved for future Dplug extensions. id 8..15 are for vendor-specific extensions. Warning: if you store an object here, keep in mind they won't get destroyed automatically.

getUserPointer
void* getUserPointer(int pointerID)

Get an user-defined pointer stored globally for the UI. This is useful to implement an optional extension to dplug:gui. id 0..7 are reserved for future Dplug extensions. id 8..15 are for vendor-specific extensions.

getRootElement
UIElement getRootElement()

Get root element of the hierarchy.

getElementById
UIElement getElementById(const(char)* id)

Get the first UIElement with the given ID, or null. This just checks for exact id matches, without anything fancy. If you use dplug:wren-support, this is called by the $ operator or the UI.getElementById.

Meta