Ultralight C++ API 1.3.0
Loading...
Searching...
No Matches
ultralight::ViewConfig Struct Reference

#include <Ultralight/View.h>

Details

View-specific configuration settings.

See also
Renderer::CreateView

Public Attributes

bool is_accelerated = false
 Whether to render using the GPU renderer (accelerated) or the CPU renderer (unaccelerated).
 
bool is_transparent = false
 Whether or not this View should support transparency.
 
double initial_device_scale = 1.0
 The initial device scale, ie.
 
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.
 
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

◆ enable_images

bool ultralight::ViewConfig::enable_images = true

Whether or not images should be enabled.

◆ enable_javascript

bool ultralight::ViewConfig::enable_javascript = true

Whether or not JavaScript should be enabled.

◆ font_family_fixed

String ultralight::ViewConfig::font_family_fixed = "Courier New"

Default font-family to use for fixed fonts.

(pre/code)

◆ font_family_sans_serif

String ultralight::ViewConfig::font_family_sans_serif = "Arial"

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

◆ font_family_serif

String ultralight::ViewConfig::font_family_serif = "Times New Roman"

Default font-family to use for serif fonts.

◆ font_family_standard

String ultralight::ViewConfig::font_family_standard = "Times New Roman"

Default font-family to use.

◆ initial_device_scale

double ultralight::ViewConfig::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)

◆ initial_focus

bool ultralight::ViewConfig::initial_focus = true

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

See also
View::Focus()

◆ is_accelerated

bool ultralight::ViewConfig::is_accelerated = false

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

This option is only valid if you're managing the Renderer yourself (eg, you've previously called Renderer::Create() instead of App::Create()).

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.

◆ is_transparent

bool ultralight::ViewConfig::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 ultralight::ViewConfig::user_agent
Initial value:
= "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
"AppleWebKit/610.4.3.1.4 (KHTML, like Gecko) "
"Ultralight/1.3.0 Version/14.0.3 Safari/610.4.3.1.4"

Default user-agent string.


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