本文整理匯總了C++中GIMP_TOOL_CLASS函數的典型用法代碼示例。如果您正苦於以下問題:C++ GIMP_TOOL_CLASS函數的具體用法?C++ GIMP_TOOL_CLASS怎麽用?C++ GIMP_TOOL_CLASS使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GIMP_TOOL_CLASS函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: gimp_rectangle_select_tool_control
static void
gimp_rectangle_select_tool_control (GimpTool *tool,
GimpToolAction action,
GimpDisplay *display)
{
gimp_rectangle_tool_control (tool, action, display);
GIMP_TOOL_CLASS (parent_class)->control (tool, action, display);
}
示例2: gimp_dodge_burn_tool_class_init
static void
gimp_dodge_burn_tool_class_init (GimpDodgeBurnToolClass *klass)
{
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
tool_class->modifier_key = gimp_dodge_burn_tool_modifier_key;
tool_class->cursor_update = gimp_dodge_burn_tool_cursor_update;
tool_class->oper_update = gimp_dodge_burn_tool_oper_update;
}
示例3: gimp_threshold_tool_initialize
static gboolean
gimp_threshold_tool_initialize (GimpTool *tool,
GimpDisplay *display,
GError **error)
{
GimpThresholdTool *t_tool = GIMP_THRESHOLD_TOOL (tool);
GimpFilterTool *filter_tool = GIMP_FILTER_TOOL (tool);
GimpImage *image = gimp_display_get_image (display);
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
gdouble low;
gdouble high;
gint n_bins;
if (! GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error))
{
return FALSE;
}
g_clear_object (&t_tool->histogram_async);
g_object_get (filter_tool->config,
"low", &low,
"high", &high,
NULL);
/* this is a hack to make sure that
* 'gimp_histogram_n_bins (t_tool->histogram)' returns the correct value for
* 'drawable' before the asynchronous calculation of its histogram is
* finished.
*/
{
GeglBuffer *temp;
temp = gegl_buffer_new (GEGL_RECTANGLE (0, 0, 1, 1),
gimp_drawable_get_format (drawable));
gimp_histogram_calculate (t_tool->histogram,
temp, GEGL_RECTANGLE (0, 0, 1, 1),
NULL, NULL);
g_object_unref (temp);
}
n_bins = gimp_histogram_n_bins (t_tool->histogram);
t_tool->histogram_async = gimp_drawable_calculate_histogram_async (
drawable, t_tool->histogram, FALSE);
gimp_histogram_view_set_histogram (t_tool->histogram_box->view,
t_tool->histogram);
gimp_histogram_view_set_range (t_tool->histogram_box->view,
low * (n_bins - 0.0001),
high * (n_bins - 0.0001));
return TRUE;
}
示例4: gimp_bucket_fill_tool_class_init
static void
gimp_bucket_fill_tool_class_init (GimpBucketFillToolClass *klass)
{
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
tool_class->initialize = gimp_bucket_fill_tool_initialize;
tool_class->button_release = gimp_bucket_fill_tool_button_release;
tool_class->modifier_key = gimp_bucket_fill_tool_modifier_key;
tool_class->cursor_update = gimp_bucket_fill_tool_cursor_update;
}
示例5: gimp_crop_tool_cursor_update
static void
gimp_crop_tool_cursor_update (GimpTool *tool,
const GimpCoords *coords,
GdkModifierType state,
GimpDisplay *display)
{
gimp_rectangle_tool_cursor_update (tool, coords, state, display);
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display);
}
示例6: gimp_mybrush_tool_class_init
static void
gimp_mybrush_tool_class_init (GimpMybrushToolClass *klass)
{
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
GimpPaintToolClass *paint_tool_class = GIMP_PAINT_TOOL_CLASS (klass);
tool_class->options_notify = gimp_mybrush_tool_options_notify;
paint_tool_class->get_outline = gimp_mybrush_tool_get_outline;
}
示例7: gimp_selection_tool_class_init
static void
gimp_selection_tool_class_init (GimpSelectionToolClass *klass)
{
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
tool_class->modifier_key = gimp_selection_tool_modifier_key;
tool_class->key_press = gimp_edit_selection_tool_key_press;
tool_class->oper_update = gimp_selection_tool_oper_update;
tool_class->cursor_update = gimp_selection_tool_cursor_update;
}
示例8: gimp_curves_tool_button_release
static void
gimp_curves_tool_button_release (GimpTool *tool,
const GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpButtonReleaseType release_type,
GimpDisplay *display)
{
GimpCurvesTool *c_tool = GIMP_CURVES_TOOL (tool);
GimpImageMapTool *im_tool = GIMP_IMAGE_MAP_TOOL (tool);
GimpCurvesConfig *config = GIMP_CURVES_CONFIG (im_tool->config);
if (state & gimp_get_extend_selection_mask ())
{
GimpCurve *curve = config->curve[config->channel];
gdouble value = c_tool->picked_color[config->channel];
gint closest;
closest = gimp_curve_get_closest_point (curve, value);
gimp_curve_view_set_selected (GIMP_CURVE_VIEW (c_tool->graph),
closest);
gimp_curve_set_point (curve, closest,
value, gimp_curve_map_value (curve, value));
}
else if (state & gimp_get_toggle_behavior_mask ())
{
GimpHistogramChannel channel;
for (channel = GIMP_HISTOGRAM_VALUE;
channel <= GIMP_HISTOGRAM_ALPHA;
channel++)
{
GimpCurve *curve = config->curve[channel];
gdouble value = c_tool->picked_color[channel];
gint closest;
if (value != -1)
{
closest = gimp_curve_get_closest_point (curve, value);
gimp_curve_view_set_selected (GIMP_CURVE_VIEW (c_tool->graph),
closest);
gimp_curve_set_point (curve, closest,
value, gimp_curve_map_value (curve, value));
}
}
}
/* chain up to halt the tool */
GIMP_TOOL_CLASS (parent_class)->button_release (tool, coords, time, state,
release_type, display);
}
示例9: gimp_flip_tool_class_init
static void
gimp_flip_tool_class_init (GimpFlipToolClass *klass)
{
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
GimpTransformToolClass *trans_class = GIMP_TRANSFORM_TOOL_CLASS (klass);
tool_class->modifier_key = gimp_flip_tool_modifier_key;
tool_class->cursor_update = gimp_flip_tool_cursor_update;
trans_class->transform = gimp_flip_tool_transform;
}
示例10: gimp_sample_point_tool_class_init
static void
gimp_sample_point_tool_class_init (GimpSamplePointToolClass *klass)
{
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
GimpDrawToolClass *draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
tool_class->button_release = gimp_sample_point_tool_button_release;
tool_class->motion = gimp_sample_point_tool_motion;
draw_tool_class->draw = gimp_sample_point_tool_draw;
}
示例11: gimp_guide_tool_class_init
static void
gimp_guide_tool_class_init (GimpGuideToolClass *klass)
{
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
GimpDrawToolClass *draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
tool_class->button_release = gimp_guide_tool_button_release;
tool_class->motion = gimp_guide_tool_motion;
draw_tool_class->draw = gimp_guide_tool_draw;
}
示例12: gimp_color_tool_cursor_update
static void
gimp_color_tool_cursor_update (GimpTool *tool,
const GimpCoords *coords,
GdkModifierType state,
GimpDisplay *display)
{
GimpColorTool *color_tool = GIMP_COLOR_TOOL (tool);
GimpImage *image = gimp_display_get_image (display);
if (color_tool->enabled)
{
if (color_tool->sample_point)
{
gimp_tool_set_cursor (tool, display,
GIMP_CURSOR_MOUSE,
GIMP_TOOL_CURSOR_COLOR_PICKER,
GIMP_CURSOR_MODIFIER_MOVE);
}
else
{
GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_BAD;
if (gimp_image_coords_in_active_pickable (image, coords,
color_tool->options->sample_merged,
FALSE))
{
switch (color_tool->pick_mode)
{
case GIMP_COLOR_PICK_MODE_NONE:
modifier = GIMP_CURSOR_MODIFIER_NONE;
break;
case GIMP_COLOR_PICK_MODE_FOREGROUND:
modifier = GIMP_CURSOR_MODIFIER_FOREGROUND;
break;
case GIMP_COLOR_PICK_MODE_BACKGROUND:
modifier = GIMP_CURSOR_MODIFIER_BACKGROUND;
break;
case GIMP_COLOR_PICK_MODE_PALETTE:
modifier = GIMP_CURSOR_MODIFIER_PLUS;
break;
}
}
gimp_tool_set_cursor (tool, display,
GIMP_CURSOR_COLOR_PICKER,
GIMP_TOOL_CURSOR_COLOR_PICKER,
modifier);
}
return; /* don't chain up */
}
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display);
}
示例13: gimp_rectangle_select_tool_oper_update
static void
gimp_rectangle_select_tool_oper_update (GimpTool *tool,
const GimpCoords *coords,
GdkModifierType state,
gboolean proximity,
GimpDisplay *display)
{
gimp_rectangle_tool_oper_update (tool, coords, state, proximity, display);
GIMP_TOOL_CLASS (parent_class)->oper_update (tool, coords, state, proximity,
display);
}
示例14: gimp_rectangle_select_tool_active_modifier_key
static void
gimp_rectangle_select_tool_active_modifier_key (GimpTool *tool,
GdkModifierType key,
gboolean press,
GdkModifierType state,
GimpDisplay *display)
{
GIMP_TOOL_CLASS (parent_class)->active_modifier_key (tool, key, press, state,
display);
gimp_rectangle_tool_active_modifier_key (tool, key, press, state, display);
}
示例15: gimp_eraser_tool_cursor_update
static void
gimp_eraser_tool_cursor_update (GimpTool *tool,
const GimpCoords *coords,
GdkModifierType state,
GimpDisplay *display)
{
GimpEraserOptions *options = GIMP_ERASER_TOOL_GET_OPTIONS (tool);
gimp_tool_control_set_toggled (tool->control, options->anti_erase);
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display);
}