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

« back to all changes in this revision

Viewing changes to plug-ins/common/sharpen.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
1
/*
2
 
 * "$Id: sharpen.c,v 1.55 2004/12/23 23:58:35 weskaggs Exp $"
 
2
 * "$Id: sharpen.c 21494 2006-12-09 21:33:38Z neo $"
3
3
 *
4
 
 *   Sharpen filters for The GIMP -- an image manipulation program
 
4
 *   Sharpen filters for GIMP - The GNU Image Manipulation Program
5
5
 *
6
6
 *   Copyright 1997-1998 Michael Sweet (mike@easysw.com)
7
7
 *
25
25
 
26
26
#include <string.h>
27
27
 
28
 
#include <gtk/gtk.h>
29
 
 
30
28
#include <libgimp/gimp.h>
31
29
#include <libgimp/gimpui.h>
32
30
 
36
34
 * Constants...
37
35
 */
38
36
 
39
 
#define PLUG_IN_NAME    "plug_in_sharpen"
 
37
#define PLUG_IN_PROC    "plug-in-sharpen"
 
38
#define PLUG_IN_BINARY  "sharpen"
40
39
#define PLUG_IN_VERSION "1.4.2 - 3 June 1998"
41
 
#define HELP_ID         "plug-in-sharpen"
42
40
#define SCALE_WIDTH     100
43
41
 
44
42
/*
76
74
 * Globals...
77
75
 */
78
76
 
79
 
GimpPlugInInfo PLUG_IN_INFO =
 
77
const GimpPlugInInfo PLUG_IN_INFO =
80
78
{
81
79
  NULL,  /* init_proc  */
82
80
  NULL,  /* quit_proc  */
105
103
static void
106
104
query (void)
107
105
{
108
 
  static GimpParamDef   args[] =
 
106
  static const GimpParamDef   args[] =
109
107
  {
110
 
    { GIMP_PDB_INT32,    "run_mode", "Interactive, non-interactive"      },
 
108
    { GIMP_PDB_INT32,    "run-mode", "Interactive, non-interactive"      },
111
109
    { GIMP_PDB_IMAGE,    "image",    "Input image"                       },
112
110
    { GIMP_PDB_DRAWABLE, "drawable", "Input drawable"                    },
113
111
    { GIMP_PDB_INT32,    "percent",  "Percent sharpening (default = 10)" }
114
112
  };
115
113
 
116
 
  gimp_install_procedure (PLUG_IN_NAME,
117
 
                          "Sharpen filter, typically used to 'sharpen' a "
118
 
                          "photographic image.",
 
114
  gimp_install_procedure (PLUG_IN_PROC,
 
115
                          N_("Make image sharper "
 
116
                             "(less powerful than Unsharp Mask)"),
119
117
                          "This plug-in selectively performs a convolution "
120
118
                          "filter on an image.",
121
119
                          "Michael Sweet <mike@easysw.com>",
127
125
                          G_N_ELEMENTS (args), 0,
128
126
                          args, NULL);
129
127
 
130
 
  gimp_plugin_menu_register (PLUG_IN_NAME, "<Image>/Filters/Enhance");
 
128
  gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Enhance");
131
129
}
132
130
 
133
131
static void
177
175
      /*
178
176
       * Possibly retrieve data...
179
177
       */
180
 
      gimp_get_data (PLUG_IN_NAME, &sharpen_params);
 
178
      gimp_get_data (PLUG_IN_PROC, &sharpen_params);
181
179
 
182
180
      /*
183
181
       * Get information from the dialog...
200
198
      /*
201
199
       * Possibly retrieve data...
202
200
       */
203
 
      gimp_get_data (PLUG_IN_NAME, &sharpen_params);
 
201
      gimp_get_data (PLUG_IN_PROC, &sharpen_params);
204
202
      break;
205
203
 
206
204
    default:
232
230
           * Store data...
233
231
           */
234
232
          if (run_mode == GIMP_RUN_INTERACTIVE)
235
 
            gimp_set_data (PLUG_IN_NAME,
 
233
            gimp_set_data (PLUG_IN_PROC,
236
234
                           &sharpen_params, sizeof (SharpenParams));
237
235
        }
238
236
      else
308
306
  /*
309
307
   * Let the user know what we're doing...
310
308
   */
311
 
  gimp_progress_init( _("Sharpening..."));
 
309
  gimp_progress_init( _("Sharpening"));
312
310
 
313
311
  /*
314
312
   * Setup for filter...
475
473
  GtkObject *adj;
476
474
  gboolean   run;
477
475
 
478
 
  gimp_ui_init ("sharpen", TRUE);
 
476
  gimp_ui_init (PLUG_IN_BINARY, TRUE);
479
477
 
480
 
  dialog = gimp_dialog_new (_("Sharpen"), "Sharpen",
 
478
  dialog = gimp_dialog_new (_("Sharpen"), PLUG_IN_BINARY,
481
479
                            NULL, 0,
482
 
                            gimp_standard_help_func, HELP_ID,
 
480
                            gimp_standard_help_func, PLUG_IN_PROC,
483
481
 
484
482
                            GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
485
483
                            GTK_STOCK_OK,     GTK_RESPONSE_OK,
486
484
 
487
485
                            NULL);
488
486
 
 
487
  gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
 
488
                                           GTK_RESPONSE_OK,
 
489
                                           GTK_RESPONSE_CANCEL,
 
490
                                           -1);
 
491
 
 
492
  gimp_window_set_transient (GTK_WINDOW (dialog));
 
493
 
489
494
  main_vbox = gtk_vbox_new (FALSE, 12);
490
495
  gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);
491
496
  gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), main_vbox);
511
516
                              1, 99, 1, 10, 0,
512
517
                              TRUE, 0, 0,
513
518
                              NULL, NULL);
514
 
  g_signal_connect (adj, "value_changed",
 
519
  g_signal_connect (adj, "value-changed",
515
520
                    G_CALLBACK (gimp_int_adjustment_update),
516
521
                    &sharpen_params.sharpen_percent);
517
 
  g_signal_connect_swapped (adj, "value_changed",
 
522
  g_signal_connect_swapped (adj, "value-changed",
518
523
                            G_CALLBACK (gimp_preview_invalidate),
519
524
                            preview);
520
525