2009-03-12 Alberto Garcia <agarcia@igalia.com>
[hildon] / src / hildon-range-editor.c
index f74b437..690ae7e 100644 (file)
@@ -3,12 +3,12 @@
  *
  * Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved.
  *
- * Contact: Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+ * Contact: Rodrigo Novo <rodrigo.novo@nokia.com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
  * as published by the Free Software Foundation; version 2.1 of
- * the License.
+ * the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * </example>
  */
 
+#undef                                          HILDON_DISABLE_DEPRECATED
+
 #ifdef                                          HAVE_CONFIG_H
 #include                                        <config.h>
 #endif
 
-#include                                        "hildon-range-editor.h"
-#include                                        <gtk/gtkbox.h>
-#include                                        <gtk/gtklabel.h>
-#include                                        <gtk/gtksignal.h>
-#include                                        <gtk/gtkentry.h>
-#include                                        <gdk/gdkkeysyms.h>
-#include                                        <glib/gprintf.h>
+#include                                        <libintl.h>
 #include                                        <string.h>
 #include                                        <stdlib.h>
-#include                                        "hildon-input-mode-hint.h"
+#include                                        <glib/gprintf.h>
+#include                                        <gdk/gdkkeysyms.h>
+
+#include                                        "hildon-range-editor.h"
 #include                                        "hildon-banner.h"
-#include                                        <libintl.h>
 #include                                        "hildon-range-editor-private.h"
 
 #define                                         _(string) \
@@ -329,11 +327,13 @@ hildon_range_editor_init                        (HildonRangeEditor *editor)
     g_signal_connect (priv->end_entry, "changed", 
             G_CALLBACK (hildon_range_editor_entry_changed), editor);
 
+#ifdef MAEMO_GTK 
     g_object_set (G_OBJECT (priv->start_entry),
-            "input-mode", HILDON_INPUT_MODE_HINT_NUMERIC, NULL);
+            "hildon-input-mode", HILDON_GTK_INPUT_MODE_NUMERIC, NULL);
 
     g_object_set( G_OBJECT (priv->end_entry),
-            "input-mode", HILDON_INPUT_MODE_HINT_NUMERIC, NULL);
+            "hildon-input-mode", HILDON_GTK_INPUT_MODE_NUMERIC, NULL);
+#endif 
 
     gtk_widget_show (priv->start_entry);
     gtk_widget_show (priv->end_entry);
@@ -546,7 +546,7 @@ hildon_range_editor_entry_focus_in              (GtkEditable *editable,
     return FALSE;
 }
 
-/* Gets and sets the current range. This has two usefull side effects:
+/* Gets and sets the current range. This has two useful side effects:
  * Values are now sorted to the correct order
  * Out of range values are clamped to range */
 static void 
@@ -669,7 +669,9 @@ hildon_range_editor_size_allocate               (GtkWidget *widget,
                                                  GtkAllocation *allocation)
 {
     HildonRangeEditorPrivate *priv;
-    GtkAllocation child1_allocation, child2_allocation, child3_allocation;
+    GtkAllocation child1_allocation = {0};
+    GtkAllocation child2_allocation = {0};
+    GtkAllocation child3_allocation = {0};
 
     priv = HILDON_RANGE_EDITOR_GET_PRIVATE (widget);
     g_assert (priv);
@@ -802,7 +804,7 @@ hildon_range_editor_refresh_widths              (HildonRangeEditorPrivate *priv)
  * 
  * Initializes, and returns the type of a hildon range editor.
  * 
- * @Returns : GType of #HildonRangeEditor
+ * Returns: GType of #HildonRangeEditor
  * 
  */
 GType G_GNUC_CONST
@@ -896,10 +898,7 @@ hildon_range_editor_get_range                   (HildonRangeEditor *editor,
                                                  gint *start,
                                                  gint *end)
 {
-    HildonRangeEditorPrivate *priv;
-
     g_return_if_fail (HILDON_IS_RANGE_EDITOR (editor) && start && end);
-    priv = HILDON_RANGE_EDITOR_GET_PRIVATE (editor);
 
     *start = hildon_range_editor_get_lower (editor);
     *end = hildon_range_editor_get_higher (editor);