gio: Add GTlsInteraction interaction method invocation guarantees

* Add 'invoke' style method, which can be used to call an interaction
   from any thread. The interaction will be run in the appropriate
   #GMainContext
 * Sync methods can be called whether main loop is running or not.
 * Derived classes can choose to implement only sync or async
   interaction method, and the invoke method will fill in the blanks.
 * Documentation for the above.
 * Tests for the above.

https://bugzilla.gnome.org/show_bug.cgi?id=657567
This commit is contained in:
Stef Walter
2011-08-28 20:24:56 +02:00
parent 116b2932ab
commit 49bb7cff4b
6 changed files with 1036 additions and 65 deletions

View File

@@ -43,17 +43,17 @@ typedef struct _GTlsInteractionPrivate GTlsInteractionPrivate;
struct _GTlsInteraction
{
/*< private >*/
GObject parent_instance;
GTlsInteractionPrivate *priv;
};
struct _GTlsInteractionClass
{
/*< private >*/
GObjectClass parent_class;
/* virtual methods: */
/*< public >*/
GTlsInteractionResult (* ask_password) (GTlsInteraction *interaction,
GTlsPassword *password,
GCancellable *cancellable,
@@ -76,6 +76,12 @@ struct _GTlsInteractionClass
GType g_tls_interaction_get_type (void) G_GNUC_CONST;
GTlsInteractionResult g_tls_interaction_invoke_ask_password (GTlsInteraction *interaction,
GTlsPassword *password,
GCancellable *cancellable,
GError **error);
GTlsInteractionResult g_tls_interaction_ask_password (GTlsInteraction *interaction,
GTlsPassword *password,
GCancellable *cancellable,