static void gdict_speller_set_property (GObject *gobject, guint prop_id, const GValue *value, GParamSpec *pspec) { GdictSpeller *speller = GDICT_SPELLER (gobject); GdictSpellerPrivate *priv = speller->priv; switch (prop_id) { case PROP_CONTEXT: set_gdict_context (speller, g_value_get_object (value)); break; case PROP_DATABASE: g_free (priv->database); priv->database = g_strdup (g_value_get_string (value)); break; case PROP_STRATEGY: g_free (priv->strategy); priv->strategy = g_strdup (g_value_get_string (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); break; } }
static void gdict_speller_finalize (GObject *gobject) { GdictSpeller *speller = GDICT_SPELLER (gobject); GdictSpellerPrivate *priv = speller->priv; if (priv->context) set_gdict_context (speller, NULL); if (priv->busy_cursor) #if GTK_CHECK_VERSION (3, 0, 0) g_object_unref (priv->busy_cursor); #else gdk_cursor_unref (priv->busy_cursor); #endif g_free (priv->strategy); g_free (priv->database); g_free (priv->word); if (priv->store) g_object_unref (priv->store); G_OBJECT_CLASS (gdict_speller_parent_class)->finalize (gobject); }
/** * gdict_database_chooser_set_context: * @chooser: a #GdictDatabaseChooser * @context: a #GdictContext * * Sets the #GdictContext to be used to query a dictionary source * for the list of available databases. * * Since: 0.10 */ void gdict_database_chooser_set_context (GdictDatabaseChooser *chooser, GdictContext *context) { g_return_if_fail (GDICT_IS_DATABASE_CHOOSER (chooser)); g_return_if_fail (context == NULL || GDICT_IS_CONTEXT (context)); set_gdict_context (chooser, context); g_object_notify (G_OBJECT (chooser), "context"); }
/** * gdict_speller_set_context: * @speller: a #GdictSpeller * @context: a #GdictContext * * FIXME * * Since: */ void gdict_speller_set_context (GdictSpeller *speller, GdictContext *context) { g_return_if_fail (GDICT_IS_SPELLER (speller)); g_return_if_fail (context == NULL || GDICT_IS_CONTEXT (context)); set_gdict_context (speller, context); g_object_notify (G_OBJECT (speller), "context"); }
static void gdict_database_chooser_set_property (GObject *gobject, guint prop_id, const GValue *value, GParamSpec *pspec) { GdictDatabaseChooser *chooser = GDICT_DATABASE_CHOOSER (gobject); switch (prop_id) { case PROP_CONTEXT: set_gdict_context (chooser, g_value_get_object (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); break; } }
static void gdict_database_chooser_dispose (GObject *gobject) { GdictDatabaseChooser *chooser = GDICT_DATABASE_CHOOSER (gobject); GdictDatabaseChooserPrivate *priv = chooser->priv; set_gdict_context (chooser, NULL); g_clear_object (&priv->busy_cursor); if (priv->store) { g_object_unref (priv->store); priv->store = NULL; } G_OBJECT_CLASS (gdict_database_chooser_parent_class)->dispose (gobject); }