~ubuntu-branches/ubuntu/vivid/gimp/vivid

« back to all changes in this revision

Viewing changes to plug-ins/common/sinus.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach
  • Date: 2012-05-08 18:50:03 UTC
  • mto: (1.1.26) (0.5.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 71.
  • Revision ID: package-import@ubuntu.com-20120508185003-tltkvbaysf8d2426
ImportĀ upstreamĀ versionĀ 2.8.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 *
4
4
 * Copyright (C) 1997 Xavier Bouchoux
5
5
 *
6
 
 * This program is free software; you can redistribute it and/or modify
 
6
 * This program is free software: you can redistribute it and/or modify
7
7
 * it under the terms of the GNU General Public License as published by
8
 
 * the Free Software Foundation; either version 2 of the License, or
 
8
 * the Free Software Foundation; either version 3 of the License, or
9
9
 * (at your option) any later version.
10
10
 *
11
11
 * This program is distributed in the hope that it will be useful,
14
14
 * GNU General Public License for more details.
15
15
 *
16
16
 * You should have received a copy of the GNU General Public License
17
 
 * along with this program; if not, write to the Free Software
18
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
17
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
18
 *
20
19
 */
21
20
 
37
36
 
38
37
#define PLUG_IN_PROC   "plug-in-sinus"
39
38
#define PLUG_IN_BINARY "sinus"
 
39
#define PLUG_IN_ROLE   "gimp-sinus"
40
40
 
41
41
 
42
42
/*
163
163
{
164
164
  static const GimpParamDef args[] =
165
165
  {
166
 
    { GIMP_PDB_INT32,    "run-mode",    "Interactive, non-interactive" },
 
166
    { GIMP_PDB_INT32,    "run-mode",    "The run mode { RUN-INTERACTIVE (0), RUN-NONINTERACTIVE (1) }" },
167
167
    { GIMP_PDB_IMAGE,    "image",       "Input image (unused)" },
168
168
    { GIMP_PDB_DRAWABLE, "drawable",    "Input drawable" },
169
169
 
459
459
      gimp_progress_update ((double) progress / (double) max_progress);
460
460
    }
461
461
 
 
462
  gimp_progress_update (1.0);
462
463
  gimp_drawable_flush (drawable);
463
464
  gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
464
465
  gimp_drawable_update (drawable->drawable_id, x1, y1, x2 - x1, y2 - y1);
567
568
  color_button = GIMP_COLOR_BUTTON (data);
568
569
 
569
570
  gimp_color_button_get_color (GIMP_COLOR_BUTTON (color_button), &color);
570
 
  gimp_rgb_set_alpha (&color, adj->value);
 
571
  gimp_rgb_set_alpha (&color, gtk_adjustment_get_value (adj));
571
572
  gimp_color_button_set_color (GIMP_COLOR_BUTTON (color_button), &color);
572
573
}
573
574
 
645
646
 
646
647
  /* Create Main window with a vbox */
647
648
  /* ============================== */
648
 
  dlg = gimp_dialog_new (_("Sinus"), PLUG_IN_BINARY,
 
649
  dlg = gimp_dialog_new (_("Sinus"), PLUG_IN_ROLE,
649
650
                         NULL, 0,
650
651
                         gimp_standard_help_func, PLUG_IN_PROC,
651
652
 
661
662
 
662
663
  gimp_window_set_transient (GTK_WINDOW (dlg));
663
664
 
664
 
  main_hbox = gtk_hbox_new (FALSE, 12);
 
665
  main_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
665
666
  gtk_container_set_border_width (GTK_CONTAINER (main_hbox), 12);
666
 
  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), main_hbox,
667
 
                      TRUE, TRUE, 0);
 
667
  gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))),
 
668
                      main_hbox, TRUE, TRUE, 0);
668
669
  gtk_widget_show (main_hbox);
669
670
 
670
671
  /* Create preview */
671
672
  /* ============== */
672
 
  vbox = gtk_vbox_new (FALSE, 6);
 
673
  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
673
674
  gtk_box_pack_start (GTK_BOX (main_hbox), vbox, FALSE, FALSE, 0);
674
675
  gtk_widget_show (vbox);
675
676
 
684
685
 
685
686
  /* Create the drawing settings frame */
686
687
  /* ================================= */
687
 
  page = gtk_vbox_new (FALSE, 12);
 
688
  page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
688
689
  gtk_container_set_border_width (GTK_CONTAINER (page), 12);
689
690
 
690
691
  frame = gimp_frame_new (_("Drawing Settings"));
729
730
  gtk_box_pack_start (GTK_BOX (page), frame, FALSE, FALSE, 0);
730
731
  gtk_widget_show (frame);
731
732
 
732
 
  vbox = gtk_vbox_new (FALSE, 6);
 
733
  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
733
734
  gtk_container_add (GTK_CONTAINER (frame), vbox);
734
735
  gtk_widget_show (vbox);
735
736
 
774
775
 
775
776
  /* Color settings dialog: */
776
777
  /* ====================== */
777
 
  page = gtk_vbox_new (FALSE, 12);
 
778
  page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
778
779
  gtk_container_set_border_width (GTK_CONTAINER (page), 12);
779
780
 
780
781
  if (drawable_is_grayscale)
783
784
      gtk_box_pack_start(GTK_BOX(page), frame, FALSE, FALSE, 0);
784
785
      gtk_widget_show (frame);
785
786
 
786
 
      vbox = gtk_vbox_new (FALSE, 6);
 
787
      vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
787
788
      gtk_container_add (GTK_CONTAINER (frame), vbox);
788
789
      gtk_widget_show (vbox);
789
790
 
790
791
      /*if in grey scale, the colors are necessarily black and white */
791
792
      label = gtk_label_new (_("The colors are white and black."));
792
793
      gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5);
793
 
      gtk_container_add (GTK_CONTAINER (vbox), label);
 
794
      gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
794
795
      gtk_widget_show (label);
795
796
    }
796
797
  else
813
814
 
814
815
      vbox = gtk_bin_get_child (GTK_BIN (frame));
815
816
 
816
 
      hbox = gtk_hbox_new (FALSE, 12);
 
817
      hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
817
818
      gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
818
819
 
819
820
      push_col1 = gimp_color_button_new (_("First color"), 32, 32,
889
890
 
890
891
  /* blend settings dialog: */
891
892
  /* ====================== */
892
 
  page = gtk_vbox_new (FALSE, 12);
 
893
  page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
893
894
  gtk_container_set_border_width (GTK_CONTAINER (page), 12);
894
895
 
895
896
  frame = gimp_frame_new (_("Blend Settings"));
896
897
  gtk_box_pack_start (GTK_BOX (page), frame, TRUE, TRUE, 0);
897
898
  gtk_widget_show (frame);
898
899
 
899
 
  vbox = gtk_vbox_new (FALSE, 12);
 
900
  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
900
901
  gtk_container_add (GTK_CONTAINER (frame), vbox);
901
902
  gtk_widget_show (vbox);
902
903
 
916
917
 
917
918
  table = gtk_table_new (1, 3, FALSE);
918
919
  gtk_table_set_col_spacings (GTK_TABLE (table), 6);
919
 
  gtk_container_add (GTK_CONTAINER (vbox), table);
 
920
  gtk_box_pack_start (GTK_BOX (vbox), table, TRUE, TRUE, 0);
920
921
 
921
922
  adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
922
923
                              _("_Exponent:"), 0, 0,
1032
1033
  GtkWidget *vbox;
1033
1034
  GtkWidget *button;
1034
1035
 
1035
 
  vbox = gtk_vbox_new (FALSE, 6);
 
1036
  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
1036
1037
  gtk_box_pack_start (GTK_BOX (parent), vbox, FALSE, FALSE, 0);
1037
1038
  gtk_widget_show (vbox);
1038
1039