1 # Initial panning support
3 # Copyright (C) 2006 - 2007 Nokia Corporation.
4 # This file is distributed under the terms of GNU LGPL license, either version 2
5 # of the License, or (at your option) any later version.
7 diff -ru gtkhtml-3.24.4/gtkhtml/gtkhtml.c gtkhtml-3.24.4/gtkhtml/gtkhtml.c
8 diff -ru gtkhtml-3.24.4/gtkhtml/gtkhtml.c gtkhtml-3.24.4/gtkhtml/gtkhtml.c
9 diff -ru gtkhtml-3.24.4/gtkhtml/gtkhtml.c gtkhtml-3.24.4/gtkhtml/gtkhtml.c
10 diff -ru gtkhtml-3.24.4/gtkhtml/gtkhtml.c gtkhtml-3.24.4/gtkhtml/gtkhtml.c
11 --- gtkhtml-3.24.4/gtkhtml/gtkhtml.c 2007-02-15 17:27:50.000000000 +0200
12 --- gtkhtml-3.24.4/gtkhtml/gtkhtml.c 2007-02-15 17:27:50.000000000 +0200
13 --- gtkhtml-3.24.4/gtkhtml/gtkhtml.c 2007-02-15 17:27:50.000000000 +0200
14 --- gtkhtml-3.24.4/gtkhtml/gtkhtml.c 2007-02-15 17:27:50.000000000 +0200
15 +++ gtkhtml-3.24.4/gtkhtml/gtkhtml.c 2007-02-16 15:40:30.000000000 +0200
16 +++ gtkhtml-3.24.4/gtkhtml/gtkhtml.c 2007-02-16 15:40:30.000000000 +0200
17 +++ gtkhtml-3.24.4/gtkhtml/gtkhtml.c 2007-02-16 15:40:30.000000000 +0200
18 +++ gtkhtml-3.24.4/gtkhtml/gtkhtml.c 2007-02-16 15:40:30.000000000 +0200
19 @@ -1679,6 +1679,35 @@
20 engine = GTK_HTML (widget)->engine;
21 if (GTK_HTML (widget)->in_selection_drag && html_engine_get_editable (engine))
22 html_engine_jump_at (engine, x, y);
24 + /* (TL 18-Nov-05) Added panning feature */
25 + if (GTK_HTML (widget)->panning) {
30 + dx = x - GTK_HTML (widget)->lastx;
31 + dy = y - GTK_HTML (widget)->lasty;
33 + /* Vertical panning */
34 + adj = gtk_layout_get_vadjustment(GTK_LAYOUT(widget));
35 + value = adj->value - (gdouble) dy;
36 + if (value < adj->lower)
38 + else if (value > (adj->upper - adj->page_size))
39 + value = adj->upper - adj->page_size;
40 + gtk_adjustment_set_value(adj, value);
42 + /* Horizontal panning */
43 + adj = gtk_layout_get_hadjustment(GTK_LAYOUT(widget));
44 + value = adj->value - (gdouble) dx;
45 + if (value < adj->lower)
47 + else if (value > (adj->upper - adj->page_size))
48 + value = adj->upper - adj->page_size;
49 + gtk_adjustment_set_value(adj, value);
55 @@ -1790,7 +1819,13 @@
59 - html->in_selection_drag = TRUE;
60 + /*html->in_selection_drag = TRUE;*/
61 + /* (TL 18-Nov-05) First click starts panning, not selection */
62 + html->in_selection_drag = FALSE;
63 + html->panning = TRUE;
67 if (html_engine_get_editable (engine)) {
70 @@ -1856,13 +1891,19 @@
72 } else if (event->button == 1 && html->allow_selection) {
73 if (event->type == GDK_2BUTTON_PRESS) {
74 - html->in_selection_drag = FALSE;
75 - gtk_html_select_word (html);
76 + /*html->in_selection_drag = FALSE;
77 + gtk_html_select_word (html);*/
78 + /* (TL 18-Nov-05) Second click starts selection and stops panning */
79 + html->in_selection_drag = TRUE;
80 + html->panning = FALSE;
81 html->in_selection = TRUE;
83 else if (event->type == GDK_3BUTTON_PRESS) {
84 - html->in_selection_drag = FALSE;
85 - gtk_html_select_line (html);
86 + /*html->in_selection_drag = FALSE;
87 + gtk_html_select_line (html);*/
88 + /* (TL 18-Nov-05) Third click starts selection and stops panning */
89 + html->in_selection_drag = TRUE;
90 + html->panning = FALSE;
91 html->in_selection = TRUE;
95 html_engine_jump_at (engine, x, y);
97 html->in_selection_drag = FALSE;
98 + /* (TL 18-Nov-05) Stop panning on button release */
99 + html->panning = FALSE;
101 if (!html->priv->dnd_in_progress
102 && html->pointer_url != NULL && ! html->in_selection) {
103 @@ -1951,7 +1994,7 @@
106 html->priv->need_im_reset = TRUE;
107 - gtk_im_context_focus_in (html->priv->im_context);
108 + //gtk_im_context_focus_in (html->priv->im_context); // (TL 20-Oct-05) Kludge to focus issues
110 gtk_html_keymap_direction_changed (gdk_keymap_get_for_display (gtk_widget_get_display (widget)),
112 @@ -3448,6 +3491,11 @@
113 html->selection_x1 = 0;
114 html->selection_y1 = 0;
116 + /* (TL 18-Nov-05) For panning */
117 + html->panning = FALSE;
121 html->in_selection = FALSE;
122 html->in_selection_drag = FALSE;
124 Only in gtkhtml-3.24.4/gtkhtml: gtkhtml.c.orig
125 Only in gtkhtml-3.24.4/gtkhtml: gtkhtml.c.orig
126 Only in gtkhtml-3.24.4/gtkhtml: gtkhtml.c.orig
127 Only in gtkhtml-3.24.4/gtkhtml: gtkhtml.c.orig
128 diff -ru gtkhtml-3.24.4/gtkhtml/gtkhtml.h gtkhtml-3.24.4/gtkhtml/gtkhtml.h
129 diff -ru gtkhtml-3.24.4/gtkhtml/gtkhtml.h gtkhtml-3.24.4/gtkhtml/gtkhtml.h
130 diff -ru gtkhtml-3.24.4/gtkhtml/gtkhtml.h gtkhtml-3.24.4/gtkhtml/gtkhtml.h
131 diff -ru gtkhtml-3.24.4/gtkhtml/gtkhtml.h gtkhtml-3.24.4/gtkhtml/gtkhtml.h
132 --- gtkhtml-3.24.4/gtkhtml/gtkhtml.h 2007-02-15 17:42:33.000000000 +0200
133 --- gtkhtml-3.24.4/gtkhtml/gtkhtml.h 2007-02-15 17:42:33.000000000 +0200
134 --- gtkhtml-3.24.4/gtkhtml/gtkhtml.h 2007-02-15 17:42:33.000000000 +0200
135 --- gtkhtml-3.24.4/gtkhtml/gtkhtml.h 2007-02-15 17:42:33.000000000 +0200
136 +++ gtkhtml-3.24.4/gtkhtml/gtkhtml.h 2007-02-16 15:40:30.000000000 +0200
137 +++ gtkhtml-3.24.4/gtkhtml/gtkhtml.h 2007-02-16 15:40:30.000000000 +0200
138 +++ gtkhtml-3.24.4/gtkhtml/gtkhtml.h 2007-02-16 15:40:30.000000000 +0200
139 +++ gtkhtml-3.24.4/gtkhtml/gtkhtml.h 2007-02-16 15:40:30.000000000 +0200
142 gint selection_x1, selection_y1;
144 + /* (TL 18-Nov-05) Panning variables */
149 guint in_selection : 1;
150 guint in_selection_drag : 1;
152 Only in gtkhtml-3.24.4/gtkhtml: gtkhtml.h.orig
153 Only in gtkhtml-3.24.4/gtkhtml: gtkhtml.h.orig
154 Only in gtkhtml-3.24.4/gtkhtml: gtkhtml.h.orig
155 Only in gtkhtml-3.24.4/gtkhtml: gtkhtml.h.orig