Commit 62e5d0cd authored by Milan Crha's avatar Milan Crha

Bug 750564 - Make server settings lookup extensible

parent 726856bb
......@@ -99,6 +99,9 @@ set(SOURCES
e-color-chooser-widget.c
e-color-combo.c
e-config.c
e-config-lookup.c
e-config-lookup-result.c
e-config-lookup-result-simple.c
e-conflict-search-selector.c
e-contact-store.c
e-content-editor.c
......@@ -365,6 +368,9 @@ set(HEADERS
e-color-chooser-widget.h
e-color-combo.h
e-config.h
e-config-lookup.h
e-config-lookup-result.h
e-config-lookup-result-simple.h
e-conflict-search-selector.h
e-contact-store.h
e-content-editor.h
......
This diff is collapsed.
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Copyright (C) 2017 Red Hat, Inc. (www.redhat.com)
*
* This library is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION)
#error "Only <e-util/e-util.h> should be included directly."
#endif
#ifndef E_CONFIG_LOOKUP_RESULT_SIMPLE_H
#define E_CONFIG_LOOKUP_RESULT_SIMPLE_H
#include <libedataserver/libedataserver.h>
#include <e-util/e-config-lookup-result.h>
/* Standard GObject macros */
#define E_TYPE_CONFIG_LOOKUP_RESULT_SIMPLE \
(e_config_lookup_result_simple_get_type ())
#define E_CONFIG_LOOKUP_RESULT_SIMPLE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST \
((obj), E_TYPE_CONFIG_LOOKUP_RESULT_SIMPLE, EConfigLookupResultSimple))
#define E_CONFIG_LOOKUP_RESULT_SIMPLE_CLASS(cls) \
(G_TYPE_CHECK_CLASS_CAST \
((cls), E_TYPE_CONFIG_LOOKUP_RESULT_SIMPLE, EConfigLookupResultSimpleClass))
#define E_IS_CONFIG_LOOKUP_RESULT_SIMPLE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE \
((obj), E_TYPE_CONFIG_LOOKUP_RESULT_SIMPLE))
#define E_IS_CONFIG_LOOKUP_RESULT_SIMPLE_CLASS(cls) \
(G_TYPE_CHECK_CLASS_TYPE \
((cls), E_TYPE_CONFIG_LOOKUP_RESULT_SIMPLE))
#define E_CONFIG_LOOKUP_RESULT_SIMPLE_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS \
((obj), E_TYPE_CONFIG_LOOKUP_RESULT_SIMPLE, EConfigLookupResultSimpleClass))
G_BEGIN_DECLS
typedef struct _EConfigLookupResultSimple EConfigLookupResultSimple;
typedef struct _EConfigLookupResultSimpleClass EConfigLookupResultSimpleClass;
typedef struct _EConfigLookupResultSimplePrivate EConfigLookupResultSimplePrivate;
/**
* EConfigLookupResultSimple:
*
* Contains only private data that should be read and manipulated using
* the functions below.
*
* Since: 3.26
**/
struct _EConfigLookupResultSimple {
/*< private >*/
GObject parent;
EConfigLookupResultSimplePrivate *priv;
};
struct _EConfigLookupResultSimpleClass {
/*< private >*/
GObjectClass parent_class;
gboolean (* configure_source) (EConfigLookupResult *lookup_result,
ESource *source);
};
GType e_config_lookup_result_simple_get_type (void) G_GNUC_CONST;
EConfigLookupResult *
e_config_lookup_result_simple_new (EConfigLookupResultKind kind,
gint priority,
const gchar *protocol,
const gchar *display_name,
const gchar *description);
void e_config_lookup_result_simple_add_value (EConfigLookupResult *lookup_result,
const gchar *extension_name,
const gchar *property_name,
const GValue *value);
void e_config_lookup_result_simple_add_boolean
(EConfigLookupResult *lookup_result,
const gchar *extension_name,
const gchar *property_name,
gboolean value);
void e_config_lookup_result_simple_add_int (EConfigLookupResult *lookup_result,
const gchar *extension_name,
const gchar *property_name,
gint value);
void e_config_lookup_result_simple_add_uint (EConfigLookupResult *lookup_result,
const gchar *extension_name,
const gchar *property_name,
guint value);
void e_config_lookup_result_simple_add_int64 (EConfigLookupResult *lookup_result,
const gchar *extension_name,
const gchar *property_name,
gint64 value);
void e_config_lookup_result_simple_add_uint64(EConfigLookupResult *lookup_result,
const gchar *extension_name,
const gchar *property_name,
guint64 value);
void e_config_lookup_result_simple_add_double(EConfigLookupResult *lookup_result,
const gchar *extension_name,
const gchar *property_name,
gdouble value);
void e_config_lookup_result_simple_add_string(EConfigLookupResult *lookup_result,
const gchar *extension_name,
const gchar *property_name,
const gchar *value);
void e_config_lookup_result_simple_add_enum (EConfigLookupResult *lookup_result,
const gchar *extension_name,
const gchar *property_name,
GType enum_type,
gint value);
G_END_DECLS
#endif /* E_CONFIG_LOOKUP_RESULT_SIMPLE_H */
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Copyright (C) 2017 Red Hat, Inc. (www.redhat.com)
*
* This library is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* SECTION: e-config-lookup-result
* @include: e-util/e-util.h
* @short_description: Configuration lookup result interface
*
* #EConfigLookupResult is an interface which actual results need to implement.
* Such result holds information about one kind and knows how to setup
* an #ESource with the looked up values.
*
* Simple changes can be saved using #EConfigLookupResultSimple object.
**/
#include "evolution-config.h"
#include <libedataserver/libedataserver.h>
#include "e-util-enums.h"
#include "e-config-lookup-result.h"
G_DEFINE_INTERFACE (EConfigLookupResult, e_config_lookup_result, G_TYPE_OBJECT)
static void
e_config_lookup_result_default_init (EConfigLookupResultInterface *iface)
{
iface->get_kind = NULL;
iface->get_priority = NULL;
iface->get_protocol = NULL;
iface->get_display_name = NULL;
iface->get_description = NULL;
iface->configure_source = NULL;
}
/**
* e_config_lookup_result_get_kind:
* @lookup_result: an #EConfigLookupResult
*
* Returns: the result kind, one of #EConfigLookupResultKind, this lookup result corresponds to
*
* Since: 3.26
**/
EConfigLookupResultKind
e_config_lookup_result_get_kind (EConfigLookupResult *lookup_result)
{
EConfigLookupResultInterface *iface;
g_return_val_if_fail (E_IS_CONFIG_LOOKUP_RESULT (lookup_result), E_CONFIG_LOOKUP_RESULT_UNKNOWN);
iface = E_CONFIG_LOOKUP_RESULT_GET_INTERFACE (lookup_result);
g_return_val_if_fail (iface != NULL, E_CONFIG_LOOKUP_RESULT_UNKNOWN);
g_return_val_if_fail (iface->get_kind != NULL, E_CONFIG_LOOKUP_RESULT_UNKNOWN);
return iface->get_kind (lookup_result);
}
/**
* e_config_lookup_result_get_priority:
* @lookup_result: an #EConfigLookupResult
*
* Returns: the result priority; lower value means higher priority
*
* Since: 3.26
**/
gint
e_config_lookup_result_get_priority (EConfigLookupResult *lookup_result)
{
EConfigLookupResultInterface *iface;
g_return_val_if_fail (E_IS_CONFIG_LOOKUP_RESULT (lookup_result), ~0);
iface = E_CONFIG_LOOKUP_RESULT_GET_INTERFACE (lookup_result);
g_return_val_if_fail (iface != NULL, ~0);
g_return_val_if_fail (iface->get_priority != NULL, ~0);
return iface->get_priority (lookup_result);
}
/**
* e_config_lookup_result_get_protocol:
* @lookup_result: an #EConfigLookupResult
*
* Returns: (nullable): if applicable, returns the protocol of this @lookup_result,
* or %NULL if not set, or not known, or not applicable
*
* Since: 3.26
**/
const gchar *
e_config_lookup_result_get_protocol (EConfigLookupResult *lookup_result)
{
EConfigLookupResultInterface *iface;
g_return_val_if_fail (E_IS_CONFIG_LOOKUP_RESULT (lookup_result), NULL);
iface = E_CONFIG_LOOKUP_RESULT_GET_INTERFACE (lookup_result);
g_return_val_if_fail (iface != NULL, NULL);
g_return_val_if_fail (iface->get_protocol != NULL, NULL);
return iface->get_protocol (lookup_result);
}
/**
* e_config_lookup_result_get_display_name:
* @lookup_result: an #EConfigLookupResult
*
* Returns: human readable display name of this @lookup_result
*
* Since: 3.26
**/
const gchar *
e_config_lookup_result_get_display_name (EConfigLookupResult *lookup_result)
{
EConfigLookupResultInterface *iface;
g_return_val_if_fail (E_IS_CONFIG_LOOKUP_RESULT (lookup_result), NULL);
iface = E_CONFIG_LOOKUP_RESULT_GET_INTERFACE (lookup_result);
g_return_val_if_fail (iface != NULL, NULL);
g_return_val_if_fail (iface->get_display_name != NULL, NULL);
return iface->get_display_name (lookup_result);
}
/**
* e_config_lookup_result_get_description:
* @lookup_result: an #EConfigLookupResult
*
* Returns: human readable description of this @lookup_result
*
* Since: 3.26
**/
const gchar *
e_config_lookup_result_get_description (EConfigLookupResult *lookup_result)
{
EConfigLookupResultInterface *iface;
g_return_val_if_fail (E_IS_CONFIG_LOOKUP_RESULT (lookup_result), NULL);
iface = E_CONFIG_LOOKUP_RESULT_GET_INTERFACE (lookup_result);
g_return_val_if_fail (iface != NULL, NULL);
g_return_val_if_fail (iface->get_description != NULL, NULL);
return iface->get_description (lookup_result);
}
/**
* e_config_lookup_result_configure_source:
* @lookup_result: an #EConfigLookupResult
* @source: an #ESource to configure
*
* Configures the @source with the looked up configuration.
*
* Returns: %TRUE when made any changes to the @source, %FALSE otherwise
*
* Since: 3.26
**/
gboolean
e_config_lookup_result_configure_source (EConfigLookupResult *lookup_result,
ESource *source)
{
EConfigLookupResultInterface *iface;
g_return_val_if_fail (E_IS_CONFIG_LOOKUP_RESULT (lookup_result), FALSE);
iface = E_CONFIG_LOOKUP_RESULT_GET_INTERFACE (lookup_result);
g_return_val_if_fail (iface != NULL, FALSE);
g_return_val_if_fail (iface->configure_source != NULL, FALSE);
return iface->configure_source (lookup_result, source);
}
/**
* e_config_lookup_result_compare:
* @lookup_result_a: the first #EConfigLookupResult
* @lookup_result_b: the second #EConfigLookupResult
*
* Compares two #EConfigLookupResult objects, and returns value less than 0,
* when @lookup_result_a is before @lookup_result_b, 0 when they are the same
* and value greater than 0, when @lookup_result_a is after @lookup_result_b.
*
* The comparison is done on kind, priority and display name values, in this order.
*
* Returns: strcmp()-like value, what the position between @lookup_result_a and
* @lookup_result_b is.
*
* Since: 3.26
**/
gint
e_config_lookup_result_compare (gconstpointer lookup_result_a,
gconstpointer lookup_result_b)
{
EConfigLookupResult *lra, *lrb;
gint res;
g_return_val_if_fail (E_IS_CONFIG_LOOKUP_RESULT (lookup_result_a), 0);
g_return_val_if_fail (E_IS_CONFIG_LOOKUP_RESULT (lookup_result_b), 0);
lra = E_CONFIG_LOOKUP_RESULT (lookup_result_a);
lrb = E_CONFIG_LOOKUP_RESULT (lookup_result_b);
res = e_config_lookup_result_get_kind (lra) - e_config_lookup_result_get_kind (lrb);
if (!res)
res = e_config_lookup_result_get_priority (lra) - e_config_lookup_result_get_priority (lrb);
if (!res) {
const gchar *display_name_a, *display_name_b;
display_name_a = e_config_lookup_result_get_display_name (lra);
display_name_b = e_config_lookup_result_get_display_name (lrb);
if (!display_name_a || !display_name_b)
res = g_strcmp0 (display_name_a, display_name_b);
else
res = g_utf8_collate (display_name_a, display_name_b);
}
return res;
}
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Copyright (C) 2017 Red Hat, Inc. (www.redhat.com)
*
* This library is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION)
#error "Only <e-util/e-util.h> should be included directly."
#endif
#ifndef E_CONFIG_LOOKUP_RESULT_H
#define E_CONFIG_LOOKUP_RESULT_H
#include <libedataserver/libedataserver.h>
#include <e-util/e-util-enums.h>
/* Standard GObject macros */
#define E_TYPE_CONFIG_LOOKUP_RESULT \
(e_config_lookup_result_get_type ())
#define E_CONFIG_LOOKUP_RESULT(obj) \
(G_TYPE_CHECK_INSTANCE_CAST \
((obj), E_TYPE_CONFIG_LOOKUP_RESULT, EConfigLookupResult))
#define E_CONFIG_LOOKUP_RESULT_INTERFACE(cls) \
(G_TYPE_CHECK_CLASS_CAST \
((cls), E_TYPE_CONFIG_LOOKUP_RESULT, EConfigLookupResultInterface))
#define E_IS_CONFIG_LOOKUP_RESULT(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE \
((obj), E_TYPE_CONFIG_LOOKUP_RESULT))
#define E_IS_CONFIG_LOOKUP_RESULT_INTERFACE(cls) \
(G_TYPE_CHECK_CLASS_TYPE \
((cls), E_TYPE_CONFIG_LOOKUP_RESULT))
#define E_CONFIG_LOOKUP_RESULT_GET_INTERFACE(obj) \
(G_TYPE_INSTANCE_GET_INTERFACE \
((obj), E_TYPE_CONFIG_LOOKUP_RESULT, EConfigLookupResultInterface))
#define E_CONFIG_LOOKUP_RESULT_PRIORITY_IMAP 1000
#define E_CONFIG_LOOKUP_RESULT_PRIORITY_POP3 2000
#define E_CONFIG_LOOKUP_RESULT_PRIORITY_SMTP 1000
G_BEGIN_DECLS
typedef struct _EConfigLookupResult EConfigLookupResult;
typedef struct _EConfigLookupResultInterface EConfigLookupResultInterface;
struct _EConfigLookupResultInterface {
GTypeInterface parent_interface;
EConfigLookupResultKind
(* get_kind) (EConfigLookupResult *lookup_result);
gint (* get_priority) (EConfigLookupResult *lookup_result);
const gchar * (* get_protocol) (EConfigLookupResult *lookup_result);
const gchar * (* get_display_name) (EConfigLookupResult *lookup_result);
const gchar * (* get_description) (EConfigLookupResult *lookup_result);
gboolean (* configure_source) (EConfigLookupResult *lookup_result,
ESource *source);
};
GType e_config_lookup_result_get_type (void);
EConfigLookupResultKind
e_config_lookup_result_get_kind (EConfigLookupResult *lookup_result);
gint e_config_lookup_result_get_priority (EConfigLookupResult *lookup_result);
const gchar * e_config_lookup_result_get_protocol (EConfigLookupResult *lookup_result);
const gchar * e_config_lookup_result_get_display_name (EConfigLookupResult *lookup_result);
const gchar * e_config_lookup_result_get_description (EConfigLookupResult *lookup_result);
gboolean e_config_lookup_result_configure_source (EConfigLookupResult *lookup_result,
ESource *source);
gint e_config_lookup_result_compare (gconstpointer lookup_result_a,
gconstpointer lookup_result_b);
G_END_DECLS
#endif /* E_CONFIG_LOOKUP_RESULT_H */
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Copyright (C) 2017 Red Hat, Inc. (www.redhat.com)
*
* This library is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* SECTION: e-config-lookup
* @include: e-util/e-util.h
* @short_description: Configuration lookup
*
* #EConfigLookup is used to search for configuration of an account,
* which is identified by an e-mail address, server address or such.
* It is an #EExtensible object, where the extensions connect to
* the #EConfigLookup::run signal to run the configuration lookup.
**/
#include "evolution-config.h"
#include <libedataserver/libedataserver.h>
#include "e-activity.h"
#include "e-config-lookup-result.h"
#include "e-simple-async-result.h"
#include "e-util-enumtypes.h"
#include "e-config-lookup.h"
struct _EConfigLookupPrivate {
ESourceRegistry *registry;
GMutex property_lock;
GSList *results; /* EConfigLookupResult * */
ESimpleAsyncResult *run_result;
GCancellable *run_cancellable;
GThreadPool *pool;
};
enum {
PROP_0,
PROP_REGISTRY
};
enum {
RUN,
GET_SOURCE,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL];
G_DEFINE_TYPE_WITH_CODE (EConfigLookup, e_config_lookup, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (E_TYPE_EXTENSIBLE, NULL))
typedef struct _ThreadData {
ENamedParameters *params;
EActivity *activity;
EConfigLookupThreadFunc thread_func;
gpointer user_data;
GDestroyNotify user_data_free;
} ThreadData;
static void
config_lookup_thread (gpointer data,
gpointer user_data)
{
ThreadData *td = data;
EConfigLookup *config_lookup = user_data;
g_return_if_fail (td != NULL);
g_return_if_fail (td->params != NULL);
g_return_if_fail (E_IS_ACTIVITY (td->activity));
g_return_if_fail (td->thread_func != NULL);
g_return_if_fail (E_IS_CONFIG_LOOKUP (config_lookup));
td->thread_func (config_lookup, td->params, td->user_data, e_activity_get_cancellable (td->activity));
if (td->user_data_free)
td->user_data_free (td->user_data);
e_named_parameters_free (td->params);
g_object_unref (td->activity);
g_free (td);
}
static void
config_lookup_set_registry (EConfigLookup *config_lookup,
ESourceRegistry *registry)
{
g_return_if_fail (E_IS_SOURCE_REGISTRY (registry));
g_return_if_fail (config_lookup->priv->registry == NULL);
config_lookup->priv->registry = g_object_ref (registry);
}
static void
config_lookup_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
switch (property_id) {
case PROP_REGISTRY:
config_lookup_set_registry (
E_CONFIG_LOOKUP (object),
g_value_get_object (value));
return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
static void
config_lookup_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
switch (property_id) {
case PROP_REGISTRY:
g_value_set_object (
value,
e_config_lookup_get_registry (
E_CONFIG_LOOKUP (object)));
return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
static void
config_lookup_constructed (GObject *object)
{
/* Chain up to parent's method. */
G_OBJECT_CLASS (e_config_lookup_parent_class)->constructed (object);
e_extensible_load_extensions (E_EXTENSIBLE (object));
}
static void
config_lookup_dispose (GObject *object)
{
EConfigLookup *config_lookup = E_CONFIG_LOOKUP (object);
g_mutex_lock (&config_lookup->priv->property_lock);
if (config_lookup->priv->run_cancellable) {
g_cancellable_cancel (config_lookup->priv->run_cancellable);
g_clear_object (&config_lookup->priv->run_cancellable);
}
g_mutex_unlock (&config_lookup->priv->property_lock);
g_clear_object (&config_lookup->priv->registry);
/* Chain up to parent's method. */
G_OBJECT_CLASS (e_config_lookup_parent_class)->dispose (object);
}
static void
config_lookup_finalize (GObject *object)
{
EConfigLookup *config_lookup = E_CONFIG_LOOKUP (object);
g_slist_free_full (config_lookup->priv->results, g_object_unref);
g_thread_pool_free (config_lookup->priv->pool, TRUE, FALSE);
g_mutex_clear (&config_lookup->priv->property_lock);
/* Chain up to parent's method. */
G_OBJECT_CLASS (e_config_lookup_parent_class)->finalize (object);
}
static void
e_config_lookup_class_init (EConfigLookupClass *klass)
{
GObjectClass *object_class;
g_type_class_add_private (klass, sizeof (EConfigLookupPrivate));
object_class = G_OBJECT_CLASS (klass);
object_class->set_property = config_lookup_set_property;
object_class->get_property = config_lookup_get_property;
object_class->constructed = config_lookup_constructed;
object_class->dispose = config_lookup_dispose;
object_class->finalize = config_lookup_finalize;
/**
* EConfigLookup:registry:
*
* The #ESourceRegistry manages #ESource instances.
*
* Since: 3.26
**/
g_object_class_install_property (
object_class,
PROP_REGISTRY,
g_param_spec_object (
"registry",
"Registry",
"Data source registry",
E_TYPE_SOURCE_REGISTRY,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
/**
* EConfigLookup::run:
* @params: an #ENamedParameters with additional parameters
* @activity: an #EActivity
*
* Emitted to run config lookup by each extension. The extensions
* run their code asynchronously and claim the result by
* e_config_lookup_add_result(). The extension also references the @activity
* for the whole run, because it's used to know when all extensions
* are finished with searching. Extensions can use e_config_lookup_create_thread(),
* which does necessary things for it.
*
* The signal is emitted from the main/GUI thread, but the @activity can be
* unreffed in another thread too.
*
* Since: 3.26
**/
signals[RUN] = g_signal_new (
"run",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (EConfigLookupClass, run),
NULL, NULL,
NULL,
G_TYPE_NONE, 2,
E_TYPE_NAMED_PARAMETERS,
E_TYPE_ACTIVITY);
/**
* EConfigLookup::get-source:
* @kind: an #EConfigLookupSourceKind
*
* Emitted to get an #ESource of the given @kind. Return %NULL, when not available.
*
* Since: 3.26
**/
signals[GET_SOURCE] = g_signal_new (
"get-source",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (EConfigLookupClass, get_source),
NULL, NULL,
NULL,
G_TYPE_POINTER, 1,
E_TYPE_CONFIG_LOOKUP_SOURCE_KIND);
}
static void
e_config_lookup_init (EConfigLookup *config_lookup)
{
config_lookup->priv = G_TYPE_INSTANCE_GET_PRIVATE (config_lookup, E_TYPE_CONFIG_LOOKUP, EConfigLookupPrivate);
g_mutex_init (&config_lookup->priv->property_lock);