本文整理汇总了C++中GIMP_TOOL函数的典型用法代码示例。如果您正苦于以下问题:C++ GIMP_TOOL函数的具体用法?C++ GIMP_TOOL怎么用?C++ GIMP_TOOL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GIMP_TOOL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: gimp_text_tool_im_preedit_start
static void
gimp_text_tool_im_preedit_start (GtkIMContext *context,
GimpTextTool *text_tool)
{
GimpTool *tool = GIMP_TOOL (text_tool);
GimpDisplayShell *shell = gimp_display_get_shell (tool->display);
GtkStyle *style = gtk_widget_get_style (shell->canvas);
GtkWidget *frame;
GtkWidget *ebox;
PangoRectangle cursor_rect = { 0, };
gint off_x, off_y;
if (text_tool->text)
gimp_text_tool_editor_get_cursor_rect (text_tool,
text_tool->overwrite_mode,
&cursor_rect);
g_object_get (text_tool, "x1", &off_x, "y1", &off_y, NULL);
text_tool->preedit_overlay = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (text_tool->preedit_overlay),
GTK_SHADOW_OUT);
gimp_display_shell_add_overlay (shell,
text_tool->preedit_overlay,
cursor_rect.x + off_x,
cursor_rect.y + off_y,
GIMP_HANDLE_ANCHOR_NORTH_WEST, 0, 0);
gimp_overlay_box_set_child_opacity (GIMP_OVERLAY_BOX (shell->canvas),
text_tool->preedit_overlay, 0.7);
gtk_widget_show (text_tool->preedit_overlay);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_container_add (GTK_CONTAINER (text_tool->preedit_overlay), frame);
gtk_widget_show (frame);
ebox = gtk_event_box_new ();
gtk_widget_modify_bg (ebox, GTK_STATE_NORMAL,
&style->base[GTK_STATE_NORMAL]);
gtk_container_add (GTK_CONTAINER (frame), ebox);
gtk_widget_show (ebox);
text_tool->preedit_label = gtk_label_new (NULL);
gtk_widget_modify_bg (text_tool->preedit_label, GTK_STATE_NORMAL,
&style->text[GTK_STATE_NORMAL]);
gtk_misc_set_padding (GTK_MISC (text_tool->preedit_label), 2, 2);
gtk_container_add (GTK_CONTAINER (ebox), text_tool->preedit_label);
gtk_widget_show (text_tool->preedit_label);
}
开发者ID:DevMaggio,项目名称:gimp,代码行数:49,代码来源:gimptexttool-editor.c
示例2: gimp_rotate_tool_prepare
static void
gimp_rotate_tool_prepare (GimpTransformTool *tr_tool)
{
GimpRotateTool *rotate = GIMP_ROTATE_TOOL (tr_tool);
GimpDisplay *display = GIMP_TOOL (tr_tool)->display;
GimpImage *image = gimp_display_get_image (display);
gdouble xres;
gdouble yres;
tr_tool->px = (gdouble) (tr_tool->x1 + tr_tool->x2) / 2.0;
tr_tool->py = (gdouble) (tr_tool->y1 + tr_tool->y2) / 2.0;
tr_tool->trans_info[ANGLE] = 0.0;
tr_tool->trans_info[REAL_ANGLE] = 0.0;
tr_tool->trans_info[PIVOT_X] = tr_tool->px;
tr_tool->trans_info[PIVOT_Y] = tr_tool->py;
gimp_image_get_resolution (image, &xres, &yres);
g_signal_handlers_block_by_func (rotate->sizeentry,
rotate_center_changed,
tr_tool);
gimp_size_entry_set_unit (GIMP_SIZE_ENTRY (rotate->sizeentry),
gimp_display_get_shell (display)->unit);
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (rotate->sizeentry), 0,
xres, FALSE);
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (rotate->sizeentry), 1,
yres, FALSE);
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (rotate->sizeentry), 0,
-65536,
65536 +
gimp_image_get_width (image));
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (rotate->sizeentry), 1,
-65536,
65536 +
gimp_image_get_height (image));
gimp_size_entry_set_size (GIMP_SIZE_ENTRY (rotate->sizeentry), 0,
tr_tool->x1, tr_tool->x2);
gimp_size_entry_set_size (GIMP_SIZE_ENTRY (rotate->sizeentry), 1,
tr_tool->y1, tr_tool->y2);
g_signal_handlers_unblock_by_func (rotate->sizeentry,
rotate_center_changed,
tr_tool);
}
开发者ID:AnonPower,项目名称:picman,代码行数:49,代码来源:gimprotatetool.c
示例3: gimp_warp_tool_halt
static void
gimp_warp_tool_halt (GimpWarpTool *wt)
{
GimpTool *tool = GIMP_TOOL (wt);
GimpWarpOptions *options = GIMP_WARP_TOOL_GET_OPTIONS (wt);
if (wt->coords_buffer)
{
g_object_unref (wt->coords_buffer);
wt->coords_buffer = NULL;
}
if (wt->graph)
{
g_object_unref (wt->graph);
wt->graph = NULL;
wt->render_node = NULL;
}
if (wt->image_map)
{
gimp_image_map_abort (wt->image_map);
g_object_unref (wt->image_map);
wt->image_map = NULL;
gimp_image_flush (gimp_display_get_image (tool->display));
}
if (wt->redo_stack)
{
g_list_free_full (wt->redo_stack, (GDestroyNotify) g_object_unref);
wt->redo_stack = NULL;
}
tool->display = NULL;
tool->drawable = NULL;
if (gimp_draw_tool_is_active (GIMP_DRAW_TOOL (wt)))
gimp_draw_tool_stop (GIMP_DRAW_TOOL (wt));
if (options->animate_button)
{
gtk_widget_set_sensitive (options->animate_button, FALSE);
g_signal_handlers_disconnect_by_func (options->animate_button,
gimp_warp_tool_animate,
wt);
}
}
开发者ID:Distrotech,项目名称:gimp,代码行数:49,代码来源:gimpwarptool.c
示例4: gimp_operation_tool_set_config
static void
gimp_operation_tool_set_config (GimpFilterTool *filter_tool,
GimpConfig *config)
{
GimpOperationTool *op_tool = GIMP_OPERATION_TOOL (filter_tool);
gimp_operation_tool_unlink_chains (op_tool);
GIMP_FILTER_TOOL_CLASS (parent_class)->set_config (filter_tool, config);
if (filter_tool->config && GIMP_TOOL (op_tool)->drawable)
gimp_operation_tool_sync_op (op_tool, FALSE);
gimp_operation_tool_relink_chains (op_tool);
}
开发者ID:jiapei100,项目名称:gimp,代码行数:15,代码来源:gimpoperationtool.c
示例5: gimp_n_point_deformation_tool_canvas_update_timeout
static gboolean
gimp_n_point_deformation_tool_canvas_update_timeout (GimpNPointDeformationTool *npd_tool)
{
if (! GIMP_TOOL (npd_tool)->drawable)
return FALSE;
gimp_npd_debug (("canvas update thread\n"));
gimp_draw_tool_pause (GIMP_DRAW_TOOL(npd_tool));
gimp_draw_tool_resume (GIMP_DRAW_TOOL(npd_tool));
gimp_npd_debug (("canvas update thread stop\n"));
return TRUE;
}
开发者ID:AdamGrzonkowski,项目名称:gimp-1,代码行数:15,代码来源:gimpnpointdeformationtool.c
示例6: gimp_scale_tool_init
static void
gimp_scale_tool_init (GimpScaleTool *scale_tool)
{
GimpTool *tool = GIMP_TOOL (scale_tool);
GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (scale_tool);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_RESIZE);
tr_tool->progress_text = _("Scaling");
tr_tool->use_grid = TRUE;
tr_tool->use_corner_handles = TRUE;
tr_tool->use_side_handles = TRUE;
tr_tool->use_center_handle = TRUE;
}
开发者ID:AdamGrzonkowski,项目名称:gimp-1,代码行数:15,代码来源:gimpscaletool.c
示例7: gimp_blend_tool_commit
static void
gimp_blend_tool_commit (GimpBlendTool *blend_tool)
{
GimpTool *tool = GIMP_TOOL (blend_tool);
if (blend_tool->filter)
{
gimp_drawable_filter_commit (blend_tool->filter,
GIMP_PROGRESS (tool), FALSE);
g_object_unref (blend_tool->filter);
blend_tool->filter = NULL;
gimp_image_flush (gimp_display_get_image (tool->display));
}
}
开发者ID:Anstep,项目名称:gimp,代码行数:15,代码来源:gimpblendtool.c
示例8: gimp_text_tool_editor_dialog
static void
gimp_text_tool_editor_dialog (GimpTextTool *text_tool)
{
GimpTool *tool = GIMP_TOOL (text_tool);
GimpTextOptions *options = GIMP_TEXT_TOOL_GET_OPTIONS (text_tool);
GimpDialogFactory *dialog_factory;
GtkWindow *parent = NULL;
gdouble xres = 1.0;
gdouble yres = 1.0;
if (text_tool->editor_dialog)
{
gtk_window_present (GTK_WINDOW (text_tool->editor_dialog));
return;
}
dialog_factory = gimp_dialog_factory_get_singleton ();
if (tool->display)
{
GimpDisplayShell *shell = gimp_display_get_shell (tool->display);
parent = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (shell)));
}
if (text_tool->image)
gimp_image_get_resolution (text_tool->image, &xres, &yres);
text_tool->editor_dialog =
gimp_text_options_editor_new (parent, tool->tool_info->gimp, options,
gimp_dialog_factory_get_menu_factory (dialog_factory),
_("GIMP Text Editor"),
text_tool->proxy, text_tool->buffer,
xres, yres);
g_object_add_weak_pointer (G_OBJECT (text_tool->editor_dialog),
(gpointer) &text_tool->editor_dialog);
gimp_dialog_factory_add_foreign (dialog_factory,
"gimp-text-tool-dialog",
text_tool->editor_dialog);
g_signal_connect (text_tool->editor_dialog, "destroy",
G_CALLBACK (gimp_text_tool_editor_destroy),
text_tool);
gtk_widget_show (text_tool->editor_dialog);
}
开发者ID:DevMaggio,项目名称:gimp,代码行数:48,代码来源:gimptexttool-editor.c
示例9: gimp_color_tool_draw
static void
gimp_color_tool_draw (GimpDrawTool *draw_tool)
{
GimpColorTool *color_tool = GIMP_COLOR_TOOL (draw_tool);
if (color_tool->enabled)
{
if (color_tool->sample_point)
{
GimpImage *image = gimp_display_get_image (draw_tool->display);
GimpCanvasItem *item;
gint index;
gint x;
gint y;
gimp_sample_point_get_position (color_tool->sample_point, &x, &y);
index = g_list_index (gimp_image_get_sample_points (image),
color_tool->sample_point) + 1;
item = gimp_draw_tool_add_sample_point (draw_tool, x, y, index);
gimp_canvas_item_set_highlight (item, TRUE);
}
if (color_tool->moving_sample_point)
{
if (color_tool->sample_point_x != SAMPLE_POINT_POSITION_INVALID &&
color_tool->sample_point_y != SAMPLE_POINT_POSITION_INVALID)
{
gimp_draw_tool_add_crosshair (draw_tool,
color_tool->sample_point_x,
color_tool->sample_point_y);
}
}
else if (color_tool->options->sample_average &&
gimp_tool_control_is_active (GIMP_TOOL (draw_tool)->control))
{
gdouble radius = color_tool->options->average_radius;
gimp_draw_tool_add_rectangle (draw_tool,
FALSE,
color_tool->center_x - radius,
color_tool->center_y - radius,
2 * radius + 1,
2 * radius + 1);
}
}
}
开发者ID:SHIVAPRASAD96,项目名称:gimp,代码行数:48,代码来源:gimpcolortool.c
示例10: gimp_warp_tool_button_release
void
gimp_warp_tool_button_release (GimpTool *tool,
const GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpButtonReleaseType release_type,
GimpDisplay *display)
{
GimpWarpTool *wt = GIMP_WARP_TOOL (tool);
gimp_draw_tool_pause (GIMP_DRAW_TOOL (wt));
gimp_tool_control_halt (tool->control);
g_source_remove (wt->stroke_timer);
wt->stroke_timer = 0;
g_signal_handlers_disconnect_by_func (wt->current_stroke,
gimp_warp_tool_stroke_changed,
wt);
#ifdef WARP_DEBUG
g_printerr ("%s\n", gegl_path_to_string (wt->current_stroke));
#endif
g_object_unref (wt->current_stroke);
wt->current_stroke = NULL;
if (release_type == GIMP_BUTTON_RELEASE_CANCEL)
{
gimp_warp_tool_undo (tool, display);
/* the just undone stroke has no business on the redo stack */
g_object_unref (wt->redo_stack->data);
wt->redo_stack = g_list_remove_link (wt->redo_stack, wt->redo_stack);
}
else if (wt->redo_stack)
{
/* the redo stack becomes invalid by actually doing a stroke */
g_list_free_full (wt->redo_stack, (GDestroyNotify) g_object_unref);
wt->redo_stack = NULL;
}
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
/* update the undo actions / menu items */
gimp_image_flush (gimp_display_get_image (GIMP_TOOL (wt)->display));
}
开发者ID:AjayRamanathan,项目名称:gimp,代码行数:48,代码来源:gimpwarptool.c
示例11: gimp_blend_tool_update_graph
static void
gimp_blend_tool_update_graph (GimpBlendTool *blend_tool)
{
GimpTool *tool = GIMP_TOOL (blend_tool);
gint off_x, off_y;
gimp_item_get_offset (GIMP_ITEM (tool->drawable), &off_x, &off_y);
#if 0
if (gimp_blend_tool_is_shapeburst (blend_tool))
{
gfloat start, end;
gegl_buffer_get (blend_tool->dist_buffer,
GEGL_RECTANGLE (blend_tool->start_x - off_x,
blend_tool->start_y - off_y,
1, 1),
1.0, babl_format("Y float"), &start,
GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_NONE);
gegl_buffer_get (blend_tool->dist_buffer,
GEGL_RECTANGLE (blend_tool->end_x - off_x,
blend_tool->end_y - off_y,
1, 1),
1.0, babl_format("Y float"), &end,
GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_NONE);
if (start != end)
{
gegl_node_set (blend_tool->subtract_node,
"value", (gdouble) start,
NULL);
gegl_node_set (blend_tool->divide_node,
"value", (gdouble) (end - start),
NULL);
}
}
else
#endif
{
gegl_node_set (blend_tool->render_node,
"start_x", blend_tool->start_x - off_x,
"start_y", blend_tool->start_y - off_y,
"end_x", blend_tool->end_x - off_x,
"end_y", blend_tool->end_y - off_y,
NULL);
}
}
开发者ID:Anstep,项目名称:gimp,代码行数:48,代码来源:gimpblendtool.c
示例12: gimp_cage_tool_commit
static void
gimp_cage_tool_commit (GimpCageTool *ct)
{
GimpTool *tool = GIMP_TOOL (ct);
gimp_tool_control_push_preserve (tool->control, TRUE);
gimp_image_map_commit (ct->image_map,
GIMP_PROGRESS (tool));
g_object_unref (ct->image_map);
ct->image_map = NULL;
gimp_tool_control_pop_preserve (tool->control);
gimp_image_flush (gimp_display_get_image (tool->display));
}
开发者ID:STRNG,项目名称:gimp,代码行数:16,代码来源:gimpcagetool.c
示例13: gimp_tool_progress_end
static void
gimp_tool_progress_end (GimpProgress *progress)
{
GimpTool *tool = GIMP_TOOL (progress);
if (tool->progress)
{
GimpDisplayShell *shell = gimp_display_get_shell (tool->progress_display);
gimp_progress_end (GIMP_PROGRESS (tool->progress));
gimp_display_shell_remove_item (shell, tool->progress);
tool->progress = NULL;
tool->progress_display = NULL;
}
}
开发者ID:MichaelMure,项目名称:Gimp-Cage-Tool,代码行数:16,代码来源:gimptool-progress.c
示例14: gimp_seamless_clone_tool_init
static void
gimp_seamless_clone_tool_init (GimpSeamlessCloneTool *self)
{
GimpTool *tool = GIMP_TOOL (self);
gimp_tool_control_set_dirty_mask (tool->control,
GIMP_DIRTY_IMAGE |
GIMP_DIRTY_IMAGE_STRUCTURE |
GIMP_DIRTY_DRAWABLE |
GIMP_DIRTY_SELECTION);
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_TOOL_CURSOR_MOVE);
self->tool_state = SC_STATE_INIT;
}
开发者ID:jiapei100,项目名称:gimp,代码行数:16,代码来源:gimpseamlessclonetool.c
示例15: gimp_region_select_tool_draw
static void
gimp_region_select_tool_draw (GimpDrawTool *draw_tool)
{
GimpRegionSelectTool *region_sel = GIMP_REGION_SELECT_TOOL (draw_tool);
if (region_sel->segs)
{
GimpDisplayShell *shell;
shell = GIMP_DISPLAY_SHELL (GIMP_TOOL (draw_tool)->display->shell);
gimp_canvas_draw_segments (GIMP_CANVAS (shell->canvas),
GIMP_CANVAS_STYLE_XOR,
region_sel->segs, region_sel->num_segs);
}
}
开发者ID:jdburton,项目名称:gimp-osx,代码行数:16,代码来源:gimpregionselecttool.c
示例16: gimp_warp_tool_init
static void
gimp_warp_tool_init (GimpWarpTool *self)
{
GimpTool *tool = GIMP_TOOL (self);
gimp_tool_control_set_preserve (tool->control, FALSE);
gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_EXACT);
gimp_tool_control_set_dirty_mask (tool->control,
GIMP_DIRTY_IMAGE |
GIMP_DIRTY_IMAGE_STRUCTURE |
GIMP_DIRTY_DRAWABLE |
GIMP_DIRTY_SELECTION);
gimp_tool_control_set_wants_click (tool->control, TRUE);
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_TOOL_CURSOR_PERSPECTIVE);
}
开发者ID:AjayRamanathan,项目名称:gimp,代码行数:16,代码来源:gimpwarptool.c
示例17: gimp_heal_tool_init
static void
gimp_heal_tool_init (GimpHealTool *heal)
{
GimpTool *tool = GIMP_TOOL (heal);
GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool);
GimpSourceTool *source_tool = GIMP_SOURCE_TOOL (tool);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_HEAL);
paint_tool->status = _("Click to heal");
paint_tool->status_ctrl = _("%s to set a new heal source");
source_tool->status_paint = _("Click to heal");
source_tool->status_set_source = _("Click to set a new heal source");
source_tool->status_set_source_ctrl = _("%s to set a new heal source");
}
开发者ID:Amerekanets,项目名称:gimp,代码行数:16,代码来源:gimphealtool.c
示例18: gimp_region_select_tool_init
static void
gimp_region_select_tool_init (GimpRegionSelectTool *region_select)
{
GimpTool *tool = GIMP_TOOL (region_select);
gimp_tool_control_set_scroll_lock (tool->control, TRUE);
gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_COMPRESS);
region_select->x = 0;
region_select->y = 0;
region_select->saved_threshold = 0.0;
region_select->region_mask = NULL;
region_select->segs = NULL;
region_select->num_segs = 0;
}
开发者ID:jdburton,项目名称:gimp-osx,代码行数:16,代码来源:gimpregionselecttool.c
示例19: gimp_ink_tool_init
static void
gimp_ink_tool_init (GimpInkTool *ink_tool)
{
GimpTool *tool = GIMP_TOOL (ink_tool);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_INK);
gimp_tool_control_set_action_value_2 (tool->control,
"tools/tools-ink-blob-size-set");
gimp_tool_control_set_action_value_3 (tool->control,
"tools/tools-ink-blob-aspect-set");
gimp_tool_control_set_action_value_4 (tool->control,
"tools/tools-ink-blob-angle-set");
gimp_paint_tool_enable_color_picker (GIMP_PAINT_TOOL (ink_tool),
GIMP_COLOR_PICK_MODE_FOREGROUND);
}
开发者ID:Amerekanets,项目名称:gimp-1,代码行数:16,代码来源:gimpinktool.c
示例20: gimp_perspective_clone_tool_widget_status
static void
gimp_perspective_clone_tool_widget_status (GimpToolWidget *widget,
const gchar *status,
GimpPerspectiveCloneTool *clone_tool)
{
GimpTool *tool = GIMP_TOOL (clone_tool);
if (status)
{
gimp_tool_replace_status (tool, tool->display, "%s", status);
}
else
{
gimp_tool_pop_status (tool, tool->display);
}
}
开发者ID:jiapei100,项目名称:gimp,代码行数:16,代码来源:gimpperspectiveclonetool.c
注:本文中的GIMP_TOOL函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论