~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/actions/palette-editor-commands.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* The GIMP -- an image manipulation program
 
1
/* GIMP - The GNU Image Manipulation Program
2
2
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
56
56
  GimpDataEditor    *data_editor = GIMP_DATA_EDITOR (data);
57
57
  GimpPalette       *palette;
58
58
 
59
 
  if (! (data_editor->data && data_editor->data_editable && editor->color))
 
59
  if (! (data_editor->data_editable && editor->color))
60
60
    return;
61
61
 
62
62
  palette = GIMP_PALETTE (data_editor->data);
64
64
  if (! editor->color_dialog)
65
65
    {
66
66
      editor->color_dialog =
67
 
        gimp_color_dialog_new (GIMP_VIEWABLE (palette),
 
67
        gimp_color_dialog_new (GIMP_VIEWABLE (palette),
 
68
                               data_editor->context,
68
69
                               _("Edit Palette Color"),
69
70
                               GIMP_STOCK_PALETTE,
70
71
                               _("Edit Color Palette Entry"),
71
72
                               GTK_WIDGET (editor),
72
73
                               gimp_dialog_factory_from_name ("toplevel"),
73
74
                               "gimp-palette-editor-color-dialog",
74
 
                               (const GimpRGB *) &editor->color->color,
 
75
                               &editor->color->color,
75
76
                               FALSE, FALSE);
76
77
 
77
78
      g_signal_connect (editor->color_dialog, "destroy",
85
86
  else
86
87
    {
87
88
      gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (editor->color_dialog),
88
 
                                         GIMP_VIEWABLE (palette));
 
89
                                         GIMP_VIEWABLE (palette),
 
90
                                         data_editor->context);
89
91
      gimp_color_dialog_set_color (GIMP_COLOR_DIALOG (editor->color_dialog),
90
92
                                   &editor->color->color);
91
93
    }
101
103
  GimpPaletteEditor *editor      = GIMP_PALETTE_EDITOR (data);
102
104
  GimpDataEditor    *data_editor = GIMP_DATA_EDITOR (data);
103
105
 
104
 
  if (data_editor->data && data_editor->data_editable)
 
106
  if (data_editor->data_editable)
105
107
    {
106
108
      GimpPalette *palette = GIMP_PALETTE (data_editor->data);
107
 
      GimpContext *context;
108
109
      GimpRGB      color;
109
110
 
110
 
      context = gimp_get_user_context (data_editor->data_factory->gimp);
111
 
 
112
111
      if (value)
113
 
        gimp_context_get_background (context, &color);
 
112
        gimp_context_get_background (data_editor->context, &color);
114
113
      else
115
 
        gimp_context_get_foreground (context, &color);
 
114
        gimp_context_get_foreground (data_editor->context, &color);
116
115
 
117
 
      editor->color = gimp_palette_add_entry (palette, NULL, &color);
 
116
      editor->color = gimp_palette_add_entry (palette, -1, NULL, &color);
118
117
    }
119
118
}
120
119
 
125
124
  GimpPaletteEditor *editor      = GIMP_PALETTE_EDITOR (data);
126
125
  GimpDataEditor    *data_editor = GIMP_DATA_EDITOR (data);
127
126
 
128
 
  if (data_editor->data && data_editor->data_editable && editor->color)
 
127
  if (data_editor->data_editable && editor->color)
129
128
    {
130
129
      GimpPalette *palette = GIMP_PALETTE (data_editor->data);
131
130
 
161
160
 
162
161
    case GIMP_COLOR_DIALOG_OK:
163
162
      if (editor->color)
164
 
        {
165
 
          editor->color->color = *color;
166
 
          gimp_data_dirty (GIMP_DATA (palette));
167
 
        }
 
163
        {
 
164
          editor->color->color = *color;
 
165
          gimp_data_dirty (GIMP_DATA (palette));
 
166
        }
168
167
      /* Fallthrough */
169
168
 
170
169
    case GIMP_COLOR_DIALOG_CANCEL: