Commit 95c903ec authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

Cleaned up the DB Browser and Plugin Details code and GUI. It's not

2004-09-30  Michael Natterer  <mitch@gimp.org>

	Cleaned up the DB Browser and Plugin Details code and GUI.  It's
	not perfect yet but at least they don't look like crap any more.
	Fixes bug #131490.

	* plug-ins/common/plugin-defs.pl
	* plug-ins/common/plugindetails.c: removed this plugin.

	* plug-ins/common/.cvsignore
	* plug-ins/common/Makefile.am: regenerated.

	* plug-ins/dbbrowser/Makefile.am
	* plug-ins/dbbrowser/dbbrowser.c
	* plug-ins/dbbrowser/dbbrowser_utils.[ch]: removed these files.

	* plug-ins/dbbrowser/gimpprocbrowser.[ch]
	* plug-ins/dbbrowser/gimpprocview.[ch]: new cleaned up files.

	* plug-ins/dbbrowser/plugin-browser.c: the former plugindetails.
	* plug-ins/dbbrowser/procedure-browser.c: the former dbbrowser.

	* plug-ins/script-fu/Makefile.am: link against the new library
	libgimpprocbrowser.a

	* plug-ins/script-fu/script-fu-console.c: changed #includes
	accordingly. Monir cleanup.

	* tools/pdbgen/pdb/plug_in.pdb (plugins_query): fixed menu_path
	return value. Was broken since the plug-in menu registering
	changes.

	* app/pdb/plug_in_cmds.c: regenerated.
parent 7762dbd9
2004-09-30 Michael Natterer <mitch@gimp.org>
Cleaned up the DB Browser and Plugin Details code and GUI. It's
not perfect yet but at least they don't look like crap any more.
Fixes bug #131490.
* plug-ins/common/plugin-defs.pl
* plug-ins/common/plugindetails.c: removed this plugin.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am: regenerated.
* plug-ins/dbbrowser/Makefile.am
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/dbbrowser/dbbrowser_utils.[ch]: removed these files.
* plug-ins/dbbrowser/gimpprocbrowser.[ch]
* plug-ins/dbbrowser/gimpprocview.[ch]: new cleaned up files.
* plug-ins/dbbrowser/plugin-browser.c: the former plugindetails.
* plug-ins/dbbrowser/procedure-browser.c: the former dbbrowser.
* plug-ins/script-fu/Makefile.am: link against the new library
libgimpprocbrowser.a
* plug-ins/script-fu/script-fu-console.c: changed #includes
accordingly. Monir cleanup.
* tools/pdbgen/pdb/plug_in.pdb (plugins_query): fixed menu_path
return value. Was broken since the plug-in menu registering
changes.
* app/pdb/plug_in_cmds.c: regenerated.
2004-09-30 Sven Neumann <sven@gimp.org>
* app/widgets/gimphelp.c (gimp_help_get_locales): fixed brokeness
......
......@@ -162,13 +162,22 @@ plugins_query_invoker (Gimp *gimp,
if (search_str && match_strings (&sregex, name))
continue;
menu_strs[i] = gimp_strip_uline (proc_def->menu_paths->data);
if (proc_def->menu_label)
name = g_strdup_printf ("%s/%s",
(gchar *) proc_def->menu_paths->data,
proc_def->menu_label);
else
name = g_strdup (proc_def->menu_paths->data);
menu_strs[i] = gimp_strip_uline (name);
accel_strs[i] = NULL;
prog_strs[i] = g_strdup (proc_def->prog);
types_strs[i] = g_strdup (proc_def->image_types);
realname_strs[i] = g_strdup (pr->name);
time_ints[i] = proc_def->mtime;
g_free (name);
i++;
}
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -16,29 +16,22 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/*
* dbbrowser_utils.h
* 0.08 26th sept 97 by Thomas NOEL <thomas@minet.net>
*/
#ifndef __DBBROWSER_UTILS_H__
#define __DBBROWSER_UTILS_H__
#ifndef __GIMP_PROC_VIEW_H__
#define __GIMP_PROC_VIEW_H__
typedef void (* GimpDBBrowserApplyCallback) (const gchar *proc_name,
const gchar *scheme_proc_name,
const gchar *proc_blurb,
const gchar *proc_help,
const gchar *proc_author,
const gchar *proc_copyright,
const gchar *proc_date,
GimpPDBProcType proc_type,
gint nparams,
gint nreturn_vals,
const GimpParamDef *params,
GimpParamDef *return_vals);
GtkWidget * gimp_db_browser (GimpDBBrowserApplyCallback apply_callback);
GtkWidget * gimp_proc_view_new (const gchar *name,
const gchar *menu_path,
const gchar *blurb,
const gchar *help,
const gchar *author,
const gchar *copyright,
const gchar *date,
GimpPDBProcType type,
gint n_params,
gint n_return_vals,
GimpParamDef *params,
GimpParamDef *return_vals);
#endif /* __DBBROWSER_UTILS_H__ */
#endif /* __GIMP_PROC_VIEW_H__ */
......@@ -89,7 +89,6 @@ photocopy
pix
pixelize
plasma
plugindetails
png
pnm
polar
......
......@@ -114,7 +114,6 @@ libexec_PROGRAMS = \
pix \
pixelize \
plasma \
plugindetails \
$(PNG) \
pnm \
polar \
......@@ -1312,19 +1311,6 @@ plasma_LDADD = \
$(RT_LIBS) \
$(INTLLIBS)
plugindetails_SOURCES = \
plugindetails.c
plugindetails_LDADD = \
$(libgimpui) \
$(libgimpwidgets) \
$(libgimp) \
$(libgimpcolor) \
$(libgimpbase) \
$(GTK_LIBS) \
$(RT_LIBS) \
$(INTLLIBS)
png_SOURCES = \
png.c
......
This diff is collapsed.
......@@ -86,7 +86,6 @@
'pix' => { libdep => 'gtk', ui => 1 },
'pixelize' => { libdep => 'gtk', ui => 1 },
'plasma' => { libdep => 'gtk', ui => 1 },
'plugindetails' => { libdep => 'gtk', ui => 1 },
'png' => { libdep => 'gtk', ui => 1, optional => 1 },
'pnm' => { libdep => 'gtk', ui => 1 },
'polar' => { libdep => 'gtk', ui => 1 },
......
This diff is collapsed.
......@@ -49,7 +49,7 @@
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include "dbbrowser_utils.h"
#include "gimpprocbrowser.h"
#include "libgimp/stdplugins-intl.h"
......@@ -86,7 +86,7 @@ query (void)
"Thomas Noel",
"Thomas Noel",
"23th june 1997",
N_("_DB Browser"),
N_("Procedure _Browser"),
"",
GIMP_PLUGIN,
G_N_ELEMENTS (args), 0,
......@@ -121,7 +121,8 @@ run (const gchar *name,
{
gimp_ui_init ("dbbrowser", FALSE);
gtk_quit_add_destroy (1, (GtkObject *) gimp_db_browser (NULL));
gtk_quit_add_destroy (1, (GtkObject *)
gimp_proc_browser_dialog_new (NULL));
gtk_main ();
gdk_flush ();
......
......@@ -3,4 +3,5 @@ Makefile
.deps
_libs
.libs
dbbrowser
plugin-browser
procedure-browser
......@@ -14,12 +14,21 @@ AM_LDFLAGS = $(mwindows)
libexecdir = $(gimpplugindir)/plug-ins
libexec_PROGRAMS = dbbrowser
noinst_LIBRARIES = libgimpprocbrowser.a
libexec_PROGRAMS = plugin-browser procedure-browser
libgimpprocbrowser_a_SOURCES = \
gimpprocbrowser.c \
gimpprocbrowser.h \
gimpprocview.c \
gimpprocview.h
plugin_browser_SOURCES = \
plugin-browser.c
procedure_browser_SOURCES = \
procedure-browser.c
dbbrowser_SOURCES = \
dbbrowser.c \
dbbrowser_utils.c \
dbbrowser_utils.h
EXTRA_DIST = README
......@@ -34,6 +43,7 @@ LDADD = \
$(libgimp) \
$(libgimpcolor) \
$(libgimpbase) \
libgimpprocbrowser.a \
$(GTK_LIBS) \
$(RT_LIBS) \
$(INTLLIBS)
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/*
* dbbrowser
* 0.08 26th sept 97 by Thomas NOEL <thomas@minet.net>
*/
/*
* This plugin gives you the list of available procedure, with the
* name, description and parameters for each procedure.
* You can do regexp search (by name and by description)
* Useful for scripts development.
*
* NOTE :
* this is only a exercice for me (my first "plug-in" (extension))
* so it's very (very) dirty.
* Btw, hope it gives you some ideas about gimp possibilities.
*
* The core of the plugin is not here. See dbbrowser_utils (shared
* with script-fu-console).
*
* TODO
* - bug fixes... (my method : rewrite from scratch :)
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <gtk/gtk.h>
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include "dbbrowser_utils.h"
#include "libgimp/stdplugins-intl.h"
static void query (void);
static void run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
GimpPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
NULL, /* quit_proc */
query, /* query_proc */
run, /* run_proc */
};
MAIN ()
static void
query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, [non-interactive]" }
};
gimp_install_procedure ("plug_in_db_browser",
"List available procedures in the PDB",
"",
"Thomas Noel",
"Thomas Noel",
"23th june 1997",
N_("_DB Browser"),
"",
GIMP_PLUGIN,
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_db_browser",
N_("<Toolbox>/Xtns/Extensions"));
}
static void
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[1];
GimpRunMode run_mode;
run_mode = param[0].data.d_int32;
*nreturn_vals = 1;
*return_vals = values;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = GIMP_PDB_SUCCESS;
INIT_I18N ();
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
{
gimp_ui_init ("dbbrowser", FALSE);
gtk_quit_add_destroy (1, (GtkObject *) gimp_db_browser (NULL));
gtk_main ();
gdk_flush ();
}
break;
case GIMP_RUN_WITH_LAST_VALS:
case GIMP_RUN_NONINTERACTIVE:
g_warning ("dbbrowser allows only interactive invocation");
values[0].data.d_status = GIMP_PDB_CALLING_ERROR;
break;
default:
break;
}
}
This diff is collapsed.
This diff is collapsed.
......@@ -21,24 +21,25 @@
* 0.08 26th sept 97 by Thomas NOEL <thomas@minet.net>
*/
#ifndef __DBBROWSER_UTILS_H__
#define __DBBROWSER_UTILS_H__
#ifndef __GIMP_PROC_BROWSER_H__
#define __GIMP_PROC_BROWSER_H__
typedef void (* GimpDBBrowserApplyCallback) (const gchar *proc_name,
const gchar *scheme_proc_name,
const gchar *proc_blurb,
const gchar *proc_help,
const gchar *proc_author,
const gchar *proc_copyright,
const gchar *proc_date,
GimpPDBProcType proc_type,
gint nparams,
gint nreturn_vals,
const GimpParamDef *params,
GimpParamDef *return_vals);
typedef void (* GimpProcBrowserApplyCallback) (const gchar *proc_name,
const gchar *scheme_proc_name,
const gchar *proc_blurb,
const gchar *proc_help,
const gchar *proc_author,
const gchar *proc_copyright,
const gchar *proc_date,
GimpPDBProcType proc_type,
gint n_params,
gint n_return_vals,
const GimpParamDef *params,
const GimpParamDef *return_vals);
GtkWidget * gimp_db_browser (GimpDBBrowserApplyCallback apply_callback);
GtkWidget * gimp_proc_browser_dialog_new (GimpProcBrowserApplyCallback apply_callback);
#endif /* __DBBROWSER_UTILS_H__ */
#endif /* __GIMP_PROC_BROWSER_H__ */
This diff is collapsed.
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_PROC_VIEW_H__
#define __GIMP_PROC_VIEW_H__
GtkWidget * gimp_proc_view_new (const gchar *name,
const gchar *menu_path,
const gchar *blurb,
const gchar *help,
const gchar *author,
const gchar *copyright,
const gchar *date,
GimpPDBProcType type,
gint n_params,
gint n_return_vals,
GimpParamDef *params,
GimpParamDef *return_vals);
#endif /* __GIMP_PROC_VIEW_H__ */
This diff is collapsed.
......@@ -49,7 +49,7 @@
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include "dbbrowser_utils.h"
#include "gimpprocbrowser.h"
#include "libgimp/stdplugins-intl.h"
......@@ -86,7 +86,7 @@ query (void)
"Thomas Noel",
"Thomas Noel",
"23th june 1997",
N_("_DB Browser"),
N_("Procedure _Browser"),
"",
GIMP_PLUGIN,
G_N_ELEMENTS (args), 0,
......@@ -121,7 +121,8 @@ run (const gchar *name,
{
gimp_ui_init ("dbbrowser", FALSE);
gtk_quit_add_destroy (1, (GtkObject *) gimp_db_browser (NULL));
gtk_quit_add_destroy (1, (GtkObject *)
gimp_proc_browser_dialog_new (NULL));
gtk_main ();
gdk_flush ();
......
......@@ -5,6 +5,7 @@ libgimpwidgets = $(top_builddir)/libgimpwidgets/libgimpwidgets-$(GIMP_API_VERSIO
libgimp = $(top_builddir)/libgimp/libgimp-$(GIMP_API_VERSION).la
libgimpcolor = $(top_builddir)/libgimpcolor/libgimpcolor-$(GIMP_API_VERSION).la
libgimpbase = $(top_builddir)/libgimpbase/libgimpbase-$(GIMP_API_VERSION).la
libgimpprocbrowser = $(top_builddir)/plug-ins/dbbrowser/libgimpprocbrowser.a
if OS_WIN32
mwindows = -mwindows
......@@ -51,16 +52,16 @@ REGEXREPL = $(top_builddir)/regexrepl/libregex.a
endif
LDADD = \
$(top_builddir)/plug-ins/dbbrowser/dbbrowser_utils.o \
$(libgimpui) \
$(libgimpwidgets) \
$(libgimp) \
$(libgimpcolor) \
$(libgimpbase) \
siod/libsiod.a \
$(REGEXREPL) \
$(GTK_LIBS) \
$(SOCKET_LIBS) \
$(WINSOCK_LIBS) \
$(RT_LIBS) \
$(libgimpui) \
$(libgimpwidgets) \
$(libgimp) \
$(libgimpcolor) \
$(libgimpbase) \
$(libgimpprocbrowser) \
siod/libsiod.a \
$(REGEXREPL) \
$(GTK_LIBS) \
$(SOCKET_LIBS) \
$(WINSOCK_LIBS) \
$(RT_LIBS) \
$(INTLLIBS)
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment