[maemo-commits] [maemo-commits] r14946 - in projects/haf/trunk/hail: . debian hail/hail-hildon-libs

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Dec 11 16:09:55 EET 2007
Author: atdomoko
Date: 2007-12-11 16:09:51 +0200 (Tue, 11 Dec 2007)
New Revision: 14946

Modified:
   projects/haf/trunk/hail/ChangeLog
   projects/haf/trunk/hail/debian/changelog
   projects/haf/trunk/hail/hail/hail-hildon-libs/haildateeditor.c
   projects/haf/trunk/hail/hail/hail-hildon-libs/hailtimeeditor.c
Log:
patch applied to fix bugs #24411 and #25602
debian/changelog 1.2.4-3



Modified: projects/haf/trunk/hail/ChangeLog
===================================================================
--- projects/haf/trunk/hail/ChangeLog	2007-12-11 12:59:19 UTC (rev 14945)
+++ projects/haf/trunk/hail/ChangeLog	2007-12-11 14:09:51 UTC (rev 14946)
@@ -1,5 +1,20 @@
 2007-12-11 Attila Domokos <attila.domokos at nokia.com>
 
+	* hail/hail-hildon-libs/hailtimeeditor.c
+	hailtimeeditor was outdated, as still tried to access the
+	am/pm switcher on HildonTimeEditor implemented as an eventbox, 
+	but this was changed several months ago to a button
+	* Fixes NB#25602
+
+	* hail/hail-hildon-libs/haildateeditor.c
+	(idle_do_action): reset priv->action_id_handler once 
+	of the handler return FALSE, so the timeout is removed, 
+	in order to allow to execute the timeout more that once on
+	hail_date_editor_action_do_action
+	* Fixes NB#24411
+
+2007-12-11 Attila Domokos <attila.domokos at nokia.com>
+
 	* hail/hildon-desktop/hailtogglebutton.c
 	(hail_toggle_button_get_name): added a check to avoid a crash if
 	there is no toggle_button available

Modified: projects/haf/trunk/hail/debian/changelog
===================================================================
--- projects/haf/trunk/hail/debian/changelog	2007-12-11 12:59:19 UTC (rev 14945)
+++ projects/haf/trunk/hail/debian/changelog	2007-12-11 14:09:51 UTC (rev 14946)
@@ -1,3 +1,13 @@
+hail (1.2.4-3) unstable; urgency=low
+
+  * hail/hail-hildon-libs/hailtimeeditor.c
+  * Fixes: NB#25602
+  
+  * hail/hail-hildon-libs/haildateeditor.c
+  * Fixes: NB#24411
+
+ -- Attila Domokos <attila.domokos at nokia.com>  Tue, 11 Dec 2007 15:10:27 +0200
+
 hail (1.2.4-2) unstable; urgency=low
 
   * patched hail/hildon-desktop/hildontogglebutton.c from bug 70723

Modified: projects/haf/trunk/hail/hail/hail-hildon-libs/haildateeditor.c
===================================================================
--- projects/haf/trunk/hail/hail/hail-hildon-libs/haildateeditor.c	2007-12-11 12:59:19 UTC (rev 14945)
+++ projects/haf/trunk/hail/hail/hail-hildon-libs/haildateeditor.c	2007-12-11 14:09:51 UTC (rev 14946)
@@ -669,7 +669,8 @@
   gtk_widget_event (widget, &tmp_event);
   
   g_idle_add (hail_date_editor_release_button, data);
-  
+
+  priv->action_idle_handler = NULL;
   return FALSE;
 }
 

Modified: projects/haf/trunk/hail/hail/hail-hildon-libs/hailtimeeditor.c
===================================================================
--- projects/haf/trunk/hail/hail/hail-hildon-libs/hailtimeeditor.c	2007-12-11 12:59:19 UTC (rev 14945)
+++ projects/haf/trunk/hail/hail/hail-hildon-libs/hailtimeeditor.c	2007-12-11 14:09:51 UTC (rev 14946)
@@ -25,10 +25,10 @@
  * #HailTimeEditor implements the required ATK interfaces of #HildonTimeEditor and its
  * children (the buttons inside the widget). It exposes:
  * <itemizedlist>
- * <listitem>An action to expose the am/pm switch </listitem>
  * <listitem>The data entries and the dialog button.</listitem>
  * <listitem>The AtkText interface showing a textual description of the selected time. It
  * should make checking current value easier (it's not required to check the children).</listitem>
+ * <listitem>The am/pm switch button</listitem>
  * </itemizedlist>
  */
 
@@ -49,8 +49,7 @@
   AtkObject *mentry; /* minute entry */
   AtkObject *sentry; /* seconds entry */
   AtkObject *iconbutton; /* dialog launch button */
-  AtkObject *event_box; /* am/pm event box */
-  gpointer action_idle_handler; /* action idle handler for click emulation */
+  AtkObject *ampm_button; /* am/pm button */
   GailTextUtil * textutil; /* text ops helper */
   gint cursor_position; /* current cursor position */
   gint selection_bound; /* selection info */
@@ -74,18 +73,6 @@
 static void       hail_time_editor_map_gtk               (GtkWidget         *widget,
 							  gpointer          data);
 
-/* AtkAction.h */
-static void                  hail_time_editor_atk_action_interface_init   (AtkActionIface  *iface);
-static gint                  hail_time_editor_action_get_n_actions    (AtkAction       *action);
-static gboolean              hail_time_editor_action_do_action        (AtkAction       *action,
-								       gint            index);
-static const gchar*          hail_time_editor_action_get_name         (AtkAction       *action,
-								       gint            index);
-static const gchar*          hail_time_editor_action_get_description  (AtkAction       *action,
-								       gint            index);
-static const gchar*          hail_time_editor_action_get_keybinding   (AtkAction       *action,
-								       gint            index);
-
 static void                  add_internal_widgets              (GtkWidget       *widget,
 								gpointer        data);
 
@@ -157,9 +144,6 @@
 						       gpointer data);
 
 
-#define HAIL_TIME_EDITOR_CLICK_ACTION_NAME "click"
-#define HAIL_TIME_EDITOR_CLICK_ACTION_DESCRIPTION "Click the AM/PM button"
-
 static GType parent_type;
 static GtkAccessibleClass* parent_class = NULL;
 
@@ -193,13 +177,6 @@
 	  NULL /* value table */
 	};
 
-      static const GInterfaceInfo atk_action_info =
-      {
-        (GInterfaceInitFunc) hail_time_editor_atk_action_interface_init,
-        (GInterfaceFinalizeFunc) NULL,
-        NULL
-      };
-
       static const GInterfaceInfo atk_text_info =
       {
         (GInterfaceInitFunc) hail_time_editor_atk_text_interface_init,
@@ -218,8 +195,6 @@
       type = g_type_register_static (parent_type,
                                      "HailTimeEditor", &tinfo, 0);
 
-      g_type_add_interface_static (type, ATK_TYPE_ACTION,
-                                   &atk_action_info);
       g_type_add_interface_static (type, ATK_TYPE_TEXT,
                                    &atk_text_info);
     }
@@ -259,7 +234,7 @@
   priv->sentry = NULL;
   priv->entry_frame = NULL;
   priv->iconbutton = NULL;
-  priv->event_box = NULL;
+  priv->ampm_button = NULL;
   priv->cursor_position = 0;
   priv->textutil = NULL;
   priv->selection_bound = 0;
@@ -401,7 +376,7 @@
     priv->entry_frame = gtk_widget_get_accessible(widget);
   } else if (GTK_IS_BUTTON(widget)) {
     priv->iconbutton = gtk_widget_get_accessible(widget);
-    atk_object_set_name(priv->iconbutton, "Icon button");
+    atk_object_set_name(priv->iconbutton, "Icon button");    
   }
 
 }
@@ -466,12 +441,12 @@
 	num_entries = 0;
       break;
       }
-    } else if (atk_object_get_role(frame_child)==ATK_ROLE_PANEL) {
-      priv->event_box = frame_child;
-      atk_object_set_name(priv->event_box, "Event box");
-      atk_object_set_parent(priv->event_box, obj);
+    } else if (atk_object_get_role(frame_child)==ATK_ROLE_PUSH_BUTTON) {
+      priv->ampm_button = frame_child;
+      atk_object_set_name(priv->ampm_button, "AMPM button");
+      atk_object_set_parent(priv->ampm_button, obj);
       g_object_ref(frame_child);
-    }
+    }       
     if (ATK_IS_OBJECT(frame_child)) {
       g_object_unref(frame_child);
     }
@@ -481,19 +456,19 @@
   g_return_if_fail (ATK_IS_OBJECT(priv->mentry));
   g_return_if_fail (ATK_IS_OBJECT(priv->sentry));
   g_return_if_fail (ATK_IS_OBJECT(priv->iconbutton));
-  g_return_if_fail (ATK_IS_OBJECT(priv->event_box));
+  g_return_if_fail (ATK_IS_OBJECT(priv->ampm_button));
 
   g_return_if_fail (ATK_IS_TEXT(priv->hentry));
   g_return_if_fail (ATK_IS_TEXT(priv->mentry));
   g_return_if_fail (ATK_IS_TEXT(priv->sentry));
 
-  g_signal_connect_after(priv->hentry, "text_changed::insert", 
+  g_signal_connect_after(priv->hentry, "text_changed::insert",
 			 (GCallback) hail_time_editor_text_changed,
 			 NULL);
-  g_signal_connect_after(priv->mentry, "text_changed::insert", 
+  g_signal_connect_after(priv->mentry, "text_changed::insert",
 			 (GCallback) hail_time_editor_text_changed,
 			 NULL);
-  g_signal_connect_after(priv->sentry, "text_changed::insert", 
+  g_signal_connect_after(priv->sentry, "text_changed::insert",
 			 (GCallback) hail_time_editor_text_changed,
 			 NULL);
 
@@ -574,7 +549,7 @@
     accessible_child = priv->iconbutton;
     break;
   case 4:
-    accessible_child = priv->event_box;
+    accessible_child = priv->ampm_button;
     break;
   }
   g_return_val_if_fail (ATK_IS_OBJECT(accessible_child), NULL);
@@ -583,195 +558,6 @@
   return accessible_child;
 }
 
-/* Initializes the AtkAction interface, and binds the virtual methods */
-static void
-hail_time_editor_atk_action_interface_init (AtkActionIface *iface)
-{
-  g_return_if_fail (iface != NULL);
-
-  iface->do_action = hail_time_editor_action_do_action;
-  iface->get_n_actions = hail_time_editor_action_get_n_actions;
-  iface->get_name = hail_time_editor_action_get_name;
-  iface->get_description = hail_time_editor_action_get_description;
-  iface->get_keybinding = hail_time_editor_action_get_keybinding;
-}
-
-/* Implementation of AtkAction method get_n_actions */
-static gint
-hail_time_editor_action_get_n_actions    (AtkAction       *action)
-{
-  GtkWidget * time_editor = NULL;
-  
-  g_return_val_if_fail (HAIL_IS_TIME_EDITOR (action), 0);
-
-  time_editor = GTK_ACCESSIBLE (action)->widget;
-  g_return_val_if_fail (HILDON_IS_TIME_EDITOR(time_editor), 0);
-
-  return 1;
-}
-
-/* idle handler to perform the release button used to emulate a click in the
- * am/pm eventbox */
-static gboolean 
-hail_time_editor_release_button (gpointer data)
-{
-  HailTimeEditor *time_editor; 
-  GtkWidget *widget;
-  GdkEvent tmp_event;
-  GdkWindow * parent_window;
-  HailTimeEditorPrivate * priv = NULL;
-
-  time_editor = HAIL_TIME_EDITOR (data);
-
-  priv = HAIL_TIME_EDITOR_GET_PRIVATE(time_editor);
-
-  widget = GTK_ACCESSIBLE(priv->event_box)->widget;
-
-  if (widget == NULL)
-    /*
-     * State is defunct
-     */
-    return FALSE;
-
-  if (!GTK_WIDGET_SENSITIVE (widget) || !GTK_WIDGET_VISIBLE (widget))
-    return FALSE;
-
-  /*
-   * Simulate a button release event. It gets the gdk window from the widget
-   */
-
-  tmp_event.key.type = GDK_KEY_RELEASE;
-  parent_window = gtk_widget_get_parent_window(widget);
-  tmp_event.key.window = parent_window;
-  tmp_event.key.keyval = GDK_Return;
-  tmp_event.key.send_event = TRUE;
-  tmp_event.key.time = GDK_CURRENT_TIME;
-    
-  gtk_widget_event (widget, &tmp_event);
-  
-  return FALSE;
-}
-
-/* idle handler to perform the press-release button used to emulate a click in the
- * am/pm eventbox */
-static gboolean 
-idle_do_action (gpointer data)
-{
-  HailTimeEditor *time_editor; 
-  GtkWidget *widget;
-  GdkEvent tmp_event;
-  GdkWindow * parent_window;
-  HailTimeEditorPrivate * priv = NULL;
-
-  time_editor = HAIL_TIME_EDITOR (data);
-
-  priv = HAIL_TIME_EDITOR_GET_PRIVATE(time_editor);
-
-  widget = GTK_ACCESSIBLE(priv->event_box)->widget;
-
-  if (widget == NULL)
-    /*
-     * State is defunct
-     */
-    return FALSE;
-
-  if (!GTK_WIDGET_SENSITIVE (widget) || !GTK_WIDGET_VISIBLE (widget))
-    return FALSE;
-
-  /*
-   * Simulate a button release event. It gets the gdk window from the widget
-   * and sends an event to it.
-   * Then it hangs an idle call to do the release once the events
-   * are processed.
-   */
-
-  tmp_event.key.type = GDK_KEY_PRESS;
-  parent_window = gtk_widget_get_parent_window(widget);
-  tmp_event.key.window = parent_window;
-  tmp_event.key.keyval = GDK_Return;
-  tmp_event.key.send_event = TRUE;
-  tmp_event.key.time = GDK_CURRENT_TIME;
-    
-  gtk_widget_event (widget, &tmp_event);
-  
-  g_idle_add (hail_time_editor_release_button, data);
-  
-  return FALSE;
-}
-
-
-/* Implementation of AtkAction method do_action */
-static gboolean
-hail_time_editor_action_do_action        (AtkAction       *action,
-					  gint            index)
-{
-  GtkWidget * time_editor = NULL;
-  HailTimeEditorPrivate * priv = NULL;
-
-  g_return_val_if_fail (HAIL_IS_TIME_EDITOR (action), FALSE);
-  g_return_val_if_fail ((index == 0), FALSE);
-
-  time_editor = GTK_ACCESSIBLE (action)->widget;
-  g_return_val_if_fail (HILDON_IS_TIME_EDITOR(time_editor), FALSE);
-
-  priv = HAIL_TIME_EDITOR_GET_PRIVATE(time_editor);
-
-  if (priv->action_idle_handler)
-    return FALSE;
-  else {
-    priv->action_idle_handler = (gpointer) g_timeout_add (500, idle_do_action, action);
-    return TRUE;
-  }
-}
-
-/* Implementation of AtkAction method get_name */
-static const gchar*
-hail_time_editor_action_get_name         (AtkAction       *action,
-					  gint            index)
-{
-  GtkWidget * time_editor = NULL;
-
-  g_return_val_if_fail (HAIL_IS_TIME_EDITOR (action), NULL);
-  g_return_val_if_fail ((index == 0), NULL);
-
-  time_editor = GTK_ACCESSIBLE (action)->widget;
-  g_return_val_if_fail (HILDON_IS_TIME_EDITOR(time_editor), NULL);
-
-  return HAIL_TIME_EDITOR_CLICK_ACTION_NAME;
-}
-
-/* Implementation of AtkAction method get_description */
-static const gchar*
-hail_time_editor_action_get_description   (AtkAction       *action,
-					   gint            index)
-{
-  GtkWidget * time_editor = NULL;
-
-  g_return_val_if_fail (HAIL_IS_TIME_EDITOR (action), NULL);
-  g_return_val_if_fail ((index == 0), NULL);
-
-  time_editor = GTK_ACCESSIBLE (action)->widget;
-  g_return_val_if_fail (HILDON_IS_TIME_EDITOR(time_editor), NULL);
-
-  return HAIL_TIME_EDITOR_CLICK_ACTION_DESCRIPTION;
-}
-
-/* Implementation of AtkAction method get_keybinding */
-static const gchar*
-hail_time_editor_action_get_keybinding   (AtkAction       *action,
-					  gint            index)
-{
-  GtkWidget * time_editor = NULL;
-
-  g_return_val_if_fail (HAIL_IS_TIME_EDITOR (action), NULL);
-  g_return_val_if_fail ((index == 0), NULL);
-
-  time_editor = GTK_ACCESSIBLE (action)->widget;
-  g_return_val_if_fail (HILDON_IS_TIME_EDITOR(time_editor), NULL);
-
-  return NULL;
-}
-
 /* atktext.h */
 
 static void
@@ -1069,6 +855,8 @@
 			       gpointer data)
 {
   GtkWidget * widget = NULL;
+  GdkEvent tmp_event;
+  GdkWindow * parent_window;
 
   g_return_if_fail (ATK_IS_TEXT(entry));
   g_return_if_fail (GTK_IS_ACCESSIBLE(entry));
@@ -1076,6 +864,13 @@
   widget = GTK_ACCESSIBLE(entry)->widget;
   g_return_if_fail (GTK_IS_EDITABLE(widget));
 
-  g_signal_emit_by_name(widget, "focus-out-event");
+  tmp_event.focus_change.type = GDK_FOCUS_CHANGE;
+  parent_window = gtk_widget_get_parent_window(widget);
+  tmp_event.focus_change.window = parent_window;
+  tmp_event.focus_change.send_event = TRUE;
+  tmp_event.focus_change.in = FALSE;
 
+  gtk_widget_event(widget, &tmp_event);
 }
+
+  


More information about the maemo-commits mailing list