Loading...
Searching...
No Matches
ViewConfig

#include <Ultralight/View.h>

Overview

View-specific configuration settings.

See also
Renderer::CreateView

Public Attributes

uint32_t display_id = 0
 A user-generated id for the display (monitor, TV, or screen) that this View will be shown on.
 
bool is_accelerated = false
 Whether to render using the GPU renderer (accelerated) or the CPU renderer (unaccelerated).
 
double initial_device_scale = 1.0
 The initial device scale, ie.
 
bool is_transparent = false
 Whether or not this View should support transparency.
 
bool initial_focus = true
 Whether or not the View should initially have input focus,.
 
bool enable_images = true
 Whether or not images should be enabled.
 
bool enable_javascript = true
 Whether or not JavaScript should be enabled.
 
bool enable_compositor = false
 Whether or not compositing should be enabled.
 
String font_family_standard = "Times New Roman"
 Default font-family to use.
 
String font_family_fixed = "Courier New"
 Default font-family to use for fixed fonts.
 
String font_family_serif = "Times New Roman"
 Default font-family to use for serif fonts.
 
String font_family_sans_serif = "Arial"
 Default font-family to use for sans-serif fonts.
 
String user_agent
 Default user-agent string.
 

Member Data Documentation

◆ display_id

uint32_t display_id = 0

A user-generated id for the display (monitor, TV, or screen) that this View will be shown on.

Animations are driven based on the physical refresh rate of the display. Multiple Views can share the same display.

Note
This is automatically managed for you when App::Create() is used.
See also
Renderer::RefreshDisplay.

◆ enable_compositor

bool enable_compositor = false

Whether or not compositing should be enabled.

◆ enable_images

bool enable_images = true

Whether or not images should be enabled.

◆ enable_javascript

bool enable_javascript = true

Whether or not JavaScript should be enabled.

◆ font_family_fixed

String font_family_fixed = "Courier New"

Default font-family to use for fixed fonts.

(pre/code)

◆ font_family_sans_serif

String font_family_sans_serif = "Arial"

Default font-family to use for sans-serif fonts.

◆ font_family_serif

String font_family_serif = "Times New Roman"

Default font-family to use for serif fonts.

◆ font_family_standard

String font_family_standard = "Times New Roman"

Default font-family to use.

◆ initial_device_scale

double initial_device_scale = 1.0

The initial device scale, ie.

the amount to scale page units to screen pixels. This should be set to the scaling factor of the device that the View is displayed on.

Note
1.0 is equal to 100% zoom (no scaling), 2.0 is equal to 200% zoom (2x scaling)
This is automatically managed for you when App::Create() is used.

◆ initial_focus

bool initial_focus = true

Whether or not the View should initially have input focus,.

See also
View::Focus()

◆ is_accelerated

bool is_accelerated = false

Whether to render using the GPU renderer (accelerated) or the CPU renderer (unaccelerated).

When true, the View will be rendered to an offscreen GPU texture using the GPU driver set in Platform::set_gpu_driver. You can fetch details for the texture via View::render_target.

When false (the default), the View will be rendered to an offscreen pixel buffer using the multithreaded CPU renderer. This pixel buffer can optionally be provided by the user– for more info see Platform::set_surface_factory and View::surface.

Note
This is automatically managed for you when App::Create() is used.

◆ is_transparent

bool is_transparent = false

Whether or not this View should support transparency.

Note
Make sure to also set the following CSS on the page:

html, body { background: transparent; }

◆ user_agent

String user_agent
Initial value:
= "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
"AppleWebKit/615.1.18.100.1 (KHTML, like Gecko) "
"Ultralight/1.4.0 Version/16.4.1 Safari/615.1.18.100.1"

Default user-agent string.


The documentation for this struct was generated from the following file: