ltk_webkit/types/
settings.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// SPDX-License-Identifier: LGPL-2.1-only
// Copyright (C) 2026 Liberux Labs, S. L. <info@liberux.net>

#[ derive( Clone, Copy, Debug, PartialEq, Eq ) ]
pub enum Autoplay
{
	Allow,
	/// WebKit's default: muted media may start by itself.
	AllowWithoutSound,
	/// Nothing plays until the user asks; a playing video costs a decoder and its buffers.
	Deny,
}

/// How much the engine keeps in memory to make browsing faster.
#[ derive( Clone, Copy, Debug, PartialEq, Eq ) ]
pub enum CacheModel
{
	/// No cached pages and the smallest resource cache.
	DocumentViewer,
	/// A smaller resource cache and fewer pages kept whole for back and forward.
	DocumentBrowser,
	/// WebKit's default: the largest caches, sized from the machine's memory.
	WebBrowser,
}

#[ derive( Debug, Clone, Copy, PartialEq, Eq ) ]
pub enum VideoCodec
{
	H264,
	Hevc,
	Vp8,
	Vp9,
	Av1,
}

impl VideoCodec
{
	pub( crate ) const ALL: [ VideoCodec; 5 ] = [ VideoCodec::H264, VideoCodec::Hevc, VideoCodec::Vp8, VideoCodec::Vp9, VideoCodec::Av1 ];

	pub( crate ) fn key( self ) -> &'static str
	{
		match self
		{
			VideoCodec::H264 => "h264",
			VideoCodec::Hevc => "hevc",
			VideoCodec::Vp8  => "vp8",
			VideoCodec::Vp9  => "vp9",
			VideoCodec::Av1  => "av1",
		}
	}
}