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 616634 - Update Gtk2 to gtk+ 2.18
Update Gtk2 to gtk+ 2.18
Status: RESOLVED FIXED
Product: gnome-perl
Classification: Bindings
Component: Gtk2
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk2-perl-bugs
gtk2-perl-bugs
Depends on:
Blocks:
 
 
Reported: 2010-04-23 11:36 UTC by Emmanuele Bassi (:ebassi)
Modified: 2010-12-29 23:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add GtkAction block/unblock activate methods (839 bytes, patch)
2010-04-23 11:36 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review
Add missing 2.16 API for GtkEntry (851 bytes, patch)
2010-04-23 11:36 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review
Add missing to GtkIMMultiContext::set_context_id() (862 bytes, patch)
2010-04-23 11:36 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review
Add GtkEntryBuffer bindings (5.35 KB, patch)
2010-04-23 11:36 UTC, Emmanuele Bassi (:ebassi)
none Details | Review
Add GtkEntryBuffer-related methods to GtkEntry (898 bytes, patch)
2010-04-23 11:36 UTC, Emmanuele Bassi (:ebassi)
none Details | Review
Add missing Gtk2::Widget accessors added in gtk+ 2.18 (1.50 KB, patch)
2010-04-23 11:36 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review
Add GtkEntryBuffer bindings (5.38 KB, patch)
2010-04-23 11:50 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review
Add GtkEntryBuffer-related methods to GtkEntry (898 bytes, patch)
2010-04-23 11:51 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review

Description Emmanuele Bassi (:ebassi) 2010-04-23 11:36:02 UTC
The following patches add the missing 2.16 and 2.18 API wrappers for gtk+.
Comment 1 Emmanuele Bassi (:ebassi) 2010-04-23 11:36:06 UTC
Created attachment 159409 [details] [review]
Add GtkAction block/unblock activate methods

Use a version check, as these methods were added in gtk+ 2.16
Comment 2 Emmanuele Bassi (:ebassi) 2010-04-23 11:36:11 UTC
Created attachment 159410 [details] [review]
Add missing 2.16 API for GtkEntry
Comment 3 Emmanuele Bassi (:ebassi) 2010-04-23 11:36:15 UTC
Created attachment 159411 [details] [review]
Add missing to GtkIMMultiContext::set_context_id()
Comment 4 Emmanuele Bassi (:ebassi) 2010-04-23 11:36:18 UTC
Created attachment 159412 [details] [review]
Add GtkEntryBuffer bindings

In gtk+ 2.18, GtkEntry gained the GtkEntryBuffer object which provides a
model similar to GtkTextBuffer for GtkTextView.
Comment 5 Emmanuele Bassi (:ebassi) 2010-04-23 11:36:22 UTC
Created attachment 159413 [details] [review]
Add GtkEntryBuffer-related methods to GtkEntry
Comment 6 Emmanuele Bassi (:ebassi) 2010-04-23 11:36:26 UTC
Created attachment 159414 [details] [review]
Add missing Gtk2::Widget accessors added in gtk+ 2.18
Comment 7 Emmanuele Bassi (:ebassi) 2010-04-23 11:50:24 UTC
Created attachment 159417 [details] [review]
Add GtkEntryBuffer bindings

In gtk+ 2.18, GtkEntry gained the GtkEntryBuffer object which provides a
model similar to GtkTextBuffer for GtkTextView.
Comment 8 Emmanuele Bassi (:ebassi) 2010-04-23 11:51:59 UTC
Created attachment 159418 [details] [review]
Add GtkEntryBuffer-related methods to GtkEntry
Comment 9 Torsten Schoenfeld 2010-04-24 19:10:14 UTC
Review of attachment 159409 [details] [review]:

Looks good.  Committed with slight changes and tests.
Comment 10 Torsten Schoenfeld 2010-04-24 19:23:47 UTC
Review of attachment 159410 [details] [review]:

Looks good.  Committed with tests.
Comment 11 Torsten Schoenfeld 2010-04-24 19:42:47 UTC
Review of attachment 159411 [details] [review]:

Looks good.  Committed with tests.
Comment 12 Torsten Schoenfeld 2010-04-24 20:00:57 UTC
Review of attachment 159414 [details] [review]:

These new methods need to integrate with those that are already there (defined in GtkWidget.xs starting at line 173).  For example, the allocation() accessor should get a get_allocation() alias and should use gtk_widget_get_allocation inside an #ifdef.
Comment 13 Torsten Schoenfeld 2010-04-24 20:16:01 UTC
Review of attachment 159417 [details] [review]:

Looks good in general.  A few comments:

::: xs/GtkEntryBuffer.xs
@@ +45,3 @@
+MAX_SIZE (class)
+    CODE:
+        RETVAL = GTK_ENTRY_BUFFER_MAX_SIZE;

I think it is better to use the constants wrapping machinery for this.  Just adding a line "GTK_ENTRY_BUFFER_MAX_SIZE	newSVuv" to a newly created "constants-2.18" file should do the trick.

@@ +50,3 @@
+
+GtkEntryBuffer_noinc *
+gtk_entry_buffer_new (class, const gchar *initial_chars=NULL, gint n_initial_chars=-1)

I don't think there is any precedence of having such a string length argument in the Perl API.  Is it really necessary?  Or can you just use the gchar_length typemap as in GtkTextBuffer.xs?  If a user wants to show only a substring, he can still use substr().

Similar comments apply to insert_text() and emit_inserted_text() below.

@@ +75,3 @@
+void gtk_entry_buffer_insert_text (GtkEntryBuffer *buffer, guint position, const gchar *chars, gint n_chars=-1);
+
+guint gtk_entry_buffer_delete_text (GtkEntryBuffer *buffer, guint position=0, gint n_chars=-1);

I don't think the default -1 for n_chars makes sense here.
Comment 14 Torsten Schoenfeld 2010-12-29 23:15:02 UTC
Comment on attachment 159414 [details] [review]
Add missing Gtk2::Widget accessors added in gtk+ 2.18

Committed with additions and tests.
Comment 15 Torsten Schoenfeld 2010-12-29 23:15:34 UTC
Comment on attachment 159417 [details] [review]
Add GtkEntryBuffer bindings

Committed with slight changes.
Comment 16 Torsten Schoenfeld 2010-12-29 23:16:05 UTC
Comment on attachment 159418 [details] [review]
Add GtkEntryBuffer-related methods to GtkEntry

Committed with tests.
Comment 17 Torsten Schoenfeld 2010-12-29 23:16:49 UTC
So, everything is now committed.  Thanks for the patches!