GNOME Bugzilla – Bug 616634
Update Gtk2 to gtk+ 2.18
Last modified: 2010-12-29 23:16:49 UTC
The following patches add the missing 2.16 and 2.18 API wrappers for gtk+.
Created attachment 159409 [details] [review] Add GtkAction block/unblock activate methods Use a version check, as these methods were added in gtk+ 2.16
Created attachment 159410 [details] [review] Add missing 2.16 API for GtkEntry
Created attachment 159411 [details] [review] Add missing to GtkIMMultiContext::set_context_id()
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.
Created attachment 159413 [details] [review] Add GtkEntryBuffer-related methods to GtkEntry
Created attachment 159414 [details] [review] Add missing Gtk2::Widget accessors added in gtk+ 2.18
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.
Created attachment 159418 [details] [review] Add GtkEntryBuffer-related methods to GtkEntry
Review of attachment 159409 [details] [review]: Looks good. Committed with slight changes and tests.
Review of attachment 159410 [details] [review]: Looks good. Committed with tests.
Review of attachment 159411 [details] [review]: Looks good. Committed with tests.
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.
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 on attachment 159414 [details] [review] Add missing Gtk2::Widget accessors added in gtk+ 2.18 Committed with additions and tests.
Comment on attachment 159417 [details] [review] Add GtkEntryBuffer bindings Committed with slight changes.
Comment on attachment 159418 [details] [review] Add GtkEntryBuffer-related methods to GtkEntry Committed with tests.
So, everything is now committed. Thanks for the patches!