]> Pileus Git - ~andy/gtk/blobdiff - gtk/deprecated/gtkhsv.c
filechooserbutton: When the combo box changes, set the *file*, not the current folder
[~andy/gtk] / gtk / deprecated / gtkhsv.c
index 3fac2e136a34db912c81ccafee96318b736318c3..ad09515336be20b2194a440dd2504a6a623a2e76 100644 (file)
@@ -17,9 +17,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
@@ -39,6 +37,7 @@
 #include "gtkhsv.h"
 #include "gtkbindings.h"
 #include "gtkmarshalers.h"
+#include "gtkstylecontext.h"
 #include "gtktypebuiltins.h"
 #include "gtkintl.h"
 
@@ -423,81 +422,6 @@ hsv_to_rgb (gdouble *h,
     }
 }
 
-/* Converts from RGB to HSV */
-static void
-rgb_to_hsv (gdouble *r,
-            gdouble *g,
-            gdouble *b)
-{
-  gdouble red, green, blue;
-  gdouble h, s, v;
-  gdouble min, max;
-  gdouble delta;
-
-  red = *r;
-  green = *g;
-  blue = *b;
-
-  h = 0.0;
-
-  if (red > green)
-    {
-      if (red > blue)
-        max = red;
-      else
-        max = blue;
-
-      if (green < blue)
-        min = green;
-      else
-        min = blue;
-    }
-  else
-    {
-      if (green > blue)
-        max = green;
-      else
-        max = blue;
-
-      if (red < blue)
-        min = red;
-      else
-        min = blue;
-    }
-
-  v = max;
-
-  if (max != 0.0)
-    s = (max - min) / max;
-  else
-    s = 0.0;
-
-  if (s == 0.0)
-    h = 0.0;
-  else
-    {
-      delta = max - min;
-
-      if (red == max)
-        h = (green - blue) / delta;
-      else if (green == max)
-        h = 2 + (blue - red) / delta;
-      else if (blue == max)
-        h = 4 + (red - green) / delta;
-
-      h /= 6.0;
-
-      if (h < 0.0)
-        h += 1.0;
-      else if (h > 1.0)
-        h -= 1.0;
-    }
-
-  *r = h;
-  *g = s;
-  *b = v;
-}
-
 /* Computes the vertices of the saturation/value triangle */
 static void
 compute_triangle (GtkHSV *hsv,