app: convert all stock IDs kept around by the core by icon names

Particularly GimpViewable's stock_id. Make sure old config files
containing stock IDs are still properly parsed.
This commit is contained in:
Michael Natterer 2014-05-07 01:01:56 +02:00
parent 9ed5b3f45e
commit 23037b5230
64 changed files with 416 additions and 404 deletions

View File

@ -692,11 +692,11 @@ action_message (GimpDisplay *display,
{
GimpToolInfo *tool_info = GIMP_TOOL_OPTIONS (object)->tool_info;
icon_name = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info));
icon_name = gimp_viewable_get_icon_name (GIMP_VIEWABLE (tool_info));
}
else if (GIMP_IS_VIEWABLE (object))
{
icon_name = gimp_viewable_get_stock_id (GIMP_VIEWABLE (object));
icon_name = gimp_viewable_get_icon_name (GIMP_VIEWABLE (object));
}
va_start (args, format);

View File

@ -459,7 +459,7 @@ plug_in_actions_add_proc (GimpActionGroup *group,
}
entry.name = gimp_object_get_name (proc);
entry.icon_name = gimp_plug_in_procedure_get_stock_id (proc);
entry.icon_name = gimp_plug_in_procedure_get_icon_name (proc);
entry.label = label;
entry.accelerator = NULL;
entry.tooltip = gimp_plug_in_procedure_get_blurb (proc);
@ -608,7 +608,7 @@ plug_in_actions_history_changed (GimpPlugInManager *manager,
"sensitive", sensitive,
"procedure", proc,
"label", label,
"icon-name", gimp_plug_in_procedure_get_stock_id (proc),
"icon-name", gimp_plug_in_procedure_get_icon_name (proc),
"tooltip", gimp_plug_in_procedure_get_blurb (proc),
NULL);
}

View File

@ -209,7 +209,7 @@ tool_options_actions_update_presets (GimpActionGroup *group,
entry.name = g_strdup_printf ("%s-%03d", action_prefix, i);
entry.label = gimp_object_get_name (preset);
entry.icon_name = gimp_viewable_get_stock_id (GIMP_VIEWABLE (preset));
entry.icon_name = gimp_viewable_get_icon_name (GIMP_VIEWABLE (preset));
entry.value = i;
gimp_action_group_add_enum_actions (group, NULL, &entry, 1, callback);

View File

@ -479,7 +479,7 @@ tools_actions_setup (GimpActionGroup *group)
gchar *tmp;
gchar *name;
icon_name = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info));
icon_name = gimp_viewable_get_icon_name (GIMP_VIEWABLE (tool_info));
identifier = gimp_object_get_name (tool_info);
tmp = g_strndup (identifier + strlen ("gimp-"),

View File

@ -119,29 +119,29 @@ gimp_brush_class_init (GimpBrushClass *klass)
gimp_marshal_VOID__VOID,
G_TYPE_NONE, 0);
object_class->finalize = gimp_brush_finalize;
object_class->get_property = gimp_brush_get_property;
object_class->set_property = gimp_brush_set_property;
object_class->finalize = gimp_brush_finalize;
object_class->get_property = gimp_brush_get_property;
object_class->set_property = gimp_brush_set_property;
gimp_object_class->get_memsize = gimp_brush_get_memsize;
gimp_object_class->get_memsize = gimp_brush_get_memsize;
viewable_class->default_stock_id = "gimp-tool-paintbrush";
viewable_class->get_size = gimp_brush_get_size;
viewable_class->get_new_preview = gimp_brush_get_new_preview;
viewable_class->get_description = gimp_brush_get_description;
viewable_class->default_icon_name = "gimp-tool-paintbrush";
viewable_class->get_size = gimp_brush_get_size;
viewable_class->get_new_preview = gimp_brush_get_new_preview;
viewable_class->get_description = gimp_brush_get_description;
data_class->dirty = gimp_brush_dirty;
data_class->get_extension = gimp_brush_get_extension;
data_class->dirty = gimp_brush_dirty;
data_class->get_extension = gimp_brush_get_extension;
klass->begin_use = gimp_brush_real_begin_use;
klass->end_use = gimp_brush_real_end_use;
klass->select_brush = gimp_brush_real_select_brush;
klass->want_null_motion = gimp_brush_real_want_null_motion;
klass->transform_size = gimp_brush_real_transform_size;
klass->transform_mask = gimp_brush_real_transform_mask;
klass->transform_pixmap = gimp_brush_real_transform_pixmap;
klass->transform_boundary = gimp_brush_real_transform_boundary;
klass->spacing_changed = NULL;
klass->begin_use = gimp_brush_real_begin_use;
klass->end_use = gimp_brush_real_end_use;
klass->select_brush = gimp_brush_real_select_brush;
klass->want_null_motion = gimp_brush_real_want_null_motion;
klass->transform_size = gimp_brush_real_transform_size;
klass->transform_mask = gimp_brush_real_transform_mask;
klass->transform_pixmap = gimp_brush_real_transform_pixmap;
klass->transform_boundary = gimp_brush_real_transform_boundary;
klass->spacing_changed = NULL;
g_object_class_install_property (object_class, PROP_SPACING,
g_param_spec_double ("spacing", NULL,

View File

@ -73,16 +73,16 @@ gimp_buffer_class_init (GimpBufferClass *klass)
GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
GimpViewableClass *viewable_class = GIMP_VIEWABLE_CLASS (klass);
object_class->finalize = gimp_buffer_finalize;
object_class->finalize = gimp_buffer_finalize;
gimp_object_class->get_memsize = gimp_buffer_get_memsize;
gimp_object_class->get_memsize = gimp_buffer_get_memsize;
viewable_class->default_stock_id = "gtk-paste";
viewable_class->get_size = gimp_buffer_get_size;
viewable_class->get_preview_size = gimp_buffer_get_preview_size;
viewable_class->get_popup_size = gimp_buffer_get_popup_size;
viewable_class->get_new_preview = gimp_buffer_get_new_preview;
viewable_class->get_description = gimp_buffer_get_description;
viewable_class->default_icon_name = "gtk-paste";
viewable_class->get_size = gimp_buffer_get_size;
viewable_class->get_preview_size = gimp_buffer_get_preview_size;
viewable_class->get_popup_size = gimp_buffer_get_popup_size;
viewable_class->get_new_preview = gimp_buffer_get_new_preview;
viewable_class->get_description = gimp_buffer_get_description;
}
static void

View File

@ -251,14 +251,14 @@ gimp_channel_class_init (GimpChannelClass *klass)
gimp_marshal_VOID__VOID,
G_TYPE_NONE, 0);
object_class->finalize = gimp_channel_finalize;
object_class->finalize = gimp_channel_finalize;
gimp_object_class->get_memsize = gimp_channel_get_memsize;
gimp_object_class->get_memsize = gimp_channel_get_memsize;
viewable_class->get_description = gimp_channel_get_description;
viewable_class->default_stock_id = "gimp-channel";
viewable_class->get_description = gimp_channel_get_description;
viewable_class->default_icon_name = "gimp-channel";
filter_class->get_node = gimp_channel_get_node;
filter_class->get_node = gimp_channel_get_node;
item_class->is_attached = gimp_channel_is_attached;
item_class->get_tree = gimp_channel_get_tree;

View File

@ -131,22 +131,22 @@ gimp_curve_class_init (GimpCurveClass *klass)
GimpDataClass *data_class = GIMP_DATA_CLASS (klass);
GParamSpec *array_spec;
object_class->finalize = gimp_curve_finalize;
object_class->set_property = gimp_curve_set_property;
object_class->get_property = gimp_curve_get_property;
object_class->finalize = gimp_curve_finalize;
object_class->set_property = gimp_curve_set_property;
object_class->get_property = gimp_curve_get_property;
gimp_object_class->get_memsize = gimp_curve_get_memsize;
gimp_object_class->get_memsize = gimp_curve_get_memsize;
viewable_class->default_stock_id = "FIXME";
viewable_class->get_preview_size = gimp_curve_get_preview_size;
viewable_class->get_popup_size = gimp_curve_get_popup_size;
viewable_class->get_new_preview = gimp_curve_get_new_preview;
viewable_class->get_description = gimp_curve_get_description;
viewable_class->default_icon_name = "FIXME icon name";
viewable_class->get_preview_size = gimp_curve_get_preview_size;
viewable_class->get_popup_size = gimp_curve_get_popup_size;
viewable_class->get_new_preview = gimp_curve_get_new_preview;
viewable_class->get_description = gimp_curve_get_description;
data_class->dirty = gimp_curve_dirty;
data_class->save = gimp_curve_save;
data_class->get_extension = gimp_curve_get_extension;
data_class->duplicate = gimp_curve_duplicate;
data_class->dirty = gimp_curve_dirty;
data_class->save = gimp_curve_save;
data_class->get_extension = gimp_curve_get_extension;
data_class->duplicate = gimp_curve_duplicate;
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_CURVE_TYPE,
"curve-type",

View File

@ -933,8 +933,8 @@ gimp_drawable_sync_fs_filter (GimpDrawable *drawable,
gboolean linear;
private->fs_filter = gimp_filter_new ("Floating Selection");
gimp_viewable_set_stock_id (GIMP_VIEWABLE (private->fs_filter),
"gimp-floating-selection");
gimp_viewable_set_icon_name (GIMP_VIEWABLE (private->fs_filter),
"gimp-floating-selection");
node = gimp_filter_get_node (private->fs_filter);

View File

@ -123,7 +123,7 @@ gimp_dynamics_class_init (GimpDynamicsClass *klass)
object_class->get_property = gimp_dynamics_get_property;
object_class->dispatch_properties_changed = gimp_dynamics_dispatch_properties_changed;
viewable_class->default_stock_id = "gimp-dynamics";
viewable_class->default_icon_name = "gimp-dynamics";
data_class->save = gimp_dynamics_save;
data_class->get_extension = gimp_dynamics_get_extension;

View File

@ -99,18 +99,18 @@ gimp_gradient_class_init (GimpGradientClass *klass)
GimpViewableClass *viewable_class = GIMP_VIEWABLE_CLASS (klass);
GimpDataClass *data_class = GIMP_DATA_CLASS (klass);
object_class->finalize = gimp_gradient_finalize;
object_class->finalize = gimp_gradient_finalize;
gimp_object_class->get_memsize = gimp_gradient_get_memsize;
gimp_object_class->get_memsize = gimp_gradient_get_memsize;
viewable_class->default_stock_id = "gimp-gradient";
viewable_class->get_preview_size = gimp_gradient_get_preview_size;
viewable_class->get_popup_size = gimp_gradient_get_popup_size;
viewable_class->get_new_preview = gimp_gradient_get_new_preview;
viewable_class->default_icon_name = "gimp-gradient";
viewable_class->get_preview_size = gimp_gradient_get_preview_size;
viewable_class->get_popup_size = gimp_gradient_get_popup_size;
viewable_class->get_new_preview = gimp_gradient_get_new_preview;
data_class->save = gimp_gradient_save;
data_class->get_extension = gimp_gradient_get_extension;
data_class->duplicate = gimp_gradient_duplicate;
data_class->save = gimp_gradient_save;
data_class->get_extension = gimp_gradient_get_extension;
data_class->duplicate = gimp_gradient_duplicate;
}
static void

View File

@ -197,39 +197,39 @@ gimp_group_layer_class_init (GimpGroupLayerClass *klass)
GimpItemClass *item_class = GIMP_ITEM_CLASS (klass);
GimpDrawableClass *drawable_class = GIMP_DRAWABLE_CLASS (klass);
object_class->set_property = gimp_group_layer_set_property;
object_class->get_property = gimp_group_layer_get_property;
object_class->finalize = gimp_group_layer_finalize;
object_class->set_property = gimp_group_layer_set_property;
object_class->get_property = gimp_group_layer_get_property;
object_class->finalize = gimp_group_layer_finalize;
gimp_object_class->get_memsize = gimp_group_layer_get_memsize;
gimp_object_class->get_memsize = gimp_group_layer_get_memsize;
viewable_class->default_stock_id = "gtk-directory";
viewable_class->get_size = gimp_group_layer_get_size;
viewable_class->get_children = gimp_group_layer_get_children;
viewable_class->set_expanded = gimp_group_layer_set_expanded;
viewable_class->get_expanded = gimp_group_layer_get_expanded;
viewable_class->default_icon_name = "gtk-directory";
viewable_class->get_size = gimp_group_layer_get_size;
viewable_class->get_children = gimp_group_layer_get_children;
viewable_class->set_expanded = gimp_group_layer_set_expanded;
viewable_class->get_expanded = gimp_group_layer_get_expanded;
item_class->is_position_locked = gimp_group_layer_is_position_locked;
item_class->duplicate = gimp_group_layer_duplicate;
item_class->convert = gimp_group_layer_convert;
item_class->translate = gimp_group_layer_translate;
item_class->scale = gimp_group_layer_scale;
item_class->resize = gimp_group_layer_resize;
item_class->flip = gimp_group_layer_flip;
item_class->rotate = gimp_group_layer_rotate;
item_class->transform = gimp_group_layer_transform;
item_class->is_position_locked = gimp_group_layer_is_position_locked;
item_class->duplicate = gimp_group_layer_duplicate;
item_class->convert = gimp_group_layer_convert;
item_class->translate = gimp_group_layer_translate;
item_class->scale = gimp_group_layer_scale;
item_class->resize = gimp_group_layer_resize;
item_class->flip = gimp_group_layer_flip;
item_class->rotate = gimp_group_layer_rotate;
item_class->transform = gimp_group_layer_transform;
item_class->default_name = _("Layer Group");
item_class->rename_desc = C_("undo-type", "Rename Layer Group");
item_class->translate_desc = C_("undo-type", "Move Layer Group");
item_class->scale_desc = C_("undo-type", "Scale Layer Group");
item_class->resize_desc = C_("undo-type", "Resize Layer Group");
item_class->flip_desc = C_("undo-type", "Flip Layer Group");
item_class->rotate_desc = C_("undo-type", "Rotate Layer Group");
item_class->transform_desc = C_("undo-type", "Transform Layer Group");
item_class->default_name = _("Layer Group");
item_class->rename_desc = C_("undo-type", "Rename Layer Group");
item_class->translate_desc = C_("undo-type", "Move Layer Group");
item_class->scale_desc = C_("undo-type", "Scale Layer Group");
item_class->resize_desc = C_("undo-type", "Resize Layer Group");
item_class->flip_desc = C_("undo-type", "Flip Layer Group");
item_class->rotate_desc = C_("undo-type", "Rotate Layer Group");
item_class->transform_desc = C_("undo-type", "Transform Layer Group");
drawable_class->estimate_memsize = gimp_group_layer_estimate_memsize;
drawable_class->convert_type = gimp_group_layer_convert_type;
drawable_class->estimate_memsize = gimp_group_layer_estimate_memsize;
drawable_class->convert_type = gimp_group_layer_convert_type;
g_type_class_add_private (klass, sizeof (GimpGroupLayerPrivate));
}

View File

@ -541,7 +541,7 @@ gimp_image_class_init (GimpImageClass *klass)
gimp_object_class->name_changed = gimp_image_name_changed;
gimp_object_class->get_memsize = gimp_image_get_memsize;
viewable_class->default_stock_id = "gimp-image";
viewable_class->default_icon_name = "gimp-image";
viewable_class->get_size = gimp_image_get_size;
viewable_class->size_changed = gimp_image_size_changed;
viewable_class->get_preview_size = gimp_image_get_preview_size;

View File

@ -65,7 +65,7 @@ struct _GimpImageMap
GimpDrawable *drawable;
gchar *undo_desc;
GeglNode *operation;
gchar *stock_id;
gchar *icon_name;
GimpImageMapRegion region;
gboolean gamma_hack;
@ -150,10 +150,10 @@ gimp_image_map_finalize (GObject *object)
image_map->operation = NULL;
}
if (image_map->stock_id)
if (image_map->icon_name)
{
g_free (image_map->stock_id);
image_map->stock_id = NULL;
g_free (image_map->icon_name);
image_map->icon_name = NULL;
}
if (image_map->filter)
@ -181,7 +181,7 @@ GimpImageMap *
gimp_image_map_new (GimpDrawable *drawable,
const gchar *undo_desc,
GeglNode *operation,
const gchar *stock_id)
const gchar *icon_name)
{
GimpImageMap *image_map;
@ -195,7 +195,7 @@ gimp_image_map_new (GimpDrawable *drawable,
image_map->undo_desc = g_strdup (undo_desc);
image_map->operation = g_object_ref (operation);
image_map->stock_id = g_strdup (stock_id);
image_map->icon_name = g_strdup (icon_name);
gimp_viewable_preview_freeze (GIMP_VIEWABLE (drawable));
@ -278,8 +278,8 @@ gimp_image_map_apply (GimpImageMap *image_map,
GeglNode *input;
image_map->filter = gimp_filter_new (image_map->undo_desc);
gimp_viewable_set_stock_id (GIMP_VIEWABLE (image_map->filter),
image_map->stock_id);
gimp_viewable_set_icon_name (GIMP_VIEWABLE (image_map->filter),
image_map->icon_name);
filter_node = gimp_filter_get_node (image_map->filter);

View File

@ -59,7 +59,7 @@ GType gimp_image_map_get_type (void) G_GNUC_CONST;
GimpImageMap * gimp_image_map_new (GimpDrawable *drawable,
const gchar *undo_desc,
GeglNode *operation,
const gchar *stock_id);
const gchar *icon_name);
void gimp_image_map_set_region (GimpImageMap *image_map,
GimpImageMapRegion region);

View File

@ -278,7 +278,7 @@ gimp_layer_class_init (GimpLayerClass *klass)
gimp_object_class->name_changed = gimp_layer_name_changed;
gimp_object_class->get_memsize = gimp_layer_get_memsize;
viewable_class->default_stock_id = "gimp-layer";
viewable_class->default_icon_name = "gimp-layer";
viewable_class->invalidate_preview = gimp_layer_invalidate_preview;
viewable_class->get_description = gimp_layer_get_description;

View File

@ -71,7 +71,7 @@ gimp_layer_mask_class_init (GimpLayerMaskClass *klass)
GimpItemClass *item_class = GIMP_ITEM_CLASS (klass);
GimpDrawableClass *drawable_class = GIMP_DRAWABLE_CLASS (klass);
viewable_class->default_stock_id = "gimp-layer-mask";
viewable_class->default_icon_name = "gimp-layer-mask";
item_class->is_attached = gimp_layer_mask_is_attached;
item_class->is_content_locked = gimp_layer_mask_is_content_locked;
@ -82,7 +82,7 @@ gimp_layer_mask_class_init (GimpLayerMaskClass *klass)
item_class->translate_desc = C_("undo-type", "Move Layer Mask");
item_class->to_selection_desc = C_("undo-type", "Layer Mask to Selection");
drawable_class->convert_type = gimp_layer_mask_convert_type;
drawable_class->convert_type = gimp_layer_mask_convert_type;
}
static void

View File

@ -104,18 +104,18 @@ gimp_paint_info_new (Gimp *gimp,
GType paint_options_type,
const gchar *identifier,
const gchar *blurb,
const gchar *stock_id)
const gchar *icon_name)
{
GimpPaintInfo *paint_info;
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (identifier != NULL, NULL);
g_return_val_if_fail (blurb != NULL, NULL);
g_return_val_if_fail (stock_id != NULL, NULL);
g_return_val_if_fail (icon_name != NULL, NULL);
paint_info = g_object_new (GIMP_TYPE_PAINT_INFO,
"name", identifier,
"stock-id", stock_id,
"name", identifier,
"icon-name", icon_name,
NULL);
paint_info->gimp = gimp;

View File

@ -59,7 +59,7 @@ GimpPaintInfo * gimp_paint_info_new (Gimp *gimp,
GType paint_options_type,
const gchar *identifier,
const gchar *blurb,
const gchar *stock_id);
const gchar *icon_name);
void gimp_paint_info_set_standard (Gimp *gimp,
GimpPaintInfo *paint_info);

View File

@ -90,19 +90,19 @@ gimp_palette_class_init (GimpPaletteClass *klass)
GimpViewableClass *viewable_class = GIMP_VIEWABLE_CLASS (klass);
GimpDataClass *data_class = GIMP_DATA_CLASS (klass);
object_class->finalize = gimp_palette_finalize;
object_class->finalize = gimp_palette_finalize;
gimp_object_class->get_memsize = gimp_palette_get_memsize;
gimp_object_class->get_memsize = gimp_palette_get_memsize;
viewable_class->default_stock_id = "gtk-select-color";
viewable_class->get_preview_size = gimp_palette_get_preview_size;
viewable_class->get_popup_size = gimp_palette_get_popup_size;
viewable_class->get_new_preview = gimp_palette_get_new_preview;
viewable_class->get_description = gimp_palette_get_description;
viewable_class->default_icon_name = "gtk-select-color";
viewable_class->get_preview_size = gimp_palette_get_preview_size;
viewable_class->get_popup_size = gimp_palette_get_popup_size;
viewable_class->get_new_preview = gimp_palette_get_new_preview;
viewable_class->get_description = gimp_palette_get_description;
data_class->save = gimp_palette_save;
data_class->get_extension = gimp_palette_get_extension;
data_class->duplicate = gimp_palette_duplicate;
data_class->save = gimp_palette_save;
data_class->get_extension = gimp_palette_get_extension;
data_class->duplicate = gimp_palette_duplicate;
}
static void

View File

@ -71,17 +71,17 @@ gimp_pattern_class_init (GimpPatternClass *klass)
GimpViewableClass *viewable_class = GIMP_VIEWABLE_CLASS (klass);
GimpDataClass *data_class = GIMP_DATA_CLASS (klass);
object_class->finalize = gimp_pattern_finalize;
object_class->finalize = gimp_pattern_finalize;
gimp_object_class->get_memsize = gimp_pattern_get_memsize;
gimp_object_class->get_memsize = gimp_pattern_get_memsize;
viewable_class->default_stock_id = "gimp-tool-bucket-fill";
viewable_class->get_size = gimp_pattern_get_size;
viewable_class->get_new_preview = gimp_pattern_get_new_preview;
viewable_class->get_description = gimp_pattern_get_description;
viewable_class->default_icon_name = "gimp-tool-bucket-fill";
viewable_class->get_size = gimp_pattern_get_size;
viewable_class->get_new_preview = gimp_pattern_get_new_preview;
viewable_class->get_description = gimp_pattern_get_description;
data_class->get_extension = gimp_pattern_get_extension;
data_class->duplicate = gimp_pattern_duplicate;
data_class->get_extension = gimp_pattern_get_extension;
data_class->duplicate = gimp_pattern_duplicate;
}
static void

View File

@ -148,7 +148,7 @@ gimp_selection_class_init (GimpSelectionClass *klass)
GimpDrawableClass *drawable_class = GIMP_DRAWABLE_CLASS (klass);
GimpChannelClass *channel_class = GIMP_CHANNEL_CLASS (klass);
viewable_class->default_stock_id = "gimp-selection";
viewable_class->default_icon_name = "gimp-selection";
item_class->is_attached = gimp_selection_is_attached;
item_class->get_tree = gimp_selection_get_tree;

View File

@ -119,7 +119,7 @@ gimp_template_class_init (GimpTemplateClass *klass)
object_class->get_property = gimp_template_get_property;
object_class->notify = gimp_template_notify;
viewable_class->default_stock_id = "gimp-template";
viewable_class->default_icon_name = "gimp-template";
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_WIDTH, "width",
NULL,
@ -346,7 +346,7 @@ gimp_template_notify (GObject *object,
private->precision,
private->width, private->height);
if (! strcmp (pspec->name, "stock-id"))
if (! strcmp (pspec->name, "icon-name"))
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (object));
}

View File

@ -235,7 +235,7 @@ gimp_tool_info_new (Gimp *gimp,
const gchar *help_domain,
const gchar *help_id,
const gchar *paint_core_name,
const gchar *stock_id)
const gchar *icon_name)
{
GimpPaintInfo *paint_info;
GimpToolInfo *tool_info;
@ -247,7 +247,7 @@ gimp_tool_info_new (Gimp *gimp,
g_return_val_if_fail (menu_label != NULL, NULL);
g_return_val_if_fail (help_id != NULL, NULL);
g_return_val_if_fail (paint_core_name != NULL, NULL);
g_return_val_if_fail (stock_id != NULL, NULL);
g_return_val_if_fail (icon_name != NULL, NULL);
paint_info = (GimpPaintInfo *)
gimp_container_get_child_by_name (gimp->paint_info_list, paint_core_name);
@ -255,8 +255,8 @@ gimp_tool_info_new (Gimp *gimp,
g_return_val_if_fail (GIMP_IS_PAINT_INFO (paint_info), NULL);
tool_info = g_object_new (GIMP_TYPE_TOOL_INFO,
"name", identifier,
"stock-id", stock_id,
"name", identifier,
"icon-name", icon_name,
NULL);
tool_info->gimp = gimp;

View File

@ -78,7 +78,7 @@ GimpToolInfo * gimp_tool_info_new (Gimp *gimp,
const gchar *help_domain,
const gchar *help_id,
const gchar *paint_core_name,
const gchar *stock_id);
const gchar *icon_name);
void gimp_tool_info_set_standard (Gimp *gimp,
GimpToolInfo *tool_info);

View File

@ -498,7 +498,7 @@ gimp_tool_preset_new (GimpContext *context,
const gchar *unused)
{
GimpToolInfo *tool_info;
const gchar *stock_id;
const gchar *icon_name;
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
@ -506,11 +506,11 @@ gimp_tool_preset_new (GimpContext *context,
g_return_val_if_fail (tool_info != NULL, NULL);
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info));
icon_name = gimp_viewable_get_icon_name (GIMP_VIEWABLE (tool_info));
return g_object_new (GIMP_TYPE_TOOL_PRESET,
"name", tool_info->blurb,
"stock-id", stock_id,
"icon-name", icon_name,
"gimp", context->gimp,
"tool-options", tool_info->tool_options,
NULL);

View File

@ -128,19 +128,19 @@ gimp_undo_class_init (GimpUndoClass *klass)
G_TYPE_NONE, 1,
GIMP_TYPE_UNDO_MODE);
object_class->constructed = gimp_undo_constructed;
object_class->finalize = gimp_undo_finalize;
object_class->set_property = gimp_undo_set_property;
object_class->get_property = gimp_undo_get_property;
object_class->constructed = gimp_undo_constructed;
object_class->finalize = gimp_undo_finalize;
object_class->set_property = gimp_undo_set_property;
object_class->get_property = gimp_undo_get_property;
gimp_object_class->get_memsize = gimp_undo_get_memsize;
gimp_object_class->get_memsize = gimp_undo_get_memsize;
viewable_class->default_stock_id = "gtk-undo";
viewable_class->get_popup_size = gimp_undo_get_popup_size;
viewable_class->get_new_preview = gimp_undo_get_new_preview;
viewable_class->default_icon_name = "gtk-undo";
viewable_class->get_popup_size = gimp_undo_get_popup_size;
viewable_class->get_new_preview = gimp_undo_get_new_preview;
klass->pop = gimp_undo_real_pop;
klass->free = gimp_undo_real_free;
klass->pop = gimp_undo_real_pop;
klass->free = gimp_undo_real_free;
g_object_class_install_property (object_class, PROP_IMAGE,
g_param_spec_object ("image", NULL, NULL,

View File

@ -44,7 +44,8 @@
enum
{
PROP_0,
PROP_STOCK_ID,
PROP_STOCK_ID, /* compat */
PROP_ICON_NAME,
PROP_ICON_PIXBUF,
PROP_FROZEN
};
@ -61,7 +62,7 @@ typedef struct _GimpViewablePrivate GimpViewablePrivate;
struct _GimpViewablePrivate
{
gchar *stock_id;
gchar *icon_name;
GdkPixbuf *icon_pixbuf;
gint freeze_count;
GimpViewable *parent;
@ -164,7 +165,7 @@ gimp_viewable_class_init (GimpViewableClass *klass)
gimp_object_class->get_memsize = gimp_viewable_get_memsize;
klass->default_stock_id = "gimp-question";
klass->default_icon_name = "gimp-question";
klass->name_changed_signal = "name-changed";
klass->invalidate_preview = gimp_viewable_real_invalidate_preview;
@ -182,10 +183,15 @@ gimp_viewable_class_init (GimpViewableClass *klass)
klass->set_expanded = NULL;
klass->get_expanded = NULL;
/* compat property */
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_STOCK_ID, "stock-id",
NULL, NULL,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_ICON_NAME, "icon-name",
NULL, NULL,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_OBJECT (object_class, PROP_ICON_PIXBUF,
"icon-pixbuf", NULL,
GDK_TYPE_PIXBUF,
@ -218,10 +224,10 @@ gimp_viewable_finalize (GObject *object)
{
GimpViewablePrivate *private = GET_PRIVATE (object);
if (private->stock_id)
if (private->icon_name)
{
g_free (private->stock_id);
private->stock_id = NULL;
g_free (private->icon_name);
private->icon_name = NULL;
}
if (private->icon_pixbuf)
@ -257,7 +263,8 @@ gimp_viewable_set_property (GObject *object,
switch (property_id)
{
case PROP_STOCK_ID:
gimp_viewable_set_stock_id (viewable, g_value_get_string (value));
case PROP_ICON_NAME:
gimp_viewable_set_icon_name (viewable, g_value_get_string (value));
break;
case PROP_ICON_PIXBUF:
if (private->icon_pixbuf)
@ -286,7 +293,8 @@ gimp_viewable_get_property (GObject *object,
switch (property_id)
{
case PROP_STOCK_ID:
g_value_set_string (value, gimp_viewable_get_stock_id (viewable));
case PROP_ICON_NAME:
g_value_set_string (value, gimp_viewable_get_icon_name (viewable));
break;
case PROP_ICON_PIXBUF:
g_value_set_object (value, private->icon_pixbuf);
@ -426,10 +434,13 @@ gimp_viewable_serialize_property (GimpConfig *config,
switch (property_id)
{
case PROP_STOCK_ID:
if (private->stock_id)
return TRUE;
case PROP_ICON_NAME:
if (private->icon_name)
{
gimp_config_writer_open (writer, pspec->name);
gimp_config_writer_string (writer, private->stock_id);
gimp_config_writer_string (writer, private->icon_name);
gimp_config_writer_close (writer);
}
return TRUE;
@ -1134,17 +1145,17 @@ gimp_viewable_get_description (GimpViewable *viewable,
}
/**
* gimp_viewable_get_stock_id:
* @viewable: viewable object for which to retrieve a stock ID.
* gimp_viewable_get_icon_name:
* @viewable: viewable object for which to retrieve a icon name.
*
* Gets the current value of the object's stock ID, for use in
* Gets the current value of the object's icon name, for use in
* constructing an iconic representation of the object.
*
* Returns: a pointer to the string containing the stock ID. The
* Returns: a pointer to the string containing the icon name. The
* contents must not be altered or freed.
**/
const gchar *
gimp_viewable_get_stock_id (GimpViewable *viewable)
gimp_viewable_get_icon_name (GimpViewable *viewable)
{
GimpViewablePrivate *private;
@ -1152,24 +1163,24 @@ gimp_viewable_get_stock_id (GimpViewable *viewable)
private = GET_PRIVATE (viewable);
if (private->stock_id)
return (const gchar *) private->stock_id;
if (private->icon_name)
return (const gchar *) private->icon_name;
return GIMP_VIEWABLE_GET_CLASS (viewable)->default_stock_id;
return GIMP_VIEWABLE_GET_CLASS (viewable)->default_icon_name;
}
/**
* gimp_viewable_set_stock_id:
* @viewable: viewable object to assign the specified stock ID.
* @stock_id: string containing a stock identifier.
* gimp_viewable_set_icon_name:
* @viewable: viewable object to assign the specified icon name.
* @icon_name: string containing an icon name identifier.
*
* Seta the object's stock ID, for use in constructing iconic smbols
* of the object. The contents of @stock_id are copied, so you can
* Seta the object's icon name, for use in constructing iconic smbols
* of the object. The contents of @icon_name are copied, so you can
* free it when you are done with it.
**/
void
gimp_viewable_set_stock_id (GimpViewable *viewable,
const gchar *stock_id)
gimp_viewable_set_icon_name (GimpViewable *viewable,
const gchar *icon_name)
{
GimpViewablePrivate *private;
GimpViewableClass *viewable_class;
@ -1178,21 +1189,21 @@ gimp_viewable_set_stock_id (GimpViewable *viewable,
private = GET_PRIVATE (viewable);
g_free (private->stock_id);
private->stock_id = NULL;
g_free (private->icon_name);
private->icon_name = NULL;
viewable_class = GIMP_VIEWABLE_GET_CLASS (viewable);
if (stock_id)
if (icon_name)
{
if (viewable_class->default_stock_id == NULL ||
strcmp (stock_id, viewable_class->default_stock_id))
private->stock_id = g_strdup (stock_id);
if (viewable_class->default_icon_name == NULL ||
strcmp (icon_name, viewable_class->default_icon_name))
private->icon_name = g_strdup (icon_name);
}
gimp_viewable_invalidate_preview (viewable);
g_object_notify (G_OBJECT (viewable), "stock-id");
g_object_notify (G_OBJECT (viewable), "icon-name");
}
void

View File

@ -52,7 +52,7 @@ struct _GimpViewableClass
{
GimpObjectClass parent_class;
const gchar *default_stock_id;
const gchar *default_icon_name;
const gchar *name_changed_signal;
/* signals */
@ -165,9 +165,9 @@ GdkPixbuf * gimp_viewable_get_dummy_pixbuf (GimpViewable *viewable,
gchar * gimp_viewable_get_description (GimpViewable *viewable,
gchar **tooltip);
const gchar * gimp_viewable_get_stock_id (GimpViewable *viewable);
void gimp_viewable_set_stock_id (GimpViewable *viewable,
const gchar *stock_id);
const gchar * gimp_viewable_get_icon_name (GimpViewable *viewable);
void gimp_viewable_set_icon_name (GimpViewable *viewable,
const gchar *icon_name);
void gimp_viewable_preview_freeze (GimpViewable *viewable);
void gimp_viewable_preview_thaw (GimpViewable *viewable);

View File

@ -109,20 +109,20 @@ gimp_tool_dialog_new (GimpToolInfo *tool_info,
...)
{
GtkWidget *dialog;
const gchar *stock_id;
const gchar *icon_name;
gchar *identifier;
va_list args;
g_return_val_if_fail (GIMP_IS_TOOL_INFO (tool_info), NULL);
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info));
icon_name = gimp_viewable_get_icon_name (GIMP_VIEWABLE (tool_info));
dialog = g_object_new (GIMP_TYPE_TOOL_DIALOG,
"title", tool_info->blurb,
"role", gimp_object_get_name (tool_info),
"help-func", gimp_standard_help_func,
"help-id", tool_info->help_id,
"stock-id", stock_id,
"icon-name", icon_name,
"description", desc ? desc : tool_info->help,
NULL);

View File

@ -64,10 +64,10 @@ gimp_brightness_contrast_config_class_init (GimpBrightnessContrastConfigClass *k
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpViewableClass *viewable_class = GIMP_VIEWABLE_CLASS (klass);
object_class->set_property = gimp_brightness_contrast_config_set_property;
object_class->get_property = gimp_brightness_contrast_config_get_property;
object_class->set_property = gimp_brightness_contrast_config_set_property;
object_class->get_property = gimp_brightness_contrast_config_get_property;
viewable_class->default_stock_id = "gimp-tool-brightness-contrast";
viewable_class->default_icon_name = "gimp-tool-brightness-contrast";
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_BRIGHTNESS,
"brightness",

View File

@ -84,10 +84,10 @@ gimp_color_balance_config_class_init (GimpColorBalanceConfigClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpViewableClass *viewable_class = GIMP_VIEWABLE_CLASS (klass);
object_class->set_property = gimp_color_balance_config_set_property;
object_class->get_property = gimp_color_balance_config_get_property;
object_class->set_property = gimp_color_balance_config_set_property;
object_class->get_property = gimp_color_balance_config_get_property;
viewable_class->default_stock_id = "gimp-tool-color-balance";
viewable_class->default_icon_name = "gimp-tool-color-balance";
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_RANGE,
"range",

View File

@ -67,10 +67,10 @@ gimp_colorize_config_class_init (GimpColorizeConfigClass *klass)
GimpHSL hsl;
GimpRGB rgb;
object_class->set_property = gimp_colorize_config_set_property;
object_class->get_property = gimp_colorize_config_get_property;
object_class->set_property = gimp_colorize_config_set_property;
object_class->get_property = gimp_colorize_config_get_property;
viewable_class->default_stock_id = "gimp-tool-colorize";
viewable_class->default_icon_name = "gimp-tool-colorize";
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_HUE,
"hue",

View File

@ -93,11 +93,11 @@ gimp_curves_config_class_init (GimpCurvesConfigClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpViewableClass *viewable_class = GIMP_VIEWABLE_CLASS (klass);
object_class->finalize = gimp_curves_config_finalize;
object_class->set_property = gimp_curves_config_set_property;
object_class->get_property = gimp_curves_config_get_property;
object_class->finalize = gimp_curves_config_finalize;
object_class->set_property = gimp_curves_config_set_property;
object_class->get_property = gimp_curves_config_get_property;
viewable_class->default_stock_id = "gimp-tool-curves";
viewable_class->default_icon_name = "gimp-tool-curves";
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_CHANNEL,
"channel",

View File

@ -60,11 +60,11 @@ gimp_desaturate_config_class_init (GimpDesaturateConfigClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpViewableClass *viewable_class = GIMP_VIEWABLE_CLASS (klass);
object_class->set_property = gimp_desaturate_config_set_property;
object_class->get_property = gimp_desaturate_config_get_property;
object_class->set_property = gimp_desaturate_config_set_property;
object_class->get_property = gimp_desaturate_config_get_property;
/*FIXME: change string when a desaturate icon gets added */
viewable_class->default_stock_id = "gimp-convert-grayscale";
viewable_class->default_icon_name = "gimp-convert-grayscale";
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_MODE,
"mode",

View File

@ -82,10 +82,10 @@ gimp_hue_saturation_config_class_init (GimpHueSaturationConfigClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpViewableClass *viewable_class = GIMP_VIEWABLE_CLASS (klass);
object_class->set_property = gimp_hue_saturation_config_set_property;
object_class->get_property = gimp_hue_saturation_config_get_property;
object_class->set_property = gimp_hue_saturation_config_set_property;
object_class->get_property = gimp_hue_saturation_config_get_property;
viewable_class->default_stock_id = "gimp-tool-hue-saturation";
viewable_class->default_icon_name = "gimp-tool-hue-saturation";
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_RANGE,
"range",

View File

@ -96,10 +96,10 @@ gimp_levels_config_class_init (GimpLevelsConfigClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpViewableClass *viewable_class = GIMP_VIEWABLE_CLASS (klass);
object_class->set_property = gimp_levels_config_set_property;
object_class->get_property = gimp_levels_config_get_property;
object_class->set_property = gimp_levels_config_set_property;
object_class->get_property = gimp_levels_config_get_property;
viewable_class->default_stock_id = "gimp-tool-levels";
viewable_class->default_icon_name = "gimp-tool-levels";
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_CHANNEL,
"channel",

View File

@ -60,10 +60,10 @@ gimp_posterize_config_class_init (GimpPosterizeConfigClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpViewableClass *viewable_class = GIMP_VIEWABLE_CLASS (klass);
object_class->set_property = gimp_posterize_config_set_property;
object_class->get_property = gimp_posterize_config_get_property;
object_class->set_property = gimp_posterize_config_set_property;
object_class->get_property = gimp_posterize_config_get_property;
viewable_class->default_stock_id = "gimp-tool-posterize";
viewable_class->default_icon_name = "gimp-tool-posterize";
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_LEVELS,
"levels",

View File

@ -61,10 +61,10 @@ gimp_threshold_config_class_init (GimpThresholdConfigClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpViewableClass *viewable_class = GIMP_VIEWABLE_CLASS (klass);
object_class->set_property = gimp_threshold_config_set_property;
object_class->get_property = gimp_threshold_config_get_property;
object_class->set_property = gimp_threshold_config_set_property;
object_class->get_property = gimp_threshold_config_get_property;
viewable_class->default_stock_id = "gimp-tool-threshold";
viewable_class->default_icon_name = "gimp-tool-threshold";
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_LOW,
"low",

View File

@ -48,7 +48,7 @@ static void gimp_paint_register (Gimp *gimp,
GType paint_options_type,
const gchar *identifier,
const gchar *blurb,
const gchar *stock_id);
const gchar *icon_name);
/* public functions */
@ -114,7 +114,7 @@ gimp_paint_register (Gimp *gimp,
GType paint_options_type,
const gchar *identifier,
const gchar *blurb,
const gchar *stock_id)
const gchar *icon_name)
{
GimpPaintInfo *paint_info;
@ -129,7 +129,7 @@ gimp_paint_register (Gimp *gimp,
paint_options_type,
identifier,
blurb,
stock_id);
icon_name);
gimp_container_add (gimp->paint_info_list, GIMP_OBJECT (paint_info));
g_object_unref (paint_info);

View File

@ -71,7 +71,7 @@ typedef void (* GimpPaintRegisterCallback) (Gimp *gimp,
GType paint_options_type,
const gchar *identifier,
const gchar *blurb,
const gchar *stock_id);
const gchar *icon_name);
typedef void (* GimpPaintRegisterFunc) (Gimp *gimp,
GimpPaintRegisterCallback callback);

View File

@ -618,7 +618,7 @@ gimp_plug_in_procedure_set_icon (GimpPlugInProcedure *proc,
}
const gchar *
gimp_plug_in_procedure_get_stock_id (const GimpPlugInProcedure *proc)
gimp_plug_in_procedure_get_icon_name (const GimpPlugInProcedure *proc)
{
g_return_val_if_fail (GIMP_IS_PLUG_IN_PROCEDURE (proc), NULL);

View File

@ -108,7 +108,7 @@ void gimp_plug_in_procedure_set_icon (GimpPlugInProcedure
GimpIconType type,
const guint8 *data,
gint data_length);
const gchar * gimp_plug_in_procedure_get_stock_id (const GimpPlugInProcedure *proc);
const gchar * gimp_plug_in_procedure_get_icon_name (const GimpPlugInProcedure *proc);
GdkPixbuf * gimp_plug_in_procedure_get_pixbuf (const GimpPlugInProcedure *proc);
gchar * gimp_plug_in_procedure_get_help_id (const GimpPlugInProcedure *proc);

View File

@ -115,14 +115,14 @@ gimp_font_class_init (GimpFontClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpViewableClass *viewable_class = GIMP_VIEWABLE_CLASS (klass);
object_class->finalize = gimp_font_finalize;
object_class->set_property = gimp_font_set_property;
object_class->finalize = gimp_font_finalize;
object_class->set_property = gimp_font_set_property;
viewable_class->get_preview_size = gimp_font_get_preview_size;
viewable_class->get_popup_size = gimp_font_get_popup_size;
viewable_class->get_new_preview = gimp_font_get_new_preview;
viewable_class->get_preview_size = gimp_font_get_preview_size;
viewable_class->get_popup_size = gimp_font_get_popup_size;
viewable_class->get_new_preview = gimp_font_get_new_preview;
viewable_class->default_stock_id = "gtk-select-font";
viewable_class->default_icon_name = "gtk-select-font";
g_object_class_install_property (object_class, PROP_PANGO_CONTEXT,
g_param_spec_object ("pango-context",

View File

@ -126,36 +126,36 @@ gimp_text_layer_class_init (GimpTextLayerClass *klass)
GimpItemClass *item_class = GIMP_ITEM_CLASS (klass);
GimpDrawableClass *drawable_class = GIMP_DRAWABLE_CLASS (klass);
object_class->finalize = gimp_text_layer_finalize;
object_class->get_property = gimp_text_layer_get_property;
object_class->set_property = gimp_text_layer_set_property;
object_class->finalize = gimp_text_layer_finalize;
object_class->get_property = gimp_text_layer_get_property;
object_class->set_property = gimp_text_layer_set_property;
gimp_object_class->get_memsize = gimp_text_layer_get_memsize;
gimp_object_class->get_memsize = gimp_text_layer_get_memsize;
viewable_class->default_stock_id = "gimp-text-layer";
viewable_class->default_icon_name = "gimp-text-layer";
item_class->duplicate = gimp_text_layer_duplicate;
item_class->rename = gimp_text_layer_rename;
item_class->duplicate = gimp_text_layer_duplicate;
item_class->rename = gimp_text_layer_rename;
#if 0
item_class->scale = gimp_text_layer_scale;
item_class->flip = gimp_text_layer_flip;
item_class->rotate = gimp_text_layer_rotate;
item_class->transform = gimp_text_layer_transform;
item_class->scale = gimp_text_layer_scale;
item_class->flip = gimp_text_layer_flip;
item_class->rotate = gimp_text_layer_rotate;
item_class->transform = gimp_text_layer_transform;
#endif
item_class->default_name = _("Text Layer");
item_class->rename_desc = _("Rename Text Layer");
item_class->translate_desc = _("Move Text Layer");
item_class->scale_desc = _("Scale Text Layer");
item_class->resize_desc = _("Resize Text Layer");
item_class->flip_desc = _("Flip Text Layer");
item_class->rotate_desc = _("Rotate Text Layer");
item_class->transform_desc = _("Transform Text Layer");
item_class->default_name = _("Text Layer");
item_class->rename_desc = _("Rename Text Layer");
item_class->translate_desc = _("Move Text Layer");
item_class->scale_desc = _("Scale Text Layer");
item_class->resize_desc = _("Resize Text Layer");
item_class->flip_desc = _("Flip Text Layer");
item_class->rotate_desc = _("Rotate Text Layer");
item_class->transform_desc = _("Transform Text Layer");
drawable_class->convert_type = gimp_text_layer_convert_type;
drawable_class->set_buffer = gimp_text_layer_set_buffer;
drawable_class->push_undo = gimp_text_layer_push_undo;
drawable_class->convert_type = gimp_text_layer_convert_type;
drawable_class->set_buffer = gimp_text_layer_set_buffer;
drawable_class->push_undo = gimp_text_layer_push_undo;
GIMP_CONFIG_INSTALL_PROP_OBJECT (object_class, PROP_TEXT,
"text", NULL,

View File

@ -103,7 +103,7 @@ static void gimp_tools_register (GType tool_type,
const gchar *menu_accel,
const gchar *help_domain,
const gchar *help_data,
const gchar *stock_id,
const gchar *icon_name,
gpointer data);
@ -475,7 +475,7 @@ gimp_tools_register (GType tool_type,
const gchar *menu_accel,
const gchar *help_domain,
const gchar *help_data,
const gchar *stock_id,
const gchar *icon_name,
gpointer data)
{
Gimp *gimp = (Gimp *) data;
@ -552,7 +552,7 @@ gimp_tools_register (GType tool_type,
help_domain,
help_data,
paint_core_name,
stock_id);
icon_name);
visible = (! g_type_is_a (tool_type, GIMP_TYPE_IMAGE_MAP_TOOL));

View File

@ -705,7 +705,7 @@ gimp_image_map_tool_create_map (GimpImageMapTool *tool)
tool->image_map = gimp_image_map_new (tool->drawable,
tool->undo_desc,
tool->operation,
gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info)));
gimp_viewable_get_icon_name (GIMP_VIEWABLE (tool_info)));
g_signal_connect (tool->image_map, "flush",
G_CALLBACK (gimp_image_map_tool_flush),
@ -910,20 +910,20 @@ gimp_image_map_tool_color_picker_toggled (GtkWidget *widget,
GtkWidget *
gimp_image_map_tool_add_color_picker (GimpImageMapTool *tool,
gpointer identifier,
const gchar *stock_id,
const gchar *icon_name,
const gchar *tooltip)
{
GtkWidget *button;
GtkWidget *image;
g_return_val_if_fail (GIMP_IS_IMAGE_MAP_TOOL (tool), NULL);
g_return_val_if_fail (stock_id != NULL, NULL);
g_return_val_if_fail (icon_name != NULL, NULL);
button = g_object_new (GTK_TYPE_TOGGLE_BUTTON,
"draw-indicator", FALSE,
NULL);
image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON);
image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON);
gtk_misc_set_padding (GTK_MISC (image), 2, 2);
gtk_container_add (GTK_CONTAINER (button), image);
gtk_widget_show (image);

View File

@ -115,7 +115,7 @@ GtkSizeGroup * gimp_image_map_tool_dialog_get_label_group (GimpImageMapTool *too
GtkWidget * gimp_image_map_tool_add_color_picker (GimpImageMapTool *tool,
gpointer identifier,
const gchar *stock_id,
const gchar *icon_name,
const gchar *tooltip);

View File

@ -1126,7 +1126,7 @@ gimp_tool_push_status (GimpTool *tool,
...)
{
GimpDisplayShell *shell;
const gchar *stock_id;
const gchar *icon_name;
va_list args;
g_return_if_fail (GIMP_IS_TOOL (tool));
@ -1135,12 +1135,12 @@ gimp_tool_push_status (GimpTool *tool,
shell = gimp_display_get_shell (display);
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool->tool_info));
icon_name = gimp_viewable_get_icon_name (GIMP_VIEWABLE (tool->tool_info));
va_start (args, format);
gimp_statusbar_push_valist (gimp_display_shell_get_statusbar (shell),
G_OBJECT_TYPE_NAME (tool), stock_id,
G_OBJECT_TYPE_NAME (tool), icon_name,
format, args);
va_end (args);
@ -1160,17 +1160,17 @@ gimp_tool_push_status_coords (GimpTool *tool,
const gchar *help)
{
GimpDisplayShell *shell;
const gchar *stock_id;
const gchar *icon_name;
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (GIMP_IS_DISPLAY (display));
shell = gimp_display_get_shell (display);
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool->tool_info));
icon_name = gimp_viewable_get_icon_name (GIMP_VIEWABLE (tool->tool_info));
gimp_statusbar_push_coords (gimp_display_shell_get_statusbar (shell),
G_OBJECT_TYPE_NAME (tool), stock_id,
G_OBJECT_TYPE_NAME (tool), icon_name,
precision, title, x, separator, y,
help);
@ -1187,17 +1187,17 @@ gimp_tool_push_status_length (GimpTool *tool,
const gchar *help)
{
GimpDisplayShell *shell;
const gchar *stock_id;
const gchar *icon_name;
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (GIMP_IS_DISPLAY (display));
shell = gimp_display_get_shell (display);
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool->tool_info));
icon_name = gimp_viewable_get_icon_name (GIMP_VIEWABLE (tool->tool_info));
gimp_statusbar_push_length (gimp_display_shell_get_statusbar (shell),
G_OBJECT_TYPE_NAME (tool), stock_id,
G_OBJECT_TYPE_NAME (tool), icon_name,
title, axis, value, help);
tool->status_displays = g_list_remove (tool->status_displays, display);
@ -1211,7 +1211,7 @@ gimp_tool_replace_status (GimpTool *tool,
...)
{
GimpDisplayShell *shell;
const gchar *stock_id;
const gchar *icon_name;
va_list args;
g_return_if_fail (GIMP_IS_TOOL (tool));
@ -1220,12 +1220,12 @@ gimp_tool_replace_status (GimpTool *tool,
shell = gimp_display_get_shell (display);
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool->tool_info));
icon_name = gimp_viewable_get_icon_name (GIMP_VIEWABLE (tool->tool_info));
va_start (args, format);
gimp_statusbar_replace_valist (gimp_display_shell_get_statusbar (shell),
G_OBJECT_TYPE_NAME (tool), stock_id,
G_OBJECT_TYPE_NAME (tool), icon_name,
format, args);
va_end (args);

View File

@ -1631,7 +1631,7 @@ gimp_transform_tool_dialog (GimpTransformTool *tr_tool)
GimpTool *tool = GIMP_TOOL (tr_tool);
GimpToolInfo *tool_info = tool->tool_info;
GimpDisplayShell *shell;
const gchar *stock_id;
const gchar *icon_name;
if (! GIMP_TRANSFORM_TOOL_GET_CLASS (tr_tool)->dialog)
return;
@ -1640,7 +1640,7 @@ gimp_transform_tool_dialog (GimpTransformTool *tr_tool)
shell = gimp_display_get_shell (tool->display);
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info));
icon_name = gimp_viewable_get_icon_name (GIMP_VIEWABLE (tool_info));
tr_tool->overlay = FALSE;
@ -1653,7 +1653,7 @@ gimp_transform_tool_dialog (GimpTransformTool *tr_tool)
GIMP_STOCK_WILBER_EEK, RESPONSE_EEK,
GIMP_STOCK_RESET, RESPONSE_RESET,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
stock_id, GTK_RESPONSE_OK,
icon_name, GTK_RESPONSE_OK,
NULL);

View File

@ -58,7 +58,7 @@ typedef void (* GimpToolRegisterCallback) (GType tool_type,
const gchar *menu_accel,
const gchar *help_domain,
const gchar *help_data,
const gchar *stock_id,
const gchar *icon_name,
gpointer register_data);
typedef void (* GimpToolRegisterFunc) (GimpToolRegisterCallback callback,

View File

@ -185,60 +185,60 @@ gimp_vectors_class_init (GimpVectorsClass *klass)
gimp_marshal_VOID__VOID,
G_TYPE_NONE, 0);
object_class->finalize = gimp_vectors_finalize;
object_class->finalize = gimp_vectors_finalize;
gimp_object_class->get_memsize = gimp_vectors_get_memsize;
gimp_object_class->get_memsize = gimp_vectors_get_memsize;
viewable_class->get_new_preview = gimp_vectors_get_new_preview;
viewable_class->default_stock_id = "gimp-path";
viewable_class->get_new_preview = gimp_vectors_get_new_preview;
viewable_class->default_icon_name = "gimp-path";
item_class->is_attached = gimp_vectors_is_attached;
item_class->get_tree = gimp_vectors_get_tree;
item_class->duplicate = gimp_vectors_duplicate;
item_class->convert = gimp_vectors_convert;
item_class->translate = gimp_vectors_translate;
item_class->scale = gimp_vectors_scale;
item_class->resize = gimp_vectors_resize;
item_class->flip = gimp_vectors_flip;
item_class->rotate = gimp_vectors_rotate;
item_class->transform = gimp_vectors_transform;
item_class->stroke = gimp_vectors_stroke;
item_class->to_selection = gimp_vectors_to_selection;
item_class->default_name = _("Path");
item_class->rename_desc = C_("undo-type", "Rename Path");
item_class->translate_desc = C_("undo-type", "Move Path");
item_class->scale_desc = C_("undo-type", "Scale Path");
item_class->resize_desc = C_("undo-type", "Resize Path");
item_class->flip_desc = C_("undo-type", "Flip Path");
item_class->rotate_desc = C_("undo-type", "Rotate Path");
item_class->transform_desc = C_("undo-type", "Transform Path");
item_class->stroke_desc = C_("undo-type", "Stroke Path");
item_class->to_selection_desc = C_("undo-type", "Path to Selection");
item_class->reorder_desc = C_("undo-type", "Reorder Path");
item_class->raise_desc = C_("undo-type", "Raise Path");
item_class->raise_to_top_desc = C_("undo-type", "Raise Path to Top");
item_class->lower_desc = C_("undo-type", "Lower Path");
item_class->lower_to_bottom_desc = C_("undo-type", "Lower Path to Bottom");
item_class->raise_failed = _("Path cannot be raised higher.");
item_class->lower_failed = _("Path cannot be lowered more.");
item_class->is_attached = gimp_vectors_is_attached;
item_class->get_tree = gimp_vectors_get_tree;
item_class->duplicate = gimp_vectors_duplicate;
item_class->convert = gimp_vectors_convert;
item_class->translate = gimp_vectors_translate;
item_class->scale = gimp_vectors_scale;
item_class->resize = gimp_vectors_resize;
item_class->flip = gimp_vectors_flip;
item_class->rotate = gimp_vectors_rotate;
item_class->transform = gimp_vectors_transform;
item_class->stroke = gimp_vectors_stroke;
item_class->to_selection = gimp_vectors_to_selection;
item_class->default_name = _("Path");
item_class->rename_desc = C_("undo-type", "Rename Path");
item_class->translate_desc = C_("undo-type", "Move Path");
item_class->scale_desc = C_("undo-type", "Scale Path");
item_class->resize_desc = C_("undo-type", "Resize Path");
item_class->flip_desc = C_("undo-type", "Flip Path");
item_class->rotate_desc = C_("undo-type", "Rotate Path");
item_class->transform_desc = C_("undo-type", "Transform Path");
item_class->stroke_desc = C_("undo-type", "Stroke Path");
item_class->to_selection_desc = C_("undo-type", "Path to Selection");
item_class->reorder_desc = C_("undo-type", "Reorder Path");
item_class->raise_desc = C_("undo-type", "Raise Path");
item_class->raise_to_top_desc = C_("undo-type", "Raise Path to Top");
item_class->lower_desc = C_("undo-type", "Lower Path");
item_class->lower_to_bottom_desc = C_("undo-type", "Lower Path to Bottom");
item_class->raise_failed = _("Path cannot be raised higher.");
item_class->lower_failed = _("Path cannot be lowered more.");
klass->freeze = gimp_vectors_real_freeze;
klass->thaw = gimp_vectors_real_thaw;
klass->freeze = gimp_vectors_real_freeze;
klass->thaw = gimp_vectors_real_thaw;
klass->stroke_add = gimp_vectors_real_stroke_add;
klass->stroke_remove = gimp_vectors_real_stroke_remove;
klass->stroke_get = gimp_vectors_real_stroke_get;
klass->stroke_get_next = gimp_vectors_real_stroke_get_next;
klass->stroke_get_length = gimp_vectors_real_stroke_get_length;
klass->stroke_add = gimp_vectors_real_stroke_add;
klass->stroke_remove = gimp_vectors_real_stroke_remove;
klass->stroke_get = gimp_vectors_real_stroke_get;
klass->stroke_get_next = gimp_vectors_real_stroke_get_next;
klass->stroke_get_length = gimp_vectors_real_stroke_get_length;
klass->anchor_get = gimp_vectors_real_anchor_get;
klass->anchor_delete = gimp_vectors_real_anchor_delete;
klass->anchor_get = gimp_vectors_real_anchor_get;
klass->anchor_delete = gimp_vectors_real_anchor_delete;
klass->get_length = gimp_vectors_real_get_length;
klass->get_distance = gimp_vectors_real_get_distance;
klass->interpolate = gimp_vectors_real_interpolate;
klass->get_length = gimp_vectors_real_get_length;
klass->get_distance = gimp_vectors_real_get_distance;
klass->interpolate = gimp_vectors_real_interpolate;
klass->make_bezier = gimp_vectors_real_make_bezier;
klass->make_bezier = gimp_vectors_real_make_bezier;
}
static void

View File

@ -101,11 +101,11 @@ gimp_controller_info_class_init (GimpControllerInfoClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpViewableClass *viewable_class = GIMP_VIEWABLE_CLASS (klass);
object_class->finalize = gimp_controller_info_finalize;
object_class->set_property = gimp_controller_info_set_property;
object_class->get_property = gimp_controller_info_get_property;
object_class->finalize = gimp_controller_info_finalize;
object_class->set_property = gimp_controller_info_set_property;
object_class->get_property = gimp_controller_info_get_property;
viewable_class->default_stock_id = GIMP_STOCK_CONTROLLER;
viewable_class->default_icon_name = GIMP_STOCK_CONTROLLER;
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_ENABLED,
"enabled", NULL,
@ -211,8 +211,9 @@ gimp_controller_info_set_property (GObject *object,
0);
controller_class = GIMP_CONTROLLER_GET_CLASS (info->controller);
gimp_viewable_set_stock_id (GIMP_VIEWABLE (info),
controller_class->stock_id);
gimp_viewable_set_icon_name (GIMP_VIEWABLE (info),
/* FIXME icon name */
controller_class->stock_id);
}
break;
case PROP_MAPPING:

View File

@ -446,9 +446,9 @@ gimp_device_editor_switch_page (GtkNotebook *notebook,
gtk_label_set_text (GTK_LABEL (private->label),
gimp_object_get_name (info));
gtk_image_set_from_stock (GTK_IMAGE (private->image),
gimp_viewable_get_stock_id (GIMP_VIEWABLE (info)),
GTK_ICON_SIZE_BUTTON);
gtk_image_set_from_icon_name (GTK_IMAGE (private->image),
gimp_viewable_get_icon_name (GIMP_VIEWABLE (info)),
GTK_ICON_SIZE_BUTTON);
if (! gimp_device_info_get_device (info, NULL))
delete_sensitive = TRUE;

View File

@ -102,12 +102,12 @@ gimp_device_info_class_init (GimpDeviceInfoClass *klass)
gimp_marshal_VOID__VOID,
G_TYPE_NONE, 0);
object_class->constructed = gimp_device_info_constructed;
object_class->finalize = gimp_device_info_finalize;
object_class->set_property = gimp_device_info_set_property;
object_class->get_property = gimp_device_info_get_property;
object_class->constructed = gimp_device_info_constructed;
object_class->finalize = gimp_device_info_finalize;
object_class->set_property = gimp_device_info_set_property;
object_class->get_property = gimp_device_info_get_property;
viewable_class->default_stock_id = GIMP_STOCK_INPUT_DEVICE;
viewable_class->default_icon_name = GIMP_STOCK_INPUT_DEVICE;
g_object_class_install_property (object_class, PROP_DEVICE,
g_param_spec_object ("device",
@ -487,24 +487,24 @@ gimp_device_info_guess_icon (GimpDeviceInfo *info)
GimpViewable *viewable = GIMP_VIEWABLE (info);
if (gimp_object_get_name (viewable) &&
! strcmp (gimp_viewable_get_stock_id (viewable),
GIMP_VIEWABLE_GET_CLASS (viewable)->default_stock_id))
! strcmp (gimp_viewable_get_icon_name (viewable),
GIMP_VIEWABLE_GET_CLASS (viewable)->default_icon_name))
{
const gchar *stock_id = NULL;
gchar *down = g_ascii_strdown (gimp_object_get_name (viewable),
-1);
const gchar *icon_name = NULL;
gchar *down = g_ascii_strdown (gimp_object_get_name (viewable),
-1);
if (strstr (down, "eraser"))
{
stock_id = GIMP_STOCK_TOOL_ERASER;
icon_name = GIMP_STOCK_TOOL_ERASER;
}
else if (strstr (down, "pen"))
{
stock_id = GIMP_STOCK_TOOL_PAINTBRUSH;
icon_name = GIMP_STOCK_TOOL_PAINTBRUSH;
}
else if (strstr (down, "airbrush"))
{
stock_id = GIMP_STOCK_TOOL_AIRBRUSH;
icon_name = GIMP_STOCK_TOOL_AIRBRUSH;
}
else if (strstr (down, "cursor") ||
strstr (down, "mouse") ||
@ -512,13 +512,13 @@ gimp_device_info_guess_icon (GimpDeviceInfo *info)
strstr (down, "touchpad") ||
strstr (down, "trackpoint"))
{
stock_id = GIMP_STOCK_CURSOR;
icon_name = GIMP_STOCK_CURSOR;
}
g_free (down);
if (stock_id)
gimp_viewable_set_stock_id (viewable, stock_id);
if (icon_name)
gimp_viewable_set_icon_name (viewable, icon_name);
}
}

View File

@ -391,12 +391,12 @@ gimp_tool_palette_initialize_tools (GimpToolPalette *palette)
{
GimpToolInfo *tool_info = list->data;
GtkToolItem *item;
const gchar *stock_id;
const gchar *icon_name;
GimpUIManager *ui_manager;
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info));
icon_name = gimp_viewable_get_icon_name (GIMP_VIEWABLE (tool_info));
item = gtk_radio_tool_button_new_from_stock (item_group, stock_id);
item = gtk_radio_tool_button_new_from_stock (item_group, icon_name);
item_group = gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON (item));
gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
gtk_widget_show (GTK_WIDGET (item));

View File

@ -271,7 +271,7 @@ gimp_tool_preset_editor_sync_data (GimpToolPresetEditor *editor)
GimpToolPreset *preset;
GimpToolInfo *tool_info;
GimpContextPropMask serialize_props;
const gchar *stock_id;
const gchar *icon_name;
gchar *label;
g_signal_handlers_block_by_func (priv->tool_preset_model,
@ -288,11 +288,11 @@ gimp_tool_preset_editor_sync_data (GimpToolPresetEditor *editor)
tool_info = priv->tool_preset_model->tool_options->tool_info;
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info));
label = g_strdup_printf (_("%s Preset"), tool_info->blurb);
icon_name = gimp_viewable_get_icon_name (GIMP_VIEWABLE (tool_info));
label = g_strdup_printf (_("%s Preset"), tool_info->blurb);
gtk_image_set_from_stock (GTK_IMAGE (priv->tool_icon),
stock_id, GTK_ICON_SIZE_MENU);
gtk_image_set_from_icon_name (GTK_IMAGE (priv->tool_icon),
icon_name, GTK_ICON_SIZE_MENU);
gtk_label_set_text (GTK_LABEL (priv->tool_label), label);
g_free (label);

View File

@ -153,7 +153,7 @@ gimp_view_renderer_init (GimpViewRenderer *renderer)
renderer->surface = NULL;
renderer->pattern = NULL;
renderer->pixbuf = NULL;
renderer->bg_stock_id = NULL;
renderer->bg_icon_name = NULL;
renderer->size = -1;
renderer->needs_render = TRUE;
@ -199,10 +199,10 @@ gimp_view_renderer_finalize (GObject *object)
renderer->pixbuf = NULL;
}
if (renderer->bg_stock_id)
if (renderer->bg_icon_name)
{
g_free (renderer->bg_stock_id);
renderer->bg_stock_id = NULL;
g_free (renderer->bg_icon_name);
renderer->bg_icon_name = NULL;
}
G_OBJECT_CLASS (parent_class)->finalize (object);
@ -510,14 +510,14 @@ gimp_view_renderer_set_border_color (GimpViewRenderer *renderer,
void
gimp_view_renderer_set_background (GimpViewRenderer *renderer,
const gchar *stock_id)
const gchar *icon_name)
{
g_return_if_fail (GIMP_IS_VIEW_RENDERER (renderer));
if (renderer->bg_stock_id)
g_free (renderer->bg_stock_id);
if (renderer->bg_icon_name)
g_free (renderer->bg_icon_name);
renderer->bg_stock_id = g_strdup (stock_id);
renderer->bg_icon_name = g_strdup (icon_name);
if (renderer->pattern)
{
@ -618,9 +618,9 @@ gimp_view_renderer_draw (GimpViewRenderer *renderer,
viewable_class = g_type_class_ref (renderer->viewable_type);
gimp_view_renderer_render_stock (renderer,
widget,
viewable_class->default_stock_id);
gimp_view_renderer_render_icon (renderer,
widget,
viewable_class->default_icon_name);
g_type_class_unref (viewable_class);
@ -695,7 +695,7 @@ gimp_view_renderer_real_draw (GimpViewRenderer *renderer,
gint height = gdk_pixbuf_get_height (renderer->pixbuf);
gint x, y;
if (renderer->bg_stock_id)
if (renderer->bg_icon_name)
{
if (! renderer->pattern)
{
@ -751,7 +751,7 @@ gimp_view_renderer_real_render (GimpViewRenderer *renderer,
{
GdkPixbuf *pixbuf;
GimpTempBuf *temp_buf;
const gchar *stock_id;
const gchar *icon_name;
pixbuf = gimp_viewable_get_pixbuf (renderer->viewable,
renderer->context,
@ -773,8 +773,8 @@ gimp_view_renderer_real_render (GimpViewRenderer *renderer,
return;
}
stock_id = gimp_viewable_get_stock_id (renderer->viewable);
gimp_view_renderer_render_stock (renderer, widget, stock_id);
icon_name = gimp_viewable_get_icon_name (renderer->viewable);
gimp_view_renderer_render_icon (renderer, widget, icon_name);
}
static void
@ -875,16 +875,16 @@ gimp_view_renderer_render_pixbuf (GimpViewRenderer *renderer,
}
void
gimp_view_renderer_render_stock (GimpViewRenderer *renderer,
GtkWidget *widget,
const gchar *stock_id)
gimp_view_renderer_render_icon (GimpViewRenderer *renderer,
GtkWidget *widget,
const gchar *icon_name)
{
GdkPixbuf *pixbuf = NULL;
GtkIconSize icon_size;
g_return_if_fail (GIMP_IS_VIEW_RENDERER (renderer));
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (stock_id != NULL);
g_return_if_fail (icon_name != NULL);
if (renderer->pixbuf)
{
@ -898,11 +898,11 @@ gimp_view_renderer_render_stock (GimpViewRenderer *renderer,
renderer->surface = NULL;
}
icon_size = gimp_get_icon_size (widget, stock_id, GTK_ICON_SIZE_INVALID,
icon_size = gimp_get_icon_size (widget, icon_name, GTK_ICON_SIZE_INVALID,
renderer->width, renderer->height);
if (icon_size)
pixbuf = gtk_widget_render_icon (widget, stock_id, icon_size, NULL);
pixbuf = gtk_widget_render_icon (widget, icon_name, icon_size, NULL);
if (pixbuf)
{
@ -1137,8 +1137,8 @@ gimp_view_render_temp_buf_to_surface (GimpViewRenderer *renderer,
cairo_destroy (cr);
}
/* This function creates a background pattern from a stock icon
* if renderer->bg_stock_id is set.
/* This function creates a background pattern from a named icon
* if renderer->bg_icon_name is set.
*/
static cairo_pattern_t *
gimp_view_renderer_create_background (GimpViewRenderer *renderer,
@ -1146,10 +1146,10 @@ gimp_view_renderer_create_background (GimpViewRenderer *renderer,
{
cairo_pattern_t *pattern = NULL;
if (renderer->bg_stock_id)
if (renderer->bg_icon_name)
{
GdkPixbuf *pixbuf = gtk_widget_render_icon (widget,
renderer->bg_stock_id,
renderer->bg_icon_name,
GTK_ICON_SIZE_DIALOG, NULL);
if (pixbuf)

View File

@ -59,7 +59,7 @@ struct _GimpViewRenderer
/*< private >*/
cairo_pattern_t *pattern;
GdkPixbuf *pixbuf;
gchar *bg_stock_id;
gchar *bg_icon_name;
gint size;
gboolean needs_render;
@ -125,7 +125,7 @@ void gimp_view_renderer_set_border_type (GimpViewRenderer *renderer,
void gimp_view_renderer_set_border_color (GimpViewRenderer *renderer,
const GimpRGB *border_color);
void gimp_view_renderer_set_background (GimpViewRenderer *renderer,
const gchar *stock_id);
const gchar *icon_name);
void gimp_view_renderer_invalidate (GimpViewRenderer *renderer);
void gimp_view_renderer_update (GimpViewRenderer *renderer);
@ -151,9 +151,9 @@ void gimp_view_renderer_render_temp_buf (GimpViewRenderer *renderer,
GimpViewBG outside_bg);
void gimp_view_renderer_render_pixbuf (GimpViewRenderer *renderer,
GdkPixbuf *pixbuf);
void gimp_view_renderer_render_stock (GimpViewRenderer *renderer,
void gimp_view_renderer_render_icon (GimpViewRenderer *renderer,
GtkWidget *widget,
const gchar *stock_id);
const gchar *icon_name);

View File

@ -108,10 +108,10 @@ gimp_view_renderer_buffer_render (GimpViewRenderer *renderer,
}
else /* no preview available */
{
const gchar *stock_id;
const gchar *icon_name;
stock_id = gimp_viewable_get_stock_id (renderer->viewable);
icon_name = gimp_viewable_get_icon_name (renderer->viewable);
gimp_view_renderer_render_stock (renderer, widget, stock_id);
gimp_view_renderer_render_icon (renderer, widget, icon_name);
}
}

View File

@ -237,10 +237,10 @@ gimp_view_renderer_drawable_render (GimpViewRenderer *renderer,
}
else
{
const gchar *stock_id;
const gchar *icon_name;
stock_id = gimp_viewable_get_stock_id (renderer->viewable);
icon_name = gimp_viewable_get_icon_name (renderer->viewable);
gimp_view_renderer_render_stock (renderer, widget, stock_id);
gimp_view_renderer_render_icon (renderer, widget, icon_name);
}
}

View File

@ -63,7 +63,7 @@ gimp_view_renderer_image_render (GimpViewRenderer *renderer,
{
GimpViewRendererImage *rendererimage = GIMP_VIEW_RENDERER_IMAGE (renderer);
GimpImage *image = GIMP_IMAGE (renderer->viewable);
const gchar *stock_id;
const gchar *icon_name;
/* The conditions checked here are mostly a hack to hide the fact that
* we are creating the channel preview from the image preview and turning
@ -158,17 +158,17 @@ gimp_view_renderer_image_render (GimpViewRenderer *renderer,
switch (rendererimage->channel)
{
case GIMP_RED_CHANNEL: stock_id = GIMP_STOCK_CHANNEL_RED; break;
case GIMP_GREEN_CHANNEL: stock_id = GIMP_STOCK_CHANNEL_GREEN; break;
case GIMP_BLUE_CHANNEL: stock_id = GIMP_STOCK_CHANNEL_BLUE; break;
case GIMP_GRAY_CHANNEL: stock_id = GIMP_STOCK_CHANNEL_GRAY; break;
case GIMP_INDEXED_CHANNEL: stock_id = GIMP_STOCK_CHANNEL_INDEXED; break;
case GIMP_ALPHA_CHANNEL: stock_id = GIMP_STOCK_CHANNEL_ALPHA; break;
case GIMP_RED_CHANNEL: icon_name = GIMP_STOCK_CHANNEL_RED; break;
case GIMP_GREEN_CHANNEL: icon_name = GIMP_STOCK_CHANNEL_GREEN; break;
case GIMP_BLUE_CHANNEL: icon_name = GIMP_STOCK_CHANNEL_BLUE; break;
case GIMP_GRAY_CHANNEL: icon_name = GIMP_STOCK_CHANNEL_GRAY; break;
case GIMP_INDEXED_CHANNEL: icon_name = GIMP_STOCK_CHANNEL_INDEXED; break;
case GIMP_ALPHA_CHANNEL: icon_name = GIMP_STOCK_CHANNEL_ALPHA; break;
default:
stock_id = gimp_viewable_get_stock_id (renderer->viewable);
icon_name = gimp_viewable_get_icon_name (renderer->viewable);
break;
}
gimp_view_renderer_render_stock (renderer, widget, stock_id);
gimp_view_renderer_render_icon (renderer, widget, icon_name);
}

View File

@ -88,9 +88,9 @@ gimp_view_renderer_imagefile_render (GimpViewRenderer *renderer,
}
else
{
const gchar *stock_id = gimp_viewable_get_stock_id (renderer->viewable);
const gchar *icon_name = gimp_viewable_get_icon_name (renderer->viewable);
gimp_view_renderer_render_stock (renderer, widget, stock_id);
gimp_view_renderer_render_icon (renderer, widget, icon_name);
}
}

View File

@ -61,26 +61,26 @@ static void
gimp_view_renderer_layer_render (GimpViewRenderer *renderer,
GtkWidget *widget)
{
const gchar *stock_id = NULL;
const gchar *icon_name = NULL;
if (gimp_layer_is_floating_sel (GIMP_LAYER (renderer->viewable)))
{
stock_id = GIMP_STOCK_FLOATING_SELECTION;
icon_name = GIMP_STOCK_FLOATING_SELECTION;
}
else if (gimp_item_is_text_layer (GIMP_ITEM (renderer->viewable)))
{
stock_id = gimp_viewable_get_stock_id (renderer->viewable);
icon_name = gimp_viewable_get_icon_name (renderer->viewable);
}
else
{
GimpContainer *children = gimp_viewable_get_children (renderer->viewable);
if (children && gimp_container_get_n_children (children) == 0)
stock_id = GTK_STOCK_DIRECTORY;
icon_name = GTK_STOCK_DIRECTORY;
}
if (stock_id)
gimp_view_renderer_render_stock (renderer, widget, stock_id);
if (icon_name)
gimp_view_renderer_render_icon (renderer, widget, icon_name);
else
GIMP_VIEW_RENDERER_CLASS (parent_class)->render (renderer, widget);
}