• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ return_if_no_widget函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: vectors_new_cmd_callback

void
vectors_new_cmd_callback (GtkAction *action,
                          gpointer   data)
{
  VectorsOptionsDialog *options;
  GimpImage            *image;
  GtkWidget            *widget;
  return_if_no_image (image, data);
  return_if_no_widget (widget, data);

  options = vectors_options_dialog_new (image, NULL,
                                        action_data_get_context (data),
                                        widget,
                                        vectors_name ? vectors_name :
                                        _("New Path"),
                                        _("New Path"),
                                        "gimp-vectors-new",
                                        GIMP_STOCK_PATH,
                                        _("New Path Options"),
                                        GIMP_HELP_PATH_NEW);

  g_signal_connect (options->dialog, "response",
                    G_CALLBACK (vectors_new_vectors_response),
                    options);

  gtk_widget_show (options->dialog);
}
开发者ID:jdburton,项目名称:gimp-osx,代码行数:27,代码来源:vectors-commands.c


示例2: layers_edit_attributes_cmd_callback

void
layers_edit_attributes_cmd_callback (GtkAction *action,
                                     gpointer   data)
{
  LayerOptionsDialog *dialog;
  GimpImage          *image;
  GimpLayer          *layer;
  GtkWidget          *widget;
  return_if_no_layer (image, layer, data);
  return_if_no_widget (widget, data);

  dialog = layer_options_dialog_new (gimp_item_get_image (GIMP_ITEM (layer)),
                                     layer,
                                     action_data_get_context (data),
                                     widget,
                                     gimp_object_get_name (layer),
                                     layer_fill_type,
                                     _("Layer Attributes"),
                                     "gimp-layer-edit",
                                     GTK_STOCK_EDIT,
                                     _("Edit Layer Attributes"),
                                     GIMP_HELP_LAYER_EDIT);

  g_signal_connect (dialog->dialog, "response",
                    G_CALLBACK (layers_edit_layer_response),
                    dialog);

  gtk_widget_show (dialog->dialog);
}
开发者ID:ApoorvKhatreja,项目名称:gimp,代码行数:29,代码来源:layers-commands.c


示例3: channels_edit_attributes_cmd_callback

void
channels_edit_attributes_cmd_callback (GtkAction *action,
                                       gpointer   data)
{
  ChannelOptionsDialog *options;
  GimpImage            *image;
  GimpChannel          *channel;
  GtkWidget            *widget;
  return_if_no_channel (image, channel, data);
  return_if_no_widget (widget, data);

  options = channel_options_dialog_new (image, channel,
                                        action_data_get_context (data),
                                        widget,
                                        &channel->color,
                                        gimp_object_get_name (channel),
                                        _("Channel Attributes"),
                                        "gimp-channel-edit",
                                        GTK_STOCK_EDIT,
                                        _("Edit Channel Attributes"),
                                        GIMP_HELP_CHANNEL_EDIT,
                                        _("Edit Channel Color"),
                                        _("_Fill opacity:"),
                                        FALSE);

  g_signal_connect (options->dialog, "response",
                    G_CALLBACK (channels_edit_channel_response),
                    options);

  gtk_widget_show (options->dialog);
}
开发者ID:1ynx,项目名称:gimp,代码行数:31,代码来源:channels-commands.c


示例4: channels_new_cmd_callback

void
channels_new_cmd_callback (GtkAction *action,
                           gpointer   data)
{
  ChannelOptionsDialog *options;
  GimpImage            *image;
  GtkWidget            *widget;
  return_if_no_image (image, data);
  return_if_no_widget (widget, data);

  options = channel_options_dialog_new (image, NULL,
                                        action_data_get_context (data),
                                        widget,
                                        &channel_color,
                                        channel_name ? channel_name :
                                        _("Channel"),
                                        _("New Channel"),
                                        "gimp-channel-new",
                                        GIMP_STOCK_CHANNEL,
                                        _("New Channel Options"),
                                        GIMP_HELP_CHANNEL_NEW,
                                        _("New Channel Color"),
                                        _("_Fill opacity:"),
                                        TRUE);

  g_signal_connect (options->dialog, "response",
                    G_CALLBACK (channels_new_channel_response),
                    options);

  gtk_widget_show (options->dialog);
}
开发者ID:1ynx,项目名称:gimp,代码行数:31,代码来源:channels-commands.c


示例5: layers_text_tool_cmd_callback

void
layers_text_tool_cmd_callback (GtkAction *action,
                               gpointer   data)
{
  GimpImage *image;
  GimpLayer *layer;
  GtkWidget *widget;
  GimpTool  *active_tool;
  return_if_no_layer (image, layer, data);
  return_if_no_widget (widget, data);

  if (! gimp_item_is_text_layer (GIMP_ITEM (layer)))
    {
      layers_edit_attributes_cmd_callback (action, data);
      return;
    }

  active_tool = tool_manager_get_active (image->gimp);

  if (! GIMP_IS_TEXT_TOOL (active_tool))
    {
      GimpToolInfo *tool_info = gimp_get_tool_info (image->gimp,
                                                    "gimp-text-tool");

      if (GIMP_IS_TOOL_INFO (tool_info))
        {
          gimp_context_set_tool (action_data_get_context (data), tool_info);
          active_tool = tool_manager_get_active (image->gimp);
        }
    }

  if (GIMP_IS_TEXT_TOOL (active_tool))
    gimp_text_tool_set_layer (GIMP_TEXT_TOOL (active_tool), layer);
}
开发者ID:ApoorvKhatreja,项目名称:gimp,代码行数:34,代码来源:layers-commands.c


示例6: vectors_edit_attributes_cmd_callback

void
vectors_edit_attributes_cmd_callback (GtkAction *action,
                                      gpointer   data)
{
  VectorsOptionsDialog *options;
  GimpImage            *image;
  GimpVectors          *vectors;
  GtkWidget            *widget;
  return_if_no_vectors (image, vectors, data);
  return_if_no_widget (widget, data);

  options = vectors_options_dialog_new (image, vectors,
                                        action_data_get_context (data),
                                        widget,
                                        gimp_object_get_name (GIMP_OBJECT (vectors)),
                                        _("Path Attributes"),
                                        "gimp-vectors-edit",
                                        GTK_STOCK_EDIT,
                                        _("Edit Path Attributes"),
                                        GIMP_HELP_PATH_EDIT);

  g_signal_connect (options->dialog, "response",
                    G_CALLBACK (vectors_edit_vectors_response),
                    options);

  gtk_widget_show (options->dialog);
}
开发者ID:jdburton,项目名称:gimp-osx,代码行数:27,代码来源:vectors-commands.c


示例7: vectors_paste_cmd_callback

void
vectors_paste_cmd_callback (GtkAction *action,
                            gpointer   data)
{
  GimpImage *image;
  GtkWidget *widget;
  gchar     *svg;
  gsize      svg_size;
  return_if_no_image (image, data);
  return_if_no_widget (widget, data);

  svg = gimp_clipboard_get_svg (image->gimp, &svg_size);

  if (svg)
    {
      GError *error = NULL;

      if (! gimp_vectors_import_buffer (image, svg, svg_size,
                                        TRUE, FALSE,
                                        GIMP_IMAGE_ACTIVE_PARENT, -1,
                                        NULL, &error))
        {
          gimp_message (image->gimp, G_OBJECT (widget), GIMP_MESSAGE_ERROR,
                        "%s", error->message);
          g_clear_error (&error);
        }
      else
        {
          gimp_image_flush (image);
        }

      g_free (svg);
    }
}
开发者ID:ellelstone,项目名称:gimp,代码行数:34,代码来源:vectors-commands.c


示例8: edit_paste_as_new_cmd_callback

void
edit_paste_as_new_cmd_callback (GtkAction *action,
                                gpointer   data)
{
    Gimp       *gimp;
    GimpBuffer *buffer;
    GtkWidget  *widget;
    return_if_no_gimp (gimp, data);
    return_if_no_widget (widget, data);

    buffer = gimp_clipboard_get_buffer (gimp);

    if (buffer)
    {
        GimpImage *image;

        image = gimp_image_new_from_buffer (gimp, action_data_get_image (data),
                                            buffer);
        g_object_unref (buffer);

        gimp_create_display (image->gimp, image, GIMP_UNIT_PIXEL, 1.0,
                             G_OBJECT (gtk_widget_get_screen (widget)),
                             gimp_widget_get_monitor (widget));
        g_object_unref (image);
    }
    else
    {
        gimp_message_literal (gimp, NULL, GIMP_MESSAGE_WARNING,
                              _("There is no image data in the clipboard to paste."));
    }
}
开发者ID:feedbackex,项目名称:gimp,代码行数:31,代码来源:edit-commands.c


示例9: select_float_cmd_callback

void
select_float_cmd_callback (GtkAction *action,
                           gpointer   data)
{
  GimpImage *image;
  GtkWidget *widget;
  GError    *error = NULL;
  return_if_no_image (image, data);
  return_if_no_widget (widget, data);

  if (gimp_selection_float (GIMP_SELECTION (gimp_image_get_mask (image)),
                            gimp_image_get_active_drawable (image),
                            action_data_get_context (data),
                            TRUE, 0, 0, &error))
    {
      gimp_image_flush (image);
    }
  else
    {
      gimp_message_literal (image->gimp,
                            G_OBJECT (widget), GIMP_MESSAGE_WARNING,
                            error->message);
      g_clear_error (&error);
    }
}
开发者ID:gfraysse,项目名称:gimp,代码行数:25,代码来源:select-commands.c


示例10: image_scale_cmd_callback

void
image_scale_cmd_callback (GtkAction *action,
                          gpointer   data)
{
  GimpDisplay *display;
  GtkWidget   *widget;
  GtkWidget   *dialog;
  return_if_no_display (display, data);
  return_if_no_widget (widget, data);

  if (image_scale_unit != GIMP_UNIT_PERCENT)
    image_scale_unit = GIMP_DISPLAY_SHELL (display->shell)->unit;

  if (image_scale_interp == -1)
    image_scale_interp = display->image->gimp->config->interpolation_type;

  dialog = image_scale_dialog_new (display->image,
                                   action_data_get_context (data),
                                   widget,
                                   image_scale_unit,
                                   image_scale_interp,
                                   image_scale_callback,
                                   display);

  g_signal_connect_object (display, "disconnect",
                           G_CALLBACK (gtk_widget_destroy),
                           dialog, G_CONNECT_SWAPPED);

  gtk_widget_show (dialog);
}
开发者ID:jdburton,项目名称:gimp-osx,代码行数:30,代码来源:image-commands.c


示例11: image_print_size_cmd_callback

void
image_print_size_cmd_callback (GtkAction *action,
                               gpointer   data)
{
  GtkWidget   *dialog;
  GimpDisplay *display;
  GtkWidget   *widget;
  return_if_no_display (display, data);
  return_if_no_widget (widget, data);

  dialog = print_size_dialog_new (display->image,
                                  action_data_get_context (data),
                                  _("Set Image Print Resolution"),
                                  "gimp-image-print-size",
                                  widget,
                                  gimp_standard_help_func,
                                  GIMP_HELP_IMAGE_PRINT_SIZE,
                                  image_print_size_callback,
                                  NULL);

  g_signal_connect_object (display, "disconnect",
                           G_CALLBACK (gtk_widget_destroy),
                           dialog, G_CONNECT_SWAPPED);

  gtk_widget_show (dialog);
}
开发者ID:jdburton,项目名称:gimp-osx,代码行数:26,代码来源:image-commands.c


示例12: select_stroke_cmd_callback

void
select_stroke_cmd_callback (GtkAction *action,
                            gpointer   data)
{
  GimpImage    *image;
  GimpDrawable *drawable;
  GtkWidget    *widget;
  GtkWidget    *dialog;
  return_if_no_image (image, data);
  return_if_no_widget (widget, data);

  drawable = gimp_image_get_active_drawable (image);

  if (! drawable)
    {
      gimp_message (image->gimp, G_OBJECT (widget), GIMP_MESSAGE_WARNING,
                    _("There is no active layer or channel to stroke to."));
      return;
    }

  dialog = stroke_dialog_new (GIMP_ITEM (gimp_image_get_mask (image)),
                              action_data_get_context (data),
                              _("Stroke Selection"),
                              GIMP_STOCK_SELECTION_STROKE,
                              GIMP_HELP_SELECTION_STROKE,
                              widget);
  gtk_widget_show (dialog);
}
开发者ID:Amerekanets,项目名称:gimp,代码行数:28,代码来源:select-commands.c


示例13: vectors_import_cmd_callback

void
vectors_import_cmd_callback (GtkAction *action,
                             gpointer   data)
{
  GimpImage *image;
  GtkWidget *widget;
  GtkWidget *dialog;
  return_if_no_image (image, data);
  return_if_no_widget (widget, data);

#define IMPORT_DIALOG_KEY "gimp-vectors-import-dialog"

  dialog = dialogs_get_dialog (G_OBJECT (image), IMPORT_DIALOG_KEY);

  if (! dialog)
    {
      GimpDialogConfig *config = GIMP_DIALOG_CONFIG (image->gimp->config);
      GFile            *folder = NULL;

      if (config->vectors_import_path)
        folder = gimp_file_new_for_config_path (config->vectors_import_path,
                                                NULL);

      dialog = vectors_import_dialog_new (image, widget,
                                          folder,
                                          config->vectors_import_merge,
                                          config->vectors_import_scale,
                                          vectors_import_callback,
                                          NULL);

      dialogs_attach_dialog (G_OBJECT (image), IMPORT_DIALOG_KEY, dialog);
    }

  gtk_window_present (GTK_WINDOW (dialog));
}
开发者ID:ellelstone,项目名称:gimp,代码行数:35,代码来源:vectors-commands.c


示例14: help_context_help_cmd_callback

void
help_context_help_cmd_callback (GtkAction *action,
                                gpointer   data)
{
  GtkWidget *widget;
  return_if_no_widget (widget, data);

  gimp_context_help (widget);
}
开发者ID:AdamGrzonkowski,项目名称:gimp-1,代码行数:9,代码来源:help-commands.c


示例15: vectors_selection_to_vectors_cmd_callback

void
vectors_selection_to_vectors_cmd_callback (GtkAction *action,
                                           gint       value,
                                           gpointer   data)
{
  GimpImage      *image;
  GtkWidget      *widget;
  GimpProcedure  *procedure;
  GimpValueArray *args;
  GimpDisplay    *display;
  GError         *error = NULL;
  return_if_no_image (image, data);
  return_if_no_widget (widget, data);

  if (value)
    procedure = gimp_pdb_lookup_procedure (image->gimp->pdb,
                                           "plug-in-sel2path-advanced");
  else
    procedure = gimp_pdb_lookup_procedure (image->gimp->pdb,
                                           "plug-in-sel2path");

  if (! procedure)
    {
      gimp_message_literal (image->gimp,
                            G_OBJECT (widget), GIMP_MESSAGE_ERROR,
                            "Selection to path procedure lookup failed.");
      return;
    }

  display = gimp_context_get_display (action_data_get_context (data));

  args = gimp_procedure_get_arguments (procedure);
  gimp_value_array_truncate (args, 2);

  g_value_set_int      (gimp_value_array_index (args, 0),
                        GIMP_RUN_INTERACTIVE);
  gimp_value_set_image (gimp_value_array_index (args, 1),
                        image);

  gimp_procedure_execute_async (procedure, image->gimp,
                                action_data_get_context (data),
                                GIMP_PROGRESS (display), args,
                                GIMP_OBJECT (display), &error);

  gimp_value_array_unref (args);

  if (error)
    {
      gimp_message_literal (image->gimp,
                            G_OBJECT (widget), GIMP_MESSAGE_ERROR,
                            error->message);
      g_error_free (error);
    }
}
开发者ID:ellelstone,项目名称:gimp,代码行数:54,代码来源:vectors-commands.c


示例16: file_open_location_cmd_callback

void
file_open_location_cmd_callback (GtkAction *action,
                                 gpointer   data)
{
  GtkWidget *widget;
  return_if_no_widget (widget, data);

  gimp_dialog_factory_dialog_new (global_dialog_factory,
                                  gtk_widget_get_screen (widget),
                                  "gimp-file-open-location-dialog", -1, TRUE);
}
开发者ID:Amerekanets,项目名称:gimp,代码行数:11,代码来源:file-commands.c


示例17: file_open_location_cmd_callback

void
file_open_location_cmd_callback (GtkAction *action,
                                 gpointer   data)
{
  GtkWidget *widget;
  return_if_no_widget (widget, data);

  gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
                                  gtk_widget_get_screen (widget),
                                  NULL /*ui_manager*/,
                                  "gimp-file-open-location-dialog", -1, TRUE);
}
开发者ID:1ynx,项目名称:gimp,代码行数:12,代码来源:file-commands.c


示例18: palettes_import_cmd_callback

void
palettes_import_cmd_callback (GtkAction *action,
                              gpointer   data)
{
  GtkWidget *widget;
  return_if_no_widget (widget, data);

  gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
                                  gtk_widget_get_screen (widget),
                                  gimp_widget_get_monitor (widget),
                                  NULL /*ui_manager*/,
                                  "gimp-palette-import-dialog", -1, TRUE);
}
开发者ID:AdamGrzonkowski,项目名称:gimp-1,代码行数:13,代码来源:palettes-commands.c


示例19: edit_named_paste_cmd_callback

void
edit_named_paste_cmd_callback (GtkAction *action,
                               gpointer   data)
{
  Gimp      *gimp;
  GtkWidget *widget;
  return_if_no_gimp (gimp, data);
  return_if_no_widget (widget, data);

  gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (gimp)),
                                             gimp,
                                             gimp_dialog_factory_get_singleton (),
                                             gtk_widget_get_screen (widget),
                                             "gimp-buffer-list|gimp-buffer-grid");
}
开发者ID:AnonPower,项目名称:picman,代码行数:15,代码来源:edit-commands.c


示例20: dialogs_create_toplevel_cmd_callback

void
dialogs_create_toplevel_cmd_callback (GtkAction   *action,
                                      const gchar *value,
                                      gpointer     data)
{
  GtkWidget *widget;
  return_if_no_widget (widget, data);

  if (value)
    gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
                                    gimp_widget_get_monitor (widget),
                                    NULL /*ui_manager*/,
                                    widget,
                                    value, -1, TRUE);
}
开发者ID:jiapei100,项目名称:gimp,代码行数:15,代码来源:dialogs-commands.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ return_nsstr函数代码示例发布时间:2022-05-30
下一篇:
C++ return_if_no_context函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap