Commit Graph

2914 Commits

Author SHA1 Message Date
Michael Catanzaro
35bccc46f9
Correct installation directory of GVariant specification
548ec9f186 accidentally moved the GVariant
spec to the toplevel /usr/share/doc directory, which is surely not
right. Let's move it back into the glib-2.0 subdirectory.

It's debatable whether this is the best place to install the GVariant
specification, since it's not part of the gi-docgen docs, but surely
it's much better than not putting it in any subdirectory.

Fixes #3351
2024-05-08 15:43:25 +01:00
Philip Withnall
548ec9f186 docs: Reduce nesting of documentation directories
The `gi-docgen` tool is not designed to be used like that. In
particular, when nesting documentation directories, the generated
`*.devhelp2` files (needed by Devhelp to show the documentation) are
nested one directory level too deep for Devhelp to find them, and hence
are useless, and the documentation doesn’t show up in this common
documentation viewer.

So, change the installed documentation directory hierarchy:
 * `${PREFIX}/share/doc/glib-2.0/gio` → `${PREFIX}/share/doc/gio-2.0`
 * `${PREFIX}/share/doc/glib-2.0/glib-unix` →
   `${PREFIX}/share/doc/glib-unix-2.0`
 * `${PREFIX}/share/doc/glib-2.0/gobject` →
   `${PREFIX}/share/doc/gobject-2.0`
 * etc.
 * `${PREFIX}/share/doc/glib-2.0/glib` → `${PREFIX}/share/doc/glib-2.0`

This is going to seem like pointless churn (the contents of the
documentation have not changed), and packagers may mourn the split of
content in `/usr/share/doc` from `/usr/share/doc/${package_name}` to
`/usr/share/doc/${pkg_config_id}` instead, but that seems to be the best
approach to fix this issue in GLib. gi-docgen’s behaviour does feel
fairly consistent and correct with the rest of how it works (single
output directory).

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

Fixes: #3287
2024-03-13 18:51:21 +00:00
Philip Withnall
fafe1a14a8 docs: Minor reformatting / gi-docgenification of signals docs
This is nowhere near a complete check-through and gi-docgenification of
the signals docs, just a few bits I was looking at anyway.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3250
2024-03-07 13:12:07 +00:00
Philip Withnall
8a640f50ca docs: Document signal handler types and arguments
It seems this was missing from the documentation (or, at least, not in
an obvious place).

As spotted on
https://discourse.gnome.org/t/calling-g-main-loop-quit-from-a-signal-handler/19785.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-03-07 13:12:07 +00:00
Philip Withnall
a6dbfcd601 docs: Slightly rephrase signals docs to not use the first person
The rest of the documentation style is to be more indirect, so let’s
consistently use that.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-03-06 13:21:56 +00:00
Philip Withnall
536bdabd6e docs: Add subheadings to signals documentation page
Splits the text up a bit and allows linking directly to those subsections.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-03-06 13:21:30 +00:00
Michael Catanzaro
a767439117 Merge branch 'wip/bobby285271/fix-docs-dir' into 'main'
docs: Fix building with docs enabled and introspection disabled

See merge request GNOME/glib!3955
2024-03-06 01:12:51 +00:00
Bobby Rong
dd97c88f90 docs: Fix building with docs enabled and introspection disabled
We install gvariant-specification-1.0.html to `docs_dir` but that shouldn't require `enable_gir`.

Fixes: docs/reference/glib/meson.build:26:16: ERROR: Unknown variable "docs_dir"
Part-of: <https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3955>
2024-03-05 16:45:21 +00:00
Bobby Rong
c7476cd615 docs: Specify gi-docgen as a native dependency
gi-docgen is supposed to be ran natively on the build machine.

Part-of: <https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3953>
2024-03-05 22:23:01 +08:00
Philip Withnall
9ed0ce21df docs: Fix a typo in the macros docs page
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-29 13:58:53 +00:00
Philip Withnall
257b98027b Merge branch 'wip/smcv/gir-man-pages' into 'main'
Add man pages for gi-* tools

Closes #3260 and gobject-introspection#55

See merge request GNOME/glib!3924
2024-02-15 21:37:35 +00:00
Simon McVittie
2cc82bd2ca Add a man page for gi-inspect-typelib
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-14 12:07:46 +00:00
Simon McVittie
b0163afd3b Add gi-* man pages to the build system
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-14 12:07:46 +00:00
Simon McVittie
66fda286e1 g-ir- tools: Add examples to man pages
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-14 12:07:46 +00:00
Simon McVittie
d0cb89538a Retitle gi-* man pages and update content
gi-compile-repository --module and gi-decompile-typelib --shlib are
intentionally undocumented here: they will be removed in !3926.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-14 12:07:46 +00:00
Simon McVittie
615c51988d Spell Matthias' name correctly in the gi-* man pages
This was wrong since 2008.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-14 12:07:46 +00:00
Simon McVittie
bca2ad0c03 Add metadata header to gi-* man pages
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-14 12:07:46 +00:00
Simon McVittie
30e8c6a1de Rename man pages to the tools' GLib names
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-14 12:07:46 +00:00
Simon McVittie
e37c94817d Move g-ir-compiler, g-ir-generate man pages to docs/reference/girepository
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-14 12:07:46 +00:00
Simon McVittie
8440742c12 migrating-gi: Document command-line option removals
From !3926, !3927.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-14 12:03:36 +00:00
Simon McVittie
64762fdef6 gi-decompile-typelib: Interpret --includedir as most-important-first
This is a behaviour change from g-ir-generate, which treats it as
least-important-first (the last directory on the command-line is
searched first).

gi-compile-repository --includedir and gcc -I are most-important-first
(the first directory on the command-line is searched first) so it seems
like it makes most sense to be consistent with that.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-14 12:00:05 +00:00
Philip Withnall
4314944e56 introspection: Drop Unix and Win32 prefixes from platform specific APIs
So now introspection users will have to call `GLibUnix.open_pipe()`
rather than `GLibUnix.unix_open_pipe()` — or
`GLibWin32.check_windows_version()` rather than
`GLibWin32.win32_check_windows_version()`.

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

Helps: #3037
2024-02-12 17:54:36 +00:00
Philip Withnall
434d3ff524 docs: Mention GioUnix-2.0 GIR namespace alongside gio-unix-2.0.pc
This should clarify things a little for users of language bindings, who
don’t directly use `.pc` files.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-12 17:54:10 +00:00
Philip Withnall
c498c9a8c9 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
2024-02-12 17:54:10 +00:00
Philip Withnall
4c178fa623 build: Combine duplicate urlmap.js files
Seems no point in keeping them separate. It doesn’t seem to matter if
they contain entries which are unused for a particular docs build.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-12 17:54:10 +00:00
Philip Withnall
3695249ebb docs: Drop unnecessary GdkPixbuf reference from urlmap.js
It was unused.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-12 17:54:10 +00:00
Philip Withnall
f51398af91 girepository: Drop GIBoxedInfo
See the previous commit for details.

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

Helps: #3245
2024-02-12 13:17:04 +00:00
Philip Withnall
8248382d8b gi-inspect-repository: Change --version argument to --typelib-version
`--version` is conventionally used to find the version of the program
itself. While that’s not currently implemented in
`gi-inspect-repository`, let’s not box ourselves into a corner.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-09 20:41:17 +00:00
Philip Withnall
d6d845aee3 docs: Add missing migration guide for gi_repository_get_shared_libraries()
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-09 20:40:47 +00:00
Philip Withnall
45468f1bb8 docs: Document girepository-2.0 utility program name changes
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-09 20:40:46 +00:00
Philip Withnall
343027d5de girepository: Make GIInfoType private
Eventually, we want to move to using `GType` directly for everything,
since `GIBaseInfo` and its subclasses are all using `GTypeInstance`.

However, that requires quite a lot of changes and we’re about to hit the
API freeze.

So do the smallest set of changes possible to remove `GIInfoType` and
related functions from the public API, which gives us freedom to make
more changes later without breaking API.

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

Helps: #3155
2024-02-08 12:56:02 +00:00
Philip Withnall
86cd95f1ae Merge branch 'gi-info-new' into 'main'
gibaseinfo: Rename gi_info_new() to gi_base_info_new()

See merge request GNOME/glib!3903
2024-02-08 10:34:40 +00:00
Philip Withnall
beb59595b7 gibaseinfo: Rename gi_info_new() to gi_base_info_new()
It’s actually a factory method rather than a constructor, since
`GIBaseInfo` is abstract, but despite that, changing the name so it sits
inside the `GIBaseInfo` class makes sense. There is no `GIInfo` type.

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

Helps: #3155
2024-02-08 10:34:40 +00:00
Philip Withnall
e1cff511e5 Merge branch '3155-union-tests' into 'main'
gitypes: Fix integer values of GIInfoType and add unit tests for GIUnionInfo

See merge request GNOME/glib!3888
2024-02-08 10:25:13 +00:00
Philip Withnall
78698af73f Merge branch '3246-object-info-docs' into 'main'
girepository: Fix declaration of ‘find using interfaces’ methods

Closes #3246

See merge request GNOME/glib!3883
2024-02-08 10:19:16 +00:00
Philip Withnall
62abd578cd Merge branch '3155-typelib-boxed' into 'main'
gitypelib: Switch to refcounting

See merge request GNOME/glib!3900
2024-02-08 10:18:40 +00:00
Philip Withnall
a138589d57 Merge branch 'repository-n-elements' into 'main'
girepository: Add length ‘out’ arguments to several getter methods

See merge request GNOME/glib!3901
2024-02-08 10:18:12 +00:00
Philip Withnall
6fe7edbc8d Merge branch 'girepository-migration-docs' into 'main'
docs: Add migration guide for libgirepository

See merge request GNOME/glib!3881
2024-02-08 10:10:40 +00:00
Philip Withnall
5cc5f413f5 gitypelib: Switch to refcounting
Since `GITypelib` is exposed in the public libgirepository API, it needs
to be a boxed type. So we either need to add a `copy` method to mirror
the existing `free` method, or switch to refcounting. The latter option
seems better, since a `GITypelib` contains internal state about open
`GModule`s and the semantics for copying that would be potentially
complex.

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

Helps: #3155
2024-02-07 21:07:18 +00:00
Philip Withnall
01f9796532 girepository: Add length ‘out’ arguments to several getter methods
This makes them consistent with the other getter methods in
`GIRepository` which return lists/arrays. It’s useful to return the
length, as that means the caller doesn’t have to work it out by
iterating over the entire array.

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

Helps: #3155
2024-02-07 15:47:13 +00:00
Simon McVittie
040caa5f6a gdbus-codegen(1): Suggest --pragma-once for headers written to stdout
Otherwise we would generate a multiple-inclusion guard of the
form `#ifndef __STDOUT__ ...`, which can only work for one D-Bus
interface per translation unit.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-06 14:06:51 +00:00
Simon McVittie
fc7942f46b gdbus-codegen: If writing body to stdout, don't try to include header
If we're writing the body to standard output, we cannot know what the
filename of the corresponding header is going to be, but it seems
vanishingly unlikely that it will be either `stdout.h` (which we would
traditionally have generated) or `-.h` (which we would have generated
since !3886).

This makes some of the output snippets sufficiently short that black(1)
requires that they are folded into a single line.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-06 14:06:45 +00:00
Philip Withnall
11e8075e51 giunioninfo: Split success and return value for get_discriminator_offset()
Otherwise there’s no obvious suitable return value to return when the
union is *not* discriminated.

This is an API break, but libgirepository has not been in a stable
release yet, so that’s fine.

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

Helps: #3155
2024-02-06 13:34:17 +00:00
Simon McVittie
1ba8386886 codegen: Document --output -
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-06 11:53:06 +00:00
Philip Withnall
7acef299c2 girepository: Fix declaration of ‘find using interfaces’ methods
Fix the declaration and documentation of
`gi_object_info_find_method_using_interfaces()` and
`gi_object_info_find_vfunc_using_interfaces()`. The documentation was
wrong when I wrote it: the value returned is the object or interface
which declares the method or vfunc, not the one which implements it.

The returned declarer info may be a `GIObjectInfo` or a
`GIInterfaceInfo`. Since those two types have no subtype relation
between them, the return type has to be changed to `GIBaseInfo`. Using
`GIObjectInfo` would have been fine in girepository-1.0 because all
`*Info` types were aliases of each other — but since the move to
`GTypeInstance` this is no longer true.

A unit test will be in the following commit.

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

Fixes: #3246
2024-02-05 18:40:03 +00:00
Philip Withnall
702719dee9 build: Ensure the libgirepository docs are installed
Make the `meson.build` match the other docs `meson.build` files.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-05 18:03:52 +00:00
Philip Withnall
bad849347d docs: Add migration guide for libgirepository
This covers all the API changes from girepository-1.0 to
girepository-2.0 so far.

It was generated by manually looking through the changes in `git diff
af36393e6.. -- girepository/*.h`.

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

Helps: #3155
2024-02-05 18:03:52 +00:00
Jordan Petridis
e0b7ab81cf docs: Fix include path for the build
f75221c7ea moved the introspection
folder around, but we also need to adjust the relative path so
the documentation will keep building
2024-02-02 12:54:07 +02:00
Michael Catanzaro
8f34e90bc3 Link to the main context tutorial from the main loop docs
This might help increase visibility of Philip's useful GMainContext
tutorial. Although the GMainContext documentation is fairly good, it's
also pretty intimidating. The tutorial is very useful and provides
guidance that we can't fit directly into the documentation, so reference
it.
2024-01-31 11:56:56 -06:00
Emmanuele Bassi
4ff4f073a4 Merge branch 'altiera/docs' into 'main'
docs: Fix links to symbols outside the allowed namsepace

See merge request GNOME/glib!3809
2024-01-18 18:35:21 +00:00