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

« back to all changes in this revision

Viewing changes to plug-ins/winsnap/winsnap.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:
46
46
 
47
47
#include "resource.h"
48
48
 
49
 
#include <gtk/gtk.h>
50
 
 
51
49
#include "libgimp/gimp.h"
52
50
#include "libgimp/gimpui.h"
 
51
 
53
52
#include "libgimp/stdplugins-intl.h"
54
53
 
55
54
/*
58
57
#define PLUG_IN_NAME        "plug_in_winsnap"
59
58
#define HELP_ID             "plug-in-winsnap"
60
59
#define PLUG_IN_PRINT_NAME  "WinSnap"
61
 
#define PLUG_IN_DESCRIPTION "Capture a Win32 window or desktop image"
62
60
#define PLUG_IN_HELP        "This plug-in will capture an image of a Win32 window or desktop"
63
61
#define PLUG_IN_AUTHOR      "Craig Setera (setera@home.com)"
64
62
#define PLUG_IN_COPYRIGHT   "Craig Setera"
134
132
};
135
133
 
136
134
/* This plug-in's functions */
137
 
GimpPlugInInfo PLUG_IN_INFO =
 
135
const GimpPlugInInfo PLUG_IN_INFO =
138
136
{
139
137
  NULL,    /* init_proc */
140
138
  NULL,    /* quit_proc */
146
144
 * DIB sections are aligned ona LONG (four byte) boundary. Its pixel
147
145
 * data is in RGB (BGR actually) format, three bytes per pixel.
148
146
 *
149
 
 * The GIMP uses no alignment for its pixel regions. The GIMP image we
 
147
 * GIMP uses no alignment for its pixel regions. The GIMP image we
150
148
 * create is of type RGB, i.e. three bytes per pixel, too. Thus in
151
149
 * order to be able to quickly transfer all of the image at a time, we
152
150
 * must use a DIB section and pixel region the scanline width in
839
837
static gboolean
840
838
snap_dialog (void)
841
839
{
842
 
  GtkWidget     *dialog;
843
 
  GtkWidget     *vbox;
844
 
  GtkWidget     *hbox;
845
 
  GtkWidget     *label;
846
 
  GtkAdjustment *adj;
847
 
  GSList        *radio_group = NULL;
848
 
  gint           radio_pressed[2];
849
 
  gint           decorations;
850
 
  gboolean       run;
 
840
  GtkWidget *dialog;
 
841
  GtkWidget *vbox;
 
842
  GtkWidget *hbox;
 
843
  GtkWidget *label;
 
844
  GtkObject *adj;
 
845
  GSList    *radio_group = NULL;
 
846
  gint       radio_pressed[2];
 
847
  gint       decorations;
 
848
  gboolean   run;
851
849
 
852
850
  /* Set defaults */
853
851
  radio_pressed[0] = (winsnapvals.root == FALSE);
867
865
 
868
866
                            NULL);
869
867
 
 
868
  gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
 
869
                                              GTK_RESPONSE_OK,
 
870
                                              GTK_RESPONSE_CANCEL,
 
871
                                              -1);
 
872
 
870
873
  vbox = gtk_vbox_new (FALSE, 12);
871
874
  gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
872
875
  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox, TRUE, TRUE, 0);
908
911
  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
909
912
  gtk_widget_show (label);
910
913
 
911
 
  adj = (GtkAdjustment *) gtk_adjustment_new ((gfloat) winsnapvals.delay,
912
 
                                              0.0, 100.0,
913
 
                                              1.0, 5.0, 0.0);
914
 
  winsnapintf.delay_spinner = gtk_spin_button_new (adj, 0, 0);
 
914
  winsnapintf.delay_spinner = gimp_spin_button_new (&adj,
 
915
                                                    winsnapvals.delay,
 
916
                                                    0.0, 100.0,
 
917
                                                    1.0, 5.0, 0.0, 0, 0);
915
918
  gtk_box_pack_start (GTK_BOX (hbox),
916
919
                      winsnapintf.delay_spinner, FALSE, FALSE, 0);
917
920
  gtk_widget_show (winsnapintf.delay_spinner);
959
962
 * Plug-in Parameter definitions
960
963
 */
961
964
#define NUMBER_IN_ARGS 3
962
 
#define IN_ARGS { GIMP_PDB_INT32,    "run_mode",  "Interactive, non-interactive" },\
 
965
#define IN_ARGS { GIMP_PDB_INT32,    "run-mode",  "Interactive, non-interactive" },\
963
966
                { GIMP_PDB_INT32,    "root",      "Root window { TRUE, FALSE }" },\
964
967
                { GIMP_PDB_INT32,    "decorations", \
965
968
                                                                        "Include Window Decorations { TRUE, FALSE }" }
977
980
static void
978
981
query(void)
979
982
{
980
 
  static GimpParamDef args[] = { IN_ARGS };
981
 
  static GimpParamDef return_vals[] = { OUT_ARGS };
 
983
  static const GimpParamDef args[] = { IN_ARGS };
 
984
  static const GimpParamDef return_vals[] = { OUT_ARGS };
982
985
 
983
986
  /* the installation of the plugin */
984
987
  gimp_install_procedure (PLUG_IN_NAME,
985
 
                          PLUG_IN_DESCRIPTION,
 
988
                          N_("Capture a window or desktop image"),
986
989
                          PLUG_IN_HELP,
987
990
                          PLUG_IN_AUTHOR,
988
991
                          PLUG_IN_COPYRIGHT,
996
999
                          return_vals);
997
1000
 
998
1001
  gimp_plugin_menu_register (PLUG_IN_NAME, "<Toolbox>/File/Acquire");
999
 
  /* gimp_plugin_menu_register (PLUG_IN_NAME, "<Image>/File/Acquire"); */
 
1002
  gimp_plugin_menu_register (PLUG_IN_NAME, "<Image>/File/Acquire");
1000
1003
}
1001
1004
 
1002
1005
/* Return values storage */