Constants ========= .. currentmodule:: gi.repository.GLib .. data:: ALLOCATOR_LIST :value: 1 .. data:: ALLOCATOR_NODE :value: 3 .. data:: ALLOCATOR_SLIST :value: 2 .. data:: ALLOC_AND_FREE :value: 2 .. data:: ALLOC_ONLY :value: 1 .. data:: ANALYZER_ANALYZING :value: 1 .. data:: ASCII_DTOSTR_BUF_SIZE :value: 39 A good size for a buffer to be passed into :obj:`~gi.repository.GLib.ascii_dtostr`\. It is guaranteed to be enough for all output of that function on systems with 64bit IEEE-compatible doubles. The typical usage would be something like: .. code-block:: C :dedent: char buf[G_ASCII_DTOSTR_BUF_SIZE]; fprintf (out, "value=%s\n", g_ascii_dtostr (buf, sizeof (buf), value)); .. data:: ATOMIC_REF_COUNT_INIT :value: 1 Evaluates to the initial reference count for ``gatomicrefcount``\. This macro is useful for initializing ``gatomicrefcount`` fields inside structures, for instance: .. code-block:: C :dedent: typedef struct { gatomicrefcount ref_count; char *name; char *address; } Person; static const Person default_person = { .ref_count = G_ATOMIC_REF_COUNT_INIT, .name = "Default name", .address = "Default address", }; .. data:: BIG_ENDIAN :value: 4321 Specifies one of the possible types of byte order. See %G_BYTE_ORDER. .. data:: CSET_A_2_Z :value: ABCDEFGHIJKLMNOPQRSTUVWXYZ The set of uppercase ASCII alphabet characters. Used for specifying valid identifier characters in :obj:`~gi.repository.GLib.ScannerConfig`\. .. data:: CSET_DIGITS :value: 0123456789 The set of ASCII digits. Used for specifying valid identifier characters in :obj:`~gi.repository.GLib.ScannerConfig`\. .. data:: CSET_a_2_z :value: abcdefghijklmnopqrstuvwxyz The set of lowercase ASCII alphabet characters. Used for specifying valid identifier characters in :obj:`~gi.repository.GLib.ScannerConfig`\. .. data:: C_STD_VERSION :value: 199000 The C standard version the code is compiling against, it's normally defined with the same value of ``__STDC_VERSION__`` for C standard compatible compilers, while it uses the lowest standard version in pure MSVC, given that in such compiler the definition depends on a compilation flag. This is granted to be undefined when compiling with a C++ compiler. See also: %G_C_STD_CHECK_VERSION and %G_CXX_STD_VERSION .. data:: DATALIST_FLAGS_MASK :value: 3 A bitmask that restricts the possible flags passed to :func:`~gi.repository.GLib.datalist_set_flags`. Passing a flags value where flags & ~G_DATALIST_FLAGS_MASK != 0 is an error. .. data:: DATE_BAD_DAY :value: 0 Represents an invalid :obj:`~gi.repository.GLib.DateDay`\. .. data:: DATE_BAD_JULIAN :value: 0 Represents an invalid Julian day number. .. data:: DATE_BAD_YEAR :value: 0 Represents an invalid year. .. data:: DIR_SEPARATOR :value: 47 The directory separator character. This is '/' on UNIX machines and '\' under Windows. .. data:: DIR_SEPARATOR_S :value: / The directory separator as a string. This is "/" on UNIX machines and "\" under Windows. .. data:: E :value: 2.718282 The base of natural logarithms. .. data:: GINT16_FORMAT :value: hi .. data:: GINT16_MODIFIER :value: h .. data:: GINT32_FORMAT :value: i .. data:: GINT32_MODIFIER :value: .. data:: GINT64_FORMAT :value: li .. data:: GINT64_MODIFIER :value: l .. data:: GINTPTR_FORMAT :value: li .. data:: GINTPTR_MODIFIER :value: l .. data:: GNUC_FUNCTION :value: Expands to "" on all modern compilers, and to ``__FUNCTION__`` on gcc version 2.x. Don't use it. .. deprecated:: 2.16 Use G_STRFUNC() instead .. data:: GNUC_PRETTY_FUNCTION :value: Expands to "" on all modern compilers, and to ``__PRETTY_FUNCTION__`` on gcc version 2.x. Don't use it. .. deprecated:: 2.16 Use G_STRFUNC() instead .. data:: GSIZE_FORMAT :value: lu .. data:: GSIZE_MODIFIER :value: l .. data:: GSSIZE_FORMAT :value: li .. data:: GSSIZE_MODIFIER :value: l .. data:: GUINT16_FORMAT :value: hu .. data:: GUINT32_FORMAT :value: u .. data:: GUINT64_FORMAT :value: lu .. data:: GUINTPTR_FORMAT :value: lu .. data:: HAVE_GINT64 :value: 1 .. data:: HAVE_GNUC_VARARGS :value: 1 .. data:: HAVE_GNUC_VISIBILITY :value: 1 Defined to 1 if gcc-style visibility handling is supported. .. data:: HAVE_GROWING_STACK :value: 0 .. data:: HAVE_ISO_VARARGS :value: 1 .. data:: HOOK_FLAG_USER_SHIFT :value: 4 The position of the first bit which is not reserved for internal use be the :obj:`~gi.repository.GLib.Hook` implementation, i.e. ``1 << G_HOOK_FLAG_USER_SHIFT`` is the first bit which can be used for application-defined flags. .. data:: IEEE754_DOUBLE_BIAS :value: 1023 The bias by which exponents in double-precision floats are offset. .. data:: IEEE754_FLOAT_BIAS :value: 127 The bias by which exponents in single-precision floats are offset. .. data:: IO_ERR :value: 8 .. data:: IO_FLAG_APPEND :value: 1 .. deprecated:: PyGObject-3.16.0 GLib.IO_FLAG_APPEND is deprecated; use GLib.IOFlags.APPEND instead .. data:: IO_FLAG_GET_MASK :value: 31 .. deprecated:: PyGObject-3.16.0 GLib.IO_FLAG_GET_MASK is deprecated; use GLib.IOFlags.GET_MASK instead .. data:: IO_FLAG_IS_READABLE :value: 4 .. deprecated:: PyGObject-3.16.0 GLib.IO_FLAG_IS_READABLE is deprecated; use GLib.IOFlags.IS_READABLE instead .. data:: IO_FLAG_IS_SEEKABLE :value: 16 .. deprecated:: PyGObject-3.16.0 GLib.IO_FLAG_IS_SEEKABLE is deprecated; use GLib.IOFlags.IS_SEEKABLE instead .. data:: IO_FLAG_IS_WRITEABLE :value: 8 .. deprecated:: PyGObject-3.16.0 GLib.IO_FLAG_IS_WRITEABLE is deprecated; use GLib.IOFlags.IS_WRITABLE instead .. data:: IO_FLAG_MASK :value: 31 .. deprecated:: PyGObject-3.16.0 GLib.IO_FLAG_MASK is deprecated; use GLib.IOFlags.MASK instead .. data:: IO_FLAG_NONBLOCK :value: 2 .. deprecated:: PyGObject-3.16.0 GLib.IO_FLAG_NONBLOCK is deprecated; use GLib.IOFlags.NONBLOCK instead .. data:: IO_FLAG_SET_MASK :value: 3 .. deprecated:: PyGObject-3.16.0 GLib.IO_FLAG_SET_MASK is deprecated; use GLib.IOFlags.SET_MASK instead .. data:: IO_HUP :value: 16 .. data:: IO_IN :value: 1 .. data:: IO_NVAL :value: 32 .. data:: IO_OUT :value: 4 .. data:: IO_PRI :value: 2 .. data:: IO_STATUS_AGAIN :value: 3 .. deprecated:: PyGObject-3.16.0 GLib.IO_STATUS_AGAIN is deprecated; use GLib.IOStatus.AGAIN instead .. data:: IO_STATUS_EOF :value: 2 .. deprecated:: PyGObject-3.16.0 GLib.IO_STATUS_EOF is deprecated; use GLib.IOStatus.EOF instead .. data:: IO_STATUS_ERROR :value: 0 .. deprecated:: PyGObject-3.16.0 GLib.IO_STATUS_ERROR is deprecated; use GLib.IOStatus.ERROR instead .. data:: IO_STATUS_NORMAL :value: 1 .. deprecated:: PyGObject-3.16.0 GLib.IO_STATUS_NORMAL is deprecated; use GLib.IOStatus.NORMAL instead .. data:: KEY_FILE_DESKTOP_GROUP :value: Desktop Entry The name of the main group of a desktop entry file, as defined in the `Desktop Entry Specification `__\. Consult the specification for more details about the meanings of the keys below. .. data:: KEY_FILE_DESKTOP_KEY_ACTIONS :value: Actions A key under :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_GROUP`, whose value is a string list giving the available application actions. .. data:: KEY_FILE_DESKTOP_KEY_CATEGORIES :value: Categories A key under :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_GROUP`, whose value is a list of strings giving the categories in which the desktop entry should be shown in a menu. .. data:: KEY_FILE_DESKTOP_KEY_COMMENT :value: Comment A key under :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_GROUP`, whose value is a localized string giving the tooltip for the desktop entry. .. data:: KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE :value: DBusActivatable A key under :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_GROUP`, whose value is a boolean set to true if the application is D-Bus activatable. .. data:: KEY_FILE_DESKTOP_KEY_EXEC :value: Exec A key under :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_GROUP`, whose value is a string giving the command line to execute. It is only valid for desktop entries with the ``Application`` type. .. data:: KEY_FILE_DESKTOP_KEY_GENERIC_NAME :value: GenericName A key under :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_GROUP`, whose value is a localized string giving the generic name of the desktop entry. .. data:: KEY_FILE_DESKTOP_KEY_HIDDEN :value: Hidden A key under :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_GROUP`, whose value is a boolean stating whether the desktop entry has been deleted by the user. .. data:: KEY_FILE_DESKTOP_KEY_ICON :value: Icon A key under :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_GROUP`, whose value is a localized string giving the name of the icon to be displayed for the desktop entry. .. data:: KEY_FILE_DESKTOP_KEY_MIME_TYPE :value: MimeType A key under :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_GROUP`, whose value is a list of strings giving the MIME types supported by this desktop entry. .. data:: KEY_FILE_DESKTOP_KEY_NAME :value: Name A key under :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_GROUP`, whose value is a localized string giving the specific name of the desktop entry. .. data:: KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN :value: NotShowIn A key under :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_GROUP`, whose value is a list of strings identifying the environments that should not display the desktop entry. .. data:: KEY_FILE_DESKTOP_KEY_NO_DISPLAY :value: NoDisplay A key under :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_GROUP`, whose value is a boolean stating whether the desktop entry should be shown in menus. .. data:: KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN :value: OnlyShowIn A key under :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_GROUP`, whose value is a list of strings identifying the environments that should display the desktop entry. .. data:: KEY_FILE_DESKTOP_KEY_PATH :value: Path A key under :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_GROUP`, whose value is a string containing the working directory to run the program in. It is only valid for desktop entries with the ``Application`` type. .. data:: KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY :value: StartupNotify A key under :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_GROUP`, whose value is a boolean stating whether the application supports the `Startup Notification Protocol Specification `__\. .. data:: KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS :value: StartupWMClass A key under :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_GROUP`, whose value is string identifying the WM class or name hint of a window that the application will create, which can be used to emulate Startup Notification with older applications. .. data:: KEY_FILE_DESKTOP_KEY_TERMINAL :value: Terminal A key under :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_GROUP`, whose value is a boolean stating whether the program should be run in a terminal window. It is only valid for desktop entries with the ``Application`` type. .. data:: KEY_FILE_DESKTOP_KEY_TRY_EXEC :value: TryExec A key under :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_GROUP`, whose value is a string giving the file name of a binary on disk used to determine if the program is actually installed. It is only valid for desktop entries with the ``Application`` type. .. data:: KEY_FILE_DESKTOP_KEY_TYPE :value: Type A key under :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_GROUP`, whose value is a string giving the type of the desktop entry. Usually :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_TYPE_APPLICATION`, :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_TYPE_LINK`, or :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_TYPE_DIRECTORY`. .. data:: KEY_FILE_DESKTOP_KEY_URL :value: URL A key under :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_GROUP`, whose value is a string giving the URL to access. It is only valid for desktop entries with the ``Link`` type. .. data:: KEY_FILE_DESKTOP_KEY_VERSION :value: Version A key under :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_GROUP`, whose value is a string giving the version of the Desktop Entry Specification used for the desktop entry file. .. data:: KEY_FILE_DESKTOP_TYPE_APPLICATION :value: Application The value of the :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_KEY_TYPE`, key for desktop entries representing applications. .. data:: KEY_FILE_DESKTOP_TYPE_DIRECTORY :value: Directory The value of the :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_KEY_TYPE`, key for desktop entries representing directories. .. data:: KEY_FILE_DESKTOP_TYPE_LINK :value: Link The value of the :const:`~gi.repository.GLib.KEY_FILE_DESKTOP_KEY_TYPE`, key for desktop entries representing links to documents. .. data:: LITTLE_ENDIAN :value: 1234 Specifies one of the possible types of byte order. See %G_BYTE_ORDER. .. data:: LN10 :value: 2.302585 The natural logarithm of 10. .. data:: LN2 :value: 0.693147 The natural logarithm of 2. .. data:: LOG_2_BASE_10 :value: 0.30103 Multiplying the base 2 exponent by this number yields the base 10 exponent. .. data:: LOG_DOMAIN :value: 0 Defines the log domain. See `Log Domains <#log-domains>`__\. Libraries should define this so that any messages which they log can be differentiated from messages from other libraries and application code. But be careful not to define it in any public header files. Log domains must be unique, and it is recommended that they are the application or library name, optionally followed by a hyphen and a sub-domain name. For example, ``bloatpad`` or ``bloatpad-io``\. If undefined, it defaults to the default :const:`None` (or ``""``\) log domain; this is not advisable, as it cannot be filtered against using the ``G_MESSAGES_DEBUG`` environment variable. For example, GTK uses this in its ``Makefile.am``\: .. code-block:: :dedent: AM_CPPFLAGS = -DG_LOG_DOMAIN=\"Gtk\" Applications can choose to leave it as the default :const:`None` (or ``""``\) domain. However, defining the domain offers the same advantages as above. .. data:: LOG_FATAL_MASK :value: 5 GLib log levels that are considered fatal by default. This is not used if structured logging is enabled; see `Using Structured Logging `__\. .. data:: LOG_LEVEL_USER_SHIFT :value: 8 Log levels below ``1< <. The standard delimiters, used in :obj:`~gi.repository.GLib.strdelimit`\. .. data:: SYSDEF_AF_INET :value: 2 .. data:: SYSDEF_AF_INET6 :value: 10 .. data:: SYSDEF_AF_UNIX :value: 1 .. data:: SYSDEF_MSG_DONTROUTE :value: 4 .. data:: SYSDEF_MSG_OOB :value: 1 .. data:: SYSDEF_MSG_PEEK :value: 2 .. data:: TEST_OPTION_ISOLATE_DIRS :value: isolate_dirs Creates a unique temporary directory for each unit test and uses :func:`~gi.repository.GLib.set_user_dirs` to set XDG directories to point into subdirectories of it for the duration of the unit test. The directory tree is cleaned up after the test finishes successfully. Note that this doesn’t take effect until :func:`~gi.repository.GLib.test_run` is called, so calls to (for example) g_get_user_home_dir() will return the system-wide value when made in a test program’s main() function. The following functions will return subdirectories of the temporary directory when this option is used. The specific subdirectory paths in use are not guaranteed to be stable API — always use a getter function to retrieve them. - :func:`~gi.repository.GLib.get_home_dir` - :func:`~gi.repository.GLib.get_user_cache_dir` - :func:`~gi.repository.GLib.get_system_config_dirs` - :func:`~gi.repository.GLib.get_user_config_dir` - :func:`~gi.repository.GLib.get_system_data_dirs` - :func:`~gi.repository.GLib.get_user_data_dir` - :func:`~gi.repository.GLib.get_user_state_dir` - :func:`~gi.repository.GLib.get_user_runtime_dir` The subdirectories may not be created by the test harness; as with normal calls to functions like :func:`~gi.repository.GLib.get_user_cache_dir`, the caller must be prepared to create the directory if it doesn’t exist. .. data:: TIME_SPAN_DAY :value: 86400000000 Evaluates to a time span of one day. .. data:: TIME_SPAN_HOUR :value: 3600000000 Evaluates to a time span of one hour. .. data:: TIME_SPAN_MILLISECOND :value: 1000 Evaluates to a time span of one millisecond. .. data:: TIME_SPAN_MINUTE :value: 60000000 Evaluates to a time span of one minute. .. data:: TIME_SPAN_SECOND :value: 1000000 Evaluates to a time span of one second. .. data:: UNICHAR_MAX_DECOMPOSITION_LENGTH :value: 18 The maximum length (in codepoints) of a compatibility or canonical decomposition of a single Unicode character. This is as defined by Unicode 6.1. .. data:: URI_RESERVED_CHARS_GENERIC_DELIMITERS :value: :/?#[]@ Generic delimiters characters as defined in `RFC 3986 `__\. Includes ``:/?#[]@``\. .. data:: URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS :value: !$&'()*+,;= Subcomponent delimiter characters as defined in `RFC 3986 `__\. Includes ``!$&'()*+,;=``\. .. data:: USEC_PER_SEC :value: 1000000 Number of microseconds in one second (1 million). This macro is provided for code readability. .. data:: USER_DIRECTORY_DESKTOP :value: 0 .. deprecated:: PyGObject-3.16.0 GLib.USER_DIRECTORY_DESKTOP is deprecated; use GLib.UserDirectory.DIRECTORY_DESKTOP instead .. data:: USER_DIRECTORY_DOCUMENTS :value: 1 .. deprecated:: PyGObject-3.16.0 GLib.USER_DIRECTORY_DOCUMENTS is deprecated; use GLib.UserDirectory.DIRECTORY_DOCUMENTS instead .. data:: USER_DIRECTORY_DOWNLOAD :value: 2 .. deprecated:: PyGObject-3.16.0 GLib.USER_DIRECTORY_DOWNLOAD is deprecated; use GLib.UserDirectory.DIRECTORY_DOWNLOAD instead .. data:: USER_DIRECTORY_MUSIC :value: 3 .. deprecated:: PyGObject-3.16.0 GLib.USER_DIRECTORY_MUSIC is deprecated; use GLib.UserDirectory.DIRECTORY_MUSIC instead .. data:: USER_DIRECTORY_PICTURES :value: 4 .. deprecated:: PyGObject-3.16.0 GLib.USER_DIRECTORY_PICTURES is deprecated; use GLib.UserDirectory.DIRECTORY_PICTURES instead .. data:: USER_DIRECTORY_PUBLIC_SHARE :value: 5 .. deprecated:: PyGObject-3.16.0 GLib.USER_DIRECTORY_PUBLIC_SHARE is deprecated; use GLib.UserDirectory.DIRECTORY_PUBLIC_SHARE instead .. data:: USER_DIRECTORY_TEMPLATES :value: 6 .. deprecated:: PyGObject-3.16.0 GLib.USER_DIRECTORY_TEMPLATES is deprecated; use GLib.UserDirectory.DIRECTORY_TEMPLATES instead .. data:: USER_DIRECTORY_VIDEOS :value: 7 .. deprecated:: PyGObject-3.16.0 GLib.USER_DIRECTORY_VIDEOS is deprecated; use GLib.UserDirectory.DIRECTORY_VIDEOS instead .. data:: VA_COPY_AS_ARRAY :value: 1 .. data:: VERSION_MIN_REQUIRED :value: 2 A macro that should be defined by the user prior to including the glib.h header. The definition should be one of the predefined GLib version macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,... This macro defines the earliest version of GLib that the package is required to be able to compile against. If the compiler is configured to warn about the use of deprecated functions, then using functions that were deprecated in version :const:`~gi.repository.GLib.VERSION_MIN_REQUIRED` or earlier will cause warnings (but using functions deprecated in later releases will not). .. data:: WIN32_MSG_HANDLE :value: 19981206 .. data:: glib_version :value: (2, 82, 2) .. deprecated:: PyGObject-3.16.0 GLib.glib_version is deprecated; use (GLib.MAJOR_VERSION, GLib.MINOR_VERSION, GLib.MICRO_VERSION) instead .. data:: macro__has_attribute___noreturn__ :value: 0 .. data:: pyglib_version :value: (3, 51, 1) .. deprecated:: PyGObject-3.16.0 GLib.pyglib_version is deprecated; use gi.version_info instead