removed path_to_beziersel() so this file can be safely included from

2001-07-17  Michael Natterer  <mitch@gimp.org>

	* app/path.[ch]: removed path_to_beziersel() so this file can be
	safely included from core/.

	* app/tools/gimpbezierselecttool.[ch]: added it here.

	* app/core/core-types.h: added a GimpToolOptions typedef. Removes
	deps into tools/ and will later be a core object anyway.

	* app/tools/tools-types.h: removed the ToolOptions typedef here.

	* app/core/gimpimage-duplicate.c
	* app/core/gimpimage-mask.c
	* app/core/gimpimage.c
	* app/core/gimptoolinfo.[ch]: removed deps into tools/, misc stuff.

	* app/tools/tool_manager.[ch]: some ugly temp hacks. Please ignore.

	* app/widgets/gimpdialogfactory.[ch]: added a "remember_if_open" field
	to the GimpDialogFactoryEntry so we can manage dialogs which should
	not be re-opened on startup.

	* app/gui/dialogs-constructors.c
	* app/gui/dialogs.c: register & create all editor dialog with the
	"global_dialog_factory".

	* app/gui/tool-options-dialog.c
	* app/tools/*: s/ToolOptions/GimpToolOptions/
This commit is contained in:
Michael Natterer 2001-07-17 20:50:01 +00:00 committed by Michael Natterer
parent 284e178d4c
commit b844c98549
100 changed files with 1043 additions and 926 deletions

View File

@ -1,3 +1,33 @@
2001-07-17 Michael Natterer <mitch@gimp.org>
* app/path.[ch]: removed path_to_beziersel() so this file can be
safely included from core/.
* app/tools/gimpbezierselecttool.[ch]: added it here.
* app/core/core-types.h: added a GimpToolOptions typedef. Removes
deps into tools/ and will later be a core object anyway.
* app/tools/tools-types.h: removed the ToolOptions typedef here.
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.c
* app/core/gimpimage.c
* app/core/gimptoolinfo.[ch]: removed deps into tools/, misc stuff.
* app/tools/tool_manager.[ch]: some ugly temp hacks. Please ignore.
* app/widgets/gimpdialogfactory.[ch]: added a "remember_if_open" field
to the GimpDialogFactoryEntry so we can manage dialogs which should
not be re-opened on startup.
* app/gui/dialogs-constructors.c
* app/gui/dialogs.c: register & create all editor dialog with the
"global_dialog_factory".
* app/gui/tool-options-dialog.c
* app/tools/*: s/ToolOptions/GimpToolOptions/
2001-07-15 Michael Natterer <mitch@gimp.org>
* libgimpbase/gimpwire.c: remove the usage of printf()/scanf()

View File

@ -93,7 +93,7 @@ static void color_balance_yb_adjustment_update (GtkAdjustment *adj,
/* the color balance tool options */
static ToolOptions *color_balance_options = NULL;
static GimpToolOptions *color_balance_options = NULL;
/* the color balance dialog */
static ColorBalanceDialog *color_balance_dialog = NULL;
@ -173,7 +173,7 @@ gimp_color_balance_tool_init (GimpColorBalanceTool *bc_tool)
color_balance_options = tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_COLOR_BALANCE_TOOL,
(ToolOptions *) color_balance_options);
(GimpToolOptions *) color_balance_options);
}
}

View File

@ -175,7 +175,7 @@ static void curves_write_to_file (FILE *f);
/* the curves tool options */
static ToolOptions * curves_options = NULL;
static GimpToolOptions * curves_options = NULL;
/* the curves dialog */
static CurvesDialog * curves_dialog = NULL;
@ -270,7 +270,7 @@ gimp_curves_tool_init (GimpCurvesTool *bc_tool)
curves_options = tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_CURVES_TOOL,
(ToolOptions *) curves_options);
(GimpToolOptions *) curves_options);
}
}

View File

@ -102,7 +102,7 @@ static gint hue_saturation_hue_partition_events (GtkWidget *,
/* the hue-saturation tool options */
static ToolOptions *hue_saturation_options = NULL;
static GimpToolOptions *hue_saturation_options = NULL;
/* the hue-saturation tool dialog */
static HueSaturationDialog *hue_saturation_dialog = NULL;
@ -195,7 +195,7 @@ gimp_hue_saturation_tool_init (GimpHueSaturationTool *bc_tool)
hue_saturation_options = tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_HUE_SATURATION_TOOL,
(ToolOptions *) hue_saturation_options);
(GimpToolOptions *) hue_saturation_options);
}
}

View File

@ -100,7 +100,7 @@ static void threshold_histogram_range (HistogramWidget *,
/* the threshold tool options */
static ToolOptions *threshold_options = NULL;
static GimpToolOptions *threshold_options = NULL;
/* the threshold tool dialog */
static ThresholdDialog *threshold_dialog = NULL;
@ -178,7 +178,7 @@ gimp_threshold_tool_init (GimpThresholdTool *bc_tool)
threshold_options = tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_THRESHOLD_TOOL,
(ToolOptions *) threshold_options);
(GimpToolOptions *) threshold_options);
}
}

View File

@ -137,6 +137,11 @@ typedef struct _GimpGuide GimpGuide;
typedef struct _GimpImageNewValues GimpImageNewValues;
/* stuff which is forward declared here so we don't need to cross-include it */
typedef struct _GimpToolOptions GimpToolOptions;
/* functions */
typedef void (* GimpDataFileLoaderFunc) (const gchar *filename,

View File

@ -132,73 +132,73 @@ typedef struct
static void gimp_blend_tool_class_init (GimpBlendToolClass *klass);
static void gimp_blend_tool_init (GimpBlendTool *blend_tool);
static void gimp_blend_tool_destroy (GtkObject *object);
static void gimp_blend_tool_destroy (GtkObject *object);
static void gradient_type_callback (GtkWidget *widget,
gpointer data);
static void gradient_type_callback (GtkWidget *widget,
gpointer data);
static void gimp_blend_tool_button_press (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void gimp_blend_tool_button_release (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void gimp_blend_tool_motion (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_blend_tool_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_blend_tool_button_press (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void gimp_blend_tool_button_release (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void gimp_blend_tool_motion (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_blend_tool_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_blend_tool_draw (GimpDrawTool *draw_tool);
static void gimp_blend_tool_draw (GimpDrawTool *draw_tool);
static BlendOptions * blend_options_new (void);
static void blend_options_reset (ToolOptions *tool_options);
static void blend_options_reset (GimpToolOptions *tool_options);
static void gradient_type_callback (GtkWidget *widget,
gpointer data);
static void blend_options_drop_gradient (GtkWidget *widget,
GimpViewable *viewable,
gpointer data);
static void blend_options_drop_tool (GtkWidget *widget,
GimpViewable *viewable,
gpointer data);
static void gradient_type_callback (GtkWidget *widget,
gpointer data);
static void blend_options_drop_gradient (GtkWidget *widget,
GimpViewable *viewable,
gpointer data);
static void blend_options_drop_tool (GtkWidget *widget,
GimpViewable *viewable,
gpointer data);
static gdouble gradient_calc_conical_sym_factor (gdouble dist,
gdouble *axis,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_conical_asym_factor (gdouble dist,
gdouble *axis,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_square_factor (gdouble dist,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_radial_factor (gdouble dist,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_linear_factor (gdouble dist,
gdouble *vec,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_bilinear_factor (gdouble dist,
gdouble *vec,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_spiral_factor (gdouble dist,
gdouble *axis,
gdouble offset,
gdouble x,
gdouble y,
gint cwise);
static gdouble gradient_calc_conical_sym_factor (gdouble dist,
gdouble *axis,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_conical_asym_factor (gdouble dist,
gdouble *axis,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_square_factor (gdouble dist,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_radial_factor (gdouble dist,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_linear_factor (gdouble dist,
gdouble *vec,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_bilinear_factor (gdouble dist,
gdouble *vec,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_spiral_factor (gdouble dist,
gdouble *axis,
gdouble offset,
gdouble x,
gdouble y,
gint cwise);
static gdouble gradient_calc_shapeburst_angular_factor (gdouble x,
gdouble y);
@ -345,7 +345,7 @@ gimp_blend_tool_init (GimpBlendTool *blend_tool)
blend_options = blend_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_BLEND_TOOL,
(ToolOptions *) blend_options);
(GimpToolOptions *) blend_options);
}
tool->tool_cursor = GIMP_BLEND_TOOL_CURSOR;
@ -670,7 +670,7 @@ blend_options_new (void)
options->threshold = options->threshold_d = 0.2;
/* the main vbox */
vbox = ((ToolOptions *) options)->main_vbox;
vbox = ((GimpToolOptions *) options)->main_vbox;
/* dnd stuff */
gtk_drag_dest_set (vbox,
@ -828,7 +828,7 @@ blend_options_new (void)
}
static void
blend_options_reset (ToolOptions *tool_options)
blend_options_reset (GimpToolOptions *tool_options)
{
BlendOptions *options;

View File

@ -31,9 +31,6 @@
#include "paint-funcs/paint-funcs.h"
/* FIXME: remove the Path <-> BezierSelect dependency */
#include "tools/tools-types.h"
#include "gimp.h"
#include "gimpchannel.h"
#include "gimpcontext.h"
@ -45,7 +42,6 @@
#include "gimpparasitelist.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "path.h"
#include "libgimp/gimpintl.h"

View File

@ -35,9 +35,6 @@
#include "paint-funcs/paint-funcs.h"
/* FIXME: remove the Path <-> BezierSelect dependency */
#include "tools/tools-types.h"
#include "gimp.h"
#include "gimpcontext.h"
#include "gimpcoreconfig.h"

View File

@ -645,7 +645,7 @@ gimage_mask_stroke (GimpImage *gimage,
GIMP_PDB_END);
if (return_vals && return_vals[0].value.pdb_int != GIMP_PDB_SUCCESS)
g_message (_("Paintbrush operation failed."));
g_message (_("Paint operation failed."));
procedural_db_destroy_args (return_vals, nreturn_vals);

View File

@ -35,9 +35,6 @@
#include "paint-funcs/paint-funcs.h"
/* FIXME: remove the Path <-> BezierSelect dependency */
#include "tools/tools-types.h"
#include "gimp.h"
#include "gimpcontext.h"
#include "gimpcoreconfig.h"

View File

@ -55,7 +55,7 @@ typedef struct _GimpColorPickerToolOptions GimpColorPickerToolOptions;
struct _GimpColorPickerToolOptions
{
ToolOptions tool_options;
GimpToolOptions tool_options;
gboolean sample_merged;
gboolean sample_merged_d;
@ -108,7 +108,7 @@ static void gimp_color_picker_tool_draw (GimpDrawTool *draw_to
static GimpColorPickerToolOptions * gimp_color_picker_tool_options_new (void);
static void gimp_color_picker_tool_options_reset (ToolOptions *tool_options);
static void gimp_color_picker_tool_options_reset (GimpToolOptions *tool_options);
static void gimp_color_picker_tool_info_window_close_callback (GtkWidget *widget,
gpointer data);
static void gimp_color_picker_tool_info_update (GimpTool *tool,
@ -224,7 +224,7 @@ gimp_color_picker_tool_init (GimpColorPickerTool *color_picker_tool)
gimp_color_picker_tool_options = gimp_color_picker_tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_COLOR_PICKER_TOOL,
(ToolOptions *) gimp_color_picker_tool_options);
(GimpToolOptions *) gimp_color_picker_tool_options);
}
tool->preserve = FALSE; /* Don't preserve on drawable change */
@ -256,7 +256,7 @@ gimp_color_picker_tool_destroy (GtkObject *object)
}
static void
gimp_color_picker_tool_options_reset (ToolOptions *tool_options)
gimp_color_picker_tool_options_reset (GimpToolOptions *tool_options)
{
GimpColorPickerToolOptions *options;
@ -284,7 +284,7 @@ gimp_color_picker_tool_options_new (void)
GtkWidget *scale;
options = g_new0 (GimpColorPickerToolOptions, 1);
tool_options_init ((ToolOptions *) options,
tool_options_init ((GimpToolOptions *) options,
gimp_color_picker_tool_options_reset);
options->sample_merged = options->sample_merged_d = FALSE;

View File

@ -35,9 +35,6 @@
#include "paint-funcs/paint-funcs.h"
/* FIXME: remove the Path <-> BezierSelect dependency */
#include "tools/tools-types.h"
#include "gimp.h"
#include "gimpcontext.h"
#include "gimpcoreconfig.h"

View File

@ -35,9 +35,6 @@
#include "paint-funcs/paint-funcs.h"
/* FIXME: remove the Path <-> BezierSelect dependency */
#include "tools/tools-types.h"
#include "gimp.h"
#include "gimpcontext.h"
#include "gimpcoreconfig.h"

View File

@ -35,9 +35,6 @@
#include "paint-funcs/paint-funcs.h"
/* FIXME: remove the Path <-> BezierSelect dependency */
#include "tools/tools-types.h"
#include "gimp.h"
#include "gimpcontext.h"
#include "gimpcoreconfig.h"

View File

@ -35,9 +35,6 @@
#include "paint-funcs/paint-funcs.h"
/* FIXME: remove the Path <-> BezierSelect dependency */
#include "tools/tools-types.h"
#include "gimp.h"
#include "gimpcontext.h"
#include "gimpcoreconfig.h"

View File

@ -35,9 +35,6 @@
#include "paint-funcs/paint-funcs.h"
/* FIXME: remove the Path <-> BezierSelect dependency */
#include "tools/tools-types.h"
#include "gimp.h"
#include "gimpcontext.h"
#include "gimpcoreconfig.h"

View File

@ -210,6 +210,7 @@ gimp_tool_info_new (GimpContext *context,
const gchar *menu_accel,
const gchar *help_domain,
const gchar *help_data,
const gchar *pdb_string,
const gchar **icon_data)
{
GimpToolInfo *tool_info;
@ -229,6 +230,9 @@ gimp_tool_info_new (GimpContext *context,
tool_info->help_domain = g_strdup (help_domain);
tool_info->help_data = g_strdup (help_data);
tool_info->pdb_string = (pdb_string ?
g_strdup (pdb_string) : "gimp_paintbrush_default");
tool_info->icon_data = icon_data;
if (tool_context)
@ -257,6 +261,7 @@ gimp_tool_info_get_standard (void)
"Well something must be broken",
NULL, NULL,
NULL, NULL,
NULL,
NULL);
}

View File

@ -23,10 +23,6 @@
#include "gimpdata.h"
/* FIXME: the ToolOptions need to be an object living in core/ */
#include "tools/tools-types.h"
#define GIMP_TYPE_TOOL_INFO (gimp_tool_info_get_type ())
#define GIMP_TOOL_INFO(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_TOOL_INFO, GimpToolInfo))
#define GIMP_IS_TOOL_INFO(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_TOOL_INFO))
@ -39,24 +35,26 @@ typedef struct _GimpToolInfoClass GimpToolInfoClass;
struct _GimpToolInfo
{
GimpData parent_instance;
GimpData parent_instance;
GtkType tool_type;
GtkType tool_type;
gchar *blurb;
gchar *help;
gchar *blurb;
gchar *help;
gchar *menu_path;
gchar *menu_accel;
gchar *menu_path;
gchar *menu_accel;
gchar *help_domain;
gchar *help_data;
gchar *help_domain;
gchar *help_data;
const gchar **icon_data;
gchar *pdb_string;
GimpContext *context;
const gchar **icon_data;
ToolOptions *tool_options;
GimpContext *context;
GimpToolOptions *tool_options;
};
struct _GimpToolInfoClass
@ -77,6 +75,7 @@ GimpToolInfo * gimp_tool_info_new (GimpContext *context,
const gchar *menu_accel,
const gchar *help_domain,
const gchar *help_data,
const gchar *pdb_string,
const gchar **icon_data);
GimpToolInfo * gimp_tool_info_get_standard (void);

View File

@ -28,21 +28,20 @@
void
tool_options_init (ToolOptions *options,
tool_options_init (GimpToolOptions *options,
ToolOptionsResetFunc reset_func)
{
options->main_vbox = gtk_vbox_new (FALSE, 2);
options->reset_func = reset_func;
}
ToolOptions *
GimpToolOptions *
tool_options_new (void)
{
ToolOptions *options;
GimpToolOptions *options;
GtkWidget *label;
GtkWidget *label;
options = g_new0 (ToolOptions, 1);
options = g_new0 (GimpToolOptions, 1);
tool_options_init (options, NULL);
label = gtk_label_new (_("This tool has no options."));

View File

@ -22,7 +22,7 @@
/* the tool options structures */
struct _ToolOptions
struct _GimpToolOptions
{
GtkWidget *main_vbox;
@ -32,13 +32,13 @@ struct _ToolOptions
/* create a dummy tool options structure
* (to be used by tools without options)
*/
ToolOptions * tool_options_new (void);
GimpToolOptions * tool_options_new (void);
/* initialize an already allocated ToolOptions structure
* (to be used by derived tool options only)
*/
void tool_options_init (ToolOptions *options,
ToolOptionsResetFunc reset_func);
void tool_options_init (GimpToolOptions *options,
ToolOptionsResetFunc reset_func);
#endif /* __TOOL_OPTIONS_H__ */

View File

@ -56,6 +56,7 @@
#include "channels-commands.h"
#include "color-area.h"
#include "colormap-dialog.h"
#include "dialogs.h"
#include "devices.h"
#include "dialogs-constructors.h"
#include "docindex.h"
@ -90,6 +91,17 @@
#include "libgimp/gimpintl.h"
/* FIXME: do something about this uglyness:
*/
typedef struct
{
GtkWidget *shell;
} EEKWrapper;
/* local function prototypes */
static void dialogs_indexed_palette_selected (GimpColormapDialog *dialog,
GimpDockable *dockable);
@ -137,6 +149,13 @@ static void dialogs_indexed_palette_image_changed (GimpContext *context,
GimpColormapDialog *ipal);
/* private variables */
static BrushEditor *brush_editor_dialog = NULL;
static GradientEditor *gradient_editor_dialog = NULL;
static PaletteEditor *palette_editor_dialog = NULL;
/* public functions */
GtkWidget *
@ -282,21 +301,36 @@ GtkWidget *
dialogs_brush_editor_get (GimpDialogFactory *factory,
GimpContext *context)
{
return NULL;
if (! brush_editor_dialog)
{
brush_editor_dialog = brush_editor_new (context->gimp);
}
return ((EEKWrapper *) brush_editor_dialog)->shell;
}
GtkWidget *
dialogs_gradient_editor_get (GimpDialogFactory *factory,
GimpContext *context)
{
return NULL;
if (! gradient_editor_dialog)
{
gradient_editor_dialog = gradient_editor_new (context->gimp);
}
return ((EEKWrapper *) gradient_editor_dialog)->shell;
}
GtkWidget *
dialogs_palette_editor_get (GimpDialogFactory *factory,
GimpContext *context)
{
return NULL;
if (! palette_editor_dialog)
{
palette_editor_dialog = palette_editor_new (context->gimp);
}
return ((EEKWrapper *) palette_editor_dialog)->shell;
}
@ -717,8 +751,6 @@ dialogs_indexed_palette_new (GimpDialogFactory *factory,
void
dialogs_edit_brush_func (GimpData *data)
{
static BrushEditor *brush_editor_dialog = NULL;
GimpBrush *brush;
brush = GIMP_BRUSH (data);
@ -727,7 +759,8 @@ dialogs_edit_brush_func (GimpData *data)
{
if (! brush_editor_dialog)
{
brush_editor_dialog = brush_editor_new (the_gimp);
gimp_dialog_factory_dialog_raise (global_dialog_factory,
"gimp:brush-editor");
}
brush_editor_set_brush (brush_editor_dialog, brush);
@ -741,15 +774,14 @@ dialogs_edit_brush_func (GimpData *data)
void
dialogs_edit_gradient_func (GimpData *data)
{
static GradientEditor *gradient_editor_dialog = NULL;
GimpGradient *gradient;
gradient = GIMP_GRADIENT (data);
if (! gradient_editor_dialog)
{
gradient_editor_dialog = gradient_editor_new (the_gimp);
gimp_dialog_factory_dialog_raise (global_dialog_factory,
"gimp:gradient-editor");
}
gradient_editor_set_gradient (gradient_editor_dialog, gradient);
@ -758,15 +790,14 @@ dialogs_edit_gradient_func (GimpData *data)
void
dialogs_edit_palette_func (GimpData *data)
{
static PaletteEditor *palette_editor_dialog = NULL;
GimpPalette *palette;
palette = GIMP_PALETTE (data);
if (! palette_editor_dialog)
{
palette_editor_dialog = palette_editor_new (the_gimp);
gimp_dialog_factory_dialog_raise (global_dialog_factory,
"gimp:palette-editor");
}
palette_editor_set_palette (palette_editor_dialog, palette);

View File

@ -38,52 +38,52 @@ GimpDialogFactory *global_dock_factory = NULL;
static const GimpDialogFactoryEntry toplevel_entries[] =
{
{ "gimp:toolbox", dialogs_toolbox_get, TRUE, TRUE, TRUE },
{ "gimp:tool-options-dialog", dialogs_tool_options_get, TRUE, TRUE, FALSE },
{ "gimp:device-status-dialog", dialogs_device_status_get, TRUE, TRUE, FALSE },
{ "gimp:brush-select-dialog", dialogs_brush_select_get, TRUE, TRUE, FALSE },
{ "gimp:pattern-select-dialog", dialogs_pattern_select_get, TRUE, TRUE, FALSE },
{ "gimp:gradient-select-dialog", dialogs_gradient_select_get, TRUE, TRUE, FALSE },
{ "gimp:palette-select-dialog", dialogs_palette_select_get, TRUE, TRUE, FALSE },
{ "gimp:error-console-dialog", dialogs_error_console_get, TRUE, TRUE, TRUE },
{ "gimp:document-index-dialog", dialogs_document_index_get, TRUE, TRUE, TRUE },
{ "gimp:preferences-dialog", dialogs_preferences_get, TRUE, FALSE, FALSE },
{ "gimp:input-devices-dialog", dialogs_input_devices_get, TRUE, FALSE, FALSE },
{ "gimp:module-browser-dialog", dialogs_module_browser_get, TRUE, FALSE, FALSE },
{ "gimp:undo-history-dialog", dialogs_undo_history_get, FALSE, FALSE, FALSE },
{ "gimp:display-filters-dialog", dialogs_display_filters_get, FALSE, FALSE, FALSE },
{ "gimp:tips-dialog", dialogs_tips_get, TRUE, FALSE, FALSE },
{ "gimp:about-dialog", dialogs_about_get, TRUE, FALSE, FALSE },
{ "gimp:toolbox", dialogs_toolbox_get, TRUE, TRUE, TRUE, TRUE },
{ "gimp:tool-options-dialog", dialogs_tool_options_get, TRUE, TRUE, FALSE, TRUE },
{ "gimp:device-status-dialog", dialogs_device_status_get, TRUE, TRUE, FALSE, TRUE },
{ "gimp:brush-select-dialog", dialogs_brush_select_get, TRUE, TRUE, FALSE, TRUE },
{ "gimp:pattern-select-dialog", dialogs_pattern_select_get, TRUE, TRUE, FALSE, TRUE },
{ "gimp:gradient-select-dialog", dialogs_gradient_select_get, TRUE, TRUE, FALSE, TRUE },
{ "gimp:palette-select-dialog", dialogs_palette_select_get, TRUE, TRUE, FALSE, TRUE },
{ "gimp:error-console-dialog", dialogs_error_console_get, TRUE, TRUE, TRUE, TRUE },
{ "gimp:document-index-dialog", dialogs_document_index_get, TRUE, TRUE, TRUE, TRUE },
{ "gimp:preferences-dialog", dialogs_preferences_get, TRUE, FALSE, FALSE, TRUE },
{ "gimp:input-devices-dialog", dialogs_input_devices_get, TRUE, FALSE, FALSE, TRUE },
{ "gimp:module-browser-dialog", dialogs_module_browser_get, TRUE, FALSE, FALSE, TRUE },
{ "gimp:undo-history-dialog", dialogs_undo_history_get, FALSE, FALSE, FALSE, TRUE },
{ "gimp:display-filters-dialog", dialogs_display_filters_get, FALSE, FALSE, FALSE, TRUE },
{ "gimp:tips-dialog", dialogs_tips_get, TRUE, FALSE, FALSE, TRUE },
{ "gimp:about-dialog", dialogs_about_get, TRUE, FALSE, FALSE, TRUE },
{ "gimp:brush-editor", dialogs_brush_editor_get, TRUE, TRUE, TRUE },
{ "gimp:gradient-editor", dialogs_gradient_editor_get, TRUE, TRUE, TRUE },
{ "gimp:palette-editor", dialogs_palette_editor_get, TRUE, TRUE, TRUE }
{ "gimp:brush-editor", dialogs_brush_editor_get, TRUE, TRUE, TRUE, FALSE },
{ "gimp:gradient-editor", dialogs_gradient_editor_get, TRUE, TRUE, TRUE, FALSE },
{ "gimp:palette-editor", dialogs_palette_editor_get, TRUE, TRUE, TRUE, FALSE }
};
static const gint n_toplevel_entries = (sizeof (toplevel_entries) /
sizeof (toplevel_entries[0]));
static const GimpDialogFactoryEntry dock_entries[] =
{
{ "gimp:image-list", dialogs_image_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:brush-list", dialogs_brush_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:pattern-list", dialogs_pattern_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:gradient-list", dialogs_gradient_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:palette-list", dialogs_palette_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:tool-list", dialogs_tool_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:buffer-list", dialogs_buffer_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:image-list", dialogs_image_list_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:brush-list", dialogs_brush_list_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:pattern-list", dialogs_pattern_list_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:gradient-list", dialogs_gradient_list_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:palette-list", dialogs_palette_list_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:tool-list", dialogs_tool_list_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:buffer-list", dialogs_buffer_list_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:image-grid", dialogs_image_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:brush-grid", dialogs_brush_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:pattern-grid", dialogs_pattern_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:gradient-grid", dialogs_gradient_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:palette-grid", dialogs_palette_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:tool-grid", dialogs_tool_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:buffer-grid", dialogs_buffer_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:image-grid", dialogs_image_grid_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:brush-grid", dialogs_brush_grid_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:pattern-grid", dialogs_pattern_grid_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:gradient-grid", dialogs_gradient_grid_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:palette-grid", dialogs_palette_grid_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:tool-grid", dialogs_tool_grid_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:buffer-grid", dialogs_buffer_grid_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:layer-list", dialogs_layer_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:channel-list", dialogs_channel_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:path-list", dialogs_path_list_view_new, TRUE, FALSE, FALSE },
{ "gimp:indexed-palette", dialogs_indexed_palette_new, FALSE, FALSE, FALSE }
{ "gimp:layer-list", dialogs_layer_list_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:channel-list", dialogs_channel_list_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:path-list", dialogs_path_list_view_new, TRUE, FALSE, FALSE, TRUE },
{ "gimp:indexed-palette", dialogs_indexed_palette_new, FALSE, FALSE, FALSE, TRUE }
};
static const gint n_dock_entries = (sizeof (dock_entries) /
sizeof (dock_entries[0]));
@ -116,7 +116,8 @@ dialogs_init (Gimp *gimp)
toplevel_entries[i].new_func,
toplevel_entries[i].singleton,
toplevel_entries[i].session_managed,
toplevel_entries[i].remember_size);
toplevel_entries[i].remember_size,
toplevel_entries[i].remember_if_open);
for (i = 0; i < n_dock_entries; i++)
gimp_dialog_factory_register_entry (global_dock_factory,
@ -124,7 +125,8 @@ dialogs_init (Gimp *gimp)
dock_entries[i].new_func,
dock_entries[i].singleton,
dock_entries[i].session_managed,
dock_entries[i].remember_size);
dock_entries[i].remember_size,
dock_entries[i].remember_if_open);
}
void

View File

@ -56,6 +56,7 @@
#include "channels-commands.h"
#include "color-area.h"
#include "colormap-dialog.h"
#include "dialogs.h"
#include "devices.h"
#include "dialogs-constructors.h"
#include "docindex.h"
@ -90,6 +91,17 @@
#include "libgimp/gimpintl.h"
/* FIXME: do something about this uglyness:
*/
typedef struct
{
GtkWidget *shell;
} EEKWrapper;
/* local function prototypes */
static void dialogs_indexed_palette_selected (GimpColormapDialog *dialog,
GimpDockable *dockable);
@ -137,6 +149,13 @@ static void dialogs_indexed_palette_image_changed (GimpContext *context,
GimpColormapDialog *ipal);
/* private variables */
static BrushEditor *brush_editor_dialog = NULL;
static GradientEditor *gradient_editor_dialog = NULL;
static PaletteEditor *palette_editor_dialog = NULL;
/* public functions */
GtkWidget *
@ -282,21 +301,36 @@ GtkWidget *
dialogs_brush_editor_get (GimpDialogFactory *factory,
GimpContext *context)
{
return NULL;
if (! brush_editor_dialog)
{
brush_editor_dialog = brush_editor_new (context->gimp);
}
return ((EEKWrapper *) brush_editor_dialog)->shell;
}
GtkWidget *
dialogs_gradient_editor_get (GimpDialogFactory *factory,
GimpContext *context)
{
return NULL;
if (! gradient_editor_dialog)
{
gradient_editor_dialog = gradient_editor_new (context->gimp);
}
return ((EEKWrapper *) gradient_editor_dialog)->shell;
}
GtkWidget *
dialogs_palette_editor_get (GimpDialogFactory *factory,
GimpContext *context)
{
return NULL;
if (! palette_editor_dialog)
{
palette_editor_dialog = palette_editor_new (context->gimp);
}
return ((EEKWrapper *) palette_editor_dialog)->shell;
}
@ -717,8 +751,6 @@ dialogs_indexed_palette_new (GimpDialogFactory *factory,
void
dialogs_edit_brush_func (GimpData *data)
{
static BrushEditor *brush_editor_dialog = NULL;
GimpBrush *brush;
brush = GIMP_BRUSH (data);
@ -727,7 +759,8 @@ dialogs_edit_brush_func (GimpData *data)
{
if (! brush_editor_dialog)
{
brush_editor_dialog = brush_editor_new (the_gimp);
gimp_dialog_factory_dialog_raise (global_dialog_factory,
"gimp:brush-editor");
}
brush_editor_set_brush (brush_editor_dialog, brush);
@ -741,15 +774,14 @@ dialogs_edit_brush_func (GimpData *data)
void
dialogs_edit_gradient_func (GimpData *data)
{
static GradientEditor *gradient_editor_dialog = NULL;
GimpGradient *gradient;
gradient = GIMP_GRADIENT (data);
if (! gradient_editor_dialog)
{
gradient_editor_dialog = gradient_editor_new (the_gimp);
gimp_dialog_factory_dialog_raise (global_dialog_factory,
"gimp:gradient-editor");
}
gradient_editor_set_gradient (gradient_editor_dialog, gradient);
@ -758,15 +790,14 @@ dialogs_edit_gradient_func (GimpData *data)
void
dialogs_edit_palette_func (GimpData *data)
{
static PaletteEditor *palette_editor_dialog = NULL;
GimpPalette *palette;
palette = GIMP_PALETTE (data);
if (! palette_editor_dialog)
{
palette_editor_dialog = palette_editor_new (the_gimp);
gimp_dialog_factory_dialog_raise (global_dialog_factory,
"gimp:palette-editor");
}
palette_editor_set_palette (palette_editor_dialog, palette);

View File

@ -38,52 +38,52 @@ GimpDialogFactory *global_dock_factory = NULL;
static const GimpDialogFactoryEntry toplevel_entries[] =
{
{ "gimp:toolbox", dialogs_toolbox_get, TRUE, TRUE, TRUE },
{ "gimp:tool-options-dialog", dialogs_tool_options_get, TRUE, TRUE, FALSE },
{ "gimp:device-status-dialog", dialogs_device_status_get, TRUE, TRUE, FALSE },
{ "gimp:brush-select-dialog", dialogs_brush_select_get, TRUE, TRUE, FALSE },
{ "gimp:pattern-select-dialog", dialogs_pattern_select_get, TRUE, TRUE, FALSE },
{ "gimp:gradient-select-dialog", dialogs_gradient_select_get, TRUE, TRUE, FALSE },
{ "gimp:palette-select-dialog", dialogs_palette_select_get, TRUE, TRUE, FALSE },
{ "gimp:error-console-dialog", dialogs_error_console_get, TRUE, TRUE, TRUE },
{ "gimp:document-index-dialog", dialogs_document_index_get, TRUE, TRUE, TRUE },
{ "gimp:preferences-dialog", dialogs_preferences_get, TRUE, FALSE, FALSE },
{ "gimp:input-devices-dialog", dialogs_input_devices_get, TRUE, FALSE, FALSE },
{ "gimp:module-browser-dialog", dialogs_module_browser_get, TRUE, FALSE, FALSE },
{ "gimp:undo-history-dialog", dialogs_undo_history_get, FALSE, FALSE, FALSE },
{ "gimp:display-filters-dialog", dialogs_display_filters_get, FALSE, FALSE, FALSE },
{ "gimp:tips-dialog", dialogs_tips_get, TRUE, FALSE, FALSE },
{ "gimp:about-dialog", dialogs_about_get, TRUE, FALSE, FALSE },
{ "gimp:toolbox", dialogs_toolbox_get, TRUE, TRUE, TRUE, TRUE },
{ "gimp:tool-options-dialog", dialogs_tool_options_get, TRUE, TRUE, FALSE, TRUE },
{ "gimp:device-status-dialog", dialogs_device_status_get, TRUE, TRUE, FALSE, TRUE },
{ "gimp:brush-select-dialog", dialogs_brush_select_get, TRUE, TRUE, FALSE, TRUE },
{ "gimp:pattern-select-dialog", dialogs_pattern_select_get, TRUE, TRUE, FALSE, TRUE },
{ "gimp:gradient-select-dialog", dialogs_gradient_select_get, TRUE, TRUE, FALSE, TRUE },
{ "gimp:palette-select-dialog", dialogs_palette_select_get, TRUE, TRUE, FALSE, TRUE },
{ "gimp:error-console-dialog", dialogs_error_console_get, TRUE, TRUE, TRUE, TRUE },
{ "gimp:document-index-dialog", dialogs_document_index_get, TRUE, TRUE, TRUE, TRUE },
{ "gimp:preferences-dialog", dialogs_preferences_get, TRUE, FALSE, FALSE, TRUE },
{ "gimp:input-devices-dialog", dialogs_input_devices_get, TRUE, FALSE, FALSE, TRUE },
{ "gimp:module-browser-dialog", dialogs_module_browser_get, TRUE, FALSE, FALSE, TRUE },
{ "gimp:undo-history-dialog", dialogs_undo_history_get, FALSE, FALSE, FALSE, TRUE },
{ "gimp:display-filters-dialog", dialogs_display_filters_get, FALSE, FALSE, FALSE, TRUE },
{ "gimp:tips-dialog", dialogs_tips_get, TRUE, FALSE, FALSE, TRUE },
{ "gimp:about-dialog", dialogs_about_get, TRUE, FALSE, FALSE, TRUE },
{ "gimp:brush-editor", dialogs_brush_editor_get, TRUE, TRUE, TRUE },
{ "gimp:gradient-editor", dialogs_gradient_editor_get, TRUE, TRUE, TRUE },
{ "gimp:palette-editor", dialogs_palette_editor_get, TRUE, TRUE, TRUE }
{ "gimp:brush-editor", dialogs_brush_editor_get, TRUE, TRUE, TRUE, FALSE },
{ "gimp:gradient-editor", dialogs_gradient_editor_get, TRUE, TRUE, TRUE, FALSE },
{ "gimp:palette-editor", dialogs_palette_editor_get, TRUE, TRUE, TRUE, FALSE }
};
static const gint n_toplevel_entries = (sizeof (toplevel_entries) /
sizeof (toplevel_entries[0]));
static const GimpDialogFactoryEntry dock_entries[] =
{
{ "gimp:image-list", dialogs_image_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:brush-list", dialogs_brush_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:pattern-list", dialogs_pattern_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:gradient-list", dialogs_gradient_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:palette-list", dialogs_palette_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:tool-list", dialogs_tool_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:buffer-list", dialogs_buffer_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:image-list", dialogs_image_list_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:brush-list", dialogs_brush_list_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:pattern-list", dialogs_pattern_list_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:gradient-list", dialogs_gradient_list_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:palette-list", dialogs_palette_list_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:tool-list", dialogs_tool_list_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:buffer-list", dialogs_buffer_list_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:image-grid", dialogs_image_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:brush-grid", dialogs_brush_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:pattern-grid", dialogs_pattern_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:gradient-grid", dialogs_gradient_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:palette-grid", dialogs_palette_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:tool-grid", dialogs_tool_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:buffer-grid", dialogs_buffer_grid_view_new, FALSE, FALSE, FALSE },
{ "gimp:image-grid", dialogs_image_grid_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:brush-grid", dialogs_brush_grid_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:pattern-grid", dialogs_pattern_grid_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:gradient-grid", dialogs_gradient_grid_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:palette-grid", dialogs_palette_grid_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:tool-grid", dialogs_tool_grid_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:buffer-grid", dialogs_buffer_grid_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:layer-list", dialogs_layer_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:channel-list", dialogs_channel_list_view_new, FALSE, FALSE, FALSE },
{ "gimp:path-list", dialogs_path_list_view_new, TRUE, FALSE, FALSE },
{ "gimp:indexed-palette", dialogs_indexed_palette_new, FALSE, FALSE, FALSE }
{ "gimp:layer-list", dialogs_layer_list_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:channel-list", dialogs_channel_list_view_new, FALSE, FALSE, FALSE, TRUE },
{ "gimp:path-list", dialogs_path_list_view_new, TRUE, FALSE, FALSE, TRUE },
{ "gimp:indexed-palette", dialogs_indexed_palette_new, FALSE, FALSE, FALSE, TRUE }
};
static const gint n_dock_entries = (sizeof (dock_entries) /
sizeof (dock_entries[0]));
@ -116,7 +116,8 @@ dialogs_init (Gimp *gimp)
toplevel_entries[i].new_func,
toplevel_entries[i].singleton,
toplevel_entries[i].session_managed,
toplevel_entries[i].remember_size);
toplevel_entries[i].remember_size,
toplevel_entries[i].remember_if_open);
for (i = 0; i < n_dock_entries; i++)
gimp_dialog_factory_register_entry (global_dock_factory,
@ -124,7 +125,8 @@ dialogs_init (Gimp *gimp)
dock_entries[i].new_func,
dock_entries[i].singleton,
dock_entries[i].session_managed,
dock_entries[i].remember_size);
dock_entries[i].remember_size,
dock_entries[i].remember_if_open);
}
void

View File

@ -70,7 +70,7 @@ static GtkWidget *options_preview = NULL;
static GtkWidget *options_eventbox = NULL;
static GtkWidget *options_reset_button = NULL;
static ToolOptions *visible_tool_options = NULL;
static GimpToolOptions *visible_tool_options = NULL;
/* public functions */

View File

@ -104,7 +104,7 @@ static void gimp_airbrush_tool_motion (GimpPaintTool *paint_tool,
static gint airbrush_time_out (gpointer data);
static AirbrushOptions * airbrush_options_new (void);
static void airbrush_options_reset (ToolOptions *tool_options);
static void airbrush_options_reset (GimpToolOptions *tool_options);
/* local variables */
@ -192,7 +192,7 @@ gimp_airbrush_tool_init (GimpAirbrushTool *airbrush)
airbrush_options = airbrush_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_AIRBRUSH_TOOL,
(ToolOptions *) airbrush_options);
(GimpToolOptions *) airbrush_options);
}
tool->tool_cursor = GIMP_AIRBRUSH_TOOL_CURSOR;
@ -504,7 +504,7 @@ airbrush_options_new (void)
options->pressure = options->pressure_d = AIRBRUSH_DEFAULT_PRESSURE;
/* the main vbox */
vbox = ((ToolOptions *) options)->main_vbox;
vbox = ((GimpToolOptions *) options)->main_vbox;
/* the rate scale */
table = gtk_table_new (2, 2, FALSE);
@ -543,7 +543,7 @@ airbrush_options_new (void)
}
static void
airbrush_options_reset (ToolOptions *tool_options)
airbrush_options_reset (GimpToolOptions *tool_options)
{
AirbrushOptions *options;

View File

@ -90,41 +90,41 @@ struct _CloneOptions
static void gimp_clone_tool_class_init (GimpCloneToolClass *klass);
static void gimp_clone_tool_init (GimpCloneTool *tool);
static void gimp_clone_tool_paint (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
PaintState state);
static void gimp_clone_tool_draw (GimpDrawTool *draw_tool);
static void gimp_clone_tool_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_clone_tool_motion (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
GimpDrawable *src_drawable,
static void gimp_clone_tool_paint (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
PaintState state);
static void gimp_clone_tool_draw (GimpDrawTool *draw_tool);
static void gimp_clone_tool_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_clone_tool_motion (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
GimpDrawable *src_drawable,
PaintPressureOptions *pressure_options,
CloneType type,
gint offset_x,
gint offset_y);
static void gimp_clone_tool_line_image (GimpImage *dest,
GimpImage *src,
GimpDrawable *d_drawable,
GimpDrawable *s_drawable,
guchar *s,
guchar *d,
gint has_alpha,
gint src_bytes,
gint dest_bytes,
gint width);
static void gimp_clone_tool_line_pattern (GimpImage *dest,
GimpDrawable *drawable,
GimpPattern *pattern,
guchar *d,
gint x,
gint y,
gint bytes,
gint width);
CloneType type,
gint offset_x,
gint offset_y);
static void gimp_clone_tool_line_image (GimpImage *dest,
GimpImage *src,
GimpDrawable *d_drawable,
GimpDrawable *s_drawable,
guchar *s,
guchar *d,
gint has_alpha,
gint src_bytes,
gint dest_bytes,
gint width);
static void gimp_clone_tool_line_pattern (GimpImage *dest,
GimpDrawable *drawable,
GimpPattern *pattern,
guchar *d,
gint x,
gint y,
gint bytes,
gint width);
static CloneOptions * clone_options_new (void);
static void clone_options_reset (ToolOptions *options);
static void clone_options_reset (GimpToolOptions *options);
/* The parent class */
@ -228,7 +228,7 @@ gimp_clone_tool_init (GimpCloneTool *clone)
clone_options = clone_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_CLONE_TOOL,
(ToolOptions *) clone_options);
(GimpToolOptions *) clone_options);
}
tool->tool_cursor = GIMP_CLONE_TOOL_CURSOR;
@ -804,7 +804,7 @@ clone_options_new (void)
options->aligned = options->aligned_d = CLONE_DEFAULT_ALIGNED;
/* the main vbox */
vbox = ((ToolOptions *) options)->main_vbox;
vbox = ((GimpToolOptions *) options)->main_vbox;
frame = gimp_radio_group_new2 (TRUE, _("Source"),
gimp_radio_button_update,
@ -840,7 +840,7 @@ clone_options_new (void)
}
static void
clone_options_reset (ToolOptions *tool_options)
clone_options_reset (GimpToolOptions *tool_options)
{
CloneOptions *options;

View File

@ -121,7 +121,7 @@ static void gimp_convolve_tool_motion (GimpPaintTool *paint_tool
gdouble rate);
static ConvolveOptions * convolve_options_new (void);
static void convolve_options_reset (ToolOptions *options);
static void convolve_options_reset (GimpToolOptions *options);
/* The parent class */
@ -242,7 +242,7 @@ gimp_convolve_tool_init (GimpConvolveTool *convolve)
convolve_options = convolve_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_CONVOLVE_TOOL,
(ToolOptions *) convolve_options);
(GimpToolOptions *) convolve_options);
}
tool->tool_cursor = GIMP_BLUR_TOOL_CURSOR;
@ -724,7 +724,7 @@ convolve_options_new (void)
options->rate = options->rate_d = DEFAULT_CONVOLVE_RATE;
/* the main vbox */
vbox = ((ToolOptions *) options)->main_vbox;
vbox = ((GimpToolOptions *) options)->main_vbox;
/* the rate scale */
hbox = gtk_hbox_new (FALSE, 4);
@ -765,7 +765,7 @@ convolve_options_new (void)
}
static void
convolve_options_reset (ToolOptions *tool_options)
convolve_options_reset (GimpToolOptions *tool_options)
{
ConvolveOptions *options;

View File

@ -122,7 +122,7 @@ static gfloat gimp_dodgeburn_tool_shadows_lut_func (gpointer user_dat
gfloat value);
static DodgeBurnOptions * gimp_dodgeburn_tool_options_new (void);
static void gimp_dodgeburn_tool_options_reset (ToolOptions *tool_options);
static void gimp_dodgeburn_tool_options_reset (GimpToolOptions *tool_options);
static gdouble non_gui_exposure;
@ -205,7 +205,7 @@ gimp_dodgeburn_tool_init (GimpDodgeBurnTool *dodgeburn)
dodgeburn_options = gimp_dodgeburn_tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_DODGEBURN_TOOL,
(ToolOptions *) dodgeburn_options);
(GimpToolOptions *) dodgeburn_options);
}
tool->tool_cursor = GIMP_DODGE_TOOL_CURSOR;
@ -659,7 +659,7 @@ gimp_dodgeburn_tool_options_new (void)
options->mode = options->mode_d = DODGEBURN_DEFAULT_MODE;
/* the main vbox */
vbox = ((ToolOptions *) options)->main_vbox;
vbox = ((GimpToolOptions *) options)->main_vbox;
/* the exposure scale */
hbox = gtk_hbox_new (FALSE, 4);
@ -721,7 +721,7 @@ gimp_dodgeburn_tool_options_new (void)
}
static void
gimp_dodgeburn_tool_options_reset (ToolOptions *tool_options)
gimp_dodgeburn_tool_options_reset (GimpToolOptions *tool_options)
{
DodgeBurnOptions *options;

View File

@ -86,7 +86,7 @@ static void gimp_eraser_tool_motion (GimpPaintTool *paint_tool,
gboolean anti_erase);
static EraserOptions * gimp_eraser_tool_options_new (void);
static void gimp_eraser_tool_options_reset (ToolOptions *tool_options);
static void gimp_eraser_tool_options_reset (GimpToolOptions *tool_options);
/* local variables */
@ -170,7 +170,7 @@ gimp_eraser_tool_init (GimpEraserTool *eraser)
eraser_options = gimp_eraser_tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_ERASER_TOOL,
(ToolOptions *) eraser_options);
(GimpToolOptions *) eraser_options);
}
tool->tool_cursor = GIMP_ERASER_TOOL_CURSOR;
@ -402,7 +402,7 @@ gimp_eraser_tool_options_new (void)
options->anti_erase = options->anti_erase_d = ERASER_DEFAULT_ANTI_ERASE;
/* the main vbox */
vbox = ((ToolOptions *) options)->main_vbox;
vbox = ((GimpToolOptions *) options)->main_vbox;
/* the hard toggle */
options->hard_w = gtk_check_button_new_with_label (_("Hard Edge"));
@ -428,7 +428,7 @@ gimp_eraser_tool_options_new (void)
}
static void
gimp_eraser_tool_options_reset (ToolOptions *tool_options)
gimp_eraser_tool_options_reset (GimpToolOptions *tool_options)
{
EraserOptions *options;

View File

@ -123,73 +123,73 @@ static void gimp_ink_tool_init (GimpInkTool *tool);
static void gimp_ink_tool_destroy (GtkObject *object);
static InkOptions * ink_options_new (void);
static void ink_options_reset (ToolOptions *tool_options);
static void ink_options_reset (GimpToolOptions *tool_options);
static void ink_button_press (GimpTool *tool,
GdkEventButton *mevent,
GDisplay *gdisp);
static void ink_button_release (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void ink_motion (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void ink_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void ink_control (GimpTool *tool,
ToolAction tool_action,
GDisplay *gdisp);
static void ink_button_press (GimpTool *tool,
GdkEventButton *mevent,
GDisplay *gdisp);
static void ink_button_release (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void ink_motion (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void ink_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void ink_control (GimpTool *tool,
ToolAction tool_action,
GDisplay *gdisp);
static void time_smoother_add (GimpInkTool *ink_tool,
guint32 value);
static gdouble time_smoother_result (GimpInkTool *ink_tool);
static void time_smoother_init (GimpInkTool *ink_tool,
guint32 initval);
static void dist_smoother_add (GimpInkTool *ink_tool,
gdouble value);
static gdouble dist_smoother_result (GimpInkTool *ink_tool);
static void dist_smoother_init (GimpInkTool *ink_tool,
gdouble initval);
static void time_smoother_add (GimpInkTool *ink_tool,
guint32 value);
static gdouble time_smoother_result (GimpInkTool *ink_tool);
static void time_smoother_init (GimpInkTool *ink_tool,
guint32 initval);
static void dist_smoother_add (GimpInkTool *ink_tool,
gdouble value);
static gdouble dist_smoother_result (GimpInkTool *ink_tool);
static void dist_smoother_init (GimpInkTool *ink_tool,
gdouble initval);
static void ink_init (GimpInkTool *ink_tool,
GimpDrawable *drawable,
gdouble x,
gdouble y);
static void ink_finish (GimpInkTool *ink_tool,
GimpDrawable *drawable);
static void ink_init (GimpInkTool *ink_tool,
GimpDrawable *drawable,
gdouble x,
gdouble y);
static void ink_finish (GimpInkTool *ink_tool,
GimpDrawable *drawable);
static void ink_cleanup (void);
static void ink_type_update (GtkWidget *radio_button,
BlobFunc function);
static GdkPixmap * blob_pixmap (GdkColormap *colormap,
GdkVisual *visual,
BlobFunc function);
static void paint_blob (GdkDrawable *drawable,
GdkGC *gc,
Blob *blob);
static void ink_type_update (GtkWidget *radio_button,
BlobFunc function);
static GdkPixmap * blob_pixmap (GdkColormap *colormap,
GdkVisual *visual,
BlobFunc function);
static void paint_blob (GdkDrawable *drawable,
GdkGC *gc,
Blob *blob);
/* Rendering functions */
static void ink_set_paint_area (GimpInkTool *ink_tool,
GimpDrawable *drawable,
Blob *blob);
static void ink_paste (GimpInkTool *ink_tool,
GimpDrawable *drawable,
Blob *blob);
static void ink_set_paint_area (GimpInkTool *ink_tool,
GimpDrawable *drawable,
Blob *blob);
static void ink_paste (GimpInkTool *ink_tool,
GimpDrawable *drawable,
Blob *blob);
static void ink_to_canvas_tiles (GimpInkTool *ink_tool,
Blob *blob,
guchar *color);
static void ink_to_canvas_tiles (GimpInkTool *ink_tool,
Blob *blob,
guchar *color);
static void ink_set_undo_tiles (GimpDrawable *drawable,
gint x,
gint y,
gint w,
gint h);
static void ink_set_canvas_tiles (gint x,
gint y,
gint w,
gint h);
static void ink_set_undo_tiles (GimpDrawable *drawable,
gint x,
gint y,
gint w,
gint h);
static void ink_set_canvas_tiles (gint x,
gint y,
gint w,
gint h);
/* Brush pseudo-widget callbacks */
static void brush_widget_active_rect (BrushWidget *brush_widget,
@ -303,9 +303,9 @@ gimp_ink_tool_init (GimpInkTool *ink_tool)
ink_options = ink_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_INK_TOOL,
(ToolOptions *) ink_options);
(GimpToolOptions *) ink_options);
ink_options_reset ((ToolOptions *) ink_options);
ink_options_reset ((GimpToolOptions *) ink_options);
}
}
@ -338,7 +338,7 @@ ink_type_update (GtkWidget *radio_button,
}
static void
ink_options_reset (ToolOptions *tool_options)
ink_options_reset (GimpToolOptions *tool_options)
{
InkOptions *options;
@ -398,7 +398,7 @@ ink_options_new (void)
/* the main vbox */
vbox = gtk_vbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (((ToolOptions *) options)->main_vbox), vbox,
gtk_box_pack_start (GTK_BOX (((GimpToolOptions *) options)->main_vbox), vbox,
TRUE, TRUE, 0);
gtk_widget_show (vbox);

View File

@ -147,7 +147,7 @@ gimp_paintbrush_tool_init (GimpPaintbrushTool *paintbrush)
paint_options_reset);
tool_manager_register_tool_options (GIMP_TYPE_PAINTBRUSH_TOOL,
(ToolOptions *) paintbrush_options);
(GimpToolOptions *) paintbrush_options);
}
tool->tool_cursor = GIMP_PAINTBRUSH_TOOL_CURSOR;

View File

@ -140,7 +140,7 @@ gimp_pencil_tool_init (GimpPencilTool *pencil)
paint_options_reset);
tool_manager_register_tool_options (GIMP_TYPE_PENCIL_TOOL,
(ToolOptions *) pencil_options);
(GimpToolOptions *) pencil_options);
}
tool->tool_cursor = GIMP_PENCIL_TOOL_CURSOR;

View File

@ -95,7 +95,7 @@ static void gimp_smudge_tool_allocate_accum_buffer (gint w,
guchar *do_fill);
static SmudgeOptions * smudge_options_new (void);
static void smudge_options_reset (ToolOptions *tool_options);
static void smudge_options_reset (GimpToolOptions *tool_options);
/* local variables */
@ -177,7 +177,7 @@ gimp_smudge_tool_init (GimpSmudgeTool *smudge)
smudge_options = smudge_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_SMUDGE_TOOL,
(ToolOptions *) smudge_options);
(GimpToolOptions *) smudge_options);
}
tool->tool_cursor = GIMP_SMUDGE_TOOL_CURSOR;
@ -533,7 +533,7 @@ smudge_options_new (void)
options->rate = options->rate_d = SMUDGE_DEFAULT_RATE;
/* the main vbox */
vbox = ((ToolOptions *) options)->main_vbox;
vbox = ((GimpToolOptions *) options)->main_vbox;
/* the rate scale */
hbox = gtk_hbox_new (FALSE, 4);
@ -560,7 +560,7 @@ smudge_options_new (void)
}
static void
smudge_options_reset (ToolOptions *tool_options)
smudge_options_reset (GimpToolOptions *tool_options)
{
SmudgeOptions *options;

View File

@ -90,41 +90,41 @@ struct _CloneOptions
static void gimp_clone_tool_class_init (GimpCloneToolClass *klass);
static void gimp_clone_tool_init (GimpCloneTool *tool);
static void gimp_clone_tool_paint (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
PaintState state);
static void gimp_clone_tool_draw (GimpDrawTool *draw_tool);
static void gimp_clone_tool_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_clone_tool_motion (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
GimpDrawable *src_drawable,
static void gimp_clone_tool_paint (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
PaintState state);
static void gimp_clone_tool_draw (GimpDrawTool *draw_tool);
static void gimp_clone_tool_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_clone_tool_motion (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
GimpDrawable *src_drawable,
PaintPressureOptions *pressure_options,
CloneType type,
gint offset_x,
gint offset_y);
static void gimp_clone_tool_line_image (GimpImage *dest,
GimpImage *src,
GimpDrawable *d_drawable,
GimpDrawable *s_drawable,
guchar *s,
guchar *d,
gint has_alpha,
gint src_bytes,
gint dest_bytes,
gint width);
static void gimp_clone_tool_line_pattern (GimpImage *dest,
GimpDrawable *drawable,
GimpPattern *pattern,
guchar *d,
gint x,
gint y,
gint bytes,
gint width);
CloneType type,
gint offset_x,
gint offset_y);
static void gimp_clone_tool_line_image (GimpImage *dest,
GimpImage *src,
GimpDrawable *d_drawable,
GimpDrawable *s_drawable,
guchar *s,
guchar *d,
gint has_alpha,
gint src_bytes,
gint dest_bytes,
gint width);
static void gimp_clone_tool_line_pattern (GimpImage *dest,
GimpDrawable *drawable,
GimpPattern *pattern,
guchar *d,
gint x,
gint y,
gint bytes,
gint width);
static CloneOptions * clone_options_new (void);
static void clone_options_reset (ToolOptions *options);
static void clone_options_reset (GimpToolOptions *options);
/* The parent class */
@ -228,7 +228,7 @@ gimp_clone_tool_init (GimpCloneTool *clone)
clone_options = clone_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_CLONE_TOOL,
(ToolOptions *) clone_options);
(GimpToolOptions *) clone_options);
}
tool->tool_cursor = GIMP_CLONE_TOOL_CURSOR;
@ -804,7 +804,7 @@ clone_options_new (void)
options->aligned = options->aligned_d = CLONE_DEFAULT_ALIGNED;
/* the main vbox */
vbox = ((ToolOptions *) options)->main_vbox;
vbox = ((GimpToolOptions *) options)->main_vbox;
frame = gimp_radio_group_new2 (TRUE, _("Source"),
gimp_radio_button_update,
@ -840,7 +840,7 @@ clone_options_new (void)
}
static void
clone_options_reset (ToolOptions *tool_options)
clone_options_reset (GimpToolOptions *tool_options)
{
CloneOptions *options;

View File

@ -242,63 +242,6 @@ path_list_free (PathList* iml)
g_free (iml);
}
GimpBezierSelectTool *
path_to_beziersel (Path *bzp)
{
GimpBezierSelectTool *bezier_sel;
GimpBezierSelectPoint *bpnt = NULL;
GSList *list;
if (!bzp)
g_warning ("path_to_beziersel: NULL bzp");
list = bzp->path_details;
bezier_sel = g_new0 (GimpBezierSelectTool, 1);
bezier_sel->num_points = 0;
bezier_sel->mask = NULL;
bezier_select_reset (bezier_sel);
bezier_sel->closed = bzp->closed;
/* bezier_sel->state = BEZIER_ADD; */
bezier_sel->state = bzp->state;
while (list)
{
PathPoint *pdata;
pdata = (PathPoint *) list->data;
if (pdata->type == BEZIER_MOVE)
{
bezier_sel->last_point->next = bpnt;
bpnt->prev = bezier_sel->last_point;
bezier_sel->cur_anchor = NULL;
bezier_sel->cur_control = NULL;
bpnt = NULL;
}
bezier_add_point (bezier_sel,
(gint) pdata->type,
RINT (pdata->x),
RINT (pdata->y));
if (bpnt == NULL)
bpnt = bezier_sel->last_point;
list = g_slist_next (list);
}
if ( bezier_sel->closed )
{
bezier_sel->last_point->next = bpnt;
bpnt->prev = bezier_sel->last_point;
bezier_sel->cur_anchor = bezier_sel->points;
bezier_sel->cur_control = bezier_sel-> points->next;
}
return bezier_sel;
}
/* Always return a copy that must be freed later */

View File

@ -77,7 +77,6 @@ PathList* path_list_new (GimpImage *gimage,
GSList *bz_paths);
void path_list_free (PathList *plist);
GimpBezierSelectTool* path_to_beziersel (Path *path);
#endif /* __PATH_H__ */

View File

@ -104,7 +104,7 @@ static void gimp_airbrush_tool_motion (GimpPaintTool *paint_tool,
static gint airbrush_time_out (gpointer data);
static AirbrushOptions * airbrush_options_new (void);
static void airbrush_options_reset (ToolOptions *tool_options);
static void airbrush_options_reset (GimpToolOptions *tool_options);
/* local variables */
@ -192,7 +192,7 @@ gimp_airbrush_tool_init (GimpAirbrushTool *airbrush)
airbrush_options = airbrush_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_AIRBRUSH_TOOL,
(ToolOptions *) airbrush_options);
(GimpToolOptions *) airbrush_options);
}
tool->tool_cursor = GIMP_AIRBRUSH_TOOL_CURSOR;
@ -504,7 +504,7 @@ airbrush_options_new (void)
options->pressure = options->pressure_d = AIRBRUSH_DEFAULT_PRESSURE;
/* the main vbox */
vbox = ((ToolOptions *) options)->main_vbox;
vbox = ((GimpToolOptions *) options)->main_vbox;
/* the rate scale */
table = gtk_table_new (2, 2, FALSE);
@ -543,7 +543,7 @@ airbrush_options_new (void)
}
static void
airbrush_options_reset (ToolOptions *tool_options)
airbrush_options_reset (GimpToolOptions *tool_options)
{
AirbrushOptions *options;

View File

@ -50,6 +50,8 @@
#include "app_procs.h"
#include "errors.h"
#include "gdisplay.h"
#include "path.h"
#include "pathP.h"
#include "undo.h"
#include "libgimp/gimpintl.h"
@ -370,7 +372,7 @@ gimp_bezier_select_tool_init (GimpBezierSelectTool *bezier_select)
selection_options_reset);
tool_manager_register_tool_options (GIMP_TYPE_BEZIER_SELECT_TOOL,
(ToolOptions *) bezier_options);
(GimpToolOptions *) bezier_options);
}
bezier_select->num_points = 0;
@ -1099,6 +1101,63 @@ bezier_select_free (GimpBezierSelectTool *bezier_sel)
g_free (bezier_sel);
}
GimpBezierSelectTool *
path_to_beziersel (Path *bzp)
{
GimpBezierSelectTool *bezier_sel;
GimpBezierSelectPoint *bpnt = NULL;
GSList *list;
if (!bzp)
g_warning ("path_to_beziersel: NULL bzp");
list = bzp->path_details;
bezier_sel = g_new0 (GimpBezierSelectTool, 1);
bezier_sel->num_points = 0;
bezier_sel->mask = NULL;
bezier_select_reset (bezier_sel);
bezier_sel->closed = bzp->closed;
/* bezier_sel->state = BEZIER_ADD; */
bezier_sel->state = bzp->state;
while (list)
{
PathPoint *pdata;
pdata = (PathPoint *) list->data;
if (pdata->type == BEZIER_MOVE)
{
bezier_sel->last_point->next = bpnt;
bpnt->prev = bezier_sel->last_point;
bezier_sel->cur_anchor = NULL;
bezier_sel->cur_control = NULL;
bpnt = NULL;
}
bezier_add_point (bezier_sel,
(gint) pdata->type,
RINT (pdata->x),
RINT (pdata->y));
if (bpnt == NULL)
bpnt = bezier_sel->last_point;
list = g_slist_next (list);
}
if ( bezier_sel->closed )
{
bezier_sel->last_point->next = bpnt;
bpnt->prev = bezier_sel->last_point;
bezier_sel->cur_anchor = bezier_sel->points;
bezier_sel->cur_control = bezier_sel-> points->next;
}
return bezier_sel;
}
/* Find the curve that points to this curve. This makes to_check point
* the start of a curve.
*/

View File

@ -140,8 +140,11 @@ void bezier_draw_curve (GimpBezierSelectTool *bezier_sel
GimpBezierSelectPointsFunc func,
gint coord,
gpointer data);
void bezier_select_reset (GimpBezierSelectTool *bezier_sel);
void bezier_select_free (GimpBezierSelectTool *bezier_sel);
GimpBezierSelectTool* path_to_beziersel (Path *path);
void bezier_add_point (GimpBezierSelectTool *bezier_sel,
gint type,
gdouble x,

View File

@ -132,73 +132,73 @@ typedef struct
static void gimp_blend_tool_class_init (GimpBlendToolClass *klass);
static void gimp_blend_tool_init (GimpBlendTool *blend_tool);
static void gimp_blend_tool_destroy (GtkObject *object);
static void gimp_blend_tool_destroy (GtkObject *object);
static void gradient_type_callback (GtkWidget *widget,
gpointer data);
static void gradient_type_callback (GtkWidget *widget,
gpointer data);
static void gimp_blend_tool_button_press (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void gimp_blend_tool_button_release (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void gimp_blend_tool_motion (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_blend_tool_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_blend_tool_button_press (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void gimp_blend_tool_button_release (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void gimp_blend_tool_motion (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_blend_tool_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_blend_tool_draw (GimpDrawTool *draw_tool);
static void gimp_blend_tool_draw (GimpDrawTool *draw_tool);
static BlendOptions * blend_options_new (void);
static void blend_options_reset (ToolOptions *tool_options);
static void blend_options_reset (GimpToolOptions *tool_options);
static void gradient_type_callback (GtkWidget *widget,
gpointer data);
static void blend_options_drop_gradient (GtkWidget *widget,
GimpViewable *viewable,
gpointer data);
static void blend_options_drop_tool (GtkWidget *widget,
GimpViewable *viewable,
gpointer data);
static void gradient_type_callback (GtkWidget *widget,
gpointer data);
static void blend_options_drop_gradient (GtkWidget *widget,
GimpViewable *viewable,
gpointer data);
static void blend_options_drop_tool (GtkWidget *widget,
GimpViewable *viewable,
gpointer data);
static gdouble gradient_calc_conical_sym_factor (gdouble dist,
gdouble *axis,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_conical_asym_factor (gdouble dist,
gdouble *axis,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_square_factor (gdouble dist,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_radial_factor (gdouble dist,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_linear_factor (gdouble dist,
gdouble *vec,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_bilinear_factor (gdouble dist,
gdouble *vec,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_spiral_factor (gdouble dist,
gdouble *axis,
gdouble offset,
gdouble x,
gdouble y,
gint cwise);
static gdouble gradient_calc_conical_sym_factor (gdouble dist,
gdouble *axis,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_conical_asym_factor (gdouble dist,
gdouble *axis,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_square_factor (gdouble dist,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_radial_factor (gdouble dist,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_linear_factor (gdouble dist,
gdouble *vec,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_bilinear_factor (gdouble dist,
gdouble *vec,
gdouble offset,
gdouble x,
gdouble y);
static gdouble gradient_calc_spiral_factor (gdouble dist,
gdouble *axis,
gdouble offset,
gdouble x,
gdouble y,
gint cwise);
static gdouble gradient_calc_shapeburst_angular_factor (gdouble x,
gdouble y);
@ -345,7 +345,7 @@ gimp_blend_tool_init (GimpBlendTool *blend_tool)
blend_options = blend_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_BLEND_TOOL,
(ToolOptions *) blend_options);
(GimpToolOptions *) blend_options);
}
tool->tool_cursor = GIMP_BLEND_TOOL_CURSOR;
@ -670,7 +670,7 @@ blend_options_new (void)
options->threshold = options->threshold_d = 0.2;
/* the main vbox */
vbox = ((ToolOptions *) options)->main_vbox;
vbox = ((GimpToolOptions *) options)->main_vbox;
/* dnd stuff */
gtk_drag_dest_set (vbox,
@ -828,7 +828,7 @@ blend_options_new (void)
}
static void
blend_options_reset (ToolOptions *tool_options)
blend_options_reset (GimpToolOptions *tool_options)
{
BlendOptions *options;

View File

@ -111,7 +111,7 @@ static void brightness_contrast_contrast_adjustment_update (GtkAdjustment *a
/* the brightness-contrast tool options */
static ToolOptions *brightness_contrast_options = NULL;
static GimpToolOptions *brightness_contrast_options = NULL;
/* the brightness-contrast dialog */
static BrightnessContrastDialog *brightness_contrast_dialog = NULL;
@ -189,7 +189,7 @@ gimp_brightness_contrast_tool_init (GimpBrightnessContrastTool *bc_tool)
brightness_contrast_options = tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_BRIGHTNESS_CONTRAST_TOOL,
(ToolOptions *) brightness_contrast_options);
(GimpToolOptions *) brightness_contrast_options);
}
}

View File

@ -91,35 +91,35 @@ static void gimp_bucket_fill_tool_init (GimpBucketFillTool *bucket_
static void gimp_bucket_fill_tool_destroy (GtkObject *object);
static BucketOptions * bucket_options_new (void);
static void bucket_options_reset (ToolOptions *tool_options);
static void bucket_options_reset (GimpToolOptions *tool_options);
static void gimp_bucket_fill_tool_button_press (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void gimp_bucket_fill_tool_button_release (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void gimp_bucket_fill_tool_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_bucket_fill_tool_modifier_key (GimpTool *tool,
GdkEventKey *kevent,
GDisplay *gdisp);
static void gimp_bucket_fill_tool_button_press (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void gimp_bucket_fill_tool_button_release (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void gimp_bucket_fill_tool_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_bucket_fill_tool_modifier_key (GimpTool *tool,
GdkEventKey *kevent,
GDisplay *gdisp);
static void bucket_fill_line_color (guchar *,
guchar *,
guchar *,
gboolean ,
gint ,
gint );
static void bucket_fill_line_pattern (guchar *,
guchar *,
TempBuf *,
gboolean ,
gint ,
gint ,
gint ,
gint );
static void bucket_fill_line_color (guchar *,
guchar *,
guchar *,
gboolean ,
gint ,
gint );
static void bucket_fill_line_pattern (guchar *,
guchar *,
TempBuf *,
gboolean ,
gint ,
gint ,
gint ,
gint );
/* functions */
@ -194,9 +194,9 @@ gimp_bucket_fill_tool_init (GimpBucketFillTool *bucket_fill_tool)
bucket_options = bucket_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_BUCKET_FILL_TOOL,
(ToolOptions *) bucket_options);
(GimpToolOptions *) bucket_options);
bucket_options_reset ((ToolOptions *) bucket_options);
bucket_options_reset ((GimpToolOptions *) bucket_options);
}
tool->tool_cursor = GIMP_BUCKET_FILL_TOOL_CURSOR;
@ -212,7 +212,7 @@ gimp_bucket_fill_tool_destroy (GtkObject *object)
}
static void
bucket_options_reset (ToolOptions *tool_options)
bucket_options_reset (GimpToolOptions *tool_options)
{
BucketOptions *options;
@ -249,7 +249,7 @@ bucket_options_new (void)
options->fill_mode = options->fill_mode_d = FG_BUCKET_FILL;
/* the main vbox */
vbox = ((ToolOptions *) options)->main_vbox;
vbox = ((GimpToolOptions *) options)->main_vbox;
/* the sample merged toggle */
options->sample_merged_w =

View File

@ -314,7 +314,7 @@ gimp_by_color_select_tool_init (GimpByColorSelectTool *by_color_select)
selection_options_reset);
tool_manager_register_tool_options (GIMP_TYPE_BY_COLOR_SELECT_TOOL,
(ToolOptions *) by_color_options);
(GimpToolOptions *) by_color_options);
}
/* Temporary until we find out how to make a new one */
tool->tool_cursor = GIMP_RECT_SELECT_TOOL_CURSOR;

View File

@ -90,41 +90,41 @@ struct _CloneOptions
static void gimp_clone_tool_class_init (GimpCloneToolClass *klass);
static void gimp_clone_tool_init (GimpCloneTool *tool);
static void gimp_clone_tool_paint (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
PaintState state);
static void gimp_clone_tool_draw (GimpDrawTool *draw_tool);
static void gimp_clone_tool_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_clone_tool_motion (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
GimpDrawable *src_drawable,
static void gimp_clone_tool_paint (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
PaintState state);
static void gimp_clone_tool_draw (GimpDrawTool *draw_tool);
static void gimp_clone_tool_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_clone_tool_motion (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
GimpDrawable *src_drawable,
PaintPressureOptions *pressure_options,
CloneType type,
gint offset_x,
gint offset_y);
static void gimp_clone_tool_line_image (GimpImage *dest,
GimpImage *src,
GimpDrawable *d_drawable,
GimpDrawable *s_drawable,
guchar *s,
guchar *d,
gint has_alpha,
gint src_bytes,
gint dest_bytes,
gint width);
static void gimp_clone_tool_line_pattern (GimpImage *dest,
GimpDrawable *drawable,
GimpPattern *pattern,
guchar *d,
gint x,
gint y,
gint bytes,
gint width);
CloneType type,
gint offset_x,
gint offset_y);
static void gimp_clone_tool_line_image (GimpImage *dest,
GimpImage *src,
GimpDrawable *d_drawable,
GimpDrawable *s_drawable,
guchar *s,
guchar *d,
gint has_alpha,
gint src_bytes,
gint dest_bytes,
gint width);
static void gimp_clone_tool_line_pattern (GimpImage *dest,
GimpDrawable *drawable,
GimpPattern *pattern,
guchar *d,
gint x,
gint y,
gint bytes,
gint width);
static CloneOptions * clone_options_new (void);
static void clone_options_reset (ToolOptions *options);
static void clone_options_reset (GimpToolOptions *options);
/* The parent class */
@ -228,7 +228,7 @@ gimp_clone_tool_init (GimpCloneTool *clone)
clone_options = clone_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_CLONE_TOOL,
(ToolOptions *) clone_options);
(GimpToolOptions *) clone_options);
}
tool->tool_cursor = GIMP_CLONE_TOOL_CURSOR;
@ -804,7 +804,7 @@ clone_options_new (void)
options->aligned = options->aligned_d = CLONE_DEFAULT_ALIGNED;
/* the main vbox */
vbox = ((ToolOptions *) options)->main_vbox;
vbox = ((GimpToolOptions *) options)->main_vbox;
frame = gimp_radio_group_new2 (TRUE, _("Source"),
gimp_radio_button_update,
@ -840,7 +840,7 @@ clone_options_new (void)
}
static void
clone_options_reset (ToolOptions *tool_options)
clone_options_reset (GimpToolOptions *tool_options)
{
CloneOptions *options;

View File

@ -93,7 +93,7 @@ static void color_balance_yb_adjustment_update (GtkAdjustment *adj,
/* the color balance tool options */
static ToolOptions *color_balance_options = NULL;
static GimpToolOptions *color_balance_options = NULL;
/* the color balance dialog */
static ColorBalanceDialog *color_balance_dialog = NULL;
@ -173,7 +173,7 @@ gimp_color_balance_tool_init (GimpColorBalanceTool *bc_tool)
color_balance_options = tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_COLOR_BALANCE_TOOL,
(ToolOptions *) color_balance_options);
(GimpToolOptions *) color_balance_options);
}
}

View File

@ -55,7 +55,7 @@ typedef struct _GimpColorPickerToolOptions GimpColorPickerToolOptions;
struct _GimpColorPickerToolOptions
{
ToolOptions tool_options;
GimpToolOptions tool_options;
gboolean sample_merged;
gboolean sample_merged_d;
@ -108,7 +108,7 @@ static void gimp_color_picker_tool_draw (GimpDrawTool *draw_to
static GimpColorPickerToolOptions * gimp_color_picker_tool_options_new (void);
static void gimp_color_picker_tool_options_reset (ToolOptions *tool_options);
static void gimp_color_picker_tool_options_reset (GimpToolOptions *tool_options);
static void gimp_color_picker_tool_info_window_close_callback (GtkWidget *widget,
gpointer data);
static void gimp_color_picker_tool_info_update (GimpTool *tool,
@ -224,7 +224,7 @@ gimp_color_picker_tool_init (GimpColorPickerTool *color_picker_tool)
gimp_color_picker_tool_options = gimp_color_picker_tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_COLOR_PICKER_TOOL,
(ToolOptions *) gimp_color_picker_tool_options);
(GimpToolOptions *) gimp_color_picker_tool_options);
}
tool->preserve = FALSE; /* Don't preserve on drawable change */
@ -256,7 +256,7 @@ gimp_color_picker_tool_destroy (GtkObject *object)
}
static void
gimp_color_picker_tool_options_reset (ToolOptions *tool_options)
gimp_color_picker_tool_options_reset (GimpToolOptions *tool_options)
{
GimpColorPickerToolOptions *options;
@ -284,7 +284,7 @@ gimp_color_picker_tool_options_new (void)
GtkWidget *scale;
options = g_new0 (GimpColorPickerToolOptions, 1);
tool_options_init ((ToolOptions *) options,
tool_options_init ((GimpToolOptions *) options,
gimp_color_picker_tool_options_reset);
options->sample_merged = options->sample_merged_d = FALSE;

View File

@ -121,7 +121,7 @@ static void gimp_convolve_tool_motion (GimpPaintTool *paint_tool
gdouble rate);
static ConvolveOptions * convolve_options_new (void);
static void convolve_options_reset (ToolOptions *options);
static void convolve_options_reset (GimpToolOptions *options);
/* The parent class */
@ -242,7 +242,7 @@ gimp_convolve_tool_init (GimpConvolveTool *convolve)
convolve_options = convolve_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_CONVOLVE_TOOL,
(ToolOptions *) convolve_options);
(GimpToolOptions *) convolve_options);
}
tool->tool_cursor = GIMP_BLUR_TOOL_CURSOR;
@ -724,7 +724,7 @@ convolve_options_new (void)
options->rate = options->rate_d = DEFAULT_CONVOLVE_RATE;
/* the main vbox */
vbox = ((ToolOptions *) options)->main_vbox;
vbox = ((GimpToolOptions *) options)->main_vbox;
/* the rate scale */
hbox = gtk_hbox_new (FALSE, 4);
@ -765,7 +765,7 @@ convolve_options_new (void)
}
static void
convolve_options_reset (ToolOptions *tool_options)
convolve_options_reset (GimpToolOptions *tool_options)
{
ConvolveOptions *options;

View File

@ -67,7 +67,7 @@ typedef struct _CropOptions CropOptions;
struct _CropOptions
{
ToolOptions tool_options;
GimpToolOptions tool_options;
gboolean layer_only;
gboolean layer_only_d;
@ -99,68 +99,68 @@ static GtkWidget *size_sizeentry;
static void gimp_crop_tool_class_init (GimpCropToolClass *klass);
static void gimp_crop_tool_init (GimpCropTool *crop_tool);
static void gimp_crop_tool_destroy (GtkObject *object);
static void gimp_crop_tool_destroy (GtkObject *object);
static void gimp_crop_tool_button_press (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void gimp_crop_tool_button_release (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void gimp_crop_tool_motion (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_crop_tool_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_crop_tool_control (GimpTool *tool,
ToolAction action,
GDisplay *gdisp);
static void gimp_crop_tool_arrow_key (GimpTool *tool,
GdkEventKey *kevent,
GDisplay *gdisp);
static void gimp_crop_tool_modifier_key (GimpTool *tool,
GdkEventKey *kevent,
GDisplay *gdisp);
static void gimp_crop_tool_button_press (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void gimp_crop_tool_button_release (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void gimp_crop_tool_motion (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_crop_tool_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_crop_tool_control (GimpTool *tool,
ToolAction action,
GDisplay *gdisp);
static void gimp_crop_tool_arrow_key (GimpTool *tool,
GdkEventKey *kevent,
GDisplay *gdisp);
static void gimp_crop_tool_modifier_key (GimpTool *tool,
GdkEventKey *kevent,
GDisplay *gdisp);
static void gimp_crop_tool_draw (GimpDrawTool *draw_tool);
static void gimp_crop_tool_draw (GimpDrawTool *draw_tool);
/* Crop helper functions */
static void crop_tool_crop_image (GimpImage *gimage,
gint x1,
gint y1,
gint x2,
gint y2,
gboolean layer_only,
gboolean crop_layers);
static void crop_tool_crop_image (GimpImage *gimage,
gint x1,
gint y1,
gint x2,
gint y2,
gboolean layer_only,
gboolean crop_layers);
static void crop_recalc (GimpTool *tool,
GimpCropTool *crop);
static void crop_start (GimpTool *tool,
GimpCropTool *crop);
static void crop_recalc (GimpTool *tool,
GimpCropTool *crop);
static void crop_start (GimpTool *tool,
GimpCropTool *crop);
/* Crop dialog functions */
static void crop_info_update (GimpTool *tool);
static void crop_info_create (GimpTool *tool);
static void crop_crop_callback (GtkWidget *widget,
gpointer data);
static void crop_resize_callback (GtkWidget *widget,
gpointer data);
static void crop_close_callback (GtkWidget *widget,
gpointer data);
static void crop_info_update (GimpTool *tool);
static void crop_info_create (GimpTool *tool);
static void crop_crop_callback (GtkWidget *widget,
gpointer data);
static void crop_resize_callback (GtkWidget *widget,
gpointer data);
static void crop_close_callback (GtkWidget *widget,
gpointer data);
static void crop_selection_callback (GtkWidget *widget,
gpointer data);
static void crop_automatic_callback (GtkWidget *widget,
gpointer data);
static void crop_selection_callback (GtkWidget *widget,
gpointer data);
static void crop_automatic_callback (GtkWidget *widget,
gpointer data);
static void crop_orig_changed (GtkWidget *widget,
gpointer data);
static void crop_size_changed (GtkWidget *widget,
gpointer data);
static void crop_orig_changed (GtkWidget *widget,
gpointer data);
static void crop_size_changed (GtkWidget *widget,
gpointer data);
static CropOptions * crop_options_new (void);
static void crop_options_reset (ToolOptions *tool_options);
static void crop_options_reset (GimpToolOptions *tool_options);
static GimpDrawToolClass *parent_class = NULL;
@ -244,7 +244,7 @@ gimp_crop_tool_init (GimpCropTool *crop_tool)
crop_options = crop_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_CROP_TOOL,
(ToolOptions *) crop_options);
(GimpToolOptions *) crop_options);
}
tool->preserve = FALSE; /* Don't preserve on drawable change */
@ -1227,7 +1227,7 @@ crop_options_new (void)
GtkWidget *frame;
options = g_new0 (CropOptions, 1);
tool_options_init ((ToolOptions *) options,
tool_options_init ((GimpToolOptions *) options,
crop_options_reset);
options->layer_only = options->layer_only_d = FALSE;
@ -1279,7 +1279,7 @@ crop_options_new (void)
}
static void
crop_options_reset (ToolOptions *tool_options)
crop_options_reset (GimpToolOptions *tool_options)
{
CropOptions *options;

View File

@ -175,7 +175,7 @@ static void curves_write_to_file (FILE *f);
/* the curves tool options */
static ToolOptions * curves_options = NULL;
static GimpToolOptions * curves_options = NULL;
/* the curves dialog */
static CurvesDialog * curves_dialog = NULL;
@ -270,7 +270,7 @@ gimp_curves_tool_init (GimpCurvesTool *bc_tool)
curves_options = tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_CURVES_TOOL,
(ToolOptions *) curves_options);
(GimpToolOptions *) curves_options);
}
}

View File

@ -122,7 +122,7 @@ static gfloat gimp_dodgeburn_tool_shadows_lut_func (gpointer user_dat
gfloat value);
static DodgeBurnOptions * gimp_dodgeburn_tool_options_new (void);
static void gimp_dodgeburn_tool_options_reset (ToolOptions *tool_options);
static void gimp_dodgeburn_tool_options_reset (GimpToolOptions *tool_options);
static gdouble non_gui_exposure;
@ -205,7 +205,7 @@ gimp_dodgeburn_tool_init (GimpDodgeBurnTool *dodgeburn)
dodgeburn_options = gimp_dodgeburn_tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_DODGEBURN_TOOL,
(ToolOptions *) dodgeburn_options);
(GimpToolOptions *) dodgeburn_options);
}
tool->tool_cursor = GIMP_DODGE_TOOL_CURSOR;
@ -659,7 +659,7 @@ gimp_dodgeburn_tool_options_new (void)
options->mode = options->mode_d = DODGEBURN_DEFAULT_MODE;
/* the main vbox */
vbox = ((ToolOptions *) options)->main_vbox;
vbox = ((GimpToolOptions *) options)->main_vbox;
/* the exposure scale */
hbox = gtk_hbox_new (FALSE, 4);
@ -721,7 +721,7 @@ gimp_dodgeburn_tool_options_new (void)
}
static void
gimp_dodgeburn_tool_options_reset (ToolOptions *tool_options)
gimp_dodgeburn_tool_options_reset (GimpToolOptions *tool_options)
{
DodgeBurnOptions *options;

View File

@ -191,7 +191,7 @@ gimp_ellipse_select_tool_init (GimpEllipseSelectTool *ellipse_select)
selection_options_reset);
tool_manager_register_tool_options (GIMP_TYPE_ELLIPSE_SELECT_TOOL,
(ToolOptions *) ellipse_options);
(GimpToolOptions *) ellipse_options);
}
tool->tool_cursor = GIMP_ELLIPSE_SELECT_TOOL_CURSOR;

View File

@ -86,7 +86,7 @@ static void gimp_eraser_tool_motion (GimpPaintTool *paint_tool,
gboolean anti_erase);
static EraserOptions * gimp_eraser_tool_options_new (void);
static void gimp_eraser_tool_options_reset (ToolOptions *tool_options);
static void gimp_eraser_tool_options_reset (GimpToolOptions *tool_options);
/* local variables */
@ -170,7 +170,7 @@ gimp_eraser_tool_init (GimpEraserTool *eraser)
eraser_options = gimp_eraser_tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_ERASER_TOOL,
(ToolOptions *) eraser_options);
(GimpToolOptions *) eraser_options);
}
tool->tool_cursor = GIMP_ERASER_TOOL_CURSOR;
@ -402,7 +402,7 @@ gimp_eraser_tool_options_new (void)
options->anti_erase = options->anti_erase_d = ERASER_DEFAULT_ANTI_ERASE;
/* the main vbox */
vbox = ((ToolOptions *) options)->main_vbox;
vbox = ((GimpToolOptions *) options)->main_vbox;
/* the hard toggle */
options->hard_w = gtk_check_button_new_with_label (_("Hard Edge"));
@ -428,7 +428,7 @@ gimp_eraser_tool_options_new (void)
}
static void
gimp_eraser_tool_options_reset (ToolOptions *tool_options)
gimp_eraser_tool_options_reset (GimpToolOptions *tool_options)
{
EraserOptions *options;

View File

@ -62,7 +62,7 @@ typedef struct _FlipOptions FlipOptions;
struct _FlipOptions
{
ToolOptions tool_options;
GimpToolOptions tool_options;
InternalOrientationType type;
InternalOrientationType type_d;
@ -89,7 +89,7 @@ static TileManager * gimp_flip_tool_transform (GimpTransformTool *tool,
TransformState state);
static FlipOptions * flip_options_new (void);
static void flip_options_reset (ToolOptions *tool_options);
static void flip_options_reset (GimpToolOptions *tool_options);
static FlipOptions *flip_options = NULL;
@ -250,7 +250,7 @@ gimp_flip_tool_init (GimpFlipTool *flip_tool)
flip_options = flip_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_FLIP_TOOL,
(ToolOptions *) flip_options);
(GimpToolOptions *) flip_options);
}
tool->tool_cursor = GIMP_FLIP_HORIZONTAL_TOOL_CURSOR;
@ -387,7 +387,7 @@ flip_options_new (void)
GtkWidget *frame;
options = g_new0 (FlipOptions, 1);
tool_options_init ((ToolOptions *) options,
tool_options_init ((GimpToolOptions *) options,
flip_options_reset);
options->type = options->type_d = ORIENTATION_HORIZONTAL;
@ -415,7 +415,7 @@ flip_options_new (void)
}
static void
flip_options_reset (ToolOptions *tool_options)
flip_options_reset (GimpToolOptions *tool_options)
{
FlipOptions *options;

View File

@ -203,7 +203,7 @@ gimp_free_select_tool_init (GimpFreeSelectTool *free_select)
selection_options_reset);
tool_manager_register_tool_options (GIMP_TYPE_FREE_SELECT_TOOL,
(ToolOptions *) free_options);
(GimpToolOptions *) free_options);
}
tool->tool_cursor = GIMP_FREE_SELECT_TOOL_CURSOR;

View File

@ -460,7 +460,7 @@ gimp_fuzzy_select_tool_init (GimpFuzzySelectTool *fuzzy_select)
selection_options_reset);
tool_manager_register_tool_options (GIMP_TYPE_FUZZY_SELECT_TOOL,
(ToolOptions *) fuzzy_options);
(GimpToolOptions *) fuzzy_options);
}
tool->tool_cursor = GIMP_FUZZY_SELECT_TOOL_CURSOR;

View File

@ -79,7 +79,7 @@ static void histogram_tool_dialog_update (HistogramToolDialog *htd,
/* the histogram tool options */
static ToolOptions * histogram_options = NULL;
static GimpToolOptions * histogram_options = NULL;
/* the histogram tool dialog */
static HistogramToolDialog * histogram_dialog = NULL;
@ -157,7 +157,7 @@ gimp_histogram_tool_init (GimpHistogramTool *bc_tool)
histogram_options = tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_HISTOGRAM_TOOL,
(ToolOptions *) histogram_options);
(GimpToolOptions *) histogram_options);
}
tool->scroll_lock = TRUE; /* Disallow scrolling */

View File

@ -102,7 +102,7 @@ static gint hue_saturation_hue_partition_events (GtkWidget *,
/* the hue-saturation tool options */
static ToolOptions *hue_saturation_options = NULL;
static GimpToolOptions *hue_saturation_options = NULL;
/* the hue-saturation tool dialog */
static HueSaturationDialog *hue_saturation_dialog = NULL;
@ -195,7 +195,7 @@ gimp_hue_saturation_tool_init (GimpHueSaturationTool *bc_tool)
hue_saturation_options = tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_HUE_SATURATION_TOOL,
(ToolOptions *) hue_saturation_options);
(GimpToolOptions *) hue_saturation_options);
}
}

View File

@ -123,73 +123,73 @@ static void gimp_ink_tool_init (GimpInkTool *tool);
static void gimp_ink_tool_destroy (GtkObject *object);
static InkOptions * ink_options_new (void);
static void ink_options_reset (ToolOptions *tool_options);
static void ink_options_reset (GimpToolOptions *tool_options);
static void ink_button_press (GimpTool *tool,
GdkEventButton *mevent,
GDisplay *gdisp);
static void ink_button_release (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void ink_motion (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void ink_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void ink_control (GimpTool *tool,
ToolAction tool_action,
GDisplay *gdisp);
static void ink_button_press (GimpTool *tool,
GdkEventButton *mevent,
GDisplay *gdisp);
static void ink_button_release (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void ink_motion (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void ink_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void ink_control (GimpTool *tool,
ToolAction tool_action,
GDisplay *gdisp);
static void time_smoother_add (GimpInkTool *ink_tool,
guint32 value);
static gdouble time_smoother_result (GimpInkTool *ink_tool);
static void time_smoother_init (GimpInkTool *ink_tool,
guint32 initval);
static void dist_smoother_add (GimpInkTool *ink_tool,
gdouble value);
static gdouble dist_smoother_result (GimpInkTool *ink_tool);
static void dist_smoother_init (GimpInkTool *ink_tool,
gdouble initval);
static void time_smoother_add (GimpInkTool *ink_tool,
guint32 value);
static gdouble time_smoother_result (GimpInkTool *ink_tool);
static void time_smoother_init (GimpInkTool *ink_tool,
guint32 initval);
static void dist_smoother_add (GimpInkTool *ink_tool,
gdouble value);
static gdouble dist_smoother_result (GimpInkTool *ink_tool);
static void dist_smoother_init (GimpInkTool *ink_tool,
gdouble initval);
static void ink_init (GimpInkTool *ink_tool,
GimpDrawable *drawable,
gdouble x,
gdouble y);
static void ink_finish (GimpInkTool *ink_tool,
GimpDrawable *drawable);
static void ink_init (GimpInkTool *ink_tool,
GimpDrawable *drawable,
gdouble x,
gdouble y);
static void ink_finish (GimpInkTool *ink_tool,
GimpDrawable *drawable);
static void ink_cleanup (void);
static void ink_type_update (GtkWidget *radio_button,
BlobFunc function);
static GdkPixmap * blob_pixmap (GdkColormap *colormap,
GdkVisual *visual,
BlobFunc function);
static void paint_blob (GdkDrawable *drawable,
GdkGC *gc,
Blob *blob);
static void ink_type_update (GtkWidget *radio_button,
BlobFunc function);
static GdkPixmap * blob_pixmap (GdkColormap *colormap,
GdkVisual *visual,
BlobFunc function);
static void paint_blob (GdkDrawable *drawable,
GdkGC *gc,
Blob *blob);
/* Rendering functions */
static void ink_set_paint_area (GimpInkTool *ink_tool,
GimpDrawable *drawable,
Blob *blob);
static void ink_paste (GimpInkTool *ink_tool,
GimpDrawable *drawable,
Blob *blob);
static void ink_set_paint_area (GimpInkTool *ink_tool,
GimpDrawable *drawable,
Blob *blob);
static void ink_paste (GimpInkTool *ink_tool,
GimpDrawable *drawable,
Blob *blob);
static void ink_to_canvas_tiles (GimpInkTool *ink_tool,
Blob *blob,
guchar *color);
static void ink_to_canvas_tiles (GimpInkTool *ink_tool,
Blob *blob,
guchar *color);
static void ink_set_undo_tiles (GimpDrawable *drawable,
gint x,
gint y,
gint w,
gint h);
static void ink_set_canvas_tiles (gint x,
gint y,
gint w,
gint h);
static void ink_set_undo_tiles (GimpDrawable *drawable,
gint x,
gint y,
gint w,
gint h);
static void ink_set_canvas_tiles (gint x,
gint y,
gint w,
gint h);
/* Brush pseudo-widget callbacks */
static void brush_widget_active_rect (BrushWidget *brush_widget,
@ -303,9 +303,9 @@ gimp_ink_tool_init (GimpInkTool *ink_tool)
ink_options = ink_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_INK_TOOL,
(ToolOptions *) ink_options);
(GimpToolOptions *) ink_options);
ink_options_reset ((ToolOptions *) ink_options);
ink_options_reset ((GimpToolOptions *) ink_options);
}
}
@ -338,7 +338,7 @@ ink_type_update (GtkWidget *radio_button,
}
static void
ink_options_reset (ToolOptions *tool_options)
ink_options_reset (GimpToolOptions *tool_options)
{
InkOptions *options;
@ -398,7 +398,7 @@ ink_options_new (void)
/* the main vbox */
vbox = gtk_vbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (((ToolOptions *) options)->main_vbox), vbox,
gtk_box_pack_start (GTK_BOX (((GimpToolOptions *) options)->main_vbox), vbox,
TRUE, TRUE, 0);
gtk_widget_show (vbox);

View File

@ -349,7 +349,7 @@ gimp_iscissors_tool_init (GimpIscissorsTool *iscissors)
iscissors_options = iscissors_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_ISCISSORS_TOOL,
(ToolOptions *) iscissors_options);
(GimpToolOptions *) iscissors_options);
}
tool->auto_snap_to = FALSE; /* Don't snap to guides */

View File

@ -187,7 +187,7 @@ static void levels_write_to_file (FILE *f);
/* the levels tool options */
static ToolOptions *levels_options = NULL;
static GimpToolOptions *levels_options = NULL;
/* the levels tool dialog */
static LevelsDialog *levels_dialog = NULL;
@ -271,7 +271,7 @@ gimp_levels_tool_init (GimpLevelsTool *bc_tool)
levels_options = tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_LEVELS_TOOL,
(ToolOptions *) levels_options);
(GimpToolOptions *) levels_options);
}
}

View File

@ -47,7 +47,7 @@ typedef struct _MagnifyOptions MagnifyOptions;
struct _MagnifyOptions
{
ToolOptions tool_options;
GimpToolOptions tool_options;
/* gint allow_resize_windows; (from gimprc) */
gint allow_resize_d;
@ -92,7 +92,7 @@ static void zoom_out (gint *src,
gint scale);
static MagnifyOptions * magnify_options_new (void);
static void magnify_options_reset (ToolOptions *tool_options);
static void magnify_options_reset (GimpToolOptions *tool_options);
static MagnifyOptions *magnify_options = NULL;
@ -175,7 +175,7 @@ gimp_magnify_tool_init (GimpMagnifyTool *magnify_tool)
magnify_options = magnify_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_MAGNIFY_TOOL,
(ToolOptions *) magnify_options);
(GimpToolOptions *) magnify_options);
}
tool->scroll_lock = TRUE; /* Disallow scrolling */
@ -198,7 +198,7 @@ gimp_magnify_tool_destroy (GtkObject *object)
/* magnify tool options functions */
static void
magnify_options_reset (ToolOptions *tool_options)
magnify_options_reset (GimpToolOptions *tool_options)
{
MagnifyOptions *options;
@ -222,7 +222,7 @@ magnify_options_new (void)
/* the new magnify tool options structure */
options = g_new0 (MagnifyOptions, 1);
tool_options_init ((ToolOptions *) options,
tool_options_init ((GimpToolOptions *) options,
magnify_options_reset);
options->allow_resize_d = gimprc.allow_resize_windows;

View File

@ -63,7 +63,7 @@ typedef struct _MeasureOptions MeasureOptions;
struct _MeasureOptions
{
ToolOptions tool_options;
GimpToolOptions tool_options;
gboolean use_info_window;
gboolean use_info_window_d;
@ -102,7 +102,7 @@ static gdouble measure_get_angle (gint dx,
gdouble xres,
gdouble yres);
static MeasureOptions * measure_tool_options_new (void);
static void measure_tool_options_reset (ToolOptions *tool_options);
static void measure_tool_options_reset (GimpToolOptions *tool_options);
static void measure_tool_info_window_close_callback (GtkWidget *widget,
gpointer data);
static void measure_tool_info_update (void);
@ -194,7 +194,7 @@ gimp_measure_tool_init (GimpMeasureTool *measure_tool)
measure_tool_options = measure_tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_MEASURE_TOOL,
(ToolOptions *) measure_tool_options);
(GimpToolOptions *) measure_tool_options);
}
tool->preserve = TRUE; /* Preserve on drawable change */
@ -782,7 +782,7 @@ gimp_measure_tool_draw (GimpDrawTool *draw_tool)
}
static void
measure_tool_options_reset (ToolOptions *tool_options)
measure_tool_options_reset (GimpToolOptions *tool_options)
{
MeasureOptions *options;
@ -799,7 +799,7 @@ measure_tool_options_new (void)
GtkWidget *vbox;
options = g_new0 (MeasureOptions, 1);
tool_options_init ((ToolOptions *) options,
tool_options_init ((GimpToolOptions *) options,
measure_tool_options_reset);
options->use_info_window = options->use_info_window_d = FALSE;

View File

@ -69,7 +69,7 @@ static void move_create_gc (GDisplay *gdisp);
/* the move tool options */
static ToolOptions *move_options = NULL;
static GimpToolOptions *move_options = NULL;
/* local variables */
static GdkGC *move_gc = NULL;
@ -150,7 +150,7 @@ gimp_move_tool_init (GimpMoveTool *move_tool)
move_options = tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_MOVE_TOOL,
(ToolOptions *) move_options);
(GimpToolOptions *) move_options);
}
move_tool->layer = NULL;

View File

@ -147,7 +147,7 @@ gimp_paintbrush_tool_init (GimpPaintbrushTool *paintbrush)
paint_options_reset);
tool_manager_register_tool_options (GIMP_TYPE_PAINTBRUSH_TOOL,
(ToolOptions *) paintbrush_options);
(GimpToolOptions *) paintbrush_options);
}
tool->tool_cursor = GIMP_PAINTBRUSH_TOOL_CURSOR;

View File

@ -137,7 +137,7 @@ paint_options_init (PaintOptions *options,
}
/* initialize the tool options structure */
tool_options_init ((ToolOptions *) options,
tool_options_init ((GimpToolOptions *) options,
reset_func);
/* initialize the paint options structure */
@ -275,7 +275,7 @@ paint_options_new (GtkType tool_type,
}
void
paint_options_reset (ToolOptions *tool_options)
paint_options_reset (GimpToolOptions *tool_options)
{
PaintOptions *options;
GimpContext *default_context;

View File

@ -91,7 +91,7 @@ typedef struct _PaintOptions PaintOptions;
struct _PaintOptions
{
ToolOptions tool_options;
GimpToolOptions tool_options;
/* vbox for the common paint options */
GtkWidget *paint_vbox;
@ -133,7 +133,7 @@ extern PaintGradientOptions non_gui_gradient_options;
PaintOptions * paint_options_new (GtkType tool_type,
ToolOptionsResetFunc reset_func);
void paint_options_reset (ToolOptions *tool_options);
void paint_options_reset (GimpToolOptions *tool_options);
/* to be used by "derived" paint options only */

View File

@ -100,7 +100,7 @@ static void gimp_path_tool_draw (GimpDrawTool *draw_tool);
static GimpDrawToolClass *parent_class = NULL;
/* the move tool options */
static ToolOptions *path_options = NULL;
static GimpToolOptions *path_options = NULL;
void
@ -179,7 +179,7 @@ gimp_path_tool_init (GimpPathTool *path_tool)
path_options = tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_PATH_TOOL,
(ToolOptions *) path_options);
(GimpToolOptions *) path_options);
}

View File

@ -140,7 +140,7 @@ gimp_pencil_tool_init (GimpPencilTool *pencil)
paint_options_reset);
tool_manager_register_tool_options (GIMP_TYPE_PENCIL_TOOL,
(ToolOptions *) pencil_options);
(GimpToolOptions *) pencil_options);
}
tool->tool_cursor = GIMP_PENCIL_TOOL_CURSOR;

View File

@ -214,7 +214,7 @@ gimp_perspective_tool_init (GimpPerspectiveTool *perspective_tool)
transform_options_reset);
tool_manager_register_tool_options (GIMP_TYPE_PERSPECTIVE_TOOL,
(ToolOptions *) perspective_options);
(GimpToolOptions *) perspective_options);
}
tool->tool_cursor = GIMP_PERSPECTIVE_TOOL_CURSOR;

View File

@ -94,7 +94,7 @@ static void posterize_levels_adjustment_update (GtkAdjustment *adjustment,
/* the posterize tool options */
static ToolOptions *posterize_options = NULL;
static GimpToolOptions *posterize_options = NULL;
/* the posterize tool dialog */
static PosterizeDialog *posterize_dialog = NULL;
@ -172,7 +172,7 @@ gimp_posterize_tool_init (GimpPosterizeTool *bc_tool)
posterize_options = tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_POSTERIZE_TOOL,
(ToolOptions *) posterize_options);
(GimpToolOptions *) posterize_options);
}
}

View File

@ -233,7 +233,7 @@ gimp_rect_select_tool_init (GimpRectSelectTool *rect_select)
selection_options_reset);
tool_manager_register_tool_options (GIMP_TYPE_RECT_SELECT_TOOL,
(ToolOptions *) rect_options);
(GimpToolOptions *) rect_options);
}
tool->tool_cursor = GIMP_RECT_SELECT_TOOL_CURSOR;

View File

@ -460,7 +460,7 @@ gimp_fuzzy_select_tool_init (GimpFuzzySelectTool *fuzzy_select)
selection_options_reset);
tool_manager_register_tool_options (GIMP_TYPE_FUZZY_SELECT_TOOL,
(ToolOptions *) fuzzy_options);
(GimpToolOptions *) fuzzy_options);
}
tool->tool_cursor = GIMP_FUZZY_SELECT_TOOL_CURSOR;

View File

@ -192,7 +192,7 @@ gimp_rotate_tool_init (GimpRotateTool *rotate_tool)
transform_options_reset);
tool_manager_register_tool_options (GIMP_TYPE_ROTATE_TOOL,
(ToolOptions *) rotate_options);
(GimpToolOptions *) rotate_options);
}
tool->tool_cursor = GIMP_ROTATE_TOOL_CURSOR;
@ -204,7 +204,6 @@ gimp_rotate_tool_init (GimpRotateTool *rotate_tool)
/* assemble the transformation matrix */
gimp_matrix3_identity (tr_tool->transform);
}
static void

View File

@ -149,7 +149,7 @@ gimp_scale_tool_init (GimpScaleTool *sc_tool)
transform_options_reset);
tool_manager_register_tool_options (GIMP_TYPE_SCALE_TOOL,
(ToolOptions *) scale_options);
(GimpToolOptions *) scale_options);
}
tool->tool_cursor = GIMP_RESIZE_TOOL_CURSOR;

View File

@ -54,7 +54,7 @@ selection_options_init (SelectionOptions *options,
GtkWidget *separator;
/* initialize the tool options structure */
tool_options_init ((ToolOptions *) options,
tool_options_init ((GimpToolOptions *) options,
reset_func);
/* the main vbox */
@ -305,7 +305,7 @@ selection_options_new (GtkType tool_type,
}
void
selection_options_reset (ToolOptions *tool_options)
selection_options_reset (GimpToolOptions *tool_options)
{
SelectionOptions *options;

View File

@ -27,7 +27,7 @@
struct _SelectionOptions
{
ToolOptions tool_options;
GimpToolOptions tool_options;
/* options used by all selection tools */
gboolean feather;
@ -81,7 +81,7 @@ struct _SelectionOptions
SelectionOptions * selection_options_new (GtkType tool_type,
ToolOptionsResetFunc reset_func);
void selection_options_reset (ToolOptions *tool_options);
void selection_options_reset (GimpToolOptions *tool_options);
/* to be used by "derived" selection options only

View File

@ -188,7 +188,7 @@ gimp_shear_tool_init (GimpShearTool *shear_tool)
transform_options_reset);
tool_manager_register_tool_options (GIMP_TYPE_SHEAR_TOOL,
(ToolOptions *) shear_options);
(GimpToolOptions *) shear_options);
}
tool->tool_cursor = GIMP_SHEAR_TOOL_CURSOR;

View File

@ -95,7 +95,7 @@ static void gimp_smudge_tool_allocate_accum_buffer (gint w,
guchar *do_fill);
static SmudgeOptions * smudge_options_new (void);
static void smudge_options_reset (ToolOptions *tool_options);
static void smudge_options_reset (GimpToolOptions *tool_options);
/* local variables */
@ -177,7 +177,7 @@ gimp_smudge_tool_init (GimpSmudgeTool *smudge)
smudge_options = smudge_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_SMUDGE_TOOL,
(ToolOptions *) smudge_options);
(GimpToolOptions *) smudge_options);
}
tool->tool_cursor = GIMP_SMUDGE_TOOL_CURSOR;
@ -533,7 +533,7 @@ smudge_options_new (void)
options->rate = options->rate_d = SMUDGE_DEFAULT_RATE;
/* the main vbox */
vbox = ((ToolOptions *) options)->main_vbox;
vbox = ((GimpToolOptions *) options)->main_vbox;
/* the rate scale */
hbox = gtk_hbox_new (FALSE, 4);
@ -560,7 +560,7 @@ smudge_options_new (void)
}
static void
smudge_options_reset (ToolOptions *tool_options)
smudge_options_reset (GimpToolOptions *tool_options)
{
SmudgeOptions *options;

View File

@ -90,41 +90,41 @@ struct _CloneOptions
static void gimp_clone_tool_class_init (GimpCloneToolClass *klass);
static void gimp_clone_tool_init (GimpCloneTool *tool);
static void gimp_clone_tool_paint (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
PaintState state);
static void gimp_clone_tool_draw (GimpDrawTool *draw_tool);
static void gimp_clone_tool_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_clone_tool_motion (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
GimpDrawable *src_drawable,
static void gimp_clone_tool_paint (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
PaintState state);
static void gimp_clone_tool_draw (GimpDrawTool *draw_tool);
static void gimp_clone_tool_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void gimp_clone_tool_motion (GimpPaintTool *paint_tool,
GimpDrawable *drawable,
GimpDrawable *src_drawable,
PaintPressureOptions *pressure_options,
CloneType type,
gint offset_x,
gint offset_y);
static void gimp_clone_tool_line_image (GimpImage *dest,
GimpImage *src,
GimpDrawable *d_drawable,
GimpDrawable *s_drawable,
guchar *s,
guchar *d,
gint has_alpha,
gint src_bytes,
gint dest_bytes,
gint width);
static void gimp_clone_tool_line_pattern (GimpImage *dest,
GimpDrawable *drawable,
GimpPattern *pattern,
guchar *d,
gint x,
gint y,
gint bytes,
gint width);
CloneType type,
gint offset_x,
gint offset_y);
static void gimp_clone_tool_line_image (GimpImage *dest,
GimpImage *src,
GimpDrawable *d_drawable,
GimpDrawable *s_drawable,
guchar *s,
guchar *d,
gint has_alpha,
gint src_bytes,
gint dest_bytes,
gint width);
static void gimp_clone_tool_line_pattern (GimpImage *dest,
GimpDrawable *drawable,
GimpPattern *pattern,
guchar *d,
gint x,
gint y,
gint bytes,
gint width);
static CloneOptions * clone_options_new (void);
static void clone_options_reset (ToolOptions *options);
static void clone_options_reset (GimpToolOptions *options);
/* The parent class */
@ -228,7 +228,7 @@ gimp_clone_tool_init (GimpCloneTool *clone)
clone_options = clone_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_CLONE_TOOL,
(ToolOptions *) clone_options);
(GimpToolOptions *) clone_options);
}
tool->tool_cursor = GIMP_CLONE_TOOL_CURSOR;
@ -804,7 +804,7 @@ clone_options_new (void)
options->aligned = options->aligned_d = CLONE_DEFAULT_ALIGNED;
/* the main vbox */
vbox = ((ToolOptions *) options)->main_vbox;
vbox = ((GimpToolOptions *) options)->main_vbox;
frame = gimp_radio_group_new2 (TRUE, _("Source"),
gimp_radio_button_update,
@ -840,7 +840,7 @@ clone_options_new (void)
}
static void
clone_options_reset (ToolOptions *tool_options)
clone_options_reset (GimpToolOptions *tool_options)
{
CloneOptions *options;

View File

@ -89,7 +89,7 @@ typedef struct _TextOptions TextOptions;
struct _TextOptions
{
ToolOptions tool_options;
GimpToolOptions tool_options;
gboolean antialias;
gboolean antialias_d;
@ -108,42 +108,42 @@ struct _TextOptions
static void gimp_text_tool_class_init (GimpTextToolClass *klass);
static void gimp_text_tool_init (GimpTextTool *tool);
static void gimp_text_tool_destroy (GtkObject *object);
static void gimp_text_tool_destroy (GtkObject *object);
static void text_tool_control (GimpTool *tool,
ToolAction tool_action,
GDisplay *gdisp);
static void text_tool_button_press (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void text_tool_button_release (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void text_tool_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static void text_tool_control (GimpTool *tool,
ToolAction tool_action,
GDisplay *gdisp);
static void text_tool_button_press (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void text_tool_button_release (GimpTool *tool,
GdkEventButton *bevent,
GDisplay *gdisp);
static void text_tool_cursor_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
static TextOptions * text_tool_options_new (void);
static void text_tool_options_reset (ToolOptions *tool_options);
static void text_tool_options_reset (GimpToolOptions *tool_options);
static void text_dialog_create (void);
static void text_dialog_ok_callback (GtkWidget *widget,
gpointer data);
static void text_dialog_cancel_callback (GtkWidget *widget,
gpointer data);
static gint text_dialog_delete_callback (GtkWidget *widget,
GdkEvent *event,
gpointer data);
static void text_dialog_ok_callback (GtkWidget *widget,
gpointer data);
static void text_dialog_cancel_callback (GtkWidget *widget,
gpointer data);
static gint text_dialog_delete_callback (GtkWidget *widget,
GdkEvent *event,
gpointer data);
static void text_init_render (GimpTextTool *text_tool);
static void text_gdk_image_to_region (GdkImage *image,
gint ,
PixelRegion *);
static void text_size_multiply (gchar **fontname,
gint size);
static void text_set_resolution (gchar **fontname,
gdouble xres,
gdouble yres);
static void text_init_render (GimpTextTool *text_tool);
static void text_gdk_image_to_region (GdkImage *image,
gint ,
PixelRegion *);
static void text_size_multiply (gchar **fontname,
gint size);
static void text_set_resolution (gchar **fontname,
gdouble xres,
gdouble yres);
/* local variables */
@ -227,7 +227,7 @@ gimp_text_tool_init (GimpTextTool *text_tool)
text_tool_options = text_tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_TEXT_TOOL,
(ToolOptions *) text_tool_options);
(GimpToolOptions *) text_tool_options);
}
tool->tool_cursor = GIMP_TEXT_TOOL_CURSOR;
@ -246,7 +246,7 @@ gimp_text_tool_destroy (GtkObject *object)
}
static void
text_tool_options_reset (ToolOptions *tool_options)
text_tool_options_reset (GimpToolOptions *tool_options)
{
TextOptions *options;
@ -271,7 +271,7 @@ text_tool_options_new (void)
GtkWidget *sep;
options = g_new0 (TextOptions, 1);
tool_options_init ((ToolOptions *) options,
tool_options_init ((GimpToolOptions *) options,
text_tool_options_reset);
options->antialias = options->antialias_d = TRUE;

View File

@ -100,7 +100,7 @@ static void threshold_histogram_range (HistogramWidget *,
/* the threshold tool options */
static ToolOptions *threshold_options = NULL;
static GimpToolOptions *threshold_options = NULL;
/* the threshold tool dialog */
static ThresholdDialog *threshold_dialog = NULL;
@ -178,7 +178,7 @@ gimp_threshold_tool_init (GimpThresholdTool *bc_tool)
threshold_options = tool_options_new ();
tool_manager_register_tool_options (GIMP_TYPE_THRESHOLD_TOOL,
(ToolOptions *) threshold_options);
(GimpToolOptions *) threshold_options);
}
}

View File

@ -161,7 +161,7 @@ gimp_transform_tool_show_grid (void)
*/
void
transform_options_reset (ToolOptions *tool_options)
transform_options_reset (GimpToolOptions *tool_options)
{
TransformOptions *options;
@ -197,7 +197,7 @@ transform_options_init (TransformOptions *options,
GtkWidget *fbox;
GtkWidget *grid_density;
tool_options_init ((ToolOptions *) options,
tool_options_init ((GimpToolOptions *) options,
reset_func);
options->smoothing = options->smoothing_d = TRUE;
@ -311,7 +311,7 @@ transform_options_init (TransformOptions *options,
gtk_widget_show (options->clip_w);
/* Set options to default values */
transform_options_reset((ToolOptions *) options);
transform_options_reset ((GimpToolOptions *) options);
}
TransformOptions *

View File

@ -25,7 +25,7 @@ typedef struct _TransformOptions TransformOptions;
struct _TransformOptions
{
ToolOptions tool_options;
GimpToolOptions tool_options;
gboolean smoothing;
gboolean smoothing_d;
@ -59,7 +59,7 @@ TransformOptions * transform_options_new (GtkType tool_type,
void transform_options_init (TransformOptions *options,
GtkType tool_type,
ToolOptionsResetFunc reset_func);
void transform_options_reset (ToolOptions *tool_options);
void transform_options_reset (GimpToolOptions *tool_options);
gboolean gimp_transform_tool_smoothing (void);
gboolean gimp_transform_tool_showpath (void);

View File

@ -137,7 +137,7 @@ paint_options_init (PaintOptions *options,
}
/* initialize the tool options structure */
tool_options_init ((ToolOptions *) options,
tool_options_init ((GimpToolOptions *) options,
reset_func);
/* initialize the paint options structure */
@ -275,7 +275,7 @@ paint_options_new (GtkType tool_type,
}
void
paint_options_reset (ToolOptions *tool_options)
paint_options_reset (GimpToolOptions *tool_options)
{
PaintOptions *options;
GimpContext *default_context;

View File

@ -91,7 +91,7 @@ typedef struct _PaintOptions PaintOptions;
struct _PaintOptions
{
ToolOptions tool_options;
GimpToolOptions tool_options;
/* vbox for the common paint options */
GtkWidget *paint_vbox;
@ -133,7 +133,7 @@ extern PaintGradientOptions non_gui_gradient_options;
PaintOptions * paint_options_new (GtkType tool_type,
ToolOptionsResetFunc reset_func);
void paint_options_reset (ToolOptions *tool_options);
void paint_options_reset (GimpToolOptions *tool_options);
/* to be used by "derived" paint options only */

View File

@ -164,7 +164,7 @@ void path_tool_motion_curve (Tool *, GdkEventMotion *, GDisplay *);
#endif
/* the path tool options */
static ToolOptions *path_options = NULL;
static GimpToolOptions *path_options = NULL;
/*
@ -1410,7 +1410,7 @@ tools_new_path_tool (void)
if (! path_options)
{
path_options = tool_options_new (_("Path Tool"));
tools_register (PATH_TOOL, (ToolOptions *) path_options);
tools_register (PATH_TOOL, (GimpToolOptions *) path_options);
}
tool = tools_new_tool (PATH_TOOL);
@ -1887,10 +1887,10 @@ path_tool_draw_helper (NPath *path,
#endif
}
#if 0
void
path_tool_draw (Tool *tool)
{
#if 0
GDisplay * gdisp;
NPath * cur_path;
PathTool * path_tool;
@ -1909,8 +1909,8 @@ path_tool_draw (Tool *tool)
/* fprintf (stderr, "path_tool_draw end.\n");
*/
#endif PATH_TOOL_DEBUG
#endif
}
#endif

View File

@ -54,7 +54,7 @@ selection_options_init (SelectionOptions *options,
GtkWidget *separator;
/* initialize the tool options structure */
tool_options_init ((ToolOptions *) options,
tool_options_init ((GimpToolOptions *) options,
reset_func);
/* the main vbox */
@ -305,7 +305,7 @@ selection_options_new (GtkType tool_type,
}
void
selection_options_reset (ToolOptions *tool_options)
selection_options_reset (GimpToolOptions *tool_options)
{
SelectionOptions *options;

View File

@ -27,7 +27,7 @@
struct _SelectionOptions
{
ToolOptions tool_options;
GimpToolOptions tool_options;
/* options used by all selection tools */
gboolean feather;
@ -81,7 +81,7 @@ struct _SelectionOptions
SelectionOptions * selection_options_new (GtkType tool_type,
ToolOptionsResetFunc reset_func);
void selection_options_reset (ToolOptions *tool_options);
void selection_options_reset (GimpToolOptions *tool_options);
/* to be used by "derived" selection options only

View File

@ -406,6 +406,40 @@ tool_manager_register_tool (Gimp *gimp,
{
GimpToolManager *tool_manager;
GimpToolInfo *tool_info;
const gchar *pdb_string = "gimp_paintbrush_default";
if (tool_type == GIMP_TYPE_PENCIL_TOOL)
{
pdb_string = "gimp_pencil";
}
else if (tool_type == GIMP_TYPE_PAINTBRUSH_TOOL)
{
pdb_string = "gimp_paintbrush_default";
}
else if (tool_type == GIMP_TYPE_ERASER_TOOL)
{
pdb_string = "gimp_eraser_default";
}
else if (tool_type == GIMP_TYPE_AIRBRUSH_TOOL)
{
pdb_string = "gimp_airbrush_default";
}
else if (tool_type == GIMP_TYPE_CLONE_TOOL)
{
pdb_string = "gimp_clone_default";
}
else if (tool_type == GIMP_TYPE_CONVOLVE_TOOL)
{
pdb_string = "gimp_convolve_default";
}
else if (tool_type == GIMP_TYPE_SMUDGE_TOOL)
{
pdb_string = "gimp_smudge_default";
}
else if (tool_type == GIMP_TYPE_DODGEBURN_TOOL)
{
pdb_string = "gimp_dodgeburn_default";
}
tool_manager = tool_manager_get (gimp);
@ -419,14 +453,15 @@ tool_manager_register_tool (Gimp *gimp,
menu_accel,
help_domain,
help_data,
pdb_string,
icon_data);
gimp_container_add (gimp->tool_info_list, GIMP_OBJECT (tool_info));
}
void
tool_manager_register_tool_options (GtkType tool_type,
ToolOptions *tool_options)
tool_manager_register_tool_options (GtkType tool_type,
GimpToolOptions *tool_options)
{
GimpToolInfo *tool_info;

View File

@ -20,56 +20,56 @@
#define __TOOL_MANAGER_H__
void tool_manager_init (Gimp *gimp);
void tool_manager_exit (Gimp *gimp);
void tool_manager_init (Gimp *gimp);
void tool_manager_exit (Gimp *gimp);
void tool_manager_set_global_paint_options (Gimp *gimp,
gboolean global);
void tool_manager_set_global_paint_options (Gimp *gimp,
gboolean global);
GimpTool * tool_manager_get_active (Gimp *gimp);
GimpTool * tool_manager_get_active (Gimp *gimp);
void tool_manager_select_tool (Gimp *gimp,
GimpTool *tool);
void tool_manager_select_tool (Gimp *gimp,
GimpTool *tool);
void tool_manager_push_tool (Gimp *gimp,
GimpTool *tool);
void tool_manager_pop_tool (Gimp *gimp);
void tool_manager_push_tool (Gimp *gimp,
GimpTool *tool);
void tool_manager_pop_tool (Gimp *gimp);
void tool_manager_initialize_tool (Gimp *gimp,
GimpTool *tool,
GDisplay *gdisp);
void tool_manager_initialize_tool (Gimp *gimp,
GimpTool *tool,
GDisplay *gdisp);
void tool_manager_control_active (Gimp *gimp,
ToolAction action,
GDisplay *gdisp);
void tool_manager_control_active (Gimp *gimp,
ToolAction action,
GDisplay *gdisp);
const gchar * tool_manager_active_get_PDB_string (Gimp *gimp);
const gchar * tool_manager_active_get_help_data (Gimp *gimp);
const gchar * tool_manager_active_get_PDB_string (Gimp *gimp);
const gchar * tool_manager_active_get_help_data (Gimp *gimp);
void tool_manager_register_tool (Gimp *gimp,
GtkType tool_type,
gboolean tool_context,
const gchar *identifier,
const gchar *blurb,
const gchar *help,
const gchar *menu_path,
const gchar *menu_accel,
const gchar *help_domain,
const gchar *help_data,
const gchar **icon_data);
void tool_manager_register_tool (Gimp *gimp,
GtkType tool_type,
gboolean tool_context,
const gchar *identifier,
const gchar *blurb,
const gchar *help,
const gchar *menu_path,
const gchar *menu_accel,
const gchar *help_domain,
const gchar *help_data,
const gchar **icon_data);
void tool_manager_register_tool_options (GtkType tool_type,
ToolOptions *tool_options);
void tool_manager_register_tool_options (GtkType tool_type,
GimpToolOptions *tool_options);
GimpToolInfo * tool_manager_get_info_by_type (Gimp *gimp,
GtkType tool_type);
GimpToolInfo * tool_manager_get_info_by_tool (Gimp *gimp,
GimpTool *tool);
GimpToolInfo * tool_manager_get_info_by_type (Gimp *gimp,
GtkType tool_type);
GimpToolInfo * tool_manager_get_info_by_tool (Gimp *gimp,
GimpTool *tool);
void tool_manager_help_func (const gchar *help_data);
void tool_manager_help_func (const gchar *help_data);
#endif /* __TOOL_MANAGER_H__ */

View File

@ -28,21 +28,20 @@
void
tool_options_init (ToolOptions *options,
tool_options_init (GimpToolOptions *options,
ToolOptionsResetFunc reset_func)
{
options->main_vbox = gtk_vbox_new (FALSE, 2);
options->reset_func = reset_func;
}
ToolOptions *
GimpToolOptions *
tool_options_new (void)
{
ToolOptions *options;
GimpToolOptions *options;
GtkWidget *label;
GtkWidget *label;
options = g_new0 (ToolOptions, 1);
options = g_new0 (GimpToolOptions, 1);
tool_options_init (options, NULL);
label = gtk_label_new (_("This tool has no options."));

View File

@ -22,7 +22,7 @@
/* the tool options structures */
struct _ToolOptions
struct _GimpToolOptions
{
GtkWidget *main_vbox;
@ -32,13 +32,13 @@ struct _ToolOptions
/* create a dummy tool options structure
* (to be used by tools without options)
*/
ToolOptions * tool_options_new (void);
GimpToolOptions * tool_options_new (void);
/* initialize an already allocated ToolOptions structure
* (to be used by derived tool options only)
*/
void tool_options_init (ToolOptions *options,
ToolOptionsResetFunc reset_func);
void tool_options_init (GimpToolOptions *options,
ToolOptionsResetFunc reset_func);
#endif /* __TOOL_OPTIONS_H__ */

View File

@ -39,18 +39,12 @@ typedef struct _GimpBezierSelectTool GimpBezierSelectTool;
/* stuff */
typedef struct _ToolOptions ToolOptions;
typedef struct _SelectionOptions SelectionOptions;
/* functions */
typedef void (* ToolOptionsResetFunc) (ToolOptions *tool_options);
/* EEK */
typedef struct _Tool Tool;
typedef void (* ToolOptionsResetFunc) (GimpToolOptions *tool_options);
/* enums */

View File

@ -161,7 +161,7 @@ gimp_transform_tool_show_grid (void)
*/
void
transform_options_reset (ToolOptions *tool_options)
transform_options_reset (GimpToolOptions *tool_options)
{
TransformOptions *options;
@ -197,7 +197,7 @@ transform_options_init (TransformOptions *options,
GtkWidget *fbox;
GtkWidget *grid_density;
tool_options_init ((ToolOptions *) options,
tool_options_init ((GimpToolOptions *) options,
reset_func);
options->smoothing = options->smoothing_d = TRUE;
@ -311,7 +311,7 @@ transform_options_init (TransformOptions *options,
gtk_widget_show (options->clip_w);
/* Set options to default values */
transform_options_reset((ToolOptions *) options);
transform_options_reset ((GimpToolOptions *) options);
}
TransformOptions *

View File

@ -25,7 +25,7 @@ typedef struct _TransformOptions TransformOptions;
struct _TransformOptions
{
ToolOptions tool_options;
GimpToolOptions tool_options;
gboolean smoothing;
gboolean smoothing_d;
@ -59,7 +59,7 @@ TransformOptions * transform_options_new (GtkType tool_type,
void transform_options_init (TransformOptions *options,
GtkType tool_type,
ToolOptionsResetFunc reset_func);
void transform_options_reset (ToolOptions *tool_options);
void transform_options_reset (GimpToolOptions *tool_options);
gboolean gimp_transform_tool_smoothing (void);
gboolean gimp_transform_tool_showpath (void);

View File

@ -193,7 +193,8 @@ gimp_dialog_factory_register_entry (GimpDialogFactory *factory,
GimpDialogNewFunc new_func,
gboolean singleton,
gboolean session_managed,
gboolean remember_size)
gboolean remember_size,
gboolean remember_if_open)
{
GimpDialogFactoryEntry *entry;
@ -203,11 +204,12 @@ gimp_dialog_factory_register_entry (GimpDialogFactory *factory,
entry = g_new0 (GimpDialogFactoryEntry, 1);
entry->identifier = g_strdup (identifier);
entry->new_func = new_func;
entry->singleton = singleton ? TRUE : FALSE;
entry->session_managed = session_managed ? TRUE : FALSE;
entry->remember_size = remember_size ? TRUE : FALSE;
entry->identifier = g_strdup (identifier);
entry->new_func = new_func;
entry->singleton = singleton ? TRUE : FALSE;
entry->session_managed = session_managed ? TRUE : FALSE;
entry->remember_size = remember_size ? TRUE : FALSE;
entry->remember_if_open = remember_if_open ? TRUE : FALSE;
factory->registered_dialogs = g_list_prepend (factory->registered_dialogs,
entry);
@ -1003,7 +1005,10 @@ gimp_dialog_factory_get_window_info (GtkWidget *window,
}
}
info->open = GTK_WIDGET_VISIBLE (window);
if (! info->toplevel_entry || info->toplevel_entry->remember_if_open)
info->open = GTK_WIDGET_VISIBLE (window);
else
info->open = FALSE;
}
static void

View File

@ -42,6 +42,7 @@ struct _GimpDialogFactoryEntry
gboolean singleton;
gboolean session_managed;
gboolean remember_size;
gboolean remember_if_open;
};
struct _GimpSessionInfo
@ -113,7 +114,8 @@ void gimp_dialog_factory_register_entry (GimpDialogFactory *factory,
GimpDialogNewFunc new_func,
gboolean singleton,
gboolean session_managed,
gboolean remember_size);
gboolean remember_size,
gboolean remember_if_open);
GimpDialogFactoryEntry * gimp_dialog_factory_find_entry
(GimpDialogFactory *factory,
const gchar *identifier);
@ -136,8 +138,8 @@ void gimp_dialog_factory_add_dialog (GimpDialogFactory *factory,
void gimp_dialog_factory_remove_dialog (GimpDialogFactory *factory,
GtkWidget *dialog);
void gimp_dialog_factories_session_save (FILE *file);
void gimp_dialog_factories_session_restore (void);
void gimp_dialog_factories_session_save (FILE *file);
void gimp_dialog_factories_session_restore (void);
#endif /* __GIMP_DIALOG_FACTORY_H__ */

View File

@ -70,7 +70,7 @@ static GtkWidget *options_preview = NULL;
static GtkWidget *options_eventbox = NULL;
static GtkWidget *options_reset_button = NULL;
static ToolOptions *visible_tool_options = NULL;
static GimpToolOptions *visible_tool_options = NULL;
/* public functions */