本文整理汇总了C++中GIMP_DATA_EDITOR函数的典型用法代码示例。如果您正苦于以下问题:C++ GIMP_DATA_EDITOR函数的具体用法?C++ GIMP_DATA_EDITOR怎么用?C++ GIMP_DATA_EDITOR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GIMP_DATA_EDITOR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: palette_editor_columns_changed
static void
palette_editor_columns_changed (GtkAdjustment *adj,
GimpPaletteEditor *editor)
{
if (GIMP_DATA_EDITOR (editor)->data)
{
GimpPalette *palette = GIMP_PALETTE (GIMP_DATA_EDITOR (editor)->data);
gimp_palette_set_columns (palette,
ROUND (gtk_adjustment_get_value (adj)));
}
}
示例2: gimp_brush_editor_update_brush
static void
gimp_brush_editor_update_brush (GtkAdjustment *adjustment,
GimpBrushEditor *editor)
{
GimpBrushGenerated *brush;
gdouble radius;
gint spikes;
gdouble hardness;
gdouble ratio;
gdouble angle;
gdouble spacing;
if (! GIMP_IS_BRUSH_GENERATED (GIMP_DATA_EDITOR (editor)->data))
return;
brush = GIMP_BRUSH_GENERATED (GIMP_DATA_EDITOR (editor)->data);
radius = gtk_adjustment_get_value (editor->radius_data);
spikes = ROUND (gtk_adjustment_get_value (editor->spikes_data));
hardness = gtk_adjustment_get_value (editor->hardness_data);
ratio = gtk_adjustment_get_value (editor->aspect_ratio_data);
angle = gtk_adjustment_get_value (editor->angle_data);
spacing = gtk_adjustment_get_value (editor->spacing_data);
if (radius != gimp_brush_generated_get_radius (brush) ||
spikes != gimp_brush_generated_get_spikes (brush) ||
hardness != gimp_brush_generated_get_hardness (brush) ||
ratio != gimp_brush_generated_get_aspect_ratio (brush) ||
angle != gimp_brush_generated_get_angle (brush) ||
spacing != gimp_brush_get_spacing (GIMP_BRUSH (brush)))
{
g_signal_handlers_block_by_func (brush,
gimp_brush_editor_notify_brush,
editor);
gimp_data_freeze (GIMP_DATA (brush));
g_object_freeze_notify (G_OBJECT (brush));
gimp_brush_generated_set_radius (brush, radius);
gimp_brush_generated_set_spikes (brush, spikes);
gimp_brush_generated_set_hardness (brush, hardness);
gimp_brush_generated_set_aspect_ratio (brush, ratio);
gimp_brush_generated_set_angle (brush, angle);
gimp_brush_set_spacing (GIMP_BRUSH (brush), spacing);
g_object_thaw_notify (G_OBJECT (brush));
gimp_data_thaw (GIMP_DATA (brush));
g_signal_handlers_unblock_by_func (brush,
gimp_brush_editor_notify_brush,
editor);
}
}
示例3: palette_editor_color_name_changed
static void
palette_editor_color_name_changed (GtkWidget *widget,
GimpPaletteEditor *editor)
{
if (GIMP_DATA_EDITOR (editor)->data)
{
GimpPalette *palette = GIMP_PALETTE (GIMP_DATA_EDITOR (editor)->data);
const gchar *name;
name = gtk_entry_get_text (GTK_ENTRY (editor->color_name));
gimp_palette_set_entry_name (palette, editor->color->position, name);
}
}
示例4: palette_editor_entry_selected
static void
palette_editor_entry_selected (GimpPaletteView *view,
GimpPaletteEntry *entry,
GimpPaletteEditor *editor)
{
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (editor);
if (editor->color != entry)
{
editor->color = entry;
g_signal_handlers_block_by_func (editor->color_name,
palette_editor_color_name_changed,
editor);
gtk_entry_set_text (GTK_ENTRY (editor->color_name),
entry ? entry->name : _("Undefined"));
g_signal_handlers_unblock_by_func (editor->color_name,
palette_editor_color_name_changed,
editor);
gtk_editable_set_editable (GTK_EDITABLE (editor->color_name),
entry && data_editor->data_editable);
gimp_ui_manager_update (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)),
gimp_editor_get_popup_data (GIMP_EDITOR (editor)));
}
}
示例5: palette_editor_edit_color_update
static void
palette_editor_edit_color_update (GimpColorDialog *dialog,
const GimpRGB *color,
GimpColorDialogState state,
GimpPaletteEditor *editor)
{
GimpPalette *palette = GIMP_PALETTE (GIMP_DATA_EDITOR (editor)->data);
switch (state)
{
case GIMP_COLOR_DIALOG_UPDATE:
break;
case GIMP_COLOR_DIALOG_OK:
if (editor->color)
{
editor->color->color = *color;
gimp_data_dirty (GIMP_DATA (palette));
}
/* Fallthrough */
case GIMP_COLOR_DIALOG_CANCEL:
gtk_widget_hide (editor->color_dialog);
break;
}
}
示例6: gimp_data_editor_set_property
static void
gimp_data_editor_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
GimpDataEditor *editor = GIMP_DATA_EDITOR (object);
switch (property_id)
{
case PROP_DATA_FACTORY:
editor->data_factory = g_value_get_object (value);
break;
case PROP_CONTEXT:
gimp_docked_set_context (GIMP_DOCKED (object),
g_value_get_object (value));
break;
case PROP_DATA:
gimp_data_editor_set_data (editor, g_value_get_object (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
示例7: gimp_data_editor_get_aux_info
static GList *
gimp_data_editor_get_aux_info (GimpDocked *docked)
{
GimpDataEditor *editor = GIMP_DATA_EDITOR (docked);
GList *aux_info;
GimpSessionInfoAux *aux;
aux_info = parent_docked_iface->get_aux_info (docked);
aux = gimp_session_info_aux_new (AUX_INFO_EDIT_ACTIVE,
editor->edit_active ? "true" : "false");
aux_info = g_list_append (aux_info, aux);
if (editor->data)
{
const gchar *value;
value = gimp_object_get_name (editor->data);
aux = gimp_session_info_aux_new (AUX_INFO_CURRENT_DATA, value);
aux_info = g_list_append (aux_info, aux);
}
return aux_info;
}
示例8: gimp_palette_editor_set_index
gboolean
gimp_palette_editor_set_index (GimpPaletteEditor *editor,
gint index,
GimpRGB *color)
{
GimpPalette *palette;
g_return_val_if_fail (GIMP_IS_PALETTE_EDITOR (editor), FALSE);
palette = GIMP_PALETTE (GIMP_DATA_EDITOR (editor)->data);
if (palette && gimp_palette_get_n_colors (palette) > 0)
{
GimpPaletteEntry *entry;
index = CLAMP (index, 0, gimp_palette_get_n_colors (palette) - 1);
entry = gimp_palette_get_entry (palette, index);
gimp_palette_view_select_entry (GIMP_PALETTE_VIEW (editor->view),
entry);
if (color)
*color = editor->color->color;
return TRUE;
}
return FALSE;
}
示例9: dynamics_editor_actions_update
void
dynamics_editor_actions_update (GimpActionGroup *group,
gpointer user_data)
{
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (user_data);
GimpData *data;
gboolean editable = FALSE;
gboolean edit_active = FALSE;
data = data_editor->data;
if (data)
{
if (data_editor->data_editable)
editable = TRUE;
}
edit_active = gimp_data_editor_get_edit_active (data_editor);
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
#define SET_ACTIVE(action,condition) \
gimp_action_group_set_action_active (group, action, (condition) != 0)
SET_ACTIVE ("dynamics-editor-edit-active", edit_active);
#undef SET_SENSITIVE
#undef SET_ACTIVE
}
示例10: gimp_data_editor_constructed
static void
gimp_data_editor_constructed (GObject *object)
{
GimpDataEditor *editor = GIMP_DATA_EDITOR (object);
G_OBJECT_CLASS (parent_class)->constructed (object);
g_assert (GIMP_IS_DATA_FACTORY (editor->data_factory));
g_assert (GIMP_IS_CONTEXT (editor->context));
gimp_data_editor_set_edit_active (editor, TRUE);
editor->save_button =
gimp_editor_add_button (GIMP_EDITOR (editor),
"document-save",
_("Save"), NULL,
G_CALLBACK (gimp_data_editor_save_clicked),
NULL,
editor);
editor->revert_button =
gimp_editor_add_button (GIMP_EDITOR (editor),
"document-revert",
_("Revert"), NULL,
G_CALLBACK (gimp_data_editor_revert_clicked),
NULL,
editor);
/* Hide because revert buttons are not yet implemented */
gtk_widget_hide (editor->revert_button);
}
示例11: gradient_editor_load_right_cmd_callback
void
gradient_editor_load_right_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (data);
GimpGradient *gradient;
GimpGradientSegment *seg;
GimpRGB color;
GimpGradientColor color_type = GIMP_GRADIENT_COLOR_FIXED;
gradient = GIMP_GRADIENT (data_editor->data);
switch (value)
{
case GRADIENT_EDITOR_COLOR_NEIGHBOR_ENDPOINT:
if (editor->control_sel_r->next != NULL)
seg = editor->control_sel_r->next;
else
seg = gimp_gradient_segment_get_first (editor->control_sel_r);
color = seg->left_color;
color_type = seg->left_color_type;
break;
case GRADIENT_EDITOR_COLOR_OTHER_ENDPOINT:
color = editor->control_sel_l->left_color;
color_type = editor->control_sel_l->left_color_type;
break;
case GRADIENT_EDITOR_COLOR_FOREGROUND:
gimp_context_get_foreground (data_editor->context, &color);
break;
case GRADIENT_EDITOR_COLOR_BACKGROUND:
gimp_context_get_background (data_editor->context, &color);
break;
default: /* Load a color */
color = editor->saved_colors[value - GRADIENT_EDITOR_COLOR_FIRST_CUSTOM];
break;
}
gimp_data_freeze (GIMP_DATA (gradient));
gimp_gradient_segment_range_blend (gradient,
editor->control_sel_l,
editor->control_sel_r,
&editor->control_sel_l->left_color,
&color,
TRUE, TRUE);
gimp_gradient_segment_set_right_color_type (gradient,
editor->control_sel_l,
color_type);
gimp_data_thaw (GIMP_DATA (gradient));
}
示例12: palette_editor_drop_palette
static void
palette_editor_drop_palette (GtkWidget *widget,
gint x,
gint y,
GimpViewable *viewable,
gpointer data)
{
gimp_data_editor_set_data (GIMP_DATA_EDITOR (data), GIMP_DATA (viewable));
}
示例13: palette_editor_drop_color
static void
palette_editor_drop_color (GtkWidget *widget,
gint x,
gint y,
const GimpRGB *color,
gpointer data)
{
GimpPaletteEditor *editor = data;
if (GIMP_DATA_EDITOR (editor)->data_editable)
{
GimpPalette *palette = GIMP_PALETTE (GIMP_DATA_EDITOR (editor)->data);
GimpPaletteEntry *entry;
entry = gimp_palette_add_entry (palette, -1, NULL, color);
gimp_palette_view_select_entry (GIMP_PALETTE_VIEW (editor->view), entry);
}
}
示例14: palette_editor_color_dropped
static void
palette_editor_color_dropped (GimpPaletteView *view,
GimpPaletteEntry *entry,
const GimpRGB *color,
GimpPaletteEditor *editor)
{
if (GIMP_DATA_EDITOR (editor)->data_editable)
{
GimpPalette *palette = GIMP_PALETTE (GIMP_DATA_EDITOR (editor)->data);
gint pos = -1;
if (entry)
pos = entry->position;
entry = gimp_palette_add_entry (palette, pos, NULL, color);
gimp_palette_view_select_entry (GIMP_PALETTE_VIEW (editor->view), entry);
}
}
示例15: palette_editor_actions_update
void
palette_editor_actions_update (GimpActionGroup *group,
gpointer user_data)
{
GimpPaletteEditor *editor = GIMP_PALETTE_EDITOR (user_data);
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (user_data);
GimpData *data;
gboolean editable = FALSE;
GimpRGB fg;
GimpRGB bg;
gboolean edit_active = FALSE;
data = data_editor->data;
if (data)
{
if (data_editor->data_editable)
editable = TRUE;
}
if (data_editor->context)
{
gimp_context_get_foreground (data_editor->context, &fg);
gimp_context_get_background (data_editor->context, &bg);
}
edit_active = gimp_data_editor_get_edit_active (data_editor);
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
#define SET_ACTIVE(action,condition) \
gimp_action_group_set_action_active (group, action, (condition) != 0)
#define SET_COLOR(action,color) \
gimp_action_group_set_action_color (group, action, color, FALSE);
SET_SENSITIVE ("palette-editor-edit-color", editable && editor->color);
SET_SENSITIVE ("palette-editor-delete-color", editable && editor->color);
SET_SENSITIVE ("palette-editor-new-color-fg", editable);
SET_SENSITIVE ("palette-editor-new-color-bg", editable);
SET_COLOR ("palette-editor-new-color-fg", data_editor->context ? &fg : NULL);
SET_COLOR ("palette-editor-new-color-bg", data_editor->context ? &bg : NULL);
SET_SENSITIVE ("palette-editor-zoom-out", data);
SET_SENSITIVE ("palette-editor-zoom-in", data);
SET_SENSITIVE ("palette-editor-zoom-all", data);
SET_ACTIVE ("palette-editor-edit-active", edit_active);
#undef SET_SENSITIVE
#undef SET_ACTIVE
#undef SET_COLOR
}