當前位置: 首頁>>代碼示例>>C++>>正文


C++ GIMP_UNDO_CLASS函數代碼示例

本文整理匯總了C++中GIMP_UNDO_CLASS函數的典型用法代碼示例。如果您正苦於以下問題:C++ GIMP_UNDO_CLASS函數的具體用法?C++ GIMP_UNDO_CLASS怎麽用?C++ GIMP_UNDO_CLASS使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GIMP_UNDO_CLASS函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: gimp_vectors_mod_undo_pop

static void
gimp_vectors_mod_undo_pop (GimpUndo            *undo,
                           GimpUndoMode         undo_mode,
                           GimpUndoAccumulator *accum)
{
  GimpVectorsModUndo *vectors_mod_undo = GIMP_VECTORS_MOD_UNDO (undo);
  GimpVectors        *vectors          = GIMP_VECTORS (GIMP_ITEM_UNDO (undo)->item);
  GimpVectors        *temp;

  GIMP_UNDO_CLASS (parent_class)->pop (undo, undo_mode, accum);

  temp = vectors_mod_undo->vectors;

  vectors_mod_undo->vectors =
    GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (vectors),
                                       G_TYPE_FROM_INSTANCE (vectors),
                                       FALSE));

  gimp_vectors_freeze (vectors);

  gimp_vectors_copy_strokes (temp, vectors);

  GIMP_ITEM (vectors)->width    = GIMP_ITEM (temp)->width;
  GIMP_ITEM (vectors)->height   = GIMP_ITEM (temp)->height;
  GIMP_ITEM (vectors)->offset_x = GIMP_ITEM (temp)->offset_x;
  GIMP_ITEM (vectors)->offset_y = GIMP_ITEM (temp)->offset_y;

  g_object_unref (temp);

  gimp_vectors_thaw (vectors);
}
開發者ID:Amerekanets,項目名稱:gimp,代碼行數:31,代碼來源:gimpvectorsmodundo.c

示例2: gimp_item_prop_undo_free

static void
gimp_item_prop_undo_free (GimpUndo     *undo,
                          GimpUndoMode  undo_mode)
{
  GimpItemPropUndo *item_prop_undo = GIMP_ITEM_PROP_UNDO (undo);

  if (item_prop_undo->name)
    {
      g_free (item_prop_undo->name);
      item_prop_undo->name = NULL;
    }

  if (item_prop_undo->parasite_name)
    {
      g_free (item_prop_undo->parasite_name);
      item_prop_undo->parasite_name = NULL;
    }

  if (item_prop_undo->parasite)
    {
      gimp_parasite_free (item_prop_undo->parasite);
      item_prop_undo->parasite = NULL;
    }

  GIMP_UNDO_CLASS (parent_class)->free (undo, undo_mode);
}
開發者ID:LebedevRI,項目名稱:gimp,代碼行數:26,代碼來源:gimpitempropundo.c

示例3: gimp_drawable_mod_undo_pop

static void
gimp_drawable_mod_undo_pop (GimpUndo            *undo,
                            GimpUndoMode         undo_mode,
                            GimpUndoAccumulator *accum)
{
  GimpDrawableModUndo *drawable_mod_undo = GIMP_DRAWABLE_MOD_UNDO (undo);
  GimpDrawable        *drawable          = GIMP_DRAWABLE (GIMP_ITEM_UNDO (undo)->item);
  GeglBuffer          *buffer;
  gint                 offset_x;
  gint                 offset_y;

  GIMP_UNDO_CLASS (parent_class)->pop (undo, undo_mode, accum);

  buffer   = drawable_mod_undo->buffer;
  offset_x = drawable_mod_undo->offset_x;
  offset_y = drawable_mod_undo->offset_y;

  drawable_mod_undo->buffer = g_object_ref (gimp_drawable_get_buffer (drawable));

  gimp_item_get_offset (GIMP_ITEM (drawable),
                        &drawable_mod_undo->offset_x,
                        &drawable_mod_undo->offset_y);

  gimp_drawable_set_buffer_full (drawable, FALSE, NULL,
                                 buffer, offset_x, offset_y);
  g_object_unref (buffer);
}
開發者ID:ChristianBusch,項目名稱:gimp,代碼行數:27,代碼來源:gimpdrawablemodundo.c

示例4: gimp_layer_mask_undo_pop

static void
gimp_layer_mask_undo_pop (GimpUndo            *undo,
                          GimpUndoMode         undo_mode,
                          GimpUndoAccumulator *accum)
{
  GimpLayerMaskUndo *layer_mask_undo = GIMP_LAYER_MASK_UNDO (undo);
  GimpLayer         *layer           = GIMP_LAYER (GIMP_ITEM_UNDO (undo)->item);

  GIMP_UNDO_CLASS (parent_class)->pop (undo, undo_mode, accum);

  if ((undo_mode       == GIMP_UNDO_MODE_UNDO &&
       undo->undo_type == GIMP_UNDO_LAYER_MASK_ADD) ||
      (undo_mode       == GIMP_UNDO_MODE_REDO &&
       undo->undo_type == GIMP_UNDO_LAYER_MASK_REMOVE))
    {
      /*  remove layer mask  */

      gimp_layer_apply_mask (layer, GIMP_MASK_DISCARD, FALSE);
    }
  else
    {
      /*  restore layer mask  */

      gimp_layer_add_mask (layer, layer_mask_undo->layer_mask, FALSE, NULL);
    }
}
開發者ID:AdamGrzonkowski,項目名稱:gimp-1,代碼行數:26,代碼來源:gimplayermaskundo.c

示例5: gimp_foreground_select_tool_undo_pop

static void
gimp_foreground_select_tool_undo_pop (GimpUndo              *undo,
                                      GimpUndoMode           undo_mode,
                                      GimpUndoAccumulator   *accum)
{
  GIMP_UNDO_CLASS (parent_class)->pop (undo, undo_mode, accum);
}
開發者ID:jiapei100,項目名稱:gimp,代碼行數:7,代碼來源:gimpforegroundselecttoolundo.c

示例6: gimp_drawable_undo_class_init

static void
gimp_drawable_undo_class_init (GimpDrawableUndoClass *klass)
{
  GObjectClass    *object_class      = G_OBJECT_CLASS (klass);
  GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
  GimpUndoClass   *undo_class        = GIMP_UNDO_CLASS (klass);

  object_class->constructed      = gimp_drawable_undo_constructed;
  object_class->set_property     = gimp_drawable_undo_set_property;
  object_class->get_property     = gimp_drawable_undo_get_property;

  gimp_object_class->get_memsize = gimp_drawable_undo_get_memsize;

  undo_class->pop                = gimp_drawable_undo_pop;
  undo_class->free               = gimp_drawable_undo_free;

  g_object_class_install_property (object_class, PROP_BUFFER,
                                   g_param_spec_object ("buffer", NULL, NULL,
                                                        GEGL_TYPE_BUFFER,
                                                        GIMP_PARAM_READWRITE |
                                                        G_PARAM_CONSTRUCT_ONLY));

  g_object_class_install_property (object_class, PROP_X,
                                   g_param_spec_int ("x", NULL, NULL,
                                                     0, GIMP_MAX_IMAGE_SIZE, 0,
                                                     GIMP_PARAM_READWRITE |
                                                     G_PARAM_CONSTRUCT_ONLY));

  g_object_class_install_property (object_class, PROP_Y,
                                   g_param_spec_int ("y", NULL, NULL,
                                                     0, GIMP_MAX_IMAGE_SIZE, 0,
                                                     GIMP_PARAM_READWRITE |
                                                     G_PARAM_CONSTRUCT_ONLY));
}
開發者ID:ChristianBusch,項目名稱:gimp,代碼行數:34,代碼來源:gimpdrawableundo.c

示例7: gimp_layer_prop_undo_pop

static void
gimp_layer_prop_undo_pop (GimpUndo            *undo,
                          GimpUndoMode         undo_mode,
                          GimpUndoAccumulator *accum)
{
  GimpLayerPropUndo *layer_prop_undo = GIMP_LAYER_PROP_UNDO (undo);
  GimpLayer         *layer           = GIMP_LAYER (GIMP_ITEM_UNDO (undo)->item);

  GIMP_UNDO_CLASS (parent_class)->pop (undo, undo_mode, accum);

  switch (undo->undo_type)
    {
    case GIMP_UNDO_LAYER_REPOSITION:
      {
        gint position;

        position = gimp_image_get_layer_index (undo->image, layer);
        gimp_image_position_layer (undo->image, layer,
                                   layer_prop_undo->position,
                                   FALSE, NULL);
        layer_prop_undo->position = position;
      }
      break;

    case GIMP_UNDO_LAYER_MODE:
      {
        GimpLayerModeEffects mode;

        mode = gimp_layer_get_mode (layer);
        gimp_layer_set_mode (layer, layer_prop_undo->mode, FALSE);
        layer_prop_undo->mode = mode;
      }
      break;

    case GIMP_UNDO_LAYER_OPACITY:
      {
        gdouble opacity;

        opacity = gimp_layer_get_opacity (layer);
        gimp_layer_set_opacity (layer, layer_prop_undo->opacity, FALSE);
        layer_prop_undo->opacity = opacity;
      }
      break;

    case GIMP_UNDO_LAYER_LOCK_ALPHA:
      {
        gboolean lock_alpha;

        lock_alpha = gimp_layer_get_lock_alpha (layer);
        gimp_layer_set_lock_alpha (layer, layer_prop_undo->lock_alpha, FALSE);
        layer_prop_undo->lock_alpha = lock_alpha;
      }
      break;

    default:
      g_assert_not_reached ();
    }
}
開發者ID:Amerekanets,項目名稱:gimp,代碼行數:58,代碼來源:gimplayerpropundo.c

示例8: gimp_group_layer_undo_pop

static void
gimp_group_layer_undo_pop (GimpUndo            *undo,
                           GimpUndoMode         undo_mode,
                           GimpUndoAccumulator *accum)
{
    GimpGroupLayerUndo *group_layer_undo = GIMP_GROUP_LAYER_UNDO (undo);
    GimpGroupLayer     *group;

    group = GIMP_GROUP_LAYER (GIMP_ITEM_UNDO (undo)->item);

    GIMP_UNDO_CLASS (parent_class)->pop (undo, undo_mode, accum);

    switch (undo->undo_type)
    {
    case GIMP_UNDO_GROUP_LAYER_SUSPEND:
    case GIMP_UNDO_GROUP_LAYER_RESUME:
        if ((undo_mode       == GIMP_UNDO_MODE_UNDO &&
                undo->undo_type == GIMP_UNDO_GROUP_LAYER_SUSPEND) ||
                (undo_mode       == GIMP_UNDO_MODE_REDO &&
                 undo->undo_type == GIMP_UNDO_GROUP_LAYER_RESUME))
        {
            /*  resume group layer auto-resizing  */

            gimp_group_layer_resume_resize (group, FALSE);
        }
        else
        {
            /*  suspend group layer auto-resizing  */

            gimp_group_layer_suspend_resize (group, FALSE);
        }
        break;

    case GIMP_UNDO_GROUP_LAYER_CONVERT:
    {
        GimpImageBaseType type;
        GimpPrecision     precision;

        type      = gimp_drawable_get_base_type (GIMP_DRAWABLE (group));
        precision = gimp_drawable_get_precision (GIMP_DRAWABLE (group));

        gimp_drawable_convert_type (GIMP_DRAWABLE (group),
                                    gimp_item_get_image (GIMP_ITEM (group)),
                                    group_layer_undo->prev_type,
                                    group_layer_undo->prev_precision,
                                    0, 0, FALSE,
                                    FALSE, NULL);

        group_layer_undo->prev_type      = type;
        group_layer_undo->prev_precision = precision;
    }
    break;

    default:
        g_assert_not_reached ();
    }
}
開發者ID:davidyang5405,項目名稱:gimp,代碼行數:57,代碼來源:gimpgrouplayerundo.c

示例9: gimp_sample_point_undo_class_init

static void
gimp_sample_point_undo_class_init (GimpSamplePointUndoClass *klass)
{
  GObjectClass  *object_class = G_OBJECT_CLASS (klass);
  GimpUndoClass *undo_class   = GIMP_UNDO_CLASS (klass);

  object_class->constructed = gimp_sample_point_undo_constructed;

  undo_class->pop           = gimp_sample_point_undo_pop;
}
開發者ID:jiapei100,項目名稱:gimp,代碼行數:10,代碼來源:gimpsamplepointundo.c

示例10: gimp_floating_sel_undo_class_init

static void
gimp_floating_sel_undo_class_init (GimpFloatingSelUndoClass *klass)
{
  GObjectClass  *object_class = G_OBJECT_CLASS (klass);
  GimpUndoClass *undo_class   = GIMP_UNDO_CLASS (klass);

  object_class->constructed = gimp_floating_sel_undo_constructed;

  undo_class->pop           = gimp_floating_sel_undo_pop;
}
開發者ID:AjayRamanathan,項目名稱:gimp,代碼行數:10,代碼來源:gimpfloatingselundo.c

示例11: gimp_layer_prop_undo_class_init

static void
gimp_layer_prop_undo_class_init (GimpLayerPropUndoClass *klass)
{
  GObjectClass  *object_class = G_OBJECT_CLASS (klass);
  GimpUndoClass *undo_class   = GIMP_UNDO_CLASS (klass);

  object_class->constructor = gimp_layer_prop_undo_constructor;

  undo_class->pop           = gimp_layer_prop_undo_pop;
}
開發者ID:Amerekanets,項目名稱:gimp,代碼行數:10,代碼來源:gimplayerpropundo.c

示例12: gimp_vectors_prop_undo_class_init

static void
gimp_vectors_prop_undo_class_init (GimpVectorsPropUndoClass *klass)
{
  GObjectClass  *object_class = G_OBJECT_CLASS (klass);
  GimpUndoClass *undo_class   = GIMP_UNDO_CLASS (klass);

  object_class->constructed = gimp_vectors_prop_undo_constructed;

  undo_class->pop           = gimp_vectors_prop_undo_pop;
}
開發者ID:jiapei100,項目名稱:gimp,代碼行數:10,代碼來源:gimpvectorspropundo.c

示例13: gimp_group_layer_undo_class_init

static void
gimp_group_layer_undo_class_init (GimpGroupLayerUndoClass *klass)
{
    GObjectClass  *object_class = G_OBJECT_CLASS (klass);
    GimpUndoClass *undo_class   = GIMP_UNDO_CLASS (klass);

    object_class->constructed   = gimp_group_layer_undo_constructed;

    undo_class->pop             = gimp_group_layer_undo_pop;
}
開發者ID:davidyang5405,項目名稱:gimp,代碼行數:10,代碼來源:gimpgrouplayerundo.c

示例14: gimp_ink_undo_class_init

static void
gimp_ink_undo_class_init (GimpInkUndoClass *klass)
{
  GObjectClass  *object_class = G_OBJECT_CLASS (klass);
  GimpUndoClass *undo_class   = GIMP_UNDO_CLASS (klass);

  object_class->constructed = gimp_ink_undo_constructed;

  undo_class->pop           = gimp_ink_undo_pop;
  undo_class->free          = gimp_ink_undo_free;
}
開發者ID:AdamGrzonkowski,項目名稱:gimp-1,代碼行數:11,代碼來源:gimpinkundo.c

示例15: gimp_sample_point_undo_pop

static void
gimp_sample_point_undo_pop (GimpUndo              *undo,
                            GimpUndoMode           undo_mode,
                            GimpUndoAccumulator   *accum)
{
  GimpSamplePointUndo *sample_point_undo = GIMP_SAMPLE_POINT_UNDO (undo);
  gint                 x;
  gint                 y;

  GIMP_UNDO_CLASS (parent_class)->pop (undo, undo_mode, accum);

  x = sample_point_undo->sample_point->x;
  y = sample_point_undo->sample_point->y;

  /*  add and move sample points manually (nor using the
   *  gimp_image_sample_point API), because we might be in the middle
   *  of an image resizing undo group and the sample point's position
   *  might be temporarily out of image.
   */

  if (x == -1)
    {
      undo->image->sample_points =
        g_list_append (undo->image->sample_points,
                       sample_point_undo->sample_point);

      sample_point_undo->sample_point->x = sample_point_undo->x;
      sample_point_undo->sample_point->y = sample_point_undo->y;
      gimp_sample_point_ref (sample_point_undo->sample_point);

      gimp_image_sample_point_added (undo->image,
                                     sample_point_undo->sample_point);
      gimp_image_update_sample_point (undo->image,
                                      sample_point_undo->sample_point);
    }
  else if (sample_point_undo->x == -1)
    {
      gimp_image_remove_sample_point (undo->image,
                                      sample_point_undo->sample_point, FALSE);
    }
  else
    {
      gimp_image_update_sample_point (undo->image,
                                      sample_point_undo->sample_point);
      sample_point_undo->sample_point->x = sample_point_undo->x;
      sample_point_undo->sample_point->y = sample_point_undo->y;
      gimp_image_update_sample_point (undo->image,
                                      sample_point_undo->sample_point);
    }

  sample_point_undo->x = x;
  sample_point_undo->y = y;
}
開發者ID:Amerekanets,項目名稱:gimp,代碼行數:53,代碼來源:gimpsamplepointundo.c


注:本文中的GIMP_UNDO_CLASS函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。