您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GIMP_CONTEXT函数代码示例

51自学网 2021-06-01 20:52:23
  C++
这篇教程C++ GIMP_CONTEXT函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GIMP_CONTEXT函数的典型用法代码示例。如果您正苦于以下问题:C++ GIMP_CONTEXT函数的具体用法?C++ GIMP_CONTEXT怎么用?C++ GIMP_CONTEXT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GIMP_CONTEXT函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: tool_manager_preset_changed

static voidtool_manager_preset_changed (GimpContext     *user_context,                             GimpToolPreset  *preset,                             GimpToolManager *tool_manager){  GimpToolInfo *preset_tool;  gboolean      tool_change = FALSE;  if (! preset || user_context->gimp->busy)    return;  preset_tool = gimp_context_get_tool (GIMP_CONTEXT (preset->tool_options));  if (preset_tool != gimp_context_get_tool (user_context))    tool_change = TRUE;  if (! tool_change)    tool_manager_disconnect_options (user_context, preset_tool);  gimp_config_copy (GIMP_CONFIG (preset->tool_options),                    GIMP_CONFIG (preset_tool->tool_options), 0);  if (tool_change)    gimp_context_set_tool (user_context, preset_tool);  else    tool_manager_connect_options (user_context, preset_tool);  gimp_context_copy_properties (GIMP_CONTEXT (preset->tool_options),                                user_context,                                gimp_tool_preset_get_prop_mask (preset));}
开发者ID:MichaelMure,项目名称:Gimp-Cage-Tool,代码行数:31,


示例2: tool_manager_connect_options

static voidtool_manager_connect_options (GimpContext  *user_context,                              GimpToolInfo *tool_info){  if (tool_info->context_props)    {      GimpCoreConfig      *config       = user_context->gimp->config;      GimpContextPropMask  global_props = 0;      /*  FG and BG are always shared between all tools  */      global_props |= GIMP_CONTEXT_FOREGROUND_MASK;      global_props |= GIMP_CONTEXT_BACKGROUND_MASK;      if (config->global_brush)        global_props |= GIMP_CONTEXT_BRUSH_MASK;      if (config->global_dynamics)        global_props |= GIMP_CONTEXT_DYNAMICS_MASK;      if (config->global_pattern)        global_props |= GIMP_CONTEXT_PATTERN_MASK;      if (config->global_palette)        global_props |= GIMP_CONTEXT_PALETTE_MASK;      if (config->global_gradient)        global_props |= GIMP_CONTEXT_GRADIENT_MASK;      if (config->global_font)        global_props |= GIMP_CONTEXT_FONT_MASK;      gimp_context_copy_properties (GIMP_CONTEXT (tool_info->tool_options),                                    user_context,                                    tool_info->context_props & ~global_props);      gimp_context_set_parent (GIMP_CONTEXT (tool_info->tool_options),                               user_context);    }}
开发者ID:MichaelMure,项目名称:Gimp-Cage-Tool,代码行数:33,


示例3: gimp_paint_options_get_gradient_color

gbooleangimp_paint_options_get_gradient_color (GimpPaintOptions *paint_options,                                       GimpImage        *image,                                       gdouble           grad_point,                                       gdouble           pixel_dist,                                       GimpRGB          *color){  GimpDynamics *dynamics;  g_return_val_if_fail (GIMP_IS_PAINT_OPTIONS (paint_options), FALSE);  g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);  g_return_val_if_fail (color != NULL, FALSE);  dynamics = gimp_context_get_dynamics (GIMP_CONTEXT (paint_options));  if (gimp_dynamics_is_output_enabled (dynamics, GIMP_DYNAMICS_OUTPUT_COLOR))    {      GimpGradientOptions *gradient_options = paint_options->gradient_options;      GimpGradient        *gradient;      gradient = gimp_context_get_gradient (GIMP_CONTEXT (paint_options));      gimp_gradient_get_color_at (gradient, GIMP_CONTEXT (paint_options),                                  NULL, grad_point,                                  gradient_options->gradient_reverse,                                  color);      return TRUE;    }  return FALSE;}
开发者ID:davidyang5405,项目名称:gimp,代码行数:32,


示例4: gimp_pdb_context_constructed

static voidgimp_pdb_context_constructed (GObject *object){  GimpInterpolationType  interpolation;  gint                   threshold;  GParamSpec            *pspec;  G_OBJECT_CLASS (parent_class)->constructed (object);  /* get default interpolation from gimprc */  interpolation = GIMP_CONTEXT (object)->gimp->config->interpolation_type;  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (object),                                        "interpolation");  if (pspec)    G_PARAM_SPEC_ENUM (pspec)->default_value = interpolation;  g_object_set (object, "interpolation", interpolation, NULL);  /* get default threshold from gimprc */  threshold = GIMP_CONTEXT (object)->gimp->config->default_threshold;  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (object),                                        "sample-threshold");  if (pspec)    G_PARAM_SPEC_DOUBLE (pspec)->default_value = threshold / 255.0;  g_object_set (object, "sample-threshold", threshold / 255.0, NULL);}
开发者ID:AjayRamanathan,项目名称:gimp,代码行数:33,


示例5: gimp_edit_fill

voidgimp_edit_fill (GimpImage       *image,                GimpDrawable    *drawable,                GimpFillOptions *options,                const gchar     *undo_desc){  GeglBuffer  *buffer;  gint         x, y, width, height;  g_return_if_fail (GIMP_IS_IMAGE (image));  g_return_if_fail (GIMP_IS_DRAWABLE (drawable));  g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)));  g_return_if_fail (GIMP_IS_FILL_OPTIONS (options));  if (! gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))    return;  /*  nothing to do, but the fill succeeded  */  buffer = gimp_fill_options_create_buffer (options, drawable,                                            GEGL_RECTANGLE (0, 0,                                                            width, height));  if (! undo_desc)    undo_desc = gimp_fill_options_get_undo_desc (options);  gimp_drawable_apply_buffer (drawable, buffer,                              GEGL_RECTANGLE (0, 0, width, height),                              TRUE, undo_desc,                              gimp_context_get_opacity (GIMP_CONTEXT (options)),                              gimp_context_get_paint_mode (GIMP_CONTEXT (options)),                              NULL, x, y);  g_object_unref (buffer);  gimp_drawable_update (drawable, x, y, width, height);}
开发者ID:LebedevRI,项目名称:gimp,代码行数:35,


示例6: tool_manager_preset_changed

static voidtool_manager_preset_changed (GimpContext     *user_context,                             GimpToolPreset  *preset,                             GimpToolManager *tool_manager){  GimpToolInfo *preset_tool;  gchar        *options_name;  gboolean      tool_change = FALSE;  if (! preset || user_context->gimp->busy)    return;  preset_tool = gimp_context_get_tool (GIMP_CONTEXT (preset->tool_options));  if (preset_tool != gimp_context_get_tool (user_context))    tool_change = TRUE;  /*  save the name, we don't want to overwrite it  */  options_name = g_strdup (gimp_object_get_name (preset_tool->tool_options));  gimp_config_copy (GIMP_CONFIG (preset->tool_options),                    GIMP_CONFIG (preset_tool->tool_options), 0);  /*  restore the saved name  */  gimp_object_take_name (GIMP_OBJECT (preset_tool->tool_options), options_name);  if (tool_change)    gimp_context_set_tool (user_context, preset_tool);  gimp_context_copy_properties (GIMP_CONTEXT (preset->tool_options),                                user_context,                                gimp_tool_preset_get_prop_mask (preset));  if (GIMP_IS_PAINT_OPTIONS (preset->tool_options))    {      GimpToolOptions     *src;      GimpToolOptions     *dest;      GimpContextPropMask  prop_mask = 0;      src  = preset->tool_options;      dest = tool_manager->active_tool->tool_info->tool_options;      /*  copy various data objects' additional tool options again       *  manually, they might have been overwritten by e.g. the "link       *  brush stuff to brush defaults" logic in gimptooloptions.c       */      if (preset->use_brush)        prop_mask |= GIMP_CONTEXT_PROP_MASK_BRUSH;      if (preset->use_dynamics)        prop_mask |= GIMP_CONTEXT_PROP_MASK_DYNAMICS;      if (preset->use_gradient)        prop_mask |= GIMP_CONTEXT_PROP_MASK_GRADIENT;      gimp_paint_options_copy_props (GIMP_PAINT_OPTIONS (src),                                     GIMP_PAINT_OPTIONS (dest),                                     prop_mask);    }}
开发者ID:jiapei100,项目名称:gimp,代码行数:60,


示例7: gimp_device_info_constructed

static voidgimp_device_info_constructed (GObject *object){  GimpDeviceInfo *info = GIMP_DEVICE_INFO (object);  Gimp           *gimp;  G_OBJECT_CLASS (parent_class)->constructed (object);  g_assert ((info->device == NULL         && info->display == NULL) ||            (GDK_IS_DEVICE (info->device) && GDK_IS_DISPLAY (info->display)));  gimp = GIMP_CONTEXT (object)->gimp;  if (info->device)    {      g_object_set_data (G_OBJECT (info->device), GIMP_DEVICE_INFO_DATA_KEY,                         info);      gimp_object_set_name (GIMP_OBJECT (info), info->device->name);      info->mode    = info->device->mode;      info->n_axes  = info->device->num_axes;      info->n_keys  = info->device->num_keys;    }  gimp_context_define_properties (GIMP_CONTEXT (object),                                  GIMP_DEVICE_INFO_CONTEXT_MASK,                                  FALSE);  gimp_context_copy_properties (gimp_get_user_context (gimp),                                GIMP_CONTEXT (object),                                GIMP_DEVICE_INFO_CONTEXT_MASK);  gimp_context_set_serialize_properties (GIMP_CONTEXT (object),                                         GIMP_DEVICE_INFO_CONTEXT_MASK);  /*  FIXME: this is ugly and needs to be done via "notify" once   *  the contexts' properties are dynamic.   */  g_signal_connect (object, "foreground-changed",                    G_CALLBACK (gimp_device_info_changed),                    NULL);  g_signal_connect (object, "background-changed",                    G_CALLBACK (gimp_device_info_changed),                    NULL);  g_signal_connect (object, "tool-changed",                    G_CALLBACK (gimp_device_info_changed),                    NULL);  g_signal_connect (object, "brush-changed",                    G_CALLBACK (gimp_device_info_changed),                    NULL);  g_signal_connect (object, "pattern-changed",                    G_CALLBACK (gimp_device_info_changed),                    NULL);  g_signal_connect (object, "gradient-changed",                    G_CALLBACK (gimp_device_info_changed),                    NULL);}
开发者ID:gfraysse,项目名称:gimp,代码行数:57,


示例8: gimp_crop_tool_execute

static gbooleangimp_crop_tool_execute (GimpRectangleTool  *rectangle,                        gint                x,                        gint                y,                        gint                w,                        gint                h){  GimpTool        *tool    = GIMP_TOOL (rectangle);  GimpCropOptions *options = GIMP_CROP_TOOL_GET_OPTIONS (tool);  GimpImage       *image   = gimp_display_get_image (tool->display);  gimp_tool_pop_status (tool, tool->display);  /* if rectangle exists, crop it */  if (w > 0 && h > 0)    {      if (options->layer_only)        {          GimpLayer *layer = gimp_image_get_active_layer (image);          gint       off_x, off_y;          if (! layer)            {              gimp_tool_message_literal (tool, tool->display,                                         _("There is no active layer to crop."));              return FALSE;            }          if (gimp_item_is_content_locked (GIMP_ITEM (layer)))            {              gimp_tool_message_literal (tool, tool->display,                                         _("The active layer's pixels are locked."));              return FALSE;            }          gimp_item_get_offset (GIMP_ITEM (layer), &off_x, &off_y);          off_x -= x;          off_y -= y;          gimp_item_resize (GIMP_ITEM (layer), GIMP_CONTEXT (options),                            w, h, off_x, off_y);        }      else        {          gimp_image_crop (image, GIMP_CONTEXT (options),                           x, y, w + x, h + y,                           TRUE);        }      gimp_image_flush (image);      return TRUE;    }  return TRUE;}
开发者ID:AjayRamanathan,项目名称:gimp,代码行数:57,


示例9: gimp_devices_restore

voidgimp_devices_restore (Gimp *gimp){  GimpDeviceManager *manager;  GimpContext       *user_context;  GimpDeviceInfo    *current_device;  GList             *list;  gchar             *filename;  GError            *error = NULL;  g_return_if_fail (GIMP_IS_GIMP (gimp));  manager = gimp_devices_get_manager (gimp);  g_return_if_fail (GIMP_IS_DEVICE_MANAGER (manager));  user_context = gimp_get_user_context (gimp);  for (list = GIMP_LIST (manager)->list;       list;       list = g_list_next (list))    {      GimpDeviceInfo *device_info = list->data;      gimp_context_copy_properties (user_context, GIMP_CONTEXT (device_info),                                    GIMP_DEVICE_INFO_CONTEXT_MASK);      gimp_device_info_set_default_tool (device_info);    }  filename = gimp_personal_rc_file ("devicerc");  if (gimp->be_verbose)    g_print ("Parsing '%s'/n", gimp_filename_to_utf8 (filename));  if (! gimp_config_deserialize_file (GIMP_CONFIG (manager),                                      filename,                                      gimp,                                      &error))    {      if (error->code != GIMP_CONFIG_ERROR_OPEN_ENOENT)        gimp_message_literal (gimp, NULL, GIMP_MESSAGE_ERROR, error->message);      g_error_free (error);      /* don't bail out here */    }  g_free (filename);  current_device = gimp_device_manager_get_current_device (manager);  gimp_context_copy_properties (GIMP_CONTEXT (current_device), user_context,                                GIMP_DEVICE_INFO_CONTEXT_MASK);  gimp_context_set_parent (GIMP_CONTEXT (current_device), user_context);}
开发者ID:Amerekanets,项目名称:gimp-1,代码行数:55,


示例10: gimp_pdb_context_new

GimpContext *gimp_pdb_context_new (Gimp        *gimp,                      GimpContext *parent,                      gboolean     set_parent){  GimpPDBContext *context;  GList          *list;  g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);  g_return_val_if_fail (GIMP_IS_CONTEXT (parent), NULL);  context = g_object_new (GIMP_TYPE_PDB_CONTEXT,                          "gimp", gimp,                          "name", "PDB Context",                          NULL);  gimp_config_sync (G_OBJECT (parent), G_OBJECT (context), 0);  if (set_parent)    {      gimp_context_define_properties (GIMP_CONTEXT (context),                                      GIMP_CONTEXT_ALL_PROPS_MASK, FALSE);      gimp_context_set_parent (GIMP_CONTEXT (context), parent);      for (list = gimp_get_paint_info_iter (gimp);           list;           list = g_list_next (list))        {          GimpPaintInfo *info = list->data;          gimp_container_add (context->paint_options_list,                              GIMP_OBJECT (info->paint_options));        }    }  else    {      for (list = GIMP_LIST (GIMP_PDB_CONTEXT (parent)->paint_options_list)->list;           list;           list = g_list_next (list))        {          GimpPaintOptions *options = gimp_config_duplicate (list->data);          gimp_container_add (context->paint_options_list,                              GIMP_OBJECT (options));          g_object_unref (options);        }    }  return GIMP_CONTEXT (context);}
开发者ID:AjayRamanathan,项目名称:gimp,代码行数:50,


示例11: gimp_drawable_bucket_fill

voidgimp_drawable_bucket_fill (GimpDrawable         *drawable,                           GimpFillOptions      *options,                           gboolean              fill_transparent,                           GimpSelectCriterion   fill_criterion,                           gdouble               threshold,                           gboolean              sample_merged,                           gboolean              diagonal_neighbors,                           gdouble               seed_x,                           gdouble               seed_y){  GimpImage  *image;  GeglBuffer *buffer;  gdouble     mask_x;  gdouble     mask_y;  gint        width, height;  g_return_if_fail (GIMP_IS_DRAWABLE (drawable));  g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)));  g_return_if_fail (GIMP_IS_FILL_OPTIONS (options));  image = gimp_item_get_image (GIMP_ITEM (drawable));  gimp_set_busy (image->gimp);  buffer = gimp_drawable_get_bucket_fill_buffer (drawable, options,                                                 fill_transparent, fill_criterion,                                                 threshold, sample_merged,                                                 diagonal_neighbors,                                                 seed_x, seed_y, NULL,                                                 &mask_x, &mask_y, &width, &height);  if (buffer)    {      /*  Apply it to the image  */      gimp_drawable_apply_buffer (drawable, buffer,                                  GEGL_RECTANGLE (0, 0, width, height),                                  TRUE, C_("undo-type", "Bucket Fill"),                                  gimp_context_get_opacity (GIMP_CONTEXT (options)),                                  gimp_context_get_paint_mode (GIMP_CONTEXT (options)),                                  GIMP_LAYER_COLOR_SPACE_AUTO,                                  GIMP_LAYER_COLOR_SPACE_AUTO,                                  gimp_layer_mode_get_paint_composite_mode (                                                                            gimp_context_get_paint_mode (GIMP_CONTEXT (options))),                                  NULL, (gint) mask_x, mask_y);      g_object_unref (buffer);      gimp_drawable_update (drawable, mask_x, mask_y, width, height);    }  gimp_unset_busy (image->gimp);}
开发者ID:jiapei100,项目名称:gimp,代码行数:49,


示例12: tool_manager_connect_options

static voidtool_manager_connect_options (GimpToolManager *tool_manager,                              GimpContext     *user_context,                              GimpToolInfo    *tool_info){  if (tool_info->context_props)    {      GimpCoreConfig      *config       = user_context->gimp->config;      GimpContextPropMask  global_props = 0;      /*  FG and BG are always shared between all tools  */      global_props |= GIMP_CONTEXT_PROP_MASK_FOREGROUND;      global_props |= GIMP_CONTEXT_PROP_MASK_BACKGROUND;      if (config->global_brush)        global_props |= GIMP_CONTEXT_PROP_MASK_BRUSH;      if (config->global_dynamics)        global_props |= GIMP_CONTEXT_PROP_MASK_DYNAMICS;      if (config->global_pattern)        global_props |= GIMP_CONTEXT_PROP_MASK_PATTERN;      if (config->global_palette)        global_props |= GIMP_CONTEXT_PROP_MASK_PALETTE;      if (config->global_gradient)        global_props |= GIMP_CONTEXT_PROP_MASK_GRADIENT;      if (config->global_font)        global_props |= GIMP_CONTEXT_PROP_MASK_FONT;      gimp_context_copy_properties (GIMP_CONTEXT (tool_info->tool_options),                                    user_context,                                    tool_info->context_props & ~global_props);      gimp_context_set_parent (GIMP_CONTEXT (tool_info->tool_options),                               user_context);      if (GIMP_IS_PAINT_OPTIONS (tool_info->tool_options))        {          if (config->global_brush)            gimp_paint_options_copy_brush_props (tool_manager->shared_paint_options,                                                 GIMP_PAINT_OPTIONS (tool_info->tool_options));          if (config->global_dynamics)            gimp_paint_options_copy_dynamics_props (tool_manager->shared_paint_options,                                                    GIMP_PAINT_OPTIONS (tool_info->tool_options));          if (config->global_gradient)            gimp_paint_options_copy_gradient_props (tool_manager->shared_paint_options,                                                    GIMP_PAINT_OPTIONS (tool_info->tool_options));        }    }}
开发者ID:davidyang5405,项目名称:gimp,代码行数:49,


示例13: gimp_paint_options_get_brush_mode

GimpBrushApplicationModegimp_paint_options_get_brush_mode (GimpPaintOptions *paint_options){  GimpDynamics       *dynamics;  GimpDynamicsOutput *force_output;  gboolean            dynamic_force = FALSE;  g_return_val_if_fail (GIMP_IS_PAINT_OPTIONS (paint_options), GIMP_BRUSH_SOFT);  if (paint_options->hard)    return GIMP_BRUSH_HARD;  dynamics = gimp_context_get_dynamics (GIMP_CONTEXT (paint_options));  force_output = gimp_dynamics_get_output (dynamics,                                           GIMP_DYNAMICS_OUTPUT_FORCE);  if (force_output)    dynamic_force = gimp_dynamics_output_is_enabled (force_output);  if (dynamic_force || (paint_options->brush_force > 0.0))    return GIMP_BRUSH_PRESSURE;  return GIMP_BRUSH_SOFT;}
开发者ID:K-Sonoda,项目名称:gimp,代码行数:25,


示例14: tool_presets_save_cmd_callback

voidtool_presets_save_cmd_callback (GtkAction *action,                                gpointer   data){  GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);  GimpContext         *context;  GimpToolPreset      *preset;  GimpToolInfo        *tool_info;  context = gimp_container_view_get_context (editor->view);  preset    = gimp_context_get_tool_preset (context);  tool_info = gimp_context_get_tool (gimp_get_user_context (context->gimp));  if (tool_info && preset)    {      GimpToolInfo *preset_tool;      preset_tool =  gimp_context_get_tool (GIMP_CONTEXT (preset->tool_options));      if (tool_info != preset_tool)        {          gimp_message (context->gimp,                        G_OBJECT (editor), GIMP_MESSAGE_WARNING,                        _("Can't save '%s' tool options to an "                          "existing '%s' tool preset."),                        tool_info->blurb,                        preset_tool->blurb);          return;        }      gimp_config_sync (G_OBJECT (tool_info->tool_options),                        G_OBJECT (preset->tool_options), 0);    }}
开发者ID:LebedevRI,项目名称:gimp,代码行数:35,


示例15: gimp_paint_options_set_default_brush_hardness

voidgimp_paint_options_set_default_brush_hardness (GimpPaintOptions *paint_options,                                               GimpBrush        *brush){  g_return_if_fail (GIMP_IS_PAINT_OPTIONS (paint_options));  g_return_if_fail (brush == NULL || GIMP_IS_BRUSH (brush));  if (! brush)    brush = gimp_context_get_brush (GIMP_CONTEXT (paint_options));  if (GIMP_IS_BRUSH_GENERATED (brush))    {      GimpBrushGenerated *generated_brush = GIMP_BRUSH_GENERATED (brush);      g_object_set (paint_options,                    "brush-hardness", (gdouble) gimp_brush_generated_get_hardness (generated_brush),                    NULL);    }  else    {      g_object_set (paint_options,                    "brush-hardness", DEFAULT_BRUSH_HARDNESS,                    NULL);    }}
开发者ID:davidyang5405,项目名称:gimp,代码行数:25,


示例16: tool_manager_disconnect_options

static voidtool_manager_disconnect_options (GimpToolManager *tool_manager,                                 GimpContext     *user_context,                                 GimpToolInfo    *tool_info){  if (tool_info->context_props)    {      if (GIMP_IS_PAINT_OPTIONS (tool_info->tool_options))        {          /* Storing is unconditional, because the user may turn on           * brush sharing mid use           */          gimp_paint_options_copy_brush_props (GIMP_PAINT_OPTIONS (tool_info->tool_options),                                               tool_manager->shared_paint_options);          gimp_paint_options_copy_dynamics_props (GIMP_PAINT_OPTIONS (tool_info->tool_options),                                                  tool_manager->shared_paint_options);          gimp_paint_options_copy_gradient_props (GIMP_PAINT_OPTIONS (tool_info->tool_options),                                                  tool_manager->shared_paint_options);        }      gimp_context_set_parent (GIMP_CONTEXT (tool_info->tool_options), NULL);    }}
开发者ID:davidyang5405,项目名称:gimp,代码行数:25,


示例17: gimp_clone_start

static gbooleangimp_clone_start (GimpPaintCore     *paint_core,                  GimpDrawable      *drawable,                  GimpPaintOptions  *paint_options,                  const GimpCoords  *coords,                  GError           **error){  GimpCloneOptions *options = GIMP_CLONE_OPTIONS (paint_options);  if (! GIMP_PAINT_CORE_CLASS (parent_class)->start (paint_core, drawable,                                                     paint_options, coords,                                                     error))    {      return FALSE;    }  if (options->clone_type == GIMP_PATTERN_CLONE)    {      if (! gimp_context_get_pattern (GIMP_CONTEXT (options)))        {          g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,			       _("No patterns available for use with this tool."));          return FALSE;        }    }  return TRUE;}
开发者ID:Amerekanets,项目名称:gimp-1,代码行数:28,


示例18: gimp_operation_tool_aux_input_new

static AuxInput *gimp_operation_tool_aux_input_new (GimpOperationTool *tool,                                   GeglNode          *operation,                                   const gchar       *input_pad,                                   const gchar       *label){    AuxInput    *input = g_slice_new (AuxInput);    GimpContext *context;    input->node = gegl_node_new_child (NULL,                                       "operation", "gegl:buffer-source",                                       NULL);    gegl_node_connect_to (input->node, "output",                          operation,   input_pad);    context = GIMP_CONTEXT (GIMP_TOOL_GET_OPTIONS (tool));    input->box = gimp_buffer_source_box_new (context, input->node, label);    g_signal_connect (input->box, "notify::pickable",                      G_CALLBACK (gimp_operation_tool_aux_input_notify),                      tool);    g_signal_connect (input->box, "notify::enabled",                      G_CALLBACK (gimp_operation_tool_aux_input_notify),                      tool);    return input;}
开发者ID:davidyang5405,项目名称:gimp,代码行数:29,


示例19: gimp_drawable_stroke_boundary

voidgimp_drawable_stroke_boundary (GimpDrawable       *drawable,                               GimpStrokeOptions  *options,                               const GimpBoundSeg *bound_segs,                               gint                n_bound_segs,                               gint                offset_x,                               gint                offset_y,                               gboolean            push_undo){  GimpScanConvert *scan_convert;  g_return_if_fail (GIMP_IS_DRAWABLE (drawable));  g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)));  g_return_if_fail (GIMP_IS_STROKE_OPTIONS (options));  g_return_if_fail (bound_segs == NULL || n_bound_segs != 0);  g_return_if_fail (gimp_fill_options_get_style (GIMP_FILL_OPTIONS (options)) !=                    GIMP_FILL_STYLE_PATTERN ||                    gimp_context_get_pattern (GIMP_CONTEXT (options)) != NULL);  scan_convert = gimp_scan_convert_new_from_boundary (bound_segs, n_bound_segs,                                                      offset_x, offset_y);  if (scan_convert)    {      gimp_drawable_stroke_scan_convert (drawable, options,                                         scan_convert, push_undo);      gimp_scan_convert_free (scan_convert);    }}
开发者ID:LebedevRI,项目名称:gimp,代码行数:29,


示例20: gimp_paint_options_gui_reset_size

static voidgimp_paint_options_gui_reset_size (GtkWidget        *button,                                   GimpPaintOptions *paint_options){    GimpBrush *brush = gimp_context_get_brush (GIMP_CONTEXT (paint_options));    if (brush)        gimp_paint_options_set_default_brush_size (paint_options, brush);}
开发者ID:kernc,项目名称:gimp,代码行数:9,


示例21: gimp_clone_options_gui

GtkWidget *gimp_clone_options_gui (GimpToolOptions *tool_options){  GObject   *config = G_OBJECT (tool_options);  GtkWidget *vbox   = gimp_paint_options_gui (tool_options);  GtkWidget *frame;  GtkWidget *combo;  GtkWidget *source_vbox;  GtkWidget *button;  GtkWidget *hbox;  /*  the source frame  */  frame = gimp_frame_new (NULL);  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);  gtk_widget_show (frame);  /*  the source type menu  */  combo = gimp_prop_enum_combo_box_new (config, "clone-type", 0, 0);  gimp_int_combo_box_set_label (GIMP_INT_COMBO_BOX (combo), _("Source"));  g_object_set (combo, "ellipsize", PANGO_ELLIPSIZE_END, NULL);  gtk_frame_set_label_widget (GTK_FRAME (frame), combo);  gtk_widget_show (combo);  source_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);  gtk_container_add (GTK_CONTAINER (frame), source_vbox);  gtk_widget_show (source_vbox);  button = gimp_prop_check_button_new (config, "sample-merged", NULL);  gtk_box_pack_start (GTK_BOX (source_vbox), button, FALSE, FALSE, 0);  g_object_bind_property_full (config, "clone-type",                               button, "visible",                               G_BINDING_SYNC_CREATE,                               gimp_clone_options_sync_source,                               NULL,                               GINT_TO_POINTER (GIMP_CLONE_IMAGE), NULL);  hbox = gimp_prop_pattern_box_new (NULL, GIMP_CONTEXT (tool_options),                                    NULL, 2,                                    "pattern-view-type", "pattern-view-size");  gtk_box_pack_start (GTK_BOX (source_vbox), hbox, FALSE, FALSE, 0);  g_object_bind_property_full (config, "clone-type",                               hbox,   "visible",                               G_BINDING_SYNC_CREATE,                               gimp_clone_options_sync_source,                               NULL,                               GINT_TO_POINTER (GIMP_CLONE_PATTERN), NULL);  combo = gimp_prop_enum_combo_box_new (config, "align-mode", 0, 0);  gimp_int_combo_box_set_label (GIMP_INT_COMBO_BOX (combo), _("Alignment"));  g_object_set (combo, "ellipsize", PANGO_ELLIPSIZE_END, NULL);  gtk_box_pack_start (GTK_BOX (vbox), combo, TRUE, TRUE, 0);  gtk_widget_show (combo);  return vbox;}
开发者ID:AdamGrzonkowski,项目名称:gimp-1,代码行数:57,


示例22: tool_manager_disconnect_options

static voidtool_manager_disconnect_options (GimpContext  *user_context,                                 GimpToolInfo *tool_info){  if (tool_info->context_props)    {      gimp_context_set_parent (GIMP_CONTEXT (tool_info->tool_options), NULL);    }}
开发者ID:MichaelMure,项目名称:Gimp-Cage-Tool,代码行数:9,


示例23: gimp_display_shell_dnd_fill

static voidgimp_display_shell_dnd_fill (GimpDisplayShell *shell,                             GimpFillOptions  *options,                             const gchar      *undo_desc){  GimpImage    *image = gimp_display_get_image (shell->display);  GimpDrawable *drawable;  if (shell->display->gimp->busy)    return;  if (! image)    return;  drawable = gimp_image_get_active_drawable (image);  if (! drawable)    return;  if (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)))    {      gimp_message_literal (shell->display->gimp, G_OBJECT (shell->display),                            GIMP_MESSAGE_ERROR,                            _("Cannot modify the pixels of layer groups."));      return;    }  if (gimp_item_is_content_locked (GIMP_ITEM (drawable)))    {      gimp_message_literal (shell->display->gimp, G_OBJECT (shell->display),                            GIMP_MESSAGE_ERROR,                            _("The active layer's pixels are locked."));      return;    }  /* FIXME: there should be a virtual method for this that the   *        GimpTextLayer can override.   */  if (gimp_fill_options_get_style (options) == GIMP_FILL_STYLE_SOLID &&      gimp_item_is_text_layer (GIMP_ITEM (drawable)))    {      GimpRGB color;      gimp_context_get_foreground (GIMP_CONTEXT (options), &color);      gimp_text_layer_set (GIMP_TEXT_LAYER (drawable), NULL,                           "color", &color,                           NULL);    }  else    {      gimp_edit_fill (image, drawable, options, undo_desc);    }  gimp_display_shell_dnd_flush (shell, image);}
开发者ID:LebedevRI,项目名称:gimp,代码行数:56,


示例24: gimp_device_info_set_default_tool

voidgimp_device_info_set_default_tool (GimpDeviceInfo *info){  g_return_if_fail (GIMP_IS_DEVICE_INFO (info));  if (info->device &&      gdk_device_get_source (info->device) == GDK_SOURCE_ERASER)    {      GimpContainer *tools = GIMP_CONTEXT (info)->gimp->tool_info_list;      GimpToolInfo  *eraser;      eraser =        GIMP_TOOL_INFO (gimp_container_get_child_by_name (tools,                                                          "gimp-eraser-tool"));      if (eraser)        gimp_context_set_tool (GIMP_CONTEXT (info), eraser);    }}
开发者ID:gfraysse,项目名称:gimp,代码行数:19,


示例25: gimp_vectors_stroke

static gbooleangimp_vectors_stroke (GimpItem           *item,                     GimpDrawable       *drawable,                     GimpStrokeOptions  *stroke_options,                     gboolean            push_undo,                     GimpProgress       *progress,                     GError            **error){  GimpVectors *vectors = GIMP_VECTORS (item);  gboolean     retval  = FALSE;  if (! vectors->strokes)    {      g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,                           _("Not enough points to stroke"));      return FALSE;    }  switch (gimp_stroke_options_get_method (stroke_options))    {    case GIMP_STROKE_METHOD_LIBART:      retval = gimp_drawable_stroke_vectors (drawable,                                             stroke_options,                                             vectors, push_undo, error);      break;    case GIMP_STROKE_METHOD_PAINT_CORE:      {        GimpPaintInfo    *paint_info;        GimpPaintCore    *core;        GimpPaintOptions *paint_options;        gboolean          emulate_dynamics;        paint_info = gimp_context_get_paint_info (GIMP_CONTEXT (stroke_options));        core = g_object_new (paint_info->paint_type, NULL);        paint_options = gimp_stroke_options_get_paint_options (stroke_options);        emulate_dynamics = gimp_stroke_options_get_emulate_dynamics (stroke_options);        retval = gimp_paint_core_stroke_vectors (core, drawable,                                                 paint_options,                                                 emulate_dynamics,                                                 vectors, push_undo, error);        g_object_unref (core);      }      break;    default:      g_return_val_if_reached (FALSE);    }  return retval;}
开发者ID:ni1son,项目名称:gimp,代码行数:55,



注:本文中的GIMP_CONTEXT函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GIMP_DATA函数代码示例
C++ GIMP_COLOR_TOOL函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。