mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-21 03:52:33 +00:00
5d01581069
2004-11-13 Manish Singh <yosh@gimp.org> Fix a bunch of warnings from Sparse: * app/actions/dockable-commands.c * app/actions/layers-actions.c * app/actions/view-commands.c * app/base/pixel-surround.c * app/config/gimpconfig-utils.c * app/config/gimpscanner.c * app/core/gimpbrushgenerated.c * app/core/gimpcontainer.c * app/core/gimpimage.c * app/dialogs/palette-import-dialog.c * app/file/gimprecentlist.c * app/plug-in/plug-in-params.c * app/text/gimptext-compat.c * app/text/gimptext-parasite.c * app/vectors/gimpbezierstroke.c * app/vectors/gimpstroke.c * app/widgets/gimpcellrendereraccel.c * app/widgets/gimpselectiondata.c * app/xcf/xcf.c * libgimp/gimp.c * libgimpthumb/gimpthumb-utils.c * libgimpthumb/gimpthumbnail.c * modules/cdisplay_proof.c * plug-ins/Lighting/lighting_ui.c * plug-ins/common/csource.c * plug-ins/common/glasstile.c * plug-ins/common/nova.c * plug-ins/common/pcx.c * plug-ins/common/pnm.c * plug-ins/common/randomize.c * plug-ins/common/screenshot.c * plug-ins/common/sel_gauss.c * plug-ins/common/spheredesigner.c * plug-ins/common/wind.c * plug-ins/gfig/gfig-dialog.c * plug-ins/gfig/gfig-dobject.c * plug-ins/gimpressionist/gimpressionist.c * plug-ins/ifscompose/ifscompose.c * plug-ins/print/gimp_main_window.c * plug-ins/print/print.c: Cleanup integer vs. pointer confusion. * app/base/temp-buf.c * app/dialogs/about-dialog.c * plug-ins/common/bumpmap.c * plug-ins/common/jigsaw.c * plug-ins/gfig/gfig-dobject.c: Cosmetic cleanups. * app/config/gimpconfig-deserialize.c * app/config/gimpconfig-path.c * app/config/gimpconfigwriter.c * app/core/gimpgradient.c * app/tools/gimpdrawtool.c * plug-ins/common/nlfilt.c * plug-ins/common/unsharp.c * plug-ins/common/zealouscrop.c: Define inline functions before they are used. * app/core/gimpdrawable-blend.c: PixelRegion definition was changed some time ago, but the initialization here didn't change. Fix it. * app/plug-in/plug-in-rc.c (plug_in_extra_deserialize): No need to assign token twice in a row. * libgimpbase/gimpdatafiles.c (gimp_datafiles_read_directories): No need to initialize file_data, since the code fills out all the fields. * plug-ins/common/CML_explorer.c * plug-ins/common/vpropagate.c: Declare function pointers fully. * plug-ins/common/grid.c (pix_composite): G_INLINE_FUNC isn't needed, we assume we can use the "inline" keyword always. * plug-ins/common/psd_save.c * plug-ins/common/vinvert.c * plug-ins/gfig/gfig-arc.c * plug-ins/gfig/gfig-bezier.c * plug-ins/gfig/gfig-circle.c * plug-ins/gfig/gfig-dialog.c * plug-ins/gfig/gfig-dobject.c * plug-ins/gfig/gfig-ellipse.c * plug-ins/gfig/gfig-line.c * plug-ins/gfig/gfig-poly.c * plug-ins/gfig/gfig-spiral.c * plug-ins/gfig/gfig-star.c * plug-ins/gfig/gfig.c * plug-ins/gimpressionist/orientmap.c * plug-ins/gimpressionist/placement.c * plug-ins/gimpressionist/sizemap.c * plug-ins/imagemap/imap_grid.c * plug-ins/imagemap/imap_main.c * plug-ins/imagemap/imap_preferences.c * plug-ins/imagemap/imap_settings.c * plug-ins/maze/maze.c * plug-ins/sel2path/curve.c * plug-ins/sel2path/fit.c * plug-ins/sel2path/pxl-outline.c * plug-ins/sel2path/spline.c * plug-ins/xjt/xjt.c: Functions with no args should be declared with (void). * plug-ins/common/retinex.c (MSRCR): Initialize max_preview to quiet the compiler.
113 lines
3.4 KiB
C
113 lines
3.4 KiB
C
#include "config.h"
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include <libgimp/gimp.h>
|
|
#include <libgimp/gimpui.h>
|
|
|
|
#include "gimpressionist.h"
|
|
#include "placement.h"
|
|
|
|
#include "libgimp/stdplugins-intl.h"
|
|
|
|
|
|
#define NUM_PLACE_RADIO 2
|
|
|
|
static GtkWidget *placement_radio[NUM_PLACE_RADIO];
|
|
static GtkWidget *placement_center = NULL;
|
|
static GtkObject *brush_density_adjust = NULL;
|
|
|
|
void
|
|
place_restore (void)
|
|
{
|
|
gtk_toggle_button_set_active
|
|
(GTK_TOGGLE_BUTTON (placement_radio[pcvals.place_type]), TRUE);
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (placement_center),
|
|
pcvals.placement_center);
|
|
gtk_adjustment_set_value (GTK_ADJUSTMENT (brush_density_adjust),
|
|
pcvals.brush_density);
|
|
}
|
|
|
|
int
|
|
place_type_input (int in)
|
|
{
|
|
return CLAMP_UP_TO (in, NUM_PLACE_RADIO);
|
|
}
|
|
|
|
void
|
|
place_store (void)
|
|
{
|
|
pcvals.placement_center = GTK_TOGGLE_BUTTON (placement_center)->active;
|
|
}
|
|
|
|
void
|
|
create_placementpage (GtkNotebook *notebook)
|
|
{
|
|
GtkWidget *vbox;
|
|
GtkWidget *label, *tmpw, *table, *frame;
|
|
|
|
label = gtk_label_new_with_mnemonic (_("Pl_acement"));
|
|
|
|
vbox = gtk_vbox_new (FALSE, 12);
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
|
|
gtk_widget_show (vbox);
|
|
|
|
frame = gimp_int_radio_group_new (TRUE, _("Placement"),
|
|
G_CALLBACK (gimp_radio_button_update),
|
|
&pcvals.place_type, 0,
|
|
|
|
_("Randomly"),
|
|
PLACEMENT_TYPE_RANDOM,
|
|
&placement_radio[PLACEMENT_TYPE_RANDOM],
|
|
|
|
_("Evenly distributed"),
|
|
PLACEMENT_TYPE_EVEN_DIST,
|
|
&placement_radio[PLACEMENT_TYPE_EVEN_DIST],
|
|
|
|
NULL);
|
|
|
|
gimp_help_set_help_data
|
|
(placement_radio[PLACEMENT_TYPE_RANDOM],
|
|
_("Place strokes randomly around the image"),
|
|
NULL);
|
|
gimp_help_set_help_data
|
|
(placement_radio[PLACEMENT_TYPE_EVEN_DIST],
|
|
_("The strokes are evenly distributed across the image"),
|
|
NULL);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
|
gtk_widget_show (frame);
|
|
|
|
gtk_toggle_button_set_active
|
|
(GTK_TOGGLE_BUTTON (placement_radio[pcvals.place_type]), TRUE);
|
|
|
|
table = gtk_table_new (1, 3, FALSE);
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
|
|
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
|
|
gtk_widget_show (table);
|
|
|
|
brush_density_adjust =
|
|
gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
|
_("Stroke _density:"),
|
|
100, -1, pcvals.brush_density,
|
|
1.0, 50.0, 1.0, 5.0, 0,
|
|
TRUE, 0, 0,
|
|
_("The relative density of the brush strokes"),
|
|
NULL);
|
|
g_signal_connect (brush_density_adjust, "value_changed",
|
|
G_CALLBACK (gimp_double_adjustment_update),
|
|
&pcvals.brush_density);
|
|
|
|
placement_center = gtk_check_button_new_with_mnemonic ( _("Centerize"));
|
|
tmpw = placement_center;
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), tmpw, FALSE, FALSE, 0);
|
|
gtk_widget_show (tmpw);
|
|
gimp_help_set_help_data
|
|
(tmpw, _("Focus the brush strokes around the center of the image"), NULL);
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tmpw),
|
|
pcvals.placement_center);
|
|
|
|
gtk_notebook_append_page_menu (notebook, vbox, label, NULL);
|
|
}
|