mirror of https://github.com/GNOME/gimp.git
app/gdisplay.c app/gdisplay.h app/interface.c app/plug_in.c app/plug_in.h
Sun Jun 14 21:16:42 CDT 1998 Shawn T. Amundson <amundson@gimp.org> * app/gdisplay.c * app/gdisplay.h * app/interface.c * app/plug_in.c * app/plug_in.h * libgimp/gimp.c: added statusbar and progressbar, which the plugins now use if they have a gdisp. Unfortunately this introduces a resize bug I wasn't able to fix immediately. ;-(
This commit is contained in:
parent
b0e08ede22
commit
127e98b5f7
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
Sun Jun 14 21:16:42 CDT 1998 Shawn T. Amundson <amundson@gimp.org>
|
||||
|
||||
* app/gdisplay.c
|
||||
* app/gdisplay.h
|
||||
* app/interface.c
|
||||
* app/plug_in.c
|
||||
* app/plug_in.h
|
||||
* libgimp/gimp.c: added statusbar and progressbar, which
|
||||
the plugins now use if they have a gdisp. Unfortunately
|
||||
this introduces a resize bug I wasn't able to fix
|
||||
immediately. ;-(
|
||||
|
||||
Sun Jun 14 18:37:06 1998 Owen Taylor <otaylor@gtk.org>
|
||||
|
||||
* app/blob.[ch] (blob_bounds): Added new files for
|
||||
|
|
|
@ -143,7 +143,10 @@ static ProcArg progress_init_args[] =
|
|||
{
|
||||
{ PDB_STRING,
|
||||
"message",
|
||||
"Message to use in the progress dialog." }
|
||||
"Message to use in the progress dialog." },
|
||||
{ PDB_INT8,
|
||||
"gdisplay",
|
||||
"GDisplay to update progressbar in, or -1 for a seperate window" }
|
||||
};
|
||||
|
||||
static ProcRecord progress_init_proc =
|
||||
|
@ -155,7 +158,7 @@ static ProcRecord progress_init_proc =
|
|||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
PDB_INTERNAL,
|
||||
1,
|
||||
2,
|
||||
progress_init_args,
|
||||
0,
|
||||
NULL,
|
||||
|
@ -724,6 +727,9 @@ plug_in_new (char *name)
|
|||
void
|
||||
plug_in_destroy (PlugIn *plug_in)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
guint c_id;
|
||||
|
||||
if (plug_in)
|
||||
{
|
||||
plug_in_close (plug_in, TRUE);
|
||||
|
@ -741,6 +747,16 @@ plug_in_destroy (PlugIn *plug_in)
|
|||
if (plug_in->args[5])
|
||||
g_free (plug_in->args[5]);
|
||||
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
c_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(gdisp->statusbar), c_id);
|
||||
gtk_progress_bar_update(GTK_PROGRESS_BAR(gdisp->progressbar), 0.0);
|
||||
gdisp->progressid = 0;
|
||||
}
|
||||
|
||||
if (plug_in == current_plug_in)
|
||||
plug_in_pop ();
|
||||
|
||||
|
@ -2906,16 +2922,31 @@ plug_in_progress_cancel (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
plug_in_progress_init (PlugIn *plug_in,
|
||||
char *message)
|
||||
char *message,
|
||||
gint gdisp_ID)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *button;
|
||||
GDisplay *gdisp;
|
||||
guint context_id;
|
||||
|
||||
if (!message)
|
||||
message = plug_in->args[0];
|
||||
|
||||
if (gdisp_ID > 0)
|
||||
gdisp = gdisplay_get_ID(gdisp_ID);
|
||||
|
||||
if (gdisp_ID > 0 && gdisp->progressid == 0)
|
||||
{
|
||||
context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
|
||||
gdisp->progressid = gtk_statusbar_push(GTK_STATUSBAR(gdisp->statusbar),
|
||||
context_id, message);
|
||||
plug_in->progress_gdisp_ID = gdisp_ID;
|
||||
}
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = gtk_dialog_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (plug_in->progress), "plug_in_progress", "Gimp");
|
||||
|
@ -2957,7 +2988,7 @@ plug_in_progress_init (PlugIn *plug_in,
|
|||
gtk_label_set (GTK_LABEL (plug_in->progress_label), message);
|
||||
}
|
||||
#else
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = 0x1;
|
||||
progress_update (0.0);
|
||||
|
@ -2970,14 +3001,24 @@ static void
|
|||
plug_in_progress_update (PlugIn *plug_in,
|
||||
double percentage)
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL);
|
||||
GDisplay *gdisp;
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
gtk_progress_bar_update( GTK_PROGRESS_BAR (gdisp->progressbar), percentage);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL, -1);
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
#else
|
||||
progress_update (percentage);
|
||||
progress_update (percentage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static Argument*
|
||||
|
@ -2989,7 +3030,8 @@ progress_init_invoker (Argument *args)
|
|||
{
|
||||
success = TRUE;
|
||||
if (no_interface == FALSE)
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer);
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer,
|
||||
args[1].value.pdb_int);
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&progress_init_proc, success);
|
||||
|
|
|
@ -126,6 +126,8 @@ gdisplay_new (GImage *gimage,
|
|||
gdisp->proximity = FALSE;
|
||||
gdisp->have_cursor = FALSE;
|
||||
|
||||
gdisp->progressid = FALSE;
|
||||
|
||||
/* add the new display to the list so that it isn't lost */
|
||||
display_list = g_slist_append (display_list, (void *) gdisp);
|
||||
|
||||
|
|
|
@ -58,6 +58,9 @@ struct _GDisplay
|
|||
GtkWidget *hrule, *vrule; /* widgets for rulers */
|
||||
GtkWidget *origin; /* widgets for rulers */
|
||||
GtkWidget *popup; /* widget for popup menu */
|
||||
GtkWidget *statusbar; /* widget for statusbar */
|
||||
GtkWidget *progressbar; /* widget for progressbar */
|
||||
guint progressid; /* id of statusbar message for progress */
|
||||
|
||||
InfoDialog *window_info_dialog; /* dialog box for image information */
|
||||
|
||||
|
|
|
@ -126,6 +126,8 @@ gdisplay_new (GImage *gimage,
|
|||
gdisp->proximity = FALSE;
|
||||
gdisp->have_cursor = FALSE;
|
||||
|
||||
gdisp->progressid = FALSE;
|
||||
|
||||
/* add the new display to the list so that it isn't lost */
|
||||
display_list = g_slist_append (display_list, (void *) gdisp);
|
||||
|
||||
|
|
|
@ -58,6 +58,9 @@ struct _GDisplay
|
|||
GtkWidget *hrule, *vrule; /* widgets for rulers */
|
||||
GtkWidget *origin; /* widgets for rulers */
|
||||
GtkWidget *popup; /* widget for popup menu */
|
||||
GtkWidget *statusbar; /* widget for statusbar */
|
||||
GtkWidget *progressbar; /* widget for progressbar */
|
||||
guint progressid; /* id of statusbar message for progress */
|
||||
|
||||
InfoDialog *window_info_dialog; /* dialog box for image information */
|
||||
|
||||
|
|
|
@ -680,10 +680,12 @@ create_display_shell (int gdisp_id,
|
|||
static GtkAccelGroup *image_accel_group = NULL;
|
||||
GDisplay *gdisp;
|
||||
GtkWidget *table;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *arrow;
|
||||
int n_width, n_height;
|
||||
int s_width, s_height;
|
||||
int scalesrc, scaledest;
|
||||
int contextid;
|
||||
|
||||
/* Get the gdisplay */
|
||||
if (! (gdisp = gdisplay_get_ID (gdisp_id)))
|
||||
|
@ -737,14 +739,18 @@ create_display_shell (int gdisp_id,
|
|||
gdisp);
|
||||
|
||||
/* the table containing all widgets */
|
||||
table = gtk_table_new (3, 3, FALSE);
|
||||
table = gtk_table_new (4, 3, FALSE);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 1);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (table), 1, 2);
|
||||
gtk_table_set_row_spacing (GTK_TABLE (table), 0, 1);
|
||||
gtk_table_set_row_spacing (GTK_TABLE (table), 1, 2);
|
||||
gtk_table_set_row_spacing (GTK_TABLE (table), 2, 2);
|
||||
gtk_container_border_width (GTK_CONTAINER (table), 2);
|
||||
gtk_container_add (GTK_CONTAINER (gdisp->shell), table);
|
||||
|
||||
/* hbox for statusbar area */
|
||||
hbox = gtk_hbox_new(0,2);
|
||||
|
||||
/* scrollbars, rulers, canvas, menu popup button */
|
||||
gdisp->origin = gtk_button_new ();
|
||||
gtk_widget_set_events (GTK_WIDGET (gdisp->origin),
|
||||
|
@ -809,10 +815,25 @@ create_display_shell (int gdisp_id,
|
|||
GTK_EXPAND | GTK_SHRINK | GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_table_attach (GTK_TABLE (table), gdisp->vsb, 2, 3, 0, 2,
|
||||
GTK_FILL, GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_table_attach (GTK_TABLE (table), hbox, 0, 3, 3, 4,
|
||||
GTK_FILL, 0, 0, 0);
|
||||
|
||||
if (! image_popup_menu)
|
||||
menus_get_image_menu (&image_popup_menu, &image_accel_group);
|
||||
|
||||
/* statusbar, progressbar */
|
||||
gdisp->statusbar = gtk_statusbar_new();
|
||||
gtk_box_pack_start (GTK_BOX (hbox), gdisp->statusbar, TRUE, TRUE, 0);
|
||||
contextid = gtk_statusbar_get_context_id (GTK_STATUSBAR (gdisp->statusbar),
|
||||
"title");
|
||||
gtk_statusbar_push(GTK_STATUSBAR (gdisp->statusbar),
|
||||
contextid,
|
||||
title);
|
||||
|
||||
gdisp->progressbar = gtk_progress_bar_new();
|
||||
gtk_widget_set_usize(gdisp->progressbar, 100, -1);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), gdisp->progressbar, FALSE, TRUE, 0);
|
||||
|
||||
/* the popup menu */
|
||||
gdisp->popup = image_popup_menu;
|
||||
|
||||
|
@ -826,6 +847,9 @@ create_display_shell (int gdisp_id,
|
|||
gtk_widget_show (gdisp->hrule);
|
||||
gtk_widget_show (gdisp->vrule);
|
||||
gtk_widget_show (gdisp->canvas);
|
||||
gtk_widget_show (gdisp->statusbar);
|
||||
gtk_widget_show (gdisp->progressbar);
|
||||
gtk_widget_show (hbox);
|
||||
gtk_widget_show (table);
|
||||
gtk_widget_show (gdisp->shell);
|
||||
|
||||
|
|
|
@ -680,10 +680,12 @@ create_display_shell (int gdisp_id,
|
|||
static GtkAccelGroup *image_accel_group = NULL;
|
||||
GDisplay *gdisp;
|
||||
GtkWidget *table;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *arrow;
|
||||
int n_width, n_height;
|
||||
int s_width, s_height;
|
||||
int scalesrc, scaledest;
|
||||
int contextid;
|
||||
|
||||
/* Get the gdisplay */
|
||||
if (! (gdisp = gdisplay_get_ID (gdisp_id)))
|
||||
|
@ -737,14 +739,18 @@ create_display_shell (int gdisp_id,
|
|||
gdisp);
|
||||
|
||||
/* the table containing all widgets */
|
||||
table = gtk_table_new (3, 3, FALSE);
|
||||
table = gtk_table_new (4, 3, FALSE);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 1);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (table), 1, 2);
|
||||
gtk_table_set_row_spacing (GTK_TABLE (table), 0, 1);
|
||||
gtk_table_set_row_spacing (GTK_TABLE (table), 1, 2);
|
||||
gtk_table_set_row_spacing (GTK_TABLE (table), 2, 2);
|
||||
gtk_container_border_width (GTK_CONTAINER (table), 2);
|
||||
gtk_container_add (GTK_CONTAINER (gdisp->shell), table);
|
||||
|
||||
/* hbox for statusbar area */
|
||||
hbox = gtk_hbox_new(0,2);
|
||||
|
||||
/* scrollbars, rulers, canvas, menu popup button */
|
||||
gdisp->origin = gtk_button_new ();
|
||||
gtk_widget_set_events (GTK_WIDGET (gdisp->origin),
|
||||
|
@ -809,10 +815,25 @@ create_display_shell (int gdisp_id,
|
|||
GTK_EXPAND | GTK_SHRINK | GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_table_attach (GTK_TABLE (table), gdisp->vsb, 2, 3, 0, 2,
|
||||
GTK_FILL, GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_table_attach (GTK_TABLE (table), hbox, 0, 3, 3, 4,
|
||||
GTK_FILL, 0, 0, 0);
|
||||
|
||||
if (! image_popup_menu)
|
||||
menus_get_image_menu (&image_popup_menu, &image_accel_group);
|
||||
|
||||
/* statusbar, progressbar */
|
||||
gdisp->statusbar = gtk_statusbar_new();
|
||||
gtk_box_pack_start (GTK_BOX (hbox), gdisp->statusbar, TRUE, TRUE, 0);
|
||||
contextid = gtk_statusbar_get_context_id (GTK_STATUSBAR (gdisp->statusbar),
|
||||
"title");
|
||||
gtk_statusbar_push(GTK_STATUSBAR (gdisp->statusbar),
|
||||
contextid,
|
||||
title);
|
||||
|
||||
gdisp->progressbar = gtk_progress_bar_new();
|
||||
gtk_widget_set_usize(gdisp->progressbar, 100, -1);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), gdisp->progressbar, FALSE, TRUE, 0);
|
||||
|
||||
/* the popup menu */
|
||||
gdisp->popup = image_popup_menu;
|
||||
|
||||
|
@ -826,6 +847,9 @@ create_display_shell (int gdisp_id,
|
|||
gtk_widget_show (gdisp->hrule);
|
||||
gtk_widget_show (gdisp->vrule);
|
||||
gtk_widget_show (gdisp->canvas);
|
||||
gtk_widget_show (gdisp->statusbar);
|
||||
gtk_widget_show (gdisp->progressbar);
|
||||
gtk_widget_show (hbox);
|
||||
gtk_widget_show (table);
|
||||
gtk_widget_show (gdisp->shell);
|
||||
|
||||
|
|
|
@ -126,6 +126,8 @@ gdisplay_new (GImage *gimage,
|
|||
gdisp->proximity = FALSE;
|
||||
gdisp->have_cursor = FALSE;
|
||||
|
||||
gdisp->progressid = FALSE;
|
||||
|
||||
/* add the new display to the list so that it isn't lost */
|
||||
display_list = g_slist_append (display_list, (void *) gdisp);
|
||||
|
||||
|
|
|
@ -58,6 +58,9 @@ struct _GDisplay
|
|||
GtkWidget *hrule, *vrule; /* widgets for rulers */
|
||||
GtkWidget *origin; /* widgets for rulers */
|
||||
GtkWidget *popup; /* widget for popup menu */
|
||||
GtkWidget *statusbar; /* widget for statusbar */
|
||||
GtkWidget *progressbar; /* widget for progressbar */
|
||||
guint progressid; /* id of statusbar message for progress */
|
||||
|
||||
InfoDialog *window_info_dialog; /* dialog box for image information */
|
||||
|
||||
|
|
|
@ -143,7 +143,10 @@ static ProcArg progress_init_args[] =
|
|||
{
|
||||
{ PDB_STRING,
|
||||
"message",
|
||||
"Message to use in the progress dialog." }
|
||||
"Message to use in the progress dialog." },
|
||||
{ PDB_INT8,
|
||||
"gdisplay",
|
||||
"GDisplay to update progressbar in, or -1 for a seperate window" }
|
||||
};
|
||||
|
||||
static ProcRecord progress_init_proc =
|
||||
|
@ -155,7 +158,7 @@ static ProcRecord progress_init_proc =
|
|||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
PDB_INTERNAL,
|
||||
1,
|
||||
2,
|
||||
progress_init_args,
|
||||
0,
|
||||
NULL,
|
||||
|
@ -724,6 +727,9 @@ plug_in_new (char *name)
|
|||
void
|
||||
plug_in_destroy (PlugIn *plug_in)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
guint c_id;
|
||||
|
||||
if (plug_in)
|
||||
{
|
||||
plug_in_close (plug_in, TRUE);
|
||||
|
@ -741,6 +747,16 @@ plug_in_destroy (PlugIn *plug_in)
|
|||
if (plug_in->args[5])
|
||||
g_free (plug_in->args[5]);
|
||||
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
c_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(gdisp->statusbar), c_id);
|
||||
gtk_progress_bar_update(GTK_PROGRESS_BAR(gdisp->progressbar), 0.0);
|
||||
gdisp->progressid = 0;
|
||||
}
|
||||
|
||||
if (plug_in == current_plug_in)
|
||||
plug_in_pop ();
|
||||
|
||||
|
@ -2906,16 +2922,31 @@ plug_in_progress_cancel (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
plug_in_progress_init (PlugIn *plug_in,
|
||||
char *message)
|
||||
char *message,
|
||||
gint gdisp_ID)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *button;
|
||||
GDisplay *gdisp;
|
||||
guint context_id;
|
||||
|
||||
if (!message)
|
||||
message = plug_in->args[0];
|
||||
|
||||
if (gdisp_ID > 0)
|
||||
gdisp = gdisplay_get_ID(gdisp_ID);
|
||||
|
||||
if (gdisp_ID > 0 && gdisp->progressid == 0)
|
||||
{
|
||||
context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
|
||||
gdisp->progressid = gtk_statusbar_push(GTK_STATUSBAR(gdisp->statusbar),
|
||||
context_id, message);
|
||||
plug_in->progress_gdisp_ID = gdisp_ID;
|
||||
}
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = gtk_dialog_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (plug_in->progress), "plug_in_progress", "Gimp");
|
||||
|
@ -2957,7 +2988,7 @@ plug_in_progress_init (PlugIn *plug_in,
|
|||
gtk_label_set (GTK_LABEL (plug_in->progress_label), message);
|
||||
}
|
||||
#else
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = 0x1;
|
||||
progress_update (0.0);
|
||||
|
@ -2970,14 +3001,24 @@ static void
|
|||
plug_in_progress_update (PlugIn *plug_in,
|
||||
double percentage)
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL);
|
||||
GDisplay *gdisp;
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
gtk_progress_bar_update( GTK_PROGRESS_BAR (gdisp->progressbar), percentage);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL, -1);
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
#else
|
||||
progress_update (percentage);
|
||||
progress_update (percentage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static Argument*
|
||||
|
@ -2989,7 +3030,8 @@ progress_init_invoker (Argument *args)
|
|||
{
|
||||
success = TRUE;
|
||||
if (no_interface == FALSE)
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer);
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer,
|
||||
args[1].value.pdb_int);
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&progress_init_proc, success);
|
||||
|
|
|
@ -143,7 +143,10 @@ static ProcArg progress_init_args[] =
|
|||
{
|
||||
{ PDB_STRING,
|
||||
"message",
|
||||
"Message to use in the progress dialog." }
|
||||
"Message to use in the progress dialog." },
|
||||
{ PDB_INT8,
|
||||
"gdisplay",
|
||||
"GDisplay to update progressbar in, or -1 for a seperate window" }
|
||||
};
|
||||
|
||||
static ProcRecord progress_init_proc =
|
||||
|
@ -155,7 +158,7 @@ static ProcRecord progress_init_proc =
|
|||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
PDB_INTERNAL,
|
||||
1,
|
||||
2,
|
||||
progress_init_args,
|
||||
0,
|
||||
NULL,
|
||||
|
@ -724,6 +727,9 @@ plug_in_new (char *name)
|
|||
void
|
||||
plug_in_destroy (PlugIn *plug_in)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
guint c_id;
|
||||
|
||||
if (plug_in)
|
||||
{
|
||||
plug_in_close (plug_in, TRUE);
|
||||
|
@ -741,6 +747,16 @@ plug_in_destroy (PlugIn *plug_in)
|
|||
if (plug_in->args[5])
|
||||
g_free (plug_in->args[5]);
|
||||
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
c_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(gdisp->statusbar), c_id);
|
||||
gtk_progress_bar_update(GTK_PROGRESS_BAR(gdisp->progressbar), 0.0);
|
||||
gdisp->progressid = 0;
|
||||
}
|
||||
|
||||
if (plug_in == current_plug_in)
|
||||
plug_in_pop ();
|
||||
|
||||
|
@ -2906,16 +2922,31 @@ plug_in_progress_cancel (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
plug_in_progress_init (PlugIn *plug_in,
|
||||
char *message)
|
||||
char *message,
|
||||
gint gdisp_ID)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *button;
|
||||
GDisplay *gdisp;
|
||||
guint context_id;
|
||||
|
||||
if (!message)
|
||||
message = plug_in->args[0];
|
||||
|
||||
if (gdisp_ID > 0)
|
||||
gdisp = gdisplay_get_ID(gdisp_ID);
|
||||
|
||||
if (gdisp_ID > 0 && gdisp->progressid == 0)
|
||||
{
|
||||
context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
|
||||
gdisp->progressid = gtk_statusbar_push(GTK_STATUSBAR(gdisp->statusbar),
|
||||
context_id, message);
|
||||
plug_in->progress_gdisp_ID = gdisp_ID;
|
||||
}
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = gtk_dialog_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (plug_in->progress), "plug_in_progress", "Gimp");
|
||||
|
@ -2957,7 +2988,7 @@ plug_in_progress_init (PlugIn *plug_in,
|
|||
gtk_label_set (GTK_LABEL (plug_in->progress_label), message);
|
||||
}
|
||||
#else
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = 0x1;
|
||||
progress_update (0.0);
|
||||
|
@ -2970,14 +3001,24 @@ static void
|
|||
plug_in_progress_update (PlugIn *plug_in,
|
||||
double percentage)
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL);
|
||||
GDisplay *gdisp;
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
gtk_progress_bar_update( GTK_PROGRESS_BAR (gdisp->progressbar), percentage);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL, -1);
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
#else
|
||||
progress_update (percentage);
|
||||
progress_update (percentage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static Argument*
|
||||
|
@ -2989,7 +3030,8 @@ progress_init_invoker (Argument *args)
|
|||
{
|
||||
success = TRUE;
|
||||
if (no_interface == FALSE)
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer);
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer,
|
||||
args[1].value.pdb_int);
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&progress_init_proc, success);
|
||||
|
|
|
@ -680,10 +680,12 @@ create_display_shell (int gdisp_id,
|
|||
static GtkAccelGroup *image_accel_group = NULL;
|
||||
GDisplay *gdisp;
|
||||
GtkWidget *table;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *arrow;
|
||||
int n_width, n_height;
|
||||
int s_width, s_height;
|
||||
int scalesrc, scaledest;
|
||||
int contextid;
|
||||
|
||||
/* Get the gdisplay */
|
||||
if (! (gdisp = gdisplay_get_ID (gdisp_id)))
|
||||
|
@ -737,14 +739,18 @@ create_display_shell (int gdisp_id,
|
|||
gdisp);
|
||||
|
||||
/* the table containing all widgets */
|
||||
table = gtk_table_new (3, 3, FALSE);
|
||||
table = gtk_table_new (4, 3, FALSE);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 1);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (table), 1, 2);
|
||||
gtk_table_set_row_spacing (GTK_TABLE (table), 0, 1);
|
||||
gtk_table_set_row_spacing (GTK_TABLE (table), 1, 2);
|
||||
gtk_table_set_row_spacing (GTK_TABLE (table), 2, 2);
|
||||
gtk_container_border_width (GTK_CONTAINER (table), 2);
|
||||
gtk_container_add (GTK_CONTAINER (gdisp->shell), table);
|
||||
|
||||
/* hbox for statusbar area */
|
||||
hbox = gtk_hbox_new(0,2);
|
||||
|
||||
/* scrollbars, rulers, canvas, menu popup button */
|
||||
gdisp->origin = gtk_button_new ();
|
||||
gtk_widget_set_events (GTK_WIDGET (gdisp->origin),
|
||||
|
@ -809,10 +815,25 @@ create_display_shell (int gdisp_id,
|
|||
GTK_EXPAND | GTK_SHRINK | GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_table_attach (GTK_TABLE (table), gdisp->vsb, 2, 3, 0, 2,
|
||||
GTK_FILL, GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_table_attach (GTK_TABLE (table), hbox, 0, 3, 3, 4,
|
||||
GTK_FILL, 0, 0, 0);
|
||||
|
||||
if (! image_popup_menu)
|
||||
menus_get_image_menu (&image_popup_menu, &image_accel_group);
|
||||
|
||||
/* statusbar, progressbar */
|
||||
gdisp->statusbar = gtk_statusbar_new();
|
||||
gtk_box_pack_start (GTK_BOX (hbox), gdisp->statusbar, TRUE, TRUE, 0);
|
||||
contextid = gtk_statusbar_get_context_id (GTK_STATUSBAR (gdisp->statusbar),
|
||||
"title");
|
||||
gtk_statusbar_push(GTK_STATUSBAR (gdisp->statusbar),
|
||||
contextid,
|
||||
title);
|
||||
|
||||
gdisp->progressbar = gtk_progress_bar_new();
|
||||
gtk_widget_set_usize(gdisp->progressbar, 100, -1);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), gdisp->progressbar, FALSE, TRUE, 0);
|
||||
|
||||
/* the popup menu */
|
||||
gdisp->popup = image_popup_menu;
|
||||
|
||||
|
@ -826,6 +847,9 @@ create_display_shell (int gdisp_id,
|
|||
gtk_widget_show (gdisp->hrule);
|
||||
gtk_widget_show (gdisp->vrule);
|
||||
gtk_widget_show (gdisp->canvas);
|
||||
gtk_widget_show (gdisp->statusbar);
|
||||
gtk_widget_show (gdisp->progressbar);
|
||||
gtk_widget_show (hbox);
|
||||
gtk_widget_show (table);
|
||||
gtk_widget_show (gdisp->shell);
|
||||
|
||||
|
|
|
@ -143,7 +143,10 @@ static ProcArg progress_init_args[] =
|
|||
{
|
||||
{ PDB_STRING,
|
||||
"message",
|
||||
"Message to use in the progress dialog." }
|
||||
"Message to use in the progress dialog." },
|
||||
{ PDB_INT8,
|
||||
"gdisplay",
|
||||
"GDisplay to update progressbar in, or -1 for a seperate window" }
|
||||
};
|
||||
|
||||
static ProcRecord progress_init_proc =
|
||||
|
@ -155,7 +158,7 @@ static ProcRecord progress_init_proc =
|
|||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
PDB_INTERNAL,
|
||||
1,
|
||||
2,
|
||||
progress_init_args,
|
||||
0,
|
||||
NULL,
|
||||
|
@ -724,6 +727,9 @@ plug_in_new (char *name)
|
|||
void
|
||||
plug_in_destroy (PlugIn *plug_in)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
guint c_id;
|
||||
|
||||
if (plug_in)
|
||||
{
|
||||
plug_in_close (plug_in, TRUE);
|
||||
|
@ -741,6 +747,16 @@ plug_in_destroy (PlugIn *plug_in)
|
|||
if (plug_in->args[5])
|
||||
g_free (plug_in->args[5]);
|
||||
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
c_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(gdisp->statusbar), c_id);
|
||||
gtk_progress_bar_update(GTK_PROGRESS_BAR(gdisp->progressbar), 0.0);
|
||||
gdisp->progressid = 0;
|
||||
}
|
||||
|
||||
if (plug_in == current_plug_in)
|
||||
plug_in_pop ();
|
||||
|
||||
|
@ -2906,16 +2922,31 @@ plug_in_progress_cancel (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
plug_in_progress_init (PlugIn *plug_in,
|
||||
char *message)
|
||||
char *message,
|
||||
gint gdisp_ID)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *button;
|
||||
GDisplay *gdisp;
|
||||
guint context_id;
|
||||
|
||||
if (!message)
|
||||
message = plug_in->args[0];
|
||||
|
||||
if (gdisp_ID > 0)
|
||||
gdisp = gdisplay_get_ID(gdisp_ID);
|
||||
|
||||
if (gdisp_ID > 0 && gdisp->progressid == 0)
|
||||
{
|
||||
context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
|
||||
gdisp->progressid = gtk_statusbar_push(GTK_STATUSBAR(gdisp->statusbar),
|
||||
context_id, message);
|
||||
plug_in->progress_gdisp_ID = gdisp_ID;
|
||||
}
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = gtk_dialog_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (plug_in->progress), "plug_in_progress", "Gimp");
|
||||
|
@ -2957,7 +2988,7 @@ plug_in_progress_init (PlugIn *plug_in,
|
|||
gtk_label_set (GTK_LABEL (plug_in->progress_label), message);
|
||||
}
|
||||
#else
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = 0x1;
|
||||
progress_update (0.0);
|
||||
|
@ -2970,14 +3001,24 @@ static void
|
|||
plug_in_progress_update (PlugIn *plug_in,
|
||||
double percentage)
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL);
|
||||
GDisplay *gdisp;
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
gtk_progress_bar_update( GTK_PROGRESS_BAR (gdisp->progressbar), percentage);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL, -1);
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
#else
|
||||
progress_update (percentage);
|
||||
progress_update (percentage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static Argument*
|
||||
|
@ -2989,7 +3030,8 @@ progress_init_invoker (Argument *args)
|
|||
{
|
||||
success = TRUE;
|
||||
if (no_interface == FALSE)
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer);
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer,
|
||||
args[1].value.pdb_int);
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&progress_init_proc, success);
|
||||
|
|
|
@ -143,7 +143,10 @@ static ProcArg progress_init_args[] =
|
|||
{
|
||||
{ PDB_STRING,
|
||||
"message",
|
||||
"Message to use in the progress dialog." }
|
||||
"Message to use in the progress dialog." },
|
||||
{ PDB_INT8,
|
||||
"gdisplay",
|
||||
"GDisplay to update progressbar in, or -1 for a seperate window" }
|
||||
};
|
||||
|
||||
static ProcRecord progress_init_proc =
|
||||
|
@ -155,7 +158,7 @@ static ProcRecord progress_init_proc =
|
|||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
PDB_INTERNAL,
|
||||
1,
|
||||
2,
|
||||
progress_init_args,
|
||||
0,
|
||||
NULL,
|
||||
|
@ -724,6 +727,9 @@ plug_in_new (char *name)
|
|||
void
|
||||
plug_in_destroy (PlugIn *plug_in)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
guint c_id;
|
||||
|
||||
if (plug_in)
|
||||
{
|
||||
plug_in_close (plug_in, TRUE);
|
||||
|
@ -741,6 +747,16 @@ plug_in_destroy (PlugIn *plug_in)
|
|||
if (plug_in->args[5])
|
||||
g_free (plug_in->args[5]);
|
||||
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
c_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(gdisp->statusbar), c_id);
|
||||
gtk_progress_bar_update(GTK_PROGRESS_BAR(gdisp->progressbar), 0.0);
|
||||
gdisp->progressid = 0;
|
||||
}
|
||||
|
||||
if (plug_in == current_plug_in)
|
||||
plug_in_pop ();
|
||||
|
||||
|
@ -2906,16 +2922,31 @@ plug_in_progress_cancel (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
plug_in_progress_init (PlugIn *plug_in,
|
||||
char *message)
|
||||
char *message,
|
||||
gint gdisp_ID)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *button;
|
||||
GDisplay *gdisp;
|
||||
guint context_id;
|
||||
|
||||
if (!message)
|
||||
message = plug_in->args[0];
|
||||
|
||||
if (gdisp_ID > 0)
|
||||
gdisp = gdisplay_get_ID(gdisp_ID);
|
||||
|
||||
if (gdisp_ID > 0 && gdisp->progressid == 0)
|
||||
{
|
||||
context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
|
||||
gdisp->progressid = gtk_statusbar_push(GTK_STATUSBAR(gdisp->statusbar),
|
||||
context_id, message);
|
||||
plug_in->progress_gdisp_ID = gdisp_ID;
|
||||
}
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = gtk_dialog_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (plug_in->progress), "plug_in_progress", "Gimp");
|
||||
|
@ -2957,7 +2988,7 @@ plug_in_progress_init (PlugIn *plug_in,
|
|||
gtk_label_set (GTK_LABEL (plug_in->progress_label), message);
|
||||
}
|
||||
#else
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = 0x1;
|
||||
progress_update (0.0);
|
||||
|
@ -2970,14 +3001,24 @@ static void
|
|||
plug_in_progress_update (PlugIn *plug_in,
|
||||
double percentage)
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL);
|
||||
GDisplay *gdisp;
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
gtk_progress_bar_update( GTK_PROGRESS_BAR (gdisp->progressbar), percentage);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL, -1);
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
#else
|
||||
progress_update (percentage);
|
||||
progress_update (percentage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static Argument*
|
||||
|
@ -2989,7 +3030,8 @@ progress_init_invoker (Argument *args)
|
|||
{
|
||||
success = TRUE;
|
||||
if (no_interface == FALSE)
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer);
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer,
|
||||
args[1].value.pdb_int);
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&progress_init_proc, success);
|
||||
|
|
|
@ -143,7 +143,10 @@ static ProcArg progress_init_args[] =
|
|||
{
|
||||
{ PDB_STRING,
|
||||
"message",
|
||||
"Message to use in the progress dialog." }
|
||||
"Message to use in the progress dialog." },
|
||||
{ PDB_INT8,
|
||||
"gdisplay",
|
||||
"GDisplay to update progressbar in, or -1 for a seperate window" }
|
||||
};
|
||||
|
||||
static ProcRecord progress_init_proc =
|
||||
|
@ -155,7 +158,7 @@ static ProcRecord progress_init_proc =
|
|||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
PDB_INTERNAL,
|
||||
1,
|
||||
2,
|
||||
progress_init_args,
|
||||
0,
|
||||
NULL,
|
||||
|
@ -724,6 +727,9 @@ plug_in_new (char *name)
|
|||
void
|
||||
plug_in_destroy (PlugIn *plug_in)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
guint c_id;
|
||||
|
||||
if (plug_in)
|
||||
{
|
||||
plug_in_close (plug_in, TRUE);
|
||||
|
@ -741,6 +747,16 @@ plug_in_destroy (PlugIn *plug_in)
|
|||
if (plug_in->args[5])
|
||||
g_free (plug_in->args[5]);
|
||||
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
c_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(gdisp->statusbar), c_id);
|
||||
gtk_progress_bar_update(GTK_PROGRESS_BAR(gdisp->progressbar), 0.0);
|
||||
gdisp->progressid = 0;
|
||||
}
|
||||
|
||||
if (plug_in == current_plug_in)
|
||||
plug_in_pop ();
|
||||
|
||||
|
@ -2906,16 +2922,31 @@ plug_in_progress_cancel (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
plug_in_progress_init (PlugIn *plug_in,
|
||||
char *message)
|
||||
char *message,
|
||||
gint gdisp_ID)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *button;
|
||||
GDisplay *gdisp;
|
||||
guint context_id;
|
||||
|
||||
if (!message)
|
||||
message = plug_in->args[0];
|
||||
|
||||
if (gdisp_ID > 0)
|
||||
gdisp = gdisplay_get_ID(gdisp_ID);
|
||||
|
||||
if (gdisp_ID > 0 && gdisp->progressid == 0)
|
||||
{
|
||||
context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
|
||||
gdisp->progressid = gtk_statusbar_push(GTK_STATUSBAR(gdisp->statusbar),
|
||||
context_id, message);
|
||||
plug_in->progress_gdisp_ID = gdisp_ID;
|
||||
}
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = gtk_dialog_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (plug_in->progress), "plug_in_progress", "Gimp");
|
||||
|
@ -2957,7 +2988,7 @@ plug_in_progress_init (PlugIn *plug_in,
|
|||
gtk_label_set (GTK_LABEL (plug_in->progress_label), message);
|
||||
}
|
||||
#else
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = 0x1;
|
||||
progress_update (0.0);
|
||||
|
@ -2970,14 +3001,24 @@ static void
|
|||
plug_in_progress_update (PlugIn *plug_in,
|
||||
double percentage)
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL);
|
||||
GDisplay *gdisp;
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
gtk_progress_bar_update( GTK_PROGRESS_BAR (gdisp->progressbar), percentage);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL, -1);
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
#else
|
||||
progress_update (percentage);
|
||||
progress_update (percentage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static Argument*
|
||||
|
@ -2989,7 +3030,8 @@ progress_init_invoker (Argument *args)
|
|||
{
|
||||
success = TRUE;
|
||||
if (no_interface == FALSE)
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer);
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer,
|
||||
args[1].value.pdb_int);
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&progress_init_proc, success);
|
||||
|
|
|
@ -62,6 +62,8 @@ struct _PlugIn
|
|||
GtkWidget *progress_label;
|
||||
GtkWidget *progress_bar;
|
||||
|
||||
gint8 progress_gdisp_ID; /* gdisp_ID of progress */
|
||||
|
||||
gpointer user_data; /* Handle for hanging data onto */
|
||||
};
|
||||
|
||||
|
|
|
@ -143,7 +143,10 @@ static ProcArg progress_init_args[] =
|
|||
{
|
||||
{ PDB_STRING,
|
||||
"message",
|
||||
"Message to use in the progress dialog." }
|
||||
"Message to use in the progress dialog." },
|
||||
{ PDB_INT8,
|
||||
"gdisplay",
|
||||
"GDisplay to update progressbar in, or -1 for a seperate window" }
|
||||
};
|
||||
|
||||
static ProcRecord progress_init_proc =
|
||||
|
@ -155,7 +158,7 @@ static ProcRecord progress_init_proc =
|
|||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
PDB_INTERNAL,
|
||||
1,
|
||||
2,
|
||||
progress_init_args,
|
||||
0,
|
||||
NULL,
|
||||
|
@ -724,6 +727,9 @@ plug_in_new (char *name)
|
|||
void
|
||||
plug_in_destroy (PlugIn *plug_in)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
guint c_id;
|
||||
|
||||
if (plug_in)
|
||||
{
|
||||
plug_in_close (plug_in, TRUE);
|
||||
|
@ -741,6 +747,16 @@ plug_in_destroy (PlugIn *plug_in)
|
|||
if (plug_in->args[5])
|
||||
g_free (plug_in->args[5]);
|
||||
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
c_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(gdisp->statusbar), c_id);
|
||||
gtk_progress_bar_update(GTK_PROGRESS_BAR(gdisp->progressbar), 0.0);
|
||||
gdisp->progressid = 0;
|
||||
}
|
||||
|
||||
if (plug_in == current_plug_in)
|
||||
plug_in_pop ();
|
||||
|
||||
|
@ -2906,16 +2922,31 @@ plug_in_progress_cancel (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
plug_in_progress_init (PlugIn *plug_in,
|
||||
char *message)
|
||||
char *message,
|
||||
gint gdisp_ID)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *button;
|
||||
GDisplay *gdisp;
|
||||
guint context_id;
|
||||
|
||||
if (!message)
|
||||
message = plug_in->args[0];
|
||||
|
||||
if (gdisp_ID > 0)
|
||||
gdisp = gdisplay_get_ID(gdisp_ID);
|
||||
|
||||
if (gdisp_ID > 0 && gdisp->progressid == 0)
|
||||
{
|
||||
context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
|
||||
gdisp->progressid = gtk_statusbar_push(GTK_STATUSBAR(gdisp->statusbar),
|
||||
context_id, message);
|
||||
plug_in->progress_gdisp_ID = gdisp_ID;
|
||||
}
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = gtk_dialog_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (plug_in->progress), "plug_in_progress", "Gimp");
|
||||
|
@ -2957,7 +2988,7 @@ plug_in_progress_init (PlugIn *plug_in,
|
|||
gtk_label_set (GTK_LABEL (plug_in->progress_label), message);
|
||||
}
|
||||
#else
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = 0x1;
|
||||
progress_update (0.0);
|
||||
|
@ -2970,14 +3001,24 @@ static void
|
|||
plug_in_progress_update (PlugIn *plug_in,
|
||||
double percentage)
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL);
|
||||
GDisplay *gdisp;
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
gtk_progress_bar_update( GTK_PROGRESS_BAR (gdisp->progressbar), percentage);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL, -1);
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
#else
|
||||
progress_update (percentage);
|
||||
progress_update (percentage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static Argument*
|
||||
|
@ -2989,7 +3030,8 @@ progress_init_invoker (Argument *args)
|
|||
{
|
||||
success = TRUE;
|
||||
if (no_interface == FALSE)
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer);
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer,
|
||||
args[1].value.pdb_int);
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&progress_init_proc, success);
|
||||
|
|
|
@ -62,6 +62,8 @@ struct _PlugIn
|
|||
GtkWidget *progress_label;
|
||||
GtkWidget *progress_bar;
|
||||
|
||||
gint8 progress_gdisp_ID; /* gdisp_ID of progress */
|
||||
|
||||
gpointer user_data; /* Handle for hanging data onto */
|
||||
};
|
||||
|
||||
|
|
|
@ -143,7 +143,10 @@ static ProcArg progress_init_args[] =
|
|||
{
|
||||
{ PDB_STRING,
|
||||
"message",
|
||||
"Message to use in the progress dialog." }
|
||||
"Message to use in the progress dialog." },
|
||||
{ PDB_INT8,
|
||||
"gdisplay",
|
||||
"GDisplay to update progressbar in, or -1 for a seperate window" }
|
||||
};
|
||||
|
||||
static ProcRecord progress_init_proc =
|
||||
|
@ -155,7 +158,7 @@ static ProcRecord progress_init_proc =
|
|||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
PDB_INTERNAL,
|
||||
1,
|
||||
2,
|
||||
progress_init_args,
|
||||
0,
|
||||
NULL,
|
||||
|
@ -724,6 +727,9 @@ plug_in_new (char *name)
|
|||
void
|
||||
plug_in_destroy (PlugIn *plug_in)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
guint c_id;
|
||||
|
||||
if (plug_in)
|
||||
{
|
||||
plug_in_close (plug_in, TRUE);
|
||||
|
@ -741,6 +747,16 @@ plug_in_destroy (PlugIn *plug_in)
|
|||
if (plug_in->args[5])
|
||||
g_free (plug_in->args[5]);
|
||||
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
c_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(gdisp->statusbar), c_id);
|
||||
gtk_progress_bar_update(GTK_PROGRESS_BAR(gdisp->progressbar), 0.0);
|
||||
gdisp->progressid = 0;
|
||||
}
|
||||
|
||||
if (plug_in == current_plug_in)
|
||||
plug_in_pop ();
|
||||
|
||||
|
@ -2906,16 +2922,31 @@ plug_in_progress_cancel (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
plug_in_progress_init (PlugIn *plug_in,
|
||||
char *message)
|
||||
char *message,
|
||||
gint gdisp_ID)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *button;
|
||||
GDisplay *gdisp;
|
||||
guint context_id;
|
||||
|
||||
if (!message)
|
||||
message = plug_in->args[0];
|
||||
|
||||
if (gdisp_ID > 0)
|
||||
gdisp = gdisplay_get_ID(gdisp_ID);
|
||||
|
||||
if (gdisp_ID > 0 && gdisp->progressid == 0)
|
||||
{
|
||||
context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
|
||||
gdisp->progressid = gtk_statusbar_push(GTK_STATUSBAR(gdisp->statusbar),
|
||||
context_id, message);
|
||||
plug_in->progress_gdisp_ID = gdisp_ID;
|
||||
}
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = gtk_dialog_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (plug_in->progress), "plug_in_progress", "Gimp");
|
||||
|
@ -2957,7 +2988,7 @@ plug_in_progress_init (PlugIn *plug_in,
|
|||
gtk_label_set (GTK_LABEL (plug_in->progress_label), message);
|
||||
}
|
||||
#else
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = 0x1;
|
||||
progress_update (0.0);
|
||||
|
@ -2970,14 +3001,24 @@ static void
|
|||
plug_in_progress_update (PlugIn *plug_in,
|
||||
double percentage)
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL);
|
||||
GDisplay *gdisp;
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
gtk_progress_bar_update( GTK_PROGRESS_BAR (gdisp->progressbar), percentage);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL, -1);
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
#else
|
||||
progress_update (percentage);
|
||||
progress_update (percentage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static Argument*
|
||||
|
@ -2989,7 +3030,8 @@ progress_init_invoker (Argument *args)
|
|||
{
|
||||
success = TRUE;
|
||||
if (no_interface == FALSE)
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer);
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer,
|
||||
args[1].value.pdb_int);
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&progress_init_proc, success);
|
||||
|
|
|
@ -143,7 +143,10 @@ static ProcArg progress_init_args[] =
|
|||
{
|
||||
{ PDB_STRING,
|
||||
"message",
|
||||
"Message to use in the progress dialog." }
|
||||
"Message to use in the progress dialog." },
|
||||
{ PDB_INT8,
|
||||
"gdisplay",
|
||||
"GDisplay to update progressbar in, or -1 for a seperate window" }
|
||||
};
|
||||
|
||||
static ProcRecord progress_init_proc =
|
||||
|
@ -155,7 +158,7 @@ static ProcRecord progress_init_proc =
|
|||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
PDB_INTERNAL,
|
||||
1,
|
||||
2,
|
||||
progress_init_args,
|
||||
0,
|
||||
NULL,
|
||||
|
@ -724,6 +727,9 @@ plug_in_new (char *name)
|
|||
void
|
||||
plug_in_destroy (PlugIn *plug_in)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
guint c_id;
|
||||
|
||||
if (plug_in)
|
||||
{
|
||||
plug_in_close (plug_in, TRUE);
|
||||
|
@ -741,6 +747,16 @@ plug_in_destroy (PlugIn *plug_in)
|
|||
if (plug_in->args[5])
|
||||
g_free (plug_in->args[5]);
|
||||
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
c_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(gdisp->statusbar), c_id);
|
||||
gtk_progress_bar_update(GTK_PROGRESS_BAR(gdisp->progressbar), 0.0);
|
||||
gdisp->progressid = 0;
|
||||
}
|
||||
|
||||
if (plug_in == current_plug_in)
|
||||
plug_in_pop ();
|
||||
|
||||
|
@ -2906,16 +2922,31 @@ plug_in_progress_cancel (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
plug_in_progress_init (PlugIn *plug_in,
|
||||
char *message)
|
||||
char *message,
|
||||
gint gdisp_ID)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *button;
|
||||
GDisplay *gdisp;
|
||||
guint context_id;
|
||||
|
||||
if (!message)
|
||||
message = plug_in->args[0];
|
||||
|
||||
if (gdisp_ID > 0)
|
||||
gdisp = gdisplay_get_ID(gdisp_ID);
|
||||
|
||||
if (gdisp_ID > 0 && gdisp->progressid == 0)
|
||||
{
|
||||
context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
|
||||
gdisp->progressid = gtk_statusbar_push(GTK_STATUSBAR(gdisp->statusbar),
|
||||
context_id, message);
|
||||
plug_in->progress_gdisp_ID = gdisp_ID;
|
||||
}
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = gtk_dialog_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (plug_in->progress), "plug_in_progress", "Gimp");
|
||||
|
@ -2957,7 +2988,7 @@ plug_in_progress_init (PlugIn *plug_in,
|
|||
gtk_label_set (GTK_LABEL (plug_in->progress_label), message);
|
||||
}
|
||||
#else
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = 0x1;
|
||||
progress_update (0.0);
|
||||
|
@ -2970,14 +3001,24 @@ static void
|
|||
plug_in_progress_update (PlugIn *plug_in,
|
||||
double percentage)
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL);
|
||||
GDisplay *gdisp;
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
gtk_progress_bar_update( GTK_PROGRESS_BAR (gdisp->progressbar), percentage);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL, -1);
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
#else
|
||||
progress_update (percentage);
|
||||
progress_update (percentage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static Argument*
|
||||
|
@ -2989,7 +3030,8 @@ progress_init_invoker (Argument *args)
|
|||
{
|
||||
success = TRUE;
|
||||
if (no_interface == FALSE)
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer);
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer,
|
||||
args[1].value.pdb_int);
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&progress_init_proc, success);
|
||||
|
|
|
@ -143,7 +143,10 @@ static ProcArg progress_init_args[] =
|
|||
{
|
||||
{ PDB_STRING,
|
||||
"message",
|
||||
"Message to use in the progress dialog." }
|
||||
"Message to use in the progress dialog." },
|
||||
{ PDB_INT8,
|
||||
"gdisplay",
|
||||
"GDisplay to update progressbar in, or -1 for a seperate window" }
|
||||
};
|
||||
|
||||
static ProcRecord progress_init_proc =
|
||||
|
@ -155,7 +158,7 @@ static ProcRecord progress_init_proc =
|
|||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
PDB_INTERNAL,
|
||||
1,
|
||||
2,
|
||||
progress_init_args,
|
||||
0,
|
||||
NULL,
|
||||
|
@ -724,6 +727,9 @@ plug_in_new (char *name)
|
|||
void
|
||||
plug_in_destroy (PlugIn *plug_in)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
guint c_id;
|
||||
|
||||
if (plug_in)
|
||||
{
|
||||
plug_in_close (plug_in, TRUE);
|
||||
|
@ -741,6 +747,16 @@ plug_in_destroy (PlugIn *plug_in)
|
|||
if (plug_in->args[5])
|
||||
g_free (plug_in->args[5]);
|
||||
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
c_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(gdisp->statusbar), c_id);
|
||||
gtk_progress_bar_update(GTK_PROGRESS_BAR(gdisp->progressbar), 0.0);
|
||||
gdisp->progressid = 0;
|
||||
}
|
||||
|
||||
if (plug_in == current_plug_in)
|
||||
plug_in_pop ();
|
||||
|
||||
|
@ -2906,16 +2922,31 @@ plug_in_progress_cancel (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
plug_in_progress_init (PlugIn *plug_in,
|
||||
char *message)
|
||||
char *message,
|
||||
gint gdisp_ID)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *button;
|
||||
GDisplay *gdisp;
|
||||
guint context_id;
|
||||
|
||||
if (!message)
|
||||
message = plug_in->args[0];
|
||||
|
||||
if (gdisp_ID > 0)
|
||||
gdisp = gdisplay_get_ID(gdisp_ID);
|
||||
|
||||
if (gdisp_ID > 0 && gdisp->progressid == 0)
|
||||
{
|
||||
context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
|
||||
gdisp->progressid = gtk_statusbar_push(GTK_STATUSBAR(gdisp->statusbar),
|
||||
context_id, message);
|
||||
plug_in->progress_gdisp_ID = gdisp_ID;
|
||||
}
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = gtk_dialog_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (plug_in->progress), "plug_in_progress", "Gimp");
|
||||
|
@ -2957,7 +2988,7 @@ plug_in_progress_init (PlugIn *plug_in,
|
|||
gtk_label_set (GTK_LABEL (plug_in->progress_label), message);
|
||||
}
|
||||
#else
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = 0x1;
|
||||
progress_update (0.0);
|
||||
|
@ -2970,14 +3001,24 @@ static void
|
|||
plug_in_progress_update (PlugIn *plug_in,
|
||||
double percentage)
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL);
|
||||
GDisplay *gdisp;
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
gtk_progress_bar_update( GTK_PROGRESS_BAR (gdisp->progressbar), percentage);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL, -1);
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
#else
|
||||
progress_update (percentage);
|
||||
progress_update (percentage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static Argument*
|
||||
|
@ -2989,7 +3030,8 @@ progress_init_invoker (Argument *args)
|
|||
{
|
||||
success = TRUE;
|
||||
if (no_interface == FALSE)
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer);
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer,
|
||||
args[1].value.pdb_int);
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&progress_init_proc, success);
|
||||
|
|
|
@ -62,6 +62,8 @@ struct _PlugIn
|
|||
GtkWidget *progress_label;
|
||||
GtkWidget *progress_bar;
|
||||
|
||||
gint8 progress_gdisp_ID; /* gdisp_ID of progress */
|
||||
|
||||
gpointer user_data; /* Handle for hanging data onto */
|
||||
};
|
||||
|
||||
|
|
|
@ -143,7 +143,10 @@ static ProcArg progress_init_args[] =
|
|||
{
|
||||
{ PDB_STRING,
|
||||
"message",
|
||||
"Message to use in the progress dialog." }
|
||||
"Message to use in the progress dialog." },
|
||||
{ PDB_INT8,
|
||||
"gdisplay",
|
||||
"GDisplay to update progressbar in, or -1 for a seperate window" }
|
||||
};
|
||||
|
||||
static ProcRecord progress_init_proc =
|
||||
|
@ -155,7 +158,7 @@ static ProcRecord progress_init_proc =
|
|||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
PDB_INTERNAL,
|
||||
1,
|
||||
2,
|
||||
progress_init_args,
|
||||
0,
|
||||
NULL,
|
||||
|
@ -724,6 +727,9 @@ plug_in_new (char *name)
|
|||
void
|
||||
plug_in_destroy (PlugIn *plug_in)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
guint c_id;
|
||||
|
||||
if (plug_in)
|
||||
{
|
||||
plug_in_close (plug_in, TRUE);
|
||||
|
@ -741,6 +747,16 @@ plug_in_destroy (PlugIn *plug_in)
|
|||
if (plug_in->args[5])
|
||||
g_free (plug_in->args[5]);
|
||||
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
c_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(gdisp->statusbar), c_id);
|
||||
gtk_progress_bar_update(GTK_PROGRESS_BAR(gdisp->progressbar), 0.0);
|
||||
gdisp->progressid = 0;
|
||||
}
|
||||
|
||||
if (plug_in == current_plug_in)
|
||||
plug_in_pop ();
|
||||
|
||||
|
@ -2906,16 +2922,31 @@ plug_in_progress_cancel (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
plug_in_progress_init (PlugIn *plug_in,
|
||||
char *message)
|
||||
char *message,
|
||||
gint gdisp_ID)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *button;
|
||||
GDisplay *gdisp;
|
||||
guint context_id;
|
||||
|
||||
if (!message)
|
||||
message = plug_in->args[0];
|
||||
|
||||
if (gdisp_ID > 0)
|
||||
gdisp = gdisplay_get_ID(gdisp_ID);
|
||||
|
||||
if (gdisp_ID > 0 && gdisp->progressid == 0)
|
||||
{
|
||||
context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
|
||||
gdisp->progressid = gtk_statusbar_push(GTK_STATUSBAR(gdisp->statusbar),
|
||||
context_id, message);
|
||||
plug_in->progress_gdisp_ID = gdisp_ID;
|
||||
}
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = gtk_dialog_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (plug_in->progress), "plug_in_progress", "Gimp");
|
||||
|
@ -2957,7 +2988,7 @@ plug_in_progress_init (PlugIn *plug_in,
|
|||
gtk_label_set (GTK_LABEL (plug_in->progress_label), message);
|
||||
}
|
||||
#else
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = 0x1;
|
||||
progress_update (0.0);
|
||||
|
@ -2970,14 +3001,24 @@ static void
|
|||
plug_in_progress_update (PlugIn *plug_in,
|
||||
double percentage)
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL);
|
||||
GDisplay *gdisp;
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
gtk_progress_bar_update( GTK_PROGRESS_BAR (gdisp->progressbar), percentage);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL, -1);
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
#else
|
||||
progress_update (percentage);
|
||||
progress_update (percentage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static Argument*
|
||||
|
@ -2989,7 +3030,8 @@ progress_init_invoker (Argument *args)
|
|||
{
|
||||
success = TRUE;
|
||||
if (no_interface == FALSE)
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer);
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer,
|
||||
args[1].value.pdb_int);
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&progress_init_proc, success);
|
||||
|
|
|
@ -143,7 +143,10 @@ static ProcArg progress_init_args[] =
|
|||
{
|
||||
{ PDB_STRING,
|
||||
"message",
|
||||
"Message to use in the progress dialog." }
|
||||
"Message to use in the progress dialog." },
|
||||
{ PDB_INT8,
|
||||
"gdisplay",
|
||||
"GDisplay to update progressbar in, or -1 for a seperate window" }
|
||||
};
|
||||
|
||||
static ProcRecord progress_init_proc =
|
||||
|
@ -155,7 +158,7 @@ static ProcRecord progress_init_proc =
|
|||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
PDB_INTERNAL,
|
||||
1,
|
||||
2,
|
||||
progress_init_args,
|
||||
0,
|
||||
NULL,
|
||||
|
@ -724,6 +727,9 @@ plug_in_new (char *name)
|
|||
void
|
||||
plug_in_destroy (PlugIn *plug_in)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
guint c_id;
|
||||
|
||||
if (plug_in)
|
||||
{
|
||||
plug_in_close (plug_in, TRUE);
|
||||
|
@ -741,6 +747,16 @@ plug_in_destroy (PlugIn *plug_in)
|
|||
if (plug_in->args[5])
|
||||
g_free (plug_in->args[5]);
|
||||
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
c_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(gdisp->statusbar), c_id);
|
||||
gtk_progress_bar_update(GTK_PROGRESS_BAR(gdisp->progressbar), 0.0);
|
||||
gdisp->progressid = 0;
|
||||
}
|
||||
|
||||
if (plug_in == current_plug_in)
|
||||
plug_in_pop ();
|
||||
|
||||
|
@ -2906,16 +2922,31 @@ plug_in_progress_cancel (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
plug_in_progress_init (PlugIn *plug_in,
|
||||
char *message)
|
||||
char *message,
|
||||
gint gdisp_ID)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *button;
|
||||
GDisplay *gdisp;
|
||||
guint context_id;
|
||||
|
||||
if (!message)
|
||||
message = plug_in->args[0];
|
||||
|
||||
if (gdisp_ID > 0)
|
||||
gdisp = gdisplay_get_ID(gdisp_ID);
|
||||
|
||||
if (gdisp_ID > 0 && gdisp->progressid == 0)
|
||||
{
|
||||
context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
|
||||
gdisp->progressid = gtk_statusbar_push(GTK_STATUSBAR(gdisp->statusbar),
|
||||
context_id, message);
|
||||
plug_in->progress_gdisp_ID = gdisp_ID;
|
||||
}
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = gtk_dialog_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (plug_in->progress), "plug_in_progress", "Gimp");
|
||||
|
@ -2957,7 +2988,7 @@ plug_in_progress_init (PlugIn *plug_in,
|
|||
gtk_label_set (GTK_LABEL (plug_in->progress_label), message);
|
||||
}
|
||||
#else
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = 0x1;
|
||||
progress_update (0.0);
|
||||
|
@ -2970,14 +3001,24 @@ static void
|
|||
plug_in_progress_update (PlugIn *plug_in,
|
||||
double percentage)
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL);
|
||||
GDisplay *gdisp;
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
gtk_progress_bar_update( GTK_PROGRESS_BAR (gdisp->progressbar), percentage);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL, -1);
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
#else
|
||||
progress_update (percentage);
|
||||
progress_update (percentage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static Argument*
|
||||
|
@ -2989,7 +3030,8 @@ progress_init_invoker (Argument *args)
|
|||
{
|
||||
success = TRUE;
|
||||
if (no_interface == FALSE)
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer);
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer,
|
||||
args[1].value.pdb_int);
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&progress_init_proc, success);
|
||||
|
|
|
@ -62,6 +62,8 @@ struct _PlugIn
|
|||
GtkWidget *progress_label;
|
||||
GtkWidget *progress_bar;
|
||||
|
||||
gint8 progress_gdisp_ID; /* gdisp_ID of progress */
|
||||
|
||||
gpointer user_data; /* Handle for hanging data onto */
|
||||
};
|
||||
|
||||
|
|
|
@ -143,7 +143,10 @@ static ProcArg progress_init_args[] =
|
|||
{
|
||||
{ PDB_STRING,
|
||||
"message",
|
||||
"Message to use in the progress dialog." }
|
||||
"Message to use in the progress dialog." },
|
||||
{ PDB_INT8,
|
||||
"gdisplay",
|
||||
"GDisplay to update progressbar in, or -1 for a seperate window" }
|
||||
};
|
||||
|
||||
static ProcRecord progress_init_proc =
|
||||
|
@ -155,7 +158,7 @@ static ProcRecord progress_init_proc =
|
|||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
PDB_INTERNAL,
|
||||
1,
|
||||
2,
|
||||
progress_init_args,
|
||||
0,
|
||||
NULL,
|
||||
|
@ -724,6 +727,9 @@ plug_in_new (char *name)
|
|||
void
|
||||
plug_in_destroy (PlugIn *plug_in)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
guint c_id;
|
||||
|
||||
if (plug_in)
|
||||
{
|
||||
plug_in_close (plug_in, TRUE);
|
||||
|
@ -741,6 +747,16 @@ plug_in_destroy (PlugIn *plug_in)
|
|||
if (plug_in->args[5])
|
||||
g_free (plug_in->args[5]);
|
||||
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
c_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(gdisp->statusbar), c_id);
|
||||
gtk_progress_bar_update(GTK_PROGRESS_BAR(gdisp->progressbar), 0.0);
|
||||
gdisp->progressid = 0;
|
||||
}
|
||||
|
||||
if (plug_in == current_plug_in)
|
||||
plug_in_pop ();
|
||||
|
||||
|
@ -2906,16 +2922,31 @@ plug_in_progress_cancel (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
plug_in_progress_init (PlugIn *plug_in,
|
||||
char *message)
|
||||
char *message,
|
||||
gint gdisp_ID)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *button;
|
||||
GDisplay *gdisp;
|
||||
guint context_id;
|
||||
|
||||
if (!message)
|
||||
message = plug_in->args[0];
|
||||
|
||||
if (gdisp_ID > 0)
|
||||
gdisp = gdisplay_get_ID(gdisp_ID);
|
||||
|
||||
if (gdisp_ID > 0 && gdisp->progressid == 0)
|
||||
{
|
||||
context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
|
||||
gdisp->progressid = gtk_statusbar_push(GTK_STATUSBAR(gdisp->statusbar),
|
||||
context_id, message);
|
||||
plug_in->progress_gdisp_ID = gdisp_ID;
|
||||
}
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = gtk_dialog_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (plug_in->progress), "plug_in_progress", "Gimp");
|
||||
|
@ -2957,7 +2988,7 @@ plug_in_progress_init (PlugIn *plug_in,
|
|||
gtk_label_set (GTK_LABEL (plug_in->progress_label), message);
|
||||
}
|
||||
#else
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = 0x1;
|
||||
progress_update (0.0);
|
||||
|
@ -2970,14 +3001,24 @@ static void
|
|||
plug_in_progress_update (PlugIn *plug_in,
|
||||
double percentage)
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL);
|
||||
GDisplay *gdisp;
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
gtk_progress_bar_update( GTK_PROGRESS_BAR (gdisp->progressbar), percentage);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL, -1);
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
#else
|
||||
progress_update (percentage);
|
||||
progress_update (percentage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static Argument*
|
||||
|
@ -2989,7 +3030,8 @@ progress_init_invoker (Argument *args)
|
|||
{
|
||||
success = TRUE;
|
||||
if (no_interface == FALSE)
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer);
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer,
|
||||
args[1].value.pdb_int);
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&progress_init_proc, success);
|
||||
|
|
|
@ -143,7 +143,10 @@ static ProcArg progress_init_args[] =
|
|||
{
|
||||
{ PDB_STRING,
|
||||
"message",
|
||||
"Message to use in the progress dialog." }
|
||||
"Message to use in the progress dialog." },
|
||||
{ PDB_INT8,
|
||||
"gdisplay",
|
||||
"GDisplay to update progressbar in, or -1 for a seperate window" }
|
||||
};
|
||||
|
||||
static ProcRecord progress_init_proc =
|
||||
|
@ -155,7 +158,7 @@ static ProcRecord progress_init_proc =
|
|||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
PDB_INTERNAL,
|
||||
1,
|
||||
2,
|
||||
progress_init_args,
|
||||
0,
|
||||
NULL,
|
||||
|
@ -724,6 +727,9 @@ plug_in_new (char *name)
|
|||
void
|
||||
plug_in_destroy (PlugIn *plug_in)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
guint c_id;
|
||||
|
||||
if (plug_in)
|
||||
{
|
||||
plug_in_close (plug_in, TRUE);
|
||||
|
@ -741,6 +747,16 @@ plug_in_destroy (PlugIn *plug_in)
|
|||
if (plug_in->args[5])
|
||||
g_free (plug_in->args[5]);
|
||||
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
c_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(gdisp->statusbar), c_id);
|
||||
gtk_progress_bar_update(GTK_PROGRESS_BAR(gdisp->progressbar), 0.0);
|
||||
gdisp->progressid = 0;
|
||||
}
|
||||
|
||||
if (plug_in == current_plug_in)
|
||||
plug_in_pop ();
|
||||
|
||||
|
@ -2906,16 +2922,31 @@ plug_in_progress_cancel (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
plug_in_progress_init (PlugIn *plug_in,
|
||||
char *message)
|
||||
char *message,
|
||||
gint gdisp_ID)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *button;
|
||||
GDisplay *gdisp;
|
||||
guint context_id;
|
||||
|
||||
if (!message)
|
||||
message = plug_in->args[0];
|
||||
|
||||
if (gdisp_ID > 0)
|
||||
gdisp = gdisplay_get_ID(gdisp_ID);
|
||||
|
||||
if (gdisp_ID > 0 && gdisp->progressid == 0)
|
||||
{
|
||||
context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
|
||||
gdisp->progressid = gtk_statusbar_push(GTK_STATUSBAR(gdisp->statusbar),
|
||||
context_id, message);
|
||||
plug_in->progress_gdisp_ID = gdisp_ID;
|
||||
}
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = gtk_dialog_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (plug_in->progress), "plug_in_progress", "Gimp");
|
||||
|
@ -2957,7 +2988,7 @@ plug_in_progress_init (PlugIn *plug_in,
|
|||
gtk_label_set (GTK_LABEL (plug_in->progress_label), message);
|
||||
}
|
||||
#else
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = 0x1;
|
||||
progress_update (0.0);
|
||||
|
@ -2970,14 +3001,24 @@ static void
|
|||
plug_in_progress_update (PlugIn *plug_in,
|
||||
double percentage)
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL);
|
||||
GDisplay *gdisp;
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
gtk_progress_bar_update( GTK_PROGRESS_BAR (gdisp->progressbar), percentage);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL, -1);
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
#else
|
||||
progress_update (percentage);
|
||||
progress_update (percentage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static Argument*
|
||||
|
@ -2989,7 +3030,8 @@ progress_init_invoker (Argument *args)
|
|||
{
|
||||
success = TRUE;
|
||||
if (no_interface == FALSE)
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer);
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer,
|
||||
args[1].value.pdb_int);
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&progress_init_proc, success);
|
||||
|
|
|
@ -62,6 +62,8 @@ struct _PlugIn
|
|||
GtkWidget *progress_label;
|
||||
GtkWidget *progress_bar;
|
||||
|
||||
gint8 progress_gdisp_ID; /* gdisp_ID of progress */
|
||||
|
||||
gpointer user_data; /* Handle for hanging data onto */
|
||||
};
|
||||
|
||||
|
|
|
@ -143,7 +143,10 @@ static ProcArg progress_init_args[] =
|
|||
{
|
||||
{ PDB_STRING,
|
||||
"message",
|
||||
"Message to use in the progress dialog." }
|
||||
"Message to use in the progress dialog." },
|
||||
{ PDB_INT8,
|
||||
"gdisplay",
|
||||
"GDisplay to update progressbar in, or -1 for a seperate window" }
|
||||
};
|
||||
|
||||
static ProcRecord progress_init_proc =
|
||||
|
@ -155,7 +158,7 @@ static ProcRecord progress_init_proc =
|
|||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
PDB_INTERNAL,
|
||||
1,
|
||||
2,
|
||||
progress_init_args,
|
||||
0,
|
||||
NULL,
|
||||
|
@ -724,6 +727,9 @@ plug_in_new (char *name)
|
|||
void
|
||||
plug_in_destroy (PlugIn *plug_in)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
guint c_id;
|
||||
|
||||
if (plug_in)
|
||||
{
|
||||
plug_in_close (plug_in, TRUE);
|
||||
|
@ -741,6 +747,16 @@ plug_in_destroy (PlugIn *plug_in)
|
|||
if (plug_in->args[5])
|
||||
g_free (plug_in->args[5]);
|
||||
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
c_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(gdisp->statusbar), c_id);
|
||||
gtk_progress_bar_update(GTK_PROGRESS_BAR(gdisp->progressbar), 0.0);
|
||||
gdisp->progressid = 0;
|
||||
}
|
||||
|
||||
if (plug_in == current_plug_in)
|
||||
plug_in_pop ();
|
||||
|
||||
|
@ -2906,16 +2922,31 @@ plug_in_progress_cancel (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
plug_in_progress_init (PlugIn *plug_in,
|
||||
char *message)
|
||||
char *message,
|
||||
gint gdisp_ID)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *button;
|
||||
GDisplay *gdisp;
|
||||
guint context_id;
|
||||
|
||||
if (!message)
|
||||
message = plug_in->args[0];
|
||||
|
||||
if (gdisp_ID > 0)
|
||||
gdisp = gdisplay_get_ID(gdisp_ID);
|
||||
|
||||
if (gdisp_ID > 0 && gdisp->progressid == 0)
|
||||
{
|
||||
context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
|
||||
gdisp->progressid = gtk_statusbar_push(GTK_STATUSBAR(gdisp->statusbar),
|
||||
context_id, message);
|
||||
plug_in->progress_gdisp_ID = gdisp_ID;
|
||||
}
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = gtk_dialog_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (plug_in->progress), "plug_in_progress", "Gimp");
|
||||
|
@ -2957,7 +2988,7 @@ plug_in_progress_init (PlugIn *plug_in,
|
|||
gtk_label_set (GTK_LABEL (plug_in->progress_label), message);
|
||||
}
|
||||
#else
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = 0x1;
|
||||
progress_update (0.0);
|
||||
|
@ -2970,14 +3001,24 @@ static void
|
|||
plug_in_progress_update (PlugIn *plug_in,
|
||||
double percentage)
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL);
|
||||
GDisplay *gdisp;
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
gtk_progress_bar_update( GTK_PROGRESS_BAR (gdisp->progressbar), percentage);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL, -1);
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
#else
|
||||
progress_update (percentage);
|
||||
progress_update (percentage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static Argument*
|
||||
|
@ -2989,7 +3030,8 @@ progress_init_invoker (Argument *args)
|
|||
{
|
||||
success = TRUE;
|
||||
if (no_interface == FALSE)
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer);
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer,
|
||||
args[1].value.pdb_int);
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&progress_init_proc, success);
|
||||
|
|
|
@ -62,6 +62,8 @@ struct _PlugIn
|
|||
GtkWidget *progress_label;
|
||||
GtkWidget *progress_bar;
|
||||
|
||||
gint8 progress_gdisp_ID; /* gdisp_ID of progress */
|
||||
|
||||
gpointer user_data; /* Handle for hanging data onto */
|
||||
};
|
||||
|
||||
|
|
|
@ -143,7 +143,10 @@ static ProcArg progress_init_args[] =
|
|||
{
|
||||
{ PDB_STRING,
|
||||
"message",
|
||||
"Message to use in the progress dialog." }
|
||||
"Message to use in the progress dialog." },
|
||||
{ PDB_INT8,
|
||||
"gdisplay",
|
||||
"GDisplay to update progressbar in, or -1 for a seperate window" }
|
||||
};
|
||||
|
||||
static ProcRecord progress_init_proc =
|
||||
|
@ -155,7 +158,7 @@ static ProcRecord progress_init_proc =
|
|||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
PDB_INTERNAL,
|
||||
1,
|
||||
2,
|
||||
progress_init_args,
|
||||
0,
|
||||
NULL,
|
||||
|
@ -724,6 +727,9 @@ plug_in_new (char *name)
|
|||
void
|
||||
plug_in_destroy (PlugIn *plug_in)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
guint c_id;
|
||||
|
||||
if (plug_in)
|
||||
{
|
||||
plug_in_close (plug_in, TRUE);
|
||||
|
@ -741,6 +747,16 @@ plug_in_destroy (PlugIn *plug_in)
|
|||
if (plug_in->args[5])
|
||||
g_free (plug_in->args[5]);
|
||||
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
c_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(gdisp->statusbar), c_id);
|
||||
gtk_progress_bar_update(GTK_PROGRESS_BAR(gdisp->progressbar), 0.0);
|
||||
gdisp->progressid = 0;
|
||||
}
|
||||
|
||||
if (plug_in == current_plug_in)
|
||||
plug_in_pop ();
|
||||
|
||||
|
@ -2906,16 +2922,31 @@ plug_in_progress_cancel (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
plug_in_progress_init (PlugIn *plug_in,
|
||||
char *message)
|
||||
char *message,
|
||||
gint gdisp_ID)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *button;
|
||||
GDisplay *gdisp;
|
||||
guint context_id;
|
||||
|
||||
if (!message)
|
||||
message = plug_in->args[0];
|
||||
|
||||
if (gdisp_ID > 0)
|
||||
gdisp = gdisplay_get_ID(gdisp_ID);
|
||||
|
||||
if (gdisp_ID > 0 && gdisp->progressid == 0)
|
||||
{
|
||||
context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
|
||||
gdisp->progressid = gtk_statusbar_push(GTK_STATUSBAR(gdisp->statusbar),
|
||||
context_id, message);
|
||||
plug_in->progress_gdisp_ID = gdisp_ID;
|
||||
}
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = gtk_dialog_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (plug_in->progress), "plug_in_progress", "Gimp");
|
||||
|
@ -2957,7 +2988,7 @@ plug_in_progress_init (PlugIn *plug_in,
|
|||
gtk_label_set (GTK_LABEL (plug_in->progress_label), message);
|
||||
}
|
||||
#else
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = 0x1;
|
||||
progress_update (0.0);
|
||||
|
@ -2970,14 +3001,24 @@ static void
|
|||
plug_in_progress_update (PlugIn *plug_in,
|
||||
double percentage)
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL);
|
||||
GDisplay *gdisp;
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
gtk_progress_bar_update( GTK_PROGRESS_BAR (gdisp->progressbar), percentage);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL, -1);
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
#else
|
||||
progress_update (percentage);
|
||||
progress_update (percentage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static Argument*
|
||||
|
@ -2989,7 +3030,8 @@ progress_init_invoker (Argument *args)
|
|||
{
|
||||
success = TRUE;
|
||||
if (no_interface == FALSE)
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer);
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer,
|
||||
args[1].value.pdb_int);
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&progress_init_proc, success);
|
||||
|
|
|
@ -143,7 +143,10 @@ static ProcArg progress_init_args[] =
|
|||
{
|
||||
{ PDB_STRING,
|
||||
"message",
|
||||
"Message to use in the progress dialog." }
|
||||
"Message to use in the progress dialog." },
|
||||
{ PDB_INT8,
|
||||
"gdisplay",
|
||||
"GDisplay to update progressbar in, or -1 for a seperate window" }
|
||||
};
|
||||
|
||||
static ProcRecord progress_init_proc =
|
||||
|
@ -155,7 +158,7 @@ static ProcRecord progress_init_proc =
|
|||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
PDB_INTERNAL,
|
||||
1,
|
||||
2,
|
||||
progress_init_args,
|
||||
0,
|
||||
NULL,
|
||||
|
@ -724,6 +727,9 @@ plug_in_new (char *name)
|
|||
void
|
||||
plug_in_destroy (PlugIn *plug_in)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
guint c_id;
|
||||
|
||||
if (plug_in)
|
||||
{
|
||||
plug_in_close (plug_in, TRUE);
|
||||
|
@ -741,6 +747,16 @@ plug_in_destroy (PlugIn *plug_in)
|
|||
if (plug_in->args[5])
|
||||
g_free (plug_in->args[5]);
|
||||
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
c_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(gdisp->statusbar), c_id);
|
||||
gtk_progress_bar_update(GTK_PROGRESS_BAR(gdisp->progressbar), 0.0);
|
||||
gdisp->progressid = 0;
|
||||
}
|
||||
|
||||
if (plug_in == current_plug_in)
|
||||
plug_in_pop ();
|
||||
|
||||
|
@ -2906,16 +2922,31 @@ plug_in_progress_cancel (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
plug_in_progress_init (PlugIn *plug_in,
|
||||
char *message)
|
||||
char *message,
|
||||
gint gdisp_ID)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *button;
|
||||
GDisplay *gdisp;
|
||||
guint context_id;
|
||||
|
||||
if (!message)
|
||||
message = plug_in->args[0];
|
||||
|
||||
if (gdisp_ID > 0)
|
||||
gdisp = gdisplay_get_ID(gdisp_ID);
|
||||
|
||||
if (gdisp_ID > 0 && gdisp->progressid == 0)
|
||||
{
|
||||
context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
|
||||
gdisp->progressid = gtk_statusbar_push(GTK_STATUSBAR(gdisp->statusbar),
|
||||
context_id, message);
|
||||
plug_in->progress_gdisp_ID = gdisp_ID;
|
||||
}
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = gtk_dialog_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (plug_in->progress), "plug_in_progress", "Gimp");
|
||||
|
@ -2957,7 +2988,7 @@ plug_in_progress_init (PlugIn *plug_in,
|
|||
gtk_label_set (GTK_LABEL (plug_in->progress_label), message);
|
||||
}
|
||||
#else
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = 0x1;
|
||||
progress_update (0.0);
|
||||
|
@ -2970,14 +3001,24 @@ static void
|
|||
plug_in_progress_update (PlugIn *plug_in,
|
||||
double percentage)
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL);
|
||||
GDisplay *gdisp;
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
gtk_progress_bar_update( GTK_PROGRESS_BAR (gdisp->progressbar), percentage);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL, -1);
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
#else
|
||||
progress_update (percentage);
|
||||
progress_update (percentage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static Argument*
|
||||
|
@ -2989,7 +3030,8 @@ progress_init_invoker (Argument *args)
|
|||
{
|
||||
success = TRUE;
|
||||
if (no_interface == FALSE)
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer);
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer,
|
||||
args[1].value.pdb_int);
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&progress_init_proc, success);
|
||||
|
|
|
@ -143,7 +143,10 @@ static ProcArg progress_init_args[] =
|
|||
{
|
||||
{ PDB_STRING,
|
||||
"message",
|
||||
"Message to use in the progress dialog." }
|
||||
"Message to use in the progress dialog." },
|
||||
{ PDB_INT8,
|
||||
"gdisplay",
|
||||
"GDisplay to update progressbar in, or -1 for a seperate window" }
|
||||
};
|
||||
|
||||
static ProcRecord progress_init_proc =
|
||||
|
@ -155,7 +158,7 @@ static ProcRecord progress_init_proc =
|
|||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
PDB_INTERNAL,
|
||||
1,
|
||||
2,
|
||||
progress_init_args,
|
||||
0,
|
||||
NULL,
|
||||
|
@ -724,6 +727,9 @@ plug_in_new (char *name)
|
|||
void
|
||||
plug_in_destroy (PlugIn *plug_in)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
guint c_id;
|
||||
|
||||
if (plug_in)
|
||||
{
|
||||
plug_in_close (plug_in, TRUE);
|
||||
|
@ -741,6 +747,16 @@ plug_in_destroy (PlugIn *plug_in)
|
|||
if (plug_in->args[5])
|
||||
g_free (plug_in->args[5]);
|
||||
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
c_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(gdisp->statusbar), c_id);
|
||||
gtk_progress_bar_update(GTK_PROGRESS_BAR(gdisp->progressbar), 0.0);
|
||||
gdisp->progressid = 0;
|
||||
}
|
||||
|
||||
if (plug_in == current_plug_in)
|
||||
plug_in_pop ();
|
||||
|
||||
|
@ -2906,16 +2922,31 @@ plug_in_progress_cancel (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
plug_in_progress_init (PlugIn *plug_in,
|
||||
char *message)
|
||||
char *message,
|
||||
gint gdisp_ID)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *button;
|
||||
GDisplay *gdisp;
|
||||
guint context_id;
|
||||
|
||||
if (!message)
|
||||
message = plug_in->args[0];
|
||||
|
||||
if (gdisp_ID > 0)
|
||||
gdisp = gdisplay_get_ID(gdisp_ID);
|
||||
|
||||
if (gdisp_ID > 0 && gdisp->progressid == 0)
|
||||
{
|
||||
context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
|
||||
gdisp->progressid = gtk_statusbar_push(GTK_STATUSBAR(gdisp->statusbar),
|
||||
context_id, message);
|
||||
plug_in->progress_gdisp_ID = gdisp_ID;
|
||||
}
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = gtk_dialog_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (plug_in->progress), "plug_in_progress", "Gimp");
|
||||
|
@ -2957,7 +2988,7 @@ plug_in_progress_init (PlugIn *plug_in,
|
|||
gtk_label_set (GTK_LABEL (plug_in->progress_label), message);
|
||||
}
|
||||
#else
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = 0x1;
|
||||
progress_update (0.0);
|
||||
|
@ -2970,14 +3001,24 @@ static void
|
|||
plug_in_progress_update (PlugIn *plug_in,
|
||||
double percentage)
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL);
|
||||
GDisplay *gdisp;
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
gtk_progress_bar_update( GTK_PROGRESS_BAR (gdisp->progressbar), percentage);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL, -1);
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
#else
|
||||
progress_update (percentage);
|
||||
progress_update (percentage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static Argument*
|
||||
|
@ -2989,7 +3030,8 @@ progress_init_invoker (Argument *args)
|
|||
{
|
||||
success = TRUE;
|
||||
if (no_interface == FALSE)
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer);
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer,
|
||||
args[1].value.pdb_int);
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&progress_init_proc, success);
|
||||
|
|
|
@ -62,6 +62,8 @@ struct _PlugIn
|
|||
GtkWidget *progress_label;
|
||||
GtkWidget *progress_bar;
|
||||
|
||||
gint8 progress_gdisp_ID; /* gdisp_ID of progress */
|
||||
|
||||
gpointer user_data; /* Handle for hanging data onto */
|
||||
};
|
||||
|
||||
|
|
|
@ -143,7 +143,10 @@ static ProcArg progress_init_args[] =
|
|||
{
|
||||
{ PDB_STRING,
|
||||
"message",
|
||||
"Message to use in the progress dialog." }
|
||||
"Message to use in the progress dialog." },
|
||||
{ PDB_INT8,
|
||||
"gdisplay",
|
||||
"GDisplay to update progressbar in, or -1 for a seperate window" }
|
||||
};
|
||||
|
||||
static ProcRecord progress_init_proc =
|
||||
|
@ -155,7 +158,7 @@ static ProcRecord progress_init_proc =
|
|||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
PDB_INTERNAL,
|
||||
1,
|
||||
2,
|
||||
progress_init_args,
|
||||
0,
|
||||
NULL,
|
||||
|
@ -724,6 +727,9 @@ plug_in_new (char *name)
|
|||
void
|
||||
plug_in_destroy (PlugIn *plug_in)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
guint c_id;
|
||||
|
||||
if (plug_in)
|
||||
{
|
||||
plug_in_close (plug_in, TRUE);
|
||||
|
@ -741,6 +747,16 @@ plug_in_destroy (PlugIn *plug_in)
|
|||
if (plug_in->args[5])
|
||||
g_free (plug_in->args[5]);
|
||||
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
c_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(gdisp->statusbar), c_id);
|
||||
gtk_progress_bar_update(GTK_PROGRESS_BAR(gdisp->progressbar), 0.0);
|
||||
gdisp->progressid = 0;
|
||||
}
|
||||
|
||||
if (plug_in == current_plug_in)
|
||||
plug_in_pop ();
|
||||
|
||||
|
@ -2906,16 +2922,31 @@ plug_in_progress_cancel (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
plug_in_progress_init (PlugIn *plug_in,
|
||||
char *message)
|
||||
char *message,
|
||||
gint gdisp_ID)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *button;
|
||||
GDisplay *gdisp;
|
||||
guint context_id;
|
||||
|
||||
if (!message)
|
||||
message = plug_in->args[0];
|
||||
|
||||
if (gdisp_ID > 0)
|
||||
gdisp = gdisplay_get_ID(gdisp_ID);
|
||||
|
||||
if (gdisp_ID > 0 && gdisp->progressid == 0)
|
||||
{
|
||||
context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
|
||||
gdisp->progressid = gtk_statusbar_push(GTK_STATUSBAR(gdisp->statusbar),
|
||||
context_id, message);
|
||||
plug_in->progress_gdisp_ID = gdisp_ID;
|
||||
}
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = gtk_dialog_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (plug_in->progress), "plug_in_progress", "Gimp");
|
||||
|
@ -2957,7 +2988,7 @@ plug_in_progress_init (PlugIn *plug_in,
|
|||
gtk_label_set (GTK_LABEL (plug_in->progress_label), message);
|
||||
}
|
||||
#else
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = 0x1;
|
||||
progress_update (0.0);
|
||||
|
@ -2970,14 +3001,24 @@ static void
|
|||
plug_in_progress_update (PlugIn *plug_in,
|
||||
double percentage)
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL);
|
||||
GDisplay *gdisp;
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
gtk_progress_bar_update( GTK_PROGRESS_BAR (gdisp->progressbar), percentage);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL, -1);
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
#else
|
||||
progress_update (percentage);
|
||||
progress_update (percentage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static Argument*
|
||||
|
@ -2989,7 +3030,8 @@ progress_init_invoker (Argument *args)
|
|||
{
|
||||
success = TRUE;
|
||||
if (no_interface == FALSE)
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer);
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer,
|
||||
args[1].value.pdb_int);
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&progress_init_proc, success);
|
||||
|
|
|
@ -62,6 +62,8 @@ struct _PlugIn
|
|||
GtkWidget *progress_label;
|
||||
GtkWidget *progress_bar;
|
||||
|
||||
gint8 progress_gdisp_ID; /* gdisp_ID of progress */
|
||||
|
||||
gpointer user_data; /* Handle for hanging data onto */
|
||||
};
|
||||
|
||||
|
|
|
@ -143,7 +143,10 @@ static ProcArg progress_init_args[] =
|
|||
{
|
||||
{ PDB_STRING,
|
||||
"message",
|
||||
"Message to use in the progress dialog." }
|
||||
"Message to use in the progress dialog." },
|
||||
{ PDB_INT8,
|
||||
"gdisplay",
|
||||
"GDisplay to update progressbar in, or -1 for a seperate window" }
|
||||
};
|
||||
|
||||
static ProcRecord progress_init_proc =
|
||||
|
@ -155,7 +158,7 @@ static ProcRecord progress_init_proc =
|
|||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
PDB_INTERNAL,
|
||||
1,
|
||||
2,
|
||||
progress_init_args,
|
||||
0,
|
||||
NULL,
|
||||
|
@ -724,6 +727,9 @@ plug_in_new (char *name)
|
|||
void
|
||||
plug_in_destroy (PlugIn *plug_in)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
guint c_id;
|
||||
|
||||
if (plug_in)
|
||||
{
|
||||
plug_in_close (plug_in, TRUE);
|
||||
|
@ -741,6 +747,16 @@ plug_in_destroy (PlugIn *plug_in)
|
|||
if (plug_in->args[5])
|
||||
g_free (plug_in->args[5]);
|
||||
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
c_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
gtk_statusbar_pop(GTK_STATUSBAR(gdisp->statusbar), c_id);
|
||||
gtk_progress_bar_update(GTK_PROGRESS_BAR(gdisp->progressbar), 0.0);
|
||||
gdisp->progressid = 0;
|
||||
}
|
||||
|
||||
if (plug_in == current_plug_in)
|
||||
plug_in_pop ();
|
||||
|
||||
|
@ -2906,16 +2922,31 @@ plug_in_progress_cancel (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
plug_in_progress_init (PlugIn *plug_in,
|
||||
char *message)
|
||||
char *message,
|
||||
gint gdisp_ID)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *button;
|
||||
GDisplay *gdisp;
|
||||
guint context_id;
|
||||
|
||||
if (!message)
|
||||
message = plug_in->args[0];
|
||||
|
||||
if (gdisp_ID > 0)
|
||||
gdisp = gdisplay_get_ID(gdisp_ID);
|
||||
|
||||
if (gdisp_ID > 0 && gdisp->progressid == 0)
|
||||
{
|
||||
context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(gdisp->statusbar),
|
||||
"progress");
|
||||
|
||||
gdisp->progressid = gtk_statusbar_push(GTK_STATUSBAR(gdisp->statusbar),
|
||||
context_id, message);
|
||||
plug_in->progress_gdisp_ID = gdisp_ID;
|
||||
}
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = gtk_dialog_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (plug_in->progress), "plug_in_progress", "Gimp");
|
||||
|
@ -2957,7 +2988,7 @@ plug_in_progress_init (PlugIn *plug_in,
|
|||
gtk_label_set (GTK_LABEL (plug_in->progress_label), message);
|
||||
}
|
||||
#else
|
||||
if (!plug_in->progress)
|
||||
else if (!plug_in->progress)
|
||||
{
|
||||
plug_in->progress = 0x1;
|
||||
progress_update (0.0);
|
||||
|
@ -2970,14 +3001,24 @@ static void
|
|||
plug_in_progress_update (PlugIn *plug_in,
|
||||
double percentage)
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL);
|
||||
GDisplay *gdisp;
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
if (plug_in->progress_gdisp_ID > 0)
|
||||
{
|
||||
gdisp = gdisplay_get_ID(plug_in->progress_gdisp_ID);
|
||||
gtk_progress_bar_update( GTK_PROGRESS_BAR (gdisp->progressbar), percentage);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef SEPARATE_PROGRESS_BAR
|
||||
if (!plug_in->progress)
|
||||
plug_in_progress_init (plug_in, NULL, -1);
|
||||
|
||||
gtk_progress_bar_update (GTK_PROGRESS_BAR (plug_in->progress_bar), percentage);
|
||||
#else
|
||||
progress_update (percentage);
|
||||
progress_update (percentage);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static Argument*
|
||||
|
@ -2989,7 +3030,8 @@ progress_init_invoker (Argument *args)
|
|||
{
|
||||
success = TRUE;
|
||||
if (no_interface == FALSE)
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer);
|
||||
plug_in_progress_init (current_plug_in, args[0].value.pdb_pointer,
|
||||
args[1].value.pdb_int);
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&progress_init_proc, success);
|
||||
|
|
|
@ -62,6 +62,8 @@ struct _PlugIn
|
|||
GtkWidget *progress_label;
|
||||
GtkWidget *progress_bar;
|
||||
|
||||
gint8 progress_gdisp_ID; /* gdisp_ID of progress */
|
||||
|
||||
gpointer user_data; /* Handle for hanging data onto */
|
||||
};
|
||||
|
||||
|
|
|
@ -176,18 +176,16 @@ gimp_get_data (gchar * id,
|
|||
}
|
||||
|
||||
|
||||
/* Snorfle - check for valid _gdisp_ID (!= -1) here and use it */
|
||||
void
|
||||
gimp_progress_init (char *message)
|
||||
{
|
||||
GParam *return_vals;
|
||||
int nreturn_vals;
|
||||
|
||||
/* g_print ("%d\n", _gdisp_ID); */
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_progress_init",
|
||||
&nreturn_vals,
|
||||
PARAM_STRING, message,
|
||||
PARAM_INT8, _gdisp_ID,
|
||||
PARAM_END);
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
|
Loading…
Reference in New Issue