Commit 1f0d296e authored by Michael Natterer's avatar Michael Natterer 😴

libgimpwidgets: remove most deprecated cruft

parent f180a171
......@@ -52,7 +52,6 @@ enum
{
PROP_0,
PROP_ICON_NAME,
PROP_STOCK_ID,
PROP_STOCK_SIZE,
PROP_OVERRIDE_BACKGROUND
};
......@@ -63,7 +62,6 @@ typedef struct _GimpCellRendererTogglePrivate GimpCellRendererTogglePrivate;
struct _GimpCellRendererTogglePrivate
{
gchar *icon_name;
gchar *stock_id;
GtkIconSize stock_size;
gboolean override_background;
......@@ -150,14 +148,6 @@ gimp_cell_renderer_toggle_class_init (GimpCellRendererToggleClass *klass)
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
g_object_class_install_property (object_class, PROP_STOCK_ID,
g_param_spec_string ("stock-id",
"Stock ID",
"The icon to display, deprecated",
NULL,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
g_object_class_install_property (object_class, PROP_STOCK_SIZE,
g_param_spec_int ("stock-size",
"Stock Size",
......@@ -189,8 +179,6 @@ gimp_cell_renderer_toggle_finalize (GObject *object)
GimpCellRendererTogglePrivate *priv = GET_PRIVATE (object);
g_clear_pointer (&priv->icon_name, g_free);
g_clear_pointer (&priv->stock_id, g_free);
g_clear_object (&priv->pixbuf);
G_OBJECT_CLASS (parent_class)->finalize (object);
......@@ -210,10 +198,6 @@ gimp_cell_renderer_toggle_get_property (GObject *object,
g_value_set_string (value, priv->icon_name);
break;
case PROP_STOCK_ID:
g_value_set_string (value, priv->stock_id);
break;
case PROP_STOCK_SIZE:
g_value_set_int (value, priv->stock_size);
break;
......@@ -244,12 +228,6 @@ gimp_cell_renderer_toggle_set_property (GObject *object,
priv->icon_name = g_value_dup_string (value);
break;
case PROP_STOCK_ID:
if (priv->stock_id)
g_free (priv->stock_id);
priv->stock_id = g_value_dup_string (value);
break;
case PROP_STOCK_SIZE:
priv->stock_size = g_value_get_int (value);
break;
......@@ -288,7 +266,7 @@ gimp_cell_renderer_toggle_get_size (GtkCellRenderer *cell,
gint xpad;
gint ypad;
if (! priv->icon_name && ! priv->stock_id)
if (! priv->icon_name)
{
GTK_CELL_RENDERER_CLASS (parent_class)->get_size (cell,
widget,
......@@ -360,7 +338,7 @@ gimp_cell_renderer_toggle_render (GtkCellRenderer *cell,
gint xpad;
gint ypad;
if (! priv->icon_name && ! priv->stock_id)
if (! priv->icon_name)
{
GTK_CELL_RENDERER_CLASS (parent_class)->render (cell, cr, widget,
background_area,
......@@ -522,12 +500,6 @@ gimp_cell_renderer_toggle_create_pixbuf (GimpCellRendererToggle *toggle,
priv->icon_name,
MIN (width, height), 0, NULL);
}
else
{
priv->pixbuf = gtk_widget_render_icon_pixbuf (widget,
priv->stock_id,
priv->stock_size);
}
}
......
......@@ -135,6 +135,7 @@ gimp_color_display_class_init (GimpColorDisplayClass *klass)
GIMP_TYPE_COLOR_MANAGED,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
display_signals[CHANGED] =
g_signal_new ("changed",
G_TYPE_FROM_CLASS (klass),
......@@ -148,14 +149,9 @@ gimp_color_display_class_init (GimpColorDisplayClass *klass)
klass->help_id = NULL;
klass->icon_name = GIMP_ICON_DISPLAY_FILTER;
klass->clone = NULL;
klass->convert_buffer = NULL;
klass->convert_surface = NULL;
klass->convert = NULL;
klass->load_state = NULL;
klass->save_state = NULL;
klass->configure = NULL;
klass->configure_reset = NULL;
klass->changed = NULL;
g_type_class_add_private (object_class, sizeof (GimpColorDisplayPrivate));
......@@ -299,49 +295,11 @@ gimp_color_display_set_color_managed (GimpColorDisplay *display,
}
}
/**
* gimp_color_display_new:
* @display_type: the GType of the GimpColorDisplay to instantiate.
*
* This function is deprecated. Please use g_object_new() directly.
*
* Return value: a new %GimpColorDisplay object.
**/
GimpColorDisplay *
gimp_color_display_new (GType display_type)
{
g_return_val_if_fail (g_type_is_a (display_type, GIMP_TYPE_COLOR_DISPLAY),
NULL);
return g_object_new (display_type, NULL);
}
GimpColorDisplay *
gimp_color_display_clone (GimpColorDisplay *display)
{
g_return_val_if_fail (GIMP_IS_COLOR_DISPLAY (display), NULL);
/* implementing the clone method is deprecated
*/
if (GIMP_COLOR_DISPLAY_GET_CLASS (display)->clone)
{
GimpColorDisplay *clone;
clone = GIMP_COLOR_DISPLAY_GET_CLASS (display)->clone (display);
if (clone)
{
GimpColorDisplayPrivate *private = GET_PRIVATE (display);
g_object_set (clone,
"enabled", private->enabled,
"color-managed", private->managed,
NULL);
}
return clone;
}
return GIMP_COLOR_DISPLAY (gimp_config_duplicate (GIMP_CONFIG (display)));
}
......@@ -375,74 +333,6 @@ gimp_color_display_convert_buffer (GimpColorDisplay *display,
}
}
/**
* gimp_color_display_convert_surface:
* @display: a #GimpColorDisplay
* @surface: a #cairo_image_surface_t of type ARGB32
*
* Converts all pixels in @surface.
*
* Since: 2.8
*
* Deprecated: GIMP 2.8: Use gimp_color_display_convert_buffer() instead.
**/
void
gimp_color_display_convert_surface (GimpColorDisplay *display,
cairo_surface_t *surface)
{
GimpColorDisplayPrivate *private;
g_return_if_fail (GIMP_IS_COLOR_DISPLAY (display));
g_return_if_fail (surface != NULL);
g_return_if_fail (cairo_surface_get_type (surface) ==
CAIRO_SURFACE_TYPE_IMAGE);
private = GET_PRIVATE (display);
if (private->enabled &&
GIMP_COLOR_DISPLAY_GET_CLASS (display)->convert_surface)
{
cairo_surface_flush (surface);
GIMP_COLOR_DISPLAY_GET_CLASS (display)->convert_surface (display, surface);
cairo_surface_mark_dirty (surface);
}
}
/**
* gimp_color_display_convert:
* @display: a #GimpColorDisplay
* @buf: the pixel buffer to convert
* @width: the width of the buffer
* @height: the height of the buffer
* @bpp: the number of bytes per pixel
* @bpl: the buffer's rowstride
*
* Converts all pixels in @buf.
*
* Deprecated: GIMP 2.8: Use gimp_color_display_convert_buffer() instead.
**/
void
gimp_color_display_convert (GimpColorDisplay *display,
guchar *buf,
gint width,
gint height,
gint bpp,
gint bpl)
{
GimpColorDisplayPrivate *private;
g_return_if_fail (GIMP_IS_COLOR_DISPLAY (display));
private = GET_PRIVATE (display);
/* implementing the convert method is deprecated
*/
if (private->enabled && GIMP_COLOR_DISPLAY_GET_CLASS (display)->convert)
GIMP_COLOR_DISPLAY_GET_CLASS (display)->convert (display, buf,
width, height,
bpp, bpl);
}
void
gimp_color_display_load_state (GimpColorDisplay *display,
GimpParasite *state)
......@@ -450,19 +340,10 @@ gimp_color_display_load_state (GimpColorDisplay *display,
g_return_if_fail (GIMP_IS_COLOR_DISPLAY (display));
g_return_if_fail (state != NULL);
/* implementing the load_state method is deprecated
*/
if (GIMP_COLOR_DISPLAY_GET_CLASS (display)->load_state)
{
GIMP_COLOR_DISPLAY_GET_CLASS (display)->load_state (display, state);
}
else
{
gimp_config_deserialize_string (GIMP_CONFIG (display),
gimp_parasite_data (state),
gimp_parasite_data_size (state),
NULL, NULL);
}
gimp_config_deserialize_string (GIMP_CONFIG (display),
gimp_parasite_data (state),
gimp_parasite_data_size (state),
NULL, NULL);
}
GimpParasite *
......@@ -473,13 +354,6 @@ gimp_color_display_save_state (GimpColorDisplay *display)
g_return_val_if_fail (GIMP_IS_COLOR_DISPLAY (display), NULL);
/* implementing the save_state method is deprecated
*/
if (GIMP_COLOR_DISPLAY_GET_CLASS (display)->save_state)
{
return GIMP_COLOR_DISPLAY_GET_CLASS (display)->save_state (display);
}
str = gimp_config_serialize_to_string (GIMP_CONFIG (display), NULL);
parasite = gimp_parasite_new ("Display/Proof",
......@@ -506,16 +380,7 @@ gimp_color_display_configure_reset (GimpColorDisplay *display)
{
g_return_if_fail (GIMP_IS_COLOR_DISPLAY (display));
/* implementing the configure_reset method is deprecated
*/
if (GIMP_COLOR_DISPLAY_GET_CLASS (display)->configure_reset)
{
GIMP_COLOR_DISPLAY_GET_CLASS (display)->configure_reset (display);
}
else
{
gimp_config_reset (GIMP_CONFIG (display));
}
gimp_config_reset (GIMP_CONFIG (display));
}
void
......
......@@ -56,37 +56,11 @@ struct _GimpColorDisplayClass
/* virtual functions */
/* implementing the GimpColorDisplay::clone method is deprecated */
GimpColorDisplay * (* clone) (GimpColorDisplay *display);
void (* convert_buffer) (GimpColorDisplay *display,
GeglBuffer *buffer,
GeglRectangle *area);
/* implementing the GimpColorDisplay::convert_surface method is deprecated */
void (* convert_surface) (GimpColorDisplay *display,
cairo_surface_t *surface);
/* implementing the GimpColorDisplay::convert method is deprecated */
void (* convert) (GimpColorDisplay *display,
guchar *buf,
gint width,
gint height,
gint bpp,
gint bpl);
/* implementing the GimpColorDisplay::load_state method is deprecated */
void (* load_state) (GimpColorDisplay *display,
GimpParasite *state);
/* implementing the GimpColorDisplay::save_state method is deprecated */
GimpParasite * (* save_state) (GimpColorDisplay *display);
GtkWidget * (* configure) (GimpColorDisplay *display);
/* implementing the GimpColorDisplay::configure_reset method is deprecated */
void (* configure_reset) (GimpColorDisplay *display);
/* signals */
void (* changed) (GimpColorDisplay *display);
......@@ -100,23 +74,11 @@ struct _GimpColorDisplayClass
GType gimp_color_display_get_type (void) G_GNUC_CONST;
GIMP_DEPRECATED_FOR(g_object_new)
GimpColorDisplay * gimp_color_display_new (GType display_type);
GimpColorDisplay * gimp_color_display_clone (GimpColorDisplay *display);
void gimp_color_display_convert_buffer (GimpColorDisplay *display,
GeglBuffer *buffer,
GeglRectangle *area);
GIMP_DEPRECATED_FOR(gimp_color_display_convert_buffer)
void gimp_color_display_convert_surface (GimpColorDisplay *display,
cairo_surface_t *surface);
GIMP_DEPRECATED_FOR(gimp_color_display_convert_buffer)
void gimp_color_display_convert (GimpColorDisplay *display,
guchar *buf,
gint width,
gint height,
gint bpp,
gint bpl);
void gimp_color_display_load_state (GimpColorDisplay *display,
GimpParasite *state);
GimpParasite * gimp_color_display_save_state (GimpColorDisplay *display);
......
......@@ -28,7 +28,6 @@
#include "gimpwidgetstypes.h"
#undef GIMP_DISABLE_DEPRECATED
#include "gimpcolordisplay.h"
#include "gimpcolordisplaystack.h"
#include "gimpwidgetsmarshal.h"
......@@ -363,79 +362,6 @@ gimp_color_display_stack_convert_buffer (GimpColorDisplayStack *stack,
}
}
/**
* gimp_color_display_stack_convert_surface:
* @stack: a #GimpColorDisplayStack
* @surface: a #cairo_image_surface_t of type ARGB32
*
* Runs all the stack's filters on all pixels in @surface.
*
* Since: 2.8
*
* Deprecated: GIMP 2.10: Use gimp_color_display_stack_convert_buffer() instead.
**/
void
gimp_color_display_stack_convert_surface (GimpColorDisplayStack *stack,
cairo_surface_t *surface)
{
GimpColorDisplayStackPrivate *private;
GList *list;
g_return_if_fail (GIMP_IS_COLOR_DISPLAY_STACK (stack));
g_return_if_fail (surface != NULL);
g_return_if_fail (cairo_surface_get_type (surface) ==
CAIRO_SURFACE_TYPE_IMAGE);
private = GET_PRIVATE (stack);
for (list = private->filters; list; list = g_list_next (list))
{
GimpColorDisplay *display = list->data;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gimp_color_display_convert_surface (display, surface);
G_GNUC_END_IGNORE_DEPRECATIONS
}
}
/**
* gimp_color_display_stack_convert:
* @stack: a #GimpColorDisplayStack
* @buf: the pixel buffer to convert
* @width: the width of the buffer
* @height: the height of the buffer
* @bpp: the number of bytes per pixel
* @bpl: the buffer's rowstride
*
* Converts all pixels in @buf.
*
* Deprecated: GIMP 2.8: Use gimp_color_display_stack_convert_buffer() instead.
**/
void
gimp_color_display_stack_convert (GimpColorDisplayStack *stack,
guchar *buf,
gint width,
gint height,
gint bpp,
gint bpl)
{
GimpColorDisplayStackPrivate *private;
GList *list;
g_return_if_fail (GIMP_IS_COLOR_DISPLAY_STACK (stack));
private = GET_PRIVATE (stack);
for (list = private->filters; list; list = g_list_next (list))
{
GimpColorDisplay *display = list->data;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gimp_color_display_convert (display, buf, width, height, bpp, bpl);
G_GNUC_END_IGNORE_DEPRECATIONS
}
}
/* private functions */
......
......@@ -88,16 +88,7 @@ void gimp_color_display_stack_reorder_down (GimpColorDisplayStack *stack,
void gimp_color_display_stack_convert_buffer (GimpColorDisplayStack *stack,
GeglBuffer *buffer,
GeglRectangle *area);
GIMP_DEPRECATED_FOR(gimp_color_display_stack_convert_buffer)
void gimp_color_display_stack_convert_surface (GimpColorDisplayStack *stack,
cairo_surface_t *surface);
GIMP_DEPRECATED_FOR(gimp_color_display_stack_convert_surface)
void gimp_color_display_stack_convert (GimpColorDisplayStack *stack,
guchar *buf,
gint width,
gint height,
gint bpp,
gint bpl);
G_END_DECLS
......
......@@ -361,40 +361,6 @@ gimp_color_profile_combo_box_new_with_model (GtkWidget *dialog,
NULL);
}
/**
* gimp_color_profile_combo_box_add:
* @combo: a #GimpColorProfileComboBox
* @filename: filename of the profile to add (or %NULL)
* @label: label to use for the profile
* (may only be %NULL if @filename is %NULL)
*
* This function delegates to the underlying
* #GimpColorProfileStore. Please refer to the documentation of
* gimp_color_profile_store_add_file() for details.
*
* Deprecated: use gimp_color_profile_combo_box_add_file() instead.
*
* Since: 2.4
**/
void
gimp_color_profile_combo_box_add (GimpColorProfileComboBox *combo,
const gchar *filename,
const gchar *label)
{
GFile *file = NULL;
g_return_if_fail (GIMP_IS_COLOR_PROFILE_COMBO_BOX (combo));
g_return_if_fail (label != NULL || filename == NULL);
if (filename)
file = g_file_new_for_path (filename);
gimp_color_profile_combo_box_add_file (combo, file, label);
if (file)
g_object_unref (file);
}
/**
* gimp_color_profile_combo_box_add_file:
* @combo: a #GimpColorProfileComboBox
......@@ -425,38 +391,6 @@ gimp_color_profile_combo_box_add_file (GimpColorProfileComboBox *combo,
file, label);
}
/**
* gimp_color_profile_combo_box_set_active:
* @combo: a #GimpColorProfileComboBox
* @filename: filename of the profile to select
* @label: label to use when adding a new entry (can be %NULL)
*
* Selects a color profile from the @combo and makes it the active
* item. If the profile is not listed in the @combo, then it is added
* with the given @label (or @filename in case that @label is %NULL).
*
* Deprecated: use gimp_color_profile_combo_box_set_active_file() instead.
*
* Since: 2.4
**/
void
gimp_color_profile_combo_box_set_active (GimpColorProfileComboBox *combo,
const gchar *filename,
const gchar *label)
{
GFile *file = NULL;
g_return_if_fail (GIMP_IS_COLOR_PROFILE_COMBO_BOX (combo));
if (filename)
file = g_file_new_for_path (filename);
gimp_color_profile_combo_box_set_active_file (combo, file, label);
if (file)
g_object_unref (file);
}
/**
* gimp_color_profile_combo_box_set_active_file:
* @combo: a #GimpColorProfileComboBox
......@@ -510,37 +444,6 @@ gimp_color_profile_combo_box_set_active_file (GimpColorProfileComboBox *combo,
g_object_unref (profile);
}
/**
* gimp_color_profile_combo_box_get_active:
* @combo: a #GimpColorProfileComboBox
*
* Return value: The filename of the currently selected color profile,
* This is a newly allocated string and should be released
* using g_free() when it is not any longer needed.
*
* Deprecated: use gimp_color_profile_combo_box_get_active_file() instead.
*
* Since: 2.4
**/
gchar *
gimp_color_profile_combo_box_get_active (GimpColorProfileComboBox *combo)
{
GFile *file;
gchar *path = NULL;
g_return_val_if_fail (GIMP_IS_COLOR_PROFILE_COMBO_BOX (combo), NULL);
file = gimp_color_profile_combo_box_get_active_file (combo);
if (file)
{
path = g_file_get_path (file);
g_object_unref (file);
}
return path;
}
/**
* gimp_color_profile_combo_box_get_active_file:
* @combo: a #GimpColorProfileComboBox
......
......@@ -62,24 +62,14 @@ GtkWidget * gimp_color_profile_combo_box_new (GtkWidget *dialog,
GtkWidget * gimp_color_profile_combo_box_new_with_model (GtkWidget *dialog,
GtkTreeModel *model);
GIMP_DEPRECATED_FOR (gimp_color_profile_combo_box_add_file)
void gimp_color_profile_combo_box_add (GimpColorProfileComboBox *combo,
const gchar *filename,
const gchar *label);
void gimp_color_profile_combo_box_add_file (GimpColorProfileComboBox *combo,
GFile *file,
const gchar *label);
GIMP_DEPRECATED_FOR (gimp_color_profile_combo_box_set_active_file)
void gimp_color_profile_combo_box_set_active (GimpColorProfileComboBox *combo,
const gchar *filename,
const gchar *label);
void gimp_color_profile_combo_box_set_active_file (GimpColorProfileComboBox *combo,
GFile *file,
const gchar *label);
GIMP_DEPRECATED_FOR (gimp_color_profile_combo_box_get_active_file)
gchar * gimp_color_profile_combo_box_get_active (GimpColorProfileComboBox *combo);
GFile * gimp_color_profile_combo_box_get_active_file (GimpColorProfileComboBox *combo);
......
......@@ -256,44 +256,6 @@ gimp_color_profile_store_new (const gchar *history)
NULL);
}
/**
* gimp_color_profile_store_add:
* @store: a #GimpColorProfileStore
* @filename: filename of the profile to add (or %NULL)
* @label: label to use for the profile
* (may only be %NULL if @filename is %NULL)
*
* Adds a color profile item to the #GimpColorProfileStore. Items
* added with this function will be kept at the top, separated from
* the history of last used color profiles.
*
* This function is often used to add a selectable item for the %NULL
* filename. If you pass %NULL for both @filename and @label, the
* @label will be set to the string "None" for you (and translated for
* the user).
*
* Deprecated: use gimp_color_profile_store_add_file() instead.
*
* Since: 2.4
**/
void
gimp_color_profile_store_add (GimpColorProfileStore *store,
const gchar *filename,
const gchar *label)
{
GFile *file = NULL;
g_return_if_fail (GIMP_IS_COLOR_PROFILE_STORE (store));
g_return_if_fail (label != NULL || filename == NULL);
if (filename)
file = g_file_new_for_path (filename);
gimp_color_profile_store_add_file (store, file, label);
g_object_unref (file);
}
/**
* gimp_color_profile_store_add_file:
* @store: a #GimpColorProfileStore
......
......@@ -59,11 +59,6 @@ GType gimp_color_profile_store_get_type (void) G_GNUC_CONST;
GtkListStore * gimp_color_profile_store_new (const gchar *history);
GIMP_DEPRECATED_FOR(gimp_color_profile_store_add_file)
void gimp_color_profile_store_add (GimpColorProfileStore *store,
const gchar *filename,
const gchar *label);
void gimp_color_profile_store_add_file (GimpColorProfileStore *store,
GFile *file,
const gchar *label);
......
......@@ -184,26 +184,6 @@ gimp_enum_combo_box_new_with_model (GimpEnumStore *enum_store)
NULL);
}
/**
* gimp_enum_combo_box_set_stock_prefix:
* @combo_box: a #GimpEnumComboBox
* @stock_prefix: a prefix to create icon stock ID from enum values
*
* Attempts to create stock icons for all items in the @combo_box. See
* gimp_enum_store_set_stock_prefix() to find out what to use as
* @stock_prefix.
*
* Since: 2.4
*
* Deprecated: GIMP 2.10
**/
void
gimp_enum_combo_box_set_stock_prefix (GimpEnumComboBox *combo_box,
const gchar *stock_prefix)