cohtml::ViewSettings

Settings used when initializing a View.

#include <View.h>

Public Functions

Name
ViewSettings()

Public Attributes

Name
IViewListener *Listener
The ViewListener is notified of events happening in the View.
ITimeZoneProvider *TimezoneProvider
The ITimeZoneProvider is queried for the timezone.
unsignedWidth
The Width of the View.
unsignedHeight
The Height of the View.
OnRenderingTasksAvailableFuncOnRenderingTasksAvailable
Called when the View is completely advanced and laid-out.
OnMonotonicallyIncreasingTimeRequestFuncOnMonotonicallyIncreasingTimeRequest
Called during the advance of the views when accurate current time is needed The client should return monotonically increasing time in milliseconds.
void *UserData
Passed to the OnRenderingTasksAvailable and OnMonotonicallyIncreasingTimeRequest callbacks.
boolEnableComplexCSSSelectorsStyling
Tells if to enable complex CSS selectors when doing style matching. By complex in this context we mean any CSS selector that requires walking the DOM tree to match - that is selectors with any combinator (https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors#Combinators) and selectors with pseudo-classes that depend on the tree like :nth-child(), :first etc. This flag has a performance implication. Views that don’t need such selectors should leave it disabled, which makes style matching significantly faster.
boolInterceptResourceRequests
Allows you to intercept resource requests for this view in order to restrict resource access of the view to only specified sets of urls. If InterceptResourceRequests is not explicitly set to true, the default behavior will be to allow every request.
InspectorNetworkTabSettings::ModeInspectorNetworkTabMode
The inspector network tab mode. InspectorNetworkTabSettings::Mode::Enabled is used by default.
unsignedMinimumVertexBufferSize
Controls the minimum count of vertices allocated when creating vertex buffers. If equal to 0 then default count will be used which is 32768.
unsignedMinimumIndexBufferSize
Controls the minimum count of indices allocated when creating index buffers. If equal to 0 then default count will be used which is 49152.
unsignedVertexIndexBufferRingSize
Controls the size of each ring buffer (the VB ring buffer and the IB ring buffer). Every call to BeginFrame rotates the ring buffer and takes the next available buffer that the GPU should not be using. The acceptable range is between 1 and 8.
unsignedDoubleClickTime
The double-click time is the maximum number of milliseconds that may occur between the first and second click of a double-click.
ITextInputHandler *TextInputHandler
Notifies of changes to an input elements Can be set to nullptr if the user is not interested in receiving the events.
floatStartPanThreshold
Controls the minimum length of pans to be performed.
boolExecuteLayoutOnDedicatedThread
Tells if the application will spawn a dedicated layout thread or the Layout will happen in the View::Advance method Doing Layout on a separate thread is recommended as it improves scalability and reduces time spent in the Main DOM thread. For more information please refer to the Documentation.
boolExecuteCommandProcessingWithLayout
Tells the view to process all collected front-end commands right after the layout execution on the same thread.
boolEnableComplexTextLayout
Enables complex text layout support aimed to deliver proper display of text in languages like Arabic, Hebrew, Farsi, etc.
boolEnableUISurfacePartitioning
Changes the rendering flow so that the user RT is not cleared and the con-partitioned elements are drawn in separate scratch space.
boolEnableImmediateLayout
Enabling this immediately recalculates layout before returning a value from some JS methods.
boolEnableUnloadingOfHiddenImages
When enabled, elements with background/border/mask images that are hidden by display:none will release their reference to the image resource. An image resource without references will be unloaded from the GPU. References to the same image resource can be held with JS to prevent undesired unloading. When disabled, hidden elements will keep a reference to the image resources which assures that the image will be available on the first draw when the element is shown.
const void *DeveloperOptions
Reserved property for internal usage. Do not use it.

Public Functions Documentation

function ViewSettings

inline ViewSettings()

Public Attributes Documentation

variable Listener

IViewListener * Listener;

The ViewListener is notified of events happening in the View.

variable TimezoneProvider

ITimeZoneProvider * TimezoneProvider;

The ITimeZoneProvider is queried for the timezone.

variable Width

unsigned Width;

The Width of the View.

variable Height

unsigned Height;

The Height of the View.

variable OnRenderingTasksAvailable

OnRenderingTasksAvailableFunc OnRenderingTasksAvailable;

Called when the View is completely advanced and laid-out.

Note: This can be called on any thread!

variable OnMonotonicallyIncreasingTimeRequest

OnMonotonicallyIncreasingTimeRequestFunc OnMonotonicallyIncreasingTimeRequest;

Called during the advance of the views when accurate current time is needed The client should return monotonically increasing time in milliseconds.

variable UserData

void * UserData;

Passed to the OnRenderingTasksAvailable and OnMonotonicallyIncreasingTimeRequest callbacks.

variable EnableComplexCSSSelectorsStyling

bool EnableComplexCSSSelectorsStyling;

Tells if to enable complex CSS selectors when doing style matching. By complex in this context we mean any CSS selector that requires walking the DOM tree to match - that is selectors with any combinator (https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors#Combinators) and selectors with pseudo-classes that depend on the tree like :nth-child(), :first etc. This flag has a performance implication. Views that don’t need such selectors should leave it disabled, which makes style matching significantly faster.

variable InterceptResourceRequests

bool InterceptResourceRequests;

Allows you to intercept resource requests for this view in order to restrict resource access of the view to only specified sets of urls. If InterceptResourceRequests is not explicitly set to true, the default behavior will be to allow every request.

variable InspectorNetworkTabMode

InspectorNetworkTabSettings::Mode InspectorNetworkTabMode;

The inspector network tab mode. InspectorNetworkTabSettings::Mode::Enabled is used by default.

Note: This mode is ignored if inspector is completely disabled by cohtml::SystemSettings::EnableDebugger option.

variable MinimumVertexBufferSize

unsigned MinimumVertexBufferSize;

Controls the minimum count of vertices allocated when creating vertex buffers. If equal to 0 then default count will be used which is 32768.

variable MinimumIndexBufferSize

unsigned MinimumIndexBufferSize;

Controls the minimum count of indices allocated when creating index buffers. If equal to 0 then default count will be used which is 49152.

variable VertexIndexBufferRingSize

unsigned VertexIndexBufferRingSize;

Controls the size of each ring buffer (the VB ring buffer and the IB ring buffer). Every call to BeginFrame rotates the ring buffer and takes the next available buffer that the GPU should not be using. The acceptable range is between 1 and 8.

variable DoubleClickTime

unsigned DoubleClickTime;

The double-click time is the maximum number of milliseconds that may occur between the first and second click of a double-click.

variable TextInputHandler

ITextInputHandler * TextInputHandler;

Notifies of changes to an input elements Can be set to nullptr if the user is not interested in receiving the events.

variable StartPanThreshold

float StartPanThreshold;

Controls the minimum length of pans to be performed.

variable ExecuteLayoutOnDedicatedThread

bool ExecuteLayoutOnDedicatedThread;

Tells if the application will spawn a dedicated layout thread or the Layout will happen in the View::Advance method Doing Layout on a separate thread is recommended as it improves scalability and reduces time spent in the Main DOM thread. For more information please refer to the Documentation.

variable ExecuteCommandProcessingWithLayout

bool ExecuteCommandProcessingWithLayout;

Tells the view to process all collected front-end commands right after the layout execution on the same thread.

Note: When this setting is enabled, the CoHTML’s rendering library will be used on two different threads – the main and the render thread. Normally the library will detect that but if you have a use case where your custom engine can execute “main thread” and rendering tasks on the same thread, you’ll have to enable the multithreaded awareness manually by setting LibraryParams::AllowMultithreadedCommandProcessing to true.

variable EnableComplexTextLayout

bool EnableComplexTextLayout;

Enables complex text layout support aimed to deliver proper display of text in languages like Arabic, Hebrew, Farsi, etc.

variable EnableUISurfacePartitioning

bool EnableUISurfacePartitioning;

Changes the rendering flow so that the user RT is not cleared and the con-partitioned elements are drawn in separate scratch space.

variable EnableImmediateLayout

bool EnableImmediateLayout;

Enabling this immediately recalculates layout before returning a value from some JS methods.

variable EnableUnloadingOfHiddenImages

bool EnableUnloadingOfHiddenImages;

When enabled, elements with background/border/mask images that are hidden by display:none will release their reference to the image resource. An image resource without references will be unloaded from the GPU. References to the same image resource can be held with JS to prevent undesired unloading. When disabled, hidden elements will keep a reference to the image resources which assures that the image will be available on the first draw when the element is shown.

variable DeveloperOptions

const void * DeveloperOptions;

Reserved property for internal usage. Do not use it.