Commit 305db405 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

added "gchar *stock_id" to the GimpViewable struct. It is used by the GUI

2003-02-26  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpviewable.[ch]: added "gchar *stock_id" to the
	GimpViewable struct. It is used by the GUI if the get_preview()
	functions return NULL. Default to GTK_STOCK_DIALOG_QUESTION.

	* app/core/gimptoolinfo.[ch]: set the tool's stock_id. Removed
	the cached GdkPixbuf. Don't implement any preview function
	so the GUI uses the stock_id.

	* app/tools/tool_manager.c: removed GdkPixbuf creation, removed
	the #warning about the buggy way we created the pixbuf.

	* app/gui/dialogs-constructors.c
	* app/gui/image-menu.c
	* app/tools/gimpcroptool.c
	* app/tools/gimphistogramtool.c
	* app/tools/gimpimagemaptool.c
	* app/tools/gimpmeasuretool.c
	* app/tools/gimptransformtool.c
	* app/widgets/gimptoolbox.c: use viewable->stock_id instead
	of tool_info->stock_id.

	* app/core/gimpbrush.c
	* app/core/gimpgradient.c
	* app/core/gimpimagefile.c
	* app/core/gimpundo.c: simplified get_preview() implementations:

	- never scale previews up, only down.
	- don't render white or checks backgrounds but simply return
	  TempBufs with alpha and let the preview system do its job.
	- don't add padding but simply return previews smaller than
	  requested.

	* app/display/gimpdisplayshell-render.[ch]: added
	"render_blend_white", a 2d lookup table for blending on white,
	just as the check lookup tables. Added "render_white_buf".

	* app/widgets/gimppreview.[ch]: changed a lot:

	- don't render the preview's border into the buffer.
	- added "GdkGC *border_gc" and draw the preview's border in expose()
	  using gdk_draw_rectangle().
	- added "GdkPixbuf *no_preview_pixbuf" and create it in
	  gimp_preview_real_render() if gimp_viewable_get_preview()
	  returned NULL.
	- factored the actual preview rendering out to
	  gimp_preview_render_to_buffer(). Added configurable background
	  rendering for the preview itself and it's padding area
	  (the area the preview is larger than the buffer returned
	  by gimp_viewable_get_preview()).
	- changed gimp_preview_render_and_flush() to
	  gimp_preview_render_preview() and added "inside_bg" and
	  "outside_bg" parameters.
	- use the new render buffers for blending on white.

	* app/widgets/gimpbrushpreview.c
	* app/widgets/gimpbufferpreview.c
	* app/widgets/gimpdrawablepreview.c
	* app/widgets/gimpgradientpreview.c
	* app/widgets/gimpimagepreview.c
	* app/widgets/gimppalettepreview.c
	* app/widgets/gimppatternpreview.c: don't create large white
	TempBufs to center the previews in but simply set the TempBuf's
	offsets to get them centered. Simplified & cleaned up many preview
	render functions. Pass the correct GimpPreviewBG modes to
	gimp_preview_render_preview().

	* app/widgets/gimpcellrendererviewable.[ch]: new GtkCellRenderer
	class derived from GtkCellRendererPixbuf which knows how
	to use gimp_viewable_get_preview_size() and renders the
	viewable's stock item if no preview can be created.

	* app/widgets/gimpcontainertreeview.c: added a GtkTreeCellDataFunc
	which creates the preview pixbuf if needed so we don't create it
	unconditionally upon item insertion. Fixed preview size assertion
	to use GIMP_PREVIEW_MAX_SIZE, not "64". Block "selection_changed"
	while reordering the selected item.

	* app/widgets/gimpcontainerview.c: cosmetic.

	* app/widgets/gimpimagefilepreview.[ch]
	* app/widgets/gimptoolinfopreview.[ch]
	* app/widgets/gimpundopreview.[ch]: removed because the default
	implementation is good enough.

	* app/widgets/Makefile.am
	* app/widgets/widgets-types.h
	* app/widgets/gimppreview-utils.c: changed accordingly.

	* app/gui/dialogs-constructors.[ch]
	* app/gui/dialogs-menu.c
	* app/gui/dialogs.c
	* app/gui/image-menu.c
	* app/gui/toolbox-menu.c: register grid and tree view variants
	of the document history.

	Unrelated:

	* app/gui/gui.c (gui_exit_finish_callback): disconnect from
	signals earlier.

	* app/gui/user-install-dialog.c: create the "tool-options" subdir
	of the user's ~/.gimp-1.3 directory.
parent 2d5828ec
2003-02-25 Michael Natterer <mitch@gimp.org>
2003-02-26 Michael Natterer <mitch@gimp.org>
* app/core/gimpviewable.[ch]: added "gchar *stock_id" to the
GimpViewable struct. It is used by the GUI if the get_preview()
......@@ -957,9 +957,9 @@ dialogs_color_editor_new (GimpDialogFactory *factory,
}
GtkWidget *
dialogs_document_history_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size)
dialogs_document_list_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size)
{
GtkWidget *view;
......@@ -972,7 +972,51 @@ dialogs_document_history_new (GimpDialogFactory *factory,
factory->menu_factory);
return dialogs_dockable_new (view,
_("Document History"), _("History"),
_("Document History List"), _("History"),
GTK_STOCK_OPEN,
dialogs_stock_text_tab_func,
dialogs_set_editor_context_func);
}
GtkWidget *
dialogs_document_grid_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size)
{
GtkWidget *view;
view = gimp_document_view_new (GIMP_VIEW_TYPE_GRID,
context->gimp->documents,
context,
preview_size,
5, 3,
file_file_open_dialog,
factory->menu_factory);
return dialogs_dockable_new (view,
_("Document History Grid"), _("History"),
GTK_STOCK_OPEN,
dialogs_stock_text_tab_func,
dialogs_set_editor_context_func);
}
GtkWidget *
dialogs_document_tree_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size)
{
GtkWidget *view;
view = gimp_document_view_new (GIMP_VIEW_TYPE_TREE,
context->gimp->documents,
context,
preview_size,
5, 3,
file_file_open_dialog,
factory->menu_factory);
return dialogs_dockable_new (view,
_("Document History Tree"), _("History"),
GTK_STOCK_OPEN,
dialogs_stock_text_tab_func,
dialogs_set_editor_context_func);
......@@ -1236,7 +1280,9 @@ dialogs_tool_tab_tool_changed (GimpContext *context,
GimpToolInfo *tool_info,
GtkImage *image)
{
gtk_image_set_from_stock (image, tool_info->stock_id, image->icon_size);
gtk_image_set_from_stock (image,
GIMP_VIEWABLE (tool_info)->stock_id,
image->icon_size);
}
static GtkWidget *
......@@ -1244,13 +1290,15 @@ dialogs_tool_tab_func (GimpDockable *dockable,
GimpDockbook *dockbook,
GtkIconSize size)
{
GimpContext *context;
GtkWidget *image;
GimpContext *context;
GimpViewable *viewable;
GtkWidget *image;
context = dockbook->dock->context;
image = gtk_image_new_from_stock (gimp_context_get_tool (context)->stock_id,
size);
viewable = GIMP_VIEWABLE (gimp_context_get_tool (context));
image = gtk_image_new_from_stock (viewable->stock_id, size);
g_signal_connect_object (context, "tool_changed",
G_CALLBACK (dialogs_tool_tab_tool_changed),
......@@ -1268,7 +1316,9 @@ dialogs_tool_options_tool_changed (GimpContext *context,
GtkImage *image;
if ((image = g_object_get_data (G_OBJECT (label), "tool-icon")))
gtk_image_set_from_stock (image, tool_info->stock_id, image->icon_size);
gtk_image_set_from_stock (image,
GIMP_VIEWABLE (tool_info)->stock_id,
image->icon_size);
gtk_label_set_text (label, tool_info->blurb);
......@@ -1298,7 +1348,7 @@ dialogs_tool_options_tab_func (GimpDockable *dockable,
hbox = gtk_hbox_new (FALSE, 2);
image = gtk_image_new_from_stock (gimp_context_get_tool (context)->stock_id,
image = gtk_image_new_from_stock (GIMP_VIEWABLE (tool_info)->stock_id,
size);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
gtk_widget_show (image);
......
......@@ -153,7 +153,13 @@ GtkWidget * dialogs_color_editor_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_document_history_new (GimpDialogFactory *factory,
GtkWidget * dialogs_document_list_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_document_grid_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_document_tree_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
......
......@@ -87,7 +87,9 @@ static const GimpDialogFactoryEntry dock_entries[] =
{ "gimp-color-editor", dialogs_color_editor_new, 0, FALSE, FALSE, FALSE, TRUE },
{ "gimp-document-history", dialogs_document_history_new, 48, FALSE, FALSE, FALSE, TRUE },
{ "gimp-document-list", dialogs_document_list_new, 48, FALSE, FALSE, FALSE, TRUE },
{ "gimp-document-grid", dialogs_document_grid_new, 48, FALSE, FALSE, FALSE, TRUE },
{ "gimp-document-tree", dialogs_document_tree_new, 48, FALSE, FALSE, FALSE, TRUE },
{ "gimp-brush-editor", dialogs_brush_editor_get, 0, TRUE, FALSE, FALSE, TRUE },
{ "gimp-gradient-editor", dialogs_gradient_editor_get, 0, TRUE, FALSE, FALSE, TRUE },
......
......@@ -265,6 +265,11 @@ tree_items[] =
"sessions and can be destroyed with impunity."),
TREE_ITEM_MKDIR_ONLY, NULL
},
{
TRUE, "tool-options",
N_("This folder is used to store tool options."),
TREE_ITEM_MKDIR_ONLY, NULL
},
{
TRUE, "curves",
N_("This folder is used to store parameter files for the\n"
......
......@@ -73,9 +73,12 @@ static void render_setup_notify (gpointer config,
/* accelerate transparency of image scaling */
guchar *render_check_buf = NULL;
guchar *render_empty_buf = NULL;
guchar *render_white_buf = NULL;
guchar *render_temp_buf = NULL;
guchar *render_blend_dark_check = NULL;
guchar *render_blend_light_check = NULL;
guchar *render_blend_white = NULL;
static guchar *tile_buf = NULL;
......@@ -135,6 +138,12 @@ render_exit (Gimp *gimp)
render_blend_light_check = NULL;
}
if (render_blend_white)
{
g_free (render_blend_white);
render_blend_white = NULL;
}
if (render_check_buf)
{
g_free (render_check_buf);
......@@ -147,6 +156,12 @@ render_exit (Gimp *gimp)
render_empty_buf = NULL;
}
if (render_white_buf)
{
g_free (render_white_buf);
render_white_buf = NULL;
}
if (render_temp_buf)
{
g_free (render_temp_buf);
......@@ -185,6 +200,8 @@ render_setup_notify (gpointer config,
render_blend_dark_check = g_new (guchar, 65536);
if (! render_blend_light_check)
render_blend_light_check = g_new (guchar, 65536);
if (! render_blend_white)
render_blend_white = g_new (guchar, 65536);
for (i = 0; i < 256; i++)
for (j = 0; j < 256; j++)
......@@ -193,6 +210,9 @@ render_setup_notify (gpointer config,
((j * i + check_combos[check_type][0] * (255 - i)) / 255);
render_blend_light_check [(i << 8) + j] = (guchar)
((j * i + check_combos[check_type][1] * (255 - i)) / 255);
render_blend_white [(i << 8) + j] = (guchar)
((j * i + 255 * (255 - i)) / 255);
}
switch (check_size)
......@@ -213,6 +233,7 @@ render_setup_notify (gpointer config,
g_free (render_check_buf);
g_free (render_empty_buf);
g_free (render_white_buf);
g_free (render_temp_buf);
#ifdef __GNUC__
......@@ -242,12 +263,16 @@ render_setup_notify (gpointer config,
}
render_empty_buf = g_new0 (guchar, (MAX_PREVIEW_SIZE + 4) * 3);
render_white_buf = g_new (guchar, (MAX_PREVIEW_SIZE + 4) * 3);
render_temp_buf = g_new (guchar, (MAX_PREVIEW_SIZE + 4) * 3);
memset (render_white_buf, 255, (MAX_PREVIEW_SIZE + 4) * 3);
}
else
{
render_check_buf = NULL;
render_empty_buf = NULL;
render_white_buf = NULL;
render_temp_buf = NULL;
}
}
......
......@@ -38,9 +38,12 @@ void gimp_display_shell_render (GimpDisplayShell *shell,
*/
extern guchar *render_check_buf;
extern guchar *render_empty_buf;
extern guchar *render_white_buf;
extern guchar *render_temp_buf;
extern guchar *render_blend_dark_check;
extern guchar *render_blend_light_check;
extern guchar *render_blend_white;
#endif /* __GIMP_DISPLAY_SHELL_RENDER_H__ */
......@@ -957,9 +957,9 @@ dialogs_color_editor_new (GimpDialogFactory *factory,
}
GtkWidget *
dialogs_document_history_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size)
dialogs_document_list_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size)
{
GtkWidget *view;
......@@ -972,7 +972,51 @@ dialogs_document_history_new (GimpDialogFactory *factory,
factory->menu_factory);
return dialogs_dockable_new (view,
_("Document History"), _("History"),
_("Document History List"), _("History"),
GTK_STOCK_OPEN,
dialogs_stock_text_tab_func,
dialogs_set_editor_context_func);
}
GtkWidget *
dialogs_document_grid_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size)
{
GtkWidget *view;
view = gimp_document_view_new (GIMP_VIEW_TYPE_GRID,
context->gimp->documents,
context,
preview_size,
5, 3,
file_file_open_dialog,
factory->menu_factory);
return dialogs_dockable_new (view,
_("Document History Grid"), _("History"),
GTK_STOCK_OPEN,
dialogs_stock_text_tab_func,
dialogs_set_editor_context_func);
}
GtkWidget *
dialogs_document_tree_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size)
{
GtkWidget *view;
view = gimp_document_view_new (GIMP_VIEW_TYPE_TREE,
context->gimp->documents,
context,
preview_size,
5, 3,
file_file_open_dialog,
factory->menu_factory);
return dialogs_dockable_new (view,
_("Document History Tree"), _("History"),
GTK_STOCK_OPEN,
dialogs_stock_text_tab_func,
dialogs_set_editor_context_func);
......@@ -1236,7 +1280,9 @@ dialogs_tool_tab_tool_changed (GimpContext *context,
GimpToolInfo *tool_info,
GtkImage *image)
{
gtk_image_set_from_stock (image, tool_info->stock_id, image->icon_size);
gtk_image_set_from_stock (image,
GIMP_VIEWABLE (tool_info)->stock_id,
image->icon_size);
}
static GtkWidget *
......@@ -1244,13 +1290,15 @@ dialogs_tool_tab_func (GimpDockable *dockable,
GimpDockbook *dockbook,
GtkIconSize size)
{
GimpContext *context;
GtkWidget *image;
GimpContext *context;
GimpViewable *viewable;
GtkWidget *image;
context = dockbook->dock->context;
image = gtk_image_new_from_stock (gimp_context_get_tool (context)->stock_id,
size);
viewable = GIMP_VIEWABLE (gimp_context_get_tool (context));
image = gtk_image_new_from_stock (viewable->stock_id, size);
g_signal_connect_object (context, "tool_changed",
G_CALLBACK (dialogs_tool_tab_tool_changed),
......@@ -1268,7 +1316,9 @@ dialogs_tool_options_tool_changed (GimpContext *context,
GtkImage *image;
if ((image = g_object_get_data (G_OBJECT (label), "tool-icon")))
gtk_image_set_from_stock (image, tool_info->stock_id, image->icon_size);
gtk_image_set_from_stock (image,
GIMP_VIEWABLE (tool_info)->stock_id,
image->icon_size);
gtk_label_set_text (label, tool_info->blurb);
......@@ -1298,7 +1348,7 @@ dialogs_tool_options_tab_func (GimpDockable *dockable,
hbox = gtk_hbox_new (FALSE, 2);
image = gtk_image_new_from_stock (gimp_context_get_tool (context)->stock_id,
image = gtk_image_new_from_stock (GIMP_VIEWABLE (tool_info)->stock_id,
size);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
gtk_widget_show (image);
......
......@@ -153,7 +153,13 @@ GtkWidget * dialogs_color_editor_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_document_history_new (GimpDialogFactory *factory,
GtkWidget * dialogs_document_list_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_document_grid_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
GtkWidget * dialogs_document_tree_new (GimpDialogFactory *factory,
GimpContext *context,
gint preview_size);
......
......@@ -88,7 +88,7 @@ GimpItemFactoryEntry dialogs_menu_entries[] =
MENU_SEPARATOR ("/Add Tab/---"),
ADD_TAB (N_("/Add Tab/Images..."), "gimp-image-list", NULL, NULL),
ADD_TAB (N_("/Add Tab/Document History..."), "gimp-document-history",
ADD_TAB (N_("/Add Tab/Document History..."), "gimp-document-list",
"<StockItem>", GTK_STOCK_OPEN),
ADD_TAB (N_("/Add Tab/Error Console..."), "gimp-error-console",
"<StockItem>", GIMP_STOCK_WARNING),
......
......@@ -87,7 +87,9 @@ static const GimpDialogFactoryEntry dock_entries[] =
{ "gimp-color-editor", dialogs_color_editor_new, 0, FALSE, FALSE, FALSE, TRUE },
{ "gimp-document-history", dialogs_document_history_new, 48, FALSE, FALSE, FALSE, TRUE },
{ "gimp-document-list", dialogs_document_list_new, 48, FALSE, FALSE, FALSE, TRUE },
{ "gimp-document-grid", dialogs_document_grid_new, 48, FALSE, FALSE, FALSE, TRUE },
{ "gimp-document-tree", dialogs_document_tree_new, 48, FALSE, FALSE, FALSE, TRUE },
{ "gimp-brush-editor", dialogs_brush_editor_get, 0, TRUE, FALSE, FALSE, TRUE },
{ "gimp-gradient-editor", dialogs_gradient_editor_get, 0, TRUE, FALSE, FALSE, TRUE },
......
......@@ -572,6 +572,13 @@ static gboolean
gui_exit_finish_callback (Gimp *gimp,
gboolean kill_it)
{
g_signal_handlers_disconnect_by_func (gimp->config,
gui_show_tooltips_notify,
gimp);
gimp_container_remove_handler (gimp->images, image_disconnect_handler_id);
image_disconnect_handler_id = 0;
g_object_unref (toolbox_item_factory);
toolbox_item_factory = NULL;
......@@ -587,13 +594,6 @@ gui_exit_finish_callback (Gimp *gimp,
dialogs_exit (gimp);
gimp_devices_exit (gimp);
g_signal_handlers_disconnect_by_func (gimp->config,
gui_show_tooltips_notify,
gimp);
gimp_container_remove_handler (gimp->images, image_disconnect_handler_id);
image_disconnect_handler_id = 0;
if (themes_hash)
{
g_hash_table_destroy (themes_hash);
......
......@@ -762,7 +762,7 @@ GimpItemFactoryEntry image_menu_entries[] =
{ { N_("/Dialogs/Document History..."), "foo",
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GTK_STOCK_OPEN },
"gimp-document-history",
"gimp-document-list",
"dialogs/document_index.html", NULL },
{ { N_("/Dialogs/Error Console..."), NULL,
dialogs_create_dockable_cmd_callback, 0,
......@@ -860,7 +860,7 @@ image_menu_setup (GimpItemFactory *factory)
entry.entry.callback = tools_select_cmd_callback;
entry.entry.callback_action = 0;
entry.entry.item_type = "<StockItem>";
entry.entry.extra_data = tool_info->stock_id;
entry.entry.extra_data = GIMP_VIEWABLE (tool_info)->stock_id;
entry.quark_string = NULL;
entry.help_page = tool_info->help_data;
entry.description = NULL;
......
......@@ -173,7 +173,7 @@ GimpItemFactoryEntry toolbox_menu_entries[] =
{ { N_("/File/Dialogs/Document History..."), "foo",
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GTK_STOCK_OPEN },
"gimp-document-history",
"gimp-document-list",
"file/dialogs/document_index.html", NULL },
{ { N_("/File/Dialogs/Error Console..."), NULL,
dialogs_create_dockable_cmd_callback, 0,
......
......@@ -265,6 +265,11 @@ tree_items[] =
"sessions and can be destroyed with impunity."),
TREE_ITEM_MKDIR_ONLY, NULL
},
{
TRUE, "tool-options",
N_("This folder is used to store tool options."),
TREE_ITEM_MKDIR_ONLY, NULL
},
{
TRUE, "curves",
N_("This folder is used to store parameter files for the\n"
......
......@@ -762,7 +762,7 @@ GimpItemFactoryEntry image_menu_entries[] =
{ { N_("/Dialogs/Document History..."), "foo",
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GTK_STOCK_OPEN },
"gimp-document-history",
"gimp-document-list",
"dialogs/document_index.html", NULL },
{ { N_("/Dialogs/Error Console..."), NULL,
dialogs_create_dockable_cmd_callback, 0,
......@@ -860,7 +860,7 @@ image_menu_setup (GimpItemFactory *factory)
entry.entry.callback = tools_select_cmd_callback;
entry.entry.callback_action = 0;
entry.entry.item_type = "<StockItem>";
entry.entry.extra_data = tool_info->stock_id;
entry.entry.extra_data = GIMP_VIEWABLE (tool_info)->stock_id;
entry.quark_string = NULL;
entry.help_page = tool_info->help_data;
entry.description = NULL;
......
......@@ -173,7 +173,7 @@ GimpItemFactoryEntry toolbox_menu_entries[] =
{ { N_("/File/Dialogs/Document History..."), "foo",
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GTK_STOCK_OPEN },
"gimp-document-history",
"gimp-document-list",
"file/dialogs/document_index.html", NULL },
{ { N_("/File/Dialogs/Error Console..."), NULL,
dialogs_create_dockable_cmd_callback, 0,
......
......@@ -946,7 +946,7 @@ crop_info_create (GimpCropTool *crop)
crop->crop_info = info_dialog_new (NULL,
tool->tool_info->blurb,
GIMP_OBJECT (tool->tool_info)->name,
tool->tool_info->stock_id,
GIMP_VIEWABLE (tool->tool_info)->stock_id,
_("Crop & Resize Information"),
tool_manager_help_func, NULL);
......
......@@ -342,7 +342,7 @@ histogram_tool_dialog_new (GimpToolInfo *tool_info)
gimp_viewable_dialog_new (NULL,
tool_info->blurb,
GIMP_OBJECT (tool_info)->name,
tool_info->stock_id,
GIMP_VIEWABLE (tool_info)->stock_id,
_("View Image Histogram"),
tool_manager_help_func, NULL,
......
......@@ -203,7 +203,7 @@ gimp_image_map_tool_initialize (GimpTool *tool,
gimp_viewable_dialog_new (NULL,
tool_info->blurb,
GIMP_OBJECT (tool_info)->name,
tool_info->stock_id,
GIMP_VIEWABLE (tool_info)->stock_id,
image_map_tool->shell_desc,
tool_manager_help_func, NULL,
......
......@@ -383,7 +383,7 @@ gimp_measure_tool_button_press (GimpTool *tool,
measure_tool_info = info_dialog_new (NULL,
tool->tool_info->blurb,
GIMP_OBJECT (tool->tool_info)->name,
tool->tool_info->stock_id,
GIMP_VIEWABLE (tool->tool_info)->stock_id,
_("Measure Distances and Angles"),
tool_manager_help_func, NULL);
info_dialog_add_label (measure_tool_info, _("Distance:"), distance_buf);
......
......@@ -1099,14 +1099,17 @@ gimp_transform_tool_dialog (GimpTransformTool *tr_tool)
if (GIMP_TRANSFORM_TOOL_GET_CLASS (tr_tool)->dialog)
{
GimpToolInfo *tool_info;
gchar *stock_id;
tool_info = GIMP_TOOL (tr_tool)->tool_info;
stock_id = GIMP_VIEWABLE (tool_info)->stock_id;
tr_tool->info_dialog =
info_dialog_new (NULL,
tool_info->blurb,
GIMP_OBJECT (tool_info)->name,
tool_info->stock_id,
stock_id,
tr_tool->shell_desc,
tool_manager_help_func, NULL);
......@@ -1120,7 +1123,7 @@ gimp_transform_tool_dialog (GimpTransformTool *tr_tool)
transform_cancel_callback,
tr_tool, NULL, NULL, FALSE, TRUE,
tool_info->stock_id,
stock_id,
transform_ok_callback,
tr_tool, NULL, NULL, TRUE, FALSE,
......
......@@ -536,9 +536,6 @@ tool_manager_register_tool (GType tool_type,
GimpToolManager *tool_manager;
GimpToolInfo *tool_info;
const gchar *paint_core_name;
GtkIconSet *icon_set;
GtkStyle *style;
GdkPixbuf *pixbuf;
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (g_type_is_a (tool_type, GIMP_TYPE_TOOL));
......@@ -585,21 +582,6 @@ tool_manager_register_tool (GType tool_type,
paint_core_name = "GimpPaintbrush";
}
icon_set = gtk_icon_factory_lookup_default (stock_id);
#ifdef __GNUC__
#warning FIXME: remove gtk_widget_get_default_style()
#endif
style = gtk_widget_get_default_style ();
pixbuf = gtk_icon_set_render_icon (icon_set,
style,
GTK_TEXT_DIR_LTR,
GTK_STATE_NORMAL,
GTK_ICON_SIZE_BUTTON,
NULL,
NULL);
tool_manager = tool_manager_get (gimp);
tool_info = gimp_tool_info_new (gimp,
......@@ -614,10 +596,7 @@ tool_manager_register_tool (GType tool_type,
help_domain,
help_data,
paint_core_name,
stock_id,
pixbuf);
g_object_unref (pixbuf);
stock_id);
g_object_set_data (G_OBJECT (tool_info), "gimp-tool-options-gui-func",
options_gui_func);
......
......@@ -29,6 +29,8 @@ libappwidgets_a_sources = \
gimpbufferpreview.h \
gimpbufferview.c \
gimpbufferview.h \
gimpcellrendererviewable.c \
gimpcellrendererviewable.h \
gimpchannellistitem.c \
gimpchannellistitem.h \
gimpchannellistview.c \
......@@ -107,8 +109,6 @@ libappwidgets_a_sources = \
gimpimagedock.h \
gimpimageeditor.c \
gimpimageeditor.h \
gimpimagefilepreview.c \
gimpimagefilepreview.h \
gimpimagepreview.c \
gimpimagepreview.h \
gimpimageview.c \
......@@ -153,12 +153,8 @@ libappwidgets_a_sources = \
gimptoolbox-color-area.h \
gimptoolbox-indicator-area.c \
gimptoolbox-indicator-area.h \
gimptoolinfopreview.c \
gimptoolinfopreview.h \
gimpundoeditor.c \
gimpundoeditor.h \
gimpundopreview.c \
gimpundopreview.h \
gimpvectorslistview.c \
gimpvectorslistview.h \
gimpviewabledialog.c \
......
......@@ -37,12 +37,12 @@
static void gimp_brush_preview_class_init (GimpBrushPreviewClass *klass);
static void gimp_brush_preview_init (GimpBrushPreview *preview);
static void gimp_brush_preview_destroy (GtkObject *object);
static void gimp_brush_preview_render (GimpPreview *preview);
static GtkWidget * gimp_brush_preview_create_popup (GimpPreview *preview);
static gboolean gimp_brush_preview_needs_popup (GimpPreview *preview);
static void gimp_brush_preview_destroy (GtkObject *object);
static void gimp_brush_preview_render (GimpPreview *preview);
static GtkWidget * gimp_brush_preview_create_popup (GimpPreview *preview);
static gboolean gimp_brush_preview_needs_popup (GimpPreview *preview);
static gboolean gimp_brush_preview_render_timeout_func (GimpBrushPreview *preview);
static gboolean gimp_brush_preview_render_timeout (gpointer data);