app/widgets/Makefile.am app/widgets/widgets-types.h new dialog widget
2002-08-30 Michael Natterer <mitch@gimp.org> * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpviewabledialog.[ch]: new dialog widget featuring a title bar containing a stock icon, a description, the viewable's name and a preview. Will be used for all viewable related dialogs and serves as a common place to control their look & feel. * app/tools/gimpimagemaptool.[ch]: removed the code which did almost the same and use GimpViewableDialog. * app/gui/info-dialog.[ch]: extended the API so it has enough information to create a GimpViewableDialog. * app/gui/channels-commands.c * app/gui/convert-dialog.c * app/gui/gradient-editor-commands.c * app/gui/image-commands.c * app/gui/info-window.c * app/gui/layers-commands.c * app/gui/offset-dialog.c * app/gui/qmask-commands.c * app/gui/resize-dialog.c * app/gui/vectors-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimphistogramtool.c * app/tools/gimpmeasuretool.c * app/tools/gimpperspectivetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c: use GimpViewableDialogs * themes/Default/gtkrc: apply the dialog style to "*Gimp*Dialog*", not only "*GimpDialog*" so it covers GimpViewableDialog.
This commit is contained in:

committed by
Michael Natterer

parent
77934d6804
commit
cc3bdec2c9
37
ChangeLog
37
ChangeLog
@ -1,3 +1,40 @@
|
||||
2002-08-30 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/widgets/Makefile.am
|
||||
* app/widgets/widgets-types.h
|
||||
* app/widgets/gimpviewabledialog.[ch]: new dialog widget featuring
|
||||
a title bar containing a stock icon, a description, the viewable's
|
||||
name and a preview. Will be used for all viewable related dialogs
|
||||
and serves as a common place to control their look & feel.
|
||||
|
||||
* app/tools/gimpimagemaptool.[ch]: removed the code which did
|
||||
almost the same and use GimpViewableDialog.
|
||||
|
||||
* app/gui/info-dialog.[ch]: extended the API so it has enough
|
||||
information to create a GimpViewableDialog.
|
||||
|
||||
* app/gui/channels-commands.c
|
||||
* app/gui/convert-dialog.c
|
||||
* app/gui/gradient-editor-commands.c
|
||||
* app/gui/image-commands.c
|
||||
* app/gui/info-window.c
|
||||
* app/gui/layers-commands.c
|
||||
* app/gui/offset-dialog.c
|
||||
* app/gui/qmask-commands.c
|
||||
* app/gui/resize-dialog.c
|
||||
* app/gui/vectors-commands.c
|
||||
* app/tools/gimpcolorpickertool.c
|
||||
* app/tools/gimpcroptool.c
|
||||
* app/tools/gimphistogramtool.c
|
||||
* app/tools/gimpmeasuretool.c
|
||||
* app/tools/gimpperspectivetool.c
|
||||
* app/tools/gimprotatetool.c
|
||||
* app/tools/gimpscaletool.c
|
||||
* app/tools/gimpsheartool.c: use GimpViewableDialogs
|
||||
|
||||
* themes/Default/gtkrc: apply the dialog style to "*Gimp*Dialog*",
|
||||
not only "*GimpDialog*" so it covers GimpViewableDialog.
|
||||
|
||||
2002-08-31 James Henstridge <james@daa.com.au>
|
||||
|
||||
* libgimp/gimp.c (gimp_run_procedure): handle GIMP_PDB_COLOR
|
||||
|
@ -37,6 +37,7 @@
|
||||
|
||||
#include "widgets/gimpcolorpanel.h"
|
||||
#include "widgets/gimpitemfactory.h"
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
#include "channels-commands.h"
|
||||
@ -293,19 +294,20 @@ channels_new_channel_query (GimpImage *gimage,
|
||||
|
||||
/* The dialog */
|
||||
options->query_box =
|
||||
gimp_dialog_new (_("New Channel Options"), "new_channel_options",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/channels/new_channel.html",
|
||||
GTK_WIN_POS_MOUSE,
|
||||
FALSE, TRUE, FALSE,
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
|
||||
_("New Channel"), "new_channel_options",
|
||||
GTK_STOCK_NEW,
|
||||
_("New Channel Options"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/channels/new_channel.html",
|
||||
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
|
||||
GTK_STOCK_OK, new_channel_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, new_channel_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (options->query_box),
|
||||
(GWeakNotify) g_free,
|
||||
@ -441,19 +443,20 @@ channels_edit_channel_query (GimpChannel *channel)
|
||||
|
||||
/* The dialog */
|
||||
options->query_box =
|
||||
gimp_dialog_new (_("Edit Channel Attributes"), "edit_channel_attributes",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/channels/edit_channel_attributes.html",
|
||||
GTK_WIN_POS_MOUSE,
|
||||
FALSE, TRUE, FALSE,
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (channel),
|
||||
_("Channel Attributes"), "edit_channel_attributes",
|
||||
GIMP_STOCK_EDIT,
|
||||
_("Edit Channel Attributes"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/channels/edit_channel_attributes.html",
|
||||
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
|
||||
GTK_STOCK_OK, edit_channel_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, edit_channel_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (options->query_box),
|
||||
(GWeakNotify) g_free,
|
||||
|
@ -535,7 +535,6 @@ gradient_editor_replicate_cmd_callback (GtkWidget *widget,
|
||||
if (! editor)
|
||||
return;
|
||||
|
||||
/* Create dialog window */
|
||||
dialog =
|
||||
gimp_dialog_new ((editor->control_sel_l == editor->control_sel_r) ?
|
||||
_("Replicate segment") :
|
||||
@ -584,7 +583,6 @@ gradient_editor_replicate_cmd_callback (GtkWidget *widget,
|
||||
G_CALLBACK (gimp_int_adjustment_update),
|
||||
&editor->replicate_times);
|
||||
|
||||
/* Show! */
|
||||
gtk_widget_show (dialog);
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (editor), FALSE);
|
||||
}
|
||||
|
@ -34,6 +34,8 @@
|
||||
#include "core/gimpimage-resize.h"
|
||||
#include "core/gimpimage-scale.h"
|
||||
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
|
||||
#include "display/gimpdisplay.h"
|
||||
#include "display/gimpdisplayshell.h"
|
||||
#include "display/gimpprogress.h"
|
||||
@ -286,19 +288,20 @@ image_layers_merge_query (GimpImage *gimage,
|
||||
|
||||
/* The dialog */
|
||||
options->query_box =
|
||||
gimp_dialog_new (_("Layers Merge Options"), "layers_merge_options",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/layers/merge_visible_layers.html",
|
||||
GTK_WIN_POS_MOUSE,
|
||||
FALSE, TRUE, FALSE,
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
|
||||
_("Merge Layers"), "layers_merge_options",
|
||||
GIMP_STOCK_MERGE_DOWN,
|
||||
_("Layers Merge Options"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/layers/merge_visible_layers.html",
|
||||
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
|
||||
GTK_STOCK_OK, image_layers_merge_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, image_layers_merge_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (options->query_box),
|
||||
(GWeakNotify) g_free,
|
||||
|
@ -42,6 +42,7 @@
|
||||
|
||||
#include "widgets/gimpenummenu.h"
|
||||
#include "widgets/gimpitemfactory.h"
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
#include "layers-commands.h"
|
||||
@ -577,19 +578,20 @@ layers_new_layer_query (GimpImage *gimage,
|
||||
|
||||
/* The dialog */
|
||||
options->query_box =
|
||||
gimp_dialog_new (_("New Layer Options"), "new_layer_options",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/layers/new_layer.html",
|
||||
GTK_WIN_POS_MOUSE,
|
||||
FALSE, TRUE, FALSE,
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
|
||||
_("New Layer"), "new_layer_options",
|
||||
GTK_STOCK_NEW,
|
||||
_("New Layer Options"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/layers/new_layer.html",
|
||||
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
|
||||
GTK_STOCK_OK, new_layer_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, new_layer_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (options->query_box),
|
||||
(GWeakNotify) g_free,
|
||||
@ -766,19 +768,21 @@ layers_edit_layer_query (GimpLayer *layer)
|
||||
|
||||
/* The dialog */
|
||||
options->query_box =
|
||||
gimp_dialog_new (_("Edit Layer Attributes"), "edit_layer_attributes",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/layers/edit_layer_attributes.html",
|
||||
GTK_WIN_POS_MOUSE,
|
||||
FALSE, TRUE, FALSE,
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (layer),
|
||||
_("Layer Attributes"),
|
||||
"edit_layer_attributes",
|
||||
GIMP_STOCK_EDIT,
|
||||
_("Edit Layer Attributes"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/layers/edit_layer_attributes.html",
|
||||
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
|
||||
GTK_STOCK_OK, edit_layer_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, edit_layer_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (options->query_box),
|
||||
(GWeakNotify) g_free,
|
||||
@ -871,19 +875,20 @@ layers_add_mask_query (GimpLayer *layer)
|
||||
|
||||
/* The dialog */
|
||||
options->query_box =
|
||||
gimp_dialog_new (_("Add Mask Options"), "add_mask_options",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/layers/add_layer_mask.html",
|
||||
GTK_WIN_POS_MOUSE,
|
||||
FALSE, TRUE, FALSE,
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (layer),
|
||||
_("Add Mask"), "add_mask_options",
|
||||
GTK_STOCK_ADD,
|
||||
_("Add Layer Mask Options"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/layers/add_layer_mask.html",
|
||||
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
|
||||
GTK_STOCK_OK, add_mask_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, add_mask_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (options->query_box),
|
||||
(GWeakNotify) g_free,
|
||||
|
@ -31,6 +31,7 @@
|
||||
|
||||
#include "widgets/gimpcolorpanel.h"
|
||||
#include "widgets/gimpitemfactory.h"
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
#include "display/gimpdisplay.h"
|
||||
@ -173,19 +174,20 @@ qmask_channel_query (GimpDisplayShell *shell)
|
||||
|
||||
/* The dialog */
|
||||
options->query_box =
|
||||
gimp_dialog_new (_("Edit Qmask Attributes"), "edit_qmask_attributes",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/edit_qmask_attributes.html",
|
||||
GTK_WIN_POS_MOUSE,
|
||||
FALSE, TRUE, FALSE,
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (shell->gdisp->gimage),
|
||||
_("Qmask Attributes"), "edit_qmask_attributes",
|
||||
GIMP_STOCK_QMASK_ON,
|
||||
_("Edit QuickMask Attributes"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/edit_qmask_attributes.html",
|
||||
|
||||
GTK_STOCK_CANCEL, qmask_query_cancel_callback,
|
||||
options, NULL, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL, qmask_query_cancel_callback,
|
||||
options, NULL, NULL, FALSE, TRUE,
|
||||
|
||||
GTK_STOCK_OK, qmask_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, qmask_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
/* The main hbox */
|
||||
hbox = gtk_hbox_new (FALSE, 4);
|
||||
|
@ -31,6 +31,7 @@
|
||||
|
||||
#include "widgets/gimpcolorpanel.h"
|
||||
#include "widgets/gimpitemfactory.h"
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
#include "display/gimpdisplay.h"
|
||||
@ -173,19 +174,20 @@ qmask_channel_query (GimpDisplayShell *shell)
|
||||
|
||||
/* The dialog */
|
||||
options->query_box =
|
||||
gimp_dialog_new (_("Edit Qmask Attributes"), "edit_qmask_attributes",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/edit_qmask_attributes.html",
|
||||
GTK_WIN_POS_MOUSE,
|
||||
FALSE, TRUE, FALSE,
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (shell->gdisp->gimage),
|
||||
_("Qmask Attributes"), "edit_qmask_attributes",
|
||||
GIMP_STOCK_QMASK_ON,
|
||||
_("Edit QuickMask Attributes"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/edit_qmask_attributes.html",
|
||||
|
||||
GTK_STOCK_CANCEL, qmask_query_cancel_callback,
|
||||
options, NULL, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL, qmask_query_cancel_callback,
|
||||
options, NULL, NULL, FALSE, TRUE,
|
||||
|
||||
GTK_STOCK_OK, qmask_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, qmask_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
/* The main hbox */
|
||||
hbox = gtk_hbox_new (FALSE, 4);
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include "vectors/gimpvectors.h"
|
||||
|
||||
#include "widgets/gimpitemfactory.h"
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
#include "tools/gimppainttool.h"
|
||||
@ -435,19 +436,20 @@ vectors_new_vectors_query (GimpImage *gimage,
|
||||
|
||||
/* The dialog */
|
||||
options->query_box =
|
||||
gimp_dialog_new (_("New Path Options"), "new_path_options",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/vectors/new_vectors.html",
|
||||
GTK_WIN_POS_MOUSE,
|
||||
FALSE, TRUE, FALSE,
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
|
||||
_("New Path"), "new_path_options",
|
||||
GTK_STOCK_NEW,
|
||||
_("New Path Options"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/vectors/new_vectors.html",
|
||||
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
|
||||
GTK_STOCK_OK, new_vectors_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, new_vectors_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (options->query_box),
|
||||
(GWeakNotify) g_free,
|
||||
@ -550,19 +552,20 @@ vectors_edit_vectors_query (GimpVectors *vectors)
|
||||
|
||||
/* The dialog */
|
||||
options->query_box =
|
||||
gimp_dialog_new (_("Edit Path Attributes"), "edit_path_attributes",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/paths/edit_path_attributes.html",
|
||||
GTK_WIN_POS_MOUSE,
|
||||
FALSE, TRUE, FALSE,
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (vectors),
|
||||
_("Path Attributes"), "edit_path_attributes",
|
||||
GIMP_STOCK_EDIT,
|
||||
_("Edit Path Attributes"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/paths/edit_path_attributes.html",
|
||||
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
|
||||
GTK_STOCK_OK, edit_vectors_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, edit_vectors_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (options->query_box),
|
||||
(GWeakNotify) g_free,
|
||||
|
@ -83,6 +83,8 @@ static GimpConvertPaletteType spalette_type = GIMP_MAKE_PALETTE;
|
||||
void
|
||||
convert_to_rgb (GimpImage *gimage)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_IMAGE (gimage));
|
||||
|
||||
gimp_image_convert (gimage, GIMP_RGB, 0, 0, 0, 0, 0, NULL);
|
||||
gimp_image_flush (gimage);
|
||||
}
|
||||
@ -90,6 +92,8 @@ convert_to_rgb (GimpImage *gimage)
|
||||
void
|
||||
convert_to_grayscale (GimpImage* gimage)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_IMAGE (gimage));
|
||||
|
||||
gimp_image_convert (gimage, GIMP_GRAY, 0, 0, 0, 0, 0, NULL);
|
||||
gimp_image_flush (gimage);
|
||||
}
|
||||
@ -108,6 +112,8 @@ convert_to_indexed (GimpImage *gimage)
|
||||
GtkWidget *toggle;
|
||||
GSList *group = NULL;
|
||||
|
||||
g_return_if_fail (GIMP_IS_IMAGE (gimage));
|
||||
|
||||
dialog = g_new0 (IndexedDialog, 1);
|
||||
|
||||
dialog->gimage = gimage;
|
||||
@ -120,19 +126,21 @@ convert_to_indexed (GimpImage *gimage)
|
||||
dialog->palette_type = spalette_type;
|
||||
|
||||
dialog->shell =
|
||||
gimp_dialog_new (_("Indexed Color Conversion"), "indexed_color_conversion",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/convert_to_indexed.html",
|
||||
GTK_WIN_POS_NONE,
|
||||
FALSE, FALSE, TRUE,
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
|
||||
_("Indexed Color Conversion"),
|
||||
"indexed_color_conversion",
|
||||
GIMP_STOCK_CONVERT_INDEXED,
|
||||
_("Convert Image to Indexed Colors"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/convert_to_indexed.html",
|
||||
|
||||
GTK_STOCK_CANCEL, indexed_cancel_callback,
|
||||
dialog, NULL, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL, indexed_cancel_callback,
|
||||
dialog, NULL, NULL, FALSE, TRUE,
|
||||
|
||||
GTK_STOCK_OK, indexed_ok_callback,
|
||||
dialog, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, indexed_ok_callback,
|
||||
dialog, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
main_vbox = gtk_vbox_new (FALSE, 2);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 4);
|
||||
|
@ -26,6 +26,8 @@
|
||||
|
||||
#include "gui-types.h"
|
||||
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
|
||||
#include "info-dialog.h"
|
||||
|
||||
#include "gimprc.h"
|
||||
@ -158,7 +160,11 @@ info_dialog_delete_callback (GtkWidget *widget,
|
||||
}
|
||||
|
||||
static InfoDialog *
|
||||
info_dialog_new_extended (gchar *title,
|
||||
info_dialog_new_extended (GimpViewable *viewable,
|
||||
const gchar *title,
|
||||
const gchar *wmclass_name,
|
||||
const gchar *stock_id,
|
||||
const gchar *desc,
|
||||
GimpHelpFunc help_func,
|
||||
gpointer help_data,
|
||||
gboolean in_notebook)
|
||||
@ -173,9 +179,11 @@ info_dialog_new_extended (gchar *title,
|
||||
idialog->field_list = NULL;
|
||||
idialog->nfields = 0;
|
||||
|
||||
shell = g_object_new (GIMP_TYPE_DIALOG, NULL);
|
||||
gtk_window_set_wmclass (GTK_WINDOW (shell), "info_dialog", "Gimp");
|
||||
gtk_window_set_title (GTK_WINDOW (shell), title);
|
||||
shell = gimp_viewable_dialog_new (viewable,
|
||||
title, wmclass_name,
|
||||
stock_id, desc,
|
||||
help_func, help_data,
|
||||
NULL);
|
||||
|
||||
g_signal_connect (G_OBJECT (shell), "delete_event",
|
||||
G_CALLBACK (info_dialog_delete_callback),
|
||||
@ -213,28 +221,37 @@ info_dialog_new_extended (gchar *title,
|
||||
gtk_widget_show (idialog->info_table);
|
||||
gtk_widget_show (idialog->vbox);
|
||||
|
||||
/* Connect the "F1" help key */
|
||||
gimp_help_connect (idialog->shell, help_func, help_data);
|
||||
|
||||
return idialog;
|
||||
}
|
||||
|
||||
/* public functions */
|
||||
|
||||
InfoDialog *
|
||||
info_dialog_notebook_new (gchar *title,
|
||||
GimpHelpFunc help_func,
|
||||
info_dialog_notebook_new (GimpViewable *viewable,
|
||||
const gchar *title,
|
||||
const gchar *wmclass_name,
|
||||
const gchar *stock_id,
|
||||
const gchar *desc,
|
||||
GimpHelpFunc help_func,
|
||||
gpointer help_data)
|
||||
{
|
||||
return info_dialog_new_extended (title, help_func, help_data, TRUE);
|
||||
return info_dialog_new_extended (viewable, title, wmclass_name,
|
||||
stock_id, desc,
|
||||
help_func, help_data, TRUE);
|
||||
}
|
||||
|
||||
InfoDialog *
|
||||
info_dialog_new (gchar *title,
|
||||
info_dialog_new (GimpViewable *viewable,
|
||||
const gchar *title,
|
||||
const gchar *wmclass_name,
|
||||
const gchar *stock_id,
|
||||
const gchar *desc,
|
||||
GimpHelpFunc help_func,
|
||||
gpointer help_data)
|
||||
{
|
||||
return info_dialog_new_extended (title, help_func, help_data, FALSE);
|
||||
return info_dialog_new_extended (viewable, title, wmclass_name,
|
||||
stock_id, desc,
|
||||
help_func, help_data, FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -57,10 +57,18 @@ struct _InfoDialog
|
||||
|
||||
/* Info Dialog functions */
|
||||
|
||||
InfoDialog *info_dialog_new (gchar *title,
|
||||
InfoDialog *info_dialog_new (GimpViewable *viewable,
|
||||
const gchar *title,
|
||||
const gchar *wmclass_name,
|
||||
const gchar *stock_id,
|
||||
const gchar *desc,
|
||||
GimpHelpFunc help_func,
|
||||
gpointer help_data);
|
||||
InfoDialog *info_dialog_notebook_new (gchar *title,
|
||||
InfoDialog *info_dialog_notebook_new (GimpViewable *viewable,
|
||||
const gchar *title,
|
||||
const gchar *wmclass_name,
|
||||
const gchar *stock_id,
|
||||
const gchar *desc,
|
||||
GimpHelpFunc help_func,
|
||||
gpointer help_data);
|
||||
void info_dialog_free (InfoDialog *idialog);
|
||||
|
@ -322,7 +322,10 @@ info_window_create (GimpDisplay *gdisp)
|
||||
type = gimp_image_base_type (gdisp->gimage);
|
||||
|
||||
title = info_window_title (gdisp);
|
||||
info_win = info_dialog_notebook_new (title,
|
||||
info_win = info_dialog_notebook_new (GIMP_VIEWABLE (gdisp->gimage),
|
||||
title, "image_info",
|
||||
GIMP_STOCK_INFO,
|
||||
_("Image Information"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/info_window.html");
|
||||
g_free (title);
|
||||
|
@ -32,6 +32,8 @@
|
||||
#include "core/gimplayermask.h"
|
||||
#include "core/gimpimage.h"
|
||||
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
|
||||
#include "offset-dialog.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
@ -79,6 +81,8 @@ offset_dialog_create (GimpDrawable *drawable)
|
||||
GtkWidget *radio_button;
|
||||
const gchar *title = NULL;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
|
||||
|
||||
off_d = g_new0 (OffsetDialog, 1);
|
||||
|
||||
off_d->wrap_around = TRUE;
|
||||
@ -94,19 +98,21 @@ offset_dialog_create (GimpDrawable *drawable)
|
||||
else
|
||||
g_warning ("%s: unexpected drawable type", G_STRLOC);
|
||||
|
||||
off_d->dlg = gimp_dialog_new (title, "offset",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/offset.html",
|
||||
GTK_WIN_POS_NONE,
|
||||
FALSE, TRUE, FALSE,
|
||||
off_d->dlg =
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (drawable),
|
||||
_("Offset"), "offset",
|
||||
GIMP_STOCK_TOOL_MOVE,
|
||||
title,
|
||||
gimp_standard_help_func,
|
||||
"dialogs/offset.html",
|
||||
|
||||
GTK_STOCK_CANCEL, offset_cancel_callback,
|
||||
off_d, NULL, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL, offset_cancel_callback,
|
||||
off_d, NULL, NULL, FALSE, TRUE,
|
||||
|
||||
GTK_STOCK_OK, offset_ok_callback,
|
||||
off_d, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, offset_ok_callback,
|
||||
off_d, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
/* The vbox for first column of options */
|
||||
vbox = gtk_vbox_new (FALSE, 2);
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "core/gimplayer.h"
|
||||
|
||||
#include "widgets/gimpenummenu.h"
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
|
||||
#include "resize-dialog.h"
|
||||
|
||||
@ -167,11 +168,14 @@ resize_widget_new (GimpImage *gimage,
|
||||
{
|
||||
const gchar *wmclass = NULL;
|
||||
const gchar *window_title = NULL;
|
||||
const gchar *stock_id = NULL;
|
||||
gchar *help_page = NULL;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case ScaleWidget:
|
||||
stock_id = GIMP_STOCK_SCALE;
|
||||
|
||||
switch (target)
|
||||
{
|
||||
case ResizeLayer:
|
||||
@ -190,6 +194,8 @@ resize_widget_new (GimpImage *gimage,
|
||||
break;
|
||||
|
||||
case ResizeWidget:
|
||||
stock_id = GIMP_STOCK_RESIZE;
|
||||
|
||||
switch (target)
|
||||
{
|
||||
case ResizeLayer:
|
||||
@ -208,24 +214,25 @@ resize_widget_new (GimpImage *gimage,
|
||||
}
|
||||
|
||||
resize->resize_shell =
|
||||
gimp_dialog_new (window_title, wmclass,
|
||||
gimp_standard_help_func, help_page,
|
||||
GTK_WIN_POS_MOUSE,
|
||||
FALSE, FALSE, TRUE,
|
||||
gimp_viewable_dialog_new (GIMP_IS_VIEWABLE (object) ?
|
||||
GIMP_VIEWABLE (object) : GIMP_VIEWABLE (gimage),
|
||||
window_title, wmclass,
|
||||
stock_id, window_title,
|
||||
gimp_standard_help_func, help_page,
|
||||
|
||||
GTK_STOCK_CANCEL,
|
||||
cancel_cb ? cancel_cb : G_CALLBACK (gtk_widget_destroy),
|
||||
cancel_cb ? user_data : NULL,
|
||||
cancel_cb ? NULL : (gpointer) 1,
|
||||
NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL,
|
||||
cancel_cb ? cancel_cb : G_CALLBACK (gtk_widget_destroy),
|
||||
cancel_cb ? user_data : NULL,
|
||||
cancel_cb ? NULL : (gpointer) 1,
|
||||
NULL, FALSE, TRUE,
|
||||
|
||||
GIMP_STOCK_RESET, reset_callback,
|
||||
resize, NULL, NULL, FALSE, FALSE,
|
||||
GIMP_STOCK_RESET, reset_callback,
|
||||
resize, NULL, NULL, FALSE, FALSE,
|
||||
|
||||
GTK_STOCK_OK, ok_cb,
|
||||
user_data, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, ok_cb,
|
||||
user_data, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (resize->resize_shell),
|
||||
(GWeakNotify) g_free,
|
||||
|
@ -37,6 +37,7 @@
|
||||
|
||||
#include "widgets/gimpcolorpanel.h"
|
||||
#include "widgets/gimpitemfactory.h"
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
#include "channels-commands.h"
|
||||
@ -293,19 +294,20 @@ channels_new_channel_query (GimpImage *gimage,
|
||||
|
||||
/* The dialog */
|
||||
options->query_box =
|
||||
gimp_dialog_new (_("New Channel Options"), "new_channel_options",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/channels/new_channel.html",
|
||||
GTK_WIN_POS_MOUSE,
|
||||
FALSE, TRUE, FALSE,
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
|
||||
_("New Channel"), "new_channel_options",
|
||||
GTK_STOCK_NEW,
|
||||
_("New Channel Options"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/channels/new_channel.html",
|
||||
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
|
||||
GTK_STOCK_OK, new_channel_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, new_channel_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (options->query_box),
|
||||
(GWeakNotify) g_free,
|
||||
@ -441,19 +443,20 @@ channels_edit_channel_query (GimpChannel *channel)
|
||||
|
||||
/* The dialog */
|
||||
options->query_box =
|
||||
gimp_dialog_new (_("Edit Channel Attributes"), "edit_channel_attributes",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/channels/edit_channel_attributes.html",
|
||||
GTK_WIN_POS_MOUSE,
|
||||
FALSE, TRUE, FALSE,
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (channel),
|
||||
_("Channel Attributes"), "edit_channel_attributes",
|
||||
GIMP_STOCK_EDIT,
|
||||
_("Edit Channel Attributes"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/channels/edit_channel_attributes.html",
|
||||
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
|
||||
GTK_STOCK_OK, edit_channel_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, edit_channel_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (options->query_box),
|
||||
(GWeakNotify) g_free,
|
||||
|
@ -83,6 +83,8 @@ static GimpConvertPaletteType spalette_type = GIMP_MAKE_PALETTE;
|
||||
void
|
||||
convert_to_rgb (GimpImage *gimage)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_IMAGE (gimage));
|
||||
|
||||
gimp_image_convert (gimage, GIMP_RGB, 0, 0, 0, 0, 0, NULL);
|
||||
gimp_image_flush (gimage);
|
||||
}
|
||||
@ -90,6 +92,8 @@ convert_to_rgb (GimpImage *gimage)
|
||||
void
|
||||
convert_to_grayscale (GimpImage* gimage)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_IMAGE (gimage));
|
||||
|
||||
gimp_image_convert (gimage, GIMP_GRAY, 0, 0, 0, 0, 0, NULL);
|
||||
gimp_image_flush (gimage);
|
||||
}
|
||||
@ -108,6 +112,8 @@ convert_to_indexed (GimpImage *gimage)
|
||||
GtkWidget *toggle;
|
||||
GSList *group = NULL;
|
||||
|
||||
g_return_if_fail (GIMP_IS_IMAGE (gimage));
|
||||
|
||||
dialog = g_new0 (IndexedDialog, 1);
|
||||
|
||||
dialog->gimage = gimage;
|
||||
@ -120,19 +126,21 @@ convert_to_indexed (GimpImage *gimage)
|
||||
dialog->palette_type = spalette_type;
|
||||
|
||||
dialog->shell =
|
||||
gimp_dialog_new (_("Indexed Color Conversion"), "indexed_color_conversion",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/convert_to_indexed.html",
|
||||
GTK_WIN_POS_NONE,
|
||||
FALSE, FALSE, TRUE,
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
|
||||
_("Indexed Color Conversion"),
|
||||
"indexed_color_conversion",
|
||||
GIMP_STOCK_CONVERT_INDEXED,
|
||||
_("Convert Image to Indexed Colors"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/convert_to_indexed.html",
|
||||
|
||||
GTK_STOCK_CANCEL, indexed_cancel_callback,
|
||||
dialog, NULL, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL, indexed_cancel_callback,
|
||||
dialog, NULL, NULL, FALSE, TRUE,
|
||||
|
||||
GTK_STOCK_OK, indexed_ok_callback,
|
||||
dialog, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, indexed_ok_callback,
|
||||
dialog, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
main_vbox = gtk_vbox_new (FALSE, 2);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 4);
|
||||
|
@ -535,7 +535,6 @@ gradient_editor_replicate_cmd_callback (GtkWidget *widget,
|
||||
if (! editor)
|
||||
return;
|
||||
|
||||
/* Create dialog window */
|
||||
dialog =
|
||||
gimp_dialog_new ((editor->control_sel_l == editor->control_sel_r) ?
|
||||
_("Replicate segment") :
|
||||
@ -584,7 +583,6 @@ gradient_editor_replicate_cmd_callback (GtkWidget *widget,
|
||||
G_CALLBACK (gimp_int_adjustment_update),
|
||||
&editor->replicate_times);
|
||||
|
||||
/* Show! */
|
||||
gtk_widget_show (dialog);
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (editor), FALSE);
|
||||
}
|
||||
|
@ -34,6 +34,8 @@
|
||||
#include "core/gimpimage-resize.h"
|
||||
#include "core/gimpimage-scale.h"
|
||||
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
|
||||
#include "display/gimpdisplay.h"
|
||||
#include "display/gimpdisplayshell.h"
|
||||
#include "display/gimpprogress.h"
|
||||
@ -286,19 +288,20 @@ image_layers_merge_query (GimpImage *gimage,
|
||||
|
||||
/* The dialog */
|
||||
options->query_box =
|
||||
gimp_dialog_new (_("Layers Merge Options"), "layers_merge_options",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/layers/merge_visible_layers.html",
|
||||
GTK_WIN_POS_MOUSE,
|
||||
FALSE, TRUE, FALSE,
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
|
||||
_("Merge Layers"), "layers_merge_options",
|
||||
GIMP_STOCK_MERGE_DOWN,
|
||||
_("Layers Merge Options"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/layers/merge_visible_layers.html",
|
||||
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
|
||||
GTK_STOCK_OK, image_layers_merge_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, image_layers_merge_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (options->query_box),
|
||||
(GWeakNotify) g_free,
|
||||
|
@ -26,6 +26,8 @@
|
||||
|
||||
#include "gui-types.h"
|
||||
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
|
||||
#include "info-dialog.h"
|
||||
|
||||
#include "gimprc.h"
|
||||
@ -158,7 +160,11 @@ info_dialog_delete_callback (GtkWidget *widget,
|
||||
}
|
||||
|
||||
static InfoDialog *
|
||||
info_dialog_new_extended (gchar *title,
|
||||
info_dialog_new_extended (GimpViewable *viewable,
|
||||
const gchar *title,
|
||||
const gchar *wmclass_name,
|
||||
const gchar *stock_id,
|
||||
const gchar *desc,
|
||||
GimpHelpFunc help_func,
|
||||
gpointer help_data,
|
||||
gboolean in_notebook)
|
||||
@ -173,9 +179,11 @@ info_dialog_new_extended (gchar *title,
|
||||
idialog->field_list = NULL;
|
||||
idialog->nfields = 0;
|
||||
|
||||
shell = g_object_new (GIMP_TYPE_DIALOG, NULL);
|
||||
gtk_window_set_wmclass (GTK_WINDOW (shell), "info_dialog", "Gimp");
|
||||
gtk_window_set_title (GTK_WINDOW (shell), title);
|
||||
shell = gimp_viewable_dialog_new (viewable,
|
||||
title, wmclass_name,
|
||||
stock_id, desc,
|
||||
help_func, help_data,
|
||||
NULL);
|
||||
|
||||
g_signal_connect (G_OBJECT (shell), "delete_event",
|
||||
G_CALLBACK (info_dialog_delete_callback),
|
||||
@ -213,28 +221,37 @@ info_dialog_new_extended (gchar *title,
|
||||
gtk_widget_show (idialog->info_table);
|
||||
gtk_widget_show (idialog->vbox);
|
||||
|
||||
/* Connect the "F1" help key */
|
||||
gimp_help_connect (idialog->shell, help_func, help_data);
|
||||
|
||||
return idialog;
|
||||
}
|
||||
|
||||
/* public functions */
|
||||
|
||||
InfoDialog *
|
||||
info_dialog_notebook_new (gchar *title,
|
||||
GimpHelpFunc help_func,
|
||||
info_dialog_notebook_new (GimpViewable *viewable,
|
||||
const gchar *title,
|
||||
const gchar *wmclass_name,
|
||||
const gchar *stock_id,
|
||||
const gchar *desc,
|
||||
GimpHelpFunc help_func,
|
||||
gpointer help_data)
|
||||
{
|
||||
return info_dialog_new_extended (title, help_func, help_data, TRUE);
|
||||
return info_dialog_new_extended (viewable, title, wmclass_name,
|
||||
stock_id, desc,
|
||||
help_func, help_data, TRUE);
|
||||
}
|
||||
|
||||
InfoDialog *
|
||||
info_dialog_new (gchar *title,
|
||||
info_dialog_new (GimpViewable *viewable,
|
||||
const gchar *title,
|
||||
const gchar *wmclass_name,
|
||||
const gchar *stock_id,
|
||||
const gchar *desc,
|
||||
GimpHelpFunc help_func,
|
||||
gpointer help_data)
|
||||
{
|
||||
return info_dialog_new_extended (title, help_func, help_data, FALSE);
|
||||
return info_dialog_new_extended (viewable, title, wmclass_name,
|
||||
stock_id, desc,
|
||||
help_func, help_data, FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -57,10 +57,18 @@ struct _InfoDialog
|
||||
|
||||
/* Info Dialog functions */
|
||||
|
||||
InfoDialog *info_dialog_new (gchar *title,
|
||||
InfoDialog *info_dialog_new (GimpViewable *viewable,
|
||||
const gchar *title,
|
||||
const gchar *wmclass_name,
|
||||
const gchar *stock_id,
|
||||
const gchar *desc,
|
||||
GimpHelpFunc help_func,
|
||||
gpointer help_data);
|
||||
InfoDialog *info_dialog_notebook_new (gchar *title,
|
||||
InfoDialog *info_dialog_notebook_new (GimpViewable *viewable,
|
||||
const gchar *title,
|
||||
const gchar *wmclass_name,
|
||||
const gchar *stock_id,
|
||||
const gchar *desc,
|
||||
GimpHelpFunc help_func,
|
||||
gpointer help_data);
|
||||
void info_dialog_free (InfoDialog *idialog);
|
||||
|
@ -322,7 +322,10 @@ info_window_create (GimpDisplay *gdisp)
|
||||
type = gimp_image_base_type (gdisp->gimage);
|
||||
|
||||
title = info_window_title (gdisp);
|
||||
info_win = info_dialog_notebook_new (title,
|
||||
info_win = info_dialog_notebook_new (GIMP_VIEWABLE (gdisp->gimage),
|
||||
title, "image_info",
|
||||
GIMP_STOCK_INFO,
|
||||
_("Image Information"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/info_window.html");
|
||||
g_free (title);
|
||||
|
@ -42,6 +42,7 @@
|
||||
|
||||
#include "widgets/gimpenummenu.h"
|
||||
#include "widgets/gimpitemfactory.h"
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
#include "layers-commands.h"
|
||||
@ -577,19 +578,20 @@ layers_new_layer_query (GimpImage *gimage,
|
||||
|
||||
/* The dialog */
|
||||
options->query_box =
|
||||
gimp_dialog_new (_("New Layer Options"), "new_layer_options",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/layers/new_layer.html",
|
||||
GTK_WIN_POS_MOUSE,
|
||||
FALSE, TRUE, FALSE,
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
|
||||
_("New Layer"), "new_layer_options",
|
||||
GTK_STOCK_NEW,
|
||||
_("New Layer Options"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/layers/new_layer.html",
|
||||
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
|
||||
GTK_STOCK_OK, new_layer_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, new_layer_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (options->query_box),
|
||||
(GWeakNotify) g_free,
|
||||
@ -766,19 +768,21 @@ layers_edit_layer_query (GimpLayer *layer)
|
||||
|
||||
/* The dialog */
|
||||
options->query_box =
|
||||
gimp_dialog_new (_("Edit Layer Attributes"), "edit_layer_attributes",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/layers/edit_layer_attributes.html",
|
||||
GTK_WIN_POS_MOUSE,
|
||||
FALSE, TRUE, FALSE,
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (layer),
|
||||
_("Layer Attributes"),
|
||||
"edit_layer_attributes",
|
||||
GIMP_STOCK_EDIT,
|
||||
_("Edit Layer Attributes"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/layers/edit_layer_attributes.html",
|
||||
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
|
||||
GTK_STOCK_OK, edit_layer_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, edit_layer_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (options->query_box),
|
||||
(GWeakNotify) g_free,
|
||||
@ -871,19 +875,20 @@ layers_add_mask_query (GimpLayer *layer)
|
||||
|
||||
/* The dialog */
|
||||
options->query_box =
|
||||
gimp_dialog_new (_("Add Mask Options"), "add_mask_options",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/layers/add_layer_mask.html",
|
||||
GTK_WIN_POS_MOUSE,
|
||||
FALSE, TRUE, FALSE,
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (layer),
|
||||
_("Add Mask"), "add_mask_options",
|
||||
GTK_STOCK_ADD,
|
||||
_("Add Layer Mask Options"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/layers/add_layer_mask.html",
|
||||
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
|
||||
GTK_STOCK_OK, add_mask_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, add_mask_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (options->query_box),
|
||||
(GWeakNotify) g_free,
|
||||
|
@ -32,6 +32,8 @@
|
||||
#include "core/gimplayermask.h"
|
||||
#include "core/gimpimage.h"
|
||||
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
|
||||
#include "offset-dialog.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
@ -79,6 +81,8 @@ offset_dialog_create (GimpDrawable *drawable)
|
||||
GtkWidget *radio_button;
|
||||
const gchar *title = NULL;
|
||||
|
||||
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
|
||||
|
||||
off_d = g_new0 (OffsetDialog, 1);
|
||||
|
||||
off_d->wrap_around = TRUE;
|
||||
@ -94,19 +98,21 @@ offset_dialog_create (GimpDrawable *drawable)
|
||||
else
|
||||
g_warning ("%s: unexpected drawable type", G_STRLOC);
|
||||
|
||||
off_d->dlg = gimp_dialog_new (title, "offset",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/offset.html",
|
||||
GTK_WIN_POS_NONE,
|
||||
FALSE, TRUE, FALSE,
|
||||
off_d->dlg =
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (drawable),
|
||||
_("Offset"), "offset",
|
||||
GIMP_STOCK_TOOL_MOVE,
|
||||
title,
|
||||
gimp_standard_help_func,
|
||||
"dialogs/offset.html",
|
||||
|
||||
GTK_STOCK_CANCEL, offset_cancel_callback,
|
||||
off_d, NULL, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL, offset_cancel_callback,
|
||||
off_d, NULL, NULL, FALSE, TRUE,
|
||||
|
||||
GTK_STOCK_OK, offset_ok_callback,
|
||||
off_d, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, offset_ok_callback,
|
||||
off_d, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
/* The vbox for first column of options */
|
||||
vbox = gtk_vbox_new (FALSE, 2);
|
||||
|
@ -31,6 +31,7 @@
|
||||
|
||||
#include "widgets/gimpcolorpanel.h"
|
||||
#include "widgets/gimpitemfactory.h"
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
#include "display/gimpdisplay.h"
|
||||
@ -173,19 +174,20 @@ qmask_channel_query (GimpDisplayShell *shell)
|
||||
|
||||
/* The dialog */
|
||||
options->query_box =
|
||||
gimp_dialog_new (_("Edit Qmask Attributes"), "edit_qmask_attributes",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/edit_qmask_attributes.html",
|
||||
GTK_WIN_POS_MOUSE,
|
||||
FALSE, TRUE, FALSE,
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (shell->gdisp->gimage),
|
||||
_("Qmask Attributes"), "edit_qmask_attributes",
|
||||
GIMP_STOCK_QMASK_ON,
|
||||
_("Edit QuickMask Attributes"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/edit_qmask_attributes.html",
|
||||
|
||||
GTK_STOCK_CANCEL, qmask_query_cancel_callback,
|
||||
options, NULL, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL, qmask_query_cancel_callback,
|
||||
options, NULL, NULL, FALSE, TRUE,
|
||||
|
||||
GTK_STOCK_OK, qmask_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, qmask_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
/* The main hbox */
|
||||
hbox = gtk_hbox_new (FALSE, 4);
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "core/gimplayer.h"
|
||||
|
||||
#include "widgets/gimpenummenu.h"
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
|
||||
#include "resize-dialog.h"
|
||||
|
||||
@ -167,11 +168,14 @@ resize_widget_new (GimpImage *gimage,
|
||||
{
|
||||
const gchar *wmclass = NULL;
|
||||
const gchar *window_title = NULL;
|
||||
const gchar *stock_id = NULL;
|
||||
gchar *help_page = NULL;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case ScaleWidget:
|
||||
stock_id = GIMP_STOCK_SCALE;
|
||||
|
||||
switch (target)
|
||||
{
|
||||
case ResizeLayer:
|
||||
@ -190,6 +194,8 @@ resize_widget_new (GimpImage *gimage,
|
||||
break;
|
||||
|
||||
case ResizeWidget:
|
||||
stock_id = GIMP_STOCK_RESIZE;
|
||||
|
||||
switch (target)
|
||||
{
|
||||
case ResizeLayer:
|
||||
@ -208,24 +214,25 @@ resize_widget_new (GimpImage *gimage,
|
||||
}
|
||||
|
||||
resize->resize_shell =
|
||||
gimp_dialog_new (window_title, wmclass,
|
||||
gimp_standard_help_func, help_page,
|
||||
GTK_WIN_POS_MOUSE,
|
||||
FALSE, FALSE, TRUE,
|
||||
gimp_viewable_dialog_new (GIMP_IS_VIEWABLE (object) ?
|
||||
GIMP_VIEWABLE (object) : GIMP_VIEWABLE (gimage),
|
||||
window_title, wmclass,
|
||||
stock_id, window_title,
|
||||
gimp_standard_help_func, help_page,
|
||||
|
||||
GTK_STOCK_CANCEL,
|
||||
cancel_cb ? cancel_cb : G_CALLBACK (gtk_widget_destroy),
|
||||
cancel_cb ? user_data : NULL,
|
||||
cancel_cb ? NULL : (gpointer) 1,
|
||||
NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL,
|
||||
cancel_cb ? cancel_cb : G_CALLBACK (gtk_widget_destroy),
|
||||
cancel_cb ? user_data : NULL,
|
||||
cancel_cb ? NULL : (gpointer) 1,
|
||||
NULL, FALSE, TRUE,
|
||||
|
||||
GIMP_STOCK_RESET, reset_callback,
|
||||
resize, NULL, NULL, FALSE, FALSE,
|
||||
GIMP_STOCK_RESET, reset_callback,
|
||||
resize, NULL, NULL, FALSE, FALSE,
|
||||
|
||||
GTK_STOCK_OK, ok_cb,
|
||||
user_data, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, ok_cb,
|
||||
user_data, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (resize->resize_shell),
|
||||
(GWeakNotify) g_free,
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include "vectors/gimpvectors.h"
|
||||
|
||||
#include "widgets/gimpitemfactory.h"
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
#include "tools/gimppainttool.h"
|
||||
@ -435,19 +436,20 @@ vectors_new_vectors_query (GimpImage *gimage,
|
||||
|
||||
/* The dialog */
|
||||
options->query_box =
|
||||
gimp_dialog_new (_("New Path Options"), "new_path_options",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/vectors/new_vectors.html",
|
||||
GTK_WIN_POS_MOUSE,
|
||||
FALSE, TRUE, FALSE,
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage),
|
||||
_("New Path"), "new_path_options",
|
||||
GTK_STOCK_NEW,
|
||||
_("New Path Options"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/vectors/new_vectors.html",
|
||||
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
|
||||
GTK_STOCK_OK, new_vectors_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, new_vectors_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (options->query_box),
|
||||
(GWeakNotify) g_free,
|
||||
@ -550,19 +552,20 @@ vectors_edit_vectors_query (GimpVectors *vectors)
|
||||
|
||||
/* The dialog */
|
||||
options->query_box =
|
||||
gimp_dialog_new (_("Edit Path Attributes"), "edit_path_attributes",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/paths/edit_path_attributes.html",
|
||||
GTK_WIN_POS_MOUSE,
|
||||
FALSE, TRUE, FALSE,
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (vectors),
|
||||
_("Path Attributes"), "edit_path_attributes",
|
||||
GIMP_STOCK_EDIT,
|
||||
_("Edit Path Attributes"),
|
||||
gimp_standard_help_func,
|
||||
"dialogs/paths/edit_path_attributes.html",
|
||||
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL, gtk_widget_destroy,
|
||||
NULL, 1, NULL, FALSE, TRUE,
|
||||
|
||||
GTK_STOCK_OK, edit_vectors_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK, edit_vectors_query_ok_callback,
|
||||
options, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (options->query_box),
|
||||
(GWeakNotify) g_free,
|
||||
|
@ -41,6 +41,7 @@
|
||||
|
||||
#include "widgets/gimppaletteeditor.h"
|
||||
#include "widgets/gimptoolbox-color-area.h"
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
|
||||
#include "gui/info-dialog.h"
|
||||
|
||||
@ -269,9 +270,12 @@ gimp_color_picker_tool_button_press (GimpTool *tool,
|
||||
GtkWidget *frame;
|
||||
GimpRGB color;
|
||||
|
||||
gimp_color_picker_tool_info = info_dialog_new (_("Color Picker"),
|
||||
tool_manager_help_func,
|
||||
NULL);
|
||||
gimp_color_picker_tool_info =
|
||||
info_dialog_new (NULL,
|
||||
_("Color Picker"), "color_picker",
|
||||
GIMP_STOCK_TOOL_COLOR_PICKER,
|
||||
_("Color Picker Information"),
|
||||
tool_manager_help_func, NULL);
|
||||
|
||||
/* if the gdisplay is for a color image, the dialog must have RGB */
|
||||
switch (GIMP_IMAGE_TYPE_BASE_TYPE (gimp_drawable_type (tool->drawable)))
|
||||
@ -352,6 +356,9 @@ gimp_color_picker_tool_button_press (GimpTool *tool,
|
||||
NULL);
|
||||
}
|
||||
|
||||
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (gimp_color_picker_tool_info->shell),
|
||||
GIMP_VIEWABLE (gimp_image_active_drawable (gdisp->gimage)));
|
||||
|
||||
/* Keep the coordinates of the target */
|
||||
gimp_drawable_offsets (gimp_image_active_drawable (gdisp->gimage),
|
||||
&off_x, &off_y);
|
||||
|
@ -45,6 +45,7 @@
|
||||
#include "gui/info-dialog.h"
|
||||
|
||||
#include "widgets/gimpenummenu.h"
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
|
||||
#include "gimpcroptool.h"
|
||||
#include "tool_manager.h"
|
||||
@ -888,6 +889,9 @@ crop_start (GimpTool *tool,
|
||||
if (! crop_info)
|
||||
crop_info_create (tool);
|
||||
|
||||
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (crop_info->shell),
|
||||
GIMP_VIEWABLE (tool->gdisp->gimage));
|
||||
|
||||
g_signal_handlers_block_by_func (G_OBJECT (origin_sizeentry),
|
||||
crop_origin_changed,
|
||||
crop_info);
|
||||
@ -968,7 +972,10 @@ crop_info_create (GimpTool *tool)
|
||||
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
|
||||
/* create the info dialog */
|
||||
crop_info = info_dialog_new (_("Crop & Resize Information"),
|
||||
crop_info = info_dialog_new (NULL,
|
||||
_("Crop & Resize"), "crop",
|
||||
GIMP_STOCK_TOOL_CROP,
|
||||
_("Crop & Resize Information"),
|
||||
tool_manager_help_func, NULL);
|
||||
|
||||
/* create the action area */
|
||||
|
@ -38,6 +38,7 @@
|
||||
|
||||
#include "widgets/gimpenummenu.h"
|
||||
#include "widgets/gimphistogramview.h"
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
|
||||
#include "display/gimpdisplay.h"
|
||||
|
||||
@ -184,7 +185,8 @@ static void
|
||||
gimp_histogram_tool_initialize (GimpTool *tool,
|
||||
GimpDisplay *gdisp)
|
||||
{
|
||||
PixelRegion PR;
|
||||
GimpDrawable *drawable;
|
||||
PixelRegion PR;
|
||||
|
||||
if (gimp_drawable_is_indexed (gimp_image_active_drawable (gdisp->gimage)))
|
||||
{
|
||||
@ -196,10 +198,15 @@ gimp_histogram_tool_initialize (GimpTool *tool,
|
||||
if (! histogram_dialog)
|
||||
histogram_dialog = histogram_tool_dialog_new ();
|
||||
|
||||
drawable = gimp_image_active_drawable (gdisp->gimage);
|
||||
|
||||
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (histogram_dialog->shell),
|
||||
GIMP_VIEWABLE (drawable));
|
||||
|
||||
gtk_widget_show (histogram_dialog->shell);
|
||||
|
||||
histogram_dialog->drawable = gimp_image_active_drawable (gdisp->gimage);
|
||||
histogram_dialog->color = gimp_drawable_is_rgb (histogram_dialog->drawable);
|
||||
histogram_dialog->drawable = drawable;
|
||||
histogram_dialog->color = gimp_drawable_is_rgb (drawable);
|
||||
|
||||
gimp_option_menu_set_sensitive (GTK_OPTION_MENU (histogram_dialog->channel_menu),
|
||||
(GimpOptionMenuSensitivityCallback) histogram_set_sensitive_callback,
|
||||
@ -208,10 +215,10 @@ gimp_histogram_tool_initialize (GimpTool *tool,
|
||||
GINT_TO_POINTER (histogram_dialog->channel));
|
||||
|
||||
/* calculate the histogram */
|
||||
pixel_region_init (&PR, gimp_drawable_data (histogram_dialog->drawable),
|
||||
pixel_region_init (&PR, gimp_drawable_data (drawable),
|
||||
0, 0,
|
||||
gimp_drawable_width (histogram_dialog->drawable),
|
||||
gimp_drawable_height (histogram_dialog->drawable),
|
||||
gimp_drawable_width (drawable),
|
||||
gimp_drawable_height (drawable),
|
||||
FALSE);
|
||||
gimp_histogram_calculate (histogram_dialog->hist, &PR, NULL);
|
||||
|
||||
@ -352,15 +359,18 @@ histogram_tool_dialog_new (void)
|
||||
htd->hist = gimp_histogram_new ();
|
||||
|
||||
/* The shell and main vbox */
|
||||
htd->shell = gimp_dialog_new (_("Histogram"), "histogram",
|
||||
tool_manager_help_func, NULL,
|
||||
GTK_WIN_POS_NONE,
|
||||
FALSE, TRUE, FALSE,
|
||||
htd->shell =
|
||||
gimp_viewable_dialog_new (NULL,
|
||||
_("Histogram"),
|
||||
"histogram",
|
||||
GIMP_STOCK_TOOL_HISTOGRAM,
|
||||
_("View Image Histogram"),
|
||||
tool_manager_help_func, NULL,
|
||||
|
||||
GTK_STOCK_CLOSE, histogram_tool_close_callback,
|
||||
htd, NULL, NULL, TRUE, TRUE,
|
||||
GTK_STOCK_CLOSE, histogram_tool_close_callback,
|
||||
htd, NULL, NULL, TRUE, TRUE,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
hbox = gtk_hbox_new (TRUE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (htd->shell)->vbox), hbox);
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
#include "file/file-utils.h"
|
||||
|
||||
#include "widgets/gimppreview.h"
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
|
||||
#include "display/gimpdisplay.h"
|
||||
#include "display/gimpdisplayshell.h"
|
||||
@ -185,8 +185,6 @@ gimp_image_map_tool_initialize (GimpTool *tool,
|
||||
{
|
||||
GimpImageMapTool *image_map_tool;
|
||||
GimpDrawable *drawable;
|
||||
gchar *basename;
|
||||
gchar *str;
|
||||
|
||||
image_map_tool = GIMP_IMAGE_MAP_TOOL (tool);
|
||||
|
||||
@ -201,67 +199,31 @@ gimp_image_map_tool_initialize (GimpTool *tool,
|
||||
if (! image_map_tool->shell)
|
||||
{
|
||||
GtkWidget *shell;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *image;
|
||||
GtkWidget *preview;
|
||||
GtkWidget *label;
|
||||
GtkWidget *toggle;
|
||||
|
||||
image_map_tool->shell = shell =
|
||||
gimp_dialog_new (image_map_tool->shell_title,
|
||||
image_map_tool->shell_name,
|
||||
tool_manager_help_func, NULL,
|
||||
GTK_WIN_POS_NONE,
|
||||
FALSE, TRUE, FALSE,
|
||||
gimp_viewable_dialog_new (NULL,
|
||||
image_map_tool->shell_title,
|
||||
image_map_tool->shell_name,
|
||||
image_map_tool->stock_id,
|
||||
image_map_tool->shell_desc,
|
||||
tool_manager_help_func, NULL,
|
||||
|
||||
GTK_STOCK_CANCEL, gimp_image_map_tool_cancel_clicked,
|
||||
image_map_tool, NULL, NULL, FALSE, TRUE,
|
||||
GTK_STOCK_CANCEL,
|
||||
gimp_image_map_tool_cancel_clicked,
|
||||
image_map_tool, NULL, NULL, FALSE, TRUE,
|
||||
|
||||
GIMP_STOCK_RESET, gimp_image_map_tool_reset_clicked,
|
||||
image_map_tool, NULL, NULL, TRUE, FALSE,
|
||||
GIMP_STOCK_RESET,
|
||||
gimp_image_map_tool_reset_clicked,
|
||||
image_map_tool, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
GTK_STOCK_OK, gimp_image_map_tool_ok_clicked,
|
||||
image_map_tool, NULL, NULL, TRUE, FALSE,
|
||||
GTK_STOCK_OK,
|
||||
gimp_image_map_tool_ok_clicked,
|
||||
image_map_tool, NULL, NULL, TRUE, FALSE,
|
||||
|
||||
NULL);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (shell)->vbox), frame,
|
||||
FALSE, FALSE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 4);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), 2);
|
||||
gtk_container_add (GTK_CONTAINER (frame), hbox);
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
image = gtk_image_new_from_stock (image_map_tool->stock_id,
|
||||
GTK_ICON_SIZE_BUTTON);
|
||||
gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
|
||||
gtk_widget_show (image);
|
||||
|
||||
image_map_tool->title_preview = preview =
|
||||
gimp_preview_new_by_type (GIMP_TYPE_DRAWABLE, 32, 1, TRUE);
|
||||
gtk_box_pack_end (GTK_BOX (hbox), preview, FALSE, FALSE, 0);
|
||||
gtk_widget_show (preview);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 2);
|
||||
gtk_container_add (GTK_CONTAINER (hbox), vbox);
|
||||
gtk_widget_show (vbox);
|
||||
|
||||
label = gtk_label_new (image_map_tool->shell_desc);
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
|
||||
gtk_widget_show (label);
|
||||
|
||||
image_map_tool->title_label = label = gtk_label_new (NULL);
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
|
||||
gtk_box_pack_end (GTK_BOX (vbox), label, FALSE, FALSE, 0);
|
||||
gtk_widget_show (label);
|
||||
NULL);
|
||||
|
||||
image_map_tool->main_vbox = vbox = gtk_vbox_new (FALSE, 4);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
|
||||
@ -290,20 +252,8 @@ gimp_image_map_tool_initialize (GimpTool *tool,
|
||||
|
||||
drawable = gimp_image_active_drawable (gdisp->gimage);
|
||||
|
||||
basename =
|
||||
file_utils_uri_to_utf8_basename (gimp_image_get_uri (gdisp->gimage));
|
||||
|
||||
str = g_strdup_printf ("%s (%s)",
|
||||
basename,
|
||||
gimp_object_get_name (GIMP_OBJECT (drawable)));
|
||||
|
||||
g_free (basename);
|
||||
|
||||
gimp_preview_set_viewable (GIMP_PREVIEW (image_map_tool->title_preview),
|
||||
GIMP_VIEWABLE (drawable));
|
||||
gtk_label_set_text (GTK_LABEL (image_map_tool->title_label), str);
|
||||
|
||||
g_free (str);
|
||||
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (image_map_tool->shell),
|
||||
GIMP_VIEWABLE (drawable));
|
||||
|
||||
gtk_widget_show (image_map_tool->shell);
|
||||
|
||||
|
@ -50,8 +50,6 @@ struct _GimpImageMapTool
|
||||
const gchar *stock_id;
|
||||
|
||||
GtkWidget *shell;
|
||||
GtkWidget *title_preview;
|
||||
GtkWidget *title_label;
|
||||
GtkWidget *main_vbox;
|
||||
};
|
||||
|
||||
|
@ -40,6 +40,8 @@
|
||||
#include "core/gimpimage-guides.h"
|
||||
#include "core/gimptoolinfo.h"
|
||||
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
|
||||
#include "display/gimpdisplay.h"
|
||||
#include "display/gimpdisplayshell.h"
|
||||
|
||||
@ -377,7 +379,7 @@ gimp_measure_tool_button_press (GimpTool *tool,
|
||||
if (gimp_tool_control_is_active (tool->control))
|
||||
{
|
||||
gimp_tool_pop_status (tool);
|
||||
gimp_tool_push_status (tool, "");
|
||||
gimp_tool_push_status (tool, " ");
|
||||
}
|
||||
|
||||
/* start drawing the measure tool */
|
||||
@ -388,7 +390,10 @@ gimp_measure_tool_button_press (GimpTool *tool,
|
||||
if (! measure_tool_info && (options->use_info_window ||
|
||||
! GTK_WIDGET_VISIBLE (shell->statusbar)))
|
||||
{
|
||||
measure_tool_info = info_dialog_new (_("Measure Tool"),
|
||||
measure_tool_info = info_dialog_new (NULL,
|
||||
_("Measure Tool"), "measure",
|
||||
GIMP_STOCK_TOOL_MEASURE,
|
||||
_("Measure Tool Information"),
|
||||
tool_manager_help_func, NULL);
|
||||
info_dialog_add_label (measure_tool_info, _("Distance:"), distance_buf);
|
||||
info_dialog_add_label (measure_tool_info, _("Angle:"), angle_buf);
|
||||
@ -402,6 +407,10 @@ gimp_measure_tool_button_press (GimpTool *tool,
|
||||
NULL);
|
||||
}
|
||||
|
||||
if (measure_tool_info)
|
||||
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (measure_tool_info->shell),
|
||||
GIMP_VIEWABLE (tool->gdisp->gimage));
|
||||
|
||||
gimp_tool_control_activate (tool->control);
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,8 @@
|
||||
#include "core/gimpdrawable-transform-utils.h"
|
||||
#include "core/gimptoolinfo.h"
|
||||
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
|
||||
#include "display/gimpdisplay.h"
|
||||
|
||||
#include "gui/info-dialog.h"
|
||||
@ -147,7 +149,10 @@ gimp_perspective_tool_transform (GimpTransformTool *transform_tool,
|
||||
if (! transform_tool->info_dialog)
|
||||
{
|
||||
transform_tool->info_dialog =
|
||||
info_dialog_new (_("Perspective Transform Information"),
|
||||
info_dialog_new (NULL,
|
||||
_("Perspective Transform"), "perspective",
|
||||
GIMP_STOCK_TOOL_PERSPECTIVE,
|
||||
_("Perspective Transform Information"),
|
||||
gimp_standard_help_func,
|
||||
"tools/transform_perspective.html");
|
||||
|
||||
@ -162,6 +167,9 @@ gimp_perspective_tool_transform (GimpTransformTool *transform_tool,
|
||||
matrix_row_buf[2]);
|
||||
}
|
||||
|
||||
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (transform_tool->info_dialog->shell),
|
||||
GIMP_VIEWABLE (gimp_image_active_drawable (gdisp->gimage)));
|
||||
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (transform_tool->info_dialog->shell),
|
||||
TRUE);
|
||||
|
||||
|
@ -35,6 +35,8 @@
|
||||
#include "core/gimpdrawable-transform-utils.h"
|
||||
#include "core/gimptoolinfo.h"
|
||||
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
|
||||
#include "display/gimpdisplay.h"
|
||||
#include "display/gimpdisplayshell.h"
|
||||
|
||||
@ -176,7 +178,10 @@ gimp_rotate_tool_transform (GimpTransformTool *transform_tool,
|
||||
GtkWidget *spinbutton2;
|
||||
|
||||
transform_tool->info_dialog =
|
||||
info_dialog_new (_("Rotation Information"),
|
||||
info_dialog_new (NULL,
|
||||
_("Rotate"), "rotate",
|
||||
GIMP_STOCK_TOOL_ROTATE,
|
||||
_("Rotation Information"),
|
||||
gimp_standard_help_func,
|
||||
"tools/transform_rotate.html");
|
||||
|
||||
@ -222,6 +227,9 @@ gimp_rotate_tool_transform (GimpTransformTool *transform_tool,
|
||||
2, 0);
|
||||
}
|
||||
|
||||
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (transform_tool->info_dialog->shell),
|
||||
GIMP_VIEWABLE (gimp_image_active_drawable (gdisp->gimage)));
|
||||
|
||||
g_signal_handlers_block_by_func (G_OBJECT (sizeentry),
|
||||
rotate_center_changed,
|
||||
transform_tool);
|
||||
|
@ -36,6 +36,8 @@
|
||||
#include "core/gimpdrawable-transform-utils.h"
|
||||
#include "core/gimptoolinfo.h"
|
||||
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
|
||||
#include "display/gimpdisplay.h"
|
||||
#include "display/gimpdisplayshell.h"
|
||||
|
||||
@ -173,7 +175,10 @@ gimp_scale_tool_transform (GimpTransformTool *transform_tool,
|
||||
GtkWidget *spinbutton;
|
||||
|
||||
transform_tool->info_dialog =
|
||||
info_dialog_new (_("Scaling Information"),
|
||||
info_dialog_new (NULL,
|
||||
_("Scale"), "scale",
|
||||
GIMP_STOCK_TOOL_SCALE,
|
||||
_("Scaling Information"),
|
||||
gimp_standard_help_func,
|
||||
"tools/transform_scale.html");
|
||||
|
||||
@ -220,6 +225,9 @@ gimp_scale_tool_transform (GimpTransformTool *transform_tool,
|
||||
(GTK_TABLE (transform_tool->info_dialog->info_table), 2, 0);
|
||||
}
|
||||
|
||||
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (transform_tool->info_dialog->shell),
|
||||
GIMP_VIEWABLE (gimp_image_active_drawable (gdisp->gimage)));
|
||||
|
||||
g_signal_handlers_block_by_func (G_OBJECT (sizeentry),
|
||||
gimp_scale_tool_size_changed,
|
||||
transform_tool);
|
||||
|
@ -37,6 +37,8 @@
|
||||
#include "core/gimpdrawable-transform-utils.h"
|
||||
#include "core/gimptoolinfo.h"
|
||||
|
||||
#include "widgets/gimpviewabledialog.h"
|
||||
|
||||
#include "display/gimpdisplay.h"
|
||||
|
||||
#include "gui/info-dialog.h"
|
||||
@ -167,7 +169,10 @@ gimp_shear_tool_transform (GimpTransformTool *transform_tool,
|
||||
if (! transform_tool->info_dialog)
|
||||
{
|
||||
transform_tool->info_dialog =
|
||||
info_dialog_new (_("Shear Information"),
|
||||
info_dialog_new (NULL,
|
||||
_("Shear"), "shear",
|
||||
GIMP_STOCK_TOOL_SHEAR,
|
||||
_("Shearing Information"),
|
||||
gimp_standard_help_func,
|
||||
"tools/transform_shear.html");
|
||||
|
||||
@ -189,6 +194,9 @@ gimp_shear_tool_transform (GimpTransformTool *transform_tool,
|
||||
transform_tool);
|
||||
}
|
||||
|
||||
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (transform_tool->info_dialog->shell),
|
||||
GIMP_VIEWABLE (gimp_image_active_drawable (gdisp->gimage)));
|
||||
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (transform_tool->info_dialog->shell),
|
||||
TRUE);
|
||||
|
||||
|
@ -143,6 +143,8 @@ libappwidgets_a_sources = \
|
||||
gimptoolinfopreview.h \
|
||||
gimpvectorslistview.c \
|
||||
gimpvectorslistview.h \
|
||||
gimpviewabledialog.c \
|
||||
gimpviewabledialog.h \
|
||||
gimpwidgets-constructors.c \
|
||||
gimpwidgets-constructors.h \
|
||||
gimpwidgets-utils.c \
|
||||
|
230
app/widgets/gimpviewabledialog.c
Normal file
230
app/widgets/gimpviewabledialog.c
Normal file
@ -0,0 +1,230 @@
|
||||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* gimpviewabledialog.c
|
||||
* Copyright (C) 2000 Michael Natterer <mitch@gimp.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
|
||||
#include "widgets-types.h"
|
||||
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimpitem.h"
|
||||
|
||||
#include "file/file-utils.h"
|
||||
|
||||
#include "gimppreview.h"
|
||||
#include "gimpviewabledialog.h"
|
||||
|
||||
|
||||
static void gimp_viewable_dialog_class_init (GimpViewableDialogClass *klass);
|
||||
static void gimp_viewable_dialog_init (GimpViewableDialog *dialog);
|
||||
|
||||
|
||||
static GimpDialogClass *parent_class = NULL;
|
||||
|
||||
|
||||
GType
|
||||
gimp_viewable_dialog_get_type (void)
|
||||
{
|
||||
static GType dialog_type = 0;
|
||||
|
||||
if (! dialog_type)
|
||||
{
|
||||
static const GTypeInfo dialog_info =
|
||||
{
|
||||
sizeof (GimpViewableDialogClass),
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) gimp_viewable_dialog_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GimpViewableDialog),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gimp_viewable_dialog_init,
|
||||
};
|
||||
|
||||
dialog_type = g_type_register_static (GIMP_TYPE_DIALOG,
|
||||
"GimpViewableDialog",
|
||||
&dialog_info, 0);
|
||||
}
|
||||
|
||||
return dialog_type;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_viewable_dialog_class_init (GimpViewableDialogClass *klass)
|
||||
{
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_viewable_dialog_init (GimpViewableDialog *dialog)
|
||||
{
|
||||
GtkWidget *ebox;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *sep;
|
||||
|
||||
ebox = gtk_event_box_new ();
|
||||
gtk_widget_set_state (ebox, GTK_STATE_PRELIGHT);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), ebox,
|
||||
FALSE, FALSE, 0);
|
||||
gtk_widget_show (ebox);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
|
||||
gtk_container_add (GTK_CONTAINER (ebox), frame);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 4);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), 2);
|
||||
gtk_container_add (GTK_CONTAINER (frame), hbox);
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
dialog->icon = gtk_image_new ();
|
||||
gtk_misc_set_alignment (GTK_MISC (dialog->icon), 0.5, 0.0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), dialog->icon, FALSE, FALSE, 0);
|
||||
gtk_widget_show (dialog->icon);
|
||||
|
||||
sep = gtk_vseparator_new ();
|
||||
gtk_box_pack_start (GTK_BOX (hbox), sep, FALSE, FALSE, 0);
|
||||
gtk_widget_show (sep);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (hbox), vbox);
|
||||
gtk_widget_show (vbox);
|
||||
|
||||
dialog->desc_label = gtk_label_new (NULL);
|
||||
gtk_misc_set_alignment (GTK_MISC (dialog->desc_label), 0.0, 0.5);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), dialog->desc_label, FALSE, FALSE, 0);
|
||||
gtk_widget_show (dialog->desc_label);
|
||||
|
||||
dialog->viewable_label = gtk_label_new (NULL);
|
||||
gtk_misc_set_alignment (GTK_MISC (dialog->viewable_label), 0.0, 0.5);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), dialog->viewable_label, FALSE, FALSE, 0);
|
||||
gtk_widget_show (dialog->viewable_label);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gimp_viewable_dialog_new (GimpViewable *viewable,
|
||||
const gchar *title,
|
||||
const gchar *wmclass_name,
|
||||
const gchar *stock_id,
|
||||
const gchar *desc,
|
||||
GimpHelpFunc help_func,
|
||||
const gchar *help_data,
|
||||
|
||||
/* specify action area buttons
|
||||
* as va_list:
|
||||
* const gchar *label,
|
||||
* GCallback callback,
|
||||
* gpointer callback_data,
|
||||
* GObject *slot_object,
|
||||
* GtkWidget **widget_ptr,
|
||||
* gboolean default_action,
|
||||
* gboolean connect_delete,
|
||||
*/
|
||||
|
||||
...)
|
||||
{
|
||||
GimpViewableDialog *dialog;
|
||||
va_list args;
|
||||
gchar *str;
|
||||
|
||||
g_return_val_if_fail (! viewable || GIMP_IS_VIEWABLE (viewable), NULL);
|
||||
g_return_val_if_fail (title != NULL, NULL);
|
||||
g_return_val_if_fail (wmclass_name != NULL, NULL);
|
||||
|
||||
dialog = g_object_new (GIMP_TYPE_VIEWABLE_DIALOG, NULL);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (dialog), title);
|
||||
gtk_window_set_wmclass (GTK_WINDOW (dialog), wmclass_name, "Gimp");
|
||||
|
||||
if (help_func)
|
||||
gimp_help_connect (GTK_WIDGET (dialog), help_func, help_data);
|
||||
|
||||
va_start (args, help_data);
|
||||
gimp_dialog_create_action_areav (GIMP_DIALOG (dialog), args);
|
||||
va_end (args);
|
||||
|
||||
gtk_image_set_from_stock (GTK_IMAGE (dialog->icon), stock_id,
|
||||
GTK_ICON_SIZE_LARGE_TOOLBAR);
|
||||
|
||||
str = g_strdup_printf ("<b><big>%s</big></b>", desc);
|
||||
gtk_label_set_markup (GTK_LABEL (dialog->desc_label), str);
|
||||
g_free (str);
|
||||
|
||||
if (viewable)
|
||||
gimp_viewable_dialog_set_viewable (dialog, viewable);
|
||||
|
||||
return GTK_WIDGET (dialog);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_viewable_dialog_set_viewable (GimpViewableDialog *dialog,
|
||||
GimpViewable *viewable)
|
||||
{
|
||||
const gchar *name;
|
||||
gchar *str;
|
||||
|
||||
g_return_if_fail (GIMP_IS_VIEWABLE_DIALOG (dialog));
|
||||
g_return_if_fail (GIMP_IS_VIEWABLE (viewable));
|
||||
|
||||
if (dialog->preview)
|
||||
gtk_widget_destroy (dialog->preview);
|
||||
|
||||
name = gimp_object_get_name (GIMP_OBJECT (viewable));
|
||||
|
||||
if (GIMP_IS_ITEM (viewable))
|
||||
{
|
||||
const gchar *uri;
|
||||
gchar *basename;
|
||||
|
||||
uri = gimp_image_get_uri (gimp_item_get_image (GIMP_ITEM (viewable)));
|
||||
|
||||
basename = file_utils_uri_to_utf8_basename (uri);
|
||||
str = g_strdup_printf ("%s (%s)", name, basename);
|
||||
g_free (basename);
|
||||
}
|
||||
else if (GIMP_IS_IMAGE (viewable))
|
||||
{
|
||||
const gchar *uri;
|
||||
|
||||
uri = gimp_image_get_uri (GIMP_IMAGE (viewable));
|
||||
|
||||
str = file_utils_uri_to_utf8_basename (uri);
|
||||
}
|
||||
else
|
||||
{
|
||||
str = g_strdup (name);
|
||||
}
|
||||
|
||||
gtk_label_set_text (GTK_LABEL (dialog->viewable_label), str);
|
||||
g_free (str);
|
||||
|
||||
dialog->preview = gimp_preview_new (viewable, 32, 1, TRUE);
|
||||
gtk_box_pack_end (GTK_BOX (dialog->icon->parent), dialog->preview,
|
||||
FALSE, FALSE, 2);
|
||||
gtk_widget_show (dialog->preview);
|
||||
}
|
85
app/widgets/gimpviewabledialog.h
Normal file
85
app/widgets/gimpviewabledialog.h
Normal file
@ -0,0 +1,85 @@
|
||||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* gimpviewabledialog.h
|
||||
* Copyright (C) 2000 Michael Natterer <mitch@gimp.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GIMP_VIEWABLE_DIALOG_H__
|
||||
#define __GIMP_VIEWABLE_DIALOG_H__
|
||||
|
||||
#include "libgimpwidgets/gimpdialog.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
#define GIMP_TYPE_VIEWABLE_DIALOG (gimp_viewable_dialog_get_type ())
|
||||
#define GIMP_VIEWABLE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_VIEWABLE_DIALOG, GimpViewableDialog))
|
||||
#define GIMP_VIEWABLE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_VIEWABLE_DIALOG, GimpViewableDialogClass))
|
||||
#define GIMP_IS_VIEWABLE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_VIEWABLE_DIALOG))
|
||||
#define GIMP_IS_VIEWABLE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_VIEWABLE_DIALOG))
|
||||
#define GIMP_VIEWABLE_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_VIEWABLE_DIALOG, GimpViewableDialogClass))
|
||||
|
||||
|
||||
typedef struct _GimpViewableDialogClass GimpViewableDialogClass;
|
||||
|
||||
struct _GimpViewableDialog
|
||||
{
|
||||
GimpDialog parent_instance;
|
||||
|
||||
GtkWidget *icon;
|
||||
GtkWidget *preview;
|
||||
GtkWidget *desc_label;
|
||||
GtkWidget *viewable_label;
|
||||
};
|
||||
|
||||
struct _GimpViewableDialogClass
|
||||
{
|
||||
GimpDialogClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
GType gimp_viewable_dialog_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GtkWidget * gimp_viewable_dialog_new (GimpViewable *viewable,
|
||||
const gchar *title,
|
||||
const gchar *wmclass_name,
|
||||
const gchar *stock_id,
|
||||
const gchar *desc,
|
||||
GimpHelpFunc help_func,
|
||||
const gchar *help_data,
|
||||
|
||||
/* specify action area buttons
|
||||
* as va_list:
|
||||
* const gchar *label,
|
||||
* GCallback callback,
|
||||
* gpointer callback_data,
|
||||
* GObject *slot_object,
|
||||
* GtkWidget **widget_ptr,
|
||||
* gboolean default_action,
|
||||
* gboolean connect_delete,
|
||||
*/
|
||||
|
||||
...);
|
||||
|
||||
void gimp_viewable_dialog_set_viewable (GimpViewableDialog *dialog,
|
||||
GimpViewable *viewable);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GIMP_VIEWABLE_DIALOG_H__ */
|
@ -92,6 +92,8 @@ typedef struct _GimpImageDock GimpImageDock;
|
||||
typedef struct _GimpDockable GimpDockable;
|
||||
typedef struct _GimpDockbook GimpDockbook;
|
||||
|
||||
typedef struct _GimpViewableDialog GimpViewableDialog;
|
||||
|
||||
typedef struct _GimpFontSelection GimpFontSelection;
|
||||
typedef struct _GimpFontSelectionDialog GimpFontSelectionDialog;
|
||||
|
||||
|
@ -102,7 +102,7 @@ style "gimp-dialog-style"
|
||||
GtkDialog::action_area_border = 4
|
||||
}
|
||||
|
||||
widget "*GimpDialog*" style "gimp-dialog-style"
|
||||
widget "*Gimp*Dialog*" style "gimp-dialog-style"
|
||||
|
||||
|
||||
style "gimp-hscale-style"
|
||||
|
Reference in New Issue
Block a user