Added preliminary support for image templates. Not finished yet. Addresses

2003-04-03  Michael Natterer  <mitch@gimp.org>

	Added preliminary support for image templates. Not finished
	yet. Addresses bug #96059. Now we need a volunteer to create
	a nice collection of default templates...

	* app/core/Makefile.am
	* app/core/core-types.h
	* app/core/gimptemplate.[ch]
	* app/core/gimp-templates.[ch]: new files implementing the new
	GimpTemplate object and the list of available image templates.

	* app/core/gimp.[ch]: keep a container of templates around.

	* app/core/gimpimage-new.[ch]: ported to use GimpTemplate. Removed
	struct GimpImageNewValues.

	* app/widgets/gimpcontainermenuimpl.c: changed to show the
	"(none)" item for a NULL selection also, not only for an empty
	container.

	* app/widgets/gimppropwidgets.[ch]: added
	gimp_prop_size_entry_connect() which connects an externally
	created GimpSizeEntry to object properties. Fixed the size entry
	code to actually work.

	* app/gui/image-menu.c
	* app/gui/file-commands.[ch]: added "Save as Template" which
	creates a new template from any image's properties.

	* app/gui/file-new-dialog.c: use prop_widgets and GimpTemplate.
	Offer the available templates in a menu at the top of the dialog.
This commit is contained in:
Michael Natterer
2003-04-03 17:50:56 +00:00
committed by Michael Natterer
parent 4865105f41
commit a018b06a96
24 changed files with 1338 additions and 835 deletions

View File

@ -181,9 +181,6 @@ gimp_container_menu_impl_insert_item (GimpContainerMenu *menu,
gtk_menu_reorder_child (GTK_MENU (menu),
GIMP_CONTAINER_MENU_IMPL (menu)->empty_item, -1);
if (g_list_length (GTK_MENU_SHELL (menu)->children) == 2)
gtk_widget_hide (GIMP_CONTAINER_MENU_IMPL (menu)->empty_item);
return (gpointer) menu_item;
}
@ -248,6 +245,7 @@ gimp_container_menu_impl_select_item (GimpContainerMenu *menu,
gpointer insert_data)
{
GtkWidget *menu_item;
gint index;
if (insert_data)
menu_item = GTK_WIDGET (insert_data);
@ -256,11 +254,19 @@ gimp_container_menu_impl_select_item (GimpContainerMenu *menu,
if (menu_item)
{
gint index;
gtk_widget_hide (GIMP_CONTAINER_MENU_IMPL (menu)->empty_item);
index = gimp_container_get_child_index (menu->container,
GIMP_OBJECT (viewable));
gimp_container_menu_impl_set_history (menu, index);
}
else
{
gtk_widget_show (GIMP_CONTAINER_MENU_IMPL (menu)->empty_item);
index = gimp_container_num_children (menu->container);
gimp_container_menu_impl_set_history (menu, index);
}
}