[gimp/soc-2011-seamless-clone2] app: build the foreground select tool again, minus the calls to SIOX



commit eb5d735e298d7bc2f318e4d263a859c60cdc502c
Author: Michael Natterer <mitch gimp org>
Date:   Tue Apr 30 00:04:28 2013 +0200

    app: build the foreground select tool again, minus the calls to SIOX
    
    the interaction is completely there again, it just doesn't nothing
    fancy with the mask :)

 app/tools/gimp-tools.c                  |    2 +-
 app/tools/gimpforegroundselectoptions.c |   14 ++++++++++----
 app/tools/gimpforegroundselectoptions.h |    4 ----
 app/tools/gimpforegroundselecttool.c    |   17 +++++++++++++----
 app/tools/gimpforegroundselecttool.h    |   15 +++++++++++----
 5 files changed, 35 insertions(+), 17 deletions(-)
---
diff --git a/app/tools/gimp-tools.c b/app/tools/gimp-tools.c
index 39c82c2..316241e 100644
--- a/app/tools/gimp-tools.c
+++ b/app/tools/gimp-tools.c
@@ -176,8 +176,8 @@ gimp_tools_init (Gimp *gimp)
 
     /*  selection tools */
 
-#if 0
     gimp_foreground_select_tool_register,
+#if 0
     gimp_iscissors_tool_register,
 #endif
     gimp_by_color_select_tool_register,
diff --git a/app/tools/gimpforegroundselectoptions.c b/app/tools/gimpforegroundselectoptions.c
index 7449948..474da98 100644
--- a/app/tools/gimpforegroundselectoptions.c
+++ b/app/tools/gimpforegroundselectoptions.c
@@ -15,8 +15,6 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#if 0
-
 #include "config.h"
 
 #include <gegl.h>
@@ -28,7 +26,9 @@
 
 #include "tools-types.h"
 
+#if 0
 #include "base/siox.h"
+#endif
 
 #include "widgets/gimpwidgets-utils.h"
 
@@ -102,6 +102,7 @@ gimp_foreground_select_options_class_init (GimpForegroundSelectOptionsClass *kla
                                 1, 80, 18,
                                 GIMP_PARAM_STATIC_STRINGS);
 
+#if 0
   GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_SMOOTHNESS,
                                 "smoothness",
                                 N_("Smaller values give a more accurate "
@@ -109,6 +110,7 @@ gimp_foreground_select_options_class_init (GimpForegroundSelectOptionsClass *kla
                                   "in the selection"),
                                 0, 8, SIOX_DEFAULT_SMOOTHNESS,
                                 GIMP_PARAM_STATIC_STRINGS);
+#endif
 
   GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_MASK_COLOR,
                                  "mask-color",
@@ -122,6 +124,7 @@ gimp_foreground_select_options_class_init (GimpForegroundSelectOptionsClass *kla
                                     FALSE,
                                     0);
 
+#if 0
   GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_SENSITIVITY_L,
                                    "sensitivity-l",
                                    N_("Sensitivity for brightness component"),
@@ -139,6 +142,7 @@ gimp_foreground_select_options_class_init (GimpForegroundSelectOptionsClass *kla
                                    N_("Sensitivity for yellow/blue component"),
                                    0.0, 10.0, SIOX_DEFAULT_SENSITIVITY_B,
                                    GIMP_PARAM_STATIC_STRINGS);
+#endif
 }
 
 static void
@@ -335,10 +339,12 @@ gimp_foreground_select_options_gui (GimpToolOptions *tool_options)
   gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
   gtk_widget_show (table);
 
+#if 0
   scale = gimp_prop_hscale_new (config, "smoothness", 0.1, 1.0, 0);
   gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_RIGHT);
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
                              _("Smoothing:"), 0.0, 0.5, scale, 2, FALSE);
+#endif
 
   /*  mask color */
   menu = gimp_prop_enum_combo_box_new (config, "mask-color",
@@ -346,6 +352,7 @@ gimp_foreground_select_options_gui (GimpToolOptions *tool_options)
   gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
                              _("Preview color:"), 0.0, 0.5, menu, 2, FALSE);
 
+#if 0
   /*  granularity  */
   frame = gimp_prop_expander_new (config, "expanded", _("Color Sensitivity"));
   gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
@@ -369,6 +376,7 @@ gimp_foreground_select_options_gui (GimpToolOptions *tool_options)
 
   gimp_prop_opacity_entry_new (config, "sensitivity-b",
                                GTK_TABLE (table), 0, row++, "b");
+#endif
 
   return vbox;
 }
@@ -399,5 +407,3 @@ gimp_foreground_select_options_get_mask_color (GimpForegroundSelectOptions *opti
       break;
     }
 }
-
-#endif
diff --git a/app/tools/gimpforegroundselectoptions.h b/app/tools/gimpforegroundselectoptions.h
index ab16de1..5423898 100644
--- a/app/tools/gimpforegroundselectoptions.h
+++ b/app/tools/gimpforegroundselectoptions.h
@@ -15,8 +15,6 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#if 0
-
 #ifndef __GIMP_FOREGROUND_SELECT_OPTIONS_H__
 #define __GIMP_FOREGROUND_SELECT_OPTIONS_H__
 
@@ -58,5 +56,3 @@ void        gimp_foreground_select_options_get_mask_color (GimpForegroundSelectO
 
 
 #endif /* __GIMP_FOREGROUND_SELECT_OPTIONS_H__ */
-
-#endif
diff --git a/app/tools/gimpforegroundselecttool.c b/app/tools/gimpforegroundselecttool.c
index 281132b..2d1792e 100644
--- a/app/tools/gimpforegroundselecttool.c
+++ b/app/tools/gimpforegroundselecttool.c
@@ -18,8 +18,6 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#if 0
-
 #include "config.h"
 
 #include <string.h>
@@ -225,8 +223,10 @@ gimp_foreground_select_tool_finalize (GObject *object)
   if (fg_select->strokes)
     g_warning ("%s: strokes should be NULL at this point", G_STRLOC);
 
+#if 0
   if (fg_select->state)
     g_warning ("%s: state should be NULL at this point", G_STRLOC);
+#endif
 
   if (fg_select->mask)
     g_warning ("%s: mask should be NULL at this point", G_STRLOC);
@@ -264,11 +264,13 @@ gimp_foreground_select_tool_control (GimpTool       *tool,
         g_list_free (fg_select->strokes);
         fg_select->strokes = NULL;
 
+#if 0
         if (fg_select->state)
           {
             gimp_drawable_foreground_extract_siox_done (fg_select->state);
             fg_select->state = NULL;
           }
+#endif
 
         tool->display = NULL;
       }
@@ -376,7 +378,10 @@ gimp_foreground_select_tool_key_press (GimpTool    *tool,
   if (display != tool->display)
     return FALSE;
 
+#if 0
   if (fg_select->state)
+#endif
+  if (fg_select->mask) /* dunno if that's the right condition */
     {
       switch (kevent->keyval)
         {
@@ -650,6 +655,7 @@ gimp_foreground_select_tool_select (GimpFreeSelectTool *free_sel,
       for (list = fg_select->strokes; list; list = list->next)
         gimp_foreground_select_tool_stroke (mask, list->data);
 
+#if 0
       if (fg_select->state)
         gimp_drawable_foreground_extract_siox (GIMP_DRAWABLE (mask),
                                                fg_select->state,
@@ -658,6 +664,7 @@ gimp_foreground_select_tool_select (GimpFreeSelectTool *free_sel,
                                                options->sensitivity,
                                                ! options->contiguous,
                                                GIMP_PROGRESS (fg_select));
+#endif
 
       fg_select->refinement = SIOX_REFINEMENT_NO_CHANGE;
 
@@ -672,12 +679,14 @@ gimp_foreground_select_tool_select (GimpFreeSelectTool *free_sel,
 
       gimp_foreground_select_tool_get_area (mask, &x1, &y1, &x2, &y2);
 
+#if 0
       if (fg_select->state)
         g_warning ("state should be NULL here");
 
       fg_select->state =
         gimp_drawable_foreground_extract_siox_init (drawable,
                                                     x1, y1, x2 - x1, y2 - y1);
+#endif
     }
 
   gimp_foreground_select_tool_set_mask (fg_select, display, mask);
@@ -849,6 +858,7 @@ gimp_foreground_select_options_notify (GimpForegroundSelectOptions *options,
   if (! fg_select->mask)
     return;
 
+#if 0
   if (strcmp (pspec->name, "smoothness") == 0)
     {
       refinement = SIOX_REFINEMENT_CHANGE_SMOOTHNESS;
@@ -861,6 +871,7 @@ gimp_foreground_select_options_notify (GimpForegroundSelectOptions *options,
     {
       refinement = SIOX_REFINEMENT_CHANGE_SENSITIVITY;
     }
+#endif
 
   if (refinement && fg_select->strokes)
     {
@@ -889,5 +900,3 @@ gimp_foreground_select_options_notify (GimpForegroundSelectOptions *options,
         }
     }
 }
-
-#endif
diff --git a/app/tools/gimpforegroundselecttool.h b/app/tools/gimpforegroundselecttool.h
index 32376e4..2903724 100644
--- a/app/tools/gimpforegroundselecttool.h
+++ b/app/tools/gimpforegroundselecttool.h
@@ -15,8 +15,6 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#if 0
-
 #ifndef __GIMP_FOREGROUND_SELECT_TOOL_H__
 #define __GIMP_FOREGROUND_SELECT_TOOL_H__
 
@@ -24,6 +22,15 @@
 #include "gimpfreeselecttool.h"
 
 
+typedef enum  /*< pdb-skip, skip >*/
+{
+  SIOX_REFINEMENT_NO_CHANGE          = 0,
+  SIOX_REFINEMENT_ADD_FOREGROUND     = (1 << 0),
+  SIOX_REFINEMENT_ADD_BACKGROUND     = (1 << 1),
+  SIOX_REFINEMENT_RECALCULATE        = 0xFF
+} SioxRefinementType;
+
+
 #define GIMP_TYPE_FOREGROUND_SELECT_TOOL            (gimp_foreground_select_tool_get_type ())
 #define GIMP_FOREGROUND_SELECT_TOOL(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
GIMP_TYPE_FOREGROUND_SELECT_TOOL, GimpForegroundSelectTool))
 #define GIMP_FOREGROUND_SELECT_TOOL_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), 
GIMP_TYPE_FOREGROUND_SELECT_TOOL, GimpForegroundSelectToolClass))
@@ -46,7 +53,9 @@ struct _GimpForegroundSelectTool
   GArray             *stroke;
   GList              *strokes;
   GimpChannel        *mask;
+#if 0
   SioxState          *state;
+#endif
   SioxRefinementType  refinement;
 };
 
@@ -63,5 +72,3 @@ GType   gimp_foreground_select_tool_get_type (void) G_GNUC_CONST;
 
 
 #endif  /*  __GIMP_FOREGROUND_SELECT_TOOL_H__  */
-
-#endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]