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

« back to all changes in this revision

Viewing changes to plug-ins/MapObject/mapobject_main.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:
36
36
#include "libgimp/stdplugins-intl.h"
37
37
 
38
38
 
 
39
#define PLUG_IN_PROC "plug-in-map-object"
 
40
 
 
41
 
39
42
/* Global variables */
40
43
/* ================ */
41
44
 
74
77
  mapvals.cylinder_radius = 0.25;
75
78
  mapvals.cylinder_length = 1.0;
76
79
 
77
 
  mapvals.preview_zoom_factor = 0;
78
 
 
 
80
  mapvals.zoom             = 1.0;
79
81
  mapvals.lightsource.type = POINT_LIGHT;
80
82
 
81
83
  mapvals.antialiasing           = TRUE;
137
139
static void
138
140
query (void)
139
141
{
140
 
  static GimpParamDef args[] =
 
142
  static const GimpParamDef args[] =
141
143
  {
142
 
    { GIMP_PDB_INT32,    "run_mode",              "Interactive (0), non-interactive (1)" },
 
144
    { GIMP_PDB_INT32,    "run-mode",              "Interactive (0), non-interactive (1)" },
143
145
    { GIMP_PDB_IMAGE,    "image",                 "Input image" },
144
146
    { GIMP_PDB_DRAWABLE, "drawable",              "Input drawable" },
145
147
    { GIMP_PDB_INT32,    "maptype",               "Type of mapping (0=plane,1=sphere,2=box,3=cylinder)" },
146
 
    { GIMP_PDB_FLOAT,    "viewpoint_x",           "Position of viewpoint (x,y,z)" },
147
 
    { GIMP_PDB_FLOAT,    "viewpoint_y",           "Position of viewpoint (x,y,z)" },
148
 
    { GIMP_PDB_FLOAT,    "viewpoint_z",           "Position of viewpoint (x,y,z)" },
149
 
    { GIMP_PDB_FLOAT,    "position_x",            "Object position (x,y,z)" },
150
 
    { GIMP_PDB_FLOAT,    "position_y",            "Object position (x,y,z)" },
151
 
    { GIMP_PDB_FLOAT,    "position_z",            "Object position (x,y,z)" },
152
 
    { GIMP_PDB_FLOAT,    "firstaxis_x",           "First axis of object [x,y,z]" },
153
 
    { GIMP_PDB_FLOAT,    "firstaxis_y",           "First axis of object [x,y,z]" },
154
 
    { GIMP_PDB_FLOAT,    "firstaxis_z",           "First axis of object [x,y,z]" },
155
 
    { GIMP_PDB_FLOAT,    "secondaxis_x",          "Second axis of object [x,y,z]" },
156
 
    { GIMP_PDB_FLOAT,    "secondaxis_y",          "Second axis of object [x,y,z]" },
157
 
    { GIMP_PDB_FLOAT,    "secondaxis_z",          "Second axis of object [x,y,z]" },
158
 
    { GIMP_PDB_FLOAT,    "rotationangle_x",       "Rotation about X axis in degrees" },
159
 
    { GIMP_PDB_FLOAT,    "rotationangle_y",       "Rotation about Y axis in degrees" },
160
 
    { GIMP_PDB_FLOAT,    "rotationangle_z",       "Rotation about Z axis in degrees" },
 
148
    { GIMP_PDB_FLOAT,    "viewpoint-x",           "Position of viewpoint (x,y,z)" },
 
149
    { GIMP_PDB_FLOAT,    "viewpoint-y",           "Position of viewpoint (x,y,z)" },
 
150
    { GIMP_PDB_FLOAT,    "viewpoint-z",           "Position of viewpoint (x,y,z)" },
 
151
    { GIMP_PDB_FLOAT,    "position-x",            "Object position (x,y,z)" },
 
152
    { GIMP_PDB_FLOAT,    "position-y",            "Object position (x,y,z)" },
 
153
    { GIMP_PDB_FLOAT,    "position-z",            "Object position (x,y,z)" },
 
154
    { GIMP_PDB_FLOAT,    "firstaxis-x",           "First axis of object [x,y,z]" },
 
155
    { GIMP_PDB_FLOAT,    "firstaxis-y",           "First axis of object [x,y,z]" },
 
156
    { GIMP_PDB_FLOAT,    "firstaxis-z",           "First axis of object [x,y,z]" },
 
157
    { GIMP_PDB_FLOAT,    "secondaxis-x",          "Second axis of object [x,y,z]" },
 
158
    { GIMP_PDB_FLOAT,    "secondaxis-y",          "Second axis of object [x,y,z]" },
 
159
    { GIMP_PDB_FLOAT,    "secondaxis-z",          "Second axis of object [x,y,z]" },
 
160
    { GIMP_PDB_FLOAT,    "rotationangle-x",       "Rotation about X axis in degrees" },
 
161
    { GIMP_PDB_FLOAT,    "rotationangle-y",       "Rotation about Y axis in degrees" },
 
162
    { GIMP_PDB_FLOAT,    "rotationangle-z",       "Rotation about Z axis in degrees" },
161
163
    { GIMP_PDB_INT32,    "lighttype",             "Type of lightsource (0=point,1=directional,3=none)" },
162
164
    { GIMP_PDB_COLOR,    "lightcolor",            "Lightsource color (r,g,b)" },
163
 
    { GIMP_PDB_FLOAT,    "lightposition_x",       "Lightsource position (x,y,z)" },
164
 
    { GIMP_PDB_FLOAT,    "lightposition_y",       "Lightsource position (x,y,z)" },
165
 
    { GIMP_PDB_FLOAT,    "lightposition_z",       "Lightsource position (x,y,z)" },
166
 
    { GIMP_PDB_FLOAT,    "lightdirection_x",      "Lightsource direction [x,y,z]" },
167
 
    { GIMP_PDB_FLOAT,    "lightdirection_y",      "Lightsource direction [x,y,z]" },
168
 
    { GIMP_PDB_FLOAT,    "lightdirection_z",      "Lightsource direction [x,y,z]" },
 
165
    { GIMP_PDB_FLOAT,    "lightposition-x",       "Lightsource position (x,y,z)" },
 
166
    { GIMP_PDB_FLOAT,    "lightposition-y",       "Lightsource position (x,y,z)" },
 
167
    { GIMP_PDB_FLOAT,    "lightposition-z",       "Lightsource position (x,y,z)" },
 
168
    { GIMP_PDB_FLOAT,    "lightdirection-x",      "Lightsource direction [x,y,z]" },
 
169
    { GIMP_PDB_FLOAT,    "lightdirection-y",      "Lightsource direction [x,y,z]" },
 
170
    { GIMP_PDB_FLOAT,    "lightdirection-z",      "Lightsource direction [x,y,z]" },
169
171
    { GIMP_PDB_FLOAT,    "ambient_intensity",     "Material ambient intensity (0..1)" },
170
172
    { GIMP_PDB_FLOAT,    "diffuse_intensity",     "Material diffuse intensity (0..1)" },
171
173
    { GIMP_PDB_FLOAT,    "diffuse_reflectivity",  "Material diffuse reflectivity (0..1)" },
176
178
    { GIMP_PDB_INT32,    "newimage",              "Create a new image (TRUE/FALSE)" },
177
179
    { GIMP_PDB_INT32,    "transparentbackground", "Make background transparent (TRUE/FALSE)" },
178
180
    { GIMP_PDB_FLOAT,    "radius",                "Sphere/cylinder radius (only used when maptype=1 or 3)" },
179
 
    { GIMP_PDB_FLOAT,    "x_scale",               "Box x size (0..->)" },
180
 
    { GIMP_PDB_FLOAT,    "y_scale",               "Box y size (0..->)" },
181
 
    { GIMP_PDB_FLOAT,    "z_scale",               "Box z size (0..->)"},
182
 
    { GIMP_PDB_FLOAT,    "cylinder_length",       "Cylinder length (0..->)"},
183
 
    { GIMP_PDB_DRAWABLE, "box_front_drawable",    "Box front face (set these to -1 if not used)" },
184
 
    { GIMP_PDB_DRAWABLE, "box_back_drawable",     "Box back face" },
185
 
    { GIMP_PDB_DRAWABLE, "box_top_drawable",      "Box top face" },
186
 
    { GIMP_PDB_DRAWABLE, "box_bottom_drawable",   "Box bottom face" },
187
 
    { GIMP_PDB_DRAWABLE, "box_left_drawable",     "Box left face" },
188
 
    { GIMP_PDB_DRAWABLE, "box_right_drawable",    "Box right face" },
189
 
    { GIMP_PDB_DRAWABLE, "cyl_top_drawable",      "Cylinder top face (set these to -1 if not used)" },
190
 
    { GIMP_PDB_DRAWABLE, "cyl_bottom_drawable",   "Cylinder bottom face" }
 
181
    { GIMP_PDB_FLOAT,    "x-scale",               "Box x size (0..->)" },
 
182
    { GIMP_PDB_FLOAT,    "y-scale",               "Box y size (0..->)" },
 
183
    { GIMP_PDB_FLOAT,    "z-scale",               "Box z size (0..->)"},
 
184
    { GIMP_PDB_FLOAT,    "cylinder-length",       "Cylinder length (0..->)"},
 
185
    { GIMP_PDB_DRAWABLE, "box-front-drawable",    "Box front face (set these to -1 if not used)" },
 
186
    { GIMP_PDB_DRAWABLE, "box-back-drawable",     "Box back face" },
 
187
    { GIMP_PDB_DRAWABLE, "box-top-drawable",      "Box top face" },
 
188
    { GIMP_PDB_DRAWABLE, "box-bottom-drawable",   "Box bottom face" },
 
189
    { GIMP_PDB_DRAWABLE, "box-left-drawable",     "Box left face" },
 
190
    { GIMP_PDB_DRAWABLE, "box-right-drawable",    "Box right face" },
 
191
    { GIMP_PDB_DRAWABLE, "cyl-top-drawable",      "Cylinder top face (set these to -1 if not used)" },
 
192
    { GIMP_PDB_DRAWABLE, "cyl-bottom-drawable",   "Cylinder bottom face" }
191
193
  };
192
194
 
193
 
  gimp_install_procedure ("plug_in_map_object",
194
 
                          "Maps a picture to a object (plane, sphere, box or cylinder)",
 
195
  gimp_install_procedure (PLUG_IN_PROC,
 
196
                          N_("Map the image to an object (plane, sphere, box or cylinder)"),
195
197
                          "No help yet",
196
198
                          "Tom Bech & Federico Mena Quintero",
197
199
                          "Tom Bech & Federico Mena Quintero",
202
204
                          G_N_ELEMENTS (args), 0,
203
205
                          args, NULL);
204
206
 
205
 
  gimp_plugin_menu_register ("plug_in_map_object", "<Image>/Filters/Map");
 
207
  gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Map");
206
208
}
207
209
 
208
210
static void
251
253
          {
252
254
            compute_image ();
253
255
 
254
 
            gimp_set_data ("plug_in_map_object",
255
 
                           &mapvals, sizeof (MapObjectValues));
 
256
            gimp_set_data (PLUG_IN_PROC, &mapvals, sizeof (MapObjectValues));
256
257
          }
257
258
        break;
258
259
 
259
260
      case GIMP_RUN_WITH_LAST_VALS:
260
 
        gimp_get_data ("plug_in_map_object", &mapvals);
 
261
        gimp_get_data (PLUG_IN_PROC, &mapvals);
261
262
        check_drawables (drawable);
262
263
        image_setup (drawable, FALSE);
263
264
        compute_image ();
331
332
  gimp_drawable_detach (drawable);
332
333
}
333
334
 
334
 
GimpPlugInInfo PLUG_IN_INFO =
 
335
const GimpPlugInInfo PLUG_IN_INFO =
335
336
{
336
337
  NULL,  /* init_proc  */
337
338
  NULL,  /* quit_proc  */