2006-12-09 13:33:38 -08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2001-05-24 16:57:08 -07:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
|
*
|
2009-01-17 14:28:01 -08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2001-05-24 16:57:08 -07:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-17 14:28:01 -08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2001-05-24 16:57:08 -07:00
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2018-07-11 14:47:19 -07:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2001-05-24 16:57:08 -07:00
|
|
|
*/
|
|
|
|
|
|
2016-05-09 15:08:36 -07:00
|
|
|
#ifndef __GIMP_FILTER_TOOL_H__
|
|
|
|
|
#define __GIMP_FILTER_TOOL_H__
|
2001-05-24 16:57:08 -07:00
|
|
|
|
|
|
|
|
|
2003-06-05 11:47:23 -07:00
|
|
|
#include "gimpcolortool.h"
|
2001-05-24 16:57:08 -07:00
|
|
|
|
|
|
|
|
|
2016-05-09 15:08:36 -07:00
|
|
|
#define GIMP_TYPE_FILTER_TOOL (gimp_filter_tool_get_type ())
|
|
|
|
|
#define GIMP_FILTER_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_FILTER_TOOL, GimpFilterTool))
|
|
|
|
|
#define GIMP_FILTER_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_FILTER_TOOL, GimpFilterToolClass))
|
|
|
|
|
#define GIMP_IS_FILTER_TOOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_FILTER_TOOL))
|
|
|
|
|
#define GIMP_IS_FILTER_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_FILTER_TOOL))
|
|
|
|
|
#define GIMP_FILTER_TOOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_FILTER_TOOL, GimpFilterToolClass))
|
2001-05-24 16:57:08 -07:00
|
|
|
|
2016-05-09 15:08:36 -07:00
|
|
|
#define GIMP_FILTER_TOOL_GET_OPTIONS(t) (GIMP_FILTER_OPTIONS (gimp_tool_get_options (GIMP_TOOL (t))))
|
2006-09-05 11:25:31 -07:00
|
|
|
|
2001-05-24 16:57:08 -07:00
|
|
|
|
2016-05-09 15:08:36 -07:00
|
|
|
typedef struct _GimpFilterToolClass GimpFilterToolClass;
|
2001-05-24 16:57:08 -07:00
|
|
|
|
2016-05-09 15:08:36 -07:00
|
|
|
struct _GimpFilterTool
|
2001-05-24 16:57:08 -07:00
|
|
|
{
|
2017-07-10 14:28:49 -07:00
|
|
|
GimpColorTool parent_instance;
|
2002-08-26 04:35:56 -07:00
|
|
|
|
2017-07-10 14:28:49 -07:00
|
|
|
GeglNode *operation;
|
|
|
|
|
GObject *config;
|
|
|
|
|
GObject *default_config;
|
|
|
|
|
GimpContainer *settings;
|
2008-01-08 17:06:46 -08:00
|
|
|
|
2017-07-10 14:28:49 -07:00
|
|
|
gchar *description;
|
2016-01-22 12:22:36 -08:00
|
|
|
|
2017-07-10 14:28:49 -07:00
|
|
|
gboolean has_settings;
|
2008-01-08 17:06:46 -08:00
|
|
|
|
2017-07-10 14:28:49 -07:00
|
|
|
GimpDrawableFilter *filter;
|
2017-03-25 03:32:17 -07:00
|
|
|
|
2017-07-10 14:28:49 -07:00
|
|
|
GimpGuide *preview_guide;
|
2002-08-26 04:35:56 -07:00
|
|
|
|
2017-07-10 14:28:49 -07:00
|
|
|
gpointer pick_identifier;
|
|
|
|
|
gboolean pick_abyss;
|
2017-05-30 14:06:41 -07:00
|
|
|
|
2004-02-25 02:23:43 -08:00
|
|
|
/* dialog */
|
2017-07-10 14:28:49 -07:00
|
|
|
gboolean overlay;
|
|
|
|
|
GimpToolGui *gui;
|
|
|
|
|
GtkWidget *settings_box;
|
2019-01-13 05:02:32 -08:00
|
|
|
GtkWidget *controller_toggle;
|
2017-07-10 14:28:49 -07:00
|
|
|
GtkWidget *region_combo;
|
|
|
|
|
GtkWidget *active_picker;
|
2017-07-01 07:24:01 -07:00
|
|
|
|
|
|
|
|
/* widget */
|
2017-07-10 14:28:49 -07:00
|
|
|
GimpToolWidget *widget;
|
|
|
|
|
GimpToolWidget *grab_widget;
|
2001-05-24 16:57:08 -07:00
|
|
|
};
|
|
|
|
|
|
2016-05-09 15:08:36 -07:00
|
|
|
struct _GimpFilterToolClass
|
2001-05-24 16:57:08 -07:00
|
|
|
{
|
2003-06-05 11:47:23 -07:00
|
|
|
GimpColorToolClass parent_class;
|
2002-08-26 04:35:56 -07:00
|
|
|
|
|
|
|
|
/* virtual functions */
|
2016-05-09 15:08:36 -07:00
|
|
|
gchar * (* get_operation) (GimpFilterTool *filter_tool,
|
2017-07-09 09:58:00 -07:00
|
|
|
gchar **description);
|
2016-05-09 15:08:36 -07:00
|
|
|
void (* dialog) (GimpFilterTool *filter_tool);
|
|
|
|
|
void (* reset) (GimpFilterTool *filter_tool);
|
2017-03-30 14:21:46 -07:00
|
|
|
void (* set_config) (GimpFilterTool *filter_tool,
|
|
|
|
|
GimpConfig *config);
|
2017-07-02 15:15:09 -07:00
|
|
|
void (* config_notify) (GimpFilterTool *filter_tool,
|
|
|
|
|
GimpConfig *config,
|
|
|
|
|
const GParamSpec *pspec);
|
2012-03-29 15:12:48 -07:00
|
|
|
|
2016-05-09 15:08:36 -07:00
|
|
|
gboolean (* settings_import) (GimpFilterTool *filter_tool,
|
2014-07-04 09:19:45 -07:00
|
|
|
GInputStream *input,
|
2012-03-29 15:12:48 -07:00
|
|
|
GError **error);
|
2016-05-09 15:08:36 -07:00
|
|
|
gboolean (* settings_export) (GimpFilterTool *filter_tool,
|
2014-07-04 09:19:45 -07:00
|
|
|
GOutputStream *output,
|
2012-03-29 15:12:48 -07:00
|
|
|
GError **error);
|
2012-04-30 13:13:50 -07:00
|
|
|
|
2016-05-09 15:08:36 -07:00
|
|
|
void (* color_picked) (GimpFilterTool *filter_tool,
|
2012-04-30 13:13:50 -07:00
|
|
|
gpointer identifier,
|
2013-05-30 10:29:36 -07:00
|
|
|
gdouble x,
|
|
|
|
|
gdouble y,
|
2012-04-30 13:13:50 -07:00
|
|
|
const Babl *sample_format,
|
|
|
|
|
const GimpRGB *color);
|
2001-05-24 16:57:08 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2017-05-30 14:06:41 -07:00
|
|
|
GType gimp_filter_tool_get_type (void) G_GNUC_CONST;
|
2008-02-05 05:54:25 -08:00
|
|
|
|
2017-10-16 08:38:28 -07:00
|
|
|
void gimp_filter_tool_get_operation (GimpFilterTool *filter_tool);
|
|
|
|
|
|
|
|
|
|
void gimp_filter_tool_set_config (GimpFilterTool *filter_tool,
|
|
|
|
|
GimpConfig *config);
|
|
|
|
|
|
|
|
|
|
void gimp_filter_tool_edit_as (GimpFilterTool *filter_tool,
|
|
|
|
|
const gchar *new_tool_id,
|
|
|
|
|
GimpConfig *config);
|
|
|
|
|
|
|
|
|
|
gboolean gimp_filter_tool_on_guide (GimpFilterTool *filter_tool,
|
|
|
|
|
const GimpCoords *coords,
|
|
|
|
|
GimpDisplay *display);
|
|
|
|
|
|
|
|
|
|
GtkWidget * gimp_filter_tool_dialog_get_vbox (GimpFilterTool *filter_tool);
|
|
|
|
|
|
|
|
|
|
void gimp_filter_tool_enable_color_picking (GimpFilterTool *filter_tool,
|
|
|
|
|
gpointer identifier,
|
|
|
|
|
gboolean pick_abyss);
|
|
|
|
|
void gimp_filter_tool_disable_color_picking (GimpFilterTool *filter_tool);
|
|
|
|
|
|
|
|
|
|
GtkWidget * gimp_filter_tool_add_color_picker (GimpFilterTool *filter_tool,
|
|
|
|
|
gpointer identifier,
|
|
|
|
|
const gchar *icon_name,
|
|
|
|
|
const gchar *tooltip,
|
|
|
|
|
gboolean pick_abyss,
|
|
|
|
|
GimpPickerCallback callback,
|
|
|
|
|
gpointer callback_data);
|
|
|
|
|
GCallback gimp_filter_tool_add_controller (GimpFilterTool *filter_tool,
|
|
|
|
|
GimpControllerType controller_type,
|
|
|
|
|
const gchar *status_title,
|
|
|
|
|
GCallback callback,
|
|
|
|
|
gpointer callback_data,
|
|
|
|
|
gpointer *set_func_data);
|
|
|
|
|
|
|
|
|
|
void gimp_filter_tool_set_widget (GimpFilterTool *filter_tool,
|
|
|
|
|
GimpToolWidget *widget);
|
|
|
|
|
|
|
|
|
|
gboolean gimp_filter_tool_get_drawable_area (GimpFilterTool *filter_tool,
|
|
|
|
|
gint *drawable_offset_x,
|
|
|
|
|
gint *drawable_offset_y,
|
|
|
|
|
GeglRectangle *drawable_area);
|
2017-07-02 15:24:09 -07:00
|
|
|
|
2001-05-24 16:57:08 -07:00
|
|
|
|
2016-05-09 15:08:36 -07:00
|
|
|
#endif /* __GIMP_FILTER_TOOL_H__ */
|