summaryrefslogtreecommitdiff
path: root/docs/reference
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | build: Use fs.copyfile() instead of configure_file()Philip Withnall2022-11-231-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because Meson complains about using `configure_file(copy: true)`. Includes improvements by Xavier Claessens. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | | | Merge branch 'c-cxx-std-versions' into 'main'Marco Trevisan2022-11-221-0/+6
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Expose C and C++ standard versions and add macros to check them See merge request GNOME/glib!2895
| * | | | macros: Add a generic way to get and check the supported C standardMarco Trevisan (Treviño)2022-11-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Try to get the value of __STDC_VERSION__ if supported, if not just fallback to the oldest standard that any compiler should handle.
| * | | | gmacros: Define G_CXX_STD_VERSION and check macrosMarco Trevisan (Treviño)2022-11-211-0/+4
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sadly, in C++ there's not an universal way to get what language standard is used to compile GLib-based programs, in fact while most compilers relies on `__cplusplus`, MSVC is defining that, but it does not use it to expose such information (unless `/Zc:__cplusplus` arg is used). On the other side, MSVC reports the language standard via _MSVC_LANG [1]. This complication makes us defining some macros in a very complex way (such as glib_typeof()), because we need to perform many checks just to understand if a C++ compiler is used and what standard is expecting. To avoid this, define multiple macros that can be used to figure out what C++ standard is being used. [1] https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-170
* | | | build: Deprecate -Druntime_libdir optionPhilip Withnall2022-11-221-17/+0
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | It’s been broken since we ported to Meson and nobody has complained, so let’s deprecate it this cycle and remove it in GLib ≥ 2.78. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #2786
* | | gobject: Add G_TYPE_FLAG_DEPRECATEDMatthias Clasen2022-11-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This can be used to mark entire types as deprecated, and trigger a warning when they are instantiated and `G_ENABLE_DIAGNOSTIC=1` is set in the environment. There's currently no convenient macros for defining types with the new flag, but you can do: ```c _G_DEFINE_TYPE_EXTENDED_BEGIN (GtkAppChooserWidget, gtk_app_chooser_widget, GTK_TYPE_WIDGET, G_TYPE_FLAG_DEPRECATED) ... _G_DEFINE_TYPE_EXTENDED_END () ``` Includes a unit test by Philip Withnall.
* | | Merge branch 'variant-spec-updates' into 'main'Philip Withnall2022-11-085-62/+218
|\ \ \ | | | | | | | | | | | | | | | | docs: Add licensing/copyright data to GVariant specification and fix various formatting issues See merge request GNOME/glib!3048
| * | | docs: Fix a broken link in the GVariant SpecificationPhilip Withnall2022-11-081-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | | docs: Add a manual revision history to the GVariant SpecificationPhilip Withnall2022-11-081-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This will make it clear what the bigger changes are between versions. Kind of like a `NEWS` file for the specification. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | | docs: Add links to the D-Bus specification to the GVariant SpecificationPhilip Withnall2022-11-081-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This should clarify object paths and signatures a little, if anyone needs that. This introduces no semantic changes. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | | docs: Change ‘DBus’ to ‘D-Bus’ in the GVariant SpecificationPhilip Withnall2022-11-081-32/+32
| | | | | | | | | | | | | | | | | | | | | | | | That’s how it’s meant to be formatted. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | | docs: Fix forall formatting in GVariant SpecificationPhilip Withnall2022-11-081-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | | docs: Improve Python code snippet formatting in GVariant SpecificationPhilip Withnall2022-11-081-1/+5
| | | | | | | | | | | | | | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | | docs: Minor improvement of word choice in the GVariant SpecificationPhilip Withnall2022-11-081-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | | docs: Remove another dangling reference from the GVariant SpecificationPhilip Withnall2022-11-081-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | This is another reference to an omitted part of Allison’s thesis. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | | docs: Fix subsection capitalisation consistency in GVariant SpecPhilip Withnall2022-11-081-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | The other subheadings here are in Title Case. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | | docs: Fix a cross-reference to a Figure in the GVariant SpecificationPhilip Withnall2022-11-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reStructuredText doesn’t support cross-references unless always built with Sphinx (as I understand it). `rst2html5` doesn‘t support them. So reword this (currently manual) cross-reference so it’s less awkward. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | | docs: Fix a minor typo in the GVariant SpecificationPhilip Withnall2022-11-081-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | | docs: Fix references to omitted requirements in GVariant SpecificationPhilip Withnall2022-11-081-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I believe the specification was originally a shorter extract of Allison’s thesis. This left a few dangling references to requirements which were listed in a part of the thesis not included in the specification. Reword them slightly so they’re not quite so awkward. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | | docs: Add licensing/copyright data to GVariant specificationPhilip Withnall2022-11-085-10/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The licensing for the original GVariant specification was not specified in the original PDF. However, CC-BY-SA-3.0 has been agreed by Allison, the sole copyright holder, here: https://gitlab.gnome.org/Teams/documentation/developer-www/-/merge_requests/108/#note_1586866 The diagrams were redrawn by me, so their licensing/copyright status is clear. Tested with `reuse lint` to ensure the data is machine-readable. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | | | Revert "meson: Define G_OS_DARWIN when compiling under OSX or iOS"Philip Withnall2022-11-072-6/+0
|/ / / | | | | | | | | | | | | | | | | | | | | | This reverts commit e85635daa07e9c669ded75c476d67d02aa85c7c1. See the previous revert for rationale. Fixes: #2802
* | | Merge branch 'variant-docs' into 'main'Philip Withnall2022-11-026-0/+2624
|\ \ \ | | | | | | | | | | | | | | | | docs: Convert GVariant Specification to reStructuredText See merge request GNOME/glib!3044
| * | | Apply 2 suggestion(s) to 1 file(s)Emmanuele Bassi2022-11-011-2/+2
| | | |
| * | | docs: Convert GVariant Specification to reStructuredTextPhilip Withnall2022-11-016-0/+2624
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a verbatim conversion of the GVariant Specification from https://people.gnome.org/~desrt/gvariant-serialisation.pdf / https://raw.githubusercontent.com/ostreedev/gvariant-rs/master/docs/gvariant-serialisation.pdf to reStructuredText. This is for several reasons: 1. The canonical copy has gone offline due to people.gnome.org being shut down. 2. GLib is the reference implementation of GVariant, so should probably host the specification (unless someone wants to host it on freedesktop-specs). 3. Moving it out of a PDF and into reStructuredText should allow for amendments. The specification has a few problems, typos and oversights in its original form, and it would be good to canonically fix them without having to write a separate addendum document. This conversion is verbatim, and does not change the content of the document at all, even to fix typos and broken links (which there are a small number of in the PDF). This describes what I’m labelling as version 1.0 of the GVariant serialisation format. Updates to the specification can bump this version number, in subsequent commits. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | | | gtask: Add g_task_set_static_name()Matthias Clasen2022-11-011-0/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to g_source_set_static_name, this avoids strdup overhead for debug-only information in possibly hot code paths. We also add a macro wrapper for g_task_set_name that uses __builtin_constant_p to decide whether to use g_task_set_name or g_task_set_static_name.
* | | gio: Create a sandbox checking functionRobert Ancell2022-11-011-0/+1
| | |
* | | meson: Expose library build type as global variablesMarco Trevisan (Treviño)2022-10-311-5/+5
| | | | | | | | | | | | | | | | | | Given that it can be computed using an error-prone strings comparisons it is better to provide a variable everywhere, so that we don't have the risk of comparing values that are always false.
* | | gstdio: Add g_clear_fd() and g_autofdSimon McVittie2022-10-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inspired by libglnx's glnx_close_fd() and glnx_autofd, these let us have the same patterns as g_clear_object() and g_autoptr(GObject), but for file descriptors. g_clear_fd() is cross-platform, while g_autofd is syntactic sugar requiring a supported compiler (gcc or clang). Now that g_close() checks for EBADF as a programming error, we can implement the equivalent of glnx_autofd as an inline function without needing to have errno and EBADF in the header file. g_clear_fd() is like glnx_close_fd(), but with error checking. The private _g_clear_fd_ignore_error() function used to implement g_autofd is a closer equivalent of glnx_close_fd(). Signed-off-by: Simon McVittie <smcv@collabora.com>
* | | meson: Define G_OS_DARWIN when compiling under OSX or iOSMarco Trevisan (Treviño)2022-10-202-0/+6
|/ / | | | | | | It has enough differences to expose it as an unix-subtype.
* | Merge branch 'wip/chergert/g_set_str' into 'main'Philip Withnall2022-10-151-0/+1
|\ \ | | | | | | | | | | | | | | | | | | strfuncs: add g_set_str() Closes #2747 See merge request GNOME/glib!2927
| * | strfuncs: add g_set_str()Christian Hergert2022-10-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is like our other suite of g_set_*() based APIs to simplify and improve correctness of setters for fields, properties, and more. This implementation specifically handles setting string values that may point to an offset within the current string by copying before free. strcmp() is used directly (as opposed to g_strcmp0() due to it being in gtestutils.h as well as to increase the chance that the compiler will hoist the implementation. Fixes #2747
* | | gboxed: Add GBookmarkFile as Boxed typesMarco Trevisan (Treviño)2022-10-141-0/+2
| | | | | | | | | | | | | | | Now that we've a copy function we can define it as a boxed type, making it fully introspectable.
* | | gbookmarkfile: Add copy functionMarco Trevisan (Treviño)2022-10-141-0/+1
|/ / | | | | | | | | | | | | | | GBookmarkFile has everything for being introspectable, but it lacks a GType, because it can't be copied. So provide a copy function that deeply copies all the bookmark structures. Add tests for this.
* | docs: Add 2.76 release series documentation pages to the buildPhilip Withnall2022-10-143-0/+12
| | | | | | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | Fix symbol visibility macros on WindowsXavier Claessens2022-10-137-344/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is currently no `dllimport` attribute on any of our function, which prevents MSVC to optimize function calls. To fix that issue, we need to redeclare all our visibility macros for each of our libraries, because when compiling e.g. GIO code, we need dllimport in GLIB headers and dllexport in GIO headers. That means they cannot use the same GLIB_AVAILABLE_* macro. Since that's a lot of boilerplate to copy/paste after each version bump, this MR generate all those macros using a python script. Also simplify the meson side by using `gnu_symbol_visibility : 'hidden'` keyword argument instead of passing the cflag manually. This leaves only API index to add manually into glib-docs.xml when bumping GLib version. That file cannot be generated because Meson does not allow passing a buit file to gnome.gtkdoc()'s main_xml kwarg unfortunately.
* | Build API docs only with shared librariesEmmanuele Bassi2022-09-141-0/+6
| | | | | | | | | | | | Building the references requires libraries with all their symbols available. Passing `-Dgtk_doc=true` and `-Ddefault_library=static` should be considered a configuration error.
* | docs: Add --delete option to gio-tool attributes documentationMarco Trevisan (Treviño)2022-08-051-0/+4
| | | | | | | | It was added via !2845 but not documented.
* | Improve default value of glib_debug optionMichael Catanzaro2022-08-031-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | glib_debug is an auto option. This is clever because it allows us to guess the best default based on the build type, while also allowing an easy way to override if the guess is not good. Sadly, the attempt to guess based on the build type does not work well. For example, it considers debugoptimized builds to be debug builds, but despite the name, it is definitely a release build type (except on Windows, which we'll ignore here). The minsize build type has the exact same problem. The debug option is true for both build types, but this only controls whether debuginfo is enabled, not whether debug extras are enabled. The plain build type has a different problem: debug is off, but the optimization option is off too, even though plain builds are distro builds are will almost always use optimization. I've outlined an argument for why we should make these changes here: https://blogs.gnome.org/mcatanzaro/2022/07/15/best-practices-for-build-options/ Specifically, Rule 4 shows all the build types and whether they correspond to release builds or debug builds. Rule 6 argues that we should provide good defaults for plain builds.
* | replace pcre1 with pcre2Aleksei Rybalkin2022-07-121-46/+0
| |
* | Merge branch 'inline-macros' into 'main'Philip Withnall2022-07-061-0/+5
|\ \ | | | | | | | | | | | | gmacros: Provide platform-independent G_ALWAYS_INLINE and G_NO_INLINE See merge request GNOME/glib!2781
| * | gmacros: Provide platform-independent G_ALWAYS_INLINE and G_NO_INLINEMarco Trevisan (Treviño)2022-07-061-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | We had gcc-only implementations for them while both can be used in all the supported platforms we have. So let's just provide generic definitions, while we keep the old ones for both consistency and retro-compatibility.
* | | docs: Mention alternatives for defining enumeration typesEmmanuele Bassi2022-06-301-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should mention glib-mkenums in the documentation for G_DEFINE_ENUM_TYPE and G_DEFINE_FLAGS_TYPE. We should also mention the macros in the documentation for glib-mkenums. This way, developers can choose the most appropriate tool for their use case.
* | | docs: Add the new G_DEFINE macros for enumeration typesEmmanuele Bassi2022-06-301-0/+3
|/ /
* | Merge branch 'atomic-exchange-pre-value' into 'main'Philip Withnall2022-06-231-0/+2
|\ \ | | | | | | | | | | | | gatomic: Add Compare and Exchange functions that returns the previous value See merge request GNOME/glib!2766
| * | gatomic: Add Compare and Exchange functions that returns the previous valueMarco Trevisan (Treviño)2022-06-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Atomic primitives allow to do conditional compare and exchange but also to get the value that was previously stored in the atomic variable. Now, we provided an exchange function that allows to do an exchange if the atomic value matches an expected value but we had no way to know at the same time what was the value in the atomic at the moment of the exchange try, an this can be useful in case that the operation fails, for example if the current value is still acceptable for us, allowing to do a kind of "OR" check: gint old_value; gint valid_value = 222; while (!g_atomic_pointer_compare_and_exchange_value (&atomic, valid_value, 555, &old_value) { if (old_value == 555 || old_value == 222) valid_value = old_value; }
* | | Merge branch 'more-async-gfile' into 'main'Philip Withnall2022-06-231-0/+11
|\ \ \ | |/ / |/| | | | | | | | gfile (and GAppInfo): Add some missing async APIs and ensure async calls always use them See merge request GNOME/glib!2717
| * | GAppInfo: Add async API to get default Application for URI schemeMarco Trevisan (Treviño)2022-06-221-0/+2
| | | | | | | | | | | | | | | Make possible to fetch the default application for URI scheme in a thread without using blocking I/O.
| * | GAppInfo: Add async API to get default Application for content typeMarco Trevisan (Treviño)2022-06-221-0/+2
| | | | | | | | | | | | | | | Make possible to fetch the Application for default content type in a thread without using blocking I/O.
| * | gfile: Add Async API to create a temporary directory and return as GFileMarco Trevisan (Treviño)2022-06-221-0/+2
| | | | | | | | | | | | | | | | | | | | | While it's possible to create a directory synchronously via g_dir_make_tmp(), there's no such API that performs it asynchronously. So implement it using GFile, using a thread to perform such task.
| * | gfile: Add API to create a new temporary file asynchronouslyMarco Trevisan (Treviño)2022-06-221-0/+2
| | | | | | | | | | | | | | | Make possible to create a new gfile with a temporary name in async way, using the same API of g_file_new_tmp().