platform/upstream/glib.git
13 years agoAllow null object in g_simple_async_report_gerror_in_idle
Christian Dywan [Mon, 20 Dec 2010 16:15:15 +0000 (17:15 +0100)]
Allow null object in g_simple_async_report_gerror_in_idle

Follow-up on bug 636673.

13 years agoappinfo: add g_app_info_set_as_last_used_for_type()
Cosimo Cecchi [Wed, 15 Dec 2010 16:56:22 +0000 (17:56 +0100)]
appinfo: add g_app_info_set_as_last_used_for_type()

This commit also changes (maintaining compatibility) the way
user-specified default applications are stored (as in, those for which
g_app_info_set_as_default_for_type() has been called.

We now store the default application for a content type in a new group
in the mimeapps.list keyfile, and "Added Associations" tracks only the
applications that have been added by the user, following a
most-recently-used first order.

This is useful in GtkAppChooser-like widgets to pre-select the last used
application when constructing a widget.

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

13 years agoemblemedicon: make GEmblemedIcon subclassable
Cosimo Cecchi [Thu, 9 Dec 2010 17:31:19 +0000 (18:31 +0100)]
emblemedicon: make GEmblemedIcon subclassable

Hiding the object/class structs in the source file makes this class not
subclassable.

Move them to the public header, and add a property for the icon, so that
subclasses can just use

  g_object_new (DERIVED_TYPE,
                "gicon", icon,
                NULL);

to create an emblemed icon.

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

13 years agoAdd a delay-apply property to GSettings
Matthias Clasen [Mon, 20 Dec 2010 14:16:05 +0000 (09:16 -0500)]
Add a delay-apply property to GSettings

Bug 637147, patch by Matt Barnes.

13 years ago[l10n] Updated Estonian translation
Mattias Põldaru [Mon, 20 Dec 2010 11:55:19 +0000 (13:55 +0200)]
[l10n] Updated Estonian translation

13 years agoUpdated Vietnamese translation
Nguyễn Thái Ngọc Duy [Mon, 20 Dec 2010 10:26:00 +0000 (17:26 +0700)]
Updated Vietnamese translation

13 years agoAdd GI annotations to GClosure and friends.
Pavel Holejsovsky [Sun, 19 Dec 2010 21:15:42 +0000 (22:15 +0100)]
Add GI annotations to GClosure and friends.

13 years agoAdd GI annotations to GValue and GValueArray.
Pavel Holejsovsky [Sun, 19 Dec 2010 09:39:36 +0000 (10:39 +0100)]
Add GI annotations to GValue and GValueArray.

13 years agog_simple_async_report_error_in_idle with no object
Christian Dywan [Fri, 10 Dec 2010 14:07:04 +0000 (15:07 +0100)]
g_simple_async_report_error_in_idle with no object

Document and allow passing of NULL for the object consistently to
_take_error and _report_error functions.

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

13 years agogrand: Fix URLs for info on the Mersenne Twister
Javier Jardón [Fri, 17 Dec 2010 16:12:16 +0000 (16:12 +0000)]
grand: Fix URLs for info on the Mersenne Twister

Reported by Allin Cottrell here:
http://mail.gnome.org/archives/gtk-devel-list/2010-December/msg00134.html

13 years ago[gi] Add annotations for GFile, G[File]{Input|Output|IO}Stream.
Pavel Holejsovsky [Fri, 17 Dec 2010 15:24:33 +0000 (16:24 +0100)]
[gi] Add annotations for GFile, G[File]{Input|Output|IO}Stream.

Also make parameter names in virtual function declarations consistent
to silent g-ir-scanner.

13 years agoUpdate symbols list for recent changes
Matthias Clasen [Fri, 17 Dec 2010 13:35:54 +0000 (08:35 -0500)]
Update symbols list for recent changes

13 years agog_object_get_property: document that value must be initialized
Will Thompson [Fri, 17 Dec 2010 12:34:28 +0000 (12:34 +0000)]
g_object_get_property: document that value must be initialized

I couldn't tell from reading the documentation whether I had to pass in
an uninitialized value, or a value initialized to the exact type, or
something else. It turns out (from reading the source) that you have to
pass in an initialized value, but you can use any type to which the
property's actual type can be transformed.

So, let's document this.

13 years agoUpdated Norwegian bokmål translation
Kjartan Maraas [Fri, 17 Dec 2010 12:03:18 +0000 (13:03 +0100)]
Updated Norwegian bokmål translation

13 years ago[gi] Fix GObject.Object annotations.
Pavel Holejsovsky [Thu, 16 Dec 2010 20:06:51 +0000 (21:06 +0100)]
[gi] Fix GObject.Object annotations.

13 years ago[gi] add annotations for methods which take a gpointer which are really GObjects
John (J5) Palmieri [Thu, 16 Dec 2010 18:44:56 +0000 (13:44 -0500)]
[gi] add annotations for methods which take a gpointer which are really GObjects

* bindings need to know how to marshal the pointer otherwise they send in
  the raw wrapped pointer causing crashes

13 years agogioenums.h: Remove a trailing comma.
Murray Cumming [Thu, 16 Dec 2010 09:57:18 +0000 (10:57 +0100)]
gioenums.h: Remove a trailing comma.

13 years agotests: remove a bogus assumption
Cosimo Cecchi [Tue, 14 Dec 2010 17:33:17 +0000 (18:33 +0100)]
tests: remove a bogus assumption

13 years agoRemove GPeriodic for now
Matthias Clasen [Wed, 15 Dec 2010 16:56:44 +0000 (11:56 -0500)]
Remove GPeriodic for now

The necessary review and integration work has not happened, and
we don't want to enshrine it in this unproven state.
It will be back when the world is ready for it.

13 years agoRemove the dead --disable-visiblity configure option
Matthias Clasen [Wed, 15 Dec 2010 16:41:05 +0000 (11:41 -0500)]
Remove the dead --disable-visiblity configure option

At the same time, document --disable-Bsymbolic.

13 years agodocs: fix a typo
Cosimo Cecchi [Wed, 15 Dec 2010 11:50:59 +0000 (12:50 +0100)]
docs: fix a typo

13 years agoemblemedicon: add docs for _clear_emblems()
Cosimo Cecchi [Wed, 15 Dec 2010 11:49:22 +0000 (12:49 +0100)]
emblemedicon: add docs for _clear_emblems()

13 years agoemblemedicon: add g_emblemed_icon_clear_emblems()
Cosimo Cecchi [Thu, 9 Dec 2010 17:16:17 +0000 (18:16 +0100)]
emblemedicon: add g_emblemed_icon_clear_emblems()

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

13 years agogapplication: plug a memory leak
Cosimo Cecchi [Tue, 14 Dec 2010 16:16:31 +0000 (17:16 +0100)]
gapplication: plug a memory leak

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

13 years agoAdd missing annotations to GApplication and GApplicationCommandLine.
Pavel Holejsovsky [Wed, 15 Dec 2010 10:17:00 +0000 (11:17 +0100)]
Add missing annotations to GApplication and GApplicationCommandLine.

13 years agoghostutils: Convert non-ASCII dots to '.' when converting hostnames
Dan Winship [Fri, 10 Dec 2010 10:42:56 +0000 (11:42 +0100)]
ghostutils: Convert non-ASCII dots to '.' when converting hostnames

Also add some test cases to test/hostutils for that and a few other
things, and make the test program just act as an ASCII/unicode
hostname converter rather than a test program if it's run with an
argument.

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

13 years agoBug 635626 – GDBus message idle can execute while flushes are pending
Ted Gould [Mon, 13 Dec 2010 18:33:15 +0000 (13:33 -0500)]
Bug 635626 – GDBus message idle can execute while flushes are pending

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
13 years agoBug 632544 – Cannot send a locked message with PRESERVE_SERIAL flag
Peng Huang [Mon, 13 Dec 2010 18:09:38 +0000 (13:09 -0500)]
Bug 632544 – Cannot send a locked message with PRESERVE_SERIAL flag

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
13 years agoAdd GIOStreamSpliceFlags to doc
Xavier Claessens [Mon, 13 Dec 2010 16:59:47 +0000 (17:59 +0100)]
Add GIOStreamSpliceFlags to doc

13 years agoAdd Since 2.28 in g_io_stream_splice doc
Xavier Claessens [Mon, 13 Dec 2010 16:42:11 +0000 (17:42 +0100)]
Add Since 2.28 in g_io_stream_splice doc

13 years agoAdd g_io_stream_splice_async/finish()
Xavier Claessens [Fri, 13 Aug 2010 08:10:48 +0000 (10:10 +0200)]
Add g_io_stream_splice_async/finish()

That function splice the output stream of both GIOStreams to the input stream
of the other GIOStream.

13 years agoDocument the GIO_USE_TLS environment variable
Matthias Clasen [Mon, 13 Dec 2010 14:04:28 +0000 (09:04 -0500)]
Document the GIO_USE_TLS environment variable

13 years agoFix gsettings enum rule to work with non-srcdir builds
Christian Persch [Tue, 16 Nov 2010 18:22:10 +0000 (19:22 +0100)]
Fix gsettings enum rule to work with non-srcdir builds

Bug #635007.

13 years agoBetter error reporting for g_variant_parse()
Christian Persch [Tue, 9 Nov 2010 21:56:28 +0000 (22:56 +0100)]
Better error reporting for g_variant_parse()

Add error codes, and use them when setting the GError.

Bug #634583.

13 years agoAdd missing property to GDummyTlsCertificate
Dan Winship [Fri, 10 Dec 2010 09:01:01 +0000 (10:01 +0100)]
Add missing property to GDummyTlsCertificate

13 years agogio: Add a count to the resolver test for number of enumerators
Benjamin Otte [Tue, 7 Dec 2010 16:55:03 +0000 (17:55 +0100)]
gio: Add a count to the resolver test for number of enumerators

This adds the nice stress-test feature of having 5 enumerators running
at the same time. Yay!

13 years agogio: Make enumerating a GNetworkAddress work more than once
Benjamin Otte [Tue, 7 Dec 2010 16:25:01 +0000 (17:25 +0100)]
gio: Make enumerating a GNetworkAddress work more than once

Previously, the code only initialized the enumerator if the address
hadn't had cached addresses. But creating an enumerator cached the
addresses, so the second one failed to work.

13 years agotls: Make g_tls_{client|server}_connection_new() return a GIOStream
Benjamin Otte [Tue, 7 Dec 2010 15:06:38 +0000 (16:06 +0100)]
tls: Make g_tls_{client|server}_connection_new() return a GIOStream

The main use case for these objects is as an IO stream, so it makes
sense to return them that way from the start.

13 years agotls: Clarify docs for g_tls_client_connection_set_validation_flags()
Benjamin Otte [Tue, 7 Dec 2010 14:42:10 +0000 (15:42 +0100)]
tls: Clarify docs for g_tls_client_connection_set_validation_flags()

And fix a typo in there.

13 years agoFix error in GSimpleAsyncResult example
Emilio Pozuelo Monfort [Tue, 7 Dec 2010 16:45:06 +0000 (17:45 +0100)]
Fix error in GSimpleAsyncResult example

13 years agoChange the handling of the peer certificate in GTlsConnection
Dan Winship [Tue, 7 Dec 2010 13:58:42 +0000 (14:58 +0100)]
Change the handling of the peer certificate in GTlsConnection

Make the certificate and peer-certificate properties virtual, and add
peer-certificate-errors as well. Change the documentation on
peer-certificate to say that it's not set until after the handshake
succeeds (which means notify::peer-certificate can be used to tell
when a handshake has completed).

13 years agoClarify that g_socket_client_connect_to_uri() doesn't know about TLS
Dan Winship [Mon, 6 Dec 2010 16:21:16 +0000 (17:21 +0100)]
Clarify that g_socket_client_connect_to_uri() doesn't know about TLS

13 years agoChange the semantics of GTlsConnection:require-close-notify
Dan Winship [Mon, 6 Dec 2010 12:10:09 +0000 (13:10 +0100)]
Change the semantics of GTlsConnection:require-close-notify

We were combining "allow un-notified closes" and "close without
notifying" into a single property, which meant that it was impossible
to "be liberal in what you accept and conservative in what you send".
Change require-close-notify to only be about the peer behavior, and
make our connections always close-notify properly when closing (while
noting that you can just close the base-io-stream directly if you want
to do an unclean close).

13 years agoadd G_TLS_ERROR_UNAVAILABLE
Dan Winship [Mon, 6 Dec 2010 11:43:59 +0000 (12:43 +0100)]
add G_TLS_ERROR_UNAVAILABLE

13 years agoRemove GTlsConnection::need-certificate
Dan Winship [Mon, 6 Dec 2010 10:04:13 +0000 (11:04 +0100)]
Remove GTlsConnection::need-certificate

Trying to do this as a signal won't work well with either
GTlsCertificateDB (in which case looking up a certificate in the db is
a blocking/asynchronous act) or session resumption support (in which
case the certificate or lack thereof is part of the session definition
and so needs to be known immediately). Make the caller use
g_tls_connection_set_certificate() ahead of time (or when retrying)
instead.

13 years agoAdd GTlsConnection:use-system-certdb
Dan Winship [Wed, 1 Dec 2010 18:49:39 +0000 (13:49 -0500)]
Add GTlsConnection:use-system-certdb

This can be set FALSE if you don't want to validate certificates
against the system database.

13 years agoAdd g_tls_certificate_verify()
Dan Winship [Wed, 1 Dec 2010 00:57:16 +0000 (19:57 -0500)]
Add g_tls_certificate_verify()

Add a method to verify a certificate against a CA; this can be used
for apps that need to test against non-default CAs.

Also make the GTlsCertificate::issuer property virtual

13 years agoComplete Simplified Chinese translation.
Aron Xu [Mon, 6 Dec 2010 12:44:18 +0000 (12:44 +0000)]
Complete Simplified Chinese translation.

13 years agoUpdate Simplified Chinese translation.
Aron Xu [Mon, 6 Dec 2010 12:40:03 +0000 (12:40 +0000)]
Update Simplified Chinese translation.

13 years agoAdded note in g_slist_free about using *free_full to mirror GList docs
Chris Kühl [Sun, 5 Dec 2010 23:34:43 +0000 (00:34 +0100)]
Added note in g_slist_free about using *free_full to mirror GList docs

13 years agoUpdated Hebrew translation
Yaron Shahrabani [Sun, 5 Dec 2010 11:19:55 +0000 (13:19 +0200)]
Updated Hebrew translation

13 years agoTry to fix the version test on builders
Matthias Clasen [Sat, 4 Dec 2010 19:12:07 +0000 (14:12 -0500)]
Try to fix the version test on builders

13 years agoUpdated Traditional Chinese translation(Hong Kong and Taiwan)
Chao-Hsiung Liao [Sat, 4 Dec 2010 12:01:37 +0000 (20:01 +0800)]
Updated Traditional Chinese translation(Hong Kong and Taiwan)

13 years agoAdd missing Since: tag
Matthias Clasen [Fri, 3 Dec 2010 19:48:35 +0000 (14:48 -0500)]
Add missing Since: tag

g_simple_async_result_is_valid was added in 2.20.

Bug 636351

13 years agoReword awkward sentence in the docs
Matthias Clasen [Fri, 3 Dec 2010 19:45:09 +0000 (14:45 -0500)]
Reword awkward sentence in the docs

Pointed out in bug 636305, the docs for g_queue_remove_all() had
several grammatical errors and sounded awkward.

13 years agoAvoid shadowing dir builtin
Matthias Clasen [Fri, 3 Dec 2010 19:39:59 +0000 (14:39 -0500)]
Avoid shadowing dir builtin

This is the same change that was already applied to the other gdb
script we ship. I had forgotten there was a second one.

13 years agointrospection: Remove spurious trailing :
Colin Walters [Fri, 3 Dec 2010 19:25:51 +0000 (14:25 -0500)]
introspection: Remove spurious trailing :

This isn't valid syntax.

13 years agoAvoid shadowing the dir builtin
Matthias Clasen [Fri, 3 Dec 2010 19:08:36 +0000 (14:08 -0500)]
Avoid shadowing the dir builtin

Proposed by David Malcolm,

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

13 years agoglib: Document g_string_free semantics better in the FALSE case
Colin Walters [Fri, 3 Dec 2010 15:36:16 +0000 (10:36 -0500)]
glib: Document g_string_free semantics better in the FALSE case

13 years agoResolve warnings about istream and ostream in socket test
Christian Dywan [Fri, 3 Dec 2010 15:33:24 +0000 (16:33 +0100)]
Resolve warnings about istream and ostream in socket test

13 years agoFix typo in docs for extension point
Thomas Hindoe Paaboel Andersen [Tue, 30 Nov 2010 01:12:16 +0000 (02:12 +0100)]
Fix typo in docs for extension point

Introduced in fcd3e3422749ddbbf29809fcc90ffe8df9d5f696

13 years agoglib: Fix enumeration warnings from gcc 4.5
Benjamin Otte [Thu, 2 Dec 2010 19:10:23 +0000 (20:10 +0100)]
glib: Fix enumeration warnings from gcc 4.5

Just introduce more values for our private enum for the cases that were
missing.

13 years agogobject: Cast token type to guint to avoid gcc warning
Benjamin Otte [Thu, 2 Dec 2010 19:09:59 +0000 (20:09 +0100)]
gobject: Cast token type to guint to avoid gcc warning

The usual fix for all things GScanner...

13 years agogio: Comment out a whole test
Benjamin Otte [Thu, 2 Dec 2010 19:09:08 +0000 (20:09 +0100)]
gio: Comment out a whole test

... instead of just commenting out the registration and leaving "unused
function" warnings for gcc.

13 years agogio: Remove unused variables from test
Benjamin Otte [Thu, 2 Dec 2010 19:08:34 +0000 (20:08 +0100)]
gio: Remove unused variables from test

13 years agoFix typo in API docs for GDateTime
Bastien Nocera [Thu, 2 Dec 2010 16:59:22 +0000 (16:59 +0000)]
Fix typo in API docs for GDateTime

s/monty/month/

13 years agoBug 636100 - Can't read GSettings:backend property
Matthew Barnes [Wed, 1 Dec 2010 00:19:12 +0000 (18:19 -0600)]
Bug 636100 - Can't read GSettings:backend property

The PROP_BACKEND case was missing from the switch statement in
g_settings_get_property().

13 years agogmain: Add Since: 2.28 tag to g_source_{add,remove}_child_source
Damien Lespiau [Tue, 30 Nov 2010 23:04:17 +0000 (23:04 +0000)]
gmain: Add Since: 2.28 tag to g_source_{add,remove}_child_source

New API should have gtk-doc tags to document the version it was
introduced.

Signed-off-by: Javier Jardón <jjardon@gnome.org>
13 years agoUpdated Spanish translation
Jorge González [Tue, 30 Nov 2010 22:42:08 +0000 (23:42 +0100)]
Updated Spanish translation

13 years agoUpdated Galician translations
Fran Diéguez [Mon, 29 Nov 2010 16:35:51 +0000 (17:35 +0100)]
Updated Galician translations

13 years agoBump version
Matthias Clasen [Mon, 29 Nov 2010 15:36:43 +0000 (10:36 -0500)]
Bump version

13 years agoUpdate POTFILES.in
Matthias Clasen [Mon, 29 Nov 2010 14:30:07 +0000 (09:30 -0500)]
Update POTFILES.in

13 years agotiny fix to g_io_modules_scan_all_in_directory() docs
Dan Winship [Mon, 29 Nov 2010 14:36:07 +0000 (09:36 -0500)]
tiny fix to g_io_modules_scan_all_in_directory() docs

13 years agogsettingsschema: plug leak
Xan Lopez [Mon, 29 Nov 2010 14:29:12 +0000 (15:29 +0100)]
gsettingsschema: plug leak

13 years agoAdd another bug
Matthias Clasen [Mon, 29 Nov 2010 13:10:11 +0000 (08:10 -0500)]
Add another bug

13 years agoFixes GB#635187: Always unbox GVariant parameter received via dbus for an action
Aleksander Morgado [Thu, 18 Nov 2010 17:00:57 +0000 (18:00 +0100)]
Fixes GB#635187: Always unbox GVariant parameter received via dbus for an action

13 years agoAdd new extension point to the list
Matthias Clasen [Mon, 29 Nov 2010 06:39:06 +0000 (01:39 -0500)]
Add new extension point to the list

13 years agoDocumentation tweak
Matthias Clasen [Mon, 29 Nov 2010 06:20:58 +0000 (01:20 -0500)]
Documentation tweak

13 years agoUpdate NEWS
Matthias Clasen [Mon, 29 Nov 2010 06:16:02 +0000 (01:16 -0500)]
Update NEWS

13 years agoVarious doc tweaks
Matthias Clasen [Mon, 29 Nov 2010 04:55:43 +0000 (23:55 -0500)]
Various doc tweaks

13 years agoRemove nonexisting type
Matthias Clasen [Mon, 29 Nov 2010 03:11:57 +0000 (22:11 -0500)]
Remove nonexisting type

13 years agoRemoved mention of inexistent GNOME 2.0 porting guide
Matt Rajca [Sat, 13 Nov 2010 16:01:34 +0000 (10:01 -0600)]
Removed mention of inexistent GNOME 2.0 porting guide

13 years agoFixed typo in public string in gsocks (630559)
Matt Rajca [Sat, 13 Nov 2010 19:01:11 +0000 (13:01 -0600)]
Fixed typo in public string in gsocks (630559)

13 years agogobject: added property test
Jonas Holmberg [Wed, 22 Sep 2010 21:02:05 +0000 (23:02 +0200)]
gobject: added property test

Added test for setting properties with g_object_new.

13 years agogobject: initialize memory in g_object_new_valist
Jonas Holmberg [Thu, 23 Sep 2010 23:20:50 +0000 (01:20 +0200)]
gobject: initialize memory in g_object_new_valist

memset parameters array in g_object_new_valist to zeroes when expanding
the array to avoid acces to uninitialized memory.

13 years agoFixes GB#530786: GFileMonitor 'changed' signal underdocumented
Aleksander Morgado [Thu, 25 Nov 2010 17:38:33 +0000 (18:38 +0100)]
Fixes GB#530786: GFileMonitor 'changed' signal underdocumented

13 years agoFix the wrong-category schema test
Christian Persch [Fri, 26 Nov 2010 21:46:51 +0000 (22:46 +0100)]
Fix the wrong-category schema test

It's supposed to test a <default l10n="..."> with a non-existent
category, so make it actually check this!

Bug #635882.

13 years agoGFileMonitor: Don't accept negative values for rate-limit
Matthias Clasen [Sun, 28 Nov 2010 22:14:49 +0000 (17:14 -0500)]
GFileMonitor: Don't accept negative values for rate-limit

Patch by Alksander Morgado,
https://bugzilla.gnome.org/show_bug.cgi?id=635768

13 years agoInherit gettext-domain from <schemalist>
Christian Persch [Fri, 26 Nov 2010 20:05:20 +0000 (21:05 +0100)]
Inherit gettext-domain from <schemalist>

When the <schema> doesn't have a 'gettext-domain' attribute, but
the <schemalist> does, use that one.

Bug #635640.

13 years agoMake gio/tests/g-icon pass again
Dan Winship [Sat, 27 Nov 2010 21:56:44 +0000 (16:56 -0500)]
Make gio/tests/g-icon pass again

It got broken in two different ways by the g_str_hash() change
(354d655b)

13 years agoTypo fix
Christian Persch [Mon, 15 Nov 2010 18:55:57 +0000 (19:55 +0100)]
Typo fix

13 years agoUse same variable names in .h and .c
Christian Persch [Sat, 27 Nov 2010 11:45:45 +0000 (12:45 +0100)]
Use same variable names in .h and .c

13 years agoAdd initial TLS (SSL) support to gio
Dan Winship [Mon, 21 Dec 2009 19:50:32 +0000 (20:50 +0100)]
Add initial TLS (SSL) support to gio

This adds an extension point for TLS connections to gio, with a
gnutls-based implementation in glib-networking.

Full TLS support is still a work in progress; the current API is
missing some features, and parts of it may still be changed before
2.28.

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

13 years agomake GProxyConnection public, as GTcpWrapperConnection
Dan Winship [Tue, 2 Nov 2010 00:22:24 +0000 (20:22 -0400)]
make GProxyConnection public, as GTcpWrapperConnection

GProxyConnection is a class that was added for proxy support;
g_socket_client_connect() returns a GSocketConnection, but in some
cases (eg, encrypted SOCKS), GProxy might return a GIOStream that is
not a GSocketConnection. In that case, GSocketClient would wrap the
stream up in a GProxyConnection, which is a subclass of
GSocketConnection but uses the input/output streams of the wrapped
connection.

GTlsConnection is not a GSocketConnection, so it has the same problem,
so it will need the same treatment. Rename the class to
GTcpWrapperStream, and make it public, so people can extract the base
stream from it when necessary.

(This is not ideal and GSocketClient will need to be revisited as an
API at some point...)

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

13 years agoAdd pollable input/output streams
Dan Winship [Sat, 18 Sep 2010 17:05:25 +0000 (13:05 -0400)]
Add pollable input/output streams

When interfacing with APIs that expect unix-style async I/O, it is
useful to be able to tell in advance whether a read/write is going to
block. This adds new interfaces GPollableInputStream and
GPollableOutputStream that can be implemented by a GInputStream or
GOutputStream to add _is_readable/_is_writable, _create_source, and
_read_nonblocking/_write_nonblocking methods.

Also, implement for GUnixInput/OutputStream and
GSocketInput/OutputStream

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

13 years agoGCancellable: add g_cancellable_create_source()
Dan Winship [Sat, 6 Nov 2010 19:49:55 +0000 (15:49 -0400)]
GCancellable: add g_cancellable_create_source()

g_cancellable_create_source() returns a GSource that triggers when its
corresponding GCancellable is cancelled. This can be used with
g_source_add_child_source() to add cancellability to a source.

Port gasynchelper's FDSource to use this rather than doing its own
cancellable handling, and also fix up its callback argument order to
be more normal.

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

13 years agogmain: add g_source_add_child_source and g_source_remove_child_source
Dan Winship [Sat, 6 Nov 2010 14:11:15 +0000 (10:11 -0400)]
gmain: add g_source_add_child_source and g_source_remove_child_source

This adds "child source" support to GSource. A child source behaves
basically like a GPollFD; when you add a source to a context, all of
its child sources are added with the same priority; when you destroy a
source, all of its child sources are destroyed; and when a child
source triggers, its parent source's dispatch function is run.

Use cases include:

    - adding a GTimeoutSource to another source to cause the source to
      automatically trigger after a certain timeout.

    - wrapping an existing source type with a new type that has
      a different callback signature

    - creating a source that triggers based on different conditions
      at different times.

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

13 years agoAdd g_source_set_dummy_callback()
Dan Winship [Sun, 7 Nov 2010 16:49:40 +0000 (11:49 -0500)]
Add g_source_set_dummy_callback()

Use g_source_set_closure() and g_close_set_meta_marshal() to allow
setting a do-nothing callback on any source.

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

13 years agoImplement closure-related methods for gio GSource types
Dan Winship [Sun, 7 Nov 2010 16:05:26 +0000 (11:05 -0500)]
Implement closure-related methods for gio GSource types

Also, fix up the argument ordering on GFDSourceFunc

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

13 years agogmain: fix some silly code in a programmer-error case
Dan Winship [Sat, 6 Nov 2010 13:45:20 +0000 (09:45 -0400)]
gmain: fix some silly code in a programmer-error case

Previously if a source got finalized while still attached to a
context, it would warn and re-ref the source. But then it just freed
it anyway... So keep the warning but drop the re-ref.

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