Functions
=========
.. currentmodule:: gi.repository.JavaScriptCore
.. function:: get_major_version() -> int
Returns the major version number of the JavaScriptCore library.
(e.g. in JavaScriptCore version 1.8.3 this is 1.)
This function is in the library, so it represents the JavaScriptCore library
your code is running against. Contrast with the ``JSC_MAJOR_VERSION``
macro, which represents the major version of the JavaScriptCore headers you
have included when compiling your code.
:return: the major version number of the JavaScriptCore library
.. function:: get_micro_version() -> int
Returns the micro version number of the JavaScriptCore library.
(e.g. in JavaScriptCore version 1.8.3 this is 3.)
This function is in the library, so it represents the JavaScriptCore library
your code is running against. Contrast with the ``JSC_MICRO_VERSION``
macro, which represents the micro version of the JavaScriptCore headers you
have included when compiling your code.
:return: the micro version number of the JavaScriptCore library
.. function:: get_minor_version() -> int
Returns the minor version number of the JavaScriptCore library.
(e.g. in JavaScriptCore version 1.8.3 this is 8.)
This function is in the library, so it represents the JavaScriptCore library
your code is running against. Contrast with the ``JSC_MINOR_VERSION``
macro, which represents the minor version of the JavaScriptCore headers you
have included when compiling your code.
:return: the minor version number of the JavaScriptCore library
.. function:: options_foreach(function: ~typing.Callable[[str, ~gi.repository.JavaScriptCore.OptionType, str | None, ~typing.Any], bool], user_data: ~typing.Any = None) -> None
Iterates all available options calling ``function`` for each one. Iteration can
stop early if ``function`` returns :const:`False`.
.. versionadded:: 2.24
:param function: a :obj:`~gi.repository.JavaScriptCore.OptionsFunc` callback
:param user_data: callback user data
.. function:: options_get_boolean(option: str) -> ~typing.Tuple[bool, bool]
Get ``option`` as a :obj:`~gi.repository.gboolean` value.
.. versionadded:: 2.24
:param option: the option identifier
:return: :const:`True` if ``value`` has been set or :const:`False` if the option doesn't exist
.. function:: options_get_double(option: str) -> ~typing.Tuple[bool, float]
Get ``option`` as a :obj:`float` value.
.. versionadded:: 2.24
:param option: the option identifier
:return: :const:`True` if ``value`` has been set or :const:`False` if the option doesn't exist
.. function:: options_get_int(option: str) -> ~typing.Tuple[bool, int]
Get ``option`` as a :obj:`int` value.
.. versionadded:: 2.24
:param option: the option identifier
:return: :const:`True` if ``value`` has been set or :const:`False` if the option doesn't exist
.. function:: options_get_option_group() -> ~gi._gi.OptionGroup
Create a :obj:`~gi.repository.GLib.OptionGroup` to handle JSCOptions as command line arguments.
The options will be exposed as command line arguments with the form
--jsc-wzxhzdk:0optionwzxhzdk:1=wzxhzdk:2valuewzxhzdk:3.
Each entry in the returned :obj:`~gi.repository.GLib.OptionGroup` is configured to apply the
corresponding option during command line parsing. Applications only need to
pass the returned group to :func:`~gi.repository.GLib.OptionContext.add_group`, and the rest will
be taken care for automatically.
.. versionadded:: 2.24
:return: a :obj:`~gi.repository.GLib.OptionGroup` for the JSCOptions
.. function:: options_get_range_string(option: str) -> ~typing.Tuple[bool, str]
Get ``option`` as a range string. The string must be in the
format [!]wzxhzdk:0lowwzxhzdk:1[:wzxhzdk:2highwzxhzdk:3] where low and high are :obj:`int` values.
Values between low and high (both included) will be considered in
the range, unless ! is used to invert the range.
.. versionadded:: 2.24
:param option: the option identifier
:return: :const:`True` if ``value`` has been set or :const:`False` if the option doesn't exist
.. function:: options_get_size(option: str) -> ~typing.Tuple[bool, int]
Get ``option`` as a :obj:`~gi.repository.gsize` value.
.. versionadded:: 2.24
:param option: the option identifier
:return: :const:`True` if ``value`` has been set or :const:`False` if the option doesn't exist
.. function:: options_get_string(option: str) -> ~typing.Tuple[bool, str]
Get ``option`` as a string.
.. versionadded:: 2.24
:param option: the option identifier
:return: :const:`True` if ``value`` has been set or :const:`False` if the option doesn't exist
.. function:: options_get_uint(option: str) -> ~typing.Tuple[bool, int]
Get ``option`` as a :obj:`int` value.
.. versionadded:: 2.24
:param option: the option identifier
:return: :const:`True` if ``value`` has been set or :const:`False` if the option doesn't exist
.. function:: options_set_boolean(option: str, value: bool) -> bool
Set ``option`` as a :obj:`~gi.repository.gboolean` value.
.. versionadded:: 2.24
:param option: the option identifier
:param value: the value to set
:return: :const:`True` if option was correctly set or :const:`False` otherwise.
.. function:: options_set_double(option: str, value: float) -> bool
Set ``option`` as a :obj:`float` value.
.. versionadded:: 2.24
:param option: the option identifier
:param value: the value to set
:return: :const:`True` if option was correctly set or :const:`False` otherwise.
.. function:: options_set_int(option: str, value: int) -> bool
Set ``option`` as a :obj:`int` value.
.. versionadded:: 2.24
:param option: the option identifier
:param value: the value to set
:return: :const:`True` if option was correctly set or :const:`False` otherwise.
.. function:: options_set_range_string(option: str, value: str) -> bool
Set ``option`` as a range string. The string must be in the
format [!]wzxhzdk:0lowwzxhzdk:1[:wzxhzdk:2highwzxhzdk:3] where low and high are :obj:`int` values.
Values between low and high (both included) will be considered in
the range, unless ! is used to invert the range.
.. versionadded:: 2.24
:param option: the option identifier
:param value: the value to set
:return: :const:`True` if option was correctly set or :const:`False` otherwise.
.. function:: options_set_size(option: str, value: int) -> bool
Set ``option`` as a :obj:`~gi.repository.gsize` value.
.. versionadded:: 2.24
:param option: the option identifier
:param value: the value to set
:return: :const:`True` if option was correctly set or :const:`False` otherwise.
.. function:: options_set_string(option: str, value: str) -> bool
Set ``option`` as a string.
.. versionadded:: 2.24
:param option: the option identifier
:param value: the value to set
:return: :const:`True` if option was correctly set or :const:`False` otherwise.
.. function:: options_set_uint(option: str, value: int) -> bool
Set ``option`` as a :obj:`int` value.
.. versionadded:: 2.24
:param option: the option identifier
:param value: the value to set
:return: :const:`True` if option was correctly set or :const:`False` otherwise.