示例#1
0
void
gimp_tool_control_set_wants_click (GimpToolControl *control,
                                   gboolean         wants_click)
{
  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));

  control->wants_click = wants_click ? TRUE : FALSE;
}
示例#2
0
void
gimp_tool_control_halt (GimpToolControl *control)
{
  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));
  g_return_if_fail (control->active == TRUE);

  control->active = FALSE;
}
示例#3
0
void
gimp_tool_control_set_toggle_tool_cursor (GimpToolControl    *control,
                                          GimpToolCursorType  cursor)
{
  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));

  control->toggle_tool_cursor = cursor;
}
示例#4
0
void
gimp_tool_control_set_motion_mode (GimpToolControl *control,
                                   GimpMotionMode   motion_mode)
{
  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));

  control->motion_mode = motion_mode;
}
示例#5
0
void
gimp_tool_control_set_snap_to (GimpToolControl *control,
                               gboolean         snap_to)
{
  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));

  control->auto_snap_to = snap_to ? TRUE : FALSE;
}
示例#6
0
void
gimp_tool_control_resume (GimpToolControl *control)
{
  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));
  g_return_if_fail (control->paused_count > 0);

  control->paused_count--;
}
示例#7
0
void
gimp_tool_control_set_toggle_cursor_modifier (GimpToolControl    *control,
                                              GimpCursorModifier  modifier)
{
  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));

  control->toggle_cursor_modifier = modifier;
}
示例#8
0
void
gimp_tool_control_set_scroll_lock (GimpToolControl *control,
                                   gboolean         scroll_lock)
{
  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));

  control->scroll_lock = scroll_lock ? TRUE : FALSE;
}
示例#9
0
void
gimp_tool_control_set_handle_empty_image (GimpToolControl *control,
                                          gboolean         handle_empty)
{
  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));

  control->handle_empty_image = handle_empty ? TRUE : FALSE;
}
示例#10
0
GimpCursorPrecision
gimp_tool_control_get_precision (GimpToolControl *control)
{
  g_return_val_if_fail (GIMP_IS_TOOL_CONTROL (control),
                        GIMP_CURSOR_PRECISION_PIXEL_CENTER);

  return control->precision;
}
示例#11
0
void
gimp_tool_control_set_preserve (GimpToolControl *control,
                                gboolean         preserve)
{
  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));

  control->preserve = preserve ? TRUE : FALSE;
}
示例#12
0
GimpToolActiveModifiers
gimp_tool_control_get_active_modifiers (GimpToolControl *control)
{
  g_return_val_if_fail (GIMP_IS_TOOL_CONTROL (control),
                        GIMP_TOOL_ACTIVE_MODIFIERS_OFF);

  return control->active_modifiers;
}
示例#13
0
void
gimp_tool_control_set_precision (GimpToolControl     *control,
                                 GimpCursorPrecision  precision)
{
  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));

  control->precision = precision;
}
示例#14
0
void
gimp_tool_control_set_active_modifiers (GimpToolControl         *control,
                                        GimpToolActiveModifiers  active_modifiers)
{
  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));

  control->active_modifiers = active_modifiers;
}
示例#15
0
void
gimp_tool_control_set_wants_all_key_events (GimpToolControl *control,
                                            gboolean         wants_key_events)
{
  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));

  control->wants_all_key_events = wants_key_events ? TRUE : FALSE;
}
示例#16
0
void
gimp_tool_control_set_dirty_action (GimpToolControl *control,
                                    GimpToolAction  action)
{
  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));

  control->dirty_action = action;
}
示例#17
0
void
gimp_tool_control_set_toggled (GimpToolControl *control,
                               gboolean         toggled)
{
  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));

  control->toggled = toggled ? TRUE : FALSE;
}
示例#18
0
void
gimp_tool_control_set_dirty_mask (GimpToolControl *control,
                                  GimpDirtyMask    dirty_mask)
{
  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));

  control->dirty_mask = dirty_mask;
}
示例#19
0
void
gimp_tool_control_activate (GimpToolControl *control)
{
  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));
#ifdef GIMP_UNSTABLE
  g_return_if_fail (control->active == FALSE);
#endif

  control->active = TRUE;
}
示例#20
0
GimpCursorModifier
gimp_tool_control_get_cursor_modifier (GimpToolControl *control)
{
  g_return_val_if_fail (GIMP_IS_TOOL_CONTROL (control), FALSE);

  if (control->toggled && control->toggle_cursor_modifier != -1)
    return control->toggle_cursor_modifier;

  return control->cursor_modifier;
}
示例#21
0
GimpToolCursorType
gimp_tool_control_get_tool_cursor (GimpToolControl *control)
{
  g_return_val_if_fail (GIMP_IS_TOOL_CONTROL (control), FALSE);

  if (control->toggled && control->toggle_tool_cursor != -1)
    return control->toggle_tool_cursor;

  return control->tool_cursor;
}
示例#22
0
void
gimp_tool_control_pop_preserve (GimpToolControl *control)
{
  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));
  g_return_if_fail (control->preserve_stack != NULL);

  control->preserve = GPOINTER_TO_INT (control->preserve_stack->data);

  control->preserve_stack = g_slist_delete_link (control->preserve_stack,
                                                 control->preserve_stack);
}
示例#23
0
void
gimp_tool_control_push_preserve (GimpToolControl *control,
                                 gboolean         preserve)
{
  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));

  control->preserve_stack =
    g_slist_prepend (control->preserve_stack,
                     GINT_TO_POINTER (control->preserve));

  control->preserve = preserve ? TRUE : FALSE;
}
示例#24
0
void
gimp_tool_control_set_action_object_2 (GimpToolControl *control,
                                       const gchar     *action)
{
  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));

  if (action != control->action_object_2)
    {
      g_free (control->action_object_2);
      control->action_object_2 = g_strdup (action);
    }
}
示例#25
0
void
gimp_tool_control_set_snap_offsets (GimpToolControl *control,
                                    gint             offset_x,
                                    gint             offset_y,
                                    gint             width,
                                    gint             height)
{
  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));

  control->snap_offset_x = offset_x;
  control->snap_offset_y = offset_y;
  control->snap_width    = width;
  control->snap_height   = height;
}
示例#26
0
void
gimp_tool_control_get_snap_offsets (GimpToolControl *control,
                                    gint            *offset_x,
                                    gint            *offset_y,
                                    gint            *width,
                                    gint            *height)
{
  g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));

  if (offset_x) *offset_x = control->snap_offset_x;
  if (offset_y) *offset_y = control->snap_offset_y;
  if (width)    *width    = control->snap_width;
  if (height)   *height   = control->snap_height;
}