本文整理匯總了C++中GIMP_IS_CONTEXT函數的典型用法代碼示例。如果您正苦於以下問題:C++ GIMP_IS_CONTEXT函數的具體用法?C++ GIMP_IS_CONTEXT怎麽用?C++ GIMP_IS_CONTEXT使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GIMP_IS_CONTEXT函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: gimp_plug_in_new
GimpPlugIn *
gimp_plug_in_new (GimpPlugInManager *manager,
GimpContext *context,
GimpProgress *progress,
GimpPlugInProcedure *procedure,
const gchar *prog)
{
GimpPlugIn *plug_in;
g_return_val_if_fail (GIMP_IS_PLUG_IN_MANAGER (manager), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
g_return_val_if_fail (procedure == NULL ||
GIMP_IS_PLUG_IN_PROCEDURE (procedure), NULL);
g_return_val_if_fail (prog == NULL || g_path_is_absolute (prog), NULL);
g_return_val_if_fail ((procedure != NULL || prog != NULL) &&
! (procedure != NULL && prog != NULL), NULL);
plug_in = g_object_new (GIMP_TYPE_PLUG_IN, NULL);
if (! prog)
prog = gimp_plug_in_procedure_get_progname (procedure);
gimp_object_take_name (GIMP_OBJECT (plug_in),
g_filename_display_basename (prog));
plug_in->manager = manager;
plug_in->prog = g_strdup (prog);
gimp_plug_in_proc_frame_init (&plug_in->main_proc_frame,
context, progress, procedure);
return plug_in;
}
示例2: gimp_prop_font_box_new
GtkWidget *
gimp_prop_font_box_new (GimpContainer *container,
GimpContext *context,
const gchar *label,
gint spacing,
const gchar *view_type_prop,
const gchar *view_size_prop)
{
GimpViewType view_type;
GimpViewSize view_size;
g_return_val_if_fail (container == NULL || GIMP_IS_CONTAINER (container),
NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_object_get (context,
view_type_prop, &view_type,
view_size_prop, &view_size,
NULL);
return view_props_connect (font_box_new (container, context, label, spacing,
view_type, view_size),
context,
view_type_prop, view_size_prop);
}
示例3: plug_in_icc_profile_info
gboolean
plug_in_icc_profile_info (GimpImage *image,
GimpContext *context,
GimpProgress *progress,
gchar **name,
gchar **desc,
gchar **info,
GError **error)
{
Gimp *gimp;
GimpProcedure *procedure;
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
gimp = image->gimp;
procedure = gimp_pdb_lookup_procedure (gimp->pdb, ICC_PROFILE_INFO_PROC);
if (procedure &&
procedure->num_args >= 1 &&
GIMP_IS_PARAM_SPEC_IMAGE_ID (procedure->args[0]))
{
GimpValueArray *return_vals;
GimpPDBStatusType status;
return_vals =
gimp_pdb_execute_procedure_by_name (gimp->pdb, context, progress, error,
ICC_PROFILE_INFO_PROC,
GIMP_TYPE_IMAGE_ID,
gimp_image_get_ID (image),
G_TYPE_NONE);
status = g_value_get_enum (gimp_value_array_index (return_vals, 0));
switch (status)
{
case GIMP_PDB_SUCCESS:
plug_in_icc_profile_info_return (return_vals, name, desc, info);
break;
default:
if (error && *error == NULL)
g_set_error (error, GIMP_PLUG_IN_ERROR, GIMP_PLUG_IN_FAILED,
_("Error running '%s'"), ICC_PROFILE_INFO_PROC);
break;
}
gimp_value_array_unref (return_vals);
return (status == GIMP_PDB_SUCCESS);
}
g_set_error (error, GIMP_PLUG_IN_ERROR, GIMP_PLUG_IN_FAILED,
_("Plug-In missing (%s)"), ICC_PROFILE_INFO_PROC);
return FALSE;
}
示例4: gimp_dynamics_factory_view_new
GtkWidget *
gimp_dynamics_factory_view_new (GimpViewType view_type,
GimpDataFactory *factory,
GimpContext *context,
gint view_size,
gint view_border_width,
GimpMenuFactory *menu_factory)
{
g_return_val_if_fail (GIMP_IS_DATA_FACTORY (factory), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (view_size > 0 &&
view_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, NULL);
g_return_val_if_fail (view_border_width >= 0 &&
view_border_width <= GIMP_VIEW_MAX_BORDER_WIDTH,
NULL);
g_return_val_if_fail (menu_factory == NULL ||
GIMP_IS_MENU_FACTORY (menu_factory), NULL);
return g_object_new (GIMP_TYPE_DYNAMICS_FACTORY_VIEW,
"view-type", view_type,
"data-factory", factory,
"context", context,
"view-size", view_size,
"view-border-width", view_border_width,
"menu-factory", menu_factory,
"menu-identifier", "<Dynamics>",
"ui-path", "/dynamics-popup",
"action-group", "dynamics",
NULL);
}
示例5: gimp_image_item_list_transform
void
gimp_image_item_list_transform (GimpImage *image,
GList *list,
GimpContext *context,
const GimpMatrix3 *matrix,
GimpTransformDirection direction,
GimpInterpolationType interpolation_type,
GimpTransformResize clip_result,
GimpProgress *progress)
{
g_return_if_fail (GIMP_IS_IMAGE (image));
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
if (list)
{
GList *l;
if (list->next)
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM,
C_("undo-type", "Transform Items"));
for (l = list; l; l = g_list_next (l))
gimp_item_transform (GIMP_ITEM (l->data), context,
matrix, direction,
interpolation_type,
clip_result, progress);
if (list->next)
gimp_image_undo_group_end (image);
}
}
示例6: gimp_edit_named_cut
const gchar *
gimp_edit_named_cut (GimpImage *image,
const gchar *name,
GimpDrawable *drawable,
GimpContext *context,
GError **error)
{
GimpBuffer *buffer;
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
buffer = gimp_edit_extract (image, GIMP_PICKABLE (drawable),
context, TRUE, error);
if (buffer)
{
gimp_object_set_name (GIMP_OBJECT (buffer), name);
gimp_container_add (image->gimp->named_buffers, GIMP_OBJECT (buffer));
g_object_unref (buffer);
return gimp_object_get_name (buffer);
}
return NULL;
}
示例7: gimp_edit_clear
void
gimp_edit_clear (GimpImage *image,
GimpDrawable *drawable,
GimpContext *context)
{
GimpFillOptions *options;
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_CONTEXT (context));
options = gimp_fill_options_new (context->gimp);
if (gimp_drawable_has_alpha (drawable))
gimp_fill_options_set_by_fill_type (options, context,
GIMP_FILL_TRANSPARENT, NULL);
else
gimp_fill_options_set_by_fill_type (options, context,
GIMP_FILL_BACKGROUND, NULL);
gimp_edit_fill (image, drawable, options, C_("undo-type", "Clear"));
g_object_unref (options);
}
示例8: gimp_item_linked_flip
void
gimp_item_linked_flip (GimpItem *item,
GimpContext *context,
GimpOrientationType flip_type,
gdouble axis,
gboolean clip_result)
{
GList *list;
g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (gimp_item_get_linked (item) == TRUE);
g_return_if_fail (gimp_item_is_attached (item));
list = gimp_image_item_list_get_list (gimp_item_get_image (item), item,
GIMP_ITEM_TYPE_ALL,
GIMP_ITEM_SET_LINKED);
list = gimp_image_item_list_filter (item, list, TRUE, FALSE);
gimp_image_item_list_flip (gimp_item_get_image (item), list, context,
flip_type, axis, clip_result);
g_list_free (list);
}
示例9: gimp_view_new_full
GtkWidget *
gimp_view_new_full (GimpContext *context,
GimpViewable *viewable,
gint width,
gint height,
gint border_width,
gboolean is_popup,
gboolean clickable,
gboolean show_popup)
{
GtkWidget *view;
g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (GIMP_IS_VIEWABLE (viewable), NULL);
view = gimp_view_new_full_by_types (context,
GIMP_TYPE_VIEW,
G_TYPE_FROM_INSTANCE (viewable),
width, height, border_width,
is_popup, clickable, show_popup);
if (view)
gimp_view_set_viewable (GIMP_VIEW (view), viewable);
gimp_view_renderer_remove_idle (GIMP_VIEW (view)->renderer);
return view;
}
示例10: gimp_container_combo_box_new
GtkWidget *
gimp_container_combo_box_new (GimpContainer *container,
GimpContext *context,
gint view_size,
gint view_border_width)
{
GtkWidget *combo_box;
GimpContainerView *view;
g_return_val_if_fail (container == NULL || GIMP_IS_CONTAINER (container),
NULL);
g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL);
combo_box = g_object_new (GIMP_TYPE_CONTAINER_COMBO_BOX, NULL);
view = GIMP_CONTAINER_VIEW (combo_box);
gimp_container_view_set_view_size (view, view_size, view_border_width);
if (container)
gimp_container_view_set_container (view, container);
if (context)
gimp_container_view_set_context (view, context);
return combo_box;
}
示例11: gimp_item_linked_transform
void
gimp_item_linked_transform (GimpItem *item,
GimpContext *context,
const GimpMatrix3 *matrix,
GimpTransformDirection direction,
GimpInterpolationType interpolation_type,
GimpTransformResize clip_result,
GimpProgress *progress)
{
GList *list;
g_return_if_fail (GIMP_IS_ITEM (item));
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (gimp_item_get_linked (item) == TRUE);
g_return_if_fail (gimp_item_is_attached (item));
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
list = gimp_image_item_list_get_list (gimp_item_get_image (item), item,
GIMP_ITEM_TYPE_ALL,
GIMP_ITEM_SET_LINKED);
list = gimp_image_item_list_filter (item, list, TRUE, FALSE);
gimp_image_item_list_transform (gimp_item_get_image (item), list, context,
matrix, direction,
interpolation_type,
clip_result, progress);
g_list_free (list);
}
示例12: gimp_container_grid_view_new
GtkWidget *
gimp_container_grid_view_new (GimpContainer *container,
GimpContext *context,
gint view_size,
gint view_border_width)
{
GimpContainerGridView *grid_view;
GimpContainerView *view;
g_return_val_if_fail (container == NULL || GIMP_IS_CONTAINER (container),
NULL);
g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (view_size > 0 &&
view_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, NULL);
g_return_val_if_fail (view_border_width >= 0 &&
view_border_width <= GIMP_VIEW_MAX_BORDER_WIDTH,
NULL);
grid_view = g_object_new (GIMP_TYPE_CONTAINER_GRID_VIEW, NULL);
view = GIMP_CONTAINER_VIEW (grid_view);
gimp_container_view_set_view_size (view, view_size, view_border_width);
if (container)
gimp_container_view_set_container (view, container);
if (context)
gimp_container_view_set_context (view, context);
return GTK_WIDGET (grid_view);
}
示例13: gimp_pdb_context_new
GimpContext *
gimp_pdb_context_new (Gimp *gimp,
GimpContext *parent,
gboolean set_parent)
{
GimpContext *context;
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 (context,
GIMP_CONTEXT_ALL_PROPS_MASK, FALSE);
gimp_context_set_parent (context, parent);
}
return context;
}
示例14: gimp_edit_clear
gboolean
gimp_edit_clear (GimpImage *image,
GimpDrawable *drawable,
GimpContext *context)
{
GimpRGB background;
GimpLayerModeEffects paint_mode;
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), FALSE);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE);
gimp_context_get_background (context, &background);
if (gimp_drawable_has_alpha (drawable))
paint_mode = GIMP_ERASE_MODE;
else
paint_mode = GIMP_NORMAL_MODE;
return gimp_edit_fill_full (image, drawable,
&background, NULL,
GIMP_OPACITY_OPAQUE, paint_mode,
C_("undo-type", "Clear"));
}
示例15: gimp_pdb_dialog_new
gboolean
gimp_pdb_dialog_new (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpContainer *container,
const gchar *title,
const gchar *callback_name,
const gchar *object_name,
...)
{
gboolean retval = FALSE;
g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), FALSE);
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
g_return_val_if_fail (title != NULL, FALSE);
g_return_val_if_fail (callback_name != NULL, FALSE);
if (gimp->gui.pdb_dialog_new)
{
va_list args;
va_start (args, object_name);
retval = gimp->gui.pdb_dialog_new (gimp, context, progress,
container, title,
callback_name, object_name,
args);
va_end (args);
}
return retval;
}