added "set_by_type", "get_by_type" and "changed_by_type" methods which

2001-02-07  Michael Natterer  <mitch@gimp.org>

	* app/gimpcontext.[ch]: added "set_by_type", "get_by_type" and
	"changed_by_type" methods which take a GtkType and decide from
	that if to manipulate the Brush, Pattern etc.

	* app/gimpcontainerview.[ch]
	* app/gimpcontainergridview.[ch]
	* app/gimpcontainerlistview.[ch]: added a GimpContext to the views
	which is used to manage the active item.

	* app/commands.c: pass the user_context to the test views.

	* app/gimpbrushpreview.c
	* app/gimppatternpreview.c
	* app/gimppreview.[ch]: added a virtual "needs_popup" method which
	returns a boolen indicating if the viewable is already fully
	visible.

	* app/gimage.[ch]: removed gimage_foreach() and some other
	functions which can easily be done be gimp_container_foreach().
	Removed gimage_delete().

	* app/fileops.c
	* app/gdisplay.c
	* app/lc_dialog.c
	* app/nav_window.c
	* app/palette_import.c
	* app/preferences_dialog.c
	* app/xcf.c
	* app/pdb/image_cmds.c
	* tools/pdbgen/pdb/image.pdb: changed accordingly. Switched from
	"disp_count" refcounting to real GtkObject refcounting for
	GimpImages.
This commit is contained in:
Michael Natterer
2001-02-07 15:01:52 +00:00
committed by Michael Natterer
parent 3675004ef6
commit c827d40a2c
57 changed files with 1693 additions and 532 deletions

View File

@ -29,6 +29,7 @@
#include "context_manager.h"
#include "gimage.h"
#include "gimpcontainer.h"
#include "gimpcontext.h"
#include "gimpimage.h"
#include "gimppalette.h"
@ -45,16 +46,14 @@
#include "libgimp/gimpintl.h"
/* New palette code... */
#define IMPORT_PREVIEW_WIDTH 80
#define IMPORT_PREVIEW_HEIGHT 80
#define MAX_IMAGE_COLORS (10000*2)
#define MAX_IMAGE_COLORS (10000 * 2)
typedef enum
{
GRAD_IMPORT = 0,
IMAGE_IMPORT = 1,
GRAD_IMPORT = 0,
IMAGE_IMPORT = 1,
INDEXED_IMPORT = 2
} ImportType;
@ -317,11 +316,15 @@ palette_import_image_menu_activate (gint redo,
/* Get list of images */
if (import_dialog->import_type == INDEXED_IMPORT)
{
gimage_foreach (palette_import_gimlist_indexed_cb, &list);
gimp_container_foreach (image_context,
palette_import_gimlist_indexed_cb,
&list);
}
else
{
gimage_foreach (palette_import_gimlist_cb, &list);
gimp_container_foreach (image_context,
palette_import_gimlist_cb,
&list);
}
num_images = g_slist_length (list);
@ -445,11 +448,15 @@ palette_import_image_count (ImportType type)
if (type == INDEXED_IMPORT)
{
gimage_foreach (palette_import_gimlist_indexed_cb, &list);
gimp_container_foreach (image_context,
palette_import_gimlist_indexed_cb,
&list);
}
else
{
gimage_foreach (palette_import_gimlist_cb, &list);
gimp_container_foreach (image_context,
palette_import_gimlist_cb,
&list);
}
num_images = g_slist_length (list);