[gimp] app: port GimpAction and friends to icon names
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: port GimpAction and friends to icon names
- Date: Tue, 6 May 2014 21:49:50 +0000 (UTC)
commit 9ed5b3f45e903da5c3f28b2dbac891a2459459cb
Author: Michael Natterer <mitch gimp org>
Date: Tue May 6 23:47:38 2014 +0200
app: port GimpAction and friends to icon names
app/actions/actions.c | 10 ++++----
app/actions/file-actions.c | 2 +-
app/actions/plug-in-actions.c | 6 ++--
app/actions/tool-options-actions.c | 8 +++---
app/actions/tools-actions.c | 6 ++--
app/actions/window-actions.c | 2 +-
app/actions/windows-actions.c | 6 ++--
app/dialogs/action-search-dialog.c | 16 ++++++------
app/widgets/gimpaction.c | 18 +++++----------
app/widgets/gimpaction.h | 2 +-
app/widgets/gimpactioneditor.c | 4 +-
app/widgets/gimpactionfactory.c | 8 +++---
app/widgets/gimpactionfactory.h | 4 +-
app/widgets/gimpactiongroup.c | 38 ++++++++++++++++----------------
app/widgets/gimpactiongroup.h | 16 ++++++------
app/widgets/gimpactionview.c | 14 ++++++------
app/widgets/gimpactionview.h | 2 +-
app/widgets/gimpcoloreditor.c | 4 +-
app/widgets/gimpcontrollereditor.c | 32 +++++++++++++-------------
app/widgets/gimpeditor.c | 43 +++++++++++++++++++++---------------
app/widgets/gimpeditor.h | 2 +-
app/widgets/gimpenumaction.c | 4 +-
app/widgets/gimpenumaction.h | 2 +-
app/widgets/gimppluginaction.c | 12 +++++-----
app/widgets/gimppluginaction.h | 2 +-
app/widgets/gimpradioaction.c | 19 +++++-----------
app/widgets/gimpradioaction.h | 2 +-
app/widgets/gimpstringaction.c | 18 +++++----------
app/widgets/gimpstringaction.h | 2 +-
app/widgets/gimptoggleaction.c | 17 ++++----------
app/widgets/gimptoggleaction.h | 2 +-
libgimpwidgets/gimpenumwidgets.c | 5 +++-
32 files changed, 156 insertions(+), 172 deletions(-)
---
diff --git a/app/actions/actions.c b/app/actions/actions.c
index 0dfd921..a1f3fa1 100644
--- a/app/actions/actions.c
+++ b/app/actions/actions.c
@@ -254,7 +254,7 @@ actions_init (Gimp *gimp)
gimp_action_factory_group_register (global_action_factory,
action_groups[i].identifier,
gettext (action_groups[i].label),
- action_groups[i].stock_id,
+ action_groups[i].icon_name,
action_groups[i].setup_func,
action_groups[i].update_func);
}
@@ -685,22 +685,22 @@ action_message (GimpDisplay *display,
{
GimpDisplayShell *shell = gimp_display_get_shell (display);
GimpStatusbar *statusbar = gimp_display_shell_get_statusbar (shell);
- const gchar *stock_id = NULL;
+ const gchar *icon_name = NULL;
va_list args;
if (GIMP_IS_TOOL_OPTIONS (object))
{
GimpToolInfo *tool_info = GIMP_TOOL_OPTIONS (object)->tool_info;
- stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info));
+ icon_name = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info));
}
else if (GIMP_IS_VIEWABLE (object))
{
- stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (object));
+ icon_name = gimp_viewable_get_stock_id (GIMP_VIEWABLE (object));
}
va_start (args, format);
gimp_statusbar_push_temp_valist (statusbar, GIMP_MESSAGE_INFO,
- stock_id, format, args);
+ icon_name, format, args);
va_end (args);
}
diff --git a/app/actions/file-actions.c b/app/actions/file-actions.c
index 0d751d1..e0df683 100644
--- a/app/actions/file-actions.c
+++ b/app/actions/file-actions.c
@@ -185,7 +185,7 @@ file_actions_setup (GimpActionGroup *group)
{
entries[i].name = g_strdup_printf ("file-open-recent-%02d",
i + 1);
- entries[i].stock_id = GTK_STOCK_OPEN;
+ entries[i].icon_name = GTK_STOCK_OPEN;
entries[i].label = entries[i].name;
entries[i].tooltip = NULL;
entries[i].value = i;
diff --git a/app/actions/plug-in-actions.c b/app/actions/plug-in-actions.c
index 9921ce7..44b1d4d 100644
--- a/app/actions/plug-in-actions.c
+++ b/app/actions/plug-in-actions.c
@@ -208,7 +208,7 @@ plug_in_actions_setup (GimpActionGroup *group)
for (i = 0; i < n_entries; i++)
{
entries[i].name = g_strdup_printf ("plug-in-recent-%02d", i + 1);
- entries[i].stock_id = NULL;
+ entries[i].icon_name = NULL;
entries[i].label = "";
entries[i].accelerator = "";
entries[i].tooltip = NULL;
@@ -459,7 +459,7 @@ plug_in_actions_add_proc (GimpActionGroup *group,
}
entry.name = gimp_object_get_name (proc);
- entry.stock_id = gimp_plug_in_procedure_get_stock_id (proc);
+ entry.icon_name = gimp_plug_in_procedure_get_stock_id (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,
- "stock-id", gimp_plug_in_procedure_get_stock_id (proc),
+ "icon-name", gimp_plug_in_procedure_get_stock_id (proc),
"tooltip", gimp_plug_in_procedure_get_blurb (proc),
NULL);
}
diff --git a/app/actions/tool-options-actions.c b/app/actions/tool-options-actions.c
index 2eb0b4e..8643501 100644
--- a/app/actions/tool-options-actions.c
+++ b/app/actions/tool-options-actions.c
@@ -207,10 +207,10 @@ tool_options_actions_update_presets (GimpActionGroup *group,
{
GimpObject *preset = list->data;
- entry.name = g_strdup_printf ("%s-%03d", action_prefix, i);
- entry.label = gimp_object_get_name (preset);
- entry.stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (preset));
- entry.value = i;
+ 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.value = i;
gimp_action_group_add_enum_actions (group, NULL, &entry, 1, callback);
diff --git a/app/actions/tools-actions.c b/app/actions/tools-actions.c
index bb88890..42e9a7b 100644
--- a/app/actions/tools-actions.c
+++ b/app/actions/tools-actions.c
@@ -474,12 +474,12 @@ tools_actions_setup (GimpActionGroup *group)
if (tool_info->menu_label)
{
GimpStringActionEntry entry;
- const gchar *stock_id;
+ const gchar *icon_name;
const gchar *identifier;
gchar *tmp;
gchar *name;
- stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info));
+ icon_name = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info));
identifier = gimp_object_get_name (tool_info);
tmp = g_strndup (identifier + strlen ("gimp-"),
@@ -488,7 +488,7 @@ tools_actions_setup (GimpActionGroup *group)
g_free (tmp);
entry.name = name;
- entry.stock_id = stock_id;
+ entry.icon_name = icon_name;
entry.label = tool_info->menu_label;
entry.accelerator = tool_info->menu_accel;
entry.tooltip = tool_info->help;
diff --git a/app/actions/window-actions.c b/app/actions/window-actions.c
index 9422659..ed656ea 100644
--- a/app/actions/window-actions.c
+++ b/app/actions/window-actions.c
@@ -166,7 +166,7 @@ window_actions_display_opened (GdkDisplayManager *manager,
entries[i].name = g_strdup_printf ("%s-move-to-screen-%s",
group_name, screen_name);
- entries[i].stock_id = GIMP_STOCK_MOVE_TO_SCREEN;
+ entries[i].icon_name = GIMP_STOCK_MOVE_TO_SCREEN;
entries[i].label = g_strdup_printf (_("Screen %s"), screen_name);
entries[i].accelerator = NULL;
entries[i].tooltip = g_strdup_printf (_("Move this window to "
diff --git a/app/actions/windows-actions.c b/app/actions/windows-actions.c
index 42e2355..271ae9b 100644
--- a/app/actions/windows-actions.c
+++ b/app/actions/windows-actions.c
@@ -344,7 +344,7 @@ windows_actions_image_notify (GimpDisplay *display,
GimpActionEntry entry;
entry.name = action_name;
- entry.stock_id = GIMP_STOCK_IMAGE;
+ entry.icon_name = GIMP_STOCK_IMAGE;
entry.label = "";
entry.accelerator = NULL;
entry.tooltip = NULL;
@@ -447,7 +447,7 @@ windows_actions_dock_window_added (GimpDialogFactory *factory,
gchar *action_name = windows_actions_dock_window_to_action_name (dock_window);
entry.name = action_name;
- entry.stock_id = NULL;
+ entry.icon_name = NULL;
entry.label = "";
entry.accelerator = NULL;
entry.tooltip = NULL;
@@ -535,7 +535,7 @@ windows_actions_recent_add (GimpContainer *container,
action_name = g_strdup_printf ("windows-recent-%04d", info_id);
entry.name = action_name;
- entry.stock_id = NULL;
+ entry.icon_name = NULL;
entry.label = gimp_object_get_name (info);
entry.accelerator = NULL;
entry.tooltip = gimp_object_get_name (info);
diff --git a/app/dialogs/action-search-dialog.c b/app/dialogs/action-search-dialog.c
index 0f93c4e..fd1c171 100644
--- a/app/dialogs/action-search-dialog.c
+++ b/app/dialogs/action-search-dialog.c
@@ -143,8 +143,8 @@ action_search_dialog_create (Gimp *gimp)
gtk_widget_show (main_vbox);
private->keyword_entry = gtk_entry_new ();
- gtk_entry_set_icon_from_stock (GTK_ENTRY (private->keyword_entry),
- GTK_ENTRY_ICON_PRIMARY, GTK_STOCK_FIND);
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (private->keyword_entry),
+ GTK_ENTRY_ICON_PRIMARY, GTK_STOCK_FIND);
gtk_box_pack_start (GTK_BOX (main_vbox), private->keyword_entry,
FALSE, FALSE, 0);
gtk_widget_show (private->keyword_entry);
@@ -398,7 +398,7 @@ action_search_add_to_results_list (GtkAction *action,
gchar *action_name;
gchar *label;
gchar *escaped_label = NULL;
- const gchar *stock_id;
+ const gchar *icon_name;
gchar *accel_string;
gchar *escaped_accel = NULL;
gboolean has_shortcut = FALSE;
@@ -419,13 +419,13 @@ action_search_add_to_results_list (GtkAction *action,
if (GTK_IS_TOGGLE_ACTION (action))
{
if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)))
- stock_id = GTK_STOCK_OK;
+ icon_name = GTK_STOCK_OK;
else
- stock_id = GTK_STOCK_NO;
+ icon_name = GTK_STOCK_NO;
}
else
{
- stock_id = gtk_action_get_stock_id (action);
+ icon_name = gtk_action_get_icon_name (action);
}
accel_string = action_search_find_accel_label (action);
@@ -479,7 +479,7 @@ action_search_add_to_results_list (GtkAction *action,
}
gtk_list_store_set (store, &iter,
- COLUMN_ICON, stock_id,
+ COLUMN_ICON, icon_name,
COLUMN_MARKUP, markup,
COLUMN_TOOLTIP, action_name,
COLUMN_ACTION, action,
@@ -846,7 +846,7 @@ action_search_setup_results_list (GtkWidget **results_list,
cell = gtk_cell_renderer_pixbuf_new ();
column = gtk_tree_view_column_new_with_attributes (NULL, cell,
- "stock-id", COLUMN_ICON,
+ "icon-name", COLUMN_ICON,
"sensitive", COLUMN_SENSITIVE,
NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (*results_list), column);
diff --git a/app/widgets/gimpaction.c b/app/widgets/gimpaction.c
index df847ef..535963f 100644
--- a/app/widgets/gimpaction.c
+++ b/app/widgets/gimpaction.c
@@ -289,23 +289,17 @@ GimpAction *
gimp_action_new (const gchar *name,
const gchar *label,
const gchar *tooltip,
- const gchar *stock_id)
+ const gchar *icon_name)
{
GimpAction *action;
action = g_object_new (GIMP_TYPE_ACTION,
- "name", name,
- "label", label,
- "tooltip", tooltip,
- "stock-id", stock_id,
+ "name", name,
+ "label", label,
+ "tooltip", tooltip,
+ "icon-name", icon_name,
NULL);
- if (stock_id)
- {
- if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), stock_id))
- gtk_action_set_icon_name (GTK_ACTION (action), stock_id);
- }
-
return action;
}
@@ -446,7 +440,7 @@ gimp_action_set_proxy (GimpAction *action,
if (GIMP_IS_VIEW (image) || GIMP_IS_COLOR_AREA (image))
{
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (proxy), NULL);
- g_object_notify (G_OBJECT (action), "stock-id");
+ g_object_notify (G_OBJECT (action), "icon-name");
}
}
diff --git a/app/widgets/gimpaction.h b/app/widgets/gimpaction.h
index 6ffbb41..1de4930 100644
--- a/app/widgets/gimpaction.h
+++ b/app/widgets/gimpaction.h
@@ -55,7 +55,7 @@ GType gimp_action_get_type (void) G_GNUC_CONST;
GimpAction * gimp_action_new (const gchar *name,
const gchar *label,
const gchar *tooltip,
- const gchar *stock_id);
+ const gchar *icon_name);
gint gimp_action_name_compare (GimpAction *action1,
GimpAction *action2);
diff --git a/app/widgets/gimpactioneditor.c b/app/widgets/gimpactioneditor.c
index b0f10a9..976eb14 100644
--- a/app/widgets/gimpactioneditor.c
+++ b/app/widgets/gimpactioneditor.c
@@ -77,8 +77,8 @@ gimp_action_editor_init (GimpActionEditor *editor)
gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
- gtk_entry_set_icon_from_stock (GTK_ENTRY (entry),
- GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_CLEAR);
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry),
+ GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_CLEAR);
gtk_entry_set_icon_activatable (GTK_ENTRY (entry),
GTK_ENTRY_ICON_SECONDARY, TRUE);
gtk_entry_set_icon_sensitive (GTK_ENTRY (entry),
diff --git a/app/widgets/gimpactionfactory.c b/app/widgets/gimpactionfactory.c
index 2baa490..0931c70 100644
--- a/app/widgets/gimpactionfactory.c
+++ b/app/widgets/gimpactionfactory.c
@@ -70,7 +70,7 @@ gimp_action_factory_finalize (GObject *object)
g_free (entry->identifier);
g_free (entry->label);
- g_free (entry->stock_id);
+ g_free (entry->icon_name);
g_slice_free (GimpActionFactoryEntry, entry);
}
@@ -99,7 +99,7 @@ void
gimp_action_factory_group_register (GimpActionFactory *factory,
const gchar *identifier,
const gchar *label,
- const gchar *stock_id,
+ const gchar *icon_name,
GimpActionGroupSetupFunc setup_func,
GimpActionGroupUpdateFunc update_func)
{
@@ -115,7 +115,7 @@ gimp_action_factory_group_register (GimpActionFactory *factory,
entry->identifier = g_strdup (identifier);
entry->label = g_strdup (label);
- entry->stock_id = g_strdup (stock_id);
+ entry->icon_name = g_strdup (icon_name);
entry->setup_func = setup_func;
entry->update_func = update_func;
@@ -144,7 +144,7 @@ gimp_action_factory_group_new (GimpActionFactory *factory,
group = gimp_action_group_new (factory->gimp,
entry->identifier,
entry->label,
- entry->stock_id,
+ entry->icon_name,
user_data,
entry->update_func);
diff --git a/app/widgets/gimpactionfactory.h b/app/widgets/gimpactionfactory.h
index 9f0e610..9251141 100644
--- a/app/widgets/gimpactionfactory.h
+++ b/app/widgets/gimpactionfactory.h
@@ -31,7 +31,7 @@ struct _GimpActionFactoryEntry
{
gchar *identifier;
gchar *label;
- gchar *stock_id;
+ gchar *icon_name;
GimpActionGroupSetupFunc setup_func;
GimpActionGroupUpdateFunc update_func;
};
@@ -68,7 +68,7 @@ GimpActionFactory * gimp_action_factory_new (Gimp *gimp);
void gimp_action_factory_group_register (GimpActionFactory *factory,
const gchar *identifier,
const gchar *label,
- const gchar *stock_id,
+ const gchar *icon_name,
GimpActionGroupSetupFunc setup_func,
GimpActionGroupUpdateFunc update_func);
diff --git a/app/widgets/gimpactiongroup.c b/app/widgets/gimpactiongroup.c
index d9b6bed..f540d14 100644
--- a/app/widgets/gimpactiongroup.c
+++ b/app/widgets/gimpactiongroup.c
@@ -47,7 +47,7 @@ enum
PROP_0,
PROP_GIMP,
PROP_LABEL,
- PROP_STOCK_ID
+ PROP_ICON_NAME
};
@@ -94,8 +94,8 @@ gimp_action_group_class_init (GimpActionGroupClass *klass)
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
- g_object_class_install_property (object_class, PROP_STOCK_ID,
- g_param_spec_string ("stock-id",
+ g_object_class_install_property (object_class, PROP_ICON_NAME,
+ g_param_spec_string ("icon-name",
NULL, NULL,
NULL,
GIMP_PARAM_READWRITE |
@@ -177,10 +177,10 @@ gimp_action_group_finalize (GObject *object)
group->label = NULL;
}
- if (group->stock_id)
+ if (group->icon_name)
{
- g_free (group->stock_id);
- group->stock_id = NULL;
+ g_free (group->icon_name);
+ group->icon_name = NULL;
}
G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -202,8 +202,8 @@ gimp_action_group_set_property (GObject *object,
case PROP_LABEL:
group->label = g_value_dup_string (value);
break;
- case PROP_STOCK_ID:
- group->stock_id = g_value_dup_string (value);
+ case PROP_ICON_NAME:
+ group->icon_name = g_value_dup_string (value);
break;
default:
@@ -228,8 +228,8 @@ gimp_action_group_get_property (GObject *object,
case PROP_LABEL:
g_value_set_string (value, group->label);
break;
- case PROP_STOCK_ID:
- g_value_set_string (value, group->stock_id);
+ case PROP_ICON_NAME:
+ g_value_set_string (value, group->icon_name);
break;
default:
@@ -260,7 +260,7 @@ gimp_action_group_check_unique_action (GimpActionGroup *group,
* @gimp: the @Gimp instance this action group belongs to
* @name: the name of the action group.
* @label: the user visible label of the action group.
- * @stock_id: the icon of the action group.
+ * @icon_name: the icon of the action group.
* @user_data: the user_data for #GtkAction callbacks.
* @update_func: the function that will be called on
* gimp_action_group_update().
@@ -275,7 +275,7 @@ GimpActionGroup *
gimp_action_group_new (Gimp *gimp,
const gchar *name,
const gchar *label,
- const gchar *stock_id,
+ const gchar *icon_name,
gpointer user_data,
GimpActionGroupUpdateFunc update_func)
{
@@ -288,7 +288,7 @@ gimp_action_group_new (Gimp *gimp,
"gimp", gimp,
"name", name,
"label", label,
- "stock-id", stock_id,
+ "icon-name", icon_name,
NULL);
group->user_data = user_data;
@@ -357,7 +357,7 @@ gimp_action_group_add_actions (GimpActionGroup *group,
}
action = gimp_action_new (entries[i].name, label, tooltip,
- entries[i].stock_id);
+ entries[i].icon_name);
if (entries[i].callback)
g_signal_connect (action, "activate",
@@ -410,7 +410,7 @@ gimp_action_group_add_toggle_actions (GimpActionGroup *group,
}
action = gimp_toggle_action_new (entries[i].name, label, tooltip,
- entries[i].stock_id);
+ entries[i].icon_name);
gtk_toggle_action_set_active (action, entries[i].is_active);
@@ -469,7 +469,7 @@ gimp_action_group_add_radio_actions (GimpActionGroup *group,
}
action = gimp_radio_action_new (entries[i].name, label, tooltip,
- entries[i].stock_id,
+ entries[i].icon_name,
entries[i].value);
if (i == 0)
@@ -535,7 +535,7 @@ gimp_action_group_add_enum_actions (GimpActionGroup *group,
}
action = gimp_enum_action_new (entries[i].name, label, tooltip,
- entries[i].stock_id,
+ entries[i].icon_name,
entries[i].value,
entries[i].value_variable);
@@ -591,7 +591,7 @@ gimp_action_group_add_string_actions (GimpActionGroup *group,
}
action = gimp_string_action_new (entries[i].name, label, tooltip,
- entries[i].stock_id,
+ entries[i].icon_name,
entries[i].value);
if (callback)
@@ -632,7 +632,7 @@ gimp_action_group_add_plug_in_actions (GimpActionGroup *group,
action = gimp_plug_in_action_new (entries[i].name,
entries[i].label,
entries[i].tooltip,
- entries[i].stock_id,
+ entries[i].icon_name,
entries[i].procedure);
if (callback)
diff --git a/app/widgets/gimpactiongroup.h b/app/widgets/gimpactiongroup.h
index 490918d..2ffc500 100644
--- a/app/widgets/gimpactiongroup.h
+++ b/app/widgets/gimpactiongroup.h
@@ -38,7 +38,7 @@ struct _GimpActionGroup
Gimp *gimp;
gchar *label;
- gchar *stock_id;
+ gchar *icon_name;
gpointer user_data;
@@ -55,7 +55,7 @@ struct _GimpActionGroupClass
struct _GimpActionEntry
{
const gchar *name;
- const gchar *stock_id;
+ const gchar *icon_name;
const gchar *label;
const gchar *accelerator;
const gchar *tooltip;
@@ -67,7 +67,7 @@ struct _GimpActionEntry
struct _GimpToggleActionEntry
{
const gchar *name;
- const gchar *stock_id;
+ const gchar *icon_name;
const gchar *label;
const gchar *accelerator;
const gchar *tooltip;
@@ -80,7 +80,7 @@ struct _GimpToggleActionEntry
struct _GimpRadioActionEntry
{
const gchar *name;
- const gchar *stock_id;
+ const gchar *icon_name;
const gchar *label;
const gchar *accelerator;
const gchar *tooltip;
@@ -92,7 +92,7 @@ struct _GimpRadioActionEntry
struct _GimpEnumActionEntry
{
const gchar *name;
- const gchar *stock_id;
+ const gchar *icon_name;
const gchar *label;
const gchar *accelerator;
const gchar *tooltip;
@@ -105,7 +105,7 @@ struct _GimpEnumActionEntry
struct _GimpStringActionEntry
{
const gchar *name;
- const gchar *stock_id;
+ const gchar *icon_name;
const gchar *label;
const gchar *accelerator;
const gchar *tooltip;
@@ -117,7 +117,7 @@ struct _GimpStringActionEntry
struct _GimpPlugInActionEntry
{
const gchar *name;
- const gchar *stock_id;
+ const gchar *icon_name;
const gchar *label;
const gchar *accelerator;
const gchar *tooltip;
@@ -132,7 +132,7 @@ GType gimp_action_group_get_type (void) G_GNUC_CONST;
GimpActionGroup *gimp_action_group_new (Gimp *gimp,
const gchar *name,
const gchar *label,
- const gchar *stock_id,
+ const gchar *icon_name,
gpointer user_data,
GimpActionGroupUpdateFunc update_func);
diff --git a/app/widgets/gimpactionview.c b/app/widgets/gimpactionview.c
index f522240..fa40d0c 100644
--- a/app/widgets/gimpactionview.c
+++ b/app/widgets/gimpactionview.c
@@ -209,7 +209,7 @@ gimp_action_view_new (GimpUIManager *manager,
store = gtk_tree_store_new (GIMP_ACTION_VIEW_N_COLUMNS,
G_TYPE_BOOLEAN, /* COLUMN_VISIBLE */
GTK_TYPE_ACTION, /* COLUMN_ACTION */
- G_TYPE_STRING, /* COLUMN_STOCK_ID */
+ G_TYPE_STRING, /* COLUMN_ICON_NAME */
G_TYPE_STRING, /* COLUMN_LABEL */
G_TYPE_STRING, /* COLUMN_LABEL_CASEFOLD */
G_TYPE_STRING, /* COLUMN_NAME */
@@ -231,8 +231,8 @@ gimp_action_view_new (GimpUIManager *manager,
gtk_tree_store_append (store, &group_iter, NULL);
gtk_tree_store_set (store, &group_iter,
- GIMP_ACTION_VIEW_COLUMN_STOCK_ID, group->stock_id,
- GIMP_ACTION_VIEW_COLUMN_LABEL, group->label,
+ GIMP_ACTION_VIEW_COLUMN_ICON_NAME, group->icon_name,
+ GIMP_ACTION_VIEW_COLUMN_LABEL, group->label,
-1);
actions = gtk_action_group_list_actions (GTK_ACTION_GROUP (group));
@@ -243,7 +243,7 @@ gimp_action_view_new (GimpUIManager *manager,
{
GtkAction *action = list2->data;
const gchar *name = gtk_action_get_name (action);
- const gchar *stock_id = gtk_action_get_stock_id (action);
+ const gchar *icon_name = gtk_action_get_icon_name (action);
gchar *label;
gchar *label_casefold;
guint accel_key = 0;
@@ -291,7 +291,7 @@ gimp_action_view_new (GimpUIManager *manager,
gtk_tree_store_set (store, &action_iter,
GIMP_ACTION_VIEW_COLUMN_VISIBLE, TRUE,
GIMP_ACTION_VIEW_COLUMN_ACTION, action,
- GIMP_ACTION_VIEW_COLUMN_STOCK_ID, stock_id,
+ GIMP_ACTION_VIEW_COLUMN_ICON_NAME, icon_name,
GIMP_ACTION_VIEW_COLUMN_LABEL, label,
GIMP_ACTION_VIEW_COLUMN_LABEL_CASEFOLD, label_casefold,
GIMP_ACTION_VIEW_COLUMN_NAME, name,
@@ -339,8 +339,8 @@ gimp_action_view_new (GimpUIManager *manager,
cell = gtk_cell_renderer_pixbuf_new ();
gtk_tree_view_column_pack_start (column, cell, FALSE);
gtk_tree_view_column_set_attributes (column, cell,
- "stock-id",
- GIMP_ACTION_VIEW_COLUMN_STOCK_ID,
+ "icon-name",
+ GIMP_ACTION_VIEW_COLUMN_ICON_NAME,
NULL);
cell = gtk_cell_renderer_text_new ();
diff --git a/app/widgets/gimpactionview.h b/app/widgets/gimpactionview.h
index 7a6edc9..0bc61f3 100644
--- a/app/widgets/gimpactionview.h
+++ b/app/widgets/gimpactionview.h
@@ -26,7 +26,7 @@ enum
{
GIMP_ACTION_VIEW_COLUMN_VISIBLE,
GIMP_ACTION_VIEW_COLUMN_ACTION,
- GIMP_ACTION_VIEW_COLUMN_STOCK_ID,
+ GIMP_ACTION_VIEW_COLUMN_ICON_NAME,
GIMP_ACTION_VIEW_COLUMN_LABEL,
GIMP_ACTION_VIEW_COLUMN_LABEL_CASEFOLD,
GIMP_ACTION_VIEW_COLUMN_NAME,
diff --git a/app/widgets/gimpcoloreditor.c b/app/widgets/gimpcoloreditor.c
index 36d6d46..c91c866 100644
--- a/app/widgets/gimpcoloreditor.c
+++ b/app/widgets/gimpcoloreditor.c
@@ -212,8 +212,8 @@ gimp_color_editor_init (GimpColorEditor *editor)
gtk_box_pack_start (GTK_BOX (editor->hbox), button, TRUE, TRUE, 0);
gtk_widget_show (button);
- image = gtk_image_new_from_stock (selector_class->stock_id,
- GTK_ICON_SIZE_BUTTON);
+ image = gtk_image_new_from_icon_name (selector_class->stock_id,
+ GTK_ICON_SIZE_BUTTON);
gtk_container_add (GTK_CONTAINER (button), image);
gtk_widget_show (image);
diff --git a/app/widgets/gimpcontrollereditor.c b/app/widgets/gimpcontrollereditor.c
index c9b7318..63926eb 100644
--- a/app/widgets/gimpcontrollereditor.c
+++ b/app/widgets/gimpcontrollereditor.c
@@ -58,7 +58,7 @@ enum
{
COLUMN_EVENT,
COLUMN_BLURB,
- COLUMN_STOCK_ID,
+ COLUMN_ICON_NAME,
COLUMN_ACTION,
N_COLUMNS
};
@@ -306,7 +306,7 @@ gimp_controller_editor_constructed (GObject *object)
const gchar *event_name;
const gchar *event_blurb;
const gchar *event_action;
- const gchar *stock_id = NULL;
+ const gchar *icon_name = NULL;
event_name = gimp_controller_get_event_name (controller, i);
event_blurb = gimp_controller_get_event_blurb (controller, i);
@@ -320,15 +320,15 @@ gimp_controller_editor_constructed (GObject *object)
action = gimp_ui_manager_find_action (ui_manager, NULL, event_action);
if (action)
- stock_id = gtk_action_get_stock_id (action);
+ icon_name = gtk_action_get_icon_name (action);
}
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
- COLUMN_EVENT, event_name,
- COLUMN_BLURB, event_blurb,
- COLUMN_STOCK_ID, stock_id,
- COLUMN_ACTION, event_action,
+ COLUMN_EVENT, event_name,
+ COLUMN_BLURB, event_blurb,
+ COLUMN_ICON_NAME, icon_name,
+ COLUMN_ACTION, event_action,
-1);
}
@@ -345,7 +345,7 @@ gimp_controller_editor_constructed (GObject *object)
cell = gtk_cell_renderer_pixbuf_new ();
gtk_tree_view_column_pack_start (column, cell, FALSE);
gtk_tree_view_column_set_attributes (column, cell,
- "stock-id", COLUMN_STOCK_ID,
+ "icon-name", COLUMN_ICON_NAME,
NULL);
cell = gtk_cell_renderer_text_new ();
@@ -732,8 +732,8 @@ gimp_controller_editor_delete_clicked (GtkWidget *button,
g_free (event_name);
gtk_list_store_set (GTK_LIST_STORE (model), &iter,
- COLUMN_STOCK_ID, NULL,
- COLUMN_ACTION, NULL,
+ COLUMN_ICON_NAME, NULL,
+ COLUMN_ACTION, NULL,
-1);
}
}
@@ -759,13 +759,13 @@ gimp_controller_editor_edit_response (GtkWidget *dialog,
GtkTreeModel *model;
GtkTreeIter iter;
gchar *event_name = NULL;
- gchar *stock_id = NULL;
+ gchar *icon_name = NULL;
gchar *action_name = NULL;
if (gtk_tree_selection_get_selected (editor->edit_sel, &model, &iter))
gtk_tree_model_get (model, &iter,
- GIMP_ACTION_VIEW_COLUMN_STOCK_ID, &stock_id,
- GIMP_ACTION_VIEW_COLUMN_NAME, &action_name,
+ GIMP_ACTION_VIEW_COLUMN_ICON_NAME, &icon_name,
+ GIMP_ACTION_VIEW_COLUMN_NAME, &action_name,
-1);
if (gtk_tree_selection_get_selected (editor->sel, &model, &iter))
@@ -780,13 +780,13 @@ gimp_controller_editor_edit_response (GtkWidget *dialog,
g_strdup (action_name));
gtk_list_store_set (GTK_LIST_STORE (model), &iter,
- COLUMN_STOCK_ID, stock_id,
- COLUMN_ACTION, action_name,
+ COLUMN_ICON_NAME, icon_name,
+ COLUMN_ACTION, action_name,
-1);
}
g_free (event_name);
- g_free (stock_id);
+ g_free (icon_name);
g_free (action_name);
gimp_controller_editor_sel_changed (editor->sel, editor);
diff --git a/app/widgets/gimpeditor.c b/app/widgets/gimpeditor.c
index 8bf6f6a..07b9f0e 100644
--- a/app/widgets/gimpeditor.c
+++ b/app/widgets/gimpeditor.c
@@ -476,7 +476,7 @@ gimp_editor_popup_menu (GimpEditor *editor,
GtkWidget *
gimp_editor_add_button (GimpEditor *editor,
- const gchar *stock_id,
+ const gchar *icon_name,
const gchar *tooltip,
const gchar *help_id,
GCallback callback,
@@ -489,13 +489,11 @@ gimp_editor_add_button (GimpEditor *editor,
GtkReliefStyle button_relief;
g_return_val_if_fail (GIMP_IS_EDITOR (editor), NULL);
- g_return_val_if_fail (stock_id != NULL, NULL);
+ g_return_val_if_fail (icon_name != NULL, NULL);
button_icon_size = gimp_editor_ensure_button_box (editor, &button_relief);
- button = g_object_new (GIMP_TYPE_BUTTON,
- "use-stock", TRUE,
- NULL);
+ button = gimp_button_new ();
gtk_button_set_relief (GTK_BUTTON (button), button_relief);
gtk_box_pack_start (GTK_BOX (editor->priv->button_box), button, TRUE, TRUE, 0);
gtk_widget_show (button);
@@ -513,7 +511,7 @@ gimp_editor_add_button (GimpEditor *editor,
extended_callback,
callback_data);
- image = gtk_image_new_from_stock (stock_id, button_icon_size);
+ image = gtk_image_new_from_icon_name (icon_name, button_icon_size);
gtk_container_add (GTK_CONTAINER (button), image);
gtk_widget_show (image);
@@ -523,7 +521,7 @@ gimp_editor_add_button (GimpEditor *editor,
GtkWidget *
gimp_editor_add_stock_box (GimpEditor *editor,
GType enum_type,
- const gchar *stock_prefix,
+ const gchar *icon_prefix,
GCallback callback,
gpointer callback_data)
{
@@ -536,11 +534,11 @@ gimp_editor_add_stock_box (GimpEditor *editor,
g_return_val_if_fail (GIMP_IS_EDITOR (editor), NULL);
g_return_val_if_fail (g_type_is_a (enum_type, G_TYPE_ENUM), NULL);
- g_return_val_if_fail (stock_prefix != NULL, NULL);
+ g_return_val_if_fail (icon_prefix != NULL, NULL);
button_icon_size = gimp_editor_ensure_button_box (editor, &button_relief);
- hbox = gimp_enum_stock_box_new (enum_type, stock_prefix, button_icon_size,
+ hbox = gimp_enum_stock_box_new (enum_type, icon_prefix, button_icon_size,
callback, callback_data,
&first_button);
@@ -621,7 +619,7 @@ gimp_editor_add_action_button (GimpEditor *editor,
GtkWidget *image;
GtkIconSize button_icon_size;
GtkReliefStyle button_relief;
- const gchar *stock_id;
+ const gchar *icon_name;
gchar *tooltip;
const gchar *help_id;
GList *extended = NULL;
@@ -650,16 +648,16 @@ gimp_editor_add_action_button (GimpEditor *editor,
gtk_button_set_relief (GTK_BUTTON (button), button_relief);
- stock_id = gtk_action_get_stock_id (action);
- tooltip = g_strdup (gtk_action_get_tooltip (action));
- help_id = g_object_get_qdata (G_OBJECT (action), GIMP_HELP_ID);
+ icon_name = gtk_action_get_icon_name (action);
+ tooltip = g_strdup (gtk_action_get_tooltip (action));
+ help_id = g_object_get_qdata (G_OBJECT (action), GIMP_HELP_ID);
old_child = gtk_bin_get_child (GTK_BIN (button));
if (old_child)
gtk_widget_destroy (old_child);
- image = gtk_image_new_from_stock (stock_id, button_icon_size);
+ image = gtk_image_new_from_icon_name (icon_name, button_icon_size);
gtk_container_add (GTK_CONTAINER (button), image);
gtk_widget_show (image);
@@ -783,13 +781,22 @@ gimp_editor_set_box_style (GimpEditor *editor,
if (GTK_IS_IMAGE (child))
{
GtkIconSize old_size;
- gchar *stock_id;
+ const gchar *icon_name;
- gtk_image_get_stock (GTK_IMAGE (child), &stock_id, &old_size);
+ /* FIXME icon_name */
+ if (gtk_image_get_storage_type (GTK_IMAGE (child)) == GTK_IMAGE_STOCK)
+ {
+ gtk_image_get_stock (GTK_IMAGE (child), &icon_name, &old_size);
+ g_printerr ("EEEEK: %s used in GimpEditor\n", icon_name);
+ }
+ else
+ {
+ gtk_image_get_icon_name (GTK_IMAGE (child), &icon_name, &old_size);
+ }
if (button_icon_size != old_size)
- gtk_image_set_from_stock (GTK_IMAGE (child),
- stock_id, button_icon_size);
+ gtk_image_set_from_icon_name (GTK_IMAGE (child),
+ icon_name, button_icon_size);
}
}
}
diff --git a/app/widgets/gimpeditor.h b/app/widgets/gimpeditor.h
index 4fdab35..d455a1b 100644
--- a/app/widgets/gimpeditor.h
+++ b/app/widgets/gimpeditor.h
@@ -60,7 +60,7 @@ gboolean gimp_editor_popup_menu (GimpEditor *editor,
gpointer position_data);
GtkWidget * gimp_editor_add_button (GimpEditor *editor,
- const gchar *stock_id,
+ const gchar *icon_name,
const gchar *tooltip,
const gchar *help_id,
GCallback callback,
diff --git a/app/widgets/gimpenumaction.c b/app/widgets/gimpenumaction.c
index 0e2e7c8..ba89aa2 100644
--- a/app/widgets/gimpenumaction.c
+++ b/app/widgets/gimpenumaction.c
@@ -151,7 +151,7 @@ GimpEnumAction *
gimp_enum_action_new (const gchar *name,
const gchar *label,
const gchar *tooltip,
- const gchar *stock_id,
+ const gchar *icon_name,
gint value,
gboolean value_variable)
{
@@ -159,7 +159,7 @@ gimp_enum_action_new (const gchar *name,
"name", name,
"label", label,
"tooltip", tooltip,
- "stock-id", stock_id,
+ "icon-name", icon_name,
"value", value,
"value-variable", value_variable,
NULL);
diff --git a/app/widgets/gimpenumaction.h b/app/widgets/gimpenumaction.h
index 9ec873e..ba5119f 100644
--- a/app/widgets/gimpenumaction.h
+++ b/app/widgets/gimpenumaction.h
@@ -57,7 +57,7 @@ GType gimp_enum_action_get_type (void) G_GNUC_CONST;
GimpEnumAction * gimp_enum_action_new (const gchar *name,
const gchar *label,
const gchar *tooltip,
- const gchar *stock_id,
+ const gchar *icon_name,
gint value,
gboolean value_variable);
void gimp_enum_action_selected (GimpEnumAction *action,
diff --git a/app/widgets/gimppluginaction.c b/app/widgets/gimppluginaction.c
index 7eaaa57..5f3cdde 100644
--- a/app/widgets/gimppluginaction.c
+++ b/app/widgets/gimppluginaction.c
@@ -220,15 +220,15 @@ GimpPlugInAction *
gimp_plug_in_action_new (const gchar *name,
const gchar *label,
const gchar *tooltip,
- const gchar *stock_id,
+ const gchar *icon_name,
GimpPlugInProcedure *procedure)
{
return g_object_new (GIMP_TYPE_PLUG_IN_ACTION,
- "name", name,
- "label", label,
- "tooltip", tooltip,
- "stock-id", stock_id,
- "procedure", procedure,
+ "name", name,
+ "label", label,
+ "tooltip", tooltip,
+ "icon-name", icon_name,
+ "procedure", procedure,
NULL);
}
diff --git a/app/widgets/gimppluginaction.h b/app/widgets/gimppluginaction.h
index d44836e..bca9a7b 100644
--- a/app/widgets/gimppluginaction.h
+++ b/app/widgets/gimppluginaction.h
@@ -56,7 +56,7 @@ GType gimp_plug_in_action_get_type (void) G_GNUC_CONST;
GimpPlugInAction * gimp_plug_in_action_new (const gchar *name,
const gchar *label,
const gchar *tooltip,
- const gchar *stock_id,
+ const gchar *icon_name,
GimpPlugInProcedure *procedure);
void gimp_plug_in_action_selected (GimpPlugInAction *action,
GimpPlugInProcedure *procedure);
diff --git a/app/widgets/gimpradioaction.c b/app/widgets/gimpradioaction.c
index 58abac4..df0a990 100644
--- a/app/widgets/gimpradioaction.c
+++ b/app/widgets/gimpradioaction.c
@@ -77,26 +77,19 @@ GtkRadioAction *
gimp_radio_action_new (const gchar *name,
const gchar *label,
const gchar *tooltip,
- const gchar *stock_id,
+ const gchar *icon_name,
gint value)
{
GtkRadioAction *action;
action = g_object_new (GIMP_TYPE_RADIO_ACTION,
- "name", name,
- "label", label,
- "tooltip", tooltip,
- "value", value,
+ "name", name,
+ "label", label,
+ "tooltip", tooltip,
+ "icon-name", icon_name,
+ "value", value,
NULL);
- if (stock_id)
- {
- if (gtk_icon_factory_lookup_default (stock_id))
- gtk_action_set_stock_id (GTK_ACTION (action), stock_id);
- else
- gtk_action_set_icon_name (GTK_ACTION (action), stock_id);
- }
-
return action;
}
diff --git a/app/widgets/gimpradioaction.h b/app/widgets/gimpradioaction.h
index 2ca655d..4644983 100644
--- a/app/widgets/gimpradioaction.h
+++ b/app/widgets/gimpradioaction.h
@@ -50,7 +50,7 @@ GType gimp_radio_action_get_type (void) G_GNUC_CONST;
GtkRadioAction * gimp_radio_action_new (const gchar *name,
const gchar *label,
const gchar *tooltip,
- const gchar *stock_id,
+ const gchar *icon_name,
gint value);
diff --git a/app/widgets/gimpstringaction.c b/app/widgets/gimpstringaction.c
index 0d8c4fc..a5f1cb9 100644
--- a/app/widgets/gimpstringaction.c
+++ b/app/widgets/gimpstringaction.c
@@ -154,25 +154,19 @@ GimpStringAction *
gimp_string_action_new (const gchar *name,
const gchar *label,
const gchar *tooltip,
- const gchar *stock_id,
+ const gchar *icon_name,
const gchar *value)
{
GimpStringAction *action;
action = g_object_new (GIMP_TYPE_STRING_ACTION,
- "name", name,
- "label", label,
- "tooltip", tooltip,
- "stock-id", stock_id,
- "value", value,
+ "name", name,
+ "label", label,
+ "tooltip", tooltip,
+ "icon-name", icon_name,
+ "value", value,
NULL);
- if (stock_id)
- {
- if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), stock_id))
- gtk_action_set_icon_name (GTK_ACTION (action), stock_id);
- }
-
return action;
}
diff --git a/app/widgets/gimpstringaction.h b/app/widgets/gimpstringaction.h
index 4173118..8508757 100644
--- a/app/widgets/gimpstringaction.h
+++ b/app/widgets/gimpstringaction.h
@@ -56,7 +56,7 @@ GType gimp_string_action_get_type (void) G_GNUC_CONST;
GimpStringAction * gimp_string_action_new (const gchar *name,
const gchar *label,
const gchar *tooltip,
- const gchar *stock_id,
+ const gchar *icon_name,
const gchar *value);
void gimp_string_action_selected (GimpStringAction *action,
const gchar *value);
diff --git a/app/widgets/gimptoggleaction.c b/app/widgets/gimptoggleaction.c
index eccbb0d..6ed473c 100644
--- a/app/widgets/gimptoggleaction.c
+++ b/app/widgets/gimptoggleaction.c
@@ -77,24 +77,17 @@ GtkToggleAction *
gimp_toggle_action_new (const gchar *name,
const gchar *label,
const gchar *tooltip,
- const gchar *stock_id)
+ const gchar *icon_name)
{
GtkToggleAction *action;
action = g_object_new (GIMP_TYPE_TOGGLE_ACTION,
- "name", name,
- "label", label,
- "tooltip", tooltip,
+ "name", name,
+ "label", label,
+ "tooltip", tooltip,
+ "icon-name", icon_name,
NULL);
- if (stock_id)
- {
- if (gtk_icon_factory_lookup_default (stock_id))
- gtk_action_set_stock_id (GTK_ACTION (action), stock_id);
- else
- gtk_action_set_icon_name (GTK_ACTION (action), stock_id);
- }
-
return action;
}
diff --git a/app/widgets/gimptoggleaction.h b/app/widgets/gimptoggleaction.h
index 7f081a9..817b7e4 100644
--- a/app/widgets/gimptoggleaction.h
+++ b/app/widgets/gimptoggleaction.h
@@ -50,7 +50,7 @@ GType gimp_toggle_action_get_type (void) G_GNUC_CONST;
GtkToggleAction * gimp_toggle_action_new (const gchar *name,
const gchar *label,
const gchar *tooltip,
- const gchar *stock_id);
+ const gchar *icon_name);
#endif /* __GIMP_TOGGLE_ACTION_H__ */
diff --git a/libgimpwidgets/gimpenumwidgets.c b/libgimpwidgets/gimpenumwidgets.c
index 56267a4..2021f4c 100644
--- a/libgimpwidgets/gimpenumwidgets.c
+++ b/libgimpwidgets/gimpenumwidgets.c
@@ -369,7 +369,10 @@ gimp_enum_stock_box_new_with_range (GType enum_type,
stock_id = g_strconcat (stock_prefix, "-", value->value_nick, NULL);
- image = gtk_image_new_from_stock (stock_id, icon_size);
+ if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), stock_id))
+ image = gtk_image_new_from_icon_name (stock_id, icon_size);
+ else
+ image = gtk_image_new_from_stock (stock_id, icon_size);
g_free (stock_id);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]