Commit 9daad804 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

plug-ins/dbbrowser/gimpprocbox.c plug-ins/dbbrowser/gimpprocbrowser.[ch]

2004-11-17  Michael Natterer  <mitch@gimp.org>

	* plug-ins/dbbrowser/gimpprocbox.c
	* plug-ins/dbbrowser/gimpprocbrowser.[ch]
	* plug-ins/dbbrowser/gimpprocview.c: some cleanup in preparation
	of moving it to a more public place.

	* plug-ins/dbbrowser/procedure-browser.c
	* plug-ins/script-fu/script-fu-console.c: changed accordingly.
parent 9c92651c
2004-11-17 Michael Natterer <mitch@gimp.org>
* plug-ins/dbbrowser/gimpprocbox.c
* plug-ins/dbbrowser/gimpprocbrowser.[ch]
* plug-ins/dbbrowser/gimpprocview.c: some cleanup in preparation
of moving it to a more public place.
* plug-ins/dbbrowser/procedure-browser.c
* plug-ins/script-fu/script-fu-console.c: changed accordingly.
2004-11-17 Sven Neumann <sven@gimp.org>
* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): removed --enable-gtk-doc
......
......@@ -68,7 +68,6 @@ typedef struct
/* the currently selected procedure */
gchar *proc_name;
gchar *scheme_proc_name;
gchar *proc_blurb;
gchar *proc_help;
gchar *proc_author;
......@@ -80,6 +79,7 @@ typedef struct
GimpParamDef *params;
GimpParamDef *return_vals;
gboolean scheme_names;
GimpProcBrowserApplyCallback apply_callback;
} GimpDBBrowser;
......@@ -103,7 +103,8 @@ static void browser_convert_string (gchar *str);
/* public functions */
GtkWidget *
gimp_proc_browser_dialog_new (GimpProcBrowserApplyCallback apply_callback)
gimp_proc_browser_dialog_new (gboolean scheme_names,
GimpProcBrowserApplyCallback apply_callback)
{
GimpDBBrowser *browser;
GtkWidget *paned;
......@@ -115,6 +116,7 @@ gimp_proc_browser_dialog_new (GimpProcBrowserApplyCallback apply_callback)
browser = g_new0 (GimpDBBrowser, 1);
browser->scheme_names = scheme_names ? TRUE : FALSE;
browser->apply_callback = apply_callback;
if (apply_callback)
......@@ -242,7 +244,6 @@ gimp_proc_browser_dialog_new (GimpProcBrowserApplyCallback apply_callback)
/* initialize the "return" value (for "apply") */
browser->proc_name = NULL;
browser->scheme_proc_name = NULL;
browser->proc_blurb = NULL;
browser->proc_help = NULL;
browser->proc_author = NULL;
......@@ -299,9 +300,8 @@ browser_show_procedure (GimpDBBrowser *browser,
g_free (browser->proc_name);
browser->proc_name = g_strdup (proc_name);
g_free (browser->scheme_proc_name);
browser->scheme_proc_name = g_strdup (proc_name);
browser_convert_string (browser->scheme_proc_name);
if (browser->scheme_names)
browser_convert_string (browser->proc_name);
g_free (browser->proc_blurb);
g_free (browser->proc_help);
......@@ -325,7 +325,7 @@ browser_show_procedure (GimpDBBrowser *browser,
&browser->return_vals);
gimp_proc_box_set_widget (browser->proc_box,
gimp_proc_view_new (browser->scheme_proc_name,
gimp_proc_view_new (browser->proc_name,
NULL,
browser->proc_blurb,
browser->proc_help,
......@@ -348,7 +348,6 @@ browser_response (GtkWidget *widget,
{
case GTK_RESPONSE_APPLY:
browser->apply_callback (browser->proc_name,
browser->scheme_proc_name,
browser->proc_blurb,
browser->proc_help,
browser->proc_author,
......
......@@ -44,7 +44,7 @@ static GtkWidget * gimp_proc_view_create_params (GimpParamDef *params,
GtkSizeGroup *name_group,
GtkSizeGroup *type_group,
GtkSizeGroup *desc_group);
static const gchar * GParamType_to_string (GimpPDBArgType type);
static const gchar * GimpPDBArgType_to_string (GimpPDBArgType type);
static const gchar * GimpPDBProcType_to_string (GimpPDBProcType type);
......@@ -254,7 +254,7 @@ gimp_proc_view_create_params (GimpParamDef *params,
gtk_widget_show (label);
/* type */
type = GParamType_to_string (params[i].type);
type = GimpPDBArgType_to_string (params[i].type);
label = gtk_label_new (type);
gimp_label_set_attributes (GTK_LABEL (label),
PANGO_ATTR_FAMILY, "monospace",
......@@ -280,7 +280,7 @@ gimp_proc_view_create_params (GimpParamDef *params,
}
static const gchar *
GParamType_to_string (GimpPDBArgType type)
GimpPDBArgType_to_string (GimpPDBArgType type)
{
switch (type)
{
......
......@@ -121,7 +121,7 @@ run (const gchar *name,
gimp_ui_init ("dbbrowser", FALSE);
gtk_quit_add_destroy (1, (GtkObject *)
gimp_proc_browser_dialog_new (NULL));
gimp_proc_browser_dialog_new (FALSE, NULL));
gtk_main ();
gdk_flush ();
......
......@@ -56,6 +56,9 @@ gimp_proc_box_set_widget (GtkWidget *proc_box,
GtkWidget *vbox;
GtkWidget *child;
g_return_if_fail (GTK_IS_SCROLLED_WINDOW (proc_box));
g_return_if_fail (GTK_IS_WIDGET (widget));
vbox = g_object_get_data (G_OBJECT (proc_box), "vbox");
g_return_if_fail (GTK_IS_VBOX (vbox));
......@@ -78,6 +81,9 @@ gimp_proc_box_show_message (GtkWidget *proc_box,
GtkWidget *vbox;
GtkWidget *child;
g_return_if_fail (GTK_IS_SCROLLED_WINDOW (proc_box));
g_return_if_fail (message != NULL);
vbox = g_object_get_data (G_OBJECT (proc_box), "vbox");
g_return_if_fail (GTK_IS_VBOX (vbox));
......
......@@ -68,7 +68,6 @@ typedef struct
/* the currently selected procedure */
gchar *proc_name;
gchar *scheme_proc_name;
gchar *proc_blurb;
gchar *proc_help;
gchar *proc_author;
......@@ -80,6 +79,7 @@ typedef struct
GimpParamDef *params;
GimpParamDef *return_vals;
gboolean scheme_names;
GimpProcBrowserApplyCallback apply_callback;
} GimpDBBrowser;
......@@ -103,7 +103,8 @@ static void browser_convert_string (gchar *str);
/* public functions */
GtkWidget *
gimp_proc_browser_dialog_new (GimpProcBrowserApplyCallback apply_callback)
gimp_proc_browser_dialog_new (gboolean scheme_names,
GimpProcBrowserApplyCallback apply_callback)
{
GimpDBBrowser *browser;
GtkWidget *paned;
......@@ -115,6 +116,7 @@ gimp_proc_browser_dialog_new (GimpProcBrowserApplyCallback apply_callback)
browser = g_new0 (GimpDBBrowser, 1);
browser->scheme_names = scheme_names ? TRUE : FALSE;
browser->apply_callback = apply_callback;
if (apply_callback)
......@@ -242,7 +244,6 @@ gimp_proc_browser_dialog_new (GimpProcBrowserApplyCallback apply_callback)
/* initialize the "return" value (for "apply") */
browser->proc_name = NULL;
browser->scheme_proc_name = NULL;
browser->proc_blurb = NULL;
browser->proc_help = NULL;
browser->proc_author = NULL;
......@@ -299,9 +300,8 @@ browser_show_procedure (GimpDBBrowser *browser,
g_free (browser->proc_name);
browser->proc_name = g_strdup (proc_name);
g_free (browser->scheme_proc_name);
browser->scheme_proc_name = g_strdup (proc_name);
browser_convert_string (browser->scheme_proc_name);
if (browser->scheme_names)
browser_convert_string (browser->proc_name);
g_free (browser->proc_blurb);
g_free (browser->proc_help);
......@@ -325,7 +325,7 @@ browser_show_procedure (GimpDBBrowser *browser,
&browser->return_vals);
gimp_proc_box_set_widget (browser->proc_box,
gimp_proc_view_new (browser->scheme_proc_name,
gimp_proc_view_new (browser->proc_name,
NULL,
browser->proc_blurb,
browser->proc_help,
......@@ -348,7 +348,6 @@ browser_response (GtkWidget *widget,
{
case GTK_RESPONSE_APPLY:
browser->apply_callback (browser->proc_name,
browser->scheme_proc_name,
browser->proc_blurb,
browser->proc_help,
browser->proc_author,
......
......@@ -26,7 +26,6 @@
typedef void (* GimpProcBrowserApplyCallback) (const gchar *proc_name,
const gchar *scheme_proc_name,
const gchar *proc_blurb,
const gchar *proc_help,
const gchar *proc_author,
......@@ -39,7 +38,8 @@ typedef void (* GimpProcBrowserApplyCallback) (const gchar *proc_name,
const GimpParamDef *return_vals);
GtkWidget * gimp_proc_browser_dialog_new (GimpProcBrowserApplyCallback apply_callback);
GtkWidget * gimp_proc_browser_dialog_new (gboolean scheme_names,
GimpProcBrowserApplyCallback apply_callback);
#endif /* __GIMP_PROC_BROWSER_H__ */
......@@ -44,7 +44,7 @@ static GtkWidget * gimp_proc_view_create_params (GimpParamDef *params,
GtkSizeGroup *name_group,
GtkSizeGroup *type_group,
GtkSizeGroup *desc_group);
static const gchar * GParamType_to_string (GimpPDBArgType type);
static const gchar * GimpPDBArgType_to_string (GimpPDBArgType type);
static const gchar * GimpPDBProcType_to_string (GimpPDBProcType type);
......@@ -254,7 +254,7 @@ gimp_proc_view_create_params (GimpParamDef *params,
gtk_widget_show (label);
/* type */
type = GParamType_to_string (params[i].type);
type = GimpPDBArgType_to_string (params[i].type);
label = gtk_label_new (type);
gimp_label_set_attributes (GTK_LABEL (label),
PANGO_ATTR_FAMILY, "monospace",
......@@ -280,7 +280,7 @@ gimp_proc_view_create_params (GimpParamDef *params,
}
static const gchar *
GParamType_to_string (GimpPDBArgType type)
GimpPDBArgType_to_string (GimpPDBArgType type)
{
switch (type)
{
......
......@@ -121,7 +121,7 @@ run (const gchar *name,
gimp_ui_init ("dbbrowser", FALSE);
gtk_quit_add_destroy (1, (GtkObject *)
gimp_proc_browser_dialog_new (NULL));
gimp_proc_browser_dialog_new (FALSE, NULL));
gtk_main ();
gdk_flush ();
......
......@@ -297,7 +297,6 @@ script_fu_response (GtkWidget *widget,
static void
apply_callback (const gchar *proc_name,
const gchar *scheme_proc_name,
const gchar *proc_blurb,
const gchar *proc_help,
const gchar *proc_author,
......@@ -316,7 +315,7 @@ apply_callback (const gchar *proc_name,
return;
text = g_string_new ("(");
text = g_string_append (text, scheme_proc_name);
text = g_string_append (text, proc_name);
for (i = 0; i < n_params; i++)
{
......@@ -335,7 +334,7 @@ script_fu_browse_callback (GtkWidget *widget,
gpointer data)
{
gtk_quit_add_destroy (1, (GtkObject *)
gimp_proc_browser_dialog_new (apply_callback));
gimp_proc_browser_dialog_new (TRUE, apply_callback));
}
static gboolean
......
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