Commit b844c985 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

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/
parent 284e178d
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()
......
......@@ -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);
}
}
......
......@@ -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);
}
}
......
......@@ -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);
}
}
......
......@@ -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);
}
}
......
......@@ -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,
......
......@@ -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 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_draw (GimpDrawTool *draw_tool);
static void gimp_blend_tool_destroy (GtkObject *object);
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_draw (GimpDrawTool *draw_tool);
static BlendOptions * blend_options_new (void);
static void blend_options_reset (ToolOptions *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 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 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 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;
......
......@@ -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"
......
......@@ -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"
......
......@@ -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);
......
......@@ -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"
......
......@@ -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;
......
......@@ -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"
......
......@@ -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"
......
......@@ -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"
......
......@@ -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"
......
......@@ -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"
......
......@@ -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);
}
......
......@@ -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;
gchar *pdb_string;
const gchar **icon_data;
const gchar **icon_data;
GimpContext *context;
GimpContext *context;
ToolOptions *tool_options;
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);
......
......@@ -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."));
......
......@@ -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__ */
......@@ -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);