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

« back to all changes in this revision

Viewing changes to app/actions/palettes-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
31
31
#include "widgets/gimpcontainertreeview.h"
32
32
#include "widgets/gimpcontainerview.h"
33
33
#include "widgets/gimpdatafactoryview.h"
 
34
#include "widgets/gimpdialogfactory.h"
34
35
#include "widgets/gimphelp-ids.h"
35
36
#include "widgets/gimpview.h"
36
37
 
37
 
#include "dialogs/palette-import-dialog.h"
 
38
#include "dialogs/dialogs.h"
38
39
 
 
40
#include "actions.h"
39
41
#include "palettes-commands.h"
40
42
 
41
43
#include "gimp-intl.h"
43
45
 
44
46
/*  local function prototypes  */
45
47
 
46
 
static void   palettes_merge_palettes_callback (GtkWidget   *widget,
47
 
                                                const gchar *palette_name,
48
 
                                                gpointer     data);
 
48
static void   palettes_merge_callback (GtkWidget   *widget,
 
49
                                       const gchar *palette_name,
 
50
                                       gpointer     data);
49
51
 
50
52
 
51
53
/*  public functionss */
52
54
 
53
55
void
54
 
palettes_import_palette_cmd_callback (GtkAction *action,
55
 
                                      gpointer   data)
 
56
palettes_import_cmd_callback (GtkAction *action,
 
57
                              gpointer   data)
56
58
{
57
 
  GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
58
 
  GimpContext         *context;
59
 
 
60
 
  context = gimp_container_view_get_context (editor->view);
61
 
 
62
 
  palette_import_dialog_show (context->gimp);
 
59
  GtkWidget *widget;
 
60
  return_if_no_widget (widget, data);
 
61
 
 
62
  gimp_dialog_factory_dialog_new (global_dialog_factory,
 
63
                                  gtk_widget_get_screen (widget),
 
64
                                  "gimp-palette-import-dialog", -1, TRUE);
63
65
}
64
66
 
65
67
void
66
 
palettes_merge_palettes_cmd_callback (GtkAction *action,
67
 
                                      gpointer   data)
 
68
palettes_merge_cmd_callback (GtkAction *action,
 
69
                             gpointer   data)
68
70
{
69
71
  GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
70
72
  GtkWidget           *dialog;
76
78
                                  _("Enter a name for the merged palette"),
77
79
                                  NULL,
78
80
                                  G_OBJECT (editor), "destroy",
79
 
                                  palettes_merge_palettes_callback,
 
81
                                  palettes_merge_callback,
80
82
                                  editor);
81
83
  gtk_widget_show (dialog);
82
84
}
85
87
/*  private functions  */
86
88
 
87
89
static void
88
 
palettes_merge_palettes_callback (GtkWidget   *widget,
89
 
                                  const gchar *palette_name,
90
 
                                  gpointer     data)
 
90
palettes_merge_callback (GtkWidget   *widget,
 
91
                         const gchar *palette_name,
 
92
                         gpointer     data)
91
93
{
92
94
#ifdef __GNUC__
93
 
#warning FIXME: reimplement palettes_merge_palettes_callback()
 
95
#warning FIXME: reimplement palettes_merge_callback()
94
96
#endif
95
97
#if 0
96
98
  GimpContainerEditor *editor;
105
107
 
106
108
  if (! sel_list)
107
109
    {
108
 
      g_message ("Can't merge palettes because there are no palettes selected.");
 
110
      gimp_message (gimp, G_OBJECT (widget), GIMP_MESSAGE_WARNING,
 
111
                    "Can't merge palettes because "
 
112
                    "there are no palettes selected.");
109
113
      return;
110
114
    }
111
115
 
121
125
      palette = (GimpPalette *) GIMP_VIEW (list_item->preview)->viewable;
122
126
 
123
127
      if (palette)
124
 
        {
125
 
          for (cols = palette->colors; cols; cols = g_list_next (cols))
126
 
            {
127
 
              entry = (GimpPaletteEntry *) cols->data;
 
128
        {
 
129
          for (cols = palette->colors; cols; cols = g_list_next (cols))
 
130
            {
 
131
              entry = (GimpPaletteEntry *) cols->data;
128
132
 
129
 
              gimp_palette_add_entry (new_palette,
130
 
                                      entry->name,
131
 
                                      &entry->color);
132
 
            }
133
 
        }
 
133
              gimp_palette_add_entry (new_palette,
 
134
                                      entry->name,
 
135
                                      &entry->color);
 
136
            }
 
137
        }
134
138
 
135
139
      sel_list = sel_list->next;
136
140
    }
137
141
 
138
142
  gimp_container_add (editor->view->container,
139
 
                      GIMP_OBJECT (new_palette));
 
143
                      GIMP_OBJECT (new_palette));
140
144
#endif
141
145
}