Added gtkhtml,libhildonhelp and maemopad
[oespirit1] / gtkhtml / gtkhtml_120_text_selection.diff
diff --git a/gtkhtml/gtkhtml_120_text_selection.diff b/gtkhtml/gtkhtml_120_text_selection.diff
new file mode 100644 (file)
index 0000000..7b8a89c
--- /dev/null
@@ -0,0 +1,104 @@
+# Double-click initiates text selection
+#
+# Copyright (C) 2006 - 2007 Nokia Corporation.
+# This file is distributed under the terms of GNU LGPL license, either version 2
+# of the License, or (at your option) any later version.
+#
+diff -ru gtkhtml-3.24.4/gtkhtml/gtkhtml.c gtkhtml-3.24.4/gtkhtml/gtkhtml.c
+diff -ru gtkhtml-3.24.4/gtkhtml/gtkhtml.c gtkhtml-3.24.4/gtkhtml/gtkhtml.c
+diff -ru gtkhtml-3.24.4/gtkhtml/gtkhtml.c gtkhtml-3.24.4/gtkhtml/gtkhtml.c
+diff -ru gtkhtml-3.24.4/gtkhtml/gtkhtml.c gtkhtml-3.24.4/gtkhtml/gtkhtml.c
+--- gtkhtml-3.24.4/gtkhtml/gtkhtml.c   2007-02-16 15:40:30.000000000 +0200
+--- gtkhtml-3.24.4/gtkhtml/gtkhtml.c   2007-02-16 15:40:30.000000000 +0200
+--- gtkhtml-3.24.4/gtkhtml/gtkhtml.c   2007-02-16 15:40:30.000000000 +0200
+--- gtkhtml-3.24.4/gtkhtml/gtkhtml.c   2007-02-16 15:40:30.000000000 +0200
++++ gtkhtml-3.24.4/gtkhtml/gtkhtml.c   2007-02-16 15:56:22.000000000 +0200
++++ gtkhtml-3.24.4/gtkhtml/gtkhtml.c   2007-02-16 15:56:22.000000000 +0200
++++ gtkhtml-3.24.4/gtkhtml/gtkhtml.c   2007-02-16 15:56:22.000000000 +0200
++++ gtkhtml-3.24.4/gtkhtml/gtkhtml.c   2007-02-16 15:56:22.000000000 +0200
+@@ -193,6 +193,9 @@
+ /* Interval for scrolling during selection.  */
+ #define SCROLL_TIMEOUT_INTERVAL 10
++/* Mouse move threshold for doubleclick check */
++#define MOUSE_DBLCLK_THRESHOLD 10
++
\f
+ GtkHTMLParagraphStyle
+ clueflow_style_to_paragraph_style (HTMLClueFlowStyle style, HTMLListType item_type)
+@@ -1673,6 +1676,18 @@
+       gdk_window_get_pointer (GTK_LAYOUT (widget)->bin_window, &x, &y, NULL);
++      /* If there is only a small motion from the origin and simple 
++         doubleclick is active, abort the motion, otherwise clear simple_dblclick flag */
++      if (GTK_HTML (widget)->simple_dblclick) {
++          GtkHTML *html = GTK_HTML (widget);
++          
++          if (abs(x - html->selection_x1) <= MOUSE_DBLCLK_THRESHOLD && 
++              abs(y - html->selection_y1) <= MOUSE_DBLCLK_THRESHOLD)
++              return TRUE;
++              
++          html->simple_dblclick = FALSE;
++      }
++      
+       if (!mouse_change_pos (widget, window, x, y, event->state))
+               return FALSE;
+@@ -1897,6 +1912,10 @@
+                       html->in_selection_drag = TRUE;
+                       html->panning = FALSE;
+                       html->in_selection = TRUE;
++                      /* Check for simple double click, for selecting a word */
++                      html->simple_dblclick = TRUE;
++                      html->selection_x1 = x;
++                      html->selection_y1 = y;
+               }
+               else if (event->type == GDK_3BUTTON_PRESS) {
+                       /*html->in_selection_drag = FALSE;
+@@ -1935,7 +1954,8 @@
+       engine =  html->engine;
+-      if (html->in_selection) {
++      /* If it is a simple doubleclick don't allow the selection */
++      if (html->in_selection && !html->simple_dblclick) {
+               html_engine_update_selection_active_state (html->engine, html->priv->event_time);
+               if (html->in_selection_drag)
+                       html_engine_select_region (engine, html->selection_x1, html->selection_y1,
+@@ -1961,6 +1981,12 @@
+                               html_text_set_link_visited (HTML_TEXT(focus_object), focus_object_offset, html->engine, TRUE);
+                       }   
+               }
++              
++              /* If it was a simple doubleclick select a word */
++              if (html->simple_dblclick) {
++                  html->simple_dblclick = FALSE;
++                  gtk_html_select_word(html);
++              }
+       }
+       html->in_selection = FALSE;
+diff -ru gtkhtml-3.24.4/gtkhtml/gtkhtml.h gtkhtml-3.24.4/gtkhtml/gtkhtml.h
+diff -ru gtkhtml-3.24.4/gtkhtml/gtkhtml.h gtkhtml-3.24.4/gtkhtml/gtkhtml.h
+diff -ru gtkhtml-3.24.4/gtkhtml/gtkhtml.h gtkhtml-3.24.4/gtkhtml/gtkhtml.h
+diff -ru gtkhtml-3.24.4/gtkhtml/gtkhtml.h gtkhtml-3.24.4/gtkhtml/gtkhtml.h
+--- gtkhtml-3.24.4/gtkhtml/gtkhtml.h   2007-02-16 15:40:30.000000000 +0200
+--- gtkhtml-3.24.4/gtkhtml/gtkhtml.h   2007-02-16 15:40:30.000000000 +0200
+--- gtkhtml-3.24.4/gtkhtml/gtkhtml.h   2007-02-16 15:40:30.000000000 +0200
+--- gtkhtml-3.24.4/gtkhtml/gtkhtml.h   2007-02-16 15:40:30.000000000 +0200
++++ gtkhtml-3.24.4/gtkhtml/gtkhtml.h   2007-02-16 15:56:22.000000000 +0200
++++ gtkhtml-3.24.4/gtkhtml/gtkhtml.h   2007-02-16 15:56:22.000000000 +0200
++++ gtkhtml-3.24.4/gtkhtml/gtkhtml.h   2007-02-16 15:56:22.000000000 +0200
++++ gtkhtml-3.24.4/gtkhtml/gtkhtml.h   2007-02-16 15:56:22.000000000 +0200
+@@ -68,6 +68,10 @@
+       guint debug : 1;
+       guint allow_selection : 1;
++      
++      /* Dbl-clk variables */
++      
++      guint simple_dblclick : 1;
+       guint hadj_connection;
+       guint vadj_connection;