GtkNotebook: deprecate some tab-dnd-related functions
gtk_notebook_set_window_creation_hook has been removed in GTK+ 3, deprecate it here. gtk_notebook_get/set_group has been deprecated in favour of the new gtk_notebook_get/set_group_name. http://bugzilla.gnome.org/show_bug.cgi?id=630521
This commit is contained in:
@ -112,6 +112,7 @@ enum {
|
||||
PROP_ENABLE_POPUP,
|
||||
PROP_GROUP_ID,
|
||||
PROP_GROUP,
|
||||
PROP_GROUP_NAME,
|
||||
PROP_HOMOGENEOUS
|
||||
};
|
||||
|
||||
@ -666,7 +667,7 @@ gtk_notebook_class_init (GtkNotebookClass *class)
|
||||
-1,
|
||||
G_MAXINT,
|
||||
-1,
|
||||
GTK_PARAM_READWRITE));
|
||||
GTK_PARAM_READWRITE|G_PARAM_DEPRECATED));
|
||||
|
||||
/**
|
||||
* GtkNotebook:group:
|
||||
@ -674,13 +675,30 @@ gtk_notebook_class_init (GtkNotebookClass *class)
|
||||
* Group for tabs drag and drop.
|
||||
*
|
||||
* Since: 2.12
|
||||
*
|
||||
* Deprecated: 2.24: Use #GtkNotebook:group-name instead
|
||||
*/
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_GROUP,
|
||||
g_param_spec_pointer ("group",
|
||||
P_("Group"),
|
||||
P_("Group for tabs drag and drop"),
|
||||
GTK_PARAM_READWRITE));
|
||||
GTK_PARAM_READWRITE|G_PARAM_DEPRECATED));
|
||||
|
||||
/**
|
||||
* GtkNotebook:group-name:
|
||||
*
|
||||
* Group name for tabs drag and drop.
|
||||
*
|
||||
* Since: 2.24
|
||||
*/
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_GROUP_NAME,
|
||||
g_param_spec_string ("group-name",
|
||||
P_("Group Name"),
|
||||
P_("Group name for tabs drag and drop"),
|
||||
NULL,
|
||||
GTK_PARAM_READWRITE));
|
||||
|
||||
gtk_container_class_install_child_property (container_class,
|
||||
CHILD_PROP_TAB_LABEL,
|
||||
@ -1554,6 +1572,9 @@ gtk_notebook_set_property (GObject *object,
|
||||
case PROP_GROUP:
|
||||
gtk_notebook_set_group (notebook, g_value_get_pointer (value));
|
||||
break;
|
||||
case PROP_GROUP_NAME:
|
||||
gtk_notebook_set_group_name (notebook, g_value_get_string (value));
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
@ -1607,6 +1628,9 @@ gtk_notebook_get_property (GObject *object,
|
||||
case PROP_GROUP:
|
||||
g_value_set_pointer (value, priv->group);
|
||||
break;
|
||||
case PROP_GROUP_NAME:
|
||||
g_value_set_string (value, gtk_notebook_get_group_name (notebook));
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
@ -7712,9 +7736,11 @@ gtk_notebook_reorder_child (GtkNotebook *notebook,
|
||||
*
|
||||
* Installs a global function used to create a window
|
||||
* when a detached tab is dropped in an empty area.
|
||||
*
|
||||
*
|
||||
* Since: 2.10
|
||||
**/
|
||||
*
|
||||
* Deprecated: 2.24: Use the #GtkNotebook::create-window signal instead
|
||||
**/
|
||||
void
|
||||
gtk_notebook_set_window_creation_hook (GtkNotebookWindowCreationFunc func,
|
||||
gpointer data,
|
||||
@ -7739,7 +7765,7 @@ gtk_notebook_set_window_creation_hook (GtkNotebookWindowCreationFunc func,
|
||||
* not be able to exchange tabs with any other notebook.
|
||||
*
|
||||
* Since: 2.10
|
||||
* Deprecated: 2.12: use gtk_notebook_set_group() instead.
|
||||
* Deprecated: 2.12: use gtk_notebook_set_group_name() instead.
|
||||
*/
|
||||
void
|
||||
gtk_notebook_set_group_id (GtkNotebook *notebook,
|
||||
@ -7763,8 +7789,10 @@ gtk_notebook_set_group_id (GtkNotebook *notebook,
|
||||
* the same group identificator pointer will be able to exchange tabs
|
||||
* via drag and drop. A notebook with a %NULL group identificator will
|
||||
* not be able to exchange tabs with any other notebook.
|
||||
*
|
||||
*
|
||||
* Since: 2.12
|
||||
*
|
||||
* Deprecated: 2.24: Use gtk_notebook_set_group_name() instead
|
||||
*/
|
||||
void
|
||||
gtk_notebook_set_group (GtkNotebook *notebook,
|
||||
@ -7783,6 +7811,32 @@ gtk_notebook_set_group (GtkNotebook *notebook,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_notebook_set_group_name:
|
||||
* @notebook: a #GtkNotebook
|
||||
* @name: (allow-none): the name of the notebook group, or %NULL to unset it
|
||||
*
|
||||
* Sets a group name for @notebook.
|
||||
*
|
||||
* Notebooks with the same name will be able to exchange tabs
|
||||
* via drag and drop. A notebook with a %NULL group name will
|
||||
* not be able to exchange tabs with any other notebook.
|
||||
*
|
||||
* Since: 2.24
|
||||
*/
|
||||
void
|
||||
gtk_notebook_set_group_name (GtkNotebook *notebook,
|
||||
const gchar *group_name)
|
||||
{
|
||||
gpointer group;
|
||||
|
||||
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
|
||||
|
||||
group = (gpointer)g_intern_string (group_name);
|
||||
gtk_notebook_set_group (notebook, group);
|
||||
g_object_notify (G_OBJECT (notebook), "group-name");
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_notebook_get_group_id:
|
||||
* @notebook: a #GtkNotebook
|
||||
@ -7792,7 +7846,7 @@ gtk_notebook_set_group (GtkNotebook *notebook,
|
||||
* Return Value: the group identificator, or -1 if none is set.
|
||||
*
|
||||
* Since: 2.10
|
||||
* Deprecated: 2.12: use gtk_notebook_get_group() instead.
|
||||
* Deprecated: 2.12: use gtk_notebook_get_group_name() instead.
|
||||
*/
|
||||
gint
|
||||
gtk_notebook_get_group_id (GtkNotebook *notebook)
|
||||
@ -7807,6 +7861,7 @@ gtk_notebook_get_group_id (GtkNotebook *notebook)
|
||||
return GPOINTER_TO_INT (priv->group) - 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gtk_notebook_get_group:
|
||||
* @notebook: a #GtkNotebook
|
||||
@ -7816,6 +7871,8 @@ gtk_notebook_get_group_id (GtkNotebook *notebook)
|
||||
* Return Value: the group identificator, or %NULL if none is set.
|
||||
*
|
||||
* Since: 2.12
|
||||
*
|
||||
* Deprecated: 2.24: Use gtk_notebook_get_group_name() instead
|
||||
**/
|
||||
gpointer
|
||||
gtk_notebook_get_group (GtkNotebook *notebook)
|
||||
@ -7828,6 +7885,31 @@ gtk_notebook_get_group (GtkNotebook *notebook)
|
||||
return priv->group;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_notebook_get_group_name:
|
||||
* @notebook: a #GtkNotebook
|
||||
*
|
||||
* Gets the current group name for @notebook.
|
||||
*
|
||||
* Note that this funtion can emphasis not be used
|
||||
* together with gtk_notebook_set_group() or
|
||||
* gtk_notebook_set_group_id().
|
||||
*
|
||||
Return Value: (transfer none): the group name,
|
||||
* or %NULL if none is set.
|
||||
*
|
||||
* Since: 2.24
|
||||
*/
|
||||
const gchar *
|
||||
gtk_notebook_get_group_name (GtkNotebook *notebook)
|
||||
{
|
||||
GtkNotebookPrivate *priv;
|
||||
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), NULL);
|
||||
|
||||
priv = GTK_NOTEBOOK_GET_PRIVATE (notebook);
|
||||
return (const gchar *)priv->group;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_notebook_get_tab_reorderable:
|
||||
* @notebook: a #GtkNotebook
|
||||
|
Reference in New Issue
Block a user