app/core/gimp.c app/core/gimpdocuments.c app/core/gimpmodules.c fixed some

2002-01-31  Michael Natterer  <mitch@gimp.org>

	* app/core/gimp.c
	* app/core/gimpdocuments.c
	* app/core/gimpmodules.c
	* app/core/gimppalette.c: fixed some get_memsize()
	implementations, give useful names to some global objects so the
	new mem profile of "the_gimp" looks nicer.

	* app/gui/menus.c
	* app/gui/commands.[ch]: added a "Debug" menu to the toolbox,
	offer a mem profile of the global "Gimp" instance.
This commit is contained in:
Michael Natterer 2002-01-31 18:02:38 +00:00 committed by Michael Natterer
parent 65d3b34d15
commit c1f00274b4
11 changed files with 40 additions and 6 deletions

View File

@ -1,3 +1,16 @@
2002-01-31 Michael Natterer <mitch@gimp.org>
* app/core/gimp.c
* app/core/gimpdocuments.c
* app/core/gimpmodules.c
* app/core/gimppalette.c: fixed some get_memsize()
implementations, give useful names to some global objects so the
new mem profile of "the_gimp" looks nicer.
* app/gui/menus.c
* app/gui/commands.[ch]: added a "Debug" menu to the toolbox,
offer a mem profile of the global "Gimp" instance.
2002-01-31 Michael Natterer <mitch@gimp.org>
* app/core/gimplayer.[ch]: removed gimp_layer_has_alpha(), use

View File

@ -45,6 +45,7 @@ gimp_documents_init (Gimp *gimp)
gimp->documents = gimp_list_new (GIMP_TYPE_IMAGEFILE,
GIMP_CONTAINER_POLICY_STRONG);
gimp_object_set_name (GIMP_OBJECT (gimp->documents), "documents");
}
void

View File

@ -76,6 +76,8 @@ gimp_modules_init (Gimp *gimp)
gimp->modules = gimp_list_new (GIMP_TYPE_MODULE_INFO,
GIMP_CONTAINER_POLICY_WEAK);
gimp_object_set_name (GIMP_OBJECT (gimp->modules), "modules");
gimp->write_modulerc = FALSE;
}

View File

@ -144,6 +144,8 @@ gimp_init (Gimp *gimp)
gimp->images = gimp_list_new (GIMP_TYPE_IMAGE,
GIMP_CONTAINER_POLICY_WEAK);
gimp_object_set_name (GIMP_OBJECT (gimp->images), "images");
gimp->next_image_ID = 1;
gimp->next_guide_ID = 1;
gimp->image_table = g_hash_table_new (g_direct_hash, NULL);
@ -154,6 +156,8 @@ gimp_init (Gimp *gimp)
gimp->global_buffer = NULL;
gimp->named_buffers = gimp_list_new (GIMP_TYPE_BUFFER,
GIMP_CONTAINER_POLICY_STRONG);
gimp_object_set_name (GIMP_OBJECT (gimp->named_buffers), "named buffers");
gimp->brush_factory = NULL;
gimp->pattern_factory = NULL;
gimp->gradient_factory = NULL;
@ -168,6 +172,8 @@ gimp_init (Gimp *gimp)
gimp->tool_info_list = gimp_list_new (GIMP_TYPE_TOOL_INFO,
GIMP_CONTAINER_POLICY_STRONG);
gimp_object_set_name (GIMP_OBJECT (gimp->tool_info_list), "tool infos");
gimp->standard_tool_info = NULL;
gimp_documents_init (gimp);
@ -341,8 +347,10 @@ gimp_get_memsize (GimpObject *object)
memsize += (g_hash_table_size (gimp->drawable_table) *
3 * sizeof (gpointer)); /* FIXME */
memsize += (gimp_object_get_memsize (GIMP_OBJECT (gimp->global_buffer)) +
gimp_object_get_memsize (GIMP_OBJECT (gimp->named_buffers)) +
if (gimp->global_buffer)
memsize += gimp_object_get_memsize (GIMP_OBJECT (gimp->global_buffer));
memsize += (gimp_object_get_memsize (GIMP_OBJECT (gimp->named_buffers)) +
gimp_object_get_memsize (GIMP_OBJECT (gimp->brush_factory)) +
gimp_object_get_memsize (GIMP_OBJECT (gimp->pattern_factory)) +
gimp_object_get_memsize (GIMP_OBJECT (gimp->gradient_factory)) +
@ -367,7 +375,7 @@ gimp_get_memsize (GimpObject *object)
gimp_object_get_memsize (GIMP_OBJECT (gimp->default_context)) +
gimp_object_get_memsize (GIMP_OBJECT (gimp->user_context)));
return memsize = GIMP_OBJECT_CLASS (parent_class)->get_memsize (object);
return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object);
}
Gimp *
@ -429,6 +437,7 @@ gimp_initialize (Gimp *gimp,
G_N_ELEMENTS (brush_loader_entries),
gimp_brush_new,
gimp_brush_get_standard);
gimp_object_set_name (GIMP_OBJECT (gimp->brush_factory), "brush factory");
gimp->pattern_factory =
gimp_data_factory_new (GIMP_TYPE_PATTERN,
@ -437,6 +446,7 @@ gimp_initialize (Gimp *gimp,
G_N_ELEMENTS (pattern_loader_entries),
gimp_pattern_new,
gimp_pattern_get_standard);
gimp_object_set_name (GIMP_OBJECT (gimp->pattern_factory), "pattern factory");
gimp->gradient_factory =
gimp_data_factory_new (GIMP_TYPE_GRADIENT,
@ -445,6 +455,7 @@ gimp_initialize (Gimp *gimp,
G_N_ELEMENTS (gradient_loader_entries),
gimp_gradient_new,
gimp_gradient_get_standard);
gimp_object_set_name (GIMP_OBJECT (gimp->gradient_factory), "gradient factory");
gimp->palette_factory =
gimp_data_factory_new (GIMP_TYPE_PALETTE,
@ -453,6 +464,7 @@ gimp_initialize (Gimp *gimp,
G_N_ELEMENTS (palette_loader_entries),
gimp_palette_new,
gimp_palette_get_standard);
gimp_object_set_name (GIMP_OBJECT (gimp->palette_factory), "palette factory");
gimp_image_new_init (gimp);

View File

@ -45,6 +45,7 @@ gimp_documents_init (Gimp *gimp)
gimp->documents = gimp_list_new (GIMP_TYPE_IMAGEFILE,
GIMP_CONTAINER_POLICY_STRONG);
gimp_object_set_name (GIMP_OBJECT (gimp->documents), "documents");
}
void

View File

@ -45,6 +45,7 @@ gimp_documents_init (Gimp *gimp)
gimp->documents = gimp_list_new (GIMP_TYPE_IMAGEFILE,
GIMP_CONTAINER_POLICY_STRONG);
gimp_object_set_name (GIMP_OBJECT (gimp->documents), "documents");
}
void

View File

@ -76,6 +76,8 @@ gimp_modules_init (Gimp *gimp)
gimp->modules = gimp_list_new (GIMP_TYPE_MODULE_INFO,
GIMP_CONTAINER_POLICY_WEAK);
gimp_object_set_name (GIMP_OBJECT (gimp->modules), "modules");
gimp->write_modulerc = FALSE;
}

View File

@ -165,7 +165,7 @@ gimp_palette_get_memsize (GimpObject *object)
memsize += strlen (entry->name) + 1;
}
return memsize += GIMP_OBJECT_CLASS (parent_class)->get_memsize (object);
return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object);
}
static TempBuf *

View File

@ -165,7 +165,7 @@ gimp_palette_get_memsize (GimpObject *object)
memsize += strlen (entry->name) + 1;
}
return memsize += GIMP_OBJECT_CLASS (parent_class)->get_memsize (object);
return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object);
}
static TempBuf *

View File

@ -165,7 +165,7 @@ gimp_palette_get_memsize (GimpObject *object)
memsize += strlen (entry->name) + 1;
}
return memsize += GIMP_OBJECT_CLASS (parent_class)->get_memsize (object);
return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object);
}
static TempBuf *

View File

@ -76,6 +76,8 @@ gimp_modules_init (Gimp *gimp)
gimp->modules = gimp_list_new (GIMP_TYPE_MODULE_INFO,
GIMP_CONTAINER_POLICY_WEAK);
gimp_object_set_name (GIMP_OBJECT (gimp->modules), "modules");
gimp->write_modulerc = FALSE;
}