app, libgimp*, modules: don't use g_type_class_add_private() ...
... and G_TYPE_INSTANCE_GET_PRIVATE() g_type_class_add_private() and G_TYPE_INSTANCE_GET_PRIVATE() were deprecated in GLib 2.58. Instead, use G_DEFINE_[ABSTRACT_]TYPE_WITH_PRIVATE(), and G_ADD_PRIVATE[_DYNAMIC](), and the implictly-defined foo_get_instance_private() functions, all of which are available in the GLib versions we depend on. This commit only covers types registered using one of the G_DEFINE_FOO() macros (i.e., most types), but not types with a custom registration function, of which we still have a few -- GLib currently only provides a (non-deprecated) public API for adding a private struct using the G_DEFINE_FOO() macros. Note that this commit was 99% auto-generated (because I'm not *that* crazy :), so if there are any style mismatches... we'll have to live with them for now.
This commit is contained in:
@ -61,7 +61,7 @@ static gboolean gimp_window_key_press_event (GtkWidget *widget,
|
||||
GdkEventKey *kevent);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GimpWindow, gimp_window, GTK_TYPE_WINDOW)
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (GimpWindow, gimp_window, GTK_TYPE_WINDOW)
|
||||
|
||||
#define parent_class gimp_window_parent_class
|
||||
|
||||
@ -90,16 +90,12 @@ gimp_window_class_init (GimpWindowClass *klass)
|
||||
widget_class->screen_changed = gimp_window_screen_changed;
|
||||
widget_class->configure_event = gimp_window_configure_event;
|
||||
widget_class->key_press_event = gimp_window_key_press_event;
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GimpWindowPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_window_init (GimpWindow *window)
|
||||
{
|
||||
window->private = G_TYPE_INSTANCE_GET_PRIVATE (window,
|
||||
GIMP_TYPE_WINDOW,
|
||||
GimpWindowPrivate);
|
||||
window->private = gimp_window_get_instance_private (window);
|
||||
|
||||
window->private->monitor = -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user