app/gui/gui-message.c moved utility function to gimpwidgets-utils.
2006-09-22 Sven Neumann <sven@gimp.org> * app/gui/gui-message.c * app/widgets/gimpwidgets-utils.[ch]: moved utility function to gimpwidgets-utils. * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: added a progress parameter to gimp_pdb_dialog_new() and make the dialog transient to the progress window. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb: pass progress to gimp_pdb_dialog_new(). * app/pdb/brush_select_cmds.c * app/pdb/font_select_cmds.c * app/pdb/gradient_select_cmds.c * app/pdb/palette_select_cmds.c * app/pdb/pattern_select_cmds.c: regenerated. * libgimp/gimpselectbutton.c: cosmetics.
This commit is contained in:

committed by
Sven Neumann

parent
e57e424488
commit
a69c1ff174
26
ChangeLog
26
ChangeLog
@ -1,3 +1,29 @@
|
|||||||
|
2006-09-22 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* app/gui/gui-message.c
|
||||||
|
* app/widgets/gimpwidgets-utils.[ch]: moved utility function to
|
||||||
|
gimpwidgets-utils.
|
||||||
|
|
||||||
|
* app/core/gimp-gui.[ch]
|
||||||
|
* app/gui/gui-vtable.c: added a progress parameter to
|
||||||
|
gimp_pdb_dialog_new() and make the dialog transient to the progress
|
||||||
|
window.
|
||||||
|
|
||||||
|
* tools/pdbgen/pdb/brush_select.pdb
|
||||||
|
* tools/pdbgen/pdb/font_select.pdb
|
||||||
|
* tools/pdbgen/pdb/gradient_select.pdb
|
||||||
|
* tools/pdbgen/pdb/palette_select.pdb
|
||||||
|
* tools/pdbgen/pdb/pattern_select.pdb: pass progress to
|
||||||
|
gimp_pdb_dialog_new().
|
||||||
|
|
||||||
|
* app/pdb/brush_select_cmds.c
|
||||||
|
* app/pdb/font_select_cmds.c
|
||||||
|
* app/pdb/gradient_select_cmds.c
|
||||||
|
* app/pdb/palette_select_cmds.c
|
||||||
|
* app/pdb/pattern_select_cmds.c: regenerated.
|
||||||
|
|
||||||
|
* libgimp/gimpselectbutton.c: cosmetics.
|
||||||
|
|
||||||
2006-09-21 Bill Skaggs <weskaggs@primate.ucdavis.edu>
|
2006-09-21 Bill Skaggs <weskaggs@primate.ucdavis.edu>
|
||||||
|
|
||||||
* app/widgets/gimppropwidgets.c (gimp_prop_aspect_ratio_new):
|
* app/widgets/gimppropwidgets.c (gimp_prop_aspect_ratio_new):
|
||||||
|
@ -329,6 +329,7 @@ gimp_free_progress (Gimp *gimp,
|
|||||||
gboolean
|
gboolean
|
||||||
gimp_pdb_dialog_new (Gimp *gimp,
|
gimp_pdb_dialog_new (Gimp *gimp,
|
||||||
GimpContext *context,
|
GimpContext *context,
|
||||||
|
GimpProgress *progress,
|
||||||
GimpContainer *container,
|
GimpContainer *container,
|
||||||
const gchar *title,
|
const gchar *title,
|
||||||
const gchar *callback_name,
|
const gchar *callback_name,
|
||||||
@ -339,17 +340,19 @@ gimp_pdb_dialog_new (Gimp *gimp,
|
|||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
|
||||||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE);
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE);
|
||||||
|
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), FALSE);
|
||||||
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
|
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
|
||||||
g_return_val_if_fail (title != NULL, FALSE);
|
g_return_val_if_fail (title != NULL, FALSE);
|
||||||
g_return_val_if_fail (callback_name != NULL, FALSE);
|
g_return_val_if_fail (callback_name != NULL, FALSE);
|
||||||
|
|
||||||
if (gimp->gui.pdb_dialog_new)
|
if (gimp->gui.pdb_dialog_new)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
va_start (args, object_name);
|
va_start (args, object_name);
|
||||||
|
|
||||||
retval = gimp->gui.pdb_dialog_new (gimp, context, container, title,
|
retval = gimp->gui.pdb_dialog_new (gimp, context, progress,
|
||||||
|
container, title,
|
||||||
callback_name, object_name,
|
callback_name, object_name,
|
||||||
args);
|
args);
|
||||||
|
|
||||||
@ -375,7 +378,7 @@ gimp_pdb_dialog_set (Gimp *gimp,
|
|||||||
|
|
||||||
if (gimp->gui.pdb_dialog_set)
|
if (gimp->gui.pdb_dialog_set)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
va_start (args, object_name);
|
va_start (args, object_name);
|
||||||
|
|
||||||
|
@ -65,6 +65,7 @@ struct _GimpGui
|
|||||||
|
|
||||||
gboolean (* pdb_dialog_new) (Gimp *gimp,
|
gboolean (* pdb_dialog_new) (Gimp *gimp,
|
||||||
GimpContext *context,
|
GimpContext *context,
|
||||||
|
GimpProgress *progress,
|
||||||
GimpContainer *container,
|
GimpContainer *container,
|
||||||
const gchar *title,
|
const gchar *title,
|
||||||
const gchar *callback_name,
|
const gchar *callback_name,
|
||||||
@ -129,6 +130,7 @@ const gchar * gimp_get_theme_dir (Gimp *gimp);
|
|||||||
|
|
||||||
gboolean gimp_pdb_dialog_new (Gimp *gimp,
|
gboolean gimp_pdb_dialog_new (Gimp *gimp,
|
||||||
GimpContext *context,
|
GimpContext *context,
|
||||||
|
GimpProgress *progress,
|
||||||
GimpContainer *container,
|
GimpContainer *container,
|
||||||
const gchar *title,
|
const gchar *title,
|
||||||
const gchar *callback_name,
|
const gchar *callback_name,
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
#include "widgets/gimperrorconsole.h"
|
#include "widgets/gimperrorconsole.h"
|
||||||
#include "widgets/gimperrordialog.h"
|
#include "widgets/gimperrordialog.h"
|
||||||
#include "widgets/gimpprogressdialog.h"
|
#include "widgets/gimpprogressdialog.h"
|
||||||
|
#include "widgets/gimpwidgets-utils.h"
|
||||||
|
|
||||||
#include "dialogs/dialogs.h"
|
#include "dialogs/dialogs.h"
|
||||||
|
|
||||||
@ -52,9 +53,6 @@ static gboolean gui_message_error_dialog (GimpProgress *progress,
|
|||||||
static void gui_message_console (const gchar *domain,
|
static void gui_message_console (const gchar *domain,
|
||||||
const gchar *message);
|
const gchar *message);
|
||||||
|
|
||||||
static void gimp_window_set_transient_for (GtkWindow *window,
|
|
||||||
guint32 parent_ID);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
gui_message (Gimp *gimp,
|
gui_message (Gimp *gimp,
|
||||||
@ -189,37 +187,3 @@ gui_message_console (const gchar *domain,
|
|||||||
{
|
{
|
||||||
g_printerr ("%s: %s\n\n", domain, message);
|
g_printerr ("%s: %s\n\n", domain, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* utility functions, similar to what we have in libgimp/gimpui.c */
|
|
||||||
|
|
||||||
static void
|
|
||||||
gimp_window_transient_realized (GtkWidget *window,
|
|
||||||
GdkWindow *parent)
|
|
||||||
{
|
|
||||||
if (GTK_WIDGET_REALIZED (window))
|
|
||||||
gdk_window_set_transient_for (window->window, parent);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gimp_window_set_transient_for (GtkWindow *window,
|
|
||||||
guint32 parent_ID)
|
|
||||||
{
|
|
||||||
GdkWindow *parent;
|
|
||||||
|
|
||||||
parent = gdk_window_foreign_new_for_display (gdk_display_get_default (),
|
|
||||||
parent_ID);
|
|
||||||
|
|
||||||
if (! parent)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (GTK_WIDGET_REALIZED (window))
|
|
||||||
gdk_window_set_transient_for (GTK_WIDGET (window)->window, parent);
|
|
||||||
|
|
||||||
g_signal_connect_object (window, "realize",
|
|
||||||
G_CALLBACK (gimp_window_transient_realized),
|
|
||||||
parent, 0);
|
|
||||||
|
|
||||||
g_object_unref (parent);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -101,6 +101,7 @@ static void gui_free_progress (Gimp *gimp,
|
|||||||
GimpProgress *progress);
|
GimpProgress *progress);
|
||||||
static gboolean gui_pdb_dialog_new (Gimp *gimp,
|
static gboolean gui_pdb_dialog_new (Gimp *gimp,
|
||||||
GimpContext *context,
|
GimpContext *context,
|
||||||
|
GimpProgress *progress,
|
||||||
GimpContainer *container,
|
GimpContainer *container,
|
||||||
const gchar *title,
|
const gchar *title,
|
||||||
const gchar *callback_name,
|
const gchar *callback_name,
|
||||||
@ -331,6 +332,7 @@ gui_free_progress (Gimp *gimp,
|
|||||||
static gboolean
|
static gboolean
|
||||||
gui_pdb_dialog_new (Gimp *gimp,
|
gui_pdb_dialog_new (Gimp *gimp,
|
||||||
GimpContext *context,
|
GimpContext *context,
|
||||||
|
GimpProgress *progress,
|
||||||
GimpContainer *container,
|
GimpContainer *container,
|
||||||
const gchar *title,
|
const gchar *title,
|
||||||
const gchar *callback_name,
|
const gchar *callback_name,
|
||||||
@ -414,6 +416,14 @@ gui_pdb_dialog_new (Gimp *gimp,
|
|||||||
if (view)
|
if (view)
|
||||||
gimp_docked_set_show_button_bar (GIMP_DOCKED (view), FALSE);
|
gimp_docked_set_show_button_bar (GIMP_DOCKED (view), FALSE);
|
||||||
|
|
||||||
|
if (progress)
|
||||||
|
{
|
||||||
|
guint32 window = gimp_progress_get_window (progress);
|
||||||
|
|
||||||
|
if (window)
|
||||||
|
gimp_window_set_transient_for (GTK_WINDOW (dialog), window);
|
||||||
|
}
|
||||||
|
|
||||||
gtk_widget_show (dialog);
|
gtk_widget_show (dialog);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -58,7 +58,8 @@ brushes_popup_invoker (GimpProcedure *procedure,
|
|||||||
{
|
{
|
||||||
if (gimp->no_interface ||
|
if (gimp->no_interface ||
|
||||||
! gimp_pdb_lookup_procedure (gimp->pdb, brush_callback) ||
|
! gimp_pdb_lookup_procedure (gimp->pdb, brush_callback) ||
|
||||||
! gimp_pdb_dialog_new (gimp, context, gimp->brush_factory->container,
|
! gimp_pdb_dialog_new (gimp, context, progress,
|
||||||
|
gimp->brush_factory->container,
|
||||||
popup_title, brush_callback, initial_brush,
|
popup_title, brush_callback, initial_brush,
|
||||||
"opacity", opacity / 100.0,
|
"opacity", opacity / 100.0,
|
||||||
"paint-mode", paint_mode,
|
"paint-mode", paint_mode,
|
||||||
|
@ -51,7 +51,7 @@ fonts_popup_invoker (GimpProcedure *procedure,
|
|||||||
{
|
{
|
||||||
if (gimp->no_interface ||
|
if (gimp->no_interface ||
|
||||||
! gimp_pdb_lookup_procedure (gimp->pdb, font_callback) ||
|
! gimp_pdb_lookup_procedure (gimp->pdb, font_callback) ||
|
||||||
! gimp_pdb_dialog_new (gimp, context, gimp->fonts,
|
! gimp_pdb_dialog_new (gimp, context, progress, gimp->fonts,
|
||||||
popup_title, font_callback, initial_font,
|
popup_title, font_callback, initial_font,
|
||||||
NULL))
|
NULL))
|
||||||
success = FALSE;
|
success = FALSE;
|
||||||
|
@ -58,7 +58,8 @@ gradients_popup_invoker (GimpProcedure *procedure,
|
|||||||
|
|
||||||
if (gimp->no_interface ||
|
if (gimp->no_interface ||
|
||||||
! gimp_pdb_lookup_procedure (gimp->pdb, gradient_callback) ||
|
! gimp_pdb_lookup_procedure (gimp->pdb, gradient_callback) ||
|
||||||
! gimp_pdb_dialog_new (gimp, context, gimp->gradient_factory->container,
|
! gimp_pdb_dialog_new (gimp, context, progress,
|
||||||
|
gimp->gradient_factory->container,
|
||||||
popup_title, gradient_callback, initial_gradient,
|
popup_title, gradient_callback, initial_gradient,
|
||||||
"sample-size", sample_size,
|
"sample-size", sample_size,
|
||||||
NULL))
|
NULL))
|
||||||
|
@ -52,7 +52,8 @@ palettes_popup_invoker (GimpProcedure *procedure,
|
|||||||
{
|
{
|
||||||
if (gimp->no_interface ||
|
if (gimp->no_interface ||
|
||||||
! gimp_pdb_lookup_procedure (gimp->pdb, palette_callback) ||
|
! gimp_pdb_lookup_procedure (gimp->pdb, palette_callback) ||
|
||||||
! gimp_pdb_dialog_new (gimp, context, gimp->palette_factory->container,
|
! gimp_pdb_dialog_new (gimp, context, progress,
|
||||||
|
gimp->palette_factory->container,
|
||||||
popup_title, palette_callback, initial_palette,
|
popup_title, palette_callback, initial_palette,
|
||||||
NULL))
|
NULL))
|
||||||
success = FALSE;
|
success = FALSE;
|
||||||
|
@ -52,7 +52,8 @@ patterns_popup_invoker (GimpProcedure *procedure,
|
|||||||
{
|
{
|
||||||
if (gimp->no_interface ||
|
if (gimp->no_interface ||
|
||||||
! gimp_pdb_lookup_procedure (gimp->pdb, pattern_callback) ||
|
! gimp_pdb_lookup_procedure (gimp->pdb, pattern_callback) ||
|
||||||
! gimp_pdb_dialog_new (gimp, context, gimp->pattern_factory->container,
|
! gimp_pdb_dialog_new (gimp, context, progress,
|
||||||
|
gimp->pattern_factory->container,
|
||||||
popup_title, pattern_callback, initial_pattern,
|
popup_title, pattern_callback, initial_pattern,
|
||||||
NULL))
|
NULL))
|
||||||
success = FALSE;
|
success = FALSE;
|
||||||
|
@ -844,6 +844,37 @@ gimp_window_get_native (GtkWindow *window)
|
|||||||
return (GdkNativeWindow)0;
|
return (GdkNativeWindow)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gimp_window_transient_realized (GtkWidget *window,
|
||||||
|
GdkWindow *parent)
|
||||||
|
{
|
||||||
|
if (GTK_WIDGET_REALIZED (window))
|
||||||
|
gdk_window_set_transient_for (window->window, parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* similar to what we have in libgimp/gimpui.c */
|
||||||
|
void
|
||||||
|
gimp_window_set_transient_for (GtkWindow *window,
|
||||||
|
guint32 parent_ID)
|
||||||
|
{
|
||||||
|
GdkWindow *parent;
|
||||||
|
|
||||||
|
parent = gdk_window_foreign_new_for_display (gdk_display_get_default (),
|
||||||
|
parent_ID);
|
||||||
|
|
||||||
|
if (! parent)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (GTK_WIDGET_REALIZED (window))
|
||||||
|
gdk_window_set_transient_for (GTK_WIDGET (window)->window, parent);
|
||||||
|
|
||||||
|
g_signal_connect_object (window, "realize",
|
||||||
|
G_CALLBACK (gimp_window_transient_realized),
|
||||||
|
parent, 0);
|
||||||
|
|
||||||
|
g_object_unref (parent);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_dialog_set_sensitive (GtkDialog *dialog,
|
gimp_dialog_set_sensitive (GtkDialog *dialog,
|
||||||
gboolean sensitive)
|
gboolean sensitive)
|
||||||
|
@ -73,6 +73,8 @@ void gimp_rgb_set_gdk_color (GimpRGB *rgb,
|
|||||||
void gimp_window_set_hint (GtkWindow *window,
|
void gimp_window_set_hint (GtkWindow *window,
|
||||||
GimpWindowHint hint);
|
GimpWindowHint hint);
|
||||||
GdkNativeWindow gimp_window_get_native (GtkWindow *window);
|
GdkNativeWindow gimp_window_get_native (GtkWindow *window);
|
||||||
|
void gimp_window_set_transient_for (GtkWindow *window,
|
||||||
|
guint32 parent_ID);
|
||||||
|
|
||||||
void gimp_dialog_set_sensitive (GtkDialog *dialog,
|
void gimp_dialog_set_sensitive (GtkDialog *dialog,
|
||||||
gboolean sensitive);
|
gboolean sensitive);
|
||||||
|
@ -63,7 +63,9 @@ gimp_select_button_close_popup (GimpSelectButton *button)
|
|||||||
|
|
||||||
if (button->temp_callback)
|
if (button->temp_callback)
|
||||||
{
|
{
|
||||||
GIMP_SELECT_BUTTON_GET_CLASS (button)->select_destroy (button->temp_callback);
|
GimpSelectButtonClass *klass = GIMP_SELECT_BUTTON_GET_CLASS (button);
|
||||||
|
|
||||||
|
klass->select_destroy (button->temp_callback);
|
||||||
|
|
||||||
button->temp_callback = NULL;
|
button->temp_callback = NULL;
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,8 @@ sub brushes_popup {
|
|||||||
{
|
{
|
||||||
if (gimp->no_interface ||
|
if (gimp->no_interface ||
|
||||||
! gimp_pdb_lookup_procedure (gimp->pdb, brush_callback) ||
|
! gimp_pdb_lookup_procedure (gimp->pdb, brush_callback) ||
|
||||||
! gimp_pdb_dialog_new (gimp, context, gimp->brush_factory->container,
|
! gimp_pdb_dialog_new (gimp, context, progress,
|
||||||
|
gimp->brush_factory->container,
|
||||||
popup_title, brush_callback, initial_brush,
|
popup_title, brush_callback, initial_brush,
|
||||||
"opacity", opacity / 100.0,
|
"opacity", opacity / 100.0,
|
||||||
"paint-mode", paint_mode,
|
"paint-mode", paint_mode,
|
||||||
|
@ -37,7 +37,7 @@ sub fonts_popup {
|
|||||||
{
|
{
|
||||||
if (gimp->no_interface ||
|
if (gimp->no_interface ||
|
||||||
! gimp_pdb_lookup_procedure (gimp->pdb, font_callback) ||
|
! gimp_pdb_lookup_procedure (gimp->pdb, font_callback) ||
|
||||||
! gimp_pdb_dialog_new (gimp, context, gimp->fonts,
|
! gimp_pdb_dialog_new (gimp, context, progress, gimp->fonts,
|
||||||
popup_title, font_callback, initial_font,
|
popup_title, font_callback, initial_font,
|
||||||
NULL))
|
NULL))
|
||||||
success = FALSE;
|
success = FALSE;
|
||||||
|
@ -45,7 +45,8 @@ sub gradients_popup {
|
|||||||
|
|
||||||
if (gimp->no_interface ||
|
if (gimp->no_interface ||
|
||||||
! gimp_pdb_lookup_procedure (gimp->pdb, gradient_callback) ||
|
! gimp_pdb_lookup_procedure (gimp->pdb, gradient_callback) ||
|
||||||
! gimp_pdb_dialog_new (gimp, context, gimp->gradient_factory->container,
|
! gimp_pdb_dialog_new (gimp, context, progress,
|
||||||
|
gimp->gradient_factory->container,
|
||||||
popup_title, gradient_callback, initial_gradient,
|
popup_title, gradient_callback, initial_gradient,
|
||||||
"sample-size", sample_size,
|
"sample-size", sample_size,
|
||||||
NULL))
|
NULL))
|
||||||
|
@ -38,7 +38,8 @@ sub palettes_popup {
|
|||||||
{
|
{
|
||||||
if (gimp->no_interface ||
|
if (gimp->no_interface ||
|
||||||
! gimp_pdb_lookup_procedure (gimp->pdb, palette_callback) ||
|
! gimp_pdb_lookup_procedure (gimp->pdb, palette_callback) ||
|
||||||
! gimp_pdb_dialog_new (gimp, context, gimp->palette_factory->container,
|
! gimp_pdb_dialog_new (gimp, context, progress,
|
||||||
|
gimp->palette_factory->container,
|
||||||
popup_title, palette_callback, initial_palette,
|
popup_title, palette_callback, initial_palette,
|
||||||
NULL))
|
NULL))
|
||||||
success = FALSE;
|
success = FALSE;
|
||||||
|
@ -38,7 +38,8 @@ sub patterns_popup {
|
|||||||
{
|
{
|
||||||
if (gimp->no_interface ||
|
if (gimp->no_interface ||
|
||||||
! gimp_pdb_lookup_procedure (gimp->pdb, pattern_callback) ||
|
! gimp_pdb_lookup_procedure (gimp->pdb, pattern_callback) ||
|
||||||
! gimp_pdb_dialog_new (gimp, context, gimp->pattern_factory->container,
|
! gimp_pdb_dialog_new (gimp, context, progress,
|
||||||
|
gimp->pattern_factory->container,
|
||||||
popup_title, pattern_callback, initial_pattern,
|
popup_title, pattern_callback, initial_pattern,
|
||||||
NULL))
|
NULL))
|
||||||
success = FALSE;
|
success = FALSE;
|
||||||
|
Reference in New Issue
Block a user