docs: Split out platform specific GIO and GLib documentation

This creates `GioUnix`, `GioWin32`, `GLibUnix` and `GLibWin32`. These
bodies of documentation are in addition to the main, platform agnostic,
documentation for both libraries.

This commit necessarily includes various mechanical changes to update
the repository namespace used in various existing documentation links to
platform specific APIs.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
This commit is contained in:
Philip Withnall
2024-02-06 15:36:14 +00:00
parent 5021d002ab
commit c498c9a8c9
16 changed files with 363 additions and 56 deletions

View File

@@ -0,0 +1,50 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
# Copyright 2023 Matthias Clasen
# Copyright 2023 Philip Withnall
[library]
name = "GioUnix"
version = "@VERSION@"
browse_url = "https://gitlab.gnome.org/GNOME/glib/"
repository_url = "https://gitlab.gnome.org/GNOME/glib.git"
website_url = "https://www.gtk.org"
docs_urls = "https://docs.gtk.org/gio-unix/"
authors = "GLib Development Team"
license = "LGPL-2.1-or-later"
description = "Unix-specific APIs in Gio"
dependencies = [ "GLib-2.0", "GModule-2.0", "GObject-2.0", "Gio-2.0" ]
devhelp = true
search_index = true
[dependencies."GLib-2.0"]
name = "GLib"
description = "The base utility library"
docs_url = "https://docs.gtk.org/glib/"
[dependencies."GModule-2.0"]
name = "GModule"
description = "Portable API for dynamically loading modules"
docs_url = "https://docs.gtk.org/gmodule/"
[dependencies."GObject-2.0"]
name = "GObject"
description = "The base type system library"
docs_url = "https://docs.gtk.org/gobject/"
[dependencies."Gio-2.0"]
name = "Gio"
description = "A library of useful classes for I/O, networking and IPC"
docs_url = "https://docs.gtk.org/gio/"
[theme]
name = "basic"
show_index_summary = true
show_class_hierarchy = true
[extra]
urlmap_file = "../urlmap.js"
# The same order will be used when generating the index
content_files = [
"unix-mounts.md",
]
content_images = []

View File

@@ -0,0 +1,48 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
# Copyright 2023 Matthias Clasen
# Copyright 2023 Philip Withnall
[library]
name = "GioWin32"
version = "@VERSION@"
browse_url = "https://gitlab.gnome.org/GNOME/glib/"
repository_url = "https://gitlab.gnome.org/GNOME/glib.git"
website_url = "https://www.gtk.org"
docs_urls = "https://docs.gtk.org/gio-win32/"
authors = "GLib Development Team"
license = "LGPL-2.1-or-later"
description = "Windows-specific APIs in Gio"
dependencies = [ "GLib-2.0", "GModule-2.0", "GObject-2.0", "Gio-2.0" ]
devhelp = true
search_index = true
[dependencies."GLib-2.0"]
name = "GLib"
description = "The base utility library"
docs_url = "https://docs.gtk.org/glib/"
[dependencies."GModule-2.0"]
name = "GModule"
description = "Portable API for dynamically loading modules"
docs_url = "https://docs.gtk.org/gmodule/"
[dependencies."GObject-2.0"]
name = "GObject"
description = "The base type system library"
docs_url = "https://docs.gtk.org/gobject/"
[dependencies."Gio-2.0"]
name = "Gio"
description = "A library of useful classes for I/O, networking and IPC"
docs_url = "https://docs.gtk.org/gio/"
[theme]
name = "basic"
show_index_summary = true
show_class_hierarchy = true
[extra]
urlmap_file = "../urlmap.js"
# The same order will be used when generating the index
content_files = []
content_images = []

View File

@@ -47,7 +47,6 @@ content_files = [
"error.md",
"pollable-utils.md",
"unix-mounts.md",
"dbus-error.md",
"dbus-introspection.md",

View File

@@ -38,8 +38,11 @@ if get_option('documentation') and enable_gir
'overview.md',
'pollable-utils.md',
'tls-overview.md',
]
expand_content_unix_files = [
'unix-mounts.md',
]
expand_content_win32_files = []
gio_toml = configure_file(input: 'gio.toml.in', output: 'gio.toml', configuration: toml_conf)
@@ -61,4 +64,48 @@ if get_option('documentation') and enable_gir
install_dir: docs_dir,
install_tag: 'doc',
)
if host_system == 'windows'
gio_win32_toml = configure_file(input: 'gio-win32.toml.in', output: 'gio-win32.toml', configuration: toml_conf)
custom_target('gio-win32-docs',
input: [ gio_win32_toml, gio_win32_gir[0] ],
output: 'gio-win32',
command: [
gidocgen,
'generate',
gidocgen_common_args,
'--config=@INPUT0@',
'--output-dir=@OUTPUT@',
'--content-dir=@0@'.format(meson.current_source_dir()),
'@INPUT1@',
],
build_by_default: true,
depend_files: expand_content_win32_files,
install: true,
install_dir: docs_dir,
install_tag: 'doc',
)
else
gio_unix_toml = configure_file(input: 'gio-unix.toml.in', output: 'gio-unix.toml', configuration: toml_conf)
custom_target('gio-unix-docs',
input: [ gio_unix_toml, gio_unix_gir[0] ],
output: 'gio-unix',
command: [
gidocgen,
'generate',
gidocgen_common_args,
'--config=@INPUT0@',
'--output-dir=@OUTPUT@',
'--content-dir=@0@'.format(meson.current_source_dir()),
'@INPUT1@',
],
build_by_default: true,
depend_files: expand_content_unix_files,
install: true,
install_dir: docs_dir,
install_tag: 'doc',
)
endif
endif

View File

@@ -6,12 +6,16 @@ SPDX-FileCopyrightText: 2007 Matthias Clasen
## Comparison of POSIX and GIO concepts
| POSIX | GIO |
|-----------------------|-----------------------------------------------------|
| `char *path` | [iface@Gio.File] |
| `struct stat *buf` | [class@Gio.FileInfo] |
| `struct statvfs *buf` | [class@Gio.FileInfo] |
| `int fd` | [class@Gio.InputStream] or [class@Gio.OutputStream] |
| `DIR *` | [class@Gio.FileEnumerator] |
| `fstab entry` | [struct@Gio.UnixMountPoint] |
| `mtab entry` | [struct@Gio.UnixMountEntry] |
The final two entries in this table require including `gio-unix-2.0.pc` as well
as `gio-2.0.pc` in your build (or, in GIR namespace terms, `GioUnix-2.0` as well
as `Gio-2.0`).
| POSIX | GIO |
|-----------------------|-------------------------------------------------------------|
| `char *path` | [iface@Gio.File] |
| `struct stat *buf` | [class@Gio.FileInfo] |
| `struct statvfs *buf` | [class@Gio.FileInfo] |
| `int fd` | [class@Gio.InputStream] or [class@Gio.OutputStream] |
| `DIR *` | [class@Gio.FileEnumerator] |
| `fstab entry` | [`GUnixMountPoint`](../gio-unix/struct.UnixMountPoint.html) |
| `mtab entry` | [`GUnixMountEntry`](../gio-unix/struct.UnixMountEntry.html) |

View File

@@ -13,23 +13,23 @@ file when using it.
There are three main classes:
* [struct@Gio.UnixMountEntry]
* [struct@Gio.UnixMountPoint]
* [class@Gio.UnixMountMonitor]
* [struct@GioUnix.UnixMountEntry]
* [struct@GioUnix.UnixMountPoint]
* [class@GioUnix.UnixMountMonitor]
Various helper functions for querying mounts:
* [func@Gio.unix_mount_points_get]
* [func@Gio.UnixMountPoint.at]
* [func@Gio.unix_mounts_get]
* [func@Gio.unix_mount_at]
* [func@Gio.unix_mount_for]
* [func@Gio.unix_mounts_changed_since]
* [func@Gio.unix_mount_points_changed_since]
* [func@GioUnix.unix_mount_points_get]
* [func@GioUnix.UnixMountPoint.at]
* [func@GioUnix.unix_mounts_get]
* [func@GioUnix.unix_mount_at]
* [func@GioUnix.unix_mount_for]
* [func@GioUnix.unix_mounts_changed_since]
* [func@GioUnix.unix_mount_points_changed_since]
And several helper functions for checking the type of a mount or path:
* [func@Gio.unix_is_mount_path_system_internal]
* [func@Gio.unix_is_system_fs_type]
* [func@Gio.unix_is_system_device_path]
* [func@GioUnix.unix_is_mount_path_system_internal]
* [func@GioUnix.unix_is_system_fs_type]
* [func@GioUnix.unix_is_system_device_path]