Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/69236590d08edc9722f48753ebe52f7315cb6b69
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/69236590d08edc9722f48753ebe52f7315cb6b69
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/69236590d08edc9722f48753ebe52f7315cb6b69

The branch, master has been updated
       via  69236590d08edc9722f48753ebe52f7315cb6b69 (commit)
       via  e34f9d3a387fba655a8dcc47d7659655dc4b5fb3 (commit)
       via  ae39b9f9551f39a07780453832fdf229fdea3552 (commit)
      from  2d57934be8a46dadd5b149e66acc0477bea8b975 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=69236590d08edc9722f48753ebe52f7315cb6b69
commit 69236590d08edc9722f48753ebe52f7315cb6b69
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>

    change mouse action drag handling to use a more efficient dispatch

diff --git a/content/handlers/html/interaction.c 
b/content/handlers/html/interaction.c
index 9e59aed..f68426e 100644
--- a/content/handlers/html/interaction.c
+++ b/content/handlers/html/interaction.c
@@ -614,31 +614,34 @@ html_mouse_action(struct content *c,
 
        nserror res = NSERROR_OK;
 
+       /* handle open select menu */
        if (html->visible_select_menu != NULL) {
                return mouse_action_select_menu(html, bw, mouse, x, y);
        }
 
-       if (html->drag_type == HTML_DRAG_SELECTION) {
+       /* handle content drag */
+       switch (html->drag_type) {
+       case HTML_DRAG_SELECTION:
                return mouse_action_drag_selection(html, bw, mouse, x, y);
-       }
 
-       if (html->drag_type == HTML_DRAG_SCROLLBAR) {
+       case HTML_DRAG_SCROLLBAR:
                return mouse_action_drag_scrollbar(html, bw, mouse, x, y);
 
-       }
-
-       if (html->drag_type == HTML_DRAG_TEXTAREA_SELECTION ||
-           html->drag_type == HTML_DRAG_TEXTAREA_SCROLLBAR) {
+       case HTML_DRAG_TEXTAREA_SELECTION:
+       case HTML_DRAG_TEXTAREA_SCROLLBAR:
                return mouse_action_drag_textarea(html, bw, mouse, x, y);
-       }
 
-       if (html->drag_type == HTML_DRAG_CONTENT_SELECTION ||
-           html->drag_type == HTML_DRAG_CONTENT_SCROLL) {
+       case HTML_DRAG_CONTENT_SELECTION:
+       case HTML_DRAG_CONTENT_SCROLL:
                return mouse_action_drag_content(html, bw, mouse, x, y);
-       }
 
-       /* Content related drags handled by now */
-       assert(html->drag_type == HTML_DRAG_NONE);
+       case HTML_DRAG_NONE:
+               break;
+
+       default:
+               /* Unknown content related drag type */
+               assert(0);
+       }
 
        /* search the box tree for a link, imagemap, form control, or
         * box with scrollbars


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=e34f9d3a387fba655a8dcc47d7659655dc4b5fb3
commit e34f9d3a387fba655a8dcc47d7659655dc4b5fb3
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>

    move remaining mouse action drag handling into separate functions

diff --git a/content/handlers/html/interaction.c 
b/content/handlers/html/interaction.c
index f238341..9e59aed 100644
--- a/content/handlers/html/interaction.c
+++ b/content/handlers/html/interaction.c
@@ -504,6 +504,62 @@ mouse_action_drag_scrollbar(html_content *html,
 }
 
 
+/**
+ * handle mouse actions while dragging in a text area
+ */
+static nserror
+mouse_action_drag_textarea(html_content *html,
+                           struct browser_window *bw,
+                           browser_mouse_state mouse,
+                           int x, int y)
+{
+       struct box *box;
+       int box_x = 0;
+       int box_y = 0;
+
+       box = html->drag_owner.textarea;
+
+       assert(box->gadget != NULL);
+       assert(box->gadget->type == GADGET_TEXTAREA ||
+              box->gadget->type == GADGET_PASSWORD ||
+              box->gadget->type == GADGET_TEXTBOX);
+
+       box_coords(box, &box_x, &box_y);
+       textarea_mouse_action(box->gadget->data.text.ta,
+                             mouse,
+                             x - box_x,
+                             y - box_y);
+
+       /* TODO: Set appropriate statusbar message */
+       return NSERROR_OK;
+}
+
+
+/**
+ * handle mouse actions while dragging in a content
+ */
+static nserror
+mouse_action_drag_content(html_content *html,
+                         struct browser_window *bw,
+                         browser_mouse_state mouse,
+                         int x, int y)
+{
+       struct box *box;
+       int box_x = 0;
+       int box_y = 0;
+
+       box = html->drag_owner.content;
+       assert(box->object != NULL);
+
+       box_coords(box, &box_x, &box_y);
+       content_mouse_track(box->object,
+                           bw, mouse,
+                           x - box_x,
+                           y - box_y);
+       return NSERROR_OK;
+}
+
+
 /* exported interface documented in html/interaction.h */
 nserror html_mouse_track(struct content *c,
                         struct browser_window *bw,
@@ -572,30 +628,13 @@ html_mouse_action(struct content *c,
        }
 
        if (html->drag_type == HTML_DRAG_TEXTAREA_SELECTION ||
-                       html->drag_type == HTML_DRAG_TEXTAREA_SCROLLBAR) {
-               box = html->drag_owner.textarea;
-               assert(box->gadget != NULL);
-               assert(box->gadget->type == GADGET_TEXTAREA ||
-                               box->gadget->type == GADGET_PASSWORD ||
-                               box->gadget->type == GADGET_TEXTBOX);
-
-               box_coords(box, &box_x, &box_y);
-               textarea_mouse_action(box->gadget->data.text.ta, mouse,
-                               x - box_x, y - box_y);
-
-               /* TODO: Set appropriate statusbar message */
-               return NSERROR_OK;
+           html->drag_type == HTML_DRAG_TEXTAREA_SCROLLBAR) {
+               return mouse_action_drag_textarea(html, bw, mouse, x, y);
        }
 
        if (html->drag_type == HTML_DRAG_CONTENT_SELECTION ||
-                       html->drag_type == HTML_DRAG_CONTENT_SCROLL) {
-               box = html->drag_owner.content;
-               assert(box->object != NULL);
-
-               box_coords(box, &box_x, &box_y);
-               content_mouse_track(box->object, bw, mouse,
-                               x - box_x, y - box_y);
-               return NSERROR_OK;
+           html->drag_type == HTML_DRAG_CONTENT_SCROLL) {
+               return mouse_action_drag_content(html, bw, mouse, x, y);
        }
 
        /* Content related drags handled by now */


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=ae39b9f9551f39a07780453832fdf229fdea3552
commit ae39b9f9551f39a07780453832fdf229fdea3552
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>

    move more select menu handling into mouse_action_select_menu()

diff --git a/content/handlers/html/interaction.c 
b/content/handlers/html/interaction.c
index 930c795..f238341 100644
--- a/content/handlers/html/interaction.c
+++ b/content/handlers/html/interaction.c
@@ -334,9 +334,16 @@ mouse_action_select_menu(html_content *html,
        const char *status;
        int width, height;
        struct hlcache_handle *bw_content;
+       browser_drag_type bw_drag_type;
 
        assert(html->visible_select_menu != NULL);
 
+       bw_drag_type = browser_window_get_drag_type(bw);
+       if (bw_drag_type != DRAGGING_NONE && !mouse) {
+               /* drag end: select menu */
+               form_select_mouse_drag_end(html->visible_select_menu, mouse, x, 
y);
+       }
+
        box = html->visible_select_menu->box;
        box_coords(box, &box_x, &box_y);
 
@@ -542,7 +549,6 @@ html_mouse_action(struct content *c,
        plot_font_style_t fstyle;
        int scroll_mouse_x = 0, scroll_mouse_y = 0;
        int padding_left, padding_right, padding_top, padding_bottom;
-       browser_drag_type drag_type = browser_window_get_drag_type(bw);
        union content_msg_data msg_data;
        struct dom_node *node = html->layout->node; /* Default to the <HTML> */
        union html_selection_owner sel_owner;
@@ -552,13 +558,6 @@ html_mouse_action(struct content *c,
 
        nserror res = NSERROR_OK;
 
-       if (drag_type != DRAGGING_NONE && !mouse &&
-                       html->visible_select_menu != NULL) {
-               /* drag end: select menu */
-               form_select_mouse_drag_end(html->visible_select_menu,
-                               mouse, x, y);
-       }
-
        if (html->visible_select_menu != NULL) {
                return mouse_action_select_menu(html, bw, mouse, x, y);
        }


-----------------------------------------------------------------------

Summary of changes:
 content/handlers/html/interaction.c |  117 +++++++++++++++++++++++------------
 1 file changed, 79 insertions(+), 38 deletions(-)

diff --git a/content/handlers/html/interaction.c 
b/content/handlers/html/interaction.c
index 930c795..f68426e 100644
--- a/content/handlers/html/interaction.c
+++ b/content/handlers/html/interaction.c
@@ -334,9 +334,16 @@ mouse_action_select_menu(html_content *html,
        const char *status;
        int width, height;
        struct hlcache_handle *bw_content;
+       browser_drag_type bw_drag_type;
 
        assert(html->visible_select_menu != NULL);
 
+       bw_drag_type = browser_window_get_drag_type(bw);
+       if (bw_drag_type != DRAGGING_NONE && !mouse) {
+               /* drag end: select menu */
+               form_select_mouse_drag_end(html->visible_select_menu, mouse, x, 
y);
+       }
+
        box = html->visible_select_menu->box;
        box_coords(box, &box_x, &box_y);
 
@@ -497,6 +504,62 @@ mouse_action_drag_scrollbar(html_content *html,
 }
 
 
+/**
+ * handle mouse actions while dragging in a text area
+ */
+static nserror
+mouse_action_drag_textarea(html_content *html,
+                           struct browser_window *bw,
+                           browser_mouse_state mouse,
+                           int x, int y)
+{
+       struct box *box;
+       int box_x = 0;
+       int box_y = 0;
+
+       box = html->drag_owner.textarea;
+
+       assert(box->gadget != NULL);
+       assert(box->gadget->type == GADGET_TEXTAREA ||
+              box->gadget->type == GADGET_PASSWORD ||
+              box->gadget->type == GADGET_TEXTBOX);
+
+       box_coords(box, &box_x, &box_y);
+       textarea_mouse_action(box->gadget->data.text.ta,
+                             mouse,
+                             x - box_x,
+                             y - box_y);
+
+       /* TODO: Set appropriate statusbar message */
+       return NSERROR_OK;
+}
+
+
+/**
+ * handle mouse actions while dragging in a content
+ */
+static nserror
+mouse_action_drag_content(html_content *html,
+                         struct browser_window *bw,
+                         browser_mouse_state mouse,
+                         int x, int y)
+{
+       struct box *box;
+       int box_x = 0;
+       int box_y = 0;
+
+       box = html->drag_owner.content;
+       assert(box->object != NULL);
+
+       box_coords(box, &box_x, &box_y);
+       content_mouse_track(box->object,
+                           bw, mouse,
+                           x - box_x,
+                           y - box_y);
+       return NSERROR_OK;
+}
+
+
 /* exported interface documented in html/interaction.h */
 nserror html_mouse_track(struct content *c,
                         struct browser_window *bw,
@@ -542,7 +605,6 @@ html_mouse_action(struct content *c,
        plot_font_style_t fstyle;
        int scroll_mouse_x = 0, scroll_mouse_y = 0;
        int padding_left, padding_right, padding_top, padding_bottom;
-       browser_drag_type drag_type = browser_window_get_drag_type(bw);
        union content_msg_data msg_data;
        struct dom_node *node = html->layout->node; /* Default to the <HTML> */
        union html_selection_owner sel_owner;
@@ -552,56 +614,35 @@ html_mouse_action(struct content *c,
 
        nserror res = NSERROR_OK;
 
-       if (drag_type != DRAGGING_NONE && !mouse &&
-                       html->visible_select_menu != NULL) {
-               /* drag end: select menu */
-               form_select_mouse_drag_end(html->visible_select_menu,
-                               mouse, x, y);
-       }
-
+       /* handle open select menu */
        if (html->visible_select_menu != NULL) {
                return mouse_action_select_menu(html, bw, mouse, x, y);
        }
 
-       if (html->drag_type == HTML_DRAG_SELECTION) {
+       /* handle content drag */
+       switch (html->drag_type) {
+       case HTML_DRAG_SELECTION:
                return mouse_action_drag_selection(html, bw, mouse, x, y);
-       }
 
-       if (html->drag_type == HTML_DRAG_SCROLLBAR) {
+       case HTML_DRAG_SCROLLBAR:
                return mouse_action_drag_scrollbar(html, bw, mouse, x, y);
 
-       }
-
-       if (html->drag_type == HTML_DRAG_TEXTAREA_SELECTION ||
-                       html->drag_type == HTML_DRAG_TEXTAREA_SCROLLBAR) {
-               box = html->drag_owner.textarea;
-               assert(box->gadget != NULL);
-               assert(box->gadget->type == GADGET_TEXTAREA ||
-                               box->gadget->type == GADGET_PASSWORD ||
-                               box->gadget->type == GADGET_TEXTBOX);
-
-               box_coords(box, &box_x, &box_y);
-               textarea_mouse_action(box->gadget->data.text.ta, mouse,
-                               x - box_x, y - box_y);
+       case HTML_DRAG_TEXTAREA_SELECTION:
+       case HTML_DRAG_TEXTAREA_SCROLLBAR:
+               return mouse_action_drag_textarea(html, bw, mouse, x, y);
 
-               /* TODO: Set appropriate statusbar message */
-               return NSERROR_OK;
-       }
+       case HTML_DRAG_CONTENT_SELECTION:
+       case HTML_DRAG_CONTENT_SCROLL:
+               return mouse_action_drag_content(html, bw, mouse, x, y);
 
-       if (html->drag_type == HTML_DRAG_CONTENT_SELECTION ||
-                       html->drag_type == HTML_DRAG_CONTENT_SCROLL) {
-               box = html->drag_owner.content;
-               assert(box->object != NULL);
+       case HTML_DRAG_NONE:
+               break;
 
-               box_coords(box, &box_x, &box_y);
-               content_mouse_track(box->object, bw, mouse,
-                               x - box_x, y - box_y);
-               return NSERROR_OK;
+       default:
+               /* Unknown content related drag type */
+               assert(0);
        }
 
-       /* Content related drags handled by now */
-       assert(html->drag_type == HTML_DRAG_NONE);
-
        /* search the box tree for a link, imagemap, form control, or
         * box with scrollbars
         */


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to