mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-26 16:29:36 +03:00
[project @ 2003-09-17 12:57:33 by bursa]
Poll queuing fix, backup redraw code. svn path=/import/netsurf/; revision=296
This commit is contained in:
parent
d0d3e96cbb
commit
763f186705
@ -8,6 +8,7 @@
|
||||
#ifndef _NETSURF_DESKTOP_FETCHCACHE_H_
|
||||
#define _NETSURF_DESKTOP_FETCHCACHE_H_
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "netsurf/content/content.h"
|
||||
|
||||
struct content * fetchcache(const char *url, char *referer,
|
||||
|
@ -152,8 +152,16 @@ void font_close(struct font_data *data)
|
||||
char * font_split(struct font_data *data, const char * text, unsigned int length,
|
||||
unsigned int width, unsigned int *used_width)
|
||||
{
|
||||
*used_width = width;
|
||||
int i = width / 10;
|
||||
|
||||
return text + (width / 10);
|
||||
if (length < i) {
|
||||
*used_width = length * 10;
|
||||
return text + length;
|
||||
}
|
||||
|
||||
for (; i != 0 && text[i] != ' '; i--)
|
||||
;
|
||||
*used_width = i * 10;
|
||||
return text + i;
|
||||
}
|
||||
|
||||
|
@ -131,10 +131,13 @@ int html_convert(struct content *c, unsigned int width, unsigned int height)
|
||||
c->width = c->data.html.layout->children->width;
|
||||
c->height = c->data.html.layout->children->height;
|
||||
|
||||
if (c->active == 0)
|
||||
if (c->active == 0) {
|
||||
c->status = CONTENT_STATUS_DONE;
|
||||
else
|
||||
sprintf(c->status_message, "Document done");
|
||||
} else {
|
||||
c->status = CONTENT_STATUS_READY;
|
||||
sprintf(c->status_message, "Fetching %u objects", c->active);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
72
riscos/gui.c
72
riscos/gui.c
@ -330,7 +330,7 @@ void ro_gui_toolbar_redraw(gui_window* g, wimp_draw* redraw)
|
||||
wimp_get_icon_state(&throbber);
|
||||
|
||||
throbber.icon.flags = wimp_ICON_SPRITE;
|
||||
sprintf(throbber.icon.data.sprite, "throbber%d", g->throbber);
|
||||
snprintf(throbber.icon.data.sprite, 12, "throbber%d", g->throbber);
|
||||
|
||||
more = wimp_redraw_window(redraw);
|
||||
while (more)
|
||||
@ -1172,8 +1172,8 @@ void ro_gui_poll_queue(wimp_event_no event, wimp_block* block)
|
||||
struct ro_gui_poll_block* q = xcalloc(1, sizeof(struct ro_gui_poll_block));
|
||||
|
||||
q->event = event;
|
||||
q->block = xcalloc(1, sizeof(block));
|
||||
memcpy(q->block, block, sizeof(block));
|
||||
q->block = xcalloc(1, sizeof(*block));
|
||||
memcpy(q->block, block, sizeof(*block));
|
||||
q->next = NULL;
|
||||
|
||||
if (ro_gui_poll_queued_blocks == NULL)
|
||||
@ -1213,21 +1213,24 @@ void gui_multitask(void)
|
||||
break;
|
||||
|
||||
case wimp_REDRAW_WINDOW_REQUEST :
|
||||
if (block.redraw.w == dialog_config_th)
|
||||
ro_gui_redraw_config_th(&block.redraw);
|
||||
else
|
||||
{
|
||||
g = ro_lookup_gui_from_w(block.redraw.w);
|
||||
if (g != NULL)
|
||||
ro_gui_window_redraw(g, &(block.redraw));
|
||||
else
|
||||
{
|
||||
g = ro_lookup_gui_toolbar_from_w(block.redraw.w);
|
||||
if (g != NULL)
|
||||
ro_gui_toolbar_redraw(g, &(block.redraw));
|
||||
}
|
||||
}
|
||||
break;
|
||||
if (block.redraw.w == dialog_config_th)
|
||||
ro_gui_redraw_config_th(&block.redraw);
|
||||
else {
|
||||
g = ro_lookup_gui_from_w(block.redraw.w);
|
||||
if (g)
|
||||
ro_gui_window_redraw(g, &(block.redraw));
|
||||
else {
|
||||
g = ro_lookup_gui_toolbar_from_w(block.redraw.w);
|
||||
if (g)
|
||||
ro_gui_toolbar_redraw(g, &(block.redraw));
|
||||
else {
|
||||
osbool more = wimp_redraw_window(&block.redraw);
|
||||
while (more)
|
||||
more = wimp_get_rectangle(&block.redraw);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case wimp_OPEN_WINDOW_REQUEST :
|
||||
g = ro_lookup_gui_from_w(block.open.w);
|
||||
@ -1475,21 +1478,24 @@ void gui_poll(void)
|
||||
break;
|
||||
|
||||
case wimp_REDRAW_WINDOW_REQUEST :
|
||||
if (block.redraw.w == dialog_config_th)
|
||||
ro_gui_redraw_config_th(&block.redraw);
|
||||
else
|
||||
{
|
||||
g = ro_lookup_gui_from_w(block.redraw.w);
|
||||
if (g != NULL)
|
||||
ro_gui_window_redraw(g, &(block.redraw));
|
||||
else
|
||||
{
|
||||
g = ro_lookup_gui_toolbar_from_w(block.redraw.w);
|
||||
if (g != NULL)
|
||||
ro_gui_toolbar_redraw(g, &(block.redraw));
|
||||
}
|
||||
}
|
||||
break;
|
||||
if (block.redraw.w == dialog_config_th)
|
||||
ro_gui_redraw_config_th(&block.redraw);
|
||||
else {
|
||||
g = ro_lookup_gui_from_w(block.redraw.w);
|
||||
if (g != NULL)
|
||||
ro_gui_window_redraw(g, &(block.redraw));
|
||||
else {
|
||||
g = ro_lookup_gui_toolbar_from_w(block.redraw.w);
|
||||
if (g != NULL) {
|
||||
ro_gui_toolbar_redraw(g, &(block.redraw));
|
||||
} else {
|
||||
osbool more = wimp_redraw_window(&block.redraw);
|
||||
while (more)
|
||||
more = wimp_get_rectangle(&block.redraw);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case wimp_OPEN_WINDOW_REQUEST :
|
||||
g = ro_lookup_gui_from_w(block.open.w);
|
||||
|
Loading…
Reference in New Issue
Block a user