~ubuntu-branches/ubuntu/saucy/gimp/saucy

« back to all changes in this revision

Viewing changes to plug-ins/file-ico/ico-dialog.c

  • Committer: Package Import Robot
  • Author(s): Micah Gersten
  • Date: 2012-05-20 19:21:01 UTC
  • mfrom: (1.1.26) (0.4.16 sid)
  • Revision ID: package-import@ubuntu.com-20120520192101-bs7zetx8ffoq2nfv
Tags: 2.8.0-2ubuntu1
* Merge from Debian unstable (LP: #908472). Remaining Changes:
  - debian/patches/02_help-message.patch,
    debian/patches/03_gimp.desktop.in.in.patch:
    + Update some strings for Ubuntu
  - debian/control:
    + Update description
  - debian/rules:
    + Set gettext domain and update translation templates
* Drop the following patches that were applied upstream:
  - debian/patches/ghost-cursor.patch: fix Wacom tablet cursor events
  - debian/patches/embed-page-setup-dialog.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 * GIMP Plug-in for Windows Icon files.
5
5
 * Copyright (C) 2002 Christian Kreibich <christian@whoop.org>.
6
6
 *
7
 
 * This program is free software; you can redistribute it and/or modify
 
7
 * This program is free software: you can redistribute it and/or modify
8
8
 * it under the terms of the GNU General Public License as published by
9
 
 * the Free Software Foundation; either version 2 of the License, or
 
9
 * the Free Software Foundation; either version 3 of the License, or
10
10
 * (at your option) any later version.
11
11
 *
12
12
 * This program is distributed in the hope that it will be useful,
15
15
 * GNU General Public License for more details.
16
16
 *
17
17
 * You should have received a copy of the GNU General Public License
18
 
 * along with this program; if not, write to the Free Software
19
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
19
 */
21
20
 
22
21
 
51
50
  GtkWidget *scrolledwindow;
52
51
  GtkWidget *warning;
53
52
 
54
 
  dialog = gimp_dialog_new (_("Save as Windows Icon"), PLUG_IN_BINARY,
55
 
                            NULL, 0,
56
 
                            gimp_standard_help_func, "plug-in-winicon",
57
 
 
58
 
                            GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
59
 
                            GTK_STOCK_SAVE,   GTK_RESPONSE_OK,
60
 
 
61
 
                            NULL);
62
 
 
63
 
  gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
64
 
                                           GTK_RESPONSE_OK,
65
 
                                           GTK_RESPONSE_CANCEL,
66
 
                                           -1);
67
 
 
68
 
  gimp_window_set_transient (GTK_WINDOW (dialog));
 
53
  dialog = gimp_export_dialog_new (_("Windows Icon"),
 
54
                                   PLUG_IN_BINARY,
 
55
                                   "plug-in-winicon");
69
56
 
70
57
  /* We store an array that holds each icon's requested bit depth
71
58
     with the dialog. It's queried when the dialog is closed so the
77
64
 
78
65
  g_object_set_data (G_OBJECT (dialog), "save_info", info);
79
66
 
80
 
  main_vbox = gtk_vbox_new (FALSE, 12);
 
67
  main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
81
68
  gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);
82
 
  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), main_vbox,
83
 
                      TRUE, TRUE, 0);
 
69
  gtk_box_pack_start (GTK_BOX (gimp_export_dialog_get_content_area (dialog)),
 
70
                      main_vbox, TRUE, TRUE, 0);
84
71
  gtk_widget_show (main_vbox);
85
72
 
86
73
  frame = gimp_frame_new (_("Icon Details"));
93
80
  gtk_container_add (GTK_CONTAINER (frame), scrolledwindow);
94
81
  gtk_widget_show (scrolledwindow);
95
82
 
96
 
  vbox = gtk_vbox_new (FALSE, 6);
 
83
  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
97
84
  gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
98
85
  g_object_set_data (G_OBJECT (dialog), "icons_vbox", vbox);
99
86
  gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolledwindow),
148
135
  GtkWidget *combo;
149
136
  GtkWidget *checkbox;
150
137
 
151
 
  hbox = gtk_hbox_new (FALSE, 6);
 
138
  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
152
139
 
153
140
  alignment = gtk_alignment_new (1.0, 0.5, 0, 0);
154
141
  gtk_box_pack_start (GTK_BOX (hbox), alignment, FALSE, FALSE, 0);
171
158
 
172
159
  gtk_size_group_add_widget (size, alignment);
173
160
 
174
 
  vbox = gtk_vbox_new (FALSE, 2);
 
161
  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
175
162
  gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
176
163
  gtk_widget_show (vbox);
177
164
 
257
244
      guchar       *cmap;
258
245
      gint          num_colors;
259
246
 
260
 
      image = gimp_drawable_get_image (layer);
 
247
      image = gimp_item_get_image (layer);
261
248
 
262
249
      tmp_image = gimp_image_new (w, h, gimp_image_base_type (image));
263
250
      gimp_image_undo_disable (tmp_image);
272
259
      tmp_layer = gimp_layer_new (tmp_image, "temporary", w, h,
273
260
                                  gimp_drawable_type (layer),
274
261
                                  100, GIMP_NORMAL_MODE);
275
 
      gimp_image_add_layer (tmp_image, tmp_layer, 0);
 
262
      gimp_image_insert_layer (tmp_image, tmp_layer, -1, 0);
276
263
 
277
264
      drawable = gimp_drawable_get (layer);
278
265
      tmp      = gimp_drawable_get (tmp_layer);
350
337
      GimpParam    *return_vals;
351
338
      gint          n_return_vals;
352
339
 
353
 
      image = gimp_drawable_get_image (layer);
 
340
      image = gimp_item_get_image (layer);
354
341
 
355
342
      tmp_image = gimp_image_new (w, h, gimp_image_base_type (image));
356
343
      gimp_image_undo_disable (tmp_image);
368
355
      tmp_layer = gimp_layer_new (tmp_image, "temporary", w, h,
369
356
                                  gimp_drawable_type (layer),
370
357
                                  100, GIMP_NORMAL_MODE);
371
 
      gimp_image_add_layer (tmp_image, tmp_layer, 0);
 
358
      gimp_image_insert_layer (tmp_image, tmp_layer, -1, 0);
372
359
 
373
360
      drawable = gimp_drawable_get (layer);
374
361
      tmp      = gimp_drawable_get (tmp_layer);
498
485
 
499
486
  for (i = 0; i < info->num_icons; i++)
500
487
    {
501
 
      if (gimp_drawable_width (info->layers[i]) > 255
502
 
          || gimp_drawable_height (info->layers[i]) > 255
503
 
          || info->compress[i])
 
488
      if (gimp_drawable_width (info->layers[i]) > 255  ||
 
489
          gimp_drawable_height (info->layers[i]) > 255 ||
 
490
          info->compress[i])
504
491
        {
505
492
          warn = TRUE;
506
493
          break;
509
496
 
510
497
  warning = g_object_get_data (G_OBJECT (dialog), "warning");
511
498
 
512
 
  if (warn)
513
 
    gtk_widget_show (warning);
514
 
  else
515
 
    gtk_widget_hide (warning);
 
499
  gtk_widget_set_visible (warning, warn);
516
500
}