diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2011-05-09 22:49:17 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2011-05-09 22:49:17 +0000 |
commit | ac447fc293d791bf3155903d7755768f7a2b48ee (patch) | |
tree | 8d09d0e6228e9fbc1a834769e4553e816c643bb4 /render | |
parent | 5c95b32756affc5ce3ef88f919da4e3f801d776e (diff) | |
download | netsurf-ac447fc293d791bf3155903d7755768f7a2b48ee.tar.gz netsurf-ac447fc293d791bf3155903d7755768f7a2b48ee.tar.bz2 |
s/scroll/scrollbar/ and improve scrollbar widget comments.
svn path=/trunk/netsurf/; revision=12363
Diffstat (limited to 'render')
-rw-r--r-- | render/box.c | 66 | ||||
-rw-r--r-- | render/box.h | 4 | ||||
-rw-r--r-- | render/form.c | 48 | ||||
-rw-r--r-- | render/html.h | 6 | ||||
-rw-r--r-- | render/html_interaction.c | 86 | ||||
-rw-r--r-- | render/html_internal.h | 2 | ||||
-rw-r--r-- | render/html_redraw.c | 22 | ||||
-rw-r--r-- | render/layout.c | 2 |
8 files changed, 120 insertions, 116 deletions
diff --git a/render/box.c b/render/box.c index 537ea3674..67877147e 100644 --- a/render/box.c +++ b/render/box.c @@ -31,7 +31,7 @@ #include "content/hlcache.h" #include "css/css.h" #include "css/dump.h" -#include "desktop/scroll.h" +#include "desktop/scrollbar.h" #include "desktop/options.h" #include "render/box.h" #include "render/form.h" @@ -277,9 +277,9 @@ void box_free_box(struct box *box) if (box->gadget) form_free_control(box->gadget); if (box->scroll_x != NULL) - scroll_destroy(box->scroll_x); + scrollbar_destroy(box->scroll_x); if (box->scroll_y != NULL) - scroll_destroy(box->scroll_y); + scrollbar_destroy(box->scroll_y); if (box->styles != NULL) css_select_results_destroy(box->styles); } @@ -307,8 +307,8 @@ void box_coords(struct box *box, int *x, int *y) } while (!box->float_children); } else box = box->parent; - *x += box->x - scroll_get_offset(box->scroll_x); - *y += box->y - scroll_get_offset(box->scroll_y); + *x += box->x - scrollbar_get_offset(box->scroll_x); + *y += box->y - scrollbar_get_offset(box->scroll_y); } } @@ -388,9 +388,9 @@ struct box *box_at_point(struct box *box, const int x, const int y, for (child = box->float_children; child; child = child->next_float) { if (box_contains_point(child, x - bx, y - by, &physically)) { *box_x = bx + child->x - - scroll_get_offset(child->scroll_x); + scrollbar_get_offset(child->scroll_x); *box_y = by + child->y - - scroll_get_offset(child->scroll_y); + scrollbar_get_offset(child->scroll_y); if (physically) return child; @@ -407,9 +407,9 @@ non_float_children: continue; if (box_contains_point(child, x - bx, y - by, &physically)) { *box_x = bx + child->x - - scroll_get_offset(child->scroll_x); + scrollbar_get_offset(child->scroll_x); *box_y = by + child->y - - scroll_get_offset(child->scroll_y); + scrollbar_get_offset(child->scroll_y); if (physically) return child; @@ -433,17 +433,17 @@ siblings: /* siblings and siblings of ancestors */ while (box) { if (box_is_float(box)) { - bx -= box->x - scroll_get_offset(box->scroll_x); - by -= box->y - scroll_get_offset(box->scroll_y); + bx -= box->x - scrollbar_get_offset(box->scroll_x); + by -= box->y - scrollbar_get_offset(box->scroll_y); for (sibling = box->next_float; sibling; sibling = sibling->next_float) { if (box_contains_point(sibling, x - bx, y - by, &physically)) { *box_x = bx + sibling->x - - scroll_get_offset( + scrollbar_get_offset( sibling->scroll_x); *box_y = by + sibling->y - - scroll_get_offset( + scrollbar_get_offset( sibling->scroll_y); if (physically) @@ -463,8 +463,8 @@ siblings: goto non_float_children; } else { - bx -= box->x - scroll_get_offset(box->scroll_x); - by -= box->y - scroll_get_offset(box->scroll_y); + bx -= box->x - scrollbar_get_offset(box->scroll_x); + by -= box->y - scrollbar_get_offset(box->scroll_y); for (sibling = box->next; sibling; sibling = sibling->next) { if (box_is_float(sibling)) @@ -472,10 +472,10 @@ siblings: if (box_contains_point(sibling, x - bx, y - by, &physically)) { *box_x = bx + sibling->x - - scroll_get_offset( + scrollbar_get_offset( sibling->scroll_x); *box_y = by + sibling->y - - scroll_get_offset( + scrollbar_get_offset( sibling->scroll_y); if (physically) @@ -735,14 +735,14 @@ bool box_nearest_text_box(struct box *box, int bx, int by, if (child->type == BOX_FLOAT_LEFT || child->type == BOX_FLOAT_RIGHT) { c_bx = fx + child->x - - scroll_get_offset(child->scroll_x); + scrollbar_get_offset(child->scroll_x); c_by = fy + child->y - - scroll_get_offset(child->scroll_y); + scrollbar_get_offset(child->scroll_y); } else { c_bx = bx + child->x - - scroll_get_offset(child->scroll_x); + scrollbar_get_offset(child->scroll_x); c_by = by + child->y - - scroll_get_offset(child->scroll_y); + scrollbar_get_offset(child->scroll_y); } if (child->float_children) { c_fx = c_bx; @@ -1004,22 +1004,22 @@ void box_dump(FILE *stream, struct box *box, unsigned int depth) bool box_handle_scrollbars(struct browser_window *bw, struct box *box, bool bottom, bool right) { - struct browser_scroll_data *data; + struct browser_scrollbar_data *data; int padding_width, padding_height; padding_width = box->width + box->padding[RIGHT] + box->padding[LEFT]; padding_height = box->height + box->padding[TOP] + box->padding[BOTTOM]; if (!bottom && box->scroll_x != NULL) { - data = scroll_get_data(box->scroll_x); - scroll_destroy(box->scroll_x); + data = scrollbar_get_data(box->scroll_x); + scrollbar_destroy(box->scroll_x); free(data); box->scroll_x = NULL; } if (!right && box->scroll_y != NULL) { - data = scroll_get_data(box->scroll_y); - scroll_destroy(box->scroll_y); + data = scrollbar_get_data(box->scroll_y); + scrollbar_destroy(box->scroll_y); free(data); box->scroll_y = NULL; } @@ -1029,7 +1029,7 @@ bool box_handle_scrollbars(struct browser_window *bw, struct box *box, if (right) { if (box->scroll_y == NULL) { - data = malloc(sizeof(struct browser_scroll_data)); + data = malloc(sizeof(struct browser_scrollbar_data)); if (data == NULL) { LOG(("malloc failed")); warn_user("NoMemory", 0); @@ -1037,7 +1037,7 @@ bool box_handle_scrollbars(struct browser_window *bw, struct box *box, } data->bw = bw; data->box = box; - if (!scroll_create(false, + if (!scrollbar_create(false, padding_height, box->descendant_y1 - box->padding[TOP], box->height, @@ -1046,14 +1046,14 @@ bool box_handle_scrollbars(struct browser_window *bw, struct box *box, &(box->scroll_y))) return false; } else - scroll_set_extents(box->scroll_y, + scrollbar_set_extents(box->scroll_y, padding_height, box->height, box->descendant_y1 - box->padding[TOP]); } if (bottom) { if (box->scroll_x == NULL) { - data = malloc(sizeof(struct browser_scroll_data)); + data = malloc(sizeof(struct browser_scrollbar_data)); if (data == NULL) { LOG(("malloc failed")); warn_user("NoMemory", 0); @@ -1061,7 +1061,7 @@ bool box_handle_scrollbars(struct browser_window *bw, struct box *box, } data->bw = bw; data->box = box; - if (!scroll_create(true, + if (!scrollbar_create(true, padding_width - (right ? SCROLLBAR_WIDTH : 0), box->descendant_x1 - box->padding[LEFT], @@ -1071,7 +1071,7 @@ bool box_handle_scrollbars(struct browser_window *bw, struct box *box, &box->scroll_x)) return false; } else - scroll_set_extents(box->scroll_x, + scrollbar_set_extents(box->scroll_x, padding_width - (right ? SCROLLBAR_WIDTH : 0), box->width, @@ -1080,7 +1080,7 @@ bool box_handle_scrollbars(struct browser_window *bw, struct box *box, } if (right && bottom) - scroll_make_pair(box->scroll_x, box->scroll_y); + scrollbar_make_pair(box->scroll_x, box->scroll_y); return true; } diff --git a/render/box.h b/render/box.h index b5092728f..936c57337 100644 --- a/render/box.h +++ b/render/box.h @@ -191,8 +191,8 @@ struct box { int padding[4]; /**< Padding: TOP, RIGHT, BOTTOM, LEFT. */ struct box_border border[4]; /**< Border: TOP, RIGHT, BOTTOM, LEFT. */ - struct scroll *scroll_x; /**< Horizontal scroll. */ - struct scroll *scroll_y; /**< Vertical scroll. */ + struct scrollbar *scroll_x; /**< Horizontal scroll. */ + struct scrollbar *scroll_y; /**< Vertical scroll. */ /** Width of box taking all line breaks (including margins etc). Must * be non-negative. */ diff --git a/render/form.c b/render/form.c index 955c208e8..6a50581d1 100644 --- a/render/form.c +++ b/render/form.c @@ -41,7 +41,7 @@ #include "desktop/knockout.h" #include "desktop/plot_style.h" #include "desktop/plotters.h" -#include "desktop/scroll.h" +#include "desktop/scrollbar.h" #include "render/box.h" #include "render/font.h" #include "render/form.h" @@ -62,7 +62,7 @@ struct form_select_menu { int line_height; int width, height; - struct scroll *scroll; + struct scrollbar *scrollbar; int f_size; bool scroll_capture; select_menu_redraw_callback callback; @@ -90,7 +90,7 @@ static char *form_encode_item(const char *item, const char *charset, static void form_select_menu_clicked(struct form_control *control, int x, int y); static void form_select_menu_scroll_callback(void *client_data, - struct scroll_msg_data *scroll_data); + struct scrollbar_msg_data *scrollbar_data); /** * Create a struct form. @@ -932,13 +932,13 @@ bool form_open_select_menu(void *client_data, } menu->client_data = client_data; menu->callback = callback; - if (!scroll_create(false, + if (!scrollbar_create(false, menu->height, total_height, menu->height, control, form_select_menu_scroll_callback, - &(menu->scroll))) { + &(menu->scrollbar))) { free(menu); return false; } @@ -960,8 +960,8 @@ bool form_open_select_menu(void *client_data, */ void form_free_select_menu(struct form_control *control) { - if (control->data.select.menu->scroll != NULL) - scroll_destroy(control->data.select.menu->scroll); + if (control->data.select.menu->scrollbar != NULL) + scrollbar_destroy(control->data.select.menu->scrollbar); free(control->data.select.menu); control->data.select.menu = NULL; } @@ -1006,7 +1006,7 @@ bool form_redraw_select_menu(struct form_control *control, int x, int y, line_height_with_spacing = line_height + line_height * SELECT_LINE_SPACING; - scroll = scroll_get_offset(menu->scroll); + scroll = scrollbar_get_offset(menu->scrollbar); if (scale != 1.0) { x *= scale; @@ -1090,7 +1090,7 @@ bool form_redraw_select_menu(struct form_control *control, int x, int y, option = option->next; } - if (!scroll_redraw(menu->scroll, + if (!scrollbar_redraw(menu->scrollbar, x_cp + menu->width - SCROLLBAR_WIDTH, y_cp, clip, scale)) @@ -1148,7 +1148,7 @@ void form_select_menu_clicked(struct form_control *control, int x, int y) int item_bottom_y; int scroll, i; - scroll = scroll_get_offset(menu->scroll); + scroll = scrollbar_get_offset(menu->scrollbar); line_height = menu->line_height; line_height_with_spacing = line_height + @@ -1200,7 +1200,7 @@ const char *form_select_mouse_action(struct form_control *control, * event is taking place on the scrollbar widget area */ x -= scrollbar_x; - return scroll_mouse_action(menu->scroll, + return scrollbar_mouse_action(menu->scrollbar, mouse, x, y); } @@ -1255,7 +1255,7 @@ void form_select_mouse_drag_end(struct form_control *control, if (menu->scroll_capture) { x -= menu->width - SCROLLBAR_WIDTH; - scroll_mouse_drag_end(menu->scroll, mouse, x, y); + scrollbar_mouse_drag_end(menu->scrollbar, mouse, x, y); return; } @@ -1274,33 +1274,33 @@ void form_select_mouse_drag_end(struct form_control *control, * Callback for the select menus scroll */ void form_select_menu_scroll_callback(void *client_data, - struct scroll_msg_data *scroll_data) + struct scrollbar_msg_data *scrollbar_data) { struct form_control *control = client_data; struct form_select_menu *menu = control->data.select.menu; - switch (scroll_data->msg) { - case SCROLL_MSG_REDRAW: + switch (scrollbar_data->msg) { + case SCROLLBAR_MSG_REDRAW: menu->callback(menu->client_data, menu->width - - SCROLLBAR_WIDTH + scroll_data->x0, - scroll_data->y0, - scroll_data->x1 - scroll_data->x0, - scroll_data->y1 - scroll_data->y0); + SCROLLBAR_WIDTH + scrollbar_data->x0, + scrollbar_data->y0, + scrollbar_data->x1 - scrollbar_data->x0, + scrollbar_data->y1 - scrollbar_data->y0); break; - case SCROLL_MSG_MOVED: + case SCROLLBAR_MSG_MOVED: menu->callback(menu->client_data, 0, 0, menu->width - SCROLLBAR_WIDTH, menu->height); break; - case SCROLL_MSG_SCROLL_START: + case SCROLLBAR_MSG_SCROLL_START: menu->scroll_capture = true; gui_window_box_scroll_start(menu->bw->window, - scroll_data->x0, scroll_data->y0, - scroll_data->x1, scroll_data->y1); + scrollbar_data->x0, scrollbar_data->y0, + scrollbar_data->x1, scrollbar_data->y1); break; - case SCROLL_MSG_SCROLL_FINISHED: + case SCROLLBAR_MSG_SCROLL_FINISHED: menu->scroll_capture = false; break; default: diff --git a/render/html.h b/render/html.h index a321f5d48..9f4f3f698 100644 --- a/render/html.h +++ b/render/html.h @@ -42,8 +42,8 @@ struct http_parameter; struct imagemap; struct object_params; struct plotters; -struct scroll; -struct scroll_msg_data; +struct scrollbar; +struct scrollbar_msg_data; /** * Container for stylesheets used by an HTML document @@ -141,7 +141,7 @@ void html_fini(void); void html_redraw_a_box(struct hlcache_handle *h, struct box *box); -void html_overflow_scroll_drag_end(struct scroll *scroll, +void html_overflow_scroll_drag_end(struct scrollbar *scrollbar, browser_mouse_state mouse, int x, int y); size_t html_selection_drag_end(struct hlcache_handle *h, browser_mouse_state mouse, int x, int y, int dir); diff --git a/render/html_interaction.c b/render/html_interaction.c index 6670a1a90..ffef09ea6 100644 --- a/render/html_interaction.c +++ b/render/html_interaction.c @@ -31,7 +31,7 @@ #include "desktop/frames.h" #include "desktop/mouse.h" #include "desktop/options.h" -#include "desktop/scroll.h" +#include "desktop/scrollbar.h" #include "desktop/selection.h" #include "desktop/textinput.h" #include "render/box.h" @@ -137,7 +137,7 @@ void html_mouse_action(struct content *c, struct browser_window *bw, hlcache_handle *object = NULL; struct box *next_box; struct box *drag_candidate = NULL; - struct scroll *scroll = NULL; + struct scrollbar *scrollbar = NULL; plot_font_style_t fstyle; int scroll_mouse_x = 0, scroll_mouse_y = 0; int padding_left, padding_right, padding_top, padding_bottom; @@ -164,24 +164,25 @@ void html_mouse_action(struct content *c, struct browser_window *bw, } return; } - - if (bw->scroll != NULL) { - struct browser_scroll_data *data = scroll_get_data(bw->scroll); + + if (bw->scrollbar != NULL) { + struct browser_scrollbar_data *data = + scrollbar_get_data(bw->scrollbar); box = data->box; box_coords(box, &box_x, &box_y); - if (scroll_is_horizontal(bw->scroll)) { + if (scrollbar_is_horizontal(bw->scrollbar)) { scroll_mouse_x = x - box_x ; scroll_mouse_y = y - (box_y + box->padding[TOP] + box->height + box->padding[BOTTOM] - SCROLLBAR_WIDTH); - status = scroll_mouse_action(bw->scroll, mouse, + status = scrollbar_mouse_action(bw->scrollbar, mouse, scroll_mouse_x, scroll_mouse_y); } else { scroll_mouse_x = x - (box_x + box->padding[LEFT] + box->width + box->padding[RIGHT] - SCROLLBAR_WIDTH); scroll_mouse_y = y - box_y; - status = scroll_mouse_action(bw->scroll, mouse, + status = scrollbar_mouse_action(bw->scrollbar, mouse, scroll_mouse_x, scroll_mouse_y); } @@ -251,10 +252,12 @@ void html_mouse_action(struct content *c, struct browser_window *bw, drag_candidate = box; if (box->scroll_y != NULL || box->scroll_x != NULL) { - padding_left = box_x + scroll_get_offset(box->scroll_x); + padding_left = box_x + + scrollbar_get_offset(box->scroll_x); padding_right = padding_left + box->padding[LEFT] + box->width + box->padding[RIGHT]; - padding_top = box_y + scroll_get_offset(box->scroll_y); + padding_top = box_y + + scrollbar_get_offset(box->scroll_y); padding_bottom = padding_top + box->padding[TOP] + box->height + box->padding[BOTTOM]; @@ -266,7 +269,7 @@ void html_mouse_action(struct content *c, struct browser_window *bw, SCROLLBAR_WIDTH) { /* mouse above vertical box scroll */ - scroll = box->scroll_y; + scrollbar = box->scroll_y; scroll_mouse_x = x - (padding_right - SCROLLBAR_WIDTH); scroll_mouse_y = y - padding_top; @@ -277,7 +280,7 @@ void html_mouse_action(struct content *c, struct browser_window *bw, SCROLLBAR_WIDTH) { /* mouse above horizontal box scroll */ - scroll = box->scroll_x; + scrollbar = box->scroll_x; scroll_mouse_x = x - padding_left; scroll_mouse_y = y - (padding_bottom - SCROLLBAR_WIDTH); @@ -295,8 +298,8 @@ void html_mouse_action(struct content *c, struct browser_window *bw, /* use of box_x, box_y, or content below this point is probably a * mistake; they will refer to the last box returned by box_at_point */ - if (scroll) { - status = scroll_mouse_action(scroll, mouse, + if (scrollbar) { + status = scrollbar_mouse_action(scrollbar, mouse, scroll_mouse_x, scroll_mouse_y); pointer = GUI_POINTER_DEFAULT; } else if (gadget) { @@ -731,48 +734,49 @@ gui_pointer_shape get_pointer_shape(struct browser_window *bw, struct box *box, * Callback for in-page scrolls. */ void html_overflow_scroll_callback(void *client_data, - struct scroll_msg_data *scroll_data) + struct scrollbar_msg_data *scrollbar_data) { - struct browser_scroll_data *data = client_data; + struct browser_scrollbar_data *data = client_data; struct browser_window *bw = data->bw; struct box *box = data->box; int x, y, box_x, box_y, diff_x, diff_y; - switch(scroll_data->msg) { - case SCROLL_MSG_REDRAW: + switch(scrollbar_data->msg) { + case SCROLLBAR_MSG_REDRAW: diff_x = box->padding[LEFT] + box->width + box->padding[RIGHT] - SCROLLBAR_WIDTH; diff_y = box->padding[TOP] + box->height + box->padding[BOTTOM] - SCROLLBAR_WIDTH; box_coords(box, &box_x, &box_y); - if (scroll_is_horizontal(scroll_data->scroll)) { - x = box_x + scroll_get_offset(box->scroll_x); - y = box_y + scroll_get_offset(box->scroll_y) + + if (scrollbar_is_horizontal( + scrollbar_data->scrollbar)) { + x = box_x + scrollbar_get_offset(box->scroll_x); + y = box_y + scrollbar_get_offset(box->scroll_y) + diff_y; } else { - x = box_x + scroll_get_offset(box->scroll_x) + + x = box_x + scrollbar_get_offset(box->scroll_x) + diff_x; - y = box_y + scroll_get_offset(box->scroll_y); + y = box_y + scrollbar_get_offset(box->scroll_y); } browser_window_redraw_rect(bw, - x + scroll_data->x0, - y + scroll_data->y0, - scroll_data->x1 - scroll_data->x0, - scroll_data->y1 - scroll_data->y0); + x + scrollbar_data->x0, + y + scrollbar_data->y0, + scrollbar_data->x1 - scrollbar_data->x0, + scrollbar_data->y1 - scrollbar_data->y0); break; - case SCROLL_MSG_MOVED: + case SCROLLBAR_MSG_MOVED: html_redraw_a_box(bw->current_content, box); break; - case SCROLL_MSG_SCROLL_START: - bw->scroll = scroll_data->scroll; + case SCROLLBAR_MSG_SCROLL_START: + bw->scrollbar = scrollbar_data->scrollbar; gui_window_box_scroll_start(bw->window, - scroll_data->x0, scroll_data->y0, - scroll_data->x1, scroll_data->y1); + scrollbar_data->x0, scrollbar_data->y0, + scrollbar_data->x1, scrollbar_data->y1); break; - case SCROLL_MSG_SCROLL_FINISHED: - bw->scroll = NULL; + case SCROLLBAR_MSG_SCROLL_FINISHED: + bw->scrollbar = NULL; browser_window_set_pointer(bw->window, GUI_POINTER_DEFAULT); @@ -789,29 +793,29 @@ void html_overflow_scroll_callback(void *client_data, * \param x coordinate of mouse * \param y coordinate of mouse */ -void html_overflow_scroll_drag_end(struct scroll *scroll, +void html_overflow_scroll_drag_end(struct scrollbar *scrollbar, browser_mouse_state mouse, int x, int y) { int scroll_mouse_x, scroll_mouse_y, box_x, box_y; - struct browser_scroll_data *data = scroll_get_data(scroll); + struct browser_scrollbar_data *data = scrollbar_get_data(scrollbar); struct box *box; box = data->box; box_coords(box, &box_x, &box_y); - if (scroll_is_horizontal(scroll)) { + if (scrollbar_is_horizontal(scrollbar)) { scroll_mouse_x = x - box_x; scroll_mouse_y = y - (box_y + box->padding[TOP] + box->height + box->padding[BOTTOM] - SCROLLBAR_WIDTH); - scroll_mouse_drag_end(scroll, mouse, + scrollbar_mouse_drag_end(scrollbar, mouse, scroll_mouse_x, scroll_mouse_y); } else { scroll_mouse_x = x - (box_x + box->padding[LEFT] + box->width + box->padding[RIGHT] - SCROLLBAR_WIDTH); scroll_mouse_y = y - box_y; - scroll_mouse_drag_end(scroll, mouse, + scrollbar_mouse_drag_end(scrollbar, mouse, scroll_mouse_x, scroll_mouse_y); } } @@ -868,7 +872,7 @@ void html_box_drag_start(struct box *box, int x, int y) scroll_mouse_y = y - (box_y + box->padding[TOP] + box->height + box->padding[BOTTOM] - SCROLLBAR_WIDTH); - scroll_start_content_drag(box->scroll_x, + scrollbar_start_content_drag(box->scroll_x, scroll_mouse_x, scroll_mouse_y); } else if (box->scroll_y != NULL) { scroll_mouse_x = x - (box_x + box->padding[LEFT] + @@ -876,7 +880,7 @@ void html_box_drag_start(struct box *box, int x, int y) SCROLLBAR_WIDTH); scroll_mouse_y = y - box_y; - scroll_start_content_drag(box->scroll_y, + scrollbar_start_content_drag(box->scroll_y, scroll_mouse_x, scroll_mouse_y); } } diff --git a/render/html_internal.h b/render/html_internal.h index dd04edb77..cbb323844 100644 --- a/render/html_internal.h +++ b/render/html_internal.h @@ -106,7 +106,7 @@ void html_mouse_track(struct content *c, struct browser_window *bw, void html_mouse_action(struct content *c, struct browser_window *bw, browser_mouse_state mouse, int x, int y); void html_overflow_scroll_callback(void *client_data, - struct scroll_msg_data *scroll_data); + struct scrollbar_msg_data *scrollbar_data); #endif diff --git a/render/html_redraw.c b/render/html_redraw.c index 2d1a78559..df8fd8d41 100644 --- a/render/html_redraw.c +++ b/render/html_redraw.c @@ -42,7 +42,7 @@ #include "desktop/options.h" #include "desktop/print.h" #include "desktop/search.h" -#include "desktop/scroll.h" +#include "desktop/scrollbar.h" #include "image/bitmap.h" #include "render/box.h" #include "render/font.h" @@ -650,8 +650,8 @@ bool html_redraw_box(struct box *box, int x_parent, int y_parent, return false; if (box->object && width != 0 && height != 0) { - x_scrolled = x - scroll_get_offset(box->scroll_x) * scale; - y_scrolled = y - scroll_get_offset(box->scroll_y) * scale; + x_scrolled = x - scrollbar_get_offset(box->scroll_x) * scale; + y_scrolled = y - scrollbar_get_offset(box->scroll_y) * scale; if (!content_redraw(box->object, x_scrolled + padding_left, y_scrolled + padding_top, @@ -693,9 +693,9 @@ bool html_redraw_box(struct box *box, int x_parent, int y_parent, if (box->list_marker) if (!html_redraw_box(box->list_marker, x_parent + box->x - - scroll_get_offset(box->scroll_x), + scrollbar_get_offset(box->scroll_x), y_parent + box->y - - scroll_get_offset(box->scroll_y), + scrollbar_get_offset(box->scroll_y), clip, scale, current_background_color)) return false; @@ -716,13 +716,13 @@ bool html_redraw_box(struct box *box, int x_parent, int y_parent, return false; if (box->scroll_x != NULL) - scroll_redraw(box->scroll_x, + scrollbar_redraw(box->scroll_x, x_parent + box->x, y_parent + box->y + box->padding[TOP] + box->height + box->padding[BOTTOM] - SCROLLBAR_WIDTH, clip, scale); if (box->scroll_y != NULL) - scroll_redraw(box->scroll_y, + scrollbar_redraw(box->scroll_y, x_parent + box->x + box->padding[LEFT] + box->width + box->padding[RIGHT] - SCROLLBAR_WIDTH, @@ -761,18 +761,18 @@ bool html_redraw_box_children(struct box *box, int x_parent, int y_parent, if (c->type != BOX_FLOAT_LEFT && c->type != BOX_FLOAT_RIGHT) if (!html_redraw_box(c, x_parent + box->x - - scroll_get_offset(box->scroll_x), + scrollbar_get_offset(box->scroll_x), y_parent + box->y - - scroll_get_offset(box->scroll_y), + scrollbar_get_offset(box->scroll_y), clip, scale, current_background_color)) return false; } for (c = box->float_children; c; c = c->next_float) if (!html_redraw_box(c, x_parent + box->x - - scroll_get_offset(box->scroll_x), + scrollbar_get_offset(box->scroll_x), y_parent + box->y - - scroll_get_offset(box->scroll_y), + scrollbar_get_offset(box->scroll_y), clip, scale, current_background_color)) return false; diff --git a/render/layout.c b/render/layout.c index b46930b21..a347b1632 100644 --- a/render/layout.c +++ b/render/layout.c @@ -45,7 +45,7 @@ #include "content/content_protected.h" #include "desktop/gui.h" #include "desktop/options.h" -#include "desktop/scroll.h" +#include "desktop/scrollbar.h" #include "render/box.h" #include "render/font.h" #include "render/form.h" |