diff --git a/ChangeLog b/ChangeLog index b328fc19e9..309443d661 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2000-05-28 Michael Natterer + + * libgimp/gimp.h + * libgimp/gimpcolordisplay.h + * libgimp/gimpcolorselector.h + * libgimp/gimpmatrix.h + * libgimp/gimpmodule.h + * libgimp/gimpunit_pdb.c: purely cosmetic stuff and added some + typedefs to make the html documentation nicer. Moved the module + documentation from the headers to the sgml files. + + * app/module_db.[ch]: The type of the "init" and "unload" functions + has changed. Code cleanup. + 2000-05-27 Sven Neumann * app/color_select.c: use spinbuttons in the GIMP diff --git a/app/dialogs/module-dialog.c b/app/dialogs/module-dialog.c index d968db297c..0ceccd6fb2 100644 --- a/app/dialogs/module-dialog.c +++ b/app/dialogs/module-dialog.c @@ -41,12 +41,15 @@ #include "libgimp/gimpenv.h" #include "libgimp/gimpmodule.h" + #include "libgimp/gimpintl.h" -/* export this to gimprc.c */ -char *module_db_load_inhibit = NULL; -typedef enum { +/* export this to gimprc.c */ +gchar *module_db_load_inhibit = NULL; + +typedef enum +{ ST_MODULE_ERROR, /* missing module_load function or other error */ ST_LOADED_OK, /* happy and running (normal state of affairs) */ ST_LOAD_FAILED, /* module_load returned GIMP_MODULE_UNLOAD */ @@ -54,7 +57,8 @@ typedef enum { ST_UNLOADED_OK /* callback arrived, module not in memory anymore */ } module_state; -static const char * const statename[] = { +static const gchar * const statename[] = +{ N_("Module error"), N_("Loaded OK"), N_("Load failed"), @@ -63,68 +67,76 @@ static const char * const statename[] = { }; #ifdef __EMX__ -extern void gimp_color_selector_register(); -extern void gimp_color_selector_unregister(); -extern void gimp_color_display_register(); -extern void gimp_color_display_unregister(); -extern void dialog_register(); -extern void dialog_unregister(); +extern void gimp_color_selector_register (); +extern void gimp_color_selector_unregister (); +extern void gimp_color_display_register (); +extern void gimp_color_display_unregister (); +extern void dialog_register (); +extern void dialog_unregister (); -static struct main_funcs_struc { +static struct main_funcs_struc +{ gchar *name; - void (*func)(); + void (*func) (); } -gimp_main_funcs[] = { - { "gimp_color_selector_register", gimp_color_selector_register }, +gimp_main_funcs[] = +{ + { "gimp_color_selector_register", gimp_color_selector_register }, { "gimp_color_selector_unregister", gimp_color_selector_unregister }, - { "gimp_color_display_register", gimp_color_display_register }, - { "gimp_color_display_unregister", gimp_color_display_unregister }, - { "dialog_register", dialog_register }, - { "dialog_unregister", dialog_unregister }, + { "gimp_color_display_register", gimp_color_display_register }, + { "gimp_color_display_unregister", gimp_color_display_unregister }, + { "dialog_register", dialog_register }, + { "dialog_unregister", dialog_unregister }, { NULL, NULL } }; #endif /* one of these objects is kept per-module */ -typedef struct { +typedef struct +{ GtkObject object; + gchar *fullpath; /* path to the module */ module_state state; /* what's happened to the module */ gboolean ondisk; /* TRUE if file still exists */ gboolean load_inhibit; /* user requests not to load at boot time */ gint refs; /* how many time we're running in the module */ + /* stuff from now on may be NULL depending on the state the module is in */ GimpModuleInfo *info; /* returned values from module_init */ GModule *module; /* handle on the module */ gchar *last_module_error; - GimpModuleInitFunc *init; - GimpModuleUnloadFunc *unload; -} module_info; + + GimpModuleInitFunc init; + GimpModuleUnloadFunc unload; +} ModuleInfo; static guint module_info_get_type (void); + #define MODULE_INFO_TYPE module_info_get_type() -#define MODULE_INFO(obj) GTK_CHECK_CAST (obj, MODULE_INFO_TYPE, module_info) +#define MODULE_INFO(obj) GTK_CHECK_CAST (obj, MODULE_INFO_TYPE, ModuleInfo) #define IS_MODULE_INFO(obj) GTK_CHECK_TYPE (obj, MODULE_INFO_TYPE) #define NUM_INFO_LINES 7 -typedef struct { - GtkWidget *table; - GtkWidget *label[NUM_INFO_LINES]; - GtkWidget *button_label; - module_info *last_update; - GtkWidget *button; - GtkWidget *list; - GtkWidget *load_inhibit_check; -} browser_st; +typedef struct +{ + GtkWidget *table; + GtkWidget *label[NUM_INFO_LINES]; + GtkWidget *button_label; + ModuleInfo *last_update; + GtkWidget *button; + GtkWidget *list; + GtkWidget *load_inhibit_check; +} BrowserState; /* global set of module_info pointers */ -static GimpSet *modules; -static GimpSetHandlerId modules_handler; +static GimpSet *modules; +static GimpSetHandlerId modules_handler; /* If the inhibit state of any modules changes, we might need to * re-write the modulerc. */ @@ -146,26 +158,43 @@ static gboolean need_to_rewrite_modulerc = FALSE; /* prototypes */ -static void module_initialize (char *filename); -static void mod_load (module_info *mod, gboolean verbose); -static void mod_unload (module_info *mod, gboolean verbose); -static module_info *module_find_by_path (const char *fullpath); -#ifdef DUMP_DB -static void print_module_info (gpointer data, gpointer user_data); -#endif -static void browser_popdown_callback (GtkWidget *w, gpointer client_data); -static void browser_destroy_callback (GtkWidget *w, gpointer client_data); -static void browser_info_update (module_info *, browser_st *); -static void browser_info_add (GimpSet *, module_info *, browser_st *); -static void browser_info_remove (GimpSet *, module_info *, browser_st *); -static void browser_info_init (browser_st *st, GtkWidget *table); -static void browser_select_callback (GtkWidget *widget, GtkWidget *child); -static void browser_load_unload_callback (GtkWidget *widget, gpointer data); -static void browser_refresh_callback (GtkWidget *widget, gpointer data); -static void make_list_item (gpointer data, gpointer user_data); +static void module_initialize (gchar *filename); +static void mod_load (ModuleInfo *mod, + gboolean verbose); +static void mod_unload (ModuleInfo *mod, + gboolean verbose); +static ModuleInfo * module_find_by_path (const gchar *fullpath); -static void gimp_module_ref (module_info *mod); -static void gimp_module_unref (module_info *mod); +#ifdef DUMP_DB +static void print_module_info (gpointer data, + gpointer user_data); +#endif + +static void browser_popdown_callback (GtkWidget *widget, + gpointer data); +static void browser_destroy_callback (GtkWidget *widget, + gpointer data); +static void browser_info_update (ModuleInfo *mod, + BrowserState *st); +static void browser_info_add (GimpSet *set, + ModuleInfo *mod, + BrowserState *st); +static void browser_info_remove (GimpSet *set, + ModuleInfo *mod, + BrowserState *st); +static void browser_info_init (BrowserState *st, + GtkWidget *table); +static void browser_select_callback (GtkWidget *widget, + GtkWidget *child); +static void browser_load_unload_callback (GtkWidget *widget, + gpointer data); +static void browser_refresh_callback (GtkWidget *widget, + gpointer data); +static void make_list_item (gpointer data, + gpointer user_data); + +static void gimp_module_ref (ModuleInfo *mod); +static void gimp_module_unref (ModuleInfo *mod); @@ -175,7 +204,7 @@ static void gimp_module_unref (module_info *mod); void module_db_init (void) { - char *filename; + gchar *filename; /* load the modulerc file */ filename = gimp_personal_rc_file ("modulerc"); @@ -198,7 +227,7 @@ static void free_a_single_module (gpointer data, gpointer user_data) { - module_info *mod = data; + ModuleInfo *mod = data; if (mod->module && mod->unload && mod->state == ST_LOADED_OK) { @@ -210,8 +239,8 @@ static void add_to_inhibit_string (gpointer data, gpointer user_data) { - module_info *mod = data; - GString *str = user_data; + ModuleInfo *mod = data; + GString *str = user_data; if (mod->load_inhibit) { @@ -224,11 +253,11 @@ add_to_inhibit_string (gpointer data, static gboolean module_db_write_modulerc (void) { - GString *str; - gchar *p; - char *filename; - FILE *fp; - gboolean saved = FALSE; + GString *str; + gchar *p; + gchar *filename; + FILE *fp; + gboolean saved = FALSE; str = g_string_new (NULL); gimp_set_foreach (modules, add_to_inhibit_string, str); @@ -256,12 +285,12 @@ void module_db_free (void) { if (need_to_rewrite_modulerc) - { + { if (module_db_write_modulerc ()) - { + { need_to_rewrite_modulerc = FALSE; - } - } + } + } gimp_set_foreach (modules, free_a_single_module, NULL); } @@ -274,7 +303,7 @@ module_db_browser_new (void) GtkWidget *vbox; GtkWidget *listbox; GtkWidget *button; - browser_st *st; + BrowserState *st; shell = gimp_dialog_new (_("Module DB"), "module_db_dialog", gimp_standard_help_func, @@ -300,7 +329,7 @@ module_db_browser_new (void) gtk_widget_set_usize (listbox, 125, 100); gtk_widget_show (listbox); - st = g_new0 (browser_st, 1); + st = g_new0 (BrowserState, 1); st->list = gtk_list_new (); gtk_list_set_selection_mode (GTK_LIST (st->list), GTK_SELECTION_BROWSE); @@ -361,14 +390,16 @@ module_db_browser_new (void) /**************************************************************/ -/* module_info object glue */ +/* ModuleInfo object glue */ -typedef struct { +typedef struct +{ GtkObjectClass parent_class; -} module_infoClass; +} ModuleInfoClass; -enum { +enum +{ MODIFIED, LAST_SIGNAL }; @@ -378,7 +409,7 @@ static guint module_info_signals[LAST_SIGNAL]; static void module_info_destroy (GtkObject *object) { - module_info *mod = MODULE_INFO (object); + ModuleInfo *mod = MODULE_INFO (object); /* if this trips, then we're onto some serious lossage in a moment */ g_return_if_fail (mod->refs == 0); @@ -389,25 +420,25 @@ module_info_destroy (GtkObject *object) } static void -module_info_class_init (module_infoClass *klass) +module_info_class_init (ModuleInfoClass *klass) { GtkObjectClass *object_class; GtkType type; - object_class = GTK_OBJECT_CLASS(klass); + object_class = GTK_OBJECT_CLASS (klass); type = object_class->type; object_class->destroy = module_info_destroy; module_info_signals[MODIFIED] = - gimp_signal_new ("modified", 0, type, 0, gimp_sigtype_void); + gimp_signal_new ("modified", 0, type, 0, gimp_sigtype_void); - gtk_object_class_add_signals(object_class, module_info_signals, LAST_SIGNAL); + gtk_object_class_add_signals (object_class, module_info_signals, LAST_SIGNAL); } static void -module_info_init (module_info *mod) +module_info_init (ModuleInfo *mod) { /* don't need to do anything */ } @@ -421,9 +452,9 @@ module_info_get_type (void) { static const GtkTypeInfo module_info_info = { - "module_info", - sizeof (module_info), - sizeof (module_infoClass), + "ModuleInfo", + sizeof (ModuleInfo), + sizeof (ModuleInfoClass), (GtkClassInitFunc) module_info_class_init, (GtkObjectInitFunc) module_info_init, /* reserved_1 */ NULL, @@ -431,8 +462,8 @@ module_info_get_type (void) (GtkClassInitFunc) NULL, }; - module_info_type = gtk_type_unique (gtk_object_get_type(), - &module_info_info); + module_info_type = + gtk_type_unique (gtk_object_get_type (), &module_info_info); } return module_info_type; @@ -441,19 +472,19 @@ module_info_get_type (void) /* exported API: */ static void -module_info_modified (module_info *mod) +module_info_modified (ModuleInfo *mod) { gtk_signal_emit (GTK_OBJECT (mod), module_info_signals[MODIFIED]); } -static module_info * +static ModuleInfo * module_info_new (void) { return MODULE_INFO (gtk_type_new (module_info_get_type ())); } static void -module_info_free (module_info *mod) +module_info_free (ModuleInfo *mod) { gtk_object_unref (GTK_OBJECT (mod)); } @@ -465,10 +496,10 @@ module_info_free (module_info *mod) /* name must be of the form lib*.so (Unix) or *.dll (Win32) */ static gboolean -valid_module_name (const char *filename) +valid_module_name (const gchar *filename) { - const char *basename; - int len; + const gchar *basename; + gint len; basename = g_basename (filename); @@ -496,12 +527,13 @@ valid_module_name (const char *filename) static gboolean -module_inhibited (const char *fullpath, - const char *inhibit_list) +module_inhibited (const gchar *fullpath, + const gchar *inhibit_list) { - char *p; - int pathlen; - const char *start, *end; + gchar *p; + gint pathlen; + const gchar *start; + const gchar *end; /* common case optimisation: the list is empty */ if (!inhibit_list || *inhibit_list == '\000') @@ -531,9 +563,9 @@ module_inhibited (const char *fullpath, static void -module_initialize (char *filename) +module_initialize (gchar *filename) { - module_info *mod; + ModuleInfo *mod; if (!valid_module_name (filename)) return; @@ -581,8 +613,8 @@ module_initialize (char *filename) } static void -mod_load (module_info *mod, - gboolean verbose) +mod_load (ModuleInfo *mod, + gboolean verbose) { gpointer symbol; @@ -632,12 +664,12 @@ mod_load (module_info *mod, mod->info = NULL; gimp_module_ref (mod); /* loaded modules are assumed to have a ref of 1 */ if (mod->init (&mod->info) == GIMP_MODULE_UNLOAD) - { - mod->state = ST_LOAD_FAILED; - gimp_module_unref (mod); - mod->info = NULL; - return; - } + { + mod->state = ST_LOAD_FAILED; + gimp_module_unref (mod); + mod->info = NULL; + return; + } /* module is now happy */ mod->state = ST_LOADED_OK; @@ -648,14 +680,13 @@ mod_load (module_info *mod, mod->unload = symbol; else mod->unload = NULL; - } static void mod_unload_completed_callback (void *data) { - module_info *mod = data; + ModuleInfo *mod = data; g_return_if_fail (mod->state == ST_UNLOAD_REQUESTED); @@ -672,8 +703,8 @@ mod_unload_completed_callback (void *data) } static void -mod_unload (module_info *mod, - gboolean verbose) +mod_unload (ModuleInfo *mod, + gboolean verbose) { g_return_if_fail (mod->module != NULL); g_return_if_fail (mod->unload != NULL); @@ -694,31 +725,30 @@ mod_unload (module_info *mod, } - #ifdef DUMP_DB static void print_module_info (gpointer data, gpointer user_data) { - module_info *i = data; + ModuleInfo *i = data; - printf ("\n%s: %s\n", - i->fullpath, statename[i->state]); - printf (" module:%p lasterr:%s init:%p unload:%p\n", - i->module, i->last_module_error? i->last_module_error : "NONE", - i->init, i->unload); + g_print ("\n%s: %s\n", + i->fullpath, statename[i->state]); + g_print (" module:%p lasterr:%s init:%p unload:%p\n", + i->module, i->last_module_error? i->last_module_error : "NONE", + i->init, i->unload); if (i->info) - { - printf (" shutdown_data: %p\n" - " purpose: %s\n" - " author: %s\n" - " version: %s\n" - " copyright: %s\n" - " date: %s\n", - i->info->shutdown_data, - i->info->purpose, i->info->author, i->info->version, - i->info->copyright, i->info->date); - } + { + g_print (" shutdown_data: %p\n" + " purpose: %s\n" + " author: %s\n" + " version: %s\n" + " copyright: %s\n" + " date: %s\n", + i->info->shutdown_data, + i->info->purpose, i->info->author, i->info->version, + i->info->copyright, i->info->date); + } } #endif @@ -728,31 +758,31 @@ print_module_info (gpointer data, /* UI functions */ static void -browser_popdown_callback (GtkWidget *w, - gpointer client_data) +browser_popdown_callback (GtkWidget *widget, + gpointer data) { - gtk_widget_destroy (GTK_WIDGET (client_data)); + gtk_widget_destroy (GTK_WIDGET (data)); } static void -browser_destroy_callback (GtkWidget *w, - gpointer client_data) +browser_destroy_callback (GtkWidget *widget, + gpointer data) { - gtk_signal_disconnect_by_data (GTK_OBJECT (modules), client_data); + gtk_signal_disconnect_by_data (GTK_OBJECT (modules), data); gimp_set_remove_handler (modules, modules_handler); - g_free (client_data); + g_free (data); } static void -browser_load_inhibit_callback (GtkWidget *w, +browser_load_inhibit_callback (GtkWidget *widget, gpointer data) { - browser_st *st = data; + BrowserState *st = data; gboolean new_value; g_return_if_fail (st->last_update != NULL); - new_value = ! GTK_TOGGLE_BUTTON (w)->active; + new_value = ! GTK_TOGGLE_BUTTON (widget)->active; if (new_value == st->last_update->load_inhibit) return; @@ -764,59 +794,58 @@ browser_load_inhibit_callback (GtkWidget *w, } static void -browser_info_update (module_info *mod, - browser_st *st) +browser_info_update (ModuleInfo *mod, + BrowserState *st) { - int i; - const char *text[NUM_INFO_LINES - 1]; - char *status; + gint i; + const gchar *text[NUM_INFO_LINES - 1]; + gchar *status; /* only update the info if we're actually showing it */ if (mod != st->last_update) return; if (!mod) - { - for (i=0; i < NUM_INFO_LINES; i++) - gtk_label_set_text (GTK_LABEL (st->label[i]), ""); - gtk_label_set_text (GTK_LABEL(st->button_label), _("")); - gtk_widget_set_sensitive (GTK_WIDGET (st->button), FALSE); - gtk_widget_set_sensitive (GTK_WIDGET (st->load_inhibit_check), FALSE); - return; - } + { + for (i=0; i < NUM_INFO_LINES; i++) + gtk_label_set_text (GTK_LABEL (st->label[i]), ""); + gtk_label_set_text (GTK_LABEL(st->button_label), _("")); + gtk_widget_set_sensitive (GTK_WIDGET (st->button), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (st->load_inhibit_check), FALSE); + return; + } if (mod->info) - { - text[0] = mod->info->purpose; - text[1] = mod->info->author; - text[2] = mod->info->version; - text[3] = mod->info->copyright; - text[4] = mod->info->date; - text[5] = mod->ondisk? _("on disk") : _("only in memory"); - } + { + text[0] = mod->info->purpose; + text[1] = mod->info->author; + text[2] = mod->info->version; + text[3] = mod->info->copyright; + text[4] = mod->info->date; + text[5] = mod->ondisk? _("on disk") : _("only in memory"); + } else - { - text[0] = "--"; - text[1] = "--"; - text[2] = "--"; - text[3] = "--"; - text[4] = "--"; - text[5] = mod->ondisk? _("on disk") : _("nowhere (click 'refresh')"); - } - + { + text[0] = "--"; + text[1] = "--"; + text[2] = "--"; + text[3] = "--"; + text[4] = "--"; + text[5] = mod->ondisk? _("on disk") : _("nowhere (click 'refresh')"); + } if (mod->state == ST_MODULE_ERROR && mod->last_module_error) status = g_strdup_printf ("%s (%s)", gettext (statename[mod->state]), mod->last_module_error); else - { - status = g_strdup (gettext (statename[mod->state])); - } + { + status = g_strdup (gettext (statename[mod->state])); + } for (i=0; i < NUM_INFO_LINES - 1; i++) - { - gtk_label_set_text (GTK_LABEL (st->label[i]), gettext (text[i])); - } + { + gtk_label_set_text (GTK_LABEL (st->label[i]), gettext (text[i])); + } gtk_label_set_text (GTK_LABEL (st->label[NUM_INFO_LINES-1]), status); @@ -827,33 +856,36 @@ browser_info_update (module_info *mod, gtk_widget_set_sensitive (GTK_WIDGET (st->load_inhibit_check), TRUE); /* work out what the button should do (if anything) */ - switch (mod->state) { - case ST_MODULE_ERROR: - case ST_LOAD_FAILED: - case ST_UNLOADED_OK: - gtk_label_set_text (GTK_LABEL(st->button_label), _("Load")); - gtk_widget_set_sensitive (GTK_WIDGET (st->button), mod->ondisk); - break; + switch (mod->state) + { + case ST_MODULE_ERROR: + case ST_LOAD_FAILED: + case ST_UNLOADED_OK: + gtk_label_set_text (GTK_LABEL(st->button_label), _("Load")); + gtk_widget_set_sensitive (GTK_WIDGET (st->button), mod->ondisk); + break; - case ST_UNLOAD_REQUESTED: - gtk_widget_set_sensitive (GTK_WIDGET (st->button), FALSE); - break; + case ST_UNLOAD_REQUESTED: + gtk_widget_set_sensitive (GTK_WIDGET (st->button), FALSE); + break; - case ST_LOADED_OK: - gtk_label_set_text (GTK_LABEL(st->button_label), _("Unload")); - gtk_widget_set_sensitive (GTK_WIDGET (st->button), - mod->unload? TRUE : FALSE); - break; - } + case ST_LOADED_OK: + gtk_label_set_text (GTK_LABEL(st->button_label), _("Unload")); + gtk_widget_set_sensitive (GTK_WIDGET (st->button), + mod->unload? TRUE : FALSE); + break; + } } static void -browser_info_init (browser_st *st, - GtkWidget *table) +browser_info_init (BrowserState *st, + GtkWidget *table) { GtkWidget *label; - int i; - char *text[] = { + gint i; + + gchar *text[] = + { N_("Purpose:"), N_("Author:"), N_("Version:"), @@ -864,22 +896,22 @@ browser_info_init (browser_st *st, }; for (i=0; i < sizeof(text) / sizeof(char *); i++) - { - label = gtk_label_new (gettext (text[i])); - gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); - gtk_table_attach (GTK_TABLE (table), label, 0, 1, i, i+1, - GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 2); - gtk_widget_show (label); + { + label = gtk_label_new (gettext (text[i])); + gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, i, i+1, + GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 2); + gtk_widget_show (label); - st->label[i] = gtk_label_new (""); - gtk_misc_set_alignment (GTK_MISC (st->label[i]), 0.0, 0.5); - gtk_table_attach (GTK_TABLE (st->table), st->label[i], 1, 2, i, i+1, - GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 2); - gtk_widget_show (st->label[i]); - } + st->label[i] = gtk_label_new (""); + gtk_misc_set_alignment (GTK_MISC (st->label[i]), 0.0, 0.5); + gtk_table_attach (GTK_TABLE (st->table), st->label[i], 1, 2, i, i+1, + GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 2); + gtk_widget_show (st->label[i]); + } st->load_inhibit_check = - gtk_check_button_new_with_label (_("Autoload during startup")); + gtk_check_button_new_with_label (_("Autoload during startup")); gtk_widget_show (st->load_inhibit_check); gtk_table_attach (GTK_TABLE (table), st->load_inhibit_check, 0, 2, i, i+1, @@ -892,8 +924,8 @@ static void browser_select_callback (GtkWidget *widget, GtkWidget *child) { - module_info *i; - browser_st *st; + ModuleInfo *i; + BrowserState *st; i = gtk_object_get_user_data (GTK_OBJECT (child)); st = gtk_object_get_user_data (GTK_OBJECT (widget)); @@ -911,7 +943,7 @@ static void browser_load_unload_callback (GtkWidget *widget, gpointer data) { - browser_st *st = data; + BrowserState *st = data; if (st->last_update->state == ST_LOADED_OK) mod_unload (st->last_update, FALSE); @@ -926,9 +958,9 @@ static void make_list_item (gpointer data, gpointer user_data) { - module_info *info = data; - browser_st *st = user_data; - GtkWidget *list_item; + ModuleInfo *info = data; + BrowserState *st = user_data; + GtkWidget *list_item; if (!st->last_update) st->last_update = info; @@ -943,22 +975,22 @@ make_list_item (gpointer data, static void -browser_info_add (GimpSet *set, - module_info *mod, - browser_st *st) +browser_info_add (GimpSet *set, + ModuleInfo *mod, + BrowserState *st) { make_list_item (mod, st); } static void -browser_info_remove (GimpSet *set, - module_info *mod, - browser_st *st) +browser_info_remove (GimpSet *set, + ModuleInfo *mod, + BrowserState *st) { GList *dlist, *free_list; GtkWidget *list_item; - module_info *i; + ModuleInfo *i; dlist = gtk_container_children (GTK_CONTAINER (st->list)); free_list = dlist; @@ -990,10 +1022,10 @@ static void module_db_module_ondisk (gpointer data, gpointer user_data) { - module_info *mod = data; + ModuleInfo *mod = data; struct stat statbuf; - int ret; - int old_ondisk = mod->ondisk; + gint ret; + gint old_ondisk = mod->ondisk; GSList **kill_list = user_data; ret = stat (mod->fullpath, &statbuf); @@ -1005,10 +1037,10 @@ module_db_module_ondisk (gpointer data, /* if it's not on the disk, and it isn't in memory, mark it to be * removed later. */ if (!mod->ondisk && !mod->module) - { - *kill_list = g_slist_append (*kill_list, mod); - mod = NULL; - } + { + *kill_list = g_slist_append (*kill_list, mod); + mod = NULL; + } if (mod && mod->ondisk != old_ondisk) module_info_modified (mod); @@ -1019,7 +1051,7 @@ static void module_db_module_remove (gpointer data, gpointer user_data) { - module_info *mod = data; + ModuleInfo *mod = data; gimp_set_remove (modules, mod); @@ -1028,23 +1060,24 @@ module_db_module_remove (gpointer data, -typedef struct { - const char *search_key; - module_info *found; +typedef struct +{ + const gchar *search_key; + ModuleInfo *found; } find_by_path_closure; static void module_db_path_cmp (gpointer data, gpointer user_data) { - module_info *mod = data; + ModuleInfo *mod = data; find_by_path_closure *cl = user_data; if (!strcmp (mod->fullpath, cl->search_key)) cl->found = mod; } -static module_info * +static ModuleInfo * module_find_by_path (const char *fullpath) { find_by_path_closure cl; @@ -1078,7 +1111,7 @@ browser_refresh_callback (GtkWidget *widget, static void -gimp_module_ref (module_info *mod) +gimp_module_ref (ModuleInfo *mod) { g_return_if_fail (mod->refs >= 0); g_return_if_fail (mod->module != NULL); @@ -1086,7 +1119,7 @@ gimp_module_ref (module_info *mod) } static void -gimp_module_unref (module_info *mod) +gimp_module_unref (ModuleInfo *mod) { g_return_if_fail (mod->refs > 0); g_return_if_fail (mod->module != NULL); @@ -1094,11 +1127,11 @@ gimp_module_unref (module_info *mod) mod->refs--; if (mod->refs == 0) - { - TRC (("module %p refs hit 0, g_module_closing it\n", mod)); - g_module_close (mod->module); - mod->module = NULL; - } + { + TRC (("module %p refs hit 0, g_module_closing it\n", mod)); + g_module_close (mod->module); + mod->module = NULL; + } } /* End of module_db.c */ diff --git a/app/dialogs/module-dialog.h b/app/dialogs/module-dialog.h index 93de1d8bf4..f178502b8e 100644 --- a/app/dialogs/module-dialog.h +++ b/app/dialogs/module-dialog.h @@ -17,14 +17,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - #ifndef __MODULE_DB_H__ + /* Load any modules we find on the module-path set in the gimprc */ -void module_db_init (void); +void module_db_init (void); /* Unload all modules, in case a module needs some cleanups */ -void module_db_free (void); +void module_db_free (void); GtkWidget *module_db_browser_new (void); diff --git a/app/gui/module-browser.c b/app/gui/module-browser.c index d968db297c..0ceccd6fb2 100644 --- a/app/gui/module-browser.c +++ b/app/gui/module-browser.c @@ -41,12 +41,15 @@ #include "libgimp/gimpenv.h" #include "libgimp/gimpmodule.h" + #include "libgimp/gimpintl.h" -/* export this to gimprc.c */ -char *module_db_load_inhibit = NULL; -typedef enum { +/* export this to gimprc.c */ +gchar *module_db_load_inhibit = NULL; + +typedef enum +{ ST_MODULE_ERROR, /* missing module_load function or other error */ ST_LOADED_OK, /* happy and running (normal state of affairs) */ ST_LOAD_FAILED, /* module_load returned GIMP_MODULE_UNLOAD */ @@ -54,7 +57,8 @@ typedef enum { ST_UNLOADED_OK /* callback arrived, module not in memory anymore */ } module_state; -static const char * const statename[] = { +static const gchar * const statename[] = +{ N_("Module error"), N_("Loaded OK"), N_("Load failed"), @@ -63,68 +67,76 @@ static const char * const statename[] = { }; #ifdef __EMX__ -extern void gimp_color_selector_register(); -extern void gimp_color_selector_unregister(); -extern void gimp_color_display_register(); -extern void gimp_color_display_unregister(); -extern void dialog_register(); -extern void dialog_unregister(); +extern void gimp_color_selector_register (); +extern void gimp_color_selector_unregister (); +extern void gimp_color_display_register (); +extern void gimp_color_display_unregister (); +extern void dialog_register (); +extern void dialog_unregister (); -static struct main_funcs_struc { +static struct main_funcs_struc +{ gchar *name; - void (*func)(); + void (*func) (); } -gimp_main_funcs[] = { - { "gimp_color_selector_register", gimp_color_selector_register }, +gimp_main_funcs[] = +{ + { "gimp_color_selector_register", gimp_color_selector_register }, { "gimp_color_selector_unregister", gimp_color_selector_unregister }, - { "gimp_color_display_register", gimp_color_display_register }, - { "gimp_color_display_unregister", gimp_color_display_unregister }, - { "dialog_register", dialog_register }, - { "dialog_unregister", dialog_unregister }, + { "gimp_color_display_register", gimp_color_display_register }, + { "gimp_color_display_unregister", gimp_color_display_unregister }, + { "dialog_register", dialog_register }, + { "dialog_unregister", dialog_unregister }, { NULL, NULL } }; #endif /* one of these objects is kept per-module */ -typedef struct { +typedef struct +{ GtkObject object; + gchar *fullpath; /* path to the module */ module_state state; /* what's happened to the module */ gboolean ondisk; /* TRUE if file still exists */ gboolean load_inhibit; /* user requests not to load at boot time */ gint refs; /* how many time we're running in the module */ + /* stuff from now on may be NULL depending on the state the module is in */ GimpModuleInfo *info; /* returned values from module_init */ GModule *module; /* handle on the module */ gchar *last_module_error; - GimpModuleInitFunc *init; - GimpModuleUnloadFunc *unload; -} module_info; + + GimpModuleInitFunc init; + GimpModuleUnloadFunc unload; +} ModuleInfo; static guint module_info_get_type (void); + #define MODULE_INFO_TYPE module_info_get_type() -#define MODULE_INFO(obj) GTK_CHECK_CAST (obj, MODULE_INFO_TYPE, module_info) +#define MODULE_INFO(obj) GTK_CHECK_CAST (obj, MODULE_INFO_TYPE, ModuleInfo) #define IS_MODULE_INFO(obj) GTK_CHECK_TYPE (obj, MODULE_INFO_TYPE) #define NUM_INFO_LINES 7 -typedef struct { - GtkWidget *table; - GtkWidget *label[NUM_INFO_LINES]; - GtkWidget *button_label; - module_info *last_update; - GtkWidget *button; - GtkWidget *list; - GtkWidget *load_inhibit_check; -} browser_st; +typedef struct +{ + GtkWidget *table; + GtkWidget *label[NUM_INFO_LINES]; + GtkWidget *button_label; + ModuleInfo *last_update; + GtkWidget *button; + GtkWidget *list; + GtkWidget *load_inhibit_check; +} BrowserState; /* global set of module_info pointers */ -static GimpSet *modules; -static GimpSetHandlerId modules_handler; +static GimpSet *modules; +static GimpSetHandlerId modules_handler; /* If the inhibit state of any modules changes, we might need to * re-write the modulerc. */ @@ -146,26 +158,43 @@ static gboolean need_to_rewrite_modulerc = FALSE; /* prototypes */ -static void module_initialize (char *filename); -static void mod_load (module_info *mod, gboolean verbose); -static void mod_unload (module_info *mod, gboolean verbose); -static module_info *module_find_by_path (const char *fullpath); -#ifdef DUMP_DB -static void print_module_info (gpointer data, gpointer user_data); -#endif -static void browser_popdown_callback (GtkWidget *w, gpointer client_data); -static void browser_destroy_callback (GtkWidget *w, gpointer client_data); -static void browser_info_update (module_info *, browser_st *); -static void browser_info_add (GimpSet *, module_info *, browser_st *); -static void browser_info_remove (GimpSet *, module_info *, browser_st *); -static void browser_info_init (browser_st *st, GtkWidget *table); -static void browser_select_callback (GtkWidget *widget, GtkWidget *child); -static void browser_load_unload_callback (GtkWidget *widget, gpointer data); -static void browser_refresh_callback (GtkWidget *widget, gpointer data); -static void make_list_item (gpointer data, gpointer user_data); +static void module_initialize (gchar *filename); +static void mod_load (ModuleInfo *mod, + gboolean verbose); +static void mod_unload (ModuleInfo *mod, + gboolean verbose); +static ModuleInfo * module_find_by_path (const gchar *fullpath); -static void gimp_module_ref (module_info *mod); -static void gimp_module_unref (module_info *mod); +#ifdef DUMP_DB +static void print_module_info (gpointer data, + gpointer user_data); +#endif + +static void browser_popdown_callback (GtkWidget *widget, + gpointer data); +static void browser_destroy_callback (GtkWidget *widget, + gpointer data); +static void browser_info_update (ModuleInfo *mod, + BrowserState *st); +static void browser_info_add (GimpSet *set, + ModuleInfo *mod, + BrowserState *st); +static void browser_info_remove (GimpSet *set, + ModuleInfo *mod, + BrowserState *st); +static void browser_info_init (BrowserState *st, + GtkWidget *table); +static void browser_select_callback (GtkWidget *widget, + GtkWidget *child); +static void browser_load_unload_callback (GtkWidget *widget, + gpointer data); +static void browser_refresh_callback (GtkWidget *widget, + gpointer data); +static void make_list_item (gpointer data, + gpointer user_data); + +static void gimp_module_ref (ModuleInfo *mod); +static void gimp_module_unref (ModuleInfo *mod); @@ -175,7 +204,7 @@ static void gimp_module_unref (module_info *mod); void module_db_init (void) { - char *filename; + gchar *filename; /* load the modulerc file */ filename = gimp_personal_rc_file ("modulerc"); @@ -198,7 +227,7 @@ static void free_a_single_module (gpointer data, gpointer user_data) { - module_info *mod = data; + ModuleInfo *mod = data; if (mod->module && mod->unload && mod->state == ST_LOADED_OK) { @@ -210,8 +239,8 @@ static void add_to_inhibit_string (gpointer data, gpointer user_data) { - module_info *mod = data; - GString *str = user_data; + ModuleInfo *mod = data; + GString *str = user_data; if (mod->load_inhibit) { @@ -224,11 +253,11 @@ add_to_inhibit_string (gpointer data, static gboolean module_db_write_modulerc (void) { - GString *str; - gchar *p; - char *filename; - FILE *fp; - gboolean saved = FALSE; + GString *str; + gchar *p; + gchar *filename; + FILE *fp; + gboolean saved = FALSE; str = g_string_new (NULL); gimp_set_foreach (modules, add_to_inhibit_string, str); @@ -256,12 +285,12 @@ void module_db_free (void) { if (need_to_rewrite_modulerc) - { + { if (module_db_write_modulerc ()) - { + { need_to_rewrite_modulerc = FALSE; - } - } + } + } gimp_set_foreach (modules, free_a_single_module, NULL); } @@ -274,7 +303,7 @@ module_db_browser_new (void) GtkWidget *vbox; GtkWidget *listbox; GtkWidget *button; - browser_st *st; + BrowserState *st; shell = gimp_dialog_new (_("Module DB"), "module_db_dialog", gimp_standard_help_func, @@ -300,7 +329,7 @@ module_db_browser_new (void) gtk_widget_set_usize (listbox, 125, 100); gtk_widget_show (listbox); - st = g_new0 (browser_st, 1); + st = g_new0 (BrowserState, 1); st->list = gtk_list_new (); gtk_list_set_selection_mode (GTK_LIST (st->list), GTK_SELECTION_BROWSE); @@ -361,14 +390,16 @@ module_db_browser_new (void) /**************************************************************/ -/* module_info object glue */ +/* ModuleInfo object glue */ -typedef struct { +typedef struct +{ GtkObjectClass parent_class; -} module_infoClass; +} ModuleInfoClass; -enum { +enum +{ MODIFIED, LAST_SIGNAL }; @@ -378,7 +409,7 @@ static guint module_info_signals[LAST_SIGNAL]; static void module_info_destroy (GtkObject *object) { - module_info *mod = MODULE_INFO (object); + ModuleInfo *mod = MODULE_INFO (object); /* if this trips, then we're onto some serious lossage in a moment */ g_return_if_fail (mod->refs == 0); @@ -389,25 +420,25 @@ module_info_destroy (GtkObject *object) } static void -module_info_class_init (module_infoClass *klass) +module_info_class_init (ModuleInfoClass *klass) { GtkObjectClass *object_class; GtkType type; - object_class = GTK_OBJECT_CLASS(klass); + object_class = GTK_OBJECT_CLASS (klass); type = object_class->type; object_class->destroy = module_info_destroy; module_info_signals[MODIFIED] = - gimp_signal_new ("modified", 0, type, 0, gimp_sigtype_void); + gimp_signal_new ("modified", 0, type, 0, gimp_sigtype_void); - gtk_object_class_add_signals(object_class, module_info_signals, LAST_SIGNAL); + gtk_object_class_add_signals (object_class, module_info_signals, LAST_SIGNAL); } static void -module_info_init (module_info *mod) +module_info_init (ModuleInfo *mod) { /* don't need to do anything */ } @@ -421,9 +452,9 @@ module_info_get_type (void) { static const GtkTypeInfo module_info_info = { - "module_info", - sizeof (module_info), - sizeof (module_infoClass), + "ModuleInfo", + sizeof (ModuleInfo), + sizeof (ModuleInfoClass), (GtkClassInitFunc) module_info_class_init, (GtkObjectInitFunc) module_info_init, /* reserved_1 */ NULL, @@ -431,8 +462,8 @@ module_info_get_type (void) (GtkClassInitFunc) NULL, }; - module_info_type = gtk_type_unique (gtk_object_get_type(), - &module_info_info); + module_info_type = + gtk_type_unique (gtk_object_get_type (), &module_info_info); } return module_info_type; @@ -441,19 +472,19 @@ module_info_get_type (void) /* exported API: */ static void -module_info_modified (module_info *mod) +module_info_modified (ModuleInfo *mod) { gtk_signal_emit (GTK_OBJECT (mod), module_info_signals[MODIFIED]); } -static module_info * +static ModuleInfo * module_info_new (void) { return MODULE_INFO (gtk_type_new (module_info_get_type ())); } static void -module_info_free (module_info *mod) +module_info_free (ModuleInfo *mod) { gtk_object_unref (GTK_OBJECT (mod)); } @@ -465,10 +496,10 @@ module_info_free (module_info *mod) /* name must be of the form lib*.so (Unix) or *.dll (Win32) */ static gboolean -valid_module_name (const char *filename) +valid_module_name (const gchar *filename) { - const char *basename; - int len; + const gchar *basename; + gint len; basename = g_basename (filename); @@ -496,12 +527,13 @@ valid_module_name (const char *filename) static gboolean -module_inhibited (const char *fullpath, - const char *inhibit_list) +module_inhibited (const gchar *fullpath, + const gchar *inhibit_list) { - char *p; - int pathlen; - const char *start, *end; + gchar *p; + gint pathlen; + const gchar *start; + const gchar *end; /* common case optimisation: the list is empty */ if (!inhibit_list || *inhibit_list == '\000') @@ -531,9 +563,9 @@ module_inhibited (const char *fullpath, static void -module_initialize (char *filename) +module_initialize (gchar *filename) { - module_info *mod; + ModuleInfo *mod; if (!valid_module_name (filename)) return; @@ -581,8 +613,8 @@ module_initialize (char *filename) } static void -mod_load (module_info *mod, - gboolean verbose) +mod_load (ModuleInfo *mod, + gboolean verbose) { gpointer symbol; @@ -632,12 +664,12 @@ mod_load (module_info *mod, mod->info = NULL; gimp_module_ref (mod); /* loaded modules are assumed to have a ref of 1 */ if (mod->init (&mod->info) == GIMP_MODULE_UNLOAD) - { - mod->state = ST_LOAD_FAILED; - gimp_module_unref (mod); - mod->info = NULL; - return; - } + { + mod->state = ST_LOAD_FAILED; + gimp_module_unref (mod); + mod->info = NULL; + return; + } /* module is now happy */ mod->state = ST_LOADED_OK; @@ -648,14 +680,13 @@ mod_load (module_info *mod, mod->unload = symbol; else mod->unload = NULL; - } static void mod_unload_completed_callback (void *data) { - module_info *mod = data; + ModuleInfo *mod = data; g_return_if_fail (mod->state == ST_UNLOAD_REQUESTED); @@ -672,8 +703,8 @@ mod_unload_completed_callback (void *data) } static void -mod_unload (module_info *mod, - gboolean verbose) +mod_unload (ModuleInfo *mod, + gboolean verbose) { g_return_if_fail (mod->module != NULL); g_return_if_fail (mod->unload != NULL); @@ -694,31 +725,30 @@ mod_unload (module_info *mod, } - #ifdef DUMP_DB static void print_module_info (gpointer data, gpointer user_data) { - module_info *i = data; + ModuleInfo *i = data; - printf ("\n%s: %s\n", - i->fullpath, statename[i->state]); - printf (" module:%p lasterr:%s init:%p unload:%p\n", - i->module, i->last_module_error? i->last_module_error : "NONE", - i->init, i->unload); + g_print ("\n%s: %s\n", + i->fullpath, statename[i->state]); + g_print (" module:%p lasterr:%s init:%p unload:%p\n", + i->module, i->last_module_error? i->last_module_error : "NONE", + i->init, i->unload); if (i->info) - { - printf (" shutdown_data: %p\n" - " purpose: %s\n" - " author: %s\n" - " version: %s\n" - " copyright: %s\n" - " date: %s\n", - i->info->shutdown_data, - i->info->purpose, i->info->author, i->info->version, - i->info->copyright, i->info->date); - } + { + g_print (" shutdown_data: %p\n" + " purpose: %s\n" + " author: %s\n" + " version: %s\n" + " copyright: %s\n" + " date: %s\n", + i->info->shutdown_data, + i->info->purpose, i->info->author, i->info->version, + i->info->copyright, i->info->date); + } } #endif @@ -728,31 +758,31 @@ print_module_info (gpointer data, /* UI functions */ static void -browser_popdown_callback (GtkWidget *w, - gpointer client_data) +browser_popdown_callback (GtkWidget *widget, + gpointer data) { - gtk_widget_destroy (GTK_WIDGET (client_data)); + gtk_widget_destroy (GTK_WIDGET (data)); } static void -browser_destroy_callback (GtkWidget *w, - gpointer client_data) +browser_destroy_callback (GtkWidget *widget, + gpointer data) { - gtk_signal_disconnect_by_data (GTK_OBJECT (modules), client_data); + gtk_signal_disconnect_by_data (GTK_OBJECT (modules), data); gimp_set_remove_handler (modules, modules_handler); - g_free (client_data); + g_free (data); } static void -browser_load_inhibit_callback (GtkWidget *w, +browser_load_inhibit_callback (GtkWidget *widget, gpointer data) { - browser_st *st = data; + BrowserState *st = data; gboolean new_value; g_return_if_fail (st->last_update != NULL); - new_value = ! GTK_TOGGLE_BUTTON (w)->active; + new_value = ! GTK_TOGGLE_BUTTON (widget)->active; if (new_value == st->last_update->load_inhibit) return; @@ -764,59 +794,58 @@ browser_load_inhibit_callback (GtkWidget *w, } static void -browser_info_update (module_info *mod, - browser_st *st) +browser_info_update (ModuleInfo *mod, + BrowserState *st) { - int i; - const char *text[NUM_INFO_LINES - 1]; - char *status; + gint i; + const gchar *text[NUM_INFO_LINES - 1]; + gchar *status; /* only update the info if we're actually showing it */ if (mod != st->last_update) return; if (!mod) - { - for (i=0; i < NUM_INFO_LINES; i++) - gtk_label_set_text (GTK_LABEL (st->label[i]), ""); - gtk_label_set_text (GTK_LABEL(st->button_label), _("")); - gtk_widget_set_sensitive (GTK_WIDGET (st->button), FALSE); - gtk_widget_set_sensitive (GTK_WIDGET (st->load_inhibit_check), FALSE); - return; - } + { + for (i=0; i < NUM_INFO_LINES; i++) + gtk_label_set_text (GTK_LABEL (st->label[i]), ""); + gtk_label_set_text (GTK_LABEL(st->button_label), _("")); + gtk_widget_set_sensitive (GTK_WIDGET (st->button), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (st->load_inhibit_check), FALSE); + return; + } if (mod->info) - { - text[0] = mod->info->purpose; - text[1] = mod->info->author; - text[2] = mod->info->version; - text[3] = mod->info->copyright; - text[4] = mod->info->date; - text[5] = mod->ondisk? _("on disk") : _("only in memory"); - } + { + text[0] = mod->info->purpose; + text[1] = mod->info->author; + text[2] = mod->info->version; + text[3] = mod->info->copyright; + text[4] = mod->info->date; + text[5] = mod->ondisk? _("on disk") : _("only in memory"); + } else - { - text[0] = "--"; - text[1] = "--"; - text[2] = "--"; - text[3] = "--"; - text[4] = "--"; - text[5] = mod->ondisk? _("on disk") : _("nowhere (click 'refresh')"); - } - + { + text[0] = "--"; + text[1] = "--"; + text[2] = "--"; + text[3] = "--"; + text[4] = "--"; + text[5] = mod->ondisk? _("on disk") : _("nowhere (click 'refresh')"); + } if (mod->state == ST_MODULE_ERROR && mod->last_module_error) status = g_strdup_printf ("%s (%s)", gettext (statename[mod->state]), mod->last_module_error); else - { - status = g_strdup (gettext (statename[mod->state])); - } + { + status = g_strdup (gettext (statename[mod->state])); + } for (i=0; i < NUM_INFO_LINES - 1; i++) - { - gtk_label_set_text (GTK_LABEL (st->label[i]), gettext (text[i])); - } + { + gtk_label_set_text (GTK_LABEL (st->label[i]), gettext (text[i])); + } gtk_label_set_text (GTK_LABEL (st->label[NUM_INFO_LINES-1]), status); @@ -827,33 +856,36 @@ browser_info_update (module_info *mod, gtk_widget_set_sensitive (GTK_WIDGET (st->load_inhibit_check), TRUE); /* work out what the button should do (if anything) */ - switch (mod->state) { - case ST_MODULE_ERROR: - case ST_LOAD_FAILED: - case ST_UNLOADED_OK: - gtk_label_set_text (GTK_LABEL(st->button_label), _("Load")); - gtk_widget_set_sensitive (GTK_WIDGET (st->button), mod->ondisk); - break; + switch (mod->state) + { + case ST_MODULE_ERROR: + case ST_LOAD_FAILED: + case ST_UNLOADED_OK: + gtk_label_set_text (GTK_LABEL(st->button_label), _("Load")); + gtk_widget_set_sensitive (GTK_WIDGET (st->button), mod->ondisk); + break; - case ST_UNLOAD_REQUESTED: - gtk_widget_set_sensitive (GTK_WIDGET (st->button), FALSE); - break; + case ST_UNLOAD_REQUESTED: + gtk_widget_set_sensitive (GTK_WIDGET (st->button), FALSE); + break; - case ST_LOADED_OK: - gtk_label_set_text (GTK_LABEL(st->button_label), _("Unload")); - gtk_widget_set_sensitive (GTK_WIDGET (st->button), - mod->unload? TRUE : FALSE); - break; - } + case ST_LOADED_OK: + gtk_label_set_text (GTK_LABEL(st->button_label), _("Unload")); + gtk_widget_set_sensitive (GTK_WIDGET (st->button), + mod->unload? TRUE : FALSE); + break; + } } static void -browser_info_init (browser_st *st, - GtkWidget *table) +browser_info_init (BrowserState *st, + GtkWidget *table) { GtkWidget *label; - int i; - char *text[] = { + gint i; + + gchar *text[] = + { N_("Purpose:"), N_("Author:"), N_("Version:"), @@ -864,22 +896,22 @@ browser_info_init (browser_st *st, }; for (i=0; i < sizeof(text) / sizeof(char *); i++) - { - label = gtk_label_new (gettext (text[i])); - gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); - gtk_table_attach (GTK_TABLE (table), label, 0, 1, i, i+1, - GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 2); - gtk_widget_show (label); + { + label = gtk_label_new (gettext (text[i])); + gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, i, i+1, + GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 2); + gtk_widget_show (label); - st->label[i] = gtk_label_new (""); - gtk_misc_set_alignment (GTK_MISC (st->label[i]), 0.0, 0.5); - gtk_table_attach (GTK_TABLE (st->table), st->label[i], 1, 2, i, i+1, - GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 2); - gtk_widget_show (st->label[i]); - } + st->label[i] = gtk_label_new (""); + gtk_misc_set_alignment (GTK_MISC (st->label[i]), 0.0, 0.5); + gtk_table_attach (GTK_TABLE (st->table), st->label[i], 1, 2, i, i+1, + GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 2); + gtk_widget_show (st->label[i]); + } st->load_inhibit_check = - gtk_check_button_new_with_label (_("Autoload during startup")); + gtk_check_button_new_with_label (_("Autoload during startup")); gtk_widget_show (st->load_inhibit_check); gtk_table_attach (GTK_TABLE (table), st->load_inhibit_check, 0, 2, i, i+1, @@ -892,8 +924,8 @@ static void browser_select_callback (GtkWidget *widget, GtkWidget *child) { - module_info *i; - browser_st *st; + ModuleInfo *i; + BrowserState *st; i = gtk_object_get_user_data (GTK_OBJECT (child)); st = gtk_object_get_user_data (GTK_OBJECT (widget)); @@ -911,7 +943,7 @@ static void browser_load_unload_callback (GtkWidget *widget, gpointer data) { - browser_st *st = data; + BrowserState *st = data; if (st->last_update->state == ST_LOADED_OK) mod_unload (st->last_update, FALSE); @@ -926,9 +958,9 @@ static void make_list_item (gpointer data, gpointer user_data) { - module_info *info = data; - browser_st *st = user_data; - GtkWidget *list_item; + ModuleInfo *info = data; + BrowserState *st = user_data; + GtkWidget *list_item; if (!st->last_update) st->last_update = info; @@ -943,22 +975,22 @@ make_list_item (gpointer data, static void -browser_info_add (GimpSet *set, - module_info *mod, - browser_st *st) +browser_info_add (GimpSet *set, + ModuleInfo *mod, + BrowserState *st) { make_list_item (mod, st); } static void -browser_info_remove (GimpSet *set, - module_info *mod, - browser_st *st) +browser_info_remove (GimpSet *set, + ModuleInfo *mod, + BrowserState *st) { GList *dlist, *free_list; GtkWidget *list_item; - module_info *i; + ModuleInfo *i; dlist = gtk_container_children (GTK_CONTAINER (st->list)); free_list = dlist; @@ -990,10 +1022,10 @@ static void module_db_module_ondisk (gpointer data, gpointer user_data) { - module_info *mod = data; + ModuleInfo *mod = data; struct stat statbuf; - int ret; - int old_ondisk = mod->ondisk; + gint ret; + gint old_ondisk = mod->ondisk; GSList **kill_list = user_data; ret = stat (mod->fullpath, &statbuf); @@ -1005,10 +1037,10 @@ module_db_module_ondisk (gpointer data, /* if it's not on the disk, and it isn't in memory, mark it to be * removed later. */ if (!mod->ondisk && !mod->module) - { - *kill_list = g_slist_append (*kill_list, mod); - mod = NULL; - } + { + *kill_list = g_slist_append (*kill_list, mod); + mod = NULL; + } if (mod && mod->ondisk != old_ondisk) module_info_modified (mod); @@ -1019,7 +1051,7 @@ static void module_db_module_remove (gpointer data, gpointer user_data) { - module_info *mod = data; + ModuleInfo *mod = data; gimp_set_remove (modules, mod); @@ -1028,23 +1060,24 @@ module_db_module_remove (gpointer data, -typedef struct { - const char *search_key; - module_info *found; +typedef struct +{ + const gchar *search_key; + ModuleInfo *found; } find_by_path_closure; static void module_db_path_cmp (gpointer data, gpointer user_data) { - module_info *mod = data; + ModuleInfo *mod = data; find_by_path_closure *cl = user_data; if (!strcmp (mod->fullpath, cl->search_key)) cl->found = mod; } -static module_info * +static ModuleInfo * module_find_by_path (const char *fullpath) { find_by_path_closure cl; @@ -1078,7 +1111,7 @@ browser_refresh_callback (GtkWidget *widget, static void -gimp_module_ref (module_info *mod) +gimp_module_ref (ModuleInfo *mod) { g_return_if_fail (mod->refs >= 0); g_return_if_fail (mod->module != NULL); @@ -1086,7 +1119,7 @@ gimp_module_ref (module_info *mod) } static void -gimp_module_unref (module_info *mod) +gimp_module_unref (ModuleInfo *mod) { g_return_if_fail (mod->refs > 0); g_return_if_fail (mod->module != NULL); @@ -1094,11 +1127,11 @@ gimp_module_unref (module_info *mod) mod->refs--; if (mod->refs == 0) - { - TRC (("module %p refs hit 0, g_module_closing it\n", mod)); - g_module_close (mod->module); - mod->module = NULL; - } + { + TRC (("module %p refs hit 0, g_module_closing it\n", mod)); + g_module_close (mod->module); + mod->module = NULL; + } } /* End of module_db.c */ diff --git a/app/gui/module-browser.h b/app/gui/module-browser.h index 93de1d8bf4..f178502b8e 100644 --- a/app/gui/module-browser.h +++ b/app/gui/module-browser.h @@ -17,14 +17,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - #ifndef __MODULE_DB_H__ + /* Load any modules we find on the module-path set in the gimprc */ -void module_db_init (void); +void module_db_init (void); /* Unload all modules, in case a module needs some cleanups */ -void module_db_free (void); +void module_db_free (void); GtkWidget *module_db_browser_new (void); diff --git a/app/module_db.c b/app/module_db.c index d968db297c..0ceccd6fb2 100644 --- a/app/module_db.c +++ b/app/module_db.c @@ -41,12 +41,15 @@ #include "libgimp/gimpenv.h" #include "libgimp/gimpmodule.h" + #include "libgimp/gimpintl.h" -/* export this to gimprc.c */ -char *module_db_load_inhibit = NULL; -typedef enum { +/* export this to gimprc.c */ +gchar *module_db_load_inhibit = NULL; + +typedef enum +{ ST_MODULE_ERROR, /* missing module_load function or other error */ ST_LOADED_OK, /* happy and running (normal state of affairs) */ ST_LOAD_FAILED, /* module_load returned GIMP_MODULE_UNLOAD */ @@ -54,7 +57,8 @@ typedef enum { ST_UNLOADED_OK /* callback arrived, module not in memory anymore */ } module_state; -static const char * const statename[] = { +static const gchar * const statename[] = +{ N_("Module error"), N_("Loaded OK"), N_("Load failed"), @@ -63,68 +67,76 @@ static const char * const statename[] = { }; #ifdef __EMX__ -extern void gimp_color_selector_register(); -extern void gimp_color_selector_unregister(); -extern void gimp_color_display_register(); -extern void gimp_color_display_unregister(); -extern void dialog_register(); -extern void dialog_unregister(); +extern void gimp_color_selector_register (); +extern void gimp_color_selector_unregister (); +extern void gimp_color_display_register (); +extern void gimp_color_display_unregister (); +extern void dialog_register (); +extern void dialog_unregister (); -static struct main_funcs_struc { +static struct main_funcs_struc +{ gchar *name; - void (*func)(); + void (*func) (); } -gimp_main_funcs[] = { - { "gimp_color_selector_register", gimp_color_selector_register }, +gimp_main_funcs[] = +{ + { "gimp_color_selector_register", gimp_color_selector_register }, { "gimp_color_selector_unregister", gimp_color_selector_unregister }, - { "gimp_color_display_register", gimp_color_display_register }, - { "gimp_color_display_unregister", gimp_color_display_unregister }, - { "dialog_register", dialog_register }, - { "dialog_unregister", dialog_unregister }, + { "gimp_color_display_register", gimp_color_display_register }, + { "gimp_color_display_unregister", gimp_color_display_unregister }, + { "dialog_register", dialog_register }, + { "dialog_unregister", dialog_unregister }, { NULL, NULL } }; #endif /* one of these objects is kept per-module */ -typedef struct { +typedef struct +{ GtkObject object; + gchar *fullpath; /* path to the module */ module_state state; /* what's happened to the module */ gboolean ondisk; /* TRUE if file still exists */ gboolean load_inhibit; /* user requests not to load at boot time */ gint refs; /* how many time we're running in the module */ + /* stuff from now on may be NULL depending on the state the module is in */ GimpModuleInfo *info; /* returned values from module_init */ GModule *module; /* handle on the module */ gchar *last_module_error; - GimpModuleInitFunc *init; - GimpModuleUnloadFunc *unload; -} module_info; + + GimpModuleInitFunc init; + GimpModuleUnloadFunc unload; +} ModuleInfo; static guint module_info_get_type (void); + #define MODULE_INFO_TYPE module_info_get_type() -#define MODULE_INFO(obj) GTK_CHECK_CAST (obj, MODULE_INFO_TYPE, module_info) +#define MODULE_INFO(obj) GTK_CHECK_CAST (obj, MODULE_INFO_TYPE, ModuleInfo) #define IS_MODULE_INFO(obj) GTK_CHECK_TYPE (obj, MODULE_INFO_TYPE) #define NUM_INFO_LINES 7 -typedef struct { - GtkWidget *table; - GtkWidget *label[NUM_INFO_LINES]; - GtkWidget *button_label; - module_info *last_update; - GtkWidget *button; - GtkWidget *list; - GtkWidget *load_inhibit_check; -} browser_st; +typedef struct +{ + GtkWidget *table; + GtkWidget *label[NUM_INFO_LINES]; + GtkWidget *button_label; + ModuleInfo *last_update; + GtkWidget *button; + GtkWidget *list; + GtkWidget *load_inhibit_check; +} BrowserState; /* global set of module_info pointers */ -static GimpSet *modules; -static GimpSetHandlerId modules_handler; +static GimpSet *modules; +static GimpSetHandlerId modules_handler; /* If the inhibit state of any modules changes, we might need to * re-write the modulerc. */ @@ -146,26 +158,43 @@ static gboolean need_to_rewrite_modulerc = FALSE; /* prototypes */ -static void module_initialize (char *filename); -static void mod_load (module_info *mod, gboolean verbose); -static void mod_unload (module_info *mod, gboolean verbose); -static module_info *module_find_by_path (const char *fullpath); -#ifdef DUMP_DB -static void print_module_info (gpointer data, gpointer user_data); -#endif -static void browser_popdown_callback (GtkWidget *w, gpointer client_data); -static void browser_destroy_callback (GtkWidget *w, gpointer client_data); -static void browser_info_update (module_info *, browser_st *); -static void browser_info_add (GimpSet *, module_info *, browser_st *); -static void browser_info_remove (GimpSet *, module_info *, browser_st *); -static void browser_info_init (browser_st *st, GtkWidget *table); -static void browser_select_callback (GtkWidget *widget, GtkWidget *child); -static void browser_load_unload_callback (GtkWidget *widget, gpointer data); -static void browser_refresh_callback (GtkWidget *widget, gpointer data); -static void make_list_item (gpointer data, gpointer user_data); +static void module_initialize (gchar *filename); +static void mod_load (ModuleInfo *mod, + gboolean verbose); +static void mod_unload (ModuleInfo *mod, + gboolean verbose); +static ModuleInfo * module_find_by_path (const gchar *fullpath); -static void gimp_module_ref (module_info *mod); -static void gimp_module_unref (module_info *mod); +#ifdef DUMP_DB +static void print_module_info (gpointer data, + gpointer user_data); +#endif + +static void browser_popdown_callback (GtkWidget *widget, + gpointer data); +static void browser_destroy_callback (GtkWidget *widget, + gpointer data); +static void browser_info_update (ModuleInfo *mod, + BrowserState *st); +static void browser_info_add (GimpSet *set, + ModuleInfo *mod, + BrowserState *st); +static void browser_info_remove (GimpSet *set, + ModuleInfo *mod, + BrowserState *st); +static void browser_info_init (BrowserState *st, + GtkWidget *table); +static void browser_select_callback (GtkWidget *widget, + GtkWidget *child); +static void browser_load_unload_callback (GtkWidget *widget, + gpointer data); +static void browser_refresh_callback (GtkWidget *widget, + gpointer data); +static void make_list_item (gpointer data, + gpointer user_data); + +static void gimp_module_ref (ModuleInfo *mod); +static void gimp_module_unref (ModuleInfo *mod); @@ -175,7 +204,7 @@ static void gimp_module_unref (module_info *mod); void module_db_init (void) { - char *filename; + gchar *filename; /* load the modulerc file */ filename = gimp_personal_rc_file ("modulerc"); @@ -198,7 +227,7 @@ static void free_a_single_module (gpointer data, gpointer user_data) { - module_info *mod = data; + ModuleInfo *mod = data; if (mod->module && mod->unload && mod->state == ST_LOADED_OK) { @@ -210,8 +239,8 @@ static void add_to_inhibit_string (gpointer data, gpointer user_data) { - module_info *mod = data; - GString *str = user_data; + ModuleInfo *mod = data; + GString *str = user_data; if (mod->load_inhibit) { @@ -224,11 +253,11 @@ add_to_inhibit_string (gpointer data, static gboolean module_db_write_modulerc (void) { - GString *str; - gchar *p; - char *filename; - FILE *fp; - gboolean saved = FALSE; + GString *str; + gchar *p; + gchar *filename; + FILE *fp; + gboolean saved = FALSE; str = g_string_new (NULL); gimp_set_foreach (modules, add_to_inhibit_string, str); @@ -256,12 +285,12 @@ void module_db_free (void) { if (need_to_rewrite_modulerc) - { + { if (module_db_write_modulerc ()) - { + { need_to_rewrite_modulerc = FALSE; - } - } + } + } gimp_set_foreach (modules, free_a_single_module, NULL); } @@ -274,7 +303,7 @@ module_db_browser_new (void) GtkWidget *vbox; GtkWidget *listbox; GtkWidget *button; - browser_st *st; + BrowserState *st; shell = gimp_dialog_new (_("Module DB"), "module_db_dialog", gimp_standard_help_func, @@ -300,7 +329,7 @@ module_db_browser_new (void) gtk_widget_set_usize (listbox, 125, 100); gtk_widget_show (listbox); - st = g_new0 (browser_st, 1); + st = g_new0 (BrowserState, 1); st->list = gtk_list_new (); gtk_list_set_selection_mode (GTK_LIST (st->list), GTK_SELECTION_BROWSE); @@ -361,14 +390,16 @@ module_db_browser_new (void) /**************************************************************/ -/* module_info object glue */ +/* ModuleInfo object glue */ -typedef struct { +typedef struct +{ GtkObjectClass parent_class; -} module_infoClass; +} ModuleInfoClass; -enum { +enum +{ MODIFIED, LAST_SIGNAL }; @@ -378,7 +409,7 @@ static guint module_info_signals[LAST_SIGNAL]; static void module_info_destroy (GtkObject *object) { - module_info *mod = MODULE_INFO (object); + ModuleInfo *mod = MODULE_INFO (object); /* if this trips, then we're onto some serious lossage in a moment */ g_return_if_fail (mod->refs == 0); @@ -389,25 +420,25 @@ module_info_destroy (GtkObject *object) } static void -module_info_class_init (module_infoClass *klass) +module_info_class_init (ModuleInfoClass *klass) { GtkObjectClass *object_class; GtkType type; - object_class = GTK_OBJECT_CLASS(klass); + object_class = GTK_OBJECT_CLASS (klass); type = object_class->type; object_class->destroy = module_info_destroy; module_info_signals[MODIFIED] = - gimp_signal_new ("modified", 0, type, 0, gimp_sigtype_void); + gimp_signal_new ("modified", 0, type, 0, gimp_sigtype_void); - gtk_object_class_add_signals(object_class, module_info_signals, LAST_SIGNAL); + gtk_object_class_add_signals (object_class, module_info_signals, LAST_SIGNAL); } static void -module_info_init (module_info *mod) +module_info_init (ModuleInfo *mod) { /* don't need to do anything */ } @@ -421,9 +452,9 @@ module_info_get_type (void) { static const GtkTypeInfo module_info_info = { - "module_info", - sizeof (module_info), - sizeof (module_infoClass), + "ModuleInfo", + sizeof (ModuleInfo), + sizeof (ModuleInfoClass), (GtkClassInitFunc) module_info_class_init, (GtkObjectInitFunc) module_info_init, /* reserved_1 */ NULL, @@ -431,8 +462,8 @@ module_info_get_type (void) (GtkClassInitFunc) NULL, }; - module_info_type = gtk_type_unique (gtk_object_get_type(), - &module_info_info); + module_info_type = + gtk_type_unique (gtk_object_get_type (), &module_info_info); } return module_info_type; @@ -441,19 +472,19 @@ module_info_get_type (void) /* exported API: */ static void -module_info_modified (module_info *mod) +module_info_modified (ModuleInfo *mod) { gtk_signal_emit (GTK_OBJECT (mod), module_info_signals[MODIFIED]); } -static module_info * +static ModuleInfo * module_info_new (void) { return MODULE_INFO (gtk_type_new (module_info_get_type ())); } static void -module_info_free (module_info *mod) +module_info_free (ModuleInfo *mod) { gtk_object_unref (GTK_OBJECT (mod)); } @@ -465,10 +496,10 @@ module_info_free (module_info *mod) /* name must be of the form lib*.so (Unix) or *.dll (Win32) */ static gboolean -valid_module_name (const char *filename) +valid_module_name (const gchar *filename) { - const char *basename; - int len; + const gchar *basename; + gint len; basename = g_basename (filename); @@ -496,12 +527,13 @@ valid_module_name (const char *filename) static gboolean -module_inhibited (const char *fullpath, - const char *inhibit_list) +module_inhibited (const gchar *fullpath, + const gchar *inhibit_list) { - char *p; - int pathlen; - const char *start, *end; + gchar *p; + gint pathlen; + const gchar *start; + const gchar *end; /* common case optimisation: the list is empty */ if (!inhibit_list || *inhibit_list == '\000') @@ -531,9 +563,9 @@ module_inhibited (const char *fullpath, static void -module_initialize (char *filename) +module_initialize (gchar *filename) { - module_info *mod; + ModuleInfo *mod; if (!valid_module_name (filename)) return; @@ -581,8 +613,8 @@ module_initialize (char *filename) } static void -mod_load (module_info *mod, - gboolean verbose) +mod_load (ModuleInfo *mod, + gboolean verbose) { gpointer symbol; @@ -632,12 +664,12 @@ mod_load (module_info *mod, mod->info = NULL; gimp_module_ref (mod); /* loaded modules are assumed to have a ref of 1 */ if (mod->init (&mod->info) == GIMP_MODULE_UNLOAD) - { - mod->state = ST_LOAD_FAILED; - gimp_module_unref (mod); - mod->info = NULL; - return; - } + { + mod->state = ST_LOAD_FAILED; + gimp_module_unref (mod); + mod->info = NULL; + return; + } /* module is now happy */ mod->state = ST_LOADED_OK; @@ -648,14 +680,13 @@ mod_load (module_info *mod, mod->unload = symbol; else mod->unload = NULL; - } static void mod_unload_completed_callback (void *data) { - module_info *mod = data; + ModuleInfo *mod = data; g_return_if_fail (mod->state == ST_UNLOAD_REQUESTED); @@ -672,8 +703,8 @@ mod_unload_completed_callback (void *data) } static void -mod_unload (module_info *mod, - gboolean verbose) +mod_unload (ModuleInfo *mod, + gboolean verbose) { g_return_if_fail (mod->module != NULL); g_return_if_fail (mod->unload != NULL); @@ -694,31 +725,30 @@ mod_unload (module_info *mod, } - #ifdef DUMP_DB static void print_module_info (gpointer data, gpointer user_data) { - module_info *i = data; + ModuleInfo *i = data; - printf ("\n%s: %s\n", - i->fullpath, statename[i->state]); - printf (" module:%p lasterr:%s init:%p unload:%p\n", - i->module, i->last_module_error? i->last_module_error : "NONE", - i->init, i->unload); + g_print ("\n%s: %s\n", + i->fullpath, statename[i->state]); + g_print (" module:%p lasterr:%s init:%p unload:%p\n", + i->module, i->last_module_error? i->last_module_error : "NONE", + i->init, i->unload); if (i->info) - { - printf (" shutdown_data: %p\n" - " purpose: %s\n" - " author: %s\n" - " version: %s\n" - " copyright: %s\n" - " date: %s\n", - i->info->shutdown_data, - i->info->purpose, i->info->author, i->info->version, - i->info->copyright, i->info->date); - } + { + g_print (" shutdown_data: %p\n" + " purpose: %s\n" + " author: %s\n" + " version: %s\n" + " copyright: %s\n" + " date: %s\n", + i->info->shutdown_data, + i->info->purpose, i->info->author, i->info->version, + i->info->copyright, i->info->date); + } } #endif @@ -728,31 +758,31 @@ print_module_info (gpointer data, /* UI functions */ static void -browser_popdown_callback (GtkWidget *w, - gpointer client_data) +browser_popdown_callback (GtkWidget *widget, + gpointer data) { - gtk_widget_destroy (GTK_WIDGET (client_data)); + gtk_widget_destroy (GTK_WIDGET (data)); } static void -browser_destroy_callback (GtkWidget *w, - gpointer client_data) +browser_destroy_callback (GtkWidget *widget, + gpointer data) { - gtk_signal_disconnect_by_data (GTK_OBJECT (modules), client_data); + gtk_signal_disconnect_by_data (GTK_OBJECT (modules), data); gimp_set_remove_handler (modules, modules_handler); - g_free (client_data); + g_free (data); } static void -browser_load_inhibit_callback (GtkWidget *w, +browser_load_inhibit_callback (GtkWidget *widget, gpointer data) { - browser_st *st = data; + BrowserState *st = data; gboolean new_value; g_return_if_fail (st->last_update != NULL); - new_value = ! GTK_TOGGLE_BUTTON (w)->active; + new_value = ! GTK_TOGGLE_BUTTON (widget)->active; if (new_value == st->last_update->load_inhibit) return; @@ -764,59 +794,58 @@ browser_load_inhibit_callback (GtkWidget *w, } static void -browser_info_update (module_info *mod, - browser_st *st) +browser_info_update (ModuleInfo *mod, + BrowserState *st) { - int i; - const char *text[NUM_INFO_LINES - 1]; - char *status; + gint i; + const gchar *text[NUM_INFO_LINES - 1]; + gchar *status; /* only update the info if we're actually showing it */ if (mod != st->last_update) return; if (!mod) - { - for (i=0; i < NUM_INFO_LINES; i++) - gtk_label_set_text (GTK_LABEL (st->label[i]), ""); - gtk_label_set_text (GTK_LABEL(st->button_label), _("")); - gtk_widget_set_sensitive (GTK_WIDGET (st->button), FALSE); - gtk_widget_set_sensitive (GTK_WIDGET (st->load_inhibit_check), FALSE); - return; - } + { + for (i=0; i < NUM_INFO_LINES; i++) + gtk_label_set_text (GTK_LABEL (st->label[i]), ""); + gtk_label_set_text (GTK_LABEL(st->button_label), _("")); + gtk_widget_set_sensitive (GTK_WIDGET (st->button), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (st->load_inhibit_check), FALSE); + return; + } if (mod->info) - { - text[0] = mod->info->purpose; - text[1] = mod->info->author; - text[2] = mod->info->version; - text[3] = mod->info->copyright; - text[4] = mod->info->date; - text[5] = mod->ondisk? _("on disk") : _("only in memory"); - } + { + text[0] = mod->info->purpose; + text[1] = mod->info->author; + text[2] = mod->info->version; + text[3] = mod->info->copyright; + text[4] = mod->info->date; + text[5] = mod->ondisk? _("on disk") : _("only in memory"); + } else - { - text[0] = "--"; - text[1] = "--"; - text[2] = "--"; - text[3] = "--"; - text[4] = "--"; - text[5] = mod->ondisk? _("on disk") : _("nowhere (click 'refresh')"); - } - + { + text[0] = "--"; + text[1] = "--"; + text[2] = "--"; + text[3] = "--"; + text[4] = "--"; + text[5] = mod->ondisk? _("on disk") : _("nowhere (click 'refresh')"); + } if (mod->state == ST_MODULE_ERROR && mod->last_module_error) status = g_strdup_printf ("%s (%s)", gettext (statename[mod->state]), mod->last_module_error); else - { - status = g_strdup (gettext (statename[mod->state])); - } + { + status = g_strdup (gettext (statename[mod->state])); + } for (i=0; i < NUM_INFO_LINES - 1; i++) - { - gtk_label_set_text (GTK_LABEL (st->label[i]), gettext (text[i])); - } + { + gtk_label_set_text (GTK_LABEL (st->label[i]), gettext (text[i])); + } gtk_label_set_text (GTK_LABEL (st->label[NUM_INFO_LINES-1]), status); @@ -827,33 +856,36 @@ browser_info_update (module_info *mod, gtk_widget_set_sensitive (GTK_WIDGET (st->load_inhibit_check), TRUE); /* work out what the button should do (if anything) */ - switch (mod->state) { - case ST_MODULE_ERROR: - case ST_LOAD_FAILED: - case ST_UNLOADED_OK: - gtk_label_set_text (GTK_LABEL(st->button_label), _("Load")); - gtk_widget_set_sensitive (GTK_WIDGET (st->button), mod->ondisk); - break; + switch (mod->state) + { + case ST_MODULE_ERROR: + case ST_LOAD_FAILED: + case ST_UNLOADED_OK: + gtk_label_set_text (GTK_LABEL(st->button_label), _("Load")); + gtk_widget_set_sensitive (GTK_WIDGET (st->button), mod->ondisk); + break; - case ST_UNLOAD_REQUESTED: - gtk_widget_set_sensitive (GTK_WIDGET (st->button), FALSE); - break; + case ST_UNLOAD_REQUESTED: + gtk_widget_set_sensitive (GTK_WIDGET (st->button), FALSE); + break; - case ST_LOADED_OK: - gtk_label_set_text (GTK_LABEL(st->button_label), _("Unload")); - gtk_widget_set_sensitive (GTK_WIDGET (st->button), - mod->unload? TRUE : FALSE); - break; - } + case ST_LOADED_OK: + gtk_label_set_text (GTK_LABEL(st->button_label), _("Unload")); + gtk_widget_set_sensitive (GTK_WIDGET (st->button), + mod->unload? TRUE : FALSE); + break; + } } static void -browser_info_init (browser_st *st, - GtkWidget *table) +browser_info_init (BrowserState *st, + GtkWidget *table) { GtkWidget *label; - int i; - char *text[] = { + gint i; + + gchar *text[] = + { N_("Purpose:"), N_("Author:"), N_("Version:"), @@ -864,22 +896,22 @@ browser_info_init (browser_st *st, }; for (i=0; i < sizeof(text) / sizeof(char *); i++) - { - label = gtk_label_new (gettext (text[i])); - gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); - gtk_table_attach (GTK_TABLE (table), label, 0, 1, i, i+1, - GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 2); - gtk_widget_show (label); + { + label = gtk_label_new (gettext (text[i])); + gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, i, i+1, + GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 2); + gtk_widget_show (label); - st->label[i] = gtk_label_new (""); - gtk_misc_set_alignment (GTK_MISC (st->label[i]), 0.0, 0.5); - gtk_table_attach (GTK_TABLE (st->table), st->label[i], 1, 2, i, i+1, - GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 2); - gtk_widget_show (st->label[i]); - } + st->label[i] = gtk_label_new (""); + gtk_misc_set_alignment (GTK_MISC (st->label[i]), 0.0, 0.5); + gtk_table_attach (GTK_TABLE (st->table), st->label[i], 1, 2, i, i+1, + GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 2); + gtk_widget_show (st->label[i]); + } st->load_inhibit_check = - gtk_check_button_new_with_label (_("Autoload during startup")); + gtk_check_button_new_with_label (_("Autoload during startup")); gtk_widget_show (st->load_inhibit_check); gtk_table_attach (GTK_TABLE (table), st->load_inhibit_check, 0, 2, i, i+1, @@ -892,8 +924,8 @@ static void browser_select_callback (GtkWidget *widget, GtkWidget *child) { - module_info *i; - browser_st *st; + ModuleInfo *i; + BrowserState *st; i = gtk_object_get_user_data (GTK_OBJECT (child)); st = gtk_object_get_user_data (GTK_OBJECT (widget)); @@ -911,7 +943,7 @@ static void browser_load_unload_callback (GtkWidget *widget, gpointer data) { - browser_st *st = data; + BrowserState *st = data; if (st->last_update->state == ST_LOADED_OK) mod_unload (st->last_update, FALSE); @@ -926,9 +958,9 @@ static void make_list_item (gpointer data, gpointer user_data) { - module_info *info = data; - browser_st *st = user_data; - GtkWidget *list_item; + ModuleInfo *info = data; + BrowserState *st = user_data; + GtkWidget *list_item; if (!st->last_update) st->last_update = info; @@ -943,22 +975,22 @@ make_list_item (gpointer data, static void -browser_info_add (GimpSet *set, - module_info *mod, - browser_st *st) +browser_info_add (GimpSet *set, + ModuleInfo *mod, + BrowserState *st) { make_list_item (mod, st); } static void -browser_info_remove (GimpSet *set, - module_info *mod, - browser_st *st) +browser_info_remove (GimpSet *set, + ModuleInfo *mod, + BrowserState *st) { GList *dlist, *free_list; GtkWidget *list_item; - module_info *i; + ModuleInfo *i; dlist = gtk_container_children (GTK_CONTAINER (st->list)); free_list = dlist; @@ -990,10 +1022,10 @@ static void module_db_module_ondisk (gpointer data, gpointer user_data) { - module_info *mod = data; + ModuleInfo *mod = data; struct stat statbuf; - int ret; - int old_ondisk = mod->ondisk; + gint ret; + gint old_ondisk = mod->ondisk; GSList **kill_list = user_data; ret = stat (mod->fullpath, &statbuf); @@ -1005,10 +1037,10 @@ module_db_module_ondisk (gpointer data, /* if it's not on the disk, and it isn't in memory, mark it to be * removed later. */ if (!mod->ondisk && !mod->module) - { - *kill_list = g_slist_append (*kill_list, mod); - mod = NULL; - } + { + *kill_list = g_slist_append (*kill_list, mod); + mod = NULL; + } if (mod && mod->ondisk != old_ondisk) module_info_modified (mod); @@ -1019,7 +1051,7 @@ static void module_db_module_remove (gpointer data, gpointer user_data) { - module_info *mod = data; + ModuleInfo *mod = data; gimp_set_remove (modules, mod); @@ -1028,23 +1060,24 @@ module_db_module_remove (gpointer data, -typedef struct { - const char *search_key; - module_info *found; +typedef struct +{ + const gchar *search_key; + ModuleInfo *found; } find_by_path_closure; static void module_db_path_cmp (gpointer data, gpointer user_data) { - module_info *mod = data; + ModuleInfo *mod = data; find_by_path_closure *cl = user_data; if (!strcmp (mod->fullpath, cl->search_key)) cl->found = mod; } -static module_info * +static ModuleInfo * module_find_by_path (const char *fullpath) { find_by_path_closure cl; @@ -1078,7 +1111,7 @@ browser_refresh_callback (GtkWidget *widget, static void -gimp_module_ref (module_info *mod) +gimp_module_ref (ModuleInfo *mod) { g_return_if_fail (mod->refs >= 0); g_return_if_fail (mod->module != NULL); @@ -1086,7 +1119,7 @@ gimp_module_ref (module_info *mod) } static void -gimp_module_unref (module_info *mod) +gimp_module_unref (ModuleInfo *mod) { g_return_if_fail (mod->refs > 0); g_return_if_fail (mod->module != NULL); @@ -1094,11 +1127,11 @@ gimp_module_unref (module_info *mod) mod->refs--; if (mod->refs == 0) - { - TRC (("module %p refs hit 0, g_module_closing it\n", mod)); - g_module_close (mod->module); - mod->module = NULL; - } + { + TRC (("module %p refs hit 0, g_module_closing it\n", mod)); + g_module_close (mod->module); + mod->module = NULL; + } } /* End of module_db.c */ diff --git a/app/module_db.h b/app/module_db.h index 93de1d8bf4..f178502b8e 100644 --- a/app/module_db.h +++ b/app/module_db.h @@ -17,14 +17,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - #ifndef __MODULE_DB_H__ + /* Load any modules we find on the module-path set in the gimprc */ -void module_db_init (void); +void module_db_init (void); /* Unload all modules, in case a module needs some cleanups */ -void module_db_free (void); +void module_db_free (void); GtkWidget *module_db_browser_new (void); diff --git a/devel-docs/ChangeLog b/devel-docs/ChangeLog index 839c51a2f0..2b288eedde 100644 --- a/devel-docs/ChangeLog +++ b/devel-docs/ChangeLog @@ -1,3 +1,32 @@ +2000-05-28 Michael Natterer + + * libgimp/libgimp-decl.txt + * libgimp/libgimp-docs.sgml + * libgimp/libgimp-sections.txt + * libgimp/tmpl/gimp.sgml + * libgimp/tmpl/gimpcolorbutton.sgml + * libgimp/tmpl/gimpcolordisplay.sgml + * libgimp/tmpl/gimpcolorselector.sgml + * libgimp/tmpl/gimpcolorspace.sgml + * libgimp/tmpl/gimpcompat.sgml + * libgimp/tmpl/gimpenums.sgml + * libgimp/tmpl/gimpfeatures.sgml + * libgimp/tmpl/gimplimits.sgml + * libgimp/tmpl/gimpmath.sgml + * libgimp/tmpl/gimpmodule.sgml + * libgimp/tmpl/gimpparasite.sgml + * libgimp/tmpl/gimpparasiteio.sgml + * libgimp/tmpl/gimppixmap.sgml + * libgimp/tmpl/gimpprotocol.sgml + * libgimp/tmpl/gimpsignal.sgml + * libgimp/tmpl/gimpui.sgml + * libgimp/tmpl/gimpunit.sgml + * libgimp/tmpl/gimputils.sgml + * libgimp/tmpl/gimpvector.sgml + * libgimp/tmpl/gimpwire.sgml + * libgimp/tmpl/libgimp-unused.sgml: Moved the module documentation + from the libgimp headers here, updates, cleanups. + 2000-05-27 Michael Natterer * libgimp/*: lotsa files removed/added/changed to reflect the diff --git a/devel-docs/libgimp/libgimp-decl.txt b/devel-docs/libgimp/libgimp-decl.txt index 28a16a05dd..6f99cebeba 100644 --- a/devel-docs/libgimp/libgimp-decl.txt +++ b/devel-docs/libgimp/libgimp-decl.txt @@ -108,16 +108,16 @@ gchar *name, struct GPlugInInfo { /* called when the gimp application initially starts up */ - void (*init_proc) (void); + void (* init_proc) (void); /* called when the gimp application exits */ - void (*quit_proc) (void); + void (* quit_proc) (void); /* called by the gimp so that the plug-in can inform the * gimp of what it does. (ie. installing a procedure database * procedure). */ - void (*query_proc) (void); + void (* query_proc) (void); /* called to run a procedure the plug-in installed in the * procedure database. @@ -281,28 +281,28 @@ struct GParam gimp_main -int -int argc,char *argv[] +gint +gint argc,gchar *argv[] gimp_set_data void -gchar * id,gpointer data,guint32 length +gchar *id,gpointer data,guint32 length gimp_get_data void -gchar * id,gpointer data +gchar *id,gpointer data gimp_get_data_size guint32 -gchar * id +gchar *id gimp_progress_init void -char *message +gchar *message gimp_progress_update @@ -331,7 +331,7 @@ gchar *proc_name,gchar **proc_blurb,gchar **proc_help,gchar gimp_query_images -gint32 * +gint32 * gint *nimages @@ -366,12 +366,12 @@ gchar *name,gchar *extensions,gchar *prefixes gimp_run_procedure -GParam * +GParam * gchar *name,gint *nreturn_vals,... gimp_run_procedure2 -GParam * +GParam * gchar *name,gint *nreturn_vals,gint nparams,GParam *params @@ -422,292 +422,292 @@ void gimp_image_new gint32 -guint width,guint height,GImageType type +guint width,guint height,GImageType type gimp_image_duplicate gint32 -gint32 image_ID +gint32 image_ID gimp_image_delete void -gint32 image_ID +gint32 image_ID gimp_image_width guint -gint32 image_ID +gint32 image_ID gimp_image_height guint -gint32 image_ID +gint32 image_ID gimp_image_base_type GImageType -gint32 image_ID +gint32 image_ID gimp_image_floating_selection gint32 -gint32 image_ID +gint32 image_ID gimp_image_add_channel void -gint32 image_ID,gint32 channel_ID,gint position +gint32 image_ID,gint32 channel_ID,gint position gimp_image_add_layer void -gint32 image_ID,gint32 layer_ID,gint position +gint32 image_ID,gint32 layer_ID,gint position gimp_image_add_layer_mask void -gint32 image_ID,gint32 layer_ID,gint32 mask_ID +gint32 image_ID,gint32 layer_ID,gint32 mask_ID gimp_image_clean_all void -gint32 image_ID +gint32 image_ID gimp_image_undo_disable void -gint32 image_ID +gint32 image_ID gimp_image_undo_enable void -gint32 image_ID +gint32 image_ID gimp_image_undo_freeze void -gint32 image_ID +gint32 image_ID gimp_image_undo_thaw void -gint32 image_ID +gint32 image_ID gimp_undo_push_group_start void -gint32 image_ID +gint32 image_ID gimp_undo_push_group_end void -gint32 image_ID +gint32 image_ID gimp_image_clean_all void -gint32 image_ID +gint32 image_ID gimp_image_flatten gint32 -gint32 image_ID +gint32 image_ID gimp_image_lower_channel void -gint32 image_ID,gint32 channel_ID +gint32 image_ID,gint32 channel_ID gimp_image_lower_layer void -gint32 image_ID,gint32 layer_ID +gint32 image_ID,gint32 layer_ID gimp_image_merge_visible_layers gint32 -gint32 image_ID,GimpMergeType merge_type +gint32 image_ID,GimpMergeType merge_type gimp_image_pick_correlate_layer gint32 -gint32 image_ID,gint x,gint y +gint32 image_ID,gint x,gint y gimp_image_raise_channel void -gint32 image_ID,gint32 channel_ID +gint32 image_ID,gint32 channel_ID gimp_image_raise_layer void -gint32 image_ID,gint32 layer_ID +gint32 image_ID,gint32 layer_ID gimp_image_remove_channel void -gint32 image_ID,gint32 channel_ID +gint32 image_ID,gint32 channel_ID gimp_image_remove_layer void -gint32 image_ID,gint32 layer_ID +gint32 image_ID,gint32 layer_ID gimp_image_remove_layer_mask void -gint32 image_ID,gint32 layer_ID,gint mode +gint32 image_ID,gint32 layer_ID,gint mode gimp_image_resize void -gint32 image_ID,guint new_width,guint new_height,gint offset_x,gint offset_y +gint32 image_ID,guint new_width,guint new_height,gint offset_x,gint offset_y gimp_image_get_active_channel gint32 -gint32 image_ID +gint32 image_ID gimp_image_get_active_layer gint32 -gint32 image_ID +gint32 image_ID gimp_image_get_channels -gint32 * -gint32 image_ID,gint *nchannels +gint32 * +gint32 image_ID,gint *nchannels gimp_image_get_cmap -guchar * -gint32 image_ID,gint *ncolors +guchar * +gint32 image_ID,gint *ncolors gimp_image_get_component_active gboolean -gint32 image_ID,gint component +gint32 image_ID,gint component gimp_image_get_component_visible gboolean -gint32 image_ID,gint component +gint32 image_ID,gint component gimp_image_get_filename -gchar * -gint32 image_ID +gchar * +gint32 image_ID gimp_image_get_layers -gint32 * -gint32 image_ID,gint *nlayers +gint32 * +gint32 image_ID,gint *nlayers gimp_image_get_selection gint32 -gint32 image_ID +gint32 image_ID gimp_image_set_active_channel void -gint32 image_ID,gint32 channel_ID +gint32 image_ID,gint32 channel_ID gimp_image_set_active_layer void -gint32 image_ID,gint32 layer_ID +gint32 image_ID,gint32 layer_ID gimp_image_set_cmap void -gint32 image_ID,guchar *cmap,gint ncolors +gint32 image_ID,guchar *cmap,gint ncolors gimp_image_set_component_active void -gint32 image_ID,gint component,gboolean active +gint32 image_ID,gint component,gboolean active gimp_image_set_component_visible void -gint32 image_ID,gint component,gboolean visible +gint32 image_ID,gint component,gboolean visible gimp_image_set_filename void -gint32 image_ID,gchar *name +gint32 image_ID,gchar *name gimp_image_parasite_find GimpParasite * -gint32 image_ID,const gchar *name +gint32 image_ID,const gchar *name gimp_image_parasite_attach void -gint32 image_ID,const GimpParasite *parasite +gint32 image_ID,const GimpParasite *parasite gimp_image_attach_new_parasite void -gint32 image_ID,const gchar *name,gint flags,gint size,const gpointer data +gint32 image_ID,const gchar *name,gint flags,gint size,const gpointer data gimp_image_parasite_detach void -gint32 image_ID,const gchar *name +gint32 image_ID,const gchar *name gimp_image_set_resolution void -gint32 image_ID,double xresolution,double yresolution +gint32 image_ID,gdouble xresolution,gdouble yresolution gimp_image_get_resolution void -gint32 image_ID,double *xresolution,double *yresolution +gint32 image_ID,gdouble *xresolution,gdouble *yresolution gimp_image_set_unit void -gint32 image_ID,GimpUnit unit +gint32 image_ID,GimpUnit unit gimp_image_get_unit GimpUnit -gint32 image_ID +gint32 image_ID gimp_image_get_layer_by_tattoo gint32 -gint32 image_ID,gint32 tattoo +gint32 image_ID,gint32 tattoo gimp_image_get_channel_by_tattoo gint32 -gint32 image_ID,gint32 tattoo +gint32 image_ID,gint32 tattoo gimp_image_get_thumbnail_data -guchar * -gint32 image_ID,gint *width,gint *height,gint *bytes +guchar * +gint32 image_ID,gint *width,gint *height,gint *bytes gimp_image_convert_rgb void -gint32 image_ID +gint32 image_ID gimp_image_convert_grayscale void -gint32 image_ID +gint32 image_ID gimp_image_convert_indexed void -gint32 image_ID,GimpConvertDitherType dither_type,GimpConvertPaletteType palette_type,gint num_colors,gint alpha_dither,gint remove_unused,gchar *palette +gint32 image_ID,GimpConvertDitherType dither_type,GimpConvertPaletteType palette_type,gint num_colors,gint alpha_dither,gint remove_unused,gchar *palette gimp_image_add_hguide @@ -757,7 +757,7 @@ void gimp_layer_new gint32 -gint32 image_ID,char *name,guint width,guint height,GDrawableType type,gdouble opacity,GLayerMode mode +gint32 image_ID,char *name,guint width,guint height,GDrawableType type,gdouble opacity,GLayerMode mode gimp_layer_copy @@ -816,7 +816,7 @@ gint32 layer_ID,gint offset_x,gint offset_y gimp_layer_is_floating_selection -gint +gboolean gint32 layer_ID @@ -831,12 +831,12 @@ gint32 layer_ID gimp_layer_get_apply_mask -gint +gboolean gint32 layer_ID gimp_layer_get_edit_mask -gint +gboolean gint32 layer_ID @@ -846,7 +846,7 @@ gint32 layer_ID gimp_layer_get_name -char * +gchar * gint32 layer_ID @@ -856,7 +856,7 @@ gint32 layer_ID gimp_layer_get_preserve_transparency -gint +gboolean gint32 layer_ID @@ -872,12 +872,12 @@ gint32 layer_ID gimp_layer_set_apply_mask void -gint32 layer_ID,gint apply_mask +gint32 layer_ID,gboolean apply_mask gimp_layer_set_edit_mask void -gint32 layer_ID,gint edit_mask +gint32 layer_ID,gboolean edit_mask gimp_layer_set_mode @@ -887,7 +887,7 @@ gint32 layer_ID,GLayerMode mode gimp_layer_set_name void -gint32 layer_ID,char *name +gint32 layer_ID,gchar *name gimp_layer_set_offsets @@ -902,17 +902,17 @@ gint32 layer_ID,gdouble opacity gimp_layer_set_preserve_transparency void -gint32 layer_ID,gint preserve_transparency +gint32 layer_ID,gboolean preserve_transparency gimp_layer_set_show_mask void -gint32 layer_ID,gint show_mask +gint32 layer_ID,gboolean show_mask gimp_layer_set_visible void -gint32 layer_ID,gint visible +gint32 layer_ID,gboolean visible gimp_layer_get_tattoo @@ -922,292 +922,292 @@ gint32 layer_ID gimp_channel_new gint32 -gint32 image_ID,gchar *name,guint width,guint height,gdouble opacity,guchar *color +gint32 image_ID,gchar *name,guint width,guint height,gdouble opacity,guchar *color gimp_channel_copy gint32 -gint32 channel_ID +gint32 channel_ID gimp_channel_delete void -gint32 channel_ID +gint32 channel_ID gimp_channel_width guint -gint32 channel_ID +gint32 channel_ID gimp_channel_height guint -gint32 channel_ID +gint32 channel_ID gimp_channel_get_image_id gint32 -gint32 channel_ID +gint32 channel_ID gimp_channel_get_layer_id gint32 -gint32 channel_ID +gint32 channel_ID gimp_channel_get_color void -gint32 channel_ID,guchar *red,guchar *green,guchar *blue +gint32 channel_ID,guchar *red,guchar *green,guchar *blue gimp_channel_get_name -gchar * -gint32 channel_ID +gchar * +gint32 channel_ID gimp_channel_get_opacity gdouble -gint32 channel_ID +gint32 channel_ID gimp_channel_get_show_masked gint -gint32 channel_ID +gint32 channel_ID gimp_channel_get_visible gboolean -gint32 channel_ID +gint32 channel_ID gimp_channel_set_color void -gint32 channel_ID,guchar red,guchar green,guchar blue +gint32 channel_ID,guchar red,guchar green,guchar blue gimp_channel_set_name void -gint32 channel_ID,gchar *name +gint32 channel_ID,gchar *name gimp_channel_set_opacity void -gint32 channel_ID,gdouble opacity +gint32 channel_ID,gdouble opacity gimp_channel_set_show_masked void -gint32 channel_ID,gint show_masked +gint32 channel_ID,gint show_masked gimp_channel_set_visible void -gint32 channel_ID,gboolean visible +gint32 channel_ID,gboolean visible gimp_channel_get_tattoo gint32 -gint32 channel_ID +gint32 channel_ID gimp_drawable_get -GDrawable * -gint32 drawable_ID +GDrawable * +gint32 drawable_ID gimp_drawable_detach void -GDrawable *drawable +GDrawable *drawable gimp_drawable_flush void -GDrawable *drawable +GDrawable *drawable gimp_drawable_delete void -GDrawable *drawable +GDrawable *drawable gimp_drawable_update void -gint32 drawable_ID,gint x,gint y,guint width,guint height +gint32 drawable_ID,gint x,gint y,guint width,guint height gimp_drawable_merge_shadow void -gint32 drawable_ID,gint undoable +gint32 drawable_ID,gboolean undoable gimp_drawable_image_id gint32 -gint32 drawable_ID +gint32 drawable_ID gimp_drawable_name -gchar * -gint32 drawable_ID +gchar * +gint32 drawable_ID gimp_drawable_width guint -gint32 drawable_ID +gint32 drawable_ID gimp_drawable_height guint -gint32 drawable_ID +gint32 drawable_ID gimp_drawable_bpp guint -gint32 drawable_ID +gint32 drawable_ID gimp_drawable_type GDrawableType -gint32 drawable_ID +gint32 drawable_ID gimp_drawable_visible gboolean -gint32 drawable_ID +gint32 drawable_ID gimp_drawable_is_channel gboolean -gint32 drawable_ID +gint32 drawable_ID gimp_drawable_is_rgb gboolean -gint32 drawable_ID +gint32 drawable_ID gimp_drawable_is_gray gboolean -gint32 drawable_ID +gint32 drawable_ID gimp_drawable_has_alpha gboolean -gint32 drawable_ID +gint32 drawable_ID gimp_drawable_is_indexed gboolean -gint32 drawable_ID +gint32 drawable_ID gimp_drawable_is_layer gboolean -gint32 drawable_ID +gint32 drawable_ID gimp_drawable_is_layer_mask gboolean -gint32 drawable_ID +gint32 drawable_ID gimp_drawable_mask_bounds gboolean -gint32 drawable_ID,gint *x1,gint *y1,gint *x2,gint *y2 +gint32 drawable_ID,gint *x1,gint *y1,gint *x2,gint *y2 gimp_drawable_offsets void -gint32 drawable_ID,gint *offset_x,gint *offset_y +gint32 drawable_ID,gint *offset_x,gint *offset_y gimp_drawable_fill void -gint32 drawable_ID,GimpFillType fill_type +gint32 drawable_ID,GimpFillType fill_type gimp_drawable_set_name void -gint32 drawable_ID,char *name +gint32 drawable_ID,gchar *name gimp_drawable_set_visible void -gint32 drawable_ID,gint visible +gint32 drawable_ID,gint visible gimp_drawable_get_tile -GTile * -GDrawable *drawable,gint shadow,gint row,gint col +GTile * +GDrawable *drawable,gint shadow,gint row,gint col gimp_drawable_get_tile2 -GTile * -GDrawable *drawable,gint shadow,gint x,gint y +GTile * +GDrawable *drawable,gint shadow,gint x,gint y gimp_drawable_parasite_find -GimpParasite * -gint32 drawable,const gchar *name +GimpParasite * +gint32 drawable,const gchar *name gimp_drawable_parasite_attach void -gint32 drawable,const GimpParasite *parasite +gint32 drawable,const GimpParasite *parasite gimp_drawable_attach_new_parasite void -gint32 drawable,const gchar *name,gint flags,gint size,const gpointer data +gint32 drawable,const gchar *name,gint flags,gint size,const gpointer data gimp_drawable_parasite_detach void -gint32 drawable,const char *name +gint32 drawable,const gchar *name gimp_drawable_get_thumbnail_data -guchar * -gint32 drawable_ID,gint *width,gint *height,gint *bytes +guchar * +gint32 drawable_ID,gint *width,gint *height,gint *bytes gimp_selection_bounds gint32 -gint32 image_ID,gint32 *non_empty,gint32 *x1,gint32 *y1,gint32 *x2,gint32 *y2 +gint32 image_ID,gint32 *non_empty,gint32 *x1,gint32 *y1,gint32 *x2,gint32 *y2 gimp_selection_float gint32 -gint32 image_ID,gint32 drawable_ID,gint32 x_offset,gint32 y_offset +gint32 image_ID,gint32 drawable_ID,gint32 x_offset,gint32 y_offset gimp_selection_is_empty gint32 -gint32 image_ID +gint32 image_ID gimp_selection_none void -gint32 image_ID +gint32 image_ID gimp_tile_ref void -GTile *tile +GTile *tile gimp_tile_ref_zero void -GTile *tile +GTile *tile gimp_tile_unref void -GTile *tile,gint dirty +GTile *tile,gint dirty gimp_tile_flush void -GTile *tile +GTile *tile gimp_tile_cache_size @@ -1232,67 +1232,67 @@ void gimp_pixel_rgn_init void -GPixelRgn *pr,GDrawable *drawable,int x,int y,int width,int height,int dirty,int shadow +GPixelRgn *pr,GDrawable *drawable,gint x,gint y,gint width,gint height,gint dirty,gint shadow gimp_pixel_rgn_resize void -GPixelRgn *pr,int x,int y,int width,int height +GPixelRgn *pr,gint x,gint y,gint width,gint height gimp_pixel_rgn_get_pixel void -GPixelRgn *pr,guchar *buf,int x,int y +GPixelRgn *pr,guchar *buf,gint x,gint y gimp_pixel_rgn_get_row void -GPixelRgn *pr,guchar *buf,int x,int y,int width +GPixelRgn *pr,guchar *buf,gint x,gint y,gint width gimp_pixel_rgn_get_col void -GPixelRgn *pr,guchar *buf,int x,int y,int height +GPixelRgn *pr,guchar *buf,gint x,gint y,gint height gimp_pixel_rgn_get_rect void -GPixelRgn *pr,guchar *buf,int x,int y,int width,int height +GPixelRgn *pr,guchar *buf,gint x,gint y,gint width,gint height gimp_pixel_rgn_set_pixel void -GPixelRgn *pr,guchar *buf,int x,int y +GPixelRgn *pr,guchar *buf,gint x,gint y gimp_pixel_rgn_set_row void -GPixelRgn *pr,guchar *buf,int x,int y,int width +GPixelRgn *pr,guchar *buf,gint x,gint y,gint width gimp_pixel_rgn_set_col void -GPixelRgn *pr,guchar *buf,int x,int y,int height +GPixelRgn *pr,guchar *buf,gint x,gint y,gint height gimp_pixel_rgn_set_rect void -GPixelRgn *pr,guchar *buf,int x,int y,int width,int height +GPixelRgn *pr,guchar *buf,gint x,gint y,gint width,gint height gimp_pixel_rgns_register gpointer -int nrgns,... +gint nrgns,... gimp_pixel_rgns_register2 gpointer -int nrgns,GPixelRgn **prs +gint nrgns,GPixelRgn **prs gimp_pixel_rgns_process gpointer -gpointer pri_ptr +gpointer pri_ptr gimp_palette_get_background @@ -1327,7 +1327,7 @@ void gimp_gradients_set_active void -char *name +gchar *name gimp_gradients_sample_uniform @@ -2643,22 +2643,45 @@ gpointer popup_pnt GimpModuleStatus -typedef enum { +typedef enum +{ GIMP_MODULE_OK, GIMP_MODULE_UNLOAD } GimpModuleStatus; GimpModuleInfo -typedef struct { - void *shutdown_data; - const char *purpose; - const char *author; - const char *version; - const char *copyright; - const char *date; -} GimpModuleInfo; + +GimpModuleInfo +struct GimpModuleInfo +{ + gpointer shutdown_data; + + const gchar *purpose; + const gchar *author; + const gchar *version; + const gchar *copyright; + const gchar *date; +}; + + +GimpModuleInitFunc +GimpModuleStatus +GimpModuleInfo **module_info + + +GimpModuleCompletedCB +void +gpointer completed_data + + +GimpModuleUnloadFunc +void +gpointer shutdown_data, + GimpModuleCompletedCB completed_cb, + gpointer completed_data + GIMP_TYPE_PATH_EDITOR #define GIMP_TYPE_PATH_EDITOR (gimp_path_editor_get_type ()) @@ -4455,44 +4478,52 @@ struct GimpColorDisplayMethods gimp_color_display_register gboolean -const char *name,GimpColorDisplayMethods *methods +const gchar *name,GimpColorDisplayMethods *methods gimp_color_display_unregister gboolean -const char *name +const gchar *name GimpColorSelector_Callback void -void *data, int r, int g, int b +gpointer data, + gint r, + gint g, + gint b GimpColorSelector_NewFunc GtkWidget * -int r, int g, int b, - GimpColorSelector_Callback cb, - void *data, - void **selector_data +gint r, + gint g, + gint b, + GimpColorSelector_Callback cb, + gpointer data, + gpointer *selector_data GimpColorSelector_FreeFunc void -void *selector_data +gpointer selector_data GimpColorSelector_SetColorFunc void -void *selector_data, - int r, int g, int b, - int set_current +gpointer selector_data, + gint r, + gint g, + gint b, + gboolean set_current GimpColorSelectorMethods GimpColorSelectorMethods -struct GimpColorSelectorMethods { +struct GimpColorSelectorMethods +{ GimpColorSelector_NewFunc new; GimpColorSelector_FreeFunc free; GimpColorSelector_SetColorFunc setcolor; @@ -4500,15 +4531,20 @@ struct GimpColorSelectorMethods { GimpColorSelectorID -typedef void *GimpColorSelectorID; +typedef gpointer GimpColorSelectorID; gimp_color_selector_register GimpColorSelectorID -const char *name,const char *help_page,GimpColorSelectorMethods *methods +const gchar *name,const gchar *help_page,GimpColorSelectorMethods *methods + +GimpColorSelectorFinishedCB +void +gpointer finished_data + gimp_color_selector_unregister gboolean -GimpColorSelectorID id,void (*callback)(void *data),void *data +GimpColorSelectorID id,GimpColorSelectorFinishedCB finished_cb,gpointer finished_data diff --git a/devel-docs/libgimp/libgimp-docs.sgml b/devel-docs/libgimp/libgimp-docs.sgml index cf0eddd807..9e6fad21cd 100644 --- a/devel-docs/libgimp/libgimp-docs.sgml +++ b/devel-docs/libgimp/libgimp-docs.sgml @@ -66,6 +66,7 @@ GIMP User Interface Library + &libgimp-gimpui; &GimpChainButton; &GimpColorButton; &GimpFileSelection; @@ -78,7 +79,6 @@ &libgimp-gimphelpui; &libgimp-gimpmenu; &libgimp-gimpquerybox; - &libgimp-gimpui; &libgimp-gimpwidgets; diff --git a/devel-docs/libgimp/libgimp-sections.txt b/devel-docs/libgimp/libgimp-sections.txt index e9bd6ee477..81b1908120 100644 --- a/devel-docs/libgimp/libgimp-sections.txt +++ b/devel-docs/libgimp/libgimp-sections.txt @@ -227,7 +227,6 @@ gimp_parasite_find gimp_parasite_attach gimp_attach_new_parasite gimp_parasite_detach -gimp_plugin_help_func gimp_help gimp_plugin_help_register gimp_plugin_domain_add_with_path @@ -528,6 +527,7 @@ GimpColorSelector_SetColorFunc GimpColorSelectorMethods GimpColorSelectorID gimp_color_selector_register +GimpColorSelectorFinishedCB gimp_color_selector_unregister @@ -535,6 +535,9 @@ gimp_color_selector_unregister gimpmodule GimpModuleStatus GimpModuleInfo +GimpModuleInitFunc +GimpModuleCompletedCB +GimpModuleUnloadFunc
@@ -631,6 +634,7 @@ gimp_image_disable_undo gimp_image_enable_undo gimp_image_freeze_undo gimp_image_thaw_undo +gimp_plugin_help_func Parasite PARASITE_PERSISTENT PARASITE_UNDOABLE diff --git a/devel-docs/libgimp/tmpl/gimp.sgml b/devel-docs/libgimp/tmpl/gimp.sgml index e93a04a8cd..4a141081d8 100644 --- a/devel-docs/libgimp/tmpl/gimp.sgml +++ b/devel-docs/libgimp/tmpl/gimp.sgml @@ -2,10 +2,13 @@ gimp - +Main functions needed for building a GIMP plug-in. This header includes +all other GIMP Library headers. +Main functions needed for building a GIMP plug-in. This header includes +all other GIMP Library headers. @@ -2177,15 +2180,6 @@ gimp @name: - - - - - - -@help_data: - - diff --git a/devel-docs/libgimp/tmpl/gimpcolorbutton.sgml b/devel-docs/libgimp/tmpl/gimpcolorbutton.sgml index 1c2f273023..922d0c7129 100644 --- a/devel-docs/libgimp/tmpl/gimpcolorbutton.sgml +++ b/devel-docs/libgimp/tmpl/gimpcolorbutton.sgml @@ -21,7 +21,7 @@ Note that the color is changed in place. - +#libgimp-gimpcolorspace diff --git a/devel-docs/libgimp/tmpl/gimpcolordisplay.sgml b/devel-docs/libgimp/tmpl/gimpcolordisplay.sgml index 3a8377b75b..9d9494c894 100644 --- a/devel-docs/libgimp/tmpl/gimpcolordisplay.sgml +++ b/devel-docs/libgimp/tmpl/gimpcolordisplay.sgml @@ -2,16 +2,22 @@ gimpcolordisplay - +Functions and definitiions for creating a pluggable GIMP +display color correction module. +Functions and definitiions for creating a pluggable GIMP +display color correction module. - +#GModule + + +#libgimp-gimpmodule diff --git a/devel-docs/libgimp/tmpl/gimpcolorselector.sgml b/devel-docs/libgimp/tmpl/gimpcolorselector.sgml index e44649e1fb..105d7d917e 100644 --- a/devel-docs/libgimp/tmpl/gimpcolorselector.sgml +++ b/devel-docs/libgimp/tmpl/gimpcolorselector.sgml @@ -2,61 +2,91 @@ gimpcolorselector - +Functions and definitiions for creating a pluggable GIMP +color selector module. +Functions and definitiions for creating a pluggable GIMP +color selector module. - +#GModule + + +#libgimp-gimpmodule - +A function of this type should be called by the color selector each +time the user modifies the selected color. -@data: -@r: -@g: -@b: +@data: The @data passed to the #GimpColorSelector_NewFunc function. +@r: The new color's red component. +@g: The new color's green component. +@b: The new color's blue component. - +A function of this type is called to create a new instance of the +color selector. The new selector should set its current color to +the RGB triple given (each component is in the range 0 - 255 +inclusive, with white at 255,255,255 and black at 0,0,0). + + +The selector should call @cb with argument @data each time the +user modifies the selected color. + + +The selector must return a #GtkWidget which implements the color +selection UI. The selector can optionally return @selector_data, +an opaque pointer which will be passed in to subsequent invokations +on the selector. -@r: -@g: -@b: -@cb: -@data: -@selector_data: -@Returns: +@r: The red component of intitial color. +@g: The green component of intitial color. +@b: The blue component of intitial color. +@cb: The function to call each time the user modifies the selected color. +@data: The @data to pass to @cb. +@selector_data: An optional data pointer which will be passed in to subsequent invokations on the selector. +@Returns: A #GtkWidget which implements the color selection UI. - +A function of this type is called when the color selector is no +longer required. This function should *not* free widgets that are +containted within the UI widget returned by new(), since they are +destroyed on behalf of the selector by the caller of this +function. -@selector_data: +@selector_data: The @selector_data pointer returned by the #GimpColorSelector_NewFunc function. - +A function of this type is called to change the selector's current +color. The required color is specified as in the new() function. +If the @set_current parameter is #FALSE, then only the old color +should be set - if @set_current is #TRUE, both the old color and +the current color should be set to the RGB triple given. This +function merely gives a hint to the color selector; the selector +can choose to ignore this information. -@selector_data: -@r: -@g: -@b: -@set_current: +@selector_data: The @selector_data pointer returned by the #GimpColorSelector_NewFunc function. +@r: The new color's red component. +@g: The new color's green component. +@b: The new color's blue component. +@set_current: Set the current color. @@ -73,23 +103,40 @@ gimpcolorselector - +Register a color selector. Returns an identifier for the color +selector on success, or #NULL if the name is already in use. Both +the @name and @methods table are internalised, so may be g_free()'d after +this call. -@name: -@help_page: -@methods: -@Returns: +@name: The color selector's name. +@help_page: The help page. +@methods: The color selector's methods. +@Returns: The #GimpColorSelectorID of the new color selector. + + + + +A function of this type will be called once all instances of a color +selector have finished after the selector module called +gimp_color_selector_unregister(). + + +@finished_data: The @finished_data as specified in gimp_color_selector_register(). - +Remove the selector @id from active service. New instances of the +selector will not be created, but existing ones are allowed to +continue. If @finished_cb is non-#NULL, it will be called once all +instances have finished. The callback could be used to unload +dynamiclly loaded code, for example. -@id: -@callback: -@data: -@Returns: +@id: The @id as returned by gimp_color_selector_register(). +@finished_cb: Optional callback which will be called once all instances have finished. +@finished_data: The @finished_data which will be passed to @finished_cb. +@Returns: #TRUE on success, #FALSE if @id was not found. diff --git a/devel-docs/libgimp/tmpl/gimpcolorspace.sgml b/devel-docs/libgimp/tmpl/gimpcolorspace.sgml index d01eb8eb7e..df8c94b3ed 100644 --- a/devel-docs/libgimp/tmpl/gimpcolorspace.sgml +++ b/devel-docs/libgimp/tmpl/gimpcolorspace.sgml @@ -2,10 +2,14 @@ gimpcolorspace - +Utility functions which convert colors between different color models. +When programming pixel data manipulation functions you will often use +algorithms operating on a color model different from the one GIMP +uses. This file provides utility functions to concert colors between +different color spaces. diff --git a/devel-docs/libgimp/tmpl/gimpcompat.sgml b/devel-docs/libgimp/tmpl/gimpcompat.sgml index 90f1c12df3..3fb1a84d47 100644 --- a/devel-docs/libgimp/tmpl/gimpcompat.sgml +++ b/devel-docs/libgimp/tmpl/gimpcompat.sgml @@ -6,6 +6,7 @@ Compatibility definitions for older plug-ins. +Compatibility definitions for older plug-ins. @@ -147,6 +148,15 @@ Compatibility definitions for older plug-ins. + + + + + + +@help_data: + + diff --git a/devel-docs/libgimp/tmpl/gimpenums.sgml b/devel-docs/libgimp/tmpl/gimpenums.sgml index 2d9838f024..3c853347bb 100644 --- a/devel-docs/libgimp/tmpl/gimpenums.sgml +++ b/devel-docs/libgimp/tmpl/gimpenums.sgml @@ -2,10 +2,11 @@ gimpenums - +Enums and definitions. +Enums and definitions. diff --git a/devel-docs/libgimp/tmpl/gimpfeatures.sgml b/devel-docs/libgimp/tmpl/gimpfeatures.sgml index aed2692da9..12895438fa 100644 --- a/devel-docs/libgimp/tmpl/gimpfeatures.sgml +++ b/devel-docs/libgimp/tmpl/gimpfeatures.sgml @@ -2,10 +2,13 @@ gimpfeatures - +Macros and constants useful for determining GIMP's version number and +capabilities. +Macros and constants useful for determining GIMP's version number and +capabilities. diff --git a/devel-docs/libgimp/tmpl/gimplimits.sgml b/devel-docs/libgimp/tmpl/gimplimits.sgml index 468bda1aaa..5bbe46c680 100644 --- a/devel-docs/libgimp/tmpl/gimplimits.sgml +++ b/devel-docs/libgimp/tmpl/gimplimits.sgml @@ -2,10 +2,11 @@ gimplimits - +Boundaries of some GIMP data types and some global constants. +Boundaries of some GIMP data types and some global constants. diff --git a/devel-docs/libgimp/tmpl/gimpmath.sgml b/devel-docs/libgimp/tmpl/gimpmath.sgml index f6f498db27..08d247d138 100644 --- a/devel-docs/libgimp/tmpl/gimpmath.sgml +++ b/devel-docs/libgimp/tmpl/gimpmath.sgml @@ -6,6 +6,7 @@ Mathematical definitions and macros. +Mathematical definitions and macros. diff --git a/devel-docs/libgimp/tmpl/gimpmodule.sgml b/devel-docs/libgimp/tmpl/gimpmodule.sgml index 2012abb66e..8b490a0d0a 100644 --- a/devel-docs/libgimp/tmpl/gimpmodule.sgml +++ b/devel-docs/libgimp/tmpl/gimpmodule.sgml @@ -2,16 +2,17 @@ gimpmodule - +Common definitions for creating a pluggable GIMP module. +Common definitions for creating a pluggable GIMP module. - +#GModule @@ -26,3 +27,59 @@ gimpmodule + + +GIMP modules should #G_MODULE_EXPORT a function named "module_init" +of this type. + + +The "module_init" function is called by the GIMP at startup, +and should return either #GIMP_MODULE_OK if it sucessfully initialised or +#GIMP_MODULE_UNLOAD if the module failed to hook whatever functions +it wanted. #GIMP_MODULE_UNLOAD causes the module to be closed, so +the module must not have registered any internal functions or given +out pointers to its data to anyone. + + +If the module returns #GIMP_MODULE_OK, it should also return a +#GimpModuleInfo structure describing itself. + + +@module_info: Returns the #GimpModuleInfo desribing the module. +@Returns: A #GimpModuleStatus value indicating success. + + + + +The type of the @completed_cb passed to the "module_unload" function +(see below). + + +@completed_data: +Must be the @completed_data pointer provided by the "module_unload" +function. + + + + + +If GIMP modules want to allow themselves to be unloaded, they +should #G_MODULE_EXPORT a function named "module_unload" of +this type. + + +GIMP calls the "module_unload" unload request function to ask +a module to prepare itself to be unloaded. It is called with the +value of @shutdown_data supplied in the #GimpModuleInfo struct. +The module should ensure that none of its code or data are being +used, and then call the supplied @completed_cb callback function with +the @completed_data provided. Typically the shutdown request function +will queue de-registration activities then return. Only when the +de-registration has finished should the @completed_cb be invoked. + + +@shutdown_data: The @shutdown_data supplied in the #GimpModuleInfo struct. +@completed_cb: The function to call after successful unload. +@completed_data: Has to be passed to the @completed_cb. + + diff --git a/devel-docs/libgimp/tmpl/gimpparasite.sgml b/devel-docs/libgimp/tmpl/gimpparasite.sgml index eb9c951e7c..074898a961 100644 --- a/devel-docs/libgimp/tmpl/gimpparasite.sgml +++ b/devel-docs/libgimp/tmpl/gimpparasite.sgml @@ -2,16 +2,18 @@ gimpparasite - +Arbitrary pieces of data which can be attached to various GIMP objects. +Arbitrary pieces of data which can be attached to various GIMP objects. - +gimp_image_parasite_attach(), gimp_drawable_parasite_attach(), +gimp_parasite_attach() and their related functions. diff --git a/devel-docs/libgimp/tmpl/gimpparasiteio.sgml b/devel-docs/libgimp/tmpl/gimpparasiteio.sgml index b309b7399e..a2c9e2bd6e 100644 --- a/devel-docs/libgimp/tmpl/gimpparasiteio.sgml +++ b/devel-docs/libgimp/tmpl/gimpparasiteio.sgml @@ -2,16 +2,17 @@ gimpparasiteio - +Utility functions to (de)serialize certain C structures to/from #GimpParasite's. +Utility functions to (de)serialize certain C structures to/from #GimpParasite's. - +#GimpParasite diff --git a/devel-docs/libgimp/tmpl/gimppixmap.sgml b/devel-docs/libgimp/tmpl/gimppixmap.sgml index 983d5dd191..0b24eaf116 100644 --- a/devel-docs/libgimp/tmpl/gimppixmap.sgml +++ b/devel-docs/libgimp/tmpl/gimppixmap.sgml @@ -6,13 +6,25 @@ Widget which creates a #GtkPixmap from XPM data. - +Widget which creates a #GtkPixmap from XPM data. + + +Use this widget instead of #GtkPixmap if you don't want to worry about +the parent container's "realized" state. + + +Note that the drawback of the easy interface is that the actual #GdkPixmap +and it's mask have to be constructed every time you call gimp_pixmap_new() +and cannot be cached in memory without doing bad hacks. gimp_pixmap_button_new() + +#GtkPixmap + diff --git a/devel-docs/libgimp/tmpl/gimpprotocol.sgml b/devel-docs/libgimp/tmpl/gimpprotocol.sgml index 57d732868a..0f5e18996a 100644 --- a/devel-docs/libgimp/tmpl/gimpprotocol.sgml +++ b/devel-docs/libgimp/tmpl/gimpprotocol.sgml @@ -2,16 +2,17 @@ gimpprotocol - +The communication protocol between GIMP and it's plug-ins. +The communication protocol between GIMP and it's plug-ins. - +#libgimp-gimpwire diff --git a/devel-docs/libgimp/tmpl/gimpsignal.sgml b/devel-docs/libgimp/tmpl/gimpsignal.sgml index b27766d68e..1a4f906a60 100644 --- a/devel-docs/libgimp/tmpl/gimpsignal.sgml +++ b/devel-docs/libgimp/tmpl/gimpsignal.sgml @@ -6,6 +6,7 @@ Portable signal handling. +Portable signal handling. diff --git a/devel-docs/libgimp/tmpl/gimpui.sgml b/devel-docs/libgimp/tmpl/gimpui.sgml index f08baaa817..982c89ea31 100644 --- a/devel-docs/libgimp/tmpl/gimpui.sgml +++ b/devel-docs/libgimp/tmpl/gimpui.sgml @@ -2,10 +2,13 @@ gimpui -Common user interface functions. +Common user interface functions. This header includes all other GIMP User +Interface Library headers. +Common user interface functions. This header includes all other GIMP User +Interface Library headers. diff --git a/devel-docs/libgimp/tmpl/gimpunit.sgml b/devel-docs/libgimp/tmpl/gimpunit.sgml index 0e0ad883a2..56061c031e 100644 --- a/devel-docs/libgimp/tmpl/gimpunit.sgml +++ b/devel-docs/libgimp/tmpl/gimpunit.sgml @@ -7,6 +7,8 @@ user-defined units. +Provides a collection of predefined units and functions for creating +user-defined units. diff --git a/devel-docs/libgimp/tmpl/gimputils.sgml b/devel-docs/libgimp/tmpl/gimputils.sgml index 3aea31c480..78be40e23f 100644 --- a/devel-docs/libgimp/tmpl/gimputils.sgml +++ b/devel-docs/libgimp/tmpl/gimputils.sgml @@ -13,7 +13,7 @@ provide it here. - +g_strescape() diff --git a/devel-docs/libgimp/tmpl/gimpvector.sgml b/devel-docs/libgimp/tmpl/gimpvector.sgml index 78af05f9f6..2e1ce01566 100644 --- a/devel-docs/libgimp/tmpl/gimpvector.sgml +++ b/devel-docs/libgimp/tmpl/gimpvector.sgml @@ -6,6 +6,7 @@ Utilities to set up and manipulate vectors. +Utilities to set up and manipulate vectors. diff --git a/devel-docs/libgimp/tmpl/gimpwire.sgml b/devel-docs/libgimp/tmpl/gimpwire.sgml index 206fe1fb9d..15a63fd30b 100644 --- a/devel-docs/libgimp/tmpl/gimpwire.sgml +++ b/devel-docs/libgimp/tmpl/gimpwire.sgml @@ -2,16 +2,19 @@ gimpwire - +The lowlevel I/O protocol used for communication between GIMP and +it's plug-ins. +The lowlevel I/O protocol used for communication between GIMP and +it's plug-ins. - +#libgimp-gimpprotocol diff --git a/devel-docs/libgimp/tmpl/libgimp-unused.sgml b/devel-docs/libgimp/tmpl/libgimp-unused.sgml index 4965038256..0852a663c8 100644 --- a/devel-docs/libgimp/tmpl/libgimp-unused.sgml +++ b/devel-docs/libgimp/tmpl/libgimp-unused.sgml @@ -96,16 +96,16 @@ parasiteF + + + + - - - - diff --git a/libgimp/gimp.h b/libgimp/gimp.h index c0ccbc42ab..979aedb231 100644 --- a/libgimp/gimp.h +++ b/libgimp/gimp.h @@ -75,16 +75,16 @@ typedef void (* GRunProc) (gchar *name, struct _GPlugInInfo { /* called when the gimp application initially starts up */ - void (*init_proc) (void); + void (* init_proc) (void); /* called when the gimp application exits */ - void (*quit_proc) (void); + void (* quit_proc) (void); /* called by the gimp so that the plug-in can inform the * gimp of what it does. (ie. installing a procedure database * procedure). */ - void (*query_proc) (void); + void (* query_proc) (void); /* called to run a procedure the plug-in installed in the * procedure database. @@ -243,627 +243,627 @@ struct _GParam /* The main procedure that should be called with the * 'argc' and 'argv' that are passed to "main". */ -int gimp_main (int argc, - char *argv[]); +gint gimp_main (gint argc, + gchar *argv[]); /* Forcefully causes the gimp library to exit and * close down its connection to main gimp application. */ -void G_GNUC_NORETURN gimp_quit (void); +void G_GNUC_NORETURN gimp_quit (void); /* Specify a range of data to be associated with 'id'. * The data will exist for as long as the main gimp * application is running. */ -void gimp_set_data (gchar * id, - gpointer data, - guint32 length); +void gimp_set_data (gchar *id, + gpointer data, + guint32 length); /* Retrieve the piece of data stored within the main * gimp application specified by 'id'. The data is * stored in the supplied buffer. Make sure enough * space is allocated. */ -void gimp_get_data (gchar * id, - gpointer data); +void gimp_get_data (gchar *id, + gpointer data); /* Get the size in bytes of the data stored by a gimp_get_data * id. As size of zero may indicate that there is no such * identifier in the database. */ -guint32 gimp_get_data_size (gchar * id); +guint32 gimp_get_data_size (gchar *id); /* Initialize the progress bar with "message". If "message" * is NULL, the message displayed in the progress window will * be the name of the plug-in. */ -void gimp_progress_init (char *message); +void gimp_progress_init (gchar *message); /* Update the progress bar. If the progress bar has not been * initialized then it will be automatically initialized as if * "gimp_progress_init (NULL)" were called. "percentage" is a * value between 0 and 1. */ -void gimp_progress_update (gdouble percentage); +void gimp_progress_update (gdouble percentage); /* Returns the default gdisplay (given at plug-in config time). */ -gint32 gimp_default_display (void); +gint32 gimp_default_display (void); /* Pops up a dialog box with "message". Useful for status and * error reports. If "message" is NULL, do nothing. */ -void gimp_message (const gchar *message); +void gimp_message (const gchar *message); /* Query the gimp application's procedural database. * The arguments are regular expressions which select * which procedure names will be returned in 'proc_names'. */ -void gimp_query_database (gchar *name_regexp, - gchar *blurb_regexp, - gchar *help_regexp, - gchar *author_regexp, - gchar *copyright_regexp, - gchar *date_regexp, - gchar *proc_type_regexp, - gint *nprocs, - gchar ***proc_names); +void gimp_query_database (gchar *name_regexp, + gchar *blurb_regexp, + gchar *help_regexp, + gchar *author_regexp, + gchar *copyright_regexp, + gchar *date_regexp, + gchar *proc_type_regexp, + gint *nprocs, + gchar ***proc_names); /* Query the gimp application's procedural database * regarding a particular procedure. */ -gboolean gimp_query_procedure (gchar *proc_name, - gchar **proc_blurb, - gchar **proc_help, - gchar **proc_author, - gchar **proc_copyright, - gchar **proc_date, - gint *proc_type, - gint *nparams, - gint *nreturn_vals, - GParamDef **params, - GParamDef **return_vals); +gboolean gimp_query_procedure (gchar *proc_name, + gchar **proc_blurb, + gchar **proc_help, + gchar **proc_author, + gchar **proc_copyright, + gchar **proc_date, + gint *proc_type, + gint *nparams, + gint *nreturn_vals, + GParamDef **params, + GParamDef **return_vals); /* Query the gimp application regarding all open images. * The list of open image id's is returned in 'image_ids'. */ -gint32* gimp_query_images (gint *nimages); +gint32 * gimp_query_images (gint *nimages); /* Install a procedure in the procedure database. */ -void gimp_install_procedure (gchar *name, - gchar *blurb, - gchar *help, - gchar *author, - gchar *copyright, - gchar *date, - gchar *menu_path, - gchar *image_types, - gint type, - gint nparams, - gint nreturn_vals, - GParamDef *params, - GParamDef *return_vals); +void gimp_install_procedure (gchar *name, + gchar *blurb, + gchar *help, + gchar *author, + gchar *copyright, + gchar *date, + gchar *menu_path, + gchar *image_types, + gint type, + gint nparams, + gint nreturn_vals, + GParamDef *params, + GParamDef *return_vals); /* Install a temporary procedure in the procedure database. */ -void gimp_install_temp_proc (gchar *name, - gchar *blurb, - gchar *help, - gchar *author, - gchar *copyright, - gchar *date, - gchar *menu_path, - gchar *image_types, - gint type, - gint nparams, - gint nreturn_vals, - GParamDef *params, - GParamDef *return_vals, - GRunProc run_proc); +void gimp_install_temp_proc (gchar *name, + gchar *blurb, + gchar *help, + gchar *author, + gchar *copyright, + gchar *date, + gchar *menu_path, + gchar *image_types, + gint type, + gint nparams, + gint nreturn_vals, + GParamDef *params, + GParamDef *return_vals, + GRunProc run_proc); /* Uninstall a temporary procedure */ -void gimp_uninstall_temp_proc (gchar *name); +void gimp_uninstall_temp_proc (gchar *name); /* Install a load file format handler in the procedure database. */ -void gimp_register_magic_load_handler (gchar *name, - gchar *extensions, - gchar *prefixes, - gchar *magics); +void gimp_register_magic_load_handler (gchar *name, + gchar *extensions, + gchar *prefixes, + gchar *magics); /* Install a load file format handler in the procedure database. */ -void gimp_register_load_handler (gchar *name, - gchar *extensions, - gchar *prefixes); +void gimp_register_load_handler (gchar *name, + gchar *extensions, + gchar *prefixes); /* Install a save file format handler in the procedure database. */ -void gimp_register_save_handler (gchar *name, - gchar *extensions, - gchar *prefixes); +void gimp_register_save_handler (gchar *name, + gchar *extensions, + gchar *prefixes); /* Run a procedure in the procedure database. The parameters are * specified via the variable length argument list. The return * values are returned in the 'GParam*' array. */ -GParam* gimp_run_procedure (gchar *name, - gint *nreturn_vals, - ...); +GParam * gimp_run_procedure (gchar *name, + gint *nreturn_vals, + ...); /* Run a procedure in the procedure database. The parameters are * specified as an array of GParam. The return * values are returned in the 'GParam*' array. */ -GParam* gimp_run_procedure2 (gchar *name, - gint *nreturn_vals, - gint nparams, - GParam *params); +GParam * gimp_run_procedure2 (gchar *name, + gint *nreturn_vals, + gint nparams, + GParam *params); /* Destroy the an array of parameters. This is useful for * destroying the return values returned by a call to * 'gimp_run_procedure'. */ -void gimp_destroy_params (GParam *params, - gint nparams); +void gimp_destroy_params (GParam *params, + gint nparams); /* Destroy the an array of GParamDef's. This is useful for * destroying the return values returned by a call to * 'gimp_query_procedure'. */ -void gimp_destroy_paramdefs (GParamDef *paramdefs, - gint nparams); +void gimp_destroy_paramdefs (GParamDef *paramdefs, + gint nparams); -gdouble gimp_gamma (void); -gboolean gimp_install_cmap (void); -gboolean gimp_use_xshm (void); -guchar * gimp_color_cube (void); -gint gimp_min_colors (void); -void gimp_request_wakeups (void); +gdouble gimp_gamma (void); +gboolean gimp_install_cmap (void); +gboolean gimp_use_xshm (void); +guchar * gimp_color_cube (void); +gint gimp_min_colors (void); +void gimp_request_wakeups (void); -gchar * gimp_get_progname (void); +gchar * gimp_get_progname (void); /**************************************** * Images * ****************************************/ -gint32 gimp_image_new (guint width, - guint height, - GImageType type); -gint32 gimp_image_duplicate (gint32 image_ID); -void gimp_image_delete (gint32 image_ID); -guint gimp_image_width (gint32 image_ID); -guint gimp_image_height (gint32 image_ID); -GImageType gimp_image_base_type (gint32 image_ID); -gint32 gimp_image_floating_selection (gint32 image_ID); -void gimp_image_add_channel (gint32 image_ID, - gint32 channel_ID, - gint position); -void gimp_image_add_layer (gint32 image_ID, - gint32 layer_ID, - gint position); -void gimp_image_add_layer_mask (gint32 image_ID, - gint32 layer_ID, - gint32 mask_ID); -void gimp_image_clean_all (gint32 image_ID); -void gimp_image_undo_disable (gint32 image_ID); -void gimp_image_undo_enable (gint32 image_ID); -void gimp_image_undo_freeze (gint32 image_ID); -void gimp_image_undo_thaw (gint32 image_ID); -void gimp_undo_push_group_start (gint32 image_ID); -void gimp_undo_push_group_end (gint32 image_ID); -void gimp_image_clean_all (gint32 image_ID); -gint32 gimp_image_flatten (gint32 image_ID); -void gimp_image_lower_channel (gint32 image_ID, - gint32 channel_ID); -void gimp_image_lower_layer (gint32 image_ID, - gint32 layer_ID); -gint32 gimp_image_merge_visible_layers (gint32 image_ID, - GimpMergeType merge_type); -gint32 gimp_image_pick_correlate_layer (gint32 image_ID, - gint x, - gint y); -void gimp_image_raise_channel (gint32 image_ID, - gint32 channel_ID); -void gimp_image_raise_layer (gint32 image_ID, - gint32 layer_ID); -void gimp_image_remove_channel (gint32 image_ID, - gint32 channel_ID); -void gimp_image_remove_layer (gint32 image_ID, - gint32 layer_ID); -void gimp_image_remove_layer_mask (gint32 image_ID, - gint32 layer_ID, - gint mode); -void gimp_image_resize (gint32 image_ID, - guint new_width, - guint new_height, - gint offset_x, - gint offset_y); -gint32 gimp_image_get_active_channel (gint32 image_ID); -gint32 gimp_image_get_active_layer (gint32 image_ID); -gint32* gimp_image_get_channels (gint32 image_ID, - gint *nchannels); -guchar* gimp_image_get_cmap (gint32 image_ID, - gint *ncolors); -gboolean gimp_image_get_component_active (gint32 image_ID, - gint component); -gboolean gimp_image_get_component_visible (gint32 image_ID, - gint component); -gchar* gimp_image_get_filename (gint32 image_ID); -gint32* gimp_image_get_layers (gint32 image_ID, - gint *nlayers); -gint32 gimp_image_get_selection (gint32 image_ID); -void gimp_image_set_active_channel (gint32 image_ID, - gint32 channel_ID); -void gimp_image_set_active_layer (gint32 image_ID, - gint32 layer_ID); -void gimp_image_set_cmap (gint32 image_ID, - guchar *cmap, - gint ncolors); -void gimp_image_set_component_active (gint32 image_ID, - gint component, - gboolean active); -void gimp_image_set_component_visible (gint32 image_ID, - gint component, - gboolean visible); -void gimp_image_set_filename (gint32 image_ID, - gchar *name); -GimpParasite * gimp_image_parasite_find (gint32 image_ID, - const gchar *name); -void gimp_image_parasite_attach (gint32 image_ID, - const GimpParasite *parasite); -void gimp_image_attach_new_parasite (gint32 image_ID, - const gchar *name, - gint flags, - gint size, - const gpointer data); -void gimp_image_parasite_detach (gint32 image_ID, - const gchar *name); -void gimp_image_set_resolution (gint32 image_ID, - double xresolution, - double yresolution); -void gimp_image_get_resolution (gint32 image_ID, - double *xresolution, - double *yresolution); -void gimp_image_set_unit (gint32 image_ID, - GimpUnit unit); -GimpUnit gimp_image_get_unit (gint32 image_ID); -gint32 gimp_image_get_layer_by_tattoo (gint32 image_ID, - gint32 tattoo); -gint32 gimp_image_get_channel_by_tattoo (gint32 image_ID, - gint32 tattoo); +gint32 gimp_image_new (guint width, + guint height, + GImageType type); +gint32 gimp_image_duplicate (gint32 image_ID); +void gimp_image_delete (gint32 image_ID); +guint gimp_image_width (gint32 image_ID); +guint gimp_image_height (gint32 image_ID); +GImageType gimp_image_base_type (gint32 image_ID); +gint32 gimp_image_floating_selection (gint32 image_ID); +void gimp_image_add_channel (gint32 image_ID, + gint32 channel_ID, + gint position); +void gimp_image_add_layer (gint32 image_ID, + gint32 layer_ID, + gint position); +void gimp_image_add_layer_mask (gint32 image_ID, + gint32 layer_ID, + gint32 mask_ID); +void gimp_image_clean_all (gint32 image_ID); +void gimp_image_undo_disable (gint32 image_ID); +void gimp_image_undo_enable (gint32 image_ID); +void gimp_image_undo_freeze (gint32 image_ID); +void gimp_image_undo_thaw (gint32 image_ID); +void gimp_undo_push_group_start (gint32 image_ID); +void gimp_undo_push_group_end (gint32 image_ID); +void gimp_image_clean_all (gint32 image_ID); +gint32 gimp_image_flatten (gint32 image_ID); +void gimp_image_lower_channel (gint32 image_ID, + gint32 channel_ID); +void gimp_image_lower_layer (gint32 image_ID, + gint32 layer_ID); +gint32 gimp_image_merge_visible_layers (gint32 image_ID, + GimpMergeType merge_type); +gint32 gimp_image_pick_correlate_layer (gint32 image_ID, + gint x, + gint y); +void gimp_image_raise_channel (gint32 image_ID, + gint32 channel_ID); +void gimp_image_raise_layer (gint32 image_ID, + gint32 layer_ID); +void gimp_image_remove_channel (gint32 image_ID, + gint32 channel_ID); +void gimp_image_remove_layer (gint32 image_ID, + gint32 layer_ID); +void gimp_image_remove_layer_mask (gint32 image_ID, + gint32 layer_ID, + gint mode); +void gimp_image_resize (gint32 image_ID, + guint new_width, + guint new_height, + gint offset_x, + gint offset_y); +gint32 gimp_image_get_active_channel (gint32 image_ID); +gint32 gimp_image_get_active_layer (gint32 image_ID); +gint32 * gimp_image_get_channels (gint32 image_ID, + gint *nchannels); +guchar * gimp_image_get_cmap (gint32 image_ID, + gint *ncolors); +gboolean gimp_image_get_component_active (gint32 image_ID, + gint component); +gboolean gimp_image_get_component_visible (gint32 image_ID, + gint component); +gchar * gimp_image_get_filename (gint32 image_ID); +gint32 * gimp_image_get_layers (gint32 image_ID, + gint *nlayers); +gint32 gimp_image_get_selection (gint32 image_ID); +void gimp_image_set_active_channel (gint32 image_ID, + gint32 channel_ID); +void gimp_image_set_active_layer (gint32 image_ID, + gint32 layer_ID); +void gimp_image_set_cmap (gint32 image_ID, + guchar *cmap, + gint ncolors); +void gimp_image_set_component_active (gint32 image_ID, + gint component, + gboolean active); +void gimp_image_set_component_visible (gint32 image_ID, + gint component, + gboolean visible); +void gimp_image_set_filename (gint32 image_ID, + gchar *name); +GimpParasite * gimp_image_parasite_find (gint32 image_ID, + const gchar *name); +void gimp_image_parasite_attach (gint32 image_ID, + const GimpParasite *parasite); +void gimp_image_attach_new_parasite (gint32 image_ID, + const gchar *name, + gint flags, + gint size, + const gpointer data); +void gimp_image_parasite_detach (gint32 image_ID, + const gchar *name); +void gimp_image_set_resolution (gint32 image_ID, + gdouble xresolution, + gdouble yresolution); +void gimp_image_get_resolution (gint32 image_ID, + gdouble *xresolution, + gdouble *yresolution); +void gimp_image_set_unit (gint32 image_ID, + GimpUnit unit); +GimpUnit gimp_image_get_unit (gint32 image_ID); +gint32 gimp_image_get_layer_by_tattoo (gint32 image_ID, + gint32 tattoo); +gint32 gimp_image_get_channel_by_tattoo (gint32 image_ID, + gint32 tattoo); -guchar * gimp_image_get_thumbnail_data (gint32 image_ID, - gint *width, - gint *height, - gint *bytes); -void gimp_image_convert_rgb (gint32 image_ID); -void gimp_image_convert_grayscale (gint32 image_ID); -void gimp_image_convert_indexed (gint32 image_ID, - GimpConvertDitherType dither_type, - GimpConvertPaletteType palette_type, - gint num_colors, - gint alpha_dither, - gint remove_unused, - gchar *palette); +guchar * gimp_image_get_thumbnail_data (gint32 image_ID, + gint *width, + gint *height, + gint *bytes); +void gimp_image_convert_rgb (gint32 image_ID); +void gimp_image_convert_grayscale (gint32 image_ID); +void gimp_image_convert_indexed (gint32 image_ID, + GimpConvertDitherType dither_type, + GimpConvertPaletteType palette_type, + gint num_colors, + gint alpha_dither, + gint remove_unused, + gchar *palette); /**************************************** * Guides * ****************************************/ -gint32 gimp_image_add_hguide (gint32 image_ID, - gint32 yposition); -gint32 gimp_image_add_vguide (gint32 image_ID, - gint32 xposition); -void gimp_image_delete_guide (gint32 image_ID, - gint32 guide_ID); -gint32 gimp_image_find_next_guide (gint32 image_ID, - gint32 guide_ID); -GOrientation gimp_image_get_guide_orientation (gint32 image_ID, - gint32 guide_ID); -gint32 gimp_image_get_guide_position (gint32 image_ID, - gint32 guide_ID); +gint32 gimp_image_add_hguide (gint32 image_ID, + gint32 yposition); +gint32 gimp_image_add_vguide (gint32 image_ID, + gint32 xposition); +void gimp_image_delete_guide (gint32 image_ID, + gint32 guide_ID); +gint32 gimp_image_find_next_guide (gint32 image_ID, + gint32 guide_ID); +GOrientation gimp_image_get_guide_orientation (gint32 image_ID, + gint32 guide_ID); +gint32 gimp_image_get_guide_position (gint32 image_ID, + gint32 guide_ID); /**************************************** * Displays * ****************************************/ -gint32 gimp_display_new (gint32 image_ID); -void gimp_display_delete (gint32 display_ID); -void gimp_displays_flush (void); +gint32 gimp_display_new (gint32 image_ID); +void gimp_display_delete (gint32 display_ID); +void gimp_displays_flush (void); /**************************************** * Layers * ****************************************/ -gint32 gimp_layer_new (gint32 image_ID, - char *name, - guint width, - guint height, - GDrawableType type, - gdouble opacity, - GLayerMode mode); -gint32 gimp_layer_copy (gint32 layer_ID); -void gimp_layer_delete (gint32 layer_ID); -guint gimp_layer_width (gint32 layer_ID); -guint gimp_layer_height (gint32 layer_ID); -guint gimp_layer_bpp (gint32 layer_ID); -GDrawableType gimp_layer_type (gint32 layer_ID); -void gimp_layer_add_alpha (gint32 layer_ID); -gint32 gimp_layer_create_mask (gint32 layer_ID, - GimpAddMaskType mask_type); -void gimp_layer_resize (gint32 layer_ID, - guint new_width, - guint new_height, - gint offset_x, - gint offset_y); -void gimp_layer_scale (gint32 layer_ID, - guint new_width, - guint new_height, - gint local_origin); -void gimp_layer_translate (gint32 layer_ID, - gint offset_x, - gint offset_y); -gint gimp_layer_is_floating_selection (gint32 layer_ID); -gint32 gimp_layer_get_image_id (gint32 layer_ID); -gint32 gimp_layer_get_mask_id (gint32 layer_ID); -gint gimp_layer_get_apply_mask (gint32 layer_ID); -gint gimp_layer_get_edit_mask (gint32 layer_ID); -GLayerMode gimp_layer_get_mode (gint32 layer_ID); -char* gimp_layer_get_name (gint32 layer_ID); -gdouble gimp_layer_get_opacity (gint32 layer_ID); -gint gimp_layer_get_preserve_transparency (gint32 layer_ID); -gint gimp_layer_get_show_mask (gint32 layer_ID); -gint gimp_layer_get_visible (gint32 layer_ID); -void gimp_layer_set_apply_mask (gint32 layer_ID, - gint apply_mask); -void gimp_layer_set_edit_mask (gint32 layer_ID, - gint edit_mask); -void gimp_layer_set_mode (gint32 layer_ID, - GLayerMode mode); -void gimp_layer_set_name (gint32 layer_ID, - char *name); -void gimp_layer_set_offsets (gint32 layer_ID, - gint offset_x, - gint offset_y); -void gimp_layer_set_opacity (gint32 layer_ID, - gdouble opacity); -void gimp_layer_set_preserve_transparency (gint32 layer_ID, - gint preserve_transparency); -void gimp_layer_set_show_mask (gint32 layer_ID, - gint show_mask); -void gimp_layer_set_visible (gint32 layer_ID, - gint visible); -gint32 gimp_layer_get_tattoo (gint32 layer_ID); +gint32 gimp_layer_new (gint32 image_ID, + char *name, + guint width, + guint height, + GDrawableType type, + gdouble opacity, + GLayerMode mode); +gint32 gimp_layer_copy (gint32 layer_ID); +void gimp_layer_delete (gint32 layer_ID); +guint gimp_layer_width (gint32 layer_ID); +guint gimp_layer_height (gint32 layer_ID); +guint gimp_layer_bpp (gint32 layer_ID); +GDrawableType gimp_layer_type (gint32 layer_ID); +void gimp_layer_add_alpha (gint32 layer_ID); +gint32 gimp_layer_create_mask (gint32 layer_ID, + GimpAddMaskType mask_type); +void gimp_layer_resize (gint32 layer_ID, + guint new_width, + guint new_height, + gint offset_x, + gint offset_y); +void gimp_layer_scale (gint32 layer_ID, + guint new_width, + guint new_height, + gint local_origin); +void gimp_layer_translate (gint32 layer_ID, + gint offset_x, + gint offset_y); +gboolean gimp_layer_is_floating_selection (gint32 layer_ID); +gint32 gimp_layer_get_image_id (gint32 layer_ID); +gint32 gimp_layer_get_mask_id (gint32 layer_ID); +gboolean gimp_layer_get_apply_mask (gint32 layer_ID); +gboolean gimp_layer_get_edit_mask (gint32 layer_ID); +GLayerMode gimp_layer_get_mode (gint32 layer_ID); +gchar * gimp_layer_get_name (gint32 layer_ID); +gdouble gimp_layer_get_opacity (gint32 layer_ID); +gboolean gimp_layer_get_preserve_transparency (gint32 layer_ID); +gint gimp_layer_get_show_mask (gint32 layer_ID); +gint gimp_layer_get_visible (gint32 layer_ID); +void gimp_layer_set_apply_mask (gint32 layer_ID, + gboolean apply_mask); +void gimp_layer_set_edit_mask (gint32 layer_ID, + gboolean edit_mask); +void gimp_layer_set_mode (gint32 layer_ID, + GLayerMode mode); +void gimp_layer_set_name (gint32 layer_ID, + gchar *name); +void gimp_layer_set_offsets (gint32 layer_ID, + gint offset_x, + gint offset_y); +void gimp_layer_set_opacity (gint32 layer_ID, + gdouble opacity); +void gimp_layer_set_preserve_transparency (gint32 layer_ID, + gboolean preserve_transparency); +void gimp_layer_set_show_mask (gint32 layer_ID, + gboolean show_mask); +void gimp_layer_set_visible (gint32 layer_ID, + gboolean visible); +gint32 gimp_layer_get_tattoo (gint32 layer_ID); /**************************************** * Channels * ****************************************/ -gint32 gimp_channel_new (gint32 image_ID, - gchar *name, - guint width, - guint height, - gdouble opacity, - guchar *color); -gint32 gimp_channel_copy (gint32 channel_ID); -void gimp_channel_delete (gint32 channel_ID); -guint gimp_channel_width (gint32 channel_ID); -guint gimp_channel_height (gint32 channel_ID); -gint32 gimp_channel_get_image_id (gint32 channel_ID); -gint32 gimp_channel_get_layer_id (gint32 channel_ID); -void gimp_channel_get_color (gint32 channel_ID, - guchar *red, - guchar *green, - guchar *blue); -gchar* gimp_channel_get_name (gint32 channel_ID); -gdouble gimp_channel_get_opacity (gint32 channel_ID); -gint gimp_channel_get_show_masked (gint32 channel_ID); -gboolean gimp_channel_get_visible (gint32 channel_ID); -void gimp_channel_set_color (gint32 channel_ID, - guchar red, - guchar green, - guchar blue); -void gimp_channel_set_name (gint32 channel_ID, - gchar *name); -void gimp_channel_set_opacity (gint32 channel_ID, - gdouble opacity); -void gimp_channel_set_show_masked (gint32 channel_ID, - gint show_masked); -void gimp_channel_set_visible (gint32 channel_ID, - gboolean visible); -gint32 gimp_channel_get_tattoo (gint32 channel_ID); +gint32 gimp_channel_new (gint32 image_ID, + gchar *name, + guint width, + guint height, + gdouble opacity, + guchar *color); +gint32 gimp_channel_copy (gint32 channel_ID); +void gimp_channel_delete (gint32 channel_ID); +guint gimp_channel_width (gint32 channel_ID); +guint gimp_channel_height (gint32 channel_ID); +gint32 gimp_channel_get_image_id (gint32 channel_ID); +gint32 gimp_channel_get_layer_id (gint32 channel_ID); +void gimp_channel_get_color (gint32 channel_ID, + guchar *red, + guchar *green, + guchar *blue); +gchar * gimp_channel_get_name (gint32 channel_ID); +gdouble gimp_channel_get_opacity (gint32 channel_ID); +gint gimp_channel_get_show_masked (gint32 channel_ID); +gboolean gimp_channel_get_visible (gint32 channel_ID); +void gimp_channel_set_color (gint32 channel_ID, + guchar red, + guchar green, + guchar blue); +void gimp_channel_set_name (gint32 channel_ID, + gchar *name); +void gimp_channel_set_opacity (gint32 channel_ID, + gdouble opacity); +void gimp_channel_set_show_masked (gint32 channel_ID, + gint show_masked); +void gimp_channel_set_visible (gint32 channel_ID, + gboolean visible); +gint32 gimp_channel_get_tattoo (gint32 channel_ID); /**************************************** * GDrawables * ****************************************/ -GDrawable* gimp_drawable_get (gint32 drawable_ID); -void gimp_drawable_detach (GDrawable *drawable); -void gimp_drawable_flush (GDrawable *drawable); -void gimp_drawable_delete (GDrawable *drawable); -void gimp_drawable_update (gint32 drawable_ID, - gint x, - gint y, - guint width, - guint height); -void gimp_drawable_merge_shadow (gint32 drawable_ID, - gint undoable); -gint32 gimp_drawable_image_id (gint32 drawable_ID); -gchar* gimp_drawable_name (gint32 drawable_ID); -guint gimp_drawable_width (gint32 drawable_ID); -guint gimp_drawable_height (gint32 drawable_ID); -guint gimp_drawable_bpp (gint32 drawable_ID); -GDrawableType gimp_drawable_type (gint32 drawable_ID); -gboolean gimp_drawable_visible (gint32 drawable_ID); -gboolean gimp_drawable_is_channel (gint32 drawable_ID); -gboolean gimp_drawable_is_rgb (gint32 drawable_ID); -gboolean gimp_drawable_is_gray (gint32 drawable_ID); -gboolean gimp_drawable_has_alpha (gint32 drawable_ID); -gboolean gimp_drawable_is_indexed (gint32 drawable_ID); -gboolean gimp_drawable_is_layer (gint32 drawable_ID); -gboolean gimp_drawable_is_layer_mask(gint32 drawable_ID); -gboolean gimp_drawable_mask_bounds (gint32 drawable_ID, - gint *x1, - gint *y1, - gint *x2, - gint *y2); -void gimp_drawable_offsets (gint32 drawable_ID, - gint *offset_x, - gint *offset_y); -void gimp_drawable_fill (gint32 drawable_ID, - GimpFillType fill_type); -void gimp_drawable_set_name (gint32 drawable_ID, - char *name); -void gimp_drawable_set_visible (gint32 drawable_ID, - gint visible); -GTile* gimp_drawable_get_tile (GDrawable *drawable, - gint shadow, - gint row, - gint col); -GTile* gimp_drawable_get_tile2 (GDrawable *drawable, - gint shadow, - gint x, - gint y); -GimpParasite * gimp_drawable_parasite_find (gint32 drawable, - const gchar *name); -void gimp_drawable_parasite_attach (gint32 drawable, - const GimpParasite *parasite); -void gimp_drawable_attach_new_parasite (gint32 drawable, - const gchar *name, - gint flags, - gint size, - const gpointer data); -void gimp_drawable_parasite_detach (gint32 drawable, - const char *name); -guchar * gimp_drawable_get_thumbnail_data (gint32 drawable_ID, - gint *width, - gint *height, - gint *bytes); +GDrawable * gimp_drawable_get (gint32 drawable_ID); +void gimp_drawable_detach (GDrawable *drawable); +void gimp_drawable_flush (GDrawable *drawable); +void gimp_drawable_delete (GDrawable *drawable); +void gimp_drawable_update (gint32 drawable_ID, + gint x, + gint y, + guint width, + guint height); +void gimp_drawable_merge_shadow (gint32 drawable_ID, + gboolean undoable); +gint32 gimp_drawable_image_id (gint32 drawable_ID); +gchar * gimp_drawable_name (gint32 drawable_ID); +guint gimp_drawable_width (gint32 drawable_ID); +guint gimp_drawable_height (gint32 drawable_ID); +guint gimp_drawable_bpp (gint32 drawable_ID); +GDrawableType gimp_drawable_type (gint32 drawable_ID); +gboolean gimp_drawable_visible (gint32 drawable_ID); +gboolean gimp_drawable_is_channel (gint32 drawable_ID); +gboolean gimp_drawable_is_rgb (gint32 drawable_ID); +gboolean gimp_drawable_is_gray (gint32 drawable_ID); +gboolean gimp_drawable_has_alpha (gint32 drawable_ID); +gboolean gimp_drawable_is_indexed (gint32 drawable_ID); +gboolean gimp_drawable_is_layer (gint32 drawable_ID); +gboolean gimp_drawable_is_layer_mask (gint32 drawable_ID); +gboolean gimp_drawable_mask_bounds (gint32 drawable_ID, + gint *x1, + gint *y1, + gint *x2, + gint *y2); +void gimp_drawable_offsets (gint32 drawable_ID, + gint *offset_x, + gint *offset_y); +void gimp_drawable_fill (gint32 drawable_ID, + GimpFillType fill_type); +void gimp_drawable_set_name (gint32 drawable_ID, + gchar *name); +void gimp_drawable_set_visible (gint32 drawable_ID, + gint visible); +GTile * gimp_drawable_get_tile (GDrawable *drawable, + gint shadow, + gint row, + gint col); +GTile * gimp_drawable_get_tile2 (GDrawable *drawable, + gint shadow, + gint x, + gint y); +GimpParasite * gimp_drawable_parasite_find (gint32 drawable, + const gchar *name); +void gimp_drawable_parasite_attach (gint32 drawable, + const GimpParasite *parasite); +void gimp_drawable_attach_new_parasite (gint32 drawable, + const gchar *name, + gint flags, + gint size, + const gpointer data); +void gimp_drawable_parasite_detach (gint32 drawable, + const gchar *name); +guchar * gimp_drawable_get_thumbnail_data (gint32 drawable_ID, + gint *width, + gint *height, + gint *bytes); /**************************************** * Selections * ****************************************/ -gint32 gimp_selection_bounds (gint32 image_ID, - gint32 *non_empty, - gint32 *x1, - gint32 *y1, - gint32 *x2, - gint32 *y2); -gint32 gimp_selection_float (gint32 image_ID, - gint32 drawable_ID, - gint32 x_offset, - gint32 y_offset); -gint32 gimp_selection_is_empty (gint32 image_ID); -void gimp_selection_none (gint32 image_ID); +gint32 gimp_selection_bounds (gint32 image_ID, + gint32 *non_empty, + gint32 *x1, + gint32 *y1, + gint32 *x2, + gint32 *y2); +gint32 gimp_selection_float (gint32 image_ID, + gint32 drawable_ID, + gint32 x_offset, + gint32 y_offset); +gint32 gimp_selection_is_empty (gint32 image_ID); +void gimp_selection_none (gint32 image_ID); /**************************************** * GTiles * ****************************************/ -void gimp_tile_ref (GTile *tile); -void gimp_tile_ref_zero (GTile *tile); -void gimp_tile_unref (GTile *tile, - gint dirty); -void gimp_tile_flush (GTile *tile); -void gimp_tile_cache_size (gulong kilobytes); -void gimp_tile_cache_ntiles (gulong ntiles); -guint gimp_tile_width (void); -guint gimp_tile_height (void); +void gimp_tile_ref (GTile *tile); +void gimp_tile_ref_zero (GTile *tile); +void gimp_tile_unref (GTile *tile, + gint dirty); +void gimp_tile_flush (GTile *tile); +void gimp_tile_cache_size (gulong kilobytes); +void gimp_tile_cache_ntiles (gulong ntiles); +guint gimp_tile_width (void); +guint gimp_tile_height (void); /**************************************** * Pixel Regions * ****************************************/ -void gimp_pixel_rgn_init (GPixelRgn *pr, - GDrawable *drawable, - int x, - int y, - int width, - int height, - int dirty, - int shadow); -void gimp_pixel_rgn_resize (GPixelRgn *pr, - int x, - int y, - int width, - int height); -void gimp_pixel_rgn_get_pixel (GPixelRgn *pr, - guchar *buf, - int x, - int y); -void gimp_pixel_rgn_get_row (GPixelRgn *pr, - guchar *buf, - int x, - int y, - int width); -void gimp_pixel_rgn_get_col (GPixelRgn *pr, - guchar *buf, - int x, - int y, - int height); -void gimp_pixel_rgn_get_rect (GPixelRgn *pr, - guchar *buf, - int x, - int y, - int width, - int height); -void gimp_pixel_rgn_set_pixel (GPixelRgn *pr, - guchar *buf, - int x, - int y); -void gimp_pixel_rgn_set_row (GPixelRgn *pr, - guchar *buf, - int x, - int y, - int width); -void gimp_pixel_rgn_set_col (GPixelRgn *pr, - guchar *buf, - int x, - int y, - int height); -void gimp_pixel_rgn_set_rect (GPixelRgn *pr, - guchar *buf, - int x, - int y, - int width, - int height); -gpointer gimp_pixel_rgns_register (int nrgns, - ...); -gpointer gimp_pixel_rgns_register2(int nrgns, - GPixelRgn **prs); -gpointer gimp_pixel_rgns_process (gpointer pri_ptr); +void gimp_pixel_rgn_init (GPixelRgn *pr, + GDrawable *drawable, + gint x, + gint y, + gint width, + gint height, + gint dirty, + gint shadow); +void gimp_pixel_rgn_resize (GPixelRgn *pr, + gint x, + gint y, + gint width, + gint height); +void gimp_pixel_rgn_get_pixel (GPixelRgn *pr, + guchar *buf, + gint x, + gint y); +void gimp_pixel_rgn_get_row (GPixelRgn *pr, + guchar *buf, + gint x, + gint y, + gint width); +void gimp_pixel_rgn_get_col (GPixelRgn *pr, + guchar *buf, + gint x, + gint y, + gint height); +void gimp_pixel_rgn_get_rect (GPixelRgn *pr, + guchar *buf, + gint x, + gint y, + gint width, + gint height); +void gimp_pixel_rgn_set_pixel (GPixelRgn *pr, + guchar *buf, + gint x, + gint y); +void gimp_pixel_rgn_set_row (GPixelRgn *pr, + guchar *buf, + gint x, + gint y, + gint width); +void gimp_pixel_rgn_set_col (GPixelRgn *pr, + guchar *buf, + gint x, + gint y, + gint height); +void gimp_pixel_rgn_set_rect (GPixelRgn *pr, + guchar *buf, + gint x, + gint y, + gint width, + gint height); +gpointer gimp_pixel_rgns_register (gint nrgns, + ...); +gpointer gimp_pixel_rgns_register2 (gint nrgns, + GPixelRgn **prs); +gpointer gimp_pixel_rgns_process (gpointer pri_ptr); /**************************************** * The Palette * ****************************************/ -void gimp_palette_get_background (guchar *red, - guchar *green, - guchar *blue); -void gimp_palette_get_foreground (guchar *red, - guchar *green, - guchar *blue); -void gimp_palette_set_background (guchar red, - guchar green, - guchar blue); -void gimp_palette_set_foreground (guchar red, - guchar green, - guchar blue); +void gimp_palette_get_background (guchar *red, + guchar *green, + guchar *blue); +void gimp_palette_get_foreground (guchar *red, + guchar *green, + guchar *blue); +void gimp_palette_set_background (guchar red, + guchar green, + guchar blue); +void gimp_palette_set_foreground (guchar red, + guchar green, + guchar blue); /**************************************** * Gradients * @@ -871,7 +871,7 @@ void gimp_palette_set_foreground (guchar red, gchar ** gimp_gradients_get_list (gint *num_gradients); gchar * gimp_gradients_get_active (void); -void gimp_gradients_set_active (char *name); +void gimp_gradients_set_active (gchar *name); gdouble * gimp_gradients_sample_uniform (gint num_samples); gdouble * gimp_gradients_sample_custom (gint num_samples, gdouble *positions); @@ -894,7 +894,6 @@ void gimp_parasite_detach (const gchar *name); void gimp_help (gchar *prog_name, gchar *help_data); - void gimp_plugin_help_register (gchar *help_path); /**************************************** diff --git a/libgimp/gimpcolordisplay.h b/libgimp/gimpcolordisplay.h index 3d33830e60..1fcef9c610 100644 --- a/libgimp/gimpcolordisplay.h +++ b/libgimp/gimpcolordisplay.h @@ -62,14 +62,15 @@ struct _GimpColorDisplayMethods GimpColorDisplayConfigureCancel cancel; }; -/* - * The following two functions are implemted and exported by gimp/app - * but need to be marked for it here too ... + +/* The following two functions are implemted and exported by gimp/app + * but need to be marked for it here too ... */ + G_MODULE_EXPORT -gboolean gimp_color_display_register (const char *name, - GimpColorDisplayMethods *methods); +gboolean gimp_color_display_register (const gchar *name, + GimpColorDisplayMethods *methods); G_MODULE_EXPORT -gboolean gimp_color_display_unregister (const char *name); +gboolean gimp_color_display_unregister (const gchar *name); #endif /* __GIMP_COLOR_DISPLAY_H__ */ diff --git a/libgimp/gimpcolorselector.h b/libgimp/gimpcolorselector.h index 8b7fc8b51c..a21b5fc227 100644 --- a/libgimp/gimpcolorselector.h +++ b/libgimp/gimpcolorselector.h @@ -21,89 +21,55 @@ #ifndef __COLOR_SELECTOR_H__ #define __COLOR_SELECTOR_H__ - -/********************************/ -/* color selector registration */ +/* For information look at the html documentation */ -/* A function of this type should be called by the color selector each - * time the user modifies the selected color. */ -typedef void (*GimpColorSelector_Callback)(void *data, int r, int g, int b); +typedef void (* GimpColorSelector_Callback) (gpointer data, + gint r, + gint g, + gint b); + +typedef GtkWidget * (* GimpColorSelector_NewFunc) (gint r, + gint g, + gint b, + GimpColorSelector_Callback cb, + gpointer data, + gpointer *selector_data); + +typedef void (* GimpColorSelector_FreeFunc) (gpointer selector_data); -/* A function of this type is called to create a new instance of the - * color selector. The new selector should set its current color to - * the RGB triple given (each component is in the range 0 - 255 - * inclusive, with white at 255,255,255 and black at 0,0,0). - * - * The selector should call "cb" with argument "data" each time the - * user modifies the selected color. - * - * The selector must return a GtkWidget which implements the color - * selection UI. The selector can optionally return "selector_data", - * an opaque pointer which will be passed in to subsequent invokations - * on the selector. */ -typedef GtkWidget * (*GimpColorSelector_NewFunc)(int r, int g, int b, - GimpColorSelector_Callback cb, - void *data, - void **selector_data); - -/* A function of this type is called when the color selector is no - * longer required. This function should not free widgets that are - * containted within the UI widget returned by new(), since they are - * destroyed on behalf of the selector by the caller of this - * function. */ -typedef void (*GimpColorSelector_FreeFunc)(void *selector_data); - - -/* A function of this type is called to change the selector's current - * color. The required color is specified as in the new() function. - * If the "set_current" parameter is FALSE, then only the old color - * should be set - if "set_current" is TRUE, both the old color and - * the current color should be set to the RGB triple given. This - * function merely gives a hint to the color selector; the selector - * can choose to ignore this information. */ -typedef void (*GimpColorSelector_SetColorFunc)(void *selector_data, - int r, int g, int b, - int set_current); +typedef void (* GimpColorSelector_SetColorFunc) (gpointer selector_data, + gint r, + gint g, + gint b, + gboolean set_current); typedef struct _GimpColorSelectorMethods GimpColorSelectorMethods; -struct _GimpColorSelectorMethods { +struct _GimpColorSelectorMethods +{ GimpColorSelector_NewFunc new; GimpColorSelector_FreeFunc free; GimpColorSelector_SetColorFunc setcolor; }; -typedef void *GimpColorSelectorID; +typedef gpointer GimpColorSelectorID; -#ifndef __COLOR_NOTEBOOK_C__ /* Bypass when compiling the source for - * these functions. */ +#ifndef __COLOR_NOTEBOOK_C__ -/* Register a color selector. Returns an identifier for the color - * selector on success, or NULL if the name is already in use. Both - * the name and method table are internalised, so may be freed after - * this call. */ -GimpColorSelectorID gimp_color_selector_register (const char *name, - const char *help_page, - GimpColorSelectorMethods *methods); +/* Bypass when compiling the source for these functions. + */ +GimpColorSelectorID gimp_color_selector_register (const gchar *name, + const gchar *help_page, + GimpColorSelectorMethods *methods); + +typedef void (* GimpColorSelectorFinishedCB) (gpointer finished_data); + +gboolean gimp_color_selector_unregister (GimpColorSelectorID id, + GimpColorSelectorFinishedCB finished_cb, + gpointer finished_data); -/* Remove the selector "id" from active service. New instances of the - * selector will not be created, but existing ones are allowed to - * continue. If "callback" is non-NULL, it will be called once all - * instances have finished. The callback could be used to unload - * dynamiclly loaded code, for example. - * - * Returns TRUE on success, FALSE if "id" was not found. */ -gboolean gimp_color_selector_unregister (GimpColorSelectorID id, - void (*callback)(void *data), - void *data); #endif /* !__COLOR_NOTEBOOK_C__ */ #endif /* __COLOR_SELECTOR_H__ */ - - - - - - diff --git a/libgimp/gimpmatrix.h b/libgimp/gimpmatrix.h index f1315156ed..ddacdbdcb1 100644 --- a/libgimp/gimpmatrix.h +++ b/libgimp/gimpmatrix.h @@ -1,4 +1,4 @@ -/* LIBGIMP - The GIMP Library +/* LIBGIMP - The GIMP Library * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball * * gimpmatrix.h diff --git a/libgimp/gimpmodule.h b/libgimp/gimpmodule.h index 65c1d01687..cbd550210e 100644 --- a/libgimp/gimpmodule.h +++ b/libgimp/gimpmodule.h @@ -19,74 +19,62 @@ */ #ifndef __GIMPMODULE_H__ -#define __GIMPMODULE_H__ +#define __GIMPMODULE_H__ #include +/* For information look at the html documentation */ -typedef enum { +typedef enum +{ GIMP_MODULE_OK, GIMP_MODULE_UNLOAD } GimpModuleStatus; +typedef struct _GimpModuleInfo GimpModuleInfo; -typedef struct { - void *shutdown_data; - const char *purpose; - const char *author; - const char *version; - const char *copyright; - const char *date; -} GimpModuleInfo; +struct _GimpModuleInfo +{ + gpointer shutdown_data; + + const gchar *purpose; + const gchar *author; + const gchar *version; + const gchar *copyright; + const gchar *date; +}; +/* Module initialization */ -/* GIMP modules should G_MODULE_EXPORT a function named "module_init" - * of the following type: */ -typedef GimpModuleStatus (GimpModuleInitFunc) (GimpModuleInfo **); +typedef GimpModuleStatus (* GimpModuleInitFunc) (GimpModuleInfo **module_info); -#ifndef MODULE_COMPILATION /* On Win32 this declaration clashes with - * the definition (which uses G_MODULE_EXPORT) - * and thus should be bypassed when compiling - * the module itself. - */ -GimpModuleInitFunc module_init; -#endif +#ifndef MODULE_COMPILATION -/* This function is called by the GIMP at startup, and should return - * either GIMP_MODULE_OK if it sucessfully initialised or - * GIMP_MODULE_UNLOAD if the module failed to hook whatever functions - * it wanted. GIMP_MODULE_UNLOAD causes the module to be closed, so - * the module must not have registered any internal functions or given - * out pointers to its data to anyone. - * - * If the module returns GIMP_MODULE_OK, it should also return a - * GimpModuleInfo structure describing itself. +/* On Win32 this declaration clashes with the definition + * (which uses G_MODULE_EXPORT) and thus should be bypassed + * when compiling the module itself. */ +GimpModuleInitFunc module_init; + +#endif /* ! MODULE_COMPILATION */ -/* If GIMP modules want to allow themselves to be unloaded, they - * should G_MODULE_EXPORT a function named "module_unload" with the - * following type: */ -typedef void (GimpModuleUnloadFunc) (void *shutdown_data, - void (*completed_cb)(void *), - void *completed_data); +/* Module unload */ -#ifndef MODULE_COMPILATION /* The same as for module_init */ +typedef void (* GimpModuleCompletedCB) (gpointer completed_data); +typedef void (* GimpModuleUnloadFunc) (gpointer shutdown_data, + GimpModuleCompletedCB completed_cb, + gpointer completed_data); + +#ifndef MODULE_COMPILATION + +/* The same as for module_init. + */ GimpModuleUnloadFunc module_unload; -#endif - -/* GIMP calls this unload request function to ask a module to - * prepare itself to be unloaded. It is called with the value of - * shutdown_data supplied in the GimpModuleInfo struct. The module - * should ensure that none of its code or data are being used, and - * then call the supplied "completed_cb" callback function with the - * data provided. Typically the shutdown request function will queue - * de-registration activities then return. Only when the - * de-registration has finished should the completed_cb be invoked. */ - +#endif /* ! MODULE_COMPILATION */ #endif /* __GIMPMODULE_H__ */ diff --git a/libgimp/gimpunit_pdb.c b/libgimp/gimpunit_pdb.c index c0816cd1a6..393b889bdb 100644 --- a/libgimp/gimpunit_pdb.c +++ b/libgimp/gimpunit_pdb.c @@ -96,8 +96,8 @@ gimp_unit_get_number_of_units (void) * gimp_unit_get_number_of_built_in_units: * * Returns the number of #GimpUnit's which are hardcoded in the unit system - * (UNIT_INCH, UNIT_MM, UNIT_POINT, UNIT_PICA and the two "pseudo units" - * UNIT_PIXEL and UNIT_PERCENT). + * (UNIT_INCH, UNIT_MM, UNIT_POINT, UNIT_PICA and the two "pseudo unit" + * UNIT_PIXEL). * * Returns: The number of built-in units. *