Class UserStyleSheet
-
Constructor Summary
ConstructorDescriptionUserStyleSheet
(MemorySegment address) Create a UserStyleSheet proxy instance for the provided memory address.UserStyleSheet
(String source, UserContentInjectedFrames injectedFrames, UserStyleLevel level, @Nullable String[] allowList, @Nullable String[] blockList) Creates a new user style sheet. -
Method Summary
Modifier and TypeMethodDescriptionstatic UserStyleSheet
forWorld
(String source, UserContentInjectedFrames injectedFrames, UserStyleLevel level, String worldName, @Nullable String[] allowList, @Nullable String[] blockList) Creates a new user style sheet for script world.static Type
getType()
Get the GType of the UserStyleSheet classref()
Atomically increments the reference count of this UserStyleSheet by one.void
unref()
Atomically decrements the reference count of this UserStyleSheet by one.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
UserStyleSheet
Create a UserStyleSheet proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
UserStyleSheet
public UserStyleSheet(String source, UserContentInjectedFrames injectedFrames, UserStyleLevel level, @Nullable @Nullable String[] allowList, @Nullable @Nullable String[] blockList) throws UnsupportedPlatformException Creates a new user style sheet.Style sheets can be applied to some URIs only by passing non-null values for
allowList
orblockList
. Passing anull
allow_list implies that all URIs are on the allow_list. The style sheet is applied if an URI matches the allow_list and not the block_list. URI patterns must be of the form[protocol]://[host]/[path]
, where the host and path components can contain the wildcard character (*
) to represent zero or more other characters.- Parameters:
source
- Source code of the user style sheet.injectedFrames
- AWebKitUserContentInjectedFrames
valuelevel
- AWebKitUserStyleLevel
allowList
- An allow_list of URI patterns ornull
blockList
- A block_list of URI patterns ornull
- Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
-
Method Details
-
getType
-
forWorld
public static UserStyleSheet forWorld(String source, UserContentInjectedFrames injectedFrames, UserStyleLevel level, String worldName, @Nullable @Nullable String[] allowList, @Nullable @Nullable String[] blockList) Creates a new user style sheet for script world.Creates a new user style sheet for script world with name
worldName
. See webkit_user_style_sheet_new() for a full description.- Parameters:
source
- Source code of the user style sheet.injectedFrames
- AWebKitUserContentInjectedFrames
valuelevel
- AWebKitUserStyleLevel
worldName
- the name of aWebKitScriptWorld
allowList
- An allow_list of URI patterns ornull
blockList
- A block_list of URI patterns ornull
- Returns:
- A new
WebKitUserStyleSheet
- Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
ref
Atomically increments the reference count of this UserStyleSheet by one.This function is MT-safe and may be called from any thread.
- Returns:
- The passed
WebKitUserStyleSheet
-
unref
public void unref()Atomically decrements the reference count of this UserStyleSheet by one.If the reference count drops to 0, all memory allocated by
WebKitUserStyleSheet
is released. This function is MT-safe and may be called from any thread.
-