mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-02-26 19:34:25 +03:00
Simplify and tidy up RISC OS gui_ functions. Fix toolbar height changing issues for framesets.
svn path=/trunk/netsurf/; revision=2924
This commit is contained in:
parent
d5540f344d
commit
3e0c02e8e5
@ -263,7 +263,7 @@ void browser_window_recalculate_iframes(struct browser_window *bw) {
|
|||||||
assert(bw);
|
assert(bw);
|
||||||
|
|
||||||
/* update window dimensions */
|
/* update window dimensions */
|
||||||
gui_window_get_dimensions(bw->window, &bw_width, &bw_height);
|
gui_window_get_dimensions(bw->window, &bw_width, &bw_height, false);
|
||||||
if (!bw->parent) {
|
if (!bw->parent) {
|
||||||
bw->x0 = 0;
|
bw->x0 = 0;
|
||||||
bw->y0 = 0;
|
bw->y0 = 0;
|
||||||
@ -383,7 +383,7 @@ void browser_window_recalculate_frameset(struct browser_window *bw) {
|
|||||||
|
|
||||||
/* window dimensions */
|
/* window dimensions */
|
||||||
if (!bw->parent) {
|
if (!bw->parent) {
|
||||||
gui_window_get_dimensions(bw->window, &bw_width, &bw_height);
|
gui_window_get_dimensions(bw->window, &bw_width, &bw_height, false);
|
||||||
bw->x0 = 0;
|
bw->x0 = 0;
|
||||||
bw->y0 = 0;
|
bw->y0 = 0;
|
||||||
bw->x1 = bw_width;
|
bw->x1 = bw_width;
|
||||||
@ -751,6 +751,7 @@ void browser_window_go_post(struct browser_window *bw, const char *url,
|
|||||||
char url_buf[256];
|
char url_buf[256];
|
||||||
int depth = 0;
|
int depth = 0;
|
||||||
struct browser_window *cur;
|
struct browser_window *cur;
|
||||||
|
int width, height;
|
||||||
|
|
||||||
LOG(("bw %p, url %s", bw, url));
|
LOG(("bw %p, url %s", bw, url));
|
||||||
assert(bw);
|
assert(bw);
|
||||||
@ -810,13 +811,13 @@ void browser_window_go_post(struct browser_window *bw, const char *url,
|
|||||||
browser_window_remove_caret(bw);
|
browser_window_remove_caret(bw);
|
||||||
browser_window_destroy_children(bw);
|
browser_window_destroy_children(bw);
|
||||||
|
|
||||||
|
gui_window_get_dimensions(bw->window, &width, &height, true);
|
||||||
|
|
||||||
browser_window_set_status(bw, messages_get("Loading"));
|
browser_window_set_status(bw, messages_get("Loading"));
|
||||||
bw->history_add = history_add;
|
bw->history_add = history_add;
|
||||||
bw->time0 = clock();
|
bw->time0 = clock();
|
||||||
c = fetchcache(url2, browser_window_callback, (intptr_t) bw, 0,
|
c = fetchcache(url2, browser_window_callback, (intptr_t) bw, 0,
|
||||||
gui_window_get_width(bw->window),
|
width, height, false,
|
||||||
gui_window_get_height(bw->window),
|
|
||||||
false,
|
|
||||||
post_urlenc, post_multipart, true, download);
|
post_urlenc, post_multipart, true, download);
|
||||||
free(url2);
|
free(url2);
|
||||||
if (!c) {
|
if (!c) {
|
||||||
@ -835,9 +836,7 @@ void browser_window_go_post(struct browser_window *bw, const char *url,
|
|||||||
|
|
||||||
bw->download = download;
|
bw->download = download;
|
||||||
fetchcache_go(c, option_send_referer ? referer : 0,
|
fetchcache_go(c, option_send_referer ? referer : 0,
|
||||||
browser_window_callback, (intptr_t) bw, 0,
|
browser_window_callback, (intptr_t) bw, 0, width, height,
|
||||||
gui_window_get_width(bw->window),
|
|
||||||
gui_window_get_height(bw->window),
|
|
||||||
post_urlenc, post_multipart, true);
|
post_urlenc, post_multipart, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,9 +67,8 @@ void gui_window_scroll_visible(struct gui_window *g, int x0, int y0,
|
|||||||
int x1, int y1);
|
int x1, int y1);
|
||||||
void gui_window_position_frame(struct gui_window *g, int x0, int y0,
|
void gui_window_position_frame(struct gui_window *g, int x0, int y0,
|
||||||
int x1, int y1);
|
int x1, int y1);
|
||||||
void gui_window_get_dimensions(struct gui_window *g, int *width, int *height);
|
void gui_window_get_dimensions(struct gui_window *g, int *width, int *height,
|
||||||
int gui_window_get_width(struct gui_window *g);
|
bool scaled);
|
||||||
int gui_window_get_height(struct gui_window *g);
|
|
||||||
void gui_window_update_extent(struct gui_window *g);
|
void gui_window_update_extent(struct gui_window *g);
|
||||||
void gui_window_set_status(struct gui_window *g, const char *text);
|
void gui_window_set_status(struct gui_window *g, const char *text);
|
||||||
void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape);
|
void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape);
|
||||||
@ -83,8 +82,8 @@ void gui_window_new_content(struct gui_window *g);
|
|||||||
bool gui_window_scroll_start(struct gui_window *g);
|
bool gui_window_scroll_start(struct gui_window *g);
|
||||||
bool gui_window_box_scroll_start(struct gui_window *g,
|
bool gui_window_box_scroll_start(struct gui_window *g,
|
||||||
int x0, int y0, int x1, int y1);
|
int x0, int y0, int x1, int y1);
|
||||||
void gui_window_save_as_link(struct gui_window *g, struct content *c);
|
|
||||||
bool gui_window_frame_resize_start(struct gui_window *g);
|
bool gui_window_frame_resize_start(struct gui_window *g);
|
||||||
|
void gui_window_save_as_link(struct gui_window *g, struct content *c);
|
||||||
|
|
||||||
struct gui_download_window *gui_download_window_create(const char *url,
|
struct gui_download_window *gui_download_window_create(const char *url,
|
||||||
const char *mime_type, struct fetch *fetch,
|
const char *mime_type, struct fetch *fetch,
|
||||||
|
@ -137,7 +137,6 @@ void ro_gui_cert_open(struct tree *tree, struct node *node);
|
|||||||
/* in window.c */
|
/* in window.c */
|
||||||
void ro_gui_window_quit(void);
|
void ro_gui_window_quit(void);
|
||||||
void ro_gui_window_update_theme(void);
|
void ro_gui_window_update_theme(void);
|
||||||
void ro_gui_window_update_dimensions(struct gui_window *g, int yscroll);
|
|
||||||
void ro_gui_window_mouse_at(struct gui_window *g, wimp_pointer *pointer);
|
void ro_gui_window_mouse_at(struct gui_window *g, wimp_pointer *pointer);
|
||||||
bool ro_gui_toolbar_click(wimp_pointer *pointer);
|
bool ro_gui_toolbar_click(wimp_pointer *pointer);
|
||||||
bool ro_gui_status_click(wimp_pointer *pointer);
|
bool ro_gui_status_click(wimp_pointer *pointer);
|
||||||
@ -146,9 +145,8 @@ struct gui_window *ro_gui_window_lookup(wimp_w window);
|
|||||||
struct gui_window *ro_gui_toolbar_lookup(wimp_w window);
|
struct gui_window *ro_gui_toolbar_lookup(wimp_w window);
|
||||||
struct gui_window *ro_gui_status_lookup(wimp_w window);
|
struct gui_window *ro_gui_status_lookup(wimp_w window);
|
||||||
void ro_gui_scroll_request(wimp_scroll *scroll);
|
void ro_gui_scroll_request(wimp_scroll *scroll);
|
||||||
int window_x_units(int x, wimp_window_state *state);
|
bool ro_gui_window_to_window_pos(struct gui_window *g, int x, int y, os_coord *pos);
|
||||||
int window_y_units(int y, wimp_window_state *state);
|
bool ro_gui_window_to_screen_pos(struct gui_window *g, int x, int y, os_coord *pos);
|
||||||
bool window_screen_pos(struct gui_window *g, int x, int y, os_coord *pos);
|
|
||||||
bool ro_gui_window_dataload(struct gui_window *g, wimp_message *message);
|
bool ro_gui_window_dataload(struct gui_window *g, wimp_message *message);
|
||||||
bool ro_gui_toolbar_dataload(struct gui_window *g, wimp_message *message);
|
bool ro_gui_toolbar_dataload(struct gui_window *g, wimp_message *message);
|
||||||
void ro_gui_window_process_reformats(void);
|
void ro_gui_window_process_reformats(void);
|
||||||
|
@ -447,10 +447,9 @@ void ro_gui_menu_init(void)
|
|||||||
* Display a menu.
|
* Display a menu.
|
||||||
*/
|
*/
|
||||||
void ro_gui_menu_create(wimp_menu *menu, int x, int y, wimp_w w) {
|
void ro_gui_menu_create(wimp_menu *menu, int x, int y, wimp_w w) {
|
||||||
int doc_x, doc_y;
|
|
||||||
wimp_window_state state;
|
|
||||||
struct gui_window *g;
|
struct gui_window *g;
|
||||||
os_error *error;
|
os_error *error;
|
||||||
|
os_coord pos;
|
||||||
int i;
|
int i;
|
||||||
menu_action action;
|
menu_action action;
|
||||||
struct menu_definition *definition;
|
struct menu_definition *definition;
|
||||||
@ -467,26 +466,14 @@ void ro_gui_menu_create(wimp_menu *menu, int x, int y, wimp_w w) {
|
|||||||
|
|
||||||
/* read the object under the pointer for a new gui_window menu */
|
/* read the object under the pointer for a new gui_window menu */
|
||||||
if ((!current_menu) && (menu == browser_menu)) {
|
if ((!current_menu) && (menu == browser_menu)) {
|
||||||
state.w = w;
|
|
||||||
error = xwimp_get_window_state(&state);
|
|
||||||
if (error) {
|
|
||||||
LOG(("xwimp_get_window_state: 0x%x: %s",
|
|
||||||
error->errnum, error->errmess));
|
|
||||||
warn_user("WimpError", error->errmess);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
g = ro_gui_window_lookup(w);
|
g = ro_gui_window_lookup(w);
|
||||||
assert(g);
|
|
||||||
|
if (!ro_gui_window_to_window_pos(g, x, y, &pos))
|
||||||
doc_x = window_x_units(x, &state) / 2 / g->option.scale;
|
return;
|
||||||
doc_y = -window_y_units(y, &state) / 2 / g->option.scale;
|
|
||||||
|
|
||||||
current_menu_object_box = NULL;
|
current_menu_object_box = NULL;
|
||||||
if (g->bw->current_content &&
|
if (g->bw->current_content &&
|
||||||
g->bw->current_content->type == CONTENT_HTML)
|
g->bw->current_content->type == CONTENT_HTML)
|
||||||
current_menu_object_box = box_object_at_point(
|
current_menu_object_box = box_object_at_point(g->bw->current_content, pos.x, pos.y);
|
||||||
g->bw->current_content, doc_x, doc_y);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* store the menu characteristics */
|
/* store the menu characteristics */
|
||||||
@ -776,17 +763,13 @@ void ro_gui_menu_warning(wimp_message_menu_warning *warning) {
|
|||||||
* \param toolbar the toolbar to update
|
* \param toolbar the toolbar to update
|
||||||
*/
|
*/
|
||||||
void ro_gui_menu_refresh_toolbar(struct toolbar *toolbar) {
|
void ro_gui_menu_refresh_toolbar(struct toolbar *toolbar) {
|
||||||
int height;
|
|
||||||
|
|
||||||
assert(toolbar);
|
assert(toolbar);
|
||||||
|
|
||||||
toolbar->reformat_buttons = true;
|
toolbar->reformat_buttons = true;
|
||||||
height = toolbar->height;
|
|
||||||
ro_gui_theme_process_toolbar(toolbar, -1);
|
ro_gui_theme_process_toolbar(toolbar, -1);
|
||||||
if (toolbar->type == THEME_BROWSER_TOOLBAR) {
|
if (toolbar->type == THEME_BROWSER_TOOLBAR) {
|
||||||
ro_gui_window_update_dimensions(
|
gui_window_update_extent(ro_gui_window_lookup(current_menu_window));
|
||||||
ro_gui_window_lookup(current_menu_window),
|
|
||||||
height - toolbar->height);
|
|
||||||
} else if (toolbar->type == THEME_HOTLIST_TOOLBAR) {
|
} else if (toolbar->type == THEME_HOTLIST_TOOLBAR) {
|
||||||
tree_resized(hotlist_tree);
|
tree_resized(hotlist_tree);
|
||||||
xwimp_force_redraw((wimp_w)hotlist_tree->handle,
|
xwimp_force_redraw((wimp_w)hotlist_tree->handle,
|
||||||
@ -795,6 +778,10 @@ void ro_gui_menu_refresh_toolbar(struct toolbar *toolbar) {
|
|||||||
tree_resized(global_history_tree);
|
tree_resized(global_history_tree);
|
||||||
xwimp_force_redraw((wimp_w)global_history_tree->handle,
|
xwimp_force_redraw((wimp_w)global_history_tree->handle,
|
||||||
0,-16384, 16384, 16384);
|
0,-16384, 16384, 16384);
|
||||||
|
} else if (toolbar->type == THEME_COOKIES_TOOLBAR) {
|
||||||
|
tree_resized(cookies_tree);
|
||||||
|
xwimp_force_redraw((wimp_w)cookies_tree->handle,
|
||||||
|
0,-16384, 16384, 16384);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,10 +137,9 @@ void gui_start_selection(struct gui_window *g)
|
|||||||
void ro_gui_selection_drag_end(struct gui_window *g, wimp_dragged *drag)
|
void ro_gui_selection_drag_end(struct gui_window *g, wimp_dragged *drag)
|
||||||
{
|
{
|
||||||
wimp_auto_scroll_info scroll;
|
wimp_auto_scroll_info scroll;
|
||||||
wimp_window_state state;
|
|
||||||
wimp_pointer pointer;
|
wimp_pointer pointer;
|
||||||
os_error *error;
|
os_error *error;
|
||||||
int x, y;
|
os_coord pos;
|
||||||
|
|
||||||
LOG(("ending text selection drag"));
|
LOG(("ending text selection drag"));
|
||||||
|
|
||||||
@ -167,20 +166,10 @@ void ro_gui_selection_drag_end(struct gui_window *g, wimp_dragged *drag)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
state.w = g->window;
|
if (ro_gui_window_to_window_pos(g, drag->final.x0, drag->final.y0, &pos))
|
||||||
error = xwimp_get_window_state(&state);
|
browser_window_mouse_drag_end(g->bw,
|
||||||
if (error) {
|
ro_gui_mouse_click_state(pointer.buttons),
|
||||||
LOG(("xwimp_get_window_state 0x%x : %s",
|
pos.x, pos.y);
|
||||||
error->errnum, error->errmess));
|
|
||||||
warn_user("WimpError", error->errmess);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
x = window_x_units(drag->final.x0, &state) / 2 / g->option.scale;
|
|
||||||
y = -window_y_units(drag->final.y0, &state) / 2 / g->option.scale;
|
|
||||||
|
|
||||||
browser_window_mouse_drag_end(g->bw,
|
|
||||||
ro_gui_mouse_click_state(pointer.buttons), x, y);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -369,7 +358,7 @@ void gui_paste_from_clipboard(struct gui_window *g, int x, int y)
|
|||||||
os_error *error;
|
os_error *error;
|
||||||
os_coord pos;
|
os_coord pos;
|
||||||
|
|
||||||
if (!window_screen_pos(g, x, y, &pos))
|
if (!ro_gui_window_to_screen_pos(g, x, y, &pos))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
msg.size = sizeof(msg);
|
msg.size = sizeof(msg);
|
||||||
@ -510,15 +499,13 @@ void ro_gui_selection_dragging(wimp_message *message)
|
|||||||
struct box *textarea = NULL;
|
struct box *textarea = NULL;
|
||||||
struct box *text_box = NULL;
|
struct box *text_box = NULL;
|
||||||
struct browser_window *bw;
|
struct browser_window *bw;
|
||||||
wimp_window_state state;
|
|
||||||
struct content *content;
|
struct content *content;
|
||||||
int gadget_box_x = 0;
|
int gadget_box_x = 0;
|
||||||
int gadget_box_y = 0;
|
int gadget_box_y = 0;
|
||||||
struct gui_window *g;
|
struct gui_window *g;
|
||||||
os_error *error;
|
os_coord pos;
|
||||||
int box_x = 0;
|
int box_x = 0;
|
||||||
int box_y = 0;
|
int box_y = 0;
|
||||||
int x, y;
|
|
||||||
|
|
||||||
/* with autoscrolling, we will probably need to remember the gui_window and
|
/* with autoscrolling, we will probably need to remember the gui_window and
|
||||||
override the drag->w window handle which could be any window on the desktop */
|
override the drag->w window handle which could be any window on the desktop */
|
||||||
@ -535,20 +522,8 @@ void ro_gui_selection_dragging(wimp_message *message)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
state.w = drag->w;
|
if (!ro_gui_window_to_window_pos(g, drag->pos.x, drag->pos.y, &pos))
|
||||||
error = xwimp_get_window_state(&state);
|
|
||||||
if (error) {
|
|
||||||
LOG(("xwimp_get_window_state: 0x%x: %s\n",
|
|
||||||
error->errnum, error->errmess));
|
|
||||||
warn_user("WimpError", error->errmess);
|
|
||||||
drag_claimed = false;
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
x = window_x_units(drag->pos.x, &state) / 2 /
|
|
||||||
g->option.scale;
|
|
||||||
y = -window_y_units(drag->pos.y, &state) / 2 /
|
|
||||||
g->option.scale;
|
|
||||||
|
|
||||||
bw = g->bw;
|
bw = g->bw;
|
||||||
content = bw->current_content;
|
content = bw->current_content;
|
||||||
@ -557,7 +532,7 @@ void ro_gui_selection_dragging(wimp_message *message)
|
|||||||
|
|
||||||
struct box *box = content->data.html.layout;
|
struct box *box = content->data.html.layout;
|
||||||
|
|
||||||
while ((box = box_at_point(box, x, y, &box_x, &box_y, &content))) {
|
while ((box = box_at_point(box, pos.x, pos.y, &box_x, &box_y, &content))) {
|
||||||
if (box->style &&
|
if (box->style &&
|
||||||
box->style->visibility == CSS_VISIBILITY_HIDDEN)
|
box->style->visibility == CSS_VISIBILITY_HIDDEN)
|
||||||
continue;
|
continue;
|
||||||
@ -591,8 +566,8 @@ void ro_gui_selection_dragging(wimp_message *message)
|
|||||||
else
|
else
|
||||||
gui_window_set_pointer(g, GUI_POINTER_CARET);
|
gui_window_set_pointer(g, GUI_POINTER_CARET);
|
||||||
|
|
||||||
text_box = textarea_get_position(textarea, x - gadget_box_x,
|
text_box = textarea_get_position(textarea, pos.x - gadget_box_x,
|
||||||
y - gadget_box_y, &char_offset, &pixel_offset);
|
pos.y - gadget_box_y, &char_offset, &pixel_offset);
|
||||||
|
|
||||||
caret_set_position(&ghost_caret, bw, text_box, char_offset, pixel_offset);
|
caret_set_position(&ghost_caret, bw, text_box, char_offset, pixel_offset);
|
||||||
drag_claimed = true;
|
drag_claimed = true;
|
||||||
|
@ -568,6 +568,9 @@ bool ro_gui_theme_apply(struct theme_descriptor *descriptor) {
|
|||||||
|
|
||||||
/* apply the theme to all the current windows */
|
/* apply the theme to all the current windows */
|
||||||
ro_gui_window_update_theme();
|
ro_gui_window_update_theme();
|
||||||
|
ro_gui_tree_update_theme(hotlist_tree);
|
||||||
|
ro_gui_tree_update_theme(global_history_tree);
|
||||||
|
ro_gui_tree_update_theme(cookies_tree);
|
||||||
ro_gui_theme_close(theme_previous, false);
|
ro_gui_theme_close(theme_previous, false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -833,6 +836,7 @@ struct toolbar *ro_gui_theme_create_toolbar(struct theme_descriptor *descriptor,
|
|||||||
ro_gui_theme_destroy_toolbar(toolbar);
|
ro_gui_theme_destroy_toolbar(toolbar);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
toolbar->old_height = ro_gui_theme_toolbar_full_height(toolbar);
|
||||||
return toolbar;
|
return toolbar;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1751,7 +1755,6 @@ void ro_gui_theme_destroy_toolbar(struct toolbar *toolbar) {
|
|||||||
* \param toolbar the toolbar to toggle editing for
|
* \param toolbar the toolbar to toggle editing for
|
||||||
*/
|
*/
|
||||||
void ro_gui_theme_toggle_edit(struct toolbar *toolbar) {
|
void ro_gui_theme_toggle_edit(struct toolbar *toolbar) {
|
||||||
int height;
|
|
||||||
int icons = 0;
|
int icons = 0;
|
||||||
struct toolbar_icon *icon;
|
struct toolbar_icon *icon;
|
||||||
struct gui_window *g = NULL;
|
struct gui_window *g = NULL;
|
||||||
@ -1812,14 +1815,13 @@ void ro_gui_theme_toggle_edit(struct toolbar *toolbar) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* turn off editing */
|
/* turn off editing */
|
||||||
height = toolbar->editor->height;
|
|
||||||
ro_gui_theme_destroy_toolbar(toolbar->editor);
|
ro_gui_theme_destroy_toolbar(toolbar->editor);
|
||||||
toolbar->editor = NULL;
|
toolbar->editor = NULL;
|
||||||
ro_gui_theme_update_toolbar(toolbar->descriptor, toolbar);
|
ro_gui_theme_update_toolbar(toolbar->descriptor, toolbar);
|
||||||
switch (toolbar->type) {
|
switch (toolbar->type) {
|
||||||
case THEME_BROWSER_TOOLBAR:
|
case THEME_BROWSER_TOOLBAR:
|
||||||
if (g)
|
if (g)
|
||||||
ro_gui_window_update_dimensions(g, height);
|
gui_window_update_extent(g);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (toolbar->parent_handle)
|
if (toolbar->parent_handle)
|
||||||
@ -1863,8 +1865,7 @@ void ro_gui_theme_toggle_edit(struct toolbar *toolbar) {
|
|||||||
switch (toolbar->type) {
|
switch (toolbar->type) {
|
||||||
case THEME_BROWSER_TOOLBAR:
|
case THEME_BROWSER_TOOLBAR:
|
||||||
if (g)
|
if (g)
|
||||||
ro_gui_window_update_dimensions(g,
|
gui_window_update_extent(g);
|
||||||
-toolbar->editor->height);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (toolbar->parent_handle) {
|
if (toolbar->parent_handle) {
|
||||||
@ -2426,3 +2427,12 @@ void ro_gui_theme_status_open(wimp_open *open) {
|
|||||||
if (toolbar->status_width > 10000) toolbar->status_width = 10000;
|
if (toolbar->status_width > 10000) toolbar->status_width = 10000;
|
||||||
ro_gui_theme_process_toolbar(toolbar, -1);
|
ro_gui_theme_process_toolbar(toolbar, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ro_gui_theme_height_change(struct toolbar *toolbar) {
|
||||||
|
int height, cur_height;
|
||||||
|
|
||||||
|
cur_height = ro_gui_theme_toolbar_full_height(toolbar);
|
||||||
|
height = toolbar->old_height - cur_height;
|
||||||
|
toolbar->old_height = cur_height;
|
||||||
|
return height;
|
||||||
|
}
|
||||||
|
@ -108,6 +108,7 @@ struct toolbar {
|
|||||||
int toolbar_current; /**< the size of the toolbar window in OS units */
|
int toolbar_current; /**< the size of the toolbar window in OS units */
|
||||||
int height; /**< vertical extent of the toolbar (read only) */
|
int height; /**< vertical extent of the toolbar (read only) */
|
||||||
int max_height; /**< allowed vertical extent (read only) */
|
int max_height; /**< allowed vertical extent (read only) */
|
||||||
|
int old_height; /**< height on last test (read only) */
|
||||||
wimp_w toolbar_handle; /**< toolbar window handle */
|
wimp_w toolbar_handle; /**< toolbar window handle */
|
||||||
wimp_w status_handle; /**< status window handle (if applicable) */
|
wimp_w status_handle; /**< status window handle (if applicable) */
|
||||||
wimp_w parent_handle; /**< parent window handle (read only) */
|
wimp_w parent_handle; /**< parent window handle (read only) */
|
||||||
@ -162,6 +163,8 @@ void ro_gui_theme_toolbar_editor_sync(struct toolbar *toolbar);
|
|||||||
void ro_gui_theme_toolbar_editor_click(struct toolbar *toolbar, wimp_pointer *pointer);
|
void ro_gui_theme_toolbar_editor_click(struct toolbar *toolbar, wimp_pointer *pointer);
|
||||||
void ro_gui_theme_toolbar_editor_drag_end(wimp_dragged *drag);
|
void ro_gui_theme_toolbar_editor_drag_end(wimp_dragged *drag);
|
||||||
|
|
||||||
|
int ro_gui_theme_height_change(struct toolbar *toolbar);
|
||||||
|
|
||||||
struct toolbar_icon *ro_gui_theme_toolbar_get_icon(struct toolbar *toolbar, int x, int y);
|
struct toolbar_icon *ro_gui_theme_toolbar_get_icon(struct toolbar *toolbar, int x, int y);
|
||||||
|
|
||||||
#define ro_gui_theme_toolbar_height(toolbar) toolbar->height + \
|
#define ro_gui_theme_toolbar_height(toolbar) toolbar->height + \
|
||||||
|
@ -1490,3 +1490,20 @@ bool ro_gui_tree_launch_node(struct tree *tree, struct node *node) {
|
|||||||
int ro_gui_tree_help(int x, int y) {
|
int ro_gui_tree_help(int x, int y) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ro_gui_tree_update_theme(struct tree *tree) {
|
||||||
|
if ((tree) && (tree->toolbar)) {
|
||||||
|
if (tree->toolbar->editor)
|
||||||
|
if (!ro_gui_theme_update_toolbar(NULL, tree->toolbar->editor))
|
||||||
|
tree->toolbar->editor = NULL;
|
||||||
|
if (!ro_gui_theme_update_toolbar(NULL, tree->toolbar)) {
|
||||||
|
ro_gui_theme_destroy_toolbar(tree->toolbar);
|
||||||
|
tree->toolbar = NULL;
|
||||||
|
}
|
||||||
|
ro_gui_theme_toolbar_editor_sync(tree->toolbar);
|
||||||
|
ro_gui_theme_attach_toolbar(tree->toolbar, (wimp_w)tree->handle);
|
||||||
|
tree_resized(tree);
|
||||||
|
xwimp_force_redraw((wimp_w)tree->handle, 0, -16384, 16384, 16384);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -45,5 +45,6 @@ void ro_gui_tree_scroll_visible(struct tree *tree, struct node_element *element)
|
|||||||
void ro_gui_tree_get_tree_coordinates(struct tree *tree, int x, int y,
|
void ro_gui_tree_get_tree_coordinates(struct tree *tree, int x, int y,
|
||||||
int *tree_x, int *tree_y);
|
int *tree_x, int *tree_y);
|
||||||
int ro_gui_tree_help(int x, int y);
|
int ro_gui_tree_help(int x, int y);
|
||||||
|
void ro_gui_tree_update_theme(struct tree *tree);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
2064
riscos/window.c
2064
riscos/window.c
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user