void gimp_color_tool_start_sample_point (GimpTool *tool, GimpDisplay *display) { GimpColorTool *color_tool; g_return_if_fail (GIMP_IS_COLOR_TOOL (tool)); g_return_if_fail (GIMP_IS_DISPLAY (display)); color_tool = GIMP_COLOR_TOOL (tool); gimp_display_shell_selection_pause (gimp_display_get_shell (display)); tool->display = display; gimp_tool_control_activate (tool->control); gimp_tool_control_set_scroll_lock (tool->control, TRUE); if (gimp_draw_tool_is_active (GIMP_DRAW_TOOL (tool))) gimp_draw_tool_stop (GIMP_DRAW_TOOL (tool)); color_tool->sample_point = NULL; color_tool->moving_sample_point = TRUE; color_tool->sample_point_x = SAMPLE_POINT_POSITION_INVALID; color_tool->sample_point_y = SAMPLE_POINT_POSITION_INVALID; gimp_tool_set_cursor (tool, display, GIMP_CURSOR_MOUSE, GIMP_TOOL_CURSOR_COLOR_PICKER, GIMP_CURSOR_MODIFIER_MOVE); gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), display); }
void gimp_color_tool_start_sample_point (GimpTool *tool, GimpDisplay *display) { GimpColorTool *color_tool; g_return_if_fail (GIMP_IS_COLOR_TOOL (tool)); g_return_if_fail (GIMP_IS_DISPLAY (display)); color_tool = GIMP_COLOR_TOOL (tool); gimp_display_shell_selection_control (GIMP_DISPLAY_SHELL (display->shell), GIMP_SELECTION_PAUSE); tool->display = display; gimp_tool_control_activate (tool->control); if (color_tool->sample_point) gimp_display_shell_draw_sample_point (GIMP_DISPLAY_SHELL (display->shell), color_tool->sample_point, FALSE); color_tool->sample_point = NULL; color_tool->moving_sample_point = TRUE; color_tool->sample_point_x = -1; color_tool->sample_point_y = -1; gimp_tool_set_cursor (tool, display, GIMP_CURSOR_MOUSE, GIMP_TOOL_CURSOR_COLOR_PICKER, GIMP_CURSOR_MODIFIER_MOVE); gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), display); }
void gimp_color_tool_disable (GimpColorTool *color_tool) { GimpTool *tool; g_return_if_fail (GIMP_IS_COLOR_TOOL (color_tool)); tool = GIMP_TOOL (color_tool); if (gimp_tool_control_is_active (tool->control)) { g_warning ("Trying to disable GimpColorTool while it is active."); return; } if (color_tool->options) { g_object_unref (color_tool->options); color_tool->options = NULL; } color_tool->enabled = FALSE; }
void gimp_color_tool_enable (GimpColorTool *color_tool, GimpColorOptions *options) { GimpTool *tool; g_return_if_fail (GIMP_IS_COLOR_TOOL (color_tool)); g_return_if_fail (GIMP_IS_COLOR_OPTIONS (options)); tool = GIMP_TOOL (color_tool); if (gimp_tool_control_is_active (tool->control)) { g_warning ("Trying to enable GimpColorTool while it is active."); return; } if (color_tool->options) g_object_unref (color_tool->options); color_tool->options = g_object_ref (options); color_tool->enabled = TRUE; }