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:
@ -169,7 +169,8 @@ static void gimp_tool_compass_update_angle (GimpToolCompass *compa
|
||||
gboolean flip);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GimpToolCompass, gimp_tool_compass, GIMP_TYPE_TOOL_WIDGET)
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (GimpToolCompass, gimp_tool_compass,
|
||||
GIMP_TYPE_TOOL_WIDGET)
|
||||
|
||||
#define parent_class gimp_tool_compass_parent_class
|
||||
|
||||
@ -273,16 +274,12 @@ gimp_tool_compass_class_init (GimpToolCompassClass *klass)
|
||||
g_param_spec_double ("unit-angle", NULL, NULL,
|
||||
-G_PI, G_PI, 0.0,
|
||||
GIMP_PARAM_READABLE));
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GimpToolCompassPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_tool_compass_init (GimpToolCompass *compass)
|
||||
{
|
||||
compass->private = G_TYPE_INSTANCE_GET_PRIVATE (compass,
|
||||
GIMP_TYPE_TOOL_COMPASS,
|
||||
GimpToolCompassPrivate);
|
||||
compass->private = gimp_tool_compass_get_instance_private (compass);
|
||||
|
||||
compass->private->point = -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user