Commit Graph

2457 Commits

Author SHA1 Message Date
Emmanuele Bassi
f9bbee7db2 Merge branch '1726-codegen-glib-min-version' into 'master'
gdbus-codegen: Emit GUnixFDLists if an arg has type `h` w/ min-version

Closes #1726

See merge request GNOME/glib!1263
2019-12-12 12:49:34 +00:00
Philip Withnall
fcc1367383 Merge branch 'gtkdoc-check-fix' into 'master'
Various gtk-doc improvements

See merge request GNOME/glib!1277
2019-12-11 13:02:20 +00:00
Xavier Claessens
df4fb2cd32 Revert "docs: remove GDBusObjectManager example"
This reverts commit 398c048c66.

It got removed because it used to cause build issues, but now that we
have a CI let's hope it won't be a problem any more.
2019-12-11 12:16:27 +00:00
Bastien Nocera
cd6612dfb7 gio: Add GMemoryMonitor to monitor for low-memory
Add a memory monitor object, with D-Bus and Portal based
implementations. The D-Bus implementation uses the Linux-only
low-memory-monitor Freedesktop project.

Low Memory Monitor D-Bus API:
https://hadess.pages.freedesktop.org/low-memory-monitor/

Android API:
https://developer.android.com/reference/android/content/ComponentCallbacks2.html#onTrimMemory(int)

iOS API:
https://developer.apple.com/documentation/uikit/app_and_environment/managing_your_app_s_life_cycle/responding_to_memory_warnings

Win32 API:
https://docs.microsoft.com/en-us/dotnet/api/microsoft.win32.systemevents.lowmemory?view=netframework-4.8

Tizen API:
https://samsung.github.io/TizenFX/master/api/Tizen.Applications.EventManager.SystemEvents.LowMemory.html
2019-12-11 11:44:42 +00:00
Philip Withnall
90f0733858 gdbus-codegen: Add a --glib-min-version argument
This can be used by callers to opt-in to backwards-incompatible changes
to the behaviour or output of `gdbus-codegen` in future. This commit
doesn’t introduce any such changes, though.

Documentation and unit tests included.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1726
2019-12-11 10:40:07 +00:00
Philip Withnall
b698327b99 Merge branch 'cherry-pick-6ea0dcc6' into 'master'
doc: Add missing --ignore-decorators

Closes #1953

See merge request GNOME/glib!1260
2019-12-03 12:48:37 +00:00
Xavier Claessens
160143ae27 gtk-doc: Ensure we have recent enough version
Older versions won't produce errors, but will silently miss
documentation for a few symbols.
2019-12-01 08:25:04 -05:00
Xavier Claessens
7b65b77a65 doc: Add missing --ignore-decorators
(cherry picked from commit 6ea0dcc6c9af0c0e8cfebc77412838f5174b7dbc)
2019-11-29 18:43:10 +00:00
Emmanuele Bassi
cc3716a943 Merge branch 'thread-safe-getpwnam' into 'master'
glocalvfs: Use thread-safe getpwnam_r() rather than getpwnam()

Closes #1687

See merge request GNOME/glib!681
2019-11-27 11:58:51 +00:00
Philip Withnall
34cb297a86 Merge branch 'wip/nielsdg/g-list-store-find' into 'master'
gliststore: Add item lookup functions

Closes #1011

See merge request GNOME/glib!1096
2019-11-27 11:22:56 +00:00
Philip Withnall
94a800fb9d glib-unix: Add g_unix_get_passwd_entry() function
This is a convenience wrapper around getpwnam_r() which handles all the
memory allocation faff.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1687
2019-11-26 12:17:04 +00:00
Ernestas Kulik
58ba7d78fb list, slist: Add g_clear_{s,}list()
Although not quite as often-occurring, this should help with constructs
like this:

  if (list)
    {
      g_list_free_full (list, foo);
      list = NULL;
    }

Closes https://gitlab.gnome.org/GNOME/glib/issues/1943
2019-11-25 13:09:25 +01:00
Garrett Regier
6cac760551 task: Add return/propagate API for GValue
This is useful for bindings.

Related: https://gitlab.gnome.org/GNOME/glib/issues/668
2019-11-15 10:37:42 +00:00
Simon McVittie
81936ca580 Make ld executable configurable
Tools like this should be configurable in a cross or native file. In
particular, if we are cross-compiling (with an executable wrapper like
qemu-arm), the build system ld is not necessarily able to manipulate
host system objects.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-11-04 15:08:33 +00:00
Simon McVittie
61f693fb21 Merge branch '1916-objcopy-cross-compilation' into 'master'
tests: Use objcopy from the cross-compilation file, if configured

Closes #1916

See merge request GNOME/glib!1188
2019-10-28 20:06:50 +00:00
Philip Withnall
c73bd53eb8 Merge branch 'fbsd_build' into 'master'
Update documentation with FreeBSD build instructions

See merge request GNOME/glib!1120
2019-10-28 17:26:26 +00:00
Philip Withnall
57aaee76d5 docs: Add objcopy to example cross-compilation file
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1916
2019-10-28 12:11:12 +00:00
Philip Withnall
21f8f89820 gmain: Add GMainContextPusher convenience API
This is like `GMutexLocker`, in that if you are able to use
`g_autoptr()`, it makes popping a `GMainContext` off the thread-default
main context stack easier when exiting a function.

A few uses of `G_GNUC_{BEGIN,END}_IGNORE_DEPRECATIONS` are needed to
avoid warnings when building apps against GLib with
`GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_64`.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-10-23 11:35:58 +01:00
Philip Withnall
0869cdedcf Merge branch '1858-tutorial-deprecated-gobject-api' into 'master'
Fix handling of private object members in GObject property tutorial

Closes #1858

See merge request GNOME/glib!1069
2019-10-10 13:15:39 +00:00
Jonas Ådahl
15e3b6f136 gmessages: Add g_warning_once()
In many places the pattern

    static gboolean warned_once = FALSE;
    if (!warned_once)
      {
        g_warning ("This and that");
        warned_once = TRUE;
      }

is used to not spam the same warning message over and over again. Add a
helper in glib for this, allowing the above statement to be changed to

    g_warning_once ("This and that");
2019-10-09 16:39:31 +02:00
Philip Withnall
45c91d7ed6 Merge branch 'g-os-info' into 'master'
gutils: Add g_get_os_info()

See merge request GNOME/glib!1063
2019-10-08 10:30:24 +00:00
Paolo Bonzini
7bada8394d Add g_array_steal(), g_ptr_array_steal() and g_byte_array_steal()
Closes issue #285
2019-10-07 14:38:24 +02:00
Philip Withnall
d207e19d32 Merge branch 'wip/tingping/pkcs11' into 'master'
gtlscertificate: Add pkcs11-uri property and constructor

Closes #1809

See merge request GNOME/glib!933
2019-10-03 12:12:16 +00:00
Patrick Griffis
b6d8efbebc gtlscertificate: Add support for PKCS #11 backed certificates
This adds properties to allow backends to expose PKCS #11 support.
2019-10-02 10:12:40 -07:00
rim
4d362a5afe Update documentation with FreeBSD build instructions 2019-09-30 23:06:53 +03:00
Philip Withnall
2268f36769 gio-tool: Add a --default-permissions argument to gio copy
This sets the `G_FILE_COPY_DEFAULT_PERMS` flag on the operation,
creating the copied file with default permissions rather than the same
permissions as the source file.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #174
2019-09-30 14:40:50 +01:00
Robert Ancell
349318e8db gutils: Add g_get_os_info()
Add a new function that gets OS information for /etc/os-release.
2019-09-27 15:47:03 +12:00
Niels De Graef
14ba521b6d gliststore: Add item lookup functions
Currently, there is no quick way to find whether and element is already
part of a list store, except for manually writing a for-loop and calling
`g_list_model_get_item()` and breaking when you find the item.

This is mostly just a small API addition to support this use case.

Fixes https://gitlab.gnome.org/GNOME/glib/issues/1011
2019-09-25 08:37:22 +02:00
Philip Withnall
d0964b72db docs: Fix typo in GConverter{Input,Output}Stream section titles
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-24 12:25:10 +01:00
Nirbheek Chauhan
e3b87b6ffb Merge branch 'add_g_fsync_function' into 'master'
Add a wrapper for fsync() function

Closes #35

See merge request GNOME/glib!1104
2019-09-23 11:22:25 +00:00
Emmanuele Bassi
b96e318f3a docs: Remove priv pointers from the tutorial example
We define `ViewerFile` as a final type with fields directly in the
instance structure. This means we don't have a `priv` pointer to
dereference.
2019-09-20 11:38:47 +02:00
Todd Goyen
3636bb5fe1 Add a wrapper for fsync() function
Closes issue #35
2019-09-18 10:47:23 +02:00
Philip Withnall
3b1e301ab5 gversionmacros: Add version macros for GLib 2.64
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-17 12:24:16 +01:00
Xavier Claessens
65f64f0988 Fix doc build on Windows
This is a work around for this Meson bug:
https://github.com/mesonbuild/meson/issues/5893

Closes: #1888
2019-09-09 08:51:46 -04:00
Philip Withnall
ca60cd3314 tutorial: Add private members to example code in tutorial
Add the private members referred to in the property setting/getting
example, and a finalize function for them, to make the tutorial code
more self-contained.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1858
2019-08-29 09:20:01 +01:00
Philip Withnall
22b59c91ad tutorial: Stop referring to ->priv for example class
The class has used `G_DECLARE_FINAL_TYPE` for a while now, so doesn’t
have a `priv` struct. Private members are declared inline.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1858
2019-08-29 09:19:03 +01:00
Philip Withnall
61912bffb5 tutorial: Improve type safety of property usage in GObject tutorial
This means that if you compile with `-Wswitch-enum`, the compiler will
warn you about properties which you’ve forgotten to handle in
`set_property()` or `get_property()`.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1858
2019-08-29 09:12:18 +01:00
Nirbheek Chauhan
7952a74721 CODEOWNERS: Add myself as co-owner of Windows stuff
because I am a sucker for punishment.
2019-08-27 12:57:32 +05:30
Nirbheek Chauhan
4387f7b7b6 Merge branch '1803-gio-open-docs' into 'master'
docs: Mention environment variables in `gio open` documentation

Closes #1803

See merge request GNOME/glib!1051
2019-08-26 12:22:06 +00:00
Philip Withnall
b2eb0a6f15 docs: Mention environment variables in gio open documentation
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1803
2019-08-25 11:05:07 +03:00
Дилян Палаузов
512655aa12 minor typos in the documentation (a/an) 2019-08-24 19:14:05 +00:00
Philip Withnall
37b2093f28 Merge branch 'contributing-fixes' into 'master'
Remove mentions of mailing lists from the documentation

See merge request GNOME/glib!1002
2019-08-05 10:20:40 +00:00
Philip Withnall
d166a55c64 gfileinfo: Add g_file_info_{get,set}_modification_date_time() APIs
These are alternatives to g_file_info_{get,set}_modification_time(),
which will soon be deprecated due to using the deprecated GTimeVal
type, which is not year 2038 safe.

The new APIs take a GDateTime instead.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
dbabd2b8a7 gdatetime: Add g_date_time_format_iso8601() convenience function
This is a simple wrapper around g_date_time_format_iso8601() which
always produces ISO 8601 dates, without people having to remember the
format string for them (and with the convenience of terminating UTC
dates with ‘Z’ rather than ‘+00’).

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1438
2019-07-29 12:27:29 +01:00
Simon McVittie
b76bf3ca72 gobject: Add a g_assert_finalize_object() macro
With modifications by Philip Withnall.

Fixes: #488
2019-07-25 15:23:21 +01:00
Emmanuele Bassi
dd42b8f01f docs: Remove mentions of mailing lists
We use a tag on Discourse, now.
2019-07-23 11:27:30 +01:00
Philip Withnall
249299a76f Merge branch 'doc-fixes' into 'master'
Various doc fixes

See merge request GNOME/glib!982
2019-07-17 10:58:21 +00:00
Emmanuel Fleury
628e448e02 Fixing a small typo in docs/references/gio/gio.xml
Fix issue #1828
2019-07-12 17:49:51 +02:00
Xavier Claessens
61872d60b5 doc: Add gobject 2.62 API 2019-07-10 10:29:04 -04:00
Xavier Claessens
e528577202 doc: Add missing GNativeSocketAddress 2019-07-10 10:29:04 -04:00