Ported module loading to GTypeModule, getting rid of all own module

2002-10-20  Michael Natterer  <mitch@gimp.org>

	Ported module loading to GTypeModule, getting rid of all own
	module registering/bookkeeping stuff for color selectors and
	display filters. The modules now simply register GimpColorSelector
	and GimpColorDisplay subclasses, the list of registered subclasses
	can then be obtained calling g_type_children() on the abstract
	base classes.

	This is work in progress and just the first working state after I
	started breaking everything...

	* app/gui/color-select.[ch]
	* libgimp/gimpcolordisplay.h
	* libgimp/gimpcolorselector.h: removed.

	* app/gui/Makefile.am
	* libgimp/Makefile.am: changed accordingly.

	* libgimp/gimpmodule.h: massively simplified. All voodoo is gone.

	* libgimpwidgets/gimpcolordisplay.[ch]
	* libgimpwidgets/gimpcolorselector.[ch]: new abstract base classes
	which need to be subclassed by modules.

	* libgimpwidgets/gimpcolorselect.[ch]: the built-in color selector
	from app/gui/color-select.* ported to be a GimpColorSelector
	subclass.

	* libgimpwidgets/Makefile.am
	* libgimpwidgets/gimpwidgets.h
	* libgimpwidgets/gimpwidgetsmarshal.list
	* libgimpwidgets/gimpwidgetstypes.h: changed accordingly.

	* app/core/gimpmoduleinfo.[ch]: made it a GTypeModule subclass

	* app/core/gimpmodules.c: changed accordingly.

	* app/core/gimpcontainer.c
	* app/core/gimplist.c: HACKED around to allow GimpLists of
	GObjects (not GimpObjects). This is EEKy, so I will either make
	gimp->modules a simple GList and revert this bit of change, or
	allow GObjects all over the place in GimpContainer land...

	* app/display/gimpdisplayshell-filter.[ch]
	* app/gui/color-notebook.c: removed all module stuff and use
	g_type_children() to get the list of available color_selectors
	and display_filters.

	* app/display/gimpdisplayshell-filter-dialog.c
	* app/display/gimpdisplayshell-render.c
	* app/gui/module-browser.c: changed accordingly.

	* app/gui/gui.c: ref the built-in color selector's class before
	the modules are queried so it appears first in the list of
	GimpColorSelector's children.

	* modules/Makefile.am: build the water color selector again.

	* modules/cdisplay_gamma.c
	* modules/cdisplay_highcontrast.c
	* modules/colorsel_triangle.c
	* modules/colorsel_water.c: ported them all to the new API.

	* modules/gimpmodregister.[ch]: removed the old EMX module hack.
This commit is contained in:
Michael Natterer
2002-10-20 10:14:17 +00:00
committed by Michael Natterer
parent 921d265270
commit d7055a3351
47 changed files with 2813 additions and 5410 deletions

View File

@ -280,10 +280,11 @@ browser_load_unload_callback (GtkWidget *widget,
{
BrowserState *st = data;
if (st->last_update->state == GIMP_MODULE_STATE_LOADED_OK)
gimp_module_info_module_unload (st->last_update, FALSE);
else
gimp_module_info_module_load (st->last_update, FALSE);
if (st->last_update->state != GIMP_MODULE_STATE_LOADED_OK)
{
if (g_type_module_use (G_TYPE_MODULE (st->last_update)))
g_type_module_unuse (G_TYPE_MODULE (st->last_update));
}
gimp_module_info_modified (st->last_update);
}
@ -310,7 +311,7 @@ make_list_item (gpointer data,
gtk_list_store_append (st->list, &iter);
gtk_list_store_set (st->list, &iter,
PATH_COLUMN, info->fullpath,
PATH_COLUMN, info->filename,
INFO_COLUMN, info,
-1);
}
@ -444,8 +445,7 @@ browser_info_update (GimpModuleInfoObj *mod,
case GIMP_MODULE_STATE_LOADED_OK:
gtk_label_set_text (GTK_LABEL(st->button_label), _("Unload"));
gtk_widget_set_sensitive (GTK_WIDGET (st->button),
mod->unload ? TRUE : FALSE);
gtk_widget_set_sensitive (GTK_WIDGET (st->button), FALSE);
break;
}
}