Commit Graph

2241 Commits

Author SHA1 Message Date
Arnaud Bonatti
6d009bc56a Add ‘gsettings list-schemas --print-paths’ option
Prints next to the name of non-relocatable schemas their paths.

https://bugzilla.gnome.org/show_bug.cgi?id=792064
2018-01-05 13:01:03 +00:00
howetuft
0e22d19a11 Bug-790839 GApplication command line --help enhancements
In order to enrich information displayed by GApplication command line
handling when --help is invoked, 3 new methods are proposed:
. g_application_set_option_context_parameter_string
. g_application_set_option_context_summary
. g_application_set_option_context_description
Those methods interact with the GApplication's internal GOptionContext
which is created for command line parsing in g_application_parse_command_line.
(please refer to the GOptionContext class for more information about option
context, parameter string, summary and description.)

To illustrate the 3 methods, an example is provided:
. gapplication-example-cmdline4.c
2018-01-03 11:08:37 +00:00
Emmanuele Bassi
8ade1af707 docs: Update the "building GLib" section
The content has slowly gone out of sync with the implementation, and
some of it is also showing its age.
2018-01-01 13:48:46 +00:00
Emmanuele Bassi
b1c7d2433f docs: Remove mention of disable-regex
The `--disable-regex` configuration option was removed with commit
d7063452 from 2012.
2018-01-01 13:16:24 +00:00
Alexander Larsson
f49a93b207 Add support for g_auto[s]list(Type)
This lets you do g_autoptr style cleanup of GList that does deep freeing.

https://bugzilla.gnome.org/show_bug.cgi?id=791342
2017-12-21 16:12:55 +01:00
Martin Blanchard
156d32cb80 gobject: new g_set_weak_pointer() & g_clear_weak_pointer() helpers
Weak-pointers are currently lacking g_set_object() & g_clear_object()
helpers equivalent. New functions (and macros, both are provided) are
convenient in many case, especially for the property's notify-on-set
pattern:

  if (g_set_weak_pointer (...))
    g_object_notify (...)

Inspired by Christian Hergert's original implementation for
gnome-builder.

https://bugzilla.gnome.org/show_bug.cgi?id=749527
2017-12-21 09:59:30 +00:00
Xavier Claessens
62c4768423 Meson: Add missing options and conform to naming guidelines
https://bugzilla.gnome.org/show_bug.cgi?id=790837
2017-12-19 14:56:11 -05:00
Philip Withnall
12fa92dcfa docs: Split GSocketConnectable/GProxyAddressEnumerator documentation
Putting them in the same section causes gtk-doc to mix their properties
together in a single listing, which is confusing.

Since having them in a single section doesn’t really add anything, split
them out to one class per section.

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

https://bugzilla.gnome.org/show_bug.cgi?id=791334
2017-12-12 11:42:45 +00:00
Xavier Claessens
fa8d42de2e Meson: Fix build of gtkdoc
This requires change added in Meson 0.44.0

https://bugzilla.gnome.org/show_bug.cgi?id=786796
2017-12-11 10:25:21 -05:00
Emmanuele Bassi
7d3e6738c5 Remove outdated/obsolete README
The README for the API reference top-level is completely obsolete, so we
should just remove it.

https://bugzilla.gnome.org/show_bug.cgi?id=790896
2017-11-27 12:55:34 +00:00
Ivar Trygve Jarlsby
f5dba7d43c docs: Correct inconsistency in GObject tutorial
The example code defines an interface with three methods. The preceding text
reads 'This interface defines two methods'. This appears to be because the
example code was changed without updating the surrounding text.

https://bugzilla.gnome.org/show_bug.cgi?id=790830
2017-11-26 21:21:34 +00:00
Emmanuele Bassi
bc277bfcef docs: Fix typo in the GObject tutorial
The description of the instance construction does not match the example.
2017-11-25 10:24:07 +00:00
Christian Hergert
2227918dfd file: add g_file_load_bytes()
This adds g_file_load_bytes() to make it more convenient to
load the contents of a GFile as GBytes.

It includes a special casing for gresources to increase the
chances that the GBytes directly references the embedded data
instead of copying to the heap.

https://bugzilla.gnome.org/show_bug.cgi?id=790272
2017-11-15 03:52:41 -08:00
Cosimo Cecchi
5ebd8f6e88 gmain: add g_clear_handle_id API
It's a very common pattern to see code that looks like this in
dispose() or finalize() implementations:

if (priv->source_id > 0)
  {
    g_source_remove (priv->source_id);
    priv->source_id = 0;
  }

This API allows to accomplish the same goal with a single line:

g_clear_handle_id (&priv->source_id, (GClearHandleFunc) g_source_remove);

Thanks to Emmanuele Bassi <ebassi@gnome.org> for making the patch
generic.

https://bugzilla.gnome.org/show_bug.cgi?id=788489
2017-11-07 08:28:45 -08:00
Cosimo Cecchi
44d6052584 gfile: add g_file_new_build_filename()
This is a convenience C API that combines g_build_filename() with
g_file_new_for_path().

https://bugzilla.gnome.org/show_bug.cgi?id=788488
2017-11-07 08:25:28 -08:00
Cosimo Cecchi
374ade1b68 glib: add g_build_filename_valist()
A new public API convenience to build a filename from a va_list.

https://bugzilla.gnome.org/show_bug.cgi?id=788488
2017-11-07 08:25:28 -08:00
Philip Withnall
a12fbd227f docs: Add version and deprecation decorators to gtk-doc ignore list
This allows gtk-doc to recognise a whole lot more API than it could
before. Maintaining the lists between 6 build files is going to be a bit
of a pain, but they only need to be modified once a cycle.

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

https://bugzilla.gnome.org/show_bug.cgi?id=789087

https://bugzilla.gnome.org/show_bug.cgi?id=790015
2017-11-07 14:50:23 +00:00
Philip Withnall
f33ca578b1 docs: Add 2.56 to the API version reference in glib-docs.xml
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=790015
2017-11-07 14:50:23 +00:00
Philip Withnall
6546d87e4a docs: Add recent version check macros to glib-sections.txt
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=790015
2017-11-07 14:50:23 +00:00
Stefan Sauer
5163805ec2 docs: fix bogus override for GIConv
GIConv is a typedef'ed pointer, don't claim it is a struct.
https://bugzilla.gnome.org/show_bug.cgi?id=779501
2017-10-27 12:06:41 +01:00
Philip Withnall
1e4221a3f7 gio: Add API for identifying system FS types and device paths
This is needed by gnome-control-center and gnome-settings-daemon; it
makes existing checks from gunixmounts.c public.

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

https://bugzilla.gnome.org/show_bug.cgi?id=788927
2017-10-26 00:19:23 +01:00
Julien Isorce
ea725a6414 gio: add g_socket_join_multicast_group_ssm (IGMPv3 SSM)
It adds support for source-specific multicast IGMPv3.

Allow receiving data only from a specified source when joining
a multicast group.

g_socket_join_multicast_group_ssm can be called multiple times
to allow receiving data from more than one source.

Support IPv4 and IPv6.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=740791
2017-10-16 11:14:57 +01:00
Kouhei Sutou
4bdb012aae docs: Fix XML syntax error
Introduced by the following commit:

    commit cd97f93bf7
    Author: Emmanuele Bassi <ebassi@gnome.org>
    Date:   Fri Oct 13 16:05:07 2017 +0100

        docs: Update glib-mkenums man page

        We should show how to properly use glib-mkenums with Autotools, in
        the hope that fewer people will be caught cargo-culting rules written
        in the late '90s.

        https://bugzilla.gnome.org/show_bug.cgi?id=788948

https://bugzilla.gnome.org/show_bug.cgi?id=788978
2017-10-14 09:15:59 +01:00
Emmanuele Bassi
cd97f93bf7 docs: Update glib-mkenums man page
We should show how to properly use glib-mkenums with Autotools, in
the hope that fewer people will be caught cargo-culting rules written
in the late '90s.

https://bugzilla.gnome.org/show_bug.cgi?id=788948
2017-10-13 18:14:57 +01:00
Emmanuele Bassi
bf4f825e84 docs: Update glib-genmarshal man page
We should show how to properly use glib-genmarshal with Autotools, in
the hope that fewer people will be caught cargo-culting rules written
in the late '90s.

https://bugzilla.gnome.org/show_bug.cgi?id=788948
2017-10-13 18:14:56 +01:00
Andrew Potter
5564ddef12 gdate: add g_date_copy()
This will allow passing invalid GDates through GValues.

https://bugzilla.gnome.org/show_bug.cgi?id=760109
2017-10-11 12:13:20 +01:00
Philip Withnall
121b1e5215 docs: Fix incorrect macro name in GType tutorial
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=770459
2017-10-05 15:40:14 +01:00
Colomban Wendling
b090a079f7 Fix documentation about stopping signal emission from inside a hook
Stopping signal emission from an emission hook is, and always has been,
actually forbidden.  Update the documentation not to lie to the reader.

https://bugzilla.gnome.org/show_bug.cgi?id=773355
2017-10-05 15:26:08 +01:00
Philip Withnall
1a5cebec39 docs: Discourage use of gstdio.h and clarify its header requirements
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=781598
2017-09-12 12:20:18 +01:00
Robert Ancell
491f835c17 GDateTime: Support parsing ISO 8601 strings
This supports a subset of ISO 8601 since that is a commonly used standard for
storing date and time information. We support only ISO 8601 strings that contain
full date and time information as this would otherwise not map to GDateTime.
This subset includes all of RFC 3339 which is commonly used on the Internet and
the week and ordinal day formats as these are supported in the GDateTime APIs.

(Minor modification by Philip Withnall to change API versions from 2.54
to 2.56.)

https://bugzilla.gnome.org/show_bug.cgi?id=753459
2017-09-11 19:29:34 +01:00
Carlo Caione
6503352be1 gvariant: Add g_variant_get() example for dicts
In the Dictionary section of the gvariant-format-strings documentation
only how to construct a dictionary is shown.

Add a small example showing how to extract data from a nested dictionary
and specifically from a GVariant of type "(oa{sa{sv})". Move also the
Dictionary section after the GVariant * section for the sake of clarity.

https://bugzilla.gnome.org/show_bug.cgi?id=786737
2017-09-11 09:46:21 +01:00
Daniel Boles
830744b0f4 docs/running: Remove outdated refs, fix name caps
Drop references to old versions of Fedora pointed out by Mohammed Sadiq.

While here, fix the capitalisation of various names to official styles.
2017-08-23 12:21:58 +01:00
Patrick Welche
6fcdf90300 gresource: fix documentation typo 2017-08-22 08:58:56 +01:00
Tim-Philipp Müller
24ea260b4c meson: docs: make gtk-doc find the gobject.types file
Should really use files('gobject.types') instead, but that
seems to get expanded to the build path for some reason:
https://github.com/mesonbuild/meson/issues/1875
2017-07-13 19:03:39 -04:00
Nirbheek Chauhan
88e437873a meson: Detect with-docs and with-man automatically
By default, only build man pages and gtk-doc if the build-deps were
found. To force-enable, pass -Dwith-docs=yes and -Dwith-man=yes.

Also use a foreach loop for man pages instead of listing them all
manually
2017-07-13 19:03:39 -04:00
Nirbheek Chauhan
e2da3cb599 meson: Port to latest master (2.51.0)
Also remove headers from some gio sources. Headers do not need to be
added to the list of sources.

+ various smaller self-explanatory fixes.
2017-07-13 19:03:39 -04:00
Patrick Griffis
bc2bb5639b meson: Match upstream gtkdoc changes 2017-07-13 19:03:39 -04:00
Patrick Griffis
0df9aab053 meson: Build all docs 2017-07-13 19:03:39 -04:00
Daniel Boles
522ba7303e docs: tut_gsignal: Fix mismatched argument names
The names differed between the argument declaration and its description.
2017-07-11 12:52:23 +01:00
Emmanuele Bassi
93f16a45ab Rewrite glib-genmarshal in Python
We're in the process or rewriting other tools in Python to reduce the
number of dependencies of GLib.

Additionally, making glib-genmarshal a Python script reduces the
complexity when cross-compiling, as we don't need a native build to
generate the marshallers.

https://bugzilla.gnome.org/show_bug.cgi?id=784528
2017-07-10 16:47:47 +01:00
Sébastien Wilmet
cc8b3d6ee2 docs: LGPL: Library -> Lesser
https://bugzilla.gnome.org/show_bug.cgi?id=776504
2017-05-29 19:53:35 +02:00
Emmanuele Bassi
0776e02be2 Remove unused ignore file
We're keeping the tmpl directory alive even if we don't need it.
2017-05-14 20:36:20 +01:00
Krzesimir Nowak
ce7e02193b docs: Add index for 2.54 api 2017-05-10 12:04:04 +02:00
Krzesimir Nowak
4fe89b0437 gstrfuncs: Add replacement for string-to-number functions
Very often when we want to convert a string to number, we assume that
the string contains only a number. We have g_ascii_strto* family of
functions to do the conversion but they are awkward to use - one has
to check if errno is zero, end_ptr is not NULL and *end_ptr points to
the terminating nul and then do the bounds checking. Many projects
need this kind of functionality, so it gets reimplemented all the
time.

This commit adds some replacement functions that convert a string to a
signed or unsigned number that also follows the usual way of error
reporting - returning FALSE on failure and filling an error output
parameter.
2017-05-10 12:04:03 +02:00
Philip Withnall
f6f6b3d83c garray: Add g_ptr_array_find[_with_equal_func]()
Partially based on telepathy-glib’s tp_g_ptr_array_contains(), and a
patch by Xavier Claessens <xavier.claessens@collabora.co.uk>.

Test cases included.

https://bugzilla.gnome.org/show_bug.cgi?id=698064
2017-05-02 16:54:41 +01:00
Emmanuele Bassi
f952fdf3fc Drop trailing semi-colon from G_DEFINE_ macro
It's unnecessary, and only adds visual noise; we have been fairly
inconsistent in the past, but the semi-colon-less version clearly
dominates in the code base.

https://bugzilla.gnome.org/show_bug.cgi?id=669355
2017-04-10 10:38:31 +01:00
Philip Withnall
4c91b7f935 docs: Add GParameter replacement API to gobject-sections.txt
This slipped through the review cracks.

https://bugzilla.gnome.org/show_bug.cgi?id=709865
2017-03-31 11:10:26 +01:00
Garrett Regier
6c95cd22e9 gobject: Add to_string() functions for Enum and Flags types
These are useful for debugging.

https://bugzilla.gnome.org/show_bug.cgi?id=447907
2017-03-30 09:52:28 +01:00
Christoph Reiter
625936343d Make GUnixMountEntry and GUnixMountPoint boxed types
And unskip some functions using them.

https://bugzilla.gnome.org/show_bug.cgi?id=668962
2017-03-28 18:03:08 +02:00
Philip Withnall
7890573f6e gdbus-tool: Add a command to wait for a well-known name on the bus
This is effectively the mc-wait-for-name tool from
telepathy-mission-control; moving it in to gdbus-tool will make it more
widely useful without making people depend on telepathy-mission-control
for no other reason. The code here is reimplemented from scratch to use
GDBus.

It blocks until the specified well-known name is owned by some process
on the bus (which can be the session, system, or any other bus). By
passing --activate, the same (or a different) name can be auto-started
on the bus first.

A timeout can be specified to ensure the process doesn’t block forever.

https://bugzilla.gnome.org/show_bug.cgi?id=745971
2017-03-28 11:23:27 +01:00