After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 666541 - Add introspection support
Add introspection support
Status: RESOLVED FIXED
Product: gnome-dictionary
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gnome-dictionary-maint
gnome-dictionary-maint
Depends on:
Blocks:
 
 
Reported: 2011-12-19 16:22 UTC by Stefano Facchini
Modified: 2015-01-03 21:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
add introspection support (16.28 KB, patch)
2011-12-19 16:22 UTC, Stefano Facchini
reviewed Details | Review
Original patch updated with review comments (15.86 KB, patch)
2014-11-30 13:18 UTC, Juan R. Garcia Blanco
reviewed Details | Review
Add introspection support to libgdict (15.73 KB, patch)
2014-12-26 09:46 UTC, Juan R. Garcia Blanco
accepted-commit_now Details | Review
Add GObject introspection support to libgdict (15.87 KB, patch)
2014-12-29 09:11 UTC, Juan R. Garcia Blanco
none Details | Review

Description Stefano Facchini 2011-12-19 16:22:34 UTC
Created attachment 203887 [details] [review]
add introspection support

add Gobject introspection support to libgdict
Comment 1 Antono Vasiljev 2012-01-04 13:17:11 UTC
I want this in master :)
Comment 2 Stefano Facchini 2012-01-04 13:28:34 UTC
(In reply to comment #1)
> I want this in master :)

Hi,
the main goal I had in mind when I wrote this patch was adding dictionary integration to GNOME shell, but after discussing with ebassi it turned out that libgdict is probabily not suitable as search provider, since it works only with the old DICT protocol. Something new is required if we want other dictionary sources like Wiktionary (see for example the Dbpedia project and its Wiktionary spin-off described in http://lists.wikimedia.org/pipermail/wiktionary-l/2011-December/001100.html)
Comment 3 Antono Vasiljev 2012-01-04 21:17:58 UTC
Well. Is it good reason to drop the patch?
Dict protocol can be usable by someone else if not gnome-shell.
Comment 4 Antono Vasiljev 2012-01-06 11:15:43 UTC
For example i going to implement language learning app. It would be nice to use gdict for this.
Comment 5 Emmanuele Bassi (:ebassi) 2014-11-02 11:02:01 UTC
Review of attachment 203887 [details] [review]:

looks generally okay, but a bit out of date.

::: configure.ac
@@ +162,3 @@
 
+# Introspection
+GOBJECT_INTROSPECTION_CHECK([0.9.3])

this should likely be updated, and made unconditional: we always want to generate introspection data.

::: libgdict/gdict-client-context.c
@@ +504,3 @@
 /**
  * gdict_client_context_new:
+ * @hostname: (allow-none): the hostname of a dictionary server,

this should be (optional), now that we have it.

@@ +530,3 @@
  * gdict_client_context_set_hostname:
  * @context: a #GdictClientContext
+ * @hostname: (allow-none): the hostname of a Dictionary server, or %NULL

this should be (optional).

@@ +611,3 @@
  * gdict_client_context_set_client:
  * @context: a #GdictClientContext
+ * @client: (allow-none): the client name to use, or %NULL

this should be (optional).

::: libgdict/gdict-context.c
@@ +332,3 @@
  * gdict_context_match_word:
  * @context: a #GdictContext
+ * @database: (allow-none): a database name to search into, or %NULL for the

this should be (optional)

@@ +335,2 @@
  *    default database
+ * @strategy: (allow-none): a strategy name to use for matching, or %NULL for

this should be (optional)

@@ +376,3 @@
  * gdict_context_define_word:
  * @context: a #GdictContext
+ * @database: (allow-none): a database name to search into, or %NULL for the

this should be (optional)

::: libgdict/gdict-defbox.c
@@ +2783,3 @@
  * gdict_defbox_get_text:
  * @defbox: a #GdictDefbox
+ * @length: (out) (allow-none): return location for the text length or %NULL

this should probably be (out) (nullable), but it's worth checking for annotations of similar API in GTK+.

@@ +2819,3 @@
  * gdict_defbox_set_font_name:
  * @defbox: a #GdictDefbox
+ * @font_name: (allow-none): a font description, or %NULL

this should be (optional)

::: libgdict/gdict-source-chooser.c
@@ +446,3 @@
  * gdict_source_chooser_set_loader:
  * @chooser: a #GdictSourceChooser
+ * @loader: (allow-none): a #GdictSourceLoader or %NULL to unset it

this should be (optional).

::: libgdict/gdict-source-loader.c
@@ +417,3 @@
  * gdict_source_loader_get_names:
  * @loader: a #GdictSourceLoader
+ * @length: (out) (allow-none): return location for the number of

this should likely be (out) (nullable).

::: libgdict/gdict-source.c
@@ +714,3 @@
  * gdict_source_to_data:
  * @source: a #GdictSource
+ * @length: (out) (allow-none): return loaction for the length

this should likely be (out) (nullable)

@@ +820,3 @@
  * gdict_source_set_description:
  * @source: a #GdictSource
+ * @description: (allow-none): a UTF-8 encoded description or %NULL

this should be (optional)

@@ +882,3 @@
  * gdict_source_set_database:
  * @source: a #GdictSource
+ * @database: (allow-none): a UTF-8 encoded database name or %NULL

this should be (optional)

@@ +944,3 @@
  * gdict_source_set_strategy:
  * @source: a #GdictSource
+ * @strategy: (allow-none): a UTF-8 encoded strategy or %NULL

this should be (optional)

::: libgdict/gdict-strategy-chooser.c
@@ +510,3 @@
  * gdict_strategy_chooser_set_context:
  * @chooser: a #GdictStrategyChooser
+ * @context: (allow-none): a #GdictContext, or %NULL to unset the context

this should be (optional)

::: libgdict/gdict-utils.c
@@ +290,3 @@
  * @widget: the widget that emits the error
  * @title: the primary error message
+ * @message: (allow-none): the secondary error message or %NULL

this should be (optional)
Comment 6 Juan R. Garcia Blanco 2014-11-30 13:16:53 UTC
Not an expert, but I think it is the other way around, allow-none should be replaced by nullable for (in) parameters, and by optional for (out) parameters.

Anyway, I think there are a few annotations missing.

I could update the patch if the original author is no longer interested.
Comment 7 Juan R. Garcia Blanco 2014-11-30 13:18:57 UTC
Created attachment 291825 [details] [review]
Original patch updated with review comments
Comment 8 Emmanuele Bassi (:ebassi) 2014-12-25 12:15:41 UTC
Review of attachment 291825 [details] [review]:

::: configure.ac
@@ +159,3 @@
 
+# Introspection
+GOBJECT_INTROSPECTION_CHECK([0.9.3])

the new annotations come with a recent version of gobject-introspection, so the version check should be updated to reflect that.

I think 1.42.0 is more appropriate.

::: libgdict/gdict-client-context.c
@@ +513,3 @@
  *
+ * Return value: (transfer full): the newly created #GdictClientContext object.
+ *   You should free it using g_object_unref().

while you're modifying the API doc, you should remove the "You should free it using g_object_unref()" sentence.

::: libgdict/gdict-database-chooser.c
@@ +1111,3 @@
  * stock ID.
  *
+ * Return value: (transfer full): the newly packed button.

I think this should be (transfer none): we're not returning a full reference, just a pointer; the button is owned by its container.

::: libgdict/gdict-source-chooser.c
@@ +884,3 @@
  * stock ID.
  *
+ * Return value: (transfer full): the newly packed button.

same here, this should be (transfer none).
Comment 9 Juan R. Garcia Blanco 2014-12-26 09:46:47 UTC
Created attachment 293350 [details] [review]
Add introspection support to libgdict

This patch incorporates comments from last review plus other minor fixes derived from the same comments.
Comment 10 Emmanuele Bassi (:ebassi) 2014-12-26 15:07:40 UTC
looks good. Juan, you should probably change the author of the patch, since you substantially changed it from the original one from Stefano; you can add:

  Original patch by: Stefano Facchini <stefano.facchini@gmail.com>

in the commit message. you should also add a reference to this bug.
Comment 11 Juan R. Garcia Blanco 2014-12-29 09:11:59 UTC
Created attachment 293424 [details] [review]
Add GObject introspection support to libgdict

Thank you. I will commit this patch as soon as I can do ssh :)