Example #1
0
static void
gimp_display_shell_guide_add_handler (GimpImage        *image,
                                      GimpGuide        *guide,
                                      GimpDisplayShell *shell)
{
  GimpCanvasProxyGroup *group = GIMP_CANVAS_PROXY_GROUP (shell->guides);
  GimpCanvasItem       *item;

  item = gimp_canvas_guide_new (shell,
                                gimp_guide_get_orientation (guide),
                                gimp_guide_get_position (guide),
                                TRUE);

  gimp_canvas_proxy_group_add_item (group, guide, item);
  g_object_unref (item);
}
Example #2
0
/**
 * gimp_draw_tool_add_guide:
 * @draw_tool:   the #GimpDrawTool
 * @orientation: the orientation of the guide line
 * @position:    the position of the guide line in image coordinates
 *
 * This function draws a guide line across the canvas.
 **/
GimpCanvasItem *
gimp_draw_tool_add_guide (GimpDrawTool        *draw_tool,
                          GimpOrientationType  orientation,
                          gint                 position,
                          gboolean             guide_style)
{
  GimpCanvasItem *item;

  g_return_val_if_fail (GIMP_IS_DRAW_TOOL (draw_tool), NULL);

  item = gimp_canvas_guide_new (gimp_display_get_shell (draw_tool->display),
                                orientation, position, guide_style);

  gimp_draw_tool_add_item (draw_tool, item);
  g_object_unref (item);

  return item;
}