Commit Graph

2396 Commits

Author SHA1 Message Date
Tristan Partin
b9988e5fc9 Add g_timer_is_active
Helper function for exposing the internal state of a GTimer.
2019-06-21 10:22:41 +00:00
Philip Withnall
fa5996927f Merge branch 'drop-g-disable-deprecated' into 'master'
Drop G_DISABLE_DEPRECATED

Closes #1060 and #638

See merge request GNOME/glib!871
2019-06-14 11:24:25 +00:00
Simental Magana, Marcos
51e7ce2c20 docs: fix typo on arrays examples in gvariant-text
example lists [(1, 2), (3, 4.0)], but mentions numbers
1 and 4 being parsed as integrers, this seems wrong as
4.0 its explicitly parsed as double.

Signed-off-by: Simental Magana, Marcos <marcos.simental.magana@intel.com>
2019-06-12 10:56:07 -05:00
Philip Withnall
1741fc2c6e build: Drop use of G_DISABLE_DEPRECATED from the build system
It’s no longer used in any of the headers. See preceding commits.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-05-30 10:38:45 +01:00
Patrick Storz
56149722ae Add g_get_console_charset
Queries the charset used by the associated console, which does not
necessarily match the charset of the current locale as returned by
g_get_charset.

Fixes https://gitlab.gnome.org/GNOME/glib/issues/1270
2019-05-27 17:51:40 +00:00
Philip Withnall
4da8b7b35a gtestutils: Add g_test_summary() to add summary metadata to unit tests
This is a new function along the same lines as g_test_bug(): to allow
developers to annotate unit tests with information about the test (what
it tests, how it tests it) for future developers to read and learn from.

It will also output this summary as a comment in the test’s TAP output,
which might clarify test results.

Includes a unit test.

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

Fixes: #1450
2019-05-21 12:33:15 +01:00
Marco Trevisan (Treviño)
409c1522bc gisgnal: Add g_clear_signal_handler
It allows to disconnect a signal handler from GObject instance and at the same
time to nullify the signal handler.

Provided also a macro for handler type conversion.
2019-05-20 13:33:41 -05:00
Philip Withnall
0470cccec8 docs: Fix typo in Meson cross-compilation instructions
Meson accepts `--cross-file`, but not `--cross_file`.

Spotted by Carlo Bramini.

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

Fixes: #1782
2019-05-20 12:11:24 +01:00
Philip Withnall
662cddcb4b glib: Deprecate gtester and gtester-report
Add warnings about their deprecation everywhere. The tools will continue
to work until we break API, but will be less well maintained. You should
use TAP for communicating test results to the test harness provided by
your build system or CI system instead.

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

Fixes: #1441
2019-05-14 12:14:54 +01:00
Kalev Lember
e4bd6dd515 Add autoptr support for GRWLock 2019-05-10 12:48:20 +02:00
Marco Trevisan (Treviño)
1d96e94070 gmacros: Add g_autoqueue to automatically free queues
This works as g_auto(s)list already does, and allows to create queues that are
fully auto free'd on destruction.
2019-05-08 14:25:24 -05:00
Christian Hergert
a4c3feb835 queue: add g_queue_insert_before_link() and g_queue_insert_after_link()
This adds two new helpers that allow for inserting pre-allocated GList
elements to the queue similar to existing helpers. This may be advantagous
in some situations such as statically allocated GList elements.
2019-05-01 13:01:14 -07:00
Christian Hergert
b0132bb64f list: add g_list_insert_before_link()
This adds a new insertion helper using a pre-allocated link which may be
advantagous in some situations such as statically linked GList elements.
2019-05-01 13:01:14 -07:00
Philip Withnall
192bf09529 general: Remove a few unhelpful references to ‘master’
Some of these have a negative master/slave connotation, and they add no
value. Change or drop them.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-04-25 09:25:49 +01:00
Philip Withnall
a00d6b08d0 docs: Add GLib 2.62 version macros to glib-sections.txt
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-04-15 12:09:33 +01:00
Philip Withnall
4ac7d2d8e3 docs: Add GLib 2.62 symbols to glib-docs.xml
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-04-15 12:09:16 +01:00
Philip Withnall
9e56d39bb4 docs: Ignore some generated source files
dep-list.c isn’t generated, but contains non-documentation gtk-doc-style
comments which are probably better left in place, since the code is
partially external to GLib.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-15 11:09:32 +00:00
Emmanuele Bassi
7644b6a368 Merge branch 'api-tags' into 'master'
Bump release version for 2.62 series

See merge request GNOME/glib!709
2019-03-06 12:30:12 +00:00
Philip Withnall
6761bb2f57 build: Factor out common gtkdoc flags
Those lists were getting very long. We can’t quite entirely automate the
list generation since Meson doesn’t have a range() function, but we can
at least combine three of them into one.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-06 11:59:03 +00:00
Руслан Ижбулатов
025a346728 W32: Add a simple exception handler
Install a Vectored Exception Handler[0]. Its sole purpose is to catch
some exceptions (access violations, stack overflows, illegal
instructions and debug breaks - by default, but it can be made to catch
any exception for which a code is known) and run a debugger in response.

This allows W32 glib applications to be run without a debugger,
but at the same time allows a debugger to be attached in case
something happens.

The debugger is run with a new console, unless an environment variable
is set to allow it to inherit the console of the crashing process.

The short list of handleable exceptions is there to ensure that
this handler won't run a debugger to "handle" utility exceptions,
such as the one that is used to communicate thread names to a debugger.

The handler is installed to be called last, and shouldn't interfere
with any user-installed handlers.

There's nothing fancy about the way it runs a debugger (it doesn't even
support unicode in paths), and it deliberately avoids using glib code.

The handler will also print a bit of information about the exception
that it caught, and even more information for well-known exceptions,
such as access violation.

The whole scheme is similar to AeDebug[1] and, in fact, the signal-event
gdb command was originally implemented for this very purpose.

[0]: https://docs.microsoft.com/en-us/windows/desktop/debug/vectored-exception-handling
[1]: https://docs.microsoft.com/en-us/windows/desktop/debug/configuring-automatic-debugging
2019-03-06 11:41:56 +00:00
Philip Withnall
e7d091dec1 gversionmacros: add version macros for GLib 2.62
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-06 11:26:28 +00:00
Christoph Reiter
7fa9a2a5da Merge branch 'gi-267-rename-header' into 'master'
Rename gobjectenumtypes.[ch] to glib-enumtypes.[ch]

See merge request GNOME/glib!702
2019-03-04 15:03:40 +00:00
Philip Withnall
95e00c7581 docs: Various markup improvements to glib-mkenums man page
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-04 11:14:22 +00:00
Philip Withnall
c3ac761a18 build: Rename gobjectenumtypes.[ch] to glib-enumtypes.[ch]
To reflect the fact that they contain the GObject types for various
enums defined in libglib.

See https://gitlab.gnome.org/GNOME/glib/merge_requests/481#note_451086.

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

Helps: GNOME/gobject-introspection#267
2019-03-04 11:12:59 +00:00
Philip Withnall
175f0243ed docs: Add Ting-Wei Lan as a BSD/kqueue code reviewer
As agreed on
https://gitlab.gnome.org/GNOME/glib/issues/1668#note_450631. Thanks!

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

Helps #1668
2019-03-04 10:38:17 +00:00
Philip Withnall
f703bed5eb docs: Populate CODEOWNERS file
Rename it from CODE-OWNERS and make it follow the documented syntax
supported by GitLab:
https://docs.gitlab.com/ee/user/project/code_owners.html. Currently our
version of GitLab doesn’t support it, but it may do in future.

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

https://gitlab.gnome.org/GNOME/glib/issues/1668
2019-02-21 18:53:47 +00:00
Philip Withnall
1f7d5b85d7 Merge branch 'trash-portal' into 'master'
Support the trash portal

See merge request GNOME/glib!276
2019-02-04 13:38:03 +00:00
Philip Withnall
5d719c782c Merge branch 'script-enum' into 'master'
Define enum types for Unicode enums

See merge request GNOME/glib!481
2019-02-04 12:28:02 +00:00
Matthias Clasen
fc6044a4b1 Define enum types for Unicode enums
We want to stop shipping PangoScript in pango, so
we need a replacement for the type that used to
be provided by pango.
2019-01-31 19:38:26 -05:00
Matthias Clasen
bca4ff7c5e Support the trash portal
When we are in a sandbox, try to trash files via a portal.
It works.
2019-01-31 19:00:19 -05:00
Krzesimir Nowak
9babfecba8 docs: Ignore more version macros
Looks like we tend to forget to update the list of ignored decorators
when adding new version macros.
2019-01-31 21:52:40 +01:00
Ondrej Holy
cec5778cad gappinfo: Add launch_uris_async() and launch_uris_finish() vfuncs
The g_app_info_launch_uris_async() and g_app_info_launch_uris_finish()
functions are crucial to fix g_app_info_launch_default_for_uri_async()
to be really asynchronous.

This patch also adds GDesktopAppInfo implementation of that vfuncs.
The implementation may still use some synchronous calls to local MIME DB.

https://gitlab.gnome.org/GNOME/glib/issues/1347
https://gitlab.gnome.org/GNOME/glib/issues/1249
2019-01-28 16:42:34 +01:00
Ondrej Holy
f72a5d65e0 gfile: Add g_file_query_default_handler_async()
This is needed as a first step to fix the
g_app_info_launch_default_for_uri_async() function to be really
asynchronous.

It still uses the g_app_info_get_default_for_uri_scheme() and
g_app_info_get_default_for_type() functions, which may use synchronous
calls to local MIME DB.

https://gitlab.gnome.org/GNOME/glib/issues/1347
https://gitlab.gnome.org/GNOME/glib/issues/1249
2019-01-28 16:42:34 +01:00
Sebastian Dröge
0bcc177378 Add writev() / writev_all() API to GOutputStream and GPollableOutputStream
This comes with default implementations around the normal write
functions and async variants.

Fixes https://gitlab.gnome.org/GNOME/glib/issues/1431
2019-01-24 16:25:34 +02:00
Sebastian Dröge
042b8dc40d Introduce new GPollableReturn enum
This allows returning WOULD_BLOCK without allocating a GError, and
should later be used for various functions of GPollableOutputStream,
GPollableInputStream and anything else that can potentially block.
2019-01-24 16:25:31 +02:00
Philip Withnall
7035462da0 Merge branch 'contributing-docs' into 'master'
Update contribution documentation

See merge request GNOME/glib!590
2019-01-23 10:52:15 +00:00
Matthias Clasen
8f71892862 Document "help" for extensions
Mention the special value "help" for the environment variables
that we document for picking extensions.
2019-01-22 13:18:50 -05:00
Philip Withnall
91493db48b docs: Rewrite CONTRIBUTING.md to update it
The new version is significantly based on the proposed GTK+
CONTRIBUTING.md file
(https://gitlab.gnome.org/GNOME/gtk/merge_requests/358).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-22 13:36:29 +00:00
Philip Withnall
d2062f0a65 docs: Drop pointless leading whitespace
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-15 15:11:43 +00:00
Philip Withnall
b3efef5b6f build: Drop autotools support
So long, and thanks for everything. We’re a Meson-only shop now.

glib-2-58 will remain the last stable GLib release series which is
buildable using autotools.

We continue to install autoconf macros for autotools-using projects
which depend on GLib; they are stable API.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-15 15:11:43 +00:00
Philip Withnall
ac396b4dc1 docs: Drop outdated timestamp and sign-off line
See the git history for that instead.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-15 15:11:43 +00:00
Philip Withnall
855aea45c6 docs: Update debugging docs to mention Meson build options
The behaviour of the Meson build has changed a little vs what we did in
autotools. In autotools, --enable-debug was a tristate (yes, no,
undefined), with all three options resulting in different macro
definitions.

In Meson, we have a bistate of --buildtype={debug,debugoptimized} vs
--buildtype=(anything else). There is no way to automatically define
G_DISABLE_ASSERT or G_DISABLE_CHECKS while building GLib — you need to
define them in your CPPFLAGS in your environment instead.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-15 15:11:43 +00:00
Philip Withnall
d08e4661de docs: Update DocBook ‘build’ documentation to mention Meson
Drop mentions of autotools. In particular, update the list of configure
options to reflect what’s available in the Meson build.

Further work is needed as a follow-up to improve our handling of (what
was formerly) the --enable-debug option.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-15 15:11:43 +00:00
Philip Withnall
0d3fe5c350 Merge branch 'queue-clear' into 'master'
Add g_queue_clear_full API

Closes #1464

See merge request GNOME/glib!537
2019-01-08 16:01:09 +00:00
Philip Withnall
940537bec7 Merge branch '1623-gio-open-docs' into 'master'
docs: Mention handling of filenames containing colons in gio docs

Closes #1623

See merge request GNOME/glib!550
2018-12-23 22:09:22 +00:00
Tapasweni Pathak
2dc82840c8 Add g_queue_clear_full API
Closes https://gitlab.gnome.org/GNOME/glib/merge_requests/378.
2018-12-22 14:36:56 +05:30
Mart Raudsepp
2ab231f52a docs: Fix dconf GSETTINGS_BACKEND name in gio overview 2018-12-21 17:38:06 +02:00
Cosimo Cecchi
7d02e32644 gdbusconnection: add a getter for the flags property
Right now this can only be set at construction but not read back.
That seems unnecessarily restrictive, and we'll need to read these
flags from outside of gdbusconnection.c in the next commit, so let's
just make it public.

https://gitlab.gnome.org/GNOME/glib/issues/1620
2018-12-20 00:41:13 +00:00
Ninja-Koala
d04b9c371d glib-compile-resources: Add external data option
Add option to not encode resource data into the C source file
in order to embed the data using `ld -b binary`. This improves compilation
times, but can only be done on Linux or other platforms with a
supporting linker.

(Rebased by Philip Withnall, fixing minor rebase conflicts.)

Fixes #1489
2018-12-19 16:43:21 +00:00
Philip Withnall
499e08a462 Merge branch 'gtask-set-name' into 'master'
gtask: Add a g_task_set_name() method

See merge request GNOME/glib!384
2018-12-19 13:16:07 +00:00