normalized the identifiers in placement.c.

* plug-ins/gimpressionist/: normalized the identifiers in placement.c.
This commit is contained in:
Shlomi Fish
2004-07-21 13:48:13 +00:00
parent 7c7879b669
commit 59179c2dd9
5 changed files with 26 additions and 21 deletions

View File

@ -1,3 +1,8 @@
2004-07-21 Shlomi Fish <shlomif@iglu.org.il>
* plug-ins/gimpressionist/: normalized the identifiers in
placement.c.
2004-07-21 Michael Natterer <mitch@gimp.org> 2004-07-21 Michael Natterer <mitch@gimp.org>
* app/actions/context-actions.c: changed names of actions which * app/actions/context-actions.c: changed names of actions which

View File

@ -61,7 +61,7 @@ typedef struct
int placetype; int placetype;
vector_t orientvector[MAXORIENTVECT]; vector_t orientvector[MAXORIENTVECT];
int numorientvector; int numorientvector;
int placecenter; int placement_center;
double brushaspect; double brushaspect;
double orientangoff; double orientangoff;
double orientstrexp; double orientstrexp;

View File

@ -11,22 +11,22 @@
#include "libgimp/stdplugins-intl.h" #include "libgimp/stdplugins-intl.h"
#define NUMPLACERADIO 2 #define NUM_PLACE_RADIO 2
static GtkWidget *placeradio[NUMPLACERADIO]; static GtkWidget *placement_radio[NUM_PLACE_RADIO];
static GtkWidget *placecenter = NULL; static GtkWidget *placement_center = NULL;
static GtkObject *brushdensityadjust = NULL; static GtkObject *brush_density_adjust = NULL;
void place_restore() void place_restore()
{ {
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(placeradio[pcvals.placetype]), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (placement_radio[pcvals.placetype]), TRUE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(placecenter), pcvals.placecenter); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (placement_center), pcvals.placement_center);
gtk_adjustment_set_value (GTK_ADJUSTMENT(brushdensityadjust), pcvals.brushdensity); gtk_adjustment_set_value (GTK_ADJUSTMENT (brush_density_adjust), pcvals.brushdensity);
} }
void place_store() void place_store()
{ {
pcvals.placecenter = GTK_TOGGLE_BUTTON(placecenter)->active; pcvals.placement_center = GTK_TOGGLE_BUTTON (placement_center)->active;
} }
void create_placementpage(GtkNotebook *notebook) void create_placementpage(GtkNotebook *notebook)
@ -45,31 +45,31 @@ void create_placementpage(GtkNotebook *notebook)
&pcvals.placetype, 0, &pcvals.placetype, 0,
_("Randomly"), PLACEMENT_TYPE_RANDOM, _("Randomly"), PLACEMENT_TYPE_RANDOM,
&placeradio[PLACEMENT_TYPE_RANDOM], &placement_radio[PLACEMENT_TYPE_RANDOM],
_("Evenly distributed"), PLACEMENT_TYPE_EVEN_DIST, _("Evenly distributed"), PLACEMENT_TYPE_EVEN_DIST,
&placeradio[PLACEMENT_TYPE_EVEN_DIST], &placement_radio[PLACEMENT_TYPE_EVEN_DIST],
NULL); NULL);
gimp_help_set_help_data gimp_help_set_help_data
(placeradio[PLACEMENT_TYPE_RANDOM], (placement_radio[PLACEMENT_TYPE_RANDOM],
_("Place strokes randomly around the image"), NULL); _("Place strokes randomly around the image"), NULL);
gimp_help_set_help_data gimp_help_set_help_data
(placeradio[PLACEMENT_TYPE_EVEN_DIST], (placement_radio[PLACEMENT_TYPE_EVEN_DIST],
_("The strokes are evenly distributed across the image"), _("The strokes are evenly distributed across the image"),
NULL); NULL);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame); gtk_widget_show (frame);
gtk_toggle_button_set_active gtk_toggle_button_set_active
(GTK_TOGGLE_BUTTON (placeradio[pcvals.placetype]), TRUE); (GTK_TOGGLE_BUTTON (placement_radio[pcvals.placetype]), TRUE);
table = gtk_table_new (1, 3, FALSE); table = gtk_table_new (1, 3, FALSE);
gtk_table_set_col_spacings (GTK_TABLE(table), 6); gtk_table_set_col_spacings (GTK_TABLE(table), 6);
gtk_box_pack_start(GTK_BOX (vbox), table, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX (vbox), table, FALSE, FALSE, 0);
gtk_widget_show (table); gtk_widget_show (table);
brushdensityadjust = brush_density_adjust =
gimp_scale_entry_new (GTK_TABLE(table), 0, 0, gimp_scale_entry_new (GTK_TABLE(table), 0, 0,
_("Stroke _density:"), _("Stroke _density:"),
100, -1, pcvals.brushdensity, 100, -1, pcvals.brushdensity,
@ -77,16 +77,16 @@ void create_placementpage(GtkNotebook *notebook)
TRUE, 0, 0, TRUE, 0, 0,
_("The relative density of the brush strokes"), _("The relative density of the brush strokes"),
NULL); NULL);
g_signal_connect (brushdensityadjust, "value_changed", g_signal_connect (brush_density_adjust, "value_changed",
G_CALLBACK (gimp_double_adjustment_update), G_CALLBACK (gimp_double_adjustment_update),
&pcvals.brushdensity); &pcvals.brushdensity);
placecenter = tmpw = gtk_check_button_new_with_mnemonic( _("Centerize")); placement_center = tmpw = gtk_check_button_new_with_mnemonic( _("Centerize"));
gtk_box_pack_start(GTK_BOX (vbox), tmpw, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX (vbox), tmpw, FALSE, FALSE, 0);
gtk_widget_show (tmpw); gtk_widget_show (tmpw);
gimp_help_set_help_data gimp_help_set_help_data
(tmpw, _("Focus the brush strokes around the center of the image"), NULL); (tmpw, _("Focus the brush strokes around the center of the image"), NULL);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(tmpw), pcvals.placecenter); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(tmpw), pcvals.placement_center);
gtk_notebook_append_page_menu (notebook, vbox, label, NULL); gtk_notebook_append_page_menu (notebook, vbox, label, NULL);
} }

View File

@ -354,7 +354,7 @@ static void set_values (const gchar *key, const gchar *val)
else if(!strcmp(key, "placetype")) else if(!strcmp(key, "placetype"))
pcvals.placetype = atoi(val); pcvals.placetype = atoi(val);
else if(!strcmp(key, "placecenter")) else if(!strcmp(key, "placecenter"))
pcvals.placecenter = atoi(val); pcvals.placement_center = atoi(val);
else if(!strcmp(key, "selectedbrush")) else if(!strcmp(key, "selectedbrush"))
g_strlcpy (pcvals.selectedbrush, val, sizeof (pcvals.selectedbrush)); g_strlcpy (pcvals.selectedbrush, val, sizeof (pcvals.selectedbrush));
@ -735,7 +735,7 @@ static void save_preset(void)
fprintf(f, "color=%02x%02x%02x\n", color[0], color[1], color[2]); fprintf(f, "color=%02x%02x%02x\n", color[0], color[1], color[2]);
fprintf(f, "placetype=%d\n", pcvals.placetype); fprintf(f, "placetype=%d\n", pcvals.placetype);
fprintf(f, "placecenter=%d\n", pcvals.placecenter); fprintf(f, "placecenter=%d\n", pcvals.placement_center);
fprintf(f, "numorientvector=%d\n", pcvals.numorientvector); fprintf(f, "numorientvector=%d\n", pcvals.numorientvector);
for(i = 0; i < pcvals.numorientvector; i++) for(i = 0; i < pcvals.numorientvector; i++)

View File

@ -661,7 +661,7 @@ void repaint(ppm_t *p, ppm_t *a)
tx = xpos[i-1]; tx = xpos[i-1];
ty = ypos[i-1]; ty = ypos[i-1];
} }
if(runningvals.placecenter) { if(runningvals.placement_center) {
double z = g_rand_double_range (random_generator, 0, 0.75); double z = g_rand_double_range (random_generator, 0, 0.75);
tx = tx * (1.0-z) + tmp.width/2 * z; tx = tx * (1.0-z) + tmp.width/2 * z;
ty = ty * (1.0-z) + tmp.height/2 * z; ty = ty * (1.0-z) + tmp.height/2 * z;