mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-22 10:22:06 +03:00
Remove gui_multitask
svn path=/trunk/netsurf/; revision=12828
This commit is contained in:
parent
0cf35ff730
commit
f27d5a3e15
16
amiga/gui.c
16
amiga/gui.c
@ -1972,17 +1972,6 @@ void ami_get_msg(void)
|
||||
}
|
||||
}
|
||||
|
||||
void gui_multitask(void)
|
||||
{
|
||||
/* This seems a bit topsy-turvy to me, but in this function, NetSurf is doing
|
||||
stuff and we need to poll for user events */
|
||||
|
||||
ami_handle_msg();
|
||||
ami_handle_appmsg();
|
||||
ami_handle_applib();
|
||||
ami_arexx_handle();
|
||||
}
|
||||
|
||||
void gui_poll(bool active)
|
||||
{
|
||||
/* However, down here we are waiting for the user to do something or for a
|
||||
@ -1994,7 +1983,10 @@ void gui_poll(bool active)
|
||||
|
||||
if(active)
|
||||
{
|
||||
gui_multitask();
|
||||
ami_handle_msg();
|
||||
ami_handle_appmsg();
|
||||
ami_handle_applib();
|
||||
ami_arexx_handle();
|
||||
schedule_run(TRUE);
|
||||
}
|
||||
else
|
||||
|
@ -248,8 +248,6 @@ nserror gui_download_window_data(struct gui_download_window *dw,
|
||||
fwrite( data , size, sizeof(unsigned char),dw->fd );
|
||||
dw->size_downloaded += size;
|
||||
|
||||
gui_multitask();
|
||||
|
||||
/* Update the progress bar... */
|
||||
if( tnow - dw->lastrdw > 1 ) {
|
||||
dw->lastrdw = tnow;
|
||||
@ -316,4 +314,4 @@ void gui_download_window_done(struct gui_download_window *dw)
|
||||
if( (tree[DOWNLOAD_CB_CLOSE_RDY].ob_state & SELECTED) != 0 ) {
|
||||
ApplWrite( _AESapid, WM_CLOSED, dw->form->handle, 0,0,0,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -104,14 +104,6 @@ const char * cfg_homepage_url;
|
||||
|
||||
extern GEM_PLOTTER plotter;
|
||||
|
||||
void gui_multitask(void)
|
||||
{
|
||||
short winloc[4];
|
||||
short mx, my, dummy, aestop;
|
||||
int flags = MU_MESAG | MU_KEYBD | MU_BUTTON | MU_TIMER;
|
||||
evnt.timer = 0;
|
||||
EvntWindom( flags );
|
||||
}
|
||||
|
||||
void gui_poll(bool active)
|
||||
{
|
||||
|
@ -91,7 +91,6 @@ void gui_init(int argc, char** argv);
|
||||
// enable using resources instead of files
|
||||
#define USE_RESOURCES 1
|
||||
|
||||
bool gui_in_multitask = false;
|
||||
bool replicated = false; /**< if we are running as a replicant */
|
||||
|
||||
char *default_stylesheet_url;
|
||||
@ -759,17 +758,6 @@ void gui_poll(bool active)
|
||||
}
|
||||
|
||||
|
||||
void gui_multitask(void)
|
||||
{
|
||||
gui_in_multitask = true;
|
||||
#if 0 /* GTK */
|
||||
while (beos_events_pending())
|
||||
beos_main_iteration();
|
||||
#endif
|
||||
gui_in_multitask = false;
|
||||
}
|
||||
|
||||
|
||||
void gui_quit(void)
|
||||
{
|
||||
CALLED();
|
||||
|
@ -29,7 +29,6 @@
|
||||
|
||||
#define CALLED() fprintf(stderr, "%s()\n", __FUNCTION__);
|
||||
|
||||
extern bool gui_in_multitask;
|
||||
extern bool replicated;
|
||||
|
||||
#if 0 /* GTK */
|
||||
|
@ -57,11 +57,6 @@ char* gui_get_resource_url(const char *filename)
|
||||
return strdup( [[[NSURL fileURLWithPath: path] absoluteString] UTF8String] );
|
||||
}
|
||||
|
||||
void gui_multitask(void)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
void gui_poll(bool active)
|
||||
{
|
||||
cocoa_autorelease();
|
||||
|
@ -71,7 +71,6 @@ typedef enum { GUI_POINTER_DEFAULT, GUI_POINTER_POINT, GUI_POINTER_CARET,
|
||||
#include <stdio.h>
|
||||
bool nslog_ensure(FILE *fptr);
|
||||
|
||||
void gui_multitask(void);
|
||||
void gui_poll(bool active);
|
||||
void gui_quit(void);
|
||||
|
||||
|
@ -528,13 +528,6 @@ main(int argc, char** argv)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gui_multitask(void)
|
||||
{
|
||||
/* LOG(("gui_multitask")); */
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gui_poll(bool active)
|
||||
{
|
||||
|
@ -563,13 +563,6 @@ void gui_poll(bool active)
|
||||
}
|
||||
|
||||
|
||||
void gui_multitask(void)
|
||||
{
|
||||
while (gtk_events_pending())
|
||||
gtk_main_iteration();
|
||||
}
|
||||
|
||||
|
||||
void gui_quit(void)
|
||||
{
|
||||
nsgtk_download_destroy();
|
||||
|
@ -158,8 +158,3 @@ gui_poll(bool active)
|
||||
monkey_window_process_reformats();
|
||||
}
|
||||
|
||||
|
||||
void gui_multitask(void)
|
||||
{
|
||||
g_main_context_iteration(g_main_context_default(), false);
|
||||
}
|
||||
|
@ -38,12 +38,10 @@
|
||||
#include "css/css.h"
|
||||
#include "css/utils.h"
|
||||
#include "css/select.h"
|
||||
#include "desktop/browser.h"
|
||||
#include "desktop/options.h"
|
||||
#include "render/box.h"
|
||||
#include "render/form.h"
|
||||
#include "render/html_internal.h"
|
||||
#include "desktop/gui.h"
|
||||
#include "utils/locale.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
@ -257,8 +255,6 @@ bool box_construct_element(xmlNode *n, html_content *content,
|
||||
assert(parent);
|
||||
assert(inline_container);
|
||||
|
||||
gui_multitask();
|
||||
|
||||
/* In case the parent is a pre block, we clear the
|
||||
* PRE_STRIP flag since it is not used if we
|
||||
* follow the pre with a tag
|
||||
|
@ -30,7 +30,6 @@
|
||||
#include "render/box.h"
|
||||
#include "render/html_internal.h"
|
||||
#include "render/table.h"
|
||||
#include "desktop/gui.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/talloc.h"
|
||||
|
||||
@ -114,8 +113,6 @@ bool box_normalise_block(struct box *block, html_content *c)
|
||||
assert(block->type == BOX_BLOCK || block->type == BOX_INLINE_BLOCK ||
|
||||
block->type == BOX_TABLE_CELL);
|
||||
|
||||
gui_multitask();
|
||||
|
||||
for (child = block->children; child != NULL; child = next_child) {
|
||||
#ifdef BOX_NORMALISE_DEBUG
|
||||
LOG(("child %p, child->type = %d", child, child->type));
|
||||
|
@ -32,7 +32,6 @@
|
||||
#include "content/fetch.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "desktop/browser.h"
|
||||
#include "desktop/gui.h"
|
||||
#include "desktop/options.h"
|
||||
#include "desktop/selection.h"
|
||||
#include "image/bitmap.h"
|
||||
@ -301,36 +300,16 @@ error:
|
||||
|
||||
/**
|
||||
* Process data for CONTENT_HTML.
|
||||
*
|
||||
* The data is parsed in chunks of size CHUNK, multitasking in between.
|
||||
*/
|
||||
|
||||
bool html_process_data(struct content *c, const char *data, unsigned int size)
|
||||
{
|
||||
html_content *html = (html_content *) c;
|
||||
unsigned long x;
|
||||
binding_error err;
|
||||
const char *encoding;
|
||||
|
||||
for (x = 0; x + CHUNK <= size; x += CHUNK) {
|
||||
err = binding_parse_chunk(html->parser_binding,
|
||||
(const uint8_t *) data + x, CHUNK);
|
||||
if (err == BINDING_ENCODINGCHANGE) {
|
||||
goto encoding_change;
|
||||
} else if (err != BINDING_OK) {
|
||||
union content_msg_data msg_data;
|
||||
|
||||
msg_data.error = messages_get("NoMemory");
|
||||
content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
gui_multitask();
|
||||
}
|
||||
|
||||
err = binding_parse_chunk(html->parser_binding,
|
||||
(const uint8_t *) data + x, (size - x));
|
||||
(const uint8_t *) data, size);
|
||||
if (err == BINDING_ENCODINGCHANGE) {
|
||||
goto encoding_change;
|
||||
} else if (err != BINDING_OK) {
|
||||
@ -404,8 +383,8 @@ encoding_change:
|
||||
|
||||
source_data = content__get_source_data(c, &source_size);
|
||||
|
||||
/* Recurse to reprocess all that data. This is safe because
|
||||
* the encoding is now specified at parser-start which means
|
||||
/* Recurse to reprocess all the data. This is safe because
|
||||
* the encoding is now specified at parser start which means
|
||||
* it cannot be changed again. */
|
||||
return html_process_data(c, source_data, source_size);
|
||||
}
|
||||
@ -1731,26 +1710,6 @@ void html_stop(struct content *c)
|
||||
|
||||
switch (c->status) {
|
||||
case CONTENT_STATUS_LOADING:
|
||||
/* Clean up objects if we were stopped after queuing up some
|
||||
* fetches within xml_to_box (i.e. gui_multitask is somewhere
|
||||
* in our call stack) */
|
||||
for (object = htmlc->object_list; object != NULL;
|
||||
object = object->next) {
|
||||
if (object->content == NULL)
|
||||
continue;
|
||||
|
||||
/* If there's a content already associated with our
|
||||
* handle, something's gone very wrong */
|
||||
assert(content_get_status(object->content) ==
|
||||
CONTENT_STATUS_ERROR);
|
||||
|
||||
hlcache_handle_abort(object->content);
|
||||
hlcache_handle_release(object->content);
|
||||
object->content = NULL;
|
||||
|
||||
c->active--;
|
||||
}
|
||||
|
||||
/* Still loading; simply flag that we've been aborted
|
||||
* html_convert/html_finish_conversion will do the rest */
|
||||
htmlc->aborted = true;
|
||||
|
@ -43,7 +43,6 @@
|
||||
#include "css/css.h"
|
||||
#include "css/utils.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "desktop/gui.h"
|
||||
#include "desktop/options.h"
|
||||
#include "desktop/scrollbar.h"
|
||||
#include "render/box.h"
|
||||
@ -220,45 +219,6 @@ bool layout_block_context(struct box *block, int viewport_height,
|
||||
assert(block->width != UNKNOWN_WIDTH);
|
||||
assert(block->width != AUTO);
|
||||
|
||||
#ifdef riscos
|
||||
/* Why the ifdef? You don't really want to know. If you do, read on.
|
||||
*
|
||||
* So, the only way into this function is through the rest of the
|
||||
* layout code. The only external entry points into the layout code
|
||||
* are layout_document and layout_inline_container. The latter is only
|
||||
* ever called when editing text in form textareas, so we can ignore it
|
||||
* for the purposes of this discussion.
|
||||
*
|
||||
* layout_document is only ever called from html_reformat, which itself
|
||||
* is only ever called from content_reformat. content_reformat locks
|
||||
* the content structure while reformatting is taking place.
|
||||
*
|
||||
* If we call gui_multitask here, then any pending UI events will get
|
||||
* processed. This includes window expose/redraw events. Upon receipt
|
||||
* of these events, the UI code will call content_redraw for the
|
||||
* window's content. content_redraw will return immediately if the
|
||||
* content is currently locked (which it will be if we're still doing
|
||||
* layout).
|
||||
*
|
||||
* On RISC OS, this isn't a problem as the UI code's window redraw
|
||||
* handler explicitly checks for locked contents and does nothing
|
||||
* in that case. This effectively means that the window contents
|
||||
* aren't updated, so whatever's already in the window will remain
|
||||
* on-screen. On GTK, however, redraw is not direct-to-screen, but
|
||||
* to a pixmap which is then blitted to screen. If we perform no
|
||||
* redraw, then the pixmap will be flat white. When this is
|
||||
* subsequently blitted, the user gets greeted with an unsightly
|
||||
* flicker to white (and then back to the document when the content
|
||||
* is redrawn when unlocked).
|
||||
*
|
||||
* In the long term, this upcall into the GUI event dispatch code needs
|
||||
* to disappear. It needs to remain for the timebeing, however, as
|
||||
* document reflow can be fairly time consuming and we need to remain
|
||||
* responsive to user input.
|
||||
*/
|
||||
gui_multitask();
|
||||
#endif
|
||||
|
||||
block->float_children = NULL;
|
||||
block->clear_level = 0;
|
||||
|
||||
|
24
riscos/gui.c
24
riscos/gui.c
@ -1080,30 +1080,6 @@ void ro_gui_handle_event(wimp_event_no event, wimp_block *block)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check for important events and yield CPU (RISC OS).
|
||||
*
|
||||
* Required on RISC OS for cooperative multitasking.
|
||||
*/
|
||||
|
||||
void gui_multitask(void)
|
||||
{
|
||||
wimp_event_no event;
|
||||
wimp_block block;
|
||||
|
||||
if (clock() < gui_last_poll + 10)
|
||||
return;
|
||||
|
||||
xhourglass_off();
|
||||
event = wimp_poll(wimp_MASK_LOSE | wimp_MASK_GAIN | wimp_SAVE_FP,
|
||||
&block, 0);
|
||||
xhourglass_on();
|
||||
gui_last_poll = clock();
|
||||
|
||||
ro_gui_handle_event(event, &block);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Handle Null_Reason_Code events.
|
||||
*/
|
||||
|
@ -72,11 +72,6 @@ static const char windowclassname_main[] = "nswsmainwindow";
|
||||
|
||||
static struct nsws_pointers nsws_pointer;
|
||||
|
||||
void gui_multitask(void)
|
||||
{
|
||||
/* LOG(("gui_multitask")); */
|
||||
}
|
||||
|
||||
void gui_poll(bool active)
|
||||
{
|
||||
MSG Msg; /* message from system */
|
||||
|
Loading…
Reference in New Issue
Block a user