本文整理汇总了C++中return_if_no_widget函数的典型用法代码示例。如果您正苦于以下问题:C++ return_if_no_widget函数的具体用法?C++ return_if_no_widget怎么用?C++ return_if_no_widget使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了return_if_no_widget函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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."));
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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));
}
示例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);
}
示例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);
}
}