Commit Graph

2161 Commits

Author SHA1 Message Date
Cosimo Cecchi
375b4ca65c vfs: add g_vfs_register_uri_scheme()
Add a new API to allow clients to register a custom GFile implementation
handling a particular URI scheme.
This can be useful for tests, but also for cases where a different URI
scheme is desired to be used with another custom GFile backend.

As an additional cleanup, we can use this to register the "resource" URI
scheme too.

Based on a patch by Jasper St. Pierre <jstpierre@mecheye.net>.

https://bugzilla.gnome.org/show_bug.cgi?id=767887
2016-06-25 06:58:19 +08:00
Cosimo Cecchi
d07e166432 gkeyfile: add g_key_file_load_from_bytes() API
This makes it easier to use GKeyFile from language bindings, and makes
the API more consistent and modern with the new data type available in
GLib.

https://bugzilla.gnome.org/show_bug.cgi?id=767880
2016-06-20 17:53:00 -07:00
Philip Withnall
195a0cb6bb gio: Add SystemTap and DTrace probes for GTask
This adds a basic tapset for GIO, covering various interesting parts of
GTask.

https://bugzilla.gnome.org/show_bug.cgi?id=759813
2016-06-15 16:15:12 -04:00
Colin Walters
424b3b9c6c docs: Move GIO_USE_VFS to "okay for production" section
Lots of projects like NetworkManager, ostree, udisks, soon polkit,
etc.  do this or *should* do this.  And we need to support that
forever.

https://bugzilla.gnome.org/show_bug.cgi?id=767172
2016-06-02 14:11:17 -04:00
Ondrej Holy
7b3f6da307 gio: Add g_drive_is_removable() support
Nautilus wants to show entries in the sidebar only for removable devices.
It uses currently sort of conditions to determine which devices should be
shown. Those condition fails in some cases unfortunatelly. Lets provide
g_drive_is_removable() which uses udisks Removable property to determine
which devices should be shown. It should return true for all drives with
removable media, or flash media, or drives on usb and firewire buses.

https://bugzilla.gnome.org/show_bug.cgi?id=765900
2016-05-20 10:31:22 +02:00
Philip Withnall
098f19bced docs: Replace references to GVFS hal modules with udisks2
Since hal is dead and buried, and has been superseded by the udisks2
modules in GVFS.
2016-05-19 10:06:36 +01:00
Rico Tzschichholz
19689af091 docs: Add index for 2.50 api 2016-05-18 13:30:32 +02:00
Matthias Clasen
98f86beed6 gdbus-codegen: Only generate autocleanup when instructed to
This adds a new --c-generate-autocleanup option to gdbus-codegen
which can be used to instruct gdbus-codegen about what autocleanup
definitions to emit.

Doing this unconditionally was found to interfere with existing
code out in the wild.

The new option takes an argument that can be
none, objects or all; to indicate whether to generate no
autocleanup functions, only do it for object types, or do it
for interface types as well. The default is 'objects', which
matches the unconditional behavior of gdbus-codegen on the 2.48
branch.

https://bugzilla.gnome.org/show_bug.cgi?id=763379
2016-05-05 06:13:16 -04:00
Marc-Antoine Perennou
5cea1c861d gsettings: add get/set_{,u}int64
https://bugzilla.gnome.org/show_bug.cgi?id=755898

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2016-04-28 17:28:44 +02:00
Руслан Ижбулатов
e4aaae4ed6 glib: Add 2.50 availibity macros
https://bugzilla.gnome.org/show_bug.cgi?id=665446
2016-04-27 13:17:27 +00:00
Thomas Perl
59ec2912e4 Documentation fix: g_variant_get() returns void
https://bugzilla.gnome.org/show_bug.cgi?id=747107
2016-04-11 23:29:53 -04:00
Hashem Nasarat
c5931d1a16 docs: fix grammar in Writing GLib Applications/Threads 2016-01-31 12:54:28 -05:00
Philip Withnall
c3d6934f18 gio: Add DTLS interfaces
Add a new GDtlsConnection interface, plus derived GDtlsClientConnection
and GDtlsServerConnection interfaces, for implementing Datagram TLS
support in glib-networking.

A GDtlsConnection is a GDatagramBased, so may be used as a normal
datagram socket, wrapping all datagrams from a base GDatagramBased in
DTLS segments.

Test cases are included in the implementation in glib-networking.

https://bugzilla.gnome.org/show_bug.cgi?id=752240
2016-01-18 14:25:06 +00:00
Christian Hergert
3272267b99 macros: add G_GNUC_CHECK_VERSION() for compiler checks.
https://bugzilla.gnome.org/show_bug.cgi?id=728099
2015-12-16 07:47:53 -05:00
Allison Ryan Lortie
398c048c66 docs: remove GDBusObjectManager example
This example has been causing on-and-off build breaks for quite some
time.  In this case, the code for copying the generated content into the
main docs of GIO is causing problems with srcdir != destdir builds (due
to the files also being copied from the read-only srcdir during
distchecks).

We could probably work around this problem yet again, but since there is
no real benefit to having this content included, so let's remove it.

https://bugzilla.gnome.org/show_bug.cgi?id=734469
2015-11-24 18:44:02 +00:00
Xavier Claessens
6f1b574cea Doc: Fix missing glibconfig.h when builddir!=srcdir
Currently the doc is incomplete when builddir!=srcdir
(e.g. debian package) because glibconfig.h is generared from
configure.ac and is thus missing from srcdir. This leads to
missing doc for symbols like G_GINT64_FORMAT.

https://bugzilla.gnome.org/show_bug.cgi?id=734469
2015-11-02 10:02:43 -05:00
Xavier Claessens
86a7c864b3 Doc: copy included example files
This fix missing files when src_dir != build_dir.

https://bugzilla.gnome.org/show_bug.cgi?id=734469
2015-11-02 09:26:58 -05:00
Xavier Claessens
2331437df3 Doc: fix some gtk-doc warnings
https://bugzilla.gnome.org/show_bug.cgi?id=755364
2015-10-30 10:30:55 -04:00
Allison Ryan Lortie
d0219f2597 GLib: add bounds-checked unsigned int arithmetic
Add some helpers for builds-checked unsigned integer arithmetic to GLib.
These will be based on compiler intrinsics where they are available,
falling back to standard manual checks otherwise.

The fallback case needs to be implemented as a function (which we do
inline) because we cannot rely on statement expressions.  We also
implement the intrinsics case as an inline in order to avoid people
accidentally writing non-portable code which depends on static
evaluation of the builtin.

For now there is only support for addition and multiplication for guint,
guint64 and gsize.  It may make sense to add support for subtraction or
for the signed equivalents of those types in the future if we find a use
for that.

https://bugzilla.gnome.org/show_bug.cgi?id=503096
2015-10-30 11:58:49 +01:00
Rico Tzschichholz
0d4f6afcdf docs: Add index for 2.48 api 2015-10-25 19:42:18 +01:00
Philip Withnall
bf33f1d98d docs: Replace Maman in the tutorial with a more meaningful example
Change it to a running example of a file viewer application with a file
class and various derived classes and related interfaces. Hopefully the
reader can relate to this a little better than to their maman.

https://bugzilla.gnome.org/show_bug.cgi?id=753935
2015-10-20 07:18:15 +09:00
Philip Withnall
128c413261 gsocketconnectable: Add a to_string() virtual method
Add string serialisation functions for GNetworkAddress, GSocketAddress,
GUnixSocketAddress, GInetSocketAddress, GNetworkService and
GSocketConnectable. These are intended for use in debug output, not for
serialisation in network or disc protocols.

They are implemented as a new virtual method on GSocketConnectable:
g_socket_connectable_to_string().

GInetSocketAddress and GUnixSocketAddress now implement
GSocketConnectable directly to implement to_string(). Previously they
implemented it via their abstract parent class, GSocketAddress.

https://bugzilla.gnome.org/show_bug.cgi?id=737116
2015-10-13 15:42:14 +01:00
Philip Withnall
4e631d2e5f gio: Add GDatagramBased interface and rebase GSocket on it
GDatagramBased is an interface abstracting datagram-based communications
in the style of the Berkeley sockets API. It may be contrasted to (for
example) GIOStream, which supports only streaming I/O.

GDatagramBased allows socket-like communications to be done through any
object, not just a concrete GSocket (which wraps socket()).

This adds the GDatagramBased interface, and implements it in GSocket.

https://bugzilla.gnome.org/show_bug.cgi?id=697907
2015-10-13 15:33:48 +01:00
Dan Winship
b4a3c1bb11 Revert "gvalue: Add g_value_clear method"
This reverts commit 1233962b54.
2015-10-02 10:07:53 -04:00
Philip Withnall
4a5a30f716 docs: Tidy up GObject construction discussion in the GObject tutorial
Remove some outdated references to an old example, and add a row in the
table of steps in object initialization for the GObjectClass.constructed
virtual method.

https://bugzilla.gnome.org/show_bug.cgi?id=754855
2015-10-01 15:27:21 +01:00
Philip Withnall
f62cbfc022 gsocket: Add g_socket_receive_messages()
Add support for receiving multiple messages with a single system call,
using recvmmsg() if available. Otherwise, fall back to looping over
g_socket_receive_message().

This adds new API, g_socket_receive_messages(), and corresponding unit
tests.

https://bugzilla.gnome.org/show_bug.cgi?id=751924
2015-10-01 14:10:10 +01:00
Philip Withnall
8c4c16ddf4 giotypes: Add GInputMessage struct
This complements the GOutputMessage struct. It will shortly be used for
adding a g_socket_receive_messages() function, but needs to be committed
first to allow some internal refactoring of GSocket.

https://bugzilla.gnome.org/show_bug.cgi?id=751924
2015-10-01 13:58:07 +01:00
Nicolas Dufresne
1233962b54 gvalue: Add g_value_clear method
This method is similar to g_value_unset() but will accept
an uninitialized (zero-filled) GValue structure.

https://bugzilla.gnome.org/show_bug.cgi?id=755766
2015-09-29 08:26:14 -04:00
Nicolas Dufresne
b36b4941a6 glib: Add 2.48 availibity macros
https://bugzilla.gnome.org/show_bug.cgi?id=755766
2015-09-29 08:26:13 -04:00
Xavier Claessens
b81f3ced71 Move GStrv typedef to glib.h instead of gobject.h
GStrv was historically only needed for the boxed G_TYPE_STRV,
but it is now useful for g_auto(GStrv) as well. This is not
an ABI change.

https://bugzilla.gnome.org/show_bug.cgi?id=755355
2015-09-22 11:18:30 -04:00
Matthias Clasen
2bc094264b Documentation fixups
Various parameter fixups and symbol list additions.
2015-09-21 06:44:58 -04:00
Rico Tzschichholz
925dca1746 docs: Add index for 2.46 api 2015-09-08 14:14:13 +02:00
Matthias Clasen
41c0d15a6d Add a method to get the pspec name quark
This lets us avoid the quark lookup in the hot
property change notification path.
2015-09-07 20:54:01 -04:00
Dan Winship
9f2e3f6b72 gtestutils: add g_assert_cmpmem()
Add a test macro to compare two buffers (which are not already known
to be the same length) for equality.

https://bugzilla.gnome.org/show_bug.cgi?id=754283
2015-08-31 13:59:48 -04:00
Matthias Clasen
e5734c37a6 Add g_list_store_sort
GListStore already has a g_list_store_insert_sorted function,
which can be used to keep the list sorted according to a fixed
sort function. But if the sort function changes (as e.g. with
sort columns in a list UI), the entire list needs to be
resorted. In that case, you want g_list_store_sort().

https://bugzilla.gnome.org/show_bug.cgi?id=754152
2015-08-31 10:40:45 -04:00
Philip Withnall
d33eae97c9 Revert "TODO ban maman"
I can’t work git-bz.

This reverts commit a228f0ac80.
2015-08-21 15:17:24 +01:00
Philip Withnall
a228f0ac80 TODO ban maman 2015-08-21 15:15:53 +01:00
Philip Withnall
57d0ec57e4 docs: Clarify costs of using the generic GObject C closure marshaller
The libffi one is slower than type-specific generated ones, but is
generally better to use.

https://bugzilla.gnome.org/show_bug.cgi?id=744060
2015-08-21 15:15:53 +01:00
Philip Withnall
e57741791e docs: Port GObject concepts to use G_DECLARE_FINAL_TYPE
And G_DECLARE_INTERFACE.

https://bugzilla.gnome.org/show_bug.cgi?id=744060
2015-08-21 15:15:53 +01:00
Philip Withnall
ab9b52e69c docs: General cleanups and rewording in the GObject concepts docs
• Remove copies of function declarations from the explanation — if
   people want those, they can follow links to the reference manual.
 • Add markup to make C code more defined.
 • Remove use of first person and irrelevant name dropping.

https://bugzilla.gnome.org/show_bug.cgi?id=744060
2015-08-21 15:15:53 +01:00
Philip Withnall
a86ef242e4 docs: Link to the GObject how-to from the GType tutorial
So that first-time users don’t fall into the trap of reading about the
gory memory layout details of GType and GObject when all they wanted to
do was derive a class.

https://bugzilla.gnome.org/show_bug.cgi?id=744060
2015-08-21 15:15:53 +01:00
Philip Withnall
cd0d605b23 docs: Mention g_clear_object() in the GObject tutorial
As an alternative to g_object_unref().

https://bugzilla.gnome.org/show_bug.cgi?id=744060
2015-08-21 15:15:53 +01:00
Philip Withnall
f9410b1647 docs: Remove pointless copy of GObject headers from tutorial
Remove a copy of the refcounting functions from gobject.h from the
GObject tutorial. It suffices to link to the functions in the API
reference.

https://bugzilla.gnome.org/show_bug.cgi?id=744060
2015-08-21 15:15:53 +01:00
Philip Withnall
92f6325509 docs: Miscellaneous formatting and wording fixes to GObject tutorial
Convert a few sections to use the passive voice, and add some more
<function> elements.

https://bugzilla.gnome.org/show_bug.cgi?id=744060
2015-08-21 15:15:53 +01:00
Philip Withnall
2aade94fcc docs: Update code examples in GObject tutorial
Use G_DECLARE_FINAL_TYPE, simplify property handling, and remove some
unnecessary braces.

https://bugzilla.gnome.org/show_bug.cgi?id=744060
2015-08-21 15:15:53 +01:00
Philip Withnall
42baaa88cd docs: Use generic marshallers in GObject how-to examples
They’re the new vogue for handling signals.

https://bugzilla.gnome.org/show_bug.cgi?id=744060
2015-08-21 15:15:53 +01:00
Philip Withnall
01962b4dd1 docs: Rename a parameter in a GObject how-to example
Make it obvious the parameter is not related to AClass.

https://bugzilla.gnome.org/show_bug.cgi?id=744060
2015-08-21 15:15:52 +01:00
Philip Withnall
a76242b35a docs: Add vfunc NULL checks to GObject how-to examples
Not setting a pure vfunc is a programmer error, so can be handled with a
g_return_if_fail() rather than needing a g_warning().

https://bugzilla.gnome.org/show_bug.cgi?id=744060
2015-08-21 15:15:52 +01:00
Philip Withnall
82abb80553 docs: Update interfaces in GObject how-to examples
Use G_DECLARE_INTERFACE and G_DEFINE_INTERFACE. Fix a couple of typos.
Add some comments to empty functions to make it obvious they’re
intentionally empty.

https://bugzilla.gnome.org/show_bug.cgi?id=744060
2015-08-21 15:15:52 +01:00
Philip Withnall
ffc248919b docs: Update instance private data in GObject how-to examples
Use get_instance_private().

https://bugzilla.gnome.org/show_bug.cgi?id=744060
2015-08-21 15:15:52 +01:00